diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 50b58264..816f3d86 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -2,16 +2,16 @@ # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions name: Python application -defaults: - run: +defaults: + run: shell: bash working-directory: ./delivery - + on: push: - branches: [ master ] + branches: [ urubu ] pull_request: - branches: [ master ] + branches: [ urubu ] jobs: build: @@ -26,12 +26,12 @@ jobs: python-version: 3.8 - name: Install dependencies run: | - make install + make install + + run: Database Migrations + make init_db - - name: Database Migrations - run: | - make init_db - - name: Run tests run: | - make test + make test + diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 0440fa37..00000000 --- a/.gitignore +++ /dev/null @@ -1,132 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -pip-wheel-metadata/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -.python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# db -delivery/delivery/delivery.db diff --git a/.venv/.gitignore b/.venv/.gitignore new file mode 100644 index 00000000..ec16b98a --- /dev/null +++ b/.venv/.gitignore @@ -0,0 +1,3 @@ +# created by virtualenv automatically + + diff --git a/.venv/bin/activate b/.venv/bin/activate new file mode 100644 index 00000000..3540d782 --- /dev/null +++ b/.venv/bin/activate @@ -0,0 +1,84 @@ +# This file must be used with "source bin/activate" *from bash* +# you cannot run it directly + + +if [ "${BASH_SOURCE-}" = "$0" ]; then + echo "You must source this script: \$ source $0" >&2 + exit 33 +fi + +deactivate () { + unset -f pydoc >/dev/null 2>&1 + + # reset old environment variables + # ! [ -z ${VAR+_} ] returns true if VAR is declared at all + if ! [ -z "${_OLD_VIRTUAL_PATH:+_}" ] ; then + PATH="$_OLD_VIRTUAL_PATH" + export PATH + unset _OLD_VIRTUAL_PATH + fi + if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then + PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME" + export PYTHONHOME + unset _OLD_VIRTUAL_PYTHONHOME + fi + + # This should detect bash and zsh, which have a hash command that must + # be called to get it to forget past commands. Without forgetting + # past commands the $PATH changes we made may not be respected + if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then + hash -r 2>/dev/null + fi + + if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then + PS1="$_OLD_VIRTUAL_PS1" + export PS1 + unset _OLD_VIRTUAL_PS1 + fi + + unset VIRTUAL_ENV + if [ ! "${1-}" = "nondestructive" ] ; then + # Self destruct! + unset -f deactivate + fi +} + +# unset irrelevant variables +deactivate nondestructive + +VIRTUAL_ENV='/home/sandrormio/curso-flask/.venv' +export VIRTUAL_ENV + +_OLD_VIRTUAL_PATH="$PATH" +PATH="$VIRTUAL_ENV/bin:$PATH" +export PATH + +# unset PYTHONHOME if set +if ! [ -z "${PYTHONHOME+_}" ] ; then + _OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME" + unset PYTHONHOME +fi + +if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then + _OLD_VIRTUAL_PS1="${PS1-}" + if [ "x" != x ] ; then + PS1="${PS1-}" + else + PS1="(`basename \"$VIRTUAL_ENV\"`) ${PS1-}" + fi + export PS1 +fi + +# Make sure to unalias pydoc if it's already there +alias pydoc 2>/dev/null >/dev/null && unalias pydoc || true + +pydoc () { + python -m pydoc "$@" +} + +# This should detect bash and zsh, which have a hash command that must +# be called to get it to forget past commands. Without forgetting +# past commands the $PATH changes we made may not be respected +if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then + hash -r 2>/dev/null +fi diff --git a/.venv/bin/activate.csh b/.venv/bin/activate.csh new file mode 100644 index 00000000..bb8c68b2 --- /dev/null +++ b/.venv/bin/activate.csh @@ -0,0 +1,55 @@ +# This file must be used with "source bin/activate.csh" *from csh*. +# You cannot run it directly. +# Created by Davide Di Blasi . + +set newline='\ +' + +alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH:q" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT:q" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate && unalias pydoc' + +# Unset irrelevant variables. +deactivate nondestructive + +setenv VIRTUAL_ENV '/home/sandrormio/curso-flask/.venv' + +set _OLD_VIRTUAL_PATH="$PATH:q" +setenv PATH "$VIRTUAL_ENV:q/bin:$PATH:q" + + + +if ('' != "") then + set env_name = '' +else + set env_name = '('"$VIRTUAL_ENV:t:q"') ' +endif + +if ( $?VIRTUAL_ENV_DISABLE_PROMPT ) then + if ( $VIRTUAL_ENV_DISABLE_PROMPT == "" ) then + set do_prompt = "1" + else + set do_prompt = "0" + endif +else + set do_prompt = "1" +endif + +if ( $do_prompt == "1" ) then + # Could be in a non-interactive environment, + # in which case, $prompt is undefined and we wouldn't + # care about the prompt anyway. + if ( $?prompt ) then + set _OLD_VIRTUAL_PROMPT="$prompt:q" + if ( "$prompt:q" =~ *"$newline:q"* ) then + : + else + set prompt = "$env_name:q$prompt:q" + endif + endif +endif + +unset env_name +unset do_prompt + +alias pydoc python -m pydoc + +rehash diff --git a/.venv/bin/activate.fish b/.venv/bin/activate.fish new file mode 100644 index 00000000..55d7a3e8 --- /dev/null +++ b/.venv/bin/activate.fish @@ -0,0 +1,100 @@ +# This file must be used using `source bin/activate.fish` *within a running fish ( http://fishshell.com ) session*. +# Do not run it directly. + +function _bashify_path -d "Converts a fish path to something bash can recognize" + set fishy_path $argv + set bashy_path $fishy_path[1] + for path_part in $fishy_path[2..-1] + set bashy_path "$bashy_path:$path_part" + end + echo $bashy_path +end + +function _fishify_path -d "Converts a bash path to something fish can recognize" + echo $argv | tr ':' '\n' +end + +function deactivate -d 'Exit virtualenv mode and return to the normal environment.' + # reset old environment variables + if test -n "$_OLD_VIRTUAL_PATH" + # https://github.com/fish-shell/fish-shell/issues/436 altered PATH handling + if test (echo $FISH_VERSION | head -c 1) -lt 3 + set -gx PATH (_fishify_path "$_OLD_VIRTUAL_PATH") + else + set -gx PATH "$_OLD_VIRTUAL_PATH" + end + set -e _OLD_VIRTUAL_PATH + end + + if test -n "$_OLD_VIRTUAL_PYTHONHOME" + set -gx PYTHONHOME "$_OLD_VIRTUAL_PYTHONHOME" + set -e _OLD_VIRTUAL_PYTHONHOME + end + + if test -n "$_OLD_FISH_PROMPT_OVERRIDE" + and functions -q _old_fish_prompt + # Set an empty local `$fish_function_path` to allow the removal of `fish_prompt` using `functions -e`. + set -l fish_function_path + + # Erase virtualenv's `fish_prompt` and restore the original. + functions -e fish_prompt + functions -c _old_fish_prompt fish_prompt + functions -e _old_fish_prompt + set -e _OLD_FISH_PROMPT_OVERRIDE + end + + set -e VIRTUAL_ENV + + if test "$argv[1]" != 'nondestructive' + # Self-destruct! + functions -e pydoc + functions -e deactivate + functions -e _bashify_path + functions -e _fishify_path + end +end + +# Unset irrelevant variables. +deactivate nondestructive + +set -gx VIRTUAL_ENV '/home/sandrormio/curso-flask/.venv' + +# https://github.com/fish-shell/fish-shell/issues/436 altered PATH handling +if test (echo $FISH_VERSION | head -c 1) -lt 3 + set -gx _OLD_VIRTUAL_PATH (_bashify_path $PATH) +else + set -gx _OLD_VIRTUAL_PATH "$PATH" +end +set -gx PATH "$VIRTUAL_ENV"'/bin' $PATH + +# Unset `$PYTHONHOME` if set. +if set -q PYTHONHOME + set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME + set -e PYTHONHOME +end + +function pydoc + python -m pydoc $argv +end + +if test -z "$VIRTUAL_ENV_DISABLE_PROMPT" + # Copy the current `fish_prompt` function as `_old_fish_prompt`. + functions -c fish_prompt _old_fish_prompt + + function fish_prompt + # Run the user's prompt first; it might depend on (pipe)status. + set -l prompt (_old_fish_prompt) + + # Prompt override provided? + # If not, just prepend the environment name. + if test -n '' + printf '%s%s' '' (set_color normal) + else + printf '%s(%s) ' (set_color normal) (basename "$VIRTUAL_ENV") + end + + string join -- \n $prompt # handle multi-line prompts + end + + set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV" +end diff --git a/.venv/bin/activate.ps1 b/.venv/bin/activate.ps1 new file mode 100644 index 00000000..95504d39 --- /dev/null +++ b/.venv/bin/activate.ps1 @@ -0,0 +1,60 @@ +$script:THIS_PATH = $myinvocation.mycommand.path +$script:BASE_DIR = Split-Path (Resolve-Path "$THIS_PATH/..") -Parent + +function global:deactivate([switch] $NonDestructive) { + if (Test-Path variable:_OLD_VIRTUAL_PATH) { + $env:PATH = $variable:_OLD_VIRTUAL_PATH + Remove-Variable "_OLD_VIRTUAL_PATH" -Scope global + } + + if (Test-Path function:_old_virtual_prompt) { + $function:prompt = $function:_old_virtual_prompt + Remove-Item function:\_old_virtual_prompt + } + + if ($env:VIRTUAL_ENV) { + Remove-Item env:VIRTUAL_ENV -ErrorAction SilentlyContinue + } + + if (!$NonDestructive) { + # Self destruct! + Remove-Item function:deactivate + Remove-Item function:pydoc + } +} + +function global:pydoc { + python -m pydoc $args +} + +# unset irrelevant variables +deactivate -nondestructive + +$VIRTUAL_ENV = $BASE_DIR +$env:VIRTUAL_ENV = $VIRTUAL_ENV + +New-Variable -Scope global -Name _OLD_VIRTUAL_PATH -Value $env:PATH + +$env:PATH = "$env:VIRTUAL_ENV/bin:" + $env:PATH +if (!$env:VIRTUAL_ENV_DISABLE_PROMPT) { + function global:_old_virtual_prompt { + "" + } + $function:_old_virtual_prompt = $function:prompt + + if ("" -ne "") { + function global:prompt { + # Add the custom prefix to the existing prompt + $previous_prompt_value = & $function:_old_virtual_prompt + ("" + $previous_prompt_value) + } + } + else { + function global:prompt { + # Add a prefix to the current prompt, but don't discard it. + $previous_prompt_value = & $function:_old_virtual_prompt + $new_prompt_value = "($( Split-Path $env:VIRTUAL_ENV -Leaf )) " + ($new_prompt_value + $previous_prompt_value) + } + } +} diff --git a/.venv/bin/activate.xsh b/.venv/bin/activate.xsh new file mode 100644 index 00000000..e24f76eb --- /dev/null +++ b/.venv/bin/activate.xsh @@ -0,0 +1,46 @@ +"""Xonsh activate script for virtualenv""" +from xonsh.tools import get_sep as _get_sep + +def _deactivate(args): + if "pydoc" in aliases: + del aliases["pydoc"] + + if ${...}.get("_OLD_VIRTUAL_PATH", ""): + $PATH = $_OLD_VIRTUAL_PATH + del $_OLD_VIRTUAL_PATH + + if ${...}.get("_OLD_VIRTUAL_PYTHONHOME", ""): + $PYTHONHOME = $_OLD_VIRTUAL_PYTHONHOME + del $_OLD_VIRTUAL_PYTHONHOME + + if "VIRTUAL_ENV" in ${...}: + del $VIRTUAL_ENV + + if "VIRTUAL_ENV_PROMPT" in ${...}: + del $VIRTUAL_ENV_PROMPT + + if "nondestructive" not in args: + # Self destruct! + del aliases["deactivate"] + + +# unset irrelevant variables +_deactivate(["nondestructive"]) +aliases["deactivate"] = _deactivate + +$VIRTUAL_ENV = r"/home/sandrormio/curso-flask/.venv" + +$_OLD_VIRTUAL_PATH = $PATH +$PATH = $PATH[:] +$PATH.add($VIRTUAL_ENV + _get_sep() + "bin", front=True, replace=True) + +if ${...}.get("PYTHONHOME", ""): + # unset PYTHONHOME if set + $_OLD_VIRTUAL_PYTHONHOME = $PYTHONHOME + del $PYTHONHOME + +$VIRTUAL_ENV_PROMPT = "" +if not $VIRTUAL_ENV_PROMPT: + del $VIRTUAL_ENV_PROMPT + +aliases["pydoc"] = ["python", "-m", "pydoc"] diff --git a/.venv/bin/activate_this.py b/.venv/bin/activate_this.py new file mode 100644 index 00000000..44799869 --- /dev/null +++ b/.venv/bin/activate_this.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +"""Activate virtualenv for current interpreter: + +Use exec(open(this_file).read(), {'__file__': this_file}). + +This can be used when you must use an existing Python interpreter, not the virtualenv bin/python. +""" +import os +import site +import sys + +try: + abs_file = os.path.abspath(__file__) +except NameError: + raise AssertionError("You must use exec(open(this_file).read(), {'__file__': this_file}))") + +bin_dir = os.path.dirname(abs_file) +base = bin_dir[: -len("bin") - 1] # strip away the bin part from the __file__, plus the path separator + +# prepend bin to PATH (this file is inside the bin directory) +os.environ["PATH"] = os.pathsep.join([bin_dir] + os.environ.get("PATH", "").split(os.pathsep)) +os.environ["VIRTUAL_ENV"] = base # virtual env is right above bin directory + +# add the virtual environments libraries to the host python import mechanism +prev_length = len(sys.path) +for lib in "../lib/python3.8/site-packages".split(os.pathsep): + path = os.path.realpath(os.path.join(bin_dir, lib)) + site.addsitedir(path.decode("utf-8") if "" else path) +sys.path[:] = sys.path[prev_length:] + sys.path[0:prev_length] + +sys.real_prefix = sys.prefix +sys.prefix = base diff --git a/.venv/bin/alembic b/.venv/bin/alembic new file mode 100755 index 00000000..007040e8 --- /dev/null +++ b/.venv/bin/alembic @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from alembic.config import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/black b/.venv/bin/black new file mode 100755 index 00000000..aad55321 --- /dev/null +++ b/.venv/bin/black @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from black import patched_main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(patched_main()) diff --git a/.venv/bin/blackd b/.venv/bin/blackd new file mode 100755 index 00000000..717c7865 --- /dev/null +++ b/.venv/bin/blackd @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from blackd import patched_main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(patched_main()) diff --git a/.venv/bin/coverage b/.venv/bin/coverage new file mode 100755 index 00000000..2cb8a205 --- /dev/null +++ b/.venv/bin/coverage @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from coverage.cmdline import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/coverage-3.8 b/.venv/bin/coverage-3.8 new file mode 100755 index 00000000..2cb8a205 --- /dev/null +++ b/.venv/bin/coverage-3.8 @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from coverage.cmdline import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/coverage3 b/.venv/bin/coverage3 new file mode 100755 index 00000000..2cb8a205 --- /dev/null +++ b/.venv/bin/coverage3 @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from coverage.cmdline import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/dynaconf b/.venv/bin/dynaconf new file mode 100755 index 00000000..c2b40fff --- /dev/null +++ b/.venv/bin/dynaconf @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from dynaconf.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/easy_install b/.venv/bin/easy_install new file mode 100755 index 00000000..07c1603f --- /dev/null +++ b/.venv/bin/easy_install @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from setuptools.command.easy_install import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/easy_install-3.8 b/.venv/bin/easy_install-3.8 new file mode 100755 index 00000000..07c1603f --- /dev/null +++ b/.venv/bin/easy_install-3.8 @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from setuptools.command.easy_install import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/easy_install3 b/.venv/bin/easy_install3 new file mode 100755 index 00000000..07c1603f --- /dev/null +++ b/.venv/bin/easy_install3 @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from setuptools.command.easy_install import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/flake8 b/.venv/bin/flake8 new file mode 100755 index 00000000..d2caaeaa --- /dev/null +++ b/.venv/bin/flake8 @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from flake8.main.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/flask b/.venv/bin/flask new file mode 100755 index 00000000..9bcb2a4d --- /dev/null +++ b/.venv/bin/flask @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from flask.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/ipdb3 b/.venv/bin/ipdb3 new file mode 100755 index 00000000..92867bc7 --- /dev/null +++ b/.venv/bin/ipdb3 @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from ipdb.__main__ import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/iptest b/.venv/bin/iptest new file mode 100755 index 00000000..7279a944 --- /dev/null +++ b/.venv/bin/iptest @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from IPython.testing.iptestcontroller import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/iptest3 b/.venv/bin/iptest3 new file mode 100755 index 00000000..7279a944 --- /dev/null +++ b/.venv/bin/iptest3 @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from IPython.testing.iptestcontroller import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/ipython b/.venv/bin/ipython new file mode 100755 index 00000000..40395ffa --- /dev/null +++ b/.venv/bin/ipython @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from IPython import start_ipython +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(start_ipython()) diff --git a/.venv/bin/ipython3 b/.venv/bin/ipython3 new file mode 100755 index 00000000..40395ffa --- /dev/null +++ b/.venv/bin/ipython3 @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from IPython import start_ipython +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(start_ipython()) diff --git a/.venv/bin/isort b/.venv/bin/isort new file mode 100755 index 00000000..e4ddffa6 --- /dev/null +++ b/.venv/bin/isort @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from isort.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/mako-render b/.venv/bin/mako-render new file mode 100755 index 00000000..01239e6e --- /dev/null +++ b/.venv/bin/mako-render @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from mako.cmd import cmdline +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(cmdline()) diff --git a/.venv/bin/pip b/.venv/bin/pip new file mode 100755 index 00000000..77254a5a --- /dev/null +++ b/.venv/bin/pip @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/pip3 b/.venv/bin/pip3 new file mode 100755 index 00000000..77254a5a --- /dev/null +++ b/.venv/bin/pip3 @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/pip3.8 b/.venv/bin/pip3.8 new file mode 100755 index 00000000..77254a5a --- /dev/null +++ b/.venv/bin/pip3.8 @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/py.test b/.venv/bin/py.test new file mode 100755 index 00000000..a72cbe56 --- /dev/null +++ b/.venv/bin/py.test @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pytest import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/pycodestyle b/.venv/bin/pycodestyle new file mode 100755 index 00000000..c370d90d --- /dev/null +++ b/.venv/bin/pycodestyle @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pycodestyle import _main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(_main()) diff --git a/.venv/bin/pyflakes b/.venv/bin/pyflakes new file mode 100755 index 00000000..3dde174d --- /dev/null +++ b/.venv/bin/pyflakes @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pyflakes.api import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/pygmentize b/.venv/bin/pygmentize new file mode 100755 index 00000000..1751ddde --- /dev/null +++ b/.venv/bin/pygmentize @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pygments.cmdline import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/pytest b/.venv/bin/pytest new file mode 100755 index 00000000..a72cbe56 --- /dev/null +++ b/.venv/bin/pytest @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pytest import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/python b/.venv/bin/python new file mode 120000 index 00000000..ae65fdaa --- /dev/null +++ b/.venv/bin/python @@ -0,0 +1 @@ +/usr/bin/python3 \ No newline at end of file diff --git a/.venv/bin/python3 b/.venv/bin/python3 new file mode 120000 index 00000000..d8654aa0 --- /dev/null +++ b/.venv/bin/python3 @@ -0,0 +1 @@ +python \ No newline at end of file diff --git a/.venv/bin/python3.8 b/.venv/bin/python3.8 new file mode 120000 index 00000000..d8654aa0 --- /dev/null +++ b/.venv/bin/python3.8 @@ -0,0 +1 @@ +python \ No newline at end of file diff --git a/.venv/bin/wheel b/.venv/bin/wheel new file mode 100755 index 00000000..600249fb --- /dev/null +++ b/.venv/bin/wheel @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from wheel.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/wheel-3.8 b/.venv/bin/wheel-3.8 new file mode 100755 index 00000000..600249fb --- /dev/null +++ b/.venv/bin/wheel-3.8 @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from wheel.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/bin/wheel3 b/.venv/bin/wheel3 new file mode 100755 index 00000000..600249fb --- /dev/null +++ b/.venv/bin/wheel3 @@ -0,0 +1,8 @@ +#!/home/sandrormio/curso-flask/.venv/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from wheel.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/.venv/lib/python3.8/site-packages/.libs_cffi_backend/libffi-806b1a9d.so.6.0.4 b/.venv/lib/python3.8/site-packages/.libs_cffi_backend/libffi-806b1a9d.so.6.0.4 new file mode 100755 index 00000000..a74aa904 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/.libs_cffi_backend/libffi-806b1a9d.so.6.0.4 differ diff --git a/.venv/lib/python3.8/site-packages/Flask-1.1.2.dist-info/INSTALLER b/.venv/lib/python3.8/site-packages/Flask-1.1.2.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask-1.1.2.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/lib/python3.8/site-packages/Flask-1.1.2.dist-info/LICENSE.rst b/.venv/lib/python3.8/site-packages/Flask-1.1.2.dist-info/LICENSE.rst new file mode 100644 index 00000000..9d227a0c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask-1.1.2.dist-info/LICENSE.rst @@ -0,0 +1,28 @@ +Copyright 2010 Pallets + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.venv/lib/python3.8/site-packages/Flask-1.1.2.dist-info/METADATA b/.venv/lib/python3.8/site-packages/Flask-1.1.2.dist-info/METADATA new file mode 100644 index 00000000..db7fcd17 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask-1.1.2.dist-info/METADATA @@ -0,0 +1,137 @@ +Metadata-Version: 2.1 +Name: Flask +Version: 1.1.2 +Summary: A simple framework for building complex web applications. +Home-page: https://palletsprojects.com/p/flask/ +Author: Armin Ronacher +Author-email: armin.ronacher@active-4.com +Maintainer: Pallets +Maintainer-email: contact@palletsprojects.com +License: BSD-3-Clause +Project-URL: Documentation, https://flask.palletsprojects.com/ +Project-URL: Code, https://github.com/pallets/flask +Project-URL: Issue tracker, https://github.com/pallets/flask/issues +Platform: UNKNOWN +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Web Environment +Classifier: Framework :: Flask +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content +Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application +Classifier: Topic :: Software Development :: Libraries :: Application Frameworks +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.* +Requires-Dist: Werkzeug (>=0.15) +Requires-Dist: Jinja2 (>=2.10.1) +Requires-Dist: itsdangerous (>=0.24) +Requires-Dist: click (>=5.1) +Provides-Extra: dev +Requires-Dist: pytest ; extra == 'dev' +Requires-Dist: coverage ; extra == 'dev' +Requires-Dist: tox ; extra == 'dev' +Requires-Dist: sphinx ; extra == 'dev' +Requires-Dist: pallets-sphinx-themes ; extra == 'dev' +Requires-Dist: sphinxcontrib-log-cabinet ; extra == 'dev' +Requires-Dist: sphinx-issues ; extra == 'dev' +Provides-Extra: docs +Requires-Dist: sphinx ; extra == 'docs' +Requires-Dist: pallets-sphinx-themes ; extra == 'docs' +Requires-Dist: sphinxcontrib-log-cabinet ; extra == 'docs' +Requires-Dist: sphinx-issues ; extra == 'docs' +Provides-Extra: dotenv +Requires-Dist: python-dotenv ; extra == 'dotenv' + +Flask +===== + +Flask is a lightweight `WSGI`_ web application framework. It is designed +to make getting started quick and easy, with the ability to scale up to +complex applications. It began as a simple wrapper around `Werkzeug`_ +and `Jinja`_ and has become one of the most popular Python web +application frameworks. + +Flask offers suggestions, but doesn't enforce any dependencies or +project layout. It is up to the developer to choose the tools and +libraries they want to use. There are many extensions provided by the +community that make adding new functionality easy. + + +Installing +---------- + +Install and update using `pip`_: + +.. code-block:: text + + pip install -U Flask + + +A Simple Example +---------------- + +.. code-block:: python + + from flask import Flask + + app = Flask(__name__) + + @app.route("/") + def hello(): + return "Hello, World!" + +.. code-block:: text + + $ env FLASK_APP=hello.py flask run + * Serving Flask app "hello" + * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) + + +Contributing +------------ + +For guidance on setting up a development environment and how to make a +contribution to Flask, see the `contributing guidelines`_. + +.. _contributing guidelines: https://github.com/pallets/flask/blob/master/CONTRIBUTING.rst + + +Donate +------ + +The Pallets organization develops and supports Flask and the libraries +it uses. In order to grow the community of contributors and users, and +allow the maintainers to devote more time to the projects, `please +donate today`_. + +.. _please donate today: https://psfmember.org/civicrm/contribute/transact?reset=1&id=20 + + +Links +----- + +* Website: https://palletsprojects.com/p/flask/ +* Documentation: https://flask.palletsprojects.com/ +* Releases: https://pypi.org/project/Flask/ +* Code: https://github.com/pallets/flask +* Issue tracker: https://github.com/pallets/flask/issues +* Test status: https://dev.azure.com/pallets/flask/_build +* Official chat: https://discord.gg/t6rrQZH + +.. _WSGI: https://wsgi.readthedocs.io +.. _Werkzeug: https://www.palletsprojects.com/p/werkzeug/ +.. _Jinja: https://www.palletsprojects.com/p/jinja/ +.. _pip: https://pip.pypa.io/en/stable/quickstart/ + + diff --git a/.venv/lib/python3.8/site-packages/Flask-1.1.2.dist-info/RECORD b/.venv/lib/python3.8/site-packages/Flask-1.1.2.dist-info/RECORD new file mode 100644 index 00000000..cd71f87c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask-1.1.2.dist-info/RECORD @@ -0,0 +1,48 @@ +../../../bin/flask,sha256=6Y1s9U6qIb46_Y4nvurcz_3Ma4pMf2G8n9SseZYIvgM,237 +Flask-1.1.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +Flask-1.1.2.dist-info/LICENSE.rst,sha256=SJqOEQhQntmKN7uYPhHg9-HTHwvY-Zp5yESOf_N9B-o,1475 +Flask-1.1.2.dist-info/METADATA,sha256=3INpPWH6nKfZ33R2N-bQZy4TOe1wQCMweZc9mwcNrtc,4591 +Flask-1.1.2.dist-info/RECORD,, +Flask-1.1.2.dist-info/WHEEL,sha256=8zNYZbwQSXoB9IfXOjPfeNwvAsALAjffgk27FqvCWbo,110 +Flask-1.1.2.dist-info/entry_points.txt,sha256=gBLA1aKg0OYR8AhbAfg8lnburHtKcgJLDU52BBctN0k,42 +Flask-1.1.2.dist-info/top_level.txt,sha256=dvi65F6AeGWVU0TBpYiC04yM60-FX1gJFkK31IKQr5c,6 +flask/__init__.py,sha256=YnA9wkwbJcnb_jTT-nMsMFeFE_UWt33khKzdHmMSuyI,1894 +flask/__main__.py,sha256=fjVtt3QTANXlpJCOv3Ha7d5H-76MwzSIOab7SFD9TEk,254 +flask/__pycache__/__init__.cpython-38.pyc,, +flask/__pycache__/__main__.cpython-38.pyc,, +flask/__pycache__/_compat.cpython-38.pyc,, +flask/__pycache__/app.cpython-38.pyc,, +flask/__pycache__/blueprints.cpython-38.pyc,, +flask/__pycache__/cli.cpython-38.pyc,, +flask/__pycache__/config.cpython-38.pyc,, +flask/__pycache__/ctx.cpython-38.pyc,, +flask/__pycache__/debughelpers.cpython-38.pyc,, +flask/__pycache__/globals.cpython-38.pyc,, +flask/__pycache__/helpers.cpython-38.pyc,, +flask/__pycache__/logging.cpython-38.pyc,, +flask/__pycache__/sessions.cpython-38.pyc,, +flask/__pycache__/signals.cpython-38.pyc,, +flask/__pycache__/templating.cpython-38.pyc,, +flask/__pycache__/testing.cpython-38.pyc,, +flask/__pycache__/views.cpython-38.pyc,, +flask/__pycache__/wrappers.cpython-38.pyc,, +flask/_compat.py,sha256=8KPT54Iig96TuLipdogLRHNYToIcg-xPhnSV5VRERnw,4099 +flask/app.py,sha256=tmEhx_XrIRP24vZg39dHMWFzJ2jj-YxIcd51LaIT5cE,98059 +flask/blueprints.py,sha256=vkdm8NusGsfZUeIfPdCluj733QFmiQcT4Sk1tuZLUjw,21400 +flask/cli.py,sha256=SIb22uq9wYBeB2tKMl0pYdhtZ1MAQyZtPL-3m6es4G0,31035 +flask/config.py,sha256=3dejvQRYfNHw_V7dCLMxU8UNFpL34xIKemN7gHZIZ8Y,10052 +flask/ctx.py,sha256=cks-omGedkxawHFo6bKIrdOHsJCAgg1i_NWw_htxb5U,16724 +flask/debughelpers.py,sha256=-whvPKuAoU8AZ9c1z_INuOeBgfYDqE1J2xNBsoriugU,6475 +flask/globals.py,sha256=OgcHb6_NCyX6-TldciOdKcyj4PNfyQwClxdMhvov6aA,1637 +flask/helpers.py,sha256=IHa578HU_3XAAo1wpXQv24MYRYO5TzaiDQQwvUIcE6Q,43074 +flask/json/__init__.py,sha256=6nITbZYiYOPB8Qfi1-dvsblwn01KRz8VOsMBIZyaYek,11988 +flask/json/__pycache__/__init__.cpython-38.pyc,, +flask/json/__pycache__/tag.cpython-38.pyc,, +flask/json/tag.py,sha256=vq9GOllg_0kTWKuVFrwmkeOQzR-jdBD23x-89JyCCQI,8306 +flask/logging.py,sha256=WcY5UkqTysGfmosyygSlXyZYGwOp3y-VsE6ehoJ48dk,3250 +flask/sessions.py,sha256=G0KsEkr_i1LG_wOINwFSOW3ts7Xbv4bNgEZKc7TRloc,14360 +flask/signals.py,sha256=yYLOed2x8WnQ7pirGalQYfpYpCILJ0LJhmNSrnWvjqw,2212 +flask/templating.py,sha256=F8E_IZXn9BGsjMzUJ5N_ACMyZdiFBp_SSEaUunvfZ7g,4939 +flask/testing.py,sha256=WXsciCQbHBP7xjHqNvOA4bT0k86GvSNpgzncfXLDEEg,10146 +flask/views.py,sha256=eeWnadLAj0QdQPLtjKipDetRZyG62CT2y7fNOFDJz0g,5802 +flask/wrappers.py,sha256=kgsvtZuMM6RQaDqhRbc5Pcj9vqTnaERl2pmXcdGL7LU,4736 diff --git a/.venv/lib/python3.8/site-packages/Flask-1.1.2.dist-info/WHEEL b/.venv/lib/python3.8/site-packages/Flask-1.1.2.dist-info/WHEEL new file mode 100644 index 00000000..8b701e93 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask-1.1.2.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.33.6) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/.venv/lib/python3.8/site-packages/Flask-1.1.2.dist-info/entry_points.txt b/.venv/lib/python3.8/site-packages/Flask-1.1.2.dist-info/entry_points.txt new file mode 100644 index 00000000..1eb02520 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask-1.1.2.dist-info/entry_points.txt @@ -0,0 +1,3 @@ +[console_scripts] +flask = flask.cli:main + diff --git a/aula3/requirements.txt b/.venv/lib/python3.8/site-packages/Flask-1.1.2.dist-info/top_level.txt similarity index 100% rename from aula3/requirements.txt rename to .venv/lib/python3.8/site-packages/Flask-1.1.2.dist-info/top_level.txt diff --git a/.venv/lib/python3.8/site-packages/Flask_Admin-1.5.6.dist-info/INSTALLER b/.venv/lib/python3.8/site-packages/Flask_Admin-1.5.6.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_Admin-1.5.6.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/lib/python3.8/site-packages/Flask_Admin-1.5.6.dist-info/LICENSE b/.venv/lib/python3.8/site-packages/Flask_Admin-1.5.6.dist-info/LICENSE new file mode 100644 index 00000000..e106c74b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_Admin-1.5.6.dist-info/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2014, Serge S. Koval and contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.venv/lib/python3.8/site-packages/Flask_Admin-1.5.6.dist-info/METADATA b/.venv/lib/python3.8/site-packages/Flask_Admin-1.5.6.dist-info/METADATA new file mode 100644 index 00000000..153addd4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_Admin-1.5.6.dist-info/METADATA @@ -0,0 +1,156 @@ +Metadata-Version: 2.1 +Name: Flask-Admin +Version: 1.5.6 +Summary: Simple and extensible admin interface framework for Flask +Home-page: https://github.com/flask-admin/flask-admin/ +Author: Flask-Admin team +Author-email: serge.koval+github@gmail.com +License: BSD +Platform: any +Classifier: Development Status :: 4 - Beta +Classifier: Environment :: Web Environment +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3.3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Requires-Dist: Flask (>=0.7) +Requires-Dist: wtforms +Provides-Extra: aws +Requires-Dist: boto ; extra == 'aws' +Provides-Extra: azure +Requires-Dist: azure-storage-blob ; extra == 'azure' + +Flask-Admin +=========== + +The project was recently moved into its own organization. Please update your +references to *git@github.com:flask-admin/flask-admin.git*. + +.. image:: https://d322cqt584bo4o.cloudfront.net/flask-admin/localized.svg + :target: https://crowdin.com/project/flask-admin + +.. image:: https://travis-ci.org/flask-admin/flask-admin.svg?branch=master + :target: https://travis-ci.org/flask-admin/flask-admin + +Introduction +------------ + +Flask-Admin is a batteries-included, simple-to-use `Flask `_ extension that lets you +add admin interfaces to Flask applications. It is inspired by the *django-admin* package, but implemented in such +a way that the developer has total control of the look, feel and functionality of the resulting application. + +Out-of-the-box, Flask-Admin plays nicely with various ORM's, including + +- `SQLAlchemy `_, + +- `MongoEngine `_, + +- `pymongo `_ and + +- `Peewee `_. + +It also boasts a simple file management interface and a `redis client `_ console. + +The biggest feature of Flask-Admin is flexibility. It aims to provide a set of simple tools that can be used for +building admin interfaces of any complexity. So, to start off with you can create a very simple application in no time, +with auto-generated CRUD-views for each of your models. But then you can go further and customize those views & forms +as the need arises. + +Flask-Admin is an active project, well-tested and production ready. + +Examples +-------- +Several usage examples are included in the */examples* folder. Please add your own, or improve +on the existing examples, and submit a *pull-request*. + +To run the examples in your local environment:: + + 1. Clone the repository:: + + git clone https://github.com/flask-admin/flask-admin.git + cd flask-admin + + 2. Create and activate a virtual environment:: + + virtualenv env -p python3 + source env/bin/activate + + 3. Install requirements:: + + pip install -r examples/sqla/requirements.txt + + 4. Run the application:: + + python examples/sqla/run_server.py + +Documentation +------------- +Flask-Admin is extensively documented, you can find all of the documentation at `https://flask-admin.readthedocs.io/en/latest/ `_. + +The docs are auto-generated from the *.rst* files in the */doc* folder. So if you come across any errors, or +if you think of anything else that should be included, then please make the changes and submit them as a *pull-request*. + +To build the docs in your local environment, from the project directory:: + + tox -e docs-html + +And if you want to preview any *.rst* snippets that you may want to contribute, go to `http://rst.ninjs.org/ `_. + +Installation +------------ +To install Flask-Admin, simply:: + + pip install flask-admin + +Or alternatively, you can download the repository and install manually by doing:: + + git clone git@github.com:flask-admin/flask-admin.git + cd flask-admin + python setup.py install + +Tests +----- +Test are run with *nose*. If you are not familiar with this package you can get some more info from `their website `_. + +To run the tests, from the project directory, simply:: + + pip install -r requirements-dev.txt + nosetests + +You should see output similar to:: + + ............................................. + ---------------------------------------------------------------------- + Ran 102 tests in 13.132s + + OK + +For all the tests to pass successfully, you'll need Postgres & MongoDB to be running locally. For Postgres:: + + > psql postgres + CREATE DATABASE flask_admin_test; + \q + + > psql flask_admin_test + CREATE EXTENSION postgis; + CREATE EXTENSION hstore; + +You can also run the tests on multiple environments using *tox*. + +3rd Party Stuff +--------------- + +Flask-Admin is built with the help of `Bootstrap `_, `Select2 `_ +and `Bootswatch `_. + +If you want to localize your application, install the `Flask-BabelEx `_ package. + +You can help improve Flask-Admin's translations through Crowdin: https://crowdin.com/project/flask-admin + + diff --git a/.venv/lib/python3.8/site-packages/Flask_Admin-1.5.6.dist-info/RECORD b/.venv/lib/python3.8/site-packages/Flask_Admin-1.5.6.dist-info/RECORD new file mode 100644 index 00000000..b96044e7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_Admin-1.5.6.dist-info/RECORD @@ -0,0 +1,440 @@ +Flask_Admin-1.5.6.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +Flask_Admin-1.5.6.dist-info/LICENSE,sha256=cFIAcXTsyQorkee_JRMtRjyq4zre8oHFTblgGsCmFgc,1539 +Flask_Admin-1.5.6.dist-info/METADATA,sha256=oqJM0Cx4X2nlrvJb_N891XSsfezLlZfo3Gf9tAcAeXU,5450 +Flask_Admin-1.5.6.dist-info/RECORD,, +Flask_Admin-1.5.6.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92 +Flask_Admin-1.5.6.dist-info/top_level.txt,sha256=4nVl7BBQjoRy6GMJ9MgJeh1Fvu1GPwuVc2L1NiCwpdE,12 +flask_admin/__init__.py,sha256=cWPRG-W7WncY-QUNw8HLwoFOrgj06Zr5Bmg_7BV5gm4,188 +flask_admin/__pycache__/__init__.cpython-38.pyc,, +flask_admin/__pycache__/_backwards.cpython-38.pyc,, +flask_admin/__pycache__/_compat.cpython-38.pyc,, +flask_admin/__pycache__/actions.cpython-38.pyc,, +flask_admin/__pycache__/babel.cpython-38.pyc,, +flask_admin/__pycache__/base.cpython-38.pyc,, +flask_admin/__pycache__/consts.cpython-38.pyc,, +flask_admin/__pycache__/helpers.cpython-38.pyc,, +flask_admin/__pycache__/menu.cpython-38.pyc,, +flask_admin/__pycache__/tools.cpython-38.pyc,, +flask_admin/_backwards.py,sha256=5ZvkLXf2u75usI9-ZSe2T3ZzjTz14KTWYxFR-PwKVsI,2366 +flask_admin/_compat.py,sha256=WdHQmWXGn_gcEzHB_J5V7BsCxgfCQgO9MCn9owOx-Wc,2695 +flask_admin/actions.py,sha256=Chy1IsKRwXluqKhujX-52j7DlWBreYfijUENxyC9jrc,3806 +flask_admin/babel.py,sha256=FF2NExEYkJd-SaFNipkAIDGraywdTTpMprbNA7FFy9I,1945 +flask_admin/base.py,sha256=Er-Vq-pD0xzwc7F3LGmfYFoE1WnsJDofQ8tD1Io7_fA,24449 +flask_admin/consts.py,sha256=-L1oNAxaP8TdUftFkkM7NeHqhOoa5reQhmZZC0HJYDc,222 +flask_admin/contrib/__init__.py,sha256=VIMfZQbMYGhKbjuveuawOViJlI8V0kqFnhAKeRHGND0,94 +flask_admin/contrib/__pycache__/__init__.cpython-38.pyc,, +flask_admin/contrib/__pycache__/rediscli.cpython-38.pyc,, +flask_admin/contrib/appengine/__init__.py,sha256=1F_LSAhoAEBAgorR6PoLvVYhXvDXeBkrvzDu5wUhal8,188 +flask_admin/contrib/appengine/__pycache__/__init__.cpython-38.pyc,, +flask_admin/contrib/appengine/__pycache__/fields.cpython-38.pyc,, +flask_admin/contrib/appengine/__pycache__/form.cpython-38.pyc,, +flask_admin/contrib/appengine/__pycache__/view.cpython-38.pyc,, +flask_admin/contrib/appengine/fields.py,sha256=ZXBxRaoSHkMUim2ALJI9zhJAoOc5GsF5q9swZ-zOXb8,568 +flask_admin/contrib/appengine/form.py,sha256=MTsOH_JZmEyEP8CZiitE31yjky9g54DCkFOPdoWHMWk,376 +flask_admin/contrib/appengine/view.py,sha256=xTfFl4TdEQBlH7Qh-by_WuPWqKFoahVL8YY5UprM0tE,6989 +flask_admin/contrib/fileadmin/__init__.py,sha256=QTjV7Jz0c8Xgqy5QeF8xYZS4bmoAm0y8mUQaQerqox8,39351 +flask_admin/contrib/fileadmin/__pycache__/__init__.cpython-38.pyc,, +flask_admin/contrib/fileadmin/__pycache__/azure.cpython-38.pyc,, +flask_admin/contrib/fileadmin/__pycache__/s3.cpython-38.pyc,, +flask_admin/contrib/fileadmin/azure.py,sha256=_O-8TqsqdSJNopbqnG4n_VUT7KRHJIniL62kPkSzupI,8847 +flask_admin/contrib/fileadmin/s3.py,sha256=8rXN4SK86nffHmnMipNlpekuJxJtydDoc2pNsQ5RCZ0,6579 +flask_admin/contrib/geoa/__init__.py,sha256=GgPqv5vxatGvIS0BVeiwWBuRnSjPs_2lEe56DxasGYo,212 +flask_admin/contrib/geoa/__pycache__/__init__.cpython-38.pyc,, +flask_admin/contrib/geoa/__pycache__/fields.cpython-38.pyc,, +flask_admin/contrib/geoa/__pycache__/form.cpython-38.pyc,, +flask_admin/contrib/geoa/__pycache__/typefmt.cpython-38.pyc,, +flask_admin/contrib/geoa/__pycache__/view.cpython-38.pyc,, +flask_admin/contrib/geoa/__pycache__/widgets.cpython-38.pyc,, +flask_admin/contrib/geoa/fields.py,sha256=2XoK5p57qj7vzM2aKGDejhcn-qREBhdoMhneq5D_1tQ,2031 +flask_admin/contrib/geoa/form.py,sha256=eIoEbVsr32Pjs2eEEXjFwHCVSDDYEsR7vh4cRM4fIjc,647 +flask_admin/contrib/geoa/typefmt.py,sha256=nZGCJjj7YOgr58FhbXYLlzsxiIXr5bbTd9adJoiyUq8,959 +flask_admin/contrib/geoa/view.py,sha256=fgZRycZUotYtwTY2hP5GIpPiqqpQ8I3MHWNqutxW1pw,317 +flask_admin/contrib/geoa/widgets.py,sha256=xkhSnnmBWbco-9ST8fqQXen595Hx6X4gX7EIgV4yhUA,3052 +flask_admin/contrib/mongoengine/__init__.py,sha256=deispFH2x3h-CE4Xv-KoBvgqfo0KGcjoTqDa-Bbn2Sc,221 +flask_admin/contrib/mongoengine/__pycache__/__init__.cpython-38.pyc,, +flask_admin/contrib/mongoengine/__pycache__/ajax.cpython-38.pyc,, +flask_admin/contrib/mongoengine/__pycache__/fields.cpython-38.pyc,, +flask_admin/contrib/mongoengine/__pycache__/filters.cpython-38.pyc,, +flask_admin/contrib/mongoengine/__pycache__/form.cpython-38.pyc,, +flask_admin/contrib/mongoengine/__pycache__/helpers.cpython-38.pyc,, +flask_admin/contrib/mongoengine/__pycache__/subdoc.cpython-38.pyc,, +flask_admin/contrib/mongoengine/__pycache__/tools.cpython-38.pyc,, +flask_admin/contrib/mongoengine/__pycache__/typefmt.cpython-38.pyc,, +flask_admin/contrib/mongoengine/__pycache__/view.cpython-38.pyc,, +flask_admin/contrib/mongoengine/__pycache__/widgets.cpython-38.pyc,, +flask_admin/contrib/mongoengine/ajax.py,sha256=AqIbfBEaxXJOBS-YiZwRs8llEPhs6KfANbDfbU8iDMQ,4322 +flask_admin/contrib/mongoengine/fields.py,sha256=8MCgcc13oE1pqUrUsHnQOmDW8zgQqJtoSmPjNL_UHqY,2575 +flask_admin/contrib/mongoengine/filters.py,sha256=8X4V2qJCChEZT8s1_qN2roaPZPiyRZjef1g44ArFbxg,8771 +flask_admin/contrib/mongoengine/form.py,sha256=Rc8L1pnHFWM7H_JFRGGRVJEIt7wplrRbUBl6-20Ke9k,9055 +flask_admin/contrib/mongoengine/helpers.py,sha256=1vECCrD0VjNXQk0drt7F4hOvmMTTfQIP5hSGT558S1k,936 +flask_admin/contrib/mongoengine/subdoc.py,sha256=kYD1DoX_6Q6JY5LW9LZbCNyfuPNTjzVU8v0A6Hf_uXg,778 +flask_admin/contrib/mongoengine/tools.py,sha256=ZZU0OG33FS51y4vdACWEi4WenwmXpR2hl1_k_FsLMgU,757 +flask_admin/contrib/mongoengine/typefmt.py,sha256=aK5KutpjQKepW8Scz4Gdz12Bicic0HbzY_xbIZWEfJQ,1357 +flask_admin/contrib/mongoengine/view.py,sha256=yCP2Dz-SXWezkemPsG0K1I6PheD-upcfw3lCnf_29jI,21556 +flask_admin/contrib/mongoengine/widgets.py,sha256=U5y0nf0ZeEj98F8Zz6uQVDoaDyQpCfsCsF9OZswhJdA,2076 +flask_admin/contrib/peewee/__init__.py,sha256=zCMne7QqxjUXBKBK3Fh3QWmmNVantzC9wwUmryqNtIk,212 +flask_admin/contrib/peewee/__pycache__/__init__.cpython-38.pyc,, +flask_admin/contrib/peewee/__pycache__/ajax.cpython-38.pyc,, +flask_admin/contrib/peewee/__pycache__/filters.cpython-38.pyc,, +flask_admin/contrib/peewee/__pycache__/form.cpython-38.pyc,, +flask_admin/contrib/peewee/__pycache__/tools.cpython-38.pyc,, +flask_admin/contrib/peewee/__pycache__/view.cpython-38.pyc,, +flask_admin/contrib/peewee/ajax.py,sha256=E-8ZYQ8ELo0x_yZQdFma5vjKb2maEFm_zm7-PgamcnQ,2260 +flask_admin/contrib/peewee/filters.py,sha256=ihNcYo_w-6dvKKOylEqrfQ715MzW3ZWs3_QkXkCscJQ,9955 +flask_admin/contrib/peewee/form.py,sha256=Y5w8OsLfvlvXZFf9aGJQGgdAY1Cb-rfcUOhCEHncfWQ,9602 +flask_admin/contrib/peewee/tools.py,sha256=1tTrhuYB8FnDFGTKmMdJyGm3sgf0mDWBQNnyfOXNWVs,461 +flask_admin/contrib/peewee/view.py,sha256=2WEovEfZ3ISdSA1xAHXQybsBNbHIHQ7YFBSSMCTXWBM,18231 +flask_admin/contrib/peeweemodel/__init__.py,sha256=CECB0bRd7PDs5pDgh0bRXxOIbKQFREcKY6tuLB5nCJ4,366 +flask_admin/contrib/peeweemodel/__pycache__/__init__.cpython-38.pyc,, +flask_admin/contrib/pymongo/__init__.py,sha256=VEtqxWjjxm2BvqLmfI8Oo4RO2hSt1A8-JHoRcEJpDIk,170 +flask_admin/contrib/pymongo/__pycache__/__init__.cpython-38.pyc,, +flask_admin/contrib/pymongo/__pycache__/filters.cpython-38.pyc,, +flask_admin/contrib/pymongo/__pycache__/tools.cpython-38.pyc,, +flask_admin/contrib/pymongo/__pycache__/typefmt.cpython-38.pyc,, +flask_admin/contrib/pymongo/__pycache__/view.cpython-38.pyc,, +flask_admin/contrib/pymongo/filters.py,sha256=NYokSYNSmtQ--ZJRD72hCjpJSheijtErx72lB8iqEXU,2662 +flask_admin/contrib/pymongo/tools.py,sha256=irW1XkgWwfVR0xo-hd5N8D0_EYpmfkuKnLkq43PK_4U,343 +flask_admin/contrib/pymongo/typefmt.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +flask_admin/contrib/pymongo/view.py,sha256=WYlpkBauacSVMchKUnD6nSBWB3OMsXnC_lYbI77jf2E,11623 +flask_admin/contrib/rediscli.py,sha256=ZukVD3c5rXN6EdLBBJ8GC2yl2E7Go9-jYolD2kWxOB0,5966 +flask_admin/contrib/sqla/__init__.py,sha256=b4ptqyj1iOUIRS7DfXS0PXdhqfmh474SLWBuMtxahT4,43 +flask_admin/contrib/sqla/__pycache__/__init__.cpython-38.pyc,, +flask_admin/contrib/sqla/__pycache__/ajax.cpython-38.pyc,, +flask_admin/contrib/sqla/__pycache__/fields.cpython-38.pyc,, +flask_admin/contrib/sqla/__pycache__/filters.cpython-38.pyc,, +flask_admin/contrib/sqla/__pycache__/form.cpython-38.pyc,, +flask_admin/contrib/sqla/__pycache__/tools.cpython-38.pyc,, +flask_admin/contrib/sqla/__pycache__/typefmt.cpython-38.pyc,, +flask_admin/contrib/sqla/__pycache__/validators.cpython-38.pyc,, +flask_admin/contrib/sqla/__pycache__/view.cpython-38.pyc,, +flask_admin/contrib/sqla/__pycache__/widgets.cpython-38.pyc,, +flask_admin/contrib/sqla/ajax.py,sha256=N-SqsHARA_cFskZEQhAH7ad0qhI1CmegOKlZM1JfGSI,3417 +flask_admin/contrib/sqla/fields.py,sha256=rt7YpsHorw7wHKPnV6L1Ly_IZnTXBSGZVBwwZQD9Rhk,11595 +flask_admin/contrib/sqla/filters.py,sha256=PlbZX1zUFeyhQyljR1K7HyZguFjFWEiNMV3XI8ul6yI,19110 +flask_admin/contrib/sqla/form.py,sha256=6uK03EQQTH4C2xQHRHfzo1PbVSWIy82A5NlMbH0u1II,28495 +flask_admin/contrib/sqla/tools.py,sha256=NhbUFHts0EUowz0_Ed2lbYXWqJKTU9Je2QZDLgbep28,6997 +flask_admin/contrib/sqla/typefmt.py,sha256=uFN1XSj-u0LYxQQO41xYoru2RU4dQAm9XhvgWJVO9SU,1506 +flask_admin/contrib/sqla/validators.py,sha256=p0J1hvPq-UWf7mom-3HzqUy_YaTZng39XGmu6l6RzQY,3032 +flask_admin/contrib/sqla/view.py,sha256=57G1Hdzl9-61BA0GzCG2l-WvY2ARAbd9YrvUr8X0d64,44100 +flask_admin/contrib/sqla/widgets.py,sha256=a1T3Atu8HXnCxOhJFK-E2aTxHhphSONTA6pudwjC1H0,846 +flask_admin/contrib/sqlamodel/__init__.py,sha256=2QqYopJ6li2HRs90LLd77eCgYhTFCkIFnZUhdpdXnvo,364 +flask_admin/contrib/sqlamodel/__pycache__/__init__.cpython-38.pyc,, +flask_admin/form/__init__.py,sha256=ZKIplNTIzmcSpH7W8o6q_ZLOSnET3DmV3D3ydnMKklU,2242 +flask_admin/form/__pycache__/__init__.cpython-38.pyc,, +flask_admin/form/__pycache__/fields.cpython-38.pyc,, +flask_admin/form/__pycache__/rules.cpython-38.pyc,, +flask_admin/form/__pycache__/upload.cpython-38.pyc,, +flask_admin/form/__pycache__/validators.cpython-38.pyc,, +flask_admin/form/__pycache__/widgets.cpython-38.pyc,, +flask_admin/form/fields.py,sha256=yyK1ENrTQrM4bnMG7mA-00q0T_dh5BzchlXtds0Grhk,6727 +flask_admin/form/rules.py,sha256=rcDRRL5SPDsLGZVTh3wpapyjBafg0MdrgNQILK78_jw,10905 +flask_admin/form/upload.py,sha256=GjsposqKgTsCY_3S05ZaQfKX9zIhRookLPgJ7xtoYQg,17250 +flask_admin/form/validators.py,sha256=GRJpxg4q0dpZ7bZ6Z-03u9NazEeWQbR6W49FFNWxJow,435 +flask_admin/form/widgets.py,sha256=HRsGhrL5Cg5XdE1BCz5DDJA1bafmd5J0JQyZ5ivnFpA,3273 +flask_admin/helpers.py,sha256=PfcN36aQWraqpokMxJ_nVpF8PbASV8mX5eKkYSym2SM,4293 +flask_admin/menu.py,sha256=B1sL55T4tJTzwZ_Iy8HRQMBM6ER05alPMEuIYfqXTCg,3572 +flask_admin/model/__init__.py,sha256=PJ9_cXo3XZzXFuwpakKnX80cC4OhxU-DBzM_2NUatMI,120 +flask_admin/model/__pycache__/__init__.cpython-38.pyc,, +flask_admin/model/__pycache__/ajax.cpython-38.pyc,, +flask_admin/model/__pycache__/base.cpython-38.pyc,, +flask_admin/model/__pycache__/fields.cpython-38.pyc,, +flask_admin/model/__pycache__/filters.cpython-38.pyc,, +flask_admin/model/__pycache__/form.cpython-38.pyc,, +flask_admin/model/__pycache__/helpers.cpython-38.pyc,, +flask_admin/model/__pycache__/template.cpython-38.pyc,, +flask_admin/model/__pycache__/typefmt.cpython-38.pyc,, +flask_admin/model/__pycache__/widgets.cpython-38.pyc,, +flask_admin/model/ajax.py,sha256=Kf4v0OKh2fIbxAfDLmg3MdDuoth9QOX4_sl0p8AE_ho,1076 +flask_admin/model/base.py,sha256=Owj8oN-mRr2bK1tpjAscJZCSz82Z4m7MX0hmvgIW4Go,79692 +flask_admin/model/fields.py,sha256=bz7MWMnTIzmkUUwe5JywpwAYBbSMa5zxZws3J3pPkPA,6645 +flask_admin/model/filters.py,sha256=BUeyKncgXS1E57Trg8RFQctqKsu081eoNstXhW8UAk0,9512 +flask_admin/model/form.py,sha256=jJuNXhAokWA0EkyHyJTYRRdOqdhK7MY3MEe_8csdaQE,7221 +flask_admin/model/helpers.py,sha256=RASEBohJPVAZu2cAtsitFT-oOR_NmGq72dddsKlaaVc,1149 +flask_admin/model/template.py,sha256=AJkmpxYHv1gdj1VGJ3CIRoQNKcuq7FbHvZkB6n-7CqY,3543 +flask_admin/model/typefmt.py,sha256=FQ49NFZOyY5Eq2mJ4bZiqsgu4UN4Me4jm4PVNZSrDTI,2051 +flask_admin/model/widgets.py,sha256=d-X_gTbrSxJExvNIWkr7c4bEgMPhq9yAELN4TA-8ZHQ,7002 +flask_admin/static/admin/css/bootstrap2/admin.css,sha256=ySude0ACblHaUNtc3RnebRtfo0ODjevjSK-ZlsRBU5I,3381 +flask_admin/static/admin/css/bootstrap2/rediscli.css,sha256=XH51uYMQErRaM0-_8VKdnsRYp2-ZjzAxjLXNofgAL0E,656 +flask_admin/static/admin/css/bootstrap3/admin.css,sha256=wgN6SwmjRCmqfm-fDpaLvPYafE3WDxEQWA4zr_tUxis,2781 +flask_admin/static/admin/css/bootstrap3/rediscli.css,sha256=XH51uYMQErRaM0-_8VKdnsRYp2-ZjzAxjLXNofgAL0E,656 +flask_admin/static/admin/css/bootstrap3/submenu.css,sha256=zmHNLTTR7S5wy5SElE7GEw6zCVPJPgaHh3YTIqLzwKg,364 +flask_admin/static/admin/js/actions.js,sha256=FumYEEL3_MpXktMXtvqtmvTbZGyhel3eLSXrvpzlp6U,1515 +flask_admin/static/admin/js/bs2_modal.js,sha256=xeecZx4WKoSgoCShTebCYHzdATkIzxiLelayVG_G0Lk,262 +flask_admin/static/admin/js/bs3_modal.js,sha256=Jxve8bBSodQplIZw4Y1walBJ0hFTx8sZ5xr-Pjr_78Y,336 +flask_admin/static/admin/js/details_filter.js,sha256=XOlW2U5UiDeV2S_HgKqbp--Fo1I5uiUT2thFRUeFW_g,323 +flask_admin/static/admin/js/filters.js,sha256=yH4WhEhyhLo_xJA04fwPks2g2fvCR9yHSvGu7fzzS34,7404 +flask_admin/static/admin/js/form.js,sha256=jxb36MpYT1cCbNGCGqVdPn0wNkvWFnnANXTOSD9N170,22346 +flask_admin/static/admin/js/helpers.js,sha256=lIrIt87gBYrn6VY4OK3BWYvE9o9SbG2Y6_7aEZVOkRo,277 +flask_admin/static/admin/js/rediscli.js,sha256=e5nBJ1nMSxkJ7rLy6fgy8YG91l-Ye3JWH1nMOj7AtgU,2384 +flask_admin/static/bootstrap/bootstrap2/css/bootstrap-responsive.css,sha256=Eo0jugp663M7D_wuHg8LQmJuaGtQDKS6fP7aO7EYWpE,22102 +flask_admin/static/bootstrap/bootstrap2/css/bootstrap-responsive.min.css,sha256=LwnryuiG_XbmEHNDtfARYL1182z0JbN9b2fO45ngZRo,16840 +flask_admin/static/bootstrap/bootstrap2/css/bootstrap.css,sha256=jvgNL8760OGM0WTn6HslOauC_FSwaOsLveFgZjsKV2k,127343 +flask_admin/static/bootstrap/bootstrap2/css/bootstrap.min.css,sha256=-DXjxJqm5kIfFyh2HOy3Xeoi9gPbwDrUvzkwvjOv1Hc,106006 +flask_admin/static/bootstrap/bootstrap2/js/bootstrap.js,sha256=w_jCs5ZKXi_Z2TH5b5QnfauO6grJkqGdx_qGYImuBN0,61884 +flask_admin/static/bootstrap/bootstrap2/js/bootstrap.min.js,sha256=pRWoIpKzS93jRHETY01dSWA5_9TWoMc4JYbzwk5YJkU,28631 +flask_admin/static/bootstrap/bootstrap2/swatch/amelia/bootstrap.min.css,sha256=baJPzNUxqfBInGPz0Xlj0Z2M6ATb-hnII0s-_BISRHs,126803 +flask_admin/static/bootstrap/bootstrap2/swatch/cerulean/bootstrap.min.css,sha256=Uj5JwBE93k4UT6VYQncK2cGUTa2LO3Svj5SvpgrZGV0,114708 +flask_admin/static/bootstrap/bootstrap2/swatch/cosmo/bootstrap.min.css,sha256=8Sg_AEaoSuemcD8DUqFq9PJXAi6nhp8Gy2oMaUPdyCQ,114369 +flask_admin/static/bootstrap/bootstrap2/swatch/cyborg/bootstrap.min.css,sha256=VGu5mlH_wu98gZXYVabsWhOUTsDWCoAX0_BcUnYBNNs,121912 +flask_admin/static/bootstrap/bootstrap2/swatch/default/bootstrap.min.css,sha256=OXczNkBByG2m5d8BUOEg47ZCu5Gy7baw-n8mYc-x4SI,105939 +flask_admin/static/bootstrap/bootstrap2/swatch/flatly/bootstrap.min.css,sha256=iQIjl9w7H9z07ivnGdTCAioUu_mkypMFG1gqCjuRK20,119048 +flask_admin/static/bootstrap/bootstrap2/swatch/img/glyphicons-halflings-white.png,sha256=8ODZWpyKvN-r9GNI4tQoWCm7BJH19q8OBa9Sv_tjJMQ,8777 +flask_admin/static/bootstrap/bootstrap2/swatch/img/glyphicons-halflings.png,sha256=2Z4_oyxkEDLwgUmRSyjC3GrPLsYvcJh_Ilnqu_p_wN4,12799 +flask_admin/static/bootstrap/bootstrap2/swatch/journal/bootstrap.min.css,sha256=iMpitsGoXD9IxvmcIH0EKTk2vK1yEn137f3whPcIW20,112175 +flask_admin/static/bootstrap/bootstrap2/swatch/readable/bootstrap.min.css,sha256=Z6OmFujLEc83-_msD-wEWcPRc92dDN7rjogsUXR-EJw,106650 +flask_admin/static/bootstrap/bootstrap2/swatch/simplex/bootstrap.min.css,sha256=zveOG7uOIg2tqQG1NzBrbu7p1enIYTOo09v1wQIr9wk,113408 +flask_admin/static/bootstrap/bootstrap2/swatch/slate/bootstrap.min.css,sha256=2vBbhd9z4DYc58SG0Mjk6e4qhxNf8T2m7zGDIw6J0oo,130206 +flask_admin/static/bootstrap/bootstrap2/swatch/spacelab/bootstrap.min.css,sha256=Er-klPLQbwxDzG2T_TD77Do7LZj-6sa94zXxVvLORJc,115883 +flask_admin/static/bootstrap/bootstrap2/swatch/spruce/bootstrap.min.css,sha256=YthArx_7T8AHZq4Xm_o0IIYk13BGspwA-JJd2tc5CNo,114811 +flask_admin/static/bootstrap/bootstrap2/swatch/superhero/bootstrap.min.css,sha256=AuQq2rDIP7lc1a-M4lz6LAJIckLh0F54W5VCxAaVMj4,120332 +flask_admin/static/bootstrap/bootstrap2/swatch/united/bootstrap.min.css,sha256=Rr9z7AxBu_undojHNwSh1ZYC8L58yDn3WcmuVKgKiIY,109732 +flask_admin/static/bootstrap/bootstrap3/css/bootstrap-theme.css,sha256=AHaEdM9xeOvgh9UVSr1XVrOJWKL_sbopR-9QC32N0JQ,26132 +flask_admin/static/bootstrap/bootstrap3/css/bootstrap-theme.css.map,sha256=pxQ2oWtTPdQspKGgqh8cgj8IHw7-NbfrqHCRHFl_w8E,47721 +flask_admin/static/bootstrap/bootstrap3/css/bootstrap-theme.min.css,sha256=bHQiqcFbnJb1Qhh61RY9cMh6kR0gTuQY6iFOBj1yj00,23357 +flask_admin/static/bootstrap/bootstrap3/css/bootstrap.css,sha256=75xVS8o85bn5eLYm_4w6RBwEaK8lmb206bazL2dD8Fg,147430 +flask_admin/static/bootstrap/bootstrap3/css/bootstrap.css.map,sha256=WQkQe5K9fP4V4Okt9XmH4u0S9FK4_WALMae_Vax4KEk,390518 +flask_admin/static/bootstrap/bootstrap3/css/bootstrap.min.css,sha256=MfvZlkHCEqatNoGiOXveE8FIwMzZg4W85qfrfIFBfYc,122540 +flask_admin/static/bootstrap/bootstrap3/js/bootstrap.js,sha256=70Ok1QL_tohlaFHXiMQoadR-iEDQB7T0tm9iUwFxrNQ,68890 +flask_admin/static/bootstrap/bootstrap3/js/bootstrap.min.js,sha256=Sk3nkD6mLTMOF0EOpNtsIry-s1CsaqQC1rVLTAy-0yc,36816 +flask_admin/static/bootstrap/bootstrap3/swatch/cerulean/bootstrap.min.css,sha256=obxCG8hWR3FEKvV19p_G6KgEYm1v_u1FnRTS7Bc4Ii8,129654 +flask_admin/static/bootstrap/bootstrap3/swatch/cosmo/bootstrap.min.css,sha256=IF1P9CSIVOaY4nBb5jATvBGnxMn_4dB9JNTLqdxKN9w,127019 +flask_admin/static/bootstrap/bootstrap3/swatch/cyborg/bootstrap.min.css,sha256=2bN4ZcH9Y-IoZK42CyyuYD7Hh0zLnb9FYB0JhL5b3uM,127022 +flask_admin/static/bootstrap/bootstrap3/swatch/darkly/bootstrap.min.css,sha256=IsefKVCcMUlgpXQgIMRsqbIqC6aP153JkybxTa7W7_8,129027 +flask_admin/static/bootstrap/bootstrap3/swatch/default/bootstrap.min.css,sha256=MfvZlkHCEqatNoGiOXveE8FIwMzZg4W85qfrfIFBfYc,122540 +flask_admin/static/bootstrap/bootstrap3/swatch/flatly/bootstrap.min.css,sha256=sHwgyDk4CGNYom267UJX364ewnY4Bh55d53pxP5WDug,128718 +flask_admin/static/bootstrap/bootstrap3/swatch/fonts/glyphicons-halflings-regular.eot,sha256=E2NNqH2eI_jD7ZEIzhck0YOjmtBy5z4bPYy_ZG0tBAc,20127 +flask_admin/static/bootstrap/bootstrap3/swatch/fonts/glyphicons-halflings-regular.svg,sha256=QvYGWdJlwaPDD5-kKry7Vr1KU69Ng9MW1t16NpA8Q-U,108738 +flask_admin/static/bootstrap/bootstrap3/swatch/fonts/glyphicons-halflings-regular.ttf,sha256=45UEQJN1fYKvyxOJV9BqHqk2G9zwtELQahioBRr1dFY,45404 +flask_admin/static/bootstrap/bootstrap3/swatch/fonts/glyphicons-halflings-regular.woff,sha256=omOU9-3hAMoRjv8u2ghZYnWpg5uVnCJuFUOVV6WoB0I,23424 +flask_admin/static/bootstrap/bootstrap3/swatch/fonts/glyphicons-halflings-regular.woff2,sha256=_hhdEaSWdokNR7t4MxKgzaWkTEA5IUCU55V7TAQO8Rw,18028 +flask_admin/static/bootstrap/bootstrap3/swatch/journal/bootstrap.min.css,sha256=bPSyJP9-ovy9_YbIwvZyX6r2M4PkiF01vt0zuDLUEzs,125898 +flask_admin/static/bootstrap/bootstrap3/swatch/lumen/bootstrap.min.css,sha256=kBMbBs0vxJSlN7T3a7hOLllj53zib5nbF7rn4NAKy04,131950 +flask_admin/static/bootstrap/bootstrap3/swatch/paper/bootstrap.min.css,sha256=wxkG5XFuJCaAsW7HybsodlioK5sM2t1H84KYzedhqv4,142226 +flask_admin/static/bootstrap/bootstrap3/swatch/readable/bootstrap.min.css,sha256=xZf1oKvAz2ou2qhEduvwW4dDmGlmHADVup7mEqdKU6k,125938 +flask_admin/static/bootstrap/bootstrap3/swatch/sandstone/bootstrap.min.css,sha256=Ay17X_itZzhUFkDfLB9MICE7tbVwtPuFhcwDpABdbEA,126330 +flask_admin/static/bootstrap/bootstrap3/swatch/simplex/bootstrap.min.css,sha256=4nVETqQoIoCwuephcXpJ501G8B5sgBHb1ZsKU_D476I,128948 +flask_admin/static/bootstrap/bootstrap3/swatch/slate/bootstrap.min.css,sha256=JcgoO7qVianjbv43Z5KinReHzk9_rEZg5m6z_ZZy3DI,143109 +flask_admin/static/bootstrap/bootstrap3/swatch/spacelab/bootstrap.min.css,sha256=gilrHoeI7xN44XwhZ-J4FbeZBomJkn5lO9JMP9N9QtU,132623 +flask_admin/static/bootstrap/bootstrap3/swatch/superhero/bootstrap.min.css,sha256=o0IkLyCCWGBI-ryg6bL44_f8s4cb7-5bncR4LvU57a8,127946 +flask_admin/static/bootstrap/bootstrap3/swatch/united/bootstrap.min.css,sha256=nKQVXFJ5JtDJlI5p1UcSf0JOFudCj9RgjBDsJSZPsS4,124248 +flask_admin/static/bootstrap/bootstrap3/swatch/yeti/bootstrap.min.css,sha256=DmWZgrCVFhJOPG5TQv5ktAALBjsJZU2reY1UrTgTUdQ,129095 +flask_admin/static/vendor/bootstrap-daterangepicker/README.md,sha256=sSycS4odsykNZI8CzPs_UVPBEWpAXNvT1TTXZU1YU6Y,7702 +flask_admin/static/vendor/bootstrap-daterangepicker/daterangepicker-bs2.css,sha256=lzb-Frrm7eKMZAcasWnLYoE5vpazbX-AWmV4fjGAmFE,6731 +flask_admin/static/vendor/bootstrap-daterangepicker/daterangepicker-bs3.css,sha256=Ej49tRtrNtpzJgUcnl0ZCYhVnVukCGBz02gOADi0aXQ,6831 +flask_admin/static/vendor/bootstrap-daterangepicker/daterangepicker.js,sha256=powqdTX5ELAmuVYDfbK8dV4MeT3LRXXm9xTeb21LWA4,55552 +flask_admin/static/vendor/jquery.min.js,sha256=FgpCb_KJQlLNfOu91ta32o_NMZxltwRo8QtmkMRdAu8,86927 +flask_admin/static/vendor/leaflet/images/layers-2x.png,sha256=Bm2sqFDY_77wB68AsG6sABVyje4nnFHzy2xxbffELt8,1259 +flask_admin/static/vendor/leaflet/images/layers.png,sha256=Hbvp0CjikvNvy6j4s6KNXokydU_CIVuaxp5M3s9RB8Y,696 +flask_admin/static/vendor/leaflet/images/marker-icon-2x.png,sha256=LXei5MLwi7rEGAgyTvlGuaL-YbYVBIDQEbcrN5w7I40,2586 +flask_admin/static/vendor/leaflet/images/marker-icon.png,sha256=V0w6XMqF9BFAhbaEFZbWLwDXyJLHsD8oy_owHesdxDc,1466 +flask_admin/static/vendor/leaflet/images/marker-shadow.png,sha256=Jk9cZAM58ELdcpBiz8BMF_jqDymIK1OOOEjtjxDttNo,618 +flask_admin/static/vendor/leaflet/images/spritesheet-2x.png,sha256=-iyV4GEPN4fIeWReQrhq0BDDBfgxLhFoQXMNANSrcrc,3581 +flask_admin/static/vendor/leaflet/images/spritesheet.png,sha256=qJeKHT0h2O5vFszjQv9n_EfEJB9SFh8FuviPFeEFgZk,1906 +flask_admin/static/vendor/leaflet/images/spritesheet.svg,sha256=cHe66WgEcYCSEyTfNR2V_i8CHNrvoB4gZFFiQC92faQ,5551 +flask_admin/static/vendor/leaflet/leaflet.css,sha256=YR4HrDE479EpYZgeTkQfgVJq08-277UXxMLbi_YP69o,14106 +flask_admin/static/vendor/leaflet/leaflet.draw.css,sha256=XzD3RpaHPv7lzX9qt-2n1j5cWj48O24KsgaGYpKN8x8,5267 +flask_admin/static/vendor/leaflet/leaflet.draw.js,sha256=nHHJ2jX4QJJzbZvNtrWt4U3kuIcn554Pmb5FrxuJ4UM,67542 +flask_admin/static/vendor/leaflet/leaflet.js,sha256=ZAwf2csg6-qXA0a8opGvRl5G0MyBuPRQx5cj0htt9pI,140540 +flask_admin/static/vendor/leaflet/leaflet.js.map,sha256=jwNaRzkJ5j3-YZSXHDfM44a2VmEvANueep61ULHEZts,191113 +flask_admin/static/vendor/moment.min.js,sha256=CutOzxCRucUsn6C6TcEYsauvvYilEniTXldPa6_wu0k,51679 +flask_admin/static/vendor/select2/LICENSE,sha256=S9WG6v1NuRmTqF3T9uXjcJiHN12joFJwwqkigs8ND8s,939 +flask_admin/static/vendor/select2/select2-bootstrap3.css,sha256=4hblV1uSaPQqT-NtIEL4_IKzKE42_3DbJ6yfxWba24k,10412 +flask_admin/static/vendor/select2/select2-spinner.gif,sha256=9uz_YX7Cun9Vnm9TXK2bcKP5ESBzdTXatNRUimyDV2w,1849 +flask_admin/static/vendor/select2/select2.css,sha256=Spikmq7sM2lXSGz7lfu9roWvAcH3LMjLMM6Ol6Bd3Zc,19457 +flask_admin/static/vendor/select2/select2.min.js,sha256=HzzZFiY4t0PIv02Tm8_R3CVvLpcjHhO1z_YAUCp4oQ4,66596 +flask_admin/static/vendor/select2/select2.png,sha256=1rXY2D28GPuNd8h2HTMc2eUSPJaElQurBAbpiiSsWug,613 +flask_admin/static/vendor/select2/select2x2.png,sha256=b-KNaH3A7U2WAWI4xgi6HnGYycmsz6CzYLeAGLn7m8I,845 +flask_admin/static/vendor/x-editable/css/bootstrap2-editable.css,sha256=YsJ7Lkc_YB0-ssBKz0c0GTx0RI-BnXcKH5SpnttERaY,21202 +flask_admin/static/vendor/x-editable/css/bootstrap3-editable.css,sha256=YsJ7Lkc_YB0-ssBKz0c0GTx0RI-BnXcKH5SpnttERaY,21202 +flask_admin/static/vendor/x-editable/img/clear.png,sha256=Pnyndng5VsBSEIPd1Zt3LjwYpeZQHDAmN1KO26QhN4o,509 +flask_admin/static/vendor/x-editable/img/loading.gif,sha256=9uz_YX7Cun9Vnm9TXK2bcKP5ESBzdTXatNRUimyDV2w,1849 +flask_admin/static/vendor/x-editable/js/bootstrap2-editable.min.js,sha256=X4MwfaZHjmW7fCwSh5_QfABzCTg6GgoebRBkUiTmFok,79461 +flask_admin/static/vendor/x-editable/js/bootstrap3-editable.min.js,sha256=-fnaOx6GCnrPNNkJicdgSX4Vtl5jpxdMGykaxRQjDi4,75909 +flask_admin/templates/bootstrap2/admin/actions.html,sha256=9ANWgp0cuwOGeBc5hQW2U6bnKCJK7T88JLNg50W07bU,1385 +flask_admin/templates/bootstrap2/admin/base.html,sha256=1BvhOnsqH-yrYFkwz4pAOcjK5LXWhOsIamh7CiXBpZY,3259 +flask_admin/templates/bootstrap2/admin/file/form.html,sha256=6oediIwYOX1LT0JJHuUGtG5vXMQJTFwGAhq3apoQNnk,258 +flask_admin/templates/bootstrap2/admin/file/list.html,sha256=qjQ7lBDJt78tBcgt8ikYwhVQfkYh-PaX7uZBvidj_gw,8680 +flask_admin/templates/bootstrap2/admin/file/modals/form.html,sha256=vaQjdSv9NTyQLIf7JL-j4qL3ZdsitvNb6BSGpQJx9p0,575 +flask_admin/templates/bootstrap2/admin/index.html,sha256=k7kyqU7y7x-ssclCeTRcbJz5f9t5Kxu7SHojzquTVuU,67 +flask_admin/templates/bootstrap2/admin/layout.html,sha256=zWCWgY0V2nCA7lSIc7-MYxeQKmp4SnF5zKy2ah-aCdQ,3713 +flask_admin/templates/bootstrap2/admin/lib.html,sha256=RlGrxtWD8_U5ghz8rU0oUSnIFXwIry_pPgWMSC0wOc8,8528 +flask_admin/templates/bootstrap2/admin/master.html,sha256=VOvi-35MLhhQ2B-FVSpEpChSVBm-YPjc1gowFo6PUus,34 +flask_admin/templates/bootstrap2/admin/model/create.html,sha256=jbBytE4ZpSDvDLAS24HE7DZzh2GgXaeKRisGARU7huQ,705 +flask_admin/templates/bootstrap2/admin/model/details.html,sha256=420gfnWglkTsxfb7d5xpEEby1hheLVrie4LxXLjtZtU,1475 +flask_admin/templates/bootstrap2/admin/model/edit.html,sha256=jTvc5t4YEYsKrRL7ffK6Zgs1vUybwPJGEh2z6aEy8K0,1070 +flask_admin/templates/bootstrap2/admin/model/inline_field_list.html,sha256=26efVMjeg7Fml1spJ-rW4MVEqRMCmijdRmQ9GanZAEE,399 +flask_admin/templates/bootstrap2/admin/model/inline_form.html,sha256=fGdpW0gsrj3gwcJv-MvAeDRtdpkNF6N6u6NeGrr_pYI,153 +flask_admin/templates/bootstrap2/admin/model/inline_list_base.html,sha256=sTl8vZq3coGiWqLdXR6FvIHDIvLhbEW6y-vgf7DL33I,1979 +flask_admin/templates/bootstrap2/admin/model/layout.html,sha256=e7llb66kjudL5lPbd3loyTNM3wRXo-nFSdxNiJuq5G0,4558 +flask_admin/templates/bootstrap2/admin/model/list.html,sha256=jIjVGE5xT2aGdtSbIc72AH3uW1aNMCVXuoDaXHpHI6s,7694 +flask_admin/templates/bootstrap2/admin/model/modals/create.html,sha256=oYa5SYkfN-Y5ZhNWJO8kypWOY2UC-pDmhTKEVNi2KVw,874 +flask_admin/templates/bootstrap2/admin/model/modals/details.html,sha256=bt5RnjvGUnimJO0HHNW7KbMDoQkZUp3MMOSDquTdPV0,1214 +flask_admin/templates/bootstrap2/admin/model/modals/edit.html,sha256=_QialcCpW3ShZgV05gANMCgwP8e1xV_oPOt_Mzm80Ac,919 +flask_admin/templates/bootstrap2/admin/model/row_actions.html,sha256=sAVE0YL147TWWCCle9n8PyGMcsEPL8TCnYeyn6VWXX8,1679 +flask_admin/templates/bootstrap2/admin/rediscli/console.html,sha256=7FLsT7S5AKbithhSzFEK9MSSh1D3soEnUxLbXp0ITpM,777 +flask_admin/templates/bootstrap2/admin/rediscli/response.html,sha256=REohKzrxl9QSmpVaELGpnh_0zUZEdo_bWp_XtSiixjU,851 +flask_admin/templates/bootstrap2/admin/static.html,sha256=fLO0UG2klNUjw7v04UVjFqcnaCJ-B4SzmLpXe9vGGZc,89 +flask_admin/templates/bootstrap3/admin/actions.html,sha256=TJFEKJ5q2xOs2YMfm65_GdaE1_JJ7gDHRseW7HeBgzw,1389 +flask_admin/templates/bootstrap3/admin/base.html,sha256=RbGjxjOVH2fYo86MOikF2nRyY8Lh2ChALFOXyn5NzwI,4148 +flask_admin/templates/bootstrap3/admin/file/form.html,sha256=6oediIwYOX1LT0JJHuUGtG5vXMQJTFwGAhq3apoQNnk,258 +flask_admin/templates/bootstrap3/admin/file/list.html,sha256=xMHwu_kmTUpEdvhhYVadHDuTcpDVhogRtqMTlOPY8I8,8711 +flask_admin/templates/bootstrap3/admin/file/modals/form.html,sha256=JiShJEUx4Fik3MSGPZj0T0bOqn1ie1YKQexIPzQ5Cbk,698 +flask_admin/templates/bootstrap3/admin/index.html,sha256=k7kyqU7y7x-ssclCeTRcbJz5f9t5Kxu7SHojzquTVuU,67 +flask_admin/templates/bootstrap3/admin/layout.html,sha256=pTszbXYfYAZmXqfqzxiCd7380f-mRmBa8AW4oLf5aWI,4129 +flask_admin/templates/bootstrap3/admin/lib.html,sha256=6H8icIOp1wPcvxW4zS9YVdupSwRAItwTU-DgjU41H3Y,8655 +flask_admin/templates/bootstrap3/admin/master.html,sha256=VOvi-35MLhhQ2B-FVSpEpChSVBm-YPjc1gowFo6PUus,34 +flask_admin/templates/bootstrap3/admin/model/create.html,sha256=jbBytE4ZpSDvDLAS24HE7DZzh2GgXaeKRisGARU7huQ,705 +flask_admin/templates/bootstrap3/admin/model/details.html,sha256=I6qN_BlaK2r3wajVeMb7viMidw9Z-iFPikP3RxdvkAY,1447 +flask_admin/templates/bootstrap3/admin/model/edit.html,sha256=jTvc5t4YEYsKrRL7ffK6Zgs1vUybwPJGEh2z6aEy8K0,1070 +flask_admin/templates/bootstrap3/admin/model/inline_field_list.html,sha256=ihW9o-8fGrS0gYJ_JGPexqB5zFL179EjEMvreculOU8,410 +flask_admin/templates/bootstrap3/admin/model/inline_form.html,sha256=fGdpW0gsrj3gwcJv-MvAeDRtdpkNF6N6u6NeGrr_pYI,153 +flask_admin/templates/bootstrap3/admin/model/inline_list_base.html,sha256=XeZRlst494GllHdCq1BYKHpXKPMkSWzuo0KHHq_QlJs,2206 +flask_admin/templates/bootstrap3/admin/model/layout.html,sha256=xokACo_WhkP43rNdfz5wWBOYxELvwOSn3YHWof7jlXQ,4845 +flask_admin/templates/bootstrap3/admin/model/list.html,sha256=oMbVaYZvm9Dfld9PCxHnsJsm3AXeQiUL15VGCK-6Cp0,7773 +flask_admin/templates/bootstrap3/admin/model/modals/create.html,sha256=9wvyMtYe-i1UIckxmVvK1Oj_cLmgER7BKCzwbH79ELY,984 +flask_admin/templates/bootstrap3/admin/model/modals/details.html,sha256=p6Q0EydXbDmhWux4XkcLfa5l24x2-6cgnC_9ocEHoqA,1306 +flask_admin/templates/bootstrap3/admin/model/modals/edit.html,sha256=5OZPv5ZiiYU328wmIwnAshylimj5J3Rkzmy7JVlVmII,1050 +flask_admin/templates/bootstrap3/admin/model/row_actions.html,sha256=ebaUF92bJ0pDMroxMAJbohQM5_n-EYd5AfUXMEfcYRg,1736 +flask_admin/templates/bootstrap3/admin/rediscli/console.html,sha256=O5Pet4Yd9FyvI7pf_BxkkrZ464rGZagF_W-Y6i2qHqY,777 +flask_admin/templates/bootstrap3/admin/rediscli/response.html,sha256=REohKzrxl9QSmpVaELGpnh_0zUZEdo_bWp_XtSiixjU,851 +flask_admin/templates/bootstrap3/admin/static.html,sha256=fLO0UG2klNUjw7v04UVjFqcnaCJ-B4SzmLpXe9vGGZc,89 +flask_admin/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +flask_admin/tests/__pycache__/__init__.cpython-38.pyc,, +flask_admin/tests/__pycache__/mock.cpython-38.pyc,, +flask_admin/tests/__pycache__/test_base.cpython-38.pyc,, +flask_admin/tests/__pycache__/test_form_upload.cpython-38.pyc,, +flask_admin/tests/__pycache__/test_helpers.cpython-38.pyc,, +flask_admin/tests/__pycache__/test_model.cpython-38.pyc,, +flask_admin/tests/__pycache__/test_tools.cpython-38.pyc,, +flask_admin/tests/data/copyleft.gif,sha256=IHNmVMloJGuCeJAZ-Rv-V2m26fb5d78iTmZrTK6qwNA,1572 +flask_admin/tests/data/copyleft.jpeg,sha256=I7ryhqOw8Fg7Sh9jgyE16SuNFx30pxWsNYCq2rQWpi8,12743 +flask_admin/tests/data/copyleft.jpg,sha256=XftCsEY0XQ6Kp3TVqDTArhTTLcS8Nb7myAN_lceEluQ,13546 +flask_admin/tests/data/copyleft.png,sha256=_xYvshAqowO039H-GSIyIhfM-zzGxvZJlCKArCaa4_k,6889 +flask_admin/tests/data/copyleft.tiff,sha256=iQALrmj1CJ6EZnuqzpDBK0J_iDzUWEk0q8pha0t62ow,7926 +flask_admin/tests/fileadmin/__init__.py,sha256=MA2Ck1m13QEWwIc-VO45DSINy63xpXLxiN2h84BbnY4,215 +flask_admin/tests/fileadmin/__pycache__/__init__.cpython-38.pyc,, +flask_admin/tests/fileadmin/__pycache__/test_fileadmin.cpython-38.pyc,, +flask_admin/tests/fileadmin/__pycache__/test_fileadmin_azure.cpython-38.pyc,, +flask_admin/tests/fileadmin/files/dummy.txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +flask_admin/tests/fileadmin/test_fileadmin.py,sha256=Z3kThd0T2Lgstvu9RHbZ-12oaqRotwI4O1fwV6bLqmA,8873 +flask_admin/tests/fileadmin/test_fileadmin_azure.py,sha256=pWlf3tYxGzQ4feE1ql54fbNpw0SSzGmHsVeu9X3zLhY,1208 +flask_admin/tests/geoa/__init__.py,sha256=pmkOnd3jKFIq4aisT3T3MzCOSksGgjfwEKXxHfN3g5U,469 +flask_admin/tests/geoa/__pycache__/__init__.cpython-38.pyc,, +flask_admin/tests/geoa/__pycache__/test_basic.cpython-38.pyc,, +flask_admin/tests/geoa/test_basic.py,sha256=XGnwU4doiCx89q8b_ffqkg4mgceQdukl5OLUwt2OnWs,5323 +flask_admin/tests/mock.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +flask_admin/tests/mongoengine/__init__.py,sha256=QLExTUcTR1W356r6I2AGf282BhpVm8Qy5SCpVCi306E,675 +flask_admin/tests/mongoengine/__pycache__/__init__.cpython-38.pyc,, +flask_admin/tests/mongoengine/__pycache__/test_basic.cpython-38.pyc,, +flask_admin/tests/mongoengine/test_basic.py,sha256=CY1IdKoWgsKfsdCGKZg4Ygh3a-03jyEilqHgAOFuuxI,34671 +flask_admin/tests/peeweemodel/__init__.py,sha256=IHLQSLXnwLRq4FsWVjcCClZWoM_4DZdVaeDcTfaq0v8,334 +flask_admin/tests/peeweemodel/__pycache__/__init__.cpython-38.pyc,, +flask_admin/tests/peeweemodel/__pycache__/test_basic.cpython-38.pyc,, +flask_admin/tests/peeweemodel/test_basic.py,sha256=TMU2yuhuINUauRnvFmvPQs7KsSebXZfnsCtHk2Wcw5A,32355 +flask_admin/tests/pymongo/__init__.py,sha256=wyuzdNexdWGjr44nBsa5FEbEX-NdKDBCaPg2Z4yswmI,289 +flask_admin/tests/pymongo/__pycache__/__init__.cpython-38.pyc,, +flask_admin/tests/pymongo/__pycache__/test_basic.cpython-38.pyc,, +flask_admin/tests/pymongo/test_basic.py,sha256=BFcefzomvLytXoo5vfvFaFQ0glnK7BWGAIR5NPQdMwo,1974 +flask_admin/tests/sqla/__init__.py,sha256=EWpY23qaDPMJRjGt5Wumev1sA4WoQdqp_15_MjGatqE,824 +flask_admin/tests/sqla/__pycache__/__init__.cpython-38.pyc,, +flask_admin/tests/sqla/__pycache__/test_basic.cpython-38.pyc,, +flask_admin/tests/sqla/__pycache__/test_form_rules.cpython-38.pyc,, +flask_admin/tests/sqla/__pycache__/test_inlineform.cpython-38.pyc,, +flask_admin/tests/sqla/__pycache__/test_multi_pk.cpython-38.pyc,, +flask_admin/tests/sqla/__pycache__/test_postgres.cpython-38.pyc,, +flask_admin/tests/sqla/__pycache__/test_translation.cpython-38.pyc,, +flask_admin/tests/sqla/templates/another_macro.html,sha256=ipd-oVymeJ-wjhyfV0jwaV7XaowZmB8hj_SZ8rJGG4A,63 +flask_admin/tests/sqla/templates/macro.html,sha256=ggfF4tddzGL0z3q2mBgNO8jJctARtnIX3LxPCYNSkbk,223 +flask_admin/tests/sqla/test_basic.py,sha256=776k7xaQwan8N01JrVUMsFbKeoTxDlJhpW2C_FYnz7U,78547 +flask_admin/tests/sqla/test_form_rules.py,sha256=LyrLmTIZbfW5hwvkLl_TwYRlQxBf6RW-9QQ0Lz2PT5s,3996 +flask_admin/tests/sqla/test_inlineform.py,sha256=V46kIypKEQW0S-ZAuevRgeJZPnffDwHXJh_02_bRJGU,8366 +flask_admin/tests/sqla/test_multi_pk.py,sha256=OUU8nYNsroVwBMQas12OEVP_DeZXUj0VzdR0faihBWM,5501 +flask_admin/tests/sqla/test_postgres.py,sha256=DbpdqF-zXG2uST1CCzHwQAXfVHyusSP2mMMffUgKfEk,2951 +flask_admin/tests/sqla/test_translation.py,sha256=YUjdNu_nxjG4msFmmvIpXdjWh6ojocxPcl0T298B4OI,789 +flask_admin/tests/templates/method.html,sha256=f3q0Lw3MnAHZjCeioeYm24WUP1O-ATqZySL70liAoYc,33 +flask_admin/tests/templates/mock.html,sha256=dY0Wee8W5nA6kQtH2se0mxSgwvpt4AYytQVHnWGhCnM,55 +flask_admin/tests/test_base.py,sha256=1me58PoE8wojJ1Qw8BfXgFNhL33jZIKy37mo0Jc43Qs,11434 +flask_admin/tests/test_form_upload.py,sha256=yTxn_EF014SGxzSnabYo0L99C7HCOCHd2d0m_Z0wuWA,8637 +flask_admin/tests/test_helpers.py,sha256=f2sHNWY0L-VAVQauuYfQ6nO69vJ0TJMk5QKnzLLm9k4,1086 +flask_admin/tests/test_model.py,sha256=WlzFpst-ZWvFGgo8Mnrhy_pqJaxNSqGqXGUfy4n_IfU,24544 +flask_admin/tests/test_tools.py,sha256=nVkpnttPS5KLf4nc-l_EZP10EHN732Fndxj4aFvGAEc,614 +flask_admin/tools.py,sha256=FzR_tjEpPHMJN-rPrIJhCk6AL_R0IA8qnLXeAZ-wZ5s,3619 +flask_admin/translations/README.md,sha256=JzesHC4rdmo3ABBUugLKJWSbmGhGoept2KIDuuaT7qM,87 +flask_admin/translations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +flask_admin/translations/__pycache__/__init__.cpython-38.pyc,, +flask_admin/translations/af/LC_MESSAGES/admin.mo,sha256=cYQE0NRAINRTMLDZeuPoHD5_Ry0PHxS8GFpmahqEYdU,7085 +flask_admin/translations/af/LC_MESSAGES/admin.po,sha256=Qgvk1CWw7nJAtHW4qF5kw20k0m530mboXFhcpiYS2WE,23241 +flask_admin/translations/ar/LC_MESSAGES/admin.mo,sha256=ZoLu2on72eM78aYcMN1ZtXuISORYTQFa72JmgrpdvFQ,8634 +flask_admin/translations/ar/LC_MESSAGES/admin.po,sha256=IrECiKd8EH5V-q36pZP0SK-tsvCldssyH4rDUiPNpA8,24678 +flask_admin/translations/be/LC_MESSAGES/admin.mo,sha256=erOnpQQ08MkPFhHsxz-ivC48IMpK4e_OXFaumm_vYSE,9332 +flask_admin/translations/be/LC_MESSAGES/admin.po,sha256=t6MAq28qEzPT14oqetGbT3ET4sGRUjC6XPGkFLoVdQU,25733 +flask_admin/translations/ca_ES/LC_MESSAGES/admin.mo,sha256=qUs7oyF1Bk5yDhT5WXvJQcWQmElXhf11vWi_J5MdUyQ,7451 +flask_admin/translations/ca_ES/LC_MESSAGES/admin.po,sha256=3nonN5OcbesjejCe58QlHLnQ9CRwrMV4_8tnMZ_BCmw,23537 +flask_admin/translations/cs/LC_MESSAGES/admin.mo,sha256=rxGKpAxLyUVXvQhuYxD7LUz4rYpQ6p-nQGuwEAmuz4g,7585 +flask_admin/translations/cs/LC_MESSAGES/admin.po,sha256=vJ1Ah2ZgH-SQaf1V0ZZtsTGfpN2AyUZvT0Z6-6JVtCg,23662 +flask_admin/translations/da/LC_MESSAGES/admin.mo,sha256=i9-rI3mqRDgwbXv8ExMimKZ3Flwv2IkOjY36pMewOZ0,7143 +flask_admin/translations/da/LC_MESSAGES/admin.po,sha256=6uEYDphHZo4Wtp3Mg0AtOxhZhQ1plNkOtGlc6ntIPaY,23233 +flask_admin/translations/de/LC_MESSAGES/admin.mo,sha256=NM1qZr2FR7PI2G7IWffajbYKR0QFjyjoFiOlLpWyNVU,7813 +flask_admin/translations/de/LC_MESSAGES/admin.po,sha256=scnQFkwXoPmBzHvLtnoUNRunc7bZrMINm16oGfkgtYg,24191 +flask_admin/translations/el/LC_MESSAGES/admin.mo,sha256=D2rmNQadMni8arJJB74eTzkN3VUsF8jIHCM0HGLfQxM,9711 +flask_admin/translations/el/LC_MESSAGES/admin.po,sha256=xf6-hcIh2FtHm60QfbQ_LPxTYb2K_v2Kif5Q3DUs81w,25857 +flask_admin/translations/en/LC_MESSAGES/admin.mo,sha256=rrG7hxjlC-0-S6eElcGquE1gi8zQ8Ow_t9NDQjALj6k,6258 +flask_admin/translations/en/LC_MESSAGES/admin.po,sha256=YC5nf3pyUg2GBgzCLXyWF-rsFuUF512HJErpfyxsya8,17596 +flask_admin/translations/es/LC_MESSAGES/admin.mo,sha256=nQf83JQez6oDRJE-WIXCz3HHHakx5a4NrpIiqneKo0k,7693 +flask_admin/translations/es/LC_MESSAGES/admin.po,sha256=GJq9cl7TD2MV6oWgR324fELCDRPNn5txMvjB9vEsulU,24072 +flask_admin/translations/et/LC_MESSAGES/admin.mo,sha256=wDss00QFgaJ13_WXjP7c9ww5sqS1bElKvOtUjRJttTE,7326 +flask_admin/translations/et/LC_MESSAGES/admin.po,sha256=fA_5ivoQBvzBQoOfuL_v_Y51u19_nTaKhoM0kQgQzGo,23543 +flask_admin/translations/fa/LC_MESSAGES/admin.mo,sha256=gyg9_Kt2SluctOpRvaIgtGTXwEFkDM7sWGw85Jg3X0g,8605 +flask_admin/translations/fa/LC_MESSAGES/admin.po,sha256=PxHhOXVBo6c35db73jIVbTaWsezhiwPi6Pc2_rmbfrA,24752 +flask_admin/translations/fi/LC_MESSAGES/admin.mo,sha256=vzk14U7k6xkDVr1kDPuu1kaT2xiOyYYobrUmKKMfvSg,7514 +flask_admin/translations/fi/LC_MESSAGES/admin.po,sha256=7kOKqggrX67x2fmoPygn4VffFLxujURcD7UsxMdvze8,23602 +flask_admin/translations/fr/LC_MESSAGES/admin.mo,sha256=CQ83MnB5vTJi2m1zYjfp2vrceJs-r9uDy5OEN_1dKMA,7865 +flask_admin/translations/fr/LC_MESSAGES/admin.po,sha256=oNDpoGExL_n4b_ew42tKjJVHJtjEArb1NIoQ7lxb7Xs,24112 +flask_admin/translations/he/LC_MESSAGES/admin.mo,sha256=OkCTERqvAC9-FjtE4K_pp8jWuDME_q8tieEUMyVY4a4,8153 +flask_admin/translations/he/LC_MESSAGES/admin.po,sha256=5Bd2R989K-dZ-MT7V3Uzt0qtP7rqH0OSUx-Fkn-cjmI,24219 +flask_admin/translations/hu/LC_MESSAGES/admin.mo,sha256=ABACuE9zFC6Ng7at8m47UWd9UqZMJ4hqD805cgJ6_0M,7583 +flask_admin/translations/hu/LC_MESSAGES/admin.po,sha256=fS0Wu6ryqlZ_pFSNA8iDsJ9S3UGodykCvf0y7X0u_QI,23800 +flask_admin/translations/it/LC_MESSAGES/admin.mo,sha256=F1Fg8sT8S66CoLJ_fQx5JIpRviosfAxrWBB12WWZ2Z4,7566 +flask_admin/translations/it/LC_MESSAGES/admin.po,sha256=vutYxF2p3k4rsZ7sYUflZJccQC2zQNEyUu_bB4rJpyo,23933 +flask_admin/translations/ja/LC_MESSAGES/admin.mo,sha256=AHjGKXzO2B7D1DVZSCBvcuyE97mfXwzS4LWboPpoFP4,8477 +flask_admin/translations/ja/LC_MESSAGES/admin.po,sha256=c-8faaTyzI4A_kbwi8IKg-oU9uBNZNmhghbNGJO0kLI,24774 +flask_admin/translations/ko/LC_MESSAGES/admin.mo,sha256=hMYJqi3iqrPaiIvBgbJgi_G6EvB69VcRhvI3XJDMdyA,7853 +flask_admin/translations/ko/LC_MESSAGES/admin.po,sha256=JugIzWY8IBAyN-lmAHbwgesRcA5ugNQ0fF9M-ZgYtBs,24196 +flask_admin/translations/nl/LC_MESSAGES/admin.mo,sha256=ZIq8Fu0Umx7aQNDvcfiQfq8BcDm1WmC7gX5_V16Chro,7592 +flask_admin/translations/nl/LC_MESSAGES/admin.po,sha256=sBAdh5Qu_AFKSnVxvdsHpyaPGEZFdrYhgOAB3Nh6bfs,23924 +flask_admin/translations/no/LC_MESSAGES/admin.mo,sha256=CPrkTQwBbJoiJLwme1lGyNy85SuBLinNcNYxgGVzBww,7111 +flask_admin/translations/no/LC_MESSAGES/admin.po,sha256=J6x4CgLpCO3Ce3z4VCR2afRIKG5ocfeVmEuRqZm7TkE,23196 +flask_admin/translations/pa/LC_MESSAGES/admin.mo,sha256=R1lWxSTIccycaE-eN-GJaOiwFFm3SxNkXK2OIMpPeKk,10486 +flask_admin/translations/pa/LC_MESSAGES/admin.po,sha256=6o0fTYIQksug9LidrmSWIZoA2i9u0BJ7ezfYhA78zx8,26577 +flask_admin/translations/pl/LC_MESSAGES/admin.mo,sha256=9ULn85OpmfF9xHWNhrOTGn6NEng6SCvHdE57gbUr2G0,7702 +flask_admin/translations/pl/LC_MESSAGES/admin.po,sha256=EtjC89daldueeUS_hVBge0Q8bvCI-dXuM0e32A8HldU,24059 +flask_admin/translations/pt/LC_MESSAGES/admin.mo,sha256=6Ceh7NONtCAGsECkhQ7SAVZWsMif_Qtsqf6qDk4l6sw,7481 +flask_admin/translations/pt/LC_MESSAGES/admin.po,sha256=NTyBrZ2DfYUhVmYvgqdcS_OXT51kK6Gp8K55OffjdMU,23630 +flask_admin/translations/pt_BR/LC_MESSAGES/admin.mo,sha256=hdTlH8jA7nWQp1qywic58cU-ypc-WzRZ_xYfdJYeuUg,7559 +flask_admin/translations/pt_BR/LC_MESSAGES/admin.po,sha256=-1dKYBlI0KyNCqa_2vDbm5yECM-OLpoB7CZGL_3QzEQ,23926 +flask_admin/translations/ro/LC_MESSAGES/admin.mo,sha256=R4OTDPgFu1meHI3uN72SOSfK_1XsPrmPkcu4OfhiPno,7710 +flask_admin/translations/ro/LC_MESSAGES/admin.po,sha256=4q1opfYoV1yVsoH8t9sYL5tXFERxeR0FY8y9vQsEIjQ,23787 +flask_admin/translations/ru/LC_MESSAGES/admin.mo,sha256=AeEsvvlkic_ld_8Wm58tCQabga5DH5zPJYktmWTc2SE,9473 +flask_admin/translations/ru/LC_MESSAGES/admin.po,sha256=ZMn8qaHOG4phk601LmP8w_S0npR7liraW88d6ZRlulg,25870 +flask_admin/translations/sk/LC_MESSAGES/admin.mo,sha256=IEaHBNMnLjaxaUxRJ5psCl2ijuOE8M6WFGc7G87pEGM,7748 +flask_admin/translations/sk/LC_MESSAGES/admin.po,sha256=LihrEVQsmvOrgNI8fhek67OvFp9zYggfm04jW2hZ2Tg,24105 +flask_admin/translations/sr/LC_MESSAGES/admin.mo,sha256=nKAcKU_WToJv8FqlDvVsrAHddoQrpdGVSt0WXskPFgg,7586 +flask_admin/translations/sr/LC_MESSAGES/admin.po,sha256=v3hTKuKG48v7SILf6wGDrrIDPPl1oUWEcpw-HdB_z1Q,23754 +flask_admin/translations/sv/LC_MESSAGES/admin.mo,sha256=k0ZYCfR9g9r5lRWonJbizxgxZ0XcsQNSoYnDgWVKcUE,7270 +flask_admin/translations/sv/LC_MESSAGES/admin.po,sha256=IB7aJCILg5JXW72LFr7jyUwJug81znKsG2fKL7DDuxw,23430 +flask_admin/translations/tr/LC_MESSAGES/admin.mo,sha256=Dn1OPhQaih3sx3XzyjVJ7pBlj9Ljvp6VXzxqFLCPKd8,7585 +flask_admin/translations/tr/LC_MESSAGES/admin.po,sha256=UmpXNrhzCdhdo1QtKeoiw6msBzNt9nJIFn8JUdhtt8Q,23960 +flask_admin/translations/uk/LC_MESSAGES/admin.mo,sha256=UYv8OwFCGXztiLywCm_wLaTgLP8mkCZDpBlBAebaamA,9410 +flask_admin/translations/uk/LC_MESSAGES/admin.po,sha256=Yu3hrG1lYETFeD_SFzUjJXcLMz917JIkJ25Q_GcimyY,25791 +flask_admin/translations/vi/LC_MESSAGES/admin.mo,sha256=M7WAT4aMNvxpxdC5habwzJhqKnSnSVZKY-76BoPToK0,7820 +flask_admin/translations/vi/LC_MESSAGES/admin.po,sha256=7-57at91h-yW6SYe_3uax8RoUo_o6FD8y1YQaFk_o0A,24019 +flask_admin/translations/zh_Hans_CN/LC_MESSAGES/adding_a_new_model_backend.po,sha256=3PgEdspB85o45UvEgntgSWd8U05Q0xVvU4WvBK_d5PA,14939 +flask_admin/translations/zh_Hans_CN/LC_MESSAGES/admin.mo,sha256=nChLeC5ae1clKaN3gIOSriZ5l1_l3DLvH6B6bXlr5xI,7054 +flask_admin/translations/zh_Hans_CN/LC_MESSAGES/admin.po,sha256=ca3jpf5zfNadhvbwdAWgeXTH5UcwwUr03K5hGaq7DT0,23387 +flask_admin/translations/zh_Hans_CN/LC_MESSAGES/advanced.po,sha256=f2RyOOYGD2R6E8ZenRrkdoukyv_y6fRBKi_yaZQ5zsw,40788 +flask_admin/translations/zh_Hans_CN/LC_MESSAGES/api.po,sha256=Qqll5JCfhGb3xKSX3zwrmycGq-Q-tmW8Yxg0KRK2gJ4,92592 +flask_admin/translations/zh_Hans_CN/LC_MESSAGES/changelog.po,sha256=Nc_goT44AYSV_QRA79PizmzpO0WyYzhcRkiEBwxq0p4,4486 +flask_admin/translations/zh_Hans_CN/LC_MESSAGES/index.po,sha256=DpAxAiu5U6Jd2vnN3MeAluDUAmSCRHcxKrWcEGF_2n8,3920 +flask_admin/translations/zh_Hans_CN/LC_MESSAGES/introduction.po,sha256=_9657SfYsk_eXejC70isThXZpuwkKf8hPaYZED33-WM,30179 +flask_admin/translations/zh_Hant_TW/LC_MESSAGES/admin.mo,sha256=WK2XyrEYcUpW-jhg0B64NPjxhucEe8EZ4Wqflo_UUgw,7182 +flask_admin/translations/zh_Hant_TW/LC_MESSAGES/admin.po,sha256=AiQ0bfBneVdD-e4R_qHVKzexWnMeeVCzBhIriuxsLx4,23373 diff --git a/.venv/lib/python3.8/site-packages/Flask_Admin-1.5.6.dist-info/WHEEL b/.venv/lib/python3.8/site-packages/Flask_Admin-1.5.6.dist-info/WHEEL new file mode 100644 index 00000000..b552003f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_Admin-1.5.6.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.34.2) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/.venv/lib/python3.8/site-packages/Flask_Admin-1.5.6.dist-info/top_level.txt b/.venv/lib/python3.8/site-packages/Flask_Admin-1.5.6.dist-info/top_level.txt new file mode 100644 index 00000000..e95e3206 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_Admin-1.5.6.dist-info/top_level.txt @@ -0,0 +1 @@ +flask_admin diff --git a/.venv/lib/python3.8/site-packages/Flask_DebugToolbar-0.11.0.dist-info/INSTALLER b/.venv/lib/python3.8/site-packages/Flask_DebugToolbar-0.11.0.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_DebugToolbar-0.11.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/lib/python3.8/site-packages/Flask_DebugToolbar-0.11.0.dist-info/LICENSE b/.venv/lib/python3.8/site-packages/Flask_DebugToolbar-0.11.0.dist-info/LICENSE new file mode 100644 index 00000000..15d83092 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_DebugToolbar-0.11.0.dist-info/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Rob Hudson and individual contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of Django nor the names of its contributors may be used + to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.venv/lib/python3.8/site-packages/Flask_DebugToolbar-0.11.0.dist-info/METADATA b/.venv/lib/python3.8/site-packages/Flask_DebugToolbar-0.11.0.dist-info/METADATA new file mode 100644 index 00000000..2d9d8ee6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_DebugToolbar-0.11.0.dist-info/METADATA @@ -0,0 +1,245 @@ +Metadata-Version: 2.1 +Name: Flask-DebugToolbar +Version: 0.11.0 +Summary: A toolbar overlay for debugging Flask applications. +Home-page: https://flask-debugtoolbar.readthedocs.io/ +Author: Michael van Tellingen +Author-email: michaelvantellingen@gmail.com +Maintainer: Matt Good +Maintainer-email: matt@matt-good.net +License: BSD +Platform: any +Classifier: Development Status :: 4 - Beta +Classifier: Environment :: Web Environment +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Requires-Dist: Flask (>=0.8) +Requires-Dist: Blinker +Requires-Dist: itsdangerous +Requires-Dist: werkzeug + +Flask Debug-toolbar +=================== + +This is a port of the excellent `django-debug-toolbar `_ +for Flask applications. + +.. image:: https://travis-ci.org/mgood/flask-debugtoolbar.png?branch=master + :target: https://travis-ci.org/mgood/flask-debugtoolbar + + +Installation +------------ + +Installing is simple with pip:: + + $ pip install flask-debugtoolbar + + +Usage +----- + +Setting up the debug toolbar is simple:: + + from flask import Flask + from flask_debugtoolbar import DebugToolbarExtension + + app = Flask(__name__) + + # the toolbar is only enabled in debug mode: + app.debug = True + + # set a 'SECRET_KEY' to enable the Flask session cookies + app.config['SECRET_KEY'] = '' + + toolbar = DebugToolbarExtension(app) + + +The toolbar will automatically be injected into Jinja templates when debug mode is on. +In production, setting ``app.debug = False`` will disable the toolbar. + +See the `documentation`_ for more information. + +.. _documentation: https://flask-debugtoolbar.readthedocs.io/ + + +Changes +======= + +0.11.0 (2020-02-18) +------------------- + +Enhancements: + +- Switch to Flask's native CLI, dropping flask_script in the process (b92391d, thanks @jeffwidman) +- Do not show DebugToolbar routes in the route map (#86, thanks @floqqi) +- Document Pygments for SQL highlighting (#127, thanks @pgiraud) + +Fixes: + +- Remove deprecated flask.json_available (#119, thanks @davidism) +- Remove deprecated request.is_xhr (7ce099c, thanks @jeffwidman) +- Explicitly disable `SQLALCHEMY_TRACK_MODIFICATIONS` (9c7db48, thanks @jeffwidman) +- Fix typo (#142, thanks @timgates42) + + +0.10.1 (2017-02-12) +------------------- + +Enhancements: +- Add support for Python wheels + +Fixes: + +- Switch imports from deprecated flask.ext.* to flask_* syntax (#94, thanks + Michael Lenzen & #97 thanks Iuri de Silvio) + +0.10.0 (2015-04-17) +------------------- + +Enhancements: + +- Added new "Routes" panel displaying URL routing rules (#69, thanks Justin McKay) +- "Versions" panel displays versions of all installed packages (#49, thanks Lucas Taylor) +- SQLAlchemy displays necessary setup steps to set up query recording +- Support reformatting SQL queries if ``sqlparse`` library is available (#48, thanks Hyunjun Kim) +- Enable sorting SQLAlchemy queries (#81, thanks Eric Workman) +- Support inserting toolbar on HTML5 pages without ```` tag +- Log a warning if unable to insert the toolbar (#20, thanks Rune Halvorsen) + +Fixes: + +- Ensure numeric sorting of profiler "Calls" column + +0.9.2 (2014-12-05) +------------------ + +Fixes: + +- HTML escape SQL queries when syntax highlighting is not available +- Use case-insensitive comparison to normalize filenames on Windows +- Fix exception when SQL query contained non-ASCII characters + +0.9.1 (2014-11-24) +------------------ + +Fixes: + +- Fix SQL queries with byte strings on Python 3 +- Fix displaying values whose `repr()` contains unprintable characters + + +0.9.0 (2014-01-03) +------------------ + +Enhancements: + +- Python 3 compatibility (#54, thanks justinmayer and jmagnusson) +- Support .init_app() (#38) +- New "Config" panel displaying Flask config values (#51, thanks Alexey Diyan) +- Better PEP8-style formatting (#63, thanks Ivan Ivaschenko) + +Fixes: + +- Fix template editor with non-ASCII templates (#46) + + +0.8 (2013-02-21) +---------------- + +Enhancements: + +- Use `itsdangerous `_ to sign SQL queries +- Expose the jQuery object as ``fldt.$`` so extensions can use the toolbar's + copy of jQuery (#42) + +Fixes: + +- Don't intercept redirects on XHR requests (#41) +- Fix SQL query time display as milliseconds (#36) +- Fix ``functools.partial`` error (#35) +- Fix werkzeug request logging with logging panel (#33) +- Fix SQL panel unicode encoding error (#31) + + +0.7.1 (2012-05-18) +------------------ + +Fixes: + +- loading template editor in-place over current page + + +0.7 (2012-05-18) +---------------- + +Enhancements: + +- Add an in-browser template editor to the template panel +- ``DEBUG_TB_PROFILER_ENABLED`` config option to enable the profiler on all + requests (normally it is user-enabled by clicking the checkmark) + + +0.6.3.1 (2012-04-16) +-------------------- + +New release to add missing changelog for 0.6.3 + + +0.6.3 (2012-04-16) +------------------ +Fixes: + +- Compatibility with Flask-SQLAlchemy 0.16 package name + + +0.6.2 (2012-02-18) +------------------ + +Fixes: + +- Installation issue on Windows with trailing slashes in MANIFEST.in + +- JavaScript error when using conditional comments for ```` tag + (like in HTML5 Boilerplate) + + +0.6.1 (2012-02-15) +------------------ + +Fixes: + +- Memory leak when toolbar was enabled + +- UnicodeDecodeError when request data contained binary data (e.g. session values) + + +Enhancements: + +- ``DEBUG_TB_ENABLED`` config setting to explicitly enable or disable the toolbar + +- ``DEBUG_TB_HOSTS`` config setting to enable toolbar only for specific remote hosts + +- New logo for Flask instead of Django + +- Monospaced font on table data + +Thanks to kennethreitz and joeshaw for their contributions. + + +0.6 (2012-01-04) +---------------- + +Flask 0.8 or higher is required + +Enhancements: + +- Flask 0.8 compatibility + +Thanks to mvantellingen + + diff --git a/.venv/lib/python3.8/site-packages/Flask_DebugToolbar-0.11.0.dist-info/RECORD b/.venv/lib/python3.8/site-packages/Flask_DebugToolbar-0.11.0.dist-info/RECORD new file mode 100644 index 00000000..58ca4eed --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_DebugToolbar-0.11.0.dist-info/RECORD @@ -0,0 +1,197 @@ +Flask_DebugToolbar-0.11.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +Flask_DebugToolbar-0.11.0.dist-info/LICENSE,sha256=POJDLyHOgE_zUE4FHPlUtp9iPRvML6keKW5gBp5ojJc,1542 +Flask_DebugToolbar-0.11.0.dist-info/METADATA,sha256=HwpirA5RjSNVns0bKIc1zB7LWSxV4qxWcdEbh2sSeQQ,6052 +Flask_DebugToolbar-0.11.0.dist-info/RECORD,, +Flask_DebugToolbar-0.11.0.dist-info/WHEEL,sha256=kGT74LWyRUZrL4VgLh6_g12IeVl_9u9ZVhadrgXZUEY,110 +Flask_DebugToolbar-0.11.0.dist-info/top_level.txt,sha256=q_rGzSvh4On1p6rOCXTE2RZECzuunUC7vpqYKrA9pZU,19 +flask_debugtoolbar/__init__.py,sha256=VaYN5_2MnLXofXeeaqmrUIp2aAjnw8OKVU0FyWtBwGo,8490 +flask_debugtoolbar/__pycache__/__init__.cpython-38.pyc,, +flask_debugtoolbar/__pycache__/compat.cpython-38.pyc,, +flask_debugtoolbar/__pycache__/toolbar.cpython-38.pyc,, +flask_debugtoolbar/__pycache__/utils.cpython-38.pyc,, +flask_debugtoolbar/compat.py,sha256=V8GTKyTeNSVyGw2yv3Va6qFGiu11L9evvH8bi7Tmnm0,141 +flask_debugtoolbar/panels/__init__.py,sha256=w9Q4rhvdT2G7C6DTRXKcgbWjizdF-mmcMpXFcxqPesI,1524 +flask_debugtoolbar/panels/__pycache__/__init__.cpython-38.pyc,, +flask_debugtoolbar/panels/__pycache__/config_vars.cpython-38.pyc,, +flask_debugtoolbar/panels/__pycache__/headers.cpython-38.pyc,, +flask_debugtoolbar/panels/__pycache__/logger.cpython-38.pyc,, +flask_debugtoolbar/panels/__pycache__/profiler.cpython-38.pyc,, +flask_debugtoolbar/panels/__pycache__/request_vars.cpython-38.pyc,, +flask_debugtoolbar/panels/__pycache__/route_list.cpython-38.pyc,, +flask_debugtoolbar/panels/__pycache__/sqlalchemy.cpython-38.pyc,, +flask_debugtoolbar/panels/__pycache__/template.cpython-38.pyc,, +flask_debugtoolbar/panels/__pycache__/timer.cpython-38.pyc,, +flask_debugtoolbar/panels/__pycache__/versions.cpython-38.pyc,, +flask_debugtoolbar/panels/config_vars.py,sha256=bekytuj6V-FdfVK46rPzUzGpQ_H5cx6OOPDKsg1FCAo,607 +flask_debugtoolbar/panels/headers.py,sha256=FrsaTwDNowsrsuuFyjV2Q9bgv2E_gY8y3gOc8Yyhu74,1317 +flask_debugtoolbar/panels/logger.py,sha256=VDtnvi5vANrZItQZby4hQozFCmqKS_mrGt2tTjNEc1s,3262 +flask_debugtoolbar/panels/profiler.py,sha256=Wb3smAcpRfvol6zd-n8B6kq8nsXiSsOz5GhLOLEm8y4,3583 +flask_debugtoolbar/panels/request_vars.py,sha256=OLe9eKQ9Ljuer5SQqXcEABKa6VHZcCwskYbXE2Qakzk,1385 +flask_debugtoolbar/panels/route_list.py,sha256=CNiEpDN-vStFcAU7ld5qdk8zG_17GBtgMOCDdTkMlB8,875 +flask_debugtoolbar/panels/sqlalchemy.py,sha256=PhSdFB5MfljoG-GcLFasKLjLXCq6nF6NhwbP2pKZo0g,4029 +flask_debugtoolbar/panels/template.py,sha256=443H0Hk8Z3ck61Z-06GQXrRj5xxxHZQhgLb4dVLRIC0,3870 +flask_debugtoolbar/panels/timer.py,sha256=oX9RRimNK-HOoPklb7a2th5GfKo8jTUfwS1VEKsOv3Q,3282 +flask_debugtoolbar/panels/versions.py,sha256=uR0-4GZ8Bsm-p1tJwYAsZ6pFn5NzT8u9lZUZmNy3oyE,1259 +flask_debugtoolbar/static/codemirror/codemirror.css,sha256=bkYX-TCq6l5mBoZ0EKmhr60gnZ-BYfXO4Vm4Obfg4C0,2980 +flask_debugtoolbar/static/codemirror/codemirror.js,sha256=iE3QiP1Z3VpUJRMIAktJuzJ7FYwRaLb9HxV_Te-vBnI,121448 +flask_debugtoolbar/static/codemirror/mode/clike/clike.js,sha256=brdvEhN56fviSqdf7AeHCrV-uHUVhumjvtkhawMlYu0,8404 +flask_debugtoolbar/static/codemirror/mode/clike/index.html,sha256=abGTCs97DnVpiiofmsBOkA3FfLYHo3tM4l326O8hBV8,3054 +flask_debugtoolbar/static/codemirror/mode/clojure/clojure.js,sha256=2DZptIXjW-szaWtA3BY0V-V9q_esxZdD9CaF91_1aYM,12435 +flask_debugtoolbar/static/codemirror/mode/clojure/index.html,sha256=fw2RYivQZAyoCpY8qt_euz0fWcOFc410gl9jd8S9QfE,1981 +flask_debugtoolbar/static/codemirror/mode/coffeescript/LICENSE,sha256=m_yh8wN8Qv-na2F0nA4Ewq2ioFM2DBwIDoCSxTpp2s8,1151 +flask_debugtoolbar/static/codemirror/mode/coffeescript/coffeescript.js,sha256=zOKBuJr-Fw6CH69YCOwIxWAfApt_2QgiFfXHSztkwt8,10731 +flask_debugtoolbar/static/codemirror/mode/coffeescript/index.html,sha256=im_fzK1d1OAxzzJXyIlUGf509JgR6xgvMqBTJKrtQIc,21995 +flask_debugtoolbar/static/codemirror/mode/css/css.js,sha256=WMRr23af66tQQrFfAPmAeasrray5OwMkCULFJq3JSjU,3646 +flask_debugtoolbar/static/codemirror/mode/css/index.html,sha256=JS-89nIc33LgVgDB6gaBlPdhNw-BRUlom9zTW_-ZNiM,1051 +flask_debugtoolbar/static/codemirror/mode/diff/diff.css,sha256=X6j4F-niK_XSlnI-Z_31FLuHKPZidrFPgOUUPqDjdok,89 +flask_debugtoolbar/static/codemirror/mode/diff/diff.js,sha256=FGJQBA9A1PNpHrnWsvONE4Vx60KhVUFjdYAYZYydozw,316 +flask_debugtoolbar/static/codemirror/mode/diff/index.html,sha256=GSuhTbDRFC8SueAMGDBBtbUcsTsfwh4w3VFdNOERPwk,3860 +flask_debugtoolbar/static/codemirror/mode/ecl/ecl.js,sha256=CP3rL5tafopXR5XVZCat-fkYyamxxtq4iXWcjh-o4XY,8721 +flask_debugtoolbar/static/codemirror/mode/ecl/index.html,sha256=HNyF0nnr1wDtgqe0u2VP2GnWMgARaQalyVrbPEbjqhA,1164 +flask_debugtoolbar/static/codemirror/mode/gfm/gfm.js,sha256=1RtCItYtflLcOLo_I7kfHqZ6kbafAOtEeDoUR-5B5O0,3023 +flask_debugtoolbar/static/codemirror/mode/gfm/index.html,sha256=cm6tllLtuab0JHjpqGt5Ck4YL8hk4C0SZXkPgR3QjiE,1297 +flask_debugtoolbar/static/codemirror/mode/go/go.js,sha256=XkYVU0H93KA-qwZAe0dSImeZlb1C7TZrcM0YzeqPVxg,5471 +flask_debugtoolbar/static/codemirror/mode/go/index.html,sha256=34va1l2MZm8r0R0oww2u-76hs9P_68ykt_K4sScWtRA,1765 +flask_debugtoolbar/static/codemirror/mode/groovy/groovy.js,sha256=6ESI4OzA5uHAfQZRiR5fDfCQ-X-JmBq8sZuyyGx0A30,7154 +flask_debugtoolbar/static/codemirror/mode/groovy/index.html,sha256=J9s6mCxOTBmD7_TGxjkO7ZSI-p7oQwIlsVZbA5bDSco,1760 +flask_debugtoolbar/static/codemirror/mode/haskell/haskell.js,sha256=R2plUYPJYl_wQ3Qcquobt-4sHnsGTg4M1uzTK2Qu74Q,7478 +flask_debugtoolbar/static/codemirror/mode/haskell/index.html,sha256=iwiovq5jH6kKh_9VtNNT-W4eB8lvaVEEUrKIaBSZycs,1780 +flask_debugtoolbar/static/codemirror/mode/htmlembedded/htmlembedded.js,sha256=DpDzRY299hGAnYuFOj5li4p3xK8HIQBjjZjSRqedqws,2280 +flask_debugtoolbar/static/codemirror/mode/htmlembedded/index.html,sha256=ev6GGuhm5teOn8BthM0U9RT8sve9Y9zshNnuvfTWlp0,1703 +flask_debugtoolbar/static/codemirror/mode/htmlmixed/htmlmixed.js,sha256=4XE7EOp59ckmYx0cVQ4jTD_HzVUOU0Ox6x5PdF6-SIg,2839 +flask_debugtoolbar/static/codemirror/mode/htmlmixed/index.html,sha256=rpKtyGaHdO02M4ewZX-itfTAo8aBqOG4MUu7tv3qBj0,1558 +flask_debugtoolbar/static/codemirror/mode/javascript/index.html,sha256=iWdVgOQ2Ft3sdM21ZYjqyW15tdpbmw41Ld-Qk4RDZH0,2539 +flask_debugtoolbar/static/codemirror/mode/javascript/javascript.js,sha256=hjMGL1qMJzpD9sEyGCnxU3WVFdYecWhL30zrPP-saIs,12693 +flask_debugtoolbar/static/codemirror/mode/jinja2/index.html,sha256=H6FIH0FQlyk740cf-MwkInW2dK5asCosTRm4pMo5KjI,1040 +flask_debugtoolbar/static/codemirror/mode/jinja2/jinja2.js,sha256=ZqD0FS3vQ4v22ZYDaFoShyQlBY2Zg_9TBJomJEwquJo,1909 +flask_debugtoolbar/static/codemirror/mode/less/index.html,sha256=CxPTi98vf7a9oSFCiNKlWEVpD-t1CenQUM2lsvnY5yo,14320 +flask_debugtoolbar/static/codemirror/mode/less/less.js,sha256=f1jb3XJzXPQl1Lz5PUBuuJG4NNa8_guC6dMzjLiX-c8,8250 +flask_debugtoolbar/static/codemirror/mode/lua/index.html,sha256=teZp1ofzRK1ekG7Y8RIrtavEDmPINOIT5aMp7lYfygE,1693 +flask_debugtoolbar/static/codemirror/mode/lua/lua.js,sha256=MlUvdPpWVY6txJ--nbXHx4kYDoTtsUQtVscDIM1_PNs,5347 +flask_debugtoolbar/static/codemirror/mode/markdown/index.html,sha256=16H0fTmSn_QR3HMRFPNvohCAiprwRVSJxAwUq_XQMuQ,9858 +flask_debugtoolbar/static/codemirror/mode/markdown/markdown.js,sha256=Z1n6Cz_jWvfddISeK7SIc-0BjdNmQ2hmH3_Pe2S6I5U,6140 +flask_debugtoolbar/static/codemirror/mode/mysql/index.html,sha256=dC_UjQHwJSWLt28AXaoPLrhpOy-FuCpY-FDs0VNIWZw,1132 +flask_debugtoolbar/static/codemirror/mode/mysql/mysql.js,sha256=sQCxdi8Bb3foTUM9hzK01-tBEqYBYMUnSZJyZ8vw-Qw,7776 +flask_debugtoolbar/static/codemirror/mode/ntriples/index.html,sha256=vLTYbYBNVBg0OCa7kRAyzrzNY8JzUeuCThEijvdJhkE,998 +flask_debugtoolbar/static/codemirror/mode/ntriples/ntriples.js,sha256=TJSNlG54kqicfvbNEF6cgjUB8V9zSokK_Ixvl9QBCdI,6348 +flask_debugtoolbar/static/codemirror/mode/pascal/LICENSE,sha256=HsVvHRil2g9SI1PnutXhcwPPia1Ml0dwdtNxa-NnP44,1078 +flask_debugtoolbar/static/codemirror/mode/pascal/index.html,sha256=LcrehVl8wNfV4AjsJXfbNS-qV7ABdrulIN89zyaE0cc,1108 +flask_debugtoolbar/static/codemirror/mode/pascal/pascal.js,sha256=EJU9fqmHo5Pj7Y4Co-vOQ5oCla5xGGDS0AWf6DgAw9Q,2605 +flask_debugtoolbar/static/codemirror/mode/perl/LICENSE,sha256=j24B6yGg6b6hzTpuyA9DwbIzwGUXs-3uARbdnqCMPiY,1094 +flask_debugtoolbar/static/codemirror/mode/perl/index.html,sha256=WgFw6DGczZOgx6i5ZRUp4UjkjiQ76nLSdWZa5Idps70,1212 +flask_debugtoolbar/static/codemirror/mode/perl/perl.js,sha256=smIzI3r28eP6dCajWrkJm_bzM2sY357aSZUsiXcyc24,29358 +flask_debugtoolbar/static/codemirror/mode/php/index.html,sha256=frIia-IV051eJR6XEhj1LQqorr8bpJlMoTm54_vx2y8,1499 +flask_debugtoolbar/static/codemirror/mode/php/php.js,sha256=omGuYurj5TcweGLl-kY6Pd8gjR4eK1p2ft0JEAwiAHg,6076 +flask_debugtoolbar/static/codemirror/mode/plsql/index.html,sha256=G8V6M4q9f8HWOFZUX3u0dwwMg84qo-_cIVU2ZhurYU8,1553 +flask_debugtoolbar/static/codemirror/mode/plsql/plsql.js,sha256=8tnKdcQZJZXOihyzj55EpaWeH7oFJBydWnMQxHNO0yc,8430 +flask_debugtoolbar/static/codemirror/mode/properties/index.html,sha256=pQPR-PyCSxoOaGxmVEqWHOQV3dgEZfKEMbylWP6iJNw,1189 +flask_debugtoolbar/static/codemirror/mode/properties/properties.js,sha256=bspJdrBR0nk8j04Hs5aUt7OriU75v2mm6LUj2MpSBu8,1734 +flask_debugtoolbar/static/codemirror/mode/python/LICENSE.txt,sha256=xtqk6HN9FapxQLT364K51IKb0v0nEyxD4oIgO5xn38Q,1075 +flask_debugtoolbar/static/codemirror/mode/python/index.html,sha256=RtCZRHjTtKrOmsmOsTvoUmB_9XzspSUKQe15-u7csDY,2835 +flask_debugtoolbar/static/codemirror/mode/python/python.js,sha256=mQ8uMMJ2qsZQisomdyc5pWDlvIJae4WXl9ufh2pV7AU,12178 +flask_debugtoolbar/static/codemirror/mode/r/LICENSE,sha256=mwpqtkk74jxHuBUATJbxTL-Pd8VoDA4vsRtp29W-FVw,1486 +flask_debugtoolbar/static/codemirror/mode/r/index.html,sha256=ynlk8Hpkbj83XOyL8Gj7BOJaDfQujKHcPDSVxUF5uQc,2263 +flask_debugtoolbar/static/codemirror/mode/r/r.js,sha256=XCNEtcSNuS42qDEst3XWVwAHcRuX53yOr5mLeLE2L2I,4936 +flask_debugtoolbar/static/codemirror/mode/rpm/changes/changes.js,sha256=4p1Socu0ACxWaz-HKQM54i9dXrUJISBQJR5HJsOk-Hs,654 +flask_debugtoolbar/static/codemirror/mode/rpm/changes/index.html,sha256=HyZazY-HnOBHYTMzZW2xuqMxtebNr_BdVVjdZ0AAWpQ,1793 +flask_debugtoolbar/static/codemirror/mode/rpm/spec/index.html,sha256=MfNBuS1ivgLSwggFnIG0nnniXqFZSXC4cnDTklkSm7M,3037 +flask_debugtoolbar/static/codemirror/mode/rpm/spec/spec.css,sha256=pljBPSn-ly2kpRebOfu4ZOdWx3PwhOO2jA8cl8Hl6Hs,267 +flask_debugtoolbar/static/codemirror/mode/rpm/spec/spec.js,sha256=MAPA8AjVpoA3_vPGxnmGD8G_4wQ46NhVZD2Ka9KFWpE,2698 +flask_debugtoolbar/static/codemirror/mode/rst/index.html,sha256=fBTY664z7pybd-ZIfHMgJzg2Y-UkEUTNlRlJm1-KQ8M,17578 +flask_debugtoolbar/static/codemirror/mode/rst/rst.js,sha256=261gwNq0ll0JRC72Wb4JORQ2fXX22ml4Yw84meuQlZQ,8429 +flask_debugtoolbar/static/codemirror/mode/ruby/LICENSE,sha256=X7n9-lCOg2JZND9QmowFpOUY7BT37TQEkWWc9ONkDnM,1487 +flask_debugtoolbar/static/codemirror/mode/ruby/index.html,sha256=MTPzJgXQA2bZWawwOFeo1QlN9kT49tmdzQpyX-Xl4-Y,5412 +flask_debugtoolbar/static/codemirror/mode/ruby/ruby.js,sha256=I-GQmpvjgqzT03UzZipCQX4yOuFPymLnYEB61lsjVdY,7400 +flask_debugtoolbar/static/codemirror/mode/rust/index.html,sha256=KJMqzl2aZ1gW76NekYyaQpE497bAppzKVeKTZawabxA,1071 +flask_debugtoolbar/static/codemirror/mode/rust/rust.js,sha256=kWbUSP4ALs8pkeZdP3J4mqLwdVcKpqt13sowq40yVDg,15457 +flask_debugtoolbar/static/codemirror/mode/scheme/index.html,sha256=8HSd56RVc0z0b2lznxEpXYFz3PfjCzchk9Z0222tc_8,2198 +flask_debugtoolbar/static/codemirror/mode/scheme/scheme.js,sha256=eFo1mjrKfEq2tW8xNwFkiqBHnJYpU8j0FljS3ngF1ng,10562 +flask_debugtoolbar/static/codemirror/mode/smalltalk/index.html,sha256=KM9LHkoh5Bxrl1AoPHJSBSJAP5LW-z7HwKgLrmYUpZ0,1484 +flask_debugtoolbar/static/codemirror/mode/smalltalk/smalltalk.js,sha256=HTL-xumQPGihbxZR2UzWarBpW8TktA0d71HhdpEG2J0,3448 +flask_debugtoolbar/static/codemirror/mode/smarty/index.html,sha256=ROo8f-0oPadhJJ7fSghCsblhkptNOpGB1Dd5_j6F61I,2306 +flask_debugtoolbar/static/codemirror/mode/smarty/smarty.js,sha256=NBmbdOuBLhE97ezMfUJyGiCihNt6n_pAXZJ3N7g4f8o,3852 +flask_debugtoolbar/static/codemirror/mode/sparql/index.html,sha256=Z7bIpNEeNy-DOE48UWe0lrV8M-JhAF08mE5Uyz1FCyo,1196 +flask_debugtoolbar/static/codemirror/mode/sparql/sparql.js,sha256=VX62uWvA8F88NH3yH04KuzXOLJpcIbXTN0bxqGfe56c,4605 +flask_debugtoolbar/static/codemirror/mode/stex/index.html,sha256=QkCDnVwf5t_nLofStsk9hkll2Wr6HpDvOvn4kiQ4i_E,3610 +flask_debugtoolbar/static/codemirror/mode/stex/stex.js,sha256=0ecm6wJ_Tct5OY4i6hb-0A-iiqiEERYYbzX02OUu48I,4413 +flask_debugtoolbar/static/codemirror/mode/stex/test.html,sha256=jNMA74KbtJHjUYxBvKYmTMB68S422Sx2RxmuiJfx7yA,5785 +flask_debugtoolbar/static/codemirror/mode/tiddlywiki/index.html,sha256=ua0ycbhcjfcQmqsgyWyK3t6j5r8z-lI5SFNmMg7KyUA,4187 +flask_debugtoolbar/static/codemirror/mode/tiddlywiki/tiddlywiki.css,sha256=YxPJLesNx3FgjFhOZDpvpp7w4BgMQerTYYL7HSv7tvQ,840 +flask_debugtoolbar/static/codemirror/mode/tiddlywiki/tiddlywiki.js,sha256=NxZDNftQuqiuaz4F0VlO5svM6xitraezDCyRY09nGz0,9500 +flask_debugtoolbar/static/codemirror/mode/vbscript/index.html,sha256=dEVpxr4ZVCWUOCd8nNTDmQwG8wLDqQGKrrJUfTcUu2o,1161 +flask_debugtoolbar/static/codemirror/mode/vbscript/vbscript.js,sha256=4aIwx1A0rMs4QXnbv3Lp9AZmh_QtECt6FAB5JTsTdzU,867 +flask_debugtoolbar/static/codemirror/mode/velocity/index.html,sha256=NZtDev2JPKyny-gsgTc08MfH1KiQvdpKO-Nh70ezwdM,2761 +flask_debugtoolbar/static/codemirror/mode/velocity/velocity.js,sha256=mWs5WsO2eSDHKsAFGP9VxWZjqdKH7_ovIeJfutPcj9w,4959 +flask_debugtoolbar/static/codemirror/mode/verilog/index.html,sha256=3KWVxJiJ0BayXxYk6di7X5wXXSbeM64hkSg0ymBXqR4,6782 +flask_debugtoolbar/static/codemirror/mode/verilog/verilog.js,sha256=8q68ZVbjlRz0DDLg2AWTxCcKDv5YZ4G-2c238Tv6Wjw,6996 +flask_debugtoolbar/static/codemirror/mode/xml/index.html,sha256=zlcZJkkmIiYingtQh-diOZwUDYww-Z5BGcA9KhNYjjU,1617 +flask_debugtoolbar/static/codemirror/mode/xml/xml.js,sha256=o9O12ycnCdp7q_XMOixDut2fHIWf4RILzLA158tRH9g,7984 +flask_debugtoolbar/static/codemirror/mode/xmlpure/index.html,sha256=G1BriqZ753gGXpXAmmDeD1AnYEPYGi8ox3b-Bl69wMA,2332 +flask_debugtoolbar/static/codemirror/mode/xmlpure/xmlpure.js,sha256=n1RBJ05iVuiIDg7rviut2wqnhU_RepBDE0KgxAlDgXc,17763 +flask_debugtoolbar/static/codemirror/mode/xquery/LICENSE,sha256=K57-OZoMkyOpuTPi0bPcVCM-lBjwviQIrAk3ZoSU-Fc,1109 +flask_debugtoolbar/static/codemirror/mode/xquery/index.html,sha256=HECUmptIWHl1x_DSXrhFyOj9wboYXkgoCnLc2HTO6Hw,9447 +flask_debugtoolbar/static/codemirror/mode/xquery/test/index.html,sha256=H92OYjzxPy2On740Be5770ZdX7sz4AUJfaRgMz5KO7s,1171 +flask_debugtoolbar/static/codemirror/mode/xquery/test/testBase.js,sha256=RXPHsxHZj7hieJWF09Y9LnZOiA82twaKXQ-6pc7Wxtw,6114 +flask_debugtoolbar/static/codemirror/mode/xquery/test/testEmptySequenceKeyword.js,sha256=qlOvt1rghAv9zrSRy22fqh-ASWHM6MoRpuo-MlYoDQQ,639 +flask_debugtoolbar/static/codemirror/mode/xquery/test/testMultiAttr.js,sha256=ci_26wWVvHWOZNGIEXsBUzQYy7ZflnyQEu62wCAjCX8,789 +flask_debugtoolbar/static/codemirror/mode/xquery/test/testNamespaces.js,sha256=RSBSMrxwTBy0G9nf0s3RGoDZNX5q0cBWNQUlZjAkF3M,5494 +flask_debugtoolbar/static/codemirror/mode/xquery/test/testProcessingInstructions.js,sha256=ApeHV4ykMjH68Od6OW4avhVET3ZoOClcZl18HNPNl0s,719 +flask_debugtoolbar/static/codemirror/mode/xquery/test/testQuotes.js,sha256=9IuYza32NhspvMmpmZhAK9ZvzyhVfqdmyOQwA7R96ts,1070 +flask_debugtoolbar/static/codemirror/mode/xquery/xquery.js,sha256=3SLVOG63F2PH09icjBGlffrAcPzN0iUUbLH-FDwnKTI,15976 +flask_debugtoolbar/static/codemirror/mode/yaml/index.html,sha256=HRBMWydNdgXUk9Adxkgqv6xaSRwcGZ6A7eK_ShBEOZQ,1744 +flask_debugtoolbar/static/codemirror/mode/yaml/yaml.js,sha256=_pvBkh5woQDpWMTHM6ZPBoTudqJUBp71Eo2hk4k7IJk,2677 +flask_debugtoolbar/static/codemirror/theme/cobalt.css,sha256=LsuhQUd3LgkeGOLR2qghdq-8MXtpb1IfvYS4J62DfUM,1037 +flask_debugtoolbar/static/codemirror/theme/eclipse.css,sha256=08pKU67A0w9FfVoVE-YrAvu-tD2EAMN1j-YqQqeBT1A,1050 +flask_debugtoolbar/static/codemirror/theme/elegant.css,sha256=1eLlbADu1jlsgK8KDRtDClABgRnfmrMchSq8zMx5O8k,593 +flask_debugtoolbar/static/codemirror/theme/lesser-dark.css,sha256=5yoLXrprW3FH--CR4o1GggpVdYXuL9G4KI_bd-cFTUo,2066 +flask_debugtoolbar/static/codemirror/theme/monokai.css,sha256=BberoVQ6eLq9ZE7W1JhhRnNm2rEdyCN1yXBw2_DI0Ik,1151 +flask_debugtoolbar/static/codemirror/theme/neat.css,sha256=7uBf7kbbt5QFDlDJA8EYQVVp8TzuXyQl7ReXPJgQIyg,524 +flask_debugtoolbar/static/codemirror/theme/night.css,sha256=p9Ss8o0thUhRF2Q8_a_Wet3mW2kpHHRFgDWFrztZT6c,1118 +flask_debugtoolbar/static/codemirror/theme/rubyblue.css,sha256=pWe3QoZomcKRVmaG7Dejs1uFkZqqRUBgXakKA6HpKaI,1300 +flask_debugtoolbar/static/codemirror/theme/xq-dark.css,sha256=LGLKUKfpI5vJkMqGTIeDQRF5rrlhr_rXhSKkCOLZuBM,2296 +flask_debugtoolbar/static/codemirror/util/closetag.js,sha256=55wDULAmej12jt5iNae1JMmnhG871W_NbB4oWHhyJSk,5868 +flask_debugtoolbar/static/codemirror/util/dialog.css,sha256=i7347oI_6DFs4UzXxJc4LEtS3ZYr5L2Atff1boHAylU,401 +flask_debugtoolbar/static/codemirror/util/dialog.js,sha256=3iaqryr-p6flHe9iwojSx8ap1XCSdZJ8-DqUSYKXRlE,1962 +flask_debugtoolbar/static/codemirror/util/foldcode.js,sha256=TpMh0zfBTiC135arTXglSzFVNiF-eLEVunm_PGO2EFs,5950 +flask_debugtoolbar/static/codemirror/util/formatting.js,sha256=lhO2G0K3audV7GOQlahKWZPaRrC9ZYfIxBAr7oILK0A,10183 +flask_debugtoolbar/static/codemirror/util/javascript-hint.js,sha256=Y_5pEePA6lIQDZUWYROkCBo4_6eRzknzPMn1cp72XYo,5385 +flask_debugtoolbar/static/codemirror/util/match-highlighter.js,sha256=eaBDWkG9x5L1_jaUqyhgDQJehcFjmRUfTu54D3hRDDQ,1656 +flask_debugtoolbar/static/codemirror/util/overlay.js,sha256=Rv_ZgcC0KwbA0aTmTnARy7eVOg08xpJRAaKA83gQb04,1862 +flask_debugtoolbar/static/codemirror/util/runmode.js,sha256=Ho_9Ywb3er-xaBfhkt0J74j0PlM910B8sjqbyU86vRo,1611 +flask_debugtoolbar/static/codemirror/util/search.js,sha256=Lr33tCML72uBR8I0qY0LRIM9NG8xj2Da6M7rH9m_RdA,4725 +flask_debugtoolbar/static/codemirror/util/searchcursor.js,sha256=B6Zo2Mud4pLU_fMfmAwtIozV7oS-Ec1vOJFlf0M3dd4,4717 +flask_debugtoolbar/static/codemirror/util/simple-hint.css,sha256=WvgGdCJ7tQVojADB5xp6JfE6ywCWQFKRQx9eRzlHwQM,368 +flask_debugtoolbar/static/codemirror/util/simple-hint.js,sha256=iaK_KRDNjLNPB17mHz3pWmaPzNsfUmzdCZl7UsfU6c4,2943 +flask_debugtoolbar/static/css/toolbar.css,sha256=tXbe3J8q62nc388Tz7isQlke_J1BCakxMqKRWmvGGBo,8117 +flask_debugtoolbar/static/img/asc.gif,sha256=G_i396_-5n8ZcH01FMVlgF798uWAHqa0GGo77RduGXU,54 +flask_debugtoolbar/static/img/back.png,sha256=kTWOX2sb71HebErXqmayprw-dccM2-6ILgwAlFa2Ylc,575 +flask_debugtoolbar/static/img/back_hover.png,sha256=Gb8bMaDLITdBEk7R0IODdRyhde6_gbGO_Fx24uGYmLo,614 +flask_debugtoolbar/static/img/bg.gif,sha256=QOnCtoj3jAzUPGApjs01P81UdFu26Do_-msPsZ4ZNvs,64 +flask_debugtoolbar/static/img/close.png,sha256=5OfEyIQNIKYDjPqgbjCidWxfnwKGbzunmRBU3Jb7Wc8,604 +flask_debugtoolbar/static/img/close_hover.png,sha256=lAlfXa33H4YPX9AwmS-R5Fw-jGGOCMvT_nWdovZhVls,711 +flask_debugtoolbar/static/img/desc.gif,sha256=2OlhRZBS3GqcpX5YfL2JEFMir2uHy3PRtZ8Oi06kv4E,54 +flask_debugtoolbar/static/img/djdt_vertical.png,sha256=oVvjpg4Hrtibzw7t_r_46lm4y055U-n-pRM3-UrIc_0,404 +flask_debugtoolbar/static/img/indicator.png,sha256=cX4yuumJ3vF4W6EWWrnPf8gxRX0JaMCKGdQALo00eaM,444 +flask_debugtoolbar/static/img/panel_bg.png,sha256=EfP53Fh2E_IvAM_uFKWlD4oC9tDnSKi_W9piH502LlY,70 +flask_debugtoolbar/static/img/tick-red.png,sha256=Rvkt4hrTV8tddbAWcMy6BD3IPVkR42kHt-RmZ9uLrQ8,538 +flask_debugtoolbar/static/img/tick.png,sha256=r1-pDDWUjDfiioxl9JqZYUqIWf5nAftaV_0QtZa2UzQ,569 +flask_debugtoolbar/static/js/jquery.js,sha256=IpJ49qnBwn_FW-xQ8GVI_mTCYp9Z9GLVDKwo5lu5OoM,84362 +flask_debugtoolbar/static/js/jquery.tablesorter.js,sha256=jAkZjvxpi2SKGoQHzm3thOKchGGbu_MLWj4ARN4sNWg,40914 +flask_debugtoolbar/static/js/toolbar.js,sha256=xK_dvUIWE6DnfdQYBCsnZZa9uUtaTvmyolYguRCjP28,7113 +flask_debugtoolbar/templates/base.html,sha256=c4QvcfAlu39mbhvAN3jQs3hOeRCV1oeiZN9WLMKccdI,2045 +flask_debugtoolbar/templates/panels/config_vars.html,sha256=6iBR9fAAbRzd8jNyoSt_VMKHP8Aw3pAJh_zARnBMEhg,398 +flask_debugtoolbar/templates/panels/headers.html,sha256=5yqal2_rYTrvWFP8iGY5XEuxSAAMiFMuD-kvg_uymKE,327 +flask_debugtoolbar/templates/panels/logger.html,sha256=MB9RVRRe7ckPv73WXEaV7niRMx-j47K0jCBdqF_XAqU,614 +flask_debugtoolbar/templates/panels/profiler.html,sha256=Z2WDz_wOQRamY4diruidJRsR2TVY4uMVRhSgDMD3QT8,753 +flask_debugtoolbar/templates/panels/request_vars.html,sha256=V36INlPgoChY9nmn3xu-LqkkcKFbTEmkiYwDdy4vQNY,1888 +flask_debugtoolbar/templates/panels/route_list.html,sha256=TOqem9K4O27EZ5sGAus1Jxswe8pHqtK6mJUrgljH2xY,646 +flask_debugtoolbar/templates/panels/sqlalchemy.html,sha256=F2yYBGUj_oC6A0tl09MvFRwbnnhPFDaqNS-_B3Abz2c,1066 +flask_debugtoolbar/templates/panels/sqlalchemy_error.html,sha256=Tg1z7Y39FS1gHG2Hl1Qhb64rsRb_aquO-QKatHchkL4,1304 +flask_debugtoolbar/templates/panels/sqlalchemy_select.html,sha256=yJ_qjzWy4MUKu4aMfIUobFrYM29womzUjM4GNYPnseo,886 +flask_debugtoolbar/templates/panels/template.html,sha256=JUiCltvTgZ25TLX7ZnlHeYiNI2gZ45SlxqMrRX8bemk,696 +flask_debugtoolbar/templates/panels/template_editor.html,sha256=ExGDDXR2eZNVDDpm1Vyt8oxb-0bpYQMgixpPDXK5c7Q,5757 +flask_debugtoolbar/templates/panels/timer.html,sha256=8yaihSVj-pdflILl_6JV3dHW2ruYzHmeDQH5voXxbII,388 +flask_debugtoolbar/templates/panels/versions.html,sha256=Mlep0vyo5Bg-kauTr6TFtnBJZKlatj4c_XoCl2dgDrA,716 +flask_debugtoolbar/templates/redirect.html,sha256=HE_ukdDcPj1OeT_owMxAQUs8FAKsSfzpb6DdY3RVW6g,568 +flask_debugtoolbar/toolbar.py,sha256=a3ORkOPzR-LGdgwG44KI2jHq7J8fimh0wNUTn-W1W0Y,2161 +flask_debugtoolbar/utils.py,sha256=mmosrCuIIebXLfJvwdKXxosJDeQw-GGeOO1puT3OvYM,2372 diff --git a/.venv/lib/python3.8/site-packages/Flask_DebugToolbar-0.11.0.dist-info/WHEEL b/.venv/lib/python3.8/site-packages/Flask_DebugToolbar-0.11.0.dist-info/WHEEL new file mode 100644 index 00000000..ef99c6cf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_DebugToolbar-0.11.0.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.34.2) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/.venv/lib/python3.8/site-packages/Flask_DebugToolbar-0.11.0.dist-info/top_level.txt b/.venv/lib/python3.8/site-packages/Flask_DebugToolbar-0.11.0.dist-info/top_level.txt new file mode 100644 index 00000000..11f2ec76 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_DebugToolbar-0.11.0.dist-info/top_level.txt @@ -0,0 +1 @@ +flask_debugtoolbar diff --git a/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/INSTALLER b/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/LICENSE b/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/LICENSE new file mode 100644 index 00000000..2448fd26 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2013 Miguel Grinberg + +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: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +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. diff --git a/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/METADATA b/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/METADATA new file mode 100644 index 00000000..a6a95d14 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/METADATA @@ -0,0 +1,29 @@ +Metadata-Version: 2.1 +Name: Flask-Migrate +Version: 2.5.3 +Summary: SQLAlchemy database migrations for Flask applications using Alembic +Home-page: http://github.com/miguelgrinberg/flask-migrate/ +Author: Miguel Grinberg +Author-email: miguelgrinberg50@gmail.com +License: MIT +Platform: any +Classifier: Environment :: Web Environment +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 3 +Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Requires-Dist: Flask (>=0.9) +Requires-Dist: Flask-SQLAlchemy (>=1.0) +Requires-Dist: alembic (>=0.7) + + +Flask-Migrate +-------------- + +SQLAlchemy database migrations for Flask applications using Alembic. + + diff --git a/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/RECORD b/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/RECORD new file mode 100644 index 00000000..21646404 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/RECORD @@ -0,0 +1,21 @@ +Flask_Migrate-2.5.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +Flask_Migrate-2.5.3.dist-info/LICENSE,sha256=kfkXGlJQvKy3Y__6tAJ8ynIp1HQfeROXhL8jZU1d-DI,1082 +Flask_Migrate-2.5.3.dist-info/METADATA,sha256=DgLcB4ONdDFJbIwT280ET2OzkRMg842OlaVboy6W6Hg,946 +Flask_Migrate-2.5.3.dist-info/RECORD,, +Flask_Migrate-2.5.3.dist-info/WHEEL,sha256=kGT74LWyRUZrL4VgLh6_g12IeVl_9u9ZVhadrgXZUEY,110 +Flask_Migrate-2.5.3.dist-info/entry_points.txt,sha256=KIMh5vVHpfcQw9lq5G7y7cVhHgS-0DdbmIS8X7mnrzI,44 +Flask_Migrate-2.5.3.dist-info/top_level.txt,sha256=jLoPgiMG6oR4ugNteXn3IHskVVIyIXVStZOVq-AWLdU,14 +flask_migrate/__init__.py,sha256=skKIE9PdKB93xX-Kt3-bxdPNLERFEbhXRDJEZN2gok0,18425 +flask_migrate/__pycache__/__init__.cpython-38.pyc,, +flask_migrate/__pycache__/cli.cpython-38.pyc,, +flask_migrate/cli.py,sha256=kYuVtaKPilpvmAnAffjXKsOJCgEDi8DaE3gSwR7yoKM,9595 +flask_migrate/templates/flask-multidb/README,sha256=MVlc9TYmr57RbhXET6QxgyCcwWP7w-vLkEsirENqiIQ,38 +flask_migrate/templates/flask-multidb/__pycache__/env.cpython-38.pyc,, +flask_migrate/templates/flask-multidb/alembic.ini.mako,sha256=zQU53x-FQXAbtuOxp3_hgtsEZK8M0Unkw9F_uMSBEDc,770 +flask_migrate/templates/flask-multidb/env.py,sha256=CHi6fXfGjFRs4lrfmYCYls7gbhyXpdFPWjQnQvTyR_4,5696 +flask_migrate/templates/flask-multidb/script.py.mako,sha256=lVwJ36kfy6N1gRW7Lepg5EjXQ6Ouar4GTSBHcHXYHbs,965 +flask_migrate/templates/flask/README,sha256=MVlc9TYmr57RbhXET6QxgyCcwWP7w-vLkEsirENqiIQ,38 +flask_migrate/templates/flask/__pycache__/env.cpython-38.pyc,, +flask_migrate/templates/flask/alembic.ini.mako,sha256=zQU53x-FQXAbtuOxp3_hgtsEZK8M0Unkw9F_uMSBEDc,770 +flask_migrate/templates/flask/env.py,sha256=3wbrXvpmvL7__FrX98cYui99h6jALszWF8KgSxT8qWg,2916 +flask_migrate/templates/flask/script.py.mako,sha256=8_xgA-gm_OhehnO7CiIijWgnm00ZlszEHtIHrAYFJl0,494 diff --git a/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/WHEEL b/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/WHEEL new file mode 100644 index 00000000..ef99c6cf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.34.2) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/entry_points.txt b/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/entry_points.txt new file mode 100644 index 00000000..f15410ef --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/entry_points.txt @@ -0,0 +1,3 @@ +[flask.commands] +db = flask_migrate.cli:db + diff --git a/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/top_level.txt b/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/top_level.txt new file mode 100644 index 00000000..0652762c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_Migrate-2.5.3.dist-info/top_level.txt @@ -0,0 +1 @@ +flask_migrate diff --git a/.venv/lib/python3.8/site-packages/Flask_SQLAlchemy-2.4.3.dist-info/INSTALLER b/.venv/lib/python3.8/site-packages/Flask_SQLAlchemy-2.4.3.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_SQLAlchemy-2.4.3.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/lib/python3.8/site-packages/Flask_SQLAlchemy-2.4.3.dist-info/LICENSE.rst b/.venv/lib/python3.8/site-packages/Flask_SQLAlchemy-2.4.3.dist-info/LICENSE.rst new file mode 100644 index 00000000..9d227a0c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_SQLAlchemy-2.4.3.dist-info/LICENSE.rst @@ -0,0 +1,28 @@ +Copyright 2010 Pallets + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.venv/lib/python3.8/site-packages/Flask_SQLAlchemy-2.4.3.dist-info/METADATA b/.venv/lib/python3.8/site-packages/Flask_SQLAlchemy-2.4.3.dist-info/METADATA new file mode 100644 index 00000000..cd9888f7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_SQLAlchemy-2.4.3.dist-info/METADATA @@ -0,0 +1,94 @@ +Metadata-Version: 2.1 +Name: Flask-SQLAlchemy +Version: 2.4.3 +Summary: Adds SQLAlchemy support to your Flask application. +Home-page: https://github.com/pallets/flask-sqlalchemy +Author: Armin Ronacher +Author-email: armin.ronacher@active-4.com +Maintainer: Pallets +Maintainer-email: contact@palletsprojects.com +License: BSD-3-Clause +Project-URL: Documentation, https://flask-sqlalchemy.palletsprojects.com/ +Project-URL: Code, https://github.com/pallets/flask-sqlalchemy +Project-URL: Issue tracker, https://github.com/pallets/flask-sqlalchemy/issues +Platform: UNKNOWN +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Web Environment +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Requires-Python: >= 2.7, != 3.0.*, != 3.1.*, != 3.2.*, != 3.3.* +Requires-Dist: Flask (>=0.10) +Requires-Dist: SQLAlchemy (>=0.8.0) + +Flask-SQLAlchemy +================ + +Flask-SQLAlchemy is an extension for `Flask`_ that adds support for +`SQLAlchemy`_ to your application. It aims to simplify using SQLAlchemy +with Flask by providing useful defaults and extra helpers that make it +easier to accomplish common tasks. + + +Installing +---------- + +Install and update using `pip`_: + +.. code-block:: text + + $ pip install -U Flask-SQLAlchemy + + +A Simple Example +---------------- + +.. code-block:: python + + from flask import Flask + from flask_sqlalchemy import SQLAlchemy + + app = Flask(__name__) + app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///example.sqlite" + db = SQLAlchemy(app) + + + class User(db.Model): + id = db.Column(db.Integer, primary_key=True) + username = db.Column(db.String, unique=True, nullable=False) + email = db.Column(db.String, unique=True, nullable=False) + + + db.session.add(User(name="Flask", email="example@example.com")) + db.session.commit() + + users = User.query.all() + + +Links +----- + +- Documentation: https://flask-sqlalchemy.palletsprojects.com/ +- Releases: https://pypi.org/project/Flask-SQLAlchemy/ +- Code: https://github.com/pallets/flask-sqlalchemy +- Issue tracker: https://github.com/pallets/flask-sqlalchemy/issues +- Test status: https://travis-ci.org/pallets/flask-sqlalchemy +- Test coverage: https://codecov.io/gh/pallets/flask-sqlalchemy + +.. _Flask: https://palletsprojects.com/p/flask/ +.. _SQLAlchemy: https://www.sqlalchemy.org +.. _pip: https://pip.pypa.io/en/stable/quickstart/ + + diff --git a/.venv/lib/python3.8/site-packages/Flask_SQLAlchemy-2.4.3.dist-info/RECORD b/.venv/lib/python3.8/site-packages/Flask_SQLAlchemy-2.4.3.dist-info/RECORD new file mode 100644 index 00000000..e5bf7462 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_SQLAlchemy-2.4.3.dist-info/RECORD @@ -0,0 +1,14 @@ +Flask_SQLAlchemy-2.4.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +Flask_SQLAlchemy-2.4.3.dist-info/LICENSE.rst,sha256=SJqOEQhQntmKN7uYPhHg9-HTHwvY-Zp5yESOf_N9B-o,1475 +Flask_SQLAlchemy-2.4.3.dist-info/METADATA,sha256=ovbU56jv4wt8BHPWByT4oFVfHGHYxrCgAyxpBzYX7QU,3128 +Flask_SQLAlchemy-2.4.3.dist-info/RECORD,, +Flask_SQLAlchemy-2.4.3.dist-info/WHEEL,sha256=kGT74LWyRUZrL4VgLh6_g12IeVl_9u9ZVhadrgXZUEY,110 +Flask_SQLAlchemy-2.4.3.dist-info/top_level.txt,sha256=w2K4fNNoTh4HItoFfz2FRQShSeLcvHYrzU_sZov21QU,17 +flask_sqlalchemy/__init__.py,sha256=VnC-WvdxWXy5X3_AGO9vIHnuXLY1zUmcuvPvDUcvGtA,39265 +flask_sqlalchemy/__pycache__/__init__.cpython-38.pyc,, +flask_sqlalchemy/__pycache__/_compat.cpython-38.pyc,, +flask_sqlalchemy/__pycache__/model.cpython-38.pyc,, +flask_sqlalchemy/__pycache__/utils.cpython-38.pyc,, +flask_sqlalchemy/_compat.py,sha256=yua0ZSgVWwi56QpEgwaPInzkNQ9PFb7YQdvEk3dImXo,821 +flask_sqlalchemy/model.py,sha256=9jBoPU1k0c4nqz2-KyYnfoE55n-1G8Zxfo2Z-ZHV0v4,4992 +flask_sqlalchemy/utils.py,sha256=4eHqAbYElnJ3NbSAHhuINckoAHDABoxjleMJD0iKgyg,1390 diff --git a/.venv/lib/python3.8/site-packages/Flask_SQLAlchemy-2.4.3.dist-info/WHEEL b/.venv/lib/python3.8/site-packages/Flask_SQLAlchemy-2.4.3.dist-info/WHEEL new file mode 100644 index 00000000..ef99c6cf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_SQLAlchemy-2.4.3.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.34.2) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/.venv/lib/python3.8/site-packages/Flask_SQLAlchemy-2.4.3.dist-info/top_level.txt b/.venv/lib/python3.8/site-packages/Flask_SQLAlchemy-2.4.3.dist-info/top_level.txt new file mode 100644 index 00000000..8a5538e9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_SQLAlchemy-2.4.3.dist-info/top_level.txt @@ -0,0 +1 @@ +flask_sqlalchemy diff --git a/.venv/lib/python3.8/site-packages/Flask_WTF-0.14.3.dist-info/INSTALLER b/.venv/lib/python3.8/site-packages/Flask_WTF-0.14.3.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_WTF-0.14.3.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/lib/python3.8/site-packages/Flask_WTF-0.14.3.dist-info/LICENSE b/.venv/lib/python3.8/site-packages/Flask_WTF-0.14.3.dist-info/LICENSE new file mode 100644 index 00000000..5cbad1ad --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_WTF-0.14.3.dist-info/LICENSE @@ -0,0 +1,32 @@ +Copyright (c) 2010 by Dan Jacob. +Copyright (c) 2013 by Hsiaoming Yang. + +Some rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + +* The names of the contributors may not be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.venv/lib/python3.8/site-packages/Flask_WTF-0.14.3.dist-info/METADATA b/.venv/lib/python3.8/site-packages/Flask_WTF-0.14.3.dist-info/METADATA new file mode 100644 index 00000000..f9166ab2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_WTF-0.14.3.dist-info/METADATA @@ -0,0 +1,55 @@ +Metadata-Version: 2.1 +Name: Flask-WTF +Version: 0.14.3 +Summary: Simple integration of Flask and WTForms. +Home-page: https://github.com/lepture/flask-wtf +Author: Dan Jacob +Author-email: danjac354@gmail.com +Maintainer: Hsiaoming Yang +Maintainer-email: me@lepture.com +License: BSD +Platform: any +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Web Environment +Classifier: Framework :: Flask +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Description-Content-Type: text/x-rst +Requires-Dist: Flask +Requires-Dist: WTForms +Requires-Dist: itsdangerous + +Flask-WTF +========= + +.. image:: https://travis-ci.org/lepture/flask-wtf.svg?branch=master + :target: https://travis-ci.org/lepture/flask-wtf + :alt: Test Status +.. image:: https://codecov.io/gh/lepture/flask-wtf/branch/master/graph/badge.svg + :target: https://codecov.io/gh/lepture/flask-wtf + :alt: Coverage Status + +Simple integration of Flask and WTForms, including CSRF, file upload, and reCAPTCHA. + +Links +----- + +* `Documentation `_ +* `PyPI `_ +* `GitHub `_ + + diff --git a/.venv/lib/python3.8/site-packages/Flask_WTF-0.14.3.dist-info/RECORD b/.venv/lib/python3.8/site-packages/Flask_WTF-0.14.3.dist-info/RECORD new file mode 100644 index 00000000..902cc633 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_WTF-0.14.3.dist-info/RECORD @@ -0,0 +1,28 @@ +Flask_WTF-0.14.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +Flask_WTF-0.14.3.dist-info/LICENSE,sha256=oHX42YrP2wXdmHFiQrniwbOrmHIpJrPEz2yRasFOg1A,1490 +Flask_WTF-0.14.3.dist-info/METADATA,sha256=dF7sva5J48ghHRrrDQXE8VC9rkGgzMroqE9F0Y8IRaE,1970 +Flask_WTF-0.14.3.dist-info/RECORD,, +Flask_WTF-0.14.3.dist-info/WHEEL,sha256=8zNYZbwQSXoB9IfXOjPfeNwvAsALAjffgk27FqvCWbo,110 +Flask_WTF-0.14.3.dist-info/top_level.txt,sha256=zK3flQPSjYTkAMjB0V6Jhu3jyotC0biL1mMhzitYoog,10 +flask_wtf/__init__.py,sha256=3HmMihSqGs5tVK4kkizqgvkIYERx3vOcu1HqDEJV9F8,166 +flask_wtf/__pycache__/__init__.cpython-38.pyc,, +flask_wtf/__pycache__/_compat.cpython-38.pyc,, +flask_wtf/__pycache__/csrf.cpython-38.pyc,, +flask_wtf/__pycache__/file.cpython-38.pyc,, +flask_wtf/__pycache__/form.cpython-38.pyc,, +flask_wtf/__pycache__/html5.cpython-38.pyc,, +flask_wtf/__pycache__/i18n.cpython-38.pyc,, +flask_wtf/_compat.py,sha256=azP2rQPjAnKozhAJjMlbhI8aDlEOMuv1HrTHFDOJZYM,917 +flask_wtf/csrf.py,sha256=6X70Trm_bqA2PeetNrX0n8yMov3346qyde7BzC6K_Cg,11784 +flask_wtf/file.py,sha256=HvYn4xlQFr1xjmNFvYCL-9ovWOQxL1VL2kSprHnxdTk,2886 +flask_wtf/form.py,sha256=carx4zNxTk5qm9Ns5PJnoexVySXnpJvgokpi2VWsc-k,4987 +flask_wtf/html5.py,sha256=ehOXtr_lhJHjn00MhIrFgvFO1SlFeN8hBoNG7wlSu5Q,333 +flask_wtf/i18n.py,sha256=6yhSjnvippZ04H2gaqSHLeztR5LXpdnugWmxZEps4ck,1228 +flask_wtf/recaptcha/__init__.py,sha256=q3TC7tZPSAZ3On3GApZKGn0EcydX4zprisbyTlhN3sQ,86 +flask_wtf/recaptcha/__pycache__/__init__.cpython-38.pyc,, +flask_wtf/recaptcha/__pycache__/fields.cpython-38.pyc,, +flask_wtf/recaptcha/__pycache__/validators.cpython-38.pyc,, +flask_wtf/recaptcha/__pycache__/widgets.cpython-38.pyc,, +flask_wtf/recaptcha/fields.py,sha256=kN_10iZYQcYg1EtxFp4B87BlFnnrJCktrh7bTykOVj4,453 +flask_wtf/recaptcha/validators.py,sha256=Wy0ucQzSpPS4XeeXhPjzRmTPtSM6pIQLlMWEPOODuQ4,2405 +flask_wtf/recaptcha/widgets.py,sha256=SbXaEMi3sFIJLFdTOVnjDMQPIQAIHAs2wdIycaTO5LQ,1255 diff --git a/.venv/lib/python3.8/site-packages/Flask_WTF-0.14.3.dist-info/WHEEL b/.venv/lib/python3.8/site-packages/Flask_WTF-0.14.3.dist-info/WHEEL new file mode 100644 index 00000000..8b701e93 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_WTF-0.14.3.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.33.6) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/.venv/lib/python3.8/site-packages/Flask_WTF-0.14.3.dist-info/top_level.txt b/.venv/lib/python3.8/site-packages/Flask_WTF-0.14.3.dist-info/top_level.txt new file mode 100644 index 00000000..716f4226 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/Flask_WTF-0.14.3.dist-info/top_level.txt @@ -0,0 +1 @@ +flask_wtf diff --git a/.venv/lib/python3.8/site-packages/IPython/__init__.py b/.venv/lib/python3.8/site-packages/IPython/__init__.py new file mode 100644 index 00000000..4fb77107 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/__init__.py @@ -0,0 +1,152 @@ +# encoding: utf-8 +""" +IPython: tools for interactive and parallel computing in Python. + +https://ipython.org +""" +#----------------------------------------------------------------------------- +# Copyright (c) 2008-2011, IPython Development Team. +# Copyright (c) 2001-2007, Fernando Perez +# Copyright (c) 2001, Janko Hauser +# Copyright (c) 2001, Nathaniel Gray +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +import os +import sys + +#----------------------------------------------------------------------------- +# Setup everything +#----------------------------------------------------------------------------- + +# Don't forget to also update setup.py when this changes! +if sys.version_info < (3, 6): + raise ImportError( +""" +IPython 7.10+ supports Python 3.6 and above. +When using Python 2.7, please install IPython 5.x LTS Long Term Support version. +Python 3.3 and 3.4 were supported up to IPython 6.x. +Python 3.5 was supported with IPython 7.0 to 7.9. + +See IPython `README.rst` file for more information: + + https://github.com/ipython/ipython/blob/master/README.rst + +""") + +# Make it easy to import extensions - they are always directly on pythonpath. +# Therefore, non-IPython modules can be added to extensions directory. +# This should probably be in ipapp.py. +sys.path.append(os.path.join(os.path.dirname(__file__), "extensions")) + +#----------------------------------------------------------------------------- +# Setup the top level names +#----------------------------------------------------------------------------- + +from .core.getipython import get_ipython +from .core import release +from .core.application import Application +from .terminal.embed import embed + +from .core.interactiveshell import InteractiveShell +from .testing import test +from .utils.sysinfo import sys_info +from .utils.frame import extract_module_locals + +# Release data +__author__ = '%s <%s>' % (release.author, release.author_email) +__license__ = release.license +__version__ = release.version +version_info = release.version_info + +def embed_kernel(module=None, local_ns=None, **kwargs): + """Embed and start an IPython kernel in a given scope. + + If you don't want the kernel to initialize the namespace + from the scope of the surrounding function, + and/or you want to load full IPython configuration, + you probably want `IPython.start_kernel()` instead. + + Parameters + ---------- + module : types.ModuleType, optional + The module to load into IPython globals (default: caller) + local_ns : dict, optional + The namespace to load into IPython user namespace (default: caller) + + kwargs : various, optional + Further keyword args are relayed to the IPKernelApp constructor, + allowing configuration of the Kernel. Will only have an effect + on the first embed_kernel call for a given process. + """ + + (caller_module, caller_locals) = extract_module_locals(1) + if module is None: + module = caller_module + if local_ns is None: + local_ns = caller_locals + + # Only import .zmq when we really need it + from ipykernel.embed import embed_kernel as real_embed_kernel + real_embed_kernel(module=module, local_ns=local_ns, **kwargs) + +def start_ipython(argv=None, **kwargs): + """Launch a normal IPython instance (as opposed to embedded) + + `IPython.embed()` puts a shell in a particular calling scope, + such as a function or method for debugging purposes, + which is often not desirable. + + `start_ipython()` does full, regular IPython initialization, + including loading startup files, configuration, etc. + much of which is skipped by `embed()`. + + This is a public API method, and will survive implementation changes. + + Parameters + ---------- + + argv : list or None, optional + If unspecified or None, IPython will parse command-line options from sys.argv. + To prevent any command-line parsing, pass an empty list: `argv=[]`. + user_ns : dict, optional + specify this dictionary to initialize the IPython user namespace with particular values. + kwargs : various, optional + Any other kwargs will be passed to the Application constructor, + such as `config`. + """ + from IPython.terminal.ipapp import launch_new_instance + return launch_new_instance(argv=argv, **kwargs) + +def start_kernel(argv=None, **kwargs): + """Launch a normal IPython kernel instance (as opposed to embedded) + + `IPython.embed_kernel()` puts a shell in a particular calling scope, + such as a function or method for debugging purposes, + which is often not desirable. + + `start_kernel()` does full, regular IPython initialization, + including loading startup files, configuration, etc. + much of which is skipped by `embed()`. + + Parameters + ---------- + + argv : list or None, optional + If unspecified or None, IPython will parse command-line options from sys.argv. + To prevent any command-line parsing, pass an empty list: `argv=[]`. + user_ns : dict, optional + specify this dictionary to initialize the IPython user namespace with particular values. + kwargs : various, optional + Any other kwargs will be passed to the Application constructor, + such as `config`. + """ + from IPython.kernel.zmq.kernelapp import launch_new_instance + return launch_new_instance(argv=argv, **kwargs) diff --git a/.venv/lib/python3.8/site-packages/IPython/__main__.py b/.venv/lib/python3.8/site-packages/IPython/__main__.py new file mode 100644 index 00000000..d5123f33 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/__main__.py @@ -0,0 +1,14 @@ +# encoding: utf-8 +"""Terminal-based IPython entry point. +""" +#----------------------------------------------------------------------------- +# Copyright (c) 2012, IPython Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +from IPython import start_ipython + +start_ipython() diff --git a/.venv/lib/python3.8/site-packages/IPython/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..8b2e6b7a Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/__pycache__/__main__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/__pycache__/__main__.cpython-38.pyc new file mode 100644 index 00000000..d58fe486 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/__pycache__/__main__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/__pycache__/config.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/__pycache__/config.cpython-38.pyc new file mode 100644 index 00000000..9bb7ec46 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/__pycache__/config.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/__pycache__/conftest.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/__pycache__/conftest.cpython-38.pyc new file mode 100644 index 00000000..60d5bf96 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/__pycache__/conftest.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/__pycache__/consoleapp.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/__pycache__/consoleapp.cpython-38.pyc new file mode 100644 index 00000000..5efbb4a7 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/__pycache__/consoleapp.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/__pycache__/display.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/__pycache__/display.cpython-38.pyc new file mode 100644 index 00000000..a81e9dd4 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/__pycache__/display.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/__pycache__/frontend.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/__pycache__/frontend.cpython-38.pyc new file mode 100644 index 00000000..1f4f9106 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/__pycache__/frontend.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/__pycache__/html.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/__pycache__/html.cpython-38.pyc new file mode 100644 index 00000000..0c745df6 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/__pycache__/html.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/__pycache__/nbconvert.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/__pycache__/nbconvert.cpython-38.pyc new file mode 100644 index 00000000..79eb8368 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/__pycache__/nbconvert.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/__pycache__/nbformat.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/__pycache__/nbformat.cpython-38.pyc new file mode 100644 index 00000000..56f0b1fe Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/__pycache__/nbformat.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/__pycache__/parallel.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/__pycache__/parallel.cpython-38.pyc new file mode 100644 index 00000000..d4b1fcdc Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/__pycache__/parallel.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/__pycache__/paths.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/__pycache__/paths.cpython-38.pyc new file mode 100644 index 00000000..9bf1d440 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/__pycache__/paths.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/__pycache__/qt.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/__pycache__/qt.cpython-38.pyc new file mode 100644 index 00000000..90cc4ed7 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/__pycache__/qt.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/config.py b/.venv/lib/python3.8/site-packages/IPython/config.py new file mode 100644 index 00000000..964f46f1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/config.py @@ -0,0 +1,19 @@ +""" +Shim to maintain backwards compatibility with old IPython.config imports. +""" +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +import sys +from warnings import warn + +from .utils.shimmodule import ShimModule, ShimWarning + +warn("The `IPython.config` package has been deprecated since IPython 4.0. " + "You should import from traitlets.config instead.", ShimWarning) + + +# Unconditionally insert the shim into sys.modules so that further import calls +# trigger the custom attribute access above + +sys.modules['IPython.config'] = ShimModule(src='IPython.config', mirror='traitlets.config') diff --git a/.venv/lib/python3.8/site-packages/IPython/conftest.py b/.venv/lib/python3.8/site-packages/IPython/conftest.py new file mode 100644 index 00000000..8b2af8c0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/conftest.py @@ -0,0 +1,69 @@ +import types +import sys +import builtins +import os +import pytest +import pathlib +import shutil + +from .testing import tools + + +def get_ipython(): + from .terminal.interactiveshell import TerminalInteractiveShell + if TerminalInteractiveShell._instance: + return TerminalInteractiveShell.instance() + + config = tools.default_config() + config.TerminalInteractiveShell.simple_prompt = True + + # Create and initialize our test-friendly IPython instance. + shell = TerminalInteractiveShell.instance(config=config) + return shell + + +@pytest.fixture(scope='session', autouse=True) +def work_path(): + path = pathlib.Path("./tmp-ipython-pytest-profiledir") + os.environ["IPYTHONDIR"] = str(path.absolute()) + if path.exists(): + raise ValueError('IPython dir temporary path already exists ! Did previous test run exit successfully ?') + path.mkdir() + yield + shutil.rmtree(str(path.resolve())) + + +def nopage(strng, start=0, screen_lines=0, pager_cmd=None): + if isinstance(strng, dict): + strng = strng.get("text/plain", "") + print(strng) + + +def xsys(self, cmd): + """Replace the default system call with a capturing one for doctest. + """ + # We use getoutput, but we need to strip it because pexpect captures + # the trailing newline differently from commands.getoutput + print(self.getoutput(cmd, split=False, depth=1).rstrip(), end="", file=sys.stdout) + sys.stdout.flush() + + +# for things to work correctly we would need this as a session fixture; +# unfortunately this will fail on some test that get executed as _collection_ +# time (before the fixture run), in particular parametrized test that contain +# yields. so for now execute at import time. +#@pytest.fixture(autouse=True, scope='session') +def inject(): + + builtins.get_ipython = get_ipython + builtins._ip = get_ipython() + builtins.ip = get_ipython() + builtins.ip.system = types.MethodType(xsys, ip) + builtins.ip.builtin_trap.activate() + from .core import page + + page.pager_page = nopage + # yield + + +inject() diff --git a/.venv/lib/python3.8/site-packages/IPython/consoleapp.py b/.venv/lib/python3.8/site-packages/IPython/consoleapp.py new file mode 100644 index 00000000..c2bbe188 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/consoleapp.py @@ -0,0 +1,12 @@ +""" +Shim to maintain backwards compatibility with old IPython.consoleapp imports. +""" +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +from warnings import warn + +warn("The `IPython.consoleapp` package has been deprecated since IPython 4.0." + "You should import from jupyter_client.consoleapp instead.", stacklevel=2) + +from jupyter_client.consoleapp import * diff --git a/delivery/delivery/ext/__init__.py b/.venv/lib/python3.8/site-packages/IPython/core/__init__.py similarity index 100% rename from delivery/delivery/ext/__init__.py rename to .venv/lib/python3.8/site-packages/IPython/core/__init__.py diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..b630edf9 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/alias.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/alias.cpython-38.pyc new file mode 100644 index 00000000..d717d6a0 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/alias.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/application.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/application.cpython-38.pyc new file mode 100644 index 00000000..1c49e043 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/application.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/async_helpers.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/async_helpers.cpython-38.pyc new file mode 100644 index 00000000..0fb8f06f Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/async_helpers.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/autocall.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/autocall.cpython-38.pyc new file mode 100644 index 00000000..d8c349ee Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/autocall.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/builtin_trap.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/builtin_trap.cpython-38.pyc new file mode 100644 index 00000000..a74e6625 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/builtin_trap.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/compilerop.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/compilerop.cpython-38.pyc new file mode 100644 index 00000000..11bb3f84 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/compilerop.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/completer.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/completer.cpython-38.pyc new file mode 100644 index 00000000..977415f2 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/completer.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/completerlib.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/completerlib.cpython-38.pyc new file mode 100644 index 00000000..fd6d7959 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/completerlib.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/crashhandler.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/crashhandler.cpython-38.pyc new file mode 100644 index 00000000..c6e04b3e Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/crashhandler.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/debugger.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/debugger.cpython-38.pyc new file mode 100644 index 00000000..69659941 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/debugger.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/display.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/display.cpython-38.pyc new file mode 100644 index 00000000..3ae29f65 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/display.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/display_trap.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/display_trap.cpython-38.pyc new file mode 100644 index 00000000..a66e3669 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/display_trap.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/displayhook.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/displayhook.cpython-38.pyc new file mode 100644 index 00000000..51e429e1 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/displayhook.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/displaypub.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/displaypub.cpython-38.pyc new file mode 100644 index 00000000..21ddb61d Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/displaypub.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/error.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/error.cpython-38.pyc new file mode 100644 index 00000000..1ce396d0 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/error.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/events.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/events.cpython-38.pyc new file mode 100644 index 00000000..2a728ae5 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/events.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/excolors.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/excolors.cpython-38.pyc new file mode 100644 index 00000000..f159d388 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/excolors.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/extensions.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/extensions.cpython-38.pyc new file mode 100644 index 00000000..6f63cc38 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/extensions.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/formatters.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/formatters.cpython-38.pyc new file mode 100644 index 00000000..beca8174 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/formatters.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/getipython.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/getipython.cpython-38.pyc new file mode 100644 index 00000000..a94980e9 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/getipython.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/history.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/history.cpython-38.pyc new file mode 100644 index 00000000..c07db8c2 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/history.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/historyapp.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/historyapp.cpython-38.pyc new file mode 100644 index 00000000..60bc5cbd Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/historyapp.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/hooks.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/hooks.cpython-38.pyc new file mode 100644 index 00000000..17db787c Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/hooks.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/inputsplitter.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/inputsplitter.cpython-38.pyc new file mode 100644 index 00000000..2300b5e5 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/inputsplitter.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/inputtransformer.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/inputtransformer.cpython-38.pyc new file mode 100644 index 00000000..2158e776 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/inputtransformer.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/inputtransformer2.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/inputtransformer2.cpython-38.pyc new file mode 100644 index 00000000..cf0921fd Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/inputtransformer2.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/interactiveshell.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/interactiveshell.cpython-38.pyc new file mode 100644 index 00000000..468f71b7 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/interactiveshell.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/latex_symbols.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/latex_symbols.cpython-38.pyc new file mode 100644 index 00000000..0c009103 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/latex_symbols.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/logger.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/logger.cpython-38.pyc new file mode 100644 index 00000000..b94f37d3 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/logger.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/macro.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/macro.cpython-38.pyc new file mode 100644 index 00000000..aa16b430 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/macro.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/magic.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/magic.cpython-38.pyc new file mode 100644 index 00000000..02863c4f Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/magic.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/magic_arguments.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/magic_arguments.cpython-38.pyc new file mode 100644 index 00000000..7a05514c Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/magic_arguments.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/oinspect.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/oinspect.cpython-38.pyc new file mode 100644 index 00000000..c06970b1 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/oinspect.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/page.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/page.cpython-38.pyc new file mode 100644 index 00000000..81361de1 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/page.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/payload.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/payload.cpython-38.pyc new file mode 100644 index 00000000..073dc86e Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/payload.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/payloadpage.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/payloadpage.cpython-38.pyc new file mode 100644 index 00000000..f655a83e Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/payloadpage.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/prefilter.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/prefilter.cpython-38.pyc new file mode 100644 index 00000000..df80744b Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/prefilter.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/profileapp.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/profileapp.cpython-38.pyc new file mode 100644 index 00000000..8179b20b Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/profileapp.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/profiledir.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/profiledir.cpython-38.pyc new file mode 100644 index 00000000..9b41da32 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/profiledir.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/prompts.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/prompts.cpython-38.pyc new file mode 100644 index 00000000..ebb03875 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/prompts.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/pylabtools.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/pylabtools.cpython-38.pyc new file mode 100644 index 00000000..cb91b701 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/pylabtools.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/release.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/release.cpython-38.pyc new file mode 100644 index 00000000..e181b846 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/release.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/shellapp.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/shellapp.cpython-38.pyc new file mode 100644 index 00000000..3f012923 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/shellapp.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/splitinput.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/splitinput.cpython-38.pyc new file mode 100644 index 00000000..4ec5054d Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/splitinput.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/ultratb.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/ultratb.cpython-38.pyc new file mode 100644 index 00000000..c4446378 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/ultratb.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/usage.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/usage.cpython-38.pyc new file mode 100644 index 00000000..96963173 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/core/__pycache__/usage.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/core/alias.py b/.venv/lib/python3.8/site-packages/IPython/core/alias.py new file mode 100644 index 00000000..2ad99023 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/alias.py @@ -0,0 +1,258 @@ +# encoding: utf-8 +""" +System command aliases. + +Authors: + +* Fernando Perez +* Brian Granger +""" + +#----------------------------------------------------------------------------- +# Copyright (C) 2008-2011 The IPython Development Team +# +# Distributed under the terms of the BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +import os +import re +import sys + +from traitlets.config.configurable import Configurable +from .error import UsageError + +from traitlets import List, Instance +from logging import error + +#----------------------------------------------------------------------------- +# Utilities +#----------------------------------------------------------------------------- + +# This is used as the pattern for calls to split_user_input. +shell_line_split = re.compile(r'^(\s*)()(\S+)(.*$)') + +def default_aliases(): + """Return list of shell aliases to auto-define. + """ + # Note: the aliases defined here should be safe to use on a kernel + # regardless of what frontend it is attached to. Frontends that use a + # kernel in-process can define additional aliases that will only work in + # their case. For example, things like 'less' or 'clear' that manipulate + # the terminal should NOT be declared here, as they will only work if the + # kernel is running inside a true terminal, and not over the network. + + if os.name == 'posix': + default_aliases = [('mkdir', 'mkdir'), ('rmdir', 'rmdir'), + ('mv', 'mv'), ('rm', 'rm'), ('cp', 'cp'), + ('cat', 'cat'), + ] + # Useful set of ls aliases. The GNU and BSD options are a little + # different, so we make aliases that provide as similar as possible + # behavior in ipython, by passing the right flags for each platform + if sys.platform.startswith('linux'): + ls_aliases = [('ls', 'ls -F --color'), + # long ls + ('ll', 'ls -F -o --color'), + # ls normal files only + ('lf', 'ls -F -o --color %l | grep ^-'), + # ls symbolic links + ('lk', 'ls -F -o --color %l | grep ^l'), + # directories or links to directories, + ('ldir', 'ls -F -o --color %l | grep /$'), + # things which are executable + ('lx', 'ls -F -o --color %l | grep ^-..x'), + ] + elif sys.platform.startswith('openbsd') or sys.platform.startswith('netbsd'): + # OpenBSD, NetBSD. The ls implementation on these platforms do not support + # the -G switch and lack the ability to use colorized output. + ls_aliases = [('ls', 'ls -F'), + # long ls + ('ll', 'ls -F -l'), + # ls normal files only + ('lf', 'ls -F -l %l | grep ^-'), + # ls symbolic links + ('lk', 'ls -F -l %l | grep ^l'), + # directories or links to directories, + ('ldir', 'ls -F -l %l | grep /$'), + # things which are executable + ('lx', 'ls -F -l %l | grep ^-..x'), + ] + else: + # BSD, OSX, etc. + ls_aliases = [('ls', 'ls -F -G'), + # long ls + ('ll', 'ls -F -l -G'), + # ls normal files only + ('lf', 'ls -F -l -G %l | grep ^-'), + # ls symbolic links + ('lk', 'ls -F -l -G %l | grep ^l'), + # directories or links to directories, + ('ldir', 'ls -F -G -l %l | grep /$'), + # things which are executable + ('lx', 'ls -F -l -G %l | grep ^-..x'), + ] + default_aliases = default_aliases + ls_aliases + elif os.name in ['nt', 'dos']: + default_aliases = [('ls', 'dir /on'), + ('ddir', 'dir /ad /on'), ('ldir', 'dir /ad /on'), + ('mkdir', 'mkdir'), ('rmdir', 'rmdir'), + ('echo', 'echo'), ('ren', 'ren'), ('copy', 'copy'), + ] + else: + default_aliases = [] + + return default_aliases + + +class AliasError(Exception): + pass + + +class InvalidAliasError(AliasError): + pass + +class Alias(object): + """Callable object storing the details of one alias. + + Instances are registered as magic functions to allow use of aliases. + """ + + # Prepare blacklist + blacklist = {'cd','popd','pushd','dhist','alias','unalias'} + + def __init__(self, shell, name, cmd): + self.shell = shell + self.name = name + self.cmd = cmd + self.__doc__ = "Alias for `!{}`".format(cmd) + self.nargs = self.validate() + + def validate(self): + """Validate the alias, and return the number of arguments.""" + if self.name in self.blacklist: + raise InvalidAliasError("The name %s can't be aliased " + "because it is a keyword or builtin." % self.name) + try: + caller = self.shell.magics_manager.magics['line'][self.name] + except KeyError: + pass + else: + if not isinstance(caller, Alias): + raise InvalidAliasError("The name %s can't be aliased " + "because it is another magic command." % self.name) + + if not (isinstance(self.cmd, str)): + raise InvalidAliasError("An alias command must be a string, " + "got: %r" % self.cmd) + + nargs = self.cmd.count('%s') - self.cmd.count('%%s') + + if (nargs > 0) and (self.cmd.find('%l') >= 0): + raise InvalidAliasError('The %s and %l specifiers are mutually ' + 'exclusive in alias definitions.') + + return nargs + + def __repr__(self): + return "".format(self.name, self.cmd) + + def __call__(self, rest=''): + cmd = self.cmd + nargs = self.nargs + # Expand the %l special to be the user's input line + if cmd.find('%l') >= 0: + cmd = cmd.replace('%l', rest) + rest = '' + + if nargs==0: + if cmd.find('%%s') >= 1: + cmd = cmd.replace('%%s', '%s') + # Simple, argument-less aliases + cmd = '%s %s' % (cmd, rest) + else: + # Handle aliases with positional arguments + args = rest.split(None, nargs) + if len(args) < nargs: + raise UsageError('Alias <%s> requires %s arguments, %s given.' % + (self.name, nargs, len(args))) + cmd = '%s %s' % (cmd % tuple(args[:nargs]),' '.join(args[nargs:])) + + self.shell.system(cmd) + +#----------------------------------------------------------------------------- +# Main AliasManager class +#----------------------------------------------------------------------------- + +class AliasManager(Configurable): + + default_aliases = List(default_aliases()).tag(config=True) + user_aliases = List(default_value=[]).tag(config=True) + shell = Instance('IPython.core.interactiveshell.InteractiveShellABC', allow_none=True) + + def __init__(self, shell=None, **kwargs): + super(AliasManager, self).__init__(shell=shell, **kwargs) + # For convenient access + self.linemagics = self.shell.magics_manager.magics['line'] + self.init_aliases() + + def init_aliases(self): + # Load default & user aliases + for name, cmd in self.default_aliases + self.user_aliases: + if cmd.startswith('ls ') and self.shell.colors == 'NoColor': + cmd = cmd.replace(' --color', '') + self.soft_define_alias(name, cmd) + + @property + def aliases(self): + return [(n, func.cmd) for (n, func) in self.linemagics.items() + if isinstance(func, Alias)] + + def soft_define_alias(self, name, cmd): + """Define an alias, but don't raise on an AliasError.""" + try: + self.define_alias(name, cmd) + except AliasError as e: + error("Invalid alias: %s" % e) + + def define_alias(self, name, cmd): + """Define a new alias after validating it. + + This will raise an :exc:`AliasError` if there are validation + problems. + """ + caller = Alias(shell=self.shell, name=name, cmd=cmd) + self.shell.magics_manager.register_function(caller, magic_kind='line', + magic_name=name) + + def get_alias(self, name): + """Return an alias, or None if no alias by that name exists.""" + aname = self.linemagics.get(name, None) + return aname if isinstance(aname, Alias) else None + + def is_alias(self, name): + """Return whether or not a given name has been defined as an alias""" + return self.get_alias(name) is not None + + def undefine_alias(self, name): + if self.is_alias(name): + del self.linemagics[name] + else: + raise ValueError('%s is not an alias' % name) + + def clear_aliases(self): + for name, cmd in self.aliases: + self.undefine_alias(name) + + def retrieve_alias(self, name): + """Retrieve the command to which an alias expands.""" + caller = self.get_alias(name) + if caller: + return caller.cmd + else: + raise ValueError('%s is not an alias' % name) diff --git a/.venv/lib/python3.8/site-packages/IPython/core/application.py b/.venv/lib/python3.8/site-packages/IPython/core/application.py new file mode 100644 index 00000000..93639d88 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/application.py @@ -0,0 +1,462 @@ +# encoding: utf-8 +""" +An application for IPython. + +All top-level applications should use the classes in this module for +handling configuration and creating configurables. + +The job of an :class:`Application` is to create the master configuration +object and then create the configurable objects, passing the config to them. +""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +import atexit +from copy import deepcopy +import glob +import logging +import os +import shutil +import sys + +from traitlets.config.application import Application, catch_config_error +from traitlets.config.loader import ConfigFileNotFound, PyFileConfigLoader +from IPython.core import release, crashhandler +from IPython.core.profiledir import ProfileDir, ProfileDirError +from IPython.paths import get_ipython_dir, get_ipython_package_dir +from IPython.utils.path import ensure_dir_exists +from traitlets import ( + List, Unicode, Type, Bool, Set, Instance, Undefined, + default, observe, +) + +if os.name == 'nt': + programdata = os.environ.get('PROGRAMDATA', None) + if programdata: + SYSTEM_CONFIG_DIRS = [os.path.join(programdata, 'ipython')] + else: # PROGRAMDATA is not defined by default on XP. + SYSTEM_CONFIG_DIRS = [] +else: + SYSTEM_CONFIG_DIRS = [ + "/usr/local/etc/ipython", + "/etc/ipython", + ] + + +ENV_CONFIG_DIRS = [] +_env_config_dir = os.path.join(sys.prefix, 'etc', 'ipython') +if _env_config_dir not in SYSTEM_CONFIG_DIRS: + # only add ENV_CONFIG if sys.prefix is not already included + ENV_CONFIG_DIRS.append(_env_config_dir) + + +_envvar = os.environ.get('IPYTHON_SUPPRESS_CONFIG_ERRORS') +if _envvar in {None, ''}: + IPYTHON_SUPPRESS_CONFIG_ERRORS = None +else: + if _envvar.lower() in {'1','true'}: + IPYTHON_SUPPRESS_CONFIG_ERRORS = True + elif _envvar.lower() in {'0','false'} : + IPYTHON_SUPPRESS_CONFIG_ERRORS = False + else: + sys.exit("Unsupported value for environment variable: 'IPYTHON_SUPPRESS_CONFIG_ERRORS' is set to '%s' which is none of {'0', '1', 'false', 'true', ''}."% _envvar ) + +# aliases and flags + +base_aliases = { + 'profile-dir' : 'ProfileDir.location', + 'profile' : 'BaseIPythonApplication.profile', + 'ipython-dir' : 'BaseIPythonApplication.ipython_dir', + 'log-level' : 'Application.log_level', + 'config' : 'BaseIPythonApplication.extra_config_file', +} + +base_flags = dict( + debug = ({'Application' : {'log_level' : logging.DEBUG}}, + "set log level to logging.DEBUG (maximize logging output)"), + quiet = ({'Application' : {'log_level' : logging.CRITICAL}}, + "set log level to logging.CRITICAL (minimize logging output)"), + init = ({'BaseIPythonApplication' : { + 'copy_config_files' : True, + 'auto_create' : True} + }, """Initialize profile with default config files. This is equivalent + to running `ipython profile create ` prior to startup. + """) +) + +class ProfileAwareConfigLoader(PyFileConfigLoader): + """A Python file config loader that is aware of IPython profiles.""" + def load_subconfig(self, fname, path=None, profile=None): + if profile is not None: + try: + profile_dir = ProfileDir.find_profile_dir_by_name( + get_ipython_dir(), + profile, + ) + except ProfileDirError: + return + path = profile_dir.location + return super(ProfileAwareConfigLoader, self).load_subconfig(fname, path=path) + +class BaseIPythonApplication(Application): + + name = u'ipython' + description = Unicode(u'IPython: an enhanced interactive Python shell.') + version = Unicode(release.version) + + aliases = base_aliases + flags = base_flags + classes = List([ProfileDir]) + + # enable `load_subconfig('cfg.py', profile='name')` + python_config_loader_class = ProfileAwareConfigLoader + + # Track whether the config_file has changed, + # because some logic happens only if we aren't using the default. + config_file_specified = Set() + + config_file_name = Unicode() + @default('config_file_name') + def _config_file_name_default(self): + return self.name.replace('-','_') + u'_config.py' + @observe('config_file_name') + def _config_file_name_changed(self, change): + if change['new'] != change['old']: + self.config_file_specified.add(change['new']) + + # The directory that contains IPython's builtin profiles. + builtin_profile_dir = Unicode( + os.path.join(get_ipython_package_dir(), u'config', u'profile', u'default') + ) + + config_file_paths = List(Unicode()) + @default('config_file_paths') + def _config_file_paths_default(self): + return [os.getcwd()] + + extra_config_file = Unicode( + help="""Path to an extra config file to load. + + If specified, load this config file in addition to any other IPython config. + """).tag(config=True) + @observe('extra_config_file') + def _extra_config_file_changed(self, change): + old = change['old'] + new = change['new'] + try: + self.config_files.remove(old) + except ValueError: + pass + self.config_file_specified.add(new) + self.config_files.append(new) + + profile = Unicode(u'default', + help="""The IPython profile to use.""" + ).tag(config=True) + + @observe('profile') + def _profile_changed(self, change): + self.builtin_profile_dir = os.path.join( + get_ipython_package_dir(), u'config', u'profile', change['new'] + ) + + ipython_dir = Unicode( + help=""" + The name of the IPython directory. This directory is used for logging + configuration (through profiles), history storage, etc. The default + is usually $HOME/.ipython. This option can also be specified through + the environment variable IPYTHONDIR. + """ + ).tag(config=True) + @default('ipython_dir') + def _ipython_dir_default(self): + d = get_ipython_dir() + self._ipython_dir_changed({ + 'name': 'ipython_dir', + 'old': d, + 'new': d, + }) + return d + + _in_init_profile_dir = False + profile_dir = Instance(ProfileDir, allow_none=True) + @default('profile_dir') + def _profile_dir_default(self): + # avoid recursion + if self._in_init_profile_dir: + return + # profile_dir requested early, force initialization + self.init_profile_dir() + return self.profile_dir + + overwrite = Bool(False, + help="""Whether to overwrite existing config files when copying""" + ).tag(config=True) + auto_create = Bool(False, + help="""Whether to create profile dir if it doesn't exist""" + ).tag(config=True) + + config_files = List(Unicode()) + @default('config_files') + def _config_files_default(self): + return [self.config_file_name] + + copy_config_files = Bool(False, + help="""Whether to install the default config files into the profile dir. + If a new profile is being created, and IPython contains config files for that + profile, then they will be staged into the new directory. Otherwise, + default config files will be automatically generated. + """).tag(config=True) + + verbose_crash = Bool(False, + help="""Create a massive crash report when IPython encounters what may be an + internal error. The default is to append a short message to the + usual traceback""").tag(config=True) + + # The class to use as the crash handler. + crash_handler_class = Type(crashhandler.CrashHandler) + + @catch_config_error + def __init__(self, **kwargs): + super(BaseIPythonApplication, self).__init__(**kwargs) + # ensure current working directory exists + try: + os.getcwd() + except: + # exit if cwd doesn't exist + self.log.error("Current working directory doesn't exist.") + self.exit(1) + + #------------------------------------------------------------------------- + # Various stages of Application creation + #------------------------------------------------------------------------- + + deprecated_subcommands = {} + + def initialize_subcommand(self, subc, argv=None): + if subc in self.deprecated_subcommands: + self.log.warning("Subcommand `ipython {sub}` is deprecated and will be removed " + "in future versions.".format(sub=subc)) + self.log.warning("You likely want to use `jupyter {sub}` in the " + "future".format(sub=subc)) + return super(BaseIPythonApplication, self).initialize_subcommand(subc, argv) + + def init_crash_handler(self): + """Create a crash handler, typically setting sys.excepthook to it.""" + self.crash_handler = self.crash_handler_class(self) + sys.excepthook = self.excepthook + def unset_crashhandler(): + sys.excepthook = sys.__excepthook__ + atexit.register(unset_crashhandler) + + def excepthook(self, etype, evalue, tb): + """this is sys.excepthook after init_crashhandler + + set self.verbose_crash=True to use our full crashhandler, instead of + a regular traceback with a short message (crash_handler_lite) + """ + + if self.verbose_crash: + return self.crash_handler(etype, evalue, tb) + else: + return crashhandler.crash_handler_lite(etype, evalue, tb) + + @observe('ipython_dir') + def _ipython_dir_changed(self, change): + old = change['old'] + new = change['new'] + if old is not Undefined: + str_old = os.path.abspath(old) + if str_old in sys.path: + sys.path.remove(str_old) + str_path = os.path.abspath(new) + sys.path.append(str_path) + ensure_dir_exists(new) + readme = os.path.join(new, 'README') + readme_src = os.path.join(get_ipython_package_dir(), u'config', u'profile', 'README') + if not os.path.exists(readme) and os.path.exists(readme_src): + shutil.copy(readme_src, readme) + for d in ('extensions', 'nbextensions'): + path = os.path.join(new, d) + try: + ensure_dir_exists(path) + except OSError as e: + # this will not be EEXIST + self.log.error("couldn't create path %s: %s", path, e) + self.log.debug("IPYTHONDIR set to: %s" % new) + + def load_config_file(self, suppress_errors=IPYTHON_SUPPRESS_CONFIG_ERRORS): + """Load the config file. + + By default, errors in loading config are handled, and a warning + printed on screen. For testing, the suppress_errors option is set + to False, so errors will make tests fail. + + `suppress_errors` default value is to be `None` in which case the + behavior default to the one of `traitlets.Application`. + + The default value can be set : + - to `False` by setting 'IPYTHON_SUPPRESS_CONFIG_ERRORS' environment variable to '0', or 'false' (case insensitive). + - to `True` by setting 'IPYTHON_SUPPRESS_CONFIG_ERRORS' environment variable to '1' or 'true' (case insensitive). + - to `None` by setting 'IPYTHON_SUPPRESS_CONFIG_ERRORS' environment variable to '' (empty string) or leaving it unset. + + Any other value are invalid, and will make IPython exit with a non-zero return code. + """ + + + self.log.debug("Searching path %s for config files", self.config_file_paths) + base_config = 'ipython_config.py' + self.log.debug("Attempting to load config file: %s" % + base_config) + try: + if suppress_errors is not None: + old_value = Application.raise_config_file_errors + Application.raise_config_file_errors = not suppress_errors; + Application.load_config_file( + self, + base_config, + path=self.config_file_paths + ) + except ConfigFileNotFound: + # ignore errors loading parent + self.log.debug("Config file %s not found", base_config) + pass + if suppress_errors is not None: + Application.raise_config_file_errors = old_value + + for config_file_name in self.config_files: + if not config_file_name or config_file_name == base_config: + continue + self.log.debug("Attempting to load config file: %s" % + self.config_file_name) + try: + Application.load_config_file( + self, + config_file_name, + path=self.config_file_paths + ) + except ConfigFileNotFound: + # Only warn if the default config file was NOT being used. + if config_file_name in self.config_file_specified: + msg = self.log.warning + else: + msg = self.log.debug + msg("Config file not found, skipping: %s", config_file_name) + except Exception: + # For testing purposes. + if not suppress_errors: + raise + self.log.warning("Error loading config file: %s" % + self.config_file_name, exc_info=True) + + def init_profile_dir(self): + """initialize the profile dir""" + self._in_init_profile_dir = True + if self.profile_dir is not None: + # already ran + return + if 'ProfileDir.location' not in self.config: + # location not specified, find by profile name + try: + p = ProfileDir.find_profile_dir_by_name(self.ipython_dir, self.profile, self.config) + except ProfileDirError: + # not found, maybe create it (always create default profile) + if self.auto_create or self.profile == 'default': + try: + p = ProfileDir.create_profile_dir_by_name(self.ipython_dir, self.profile, self.config) + except ProfileDirError: + self.log.fatal("Could not create profile: %r"%self.profile) + self.exit(1) + else: + self.log.info("Created profile dir: %r"%p.location) + else: + self.log.fatal("Profile %r not found."%self.profile) + self.exit(1) + else: + self.log.debug("Using existing profile dir: %r"%p.location) + else: + location = self.config.ProfileDir.location + # location is fully specified + try: + p = ProfileDir.find_profile_dir(location, self.config) + except ProfileDirError: + # not found, maybe create it + if self.auto_create: + try: + p = ProfileDir.create_profile_dir(location, self.config) + except ProfileDirError: + self.log.fatal("Could not create profile directory: %r"%location) + self.exit(1) + else: + self.log.debug("Creating new profile dir: %r"%location) + else: + self.log.fatal("Profile directory %r not found."%location) + self.exit(1) + else: + self.log.info("Using existing profile dir: %r"%location) + # if profile_dir is specified explicitly, set profile name + dir_name = os.path.basename(p.location) + if dir_name.startswith('profile_'): + self.profile = dir_name[8:] + + self.profile_dir = p + self.config_file_paths.append(p.location) + self._in_init_profile_dir = False + + def init_config_files(self): + """[optionally] copy default config files into profile dir.""" + self.config_file_paths.extend(ENV_CONFIG_DIRS) + self.config_file_paths.extend(SYSTEM_CONFIG_DIRS) + # copy config files + path = self.builtin_profile_dir + if self.copy_config_files: + src = self.profile + + cfg = self.config_file_name + if path and os.path.exists(os.path.join(path, cfg)): + self.log.warning("Staging %r from %s into %r [overwrite=%s]"%( + cfg, src, self.profile_dir.location, self.overwrite) + ) + self.profile_dir.copy_config_file(cfg, path=path, overwrite=self.overwrite) + else: + self.stage_default_config_file() + else: + # Still stage *bundled* config files, but not generated ones + # This is necessary for `ipython profile=sympy` to load the profile + # on the first go + files = glob.glob(os.path.join(path, '*.py')) + for fullpath in files: + cfg = os.path.basename(fullpath) + if self.profile_dir.copy_config_file(cfg, path=path, overwrite=False): + # file was copied + self.log.warning("Staging bundled %s from %s into %r"%( + cfg, self.profile, self.profile_dir.location) + ) + + + def stage_default_config_file(self): + """auto generate default config file, and stage it into the profile.""" + s = self.generate_config_file() + fname = os.path.join(self.profile_dir.location, self.config_file_name) + if self.overwrite or not os.path.exists(fname): + self.log.warning("Generating default config file: %r"%(fname)) + with open(fname, 'w') as f: + f.write(s) + + @catch_config_error + def initialize(self, argv=None): + # don't hook up crash handler before parsing command-line + self.parse_command_line(argv) + self.init_crash_handler() + if self.subapp is not None: + # stop here if subapp is taking over + return + # save a copy of CLI config to re-load after config files + # so that it has highest priority + cl_config = deepcopy(self.config) + self.init_profile_dir() + self.init_config_files() + self.load_config_file() + # enforce cl-opts override configfile opts: + self.update_config(cl_config) diff --git a/.venv/lib/python3.8/site-packages/IPython/core/async_helpers.py b/.venv/lib/python3.8/site-packages/IPython/core/async_helpers.py new file mode 100644 index 00000000..fb4cc193 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/async_helpers.py @@ -0,0 +1,173 @@ +""" +Async helper function that are invalid syntax on Python 3.5 and below. + +This code is best effort, and may have edge cases not behaving as expected. In +particular it contain a number of heuristics to detect whether code is +effectively async and need to run in an event loop or not. + +Some constructs (like top-level `return`, or `yield`) are taken care of +explicitly to actually raise a SyntaxError and stay as close as possible to +Python semantics. +""" + + +import ast +import sys +import inspect +from textwrap import dedent, indent + + +class _AsyncIORunner: + + def __call__(self, coro): + """ + Handler for asyncio autoawait + """ + import asyncio + + return asyncio.get_event_loop().run_until_complete(coro) + + def __str__(self): + return 'asyncio' + +_asyncio_runner = _AsyncIORunner() + + +def _curio_runner(coroutine): + """ + handler for curio autoawait + """ + import curio + + return curio.run(coroutine) + + +def _trio_runner(async_fn): + import trio + + async def loc(coro): + """ + We need the dummy no-op async def to protect from + trio's internal. See https://github.com/python-trio/trio/issues/89 + """ + return await coro + + return trio.run(loc, async_fn) + + +def _pseudo_sync_runner(coro): + """ + A runner that does not really allow async execution, and just advance the coroutine. + + See discussion in https://github.com/python-trio/trio/issues/608, + + Credit to Nathaniel Smith + + """ + try: + coro.send(None) + except StopIteration as exc: + return exc.value + else: + # TODO: do not raise but return an execution result with the right info. + raise RuntimeError( + "{coro_name!r} needs a real async loop".format(coro_name=coro.__name__) + ) + + +def _asyncify(code: str) -> str: + """wrap code in async def definition. + + And setup a bit of context to run it later. + """ + res = dedent( + """ + async def __wrapper__(): + try: + {usercode} + finally: + locals() + """ + ).format(usercode=indent(code, " " * 8)) + return res + + +class _AsyncSyntaxErrorVisitor(ast.NodeVisitor): + """ + Find syntax errors that would be an error in an async repl, but because + the implementation involves wrapping the repl in an async function, it + is erroneously allowed (e.g. yield or return at the top level) + """ + def __init__(self): + if sys.version_info >= (3,8): + raise ValueError('DEPRECATED in Python 3.8+') + self.depth = 0 + super().__init__() + + def generic_visit(self, node): + func_types = (ast.FunctionDef, ast.AsyncFunctionDef) + invalid_types_by_depth = { + 0: (ast.Return, ast.Yield, ast.YieldFrom), + 1: (ast.Nonlocal,) + } + + should_traverse = self.depth < max(invalid_types_by_depth.keys()) + if isinstance(node, func_types) and should_traverse: + self.depth += 1 + super().generic_visit(node) + self.depth -= 1 + elif isinstance(node, invalid_types_by_depth[self.depth]): + raise SyntaxError() + else: + super().generic_visit(node) + + +def _async_parse_cell(cell: str) -> ast.AST: + """ + This is a compatibility shim for pre-3.7 when async outside of a function + is a syntax error at the parse stage. + + It will return an abstract syntax tree parsed as if async and await outside + of a function were not a syntax error. + """ + if sys.version_info < (3, 7): + # Prior to 3.7 you need to asyncify before parse + wrapped_parse_tree = ast.parse(_asyncify(cell)) + return wrapped_parse_tree.body[0].body[0] + else: + return ast.parse(cell) + + +def _should_be_async(cell: str) -> bool: + """Detect if a block of code need to be wrapped in an `async def` + + Attempt to parse the block of code, it it compile we're fine. + Otherwise we wrap if and try to compile. + + If it works, assume it should be async. Otherwise Return False. + + Not handled yet: If the block of code has a return statement as the top + level, it will be seen as async. This is a know limitation. + """ + if sys.version_info > (3, 8): + try: + code = compile(cell, "<>", "exec", flags=getattr(ast,'PyCF_ALLOW_TOP_LEVEL_AWAIT', 0x0)) + return inspect.CO_COROUTINE & code.co_flags == inspect.CO_COROUTINE + except (SyntaxError, MemoryError): + return False + try: + # we can't limit ourself to ast.parse, as it __accepts__ to parse on + # 3.7+, but just does not _compile_ + code = compile(cell, "<>", "exec") + except (SyntaxError, MemoryError): + try: + parse_tree = _async_parse_cell(cell) + + # Raise a SyntaxError if there are top-level return or yields + v = _AsyncSyntaxErrorVisitor() + v.visit(parse_tree) + + except (SyntaxError, MemoryError): + return False + return True + return False diff --git a/.venv/lib/python3.8/site-packages/IPython/core/autocall.py b/.venv/lib/python3.8/site-packages/IPython/core/autocall.py new file mode 100644 index 00000000..bab7f859 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/autocall.py @@ -0,0 +1,70 @@ +# encoding: utf-8 +""" +Autocall capabilities for IPython.core. + +Authors: + +* Brian Granger +* Fernando Perez +* Thomas Kluyver + +Notes +----- +""" + +#----------------------------------------------------------------------------- +# Copyright (C) 2008-2011 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + + +#----------------------------------------------------------------------------- +# Code +#----------------------------------------------------------------------------- + +class IPyAutocall(object): + """ Instances of this class are always autocalled + + This happens regardless of 'autocall' variable state. Use this to + develop macro-like mechanisms. + """ + _ip = None + rewrite = True + def __init__(self, ip=None): + self._ip = ip + + def set_ip(self, ip): + """ Will be used to set _ip point to current ipython instance b/f call + + Override this method if you don't want this to happen. + + """ + self._ip = ip + + +class ExitAutocall(IPyAutocall): + """An autocallable object which will be added to the user namespace so that + exit, exit(), quit or quit() are all valid ways to close the shell.""" + rewrite = False + + def __call__(self): + self._ip.ask_exit() + +class ZMQExitAutocall(ExitAutocall): + """Exit IPython. Autocallable, so it needn't be explicitly called. + + Parameters + ---------- + keep_kernel : bool + If True, leave the kernel alive. Otherwise, tell the kernel to exit too + (default). + """ + def __call__(self, keep_kernel=False): + self._ip.keepkernel_on_exit = keep_kernel + self._ip.ask_exit() diff --git a/.venv/lib/python3.8/site-packages/IPython/core/builtin_trap.py b/.venv/lib/python3.8/site-packages/IPython/core/builtin_trap.py new file mode 100644 index 00000000..a8ea4abc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/builtin_trap.py @@ -0,0 +1,86 @@ +""" +A context manager for managing things injected into :mod:`builtins`. +""" +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. +import builtins as builtin_mod + +from traitlets.config.configurable import Configurable + +from traitlets import Instance + + +class __BuiltinUndefined(object): pass +BuiltinUndefined = __BuiltinUndefined() + +class __HideBuiltin(object): pass +HideBuiltin = __HideBuiltin() + + +class BuiltinTrap(Configurable): + + shell = Instance('IPython.core.interactiveshell.InteractiveShellABC', + allow_none=True) + + def __init__(self, shell=None): + super(BuiltinTrap, self).__init__(shell=shell, config=None) + self._orig_builtins = {} + # We define this to track if a single BuiltinTrap is nested. + # Only turn off the trap when the outermost call to __exit__ is made. + self._nested_level = 0 + self.shell = shell + # builtins we always add - if set to HideBuiltin, they will just + # be removed instead of being replaced by something else + self.auto_builtins = {'exit': HideBuiltin, + 'quit': HideBuiltin, + 'get_ipython': self.shell.get_ipython, + } + + def __enter__(self): + if self._nested_level == 0: + self.activate() + self._nested_level += 1 + # I return self, so callers can use add_builtin in a with clause. + return self + + def __exit__(self, type, value, traceback): + if self._nested_level == 1: + self.deactivate() + self._nested_level -= 1 + # Returning False will cause exceptions to propagate + return False + + def add_builtin(self, key, value): + """Add a builtin and save the original.""" + bdict = builtin_mod.__dict__ + orig = bdict.get(key, BuiltinUndefined) + if value is HideBuiltin: + if orig is not BuiltinUndefined: #same as 'key in bdict' + self._orig_builtins[key] = orig + del bdict[key] + else: + self._orig_builtins[key] = orig + bdict[key] = value + + def remove_builtin(self, key, orig): + """Remove an added builtin and re-set the original.""" + if orig is BuiltinUndefined: + del builtin_mod.__dict__[key] + else: + builtin_mod.__dict__[key] = orig + + def activate(self): + """Store ipython references in the __builtin__ namespace.""" + + add_builtin = self.add_builtin + for name, func in self.auto_builtins.items(): + add_builtin(name, func) + + def deactivate(self): + """Remove any builtins which might have been added by add_builtins, or + restore overwritten ones to their previous values.""" + remove_builtin = self.remove_builtin + for key, val in self._orig_builtins.items(): + remove_builtin(key, val) + self._orig_builtins.clear() + self._builtins_added = False diff --git a/.venv/lib/python3.8/site-packages/IPython/core/compilerop.py b/.venv/lib/python3.8/site-packages/IPython/core/compilerop.py new file mode 100644 index 00000000..c4771af7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/compilerop.py @@ -0,0 +1,160 @@ +"""Compiler tools with improved interactive support. + +Provides compilation machinery similar to codeop, but with caching support so +we can provide interactive tracebacks. + +Authors +------- +* Robert Kern +* Fernando Perez +* Thomas Kluyver +""" + +# Note: though it might be more natural to name this module 'compiler', that +# name is in the stdlib and name collisions with the stdlib tend to produce +# weird problems (often with third-party tools). + +#----------------------------------------------------------------------------- +# Copyright (C) 2010-2011 The IPython Development Team. +# +# Distributed under the terms of the BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +# Stdlib imports +import __future__ +from ast import PyCF_ONLY_AST +import codeop +import functools +import hashlib +import linecache +import operator +import time +from contextlib import contextmanager + +#----------------------------------------------------------------------------- +# Constants +#----------------------------------------------------------------------------- + +# Roughly equal to PyCF_MASK | PyCF_MASK_OBSOLETE as defined in pythonrun.h, +# this is used as a bitmask to extract future-related code flags. +PyCF_MASK = functools.reduce(operator.or_, + (getattr(__future__, fname).compiler_flag + for fname in __future__.all_feature_names)) + +#----------------------------------------------------------------------------- +# Local utilities +#----------------------------------------------------------------------------- + +def code_name(code, number=0): + """ Compute a (probably) unique name for code for caching. + + This now expects code to be unicode. + """ + hash_digest = hashlib.sha1(code.encode("utf-8")).hexdigest() + # Include the number and 12 characters of the hash in the name. It's + # pretty much impossible that in a single session we'll have collisions + # even with truncated hashes, and the full one makes tracebacks too long + return ''.format(number, hash_digest[:12]) + +#----------------------------------------------------------------------------- +# Classes and functions +#----------------------------------------------------------------------------- + +class CachingCompiler(codeop.Compile): + """A compiler that caches code compiled from interactive statements. + """ + + def __init__(self): + codeop.Compile.__init__(self) + + # This is ugly, but it must be done this way to allow multiple + # simultaneous ipython instances to coexist. Since Python itself + # directly accesses the data structures in the linecache module, and + # the cache therein is global, we must work with that data structure. + # We must hold a reference to the original checkcache routine and call + # that in our own check_cache() below, but the special IPython cache + # must also be shared by all IPython instances. If we were to hold + # separate caches (one in each CachingCompiler instance), any call made + # by Python itself to linecache.checkcache() would obliterate the + # cached data from the other IPython instances. + if not hasattr(linecache, '_ipython_cache'): + linecache._ipython_cache = {} + if not hasattr(linecache, '_checkcache_ori'): + linecache._checkcache_ori = linecache.checkcache + # Now, we must monkeypatch the linecache directly so that parts of the + # stdlib that call it outside our control go through our codepath + # (otherwise we'd lose our tracebacks). + linecache.checkcache = check_linecache_ipython + + + def ast_parse(self, source, filename='', symbol='exec'): + """Parse code to an AST with the current compiler flags active. + + Arguments are exactly the same as ast.parse (in the standard library), + and are passed to the built-in compile function.""" + return compile(source, filename, symbol, self.flags | PyCF_ONLY_AST, 1) + + def reset_compiler_flags(self): + """Reset compiler flags to default state.""" + # This value is copied from codeop.Compile.__init__, so if that ever + # changes, it will need to be updated. + self.flags = codeop.PyCF_DONT_IMPLY_DEDENT + + @property + def compiler_flags(self): + """Flags currently active in the compilation process. + """ + return self.flags + + def cache(self, code, number=0): + """Make a name for a block of code, and cache the code. + + Parameters + ---------- + code : str + The Python source code to cache. + number : int + A number which forms part of the code's name. Used for the execution + counter. + + Returns + ------- + The name of the cached code (as a string). Pass this as the filename + argument to compilation, so that tracebacks are correctly hooked up. + """ + name = code_name(code, number) + entry = (len(code), time.time(), + [line+'\n' for line in code.splitlines()], name) + linecache.cache[name] = entry + linecache._ipython_cache[name] = entry + return name + + @contextmanager + def extra_flags(self, flags): + ## bits that we'll set to 1 + turn_on_bits = ~self.flags & flags + + + self.flags = self.flags | flags + try: + yield + finally: + # turn off only the bits we turned on so that something like + # __future__ that set flags stays. + self.flags &= ~turn_on_bits + + +def check_linecache_ipython(*args): + """Call linecache.checkcache() safely protecting our cached values. + """ + # First call the original checkcache as intended + linecache._checkcache_ori(*args) + # Then, update back the cache with our data, so that tracebacks related + # to our compiled codes can be produced. + linecache.cache.update(linecache._ipython_cache) diff --git a/.venv/lib/python3.8/site-packages/IPython/core/completer.py b/.venv/lib/python3.8/site-packages/IPython/core/completer.py new file mode 100644 index 00000000..bc114f0f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/completer.py @@ -0,0 +1,2092 @@ +"""Completion for IPython. + +This module started as fork of the rlcompleter module in the Python standard +library. The original enhancements made to rlcompleter have been sent +upstream and were accepted as of Python 2.3, + +This module now support a wide variety of completion mechanism both available +for normal classic Python code, as well as completer for IPython specific +Syntax like magics. + +Latex and Unicode completion +============================ + +IPython and compatible frontends not only can complete your code, but can help +you to input a wide range of characters. In particular we allow you to insert +a unicode character using the tab completion mechanism. + +Forward latex/unicode completion +-------------------------------- + +Forward completion allows you to easily type a unicode character using its latex +name, or unicode long description. To do so type a backslash follow by the +relevant name and press tab: + + +Using latex completion: + +.. code:: + + \\alpha + α + +or using unicode completion: + + +.. code:: + + \\greek small letter alpha + α + + +Only valid Python identifiers will complete. Combining characters (like arrow or +dots) are also available, unlike latex they need to be put after the their +counterpart that is to say, `F\\\\vec` is correct, not `\\\\vecF`. + +Some browsers are known to display combining characters incorrectly. + +Backward latex completion +------------------------- + +It is sometime challenging to know how to type a character, if you are using +IPython, or any compatible frontend you can prepend backslash to the character +and press `` to expand it to its latex form. + +.. code:: + + \\α + \\alpha + + +Both forward and backward completions can be deactivated by setting the +``Completer.backslash_combining_completions`` option to ``False``. + + +Experimental +============ + +Starting with IPython 6.0, this module can make use of the Jedi library to +generate completions both using static analysis of the code, and dynamically +inspecting multiple namespaces. Jedi is an autocompletion and static analysis +for Python. The APIs attached to this new mechanism is unstable and will +raise unless use in an :any:`provisionalcompleter` context manager. + +You will find that the following are experimental: + + - :any:`provisionalcompleter` + - :any:`IPCompleter.completions` + - :any:`Completion` + - :any:`rectify_completions` + +.. note:: + + better name for :any:`rectify_completions` ? + +We welcome any feedback on these new API, and we also encourage you to try this +module in debug mode (start IPython with ``--Completer.debug=True``) in order +to have extra logging information if :any:`jedi` is crashing, or if current +IPython completer pending deprecations are returning results not yet handled +by :any:`jedi` + +Using Jedi for tab completion allow snippets like the following to work without +having to execute any code: + + >>> myvar = ['hello', 42] + ... myvar[1].bi + +Tab completion will be able to infer that ``myvar[1]`` is a real number without +executing any code unlike the previously available ``IPCompleter.greedy`` +option. + +Be sure to update :any:`jedi` to the latest stable version or to try the +current development version to get better completions. +""" + + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. +# +# Some of this code originated from rlcompleter in the Python standard library +# Copyright (C) 2001 Python Software Foundation, www.python.org + + +import __main__ +import builtins as builtin_mod +import glob +import time +import inspect +import itertools +import keyword +import os +import re +import sys +import unicodedata +import string +import warnings + +from contextlib import contextmanager +from importlib import import_module +from typing import Iterator, List, Tuple, Iterable +from types import SimpleNamespace + +from traitlets.config.configurable import Configurable +from IPython.core.error import TryNext +from IPython.core.inputtransformer2 import ESC_MAGIC +from IPython.core.latex_symbols import latex_symbols, reverse_latex_symbol +from IPython.core.oinspect import InspectColors +from IPython.utils import generics +from IPython.utils.dir2 import dir2, get_real_method +from IPython.utils.process import arg_split +from traitlets import Bool, Enum, observe, Int + +# skip module docstests +skip_doctest = True + +try: + import jedi + jedi.settings.case_insensitive_completion = False + import jedi.api.helpers + import jedi.api.classes + JEDI_INSTALLED = True +except ImportError: + JEDI_INSTALLED = False +#----------------------------------------------------------------------------- +# Globals +#----------------------------------------------------------------------------- + +# Public API +__all__ = ['Completer','IPCompleter'] + +if sys.platform == 'win32': + PROTECTABLES = ' ' +else: + PROTECTABLES = ' ()[]{}?=\\|;:\'#*"^&' + +# Protect against returning an enormous number of completions which the frontend +# may have trouble processing. +MATCHES_LIMIT = 500 + +_deprecation_readline_sentinel = object() + + +class ProvisionalCompleterWarning(FutureWarning): + """ + Exception raise by an experimental feature in this module. + + Wrap code in :any:`provisionalcompleter` context manager if you + are certain you want to use an unstable feature. + """ + pass + +warnings.filterwarnings('error', category=ProvisionalCompleterWarning) + +@contextmanager +def provisionalcompleter(action='ignore'): + """ + + + This context manager has to be used in any place where unstable completer + behavior and API may be called. + + >>> with provisionalcompleter(): + ... completer.do_experimental_things() # works + + >>> completer.do_experimental_things() # raises. + + .. note:: Unstable + + By using this context manager you agree that the API in use may change + without warning, and that you won't complain if they do so. + + You also understand that, if the API is not to your liking, you should report + a bug to explain your use case upstream. + + We'll be happy to get your feedback, feature requests, and improvements on + any of the unstable APIs! + """ + with warnings.catch_warnings(): + warnings.filterwarnings(action, category=ProvisionalCompleterWarning) + yield + + +def has_open_quotes(s): + """Return whether a string has open quotes. + + This simply counts whether the number of quote characters of either type in + the string is odd. + + Returns + ------- + If there is an open quote, the quote character is returned. Else, return + False. + """ + # We check " first, then ', so complex cases with nested quotes will get + # the " to take precedence. + if s.count('"') % 2: + return '"' + elif s.count("'") % 2: + return "'" + else: + return False + + +def protect_filename(s, protectables=PROTECTABLES): + """Escape a string to protect certain characters.""" + if set(s) & set(protectables): + if sys.platform == "win32": + return '"' + s + '"' + else: + return "".join(("\\" + c if c in protectables else c) for c in s) + else: + return s + + +def expand_user(path:str) -> Tuple[str, bool, str]: + """Expand ``~``-style usernames in strings. + + This is similar to :func:`os.path.expanduser`, but it computes and returns + extra information that will be useful if the input was being used in + computing completions, and you wish to return the completions with the + original '~' instead of its expanded value. + + Parameters + ---------- + path : str + String to be expanded. If no ~ is present, the output is the same as the + input. + + Returns + ------- + newpath : str + Result of ~ expansion in the input path. + tilde_expand : bool + Whether any expansion was performed or not. + tilde_val : str + The value that ~ was replaced with. + """ + # Default values + tilde_expand = False + tilde_val = '' + newpath = path + + if path.startswith('~'): + tilde_expand = True + rest = len(path)-1 + newpath = os.path.expanduser(path) + if rest: + tilde_val = newpath[:-rest] + else: + tilde_val = newpath + + return newpath, tilde_expand, tilde_val + + +def compress_user(path:str, tilde_expand:bool, tilde_val:str) -> str: + """Does the opposite of expand_user, with its outputs. + """ + if tilde_expand: + return path.replace(tilde_val, '~') + else: + return path + + +def completions_sorting_key(word): + """key for sorting completions + + This does several things: + + - Demote any completions starting with underscores to the end + - Insert any %magic and %%cellmagic completions in the alphabetical order + by their name + """ + prio1, prio2 = 0, 0 + + if word.startswith('__'): + prio1 = 2 + elif word.startswith('_'): + prio1 = 1 + + if word.endswith('='): + prio1 = -1 + + if word.startswith('%%'): + # If there's another % in there, this is something else, so leave it alone + if not "%" in word[2:]: + word = word[2:] + prio2 = 2 + elif word.startswith('%'): + if not "%" in word[1:]: + word = word[1:] + prio2 = 1 + + return prio1, word, prio2 + + +class _FakeJediCompletion: + """ + This is a workaround to communicate to the UI that Jedi has crashed and to + report a bug. Will be used only id :any:`IPCompleter.debug` is set to true. + + Added in IPython 6.0 so should likely be removed for 7.0 + + """ + + def __init__(self, name): + + self.name = name + self.complete = name + self.type = 'crashed' + self.name_with_symbols = name + self.signature = '' + self._origin = 'fake' + + def __repr__(self): + return '' + + +class Completion: + """ + Completion object used and return by IPython completers. + + .. warning:: Unstable + + This function is unstable, API may change without warning. + It will also raise unless use in proper context manager. + + This act as a middle ground :any:`Completion` object between the + :any:`jedi.api.classes.Completion` object and the Prompt Toolkit completion + object. While Jedi need a lot of information about evaluator and how the + code should be ran/inspected, PromptToolkit (and other frontend) mostly + need user facing information. + + - Which range should be replaced replaced by what. + - Some metadata (like completion type), or meta information to displayed to + the use user. + + For debugging purpose we can also store the origin of the completion (``jedi``, + ``IPython.python_matches``, ``IPython.magics_matches``...). + """ + + __slots__ = ['start', 'end', 'text', 'type', 'signature', '_origin'] + + def __init__(self, start: int, end: int, text: str, *, type: str=None, _origin='', signature='') -> None: + warnings.warn("``Completion`` is a provisional API (as of IPython 6.0). " + "It may change without warnings. " + "Use in corresponding context manager.", + category=ProvisionalCompleterWarning, stacklevel=2) + + self.start = start + self.end = end + self.text = text + self.type = type + self.signature = signature + self._origin = _origin + + def __repr__(self): + return '' % \ + (self.start, self.end, self.text, self.type or '?', self.signature or '?') + + def __eq__(self, other)->Bool: + """ + Equality and hash do not hash the type (as some completer may not be + able to infer the type), but are use to (partially) de-duplicate + completion. + + Completely de-duplicating completion is a bit tricker that just + comparing as it depends on surrounding text, which Completions are not + aware of. + """ + return self.start == other.start and \ + self.end == other.end and \ + self.text == other.text + + def __hash__(self): + return hash((self.start, self.end, self.text)) + + +_IC = Iterable[Completion] + + +def _deduplicate_completions(text: str, completions: _IC)-> _IC: + """ + Deduplicate a set of completions. + + .. warning:: Unstable + + This function is unstable, API may change without warning. + + Parameters + ---------- + text: str + text that should be completed. + completions: Iterator[Completion] + iterator over the completions to deduplicate + + Yields + ------ + `Completions` objects + + + Completions coming from multiple sources, may be different but end up having + the same effect when applied to ``text``. If this is the case, this will + consider completions as equal and only emit the first encountered. + + Not folded in `completions()` yet for debugging purpose, and to detect when + the IPython completer does return things that Jedi does not, but should be + at some point. + """ + completions = list(completions) + if not completions: + return + + new_start = min(c.start for c in completions) + new_end = max(c.end for c in completions) + + seen = set() + for c in completions: + new_text = text[new_start:c.start] + c.text + text[c.end:new_end] + if new_text not in seen: + yield c + seen.add(new_text) + + +def rectify_completions(text: str, completions: _IC, *, _debug=False)->_IC: + """ + Rectify a set of completions to all have the same ``start`` and ``end`` + + .. warning:: Unstable + + This function is unstable, API may change without warning. + It will also raise unless use in proper context manager. + + Parameters + ---------- + text: str + text that should be completed. + completions: Iterator[Completion] + iterator over the completions to rectify + + + :any:`jedi.api.classes.Completion` s returned by Jedi may not have the same start and end, though + the Jupyter Protocol requires them to behave like so. This will readjust + the completion to have the same ``start`` and ``end`` by padding both + extremities with surrounding text. + + During stabilisation should support a ``_debug`` option to log which + completion are return by the IPython completer and not found in Jedi in + order to make upstream bug report. + """ + warnings.warn("`rectify_completions` is a provisional API (as of IPython 6.0). " + "It may change without warnings. " + "Use in corresponding context manager.", + category=ProvisionalCompleterWarning, stacklevel=2) + + completions = list(completions) + if not completions: + return + starts = (c.start for c in completions) + ends = (c.end for c in completions) + + new_start = min(starts) + new_end = max(ends) + + seen_jedi = set() + seen_python_matches = set() + for c in completions: + new_text = text[new_start:c.start] + c.text + text[c.end:new_end] + if c._origin == 'jedi': + seen_jedi.add(new_text) + elif c._origin == 'IPCompleter.python_matches': + seen_python_matches.add(new_text) + yield Completion(new_start, new_end, new_text, type=c.type, _origin=c._origin, signature=c.signature) + diff = seen_python_matches.difference(seen_jedi) + if diff and _debug: + print('IPython.python matches have extras:', diff) + + +if sys.platform == 'win32': + DELIMS = ' \t\n`!@#$^&*()=+[{]}|;\'",<>?' +else: + DELIMS = ' \t\n`!@#$^&*()=+[{]}\\|;:\'",<>?' + +GREEDY_DELIMS = ' =\r\n' + + +class CompletionSplitter(object): + """An object to split an input line in a manner similar to readline. + + By having our own implementation, we can expose readline-like completion in + a uniform manner to all frontends. This object only needs to be given the + line of text to be split and the cursor position on said line, and it + returns the 'word' to be completed on at the cursor after splitting the + entire line. + + What characters are used as splitting delimiters can be controlled by + setting the ``delims`` attribute (this is a property that internally + automatically builds the necessary regular expression)""" + + # Private interface + + # A string of delimiter characters. The default value makes sense for + # IPython's most typical usage patterns. + _delims = DELIMS + + # The expression (a normal string) to be compiled into a regular expression + # for actual splitting. We store it as an attribute mostly for ease of + # debugging, since this type of code can be so tricky to debug. + _delim_expr = None + + # The regular expression that does the actual splitting + _delim_re = None + + def __init__(self, delims=None): + delims = CompletionSplitter._delims if delims is None else delims + self.delims = delims + + @property + def delims(self): + """Return the string of delimiter characters.""" + return self._delims + + @delims.setter + def delims(self, delims): + """Set the delimiters for line splitting.""" + expr = '[' + ''.join('\\'+ c for c in delims) + ']' + self._delim_re = re.compile(expr) + self._delims = delims + self._delim_expr = expr + + def split_line(self, line, cursor_pos=None): + """Split a line of text with a cursor at the given position. + """ + l = line if cursor_pos is None else line[:cursor_pos] + return self._delim_re.split(l)[-1] + + + +class Completer(Configurable): + + greedy = Bool(False, + help="""Activate greedy completion + PENDING DEPRECTION. this is now mostly taken care of with Jedi. + + This will enable completion on elements of lists, results of function calls, etc., + but can be unsafe because the code is actually evaluated on TAB. + """ + ).tag(config=True) + + use_jedi = Bool(default_value=JEDI_INSTALLED, + help="Experimental: Use Jedi to generate autocompletions. " + "Default to True if jedi is installed.").tag(config=True) + + jedi_compute_type_timeout = Int(default_value=400, + help="""Experimental: restrict time (in milliseconds) during which Jedi can compute types. + Set to 0 to stop computing types. Non-zero value lower than 100ms may hurt + performance by preventing jedi to build its cache. + """).tag(config=True) + + debug = Bool(default_value=False, + help='Enable debug for the Completer. Mostly print extra ' + 'information for experimental jedi integration.')\ + .tag(config=True) + + backslash_combining_completions = Bool(True, + help="Enable unicode completions, e.g. \\alpha . " + "Includes completion of latex commands, unicode names, and expanding " + "unicode characters back to latex commands.").tag(config=True) + + + + def __init__(self, namespace=None, global_namespace=None, **kwargs): + """Create a new completer for the command line. + + Completer(namespace=ns, global_namespace=ns2) -> completer instance. + + If unspecified, the default namespace where completions are performed + is __main__ (technically, __main__.__dict__). Namespaces should be + given as dictionaries. + + An optional second namespace can be given. This allows the completer + to handle cases where both the local and global scopes need to be + distinguished. + """ + + # Don't bind to namespace quite yet, but flag whether the user wants a + # specific namespace or to use __main__.__dict__. This will allow us + # to bind to __main__.__dict__ at completion time, not now. + if namespace is None: + self.use_main_ns = True + else: + self.use_main_ns = False + self.namespace = namespace + + # The global namespace, if given, can be bound directly + if global_namespace is None: + self.global_namespace = {} + else: + self.global_namespace = global_namespace + + self.custom_matchers = [] + + super(Completer, self).__init__(**kwargs) + + def complete(self, text, state): + """Return the next possible completion for 'text'. + + This is called successively with state == 0, 1, 2, ... until it + returns None. The completion should begin with 'text'. + + """ + if self.use_main_ns: + self.namespace = __main__.__dict__ + + if state == 0: + if "." in text: + self.matches = self.attr_matches(text) + else: + self.matches = self.global_matches(text) + try: + return self.matches[state] + except IndexError: + return None + + def global_matches(self, text): + """Compute matches when text is a simple name. + + Return a list of all keywords, built-in functions and names currently + defined in self.namespace or self.global_namespace that match. + + """ + matches = [] + match_append = matches.append + n = len(text) + for lst in [keyword.kwlist, + builtin_mod.__dict__.keys(), + self.namespace.keys(), + self.global_namespace.keys()]: + for word in lst: + if word[:n] == text and word != "__builtins__": + match_append(word) + + snake_case_re = re.compile(r"[^_]+(_[^_]+)+?\Z") + for lst in [self.namespace.keys(), + self.global_namespace.keys()]: + shortened = {"_".join([sub[0] for sub in word.split('_')]) : word + for word in lst if snake_case_re.match(word)} + for word in shortened.keys(): + if word[:n] == text and word != "__builtins__": + match_append(shortened[word]) + return matches + + def attr_matches(self, text): + """Compute matches when text contains a dot. + + Assuming the text is of the form NAME.NAME....[NAME], and is + evaluatable in self.namespace or self.global_namespace, it will be + evaluated and its attributes (as revealed by dir()) are used as + possible completions. (For class instances, class members are + also considered.) + + WARNING: this can still invoke arbitrary C code, if an object + with a __getattr__ hook is evaluated. + + """ + + # Another option, seems to work great. Catches things like ''. + m = re.match(r"(\S+(\.\w+)*)\.(\w*)$", text) + + if m: + expr, attr = m.group(1, 3) + elif self.greedy: + m2 = re.match(r"(.+)\.(\w*)$", self.line_buffer) + if not m2: + return [] + expr, attr = m2.group(1,2) + else: + return [] + + try: + obj = eval(expr, self.namespace) + except: + try: + obj = eval(expr, self.global_namespace) + except: + return [] + + if self.limit_to__all__ and hasattr(obj, '__all__'): + words = get__all__entries(obj) + else: + words = dir2(obj) + + try: + words = generics.complete_object(obj, words) + except TryNext: + pass + except AssertionError: + raise + except Exception: + # Silence errors from completion function + #raise # dbg + pass + # Build match list to return + n = len(attr) + return [u"%s.%s" % (expr, w) for w in words if w[:n] == attr ] + + +def get__all__entries(obj): + """returns the strings in the __all__ attribute""" + try: + words = getattr(obj, '__all__') + except: + return [] + + return [w for w in words if isinstance(w, str)] + + +def match_dict_keys(keys: List[str], prefix: str, delims: str): + """Used by dict_key_matches, matching the prefix to a list of keys + + Parameters + ========== + keys: + list of keys in dictionary currently being completed. + prefix: + Part of the text already typed by the user. e.g. `mydict[b'fo` + delims: + String of delimiters to consider when finding the current key. + + Returns + ======= + + A tuple of three elements: ``quote``, ``token_start``, ``matched``, with + ``quote`` being the quote that need to be used to close current string. + ``token_start`` the position where the replacement should start occurring, + ``matches`` a list of replacement/completion + + """ + if not prefix: + return None, 0, [repr(k) for k in keys + if isinstance(k, (str, bytes))] + quote_match = re.search('["\']', prefix) + quote = quote_match.group() + try: + prefix_str = eval(prefix + quote, {}) + except Exception: + return None, 0, [] + + pattern = '[^' + ''.join('\\' + c for c in delims) + ']*$' + token_match = re.search(pattern, prefix, re.UNICODE) + token_start = token_match.start() + token_prefix = token_match.group() + + matched = [] + for key in keys: + try: + if not key.startswith(prefix_str): + continue + except (AttributeError, TypeError, UnicodeError): + # Python 3+ TypeError on b'a'.startswith('a') or vice-versa + continue + + # reformat remainder of key to begin with prefix + rem = key[len(prefix_str):] + # force repr wrapped in ' + rem_repr = repr(rem + '"') if isinstance(rem, str) else repr(rem + b'"') + if rem_repr.startswith('u') and prefix[0] not in 'uU': + # Found key is unicode, but prefix is Py2 string. + # Therefore attempt to interpret key as string. + try: + rem_repr = repr(rem.encode('ascii') + '"') + except UnicodeEncodeError: + continue + + rem_repr = rem_repr[1 + rem_repr.index("'"):-2] + if quote == '"': + # The entered prefix is quoted with ", + # but the match is quoted with '. + # A contained " hence needs escaping for comparison: + rem_repr = rem_repr.replace('"', '\\"') + + # then reinsert prefix from start of token + matched.append('%s%s' % (token_prefix, rem_repr)) + return quote, token_start, matched + + +def cursor_to_position(text:str, line:int, column:int)->int: + """ + + Convert the (line,column) position of the cursor in text to an offset in a + string. + + Parameters + ---------- + + text : str + The text in which to calculate the cursor offset + line : int + Line of the cursor; 0-indexed + column : int + Column of the cursor 0-indexed + + Return + ------ + Position of the cursor in ``text``, 0-indexed. + + See Also + -------- + position_to_cursor: reciprocal of this function + + """ + lines = text.split('\n') + assert line <= len(lines), '{} <= {}'.format(str(line), str(len(lines))) + + return sum(len(l) + 1 for l in lines[:line]) + column + +def position_to_cursor(text:str, offset:int)->Tuple[int, int]: + """ + Convert the position of the cursor in text (0 indexed) to a line + number(0-indexed) and a column number (0-indexed) pair + + Position should be a valid position in ``text``. + + Parameters + ---------- + + text : str + The text in which to calculate the cursor offset + offset : int + Position of the cursor in ``text``, 0-indexed. + + Return + ------ + (line, column) : (int, int) + Line of the cursor; 0-indexed, column of the cursor 0-indexed + + + See Also + -------- + cursor_to_position : reciprocal of this function + + + """ + + assert 0 <= offset <= len(text) , "0 <= %s <= %s" % (offset , len(text)) + + before = text[:offset] + blines = before.split('\n') # ! splitnes trim trailing \n + line = before.count('\n') + col = len(blines[-1]) + return line, col + + +def _safe_isinstance(obj, module, class_name): + """Checks if obj is an instance of module.class_name if loaded + """ + return (module in sys.modules and + isinstance(obj, getattr(import_module(module), class_name))) + + +def back_unicode_name_matches(text): + u"""Match unicode characters back to unicode name + + This does ``☃`` -> ``\\snowman`` + + Note that snowman is not a valid python3 combining character but will be expanded. + Though it will not recombine back to the snowman character by the completion machinery. + + This will not either back-complete standard sequences like \\n, \\b ... + + Used on Python 3 only. + """ + if len(text)<2: + return u'', () + maybe_slash = text[-2] + if maybe_slash != '\\': + return u'', () + + char = text[-1] + # no expand on quote for completion in strings. + # nor backcomplete standard ascii keys + if char in string.ascii_letters or char in ['"',"'"]: + return u'', () + try : + unic = unicodedata.name(char) + return '\\'+char,['\\'+unic] + except KeyError: + pass + return u'', () + +def back_latex_name_matches(text:str): + """Match latex characters back to unicode name + + This does ``\\ℵ`` -> ``\\aleph`` + + Used on Python 3 only. + """ + if len(text)<2: + return u'', () + maybe_slash = text[-2] + if maybe_slash != '\\': + return u'', () + + + char = text[-1] + # no expand on quote for completion in strings. + # nor backcomplete standard ascii keys + if char in string.ascii_letters or char in ['"',"'"]: + return u'', () + try : + latex = reverse_latex_symbol[char] + # '\\' replace the \ as well + return '\\'+char,[latex] + except KeyError: + pass + return u'', () + + +def _formatparamchildren(parameter) -> str: + """ + Get parameter name and value from Jedi Private API + + Jedi does not expose a simple way to get `param=value` from its API. + + Parameter + ========= + + parameter: + Jedi's function `Param` + + Returns + ======= + + A string like 'a', 'b=1', '*args', '**kwargs' + + + """ + description = parameter.description + if not description.startswith('param '): + raise ValueError('Jedi function parameter description have change format.' + 'Expected "param ...", found %r".' % description) + return description[6:] + +def _make_signature(completion)-> str: + """ + Make the signature from a jedi completion + + Parameter + ========= + + completion: jedi.Completion + object does not complete a function type + + Returns + ======= + + a string consisting of the function signature, with the parenthesis but + without the function name. example: + `(a, *args, b=1, **kwargs)` + + """ + + return '(%s)'% ', '.join([f for f in (_formatparamchildren(p) for p in completion.params) if f]) + +class IPCompleter(Completer): + """Extension of the completer class with IPython-specific features""" + + _names = None + + @observe('greedy') + def _greedy_changed(self, change): + """update the splitter and readline delims when greedy is changed""" + if change['new']: + self.splitter.delims = GREEDY_DELIMS + else: + self.splitter.delims = DELIMS + + dict_keys_only = Bool(False, + help="""Whether to show dict key matches only""") + + merge_completions = Bool(True, + help="""Whether to merge completion results into a single list + + If False, only the completion results from the first non-empty + completer will be returned. + """ + ).tag(config=True) + omit__names = Enum((0,1,2), default_value=2, + help="""Instruct the completer to omit private method names + + Specifically, when completing on ``object.``. + + When 2 [default]: all names that start with '_' will be excluded. + + When 1: all 'magic' names (``__foo__``) will be excluded. + + When 0: nothing will be excluded. + """ + ).tag(config=True) + limit_to__all__ = Bool(False, + help=""" + DEPRECATED as of version 5.0. + + Instruct the completer to use __all__ for the completion + + Specifically, when completing on ``object.``. + + When True: only those names in obj.__all__ will be included. + + When False [default]: the __all__ attribute is ignored + """, + ).tag(config=True) + + @observe('limit_to__all__') + def _limit_to_all_changed(self, change): + warnings.warn('`IPython.core.IPCompleter.limit_to__all__` configuration ' + 'value has been deprecated since IPython 5.0, will be made to have ' + 'no effects and then removed in future version of IPython.', + UserWarning) + + def __init__(self, shell=None, namespace=None, global_namespace=None, + use_readline=_deprecation_readline_sentinel, config=None, **kwargs): + """IPCompleter() -> completer + + Return a completer object. + + Parameters + ---------- + + shell + a pointer to the ipython shell itself. This is needed + because this completer knows about magic functions, and those can + only be accessed via the ipython instance. + + namespace : dict, optional + an optional dict where completions are performed. + + global_namespace : dict, optional + secondary optional dict for completions, to + handle cases (such as IPython embedded inside functions) where + both Python scopes are visible. + + use_readline : bool, optional + DEPRECATED, ignored since IPython 6.0, will have no effects + """ + + self.magic_escape = ESC_MAGIC + self.splitter = CompletionSplitter() + + if use_readline is not _deprecation_readline_sentinel: + warnings.warn('The `use_readline` parameter is deprecated and ignored since IPython 6.0.', + DeprecationWarning, stacklevel=2) + + # _greedy_changed() depends on splitter and readline being defined: + Completer.__init__(self, namespace=namespace, global_namespace=global_namespace, + config=config, **kwargs) + + # List where completion matches will be stored + self.matches = [] + self.shell = shell + # Regexp to split filenames with spaces in them + self.space_name_re = re.compile(r'([^\\] )') + # Hold a local ref. to glob.glob for speed + self.glob = glob.glob + + # Determine if we are running on 'dumb' terminals, like (X)Emacs + # buffers, to avoid completion problems. + term = os.environ.get('TERM','xterm') + self.dumb_terminal = term in ['dumb','emacs'] + + # Special handling of backslashes needed in win32 platforms + if sys.platform == "win32": + self.clean_glob = self._clean_glob_win32 + else: + self.clean_glob = self._clean_glob + + #regexp to parse docstring for function signature + self.docstring_sig_re = re.compile(r'^[\w|\s.]+\(([^)]*)\).*') + self.docstring_kwd_re = re.compile(r'[\s|\[]*(\w+)(?:\s*=\s*.*)') + #use this if positional argument name is also needed + #= re.compile(r'[\s|\[]*(\w+)(?:\s*=?\s*.*)') + + self.magic_arg_matchers = [ + self.magic_config_matches, + self.magic_color_matches, + ] + + # This is set externally by InteractiveShell + self.custom_completers = None + + @property + def matchers(self): + """All active matcher routines for completion""" + if self.dict_keys_only: + return [self.dict_key_matches] + + if self.use_jedi: + return [ + *self.custom_matchers, + self.file_matches, + self.magic_matches, + self.dict_key_matches, + ] + else: + return [ + *self.custom_matchers, + self.python_matches, + self.file_matches, + self.magic_matches, + self.python_func_kw_matches, + self.dict_key_matches, + ] + + def all_completions(self, text) -> List[str]: + """ + Wrapper around the completion methods for the benefit of emacs. + """ + prefix = text.rpartition('.')[0] + with provisionalcompleter(): + return ['.'.join([prefix, c.text]) if prefix and self.use_jedi else c.text + for c in self.completions(text, len(text))] + + return self.complete(text)[1] + + def _clean_glob(self, text): + return self.glob("%s*" % text) + + def _clean_glob_win32(self,text): + return [f.replace("\\","/") + for f in self.glob("%s*" % text)] + + def file_matches(self, text): + """Match filenames, expanding ~USER type strings. + + Most of the seemingly convoluted logic in this completer is an + attempt to handle filenames with spaces in them. And yet it's not + quite perfect, because Python's readline doesn't expose all of the + GNU readline details needed for this to be done correctly. + + For a filename with a space in it, the printed completions will be + only the parts after what's already been typed (instead of the + full completions, as is normally done). I don't think with the + current (as of Python 2.3) Python readline it's possible to do + better.""" + + # chars that require escaping with backslash - i.e. chars + # that readline treats incorrectly as delimiters, but we + # don't want to treat as delimiters in filename matching + # when escaped with backslash + if text.startswith('!'): + text = text[1:] + text_prefix = u'!' + else: + text_prefix = u'' + + text_until_cursor = self.text_until_cursor + # track strings with open quotes + open_quotes = has_open_quotes(text_until_cursor) + + if '(' in text_until_cursor or '[' in text_until_cursor: + lsplit = text + else: + try: + # arg_split ~ shlex.split, but with unicode bugs fixed by us + lsplit = arg_split(text_until_cursor)[-1] + except ValueError: + # typically an unmatched ", or backslash without escaped char. + if open_quotes: + lsplit = text_until_cursor.split(open_quotes)[-1] + else: + return [] + except IndexError: + # tab pressed on empty line + lsplit = "" + + if not open_quotes and lsplit != protect_filename(lsplit): + # if protectables are found, do matching on the whole escaped name + has_protectables = True + text0,text = text,lsplit + else: + has_protectables = False + text = os.path.expanduser(text) + + if text == "": + return [text_prefix + protect_filename(f) for f in self.glob("*")] + + # Compute the matches from the filesystem + if sys.platform == 'win32': + m0 = self.clean_glob(text) + else: + m0 = self.clean_glob(text.replace('\\', '')) + + if has_protectables: + # If we had protectables, we need to revert our changes to the + # beginning of filename so that we don't double-write the part + # of the filename we have so far + len_lsplit = len(lsplit) + matches = [text_prefix + text0 + + protect_filename(f[len_lsplit:]) for f in m0] + else: + if open_quotes: + # if we have a string with an open quote, we don't need to + # protect the names beyond the quote (and we _shouldn't_, as + # it would cause bugs when the filesystem call is made). + matches = m0 if sys.platform == "win32" else\ + [protect_filename(f, open_quotes) for f in m0] + else: + matches = [text_prefix + + protect_filename(f) for f in m0] + + # Mark directories in input list by appending '/' to their names. + return [x+'/' if os.path.isdir(x) else x for x in matches] + + def magic_matches(self, text): + """Match magics""" + # Get all shell magics now rather than statically, so magics loaded at + # runtime show up too. + lsm = self.shell.magics_manager.lsmagic() + line_magics = lsm['line'] + cell_magics = lsm['cell'] + pre = self.magic_escape + pre2 = pre+pre + + explicit_magic = text.startswith(pre) + + # Completion logic: + # - user gives %%: only do cell magics + # - user gives %: do both line and cell magics + # - no prefix: do both + # In other words, line magics are skipped if the user gives %% explicitly + # + # We also exclude magics that match any currently visible names: + # https://github.com/ipython/ipython/issues/4877, unless the user has + # typed a %: + # https://github.com/ipython/ipython/issues/10754 + bare_text = text.lstrip(pre) + global_matches = self.global_matches(bare_text) + if not explicit_magic: + def matches(magic): + """ + Filter magics, in particular remove magics that match + a name present in global namespace. + """ + return ( magic.startswith(bare_text) and + magic not in global_matches ) + else: + def matches(magic): + return magic.startswith(bare_text) + + comp = [ pre2+m for m in cell_magics if matches(m)] + if not text.startswith(pre2): + comp += [ pre+m for m in line_magics if matches(m)] + + return comp + + def magic_config_matches(self, text:str) -> List[str]: + """ Match class names and attributes for %config magic """ + texts = text.strip().split() + + if len(texts) > 0 and (texts[0] == 'config' or texts[0] == '%config'): + # get all configuration classes + classes = sorted(set([ c for c in self.shell.configurables + if c.__class__.class_traits(config=True) + ]), key=lambda x: x.__class__.__name__) + classnames = [ c.__class__.__name__ for c in classes ] + + # return all classnames if config or %config is given + if len(texts) == 1: + return classnames + + # match classname + classname_texts = texts[1].split('.') + classname = classname_texts[0] + classname_matches = [ c for c in classnames + if c.startswith(classname) ] + + # return matched classes or the matched class with attributes + if texts[1].find('.') < 0: + return classname_matches + elif len(classname_matches) == 1 and \ + classname_matches[0] == classname: + cls = classes[classnames.index(classname)].__class__ + help = cls.class_get_help() + # strip leading '--' from cl-args: + help = re.sub(re.compile(r'^--', re.MULTILINE), '', help) + return [ attr.split('=')[0] + for attr in help.strip().splitlines() + if attr.startswith(texts[1]) ] + return [] + + def magic_color_matches(self, text:str) -> List[str] : + """ Match color schemes for %colors magic""" + texts = text.split() + if text.endswith(' '): + # .split() strips off the trailing whitespace. Add '' back + # so that: '%colors ' -> ['%colors', ''] + texts.append('') + + if len(texts) == 2 and (texts[0] == 'colors' or texts[0] == '%colors'): + prefix = texts[1] + return [ color for color in InspectColors.keys() + if color.startswith(prefix) ] + return [] + + def _jedi_matches(self, cursor_column:int, cursor_line:int, text:str): + """ + + Return a list of :any:`jedi.api.Completions` object from a ``text`` and + cursor position. + + Parameters + ---------- + cursor_column : int + column position of the cursor in ``text``, 0-indexed. + cursor_line : int + line position of the cursor in ``text``, 0-indexed + text : str + text to complete + + Debugging + --------- + + If ``IPCompleter.debug`` is ``True`` may return a :any:`_FakeJediCompletion` + object containing a string with the Jedi debug information attached. + """ + namespaces = [self.namespace] + if self.global_namespace is not None: + namespaces.append(self.global_namespace) + + completion_filter = lambda x:x + offset = cursor_to_position(text, cursor_line, cursor_column) + # filter output if we are completing for object members + if offset: + pre = text[offset-1] + if pre == '.': + if self.omit__names == 2: + completion_filter = lambda c:not c.name.startswith('_') + elif self.omit__names == 1: + completion_filter = lambda c:not (c.name.startswith('__') and c.name.endswith('__')) + elif self.omit__names == 0: + completion_filter = lambda x:x + else: + raise ValueError("Don't understand self.omit__names == {}".format(self.omit__names)) + + interpreter = jedi.Interpreter( + text[:offset], namespaces, column=cursor_column, line=cursor_line + 1) + try_jedi = True + + try: + # find the first token in the current tree -- if it is a ' or " then we are in a string + completing_string = False + try: + first_child = next(c for c in interpreter._get_module().tree_node.children if hasattr(c, 'value')) + except StopIteration: + pass + else: + # note the value may be ', ", or it may also be ''' or """, or + # in some cases, """what/you/typed..., but all of these are + # strings. + completing_string = len(first_child.value) > 0 and first_child.value[0] in {"'", '"'} + + # if we are in a string jedi is likely not the right candidate for + # now. Skip it. + try_jedi = not completing_string + except Exception as e: + # many of things can go wrong, we are using private API just don't crash. + if self.debug: + print("Error detecting if completing a non-finished string :", e, '|') + + if not try_jedi: + return [] + try: + return filter(completion_filter, interpreter.completions()) + except Exception as e: + if self.debug: + return [_FakeJediCompletion('Oops Jedi has crashed, please report a bug with the following:\n"""\n%s\ns"""' % (e))] + else: + return [] + + def python_matches(self, text): + """Match attributes or global python names""" + if "." in text: + try: + matches = self.attr_matches(text) + if text.endswith('.') and self.omit__names: + if self.omit__names == 1: + # true if txt is _not_ a __ name, false otherwise: + no__name = (lambda txt: + re.match(r'.*\.__.*?__',txt) is None) + else: + # true if txt is _not_ a _ name, false otherwise: + no__name = (lambda txt: + re.match(r'\._.*?',txt[txt.rindex('.'):]) is None) + matches = filter(no__name, matches) + except NameError: + # catches . + matches = [] + else: + matches = self.global_matches(text) + return matches + + def _default_arguments_from_docstring(self, doc): + """Parse the first line of docstring for call signature. + + Docstring should be of the form 'min(iterable[, key=func])\n'. + It can also parse cython docstring of the form + 'Minuit.migrad(self, int ncall=10000, resume=True, int nsplit=1)'. + """ + if doc is None: + return [] + + #care only the firstline + line = doc.lstrip().splitlines()[0] + + #p = re.compile(r'^[\w|\s.]+\(([^)]*)\).*') + #'min(iterable[, key=func])\n' -> 'iterable[, key=func]' + sig = self.docstring_sig_re.search(line) + if sig is None: + return [] + # iterable[, key=func]' -> ['iterable[' ,' key=func]'] + sig = sig.groups()[0].split(',') + ret = [] + for s in sig: + #re.compile(r'[\s|\[]*(\w+)(?:\s*=\s*.*)') + ret += self.docstring_kwd_re.findall(s) + return ret + + def _default_arguments(self, obj): + """Return the list of default arguments of obj if it is callable, + or empty list otherwise.""" + call_obj = obj + ret = [] + if inspect.isbuiltin(obj): + pass + elif not (inspect.isfunction(obj) or inspect.ismethod(obj)): + if inspect.isclass(obj): + #for cython embedsignature=True the constructor docstring + #belongs to the object itself not __init__ + ret += self._default_arguments_from_docstring( + getattr(obj, '__doc__', '')) + # for classes, check for __init__,__new__ + call_obj = (getattr(obj, '__init__', None) or + getattr(obj, '__new__', None)) + # for all others, check if they are __call__able + elif hasattr(obj, '__call__'): + call_obj = obj.__call__ + ret += self._default_arguments_from_docstring( + getattr(call_obj, '__doc__', '')) + + _keeps = (inspect.Parameter.KEYWORD_ONLY, + inspect.Parameter.POSITIONAL_OR_KEYWORD) + + try: + sig = inspect.signature(call_obj) + ret.extend(k for k, v in sig.parameters.items() if + v.kind in _keeps) + except ValueError: + pass + + return list(set(ret)) + + def python_func_kw_matches(self,text): + """Match named parameters (kwargs) of the last open function""" + + if "." in text: # a parameter cannot be dotted + return [] + try: regexp = self.__funcParamsRegex + except AttributeError: + regexp = self.__funcParamsRegex = re.compile(r''' + '.*?(?,a=1)", the candidate is "foo" + tokens = regexp.findall(self.text_until_cursor) + iterTokens = reversed(tokens); openPar = 0 + + for token in iterTokens: + if token == ')': + openPar -= 1 + elif token == '(': + openPar += 1 + if openPar > 0: + # found the last unclosed parenthesis + break + else: + return [] + # 2. Concatenate dotted names ("foo.bar" for "foo.bar(x, pa" ) + ids = [] + isId = re.compile(r'\w+$').match + + while True: + try: + ids.append(next(iterTokens)) + if not isId(ids[-1]): + ids.pop(); break + if not next(iterTokens) == '.': + break + except StopIteration: + break + + # Find all named arguments already assigned to, as to avoid suggesting + # them again + usedNamedArgs = set() + par_level = -1 + for token, next_token in zip(tokens, tokens[1:]): + if token == '(': + par_level += 1 + elif token == ')': + par_level -= 1 + + if par_level != 0: + continue + + if next_token != '=': + continue + + usedNamedArgs.add(token) + + argMatches = [] + try: + callableObj = '.'.join(ids[::-1]) + namedArgs = self._default_arguments(eval(callableObj, + self.namespace)) + + # Remove used named arguments from the list, no need to show twice + for namedArg in set(namedArgs) - usedNamedArgs: + if namedArg.startswith(text): + argMatches.append(u"%s=" %namedArg) + except: + pass + + return argMatches + + def dict_key_matches(self, text): + "Match string keys in a dictionary, after e.g. 'foo[' " + def get_keys(obj): + # Objects can define their own completions by defining an + # _ipy_key_completions_() method. + method = get_real_method(obj, '_ipython_key_completions_') + if method is not None: + return method() + + # Special case some common in-memory dict-like types + if isinstance(obj, dict) or\ + _safe_isinstance(obj, 'pandas', 'DataFrame'): + try: + return list(obj.keys()) + except Exception: + return [] + elif _safe_isinstance(obj, 'numpy', 'ndarray') or\ + _safe_isinstance(obj, 'numpy', 'void'): + return obj.dtype.names or [] + return [] + + try: + regexps = self.__dict_key_regexps + except AttributeError: + dict_key_re_fmt = r'''(?x) + ( # match dict-referring expression wrt greedy setting + %s + ) + \[ # open bracket + \s* # and optional whitespace + ([uUbB]? # string prefix (r not handled) + (?: # unclosed string + '(?:[^']|(? key_start: + leading = '' + else: + leading = text[text_start:completion_start] + + # the index of the `[` character + bracket_idx = match.end(1) + + # append closing quote and bracket as appropriate + # this is *not* appropriate if the opening quote or bracket is outside + # the text given to this method + suf = '' + continuation = self.line_buffer[len(self.text_until_cursor):] + if key_start > text_start and closing_quote: + # quotes were opened inside text, maybe close them + if continuation.startswith(closing_quote): + continuation = continuation[len(closing_quote):] + else: + suf += closing_quote + if bracket_idx > text_start: + # brackets were opened inside text, maybe close them + if not continuation.startswith(']'): + suf += ']' + + return [leading + k + suf for k in matches] + + def unicode_name_matches(self, text): + u"""Match Latex-like syntax for unicode characters base + on the name of the character. + + This does ``\\GREEK SMALL LETTER ETA`` -> ``η`` + + Works only on valid python 3 identifier, or on combining characters that + will combine to form a valid identifier. + + Used on Python 3 only. + """ + slashpos = text.rfind('\\') + if slashpos > -1: + s = text[slashpos+1:] + try : + unic = unicodedata.lookup(s) + # allow combining chars + if ('a'+unic).isidentifier(): + return '\\'+s,[unic] + except KeyError: + pass + return u'', [] + + + def latex_matches(self, text): + u"""Match Latex syntax for unicode characters. + + This does both ``\\alp`` -> ``\\alpha`` and ``\\alpha`` -> ``α`` + """ + slashpos = text.rfind('\\') + if slashpos > -1: + s = text[slashpos:] + if s in latex_symbols: + # Try to complete a full latex symbol to unicode + # \\alpha -> α + return s, [latex_symbols[s]] + else: + # If a user has partially typed a latex symbol, give them + # a full list of options \al -> [\aleph, \alpha] + matches = [k for k in latex_symbols if k.startswith(s)] + if matches: + return s, matches + return u'', [] + + def dispatch_custom_completer(self, text): + if not self.custom_completers: + return + + line = self.line_buffer + if not line.strip(): + return None + + # Create a little structure to pass all the relevant information about + # the current completion to any custom completer. + event = SimpleNamespace() + event.line = line + event.symbol = text + cmd = line.split(None,1)[0] + event.command = cmd + event.text_until_cursor = self.text_until_cursor + + # for foo etc, try also to find completer for %foo + if not cmd.startswith(self.magic_escape): + try_magic = self.custom_completers.s_matches( + self.magic_escape + cmd) + else: + try_magic = [] + + for c in itertools.chain(self.custom_completers.s_matches(cmd), + try_magic, + self.custom_completers.flat_matches(self.text_until_cursor)): + try: + res = c(event) + if res: + # first, try case sensitive match + withcase = [r for r in res if r.startswith(text)] + if withcase: + return withcase + # if none, then case insensitive ones are ok too + text_low = text.lower() + return [r for r in res if r.lower().startswith(text_low)] + except TryNext: + pass + except KeyboardInterrupt: + """ + If custom completer take too long, + let keyboard interrupt abort and return nothing. + """ + break + + return None + + def completions(self, text: str, offset: int)->Iterator[Completion]: + """ + Returns an iterator over the possible completions + + .. warning:: Unstable + + This function is unstable, API may change without warning. + It will also raise unless use in proper context manager. + + Parameters + ---------- + + text:str + Full text of the current input, multi line string. + offset:int + Integer representing the position of the cursor in ``text``. Offset + is 0-based indexed. + + Yields + ------ + :any:`Completion` object + + + The cursor on a text can either be seen as being "in between" + characters or "On" a character depending on the interface visible to + the user. For consistency the cursor being on "in between" characters X + and Y is equivalent to the cursor being "on" character Y, that is to say + the character the cursor is on is considered as being after the cursor. + + Combining characters may span more that one position in the + text. + + + .. note:: + + If ``IPCompleter.debug`` is :any:`True` will yield a ``--jedi/ipython--`` + fake Completion token to distinguish completion returned by Jedi + and usual IPython completion. + + .. note:: + + Completions are not completely deduplicated yet. If identical + completions are coming from different sources this function does not + ensure that each completion object will only be present once. + """ + warnings.warn("_complete is a provisional API (as of IPython 6.0). " + "It may change without warnings. " + "Use in corresponding context manager.", + category=ProvisionalCompleterWarning, stacklevel=2) + + seen = set() + try: + for c in self._completions(text, offset, _timeout=self.jedi_compute_type_timeout/1000): + if c and (c in seen): + continue + yield c + seen.add(c) + except KeyboardInterrupt: + """if completions take too long and users send keyboard interrupt, + do not crash and return ASAP. """ + pass + + def _completions(self, full_text: str, offset: int, *, _timeout)->Iterator[Completion]: + """ + Core completion module.Same signature as :any:`completions`, with the + extra `timeout` parameter (in seconds). + + + Computing jedi's completion ``.type`` can be quite expensive (it is a + lazy property) and can require some warm-up, more warm up than just + computing the ``name`` of a completion. The warm-up can be : + + - Long warm-up the first time a module is encountered after + install/update: actually build parse/inference tree. + + - first time the module is encountered in a session: load tree from + disk. + + We don't want to block completions for tens of seconds so we give the + completer a "budget" of ``_timeout`` seconds per invocation to compute + completions types, the completions that have not yet been computed will + be marked as "unknown" an will have a chance to be computed next round + are things get cached. + + Keep in mind that Jedi is not the only thing treating the completion so + keep the timeout short-ish as if we take more than 0.3 second we still + have lots of processing to do. + + """ + deadline = time.monotonic() + _timeout + + + before = full_text[:offset] + cursor_line, cursor_column = position_to_cursor(full_text, offset) + + matched_text, matches, matches_origin, jedi_matches = self._complete( + full_text=full_text, cursor_line=cursor_line, cursor_pos=cursor_column) + + iter_jm = iter(jedi_matches) + if _timeout: + for jm in iter_jm: + try: + type_ = jm.type + except Exception: + if self.debug: + print("Error in Jedi getting type of ", jm) + type_ = None + delta = len(jm.name_with_symbols) - len(jm.complete) + if type_ == 'function': + signature = _make_signature(jm) + else: + signature = '' + yield Completion(start=offset - delta, + end=offset, + text=jm.name_with_symbols, + type=type_, + signature=signature, + _origin='jedi') + + if time.monotonic() > deadline: + break + + for jm in iter_jm: + delta = len(jm.name_with_symbols) - len(jm.complete) + yield Completion(start=offset - delta, + end=offset, + text=jm.name_with_symbols, + type='', # don't compute type for speed + _origin='jedi', + signature='') + + + start_offset = before.rfind(matched_text) + + # TODO: + # Suppress this, right now just for debug. + if jedi_matches and matches and self.debug: + yield Completion(start=start_offset, end=offset, text='--jedi/ipython--', + _origin='debug', type='none', signature='') + + # I'm unsure if this is always true, so let's assert and see if it + # crash + assert before.endswith(matched_text) + for m, t in zip(matches, matches_origin): + yield Completion(start=start_offset, end=offset, text=m, _origin=t, signature='', type='') + + + def complete(self, text=None, line_buffer=None, cursor_pos=None): + """Find completions for the given text and line context. + + Note that both the text and the line_buffer are optional, but at least + one of them must be given. + + Parameters + ---------- + text : string, optional + Text to perform the completion on. If not given, the line buffer + is split using the instance's CompletionSplitter object. + + line_buffer : string, optional + If not given, the completer attempts to obtain the current line + buffer via readline. This keyword allows clients which are + requesting for text completions in non-readline contexts to inform + the completer of the entire text. + + cursor_pos : int, optional + Index of the cursor in the full line buffer. Should be provided by + remote frontends where kernel has no access to frontend state. + + Returns + ------- + text : str + Text that was actually used in the completion. + + matches : list + A list of completion matches. + + + .. note:: + + This API is likely to be deprecated and replaced by + :any:`IPCompleter.completions` in the future. + + + """ + warnings.warn('`Completer.complete` is pending deprecation since ' + 'IPython 6.0 and will be replaced by `Completer.completions`.', + PendingDeprecationWarning) + # potential todo, FOLD the 3rd throw away argument of _complete + # into the first 2 one. + return self._complete(line_buffer=line_buffer, cursor_pos=cursor_pos, text=text, cursor_line=0)[:2] + + def _complete(self, *, cursor_line, cursor_pos, line_buffer=None, text=None, + full_text=None) -> Tuple[str, List[str], List[str], Iterable[_FakeJediCompletion]]: + """ + + Like complete but can also returns raw jedi completions as well as the + origin of the completion text. This could (and should) be made much + cleaner but that will be simpler once we drop the old (and stateful) + :any:`complete` API. + + + With current provisional API, cursor_pos act both (depending on the + caller) as the offset in the ``text`` or ``line_buffer``, or as the + ``column`` when passing multiline strings this could/should be renamed + but would add extra noise. + """ + + # if the cursor position isn't given, the only sane assumption we can + # make is that it's at the end of the line (the common case) + if cursor_pos is None: + cursor_pos = len(line_buffer) if text is None else len(text) + + if self.use_main_ns: + self.namespace = __main__.__dict__ + + # if text is either None or an empty string, rely on the line buffer + if (not line_buffer) and full_text: + line_buffer = full_text.split('\n')[cursor_line] + if not text: # issue #11508: check line_buffer before calling split_line + text = self.splitter.split_line(line_buffer, cursor_pos) if line_buffer else '' + + if self.backslash_combining_completions: + # allow deactivation of these on windows. + base_text = text if not line_buffer else line_buffer[:cursor_pos] + latex_text, latex_matches = self.latex_matches(base_text) + if latex_matches: + return latex_text, latex_matches, ['latex_matches']*len(latex_matches), () + name_text = '' + name_matches = [] + # need to add self.fwd_unicode_match() function here when done + for meth in (self.unicode_name_matches, back_latex_name_matches, back_unicode_name_matches, self.fwd_unicode_match): + name_text, name_matches = meth(base_text) + if name_text: + return name_text, name_matches[:MATCHES_LIMIT], \ + [meth.__qualname__]*min(len(name_matches), MATCHES_LIMIT), () + + + # If no line buffer is given, assume the input text is all there was + if line_buffer is None: + line_buffer = text + + self.line_buffer = line_buffer + self.text_until_cursor = self.line_buffer[:cursor_pos] + + # Do magic arg matches + for matcher in self.magic_arg_matchers: + matches = list(matcher(line_buffer))[:MATCHES_LIMIT] + if matches: + origins = [matcher.__qualname__] * len(matches) + return text, matches, origins, () + + # Start with a clean slate of completions + matches = [] + + # FIXME: we should extend our api to return a dict with completions for + # different types of objects. The rlcomplete() method could then + # simply collapse the dict into a list for readline, but we'd have + # richer completion semantics in other environments. + completions = () + if self.use_jedi: + if not full_text: + full_text = line_buffer + completions = self._jedi_matches( + cursor_pos, cursor_line, full_text) + + if self.merge_completions: + matches = [] + for matcher in self.matchers: + try: + matches.extend([(m, matcher.__qualname__) + for m in matcher(text)]) + except: + # Show the ugly traceback if the matcher causes an + # exception, but do NOT crash the kernel! + sys.excepthook(*sys.exc_info()) + else: + for matcher in self.matchers: + matches = [(m, matcher.__qualname__) + for m in matcher(text)] + if matches: + break + + seen = set() + filtered_matches = set() + for m in matches: + t, c = m + if t not in seen: + filtered_matches.add(m) + seen.add(t) + + _filtered_matches = sorted(filtered_matches, key=lambda x: completions_sorting_key(x[0])) + + custom_res = [(m, 'custom') for m in self.dispatch_custom_completer(text) or []] + + _filtered_matches = custom_res or _filtered_matches + + _filtered_matches = _filtered_matches[:MATCHES_LIMIT] + _matches = [m[0] for m in _filtered_matches] + origins = [m[1] for m in _filtered_matches] + + self.matches = _matches + + return text, _matches, origins, completions + + def fwd_unicode_match(self, text:str) -> Tuple[str, list]: + if self._names is None: + self._names = [] + for c in range(0,0x10FFFF + 1): + try: + self._names.append(unicodedata.name(chr(c))) + except ValueError: + pass + + slashpos = text.rfind('\\') + # if text starts with slash + if slashpos > -1: + s = text[slashpos+1:] + candidates = [x for x in self._names if x.startswith(s)] + if candidates: + return s, candidates + else: + return '', () + + # if text does not start with slash + else: + return u'', () diff --git a/.venv/lib/python3.8/site-packages/IPython/core/completerlib.py b/.venv/lib/python3.8/site-packages/IPython/core/completerlib.py new file mode 100644 index 00000000..7860cb67 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/completerlib.py @@ -0,0 +1,354 @@ +# encoding: utf-8 +"""Implementations for various useful completers. + +These are all loaded by default by IPython. +""" +#----------------------------------------------------------------------------- +# Copyright (C) 2010-2011 The IPython Development Team. +# +# Distributed under the terms of the BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +# Stdlib imports +import glob +import inspect +import os +import re +import sys +from importlib import import_module +from importlib.machinery import all_suffixes + + +# Third-party imports +from time import time +from zipimport import zipimporter + +# Our own imports +from .completer import expand_user, compress_user +from .error import TryNext +from ..utils._process_common import arg_split + +# FIXME: this should be pulled in with the right call via the component system +from IPython import get_ipython + +from typing import List + +#----------------------------------------------------------------------------- +# Globals and constants +#----------------------------------------------------------------------------- +_suffixes = all_suffixes() + +# Time in seconds after which the rootmodules will be stored permanently in the +# ipython ip.db database (kept in the user's .ipython dir). +TIMEOUT_STORAGE = 2 + +# Time in seconds after which we give up +TIMEOUT_GIVEUP = 20 + +# Regular expression for the python import statement +import_re = re.compile(r'(?P[^\W\d]\w*?)' + r'(?P[/\\]__init__)?' + r'(?P%s)$' % + r'|'.join(re.escape(s) for s in _suffixes)) + +# RE for the ipython %run command (python + ipython scripts) +magic_run_re = re.compile(r'.*(\.ipy|\.ipynb|\.py[w]?)$') + +#----------------------------------------------------------------------------- +# Local utilities +#----------------------------------------------------------------------------- + +def module_list(path): + """ + Return the list containing the names of the modules available in the given + folder. + """ + # sys.path has the cwd as an empty string, but isdir/listdir need it as '.' + if path == '': + path = '.' + + # A few local constants to be used in loops below + pjoin = os.path.join + + if os.path.isdir(path): + # Build a list of all files in the directory and all files + # in its subdirectories. For performance reasons, do not + # recurse more than one level into subdirectories. + files = [] + for root, dirs, nondirs in os.walk(path, followlinks=True): + subdir = root[len(path)+1:] + if subdir: + files.extend(pjoin(subdir, f) for f in nondirs) + dirs[:] = [] # Do not recurse into additional subdirectories. + else: + files.extend(nondirs) + + else: + try: + files = list(zipimporter(path)._files.keys()) + except: + files = [] + + # Build a list of modules which match the import_re regex. + modules = [] + for f in files: + m = import_re.match(f) + if m: + modules.append(m.group('name')) + return list(set(modules)) + + +def get_root_modules(): + """ + Returns a list containing the names of all the modules available in the + folders of the pythonpath. + + ip.db['rootmodules_cache'] maps sys.path entries to list of modules. + """ + ip = get_ipython() + if ip is None: + # No global shell instance to store cached list of modules. + # Don't try to scan for modules every time. + return list(sys.builtin_module_names) + + rootmodules_cache = ip.db.get('rootmodules_cache', {}) + rootmodules = list(sys.builtin_module_names) + start_time = time() + store = False + for path in sys.path: + try: + modules = rootmodules_cache[path] + except KeyError: + modules = module_list(path) + try: + modules.remove('__init__') + except ValueError: + pass + if path not in ('', '.'): # cwd modules should not be cached + rootmodules_cache[path] = modules + if time() - start_time > TIMEOUT_STORAGE and not store: + store = True + print("\nCaching the list of root modules, please wait!") + print("(This will only be done once - type '%rehashx' to " + "reset cache!)\n") + sys.stdout.flush() + if time() - start_time > TIMEOUT_GIVEUP: + print("This is taking too long, we give up.\n") + return [] + rootmodules.extend(modules) + if store: + ip.db['rootmodules_cache'] = rootmodules_cache + rootmodules = list(set(rootmodules)) + return rootmodules + + +def is_importable(module, attr, only_modules): + if only_modules: + return inspect.ismodule(getattr(module, attr)) + else: + return not(attr[:2] == '__' and attr[-2:] == '__') + + +def try_import(mod: str, only_modules=False) -> List[str]: + """ + Try to import given module and return list of potential completions. + """ + mod = mod.rstrip('.') + try: + m = import_module(mod) + except: + return [] + + m_is_init = '__init__' in (getattr(m, '__file__', '') or '') + + completions = [] + if (not hasattr(m, '__file__')) or (not only_modules) or m_is_init: + completions.extend( [attr for attr in dir(m) if + is_importable(m, attr, only_modules)]) + + completions.extend(getattr(m, '__all__', [])) + if m_is_init: + completions.extend(module_list(os.path.dirname(m.__file__))) + completions_set = {c for c in completions if isinstance(c, str)} + completions_set.discard('__init__') + return list(completions_set) + + +#----------------------------------------------------------------------------- +# Completion-related functions. +#----------------------------------------------------------------------------- + +def quick_completer(cmd, completions): + r""" Easily create a trivial completer for a command. + + Takes either a list of completions, or all completions in string (that will + be split on whitespace). + + Example:: + + [d:\ipython]|1> import ipy_completers + [d:\ipython]|2> ipy_completers.quick_completer('foo', ['bar','baz']) + [d:\ipython]|3> foo b + bar baz + [d:\ipython]|3> foo ba + """ + + if isinstance(completions, str): + completions = completions.split() + + def do_complete(self, event): + return completions + + get_ipython().set_hook('complete_command',do_complete, str_key = cmd) + +def module_completion(line): + """ + Returns a list containing the completion possibilities for an import line. + + The line looks like this : + 'import xml.d' + 'from xml.dom import' + """ + + words = line.split(' ') + nwords = len(words) + + # from whatever -> 'import ' + if nwords == 3 and words[0] == 'from': + return ['import '] + + # 'from xy' or 'import xy' + if nwords < 3 and (words[0] in {'%aimport', 'import', 'from'}) : + if nwords == 1: + return get_root_modules() + mod = words[1].split('.') + if len(mod) < 2: + return get_root_modules() + completion_list = try_import('.'.join(mod[:-1]), True) + return ['.'.join(mod[:-1] + [el]) for el in completion_list] + + # 'from xyz import abc' + if nwords >= 3 and words[0] == 'from': + mod = words[1] + return try_import(mod) + +#----------------------------------------------------------------------------- +# Completers +#----------------------------------------------------------------------------- +# These all have the func(self, event) signature to be used as custom +# completers + +def module_completer(self,event): + """Give completions after user has typed 'import ...' or 'from ...'""" + + # This works in all versions of python. While 2.5 has + # pkgutil.walk_packages(), that particular routine is fairly dangerous, + # since it imports *EVERYTHING* on sys.path. That is: a) very slow b) full + # of possibly problematic side effects. + # This search the folders in the sys.path for available modules. + + return module_completion(event.line) + +# FIXME: there's a lot of logic common to the run, cd and builtin file +# completers, that is currently reimplemented in each. + +def magic_run_completer(self, event): + """Complete files that end in .py or .ipy or .ipynb for the %run command. + """ + comps = arg_split(event.line, strict=False) + # relpath should be the current token that we need to complete. + if (len(comps) > 1) and (not event.line.endswith(' ')): + relpath = comps[-1].strip("'\"") + else: + relpath = '' + + #print("\nev=", event) # dbg + #print("rp=", relpath) # dbg + #print('comps=', comps) # dbg + + lglob = glob.glob + isdir = os.path.isdir + relpath, tilde_expand, tilde_val = expand_user(relpath) + + # Find if the user has already typed the first filename, after which we + # should complete on all files, since after the first one other files may + # be arguments to the input script. + + if any(magic_run_re.match(c) for c in comps): + matches = [f.replace('\\','/') + ('/' if isdir(f) else '') + for f in lglob(relpath+'*')] + else: + dirs = [f.replace('\\','/') + "/" for f in lglob(relpath+'*') if isdir(f)] + pys = [f.replace('\\','/') + for f in lglob(relpath+'*.py') + lglob(relpath+'*.ipy') + + lglob(relpath+'*.ipynb') + lglob(relpath + '*.pyw')] + + matches = dirs + pys + + #print('run comp:', dirs+pys) # dbg + return [compress_user(p, tilde_expand, tilde_val) for p in matches] + + +def cd_completer(self, event): + """Completer function for cd, which only returns directories.""" + ip = get_ipython() + relpath = event.symbol + + #print(event) # dbg + if event.line.endswith('-b') or ' -b ' in event.line: + # return only bookmark completions + bkms = self.db.get('bookmarks', None) + if bkms: + return bkms.keys() + else: + return [] + + if event.symbol == '-': + width_dh = str(len(str(len(ip.user_ns['_dh']) + 1))) + # jump in directory history by number + fmt = '-%0' + width_dh +'d [%s]' + ents = [ fmt % (i,s) for i,s in enumerate(ip.user_ns['_dh'])] + if len(ents) > 1: + return ents + return [] + + if event.symbol.startswith('--'): + return ["--" + os.path.basename(d) for d in ip.user_ns['_dh']] + + # Expand ~ in path and normalize directory separators. + relpath, tilde_expand, tilde_val = expand_user(relpath) + relpath = relpath.replace('\\','/') + + found = [] + for d in [f.replace('\\','/') + '/' for f in glob.glob(relpath+'*') + if os.path.isdir(f)]: + if ' ' in d: + # we don't want to deal with any of that, complex code + # for this is elsewhere + raise TryNext + + found.append(d) + + if not found: + if os.path.isdir(relpath): + return [compress_user(relpath, tilde_expand, tilde_val)] + + # if no completions so far, try bookmarks + bks = self.db.get('bookmarks',{}) + bkmatches = [s for s in bks if s.startswith(event.symbol)] + if bkmatches: + return bkmatches + + raise TryNext + + return [compress_user(p, tilde_expand, tilde_val) for p in found] + +def reset_completer(self, event): + "A completer for %reset magic" + return '-f -s in out array dhist'.split() diff --git a/.venv/lib/python3.8/site-packages/IPython/core/crashhandler.py b/.venv/lib/python3.8/site-packages/IPython/core/crashhandler.py new file mode 100644 index 00000000..1e0b429d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/crashhandler.py @@ -0,0 +1,228 @@ +# encoding: utf-8 +"""sys.excepthook for IPython itself, leaves a detailed report on disk. + +Authors: + +* Fernando Perez +* Brian E. Granger +""" + +#----------------------------------------------------------------------------- +# Copyright (C) 2001-2007 Fernando Perez. +# Copyright (C) 2008-2011 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +import os +import sys +import traceback +from pprint import pformat + +from IPython.core import ultratb +from IPython.core.release import author_email +from IPython.utils.sysinfo import sys_info +from IPython.utils.py3compat import input + +from IPython.core.release import __version__ as version + +#----------------------------------------------------------------------------- +# Code +#----------------------------------------------------------------------------- + +# Template for the user message. +_default_message_template = """\ +Oops, {app_name} crashed. We do our best to make it stable, but... + +A crash report was automatically generated with the following information: + - A verbatim copy of the crash traceback. + - A copy of your input history during this session. + - Data on your current {app_name} configuration. + +It was left in the file named: +\t'{crash_report_fname}' +If you can email this file to the developers, the information in it will help +them in understanding and correcting the problem. + +You can mail it to: {contact_name} at {contact_email} +with the subject '{app_name} Crash Report'. + +If you want to do it now, the following command will work (under Unix): +mail -s '{app_name} Crash Report' {contact_email} < {crash_report_fname} + +In your email, please also include information about: +- The operating system under which the crash happened: Linux, macOS, Windows, + other, and which exact version (for example: Ubuntu 16.04.3, macOS 10.13.2, + Windows 10 Pro), and whether it is 32-bit or 64-bit; +- How {app_name} was installed: using pip or conda, from GitHub, as part of + a Docker container, or other, providing more detail if possible; +- How to reproduce the crash: what exact sequence of instructions can one + input to get the same crash? Ideally, find a minimal yet complete sequence + of instructions that yields the crash. + +To ensure accurate tracking of this issue, please file a report about it at: +{bug_tracker} +""" + +_lite_message_template = """ +If you suspect this is an IPython {version} bug, please report it at: + https://github.com/ipython/ipython/issues +or send an email to the mailing list at {email} + +You can print a more detailed traceback right now with "%tb", or use "%debug" +to interactively debug it. + +Extra-detailed tracebacks for bug-reporting purposes can be enabled via: + {config}Application.verbose_crash=True +""" + + +class CrashHandler(object): + """Customizable crash handlers for IPython applications. + + Instances of this class provide a :meth:`__call__` method which can be + used as a ``sys.excepthook``. The :meth:`__call__` signature is:: + + def __call__(self, etype, evalue, etb) + """ + + message_template = _default_message_template + section_sep = '\n\n'+'*'*75+'\n\n' + + def __init__(self, app, contact_name=None, contact_email=None, + bug_tracker=None, show_crash_traceback=True, call_pdb=False): + """Create a new crash handler + + Parameters + ---------- + app : Application + A running :class:`Application` instance, which will be queried at + crash time for internal information. + + contact_name : str + A string with the name of the person to contact. + + contact_email : str + A string with the email address of the contact. + + bug_tracker : str + A string with the URL for your project's bug tracker. + + show_crash_traceback : bool + If false, don't print the crash traceback on stderr, only generate + the on-disk report + + Non-argument instance attributes: + + These instances contain some non-argument attributes which allow for + further customization of the crash handler's behavior. Please see the + source for further details. + """ + self.crash_report_fname = "Crash_report_%s.txt" % app.name + self.app = app + self.call_pdb = call_pdb + #self.call_pdb = True # dbg + self.show_crash_traceback = show_crash_traceback + self.info = dict(app_name = app.name, + contact_name = contact_name, + contact_email = contact_email, + bug_tracker = bug_tracker, + crash_report_fname = self.crash_report_fname) + + + def __call__(self, etype, evalue, etb): + """Handle an exception, call for compatible with sys.excepthook""" + + # do not allow the crash handler to be called twice without reinstalling it + # this prevents unlikely errors in the crash handling from entering an + # infinite loop. + sys.excepthook = sys.__excepthook__ + + # Report tracebacks shouldn't use color in general (safer for users) + color_scheme = 'NoColor' + + # Use this ONLY for developer debugging (keep commented out for release) + #color_scheme = 'Linux' # dbg + try: + rptdir = self.app.ipython_dir + except: + rptdir = os.getcwd() + if rptdir is None or not os.path.isdir(rptdir): + rptdir = os.getcwd() + report_name = os.path.join(rptdir,self.crash_report_fname) + # write the report filename into the instance dict so it can get + # properly expanded out in the user message template + self.crash_report_fname = report_name + self.info['crash_report_fname'] = report_name + TBhandler = ultratb.VerboseTB( + color_scheme=color_scheme, + long_header=1, + call_pdb=self.call_pdb, + ) + if self.call_pdb: + TBhandler(etype,evalue,etb) + return + else: + traceback = TBhandler.text(etype,evalue,etb,context=31) + + # print traceback to screen + if self.show_crash_traceback: + print(traceback, file=sys.stderr) + + # and generate a complete report on disk + try: + report = open(report_name,'w') + except: + print('Could not create crash report on disk.', file=sys.stderr) + return + + with report: + # Inform user on stderr of what happened + print('\n'+'*'*70+'\n', file=sys.stderr) + print(self.message_template.format(**self.info), file=sys.stderr) + + # Construct report on disk + report.write(self.make_report(traceback)) + + input("Hit to quit (your terminal may close):") + + def make_report(self,traceback): + """Return a string containing a crash report.""" + + sec_sep = self.section_sep + + report = ['*'*75+'\n\n'+'IPython post-mortem report\n\n'] + rpt_add = report.append + rpt_add(sys_info()) + + try: + config = pformat(self.app.config) + rpt_add(sec_sep) + rpt_add('Application name: %s\n\n' % self.app_name) + rpt_add('Current user configuration structure:\n\n') + rpt_add(config) + except: + pass + rpt_add(sec_sep+'Crash traceback:\n\n' + traceback) + + return ''.join(report) + + +def crash_handler_lite(etype, evalue, tb): + """a light excepthook, adding a small message to the usual traceback""" + traceback.print_exception(etype, evalue, tb) + + from IPython.core.interactiveshell import InteractiveShell + if InteractiveShell.initialized(): + # we are in a Shell environment, give %magic example + config = "%config " + else: + # we are not in a shell, show generic config + config = "c." + print(_lite_message_template.format(email=author_email, config=config, version=version), file=sys.stderr) + diff --git a/.venv/lib/python3.8/site-packages/IPython/core/debugger.py b/.venv/lib/python3.8/site-packages/IPython/core/debugger.py new file mode 100644 index 00000000..a330baa4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/debugger.py @@ -0,0 +1,804 @@ +# -*- coding: utf-8 -*- +""" +Pdb debugger class. + +Modified from the standard pdb.Pdb class to avoid including readline, so that +the command line completion of other programs which include this isn't +damaged. + +In the future, this class will be expanded with improvements over the standard +pdb. + +The code in this file is mainly lifted out of cmd.py in Python 2.2, with minor +changes. Licensing should therefore be under the standard Python terms. For +details on the PSF (Python Software Foundation) standard license, see: + +https://docs.python.org/2/license.html +""" + +#***************************************************************************** +# +# This file is licensed under the PSF license. +# +# Copyright (C) 2001 Python Software Foundation, www.python.org +# Copyright (C) 2005-2006 Fernando Perez. +# +# +#***************************************************************************** + +import bdb +import functools +import inspect +import linecache +import sys +import warnings +import re + +from IPython import get_ipython +from IPython.utils import PyColorize +from IPython.utils import coloransi, py3compat +from IPython.core.excolors import exception_colors +from IPython.testing.skipdoctest import skip_doctest + + +prompt = 'ipdb> ' + +#We have to check this directly from sys.argv, config struct not yet available +from pdb import Pdb as OldPdb + +# Allow the set_trace code to operate outside of an ipython instance, even if +# it does so with some limitations. The rest of this support is implemented in +# the Tracer constructor. + +def make_arrow(pad): + """generate the leading arrow in front of traceback or debugger""" + if pad >= 2: + return '-'*(pad-2) + '> ' + elif pad == 1: + return '>' + return '' + + +def BdbQuit_excepthook(et, ev, tb, excepthook=None): + """Exception hook which handles `BdbQuit` exceptions. + + All other exceptions are processed using the `excepthook` + parameter. + """ + warnings.warn("`BdbQuit_excepthook` is deprecated since version 5.1", + DeprecationWarning, stacklevel=2) + if et==bdb.BdbQuit: + print('Exiting Debugger.') + elif excepthook is not None: + excepthook(et, ev, tb) + else: + # Backwards compatibility. Raise deprecation warning? + BdbQuit_excepthook.excepthook_ori(et,ev,tb) + + +def BdbQuit_IPython_excepthook(self,et,ev,tb,tb_offset=None): + warnings.warn( + "`BdbQuit_IPython_excepthook` is deprecated since version 5.1", + DeprecationWarning, stacklevel=2) + print('Exiting Debugger.') + + +class Tracer(object): + """ + DEPRECATED + + Class for local debugging, similar to pdb.set_trace. + + Instances of this class, when called, behave like pdb.set_trace, but + providing IPython's enhanced capabilities. + + This is implemented as a class which must be initialized in your own code + and not as a standalone function because we need to detect at runtime + whether IPython is already active or not. That detection is done in the + constructor, ensuring that this code plays nicely with a running IPython, + while functioning acceptably (though with limitations) if outside of it. + """ + + @skip_doctest + def __init__(self, colors=None): + """ + DEPRECATED + + Create a local debugger instance. + + Parameters + ---------- + + colors : str, optional + The name of the color scheme to use, it must be one of IPython's + valid color schemes. If not given, the function will default to + the current IPython scheme when running inside IPython, and to + 'NoColor' otherwise. + + Examples + -------- + :: + + from IPython.core.debugger import Tracer; debug_here = Tracer() + + Later in your code:: + + debug_here() # -> will open up the debugger at that point. + + Once the debugger activates, you can use all of its regular commands to + step through code, set breakpoints, etc. See the pdb documentation + from the Python standard library for usage details. + """ + warnings.warn("`Tracer` is deprecated since version 5.1, directly use " + "`IPython.core.debugger.Pdb.set_trace()`", + DeprecationWarning, stacklevel=2) + + ip = get_ipython() + if ip is None: + # Outside of ipython, we set our own exception hook manually + sys.excepthook = functools.partial(BdbQuit_excepthook, + excepthook=sys.excepthook) + def_colors = 'NoColor' + else: + # In ipython, we use its custom exception handler mechanism + def_colors = ip.colors + ip.set_custom_exc((bdb.BdbQuit,), BdbQuit_IPython_excepthook) + + if colors is None: + colors = def_colors + + # The stdlib debugger internally uses a modified repr from the `repr` + # module, that limits the length of printed strings to a hardcoded + # limit of 30 characters. That much trimming is too aggressive, let's + # at least raise that limit to 80 chars, which should be enough for + # most interactive uses. + try: + from reprlib import aRepr + aRepr.maxstring = 80 + except: + # This is only a user-facing convenience, so any error we encounter + # here can be warned about but can be otherwise ignored. These + # printouts will tell us about problems if this API changes + import traceback + traceback.print_exc() + + self.debugger = Pdb(colors) + + def __call__(self): + """Starts an interactive debugger at the point where called. + + This is similar to the pdb.set_trace() function from the std lib, but + using IPython's enhanced debugger.""" + + self.debugger.set_trace(sys._getframe().f_back) + + +RGX_EXTRA_INDENT = re.compile(r'(?<=\n)\s+') + + +def strip_indentation(multiline_string): + return RGX_EXTRA_INDENT.sub('', multiline_string) + + +def decorate_fn_with_doc(new_fn, old_fn, additional_text=""): + """Make new_fn have old_fn's doc string. This is particularly useful + for the ``do_...`` commands that hook into the help system. + Adapted from from a comp.lang.python posting + by Duncan Booth.""" + def wrapper(*args, **kw): + return new_fn(*args, **kw) + if old_fn.__doc__: + wrapper.__doc__ = strip_indentation(old_fn.__doc__) + additional_text + return wrapper + + +class Pdb(OldPdb): + """Modified Pdb class, does not load readline. + + for a standalone version that uses prompt_toolkit, see + `IPython.terminal.debugger.TerminalPdb` and + `IPython.terminal.debugger.set_trace()` + """ + + def __init__(self, color_scheme=None, completekey=None, + stdin=None, stdout=None, context=5, **kwargs): + """Create a new IPython debugger. + + :param color_scheme: Deprecated, do not use. + :param completekey: Passed to pdb.Pdb. + :param stdin: Passed to pdb.Pdb. + :param stdout: Passed to pdb.Pdb. + :param context: Number of lines of source code context to show when + displaying stacktrace information. + :param kwargs: Passed to pdb.Pdb. + The possibilities are python version dependent, see the python + docs for more info. + """ + + # Parent constructor: + try: + self.context = int(context) + if self.context <= 0: + raise ValueError("Context must be a positive integer") + except (TypeError, ValueError): + raise ValueError("Context must be a positive integer") + + # `kwargs` ensures full compatibility with stdlib's `pdb.Pdb`. + OldPdb.__init__(self, completekey, stdin, stdout, **kwargs) + + # IPython changes... + self.shell = get_ipython() + + if self.shell is None: + save_main = sys.modules['__main__'] + # No IPython instance running, we must create one + from IPython.terminal.interactiveshell import \ + TerminalInteractiveShell + self.shell = TerminalInteractiveShell.instance() + # needed by any code which calls __import__("__main__") after + # the debugger was entered. See also #9941. + sys.modules['__main__'] = save_main + + if color_scheme is not None: + warnings.warn( + "The `color_scheme` argument is deprecated since version 5.1", + DeprecationWarning, stacklevel=2) + else: + color_scheme = self.shell.colors + + self.aliases = {} + + # Create color table: we copy the default one from the traceback + # module and add a few attributes needed for debugging + self.color_scheme_table = exception_colors() + + # shorthands + C = coloransi.TermColors + cst = self.color_scheme_table + + cst['NoColor'].colors.prompt = C.NoColor + cst['NoColor'].colors.breakpoint_enabled = C.NoColor + cst['NoColor'].colors.breakpoint_disabled = C.NoColor + + cst['Linux'].colors.prompt = C.Green + cst['Linux'].colors.breakpoint_enabled = C.LightRed + cst['Linux'].colors.breakpoint_disabled = C.Red + + cst['LightBG'].colors.prompt = C.Blue + cst['LightBG'].colors.breakpoint_enabled = C.LightRed + cst['LightBG'].colors.breakpoint_disabled = C.Red + + cst['Neutral'].colors.prompt = C.Blue + cst['Neutral'].colors.breakpoint_enabled = C.LightRed + cst['Neutral'].colors.breakpoint_disabled = C.Red + + + # Add a python parser so we can syntax highlight source while + # debugging. + self.parser = PyColorize.Parser(style=color_scheme) + self.set_colors(color_scheme) + + # Set the prompt - the default prompt is '(Pdb)' + self.prompt = prompt + self.skip_hidden = True + + def set_colors(self, scheme): + """Shorthand access to the color table scheme selector method.""" + self.color_scheme_table.set_active_scheme(scheme) + self.parser.style = scheme + + + def hidden_frames(self, stack): + """ + Given an index in the stack return wether it should be skipped. + + This is used in up/down and where to skip frames. + """ + ip_hide = [s[0].f_locals.get("__tracebackhide__", False) for s in stack] + ip_start = [i for i, s in enumerate(ip_hide) if s == "__ipython_bottom__"] + if ip_start: + ip_hide = [h if i > ip_start[0] else True for (i, h) in enumerate(ip_hide)] + return ip_hide + + def interaction(self, frame, traceback): + try: + OldPdb.interaction(self, frame, traceback) + except KeyboardInterrupt: + self.stdout.write("\n" + self.shell.get_exception_only()) + + def new_do_frame(self, arg): + OldPdb.do_frame(self, arg) + + def new_do_quit(self, arg): + + if hasattr(self, 'old_all_completions'): + self.shell.Completer.all_completions=self.old_all_completions + + return OldPdb.do_quit(self, arg) + + do_q = do_quit = decorate_fn_with_doc(new_do_quit, OldPdb.do_quit) + + def new_do_restart(self, arg): + """Restart command. In the context of ipython this is exactly the same + thing as 'quit'.""" + self.msg("Restart doesn't make sense here. Using 'quit' instead.") + return self.do_quit(arg) + + def print_stack_trace(self, context=None): + Colors = self.color_scheme_table.active_colors + ColorsNormal = Colors.Normal + if context is None: + context = self.context + try: + context=int(context) + if context <= 0: + raise ValueError("Context must be a positive integer") + except (TypeError, ValueError): + raise ValueError("Context must be a positive integer") + try: + skipped = 0 + for hidden, frame_lineno in zip(self.hidden_frames(self.stack), self.stack): + if hidden and self.skip_hidden: + skipped += 1 + continue + if skipped: + print( + f"{Colors.excName} [... skipping {skipped} hidden frame(s)]{ColorsNormal}\n" + ) + skipped = 0 + self.print_stack_entry(frame_lineno, context=context) + if skipped: + print( + f"{Colors.excName} [... skipping {skipped} hidden frame(s)]{ColorsNormal}\n" + ) + except KeyboardInterrupt: + pass + + def print_stack_entry(self, frame_lineno, prompt_prefix='\n-> ', + context=None): + if context is None: + context = self.context + try: + context=int(context) + if context <= 0: + raise ValueError("Context must be a positive integer") + except (TypeError, ValueError): + raise ValueError("Context must be a positive integer") + print(self.format_stack_entry(frame_lineno, '', context), file=self.stdout) + + # vds: >> + frame, lineno = frame_lineno + filename = frame.f_code.co_filename + self.shell.hooks.synchronize_with_editor(filename, lineno, 0) + # vds: << + + def format_stack_entry(self, frame_lineno, lprefix=': ', context=None): + if context is None: + context = self.context + try: + context=int(context) + if context <= 0: + print("Context must be a positive integer", file=self.stdout) + except (TypeError, ValueError): + print("Context must be a positive integer", file=self.stdout) + try: + import reprlib # Py 3 + except ImportError: + import repr as reprlib # Py 2 + + ret = [] + + Colors = self.color_scheme_table.active_colors + ColorsNormal = Colors.Normal + tpl_link = u'%s%%s%s' % (Colors.filenameEm, ColorsNormal) + tpl_call = u'%s%%s%s%%s%s' % (Colors.vName, Colors.valEm, ColorsNormal) + tpl_line = u'%%s%s%%s %s%%s' % (Colors.lineno, ColorsNormal) + tpl_line_em = u'%%s%s%%s %s%%s%s' % (Colors.linenoEm, Colors.line, + ColorsNormal) + + frame, lineno = frame_lineno + + return_value = '' + if '__return__' in frame.f_locals: + rv = frame.f_locals['__return__'] + #return_value += '->' + return_value += reprlib.repr(rv) + '\n' + ret.append(return_value) + + #s = filename + '(' + `lineno` + ')' + filename = self.canonic(frame.f_code.co_filename) + link = tpl_link % py3compat.cast_unicode(filename) + + if frame.f_code.co_name: + func = frame.f_code.co_name + else: + func = "" + + call = '' + if func != '?': + if '__args__' in frame.f_locals: + args = reprlib.repr(frame.f_locals['__args__']) + else: + args = '()' + call = tpl_call % (func, args) + + # The level info should be generated in the same format pdb uses, to + # avoid breaking the pdbtrack functionality of python-mode in *emacs. + if frame is self.curframe: + ret.append('> ') + else: + ret.append(' ') + ret.append(u'%s(%s)%s\n' % (link,lineno,call)) + + start = lineno - 1 - context//2 + lines = linecache.getlines(filename) + start = min(start, len(lines) - context) + start = max(start, 0) + lines = lines[start : start + context] + + for i,line in enumerate(lines): + show_arrow = (start + 1 + i == lineno) + linetpl = (frame is self.curframe or show_arrow) \ + and tpl_line_em \ + or tpl_line + ret.append(self.__format_line(linetpl, filename, + start + 1 + i, line, + arrow = show_arrow) ) + return ''.join(ret) + + def __format_line(self, tpl_line, filename, lineno, line, arrow = False): + bp_mark = "" + bp_mark_color = "" + + new_line, err = self.parser.format2(line, 'str') + if not err: + line = new_line + + bp = None + if lineno in self.get_file_breaks(filename): + bps = self.get_breaks(filename, lineno) + bp = bps[-1] + + if bp: + Colors = self.color_scheme_table.active_colors + bp_mark = str(bp.number) + bp_mark_color = Colors.breakpoint_enabled + if not bp.enabled: + bp_mark_color = Colors.breakpoint_disabled + + numbers_width = 7 + if arrow: + # This is the line with the error + pad = numbers_width - len(str(lineno)) - len(bp_mark) + num = '%s%s' % (make_arrow(pad), str(lineno)) + else: + num = '%*s' % (numbers_width - len(bp_mark), str(lineno)) + + return tpl_line % (bp_mark_color + bp_mark, num, line) + + + def print_list_lines(self, filename, first, last): + """The printing (as opposed to the parsing part of a 'list' + command.""" + try: + Colors = self.color_scheme_table.active_colors + ColorsNormal = Colors.Normal + tpl_line = '%%s%s%%s %s%%s' % (Colors.lineno, ColorsNormal) + tpl_line_em = '%%s%s%%s %s%%s%s' % (Colors.linenoEm, Colors.line, ColorsNormal) + src = [] + if filename == "" and hasattr(self, "_exec_filename"): + filename = self._exec_filename + + for lineno in range(first, last+1): + line = linecache.getline(filename, lineno) + if not line: + break + + if lineno == self.curframe.f_lineno: + line = self.__format_line(tpl_line_em, filename, lineno, line, arrow = True) + else: + line = self.__format_line(tpl_line, filename, lineno, line, arrow = False) + + src.append(line) + self.lineno = lineno + + print(''.join(src), file=self.stdout) + + except KeyboardInterrupt: + pass + + def do_skip_hidden(self, arg): + """ + Change whether or not we should skip frames with the + __tracebackhide__ attribute. + """ + if arg.strip().lower() in ("true", "yes"): + self.skip_hidden = True + elif arg.strip().lower() in ("false", "no"): + self.skip_hidden = False + + def do_list(self, arg): + """Print lines of code from the current stack frame + """ + self.lastcmd = 'list' + last = None + if arg: + try: + x = eval(arg, {}, {}) + if type(x) == type(()): + first, last = x + first = int(first) + last = int(last) + if last < first: + # Assume it's a count + last = first + last + else: + first = max(1, int(x) - 5) + except: + print('*** Error in argument:', repr(arg), file=self.stdout) + return + elif self.lineno is None: + first = max(1, self.curframe.f_lineno - 5) + else: + first = self.lineno + 1 + if last is None: + last = first + 10 + self.print_list_lines(self.curframe.f_code.co_filename, first, last) + + # vds: >> + lineno = first + filename = self.curframe.f_code.co_filename + self.shell.hooks.synchronize_with_editor(filename, lineno, 0) + # vds: << + + do_l = do_list + + def getsourcelines(self, obj): + lines, lineno = inspect.findsource(obj) + if inspect.isframe(obj) and obj.f_globals is obj.f_locals: + # must be a module frame: do not try to cut a block out of it + return lines, 1 + elif inspect.ismodule(obj): + return lines, 1 + return inspect.getblock(lines[lineno:]), lineno+1 + + def do_longlist(self, arg): + """Print lines of code from the current stack frame. + + Shows more lines than 'list' does. + """ + self.lastcmd = 'longlist' + try: + lines, lineno = self.getsourcelines(self.curframe) + except OSError as err: + self.error(err) + return + last = lineno + len(lines) + self.print_list_lines(self.curframe.f_code.co_filename, lineno, last) + do_ll = do_longlist + + def do_debug(self, arg): + """debug code + Enter a recursive debugger that steps through the code + argument (which is an arbitrary expression or statement to be + executed in the current environment). + """ + sys.settrace(None) + globals = self.curframe.f_globals + locals = self.curframe_locals + p = self.__class__(completekey=self.completekey, + stdin=self.stdin, stdout=self.stdout) + p.use_rawinput = self.use_rawinput + p.prompt = "(%s) " % self.prompt.strip() + self.message("ENTERING RECURSIVE DEBUGGER") + sys.call_tracing(p.run, (arg, globals, locals)) + self.message("LEAVING RECURSIVE DEBUGGER") + sys.settrace(self.trace_dispatch) + self.lastcmd = p.lastcmd + + def do_pdef(self, arg): + """Print the call signature for any callable object. + + The debugger interface to %pdef""" + namespaces = [('Locals', self.curframe.f_locals), + ('Globals', self.curframe.f_globals)] + self.shell.find_line_magic('pdef')(arg, namespaces=namespaces) + + def do_pdoc(self, arg): + """Print the docstring for an object. + + The debugger interface to %pdoc.""" + namespaces = [('Locals', self.curframe.f_locals), + ('Globals', self.curframe.f_globals)] + self.shell.find_line_magic('pdoc')(arg, namespaces=namespaces) + + def do_pfile(self, arg): + """Print (or run through pager) the file where an object is defined. + + The debugger interface to %pfile. + """ + namespaces = [('Locals', self.curframe.f_locals), + ('Globals', self.curframe.f_globals)] + self.shell.find_line_magic('pfile')(arg, namespaces=namespaces) + + def do_pinfo(self, arg): + """Provide detailed information about an object. + + The debugger interface to %pinfo, i.e., obj?.""" + namespaces = [('Locals', self.curframe.f_locals), + ('Globals', self.curframe.f_globals)] + self.shell.find_line_magic('pinfo')(arg, namespaces=namespaces) + + def do_pinfo2(self, arg): + """Provide extra detailed information about an object. + + The debugger interface to %pinfo2, i.e., obj??.""" + namespaces = [('Locals', self.curframe.f_locals), + ('Globals', self.curframe.f_globals)] + self.shell.find_line_magic('pinfo2')(arg, namespaces=namespaces) + + def do_psource(self, arg): + """Print (or run through pager) the source code for an object.""" + namespaces = [('Locals', self.curframe.f_locals), + ('Globals', self.curframe.f_globals)] + self.shell.find_line_magic('psource')(arg, namespaces=namespaces) + + def do_where(self, arg): + """w(here) + Print a stack trace, with the most recent frame at the bottom. + An arrow indicates the "current frame", which determines the + context of most commands. 'bt' is an alias for this command. + + Take a number as argument as an (optional) number of context line to + print""" + if arg: + try: + context = int(arg) + except ValueError as err: + self.error(err) + return + self.print_stack_trace(context) + else: + self.print_stack_trace() + + do_w = do_where + + def stop_here(self, frame): + hidden = False + if self.skip_hidden: + hidden = frame.f_locals.get("__tracebackhide__", False) + if hidden: + Colors = self.color_scheme_table.active_colors + ColorsNormal = Colors.Normal + print(f"{Colors.excName} [... skipped 1 hidden frame]{ColorsNormal}\n") + + return super().stop_here(frame) + + def do_up(self, arg): + """u(p) [count] + Move the current frame count (default one) levels up in the + stack trace (to an older frame). + + Will skip hidden frames. + """ + ## modified version of upstream that skips + # frames with __tracebackide__ + if self.curindex == 0: + self.error("Oldest frame") + return + try: + count = int(arg or 1) + except ValueError: + self.error("Invalid frame count (%s)" % arg) + return + skipped = 0 + if count < 0: + _newframe = 0 + else: + _newindex = self.curindex + counter = 0 + hidden_frames = self.hidden_frames(self.stack) + for i in range(self.curindex - 1, -1, -1): + frame = self.stack[i][0] + if hidden_frames[i] and self.skip_hidden: + skipped += 1 + continue + counter += 1 + if counter >= count: + break + else: + # if no break occured. + self.error("all frames above hidden") + return + + Colors = self.color_scheme_table.active_colors + ColorsNormal = Colors.Normal + _newframe = i + self._select_frame(_newframe) + if skipped: + print( + f"{Colors.excName} [... skipped {skipped} hidden frame(s)]{ColorsNormal}\n" + ) + + def do_down(self, arg): + """d(own) [count] + Move the current frame count (default one) levels down in the + stack trace (to a newer frame). + + Will skip hidden frames. + """ + if self.curindex + 1 == len(self.stack): + self.error("Newest frame") + return + try: + count = int(arg or 1) + except ValueError: + self.error("Invalid frame count (%s)" % arg) + return + if count < 0: + _newframe = len(self.stack) - 1 + else: + _newindex = self.curindex + counter = 0 + skipped = 0 + hidden_frames = self.hidden_frames(self.stack) + for i in range(self.curindex + 1, len(self.stack)): + frame = self.stack[i][0] + if hidden_frames[i] and self.skip_hidden: + skipped += 1 + continue + counter += 1 + if counter >= count: + break + else: + self.error("all frames bellow hidden") + return + + Colors = self.color_scheme_table.active_colors + ColorsNormal = Colors.Normal + if skipped: + print( + f"{Colors.excName} [... skipped {skipped} hidden frame(s)]{ColorsNormal}\n" + ) + _newframe = i + + self._select_frame(_newframe) + + do_d = do_down + do_u = do_up + +class InterruptiblePdb(Pdb): + """Version of debugger where KeyboardInterrupt exits the debugger altogether.""" + + def cmdloop(self): + """Wrap cmdloop() such that KeyboardInterrupt stops the debugger.""" + try: + return OldPdb.cmdloop(self) + except KeyboardInterrupt: + self.stop_here = lambda frame: False + self.do_quit("") + sys.settrace(None) + self.quitting = False + raise + + def _cmdloop(self): + while True: + try: + # keyboard interrupts allow for an easy way to cancel + # the current command, so allow them during interactive input + self.allow_kbdint = True + self.cmdloop() + self.allow_kbdint = False + break + except KeyboardInterrupt: + self.message('--KeyboardInterrupt--') + raise + + +def set_trace(frame=None): + """ + Start debugging from `frame`. + + If frame is not specified, debugging starts from caller's frame. + """ + Pdb().set_trace(frame or sys._getframe().f_back) diff --git a/.venv/lib/python3.8/site-packages/IPython/core/display.py b/.venv/lib/python3.8/site-packages/IPython/core/display.py new file mode 100644 index 00000000..424414a6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/display.py @@ -0,0 +1,1527 @@ +# -*- coding: utf-8 -*- +"""Top-level display functions for displaying object in different formats.""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + + +from binascii import b2a_hex, b2a_base64, hexlify +import json +import mimetypes +import os +import struct +import sys +import warnings +from copy import deepcopy +from os.path import splitext +from pathlib import Path, PurePath + +from IPython.utils.py3compat import cast_unicode +from IPython.testing.skipdoctest import skip_doctest + +__all__ = ['display', 'display_pretty', 'display_html', 'display_markdown', +'display_svg', 'display_png', 'display_jpeg', 'display_latex', 'display_json', +'display_javascript', 'display_pdf', 'DisplayObject', 'TextDisplayObject', +'Pretty', 'HTML', 'Markdown', 'Math', 'Latex', 'SVG', 'ProgressBar', 'JSON', +'GeoJSON', 'Javascript', 'Image', 'clear_output', 'set_matplotlib_formats', +'set_matplotlib_close', 'publish_display_data', 'update_display', 'DisplayHandle', +'Video'] + +#----------------------------------------------------------------------------- +# utility functions +#----------------------------------------------------------------------------- + +def _safe_exists(path): + """Check path, but don't let exceptions raise""" + try: + return os.path.exists(path) + except Exception: + return False + +def _merge(d1, d2): + """Like update, but merges sub-dicts instead of clobbering at the top level. + + Updates d1 in-place + """ + + if not isinstance(d2, dict) or not isinstance(d1, dict): + return d2 + for key, value in d2.items(): + d1[key] = _merge(d1.get(key), value) + return d1 + +def _display_mimetype(mimetype, objs, raw=False, metadata=None): + """internal implementation of all display_foo methods + + Parameters + ---------- + mimetype : str + The mimetype to be published (e.g. 'image/png') + objs : tuple of objects + The Python objects to display, or if raw=True raw text data to + display. + raw : bool + Are the data objects raw data or Python objects that need to be + formatted before display? [default: False] + metadata : dict (optional) + Metadata to be associated with the specific mimetype output. + """ + if metadata: + metadata = {mimetype: metadata} + if raw: + # turn list of pngdata into list of { 'image/png': pngdata } + objs = [ {mimetype: obj} for obj in objs ] + display(*objs, raw=raw, metadata=metadata, include=[mimetype]) + +#----------------------------------------------------------------------------- +# Main functions +#----------------------------------------------------------------------------- + +# use * to indicate transient is keyword-only +def publish_display_data(data, metadata=None, source=None, *, transient=None, **kwargs): + """Publish data and metadata to all frontends. + + See the ``display_data`` message in the messaging documentation for + more details about this message type. + + Keys of data and metadata can be any mime-type. + + Parameters + ---------- + data : dict + A dictionary having keys that are valid MIME types (like + 'text/plain' or 'image/svg+xml') and values that are the data for + that MIME type. The data itself must be a JSON'able data + structure. Minimally all data should have the 'text/plain' data, + which can be displayed by all frontends. If more than the plain + text is given, it is up to the frontend to decide which + representation to use. + metadata : dict + A dictionary for metadata related to the data. This can contain + arbitrary key, value pairs that frontends can use to interpret + the data. mime-type keys matching those in data can be used + to specify metadata about particular representations. + source : str, deprecated + Unused. + transient : dict, keyword-only + A dictionary of transient data, such as display_id. + """ + from IPython.core.interactiveshell import InteractiveShell + + display_pub = InteractiveShell.instance().display_pub + + # only pass transient if supplied, + # to avoid errors with older ipykernel. + # TODO: We could check for ipykernel version and provide a detailed upgrade message. + if transient: + kwargs['transient'] = transient + + display_pub.publish( + data=data, + metadata=metadata, + **kwargs + ) + + +def _new_id(): + """Generate a new random text id with urandom""" + return b2a_hex(os.urandom(16)).decode('ascii') + + +def display(*objs, include=None, exclude=None, metadata=None, transient=None, display_id=None, **kwargs): + """Display a Python object in all frontends. + + By default all representations will be computed and sent to the frontends. + Frontends can decide which representation is used and how. + + In terminal IPython this will be similar to using :func:`print`, for use in richer + frontends see Jupyter notebook examples with rich display logic. + + Parameters + ---------- + objs : tuple of objects + The Python objects to display. + raw : bool, optional + Are the objects to be displayed already mimetype-keyed dicts of raw display data, + or Python objects that need to be formatted before display? [default: False] + include : list, tuple or set, optional + A list of format type strings (MIME types) to include in the + format data dict. If this is set *only* the format types included + in this list will be computed. + exclude : list, tuple or set, optional + A list of format type strings (MIME types) to exclude in the format + data dict. If this is set all format types will be computed, + except for those included in this argument. + metadata : dict, optional + A dictionary of metadata to associate with the output. + mime-type keys in this dictionary will be associated with the individual + representation formats, if they exist. + transient : dict, optional + A dictionary of transient data to associate with the output. + Data in this dict should not be persisted to files (e.g. notebooks). + display_id : str, bool optional + Set an id for the display. + This id can be used for updating this display area later via update_display. + If given as `True`, generate a new `display_id` + kwargs: additional keyword-args, optional + Additional keyword-arguments are passed through to the display publisher. + + Returns + ------- + + handle: DisplayHandle + Returns a handle on updatable displays for use with :func:`update_display`, + if `display_id` is given. Returns :any:`None` if no `display_id` is given + (default). + + Examples + -------- + + >>> class Json(object): + ... def __init__(self, json): + ... self.json = json + ... def _repr_pretty_(self, pp, cycle): + ... import json + ... pp.text(json.dumps(self.json, indent=2)) + ... def __repr__(self): + ... return str(self.json) + ... + + >>> d = Json({1:2, 3: {4:5}}) + + >>> print(d) + {1: 2, 3: {4: 5}} + + >>> display(d) + { + "1": 2, + "3": { + "4": 5 + } + } + + >>> def int_formatter(integer, pp, cycle): + ... pp.text('I'*integer) + + >>> plain = get_ipython().display_formatter.formatters['text/plain'] + >>> plain.for_type(int, int_formatter) + + >>> display(7-5) + II + + >>> del plain.type_printers[int] + >>> display(7-5) + 2 + + See Also + -------- + + :func:`update_display` + + Notes + ----- + + In Python, objects can declare their textual representation using the + `__repr__` method. IPython expands on this idea and allows objects to declare + other, rich representations including: + + - HTML + - JSON + - PNG + - JPEG + - SVG + - LaTeX + + A single object can declare some or all of these representations; all are + handled by IPython's display system. + + The main idea of the first approach is that you have to implement special + display methods when you define your class, one for each representation you + want to use. Here is a list of the names of the special methods and the + values they must return: + + - `_repr_html_`: return raw HTML as a string, or a tuple (see below). + - `_repr_json_`: return a JSONable dict, or a tuple (see below). + - `_repr_jpeg_`: return raw JPEG data, or a tuple (see below). + - `_repr_png_`: return raw PNG data, or a tuple (see below). + - `_repr_svg_`: return raw SVG data as a string, or a tuple (see below). + - `_repr_latex_`: return LaTeX commands in a string surrounded by "$", + or a tuple (see below). + - `_repr_mimebundle_`: return a full mimebundle containing the mapping + from all mimetypes to data. + Use this for any mime-type not listed above. + + The above functions may also return the object's metadata alonside the + data. If the metadata is available, the functions will return a tuple + containing the data and metadata, in that order. If there is no metadata + available, then the functions will return the data only. + + When you are directly writing your own classes, you can adapt them for + display in IPython by following the above approach. But in practice, you + often need to work with existing classes that you can't easily modify. + + You can refer to the documentation on integrating with the display system in + order to register custom formatters for already existing types + (:ref:`integrating_rich_display`). + + .. versionadded:: 5.4 display available without import + .. versionadded:: 6.1 display available without import + + Since IPython 5.4 and 6.1 :func:`display` is automatically made available to + the user without import. If you are using display in a document that might + be used in a pure python context or with older version of IPython, use the + following import at the top of your file:: + + from IPython.display import display + + """ + from IPython.core.interactiveshell import InteractiveShell + + if not InteractiveShell.initialized(): + # Directly print objects. + print(*objs) + return + + raw = kwargs.pop('raw', False) + if transient is None: + transient = {} + if metadata is None: + metadata={} + if display_id: + if display_id is True: + display_id = _new_id() + transient['display_id'] = display_id + if kwargs.get('update') and 'display_id' not in transient: + raise TypeError('display_id required for update_display') + if transient: + kwargs['transient'] = transient + + if not objs and display_id: + # if given no objects, but still a request for a display_id, + # we assume the user wants to insert an empty output that + # can be updated later + objs = [{}] + raw = True + + if not raw: + format = InteractiveShell.instance().display_formatter.format + + for obj in objs: + if raw: + publish_display_data(data=obj, metadata=metadata, **kwargs) + else: + format_dict, md_dict = format(obj, include=include, exclude=exclude) + if not format_dict: + # nothing to display (e.g. _ipython_display_ took over) + continue + if metadata: + # kwarg-specified metadata gets precedence + _merge(md_dict, metadata) + publish_display_data(data=format_dict, metadata=md_dict, **kwargs) + if display_id: + return DisplayHandle(display_id) + + +# use * for keyword-only display_id arg +def update_display(obj, *, display_id, **kwargs): + """Update an existing display by id + + Parameters + ---------- + + obj: + The object with which to update the display + display_id: keyword-only + The id of the display to update + + See Also + -------- + + :func:`display` + """ + kwargs['update'] = True + display(obj, display_id=display_id, **kwargs) + + +class DisplayHandle(object): + """A handle on an updatable display + + Call `.update(obj)` to display a new object. + + Call `.display(obj`) to add a new instance of this display, + and update existing instances. + + See Also + -------- + + :func:`display`, :func:`update_display` + + """ + + def __init__(self, display_id=None): + if display_id is None: + display_id = _new_id() + self.display_id = display_id + + def __repr__(self): + return "<%s display_id=%s>" % (self.__class__.__name__, self.display_id) + + def display(self, obj, **kwargs): + """Make a new display with my id, updating existing instances. + + Parameters + ---------- + + obj: + object to display + **kwargs: + additional keyword arguments passed to display + """ + display(obj, display_id=self.display_id, **kwargs) + + def update(self, obj, **kwargs): + """Update existing displays with my id + + Parameters + ---------- + + obj: + object to display + **kwargs: + additional keyword arguments passed to update_display + """ + update_display(obj, display_id=self.display_id, **kwargs) + + +def display_pretty(*objs, **kwargs): + """Display the pretty (default) representation of an object. + + Parameters + ---------- + objs : tuple of objects + The Python objects to display, or if raw=True raw text data to + display. + raw : bool + Are the data objects raw data or Python objects that need to be + formatted before display? [default: False] + metadata : dict (optional) + Metadata to be associated with the specific mimetype output. + """ + _display_mimetype('text/plain', objs, **kwargs) + + +def display_html(*objs, **kwargs): + """Display the HTML representation of an object. + + Note: If raw=False and the object does not have a HTML + representation, no HTML will be shown. + + Parameters + ---------- + objs : tuple of objects + The Python objects to display, or if raw=True raw HTML data to + display. + raw : bool + Are the data objects raw data or Python objects that need to be + formatted before display? [default: False] + metadata : dict (optional) + Metadata to be associated with the specific mimetype output. + """ + _display_mimetype('text/html', objs, **kwargs) + + +def display_markdown(*objs, **kwargs): + """Displays the Markdown representation of an object. + + Parameters + ---------- + objs : tuple of objects + The Python objects to display, or if raw=True raw markdown data to + display. + raw : bool + Are the data objects raw data or Python objects that need to be + formatted before display? [default: False] + metadata : dict (optional) + Metadata to be associated with the specific mimetype output. + """ + + _display_mimetype('text/markdown', objs, **kwargs) + + +def display_svg(*objs, **kwargs): + """Display the SVG representation of an object. + + Parameters + ---------- + objs : tuple of objects + The Python objects to display, or if raw=True raw svg data to + display. + raw : bool + Are the data objects raw data or Python objects that need to be + formatted before display? [default: False] + metadata : dict (optional) + Metadata to be associated with the specific mimetype output. + """ + _display_mimetype('image/svg+xml', objs, **kwargs) + + +def display_png(*objs, **kwargs): + """Display the PNG representation of an object. + + Parameters + ---------- + objs : tuple of objects + The Python objects to display, or if raw=True raw png data to + display. + raw : bool + Are the data objects raw data or Python objects that need to be + formatted before display? [default: False] + metadata : dict (optional) + Metadata to be associated with the specific mimetype output. + """ + _display_mimetype('image/png', objs, **kwargs) + + +def display_jpeg(*objs, **kwargs): + """Display the JPEG representation of an object. + + Parameters + ---------- + objs : tuple of objects + The Python objects to display, or if raw=True raw JPEG data to + display. + raw : bool + Are the data objects raw data or Python objects that need to be + formatted before display? [default: False] + metadata : dict (optional) + Metadata to be associated with the specific mimetype output. + """ + _display_mimetype('image/jpeg', objs, **kwargs) + + +def display_latex(*objs, **kwargs): + """Display the LaTeX representation of an object. + + Parameters + ---------- + objs : tuple of objects + The Python objects to display, or if raw=True raw latex data to + display. + raw : bool + Are the data objects raw data or Python objects that need to be + formatted before display? [default: False] + metadata : dict (optional) + Metadata to be associated with the specific mimetype output. + """ + _display_mimetype('text/latex', objs, **kwargs) + + +def display_json(*objs, **kwargs): + """Display the JSON representation of an object. + + Note that not many frontends support displaying JSON. + + Parameters + ---------- + objs : tuple of objects + The Python objects to display, or if raw=True raw json data to + display. + raw : bool + Are the data objects raw data or Python objects that need to be + formatted before display? [default: False] + metadata : dict (optional) + Metadata to be associated with the specific mimetype output. + """ + _display_mimetype('application/json', objs, **kwargs) + + +def display_javascript(*objs, **kwargs): + """Display the Javascript representation of an object. + + Parameters + ---------- + objs : tuple of objects + The Python objects to display, or if raw=True raw javascript data to + display. + raw : bool + Are the data objects raw data or Python objects that need to be + formatted before display? [default: False] + metadata : dict (optional) + Metadata to be associated with the specific mimetype output. + """ + _display_mimetype('application/javascript', objs, **kwargs) + + +def display_pdf(*objs, **kwargs): + """Display the PDF representation of an object. + + Parameters + ---------- + objs : tuple of objects + The Python objects to display, or if raw=True raw javascript data to + display. + raw : bool + Are the data objects raw data or Python objects that need to be + formatted before display? [default: False] + metadata : dict (optional) + Metadata to be associated with the specific mimetype output. + """ + _display_mimetype('application/pdf', objs, **kwargs) + + +#----------------------------------------------------------------------------- +# Smart classes +#----------------------------------------------------------------------------- + + +class DisplayObject(object): + """An object that wraps data to be displayed.""" + + _read_flags = 'r' + _show_mem_addr = False + metadata = None + + def __init__(self, data=None, url=None, filename=None, metadata=None): + """Create a display object given raw data. + + When this object is returned by an expression or passed to the + display function, it will result in the data being displayed + in the frontend. The MIME type of the data should match the + subclasses used, so the Png subclass should be used for 'image/png' + data. If the data is a URL, the data will first be downloaded + and then displayed. If + + Parameters + ---------- + data : unicode, str or bytes + The raw data or a URL or file to load the data from + url : unicode + A URL to download the data from. + filename : unicode + Path to a local file to load the data from. + metadata : dict + Dict of metadata associated to be the object when displayed + """ + if isinstance(data, (Path, PurePath)): + data = str(data) + + if data is not None and isinstance(data, str): + if data.startswith('http') and url is None: + url = data + filename = None + data = None + elif _safe_exists(data) and filename is None: + url = None + filename = data + data = None + + self.url = url + self.filename = filename + # because of @data.setter methods in + # subclasses ensure url and filename are set + # before assigning to self.data + self.data = data + + if metadata is not None: + self.metadata = metadata + elif self.metadata is None: + self.metadata = {} + + self.reload() + self._check_data() + + def __repr__(self): + if not self._show_mem_addr: + cls = self.__class__ + r = "<%s.%s object>" % (cls.__module__, cls.__name__) + else: + r = super(DisplayObject, self).__repr__() + return r + + def _check_data(self): + """Override in subclasses if there's something to check.""" + pass + + def _data_and_metadata(self): + """shortcut for returning metadata with shape information, if defined""" + if self.metadata: + return self.data, deepcopy(self.metadata) + else: + return self.data + + def reload(self): + """Reload the raw data from file or URL.""" + if self.filename is not None: + with open(self.filename, self._read_flags) as f: + self.data = f.read() + elif self.url is not None: + # Deferred import + from urllib.request import urlopen + response = urlopen(self.url) + data = response.read() + # extract encoding from header, if there is one: + encoding = None + if 'content-type' in response.headers: + for sub in response.headers['content-type'].split(';'): + sub = sub.strip() + if sub.startswith('charset'): + encoding = sub.split('=')[-1].strip() + break + if 'content-encoding' in response.headers: + # TODO: do deflate? + if 'gzip' in response.headers['content-encoding']: + import gzip + from io import BytesIO + with gzip.open(BytesIO(data), 'rt', encoding=encoding) as fp: + encoding = None + data = fp.read() + + # decode data, if an encoding was specified + # We only touch self.data once since + # subclasses such as SVG have @data.setter methods + # that transform self.data into ... well svg. + if encoding: + self.data = data.decode(encoding, 'replace') + else: + self.data = data + + +class TextDisplayObject(DisplayObject): + """Validate that display data is text""" + def _check_data(self): + if self.data is not None and not isinstance(self.data, str): + raise TypeError("%s expects text, not %r" % (self.__class__.__name__, self.data)) + +class Pretty(TextDisplayObject): + + def _repr_pretty_(self, pp, cycle): + return pp.text(self.data) + + +class HTML(TextDisplayObject): + + def __init__(self, data=None, url=None, filename=None, metadata=None): + def warn(): + if not data: + return False + + # + # Avoid calling lower() on the entire data, because it could be a + # long string and we're only interested in its beginning and end. + # + prefix = data[:10].lower() + suffix = data[-10:].lower() + return prefix.startswith("') + m_warn.assert_not_called() + + display.HTML('') + m_warn.assert_called_with('Consider using IPython.display.IFrame instead') + + m_warn.reset_mock() + display.HTML('') + m_warn.assert_called_with('Consider using IPython.display.IFrame instead') + +def test_progress(): + p = display.ProgressBar(10) + nt.assert_in('0/10',repr(p)) + p.html_width = '100%' + p.progress = 5 + nt.assert_equal(p._repr_html_(), "") + +def test_progress_iter(): + with capture_output(display=False) as captured: + for i in display.ProgressBar(5): + out = captured.stdout + nt.assert_in('{0}/5'.format(i), out) + out = captured.stdout + nt.assert_in('5/5', out) + +def test_json(): + d = {'a': 5} + lis = [d] + metadata = [ + {'expanded': False, 'root': 'root'}, + {'expanded': True, 'root': 'root'}, + {'expanded': False, 'root': 'custom'}, + {'expanded': True, 'root': 'custom'}, + ] + json_objs = [ + display.JSON(d), + display.JSON(d, expanded=True), + display.JSON(d, root='custom'), + display.JSON(d, expanded=True, root='custom'), + ] + for j, md in zip(json_objs, metadata): + nt.assert_equal(j._repr_json_(), (d, md)) + + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("always") + j = display.JSON(json.dumps(d)) + nt.assert_equal(len(w), 1) + nt.assert_equal(j._repr_json_(), (d, metadata[0])) + + json_objs = [ + display.JSON(lis), + display.JSON(lis, expanded=True), + display.JSON(lis, root='custom'), + display.JSON(lis, expanded=True, root='custom'), + ] + for j, md in zip(json_objs, metadata): + nt.assert_equal(j._repr_json_(), (lis, md)) + + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("always") + j = display.JSON(json.dumps(lis)) + nt.assert_equal(len(w), 1) + nt.assert_equal(j._repr_json_(), (lis, metadata[0])) + +def test_video_embedding(): + """use a tempfile, with dummy-data, to ensure that video embedding doesn't crash""" + v = display.Video("http://ignored") + assert not v.embed + html = v._repr_html_() + nt.assert_not_in('src="data:', html) + nt.assert_in('src="http://ignored"', html) + + with nt.assert_raises(ValueError): + v = display.Video(b'abc') + + with NamedFileInTemporaryDirectory('test.mp4') as f: + f.write(b'abc') + f.close() + + v = display.Video(f.name) + assert not v.embed + html = v._repr_html_() + nt.assert_not_in('src="data:', html) + + v = display.Video(f.name, embed=True) + html = v._repr_html_() + nt.assert_in('src="data:video/mp4;base64,YWJj"',html) + + v = display.Video(f.name, embed=True, mimetype='video/other') + html = v._repr_html_() + nt.assert_in('src="data:video/other;base64,YWJj"',html) + + v = display.Video(b'abc', embed=True, mimetype='video/mp4') + html = v._repr_html_() + nt.assert_in('src="data:video/mp4;base64,YWJj"',html) + + v = display.Video(u'YWJj', embed=True, mimetype='video/xyz') + html = v._repr_html_() + nt.assert_in('src="data:video/xyz;base64,YWJj"',html) + +def test_html_metadata(): + s = "

Test

" + h = display.HTML(s, metadata={"isolated": True}) + nt.assert_equal(h._repr_html_(), (s, {"isolated": True})) + +def test_display_id(): + ip = get_ipython() + with mock.patch.object(ip.display_pub, 'publish') as pub: + handle = display.display('x') + nt.assert_is(handle, None) + handle = display.display('y', display_id='secret') + nt.assert_is_instance(handle, display.DisplayHandle) + handle2 = display.display('z', display_id=True) + nt.assert_is_instance(handle2, display.DisplayHandle) + nt.assert_not_equal(handle.display_id, handle2.display_id) + + nt.assert_equal(pub.call_count, 3) + args, kwargs = pub.call_args_list[0] + nt.assert_equal(args, ()) + nt.assert_equal(kwargs, { + 'data': { + 'text/plain': repr('x') + }, + 'metadata': {}, + }) + args, kwargs = pub.call_args_list[1] + nt.assert_equal(args, ()) + nt.assert_equal(kwargs, { + 'data': { + 'text/plain': repr('y') + }, + 'metadata': {}, + 'transient': { + 'display_id': handle.display_id, + }, + }) + args, kwargs = pub.call_args_list[2] + nt.assert_equal(args, ()) + nt.assert_equal(kwargs, { + 'data': { + 'text/plain': repr('z') + }, + 'metadata': {}, + 'transient': { + 'display_id': handle2.display_id, + }, + }) + + +def test_update_display(): + ip = get_ipython() + with mock.patch.object(ip.display_pub, 'publish') as pub: + with nt.assert_raises(TypeError): + display.update_display('x') + display.update_display('x', display_id='1') + display.update_display('y', display_id='2') + args, kwargs = pub.call_args_list[0] + nt.assert_equal(args, ()) + nt.assert_equal(kwargs, { + 'data': { + 'text/plain': repr('x') + }, + 'metadata': {}, + 'transient': { + 'display_id': '1', + }, + 'update': True, + }) + args, kwargs = pub.call_args_list[1] + nt.assert_equal(args, ()) + nt.assert_equal(kwargs, { + 'data': { + 'text/plain': repr('y') + }, + 'metadata': {}, + 'transient': { + 'display_id': '2', + }, + 'update': True, + }) + + +def test_display_handle(): + ip = get_ipython() + handle = display.DisplayHandle() + nt.assert_is_instance(handle.display_id, str) + handle = display.DisplayHandle('my-id') + nt.assert_equal(handle.display_id, 'my-id') + with mock.patch.object(ip.display_pub, 'publish') as pub: + handle.display('x') + handle.update('y') + + args, kwargs = pub.call_args_list[0] + nt.assert_equal(args, ()) + nt.assert_equal(kwargs, { + 'data': { + 'text/plain': repr('x') + }, + 'metadata': {}, + 'transient': { + 'display_id': handle.display_id, + } + }) + args, kwargs = pub.call_args_list[1] + nt.assert_equal(args, ()) + nt.assert_equal(kwargs, { + 'data': { + 'text/plain': repr('y') + }, + 'metadata': {}, + 'transient': { + 'display_id': handle.display_id, + }, + 'update': True, + }) + diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_displayhook.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_displayhook.py new file mode 100644 index 00000000..6ad89793 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_displayhook.py @@ -0,0 +1,112 @@ +import sys +from IPython.testing.tools import AssertPrints, AssertNotPrints +from IPython.core.displayhook import CapturingDisplayHook +from IPython.utils.capture import CapturedIO + +def test_output_displayed(): + """Checking to make sure that output is displayed""" + + with AssertPrints('2'): + ip.run_cell('1+1', store_history=True) + + with AssertPrints('2'): + ip.run_cell('1+1 # comment with a semicolon;', store_history=True) + + with AssertPrints('2'): + ip.run_cell('1+1\n#commented_out_function();', store_history=True) + + +def test_output_quiet(): + """Checking to make sure that output is quiet""" + + with AssertNotPrints('2'): + ip.run_cell('1+1;', store_history=True) + + with AssertNotPrints('2'): + ip.run_cell('1+1; # comment with a semicolon', store_history=True) + + with AssertNotPrints('2'): + ip.run_cell('1+1;\n#commented_out_function()', store_history=True) + +def test_underscore_no_overrite_user(): + ip.run_cell('_ = 42', store_history=True) + ip.run_cell('1+1', store_history=True) + + with AssertPrints('42'): + ip.run_cell('print(_)', store_history=True) + + ip.run_cell('del _', store_history=True) + ip.run_cell('6+6', store_history=True) + with AssertPrints('12'): + ip.run_cell('_', store_history=True) + + +def test_underscore_no_overrite_builtins(): + ip.run_cell("import gettext ; gettext.install('foo')", store_history=True) + ip.run_cell('3+3', store_history=True) + + with AssertPrints('gettext'): + ip.run_cell('print(_)', store_history=True) + + ip.run_cell('_ = "userset"', store_history=True) + + with AssertPrints('userset'): + ip.run_cell('print(_)', store_history=True) + ip.run_cell('import builtins; del builtins._') + + +def test_interactivehooks_ast_modes(): + """ + Test that ast nodes can be triggered with different modes + """ + saved_mode = ip.ast_node_interactivity + ip.ast_node_interactivity = 'last_expr_or_assign' + + try: + with AssertPrints('2'): + ip.run_cell('a = 1+1', store_history=True) + + with AssertPrints('9'): + ip.run_cell('b = 1+8 # comment with a semicolon;', store_history=False) + + with AssertPrints('7'): + ip.run_cell('c = 1+6\n#commented_out_function();', store_history=True) + + ip.run_cell('d = 11', store_history=True) + with AssertPrints('12'): + ip.run_cell('d += 1', store_history=True) + + with AssertNotPrints('42'): + ip.run_cell('(u,v) = (41+1, 43-1)') + + finally: + ip.ast_node_interactivity = saved_mode + +def test_interactivehooks_ast_modes_semi_suppress(): + """ + Test that ast nodes can be triggered with different modes and suppressed + by semicolon + """ + saved_mode = ip.ast_node_interactivity + ip.ast_node_interactivity = 'last_expr_or_assign' + + try: + with AssertNotPrints('2'): + ip.run_cell('x = 1+1;', store_history=True) + + with AssertNotPrints('7'): + ip.run_cell('y = 1+6; # comment with a semicolon', store_history=True) + + with AssertNotPrints('9'): + ip.run_cell('z = 1+8;\n#commented_out_function()', store_history=True) + + finally: + ip.ast_node_interactivity = saved_mode + +def test_capture_display_hook_format(): + """Tests that the capture display hook conforms to the CapturedIO output format""" + hook = CapturingDisplayHook(ip) + hook({"foo": "bar"}) + captured = CapturedIO(sys.stdout, sys.stderr, hook.outputs) + # Should not raise with RichOutput transformation error + captured.outputs diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_events.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_events.py new file mode 100644 index 00000000..a4211ece --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_events.py @@ -0,0 +1,92 @@ +import unittest +from unittest.mock import Mock +import nose.tools as nt + +from IPython.core import events +import IPython.testing.tools as tt + + +@events._define_event +def ping_received(): + pass + + +@events._define_event +def event_with_argument(argument): + pass + + +class CallbackTests(unittest.TestCase): + def setUp(self): + self.em = events.EventManager(get_ipython(), + {'ping_received': ping_received, + 'event_with_argument': event_with_argument}) + + def test_register_unregister(self): + cb = Mock() + + self.em.register('ping_received', cb) + self.em.trigger('ping_received') + self.assertEqual(cb.call_count, 1) + + self.em.unregister('ping_received', cb) + self.em.trigger('ping_received') + self.assertEqual(cb.call_count, 1) + + def test_bare_function_missed_unregister(self): + def cb1(): + ... + + def cb2(): + ... + + self.em.register('ping_received', cb1) + nt.assert_raises(ValueError, self.em.unregister, 'ping_received', cb2) + self.em.unregister('ping_received', cb1) + + def test_cb_error(self): + cb = Mock(side_effect=ValueError) + self.em.register('ping_received', cb) + with tt.AssertPrints("Error in callback"): + self.em.trigger('ping_received') + + def test_cb_keyboard_interrupt(self): + cb = Mock(side_effect=KeyboardInterrupt) + self.em.register('ping_received', cb) + with tt.AssertPrints("Error in callback"): + self.em.trigger('ping_received') + + def test_unregister_during_callback(self): + invoked = [False] * 3 + + def func1(*_): + invoked[0] = True + self.em.unregister('ping_received', func1) + self.em.register('ping_received', func3) + + def func2(*_): + invoked[1] = True + self.em.unregister('ping_received', func2) + + def func3(*_): + invoked[2] = True + + self.em.register('ping_received', func1) + self.em.register('ping_received', func2) + + self.em.trigger('ping_received') + self.assertEqual([True, True, False], invoked) + self.assertEqual([func3], self.em.callbacks['ping_received']) + + def test_ignore_event_arguments_if_no_argument_required(self): + call_count = [0] + def event_with_no_argument(): + call_count[0] += 1 + + self.em.register('event_with_argument', event_with_no_argument) + self.em.trigger('event_with_argument', 'the argument') + self.assertEqual(call_count[0], 1) + + self.em.unregister('event_with_argument', event_with_no_argument) + self.em.trigger('ping_received') + self.assertEqual(call_count[0], 1) diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_extension.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_extension.py new file mode 100644 index 00000000..b18e6848 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_extension.py @@ -0,0 +1,96 @@ +import os.path + +import nose.tools as nt + +import IPython.testing.tools as tt +from IPython.utils.syspathcontext import prepended_to_syspath +from IPython.utils.tempdir import TemporaryDirectory + +ext1_content = """ +def load_ipython_extension(ip): + print("Running ext1 load") + +def unload_ipython_extension(ip): + print("Running ext1 unload") +""" + +ext2_content = """ +def load_ipython_extension(ip): + print("Running ext2 load") +""" + +ext3_content = """ +def load_ipython_extension(ip): + ip2 = get_ipython() + print(ip is ip2) +""" + +def test_extension_loading(): + em = get_ipython().extension_manager + with TemporaryDirectory() as td: + ext1 = os.path.join(td, 'ext1.py') + with open(ext1, 'w') as f: + f.write(ext1_content) + + ext2 = os.path.join(td, 'ext2.py') + with open(ext2, 'w') as f: + f.write(ext2_content) + + with prepended_to_syspath(td): + assert 'ext1' not in em.loaded + assert 'ext2' not in em.loaded + + # Load extension + with tt.AssertPrints("Running ext1 load"): + assert em.load_extension('ext1') is None + assert 'ext1' in em.loaded + + # Should refuse to load it again + with tt.AssertNotPrints("Running ext1 load"): + assert em.load_extension('ext1') == 'already loaded' + + # Reload + with tt.AssertPrints("Running ext1 unload"): + with tt.AssertPrints("Running ext1 load", suppress=False): + em.reload_extension('ext1') + + # Unload + with tt.AssertPrints("Running ext1 unload"): + assert em.unload_extension('ext1') is None + + # Can't unload again + with tt.AssertNotPrints("Running ext1 unload"): + assert em.unload_extension('ext1') == 'not loaded' + assert em.unload_extension('ext2') == 'not loaded' + + # Load extension 2 + with tt.AssertPrints("Running ext2 load"): + assert em.load_extension('ext2') is None + + # Can't unload this + assert em.unload_extension('ext2') == 'no unload function' + + # But can reload it + with tt.AssertPrints("Running ext2 load"): + em.reload_extension('ext2') + + +def test_extension_builtins(): + em = get_ipython().extension_manager + with TemporaryDirectory() as td: + ext3 = os.path.join(td, 'ext3.py') + with open(ext3, 'w') as f: + f.write(ext3_content) + + assert 'ext3' not in em.loaded + + with prepended_to_syspath(td): + # Load extension + with tt.AssertPrints("True"): + assert em.load_extension('ext3') is None + assert 'ext3' in em.loaded + + +def test_non_extension(): + em = get_ipython().extension_manager + nt.assert_equal(em.load_extension('sys'), "no load function") diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_formatters.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_formatters.py new file mode 100644 index 00000000..cde43c94 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_formatters.py @@ -0,0 +1,533 @@ +"""Tests for the Formatters.""" + +import warnings +from math import pi + +try: + import numpy +except: + numpy = None +import nose.tools as nt + +from IPython import get_ipython +from traitlets.config import Config +from IPython.core.formatters import ( + PlainTextFormatter, HTMLFormatter, PDFFormatter, _mod_name_key, + DisplayFormatter, JSONFormatter, +) +from IPython.utils.io import capture_output + +class A(object): + def __repr__(self): + return 'A()' + +class B(A): + def __repr__(self): + return 'B()' + +class C: + pass + +class BadRepr(object): + def __repr__(self): + raise ValueError("bad repr") + +class BadPretty(object): + _repr_pretty_ = None + +class GoodPretty(object): + def _repr_pretty_(self, pp, cycle): + pp.text('foo') + + def __repr__(self): + return 'GoodPretty()' + +def foo_printer(obj, pp, cycle): + pp.text('foo') + +def test_pretty(): + f = PlainTextFormatter() + f.for_type(A, foo_printer) + nt.assert_equal(f(A()), 'foo') + nt.assert_equal(f(B()), 'B()') + nt.assert_equal(f(GoodPretty()), 'foo') + # Just don't raise an exception for the following: + f(BadPretty()) + + f.pprint = False + nt.assert_equal(f(A()), 'A()') + nt.assert_equal(f(B()), 'B()') + nt.assert_equal(f(GoodPretty()), 'GoodPretty()') + + +def test_deferred(): + f = PlainTextFormatter() + +def test_precision(): + """test various values for float_precision.""" + f = PlainTextFormatter() + nt.assert_equal(f(pi), repr(pi)) + f.float_precision = 0 + if numpy: + po = numpy.get_printoptions() + nt.assert_equal(po['precision'], 0) + nt.assert_equal(f(pi), '3') + f.float_precision = 2 + if numpy: + po = numpy.get_printoptions() + nt.assert_equal(po['precision'], 2) + nt.assert_equal(f(pi), '3.14') + f.float_precision = '%g' + if numpy: + po = numpy.get_printoptions() + nt.assert_equal(po['precision'], 2) + nt.assert_equal(f(pi), '3.14159') + f.float_precision = '%e' + nt.assert_equal(f(pi), '3.141593e+00') + f.float_precision = '' + if numpy: + po = numpy.get_printoptions() + nt.assert_equal(po['precision'], 8) + nt.assert_equal(f(pi), repr(pi)) + +def test_bad_precision(): + """test various invalid values for float_precision.""" + f = PlainTextFormatter() + def set_fp(p): + f.float_precision=p + nt.assert_raises(ValueError, set_fp, '%') + nt.assert_raises(ValueError, set_fp, '%.3f%i') + nt.assert_raises(ValueError, set_fp, 'foo') + nt.assert_raises(ValueError, set_fp, -1) + +def test_for_type(): + f = PlainTextFormatter() + + # initial return, None + nt.assert_is(f.for_type(C, foo_printer), None) + # no func queries + nt.assert_is(f.for_type(C), foo_printer) + # shouldn't change anything + nt.assert_is(f.for_type(C), foo_printer) + # None should do the same + nt.assert_is(f.for_type(C, None), foo_printer) + nt.assert_is(f.for_type(C, None), foo_printer) + +def test_for_type_string(): + f = PlainTextFormatter() + + type_str = '%s.%s' % (C.__module__, 'C') + + # initial return, None + nt.assert_is(f.for_type(type_str, foo_printer), None) + # no func queries + nt.assert_is(f.for_type(type_str), foo_printer) + nt.assert_in(_mod_name_key(C), f.deferred_printers) + nt.assert_is(f.for_type(C), foo_printer) + nt.assert_not_in(_mod_name_key(C), f.deferred_printers) + nt.assert_in(C, f.type_printers) + +def test_for_type_by_name(): + f = PlainTextFormatter() + + mod = C.__module__ + + # initial return, None + nt.assert_is(f.for_type_by_name(mod, 'C', foo_printer), None) + # no func queries + nt.assert_is(f.for_type_by_name(mod, 'C'), foo_printer) + # shouldn't change anything + nt.assert_is(f.for_type_by_name(mod, 'C'), foo_printer) + # None should do the same + nt.assert_is(f.for_type_by_name(mod, 'C', None), foo_printer) + nt.assert_is(f.for_type_by_name(mod, 'C', None), foo_printer) + +def test_lookup(): + f = PlainTextFormatter() + + f.for_type(C, foo_printer) + nt.assert_is(f.lookup(C()), foo_printer) + with nt.assert_raises(KeyError): + f.lookup(A()) + +def test_lookup_string(): + f = PlainTextFormatter() + type_str = '%s.%s' % (C.__module__, 'C') + + f.for_type(type_str, foo_printer) + nt.assert_is(f.lookup(C()), foo_printer) + # should move from deferred to imported dict + nt.assert_not_in(_mod_name_key(C), f.deferred_printers) + nt.assert_in(C, f.type_printers) + +def test_lookup_by_type(): + f = PlainTextFormatter() + f.for_type(C, foo_printer) + nt.assert_is(f.lookup_by_type(C), foo_printer) + with nt.assert_raises(KeyError): + f.lookup_by_type(A) + +def test_lookup_by_type_string(): + f = PlainTextFormatter() + type_str = '%s.%s' % (C.__module__, 'C') + f.for_type(type_str, foo_printer) + + # verify insertion + nt.assert_in(_mod_name_key(C), f.deferred_printers) + nt.assert_not_in(C, f.type_printers) + + nt.assert_is(f.lookup_by_type(type_str), foo_printer) + # lookup by string doesn't cause import + nt.assert_in(_mod_name_key(C), f.deferred_printers) + nt.assert_not_in(C, f.type_printers) + + nt.assert_is(f.lookup_by_type(C), foo_printer) + # should move from deferred to imported dict + nt.assert_not_in(_mod_name_key(C), f.deferred_printers) + nt.assert_in(C, f.type_printers) + +def test_in_formatter(): + f = PlainTextFormatter() + f.for_type(C, foo_printer) + type_str = '%s.%s' % (C.__module__, 'C') + nt.assert_in(C, f) + nt.assert_in(type_str, f) + +def test_string_in_formatter(): + f = PlainTextFormatter() + type_str = '%s.%s' % (C.__module__, 'C') + f.for_type(type_str, foo_printer) + nt.assert_in(type_str, f) + nt.assert_in(C, f) + +def test_pop(): + f = PlainTextFormatter() + f.for_type(C, foo_printer) + nt.assert_is(f.lookup_by_type(C), foo_printer) + nt.assert_is(f.pop(C, None), foo_printer) + f.for_type(C, foo_printer) + nt.assert_is(f.pop(C), foo_printer) + with nt.assert_raises(KeyError): + f.lookup_by_type(C) + with nt.assert_raises(KeyError): + f.pop(C) + with nt.assert_raises(KeyError): + f.pop(A) + nt.assert_is(f.pop(A, None), None) + +def test_pop_string(): + f = PlainTextFormatter() + type_str = '%s.%s' % (C.__module__, 'C') + + with nt.assert_raises(KeyError): + f.pop(type_str) + + f.for_type(type_str, foo_printer) + f.pop(type_str) + with nt.assert_raises(KeyError): + f.lookup_by_type(C) + with nt.assert_raises(KeyError): + f.pop(type_str) + + f.for_type(C, foo_printer) + nt.assert_is(f.pop(type_str, None), foo_printer) + with nt.assert_raises(KeyError): + f.lookup_by_type(C) + with nt.assert_raises(KeyError): + f.pop(type_str) + nt.assert_is(f.pop(type_str, None), None) + + +def test_error_method(): + f = HTMLFormatter() + class BadHTML(object): + def _repr_html_(self): + raise ValueError("Bad HTML") + bad = BadHTML() + with capture_output() as captured: + result = f(bad) + nt.assert_is(result, None) + nt.assert_in("Traceback", captured.stdout) + nt.assert_in("Bad HTML", captured.stdout) + nt.assert_in("_repr_html_", captured.stdout) + +def test_nowarn_notimplemented(): + f = HTMLFormatter() + class HTMLNotImplemented(object): + def _repr_html_(self): + raise NotImplementedError + h = HTMLNotImplemented() + with capture_output() as captured: + result = f(h) + nt.assert_is(result, None) + nt.assert_equal("", captured.stderr) + nt.assert_equal("", captured.stdout) + +def test_warn_error_for_type(): + f = HTMLFormatter() + f.for_type(int, lambda i: name_error) + with capture_output() as captured: + result = f(5) + nt.assert_is(result, None) + nt.assert_in("Traceback", captured.stdout) + nt.assert_in("NameError", captured.stdout) + nt.assert_in("name_error", captured.stdout) + +def test_error_pretty_method(): + f = PlainTextFormatter() + class BadPretty(object): + def _repr_pretty_(self): + return "hello" + bad = BadPretty() + with capture_output() as captured: + result = f(bad) + nt.assert_is(result, None) + nt.assert_in("Traceback", captured.stdout) + nt.assert_in("_repr_pretty_", captured.stdout) + nt.assert_in("given", captured.stdout) + nt.assert_in("argument", captured.stdout) + + +def test_bad_repr_traceback(): + f = PlainTextFormatter() + bad = BadRepr() + with capture_output() as captured: + result = f(bad) + # catches error, returns None + nt.assert_is(result, None) + nt.assert_in("Traceback", captured.stdout) + nt.assert_in("__repr__", captured.stdout) + nt.assert_in("ValueError", captured.stdout) + + +class MakePDF(object): + def _repr_pdf_(self): + return 'PDF' + +def test_pdf_formatter(): + pdf = MakePDF() + f = PDFFormatter() + nt.assert_equal(f(pdf), 'PDF') + +def test_print_method_bound(): + f = HTMLFormatter() + class MyHTML(object): + def _repr_html_(self): + return "hello" + with capture_output() as captured: + result = f(MyHTML) + nt.assert_is(result, None) + nt.assert_not_in("FormatterWarning", captured.stderr) + + with capture_output() as captured: + result = f(MyHTML()) + nt.assert_equal(result, "hello") + nt.assert_equal(captured.stderr, "") + +def test_print_method_weird(): + + class TextMagicHat(object): + def __getattr__(self, key): + return key + + f = HTMLFormatter() + + text_hat = TextMagicHat() + nt.assert_equal(text_hat._repr_html_, '_repr_html_') + with capture_output() as captured: + result = f(text_hat) + + nt.assert_is(result, None) + nt.assert_not_in("FormatterWarning", captured.stderr) + + class CallableMagicHat(object): + def __getattr__(self, key): + return lambda : key + + call_hat = CallableMagicHat() + with capture_output() as captured: + result = f(call_hat) + + nt.assert_equal(result, None) + + class BadReprArgs(object): + def _repr_html_(self, extra, args): + return "html" + + bad = BadReprArgs() + with capture_output() as captured: + result = f(bad) + + nt.assert_is(result, None) + nt.assert_not_in("FormatterWarning", captured.stderr) + + +def test_format_config(): + """config objects don't pretend to support fancy reprs with lazy attrs""" + f = HTMLFormatter() + cfg = Config() + with capture_output() as captured: + result = f(cfg) + nt.assert_is(result, None) + nt.assert_equal(captured.stderr, "") + + with capture_output() as captured: + result = f(Config) + nt.assert_is(result, None) + nt.assert_equal(captured.stderr, "") + +def test_pretty_max_seq_length(): + f = PlainTextFormatter(max_seq_length=1) + lis = list(range(3)) + text = f(lis) + nt.assert_equal(text, '[0, ...]') + f.max_seq_length = 0 + text = f(lis) + nt.assert_equal(text, '[0, 1, 2]') + text = f(list(range(1024))) + lines = text.splitlines() + nt.assert_equal(len(lines), 1024) + + +def test_ipython_display_formatter(): + """Objects with _ipython_display_ defined bypass other formatters""" + f = get_ipython().display_formatter + catcher = [] + class SelfDisplaying(object): + def _ipython_display_(self): + catcher.append(self) + + class NotSelfDisplaying(object): + def __repr__(self): + return "NotSelfDisplaying" + + def _ipython_display_(self): + raise NotImplementedError + + save_enabled = f.ipython_display_formatter.enabled + f.ipython_display_formatter.enabled = True + + yes = SelfDisplaying() + no = NotSelfDisplaying() + + d, md = f.format(no) + nt.assert_equal(d, {'text/plain': repr(no)}) + nt.assert_equal(md, {}) + nt.assert_equal(catcher, []) + + d, md = f.format(yes) + nt.assert_equal(d, {}) + nt.assert_equal(md, {}) + nt.assert_equal(catcher, [yes]) + + f.ipython_display_formatter.enabled = save_enabled + + +def test_json_as_string_deprecated(): + class JSONString(object): + def _repr_json_(self): + return '{}' + + f = JSONFormatter() + with warnings.catch_warnings(record=True) as w: + d = f(JSONString()) + nt.assert_equal(d, {}) + nt.assert_equal(len(w), 1) + + +def test_repr_mime(): + class HasReprMime(object): + def _repr_mimebundle_(self, include=None, exclude=None): + return { + 'application/json+test.v2': { + 'x': 'y' + }, + 'plain/text' : '', + 'image/png' : 'i-overwrite' + } + + def _repr_png_(self): + return 'should-be-overwritten' + def _repr_html_(self): + return 'hi!' + + f = get_ipython().display_formatter + html_f = f.formatters['text/html'] + save_enabled = html_f.enabled + html_f.enabled = True + obj = HasReprMime() + d, md = f.format(obj) + html_f.enabled = save_enabled + + nt.assert_equal(sorted(d), ['application/json+test.v2', + 'image/png', + 'plain/text', + 'text/html', + 'text/plain']) + nt.assert_equal(md, {}) + + d, md = f.format(obj, include={'image/png'}) + nt.assert_equal(list(d.keys()), ['image/png'], + 'Include should filter out even things from repr_mimebundle') + nt.assert_equal(d['image/png'], 'i-overwrite', '_repr_mimebundle_ take precedence') + + + +def test_pass_correct_include_exclude(): + class Tester(object): + + def __init__(self, include=None, exclude=None): + self.include = include + self.exclude = exclude + + def _repr_mimebundle_(self, include, exclude, **kwargs): + if include and (include != self.include): + raise ValueError('include got modified: display() may be broken.') + if exclude and (exclude != self.exclude): + raise ValueError('exclude got modified: display() may be broken.') + + return None + + include = {'a', 'b', 'c'} + exclude = {'c', 'e' , 'f'} + + f = get_ipython().display_formatter + f.format(Tester(include=include, exclude=exclude), include=include, exclude=exclude) + f.format(Tester(exclude=exclude), exclude=exclude) + f.format(Tester(include=include), include=include) + + +def test_repr_mime_meta(): + class HasReprMimeMeta(object): + def _repr_mimebundle_(self, include=None, exclude=None): + data = { + 'image/png': 'base64-image-data', + } + metadata = { + 'image/png': { + 'width': 5, + 'height': 10, + } + } + return (data, metadata) + + f = get_ipython().display_formatter + obj = HasReprMimeMeta() + d, md = f.format(obj) + nt.assert_equal(sorted(d), ['image/png', 'text/plain']) + nt.assert_equal(md, { + 'image/png': { + 'width': 5, + 'height': 10, + } + }) + +def test_repr_mime_failure(): + class BadReprMime(object): + def _repr_mimebundle_(self, include=None, exclude=None): + raise RuntimeError + + f = get_ipython().display_formatter + obj = BadReprMime() + d, md = f.format(obj) + nt.assert_in('text/plain', d) diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_handlers.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_handlers.py new file mode 100644 index 00000000..19248177 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_handlers.py @@ -0,0 +1,94 @@ +"""Tests for input handlers. +""" +#----------------------------------------------------------------------------- +# Module imports +#----------------------------------------------------------------------------- + +# third party +import nose.tools as nt + +# our own packages +from IPython.core import autocall +from IPython.testing import tools as tt + +#----------------------------------------------------------------------------- +# Globals +#----------------------------------------------------------------------------- + +# Get the public instance of IPython + +failures = [] +num_tests = 0 + +#----------------------------------------------------------------------------- +# Test functions +#----------------------------------------------------------------------------- + +class CallableIndexable(object): + def __getitem__(self, idx): return True + def __call__(self, *args, **kws): return True + + +class Autocallable(autocall.IPyAutocall): + def __call__(self): + return "called" + + +def run(tests): + """Loop through a list of (pre, post) inputs, where pre is the string + handed to ipython, and post is how that string looks after it's been + transformed (i.e. ipython's notion of _i)""" + tt.check_pairs(ip.prefilter_manager.prefilter_lines, tests) + + +def test_handlers(): + call_idx = CallableIndexable() + ip.user_ns['call_idx'] = call_idx + + # For many of the below, we're also checking that leading whitespace + # turns off the esc char, which it should unless there is a continuation + # line. + run( + [('"no change"', '"no change"'), # normal + (u"lsmagic", "get_ipython().run_line_magic('lsmagic', '')"), # magic + #("a = b # PYTHON-MODE", '_i'), # emacs -- avoids _in cache + ]) + + # Objects which are instances of IPyAutocall are *always* autocalled + autocallable = Autocallable() + ip.user_ns['autocallable'] = autocallable + + # auto + ip.magic('autocall 0') + # Only explicit escapes or instances of IPyAutocallable should get + # expanded + run([ + ('len "abc"', 'len "abc"'), + ('autocallable', 'autocallable()'), + # Don't add extra brackets (gh-1117) + ('autocallable()', 'autocallable()'), + ]) + ip.magic('autocall 1') + run([ + ('len "abc"', 'len("abc")'), + ('len "abc";', 'len("abc");'), # ; is special -- moves out of parens + # Autocall is turned off if first arg is [] and the object + # is both callable and indexable. Like so: + ('len [1,2]', 'len([1,2])'), # len doesn't support __getitem__... + ('call_idx [1]', 'call_idx [1]'), # call_idx *does*.. + ('call_idx 1', 'call_idx(1)'), + ('len', 'len'), # only at 2 does it auto-call on single args + ]) + ip.magic('autocall 2') + run([ + ('len "abc"', 'len("abc")'), + ('len "abc";', 'len("abc");'), + ('len [1,2]', 'len([1,2])'), + ('call_idx [1]', 'call_idx [1]'), + ('call_idx 1', 'call_idx(1)'), + # This is what's different: + ('len', 'len()'), # only at 2 does it auto-call on single args + ]) + ip.magic('autocall 1') + + nt.assert_equal(failures, []) diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_history.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_history.py new file mode 100644 index 00000000..f4f080dc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_history.py @@ -0,0 +1,214 @@ +# coding: utf-8 +"""Tests for the IPython tab-completion machinery. +""" +#----------------------------------------------------------------------------- +# Module imports +#----------------------------------------------------------------------------- + +# stdlib +import io +import os +import sys +import tempfile +from datetime import datetime +import sqlite3 + +# third party +import nose.tools as nt + +# our own packages +from traitlets.config.loader import Config +from IPython.utils.tempdir import TemporaryDirectory +from IPython.core.history import HistoryManager, extract_hist_ranges +from IPython.testing.decorators import skipif + +def test_proper_default_encoding(): + nt.assert_equal(sys.getdefaultencoding(), "utf-8") + +@skipif(sqlite3.sqlite_version_info > (3,24,0)) +def test_history(): + ip = get_ipython() + with TemporaryDirectory() as tmpdir: + hist_manager_ori = ip.history_manager + hist_file = os.path.join(tmpdir, 'history.sqlite') + try: + ip.history_manager = HistoryManager(shell=ip, hist_file=hist_file) + hist = [u'a=1', u'def f():\n test = 1\n return test', u"b='€Æ¾÷ß'"] + for i, h in enumerate(hist, start=1): + ip.history_manager.store_inputs(i, h) + + ip.history_manager.db_log_output = True + # Doesn't match the input, but we'll just check it's stored. + ip.history_manager.output_hist_reprs[3] = "spam" + ip.history_manager.store_output(3) + + nt.assert_equal(ip.history_manager.input_hist_raw, [''] + hist) + + # Detailed tests for _get_range_session + grs = ip.history_manager._get_range_session + nt.assert_equal(list(grs(start=2,stop=-1)), list(zip([0], [2], hist[1:-1]))) + nt.assert_equal(list(grs(start=-2)), list(zip([0,0], [2,3], hist[-2:]))) + nt.assert_equal(list(grs(output=True)), list(zip([0,0,0], [1,2,3], zip(hist, [None,None,'spam'])))) + + # Check whether specifying a range beyond the end of the current + # session results in an error (gh-804) + ip.magic('%hist 2-500') + + # Check that we can write non-ascii characters to a file + ip.magic("%%hist -f %s" % os.path.join(tmpdir, "test1")) + ip.magic("%%hist -pf %s" % os.path.join(tmpdir, "test2")) + ip.magic("%%hist -nf %s" % os.path.join(tmpdir, "test3")) + ip.magic("%%save %s 1-10" % os.path.join(tmpdir, "test4")) + + # New session + ip.history_manager.reset() + newcmds = [u"z=5", + u"class X(object):\n pass", + u"k='p'", + u"z=5"] + for i, cmd in enumerate(newcmds, start=1): + ip.history_manager.store_inputs(i, cmd) + gothist = ip.history_manager.get_range(start=1, stop=4) + nt.assert_equal(list(gothist), list(zip([0,0,0],[1,2,3], newcmds))) + # Previous session: + gothist = ip.history_manager.get_range(-1, 1, 4) + nt.assert_equal(list(gothist), list(zip([1,1,1],[1,2,3], hist))) + + newhist = [(2, i, c) for (i, c) in enumerate(newcmds, 1)] + + # Check get_hist_tail + gothist = ip.history_manager.get_tail(5, output=True, + include_latest=True) + expected = [(1, 3, (hist[-1], "spam"))] \ + + [(s, n, (c, None)) for (s, n, c) in newhist] + nt.assert_equal(list(gothist), expected) + + gothist = ip.history_manager.get_tail(2) + expected = newhist[-3:-1] + nt.assert_equal(list(gothist), expected) + + # Check get_hist_search + + gothist = ip.history_manager.search("*test*") + nt.assert_equal(list(gothist), [(1,2,hist[1])] ) + + gothist = ip.history_manager.search("*=*") + nt.assert_equal(list(gothist), + [(1, 1, hist[0]), + (1, 2, hist[1]), + (1, 3, hist[2]), + newhist[0], + newhist[2], + newhist[3]]) + + gothist = ip.history_manager.search("*=*", n=4) + nt.assert_equal(list(gothist), + [(1, 3, hist[2]), + newhist[0], + newhist[2], + newhist[3]]) + + gothist = ip.history_manager.search("*=*", unique=True) + nt.assert_equal(list(gothist), + [(1, 1, hist[0]), + (1, 2, hist[1]), + (1, 3, hist[2]), + newhist[2], + newhist[3]]) + + gothist = ip.history_manager.search("*=*", unique=True, n=3) + nt.assert_equal(list(gothist), + [(1, 3, hist[2]), + newhist[2], + newhist[3]]) + + gothist = ip.history_manager.search("b*", output=True) + nt.assert_equal(list(gothist), [(1,3,(hist[2],"spam"))] ) + + # Cross testing: check that magic %save can get previous session. + testfilename = os.path.realpath(os.path.join(tmpdir, "test.py")) + ip.magic("save " + testfilename + " ~1/1-3") + with io.open(testfilename, encoding='utf-8') as testfile: + nt.assert_equal(testfile.read(), + u"# coding: utf-8\n" + u"\n".join(hist)+u"\n") + + # Duplicate line numbers - check that it doesn't crash, and + # gets a new session + ip.history_manager.store_inputs(1, "rogue") + ip.history_manager.writeout_cache() + nt.assert_equal(ip.history_manager.session_number, 3) + finally: + # Ensure saving thread is shut down before we try to clean up the files + ip.history_manager.save_thread.stop() + # Forcibly close database rather than relying on garbage collection + ip.history_manager.db.close() + # Restore history manager + ip.history_manager = hist_manager_ori + + +def test_extract_hist_ranges(): + instr = "1 2/3 ~4/5-6 ~4/7-~4/9 ~9/2-~7/5 ~10/" + expected = [(0, 1, 2), # 0 == current session + (2, 3, 4), + (-4, 5, 7), + (-4, 7, 10), + (-9, 2, None), # None == to end + (-8, 1, None), + (-7, 1, 6), + (-10, 1, None)] + actual = list(extract_hist_ranges(instr)) + nt.assert_equal(actual, expected) + +def test_magic_rerun(): + """Simple test for %rerun (no args -> rerun last line)""" + ip = get_ipython() + ip.run_cell("a = 10", store_history=True) + ip.run_cell("a += 1", store_history=True) + nt.assert_equal(ip.user_ns["a"], 11) + ip.run_cell("%rerun", store_history=True) + nt.assert_equal(ip.user_ns["a"], 12) + +def test_timestamp_type(): + ip = get_ipython() + info = ip.history_manager.get_session_info() + nt.assert_true(isinstance(info[1], datetime)) + +def test_hist_file_config(): + cfg = Config() + tfile = tempfile.NamedTemporaryFile(delete=False) + cfg.HistoryManager.hist_file = tfile.name + try: + hm = HistoryManager(shell=get_ipython(), config=cfg) + nt.assert_equal(hm.hist_file, cfg.HistoryManager.hist_file) + finally: + try: + os.remove(tfile.name) + except OSError: + # same catch as in testing.tools.TempFileMixin + # On Windows, even though we close the file, we still can't + # delete it. I have no clue why + pass + +def test_histmanager_disabled(): + """Ensure that disabling the history manager doesn't create a database.""" + cfg = Config() + cfg.HistoryAccessor.enabled = False + + ip = get_ipython() + with TemporaryDirectory() as tmpdir: + hist_manager_ori = ip.history_manager + hist_file = os.path.join(tmpdir, 'history.sqlite') + cfg.HistoryManager.hist_file = hist_file + try: + ip.history_manager = HistoryManager(shell=ip, config=cfg) + hist = [u'a=1', u'def f():\n test = 1\n return test', u"b='€Æ¾÷ß'"] + for i, h in enumerate(hist, start=1): + ip.history_manager.store_inputs(i, h) + nt.assert_equal(ip.history_manager.input_hist_raw, [''] + hist) + ip.history_manager.reset() + ip.history_manager.end_session() + finally: + ip.history_manager = hist_manager_ori + + # hist_file should not be created + nt.assert_false(os.path.exists(hist_file)) diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_hooks.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_hooks.py new file mode 100644 index 00000000..35d3f315 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_hooks.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +"""Tests for CommandChainDispatcher.""" + + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +import nose.tools as nt +from IPython.core.error import TryNext +from IPython.core.hooks import CommandChainDispatcher + +#----------------------------------------------------------------------------- +# Local utilities +#----------------------------------------------------------------------------- + +# Define two classes, one which succeeds and one which raises TryNext. Each +# sets the attribute `called` to True when it is called. +class Okay(object): + def __init__(self, message): + self.message = message + self.called = False + def __call__(self): + self.called = True + return self.message + +class Fail(object): + def __init__(self, message): + self.message = message + self.called = False + def __call__(self): + self.called = True + raise TryNext(self.message) + +#----------------------------------------------------------------------------- +# Test functions +#----------------------------------------------------------------------------- + +def test_command_chain_dispatcher_ff(): + """Test two failing hooks""" + fail1 = Fail(u'fail1') + fail2 = Fail(u'fail2') + dp = CommandChainDispatcher([(0, fail1), + (10, fail2)]) + + try: + dp() + except TryNext as e: + nt.assert_equal(str(e), u'fail2') + else: + assert False, "Expected exception was not raised." + + nt.assert_true(fail1.called) + nt.assert_true(fail2.called) + +def test_command_chain_dispatcher_fofo(): + """Test a mixture of failing and succeeding hooks.""" + fail1 = Fail(u'fail1') + fail2 = Fail(u'fail2') + okay1 = Okay(u'okay1') + okay2 = Okay(u'okay2') + + dp = CommandChainDispatcher([(0, fail1), + # (5, okay1), # add this later + (10, fail2), + (15, okay2)]) + dp.add(okay1, 5) + + nt.assert_equal(dp(), u'okay1') + + nt.assert_true(fail1.called) + nt.assert_true(okay1.called) + nt.assert_false(fail2.called) + nt.assert_false(okay2.called) + +def test_command_chain_dispatcher_eq_priority(): + okay1 = Okay(u'okay1') + okay2 = Okay(u'okay2') + dp = CommandChainDispatcher([(1, okay1)]) + dp.add(okay2, 1) diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_imports.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_imports.py new file mode 100644 index 00000000..7aa278fb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_imports.py @@ -0,0 +1,52 @@ +# encoding: utf-8 + +def test_import_completer(): + from IPython.core import completer + +def test_import_crashhandler(): + from IPython.core import crashhandler + +def test_import_debugger(): + from IPython.core import debugger + +def test_import_excolors(): + from IPython.core import excolors + +def test_import_history(): + from IPython.core import history + +def test_import_hooks(): + from IPython.core import hooks + +def test_import_getipython(): + from IPython.core import getipython + +def test_import_interactiveshell(): + from IPython.core import interactiveshell + +def test_import_logger(): + from IPython.core import logger + +def test_import_macro(): + from IPython.core import macro + +def test_import_magic(): + from IPython.core import magic + +def test_import_oinspect(): + from IPython.core import oinspect + +def test_import_prefilter(): + from IPython.core import prefilter + +def test_import_prompts(): + from IPython.core import prompts + +def test_import_release(): + from IPython.core import release + +def test_import_ultratb(): + from IPython.core import ultratb + +def test_import_usage(): + from IPython.core import usage diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_inputsplitter.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_inputsplitter.py new file mode 100644 index 00000000..a39943ae --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_inputsplitter.py @@ -0,0 +1,639 @@ +# -*- coding: utf-8 -*- +"""Tests for the inputsplitter module.""" + + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +import unittest +import sys + +import nose.tools as nt + +from IPython.core import inputsplitter as isp +from IPython.core.inputtransformer import InputTransformer +from IPython.core.tests.test_inputtransformer import syntax, syntax_ml +from IPython.testing import tools as tt + +#----------------------------------------------------------------------------- +# Semi-complete examples (also used as tests) +#----------------------------------------------------------------------------- + +# Note: at the bottom, there's a slightly more complete version of this that +# can be useful during development of code here. + +def mini_interactive_loop(input_func): + """Minimal example of the logic of an interactive interpreter loop. + + This serves as an example, and it is used by the test system with a fake + raw_input that simulates interactive input.""" + + from IPython.core.inputsplitter import InputSplitter + + isp = InputSplitter() + # In practice, this input loop would be wrapped in an outside loop to read + # input indefinitely, until some exit/quit command was issued. Here we + # only illustrate the basic inner loop. + while isp.push_accepts_more(): + indent = ' '*isp.get_indent_spaces() + prompt = '>>> ' + indent + line = indent + input_func(prompt) + isp.push(line) + + # Here we just return input so we can use it in a test suite, but a real + # interpreter would instead send it for execution somewhere. + src = isp.source_reset() + #print 'Input source was:\n', src # dbg + return src + +#----------------------------------------------------------------------------- +# Test utilities, just for local use +#----------------------------------------------------------------------------- + +def assemble(block): + """Assemble a block into multi-line sub-blocks.""" + return ['\n'.join(sub_block)+'\n' for sub_block in block] + + +def pseudo_input(lines): + """Return a function that acts like raw_input but feeds the input list.""" + ilines = iter(lines) + def raw_in(prompt): + try: + return next(ilines) + except StopIteration: + return '' + return raw_in + +#----------------------------------------------------------------------------- +# Tests +#----------------------------------------------------------------------------- +def test_spaces(): + tests = [('', 0), + (' ', 1), + ('\n', 0), + (' \n', 1), + ('x', 0), + (' x', 1), + (' x',2), + (' x',4), + # Note: tabs are counted as a single whitespace! + ('\tx', 1), + ('\t x', 2), + ] + tt.check_pairs(isp.num_ini_spaces, tests) + + +def test_remove_comments(): + tests = [('text', 'text'), + ('text # comment', 'text '), + ('text # comment\n', 'text \n'), + ('text # comment \n', 'text \n'), + ('line # c \nline\n','line \nline\n'), + ('line # c \nline#c2 \nline\nline #c\n\n', + 'line \nline\nline\nline \n\n'), + ] + tt.check_pairs(isp.remove_comments, tests) + + +def test_get_input_encoding(): + encoding = isp.get_input_encoding() + nt.assert_true(isinstance(encoding, str)) + # simple-minded check that at least encoding a simple string works with the + # encoding we got. + nt.assert_equal(u'test'.encode(encoding), b'test') + + +class NoInputEncodingTestCase(unittest.TestCase): + def setUp(self): + self.old_stdin = sys.stdin + class X: pass + fake_stdin = X() + sys.stdin = fake_stdin + + def test(self): + # Verify that if sys.stdin has no 'encoding' attribute we do the right + # thing + enc = isp.get_input_encoding() + self.assertEqual(enc, 'ascii') + + def tearDown(self): + sys.stdin = self.old_stdin + + +class InputSplitterTestCase(unittest.TestCase): + def setUp(self): + self.isp = isp.InputSplitter() + + def test_reset(self): + isp = self.isp + isp.push('x=1') + isp.reset() + self.assertEqual(isp._buffer, []) + self.assertEqual(isp.get_indent_spaces(), 0) + self.assertEqual(isp.source, '') + self.assertEqual(isp.code, None) + self.assertEqual(isp._is_complete, False) + + def test_source(self): + self.isp._store('1') + self.isp._store('2') + self.assertEqual(self.isp.source, '1\n2\n') + self.assertEqual(len(self.isp._buffer)>0, True) + self.assertEqual(self.isp.source_reset(), '1\n2\n') + self.assertEqual(self.isp._buffer, []) + self.assertEqual(self.isp.source, '') + + def test_indent(self): + isp = self.isp # shorthand + isp.push('x=1') + self.assertEqual(isp.get_indent_spaces(), 0) + isp.push('if 1:\n x=1') + self.assertEqual(isp.get_indent_spaces(), 4) + isp.push('y=2\n') + self.assertEqual(isp.get_indent_spaces(), 0) + + def test_indent2(self): + isp = self.isp + isp.push('if 1:') + self.assertEqual(isp.get_indent_spaces(), 4) + isp.push(' x=1') + self.assertEqual(isp.get_indent_spaces(), 4) + # Blank lines shouldn't change the indent level + isp.push(' '*2) + self.assertEqual(isp.get_indent_spaces(), 4) + + def test_indent3(self): + isp = self.isp + # When a multiline statement contains parens or multiline strings, we + # shouldn't get confused. + isp.push("if 1:") + isp.push(" x = (1+\n 2)") + self.assertEqual(isp.get_indent_spaces(), 4) + + def test_indent4(self): + isp = self.isp + # whitespace after ':' should not screw up indent level + isp.push('if 1: \n x=1') + self.assertEqual(isp.get_indent_spaces(), 4) + isp.push('y=2\n') + self.assertEqual(isp.get_indent_spaces(), 0) + isp.push('if 1:\t\n x=1') + self.assertEqual(isp.get_indent_spaces(), 4) + isp.push('y=2\n') + self.assertEqual(isp.get_indent_spaces(), 0) + + def test_dedent_pass(self): + isp = self.isp # shorthand + # should NOT cause dedent + isp.push('if 1:\n passes = 5') + self.assertEqual(isp.get_indent_spaces(), 4) + isp.push('if 1:\n pass') + self.assertEqual(isp.get_indent_spaces(), 0) + isp.push('if 1:\n pass ') + self.assertEqual(isp.get_indent_spaces(), 0) + + def test_dedent_break(self): + isp = self.isp # shorthand + # should NOT cause dedent + isp.push('while 1:\n breaks = 5') + self.assertEqual(isp.get_indent_spaces(), 4) + isp.push('while 1:\n break') + self.assertEqual(isp.get_indent_spaces(), 0) + isp.push('while 1:\n break ') + self.assertEqual(isp.get_indent_spaces(), 0) + + def test_dedent_continue(self): + isp = self.isp # shorthand + # should NOT cause dedent + isp.push('while 1:\n continues = 5') + self.assertEqual(isp.get_indent_spaces(), 4) + isp.push('while 1:\n continue') + self.assertEqual(isp.get_indent_spaces(), 0) + isp.push('while 1:\n continue ') + self.assertEqual(isp.get_indent_spaces(), 0) + + def test_dedent_raise(self): + isp = self.isp # shorthand + # should NOT cause dedent + isp.push('if 1:\n raised = 4') + self.assertEqual(isp.get_indent_spaces(), 4) + isp.push('if 1:\n raise TypeError()') + self.assertEqual(isp.get_indent_spaces(), 0) + isp.push('if 1:\n raise') + self.assertEqual(isp.get_indent_spaces(), 0) + isp.push('if 1:\n raise ') + self.assertEqual(isp.get_indent_spaces(), 0) + + def test_dedent_return(self): + isp = self.isp # shorthand + # should NOT cause dedent + isp.push('if 1:\n returning = 4') + self.assertEqual(isp.get_indent_spaces(), 4) + isp.push('if 1:\n return 5 + 493') + self.assertEqual(isp.get_indent_spaces(), 0) + isp.push('if 1:\n return') + self.assertEqual(isp.get_indent_spaces(), 0) + isp.push('if 1:\n return ') + self.assertEqual(isp.get_indent_spaces(), 0) + isp.push('if 1:\n return(0)') + self.assertEqual(isp.get_indent_spaces(), 0) + + def test_push(self): + isp = self.isp + self.assertEqual(isp.push('x=1'), True) + + def test_push2(self): + isp = self.isp + self.assertEqual(isp.push('if 1:'), False) + for line in [' x=1', '# a comment', ' y=2']: + print(line) + self.assertEqual(isp.push(line), True) + + def test_push3(self): + isp = self.isp + isp.push('if True:') + isp.push(' a = 1') + self.assertEqual(isp.push('b = [1,'), False) + + def test_push_accepts_more(self): + isp = self.isp + isp.push('x=1') + self.assertEqual(isp.push_accepts_more(), False) + + def test_push_accepts_more2(self): + isp = self.isp + isp.push('if 1:') + self.assertEqual(isp.push_accepts_more(), True) + isp.push(' x=1') + self.assertEqual(isp.push_accepts_more(), True) + isp.push('') + self.assertEqual(isp.push_accepts_more(), False) + + def test_push_accepts_more3(self): + isp = self.isp + isp.push("x = (2+\n3)") + self.assertEqual(isp.push_accepts_more(), False) + + def test_push_accepts_more4(self): + isp = self.isp + # When a multiline statement contains parens or multiline strings, we + # shouldn't get confused. + # FIXME: we should be able to better handle de-dents in statements like + # multiline strings and multiline expressions (continued with \ or + # parens). Right now we aren't handling the indentation tracking quite + # correctly with this, though in practice it may not be too much of a + # problem. We'll need to see. + isp.push("if 1:") + isp.push(" x = (2+") + isp.push(" 3)") + self.assertEqual(isp.push_accepts_more(), True) + isp.push(" y = 3") + self.assertEqual(isp.push_accepts_more(), True) + isp.push('') + self.assertEqual(isp.push_accepts_more(), False) + + def test_push_accepts_more5(self): + isp = self.isp + isp.push('try:') + isp.push(' a = 5') + isp.push('except:') + isp.push(' raise') + # We want to be able to add an else: block at this point, so it should + # wait for a blank line. + self.assertEqual(isp.push_accepts_more(), True) + + def test_continuation(self): + isp = self.isp + isp.push("import os, \\") + self.assertEqual(isp.push_accepts_more(), True) + isp.push("sys") + self.assertEqual(isp.push_accepts_more(), False) + + def test_syntax_error(self): + isp = self.isp + # Syntax errors immediately produce a 'ready' block, so the invalid + # Python can be sent to the kernel for evaluation with possible ipython + # special-syntax conversion. + isp.push('run foo') + self.assertEqual(isp.push_accepts_more(), False) + + def test_unicode(self): + self.isp.push(u"Pérez") + self.isp.push(u'\xc3\xa9') + self.isp.push(u"u'\xc3\xa9'") + + def test_line_continuation(self): + """ Test issue #2108.""" + isp = self.isp + # A blank line after a line continuation should not accept more + isp.push("1 \\\n\n") + self.assertEqual(isp.push_accepts_more(), False) + # Whitespace after a \ is a SyntaxError. The only way to test that + # here is to test that push doesn't accept more (as with + # test_syntax_error() above). + isp.push(r"1 \ ") + self.assertEqual(isp.push_accepts_more(), False) + # Even if the line is continuable (c.f. the regular Python + # interpreter) + isp.push(r"(1 \ ") + self.assertEqual(isp.push_accepts_more(), False) + + def test_check_complete(self): + isp = self.isp + self.assertEqual(isp.check_complete("a = 1"), ('complete', None)) + self.assertEqual(isp.check_complete("for a in range(5):"), ('incomplete', 4)) + self.assertEqual(isp.check_complete("raise = 2"), ('invalid', None)) + self.assertEqual(isp.check_complete("a = [1,\n2,"), ('incomplete', 0)) + self.assertEqual(isp.check_complete("def a():\n x=1\n global x"), ('invalid', None)) + +class InteractiveLoopTestCase(unittest.TestCase): + """Tests for an interactive loop like a python shell. + """ + def check_ns(self, lines, ns): + """Validate that the given input lines produce the resulting namespace. + + Note: the input lines are given exactly as they would be typed in an + auto-indenting environment, as mini_interactive_loop above already does + auto-indenting and prepends spaces to the input. + """ + src = mini_interactive_loop(pseudo_input(lines)) + test_ns = {} + exec(src, test_ns) + # We can't check that the provided ns is identical to the test_ns, + # because Python fills test_ns with extra keys (copyright, etc). But + # we can check that the given dict is *contained* in test_ns + for k,v in ns.items(): + self.assertEqual(test_ns[k], v) + + def test_simple(self): + self.check_ns(['x=1'], dict(x=1)) + + def test_simple2(self): + self.check_ns(['if 1:', 'x=2'], dict(x=2)) + + def test_xy(self): + self.check_ns(['x=1; y=2'], dict(x=1, y=2)) + + def test_abc(self): + self.check_ns(['if 1:','a=1','b=2','c=3'], dict(a=1, b=2, c=3)) + + def test_multi(self): + self.check_ns(['x =(1+','1+','2)'], dict(x=4)) + + +class IPythonInputTestCase(InputSplitterTestCase): + """By just creating a new class whose .isp is a different instance, we + re-run the same test battery on the new input splitter. + + In addition, this runs the tests over the syntax and syntax_ml dicts that + were tested by individual functions, as part of the OO interface. + + It also makes some checks on the raw buffer storage. + """ + + def setUp(self): + self.isp = isp.IPythonInputSplitter() + + def test_syntax(self): + """Call all single-line syntax tests from the main object""" + isp = self.isp + for example in syntax.values(): + for raw, out_t in example: + if raw.startswith(' '): + continue + + isp.push(raw+'\n') + out_raw = isp.source_raw + out = isp.source_reset() + self.assertEqual(out.rstrip(), out_t, + tt.pair_fail_msg.format("inputsplitter",raw, out_t, out)) + self.assertEqual(out_raw.rstrip(), raw.rstrip()) + + def test_syntax_multiline(self): + isp = self.isp + for example in syntax_ml.values(): + for line_pairs in example: + out_t_parts = [] + raw_parts = [] + for lraw, out_t_part in line_pairs: + if out_t_part is not None: + out_t_parts.append(out_t_part) + + if lraw is not None: + isp.push(lraw) + raw_parts.append(lraw) + + out_raw = isp.source_raw + out = isp.source_reset() + out_t = '\n'.join(out_t_parts).rstrip() + raw = '\n'.join(raw_parts).rstrip() + self.assertEqual(out.rstrip(), out_t) + self.assertEqual(out_raw.rstrip(), raw) + + def test_syntax_multiline_cell(self): + isp = self.isp + for example in syntax_ml.values(): + + out_t_parts = [] + for line_pairs in example: + raw = '\n'.join(r for r, _ in line_pairs if r is not None) + out_t = '\n'.join(t for _,t in line_pairs if t is not None) + out = isp.transform_cell(raw) + # Match ignoring trailing whitespace + self.assertEqual(out.rstrip(), out_t.rstrip()) + + def test_cellmagic_preempt(self): + isp = self.isp + for raw, name, line, cell in [ + ("%%cellm a\nIn[1]:", u'cellm', u'a', u'In[1]:'), + ("%%cellm \nline\n>>> hi", u'cellm', u'', u'line\n>>> hi'), + (">>> %%cellm \nline\n>>> hi", u'cellm', u'', u'line\nhi'), + ("%%cellm \n>>> hi", u'cellm', u'', u'>>> hi'), + ("%%cellm \nline1\nline2", u'cellm', u'', u'line1\nline2'), + ("%%cellm \nline1\\\\\nline2", u'cellm', u'', u'line1\\\\\nline2'), + ]: + expected = "get_ipython().run_cell_magic(%r, %r, %r)" % ( + name, line, cell + ) + out = isp.transform_cell(raw) + self.assertEqual(out.rstrip(), expected.rstrip()) + + def test_multiline_passthrough(self): + isp = self.isp + class CommentTransformer(InputTransformer): + def __init__(self): + self._lines = [] + + def push(self, line): + self._lines.append(line + '#') + + def reset(self): + text = '\n'.join(self._lines) + self._lines = [] + return text + + isp.physical_line_transforms.insert(0, CommentTransformer()) + + for raw, expected in [ + ("a=5", "a=5#"), + ("%ls foo", "get_ipython().run_line_magic(%r, %r)" % (u'ls', u'foo#')), + ("!ls foo\n%ls bar", "get_ipython().system(%r)\nget_ipython().run_line_magic(%r, %r)" % ( + u'ls foo#', u'ls', u'bar#' + )), + ("1\n2\n3\n%ls foo\n4\n5", "1#\n2#\n3#\nget_ipython().run_line_magic(%r, %r)\n4#\n5#" % (u'ls', u'foo#')), + ]: + out = isp.transform_cell(raw) + self.assertEqual(out.rstrip(), expected.rstrip()) + +#----------------------------------------------------------------------------- +# Main - use as a script, mostly for developer experiments +#----------------------------------------------------------------------------- + +if __name__ == '__main__': + # A simple demo for interactive experimentation. This code will not get + # picked up by any test suite. + from IPython.core.inputsplitter import IPythonInputSplitter + + # configure here the syntax to use, prompt and whether to autoindent + #isp, start_prompt = InputSplitter(), '>>> ' + isp, start_prompt = IPythonInputSplitter(), 'In> ' + + autoindent = True + #autoindent = False + + try: + while True: + prompt = start_prompt + while isp.push_accepts_more(): + indent = ' '*isp.get_indent_spaces() + if autoindent: + line = indent + input(prompt+indent) + else: + line = input(prompt) + isp.push(line) + prompt = '... ' + + # Here we just return input so we can use it in a test suite, but a + # real interpreter would instead send it for execution somewhere. + #src = isp.source; raise EOFError # dbg + raw = isp.source_raw + src = isp.source_reset() + print('Input source was:\n', src) + print('Raw source was:\n', raw) + except EOFError: + print('Bye') + +# Tests for cell magics support + +def test_last_blank(): + nt.assert_false(isp.last_blank('')) + nt.assert_false(isp.last_blank('abc')) + nt.assert_false(isp.last_blank('abc\n')) + nt.assert_false(isp.last_blank('abc\na')) + + nt.assert_true(isp.last_blank('\n')) + nt.assert_true(isp.last_blank('\n ')) + nt.assert_true(isp.last_blank('abc\n ')) + nt.assert_true(isp.last_blank('abc\n\n')) + nt.assert_true(isp.last_blank('abc\nd\n\n')) + nt.assert_true(isp.last_blank('abc\nd\ne\n\n')) + nt.assert_true(isp.last_blank('abc \n \n \n\n')) + + +def test_last_two_blanks(): + nt.assert_false(isp.last_two_blanks('')) + nt.assert_false(isp.last_two_blanks('abc')) + nt.assert_false(isp.last_two_blanks('abc\n')) + nt.assert_false(isp.last_two_blanks('abc\n\na')) + nt.assert_false(isp.last_two_blanks('abc\n \n')) + nt.assert_false(isp.last_two_blanks('abc\n\n')) + + nt.assert_true(isp.last_two_blanks('\n\n')) + nt.assert_true(isp.last_two_blanks('\n\n ')) + nt.assert_true(isp.last_two_blanks('\n \n')) + nt.assert_true(isp.last_two_blanks('abc\n\n ')) + nt.assert_true(isp.last_two_blanks('abc\n\n\n')) + nt.assert_true(isp.last_two_blanks('abc\n\n \n')) + nt.assert_true(isp.last_two_blanks('abc\n\n \n ')) + nt.assert_true(isp.last_two_blanks('abc\n\n \n \n')) + nt.assert_true(isp.last_two_blanks('abc\nd\n\n\n')) + nt.assert_true(isp.last_two_blanks('abc\nd\ne\nf\n\n\n')) + + +class CellMagicsCommon(object): + + def test_whole_cell(self): + src = "%%cellm line\nbody\n" + out = self.sp.transform_cell(src) + ref = "get_ipython().run_cell_magic('cellm', 'line', 'body')\n" + nt.assert_equal(out, ref) + + def test_cellmagic_help(self): + self.sp.push('%%cellm?') + nt.assert_false(self.sp.push_accepts_more()) + + def tearDown(self): + self.sp.reset() + + +class CellModeCellMagics(CellMagicsCommon, unittest.TestCase): + sp = isp.IPythonInputSplitter(line_input_checker=False) + + def test_incremental(self): + sp = self.sp + sp.push('%%cellm firstline\n') + nt.assert_true(sp.push_accepts_more()) #1 + sp.push('line2\n') + nt.assert_true(sp.push_accepts_more()) #2 + sp.push('\n') + # This should accept a blank line and carry on until the cell is reset + nt.assert_true(sp.push_accepts_more()) #3 + + def test_no_strip_coding(self): + src = '\n'.join([ + '%%writefile foo.py', + '# coding: utf-8', + 'print(u"üñîçø∂é")', + ]) + out = self.sp.transform_cell(src) + nt.assert_in('# coding: utf-8', out) + + +class LineModeCellMagics(CellMagicsCommon, unittest.TestCase): + sp = isp.IPythonInputSplitter(line_input_checker=True) + + def test_incremental(self): + sp = self.sp + sp.push('%%cellm line2\n') + nt.assert_true(sp.push_accepts_more()) #1 + sp.push('\n') + # In this case, a blank line should end the cell magic + nt.assert_false(sp.push_accepts_more()) #2 + +indentation_samples = [ + ('a = 1', 0), + ('for a in b:', 4), + ('def f():', 4), + ('def f(): #comment', 4), + ('a = ":#not a comment"', 0), + ('def f():\n a = 1', 4), + ('def f():\n return 1', 0), + ('for a in b:\n' + ' if a < 0:' + ' continue', 3), + ('a = {', 4), + ('a = {\n' + ' 1,', 5), + ('b = """123', 0), + ('', 0), + ('def f():\n pass', 0), + ('class Bar:\n def f():\n pass', 4), + ('class Bar:\n def f():\n raise', 4), +] + +def test_find_next_indent(): + for code, exp in indentation_samples: + res = isp.find_next_indent(code) + msg = "{!r} != {!r} (expected)\n Code: {!r}".format(res, exp, code) + assert res == exp, msg diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_inputtransformer.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_inputtransformer.py new file mode 100644 index 00000000..0d97fd4d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_inputtransformer.py @@ -0,0 +1,495 @@ +import tokenize +import nose.tools as nt + +from IPython.testing import tools as tt +from IPython.utils import py3compat +u_fmt = py3compat.u_format + +from IPython.core import inputtransformer as ipt + +def transform_and_reset(transformer): + transformer = transformer() + def transform(inp): + try: + return transformer.push(inp) + finally: + transformer.reset() + + return transform + +# Transformer tests +def transform_checker(tests, transformer, **kwargs): + """Utility to loop over test inputs""" + transformer = transformer(**kwargs) + try: + for inp, tr in tests: + if inp is None: + out = transformer.reset() + else: + out = transformer.push(inp) + nt.assert_equal(out, tr) + finally: + transformer.reset() + +# Data for all the syntax tests in the form of lists of pairs of +# raw/transformed input. We store it here as a global dict so that we can use +# it both within single-function tests and also to validate the behavior of the +# larger objects + +syntax = \ + dict(assign_system = + [(i,py3compat.u_format(o)) for i,o in \ + [(u'a =! ls', "a = get_ipython().getoutput('ls')"), + (u'b = !ls', "b = get_ipython().getoutput('ls')"), + (u'c= !ls', "c = get_ipython().getoutput('ls')"), + (u'd == !ls', u'd == !ls'), # Invalid syntax, but we leave == alone. + ('x=1', 'x=1'), # normal input is unmodified + (' ',' '), # blank lines are kept intact + # Tuple unpacking + (u"a, b = !echo 'a\\nb'", u"a, b = get_ipython().getoutput(\"echo 'a\\\\nb'\")"), + (u"a,= !echo 'a'", u"a, = get_ipython().getoutput(\"echo 'a'\")"), + (u"a, *bc = !echo 'a\\nb\\nc'", u"a, *bc = get_ipython().getoutput(\"echo 'a\\\\nb\\\\nc'\")"), + # Tuple unpacking with regular Python expressions, not our syntax. + (u"a, b = range(2)", u"a, b = range(2)"), + (u"a, = range(1)", u"a, = range(1)"), + (u"a, *bc = range(3)", u"a, *bc = range(3)"), + ]], + + assign_magic = + [(i,py3compat.u_format(o)) for i,o in \ + [(u'a =% who', "a = get_ipython().run_line_magic('who', '')"), + (u'b = %who', "b = get_ipython().run_line_magic('who', '')"), + (u'c= %ls', "c = get_ipython().run_line_magic('ls', '')"), + (u'd == %ls', u'd == %ls'), # Invalid syntax, but we leave == alone. + ('x=1', 'x=1'), # normal input is unmodified + (' ',' '), # blank lines are kept intact + (u"a, b = %foo", u"a, b = get_ipython().run_line_magic('foo', '')"), + ]], + + classic_prompt = + [('>>> x=1', 'x=1'), + ('x=1', 'x=1'), # normal input is unmodified + (' ', ' '), # blank lines are kept intact + ], + + ipy_prompt = + [('In [1]: x=1', 'x=1'), + ('x=1', 'x=1'), # normal input is unmodified + (' ',' '), # blank lines are kept intact + ], + + # Tests for the escape transformer to leave normal code alone + escaped_noesc = + [ (' ', ' '), + ('x=1', 'x=1'), + ], + + # System calls + escaped_shell = + [(i,py3compat.u_format(o)) for i,o in \ + [ (u'!ls', "get_ipython().system('ls')"), + # Double-escape shell, this means to capture the output of the + # subprocess and return it + (u'!!ls', "get_ipython().getoutput('ls')"), + ]], + + # Help/object info + escaped_help = + [(i,py3compat.u_format(o)) for i,o in \ + [ (u'?', 'get_ipython().show_usage()'), + (u'?x1', "get_ipython().run_line_magic('pinfo', 'x1')"), + (u'??x2', "get_ipython().run_line_magic('pinfo2', 'x2')"), + (u'?a.*s', "get_ipython().run_line_magic('psearch', 'a.*s')"), + (u'?%hist1', "get_ipython().run_line_magic('pinfo', '%hist1')"), + (u'?%%hist2', "get_ipython().run_line_magic('pinfo', '%%hist2')"), + (u'?abc = qwe', "get_ipython().run_line_magic('pinfo', 'abc')"), + ]], + + end_help = + [(i,py3compat.u_format(o)) for i,o in \ + [ (u'x3?', "get_ipython().run_line_magic('pinfo', 'x3')"), + (u'x4??', "get_ipython().run_line_magic('pinfo2', 'x4')"), + (u'%hist1?', "get_ipython().run_line_magic('pinfo', '%hist1')"), + (u'%hist2??', "get_ipython().run_line_magic('pinfo2', '%hist2')"), + (u'%%hist3?', "get_ipython().run_line_magic('pinfo', '%%hist3')"), + (u'%%hist4??', "get_ipython().run_line_magic('pinfo2', '%%hist4')"), + (u'π.foo?', "get_ipython().run_line_magic('pinfo', 'π.foo')"), + (u'f*?', "get_ipython().run_line_magic('psearch', 'f*')"), + (u'ax.*aspe*?', "get_ipython().run_line_magic('psearch', 'ax.*aspe*')"), + (u'a = abc?', "get_ipython().set_next_input('a = abc');" + "get_ipython().run_line_magic('pinfo', 'abc')"), + (u'a = abc.qe??', "get_ipython().set_next_input('a = abc.qe');" + "get_ipython().run_line_magic('pinfo2', 'abc.qe')"), + (u'a = *.items?', "get_ipython().set_next_input('a = *.items');" + "get_ipython().run_line_magic('psearch', '*.items')"), + (u'plot(a?', "get_ipython().set_next_input('plot(a');" + "get_ipython().run_line_magic('pinfo', 'a')"), + (u'a*2 #comment?', 'a*2 #comment?'), + ]], + + # Explicit magic calls + escaped_magic = + [(i,py3compat.u_format(o)) for i,o in \ + [ (u'%cd', "get_ipython().run_line_magic('cd', '')"), + (u'%cd /home', "get_ipython().run_line_magic('cd', '/home')"), + # Backslashes need to be escaped. + (u'%cd C:\\User', "get_ipython().run_line_magic('cd', 'C:\\\\User')"), + (u' %magic', " get_ipython().run_line_magic('magic', '')"), + ]], + + # Quoting with separate arguments + escaped_quote = + [ (',f', 'f("")'), + (',f x', 'f("x")'), + (' ,f y', ' f("y")'), + (',f a b', 'f("a", "b")'), + ], + + # Quoting with single argument + escaped_quote2 = + [ (';f', 'f("")'), + (';f x', 'f("x")'), + (' ;f y', ' f("y")'), + (';f a b', 'f("a b")'), + ], + + # Simply apply parens + escaped_paren = + [ ('/f', 'f()'), + ('/f x', 'f(x)'), + (' /f y', ' f(y)'), + ('/f a b', 'f(a, b)'), + ], + + # Check that we transform prompts before other transforms + mixed = + [(i,py3compat.u_format(o)) for i,o in \ + [ (u'In [1]: %lsmagic', "get_ipython().run_line_magic('lsmagic', '')"), + (u'>>> %lsmagic', "get_ipython().run_line_magic('lsmagic', '')"), + (u'In [2]: !ls', "get_ipython().system('ls')"), + (u'In [3]: abs?', "get_ipython().run_line_magic('pinfo', 'abs')"), + (u'In [4]: b = %who', "b = get_ipython().run_line_magic('who', '')"), + ]], + ) + +# multiline syntax examples. Each of these should be a list of lists, with +# each entry itself having pairs of raw/transformed input. The union (with +# '\n'.join() of the transformed inputs is what the splitter should produce +# when fed the raw lines one at a time via push. +syntax_ml = \ + dict(classic_prompt = + [ [('>>> for i in range(10):','for i in range(10):'), + ('... print i',' print i'), + ('... ', ''), + ], + [('>>> a="""','a="""'), + ('... 123"""','123"""'), + ], + [('a="""','a="""'), + ('... 123','123'), + ('... 456"""','456"""'), + ], + [('a="""','a="""'), + ('>>> 123','123'), + ('... 456"""','456"""'), + ], + [('a="""','a="""'), + ('123','123'), + ('... 456"""','... 456"""'), + ], + [('....__class__','....__class__'), + ], + [('a=5', 'a=5'), + ('...', ''), + ], + [('>>> def f(x):', 'def f(x):'), + ('...', ''), + ('... return x', ' return x'), + ], + [('board = """....', 'board = """....'), + ('....', '....'), + ('...."""', '...."""'), + ], + ], + + ipy_prompt = + [ [('In [24]: for i in range(10):','for i in range(10):'), + (' ....: print i',' print i'), + (' ....: ', ''), + ], + [('In [24]: for i in range(10):','for i in range(10):'), + # Qt console prompts expand with spaces, not dots + (' ...: print i',' print i'), + (' ...: ', ''), + ], + [('In [24]: for i in range(10):','for i in range(10):'), + # Sometimes whitespace preceding '...' has been removed + ('...: print i',' print i'), + ('...: ', ''), + ], + [('In [24]: for i in range(10):','for i in range(10):'), + # Space after last continuation prompt has been removed (issue #6674) + ('...: print i',' print i'), + ('...:', ''), + ], + [('In [2]: a="""','a="""'), + (' ...: 123"""','123"""'), + ], + [('a="""','a="""'), + (' ...: 123','123'), + (' ...: 456"""','456"""'), + ], + [('a="""','a="""'), + ('In [1]: 123','123'), + (' ...: 456"""','456"""'), + ], + [('a="""','a="""'), + ('123','123'), + (' ...: 456"""',' ...: 456"""'), + ], + ], + + multiline_datastructure_prompt = + [ [('>>> a = [1,','a = [1,'), + ('... 2]','2]'), + ], + ], + + multiline_datastructure = + [ [('b = ("%s"', None), + ('# comment', None), + ('%foo )', 'b = ("%s"\n# comment\n%foo )'), + ], + ], + + multiline_string = + [ [("'''foo?", None), + ("bar'''", "'''foo?\nbar'''"), + ], + ], + + leading_indent = + [ [(' print "hi"','print "hi"'), + ], + [(' for a in range(5):','for a in range(5):'), + (' a*2',' a*2'), + ], + [(' a="""','a="""'), + (' 123"""','123"""'), + ], + [('a="""','a="""'), + (' 123"""',' 123"""'), + ], + ], + + cellmagic = + [ [(u'%%foo a', None), + (None, u_fmt("get_ipython().run_cell_magic('foo', 'a', '')")), + ], + [(u'%%bar 123', None), + (u'hello', None), + (None , u_fmt("get_ipython().run_cell_magic('bar', '123', 'hello')")), + ], + [(u'a=5', 'a=5'), + (u'%%cellmagic', '%%cellmagic'), + ], + ], + + escaped = + [ [('%abc def \\', None), + ('ghi', u_fmt("get_ipython().run_line_magic('abc', 'def ghi')")), + ], + [('%abc def \\', None), + ('ghi\\', None), + (None, u_fmt("get_ipython().run_line_magic('abc', 'def ghi')")), + ], + ], + + assign_magic = + [ [(u'a = %bc de \\', None), + (u'fg', u_fmt("a = get_ipython().run_line_magic('bc', 'de fg')")), + ], + [(u'a = %bc de \\', None), + (u'fg\\', None), + (None, u_fmt("a = get_ipython().run_line_magic('bc', 'de fg')")), + ], + ], + + assign_system = + [ [(u'a = !bc de \\', None), + (u'fg', u_fmt("a = get_ipython().getoutput('bc de fg')")), + ], + [(u'a = !bc de \\', None), + (u'fg\\', None), + (None, u_fmt("a = get_ipython().getoutput('bc de fg')")), + ], + ], + ) + + +def test_assign_system(): + tt.check_pairs(transform_and_reset(ipt.assign_from_system), syntax['assign_system']) + +def test_assign_magic(): + tt.check_pairs(transform_and_reset(ipt.assign_from_magic), syntax['assign_magic']) + +def test_classic_prompt(): + tt.check_pairs(transform_and_reset(ipt.classic_prompt), syntax['classic_prompt']) + for example in syntax_ml['classic_prompt']: + transform_checker(example, ipt.classic_prompt) + for example in syntax_ml['multiline_datastructure_prompt']: + transform_checker(example, ipt.classic_prompt) + + # Check that we don't transform the second line if the first is obviously + # IPython syntax + transform_checker([ + (u'%foo', '%foo'), + (u'>>> bar', '>>> bar'), + ], ipt.classic_prompt) + + +def test_ipy_prompt(): + tt.check_pairs(transform_and_reset(ipt.ipy_prompt), syntax['ipy_prompt']) + for example in syntax_ml['ipy_prompt']: + transform_checker(example, ipt.ipy_prompt) + + # Check that we don't transform the second line if we're inside a cell magic + transform_checker([ + (u'%%foo', '%%foo'), + (u'In [1]: bar', 'In [1]: bar'), + ], ipt.ipy_prompt) + +def test_assemble_logical_lines(): + tests = \ + [ [(u"a = \\", None), + (u"123", u"a = 123"), + ], + [(u"a = \\", None), # Test resetting when within a multi-line string + (u"12 *\\", None), + (None, u"a = 12 *"), + ], + [(u"# foo\\", u"# foo\\"), # Comments can't be continued like this + ], + ] + for example in tests: + transform_checker(example, ipt.assemble_logical_lines) + +def test_assemble_python_lines(): + tests = \ + [ [(u"a = '''", None), + (u"abc'''", u"a = '''\nabc'''"), + ], + [(u"a = '''", None), # Test resetting when within a multi-line string + (u"def", None), + (None, u"a = '''\ndef"), + ], + [(u"a = [1,", None), + (u"2]", u"a = [1,\n2]"), + ], + [(u"a = [1,", None), # Test resetting when within a multi-line string + (u"2,", None), + (None, u"a = [1,\n2,"), + ], + [(u"a = '''", None), # Test line continuation within a multi-line string + (u"abc\\", None), + (u"def", None), + (u"'''", u"a = '''\nabc\\\ndef\n'''"), + ], + ] + syntax_ml['multiline_datastructure'] + for example in tests: + transform_checker(example, ipt.assemble_python_lines) + + +def test_help_end(): + tt.check_pairs(transform_and_reset(ipt.help_end), syntax['end_help']) + +def test_escaped_noesc(): + tt.check_pairs(transform_and_reset(ipt.escaped_commands), syntax['escaped_noesc']) + + +def test_escaped_shell(): + tt.check_pairs(transform_and_reset(ipt.escaped_commands), syntax['escaped_shell']) + + +def test_escaped_help(): + tt.check_pairs(transform_and_reset(ipt.escaped_commands), syntax['escaped_help']) + + +def test_escaped_magic(): + tt.check_pairs(transform_and_reset(ipt.escaped_commands), syntax['escaped_magic']) + + +def test_escaped_quote(): + tt.check_pairs(transform_and_reset(ipt.escaped_commands), syntax['escaped_quote']) + + +def test_escaped_quote2(): + tt.check_pairs(transform_and_reset(ipt.escaped_commands), syntax['escaped_quote2']) + + +def test_escaped_paren(): + tt.check_pairs(transform_and_reset(ipt.escaped_commands), syntax['escaped_paren']) + + +def test_cellmagic(): + for example in syntax_ml['cellmagic']: + transform_checker(example, ipt.cellmagic) + + line_example = [(u'%%bar 123', None), + (u'hello', None), + (u'' , u_fmt("get_ipython().run_cell_magic('bar', '123', 'hello')")), + ] + transform_checker(line_example, ipt.cellmagic, end_on_blank_line=True) + +def test_has_comment(): + tests = [('text', False), + ('text #comment', True), + ('text #comment\n', True), + ('#comment', True), + ('#comment\n', True), + ('a = "#string"', False), + ('a = "#string" # comment', True), + ('a #comment not "string"', True), + ] + tt.check_pairs(ipt.has_comment, tests) + +@ipt.TokenInputTransformer.wrap +def decistmt(tokens): + """Substitute Decimals for floats in a string of statements. + + Based on an example from the tokenize module docs. + """ + result = [] + for toknum, tokval, _, _, _ in tokens: + if toknum == tokenize.NUMBER and '.' in tokval: # replace NUMBER tokens + for newtok in [ + (tokenize.NAME, 'Decimal'), + (tokenize.OP, '('), + (tokenize.STRING, repr(tokval)), + (tokenize.OP, ')') + ]: + yield newtok + else: + yield (toknum, tokval) + + + +def test_token_input_transformer(): + tests = [(u'1.2', u_fmt(u"Decimal ('1.2')")), + (u'"1.2"', u'"1.2"'), + ] + tt.check_pairs(transform_and_reset(decistmt), tests) + ml_tests = \ + [ [(u"a = 1.2; b = '''x", None), + (u"y'''", u_fmt(u"a =Decimal ('1.2');b ='''x\ny'''")), + ], + [(u"a = [1.2,", None), + (u"3]", u_fmt(u"a =[Decimal ('1.2'),\n3 ]")), + ], + [(u"a = '''foo", None), # Test resetting when within a multi-line string + (u"bar", None), + (None, u"a = '''foo\nbar"), + ], + ] + for example in ml_tests: + transform_checker(example, decistmt) diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_inputtransformer2.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_inputtransformer2.py new file mode 100644 index 00000000..b29a0196 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_inputtransformer2.py @@ -0,0 +1,292 @@ +"""Tests for the token-based transformers in IPython.core.inputtransformer2 + +Line-based transformers are the simpler ones; token-based transformers are +more complex. See test_inputtransformer2_line for tests for line-based +transformations. +""" +import nose.tools as nt +import string + +from IPython.core import inputtransformer2 as ipt2 +from IPython.core.inputtransformer2 import make_tokens_by_line, _find_assign_op + +from textwrap import dedent + +MULTILINE_MAGIC = ("""\ +a = f() +%foo \\ +bar +g() +""".splitlines(keepends=True), (2, 0), """\ +a = f() +get_ipython().run_line_magic('foo', ' bar') +g() +""".splitlines(keepends=True)) + +INDENTED_MAGIC = ("""\ +for a in range(5): + %ls +""".splitlines(keepends=True), (2, 4), """\ +for a in range(5): + get_ipython().run_line_magic('ls', '') +""".splitlines(keepends=True)) + +MULTILINE_MAGIC_ASSIGN = ("""\ +a = f() +b = %foo \\ + bar +g() +""".splitlines(keepends=True), (2, 4), """\ +a = f() +b = get_ipython().run_line_magic('foo', ' bar') +g() +""".splitlines(keepends=True)) + +MULTILINE_SYSTEM_ASSIGN = ("""\ +a = f() +b = !foo \\ + bar +g() +""".splitlines(keepends=True), (2, 4), """\ +a = f() +b = get_ipython().getoutput('foo bar') +g() +""".splitlines(keepends=True)) + +##### + +MULTILINE_SYSTEM_ASSIGN_AFTER_DEDENT = ("""\ +def test(): + for i in range(1): + print(i) + res =! ls +""".splitlines(keepends=True), (4, 7), '''\ +def test(): + for i in range(1): + print(i) + res =get_ipython().getoutput(\' ls\') +'''.splitlines(keepends=True)) + +###### + +AUTOCALL_QUOTE = ( + [",f 1 2 3\n"], (1, 0), + ['f("1", "2", "3")\n'] +) + +AUTOCALL_QUOTE2 = ( + [";f 1 2 3\n"], (1, 0), + ['f("1 2 3")\n'] +) + +AUTOCALL_PAREN = ( + ["/f 1 2 3\n"], (1, 0), + ['f(1, 2, 3)\n'] +) + +SIMPLE_HELP = ( + ["foo?\n"], (1, 0), + ["get_ipython().run_line_magic('pinfo', 'foo')\n"] +) + +DETAILED_HELP = ( + ["foo??\n"], (1, 0), + ["get_ipython().run_line_magic('pinfo2', 'foo')\n"] +) + +MAGIC_HELP = ( + ["%foo?\n"], (1, 0), + ["get_ipython().run_line_magic('pinfo', '%foo')\n"] +) + +HELP_IN_EXPR = ( + ["a = b + c?\n"], (1, 0), + ["get_ipython().set_next_input('a = b + c');" + "get_ipython().run_line_magic('pinfo', 'c')\n"] +) + +HELP_CONTINUED_LINE = ("""\ +a = \\ +zip? +""".splitlines(keepends=True), (1, 0), +[r"get_ipython().set_next_input('a = \\\nzip');get_ipython().run_line_magic('pinfo', 'zip')" + "\n"] +) + +HELP_MULTILINE = ("""\ +(a, +b) = zip? +""".splitlines(keepends=True), (1, 0), +[r"get_ipython().set_next_input('(a,\nb) = zip');get_ipython().run_line_magic('pinfo', 'zip')" + "\n"] +) + +HELP_UNICODE = ( + ["π.foo?\n"], (1, 0), + ["get_ipython().run_line_magic('pinfo', 'π.foo')\n"] +) + + +def null_cleanup_transformer(lines): + """ + A cleanup transform that returns an empty list. + """ + return [] + +def check_make_token_by_line_never_ends_empty(): + """ + Check that not sequence of single or double characters ends up leading to en empty list of tokens + """ + from string import printable + for c in printable: + nt.assert_not_equal(make_tokens_by_line(c)[-1], []) + for k in printable: + nt.assert_not_equal(make_tokens_by_line(c+k)[-1], []) + +def check_find(transformer, case, match=True): + sample, expected_start, _ = case + tbl = make_tokens_by_line(sample) + res = transformer.find(tbl) + if match: + # start_line is stored 0-indexed, expected values are 1-indexed + nt.assert_equal((res.start_line+1, res.start_col), expected_start) + return res + else: + nt.assert_is(res, None) + +def check_transform(transformer_cls, case): + lines, start, expected = case + transformer = transformer_cls(start) + nt.assert_equal(transformer.transform(lines), expected) + +def test_continued_line(): + lines = MULTILINE_MAGIC_ASSIGN[0] + nt.assert_equal(ipt2.find_end_of_continued_line(lines, 1), 2) + + nt.assert_equal(ipt2.assemble_continued_line(lines, (1, 5), 2), "foo bar") + +def test_find_assign_magic(): + check_find(ipt2.MagicAssign, MULTILINE_MAGIC_ASSIGN) + check_find(ipt2.MagicAssign, MULTILINE_SYSTEM_ASSIGN, match=False) + check_find(ipt2.MagicAssign, MULTILINE_SYSTEM_ASSIGN_AFTER_DEDENT, match=False) + +def test_transform_assign_magic(): + check_transform(ipt2.MagicAssign, MULTILINE_MAGIC_ASSIGN) + +def test_find_assign_system(): + check_find(ipt2.SystemAssign, MULTILINE_SYSTEM_ASSIGN) + check_find(ipt2.SystemAssign, MULTILINE_SYSTEM_ASSIGN_AFTER_DEDENT) + check_find(ipt2.SystemAssign, (["a = !ls\n"], (1, 5), None)) + check_find(ipt2.SystemAssign, (["a=!ls\n"], (1, 2), None)) + check_find(ipt2.SystemAssign, MULTILINE_MAGIC_ASSIGN, match=False) + +def test_transform_assign_system(): + check_transform(ipt2.SystemAssign, MULTILINE_SYSTEM_ASSIGN) + check_transform(ipt2.SystemAssign, MULTILINE_SYSTEM_ASSIGN_AFTER_DEDENT) + +def test_find_magic_escape(): + check_find(ipt2.EscapedCommand, MULTILINE_MAGIC) + check_find(ipt2.EscapedCommand, INDENTED_MAGIC) + check_find(ipt2.EscapedCommand, MULTILINE_MAGIC_ASSIGN, match=False) + +def test_transform_magic_escape(): + check_transform(ipt2.EscapedCommand, MULTILINE_MAGIC) + check_transform(ipt2.EscapedCommand, INDENTED_MAGIC) + +def test_find_autocalls(): + for case in [AUTOCALL_QUOTE, AUTOCALL_QUOTE2, AUTOCALL_PAREN]: + print("Testing %r" % case[0]) + check_find(ipt2.EscapedCommand, case) + +def test_transform_autocall(): + for case in [AUTOCALL_QUOTE, AUTOCALL_QUOTE2, AUTOCALL_PAREN]: + print("Testing %r" % case[0]) + check_transform(ipt2.EscapedCommand, case) + +def test_find_help(): + for case in [SIMPLE_HELP, DETAILED_HELP, MAGIC_HELP, HELP_IN_EXPR]: + check_find(ipt2.HelpEnd, case) + + tf = check_find(ipt2.HelpEnd, HELP_CONTINUED_LINE) + nt.assert_equal(tf.q_line, 1) + nt.assert_equal(tf.q_col, 3) + + tf = check_find(ipt2.HelpEnd, HELP_MULTILINE) + nt.assert_equal(tf.q_line, 1) + nt.assert_equal(tf.q_col, 8) + + # ? in a comment does not trigger help + check_find(ipt2.HelpEnd, (["foo # bar?\n"], None, None), match=False) + # Nor in a string + check_find(ipt2.HelpEnd, (["foo = '''bar?\n"], None, None), match=False) + +def test_transform_help(): + tf = ipt2.HelpEnd((1, 0), (1, 9)) + nt.assert_equal(tf.transform(HELP_IN_EXPR[0]), HELP_IN_EXPR[2]) + + tf = ipt2.HelpEnd((1, 0), (2, 3)) + nt.assert_equal(tf.transform(HELP_CONTINUED_LINE[0]), HELP_CONTINUED_LINE[2]) + + tf = ipt2.HelpEnd((1, 0), (2, 8)) + nt.assert_equal(tf.transform(HELP_MULTILINE[0]), HELP_MULTILINE[2]) + + tf = ipt2.HelpEnd((1, 0), (1, 0)) + nt.assert_equal(tf.transform(HELP_UNICODE[0]), HELP_UNICODE[2]) + +def test_find_assign_op_dedent(): + """ + be careful that empty token like dedent are not counted as parens + """ + class Tk: + def __init__(self, s): + self.string = s + + nt.assert_equal(_find_assign_op([Tk(s) for s in ('','a','=','b')]), 2) + nt.assert_equal(_find_assign_op([Tk(s) for s in ('','(', 'a','=','b', ')', '=' ,'5')]), 6) + +def test_check_complete(): + cc = ipt2.TransformerManager().check_complete + nt.assert_equal(cc("a = 1"), ('complete', None)) + nt.assert_equal(cc("for a in range(5):"), ('incomplete', 4)) + nt.assert_equal(cc("for a in range(5):\n if a > 0:"), ('incomplete', 8)) + nt.assert_equal(cc("raise = 2"), ('invalid', None)) + nt.assert_equal(cc("a = [1,\n2,"), ('incomplete', 0)) + nt.assert_equal(cc(")"), ('incomplete', 0)) + nt.assert_equal(cc("\\\r\n"), ('incomplete', 0)) + nt.assert_equal(cc("a = '''\n hi"), ('incomplete', 3)) + nt.assert_equal(cc("def a():\n x=1\n global x"), ('invalid', None)) + nt.assert_equal(cc("a \\ "), ('invalid', None)) # Nothing allowed after backslash + nt.assert_equal(cc("1\\\n+2"), ('complete', None)) + nt.assert_equal(cc("exit"), ('complete', None)) + + example = dedent(""" + if True: + a=1""" ) + + nt.assert_equal(cc(example), ('incomplete', 4)) + nt.assert_equal(cc(example+'\n'), ('complete', None)) + nt.assert_equal(cc(example+'\n '), ('complete', None)) + + # no need to loop on all the letters/numbers. + short = '12abAB'+string.printable[62:] + for c in short: + # test does not raise: + cc(c) + for k in short: + cc(c+k) + + nt.assert_equal(cc("def f():\n x=0\n \\\n "), ('incomplete', 2)) + +def test_check_complete_II(): + """ + Test that multiple line strings are properly handled. + + Separate test function for convenience + + """ + cc = ipt2.TransformerManager().check_complete + nt.assert_equal(cc('''def foo():\n """'''), ('incomplete', 4)) + + +def test_null_cleanup_transformer(): + manager = ipt2.TransformerManager() + manager.cleanup_transforms.insert(0, null_cleanup_transformer) + nt.assert_is(manager.transform_cell(""), "") diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_inputtransformer2_line.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_inputtransformer2_line.py new file mode 100644 index 00000000..41b6ed29 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_inputtransformer2_line.py @@ -0,0 +1,116 @@ +"""Tests for the line-based transformers in IPython.core.inputtransformer2 + +Line-based transformers are the simpler ones; token-based transformers are +more complex. See test_inputtransformer2 for tests for token-based transformers. +""" +import nose.tools as nt + +from IPython.core import inputtransformer2 as ipt2 + +CELL_MAGIC = ("""\ +%%foo arg +body 1 +body 2 +""", """\ +get_ipython().run_cell_magic('foo', 'arg', 'body 1\\nbody 2\\n') +""") + +def test_cell_magic(): + for sample, expected in [CELL_MAGIC]: + nt.assert_equal(ipt2.cell_magic(sample.splitlines(keepends=True)), + expected.splitlines(keepends=True)) + +CLASSIC_PROMPT = ("""\ +>>> for a in range(5): +... print(a) +""", """\ +for a in range(5): + print(a) +""") + +CLASSIC_PROMPT_L2 = ("""\ +for a in range(5): +... print(a) +... print(a ** 2) +""", """\ +for a in range(5): + print(a) + print(a ** 2) +""") + +def test_classic_prompt(): + for sample, expected in [CLASSIC_PROMPT, CLASSIC_PROMPT_L2]: + nt.assert_equal(ipt2.classic_prompt(sample.splitlines(keepends=True)), + expected.splitlines(keepends=True)) + +IPYTHON_PROMPT = ("""\ +In [1]: for a in range(5): + ...: print(a) +""", """\ +for a in range(5): + print(a) +""") + +IPYTHON_PROMPT_L2 = ("""\ +for a in range(5): + ...: print(a) + ...: print(a ** 2) +""", """\ +for a in range(5): + print(a) + print(a ** 2) +""") + +def test_ipython_prompt(): + for sample, expected in [IPYTHON_PROMPT, IPYTHON_PROMPT_L2]: + nt.assert_equal(ipt2.ipython_prompt(sample.splitlines(keepends=True)), + expected.splitlines(keepends=True)) + +INDENT_SPACES = ("""\ + if True: + a = 3 +""", """\ +if True: + a = 3 +""") + +INDENT_TABS = ("""\ +\tif True: +\t\tb = 4 +""", """\ +if True: +\tb = 4 +""") + +def test_leading_indent(): + for sample, expected in [INDENT_SPACES, INDENT_TABS]: + nt.assert_equal(ipt2.leading_indent(sample.splitlines(keepends=True)), + expected.splitlines(keepends=True)) + +LEADING_EMPTY_LINES = ("""\ + \t + +if True: + a = 3 + +b = 4 +""", """\ +if True: + a = 3 + +b = 4 +""") + +ONLY_EMPTY_LINES = ("""\ + \t + +""", """\ + \t + +""") + +def test_leading_empty_lines(): + for sample, expected in [LEADING_EMPTY_LINES, ONLY_EMPTY_LINES]: + nt.assert_equal( + ipt2.leading_empty_lines(sample.splitlines(keepends=True)), + expected.splitlines(keepends=True)) diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_interactiveshell.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_interactiveshell.py new file mode 100644 index 00000000..496e3bd0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_interactiveshell.py @@ -0,0 +1,1018 @@ +# -*- coding: utf-8 -*- +"""Tests for the key interactiveshell module. + +Historically the main classes in interactiveshell have been under-tested. This +module should grow as many single-method tests as possible to trap many of the +recurring bugs we seem to encounter with high-level interaction. +""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +import asyncio +import ast +import os +import signal +import shutil +import sys +import tempfile +import unittest +from unittest import mock + +from os.path import join + +import nose.tools as nt + +from IPython.core.error import InputRejected +from IPython.core.inputtransformer import InputTransformer +from IPython.core import interactiveshell +from IPython.testing.decorators import ( + skipif, skip_win32, onlyif_unicode_paths, onlyif_cmds_exist, +) +from IPython.testing import tools as tt +from IPython.utils.process import find_cmd + +#----------------------------------------------------------------------------- +# Globals +#----------------------------------------------------------------------------- +# This is used by every single test, no point repeating it ad nauseam + +#----------------------------------------------------------------------------- +# Tests +#----------------------------------------------------------------------------- + +class DerivedInterrupt(KeyboardInterrupt): + pass + +class InteractiveShellTestCase(unittest.TestCase): + def test_naked_string_cells(self): + """Test that cells with only naked strings are fully executed""" + # First, single-line inputs + ip.run_cell('"a"\n') + self.assertEqual(ip.user_ns['_'], 'a') + # And also multi-line cells + ip.run_cell('"""a\nb"""\n') + self.assertEqual(ip.user_ns['_'], 'a\nb') + + def test_run_empty_cell(self): + """Just make sure we don't get a horrible error with a blank + cell of input. Yes, I did overlook that.""" + old_xc = ip.execution_count + res = ip.run_cell('') + self.assertEqual(ip.execution_count, old_xc) + self.assertEqual(res.execution_count, None) + + def test_run_cell_multiline(self): + """Multi-block, multi-line cells must execute correctly. + """ + src = '\n'.join(["x=1", + "y=2", + "if 1:", + " x += 1", + " y += 1",]) + res = ip.run_cell(src) + self.assertEqual(ip.user_ns['x'], 2) + self.assertEqual(ip.user_ns['y'], 3) + self.assertEqual(res.success, True) + self.assertEqual(res.result, None) + + def test_multiline_string_cells(self): + "Code sprinkled with multiline strings should execute (GH-306)" + ip.run_cell('tmp=0') + self.assertEqual(ip.user_ns['tmp'], 0) + res = ip.run_cell('tmp=1;"""a\nb"""\n') + self.assertEqual(ip.user_ns['tmp'], 1) + self.assertEqual(res.success, True) + self.assertEqual(res.result, "a\nb") + + def test_dont_cache_with_semicolon(self): + "Ending a line with semicolon should not cache the returned object (GH-307)" + oldlen = len(ip.user_ns['Out']) + for cell in ['1;', '1;1;']: + res = ip.run_cell(cell, store_history=True) + newlen = len(ip.user_ns['Out']) + self.assertEqual(oldlen, newlen) + self.assertIsNone(res.result) + i = 0 + #also test the default caching behavior + for cell in ['1', '1;1']: + ip.run_cell(cell, store_history=True) + newlen = len(ip.user_ns['Out']) + i += 1 + self.assertEqual(oldlen+i, newlen) + + def test_syntax_error(self): + res = ip.run_cell("raise = 3") + self.assertIsInstance(res.error_before_exec, SyntaxError) + + def test_In_variable(self): + "Verify that In variable grows with user input (GH-284)" + oldlen = len(ip.user_ns['In']) + ip.run_cell('1;', store_history=True) + newlen = len(ip.user_ns['In']) + self.assertEqual(oldlen+1, newlen) + self.assertEqual(ip.user_ns['In'][-1],'1;') + + def test_magic_names_in_string(self): + ip.run_cell('a = """\n%exit\n"""') + self.assertEqual(ip.user_ns['a'], '\n%exit\n') + + def test_trailing_newline(self): + """test that running !(command) does not raise a SyntaxError""" + ip.run_cell('!(true)\n', False) + ip.run_cell('!(true)\n\n\n', False) + + def test_gh_597(self): + """Pretty-printing lists of objects with non-ascii reprs may cause + problems.""" + class Spam(object): + def __repr__(self): + return "\xe9"*50 + import IPython.core.formatters + f = IPython.core.formatters.PlainTextFormatter() + f([Spam(),Spam()]) + + + def test_future_flags(self): + """Check that future flags are used for parsing code (gh-777)""" + ip.run_cell('from __future__ import barry_as_FLUFL') + try: + ip.run_cell('prfunc_return_val = 1 <> 2') + assert 'prfunc_return_val' in ip.user_ns + finally: + # Reset compiler flags so we don't mess up other tests. + ip.compile.reset_compiler_flags() + + def test_can_pickle(self): + "Can we pickle objects defined interactively (GH-29)" + ip = get_ipython() + ip.reset() + ip.run_cell(("class Mylist(list):\n" + " def __init__(self,x=[]):\n" + " list.__init__(self,x)")) + ip.run_cell("w=Mylist([1,2,3])") + + from pickle import dumps + + # We need to swap in our main module - this is only necessary + # inside the test framework, because IPython puts the interactive module + # in place (but the test framework undoes this). + _main = sys.modules['__main__'] + sys.modules['__main__'] = ip.user_module + try: + res = dumps(ip.user_ns["w"]) + finally: + sys.modules['__main__'] = _main + self.assertTrue(isinstance(res, bytes)) + + def test_global_ns(self): + "Code in functions must be able to access variables outside them." + ip = get_ipython() + ip.run_cell("a = 10") + ip.run_cell(("def f(x):\n" + " return x + a")) + ip.run_cell("b = f(12)") + self.assertEqual(ip.user_ns["b"], 22) + + def test_bad_custom_tb(self): + """Check that InteractiveShell is protected from bad custom exception handlers""" + ip.set_custom_exc((IOError,), lambda etype,value,tb: 1/0) + self.assertEqual(ip.custom_exceptions, (IOError,)) + with tt.AssertPrints("Custom TB Handler failed", channel='stderr'): + ip.run_cell(u'raise IOError("foo")') + self.assertEqual(ip.custom_exceptions, ()) + + def test_bad_custom_tb_return(self): + """Check that InteractiveShell is protected from bad return types in custom exception handlers""" + ip.set_custom_exc((NameError,),lambda etype,value,tb, tb_offset=None: 1) + self.assertEqual(ip.custom_exceptions, (NameError,)) + with tt.AssertPrints("Custom TB Handler failed", channel='stderr'): + ip.run_cell(u'a=abracadabra') + self.assertEqual(ip.custom_exceptions, ()) + + def test_drop_by_id(self): + myvars = {"a":object(), "b":object(), "c": object()} + ip.push(myvars, interactive=False) + for name in myvars: + assert name in ip.user_ns, name + assert name in ip.user_ns_hidden, name + ip.user_ns['b'] = 12 + ip.drop_by_id(myvars) + for name in ["a", "c"]: + assert name not in ip.user_ns, name + assert name not in ip.user_ns_hidden, name + assert ip.user_ns['b'] == 12 + ip.reset() + + def test_var_expand(self): + ip.user_ns['f'] = u'Ca\xf1o' + self.assertEqual(ip.var_expand(u'echo $f'), u'echo Ca\xf1o') + self.assertEqual(ip.var_expand(u'echo {f}'), u'echo Ca\xf1o') + self.assertEqual(ip.var_expand(u'echo {f[:-1]}'), u'echo Ca\xf1') + self.assertEqual(ip.var_expand(u'echo {1*2}'), u'echo 2') + + self.assertEqual(ip.var_expand(u"grep x | awk '{print $1}'"), u"grep x | awk '{print $1}'") + + ip.user_ns['f'] = b'Ca\xc3\xb1o' + # This should not raise any exception: + ip.var_expand(u'echo $f') + + def test_var_expand_local(self): + """Test local variable expansion in !system and %magic calls""" + # !system + ip.run_cell('def test():\n' + ' lvar = "ttt"\n' + ' ret = !echo {lvar}\n' + ' return ret[0]\n') + res = ip.user_ns['test']() + nt.assert_in('ttt', res) + + # %magic + ip.run_cell('def makemacro():\n' + ' macroname = "macro_var_expand_locals"\n' + ' %macro {macroname} codestr\n') + ip.user_ns['codestr'] = "str(12)" + ip.run_cell('makemacro()') + nt.assert_in('macro_var_expand_locals', ip.user_ns) + + def test_var_expand_self(self): + """Test variable expansion with the name 'self', which was failing. + + See https://github.com/ipython/ipython/issues/1878#issuecomment-7698218 + """ + ip.run_cell('class cTest:\n' + ' classvar="see me"\n' + ' def test(self):\n' + ' res = !echo Variable: {self.classvar}\n' + ' return res[0]\n') + nt.assert_in('see me', ip.user_ns['cTest']().test()) + + def test_bad_var_expand(self): + """var_expand on invalid formats shouldn't raise""" + # SyntaxError + self.assertEqual(ip.var_expand(u"{'a':5}"), u"{'a':5}") + # NameError + self.assertEqual(ip.var_expand(u"{asdf}"), u"{asdf}") + # ZeroDivisionError + self.assertEqual(ip.var_expand(u"{1/0}"), u"{1/0}") + + def test_silent_postexec(self): + """run_cell(silent=True) doesn't invoke pre/post_run_cell callbacks""" + pre_explicit = mock.Mock() + pre_always = mock.Mock() + post_explicit = mock.Mock() + post_always = mock.Mock() + all_mocks = [pre_explicit, pre_always, post_explicit, post_always] + + ip.events.register('pre_run_cell', pre_explicit) + ip.events.register('pre_execute', pre_always) + ip.events.register('post_run_cell', post_explicit) + ip.events.register('post_execute', post_always) + + try: + ip.run_cell("1", silent=True) + assert pre_always.called + assert not pre_explicit.called + assert post_always.called + assert not post_explicit.called + # double-check that non-silent exec did what we expected + # silent to avoid + ip.run_cell("1") + assert pre_explicit.called + assert post_explicit.called + info, = pre_explicit.call_args[0] + result, = post_explicit.call_args[0] + self.assertEqual(info, result.info) + # check that post hooks are always called + [m.reset_mock() for m in all_mocks] + ip.run_cell("syntax error") + assert pre_always.called + assert pre_explicit.called + assert post_always.called + assert post_explicit.called + info, = pre_explicit.call_args[0] + result, = post_explicit.call_args[0] + self.assertEqual(info, result.info) + finally: + # remove post-exec + ip.events.unregister('pre_run_cell', pre_explicit) + ip.events.unregister('pre_execute', pre_always) + ip.events.unregister('post_run_cell', post_explicit) + ip.events.unregister('post_execute', post_always) + + def test_silent_noadvance(self): + """run_cell(silent=True) doesn't advance execution_count""" + ec = ip.execution_count + # silent should force store_history=False + ip.run_cell("1", store_history=True, silent=True) + + self.assertEqual(ec, ip.execution_count) + # double-check that non-silent exec did what we expected + # silent to avoid + ip.run_cell("1", store_history=True) + self.assertEqual(ec+1, ip.execution_count) + + def test_silent_nodisplayhook(self): + """run_cell(silent=True) doesn't trigger displayhook""" + d = dict(called=False) + + trap = ip.display_trap + save_hook = trap.hook + + def failing_hook(*args, **kwargs): + d['called'] = True + + try: + trap.hook = failing_hook + res = ip.run_cell("1", silent=True) + self.assertFalse(d['called']) + self.assertIsNone(res.result) + # double-check that non-silent exec did what we expected + # silent to avoid + ip.run_cell("1") + self.assertTrue(d['called']) + finally: + trap.hook = save_hook + + def test_ofind_line_magic(self): + from IPython.core.magic import register_line_magic + + @register_line_magic + def lmagic(line): + "A line magic" + + # Get info on line magic + lfind = ip._ofind('lmagic') + info = dict(found=True, isalias=False, ismagic=True, + namespace = 'IPython internal', obj= lmagic.__wrapped__, + parent = None) + nt.assert_equal(lfind, info) + + def test_ofind_cell_magic(self): + from IPython.core.magic import register_cell_magic + + @register_cell_magic + def cmagic(line, cell): + "A cell magic" + + # Get info on cell magic + find = ip._ofind('cmagic') + info = dict(found=True, isalias=False, ismagic=True, + namespace = 'IPython internal', obj= cmagic.__wrapped__, + parent = None) + nt.assert_equal(find, info) + + def test_ofind_property_with_error(self): + class A(object): + @property + def foo(self): + raise NotImplementedError() + a = A() + + found = ip._ofind('a.foo', [('locals', locals())]) + info = dict(found=True, isalias=False, ismagic=False, + namespace='locals', obj=A.foo, parent=a) + nt.assert_equal(found, info) + + def test_ofind_multiple_attribute_lookups(self): + class A(object): + @property + def foo(self): + raise NotImplementedError() + + a = A() + a.a = A() + a.a.a = A() + + found = ip._ofind('a.a.a.foo', [('locals', locals())]) + info = dict(found=True, isalias=False, ismagic=False, + namespace='locals', obj=A.foo, parent=a.a.a) + nt.assert_equal(found, info) + + def test_ofind_slotted_attributes(self): + class A(object): + __slots__ = ['foo'] + def __init__(self): + self.foo = 'bar' + + a = A() + found = ip._ofind('a.foo', [('locals', locals())]) + info = dict(found=True, isalias=False, ismagic=False, + namespace='locals', obj=a.foo, parent=a) + nt.assert_equal(found, info) + + found = ip._ofind('a.bar', [('locals', locals())]) + info = dict(found=False, isalias=False, ismagic=False, + namespace=None, obj=None, parent=a) + nt.assert_equal(found, info) + + def test_ofind_prefers_property_to_instance_level_attribute(self): + class A(object): + @property + def foo(self): + return 'bar' + a = A() + a.__dict__['foo'] = 'baz' + nt.assert_equal(a.foo, 'bar') + found = ip._ofind('a.foo', [('locals', locals())]) + nt.assert_is(found['obj'], A.foo) + + def test_custom_syntaxerror_exception(self): + called = [] + def my_handler(shell, etype, value, tb, tb_offset=None): + called.append(etype) + shell.showtraceback((etype, value, tb), tb_offset=tb_offset) + + ip.set_custom_exc((SyntaxError,), my_handler) + try: + ip.run_cell("1f") + # Check that this was called, and only once. + self.assertEqual(called, [SyntaxError]) + finally: + # Reset the custom exception hook + ip.set_custom_exc((), None) + + def test_custom_exception(self): + called = [] + def my_handler(shell, etype, value, tb, tb_offset=None): + called.append(etype) + shell.showtraceback((etype, value, tb), tb_offset=tb_offset) + + ip.set_custom_exc((ValueError,), my_handler) + try: + res = ip.run_cell("raise ValueError('test')") + # Check that this was called, and only once. + self.assertEqual(called, [ValueError]) + # Check that the error is on the result object + self.assertIsInstance(res.error_in_exec, ValueError) + finally: + # Reset the custom exception hook + ip.set_custom_exc((), None) + + def test_mktempfile(self): + filename = ip.mktempfile() + # Check that we can open the file again on Windows + with open(filename, 'w') as f: + f.write('abc') + + filename = ip.mktempfile(data='blah') + with open(filename, 'r') as f: + self.assertEqual(f.read(), 'blah') + + def test_new_main_mod(self): + # Smoketest to check that this accepts a unicode module name + name = u'jiefmw' + mod = ip.new_main_mod(u'%s.py' % name, name) + self.assertEqual(mod.__name__, name) + + def test_get_exception_only(self): + try: + raise KeyboardInterrupt + except KeyboardInterrupt: + msg = ip.get_exception_only() + self.assertEqual(msg, 'KeyboardInterrupt\n') + + try: + raise DerivedInterrupt("foo") + except KeyboardInterrupt: + msg = ip.get_exception_only() + self.assertEqual(msg, 'IPython.core.tests.test_interactiveshell.DerivedInterrupt: foo\n') + + def test_inspect_text(self): + ip.run_cell('a = 5') + text = ip.object_inspect_text('a') + self.assertIsInstance(text, str) + + def test_last_execution_result(self): + """ Check that last execution result gets set correctly (GH-10702) """ + result = ip.run_cell('a = 5; a') + self.assertTrue(ip.last_execution_succeeded) + self.assertEqual(ip.last_execution_result.result, 5) + + result = ip.run_cell('a = x_invalid_id_x') + self.assertFalse(ip.last_execution_succeeded) + self.assertFalse(ip.last_execution_result.success) + self.assertIsInstance(ip.last_execution_result.error_in_exec, NameError) + + def test_reset_aliasing(self): + """ Check that standard posix aliases work after %reset. """ + if os.name != 'posix': + return + + ip.reset() + for cmd in ('clear', 'more', 'less', 'man'): + res = ip.run_cell('%' + cmd) + self.assertEqual(res.success, True) + + +class TestSafeExecfileNonAsciiPath(unittest.TestCase): + + @onlyif_unicode_paths + def setUp(self): + self.BASETESTDIR = tempfile.mkdtemp() + self.TESTDIR = join(self.BASETESTDIR, u"åäö") + os.mkdir(self.TESTDIR) + with open(join(self.TESTDIR, u"åäötestscript.py"), "w") as sfile: + sfile.write("pass\n") + self.oldpath = os.getcwd() + os.chdir(self.TESTDIR) + self.fname = u"åäötestscript.py" + + def tearDown(self): + os.chdir(self.oldpath) + shutil.rmtree(self.BASETESTDIR) + + @onlyif_unicode_paths + def test_1(self): + """Test safe_execfile with non-ascii path + """ + ip.safe_execfile(self.fname, {}, raise_exceptions=True) + +class ExitCodeChecks(tt.TempFileMixin): + + def setUp(self): + self.system = ip.system_raw + + def test_exit_code_ok(self): + self.system('exit 0') + self.assertEqual(ip.user_ns['_exit_code'], 0) + + def test_exit_code_error(self): + self.system('exit 1') + self.assertEqual(ip.user_ns['_exit_code'], 1) + + @skipif(not hasattr(signal, 'SIGALRM')) + def test_exit_code_signal(self): + self.mktmp("import signal, time\n" + "signal.setitimer(signal.ITIMER_REAL, 0.1)\n" + "time.sleep(1)\n") + self.system("%s %s" % (sys.executable, self.fname)) + self.assertEqual(ip.user_ns['_exit_code'], -signal.SIGALRM) + + @onlyif_cmds_exist("csh") + def test_exit_code_signal_csh(self): + SHELL = os.environ.get('SHELL', None) + os.environ['SHELL'] = find_cmd("csh") + try: + self.test_exit_code_signal() + finally: + if SHELL is not None: + os.environ['SHELL'] = SHELL + else: + del os.environ['SHELL'] + + +class TestSystemRaw(ExitCodeChecks): + + def setUp(self): + super().setUp() + self.system = ip.system_raw + + @onlyif_unicode_paths + def test_1(self): + """Test system_raw with non-ascii cmd + """ + cmd = u'''python -c "'åäö'" ''' + ip.system_raw(cmd) + + @mock.patch('subprocess.call', side_effect=KeyboardInterrupt) + @mock.patch('os.system', side_effect=KeyboardInterrupt) + def test_control_c(self, *mocks): + try: + self.system("sleep 1 # wont happen") + except KeyboardInterrupt: + self.fail("system call should intercept " + "keyboard interrupt from subprocess.call") + self.assertEqual(ip.user_ns['_exit_code'], -signal.SIGINT) + +# TODO: Exit codes are currently ignored on Windows. +class TestSystemPipedExitCode(ExitCodeChecks): + + def setUp(self): + super().setUp() + self.system = ip.system_piped + + @skip_win32 + def test_exit_code_ok(self): + ExitCodeChecks.test_exit_code_ok(self) + + @skip_win32 + def test_exit_code_error(self): + ExitCodeChecks.test_exit_code_error(self) + + @skip_win32 + def test_exit_code_signal(self): + ExitCodeChecks.test_exit_code_signal(self) + +class TestModules(tt.TempFileMixin): + def test_extraneous_loads(self): + """Test we're not loading modules on startup that we shouldn't. + """ + self.mktmp("import sys\n" + "print('numpy' in sys.modules)\n" + "print('ipyparallel' in sys.modules)\n" + "print('ipykernel' in sys.modules)\n" + ) + out = "False\nFalse\nFalse\n" + tt.ipexec_validate(self.fname, out) + +class Negator(ast.NodeTransformer): + """Negates all number literals in an AST.""" + + # for python 3.7 and earlier + def visit_Num(self, node): + node.n = -node.n + return node + + # for python 3.8+ + def visit_Constant(self, node): + if isinstance(node.value, int): + return self.visit_Num(node) + return node + +class TestAstTransform(unittest.TestCase): + def setUp(self): + self.negator = Negator() + ip.ast_transformers.append(self.negator) + + def tearDown(self): + ip.ast_transformers.remove(self.negator) + + def test_run_cell(self): + with tt.AssertPrints('-34'): + ip.run_cell('print (12 + 22)') + + # A named reference to a number shouldn't be transformed. + ip.user_ns['n'] = 55 + with tt.AssertNotPrints('-55'): + ip.run_cell('print (n)') + + def test_timeit(self): + called = set() + def f(x): + called.add(x) + ip.push({'f':f}) + + with tt.AssertPrints("std. dev. of"): + ip.run_line_magic("timeit", "-n1 f(1)") + self.assertEqual(called, {-1}) + called.clear() + + with tt.AssertPrints("std. dev. of"): + ip.run_cell_magic("timeit", "-n1 f(2)", "f(3)") + self.assertEqual(called, {-2, -3}) + + def test_time(self): + called = [] + def f(x): + called.append(x) + ip.push({'f':f}) + + # Test with an expression + with tt.AssertPrints("Wall time: "): + ip.run_line_magic("time", "f(5+9)") + self.assertEqual(called, [-14]) + called[:] = [] + + # Test with a statement (different code path) + with tt.AssertPrints("Wall time: "): + ip.run_line_magic("time", "a = f(-3 + -2)") + self.assertEqual(called, [5]) + + def test_macro(self): + ip.push({'a':10}) + # The AST transformation makes this do a+=-1 + ip.define_macro("amacro", "a+=1\nprint(a)") + + with tt.AssertPrints("9"): + ip.run_cell("amacro") + with tt.AssertPrints("8"): + ip.run_cell("amacro") + +class IntegerWrapper(ast.NodeTransformer): + """Wraps all integers in a call to Integer()""" + + # for Python 3.7 and earlier + + # for Python 3.7 and earlier + def visit_Num(self, node): + if isinstance(node.n, int): + return ast.Call(func=ast.Name(id='Integer', ctx=ast.Load()), + args=[node], keywords=[]) + return node + + # For Python 3.8+ + def visit_Constant(self, node): + if isinstance(node.value, int): + return self.visit_Num(node) + return node + + +class TestAstTransform2(unittest.TestCase): + def setUp(self): + self.intwrapper = IntegerWrapper() + ip.ast_transformers.append(self.intwrapper) + + self.calls = [] + def Integer(*args): + self.calls.append(args) + return args + ip.push({"Integer": Integer}) + + def tearDown(self): + ip.ast_transformers.remove(self.intwrapper) + del ip.user_ns['Integer'] + + def test_run_cell(self): + ip.run_cell("n = 2") + self.assertEqual(self.calls, [(2,)]) + + # This shouldn't throw an error + ip.run_cell("o = 2.0") + self.assertEqual(ip.user_ns['o'], 2.0) + + def test_timeit(self): + called = set() + def f(x): + called.add(x) + ip.push({'f':f}) + + with tt.AssertPrints("std. dev. of"): + ip.run_line_magic("timeit", "-n1 f(1)") + self.assertEqual(called, {(1,)}) + called.clear() + + with tt.AssertPrints("std. dev. of"): + ip.run_cell_magic("timeit", "-n1 f(2)", "f(3)") + self.assertEqual(called, {(2,), (3,)}) + +class ErrorTransformer(ast.NodeTransformer): + """Throws an error when it sees a number.""" + + # for Python 3.7 and earlier + def visit_Num(self, node): + raise ValueError("test") + + # for Python 3.8+ + def visit_Constant(self, node): + if isinstance(node.value, int): + return self.visit_Num(node) + return node + + +class TestAstTransformError(unittest.TestCase): + def test_unregistering(self): + err_transformer = ErrorTransformer() + ip.ast_transformers.append(err_transformer) + + with self.assertWarnsRegex(UserWarning, "It will be unregistered"): + ip.run_cell("1 + 2") + + # This should have been removed. + nt.assert_not_in(err_transformer, ip.ast_transformers) + + +class StringRejector(ast.NodeTransformer): + """Throws an InputRejected when it sees a string literal. + + Used to verify that NodeTransformers can signal that a piece of code should + not be executed by throwing an InputRejected. + """ + + #for python 3.7 and earlier + def visit_Str(self, node): + raise InputRejected("test") + + # 3.8 only + def visit_Constant(self, node): + if isinstance(node.value, str): + raise InputRejected("test") + return node + + +class TestAstTransformInputRejection(unittest.TestCase): + + def setUp(self): + self.transformer = StringRejector() + ip.ast_transformers.append(self.transformer) + + def tearDown(self): + ip.ast_transformers.remove(self.transformer) + + def test_input_rejection(self): + """Check that NodeTransformers can reject input.""" + + expect_exception_tb = tt.AssertPrints("InputRejected: test") + expect_no_cell_output = tt.AssertNotPrints("'unsafe'", suppress=False) + + # Run the same check twice to verify that the transformer is not + # disabled after raising. + with expect_exception_tb, expect_no_cell_output: + ip.run_cell("'unsafe'") + + with expect_exception_tb, expect_no_cell_output: + res = ip.run_cell("'unsafe'") + + self.assertIsInstance(res.error_before_exec, InputRejected) + +def test__IPYTHON__(): + # This shouldn't raise a NameError, that's all + __IPYTHON__ + + +class DummyRepr(object): + def __repr__(self): + return "DummyRepr" + + def _repr_html_(self): + return "dummy" + + def _repr_javascript_(self): + return "console.log('hi');", {'key': 'value'} + + +def test_user_variables(): + # enable all formatters + ip.display_formatter.active_types = ip.display_formatter.format_types + + ip.user_ns['dummy'] = d = DummyRepr() + keys = {'dummy', 'doesnotexist'} + r = ip.user_expressions({ key:key for key in keys}) + + nt.assert_equal(keys, set(r.keys())) + dummy = r['dummy'] + nt.assert_equal({'status', 'data', 'metadata'}, set(dummy.keys())) + nt.assert_equal(dummy['status'], 'ok') + data = dummy['data'] + metadata = dummy['metadata'] + nt.assert_equal(data.get('text/html'), d._repr_html_()) + js, jsmd = d._repr_javascript_() + nt.assert_equal(data.get('application/javascript'), js) + nt.assert_equal(metadata.get('application/javascript'), jsmd) + + dne = r['doesnotexist'] + nt.assert_equal(dne['status'], 'error') + nt.assert_equal(dne['ename'], 'NameError') + + # back to text only + ip.display_formatter.active_types = ['text/plain'] + +def test_user_expression(): + # enable all formatters + ip.display_formatter.active_types = ip.display_formatter.format_types + query = { + 'a' : '1 + 2', + 'b' : '1/0', + } + r = ip.user_expressions(query) + import pprint + pprint.pprint(r) + nt.assert_equal(set(r.keys()), set(query.keys())) + a = r['a'] + nt.assert_equal({'status', 'data', 'metadata'}, set(a.keys())) + nt.assert_equal(a['status'], 'ok') + data = a['data'] + metadata = a['metadata'] + nt.assert_equal(data.get('text/plain'), '3') + + b = r['b'] + nt.assert_equal(b['status'], 'error') + nt.assert_equal(b['ename'], 'ZeroDivisionError') + + # back to text only + ip.display_formatter.active_types = ['text/plain'] + + +class TestSyntaxErrorTransformer(unittest.TestCase): + """Check that SyntaxError raised by an input transformer is handled by run_cell()""" + + @staticmethod + def transformer(lines): + for line in lines: + pos = line.find('syntaxerror') + if pos >= 0: + e = SyntaxError('input contains "syntaxerror"') + e.text = line + e.offset = pos + 1 + raise e + return lines + + def setUp(self): + ip.input_transformers_post.append(self.transformer) + + def tearDown(self): + ip.input_transformers_post.remove(self.transformer) + + def test_syntaxerror_input_transformer(self): + with tt.AssertPrints('1234'): + ip.run_cell('1234') + with tt.AssertPrints('SyntaxError: invalid syntax'): + ip.run_cell('1 2 3') # plain python syntax error + with tt.AssertPrints('SyntaxError: input contains "syntaxerror"'): + ip.run_cell('2345 # syntaxerror') # input transformer syntax error + with tt.AssertPrints('3456'): + ip.run_cell('3456') + + +class TestWarningSuppression(unittest.TestCase): + def test_warning_suppression(self): + ip.run_cell("import warnings") + try: + with self.assertWarnsRegex(UserWarning, "asdf"): + ip.run_cell("warnings.warn('asdf')") + # Here's the real test -- if we run that again, we should get the + # warning again. Traditionally, each warning was only issued once per + # IPython session (approximately), even if the user typed in new and + # different code that should have also triggered the warning, leading + # to much confusion. + with self.assertWarnsRegex(UserWarning, "asdf"): + ip.run_cell("warnings.warn('asdf')") + finally: + ip.run_cell("del warnings") + + + def test_deprecation_warning(self): + ip.run_cell(""" +import warnings +def wrn(): + warnings.warn( + "I AM A WARNING", + DeprecationWarning + ) + """) + try: + with self.assertWarnsRegex(DeprecationWarning, "I AM A WARNING"): + ip.run_cell("wrn()") + finally: + ip.run_cell("del warnings") + ip.run_cell("del wrn") + + +class TestImportNoDeprecate(tt.TempFileMixin): + + def setUp(self): + """Make a valid python temp file.""" + self.mktmp(""" +import warnings +def wrn(): + warnings.warn( + "I AM A WARNING", + DeprecationWarning + ) +""") + super().setUp() + + def test_no_dep(self): + """ + No deprecation warning should be raised from imported functions + """ + ip.run_cell("from {} import wrn".format(self.fname)) + + with tt.AssertNotPrints("I AM A WARNING"): + ip.run_cell("wrn()") + ip.run_cell("del wrn") + + +def test_custom_exc_count(): + hook = mock.Mock(return_value=None) + ip.set_custom_exc((SyntaxError,), hook) + before = ip.execution_count + ip.run_cell("def foo()", store_history=True) + # restore default excepthook + ip.set_custom_exc((), None) + nt.assert_equal(hook.call_count, 1) + nt.assert_equal(ip.execution_count, before + 1) + + +def test_run_cell_async(): + loop = asyncio.get_event_loop() + ip.run_cell("import asyncio") + coro = ip.run_cell_async("await asyncio.sleep(0.01)\n5") + assert asyncio.iscoroutine(coro) + result = loop.run_until_complete(coro) + assert isinstance(result, interactiveshell.ExecutionResult) + assert result.result == 5 + + +def test_should_run_async(): + assert not ip.should_run_async("a = 5") + assert ip.should_run_async("await x") + assert ip.should_run_async("import asyncio; await asyncio.sleep(1)") + + +def test_set_custom_completer(): + num_completers = len(ip.Completer.matchers) + + def foo(*args, **kwargs): + return "I'm a completer!" + + ip.set_custom_completer(foo, 0) + + # check that we've really added a new completer + assert len(ip.Completer.matchers) == num_completers + 1 + + # check that the first completer is the function we defined + assert ip.Completer.matchers[0]() == "I'm a completer!" + + # clean up + ip.Completer.custom_matchers.pop() diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_iplib.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_iplib.py new file mode 100644 index 00000000..adadae56 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_iplib.py @@ -0,0 +1,246 @@ +"""Tests for the key interactiveshell module, where the main ipython class is defined. +""" +#----------------------------------------------------------------------------- +# Module imports +#----------------------------------------------------------------------------- + +# third party +import nose.tools as nt + +# our own packages + +#----------------------------------------------------------------------------- +# Test functions +#----------------------------------------------------------------------------- + +def test_reset(): + """reset must clear most namespaces.""" + + # Check that reset runs without error + ip.reset() + + # Once we've reset it (to clear of any junk that might have been there from + # other tests, we can count how many variables are in the user's namespace + nvars_user_ns = len(ip.user_ns) + nvars_hidden = len(ip.user_ns_hidden) + + # Now add a few variables to user_ns, and check that reset clears them + ip.user_ns['x'] = 1 + ip.user_ns['y'] = 1 + ip.reset() + + # Finally, check that all namespaces have only as many variables as we + # expect to find in them: + nt.assert_equal(len(ip.user_ns), nvars_user_ns) + nt.assert_equal(len(ip.user_ns_hidden), nvars_hidden) + + +# Tests for reporting of exceptions in various modes, handling of SystemExit, +# and %tb functionality. This is really a mix of testing ultraTB and interactiveshell. + +def doctest_tb_plain(): + """ +In [18]: xmode plain +Exception reporting mode: Plain + +In [19]: run simpleerr.py +Traceback (most recent call last): + ...line 32, in + bar(mode) + ...line 16, in bar + div0() + ...line 8, in div0 + x/y +ZeroDivisionError: ... + """ + + +def doctest_tb_context(): + """ +In [3]: xmode context +Exception reporting mode: Context + +In [4]: run simpleerr.py +--------------------------------------------------------------------------- +ZeroDivisionError Traceback (most recent call last) + +... in + 30 mode = 'div' + 31 +---> 32 bar(mode) + +... in bar(mode) + 14 "bar" + 15 if mode=='div': +---> 16 div0() + 17 elif mode=='exit': + 18 try: + +... in div0() + 6 x = 1 + 7 y = 0 +----> 8 x/y + 9 + 10 def sysexit(stat, mode): + +ZeroDivisionError: ... +""" + + +def doctest_tb_verbose(): + """ +In [5]: xmode verbose +Exception reporting mode: Verbose + +In [6]: run simpleerr.py +--------------------------------------------------------------------------- +ZeroDivisionError Traceback (most recent call last) + +... in + 30 mode = 'div' + 31 +---> 32 bar(mode) + global bar = + global mode = 'div' + +... in bar(mode='div') + 14 "bar" + 15 if mode=='div': +---> 16 div0() + global div0 = + 17 elif mode=='exit': + 18 try: + +... in div0() + 6 x = 1 + 7 y = 0 +----> 8 x/y + x = 1 + y = 0 + 9 + 10 def sysexit(stat, mode): + +ZeroDivisionError: ... + """ + +def doctest_tb_sysexit(): + """ +In [17]: %xmode plain +Exception reporting mode: Plain + +In [18]: %run simpleerr.py exit +An exception has occurred, use %tb to see the full traceback. +SystemExit: (1, 'Mode = exit') + +In [19]: %run simpleerr.py exit 2 +An exception has occurred, use %tb to see the full traceback. +SystemExit: (2, 'Mode = exit') + +In [20]: %tb +Traceback (most recent call last): + File ... in + bar(mode) + File ... line 22, in bar + sysexit(stat, mode) + File ... line 11, in sysexit + raise SystemExit(stat, 'Mode = %s' % mode) +SystemExit: (2, 'Mode = exit') + +In [21]: %xmode context +Exception reporting mode: Context + +In [22]: %tb +--------------------------------------------------------------------------- +SystemExit Traceback (most recent call last) + +... + 30 mode = 'div' + 31 +---> 32 bar(mode) + +...bar(mode) + 20 except: + 21 stat = 1 +---> 22 sysexit(stat, mode) + 23 else: + 24 raise ValueError('Unknown mode') + +...sysexit(stat, mode) + 9 + 10 def sysexit(stat, mode): +---> 11 raise SystemExit(stat, 'Mode = %s' % mode) + 12 + 13 def bar(mode): + +SystemExit: (2, 'Mode = exit') + +In [23]: %xmode verbose +Exception reporting mode: Verbose + +In [24]: %tb +--------------------------------------------------------------------------- +SystemExit Traceback (most recent call last) + +... in + 30 mode = 'div' + 31 +---> 32 bar(mode) + global bar = + global mode = 'exit' + +... in bar(mode='exit') + 20 except: + 21 stat = 1 +---> 22 sysexit(stat, mode) + global sysexit = + stat = 2 + mode = 'exit' + 23 else: + 24 raise ValueError('Unknown mode') + +... in sysexit(stat=2, mode='exit') + 9 + 10 def sysexit(stat, mode): +---> 11 raise SystemExit(stat, 'Mode = %s' % mode) + global SystemExit = undefined + stat = 2 + mode = 'exit' + 12 + 13 def bar(mode): + +SystemExit: (2, 'Mode = exit') + """ + + +def test_run_cell(): + import textwrap + ip.run_cell('a = 10\na+=1') + ip.run_cell('assert a == 11\nassert 1') + + nt.assert_equal(ip.user_ns['a'], 11) + complex = textwrap.dedent(""" + if 1: + print "hello" + if 1: + print "world" + + if 2: + print "foo" + + if 3: + print "bar" + + if 4: + print "bar" + + """) + # Simply verifies that this kind of input is run + ip.run_cell(complex) + + +def test_db(): + """Test the internal database used for variable persistence.""" + ip.db['__unittest_'] = 12 + nt.assert_equal(ip.db['__unittest_'], 12) + del ip.db['__unittest_'] + assert '__unittest_' not in ip.db diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_logger.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_logger.py new file mode 100644 index 00000000..ebebac16 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_logger.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +"""Test IPython.core.logger""" + +import os.path + +import nose.tools as nt +from IPython.utils.tempdir import TemporaryDirectory + +def test_logstart_inaccessible_file(): + try: + _ip.logger.logstart(logfname="/") # Opening that filename will fail. + except IOError: + pass + else: + nt.assert_true(False) # The try block should never pass. + + try: + _ip.run_cell("a=1") # Check it doesn't try to log this + finally: + _ip.logger.log_active = False # If this fails, don't let later tests fail + +def test_logstart_unicode(): + with TemporaryDirectory() as tdir: + logfname = os.path.join(tdir, "test_unicode.log") + _ip.run_cell("'abc€'") + try: + _ip.magic("logstart -to %s" % logfname) + _ip.run_cell("'abc€'") + finally: + _ip.logger.logstop() diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_magic.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_magic.py new file mode 100644 index 00000000..877326cc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_magic.py @@ -0,0 +1,1225 @@ +# -*- coding: utf-8 -*- +"""Tests for various magic functions. + +Needs to be run by nose (to make ipython session available). +""" + +import io +import os +import re +import sys +import warnings +from textwrap import dedent +from unittest import TestCase +from unittest import mock +from importlib import invalidate_caches +from io import StringIO + +import nose.tools as nt + +import shlex + +from IPython import get_ipython +from IPython.core import magic +from IPython.core.error import UsageError +from IPython.core.magic import (Magics, magics_class, line_magic, + cell_magic, + register_line_magic, register_cell_magic) +from IPython.core.magics import execution, script, code, logging, osm +from IPython.testing import decorators as dec +from IPython.testing import tools as tt +from IPython.utils.io import capture_output +from IPython.utils.tempdir import (TemporaryDirectory, + TemporaryWorkingDirectory) +from IPython.utils.process import find_cmd + + +@magic.magics_class +class DummyMagics(magic.Magics): pass + +def test_extract_code_ranges(): + instr = "1 3 5-6 7-9 10:15 17: :10 10- -13 :" + expected = [(0, 1), + (2, 3), + (4, 6), + (6, 9), + (9, 14), + (16, None), + (None, 9), + (9, None), + (None, 13), + (None, None)] + actual = list(code.extract_code_ranges(instr)) + nt.assert_equal(actual, expected) + +def test_extract_symbols(): + source = """import foo\na = 10\ndef b():\n return 42\n\n\nclass A: pass\n\n\n""" + symbols_args = ["a", "b", "A", "A,b", "A,a", "z"] + expected = [([], ['a']), + (["def b():\n return 42\n"], []), + (["class A: pass\n"], []), + (["class A: pass\n", "def b():\n return 42\n"], []), + (["class A: pass\n"], ['a']), + ([], ['z'])] + for symbols, exp in zip(symbols_args, expected): + nt.assert_equal(code.extract_symbols(source, symbols), exp) + + +def test_extract_symbols_raises_exception_with_non_python_code(): + source = ("=begin A Ruby program :)=end\n" + "def hello\n" + "puts 'Hello world'\n" + "end") + with nt.assert_raises(SyntaxError): + code.extract_symbols(source, "hello") + + +def test_magic_not_found(): + # magic not found raises UsageError + with nt.assert_raises(UsageError): + _ip.magic('doesntexist') + + # ensure result isn't success when a magic isn't found + result = _ip.run_cell('%doesntexist') + assert isinstance(result.error_in_exec, UsageError) + + +def test_cell_magic_not_found(): + # magic not found raises UsageError + with nt.assert_raises(UsageError): + _ip.run_cell_magic('doesntexist', 'line', 'cell') + + # ensure result isn't success when a magic isn't found + result = _ip.run_cell('%%doesntexist') + assert isinstance(result.error_in_exec, UsageError) + + +def test_magic_error_status(): + def fail(shell): + 1/0 + _ip.register_magic_function(fail) + result = _ip.run_cell('%fail') + assert isinstance(result.error_in_exec, ZeroDivisionError) + + +def test_config(): + """ test that config magic does not raise + can happen if Configurable init is moved too early into + Magics.__init__ as then a Config object will be registered as a + magic. + """ + ## should not raise. + _ip.magic('config') + +def test_config_available_configs(): + """ test that config magic prints available configs in unique and + sorted order. """ + with capture_output() as captured: + _ip.magic('config') + + stdout = captured.stdout + config_classes = stdout.strip().split('\n')[1:] + nt.assert_list_equal(config_classes, sorted(set(config_classes))) + +def test_config_print_class(): + """ test that config with a classname prints the class's options. """ + with capture_output() as captured: + _ip.magic('config TerminalInteractiveShell') + + stdout = captured.stdout + if not re.match("TerminalInteractiveShell.* options", stdout.splitlines()[0]): + print(stdout) + raise AssertionError("1st line of stdout not like " + "'TerminalInteractiveShell.* options'") + +def test_rehashx(): + # clear up everything + _ip.alias_manager.clear_aliases() + del _ip.db['syscmdlist'] + + _ip.magic('rehashx') + # Practically ALL ipython development systems will have more than 10 aliases + + nt.assert_true(len(_ip.alias_manager.aliases) > 10) + for name, cmd in _ip.alias_manager.aliases: + # we must strip dots from alias names + nt.assert_not_in('.', name) + + # rehashx must fill up syscmdlist + scoms = _ip.db['syscmdlist'] + nt.assert_true(len(scoms) > 10) + + + +def test_magic_parse_options(): + """Test that we don't mangle paths when parsing magic options.""" + ip = get_ipython() + path = 'c:\\x' + m = DummyMagics(ip) + opts = m.parse_options('-f %s' % path,'f:')[0] + # argv splitting is os-dependent + if os.name == 'posix': + expected = 'c:x' + else: + expected = path + nt.assert_equal(opts['f'], expected) + +def test_magic_parse_long_options(): + """Magic.parse_options can handle --foo=bar long options""" + ip = get_ipython() + m = DummyMagics(ip) + opts, _ = m.parse_options('--foo --bar=bubble', 'a', 'foo', 'bar=') + nt.assert_in('foo', opts) + nt.assert_in('bar', opts) + nt.assert_equal(opts['bar'], "bubble") + + +@dec.skip_without('sqlite3') +def doctest_hist_f(): + """Test %hist -f with temporary filename. + + In [9]: import tempfile + + In [10]: tfile = tempfile.mktemp('.py','tmp-ipython-') + + In [11]: %hist -nl -f $tfile 3 + + In [13]: import os; os.unlink(tfile) + """ + + +@dec.skip_without('sqlite3') +def doctest_hist_r(): + """Test %hist -r + + XXX - This test is not recording the output correctly. For some reason, in + testing mode the raw history isn't getting populated. No idea why. + Disabling the output checking for now, though at least we do run it. + + In [1]: 'hist' in _ip.lsmagic() + Out[1]: True + + In [2]: x=1 + + In [3]: %hist -rl 2 + x=1 # random + %hist -r 2 + """ + + +@dec.skip_without('sqlite3') +def doctest_hist_op(): + """Test %hist -op + + In [1]: class b(float): + ...: pass + ...: + + In [2]: class s(object): + ...: def __str__(self): + ...: return 's' + ...: + + In [3]: + + In [4]: class r(b): + ...: def __repr__(self): + ...: return 'r' + ...: + + In [5]: class sr(s,r): pass + ...: + + In [6]: + + In [7]: bb=b() + + In [8]: ss=s() + + In [9]: rr=r() + + In [10]: ssrr=sr() + + In [11]: 4.5 + Out[11]: 4.5 + + In [12]: str(ss) + Out[12]: 's' + + In [13]: + + In [14]: %hist -op + >>> class b: + ... pass + ... + >>> class s(b): + ... def __str__(self): + ... return 's' + ... + >>> + >>> class r(b): + ... def __repr__(self): + ... return 'r' + ... + >>> class sr(s,r): pass + >>> + >>> bb=b() + >>> ss=s() + >>> rr=r() + >>> ssrr=sr() + >>> 4.5 + 4.5 + >>> str(ss) + 's' + >>> + """ + +def test_hist_pof(): + ip = get_ipython() + ip.run_cell(u"1+2", store_history=True) + #raise Exception(ip.history_manager.session_number) + #raise Exception(list(ip.history_manager._get_range_session())) + with TemporaryDirectory() as td: + tf = os.path.join(td, 'hist.py') + ip.run_line_magic('history', '-pof %s' % tf) + assert os.path.isfile(tf) + + +@dec.skip_without('sqlite3') +def test_macro(): + ip = get_ipython() + ip.history_manager.reset() # Clear any existing history. + cmds = ["a=1", "def b():\n return a**2", "print(a,b())"] + for i, cmd in enumerate(cmds, start=1): + ip.history_manager.store_inputs(i, cmd) + ip.magic("macro test 1-3") + nt.assert_equal(ip.user_ns["test"].value, "\n".join(cmds)+"\n") + + # List macros + nt.assert_in("test", ip.magic("macro")) + + +@dec.skip_without('sqlite3') +def test_macro_run(): + """Test that we can run a multi-line macro successfully.""" + ip = get_ipython() + ip.history_manager.reset() + cmds = ["a=10", "a+=1", "print(a)", "%macro test 2-3"] + for cmd in cmds: + ip.run_cell(cmd, store_history=True) + nt.assert_equal(ip.user_ns["test"].value, "a+=1\nprint(a)\n") + with tt.AssertPrints("12"): + ip.run_cell("test") + with tt.AssertPrints("13"): + ip.run_cell("test") + + +def test_magic_magic(): + """Test %magic""" + ip = get_ipython() + with capture_output() as captured: + ip.magic("magic") + + stdout = captured.stdout + nt.assert_in('%magic', stdout) + nt.assert_in('IPython', stdout) + nt.assert_in('Available', stdout) + + +@dec.skipif_not_numpy +def test_numpy_reset_array_undec(): + "Test '%reset array' functionality" + _ip.ex('import numpy as np') + _ip.ex('a = np.empty(2)') + nt.assert_in('a', _ip.user_ns) + _ip.magic('reset -f array') + nt.assert_not_in('a', _ip.user_ns) + +def test_reset_out(): + "Test '%reset out' magic" + _ip.run_cell("parrot = 'dead'", store_history=True) + # test '%reset -f out', make an Out prompt + _ip.run_cell("parrot", store_history=True) + nt.assert_true('dead' in [_ip.user_ns[x] for x in ('_','__','___')]) + _ip.magic('reset -f out') + nt.assert_false('dead' in [_ip.user_ns[x] for x in ('_','__','___')]) + nt.assert_equal(len(_ip.user_ns['Out']), 0) + +def test_reset_in(): + "Test '%reset in' magic" + # test '%reset -f in' + _ip.run_cell("parrot", store_history=True) + nt.assert_true('parrot' in [_ip.user_ns[x] for x in ('_i','_ii','_iii')]) + _ip.magic('%reset -f in') + nt.assert_false('parrot' in [_ip.user_ns[x] for x in ('_i','_ii','_iii')]) + nt.assert_equal(len(set(_ip.user_ns['In'])), 1) + +def test_reset_dhist(): + "Test '%reset dhist' magic" + _ip.run_cell("tmp = [d for d in _dh]") # copy before clearing + _ip.magic('cd ' + os.path.dirname(nt.__file__)) + _ip.magic('cd -') + nt.assert_true(len(_ip.user_ns['_dh']) > 0) + _ip.magic('reset -f dhist') + nt.assert_equal(len(_ip.user_ns['_dh']), 0) + _ip.run_cell("_dh = [d for d in tmp]") #restore + +def test_reset_in_length(): + "Test that '%reset in' preserves In[] length" + _ip.run_cell("print 'foo'") + _ip.run_cell("reset -f in") + nt.assert_equal(len(_ip.user_ns['In']), _ip.displayhook.prompt_count+1) + +class TestResetErrors(TestCase): + + def test_reset_redefine(self): + + @magics_class + class KernelMagics(Magics): + @line_magic + def less(self, shell): pass + + _ip.register_magics(KernelMagics) + + with self.assertLogs() as cm: + # hack, we want to just capture logs, but assertLogs fails if not + # logs get produce. + # so log one things we ignore. + import logging as log_mod + log = log_mod.getLogger() + log.info('Nothing') + # end hack. + _ip.run_cell("reset -f") + + assert len(cm.output) == 1 + for out in cm.output: + assert "Invalid alias" not in out + +def test_tb_syntaxerror(): + """test %tb after a SyntaxError""" + ip = get_ipython() + ip.run_cell("for") + + # trap and validate stdout + save_stdout = sys.stdout + try: + sys.stdout = StringIO() + ip.run_cell("%tb") + out = sys.stdout.getvalue() + finally: + sys.stdout = save_stdout + # trim output, and only check the last line + last_line = out.rstrip().splitlines()[-1].strip() + nt.assert_equal(last_line, "SyntaxError: invalid syntax") + + +def test_time(): + ip = get_ipython() + + with tt.AssertPrints("Wall time: "): + ip.run_cell("%time None") + + ip.run_cell("def f(kmjy):\n" + " %time print (2*kmjy)") + + with tt.AssertPrints("Wall time: "): + with tt.AssertPrints("hihi", suppress=False): + ip.run_cell("f('hi')") + +def test_time_last_not_expression(): + ip.run_cell("%%time\n" + "var_1 = 1\n" + "var_2 = 2\n") + assert ip.user_ns['var_1'] == 1 + del ip.user_ns['var_1'] + assert ip.user_ns['var_2'] == 2 + del ip.user_ns['var_2'] + + +@dec.skip_win32 +def test_time2(): + ip = get_ipython() + + with tt.AssertPrints("CPU times: user "): + ip.run_cell("%time None") + +def test_time3(): + """Erroneous magic function calls, issue gh-3334""" + ip = get_ipython() + ip.user_ns.pop('run', None) + + with tt.AssertNotPrints("not found", channel='stderr'): + ip.run_cell("%%time\n" + "run = 0\n" + "run += 1") + +def test_multiline_time(): + """Make sure last statement from time return a value.""" + ip = get_ipython() + ip.user_ns.pop('run', None) + + ip.run_cell(dedent("""\ + %%time + a = "ho" + b = "hey" + a+b + """)) + nt.assert_equal(ip.user_ns_hidden['_'], 'hohey') + +def test_time_local_ns(): + """ + Test that local_ns is actually global_ns when running a cell magic + """ + ip = get_ipython() + ip.run_cell("%%time\n" + "myvar = 1") + nt.assert_equal(ip.user_ns['myvar'], 1) + del ip.user_ns['myvar'] + +def test_doctest_mode(): + "Toggle doctest_mode twice, it should be a no-op and run without error" + _ip.magic('doctest_mode') + _ip.magic('doctest_mode') + + +def test_parse_options(): + """Tests for basic options parsing in magics.""" + # These are only the most minimal of tests, more should be added later. At + # the very least we check that basic text/unicode calls work OK. + m = DummyMagics(_ip) + nt.assert_equal(m.parse_options('foo', '')[1], 'foo') + nt.assert_equal(m.parse_options(u'foo', '')[1], u'foo') + + +def test_dirops(): + """Test various directory handling operations.""" + # curpath = lambda :os.path.splitdrive(os.getcwd())[1].replace('\\','/') + curpath = os.getcwd + startdir = os.getcwd() + ipdir = os.path.realpath(_ip.ipython_dir) + try: + _ip.magic('cd "%s"' % ipdir) + nt.assert_equal(curpath(), ipdir) + _ip.magic('cd -') + nt.assert_equal(curpath(), startdir) + _ip.magic('pushd "%s"' % ipdir) + nt.assert_equal(curpath(), ipdir) + _ip.magic('popd') + nt.assert_equal(curpath(), startdir) + finally: + os.chdir(startdir) + + +def test_cd_force_quiet(): + """Test OSMagics.cd_force_quiet option""" + _ip.config.OSMagics.cd_force_quiet = True + osmagics = osm.OSMagics(shell=_ip) + + startdir = os.getcwd() + ipdir = os.path.realpath(_ip.ipython_dir) + + try: + with tt.AssertNotPrints(ipdir): + osmagics.cd('"%s"' % ipdir) + with tt.AssertNotPrints(startdir): + osmagics.cd('-') + finally: + os.chdir(startdir) + + +def test_xmode(): + # Calling xmode three times should be a no-op + xmode = _ip.InteractiveTB.mode + for i in range(4): + _ip.magic("xmode") + nt.assert_equal(_ip.InteractiveTB.mode, xmode) + +def test_reset_hard(): + monitor = [] + class A(object): + def __del__(self): + monitor.append(1) + def __repr__(self): + return "" + + _ip.user_ns["a"] = A() + _ip.run_cell("a") + + nt.assert_equal(monitor, []) + _ip.magic("reset -f") + nt.assert_equal(monitor, [1]) + +class TestXdel(tt.TempFileMixin): + def test_xdel(self): + """Test that references from %run are cleared by xdel.""" + src = ("class A(object):\n" + " monitor = []\n" + " def __del__(self):\n" + " self.monitor.append(1)\n" + "a = A()\n") + self.mktmp(src) + # %run creates some hidden references... + _ip.magic("run %s" % self.fname) + # ... as does the displayhook. + _ip.run_cell("a") + + monitor = _ip.user_ns["A"].monitor + nt.assert_equal(monitor, []) + + _ip.magic("xdel a") + + # Check that a's __del__ method has been called. + nt.assert_equal(monitor, [1]) + +def doctest_who(): + """doctest for %who + + In [1]: %reset -f + + In [2]: alpha = 123 + + In [3]: beta = 'beta' + + In [4]: %who int + alpha + + In [5]: %who str + beta + + In [6]: %whos + Variable Type Data/Info + ---------------------------- + alpha int 123 + beta str beta + + In [7]: %who_ls + Out[7]: ['alpha', 'beta'] + """ + +def test_whos(): + """Check that whos is protected against objects where repr() fails.""" + class A(object): + def __repr__(self): + raise Exception() + _ip.user_ns['a'] = A() + _ip.magic("whos") + +def doctest_precision(): + """doctest for %precision + + In [1]: f = get_ipython().display_formatter.formatters['text/plain'] + + In [2]: %precision 5 + Out[2]: '%.5f' + + In [3]: f.float_format + Out[3]: '%.5f' + + In [4]: %precision %e + Out[4]: '%e' + + In [5]: f(3.1415927) + Out[5]: '3.141593e+00' + """ + +def test_psearch(): + with tt.AssertPrints("dict.fromkeys"): + _ip.run_cell("dict.fr*?") + with tt.AssertPrints("π.is_integer"): + _ip.run_cell("π = 3.14;\nπ.is_integ*?") + +def test_timeit_shlex(): + """test shlex issues with timeit (#1109)""" + _ip.ex("def f(*a,**kw): pass") + _ip.magic('timeit -n1 "this is a bug".count(" ")') + _ip.magic('timeit -r1 -n1 f(" ", 1)') + _ip.magic('timeit -r1 -n1 f(" ", 1, " ", 2, " ")') + _ip.magic('timeit -r1 -n1 ("a " + "b")') + _ip.magic('timeit -r1 -n1 f("a " + "b")') + _ip.magic('timeit -r1 -n1 f("a " + "b ")') + + +def test_timeit_special_syntax(): + "Test %%timeit with IPython special syntax" + @register_line_magic + def lmagic(line): + ip = get_ipython() + ip.user_ns['lmagic_out'] = line + + # line mode test + _ip.run_line_magic('timeit', '-n1 -r1 %lmagic my line') + nt.assert_equal(_ip.user_ns['lmagic_out'], 'my line') + # cell mode test + _ip.run_cell_magic('timeit', '-n1 -r1', '%lmagic my line2') + nt.assert_equal(_ip.user_ns['lmagic_out'], 'my line2') + +def test_timeit_return(): + """ + test whether timeit -o return object + """ + + res = _ip.run_line_magic('timeit','-n10 -r10 -o 1') + assert(res is not None) + +def test_timeit_quiet(): + """ + test quiet option of timeit magic + """ + with tt.AssertNotPrints("loops"): + _ip.run_cell("%timeit -n1 -r1 -q 1") + +def test_timeit_return_quiet(): + with tt.AssertNotPrints("loops"): + res = _ip.run_line_magic('timeit', '-n1 -r1 -q -o 1') + assert (res is not None) + +def test_timeit_invalid_return(): + with nt.assert_raises_regex(SyntaxError, "outside function"): + _ip.run_line_magic('timeit', 'return') + +@dec.skipif(execution.profile is None) +def test_prun_special_syntax(): + "Test %%prun with IPython special syntax" + @register_line_magic + def lmagic(line): + ip = get_ipython() + ip.user_ns['lmagic_out'] = line + + # line mode test + _ip.run_line_magic('prun', '-q %lmagic my line') + nt.assert_equal(_ip.user_ns['lmagic_out'], 'my line') + # cell mode test + _ip.run_cell_magic('prun', '-q', '%lmagic my line2') + nt.assert_equal(_ip.user_ns['lmagic_out'], 'my line2') + +@dec.skipif(execution.profile is None) +def test_prun_quotes(): + "Test that prun does not clobber string escapes (GH #1302)" + _ip.magic(r"prun -q x = '\t'") + nt.assert_equal(_ip.user_ns['x'], '\t') + +def test_extension(): + # Debugging information for failures of this test + print('sys.path:') + for p in sys.path: + print(' ', p) + print('CWD', os.getcwd()) + + nt.assert_raises(ImportError, _ip.magic, "load_ext daft_extension") + daft_path = os.path.join(os.path.dirname(__file__), "daft_extension") + sys.path.insert(0, daft_path) + try: + _ip.user_ns.pop('arq', None) + invalidate_caches() # Clear import caches + _ip.magic("load_ext daft_extension") + nt.assert_equal(_ip.user_ns['arq'], 185) + _ip.magic("unload_ext daft_extension") + assert 'arq' not in _ip.user_ns + finally: + sys.path.remove(daft_path) + + +def test_notebook_export_json(): + _ip = get_ipython() + _ip.history_manager.reset() # Clear any existing history. + cmds = [u"a=1", u"def b():\n return a**2", u"print('noël, été', b())"] + for i, cmd in enumerate(cmds, start=1): + _ip.history_manager.store_inputs(i, cmd) + with TemporaryDirectory() as td: + outfile = os.path.join(td, "nb.ipynb") + _ip.magic("notebook -e %s" % outfile) + + +class TestEnv(TestCase): + + def test_env(self): + env = _ip.magic("env") + self.assertTrue(isinstance(env, dict)) + + def test_env_secret(self): + env = _ip.magic("env") + hidden = "" + with mock.patch.dict( + os.environ, + { + "API_KEY": "abc123", + "SECRET_THING": "ssshhh", + "JUPYTER_TOKEN": "", + "VAR": "abc" + } + ): + env = _ip.magic("env") + assert env["API_KEY"] == hidden + assert env["SECRET_THING"] == hidden + assert env["JUPYTER_TOKEN"] == hidden + assert env["VAR"] == "abc" + + def test_env_get_set_simple(self): + env = _ip.magic("env var val1") + self.assertEqual(env, None) + self.assertEqual(os.environ['var'], 'val1') + self.assertEqual(_ip.magic("env var"), 'val1') + env = _ip.magic("env var=val2") + self.assertEqual(env, None) + self.assertEqual(os.environ['var'], 'val2') + + def test_env_get_set_complex(self): + env = _ip.magic("env var 'val1 '' 'val2") + self.assertEqual(env, None) + self.assertEqual(os.environ['var'], "'val1 '' 'val2") + self.assertEqual(_ip.magic("env var"), "'val1 '' 'val2") + env = _ip.magic('env var=val2 val3="val4') + self.assertEqual(env, None) + self.assertEqual(os.environ['var'], 'val2 val3="val4') + + def test_env_set_bad_input(self): + self.assertRaises(UsageError, lambda: _ip.magic("set_env var")) + + def test_env_set_whitespace(self): + self.assertRaises(UsageError, lambda: _ip.magic("env var A=B")) + + +class CellMagicTestCase(TestCase): + + def check_ident(self, magic): + # Manually called, we get the result + out = _ip.run_cell_magic(magic, 'a', 'b') + nt.assert_equal(out, ('a','b')) + # Via run_cell, it goes into the user's namespace via displayhook + _ip.run_cell('%%' + magic +' c\nd\n') + nt.assert_equal(_ip.user_ns['_'], ('c','d\n')) + + def test_cell_magic_func_deco(self): + "Cell magic using simple decorator" + @register_cell_magic + def cellm(line, cell): + return line, cell + + self.check_ident('cellm') + + def test_cell_magic_reg(self): + "Cell magic manually registered" + def cellm(line, cell): + return line, cell + + _ip.register_magic_function(cellm, 'cell', 'cellm2') + self.check_ident('cellm2') + + def test_cell_magic_class(self): + "Cell magics declared via a class" + @magics_class + class MyMagics(Magics): + + @cell_magic + def cellm3(self, line, cell): + return line, cell + + _ip.register_magics(MyMagics) + self.check_ident('cellm3') + + def test_cell_magic_class2(self): + "Cell magics declared via a class, #2" + @magics_class + class MyMagics2(Magics): + + @cell_magic('cellm4') + def cellm33(self, line, cell): + return line, cell + + _ip.register_magics(MyMagics2) + self.check_ident('cellm4') + # Check that nothing is registered as 'cellm33' + c33 = _ip.find_cell_magic('cellm33') + nt.assert_equal(c33, None) + +def test_file(): + """Basic %%writefile""" + ip = get_ipython() + with TemporaryDirectory() as td: + fname = os.path.join(td, 'file1') + ip.run_cell_magic("writefile", fname, u'\n'.join([ + 'line1', + 'line2', + ])) + with open(fname) as f: + s = f.read() + nt.assert_in('line1\n', s) + nt.assert_in('line2', s) + +@dec.skip_win32 +def test_file_single_quote(): + """Basic %%writefile with embedded single quotes""" + ip = get_ipython() + with TemporaryDirectory() as td: + fname = os.path.join(td, '\'file1\'') + ip.run_cell_magic("writefile", fname, u'\n'.join([ + 'line1', + 'line2', + ])) + with open(fname) as f: + s = f.read() + nt.assert_in('line1\n', s) + nt.assert_in('line2', s) + +@dec.skip_win32 +def test_file_double_quote(): + """Basic %%writefile with embedded double quotes""" + ip = get_ipython() + with TemporaryDirectory() as td: + fname = os.path.join(td, '"file1"') + ip.run_cell_magic("writefile", fname, u'\n'.join([ + 'line1', + 'line2', + ])) + with open(fname) as f: + s = f.read() + nt.assert_in('line1\n', s) + nt.assert_in('line2', s) + +def test_file_var_expand(): + """%%writefile $filename""" + ip = get_ipython() + with TemporaryDirectory() as td: + fname = os.path.join(td, 'file1') + ip.user_ns['filename'] = fname + ip.run_cell_magic("writefile", '$filename', u'\n'.join([ + 'line1', + 'line2', + ])) + with open(fname) as f: + s = f.read() + nt.assert_in('line1\n', s) + nt.assert_in('line2', s) + +def test_file_unicode(): + """%%writefile with unicode cell""" + ip = get_ipython() + with TemporaryDirectory() as td: + fname = os.path.join(td, 'file1') + ip.run_cell_magic("writefile", fname, u'\n'.join([ + u'liné1', + u'liné2', + ])) + with io.open(fname, encoding='utf-8') as f: + s = f.read() + nt.assert_in(u'liné1\n', s) + nt.assert_in(u'liné2', s) + +def test_file_amend(): + """%%writefile -a amends files""" + ip = get_ipython() + with TemporaryDirectory() as td: + fname = os.path.join(td, 'file2') + ip.run_cell_magic("writefile", fname, u'\n'.join([ + 'line1', + 'line2', + ])) + ip.run_cell_magic("writefile", "-a %s" % fname, u'\n'.join([ + 'line3', + 'line4', + ])) + with open(fname) as f: + s = f.read() + nt.assert_in('line1\n', s) + nt.assert_in('line3\n', s) + +def test_file_spaces(): + """%%file with spaces in filename""" + ip = get_ipython() + with TemporaryWorkingDirectory() as td: + fname = "file name" + ip.run_cell_magic("file", '"%s"'%fname, u'\n'.join([ + 'line1', + 'line2', + ])) + with open(fname) as f: + s = f.read() + nt.assert_in('line1\n', s) + nt.assert_in('line2', s) + +def test_script_config(): + ip = get_ipython() + ip.config.ScriptMagics.script_magics = ['whoda'] + sm = script.ScriptMagics(shell=ip) + nt.assert_in('whoda', sm.magics['cell']) + +@dec.skip_win32 +def test_script_out(): + ip = get_ipython() + ip.run_cell_magic("script", "--out output sh", "echo 'hi'") + nt.assert_equal(ip.user_ns['output'], 'hi\n') + +@dec.skip_win32 +def test_script_err(): + ip = get_ipython() + ip.run_cell_magic("script", "--err error sh", "echo 'hello' >&2") + nt.assert_equal(ip.user_ns['error'], 'hello\n') + +@dec.skip_win32 +def test_script_out_err(): + ip = get_ipython() + ip.run_cell_magic("script", "--out output --err error sh", "echo 'hi'\necho 'hello' >&2") + nt.assert_equal(ip.user_ns['output'], 'hi\n') + nt.assert_equal(ip.user_ns['error'], 'hello\n') + +@dec.skip_win32 +def test_script_bg_out(): + ip = get_ipython() + ip.run_cell_magic("script", "--bg --out output sh", "echo 'hi'") + + nt.assert_equal(ip.user_ns['output'].read(), b'hi\n') + ip.user_ns['output'].close() + +@dec.skip_win32 +def test_script_bg_err(): + ip = get_ipython() + ip.run_cell_magic("script", "--bg --err error sh", "echo 'hello' >&2") + nt.assert_equal(ip.user_ns['error'].read(), b'hello\n') + ip.user_ns['error'].close() + +@dec.skip_win32 +def test_script_bg_out_err(): + ip = get_ipython() + ip.run_cell_magic("script", "--bg --out output --err error sh", "echo 'hi'\necho 'hello' >&2") + nt.assert_equal(ip.user_ns['output'].read(), b'hi\n') + nt.assert_equal(ip.user_ns['error'].read(), b'hello\n') + ip.user_ns['output'].close() + ip.user_ns['error'].close() + +def test_script_defaults(): + ip = get_ipython() + for cmd in ['sh', 'bash', 'perl', 'ruby']: + try: + find_cmd(cmd) + except Exception: + pass + else: + nt.assert_in(cmd, ip.magics_manager.magics['cell']) + + +@magics_class +class FooFoo(Magics): + """class with both %foo and %%foo magics""" + @line_magic('foo') + def line_foo(self, line): + "I am line foo" + pass + + @cell_magic("foo") + def cell_foo(self, line, cell): + "I am cell foo, not line foo" + pass + +def test_line_cell_info(): + """%%foo and %foo magics are distinguishable to inspect""" + ip = get_ipython() + ip.magics_manager.register(FooFoo) + oinfo = ip.object_inspect('foo') + nt.assert_true(oinfo['found']) + nt.assert_true(oinfo['ismagic']) + + oinfo = ip.object_inspect('%%foo') + nt.assert_true(oinfo['found']) + nt.assert_true(oinfo['ismagic']) + nt.assert_equal(oinfo['docstring'], FooFoo.cell_foo.__doc__) + + oinfo = ip.object_inspect('%foo') + nt.assert_true(oinfo['found']) + nt.assert_true(oinfo['ismagic']) + nt.assert_equal(oinfo['docstring'], FooFoo.line_foo.__doc__) + +def test_multiple_magics(): + ip = get_ipython() + foo1 = FooFoo(ip) + foo2 = FooFoo(ip) + mm = ip.magics_manager + mm.register(foo1) + nt.assert_true(mm.magics['line']['foo'].__self__ is foo1) + mm.register(foo2) + nt.assert_true(mm.magics['line']['foo'].__self__ is foo2) + +def test_alias_magic(): + """Test %alias_magic.""" + ip = get_ipython() + mm = ip.magics_manager + + # Basic operation: both cell and line magics are created, if possible. + ip.run_line_magic('alias_magic', 'timeit_alias timeit') + nt.assert_in('timeit_alias', mm.magics['line']) + nt.assert_in('timeit_alias', mm.magics['cell']) + + # --cell is specified, line magic not created. + ip.run_line_magic('alias_magic', '--cell timeit_cell_alias timeit') + nt.assert_not_in('timeit_cell_alias', mm.magics['line']) + nt.assert_in('timeit_cell_alias', mm.magics['cell']) + + # Test that line alias is created successfully. + ip.run_line_magic('alias_magic', '--line env_alias env') + nt.assert_equal(ip.run_line_magic('env', ''), + ip.run_line_magic('env_alias', '')) + + # Test that line alias with parameters passed in is created successfully. + ip.run_line_magic('alias_magic', '--line history_alias history --params ' + shlex.quote('3')) + nt.assert_in('history_alias', mm.magics['line']) + + +def test_save(): + """Test %save.""" + ip = get_ipython() + ip.history_manager.reset() # Clear any existing history. + cmds = [u"a=1", u"def b():\n return a**2", u"print(a, b())"] + for i, cmd in enumerate(cmds, start=1): + ip.history_manager.store_inputs(i, cmd) + with TemporaryDirectory() as tmpdir: + file = os.path.join(tmpdir, "testsave.py") + ip.run_line_magic("save", "%s 1-10" % file) + with open(file) as f: + content = f.read() + nt.assert_equal(content.count(cmds[0]), 1) + nt.assert_in('coding: utf-8', content) + ip.run_line_magic("save", "-a %s 1-10" % file) + with open(file) as f: + content = f.read() + nt.assert_equal(content.count(cmds[0]), 2) + nt.assert_in('coding: utf-8', content) + + +def test_store(): + """Test %store.""" + ip = get_ipython() + ip.run_line_magic('load_ext', 'storemagic') + + # make sure the storage is empty + ip.run_line_magic('store', '-z') + ip.user_ns['var'] = 42 + ip.run_line_magic('store', 'var') + ip.user_ns['var'] = 39 + ip.run_line_magic('store', '-r') + nt.assert_equal(ip.user_ns['var'], 42) + + ip.run_line_magic('store', '-d var') + ip.user_ns['var'] = 39 + ip.run_line_magic('store' , '-r') + nt.assert_equal(ip.user_ns['var'], 39) + + +def _run_edit_test(arg_s, exp_filename=None, + exp_lineno=-1, + exp_contents=None, + exp_is_temp=None): + ip = get_ipython() + M = code.CodeMagics(ip) + last_call = ['',''] + opts,args = M.parse_options(arg_s,'prxn:') + filename, lineno, is_temp = M._find_edit_target(ip, args, opts, last_call) + + if exp_filename is not None: + nt.assert_equal(exp_filename, filename) + if exp_contents is not None: + with io.open(filename, 'r', encoding='utf-8') as f: + contents = f.read() + nt.assert_equal(exp_contents, contents) + if exp_lineno != -1: + nt.assert_equal(exp_lineno, lineno) + if exp_is_temp is not None: + nt.assert_equal(exp_is_temp, is_temp) + + +def test_edit_interactive(): + """%edit on interactively defined objects""" + ip = get_ipython() + n = ip.execution_count + ip.run_cell(u"def foo(): return 1", store_history=True) + + try: + _run_edit_test("foo") + except code.InteractivelyDefined as e: + nt.assert_equal(e.index, n) + else: + raise AssertionError("Should have raised InteractivelyDefined") + + +def test_edit_cell(): + """%edit [cell id]""" + ip = get_ipython() + + ip.run_cell(u"def foo(): return 1", store_history=True) + + # test + _run_edit_test("1", exp_contents=ip.user_ns['In'][1], exp_is_temp=True) + +def test_bookmark(): + ip = get_ipython() + ip.run_line_magic('bookmark', 'bmname') + with tt.AssertPrints('bmname'): + ip.run_line_magic('bookmark', '-l') + ip.run_line_magic('bookmark', '-d bmname') + +def test_ls_magic(): + ip = get_ipython() + json_formatter = ip.display_formatter.formatters['application/json'] + json_formatter.enabled = True + lsmagic = ip.magic('lsmagic') + with warnings.catch_warnings(record=True) as w: + j = json_formatter(lsmagic) + nt.assert_equal(sorted(j), ['cell', 'line']) + nt.assert_equal(w, []) # no warnings + +def test_strip_initial_indent(): + def sii(s): + lines = s.splitlines() + return '\n'.join(code.strip_initial_indent(lines)) + + nt.assert_equal(sii(" a = 1\nb = 2"), "a = 1\nb = 2") + nt.assert_equal(sii(" a\n b\nc"), "a\n b\nc") + nt.assert_equal(sii("a\n b"), "a\n b") + +def test_logging_magic_quiet_from_arg(): + _ip.config.LoggingMagics.quiet = False + lm = logging.LoggingMagics(shell=_ip) + with TemporaryDirectory() as td: + try: + with tt.AssertNotPrints(re.compile("Activating.*")): + lm.logstart('-q {}'.format( + os.path.join(td, "quiet_from_arg.log"))) + finally: + _ip.logger.logstop() + +def test_logging_magic_quiet_from_config(): + _ip.config.LoggingMagics.quiet = True + lm = logging.LoggingMagics(shell=_ip) + with TemporaryDirectory() as td: + try: + with tt.AssertNotPrints(re.compile("Activating.*")): + lm.logstart(os.path.join(td, "quiet_from_config.log")) + finally: + _ip.logger.logstop() + + +def test_logging_magic_not_quiet(): + _ip.config.LoggingMagics.quiet = False + lm = logging.LoggingMagics(shell=_ip) + with TemporaryDirectory() as td: + try: + with tt.AssertPrints(re.compile("Activating.*")): + lm.logstart(os.path.join(td, "not_quiet.log")) + finally: + _ip.logger.logstop() + + +def test_time_no_var_expand(): + _ip.user_ns['a'] = 5 + _ip.user_ns['b'] = [] + _ip.magic('time b.append("{a}")') + assert _ip.user_ns['b'] == ['{a}'] + + +# this is slow, put at the end for local testing. +def test_timeit_arguments(): + "Test valid timeit arguments, should not cause SyntaxError (GH #1269)" + if sys.version_info < (3,7): + _ip.magic("timeit -n1 -r1 ('#')") + else: + # 3.7 optimize no-op statement like above out, and complain there is + # nothing in the for loop. + _ip.magic("timeit -n1 -r1 a=('#')") diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_magic_arguments.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_magic_arguments.py new file mode 100644 index 00000000..5dea32dd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_magic_arguments.py @@ -0,0 +1,118 @@ +#----------------------------------------------------------------------------- +# Copyright (C) 2010-2011, IPython Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +import argparse +from nose.tools import assert_equal + +from IPython.core.magic_arguments import (argument, argument_group, kwds, + magic_arguments, parse_argstring, real_name) + + +@magic_arguments() +@argument('-f', '--foo', help="an argument") +def magic_foo1(self, args): + """ A docstring. + """ + return parse_argstring(magic_foo1, args) + + +@magic_arguments() +def magic_foo2(self, args): + """ A docstring. + """ + return parse_argstring(magic_foo2, args) + + +@magic_arguments() +@argument('-f', '--foo', help="an argument") +@argument_group('Group') +@argument('-b', '--bar', help="a grouped argument") +@argument_group('Second Group') +@argument('-z', '--baz', help="another grouped argument") +def magic_foo3(self, args): + """ A docstring. + """ + return parse_argstring(magic_foo3, args) + + +@magic_arguments() +@kwds(argument_default=argparse.SUPPRESS) +@argument('-f', '--foo', help="an argument") +def magic_foo4(self, args): + """ A docstring. + """ + return parse_argstring(magic_foo4, args) + + +@magic_arguments('frobnicate') +@argument('-f', '--foo', help="an argument") +def magic_foo5(self, args): + """ A docstring. + """ + return parse_argstring(magic_foo5, args) + + +@magic_arguments() +@argument('-f', '--foo', help="an argument") +def magic_magic_foo(self, args): + """ A docstring. + """ + return parse_argstring(magic_magic_foo, args) + + +@magic_arguments() +@argument('-f', '--foo', help="an argument") +def foo(self, args): + """ A docstring. + """ + return parse_argstring(foo, args) + + +def test_magic_arguments(): + assert_equal(magic_foo1.__doc__, '::\n\n %foo1 [-f FOO]\n\n A docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n') + assert_equal(getattr(magic_foo1, 'argcmd_name', None), None) + assert_equal(real_name(magic_foo1), 'foo1') + assert_equal(magic_foo1(None, ''), argparse.Namespace(foo=None)) + assert hasattr(magic_foo1, 'has_arguments') + + assert_equal(magic_foo2.__doc__, '::\n\n %foo2\n\n A docstring.\n') + assert_equal(getattr(magic_foo2, 'argcmd_name', None), None) + assert_equal(real_name(magic_foo2), 'foo2') + assert_equal(magic_foo2(None, ''), argparse.Namespace()) + assert hasattr(magic_foo2, 'has_arguments') + + assert_equal(magic_foo3.__doc__, '::\n\n %foo3 [-f FOO] [-b BAR] [-z BAZ]\n\n A docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n\nGroup:\n -b BAR, --bar BAR a grouped argument\n\nSecond Group:\n -z BAZ, --baz BAZ another grouped argument\n') + assert_equal(getattr(magic_foo3, 'argcmd_name', None), None) + assert_equal(real_name(magic_foo3), 'foo3') + assert_equal(magic_foo3(None, ''), + argparse.Namespace(bar=None, baz=None, foo=None)) + assert hasattr(magic_foo3, 'has_arguments') + + assert_equal(magic_foo4.__doc__, '::\n\n %foo4 [-f FOO]\n\n A docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n') + assert_equal(getattr(magic_foo4, 'argcmd_name', None), None) + assert_equal(real_name(magic_foo4), 'foo4') + assert_equal(magic_foo4(None, ''), argparse.Namespace()) + assert hasattr(magic_foo4, 'has_arguments') + + assert_equal(magic_foo5.__doc__, '::\n\n %frobnicate [-f FOO]\n\n A docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n') + assert_equal(getattr(magic_foo5, 'argcmd_name', None), 'frobnicate') + assert_equal(real_name(magic_foo5), 'frobnicate') + assert_equal(magic_foo5(None, ''), argparse.Namespace(foo=None)) + assert hasattr(magic_foo5, 'has_arguments') + + assert_equal(magic_magic_foo.__doc__, '::\n\n %magic_foo [-f FOO]\n\n A docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n') + assert_equal(getattr(magic_magic_foo, 'argcmd_name', None), None) + assert_equal(real_name(magic_magic_foo), 'magic_foo') + assert_equal(magic_magic_foo(None, ''), argparse.Namespace(foo=None)) + assert hasattr(magic_magic_foo, 'has_arguments') + + assert_equal(foo.__doc__, '::\n\n %foo [-f FOO]\n\n A docstring.\n\noptional arguments:\n -f FOO, --foo FOO an argument\n') + assert_equal(getattr(foo, 'argcmd_name', None), None) + assert_equal(real_name(foo), 'foo') + assert_equal(foo(None, ''), argparse.Namespace(foo=None)) + assert hasattr(foo, 'has_arguments') diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_magic_terminal.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_magic_terminal.py new file mode 100644 index 00000000..79e2d3ed --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_magic_terminal.py @@ -0,0 +1,192 @@ +"""Tests for various magic functions specific to the terminal frontend. + +Needs to be run by nose (to make ipython session available). +""" + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +import sys +from io import StringIO +from unittest import TestCase + +import nose.tools as nt + +from IPython.testing import tools as tt + +#----------------------------------------------------------------------------- +# Test functions begin +#----------------------------------------------------------------------------- + +def check_cpaste(code, should_fail=False): + """Execute code via 'cpaste' and ensure it was executed, unless + should_fail is set. + """ + ip.user_ns['code_ran'] = False + + src = StringIO() + if not hasattr(src, 'encoding'): + # IPython expects stdin to have an encoding attribute + src.encoding = None + src.write(code) + src.write('\n--\n') + src.seek(0) + + stdin_save = sys.stdin + sys.stdin = src + + try: + context = tt.AssertPrints if should_fail else tt.AssertNotPrints + with context("Traceback (most recent call last)"): + ip.magic('cpaste') + + if not should_fail: + assert ip.user_ns['code_ran'], "%r failed" % code + finally: + sys.stdin = stdin_save + +def test_cpaste(): + """Test cpaste magic""" + + def runf(): + """Marker function: sets a flag when executed. + """ + ip.user_ns['code_ran'] = True + return 'runf' # return string so '+ runf()' doesn't result in success + + tests = {'pass': ["runf()", + "In [1]: runf()", + "In [1]: if 1:\n ...: runf()", + "> > > runf()", + ">>> runf()", + " >>> runf()", + ], + + 'fail': ["1 + runf()", + "++ runf()", + ]} + + ip.user_ns['runf'] = runf + + for code in tests['pass']: + check_cpaste(code) + + for code in tests['fail']: + check_cpaste(code, should_fail=True) + + +class PasteTestCase(TestCase): + """Multiple tests for clipboard pasting""" + + def paste(self, txt, flags='-q'): + """Paste input text, by default in quiet mode""" + ip.hooks.clipboard_get = lambda : txt + ip.magic('paste '+flags) + + def setUp(self): + # Inject fake clipboard hook but save original so we can restore it later + self.original_clip = ip.hooks.clipboard_get + + def tearDown(self): + # Restore original hook + ip.hooks.clipboard_get = self.original_clip + + def test_paste(self): + ip.user_ns.pop('x', None) + self.paste('x = 1') + nt.assert_equal(ip.user_ns['x'], 1) + ip.user_ns.pop('x') + + def test_paste_pyprompt(self): + ip.user_ns.pop('x', None) + self.paste('>>> x=2') + nt.assert_equal(ip.user_ns['x'], 2) + ip.user_ns.pop('x') + + def test_paste_py_multi(self): + self.paste(""" + >>> x = [1,2,3] + >>> y = [] + >>> for i in x: + ... y.append(i**2) + ... + """) + nt.assert_equal(ip.user_ns['x'], [1,2,3]) + nt.assert_equal(ip.user_ns['y'], [1,4,9]) + + def test_paste_py_multi_r(self): + "Now, test that self.paste -r works" + self.test_paste_py_multi() + nt.assert_equal(ip.user_ns.pop('x'), [1,2,3]) + nt.assert_equal(ip.user_ns.pop('y'), [1,4,9]) + nt.assert_false('x' in ip.user_ns) + ip.magic('paste -r') + nt.assert_equal(ip.user_ns['x'], [1,2,3]) + nt.assert_equal(ip.user_ns['y'], [1,4,9]) + + def test_paste_email(self): + "Test pasting of email-quoted contents" + self.paste("""\ + >> def foo(x): + >> return x + 1 + >> xx = foo(1.1)""") + nt.assert_equal(ip.user_ns['xx'], 2.1) + + def test_paste_email2(self): + "Email again; some programs add a space also at each quoting level" + self.paste("""\ + > > def foo(x): + > > return x + 1 + > > yy = foo(2.1) """) + nt.assert_equal(ip.user_ns['yy'], 3.1) + + def test_paste_email_py(self): + "Email quoting of interactive input" + self.paste("""\ + >> >>> def f(x): + >> ... return x+1 + >> ... + >> >>> zz = f(2.5) """) + nt.assert_equal(ip.user_ns['zz'], 3.5) + + def test_paste_echo(self): + "Also test self.paste echoing, by temporarily faking the writer" + w = StringIO() + writer = ip.write + ip.write = w.write + code = """ + a = 100 + b = 200""" + try: + self.paste(code,'') + out = w.getvalue() + finally: + ip.write = writer + nt.assert_equal(ip.user_ns['a'], 100) + nt.assert_equal(ip.user_ns['b'], 200) + assert out == code+"\n## -- End pasted text --\n" + + def test_paste_leading_commas(self): + "Test multiline strings with leading commas" + tm = ip.magics_manager.registry['TerminalMagics'] + s = '''\ +a = """ +,1,2,3 +"""''' + ip.user_ns.pop('foo', None) + tm.store_or_execute(s, 'foo') + nt.assert_in('foo', ip.user_ns) + + + def test_paste_trailing_question(self): + "Test pasting sources with trailing question marks" + tm = ip.magics_manager.registry['TerminalMagics'] + s = '''\ +def funcfoo(): + if True: #am i true? + return 'fooresult' +''' + ip.user_ns.pop('funcfoo', None) + self.paste(s) + nt.assert_equal(ip.user_ns['funcfoo'](), 'fooresult') diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_oinspect.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_oinspect.py new file mode 100644 index 00000000..19c6db7c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_oinspect.py @@ -0,0 +1,447 @@ +"""Tests for the object inspection functionality. +""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + + +from inspect import signature, Signature, Parameter +import os +import re + +import nose.tools as nt + +from .. import oinspect + +from decorator import decorator + +from IPython.testing.tools import AssertPrints, AssertNotPrints +from IPython.utils.path import compress_user + + +#----------------------------------------------------------------------------- +# Globals and constants +#----------------------------------------------------------------------------- + +inspector = None + +def setup_module(): + global inspector + inspector = oinspect.Inspector() + + +#----------------------------------------------------------------------------- +# Local utilities +#----------------------------------------------------------------------------- + +# WARNING: since this test checks the line number where a function is +# defined, if any code is inserted above, the following line will need to be +# updated. Do NOT insert any whitespace between the next line and the function +# definition below. +THIS_LINE_NUMBER = 41 # Put here the actual number of this line + +from unittest import TestCase + +class Test(TestCase): + + def test_find_source_lines(self): + self.assertEqual(oinspect.find_source_lines(Test.test_find_source_lines), + THIS_LINE_NUMBER+6) + + +# A couple of utilities to ensure these tests work the same from a source or a +# binary install +def pyfile(fname): + return os.path.normcase(re.sub('.py[co]$', '.py', fname)) + + +def match_pyfiles(f1, f2): + nt.assert_equal(pyfile(f1), pyfile(f2)) + + +def test_find_file(): + match_pyfiles(oinspect.find_file(test_find_file), os.path.abspath(__file__)) + + +def test_find_file_decorated1(): + + @decorator + def noop1(f): + def wrapper(*a, **kw): + return f(*a, **kw) + return wrapper + + @noop1 + def f(x): + "My docstring" + + match_pyfiles(oinspect.find_file(f), os.path.abspath(__file__)) + nt.assert_equal(f.__doc__, "My docstring") + + +def test_find_file_decorated2(): + + @decorator + def noop2(f, *a, **kw): + return f(*a, **kw) + + @noop2 + @noop2 + @noop2 + def f(x): + "My docstring 2" + + match_pyfiles(oinspect.find_file(f), os.path.abspath(__file__)) + nt.assert_equal(f.__doc__, "My docstring 2") + + +def test_find_file_magic(): + run = ip.find_line_magic('run') + nt.assert_not_equal(oinspect.find_file(run), None) + + +# A few generic objects we can then inspect in the tests below + +class Call(object): + """This is the class docstring.""" + + def __init__(self, x, y=1): + """This is the constructor docstring.""" + + def __call__(self, *a, **kw): + """This is the call docstring.""" + + def method(self, x, z=2): + """Some method's docstring""" + +class HasSignature(object): + """This is the class docstring.""" + __signature__ = Signature([Parameter('test', Parameter.POSITIONAL_OR_KEYWORD)]) + + def __init__(self, *args): + """This is the init docstring""" + + +class SimpleClass(object): + def method(self, x, z=2): + """Some method's docstring""" + + +class Awkward(object): + def __getattr__(self, name): + raise Exception(name) + +class NoBoolCall: + """ + callable with `__bool__` raising should still be inspect-able. + """ + + def __call__(self): + """does nothing""" + pass + + def __bool__(self): + """just raise NotImplemented""" + raise NotImplementedError('Must be implemented') + + +class SerialLiar(object): + """Attribute accesses always get another copy of the same class. + + unittest.mock.call does something similar, but it's not ideal for testing + as the failure mode is to eat all your RAM. This gives up after 10k levels. + """ + def __init__(self, max_fibbing_twig, lies_told=0): + if lies_told > 10000: + raise RuntimeError('Nose too long, honesty is the best policy') + self.max_fibbing_twig = max_fibbing_twig + self.lies_told = lies_told + max_fibbing_twig[0] = max(max_fibbing_twig[0], lies_told) + + def __getattr__(self, item): + return SerialLiar(self.max_fibbing_twig, self.lies_told + 1) + +#----------------------------------------------------------------------------- +# Tests +#----------------------------------------------------------------------------- + +def test_info(): + "Check that Inspector.info fills out various fields as expected." + i = inspector.info(Call, oname='Call') + nt.assert_equal(i['type_name'], 'type') + expted_class = str(type(type)) # (Python 3) or + nt.assert_equal(i['base_class'], expted_class) + nt.assert_regex(i['string_form'], "") + fname = __file__ + if fname.endswith(".pyc"): + fname = fname[:-1] + # case-insensitive comparison needed on some filesystems + # e.g. Windows: + nt.assert_equal(i['file'].lower(), compress_user(fname).lower()) + nt.assert_equal(i['definition'], None) + nt.assert_equal(i['docstring'], Call.__doc__) + nt.assert_equal(i['source'], None) + nt.assert_true(i['isclass']) + nt.assert_equal(i['init_definition'], "Call(x, y=1)") + nt.assert_equal(i['init_docstring'], Call.__init__.__doc__) + + i = inspector.info(Call, detail_level=1) + nt.assert_not_equal(i['source'], None) + nt.assert_equal(i['docstring'], None) + + c = Call(1) + c.__doc__ = "Modified instance docstring" + i = inspector.info(c) + nt.assert_equal(i['type_name'], 'Call') + nt.assert_equal(i['docstring'], "Modified instance docstring") + nt.assert_equal(i['class_docstring'], Call.__doc__) + nt.assert_equal(i['init_docstring'], Call.__init__.__doc__) + nt.assert_equal(i['call_docstring'], Call.__call__.__doc__) + +def test_class_signature(): + info = inspector.info(HasSignature, 'HasSignature') + nt.assert_equal(info['init_definition'], "HasSignature(test)") + nt.assert_equal(info['init_docstring'], HasSignature.__init__.__doc__) + +def test_info_awkward(): + # Just test that this doesn't throw an error. + inspector.info(Awkward()) + +def test_bool_raise(): + inspector.info(NoBoolCall()) + +def test_info_serialliar(): + fib_tracker = [0] + inspector.info(SerialLiar(fib_tracker)) + + # Nested attribute access should be cut off at 100 levels deep to avoid + # infinite loops: https://github.com/ipython/ipython/issues/9122 + nt.assert_less(fib_tracker[0], 9000) + +def support_function_one(x, y=2, *a, **kw): + """A simple function.""" + +def test_calldef_none(): + # We should ignore __call__ for all of these. + for obj in [support_function_one, SimpleClass().method, any, str.upper]: + i = inspector.info(obj) + nt.assert_is(i['call_def'], None) + +def f_kwarg(pos, *, kwonly): + pass + +def test_definition_kwonlyargs(): + i = inspector.info(f_kwarg, oname='f_kwarg') # analysis:ignore + nt.assert_equal(i['definition'], "f_kwarg(pos, *, kwonly)") + +def test_getdoc(): + class A(object): + """standard docstring""" + pass + + class B(object): + """standard docstring""" + def getdoc(self): + return "custom docstring" + + class C(object): + """standard docstring""" + def getdoc(self): + return None + + a = A() + b = B() + c = C() + + nt.assert_equal(oinspect.getdoc(a), "standard docstring") + nt.assert_equal(oinspect.getdoc(b), "custom docstring") + nt.assert_equal(oinspect.getdoc(c), "standard docstring") + + +def test_empty_property_has_no_source(): + i = inspector.info(property(), detail_level=1) + nt.assert_is(i['source'], None) + + +def test_property_sources(): + import posixpath + # A simple adder whose source and signature stays + # the same across Python distributions + def simple_add(a, b): + "Adds two numbers" + return a + b + + class A(object): + @property + def foo(self): + return 'bar' + + foo = foo.setter(lambda self, v: setattr(self, 'bar', v)) + + dname = property(posixpath.dirname) + adder = property(simple_add) + + i = inspector.info(A.foo, detail_level=1) + nt.assert_in('def foo(self):', i['source']) + nt.assert_in('lambda self, v:', i['source']) + + i = inspector.info(A.dname, detail_level=1) + nt.assert_in('def dirname(p)', i['source']) + + i = inspector.info(A.adder, detail_level=1) + nt.assert_in('def simple_add(a, b)', i['source']) + + +def test_property_docstring_is_in_info_for_detail_level_0(): + class A(object): + @property + def foobar(self): + """This is `foobar` property.""" + pass + + ip.user_ns['a_obj'] = A() + nt.assert_equal( + 'This is `foobar` property.', + ip.object_inspect('a_obj.foobar', detail_level=0)['docstring']) + + ip.user_ns['a_cls'] = A + nt.assert_equal( + 'This is `foobar` property.', + ip.object_inspect('a_cls.foobar', detail_level=0)['docstring']) + + +def test_pdef(): + # See gh-1914 + def foo(): pass + inspector.pdef(foo, 'foo') + + +def test_pinfo_nonascii(): + # See gh-1177 + from . import nonascii2 + ip.user_ns['nonascii2'] = nonascii2 + ip._inspect('pinfo', 'nonascii2', detail_level=1) + +def test_pinfo_type(): + """ + type can fail in various edge case, for example `type.__subclass__()` + """ + ip._inspect('pinfo', 'type') + + +def test_pinfo_docstring_no_source(): + """Docstring should be included with detail_level=1 if there is no source""" + with AssertPrints('Docstring:'): + ip._inspect('pinfo', 'str.format', detail_level=0) + with AssertPrints('Docstring:'): + ip._inspect('pinfo', 'str.format', detail_level=1) + + +def test_pinfo_no_docstring_if_source(): + """Docstring should not be included with detail_level=1 if source is found""" + def foo(): + """foo has a docstring""" + + ip.user_ns['foo'] = foo + + with AssertPrints('Docstring:'): + ip._inspect('pinfo', 'foo', detail_level=0) + with AssertPrints('Source:'): + ip._inspect('pinfo', 'foo', detail_level=1) + with AssertNotPrints('Docstring:'): + ip._inspect('pinfo', 'foo', detail_level=1) + + +def test_pinfo_docstring_if_detail_and_no_source(): + """ Docstring should be displayed if source info not available """ + obj_def = '''class Foo(object): + """ This is a docstring for Foo """ + def bar(self): + """ This is a docstring for Foo.bar """ + pass + ''' + + ip.run_cell(obj_def) + ip.run_cell('foo = Foo()') + + with AssertNotPrints("Source:"): + with AssertPrints('Docstring:'): + ip._inspect('pinfo', 'foo', detail_level=0) + with AssertPrints('Docstring:'): + ip._inspect('pinfo', 'foo', detail_level=1) + with AssertPrints('Docstring:'): + ip._inspect('pinfo', 'foo.bar', detail_level=0) + + with AssertNotPrints('Docstring:'): + with AssertPrints('Source:'): + ip._inspect('pinfo', 'foo.bar', detail_level=1) + + +def test_pinfo_magic(): + with AssertPrints('Docstring:'): + ip._inspect('pinfo', 'lsmagic', detail_level=0) + + with AssertPrints('Source:'): + ip._inspect('pinfo', 'lsmagic', detail_level=1) + + +def test_init_colors(): + # ensure colors are not present in signature info + info = inspector.info(HasSignature) + init_def = info['init_definition'] + nt.assert_not_in('[0m', init_def) + + +def test_builtin_init(): + info = inspector.info(list) + init_def = info['init_definition'] + nt.assert_is_not_none(init_def) + + +def test_render_signature_short(): + def short_fun(a=1): pass + sig = oinspect._render_signature( + signature(short_fun), + short_fun.__name__, + ) + nt.assert_equal(sig, 'short_fun(a=1)') + + +def test_render_signature_long(): + from typing import Optional + + def long_function( + a_really_long_parameter: int, + and_another_long_one: bool = False, + let_us_make_sure_this_is_looong: Optional[str] = None, + ) -> bool: pass + + sig = oinspect._render_signature( + signature(long_function), + long_function.__name__, + ) + nt.assert_in(sig, [ + # Python >=3.9 + '''\ +long_function( + a_really_long_parameter: int, + and_another_long_one: bool = False, + let_us_make_sure_this_is_looong: Optional[str] = None, +) -> bool\ +''', + # Python >=3.7 + '''\ +long_function( + a_really_long_parameter: int, + and_another_long_one: bool = False, + let_us_make_sure_this_is_looong: Union[str, NoneType] = None, +) -> bool\ +''', # Python <=3.6 + '''\ +long_function( + a_really_long_parameter:int, + and_another_long_one:bool=False, + let_us_make_sure_this_is_looong:Union[str, NoneType]=None, +) -> bool\ +''', + ]) diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_page.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_page.py new file mode 100644 index 00000000..9f6a3742 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_page.py @@ -0,0 +1,20 @@ +#----------------------------------------------------------------------------- +# Copyright (C) 2010-2011 The IPython Development Team. +# +# Distributed under the terms of the BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- +import io + +# N.B. For the test suite, page.page is overridden (see IPython.testing.globalipapp) +from IPython.core import page + +def test_detect_screen_size(): + """Simple smoketest for page._detect_screen_size.""" + try: + page._detect_screen_size(True, 25) + except (TypeError, io.UnsupportedOperation): + # This can happen in the test suite, because stdout may not have a + # fileno. + pass diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_paths.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_paths.py new file mode 100644 index 00000000..ab1c4132 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_paths.py @@ -0,0 +1,200 @@ +import errno +import os +import shutil +import sys +import tempfile +import warnings +from unittest.mock import patch + +import nose.tools as nt +from testpath import modified_env, assert_isdir, assert_isfile + +from IPython import paths +from IPython.testing.decorators import skip_win32 +from IPython.utils.tempdir import TemporaryDirectory + +TMP_TEST_DIR = os.path.realpath(tempfile.mkdtemp()) +HOME_TEST_DIR = os.path.join(TMP_TEST_DIR, "home_test_dir") +XDG_TEST_DIR = os.path.join(HOME_TEST_DIR, "xdg_test_dir") +XDG_CACHE_DIR = os.path.join(HOME_TEST_DIR, "xdg_cache_dir") +IP_TEST_DIR = os.path.join(HOME_TEST_DIR,'.ipython') + +def setup_module(): + """Setup testenvironment for the module: + + - Adds dummy home dir tree + """ + # Do not mask exceptions here. In particular, catching WindowsError is a + # problem because that exception is only defined on Windows... + os.makedirs(IP_TEST_DIR) + os.makedirs(os.path.join(XDG_TEST_DIR, 'ipython')) + os.makedirs(os.path.join(XDG_CACHE_DIR, 'ipython')) + + +def teardown_module(): + """Teardown testenvironment for the module: + + - Remove dummy home dir tree + """ + # Note: we remove the parent test dir, which is the root of all test + # subdirs we may have created. Use shutil instead of os.removedirs, so + # that non-empty directories are all recursively removed. + shutil.rmtree(TMP_TEST_DIR) + +def patch_get_home_dir(dirpath): + return patch.object(paths, 'get_home_dir', return_value=dirpath) + + +def test_get_ipython_dir_1(): + """test_get_ipython_dir_1, Testcase to see if we can call get_ipython_dir without Exceptions.""" + env_ipdir = os.path.join("someplace", ".ipython") + with patch.object(paths, '_writable_dir', return_value=True), \ + modified_env({'IPYTHONDIR': env_ipdir}): + ipdir = paths.get_ipython_dir() + + nt.assert_equal(ipdir, env_ipdir) + +def test_get_ipython_dir_2(): + """test_get_ipython_dir_2, Testcase to see if we can call get_ipython_dir without Exceptions.""" + with patch_get_home_dir('someplace'), \ + patch.object(paths, 'get_xdg_dir', return_value=None), \ + patch.object(paths, '_writable_dir', return_value=True), \ + patch('os.name', "posix"), \ + modified_env({'IPYTHON_DIR': None, + 'IPYTHONDIR': None, + 'XDG_CONFIG_HOME': None + }): + ipdir = paths.get_ipython_dir() + + nt.assert_equal(ipdir, os.path.join("someplace", ".ipython")) + +def test_get_ipython_dir_3(): + """test_get_ipython_dir_3, move XDG if defined, and .ipython doesn't exist.""" + tmphome = TemporaryDirectory() + try: + with patch_get_home_dir(tmphome.name), \ + patch('os.name', 'posix'), \ + modified_env({ + 'IPYTHON_DIR': None, + 'IPYTHONDIR': None, + 'XDG_CONFIG_HOME': XDG_TEST_DIR, + }), warnings.catch_warnings(record=True) as w: + ipdir = paths.get_ipython_dir() + + nt.assert_equal(ipdir, os.path.join(tmphome.name, ".ipython")) + if sys.platform != 'darwin': + nt.assert_equal(len(w), 1) + nt.assert_in('Moving', str(w[0])) + finally: + tmphome.cleanup() + +def test_get_ipython_dir_4(): + """test_get_ipython_dir_4, warn if XDG and home both exist.""" + with patch_get_home_dir(HOME_TEST_DIR), \ + patch('os.name', 'posix'): + try: + os.mkdir(os.path.join(XDG_TEST_DIR, 'ipython')) + except OSError as e: + if e.errno != errno.EEXIST: + raise + + + with modified_env({ + 'IPYTHON_DIR': None, + 'IPYTHONDIR': None, + 'XDG_CONFIG_HOME': XDG_TEST_DIR, + }), warnings.catch_warnings(record=True) as w: + ipdir = paths.get_ipython_dir() + + nt.assert_equal(ipdir, os.path.join(HOME_TEST_DIR, ".ipython")) + if sys.platform != 'darwin': + nt.assert_equal(len(w), 1) + nt.assert_in('Ignoring', str(w[0])) + +def test_get_ipython_dir_5(): + """test_get_ipython_dir_5, use .ipython if exists and XDG defined, but doesn't exist.""" + with patch_get_home_dir(HOME_TEST_DIR), \ + patch('os.name', 'posix'): + try: + os.rmdir(os.path.join(XDG_TEST_DIR, 'ipython')) + except OSError as e: + if e.errno != errno.ENOENT: + raise + + with modified_env({ + 'IPYTHON_DIR': None, + 'IPYTHONDIR': None, + 'XDG_CONFIG_HOME': XDG_TEST_DIR, + }): + ipdir = paths.get_ipython_dir() + + nt.assert_equal(ipdir, IP_TEST_DIR) + +def test_get_ipython_dir_6(): + """test_get_ipython_dir_6, use home over XDG if defined and neither exist.""" + xdg = os.path.join(HOME_TEST_DIR, 'somexdg') + os.mkdir(xdg) + shutil.rmtree(os.path.join(HOME_TEST_DIR, '.ipython')) + print(paths._writable_dir) + with patch_get_home_dir(HOME_TEST_DIR), \ + patch.object(paths, 'get_xdg_dir', return_value=xdg), \ + patch('os.name', 'posix'), \ + modified_env({ + 'IPYTHON_DIR': None, + 'IPYTHONDIR': None, + 'XDG_CONFIG_HOME': None, + }), warnings.catch_warnings(record=True) as w: + ipdir = paths.get_ipython_dir() + + nt.assert_equal(ipdir, os.path.join(HOME_TEST_DIR, '.ipython')) + nt.assert_equal(len(w), 0) + +def test_get_ipython_dir_7(): + """test_get_ipython_dir_7, test home directory expansion on IPYTHONDIR""" + home_dir = os.path.normpath(os.path.expanduser('~')) + with modified_env({'IPYTHONDIR': os.path.join('~', 'somewhere')}), \ + patch.object(paths, '_writable_dir', return_value=True): + ipdir = paths.get_ipython_dir() + nt.assert_equal(ipdir, os.path.join(home_dir, 'somewhere')) + +@skip_win32 +def test_get_ipython_dir_8(): + """test_get_ipython_dir_8, test / home directory""" + with patch.object(paths, '_writable_dir', lambda path: bool(path)), \ + patch.object(paths, 'get_xdg_dir', return_value=None), \ + modified_env({ + 'IPYTHON_DIR': None, + 'IPYTHONDIR': None, + 'HOME': '/', + }): + nt.assert_equal(paths.get_ipython_dir(), '/.ipython') + + +def test_get_ipython_cache_dir(): + with modified_env({'HOME': HOME_TEST_DIR}): + if os.name == 'posix' and sys.platform != 'darwin': + # test default + os.makedirs(os.path.join(HOME_TEST_DIR, ".cache")) + with modified_env({'XDG_CACHE_HOME': None}): + ipdir = paths.get_ipython_cache_dir() + nt.assert_equal(os.path.join(HOME_TEST_DIR, ".cache", "ipython"), + ipdir) + assert_isdir(ipdir) + + # test env override + with modified_env({"XDG_CACHE_HOME": XDG_CACHE_DIR}): + ipdir = paths.get_ipython_cache_dir() + assert_isdir(ipdir) + nt.assert_equal(ipdir, os.path.join(XDG_CACHE_DIR, "ipython")) + else: + nt.assert_equal(paths.get_ipython_cache_dir(), + paths.get_ipython_dir()) + +def test_get_ipython_package_dir(): + ipdir = paths.get_ipython_package_dir() + assert_isdir(ipdir) + + +def test_get_ipython_module_path(): + ipapp_path = paths.get_ipython_module_path('IPython.terminal.ipapp') + assert_isfile(ipapp_path) diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_prefilter.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_prefilter.py new file mode 100644 index 00000000..ca447b3d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_prefilter.py @@ -0,0 +1,127 @@ +"""Tests for input manipulation machinery.""" + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- +import nose.tools as nt + +from IPython.core.prefilter import AutocallChecker + +#----------------------------------------------------------------------------- +# Tests +#----------------------------------------------------------------------------- + +def test_prefilter(): + """Test user input conversions""" + + # pairs of (raw, expected correct) input + pairs = [ ('2+2','2+2'), + ] + + for raw, correct in pairs: + nt.assert_equal(ip.prefilter(raw), correct) + +def test_prefilter_shadowed(): + def dummy_magic(line): pass + + prev_automagic_state = ip.automagic + ip.automagic = True + ip.autocall = 0 + + try: + # These should not be transformed - they are shadowed by other names + for name in ['if', 'zip', 'get_ipython']: # keyword, builtin, global + ip.register_magic_function(dummy_magic, magic_name=name) + res = ip.prefilter(name+' foo') + nt.assert_equal(res, name+' foo') + del ip.magics_manager.magics['line'][name] + + # These should be transformed + for name in ['fi', 'piz', 'nohtypi_teg']: + ip.register_magic_function(dummy_magic, magic_name=name) + res = ip.prefilter(name+' foo') + nt.assert_not_equal(res, name+' foo') + del ip.magics_manager.magics['line'][name] + + finally: + ip.automagic = prev_automagic_state + +def test_autocall_binops(): + """See https://github.com/ipython/ipython/issues/81""" + ip.magic('autocall 2') + f = lambda x: x + ip.user_ns['f'] = f + try: + nt.assert_equal(ip.prefilter('f 1'),'f(1)') + for t in ['f +1', 'f -1']: + nt.assert_equal(ip.prefilter(t), t) + + # Run tests again with a more permissive exclude_regexp, which will + # allow transformation of binary operations ('f -1' -> 'f(-1)'). + pm = ip.prefilter_manager + ac = AutocallChecker(shell=pm.shell, prefilter_manager=pm, + config=pm.config) + try: + ac.priority = 1 + ac.exclude_regexp = r'^[,&^\|\*/]|^is |^not |^in |^and |^or ' + pm.sort_checkers() + + nt.assert_equal(ip.prefilter('f -1'), 'f(-1)') + nt.assert_equal(ip.prefilter('f +1'), 'f(+1)') + finally: + pm.unregister_checker(ac) + finally: + ip.magic('autocall 0') + del ip.user_ns['f'] + + +def test_issue_114(): + """Check that multiline string literals don't expand as magic + see http://github.com/ipython/ipython/issues/114""" + + template = '"""\n%s\n"""' + # Store the current value of multi_line_specials and turn it off before + # running test, since it could be true (case in which the test doesn't make + # sense, as multiline string literals *will* expand as magic in that case). + msp = ip.prefilter_manager.multi_line_specials + ip.prefilter_manager.multi_line_specials = False + try: + for mgk in ip.magics_manager.lsmagic()['line']: + raw = template % mgk + nt.assert_equal(ip.prefilter(raw), raw) + finally: + ip.prefilter_manager.multi_line_specials = msp + + +def test_prefilter_attribute_errors(): + """Capture exceptions thrown by user objects on attribute access. + + See http://github.com/ipython/ipython/issues/988.""" + + class X(object): + def __getattr__(self, k): + raise ValueError('broken object') + def __call__(self, x): + return x + + # Create a callable broken object + ip.user_ns['x'] = X() + ip.magic('autocall 2') + try: + # Even if x throws an attribute error when looking at its rewrite + # attribute, we should not crash. So the test here is simply making + # the prefilter call and not having an exception. + ip.prefilter('x 1') + finally: + del ip.user_ns['x'] + ip.magic('autocall 0') + + +def test_autocall_should_support_unicode(): + ip.magic('autocall 2') + ip.user_ns['π'] = lambda x: x + try: + nt.assert_equal(ip.prefilter('π 3'),'π(3)') + finally: + ip.magic('autocall 0') + del ip.user_ns['π'] diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_profile.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_profile.py new file mode 100644 index 00000000..e63fb3ef --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_profile.py @@ -0,0 +1,161 @@ +# coding: utf-8 +"""Tests for profile-related functions. + +Currently only the startup-dir functionality is tested, but more tests should +be added for: + + * ipython profile create + * ipython profile list + * ipython profile create --parallel + * security dir permissions + +Authors +------- + +* MinRK + +""" + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +import os +import shutil +import sys +import tempfile + +from unittest import TestCase + +import nose.tools as nt + +from IPython.core.profileapp import list_profiles_in, list_bundled_profiles +from IPython.core.profiledir import ProfileDir + +from IPython.testing import decorators as dec +from IPython.testing import tools as tt +from IPython.utils.process import getoutput +from IPython.utils.tempdir import TemporaryDirectory + +#----------------------------------------------------------------------------- +# Globals +#----------------------------------------------------------------------------- +TMP_TEST_DIR = tempfile.mkdtemp() +HOME_TEST_DIR = os.path.join(TMP_TEST_DIR, "home_test_dir") +IP_TEST_DIR = os.path.join(HOME_TEST_DIR,'.ipython') + +# +# Setup/teardown functions/decorators +# + +def setup_module(): + """Setup test environment for the module: + + - Adds dummy home dir tree + """ + # Do not mask exceptions here. In particular, catching WindowsError is a + # problem because that exception is only defined on Windows... + os.makedirs(IP_TEST_DIR) + + +def teardown_module(): + """Teardown test environment for the module: + + - Remove dummy home dir tree + """ + # Note: we remove the parent test dir, which is the root of all test + # subdirs we may have created. Use shutil instead of os.removedirs, so + # that non-empty directories are all recursively removed. + shutil.rmtree(TMP_TEST_DIR) + + +#----------------------------------------------------------------------------- +# Test functions +#----------------------------------------------------------------------------- +def win32_without_pywin32(): + if sys.platform == 'win32': + try: + import pywin32 + except ImportError: + return True + return False + + +class ProfileStartupTest(TestCase): + def setUp(self): + # create profile dir + self.pd = ProfileDir.create_profile_dir_by_name(IP_TEST_DIR, 'test') + self.options = ['--ipython-dir', IP_TEST_DIR, '--profile', 'test'] + self.fname = os.path.join(TMP_TEST_DIR, 'test.py') + + def tearDown(self): + # We must remove this profile right away so its presence doesn't + # confuse other tests. + shutil.rmtree(self.pd.location) + + def init(self, startup_file, startup, test): + # write startup python file + with open(os.path.join(self.pd.startup_dir, startup_file), 'w') as f: + f.write(startup) + # write simple test file, to check that the startup file was run + with open(self.fname, 'w') as f: + f.write(test) + + def validate(self, output): + tt.ipexec_validate(self.fname, output, '', options=self.options) + + @dec.skipif(win32_without_pywin32(), "Test requires pywin32 on Windows") + def test_startup_py(self): + self.init('00-start.py', 'zzz=123\n', 'print(zzz)\n') + self.validate('123') + + @dec.skipif(win32_without_pywin32(), "Test requires pywin32 on Windows") + def test_startup_ipy(self): + self.init('00-start.ipy', '%xmode plain\n', '') + self.validate('Exception reporting mode: Plain') + + +def test_list_profiles_in(): + # No need to remove these directories and files, as they will get nuked in + # the module-level teardown. + td = tempfile.mkdtemp(dir=TMP_TEST_DIR) + for name in ('profile_foo', 'profile_hello', 'not_a_profile'): + os.mkdir(os.path.join(td, name)) + if dec.unicode_paths: + os.mkdir(os.path.join(td, u'profile_ünicode')) + + with open(os.path.join(td, 'profile_file'), 'w') as f: + f.write("I am not a profile directory") + profiles = list_profiles_in(td) + + # unicode normalization can turn u'ünicode' into u'u\0308nicode', + # so only check for *nicode, and that creating a ProfileDir from the + # name remains valid + found_unicode = False + for p in list(profiles): + if p.endswith('nicode'): + pd = ProfileDir.find_profile_dir_by_name(td, p) + profiles.remove(p) + found_unicode = True + break + if dec.unicode_paths: + nt.assert_true(found_unicode) + nt.assert_equal(set(profiles), {'foo', 'hello'}) + + +def test_list_bundled_profiles(): + # This variable will need to be updated when a new profile gets bundled + bundled = sorted(list_bundled_profiles()) + nt.assert_equal(bundled, []) + + +def test_profile_create_ipython_dir(): + """ipython profile create respects --ipython-dir""" + with TemporaryDirectory() as td: + getoutput([sys.executable, '-m', 'IPython', 'profile', 'create', + 'foo', '--ipython-dir=%s' % td]) + profile_dir = os.path.join(td, 'profile_foo') + assert os.path.exists(profile_dir) + ipython_config = os.path.join(profile_dir, 'ipython_config.py') + assert os.path.exists(ipython_config) + diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_prompts.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_prompts.py new file mode 100644 index 00000000..95e6163b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_prompts.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 +"""Tests for prompt generation.""" + +import unittest + +from IPython.core.prompts import LazyEvaluate + +class PromptTests(unittest.TestCase): + def test_lazy_eval_unicode(self): + u = u'ünicødé' + lz = LazyEvaluate(lambda : u) + self.assertEqual(str(lz), u) + self.assertEqual(format(lz), u) + + def test_lazy_eval_nonascii_bytes(self): + u = u'ünicødé' + b = u.encode('utf8') + lz = LazyEvaluate(lambda : b) + # unicode(lz) would fail + self.assertEqual(str(lz), str(b)) + self.assertEqual(format(lz), str(b)) + + def test_lazy_eval_float(self): + f = 0.503 + lz = LazyEvaluate(lambda : f) + + self.assertEqual(str(lz), str(f)) + self.assertEqual(format(lz), str(f)) + self.assertEqual(format(lz, '.1'), '0.5') + diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_pylabtools.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_pylabtools.py new file mode 100644 index 00000000..7b64aab1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_pylabtools.py @@ -0,0 +1,256 @@ +"""Tests for pylab tools module. +""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + + +from io import UnsupportedOperation, BytesIO + +import matplotlib +matplotlib.use('Agg') +from matplotlib.figure import Figure + +from nose import SkipTest +import nose.tools as nt + +from matplotlib import pyplot as plt +import numpy as np + +from IPython.core.getipython import get_ipython +from IPython.core.interactiveshell import InteractiveShell +from IPython.core.display import _PNG, _JPEG +from .. import pylabtools as pt + +from IPython.testing import decorators as dec + + +def test_figure_to_svg(): + # simple empty-figure test + fig = plt.figure() + nt.assert_equal(pt.print_figure(fig, 'svg'), None) + + plt.close('all') + + # simple check for at least svg-looking output + fig = plt.figure() + ax = fig.add_subplot(1,1,1) + ax.plot([1,2,3]) + plt.draw() + svg = pt.print_figure(fig, 'svg')[:100].lower() + nt.assert_in(u'doctype svg', svg) + +def _check_pil_jpeg_bytes(): + """Skip if PIL can't write JPEGs to BytesIO objects""" + # PIL's JPEG plugin can't write to BytesIO objects + # Pillow fixes this + from PIL import Image + buf = BytesIO() + img = Image.new("RGB", (4,4)) + try: + img.save(buf, 'jpeg') + except Exception as e: + ename = e.__class__.__name__ + raise SkipTest("PIL can't write JPEG to BytesIO: %s: %s" % (ename, e)) + +@dec.skip_without("PIL.Image") +def test_figure_to_jpeg(): + _check_pil_jpeg_bytes() + # simple check for at least jpeg-looking output + fig = plt.figure() + ax = fig.add_subplot(1,1,1) + ax.plot([1,2,3]) + plt.draw() + jpeg = pt.print_figure(fig, 'jpeg', pil_kwargs={'optimize': 50})[:100].lower() + assert jpeg.startswith(_JPEG) + +def test_retina_figure(): + # simple empty-figure test + fig = plt.figure() + nt.assert_equal(pt.retina_figure(fig), None) + plt.close('all') + + fig = plt.figure() + ax = fig.add_subplot(1,1,1) + ax.plot([1,2,3]) + plt.draw() + png, md = pt.retina_figure(fig) + assert png.startswith(_PNG) + nt.assert_in('width', md) + nt.assert_in('height', md) + +_fmt_mime_map = { + 'png': 'image/png', + 'jpeg': 'image/jpeg', + 'pdf': 'application/pdf', + 'retina': 'image/png', + 'svg': 'image/svg+xml', +} + +def test_select_figure_formats_str(): + ip = get_ipython() + for fmt, active_mime in _fmt_mime_map.items(): + pt.select_figure_formats(ip, fmt) + for mime, f in ip.display_formatter.formatters.items(): + if mime == active_mime: + nt.assert_in(Figure, f) + else: + nt.assert_not_in(Figure, f) + +def test_select_figure_formats_kwargs(): + ip = get_ipython() + kwargs = dict(quality=10, bbox_inches='tight') + pt.select_figure_formats(ip, 'png', **kwargs) + formatter = ip.display_formatter.formatters['image/png'] + f = formatter.lookup_by_type(Figure) + cell = f.__closure__[0].cell_contents + nt.assert_equal(cell, kwargs) + + # check that the formatter doesn't raise + fig = plt.figure() + ax = fig.add_subplot(1,1,1) + ax.plot([1,2,3]) + plt.draw() + formatter.enabled = True + png = formatter(fig) + assert png.startswith(_PNG) + +def test_select_figure_formats_set(): + ip = get_ipython() + for fmts in [ + {'png', 'svg'}, + ['png'], + ('jpeg', 'pdf', 'retina'), + {'svg'}, + ]: + active_mimes = {_fmt_mime_map[fmt] for fmt in fmts} + pt.select_figure_formats(ip, fmts) + for mime, f in ip.display_formatter.formatters.items(): + if mime in active_mimes: + nt.assert_in(Figure, f) + else: + nt.assert_not_in(Figure, f) + +def test_select_figure_formats_bad(): + ip = get_ipython() + with nt.assert_raises(ValueError): + pt.select_figure_formats(ip, 'foo') + with nt.assert_raises(ValueError): + pt.select_figure_formats(ip, {'png', 'foo'}) + with nt.assert_raises(ValueError): + pt.select_figure_formats(ip, ['retina', 'pdf', 'bar', 'bad']) + +def test_import_pylab(): + ns = {} + pt.import_pylab(ns, import_all=False) + nt.assert_true('plt' in ns) + nt.assert_equal(ns['np'], np) + +class TestPylabSwitch(object): + class Shell(InteractiveShell): + def enable_gui(self, gui): + pass + + def setup(self): + import matplotlib + def act_mpl(backend): + matplotlib.rcParams['backend'] = backend + + # Save rcParams since they get modified + self._saved_rcParams = matplotlib.rcParams + self._saved_rcParamsOrig = matplotlib.rcParamsOrig + matplotlib.rcParams = dict(backend='Qt4Agg') + matplotlib.rcParamsOrig = dict(backend='Qt4Agg') + + # Mock out functions + self._save_am = pt.activate_matplotlib + pt.activate_matplotlib = act_mpl + self._save_ip = pt.import_pylab + pt.import_pylab = lambda *a,**kw:None + self._save_cis = pt.configure_inline_support + pt.configure_inline_support = lambda *a,**kw:None + + def teardown(self): + pt.activate_matplotlib = self._save_am + pt.import_pylab = self._save_ip + pt.configure_inline_support = self._save_cis + import matplotlib + matplotlib.rcParams = self._saved_rcParams + matplotlib.rcParamsOrig = self._saved_rcParamsOrig + + def test_qt(self): + s = self.Shell() + gui, backend = s.enable_matplotlib(None) + nt.assert_equal(gui, 'qt') + nt.assert_equal(s.pylab_gui_select, 'qt') + + gui, backend = s.enable_matplotlib('inline') + nt.assert_equal(gui, 'inline') + nt.assert_equal(s.pylab_gui_select, 'qt') + + gui, backend = s.enable_matplotlib('qt') + nt.assert_equal(gui, 'qt') + nt.assert_equal(s.pylab_gui_select, 'qt') + + gui, backend = s.enable_matplotlib('inline') + nt.assert_equal(gui, 'inline') + nt.assert_equal(s.pylab_gui_select, 'qt') + + gui, backend = s.enable_matplotlib() + nt.assert_equal(gui, 'qt') + nt.assert_equal(s.pylab_gui_select, 'qt') + + def test_inline(self): + s = self.Shell() + gui, backend = s.enable_matplotlib('inline') + nt.assert_equal(gui, 'inline') + nt.assert_equal(s.pylab_gui_select, None) + + gui, backend = s.enable_matplotlib('inline') + nt.assert_equal(gui, 'inline') + nt.assert_equal(s.pylab_gui_select, None) + + gui, backend = s.enable_matplotlib('qt') + nt.assert_equal(gui, 'qt') + nt.assert_equal(s.pylab_gui_select, 'qt') + + def test_inline_twice(self): + "Using '%matplotlib inline' twice should not reset formatters" + + ip = self.Shell() + gui, backend = ip.enable_matplotlib('inline') + nt.assert_equal(gui, 'inline') + + fmts = {'png'} + active_mimes = {_fmt_mime_map[fmt] for fmt in fmts} + pt.select_figure_formats(ip, fmts) + + gui, backend = ip.enable_matplotlib('inline') + nt.assert_equal(gui, 'inline') + + for mime, f in ip.display_formatter.formatters.items(): + if mime in active_mimes: + nt.assert_in(Figure, f) + else: + nt.assert_not_in(Figure, f) + + def test_qt_gtk(self): + s = self.Shell() + gui, backend = s.enable_matplotlib('qt') + nt.assert_equal(gui, 'qt') + nt.assert_equal(s.pylab_gui_select, 'qt') + + gui, backend = s.enable_matplotlib('gtk') + nt.assert_equal(gui, 'qt') + nt.assert_equal(s.pylab_gui_select, 'qt') + + +def test_no_gui_backends(): + for k in ['agg', 'svg', 'pdf', 'ps']: + assert k not in pt.backend2gui + + +def test_figure_no_canvas(): + fig = Figure() + fig.canvas = None + pt.print_figure(fig) diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_run.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_run.py new file mode 100644 index 00000000..eff832b3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_run.py @@ -0,0 +1,607 @@ +# encoding: utf-8 +"""Tests for code execution (%run and related), which is particularly tricky. + +Because of how %run manages namespaces, and the fact that we are trying here to +verify subtle object deletion and reference counting issues, the %run tests +will be kept in this separate file. This makes it easier to aggregate in one +place the tricks needed to handle it; most other magics are much easier to test +and we do so in a common test_magic file. + +Note that any test using `run -i` should make sure to do a `reset` afterwards, +as otherwise it may influence later tests. +""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + + + +import functools +import os +from os.path import join as pjoin +import random +import string +import sys +import textwrap +import unittest +from unittest.mock import patch + +import nose.tools as nt +from nose import SkipTest + +from IPython.testing import decorators as dec +from IPython.testing import tools as tt +from IPython.utils.io import capture_output +from IPython.utils.tempdir import TemporaryDirectory +from IPython.core import debugger + +def doctest_refbug(): + """Very nasty problem with references held by multiple runs of a script. + See: https://github.com/ipython/ipython/issues/141 + + In [1]: _ip.clear_main_mod_cache() + # random + + In [2]: %run refbug + + In [3]: call_f() + lowercased: hello + + In [4]: %run refbug + + In [5]: call_f() + lowercased: hello + lowercased: hello + """ + + +def doctest_run_builtins(): + r"""Check that %run doesn't damage __builtins__. + + In [1]: import tempfile + + In [2]: bid1 = id(__builtins__) + + In [3]: fname = tempfile.mkstemp('.py')[1] + + In [3]: f = open(fname,'w') + + In [4]: dummy= f.write('pass\n') + + In [5]: f.flush() + + In [6]: t1 = type(__builtins__) + + In [7]: %run $fname + + In [7]: f.close() + + In [8]: bid2 = id(__builtins__) + + In [9]: t2 = type(__builtins__) + + In [10]: t1 == t2 + Out[10]: True + + In [10]: bid1 == bid2 + Out[10]: True + + In [12]: try: + ....: os.unlink(fname) + ....: except: + ....: pass + ....: + """ + + +def doctest_run_option_parser(): + r"""Test option parser in %run. + + In [1]: %run print_argv.py + [] + + In [2]: %run print_argv.py print*.py + ['print_argv.py'] + + In [3]: %run -G print_argv.py print*.py + ['print*.py'] + + """ + + +@dec.skip_win32 +def doctest_run_option_parser_for_posix(): + r"""Test option parser in %run (Linux/OSX specific). + + You need double quote to escape glob in POSIX systems: + + In [1]: %run print_argv.py print\\*.py + ['print*.py'] + + You can't use quote to escape glob in POSIX systems: + + In [2]: %run print_argv.py 'print*.py' + ['print_argv.py'] + + """ + + +@dec.skip_if_not_win32 +def doctest_run_option_parser_for_windows(): + r"""Test option parser in %run (Windows specific). + + In Windows, you can't escape ``*` `by backslash: + + In [1]: %run print_argv.py print\\*.py + ['print\\*.py'] + + You can use quote to escape glob: + + In [2]: %run print_argv.py 'print*.py' + ['print*.py'] + + """ + + +def doctest_reset_del(): + """Test that resetting doesn't cause errors in __del__ methods. + + In [2]: class A(object): + ...: def __del__(self): + ...: print(str("Hi")) + ...: + + In [3]: a = A() + + In [4]: get_ipython().reset() + Hi + + In [5]: 1+1 + Out[5]: 2 + """ + +# For some tests, it will be handy to organize them in a class with a common +# setup that makes a temp file + +class TestMagicRunPass(tt.TempFileMixin): + + def setUp(self): + content = "a = [1,2,3]\nb = 1" + self.mktmp(content) + + def run_tmpfile(self): + _ip = get_ipython() + # This fails on Windows if self.tmpfile.name has spaces or "~" in it. + # See below and ticket https://bugs.launchpad.net/bugs/366353 + _ip.magic('run %s' % self.fname) + + def run_tmpfile_p(self): + _ip = get_ipython() + # This fails on Windows if self.tmpfile.name has spaces or "~" in it. + # See below and ticket https://bugs.launchpad.net/bugs/366353 + _ip.magic('run -p %s' % self.fname) + + def test_builtins_id(self): + """Check that %run doesn't damage __builtins__ """ + _ip = get_ipython() + # Test that the id of __builtins__ is not modified by %run + bid1 = id(_ip.user_ns['__builtins__']) + self.run_tmpfile() + bid2 = id(_ip.user_ns['__builtins__']) + nt.assert_equal(bid1, bid2) + + def test_builtins_type(self): + """Check that the type of __builtins__ doesn't change with %run. + + However, the above could pass if __builtins__ was already modified to + be a dict (it should be a module) by a previous use of %run. So we + also check explicitly that it really is a module: + """ + _ip = get_ipython() + self.run_tmpfile() + nt.assert_equal(type(_ip.user_ns['__builtins__']),type(sys)) + + def test_run_profile( self ): + """Test that the option -p, which invokes the profiler, do not + crash by invoking execfile""" + self.run_tmpfile_p() + + def test_run_debug_twice(self): + # https://github.com/ipython/ipython/issues/10028 + _ip = get_ipython() + with tt.fake_input(['c']): + _ip.magic('run -d %s' % self.fname) + with tt.fake_input(['c']): + _ip.magic('run -d %s' % self.fname) + + def test_run_debug_twice_with_breakpoint(self): + """Make a valid python temp file.""" + _ip = get_ipython() + with tt.fake_input(['b 2', 'c', 'c']): + _ip.magic('run -d %s' % self.fname) + + with tt.fake_input(['c']): + with tt.AssertNotPrints('KeyError'): + _ip.magic('run -d %s' % self.fname) + + +class TestMagicRunSimple(tt.TempFileMixin): + + def test_simpledef(self): + """Test that simple class definitions work.""" + src = ("class foo: pass\n" + "def f(): return foo()") + self.mktmp(src) + _ip.magic('run %s' % self.fname) + _ip.run_cell('t = isinstance(f(), foo)') + nt.assert_true(_ip.user_ns['t']) + + def test_obj_del(self): + """Test that object's __del__ methods are called on exit.""" + if sys.platform == 'win32': + try: + import win32api + except ImportError: + raise SkipTest("Test requires pywin32") + src = ("class A(object):\n" + " def __del__(self):\n" + " print('object A deleted')\n" + "a = A()\n") + self.mktmp(src) + if dec.module_not_available('sqlite3'): + err = 'WARNING: IPython History requires SQLite, your history will not be saved\n' + else: + err = None + tt.ipexec_validate(self.fname, 'object A deleted', err) + + def test_aggressive_namespace_cleanup(self): + """Test that namespace cleanup is not too aggressive GH-238 + + Returning from another run magic deletes the namespace""" + # see ticket https://github.com/ipython/ipython/issues/238 + + with tt.TempFileMixin() as empty: + empty.mktmp('') + # On Windows, the filename will have \users in it, so we need to use the + # repr so that the \u becomes \\u. + src = ("ip = get_ipython()\n" + "for i in range(5):\n" + " try:\n" + " ip.magic(%r)\n" + " except NameError as e:\n" + " print(i)\n" + " break\n" % ('run ' + empty.fname)) + self.mktmp(src) + _ip.magic('run %s' % self.fname) + _ip.run_cell('ip == get_ipython()') + nt.assert_equal(_ip.user_ns['i'], 4) + + def test_run_second(self): + """Test that running a second file doesn't clobber the first, gh-3547 + """ + self.mktmp("avar = 1\n" + "def afunc():\n" + " return avar\n") + + with tt.TempFileMixin() as empty: + empty.mktmp("") + + _ip.magic('run %s' % self.fname) + _ip.magic('run %s' % empty.fname) + nt.assert_equal(_ip.user_ns['afunc'](), 1) + + @dec.skip_win32 + def test_tclass(self): + mydir = os.path.dirname(__file__) + tc = os.path.join(mydir, 'tclass') + src = ("%%run '%s' C-first\n" + "%%run '%s' C-second\n" + "%%run '%s' C-third\n") % (tc, tc, tc) + self.mktmp(src, '.ipy') + out = """\ +ARGV 1-: ['C-first'] +ARGV 1-: ['C-second'] +tclass.py: deleting object: C-first +ARGV 1-: ['C-third'] +tclass.py: deleting object: C-second +tclass.py: deleting object: C-third +""" + if dec.module_not_available('sqlite3'): + err = 'WARNING: IPython History requires SQLite, your history will not be saved\n' + else: + err = None + tt.ipexec_validate(self.fname, out, err) + + def test_run_i_after_reset(self): + """Check that %run -i still works after %reset (gh-693)""" + src = "yy = zz\n" + self.mktmp(src) + _ip.run_cell("zz = 23") + try: + _ip.magic('run -i %s' % self.fname) + nt.assert_equal(_ip.user_ns['yy'], 23) + finally: + _ip.magic('reset -f') + + _ip.run_cell("zz = 23") + try: + _ip.magic('run -i %s' % self.fname) + nt.assert_equal(_ip.user_ns['yy'], 23) + finally: + _ip.magic('reset -f') + + def test_unicode(self): + """Check that files in odd encodings are accepted.""" + mydir = os.path.dirname(__file__) + na = os.path.join(mydir, 'nonascii.py') + _ip.magic('run "%s"' % na) + nt.assert_equal(_ip.user_ns['u'], u'Ўт№Ф') + + def test_run_py_file_attribute(self): + """Test handling of `__file__` attribute in `%run .py`.""" + src = "t = __file__\n" + self.mktmp(src) + _missing = object() + file1 = _ip.user_ns.get('__file__', _missing) + _ip.magic('run %s' % self.fname) + file2 = _ip.user_ns.get('__file__', _missing) + + # Check that __file__ was equal to the filename in the script's + # namespace. + nt.assert_equal(_ip.user_ns['t'], self.fname) + + # Check that __file__ was not leaked back into user_ns. + nt.assert_equal(file1, file2) + + def test_run_ipy_file_attribute(self): + """Test handling of `__file__` attribute in `%run `.""" + src = "t = __file__\n" + self.mktmp(src, ext='.ipy') + _missing = object() + file1 = _ip.user_ns.get('__file__', _missing) + _ip.magic('run %s' % self.fname) + file2 = _ip.user_ns.get('__file__', _missing) + + # Check that __file__ was equal to the filename in the script's + # namespace. + nt.assert_equal(_ip.user_ns['t'], self.fname) + + # Check that __file__ was not leaked back into user_ns. + nt.assert_equal(file1, file2) + + def test_run_formatting(self): + """ Test that %run -t -N does not raise a TypeError for N > 1.""" + src = "pass" + self.mktmp(src) + _ip.magic('run -t -N 1 %s' % self.fname) + _ip.magic('run -t -N 10 %s' % self.fname) + + def test_ignore_sys_exit(self): + """Test the -e option to ignore sys.exit()""" + src = "import sys; sys.exit(1)" + self.mktmp(src) + with tt.AssertPrints('SystemExit'): + _ip.magic('run %s' % self.fname) + + with tt.AssertNotPrints('SystemExit'): + _ip.magic('run -e %s' % self.fname) + + def test_run_nb(self): + """Test %run notebook.ipynb""" + from nbformat import v4, writes + nb = v4.new_notebook( + cells=[ + v4.new_markdown_cell("The Ultimate Question of Everything"), + v4.new_code_cell("answer=42") + ] + ) + src = writes(nb, version=4) + self.mktmp(src, ext='.ipynb') + + _ip.magic("run %s" % self.fname) + + nt.assert_equal(_ip.user_ns['answer'], 42) + + def test_run_nb_error(self): + """Test %run notebook.ipynb error""" + from nbformat import v4, writes + # %run when a file name isn't provided + nt.assert_raises(Exception, _ip.magic, "run") + + # %run when a file doesn't exist + nt.assert_raises(Exception, _ip.magic, "run foobar.ipynb") + + # %run on a notebook with an error + nb = v4.new_notebook( + cells=[ + v4.new_code_cell("0/0") + ] + ) + src = writes(nb, version=4) + self.mktmp(src, ext='.ipynb') + nt.assert_raises(Exception, _ip.magic, "run %s" % self.fname) + + def test_file_options(self): + src = ('import sys\n' + 'a = " ".join(sys.argv[1:])\n') + self.mktmp(src) + test_opts = '-x 3 --verbose' + _ip.run_line_magic("run", '{0} {1}'.format(self.fname, test_opts)) + nt.assert_equal(_ip.user_ns['a'], test_opts) + + +class TestMagicRunWithPackage(unittest.TestCase): + + def writefile(self, name, content): + path = os.path.join(self.tempdir.name, name) + d = os.path.dirname(path) + if not os.path.isdir(d): + os.makedirs(d) + with open(path, 'w') as f: + f.write(textwrap.dedent(content)) + + def setUp(self): + self.package = package = 'tmp{0}'.format(''.join([random.choice(string.ascii_letters) for i in range(10)])) + """Temporary (probably) valid python package name.""" + + self.value = int(random.random() * 10000) + + self.tempdir = TemporaryDirectory() + self.__orig_cwd = os.getcwd() + sys.path.insert(0, self.tempdir.name) + + self.writefile(os.path.join(package, '__init__.py'), '') + self.writefile(os.path.join(package, 'sub.py'), """ + x = {0!r} + """.format(self.value)) + self.writefile(os.path.join(package, 'relative.py'), """ + from .sub import x + """) + self.writefile(os.path.join(package, 'absolute.py'), """ + from {0}.sub import x + """.format(package)) + self.writefile(os.path.join(package, 'args.py'), """ + import sys + a = " ".join(sys.argv[1:]) + """.format(package)) + + def tearDown(self): + os.chdir(self.__orig_cwd) + sys.path[:] = [p for p in sys.path if p != self.tempdir.name] + self.tempdir.cleanup() + + def check_run_submodule(self, submodule, opts=''): + _ip.user_ns.pop('x', None) + _ip.magic('run {2} -m {0}.{1}'.format(self.package, submodule, opts)) + self.assertEqual(_ip.user_ns['x'], self.value, + 'Variable `x` is not loaded from module `{0}`.' + .format(submodule)) + + def test_run_submodule_with_absolute_import(self): + self.check_run_submodule('absolute') + + def test_run_submodule_with_relative_import(self): + """Run submodule that has a relative import statement (#2727).""" + self.check_run_submodule('relative') + + def test_prun_submodule_with_absolute_import(self): + self.check_run_submodule('absolute', '-p') + + def test_prun_submodule_with_relative_import(self): + self.check_run_submodule('relative', '-p') + + def with_fake_debugger(func): + @functools.wraps(func) + def wrapper(*args, **kwds): + with patch.object(debugger.Pdb, 'run', staticmethod(eval)): + return func(*args, **kwds) + return wrapper + + @with_fake_debugger + def test_debug_run_submodule_with_absolute_import(self): + self.check_run_submodule('absolute', '-d') + + @with_fake_debugger + def test_debug_run_submodule_with_relative_import(self): + self.check_run_submodule('relative', '-d') + + def test_module_options(self): + _ip.user_ns.pop('a', None) + test_opts = '-x abc -m test' + _ip.run_line_magic('run', '-m {0}.args {1}'.format(self.package, test_opts)) + nt.assert_equal(_ip.user_ns['a'], test_opts) + + def test_module_options_with_separator(self): + _ip.user_ns.pop('a', None) + test_opts = '-x abc -m test' + _ip.run_line_magic('run', '-m {0}.args -- {1}'.format(self.package, test_opts)) + nt.assert_equal(_ip.user_ns['a'], test_opts) + +def test_run__name__(): + with TemporaryDirectory() as td: + path = pjoin(td, 'foo.py') + with open(path, 'w') as f: + f.write("q = __name__") + + _ip.user_ns.pop('q', None) + _ip.magic('run {}'.format(path)) + nt.assert_equal(_ip.user_ns.pop('q'), '__main__') + + _ip.magic('run -n {}'.format(path)) + nt.assert_equal(_ip.user_ns.pop('q'), 'foo') + + try: + _ip.magic('run -i -n {}'.format(path)) + nt.assert_equal(_ip.user_ns.pop('q'), 'foo') + finally: + _ip.magic('reset -f') + + +def test_run_tb(): + """Test traceback offset in %run""" + with TemporaryDirectory() as td: + path = pjoin(td, 'foo.py') + with open(path, 'w') as f: + f.write('\n'.join([ + "def foo():", + " return bar()", + "def bar():", + " raise RuntimeError('hello!')", + "foo()", + ])) + with capture_output() as io: + _ip.magic('run {}'.format(path)) + out = io.stdout + nt.assert_not_in("execfile", out) + nt.assert_in("RuntimeError", out) + nt.assert_equal(out.count("---->"), 3) + del ip.user_ns['bar'] + del ip.user_ns['foo'] + + +def test_multiprocessing_run(): + """Set we can run mutiprocesgin without messing up up main namespace + + Note that import `nose.tools as nt` mdify the value s + sys.module['__mp_main__'] so wee need to temporarily set it to None to test + the issue. + """ + with TemporaryDirectory() as td: + mpm = sys.modules.get('__mp_main__') + assert mpm is not None + sys.modules['__mp_main__'] = None + try: + path = pjoin(td, 'test.py') + with open(path, 'w') as f: + f.write("import multiprocessing\nprint('hoy')") + with capture_output() as io: + _ip.run_line_magic('run', path) + _ip.run_cell("i_m_undefined") + out = io.stdout + nt.assert_in("hoy", out) + nt.assert_not_in("AttributeError", out) + nt.assert_in("NameError", out) + nt.assert_equal(out.count("---->"), 1) + except: + raise + finally: + sys.modules['__mp_main__'] = mpm + +@dec.knownfailureif(sys.platform == 'win32', "writes to io.stdout aren't captured on Windows") +def test_script_tb(): + """Test traceback offset in `ipython script.py`""" + with TemporaryDirectory() as td: + path = pjoin(td, 'foo.py') + with open(path, 'w') as f: + f.write('\n'.join([ + "def foo():", + " return bar()", + "def bar():", + " raise RuntimeError('hello!')", + "foo()", + ])) + out, err = tt.ipexec(path) + nt.assert_not_in("execfile", out) + nt.assert_in("RuntimeError", out) + nt.assert_equal(out.count("---->"), 3) + diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_shellapp.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_shellapp.py new file mode 100644 index 00000000..6808114b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_shellapp.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +"""Tests for shellapp module. + +Authors +------- +* Bradley Froehle +""" +#----------------------------------------------------------------------------- +# Copyright (C) 2012 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- +import unittest + +from IPython.testing import decorators as dec +from IPython.testing import tools as tt + +sqlite_err_maybe = dec.module_not_available('sqlite3') +SQLITE_NOT_AVAILABLE_ERROR = ('WARNING: IPython History requires SQLite,' + ' your history will not be saved\n') + +class TestFileToRun(tt.TempFileMixin, unittest.TestCase): + """Test the behavior of the file_to_run parameter.""" + + def test_py_script_file_attribute(self): + """Test that `__file__` is set when running `ipython file.py`""" + src = "print(__file__)\n" + self.mktmp(src) + + err = SQLITE_NOT_AVAILABLE_ERROR if sqlite_err_maybe else None + tt.ipexec_validate(self.fname, self.fname, err) + + def test_ipy_script_file_attribute(self): + """Test that `__file__` is set when running `ipython file.ipy`""" + src = "print(__file__)\n" + self.mktmp(src, ext='.ipy') + + err = SQLITE_NOT_AVAILABLE_ERROR if sqlite_err_maybe else None + tt.ipexec_validate(self.fname, self.fname, err) + + # The commands option to ipexec_validate doesn't work on Windows, and it + # doesn't seem worth fixing + @dec.skip_win32 + def test_py_script_file_attribute_interactively(self): + """Test that `__file__` is not set after `ipython -i file.py`""" + src = "True\n" + self.mktmp(src) + + out, err = tt.ipexec(self.fname, options=['-i'], + commands=['"__file__" in globals()', 'print(123)', 'exit()']) + if 'False' not in out: + print("Subprocess stderr:") + print(err) + print('-----') + raise AssertionError("'False' not found in %r" % out) diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_splitinput.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_splitinput.py new file mode 100644 index 00000000..98b4189e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_splitinput.py @@ -0,0 +1,38 @@ +# coding: utf-8 +import nose.tools as nt + +from IPython.core.splitinput import split_user_input, LineInfo +from IPython.testing import tools as tt + +tests = [ + ('x=1', ('', '', 'x', '=1')), + ('?', ('', '?', '', '')), + ('??', ('', '??', '', '')), + (' ?', (' ', '?', '', '')), + (' ??', (' ', '??', '', '')), + ('??x', ('', '??', 'x', '')), + ('?x=1', ('', '?', 'x', '=1')), + ('!ls', ('', '!', 'ls', '')), + (' !ls', (' ', '!', 'ls', '')), + ('!!ls', ('', '!!', 'ls', '')), + (' !!ls', (' ', '!!', 'ls', '')), + (',ls', ('', ',', 'ls', '')), + (';ls', ('', ';', 'ls', '')), + (' ;ls', (' ', ';', 'ls', '')), + ('f.g(x)', ('', '', 'f.g', '(x)')), + ('f.g (x)', ('', '', 'f.g', '(x)')), + ('?%hist1', ('', '?', '%hist1', '')), + ('?%%hist2', ('', '?', '%%hist2', '')), + ('??%hist3', ('', '??', '%hist3', '')), + ('??%%hist4', ('', '??', '%%hist4', '')), + ('?x*', ('', '?', 'x*', '')), + ] +tests.append((u"Pérez Fernando", (u'', u'', u'Pérez', u'Fernando'))) + +def test_split_user_input(): + return tt.check_pairs(split_user_input, tests) + +def test_LineInfo(): + """Simple test for LineInfo construction and str()""" + linfo = LineInfo(' %cd /home') + nt.assert_equal(str(linfo), 'LineInfo [ |%|cd|/home]') diff --git a/.venv/lib/python3.8/site-packages/IPython/core/tests/test_ultratb.py b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_ultratb.py new file mode 100644 index 00000000..3751117b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/tests/test_ultratb.py @@ -0,0 +1,470 @@ +# encoding: utf-8 +"""Tests for IPython.core.ultratb +""" +import io +import logging +import sys +import os.path +from textwrap import dedent +import traceback +import unittest +from unittest import mock + +import IPython.core.ultratb as ultratb +from IPython.core.ultratb import ColorTB, VerboseTB, find_recursion + + +from IPython.testing import tools as tt +from IPython.testing.decorators import onlyif_unicode_paths +from IPython.utils.syspathcontext import prepended_to_syspath +from IPython.utils.tempdir import TemporaryDirectory + +file_1 = """1 +2 +3 +def f(): + 1/0 +""" + +file_2 = """def f(): + 1/0 +""" + + +def recursionlimit(frames): + """ + decorator to set the recursion limit temporarily + """ + + def inner(test_function): + def wrapper(*args, **kwargs): + _orig_rec_limit = ultratb._FRAME_RECURSION_LIMIT + ultratb._FRAME_RECURSION_LIMIT = 50 + + rl = sys.getrecursionlimit() + sys.setrecursionlimit(frames) + try: + return test_function(*args, **kwargs) + finally: + sys.setrecursionlimit(rl) + ultratb._FRAME_RECURSION_LIMIT = _orig_rec_limit + + return wrapper + + return inner + + +class ChangedPyFileTest(unittest.TestCase): + def test_changing_py_file(self): + """Traceback produced if the line where the error occurred is missing? + + https://github.com/ipython/ipython/issues/1456 + """ + with TemporaryDirectory() as td: + fname = os.path.join(td, "foo.py") + with open(fname, "w") as f: + f.write(file_1) + + with prepended_to_syspath(td): + ip.run_cell("import foo") + + with tt.AssertPrints("ZeroDivisionError"): + ip.run_cell("foo.f()") + + # Make the file shorter, so the line of the error is missing. + with open(fname, "w") as f: + f.write(file_2) + + # For some reason, this was failing on the *second* call after + # changing the file, so we call f() twice. + with tt.AssertNotPrints("Internal Python error", channel='stderr'): + with tt.AssertPrints("ZeroDivisionError"): + ip.run_cell("foo.f()") + with tt.AssertPrints("ZeroDivisionError"): + ip.run_cell("foo.f()") + +iso_8859_5_file = u'''# coding: iso-8859-5 + +def fail(): + """дбИЖ""" + 1/0 # дбИЖ +''' + +class NonAsciiTest(unittest.TestCase): + @onlyif_unicode_paths + def test_nonascii_path(self): + # Non-ascii directory name as well. + with TemporaryDirectory(suffix=u'é') as td: + fname = os.path.join(td, u"fooé.py") + with open(fname, "w") as f: + f.write(file_1) + + with prepended_to_syspath(td): + ip.run_cell("import foo") + + with tt.AssertPrints("ZeroDivisionError"): + ip.run_cell("foo.f()") + + def test_iso8859_5(self): + with TemporaryDirectory() as td: + fname = os.path.join(td, 'dfghjkl.py') + + with io.open(fname, 'w', encoding='iso-8859-5') as f: + f.write(iso_8859_5_file) + + with prepended_to_syspath(td): + ip.run_cell("from dfghjkl import fail") + + with tt.AssertPrints("ZeroDivisionError"): + with tt.AssertPrints(u'дбИЖ', suppress=False): + ip.run_cell('fail()') + + def test_nonascii_msg(self): + cell = u"raise Exception('é')" + expected = u"Exception('é')" + ip.run_cell("%xmode plain") + with tt.AssertPrints(expected): + ip.run_cell(cell) + + ip.run_cell("%xmode verbose") + with tt.AssertPrints(expected): + ip.run_cell(cell) + + ip.run_cell("%xmode context") + with tt.AssertPrints(expected): + ip.run_cell(cell) + + ip.run_cell("%xmode minimal") + with tt.AssertPrints(u"Exception: é"): + ip.run_cell(cell) + + # Put this back into Context mode for later tests. + ip.run_cell("%xmode context") + +class NestedGenExprTestCase(unittest.TestCase): + """ + Regression test for the following issues: + https://github.com/ipython/ipython/issues/8293 + https://github.com/ipython/ipython/issues/8205 + """ + def test_nested_genexpr(self): + code = dedent( + """\ + class SpecificException(Exception): + pass + + def foo(x): + raise SpecificException("Success!") + + sum(sum(foo(x) for _ in [0]) for x in [0]) + """ + ) + with tt.AssertPrints('SpecificException: Success!', suppress=False): + ip.run_cell(code) + + +indentationerror_file = """if True: +zoon() +""" + +class IndentationErrorTest(unittest.TestCase): + def test_indentationerror_shows_line(self): + # See issue gh-2398 + with tt.AssertPrints("IndentationError"): + with tt.AssertPrints("zoon()", suppress=False): + ip.run_cell(indentationerror_file) + + with TemporaryDirectory() as td: + fname = os.path.join(td, "foo.py") + with open(fname, "w") as f: + f.write(indentationerror_file) + + with tt.AssertPrints("IndentationError"): + with tt.AssertPrints("zoon()", suppress=False): + ip.magic('run %s' % fname) + +se_file_1 = """1 +2 +7/ +""" + +se_file_2 = """7/ +""" + +class SyntaxErrorTest(unittest.TestCase): + def test_syntaxerror_without_lineno(self): + with tt.AssertNotPrints("TypeError"): + with tt.AssertPrints("line unknown"): + ip.run_cell("raise SyntaxError()") + + def test_syntaxerror_no_stacktrace_at_compile_time(self): + syntax_error_at_compile_time = """ +def foo(): + .. +""" + with tt.AssertPrints("SyntaxError"): + ip.run_cell(syntax_error_at_compile_time) + + with tt.AssertNotPrints("foo()"): + ip.run_cell(syntax_error_at_compile_time) + + def test_syntaxerror_stacktrace_when_running_compiled_code(self): + syntax_error_at_runtime = """ +def foo(): + eval("..") + +def bar(): + foo() + +bar() +""" + with tt.AssertPrints("SyntaxError"): + ip.run_cell(syntax_error_at_runtime) + # Assert syntax error during runtime generate stacktrace + with tt.AssertPrints(["foo()", "bar()"]): + ip.run_cell(syntax_error_at_runtime) + del ip.user_ns['bar'] + del ip.user_ns['foo'] + + def test_changing_py_file(self): + with TemporaryDirectory() as td: + fname = os.path.join(td, "foo.py") + with open(fname, 'w') as f: + f.write(se_file_1) + + with tt.AssertPrints(["7/", "SyntaxError"]): + ip.magic("run " + fname) + + # Modify the file + with open(fname, 'w') as f: + f.write(se_file_2) + + # The SyntaxError should point to the correct line + with tt.AssertPrints(["7/", "SyntaxError"]): + ip.magic("run " + fname) + + def test_non_syntaxerror(self): + # SyntaxTB may be called with an error other than a SyntaxError + # See e.g. gh-4361 + try: + raise ValueError('QWERTY') + except ValueError: + with tt.AssertPrints('QWERTY'): + ip.showsyntaxerror() + +import sys +if sys.version_info < (3,9): + """ + New 3.9 Pgen Parser does not raise Memory error, except on failed malloc. + """ + class MemoryErrorTest(unittest.TestCase): + def test_memoryerror(self): + memoryerror_code = "(" * 200 + ")" * 200 + with tt.AssertPrints("MemoryError"): + ip.run_cell(memoryerror_code) + + +class Python3ChainedExceptionsTest(unittest.TestCase): + DIRECT_CAUSE_ERROR_CODE = """ +try: + x = 1 + 2 + print(not_defined_here) +except Exception as e: + x += 55 + x - 1 + y = {} + raise KeyError('uh') from e + """ + + EXCEPTION_DURING_HANDLING_CODE = """ +try: + x = 1 + 2 + print(not_defined_here) +except Exception as e: + x += 55 + x - 1 + y = {} + raise KeyError('uh') + """ + + SUPPRESS_CHAINING_CODE = """ +try: + 1/0 +except Exception: + raise ValueError("Yikes") from None + """ + + def test_direct_cause_error(self): + with tt.AssertPrints(["KeyError", "NameError", "direct cause"]): + ip.run_cell(self.DIRECT_CAUSE_ERROR_CODE) + + def test_exception_during_handling_error(self): + with tt.AssertPrints(["KeyError", "NameError", "During handling"]): + ip.run_cell(self.EXCEPTION_DURING_HANDLING_CODE) + + def test_suppress_exception_chaining(self): + with tt.AssertNotPrints("ZeroDivisionError"), \ + tt.AssertPrints("ValueError", suppress=False): + ip.run_cell(self.SUPPRESS_CHAINING_CODE) + + def test_plain_direct_cause_error(self): + with tt.AssertPrints(["KeyError", "NameError", "direct cause"]): + ip.run_cell("%xmode Plain") + ip.run_cell(self.DIRECT_CAUSE_ERROR_CODE) + ip.run_cell("%xmode Verbose") + + def test_plain_exception_during_handling_error(self): + with tt.AssertPrints(["KeyError", "NameError", "During handling"]): + ip.run_cell("%xmode Plain") + ip.run_cell(self.EXCEPTION_DURING_HANDLING_CODE) + ip.run_cell("%xmode Verbose") + + def test_plain_suppress_exception_chaining(self): + with tt.AssertNotPrints("ZeroDivisionError"), \ + tt.AssertPrints("ValueError", suppress=False): + ip.run_cell("%xmode Plain") + ip.run_cell(self.SUPPRESS_CHAINING_CODE) + ip.run_cell("%xmode Verbose") + + +class RecursionTest(unittest.TestCase): + DEFINITIONS = """ +def non_recurs(): + 1/0 + +def r1(): + r1() + +def r3a(): + r3b() + +def r3b(): + r3c() + +def r3c(): + r3a() + +def r3o1(): + r3a() + +def r3o2(): + r3o1() +""" + def setUp(self): + ip.run_cell(self.DEFINITIONS) + + def test_no_recursion(self): + with tt.AssertNotPrints("frames repeated"): + ip.run_cell("non_recurs()") + + @recursionlimit(150) + def test_recursion_one_frame(self): + with tt.AssertPrints("1 frames repeated"): + ip.run_cell("r1()") + + @recursionlimit(150) + def test_recursion_three_frames(self): + with tt.AssertPrints("3 frames repeated"): + ip.run_cell("r3o2()") + + @recursionlimit(150) + def test_find_recursion(self): + captured = [] + def capture_exc(*args, **kwargs): + captured.append(sys.exc_info()) + with mock.patch.object(ip, 'showtraceback', capture_exc): + ip.run_cell("r3o2()") + + self.assertEqual(len(captured), 1) + etype, evalue, tb = captured[0] + self.assertIn("recursion", str(evalue)) + + records = ip.InteractiveTB.get_records(tb, 3, ip.InteractiveTB.tb_offset) + for r in records[:10]: + print(r[1:4]) + + # The outermost frames should be: + # 0: the 'cell' that was running when the exception came up + # 1: r3o2() + # 2: r3o1() + # 3: r3a() + # Then repeating r3b, r3c, r3a + last_unique, repeat_length = find_recursion(etype, evalue, records) + self.assertEqual(last_unique, 2) + self.assertEqual(repeat_length, 3) + + +#---------------------------------------------------------------------------- + +# module testing (minimal) +def test_handlers(): + def spam(c, d_e): + (d, e) = d_e + x = c + d + y = c * d + foo(x, y) + + def foo(a, b, bar=1): + eggs(a, b + bar) + + def eggs(f, g, z=globals()): + h = f + g + i = f - g + return h / i + + buff = io.StringIO() + + buff.write('') + buff.write('*** Before ***') + try: + buff.write(spam(1, (2, 3))) + except: + traceback.print_exc(file=buff) + + handler = ColorTB(ostream=buff) + buff.write('*** ColorTB ***') + try: + buff.write(spam(1, (2, 3))) + except: + handler(*sys.exc_info()) + buff.write('') + + handler = VerboseTB(ostream=buff) + buff.write('*** VerboseTB ***') + try: + buff.write(spam(1, (2, 3))) + except: + handler(*sys.exc_info()) + buff.write('') + +from IPython.testing.decorators import skipif + +class TokenizeFailureTest(unittest.TestCase): + """Tests related to https://github.com/ipython/ipython/issues/6864.""" + + # that appear to test that we are handling an exception that can be thrown + # by the tokenizer due to a bug that seem to have been fixed in 3.8, though + # I'm unsure if other sequences can make it raise this error. Let's just + # skip in 3.8 for now + @skipif(sys.version_info > (3,8)) + def testLogging(self): + message = "An unexpected error occurred while tokenizing input" + cell = 'raise ValueError("""a\nb""")' + + stream = io.StringIO() + handler = logging.StreamHandler(stream) + logger = logging.getLogger() + loglevel = logger.level + logger.addHandler(handler) + self.addCleanup(lambda: logger.removeHandler(handler)) + self.addCleanup(lambda: logger.setLevel(loglevel)) + + logger.setLevel(logging.INFO) + with tt.AssertNotPrints(message): + ip.run_cell(cell) + self.assertNotIn(message, stream.getvalue()) + + logger.setLevel(logging.DEBUG) + with tt.AssertNotPrints(message): + ip.run_cell(cell) + self.assertIn(message, stream.getvalue()) diff --git a/.venv/lib/python3.8/site-packages/IPython/core/ultratb.py b/.venv/lib/python3.8/site-packages/IPython/core/ultratb.py new file mode 100644 index 00000000..45e22bd7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/ultratb.py @@ -0,0 +1,1524 @@ +# -*- coding: utf-8 -*- +""" +Verbose and colourful traceback formatting. + +**ColorTB** + +I've always found it a bit hard to visually parse tracebacks in Python. The +ColorTB class is a solution to that problem. It colors the different parts of a +traceback in a manner similar to what you would expect from a syntax-highlighting +text editor. + +Installation instructions for ColorTB:: + + import sys,ultratb + sys.excepthook = ultratb.ColorTB() + +**VerboseTB** + +I've also included a port of Ka-Ping Yee's "cgitb.py" that produces all kinds +of useful info when a traceback occurs. Ping originally had it spit out HTML +and intended it for CGI programmers, but why should they have all the fun? I +altered it to spit out colored text to the terminal. It's a bit overwhelming, +but kind of neat, and maybe useful for long-running programs that you believe +are bug-free. If a crash *does* occur in that type of program you want details. +Give it a shot--you'll love it or you'll hate it. + +.. note:: + + The Verbose mode prints the variables currently visible where the exception + happened (shortening their strings if too long). This can potentially be + very slow, if you happen to have a huge data structure whose string + representation is complex to compute. Your computer may appear to freeze for + a while with cpu usage at 100%. If this occurs, you can cancel the traceback + with Ctrl-C (maybe hitting it more than once). + + If you encounter this kind of situation often, you may want to use the + Verbose_novars mode instead of the regular Verbose, which avoids formatting + variables (but otherwise includes the information and context given by + Verbose). + +.. note:: + + The verbose mode print all variables in the stack, which means it can + potentially leak sensitive information like access keys, or unencrypted + password. + +Installation instructions for VerboseTB:: + + import sys,ultratb + sys.excepthook = ultratb.VerboseTB() + +Note: Much of the code in this module was lifted verbatim from the standard +library module 'traceback.py' and Ka-Ping Yee's 'cgitb.py'. + +Color schemes +------------- + +The colors are defined in the class TBTools through the use of the +ColorSchemeTable class. Currently the following exist: + + - NoColor: allows all of this module to be used in any terminal (the color + escapes are just dummy blank strings). + + - Linux: is meant to look good in a terminal like the Linux console (black + or very dark background). + + - LightBG: similar to Linux but swaps dark/light colors to be more readable + in light background terminals. + + - Neutral: a neutral color scheme that should be readable on both light and + dark background + +You can implement other color schemes easily, the syntax is fairly +self-explanatory. Please send back new schemes you develop to the author for +possible inclusion in future releases. + +Inheritance diagram: + +.. inheritance-diagram:: IPython.core.ultratb + :parts: 3 +""" + +#***************************************************************************** +# Copyright (C) 2001 Nathaniel Gray +# Copyright (C) 2001-2004 Fernando Perez +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#***************************************************************************** + + +import dis +import inspect +import keyword +import linecache +import os +import pydoc +import re +import sys +import time +import tokenize +import traceback + +from tokenize import generate_tokens + +# For purposes of monkeypatching inspect to fix a bug in it. +from inspect import getsourcefile, getfile, getmodule, \ + ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode + +# IPython's own modules +from IPython import get_ipython +from IPython.core import debugger +from IPython.core.display_trap import DisplayTrap +from IPython.core.excolors import exception_colors +from IPython.utils import PyColorize +from IPython.utils import path as util_path +from IPython.utils import py3compat +from IPython.utils.data import uniq_stable +from IPython.utils.terminal import get_terminal_size + +from logging import info, error, debug + +from importlib.util import source_from_cache + +import IPython.utils.colorable as colorable + +# Globals +# amount of space to put line numbers before verbose tracebacks +INDENT_SIZE = 8 + +# Default color scheme. This is used, for example, by the traceback +# formatter. When running in an actual IPython instance, the user's rc.colors +# value is used, but having a module global makes this functionality available +# to users of ultratb who are NOT running inside ipython. +DEFAULT_SCHEME = 'NoColor' + + +# Number of frame above which we are likely to have a recursion and will +# **attempt** to detect it. Made modifiable mostly to speedup test suite +# as detecting recursion is one of our slowest test +_FRAME_RECURSION_LIMIT = 500 + +# --------------------------------------------------------------------------- +# Code begins + +# Utility functions +def inspect_error(): + """Print a message about internal inspect errors. + + These are unfortunately quite common.""" + + error('Internal Python error in the inspect module.\n' + 'Below is the traceback from this internal error.\n') + + +# This function is a monkeypatch we apply to the Python inspect module. We have +# now found when it's needed (see discussion on issue gh-1456), and we have a +# test case (IPython.core.tests.test_ultratb.ChangedPyFileTest) that fails if +# the monkeypatch is not applied. TK, Aug 2012. +def findsource(object): + """Return the entire source file and starting line number for an object. + + The argument may be a module, class, method, function, traceback, frame, + or code object. The source code is returned as a list of all the lines + in the file and the line number indexes a line in that list. An IOError + is raised if the source code cannot be retrieved. + + FIXED version with which we monkeypatch the stdlib to work around a bug.""" + + file = getsourcefile(object) or getfile(object) + # If the object is a frame, then trying to get the globals dict from its + # module won't work. Instead, the frame object itself has the globals + # dictionary. + globals_dict = None + if inspect.isframe(object): + # XXX: can this ever be false? + globals_dict = object.f_globals + else: + module = getmodule(object, file) + if module: + globals_dict = module.__dict__ + lines = linecache.getlines(file, globals_dict) + if not lines: + raise IOError('could not get source code') + + if ismodule(object): + return lines, 0 + + if isclass(object): + name = object.__name__ + pat = re.compile(r'^(\s*)class\s*' + name + r'\b') + # make some effort to find the best matching class definition: + # use the one with the least indentation, which is the one + # that's most probably not inside a function definition. + candidates = [] + for i, line in enumerate(lines): + match = pat.match(line) + if match: + # if it's at toplevel, it's already the best one + if line[0] == 'c': + return lines, i + # else add whitespace to candidate list + candidates.append((match.group(1), i)) + if candidates: + # this will sort by whitespace, and by line number, + # less whitespace first + candidates.sort() + return lines, candidates[0][1] + else: + raise IOError('could not find class definition') + + if ismethod(object): + object = object.__func__ + if isfunction(object): + object = object.__code__ + if istraceback(object): + object = object.tb_frame + if isframe(object): + object = object.f_code + if iscode(object): + if not hasattr(object, 'co_firstlineno'): + raise IOError('could not find function definition') + pat = re.compile(r'^(\s*def\s)|(.*(? 0: + if pmatch(lines[lnum]): + break + lnum -= 1 + + return lines, lnum + raise IOError('could not find code object') + + +# This is a patched version of inspect.getargs that applies the (unmerged) +# patch for http://bugs.python.org/issue14611 by Stefano Taschini. This fixes +# https://github.com/ipython/ipython/issues/8205 and +# https://github.com/ipython/ipython/issues/8293 +def getargs(co): + """Get information about the arguments accepted by a code object. + + Three things are returned: (args, varargs, varkw), where 'args' is + a list of argument names (possibly containing nested lists), and + 'varargs' and 'varkw' are the names of the * and ** arguments or None.""" + if not iscode(co): + raise TypeError('{!r} is not a code object'.format(co)) + + nargs = co.co_argcount + names = co.co_varnames + args = list(names[:nargs]) + step = 0 + + # The following acrobatics are for anonymous (tuple) arguments. + for i in range(nargs): + if args[i][:1] in ('', '.'): + stack, remain, count = [], [], [] + while step < len(co.co_code): + op = ord(co.co_code[step]) + step = step + 1 + if op >= dis.HAVE_ARGUMENT: + opname = dis.opname[op] + value = ord(co.co_code[step]) + ord(co.co_code[step+1])*256 + step = step + 2 + if opname in ('UNPACK_TUPLE', 'UNPACK_SEQUENCE'): + remain.append(value) + count.append(value) + elif opname in ('STORE_FAST', 'STORE_DEREF'): + if op in dis.haslocal: + stack.append(co.co_varnames[value]) + elif op in dis.hasfree: + stack.append((co.co_cellvars + co.co_freevars)[value]) + # Special case for sublists of length 1: def foo((bar)) + # doesn't generate the UNPACK_TUPLE bytecode, so if + # `remain` is empty here, we have such a sublist. + if not remain: + stack[0] = [stack[0]] + break + else: + remain[-1] = remain[-1] - 1 + while remain[-1] == 0: + remain.pop() + size = count.pop() + stack[-size:] = [stack[-size:]] + if not remain: + break + remain[-1] = remain[-1] - 1 + if not remain: + break + args[i] = stack[0] + + varargs = None + if co.co_flags & inspect.CO_VARARGS: + varargs = co.co_varnames[nargs] + nargs = nargs + 1 + varkw = None + if co.co_flags & inspect.CO_VARKEYWORDS: + varkw = co.co_varnames[nargs] + return inspect.Arguments(args, varargs, varkw) + + +# Monkeypatch inspect to apply our bugfix. +def with_patch_inspect(f): + """ + Deprecated since IPython 6.0 + decorator for monkeypatching inspect.findsource + """ + + def wrapped(*args, **kwargs): + save_findsource = inspect.findsource + save_getargs = inspect.getargs + inspect.findsource = findsource + inspect.getargs = getargs + try: + return f(*args, **kwargs) + finally: + inspect.findsource = save_findsource + inspect.getargs = save_getargs + + return wrapped + + +def fix_frame_records_filenames(records): + """Try to fix the filenames in each record from inspect.getinnerframes(). + + Particularly, modules loaded from within zip files have useless filenames + attached to their code object, and inspect.getinnerframes() just uses it. + """ + fixed_records = [] + for frame, filename, line_no, func_name, lines, index in records: + # Look inside the frame's globals dictionary for __file__, + # which should be better. However, keep Cython filenames since + # we prefer the source filenames over the compiled .so file. + if not filename.endswith(('.pyx', '.pxd', '.pxi')): + better_fn = frame.f_globals.get('__file__', None) + if isinstance(better_fn, str): + # Check the type just in case someone did something weird with + # __file__. It might also be None if the error occurred during + # import. + filename = better_fn + fixed_records.append((frame, filename, line_no, func_name, lines, index)) + return fixed_records + + +@with_patch_inspect +def _fixed_getinnerframes(etb, context=1, tb_offset=0): + LNUM_POS, LINES_POS, INDEX_POS = 2, 4, 5 + + records = fix_frame_records_filenames(inspect.getinnerframes(etb, context)) + # If the error is at the console, don't build any context, since it would + # otherwise produce 5 blank lines printed out (there is no file at the + # console) + rec_check = records[tb_offset:] + try: + rname = rec_check[0][1] + if rname == '' or rname.endswith(''): + return rec_check + except IndexError: + pass + + aux = traceback.extract_tb(etb) + assert len(records) == len(aux) + for i, (file, lnum, _, _) in enumerate(aux): + maybeStart = lnum - 1 - context // 2 + start = max(maybeStart, 0) + end = start + context + lines = linecache.getlines(file)[start:end] + buf = list(records[i]) + buf[LNUM_POS] = lnum + buf[INDEX_POS] = lnum - 1 - start + buf[LINES_POS] = lines + records[i] = tuple(buf) + return records[tb_offset:] + +# Helper function -- largely belongs to VerboseTB, but we need the same +# functionality to produce a pseudo verbose TB for SyntaxErrors, so that they +# can be recognized properly by ipython.el's py-traceback-line-re +# (SyntaxErrors have to be treated specially because they have no traceback) + + +def _format_traceback_lines(lnum, index, lines, Colors, lvals, _line_format): + """ + Format tracebacks lines with pointing arrow, leading numbers... + + Parameters + ========== + + lnum: int + index: int + lines: list[string] + Colors: + ColorScheme used. + lvals: bytes + Values of local variables, already colored, to inject just after the error line. + _line_format: f (str) -> (str, bool) + return (colorized version of str, failure to do so) + """ + numbers_width = INDENT_SIZE - 1 + res = [] + + for i,line in enumerate(lines, lnum-index): + line = py3compat.cast_unicode(line) + + new_line, err = _line_format(line, 'str') + if not err: + line = new_line + + if i == lnum: + # This is the line with the error + pad = numbers_width - len(str(i)) + num = '%s%s' % (debugger.make_arrow(pad), str(lnum)) + line = '%s%s%s %s%s' % (Colors.linenoEm, num, + Colors.line, line, Colors.Normal) + else: + num = '%*s' % (numbers_width, i) + line = '%s%s%s %s' % (Colors.lineno, num, + Colors.Normal, line) + + res.append(line) + if lvals and i == lnum: + res.append(lvals + '\n') + return res + +def is_recursion_error(etype, value, records): + try: + # RecursionError is new in Python 3.5 + recursion_error_type = RecursionError + except NameError: + recursion_error_type = RuntimeError + + # The default recursion limit is 1000, but some of that will be taken up + # by stack frames in IPython itself. >500 frames probably indicates + # a recursion error. + return (etype is recursion_error_type) \ + and "recursion" in str(value).lower() \ + and len(records) > _FRAME_RECURSION_LIMIT + +def find_recursion(etype, value, records): + """Identify the repeating stack frames from a RecursionError traceback + + 'records' is a list as returned by VerboseTB.get_records() + + Returns (last_unique, repeat_length) + """ + # This involves a bit of guesswork - we want to show enough of the traceback + # to indicate where the recursion is occurring. We guess that the innermost + # quarter of the traceback (250 frames by default) is repeats, and find the + # first frame (from in to out) that looks different. + if not is_recursion_error(etype, value, records): + return len(records), 0 + + # Select filename, lineno, func_name to track frames with + records = [r[1:4] for r in records] + inner_frames = records[-(len(records)//4):] + frames_repeated = set(inner_frames) + + last_seen_at = {} + longest_repeat = 0 + i = len(records) + for frame in reversed(records): + i -= 1 + if frame not in frames_repeated: + last_unique = i + break + + if frame in last_seen_at: + distance = last_seen_at[frame] - i + longest_repeat = max(longest_repeat, distance) + + last_seen_at[frame] = i + else: + last_unique = 0 # The whole traceback was recursion + + return last_unique, longest_repeat + +#--------------------------------------------------------------------------- +# Module classes +class TBTools(colorable.Colorable): + """Basic tools used by all traceback printer classes.""" + + # Number of frames to skip when reporting tracebacks + tb_offset = 0 + + def __init__(self, color_scheme='NoColor', call_pdb=False, ostream=None, parent=None, config=None): + # Whether to call the interactive pdb debugger after printing + # tracebacks or not + super(TBTools, self).__init__(parent=parent, config=config) + self.call_pdb = call_pdb + + # Output stream to write to. Note that we store the original value in + # a private attribute and then make the public ostream a property, so + # that we can delay accessing sys.stdout until runtime. The way + # things are written now, the sys.stdout object is dynamically managed + # so a reference to it should NEVER be stored statically. This + # property approach confines this detail to a single location, and all + # subclasses can simply access self.ostream for writing. + self._ostream = ostream + + # Create color table + self.color_scheme_table = exception_colors() + + self.set_colors(color_scheme) + self.old_scheme = color_scheme # save initial value for toggles + + if call_pdb: + self.pdb = debugger.Pdb() + else: + self.pdb = None + + def _get_ostream(self): + """Output stream that exceptions are written to. + + Valid values are: + + - None: the default, which means that IPython will dynamically resolve + to sys.stdout. This ensures compatibility with most tools, including + Windows (where plain stdout doesn't recognize ANSI escapes). + + - Any object with 'write' and 'flush' attributes. + """ + return sys.stdout if self._ostream is None else self._ostream + + def _set_ostream(self, val): + assert val is None or (hasattr(val, 'write') and hasattr(val, 'flush')) + self._ostream = val + + ostream = property(_get_ostream, _set_ostream) + + def get_parts_of_chained_exception(self, evalue): + def get_chained_exception(exception_value): + cause = getattr(exception_value, '__cause__', None) + if cause: + return cause + if getattr(exception_value, '__suppress_context__', False): + return None + return getattr(exception_value, '__context__', None) + + chained_evalue = get_chained_exception(evalue) + + if chained_evalue: + return chained_evalue.__class__, chained_evalue, chained_evalue.__traceback__ + + def prepare_chained_exception_message(self, cause): + direct_cause = "\nThe above exception was the direct cause of the following exception:\n" + exception_during_handling = "\nDuring handling of the above exception, another exception occurred:\n" + + if cause: + message = [[direct_cause]] + else: + message = [[exception_during_handling]] + return message + + def set_colors(self, *args, **kw): + """Shorthand access to the color table scheme selector method.""" + + # Set own color table + self.color_scheme_table.set_active_scheme(*args, **kw) + # for convenience, set Colors to the active scheme + self.Colors = self.color_scheme_table.active_colors + # Also set colors of debugger + if hasattr(self, 'pdb') and self.pdb is not None: + self.pdb.set_colors(*args, **kw) + + def color_toggle(self): + """Toggle between the currently active color scheme and NoColor.""" + + if self.color_scheme_table.active_scheme_name == 'NoColor': + self.color_scheme_table.set_active_scheme(self.old_scheme) + self.Colors = self.color_scheme_table.active_colors + else: + self.old_scheme = self.color_scheme_table.active_scheme_name + self.color_scheme_table.set_active_scheme('NoColor') + self.Colors = self.color_scheme_table.active_colors + + def stb2text(self, stb): + """Convert a structured traceback (a list) to a string.""" + return '\n'.join(stb) + + def text(self, etype, value, tb, tb_offset=None, context=5): + """Return formatted traceback. + + Subclasses may override this if they add extra arguments. + """ + tb_list = self.structured_traceback(etype, value, tb, + tb_offset, context) + return self.stb2text(tb_list) + + def structured_traceback(self, etype, evalue, tb, tb_offset=None, + context=5, mode=None): + """Return a list of traceback frames. + + Must be implemented by each class. + """ + raise NotImplementedError() + + +#--------------------------------------------------------------------------- +class ListTB(TBTools): + """Print traceback information from a traceback list, with optional color. + + Calling requires 3 arguments: (etype, evalue, elist) + as would be obtained by:: + + etype, evalue, tb = sys.exc_info() + if tb: + elist = traceback.extract_tb(tb) + else: + elist = None + + It can thus be used by programs which need to process the traceback before + printing (such as console replacements based on the code module from the + standard library). + + Because they are meant to be called without a full traceback (only a + list), instances of this class can't call the interactive pdb debugger.""" + + def __init__(self, color_scheme='NoColor', call_pdb=False, ostream=None, parent=None, config=None): + TBTools.__init__(self, color_scheme=color_scheme, call_pdb=call_pdb, + ostream=ostream, parent=parent,config=config) + + def __call__(self, etype, value, elist): + self.ostream.flush() + self.ostream.write(self.text(etype, value, elist)) + self.ostream.write('\n') + + def _extract_tb(self, tb): + if tb: + return traceback.extract_tb(tb) + else: + return None + + def structured_traceback(self, etype, evalue, etb=None, tb_offset=None, + context=5): + """Return a color formatted string with the traceback info. + + Parameters + ---------- + etype : exception type + Type of the exception raised. + + evalue : object + Data stored in the exception + + etb : object + If list: List of frames, see class docstring for details. + If Traceback: Traceback of the exception. + + tb_offset : int, optional + Number of frames in the traceback to skip. If not given, the + instance evalue is used (set in constructor). + + context : int, optional + Number of lines of context information to print. + + Returns + ------- + String with formatted exception. + """ + # This is a workaround to get chained_exc_ids in recursive calls + # etb should not be a tuple if structured_traceback is not recursive + if isinstance(etb, tuple): + etb, chained_exc_ids = etb + else: + chained_exc_ids = set() + + if isinstance(etb, list): + elist = etb + elif etb is not None: + elist = self._extract_tb(etb) + else: + elist = [] + tb_offset = self.tb_offset if tb_offset is None else tb_offset + Colors = self.Colors + out_list = [] + if elist: + + if tb_offset and len(elist) > tb_offset: + elist = elist[tb_offset:] + + out_list.append('Traceback %s(most recent call last)%s:' % + (Colors.normalEm, Colors.Normal) + '\n') + out_list.extend(self._format_list(elist)) + # The exception info should be a single entry in the list. + lines = ''.join(self._format_exception_only(etype, evalue)) + out_list.append(lines) + + exception = self.get_parts_of_chained_exception(evalue) + + if exception and not id(exception[1]) in chained_exc_ids: + chained_exception_message = self.prepare_chained_exception_message( + evalue.__cause__)[0] + etype, evalue, etb = exception + # Trace exception to avoid infinite 'cause' loop + chained_exc_ids.add(id(exception[1])) + chained_exceptions_tb_offset = 0 + out_list = ( + self.structured_traceback( + etype, evalue, (etb, chained_exc_ids), + chained_exceptions_tb_offset, context) + + chained_exception_message + + out_list) + + return out_list + + def _format_list(self, extracted_list): + """Format a list of traceback entry tuples for printing. + + Given a list of tuples as returned by extract_tb() or + extract_stack(), return a list of strings ready for printing. + Each string in the resulting list corresponds to the item with the + same index in the argument list. Each string ends in a newline; + the strings may contain internal newlines as well, for those items + whose source text line is not None. + + Lifted almost verbatim from traceback.py + """ + + Colors = self.Colors + list = [] + for filename, lineno, name, line in extracted_list[:-1]: + item = ' File %s"%s"%s, line %s%d%s, in %s%s%s\n' % \ + (Colors.filename, filename, Colors.Normal, + Colors.lineno, lineno, Colors.Normal, + Colors.name, name, Colors.Normal) + if line: + item += ' %s\n' % line.strip() + list.append(item) + # Emphasize the last entry + filename, lineno, name, line = extracted_list[-1] + item = '%s File %s"%s"%s, line %s%d%s, in %s%s%s%s\n' % \ + (Colors.normalEm, + Colors.filenameEm, filename, Colors.normalEm, + Colors.linenoEm, lineno, Colors.normalEm, + Colors.nameEm, name, Colors.normalEm, + Colors.Normal) + if line: + item += '%s %s%s\n' % (Colors.line, line.strip(), + Colors.Normal) + list.append(item) + return list + + def _format_exception_only(self, etype, value): + """Format the exception part of a traceback. + + The arguments are the exception type and value such as given by + sys.exc_info()[:2]. The return value is a list of strings, each ending + in a newline. Normally, the list contains a single string; however, + for SyntaxError exceptions, it contains several lines that (when + printed) display detailed information about where the syntax error + occurred. The message indicating which exception occurred is the + always last string in the list. + + Also lifted nearly verbatim from traceback.py + """ + have_filedata = False + Colors = self.Colors + list = [] + stype = py3compat.cast_unicode(Colors.excName + etype.__name__ + Colors.Normal) + if value is None: + # Not sure if this can still happen in Python 2.6 and above + list.append(stype + '\n') + else: + if issubclass(etype, SyntaxError): + have_filedata = True + if not value.filename: value.filename = "" + if value.lineno: + lineno = value.lineno + textline = linecache.getline(value.filename, value.lineno) + else: + lineno = 'unknown' + textline = '' + list.append('%s File %s"%s"%s, line %s%s%s\n' % \ + (Colors.normalEm, + Colors.filenameEm, py3compat.cast_unicode(value.filename), Colors.normalEm, + Colors.linenoEm, lineno, Colors.Normal )) + if textline == '': + textline = py3compat.cast_unicode(value.text, "utf-8") + + if textline is not None: + i = 0 + while i < len(textline) and textline[i].isspace(): + i += 1 + list.append('%s %s%s\n' % (Colors.line, + textline.strip(), + Colors.Normal)) + if value.offset is not None: + s = ' ' + for c in textline[i:value.offset - 1]: + if c.isspace(): + s += c + else: + s += ' ' + list.append('%s%s^%s\n' % (Colors.caret, s, + Colors.Normal)) + + try: + s = value.msg + except Exception: + s = self._some_str(value) + if s: + list.append('%s%s:%s %s\n' % (stype, Colors.excName, + Colors.Normal, s)) + else: + list.append('%s\n' % stype) + + # sync with user hooks + if have_filedata: + ipinst = get_ipython() + if ipinst is not None: + ipinst.hooks.synchronize_with_editor(value.filename, value.lineno, 0) + + return list + + def get_exception_only(self, etype, value): + """Only print the exception type and message, without a traceback. + + Parameters + ---------- + etype : exception type + value : exception value + """ + return ListTB.structured_traceback(self, etype, value) + + def show_exception_only(self, etype, evalue): + """Only print the exception type and message, without a traceback. + + Parameters + ---------- + etype : exception type + value : exception value + """ + # This method needs to use __call__ from *this* class, not the one from + # a subclass whose signature or behavior may be different + ostream = self.ostream + ostream.flush() + ostream.write('\n'.join(self.get_exception_only(etype, evalue))) + ostream.flush() + + def _some_str(self, value): + # Lifted from traceback.py + try: + return py3compat.cast_unicode(str(value)) + except: + return u'' % type(value).__name__ + + +#---------------------------------------------------------------------------- +class VerboseTB(TBTools): + """A port of Ka-Ping Yee's cgitb.py module that outputs color text instead + of HTML. Requires inspect and pydoc. Crazy, man. + + Modified version which optionally strips the topmost entries from the + traceback, to be used with alternate interpreters (because their own code + would appear in the traceback).""" + + def __init__(self, color_scheme='Linux', call_pdb=False, ostream=None, + tb_offset=0, long_header=False, include_vars=True, + check_cache=None, debugger_cls = None, + parent=None, config=None): + """Specify traceback offset, headers and color scheme. + + Define how many frames to drop from the tracebacks. Calling it with + tb_offset=1 allows use of this handler in interpreters which will have + their own code at the top of the traceback (VerboseTB will first + remove that frame before printing the traceback info).""" + TBTools.__init__(self, color_scheme=color_scheme, call_pdb=call_pdb, + ostream=ostream, parent=parent, config=config) + self.tb_offset = tb_offset + self.long_header = long_header + self.include_vars = include_vars + # By default we use linecache.checkcache, but the user can provide a + # different check_cache implementation. This is used by the IPython + # kernel to provide tracebacks for interactive code that is cached, + # by a compiler instance that flushes the linecache but preserves its + # own code cache. + if check_cache is None: + check_cache = linecache.checkcache + self.check_cache = check_cache + + self.debugger_cls = debugger_cls or debugger.Pdb + self.skip_hidden = True + + def format_records(self, records, last_unique, recursion_repeat): + """Format the stack frames of the traceback""" + frames = [] + + skipped = 0 + for r in records[:last_unique+recursion_repeat+1]: + if self.skip_hidden: + if r[0].f_locals.get("__tracebackhide__", 0): + skipped += 1 + continue + if skipped: + Colors = self.Colors # just a shorthand + quicker name lookup + ColorsNormal = Colors.Normal # used a lot + frames.append( + " %s[... skipping hidden %s frame]%s\n" + % (Colors.excName, skipped, ColorsNormal) + ) + skipped = 0 + + frames.append(self.format_record(*r)) + + if skipped: + Colors = self.Colors # just a shorthand + quicker name lookup + ColorsNormal = Colors.Normal # used a lot + frames.append( + " %s[... skipping hidden %s frame]%s\n" + % (Colors.excName, skipped, ColorsNormal) + ) + + if recursion_repeat: + frames.append('... last %d frames repeated, from the frame below ...\n' % recursion_repeat) + frames.append(self.format_record(*records[last_unique+recursion_repeat+1])) + + return frames + + def format_record(self, frame, file, lnum, func, lines, index): + """Format a single stack frame""" + Colors = self.Colors # just a shorthand + quicker name lookup + ColorsNormal = Colors.Normal # used a lot + col_scheme = self.color_scheme_table.active_scheme_name + indent = ' ' * INDENT_SIZE + em_normal = '%s\n%s%s' % (Colors.valEm, indent, ColorsNormal) + undefined = '%sundefined%s' % (Colors.em, ColorsNormal) + tpl_link = '%s%%s%s' % (Colors.filenameEm, ColorsNormal) + tpl_call = 'in %s%%s%s%%s%s' % (Colors.vName, Colors.valEm, + ColorsNormal) + tpl_call_fail = 'in %s%%s%s(***failed resolving arguments***)%s' % \ + (Colors.vName, Colors.valEm, ColorsNormal) + tpl_local_var = '%s%%s%s' % (Colors.vName, ColorsNormal) + tpl_global_var = '%sglobal%s %s%%s%s' % (Colors.em, ColorsNormal, + Colors.vName, ColorsNormal) + tpl_name_val = '%%s %s= %%s%s' % (Colors.valEm, ColorsNormal) + + if not file: + file = '?' + elif file.startswith(str("<")) and file.endswith(str(">")): + # Not a real filename, no problem... + pass + elif not os.path.isabs(file): + # Try to make the filename absolute by trying all + # sys.path entries (which is also what linecache does) + for dirname in sys.path: + try: + fullname = os.path.join(dirname, file) + if os.path.isfile(fullname): + file = os.path.abspath(fullname) + break + except Exception: + # Just in case that sys.path contains very + # strange entries... + pass + + file = py3compat.cast_unicode(file, util_path.fs_encoding) + link = tpl_link % util_path.compress_user(file) + args, varargs, varkw, locals_ = inspect.getargvalues(frame) + + if func == '?': + call = '' + elif func == '': + call = tpl_call % (func, '') + else: + # Decide whether to include variable details or not + var_repr = eqrepr if self.include_vars else nullrepr + try: + call = tpl_call % (func, inspect.formatargvalues(args, + varargs, varkw, + locals_, formatvalue=var_repr)) + except KeyError: + # This happens in situations like errors inside generator + # expressions, where local variables are listed in the + # line, but can't be extracted from the frame. I'm not + # 100% sure this isn't actually a bug in inspect itself, + # but since there's no info for us to compute with, the + # best we can do is report the failure and move on. Here + # we must *not* call any traceback construction again, + # because that would mess up use of %debug later on. So we + # simply report the failure and move on. The only + # limitation will be that this frame won't have locals + # listed in the call signature. Quite subtle problem... + # I can't think of a good way to validate this in a unit + # test, but running a script consisting of: + # dict( (k,v.strip()) for (k,v) in range(10) ) + # will illustrate the error, if this exception catch is + # disabled. + call = tpl_call_fail % func + + # Don't attempt to tokenize binary files. + if file.endswith(('.so', '.pyd', '.dll')): + return '%s %s\n' % (link, call) + + elif file.endswith(('.pyc', '.pyo')): + # Look up the corresponding source file. + try: + file = source_from_cache(file) + except ValueError: + # Failed to get the source file for some reason + # E.g. https://github.com/ipython/ipython/issues/9486 + return '%s %s\n' % (link, call) + + def linereader(file=file, lnum=[lnum], getline=linecache.getline): + line = getline(file, lnum[0]) + lnum[0] += 1 + return line + + # Build the list of names on this line of code where the exception + # occurred. + try: + names = [] + name_cont = False + + for token_type, token, start, end, line in generate_tokens(linereader): + # build composite names + if token_type == tokenize.NAME and token not in keyword.kwlist: + if name_cont: + # Continuation of a dotted name + try: + names[-1].append(token) + except IndexError: + names.append([token]) + name_cont = False + else: + # Regular new names. We append everything, the caller + # will be responsible for pruning the list later. It's + # very tricky to try to prune as we go, b/c composite + # names can fool us. The pruning at the end is easy + # to do (or the caller can print a list with repeated + # names if so desired. + names.append([token]) + elif token == '.': + name_cont = True + elif token_type == tokenize.NEWLINE: + break + + except (IndexError, UnicodeDecodeError, SyntaxError): + # signals exit of tokenizer + # SyntaxError can occur if the file is not actually Python + # - see gh-6300 + pass + except tokenize.TokenError as msg: + # Tokenizing may fail for various reasons, many of which are + # harmless. (A good example is when the line in question is the + # close of a triple-quoted string, cf gh-6864). We don't want to + # show this to users, but want make it available for debugging + # purposes. + _m = ("An unexpected error occurred while tokenizing input\n" + "The following traceback may be corrupted or invalid\n" + "The error message is: %s\n" % msg) + debug(_m) + + # Join composite names (e.g. "dict.fromkeys") + names = ['.'.join(n) for n in names] + # prune names list of duplicates, but keep the right order + unique_names = uniq_stable(names) + + # Start loop over vars + lvals = '' + lvals_list = [] + if self.include_vars: + for name_full in unique_names: + name_base = name_full.split('.', 1)[0] + if name_base in frame.f_code.co_varnames: + if name_base in locals_: + try: + value = repr(eval(name_full, locals_)) + except: + value = undefined + else: + value = undefined + name = tpl_local_var % name_full + else: + if name_base in frame.f_globals: + try: + value = repr(eval(name_full, frame.f_globals)) + except: + value = undefined + else: + value = undefined + name = tpl_global_var % name_full + lvals_list.append(tpl_name_val % (name, value)) + if lvals_list: + lvals = '%s%s' % (indent, em_normal.join(lvals_list)) + + level = '%s %s\n' % (link, call) + + if index is None: + return level + else: + _line_format = PyColorize.Parser(style=col_scheme, parent=self).format2 + return '%s%s' % (level, ''.join( + _format_traceback_lines(lnum, index, lines, Colors, lvals, + _line_format))) + + def prepare_header(self, etype, long_version=False): + colors = self.Colors # just a shorthand + quicker name lookup + colorsnormal = colors.Normal # used a lot + exc = '%s%s%s' % (colors.excName, etype, colorsnormal) + width = min(75, get_terminal_size()[0]) + if long_version: + # Header with the exception type, python version, and date + pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable + date = time.ctime(time.time()) + + head = '%s%s%s\n%s%s%s\n%s' % (colors.topline, '-' * width, colorsnormal, + exc, ' ' * (width - len(str(etype)) - len(pyver)), + pyver, date.rjust(width) ) + head += "\nA problem occurred executing Python code. Here is the sequence of function" \ + "\ncalls leading up to the error, with the most recent (innermost) call last." + else: + # Simplified header + head = '%s%s' % (exc, 'Traceback (most recent call last)'. \ + rjust(width - len(str(etype))) ) + + return head + + def format_exception(self, etype, evalue): + colors = self.Colors # just a shorthand + quicker name lookup + colorsnormal = colors.Normal # used a lot + # Get (safely) a string form of the exception info + try: + etype_str, evalue_str = map(str, (etype, evalue)) + except: + # User exception is improperly defined. + etype, evalue = str, sys.exc_info()[:2] + etype_str, evalue_str = map(str, (etype, evalue)) + # ... and format it + return ['%s%s%s: %s' % (colors.excName, etype_str, + colorsnormal, py3compat.cast_unicode(evalue_str))] + + def format_exception_as_a_whole(self, etype, evalue, etb, number_of_lines_of_context, tb_offset): + """Formats the header, traceback and exception message for a single exception. + + This may be called multiple times by Python 3 exception chaining + (PEP 3134). + """ + # some locals + orig_etype = etype + try: + etype = etype.__name__ + except AttributeError: + pass + + tb_offset = self.tb_offset if tb_offset is None else tb_offset + head = self.prepare_header(etype, self.long_header) + records = self.get_records(etb, number_of_lines_of_context, tb_offset) + + + last_unique, recursion_repeat = find_recursion(orig_etype, evalue, records) + + frames = self.format_records(records, last_unique, recursion_repeat) + + formatted_exception = self.format_exception(etype, evalue) + if records: + filepath, lnum = records[-1][1:3] + filepath = os.path.abspath(filepath) + ipinst = get_ipython() + if ipinst is not None: + ipinst.hooks.synchronize_with_editor(filepath, lnum, 0) + + return [[head] + frames + [''.join(formatted_exception[0])]] + + def get_records(self, etb, number_of_lines_of_context, tb_offset): + try: + # Try the default getinnerframes and Alex's: Alex's fixes some + # problems, but it generates empty tracebacks for console errors + # (5 blanks lines) where none should be returned. + return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset) + except UnicodeDecodeError: + # This can occur if a file's encoding magic comment is wrong. + # I can't see a way to recover without duplicating a bunch of code + # from the stdlib traceback module. --TK + error('\nUnicodeDecodeError while processing traceback.\n') + return None + except: + # FIXME: I've been getting many crash reports from python 2.3 + # users, traceable to inspect.py. If I can find a small test-case + # to reproduce this, I should either write a better workaround or + # file a bug report against inspect (if that's the real problem). + # So far, I haven't been able to find an isolated example to + # reproduce the problem. + inspect_error() + traceback.print_exc(file=self.ostream) + info('\nUnfortunately, your original traceback can not be constructed.\n') + return None + + def structured_traceback(self, etype, evalue, etb, tb_offset=None, + number_of_lines_of_context=5): + """Return a nice text document describing the traceback.""" + + formatted_exception = self.format_exception_as_a_whole(etype, evalue, etb, number_of_lines_of_context, + tb_offset) + + colors = self.Colors # just a shorthand + quicker name lookup + colorsnormal = colors.Normal # used a lot + head = '%s%s%s' % (colors.topline, '-' * min(75, get_terminal_size()[0]), colorsnormal) + structured_traceback_parts = [head] + chained_exceptions_tb_offset = 0 + lines_of_context = 3 + formatted_exceptions = formatted_exception + exception = self.get_parts_of_chained_exception(evalue) + if exception: + formatted_exceptions += self.prepare_chained_exception_message(evalue.__cause__) + etype, evalue, etb = exception + else: + evalue = None + chained_exc_ids = set() + while evalue: + formatted_exceptions += self.format_exception_as_a_whole(etype, evalue, etb, lines_of_context, + chained_exceptions_tb_offset) + exception = self.get_parts_of_chained_exception(evalue) + + if exception and not id(exception[1]) in chained_exc_ids: + chained_exc_ids.add(id(exception[1])) # trace exception to avoid infinite 'cause' loop + formatted_exceptions += self.prepare_chained_exception_message(evalue.__cause__) + etype, evalue, etb = exception + else: + evalue = None + + # we want to see exceptions in a reversed order: + # the first exception should be on top + for formatted_exception in reversed(formatted_exceptions): + structured_traceback_parts += formatted_exception + + return structured_traceback_parts + + def debugger(self, force=False): + """Call up the pdb debugger if desired, always clean up the tb + reference. + + Keywords: + + - force(False): by default, this routine checks the instance call_pdb + flag and does not actually invoke the debugger if the flag is false. + The 'force' option forces the debugger to activate even if the flag + is false. + + If the call_pdb flag is set, the pdb interactive debugger is + invoked. In all cases, the self.tb reference to the current traceback + is deleted to prevent lingering references which hamper memory + management. + + Note that each call to pdb() does an 'import readline', so if your app + requires a special setup for the readline completers, you'll have to + fix that by hand after invoking the exception handler.""" + + if force or self.call_pdb: + if self.pdb is None: + self.pdb = self.debugger_cls() + # the system displayhook may have changed, restore the original + # for pdb + display_trap = DisplayTrap(hook=sys.__displayhook__) + with display_trap: + self.pdb.reset() + # Find the right frame so we don't pop up inside ipython itself + if hasattr(self, 'tb') and self.tb is not None: + etb = self.tb + else: + etb = self.tb = sys.last_traceback + while self.tb is not None and self.tb.tb_next is not None: + self.tb = self.tb.tb_next + if etb and etb.tb_next: + etb = etb.tb_next + self.pdb.botframe = etb.tb_frame + self.pdb.interaction(None, etb) + + if hasattr(self, 'tb'): + del self.tb + + def handler(self, info=None): + (etype, evalue, etb) = info or sys.exc_info() + self.tb = etb + ostream = self.ostream + ostream.flush() + ostream.write(self.text(etype, evalue, etb)) + ostream.write('\n') + ostream.flush() + + # Changed so an instance can just be called as VerboseTB_inst() and print + # out the right info on its own. + def __call__(self, etype=None, evalue=None, etb=None): + """This hook can replace sys.excepthook (for Python 2.1 or higher).""" + if etb is None: + self.handler() + else: + self.handler((etype, evalue, etb)) + try: + self.debugger() + except KeyboardInterrupt: + print("\nKeyboardInterrupt") + + +#---------------------------------------------------------------------------- +class FormattedTB(VerboseTB, ListTB): + """Subclass ListTB but allow calling with a traceback. + + It can thus be used as a sys.excepthook for Python > 2.1. + + Also adds 'Context' and 'Verbose' modes, not available in ListTB. + + Allows a tb_offset to be specified. This is useful for situations where + one needs to remove a number of topmost frames from the traceback (such as + occurs with python programs that themselves execute other python code, + like Python shells). """ + + def __init__(self, mode='Plain', color_scheme='Linux', call_pdb=False, + ostream=None, + tb_offset=0, long_header=False, include_vars=False, + check_cache=None, debugger_cls=None, + parent=None, config=None): + + # NEVER change the order of this list. Put new modes at the end: + self.valid_modes = ['Plain', 'Context', 'Verbose', 'Minimal'] + self.verbose_modes = self.valid_modes[1:3] + + VerboseTB.__init__(self, color_scheme=color_scheme, call_pdb=call_pdb, + ostream=ostream, tb_offset=tb_offset, + long_header=long_header, include_vars=include_vars, + check_cache=check_cache, debugger_cls=debugger_cls, + parent=parent, config=config) + + # Different types of tracebacks are joined with different separators to + # form a single string. They are taken from this dict + self._join_chars = dict(Plain='', Context='\n', Verbose='\n', + Minimal='') + # set_mode also sets the tb_join_char attribute + self.set_mode(mode) + + def structured_traceback(self, etype, value, tb, tb_offset=None, number_of_lines_of_context=5): + tb_offset = self.tb_offset if tb_offset is None else tb_offset + mode = self.mode + if mode in self.verbose_modes: + # Verbose modes need a full traceback + return VerboseTB.structured_traceback( + self, etype, value, tb, tb_offset, number_of_lines_of_context + ) + elif mode == 'Minimal': + return ListTB.get_exception_only(self, etype, value) + else: + # We must check the source cache because otherwise we can print + # out-of-date source code. + self.check_cache() + # Now we can extract and format the exception + return ListTB.structured_traceback( + self, etype, value, tb, tb_offset, number_of_lines_of_context + ) + + def stb2text(self, stb): + """Convert a structured traceback (a list) to a string.""" + return self.tb_join_char.join(stb) + + + def set_mode(self, mode=None): + """Switch to the desired mode. + + If mode is not specified, cycles through the available modes.""" + + if not mode: + new_idx = (self.valid_modes.index(self.mode) + 1 ) % \ + len(self.valid_modes) + self.mode = self.valid_modes[new_idx] + elif mode not in self.valid_modes: + raise ValueError('Unrecognized mode in FormattedTB: <' + mode + '>\n' + 'Valid modes: ' + str(self.valid_modes)) + else: + self.mode = mode + # include variable details only in 'Verbose' mode + self.include_vars = (self.mode == self.valid_modes[2]) + # Set the join character for generating text tracebacks + self.tb_join_char = self._join_chars[self.mode] + + # some convenient shortcuts + def plain(self): + self.set_mode(self.valid_modes[0]) + + def context(self): + self.set_mode(self.valid_modes[1]) + + def verbose(self): + self.set_mode(self.valid_modes[2]) + + def minimal(self): + self.set_mode(self.valid_modes[3]) + + +#---------------------------------------------------------------------------- +class AutoFormattedTB(FormattedTB): + """A traceback printer which can be called on the fly. + + It will find out about exceptions by itself. + + A brief example:: + + AutoTB = AutoFormattedTB(mode = 'Verbose',color_scheme='Linux') + try: + ... + except: + AutoTB() # or AutoTB(out=logfile) where logfile is an open file object + """ + + def __call__(self, etype=None, evalue=None, etb=None, + out=None, tb_offset=None): + """Print out a formatted exception traceback. + + Optional arguments: + - out: an open file-like object to direct output to. + + - tb_offset: the number of frames to skip over in the stack, on a + per-call basis (this overrides temporarily the instance's tb_offset + given at initialization time. """ + + if out is None: + out = self.ostream + out.flush() + out.write(self.text(etype, evalue, etb, tb_offset)) + out.write('\n') + out.flush() + # FIXME: we should remove the auto pdb behavior from here and leave + # that to the clients. + try: + self.debugger() + except KeyboardInterrupt: + print("\nKeyboardInterrupt") + + def structured_traceback(self, etype=None, value=None, tb=None, + tb_offset=None, number_of_lines_of_context=5): + if etype is None: + etype, value, tb = sys.exc_info() + if isinstance(tb, tuple): + # tb is a tuple if this is a chained exception. + self.tb = tb[0] + else: + self.tb = tb + return FormattedTB.structured_traceback( + self, etype, value, tb, tb_offset, number_of_lines_of_context) + + +#--------------------------------------------------------------------------- + +# A simple class to preserve Nathan's original functionality. +class ColorTB(FormattedTB): + """Shorthand to initialize a FormattedTB in Linux colors mode.""" + + def __init__(self, color_scheme='Linux', call_pdb=0, **kwargs): + FormattedTB.__init__(self, color_scheme=color_scheme, + call_pdb=call_pdb, **kwargs) + + +class SyntaxTB(ListTB): + """Extension which holds some state: the last exception value""" + + def __init__(self, color_scheme='NoColor', parent=None, config=None): + ListTB.__init__(self, color_scheme, parent=parent, config=config) + self.last_syntax_error = None + + def __call__(self, etype, value, elist): + self.last_syntax_error = value + + ListTB.__call__(self, etype, value, elist) + + def structured_traceback(self, etype, value, elist, tb_offset=None, + context=5): + # If the source file has been edited, the line in the syntax error can + # be wrong (retrieved from an outdated cache). This replaces it with + # the current value. + if isinstance(value, SyntaxError) \ + and isinstance(value.filename, str) \ + and isinstance(value.lineno, int): + linecache.checkcache(value.filename) + newtext = linecache.getline(value.filename, value.lineno) + if newtext: + value.text = newtext + self.last_syntax_error = value + return super(SyntaxTB, self).structured_traceback(etype, value, elist, + tb_offset=tb_offset, context=context) + + def clear_err_state(self): + """Return the current error state and clear it""" + e = self.last_syntax_error + self.last_syntax_error = None + return e + + def stb2text(self, stb): + """Convert a structured traceback (a list) to a string.""" + return ''.join(stb) + + +# some internal-use functions +def text_repr(value): + """Hopefully pretty robust repr equivalent.""" + # this is pretty horrible but should always return *something* + try: + return pydoc.text.repr(value) + except KeyboardInterrupt: + raise + except: + try: + return repr(value) + except KeyboardInterrupt: + raise + except: + try: + # all still in an except block so we catch + # getattr raising + name = getattr(value, '__name__', None) + if name: + # ick, recursion + return text_repr(name) + klass = getattr(value, '__class__', None) + if klass: + return '%s instance' % text_repr(klass) + except KeyboardInterrupt: + raise + except: + return 'UNRECOVERABLE REPR FAILURE' + + +def eqrepr(value, repr=text_repr): + return '=%s' % repr(value) + + +def nullrepr(value, repr=text_repr): + return '' diff --git a/.venv/lib/python3.8/site-packages/IPython/core/usage.py b/.venv/lib/python3.8/site-packages/IPython/core/usage.py new file mode 100644 index 00000000..37024c44 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/core/usage.py @@ -0,0 +1,341 @@ +# -*- coding: utf-8 -*- +"""Usage information for the main IPython applications. +""" +#----------------------------------------------------------------------------- +# Copyright (C) 2008-2011 The IPython Development Team +# Copyright (C) 2001-2007 Fernando Perez. +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +import sys +from IPython.core import release + +cl_usage = """\ +========= + IPython +========= + +Tools for Interactive Computing in Python +========================================= + + A Python shell with automatic history (input and output), dynamic object + introspection, easier configuration, command completion, access to the + system shell and more. IPython can also be embedded in running programs. + + +Usage + + ipython [subcommand] [options] [-c cmd | -m mod | file] [--] [arg] ... + + If invoked with no options, it executes the file and exits, passing the + remaining arguments to the script, just as if you had specified the same + command with python. You may need to specify `--` before args to be passed + to the script, to prevent IPython from attempting to parse them. If you + specify the option `-i` before the filename, it will enter an interactive + IPython session after running the script, rather than exiting. Files ending + in .py will be treated as normal Python, but files ending in .ipy can + contain special IPython syntax (magic commands, shell expansions, etc.). + + Almost all configuration in IPython is available via the command-line. Do + `ipython --help-all` to see all available options. For persistent + configuration, look into your `ipython_config.py` configuration file for + details. + + This file is typically installed in the `IPYTHONDIR` directory, and there + is a separate configuration directory for each profile. The default profile + directory will be located in $IPYTHONDIR/profile_default. IPYTHONDIR + defaults to to `$HOME/.ipython`. For Windows users, $HOME resolves to + C:\\Users\\YourUserName in most instances. + + To initialize a profile with the default configuration file, do:: + + $> ipython profile create + + and start editing `IPYTHONDIR/profile_default/ipython_config.py` + + In IPython's documentation, we will refer to this directory as + `IPYTHONDIR`, you can change its default location by creating an + environment variable with this name and setting it to the desired path. + + For more information, see the manual available in HTML and PDF in your + installation, or online at https://ipython.org/documentation.html. +""" + +interactive_usage = """ +IPython -- An enhanced Interactive Python +========================================= + +IPython offers a fully compatible replacement for the standard Python +interpreter, with convenient shell features, special commands, command +history mechanism and output results caching. + +At your system command line, type 'ipython -h' to see the command line +options available. This document only describes interactive features. + +GETTING HELP +------------ + +Within IPython you have various way to access help: + + ? -> Introduction and overview of IPython's features (this screen). + object? -> Details about 'object'. + object?? -> More detailed, verbose information about 'object'. + %quickref -> Quick reference of all IPython specific syntax and magics. + help -> Access Python's own help system. + +If you are in terminal IPython you can quit this screen by pressing `q`. + + +MAIN FEATURES +------------- + +* Access to the standard Python help with object docstrings and the Python + manuals. Simply type 'help' (no quotes) to invoke it. + +* Magic commands: type %magic for information on the magic subsystem. + +* System command aliases, via the %alias command or the configuration file(s). + +* Dynamic object information: + + Typing ?word or word? prints detailed information about an object. Certain + long strings (code, etc.) get snipped in the center for brevity. + + Typing ??word or word?? gives access to the full information without + snipping long strings. Strings that are longer than the screen are printed + through the less pager. + + The ?/?? system gives access to the full source code for any object (if + available), shows function prototypes and other useful information. + + If you just want to see an object's docstring, type '%pdoc object' (without + quotes, and without % if you have automagic on). + +* Tab completion in the local namespace: + + At any time, hitting tab will complete any available python commands or + variable names, and show you a list of the possible completions if there's + no unambiguous one. It will also complete filenames in the current directory. + +* Search previous command history in multiple ways: + + - Start typing, and then use arrow keys up/down or (Ctrl-p/Ctrl-n) to search + through the history items that match what you've typed so far. + + - Hit Ctrl-r: opens a search prompt. Begin typing and the system searches + your history for lines that match what you've typed so far, completing as + much as it can. + + - %hist: search history by index. + +* Persistent command history across sessions. + +* Logging of input with the ability to save and restore a working session. + +* System shell with !. Typing !ls will run 'ls' in the current directory. + +* The reload command does a 'deep' reload of a module: changes made to the + module since you imported will actually be available without having to exit. + +* Verbose and colored exception traceback printouts. See the magic xmode and + xcolor functions for details (just type %magic). + +* Input caching system: + + IPython offers numbered prompts (In/Out) with input and output caching. All + input is saved and can be retrieved as variables (besides the usual arrow + key recall). + + The following GLOBAL variables always exist (so don't overwrite them!): + _i: stores previous input. + _ii: next previous. + _iii: next-next previous. + _ih : a list of all input _ih[n] is the input from line n. + + Additionally, global variables named _i are dynamically created ( + being the prompt counter), such that _i == _ih[] + + For example, what you typed at prompt 14 is available as _i14 and _ih[14]. + + You can create macros which contain multiple input lines from this history, + for later re-execution, with the %macro function. + + The history function %hist allows you to see any part of your input history + by printing a range of the _i variables. Note that inputs which contain + magic functions (%) appear in the history with a prepended comment. This is + because they aren't really valid Python code, so you can't exec them. + +* Output caching system: + + For output that is returned from actions, a system similar to the input + cache exists but using _ instead of _i. Only actions that produce a result + (NOT assignments, for example) are cached. If you are familiar with + Mathematica, IPython's _ variables behave exactly like Mathematica's % + variables. + + The following GLOBAL variables always exist (so don't overwrite them!): + _ (one underscore): previous output. + __ (two underscores): next previous. + ___ (three underscores): next-next previous. + + Global variables named _ are dynamically created ( being the prompt + counter), such that the result of output is always available as _. + + Finally, a global dictionary named _oh exists with entries for all lines + which generated output. + +* Directory history: + + Your history of visited directories is kept in the global list _dh, and the + magic %cd command can be used to go to any entry in that list. + +* Auto-parentheses and auto-quotes (adapted from Nathan Gray's LazyPython) + + 1. Auto-parentheses + + Callable objects (i.e. functions, methods, etc) can be invoked like + this (notice the commas between the arguments):: + + In [1]: callable_ob arg1, arg2, arg3 + + and the input will be translated to this:: + + callable_ob(arg1, arg2, arg3) + + This feature is off by default (in rare cases it can produce + undesirable side-effects), but you can activate it at the command-line + by starting IPython with `--autocall 1`, set it permanently in your + configuration file, or turn on at runtime with `%autocall 1`. + + You can force auto-parentheses by using '/' as the first character + of a line. For example:: + + In [1]: /globals # becomes 'globals()' + + Note that the '/' MUST be the first character on the line! This + won't work:: + + In [2]: print /globals # syntax error + + In most cases the automatic algorithm should work, so you should + rarely need to explicitly invoke /. One notable exception is if you + are trying to call a function with a list of tuples as arguments (the + parenthesis will confuse IPython):: + + In [1]: zip (1,2,3),(4,5,6) # won't work + + but this will work:: + + In [2]: /zip (1,2,3),(4,5,6) + ------> zip ((1,2,3),(4,5,6)) + Out[2]= [(1, 4), (2, 5), (3, 6)] + + IPython tells you that it has altered your command line by + displaying the new command line preceded by -->. e.g.:: + + In [18]: callable list + -------> callable (list) + + 2. Auto-Quoting + + You can force auto-quoting of a function's arguments by using ',' as + the first character of a line. For example:: + + In [1]: ,my_function /home/me # becomes my_function("/home/me") + + If you use ';' instead, the whole argument is quoted as a single + string (while ',' splits on whitespace):: + + In [2]: ,my_function a b c # becomes my_function("a","b","c") + In [3]: ;my_function a b c # becomes my_function("a b c") + + Note that the ',' MUST be the first character on the line! This + won't work:: + + In [4]: x = ,my_function /home/me # syntax error +""" + +interactive_usage_min = """\ +An enhanced console for Python. +Some of its features are: +- Tab completion in the local namespace. +- Logging of input, see command-line options. +- System shell escape via ! , eg !ls. +- Magic commands, starting with a % (like %ls, %pwd, %cd, etc.) +- Keeps track of locally defined variables via %who, %whos. +- Show object information with a ? eg ?x or x? (use ?? for more info). +""" + +quick_reference = r""" +IPython -- An enhanced Interactive Python - Quick Reference Card +================================================================ + +obj?, obj?? : Get help, or more help for object (also works as + ?obj, ??obj). +?foo.*abc* : List names in 'foo' containing 'abc' in them. +%magic : Information about IPython's 'magic' % functions. + +Magic functions are prefixed by % or %%, and typically take their arguments +without parentheses, quotes or even commas for convenience. Line magics take a +single % and cell magics are prefixed with two %%. + +Example magic function calls: + +%alias d ls -F : 'd' is now an alias for 'ls -F' +alias d ls -F : Works if 'alias' not a python name +alist = %alias : Get list of aliases to 'alist' +cd /usr/share : Obvious. cd - to choose from visited dirs. +%cd?? : See help AND source for magic %cd +%timeit x=10 : time the 'x=10' statement with high precision. +%%timeit x=2**100 +x**100 : time 'x**100' with a setup of 'x=2**100'; setup code is not + counted. This is an example of a cell magic. + +System commands: + +!cp a.txt b/ : System command escape, calls os.system() +cp a.txt b/ : after %rehashx, most system commands work without ! +cp ${f}.txt $bar : Variable expansion in magics and system commands +files = !ls /usr : Capture system command output +files.s, files.l, files.n: "a b c", ['a','b','c'], 'a\nb\nc' + +History: + +_i, _ii, _iii : Previous, next previous, next next previous input +_i4, _ih[2:5] : Input history line 4, lines 2-4 +exec _i81 : Execute input history line #81 again +%rep 81 : Edit input history line #81 +_, __, ___ : previous, next previous, next next previous output +_dh : Directory history +_oh : Output history +%hist : Command history of current session. +%hist -g foo : Search command history of (almost) all sessions for 'foo'. +%hist -g : Command history of (almost) all sessions. +%hist 1/2-8 : Command history containing lines 2-8 of session 1. +%hist 1/ ~2/ : Command history of session 1 and 2 sessions before current. +%hist ~8/1-~6/5 : Command history from line 1 of 8 sessions ago to + line 5 of 6 sessions ago. +%edit 0/ : Open editor to execute code with history of current session. + +Autocall: + +f 1,2 : f(1,2) # Off by default, enable with %autocall magic. +/f 1,2 : f(1,2) (forced autoparen) +,f 1 2 : f("1","2") +;f 1 2 : f("1 2") + +Remember: TAB completion works in many contexts, not just file names +or python names. + +The following magic functions are currently available: + +""" + +default_banner_parts = ["Python %s\n"%sys.version.split("\n")[0], + "Type 'copyright', 'credits' or 'license' for more information\n" , + "IPython {version} -- An enhanced Interactive Python. Type '?' for help.\n".format(version=release.version), +] + +default_banner = ''.join(default_banner_parts) diff --git a/.venv/lib/python3.8/site-packages/IPython/display.py b/.venv/lib/python3.8/site-packages/IPython/display.py new file mode 100644 index 00000000..7d248ba0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/display.py @@ -0,0 +1,16 @@ +"""Public API for display tools in IPython. +""" + +#----------------------------------------------------------------------------- +# Copyright (C) 2012 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +from IPython.core.display import * +from IPython.lib.display import * diff --git a/.venv/lib/python3.8/site-packages/IPython/extensions/__init__.py b/.venv/lib/python3.8/site-packages/IPython/extensions/__init__.py new file mode 100644 index 00000000..db7f79fc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/extensions/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +"""This directory is meant for IPython extensions.""" diff --git a/.venv/lib/python3.8/site-packages/IPython/extensions/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/extensions/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..0657e887 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/extensions/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/extensions/__pycache__/autoreload.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/extensions/__pycache__/autoreload.cpython-38.pyc new file mode 100644 index 00000000..a870ddca Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/extensions/__pycache__/autoreload.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/extensions/__pycache__/cythonmagic.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/extensions/__pycache__/cythonmagic.cpython-38.pyc new file mode 100644 index 00000000..ed9940df Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/extensions/__pycache__/cythonmagic.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/extensions/__pycache__/rmagic.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/extensions/__pycache__/rmagic.cpython-38.pyc new file mode 100644 index 00000000..9d896024 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/extensions/__pycache__/rmagic.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/extensions/__pycache__/storemagic.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/extensions/__pycache__/storemagic.cpython-38.pyc new file mode 100644 index 00000000..3be680dc Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/extensions/__pycache__/storemagic.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/extensions/__pycache__/sympyprinting.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/extensions/__pycache__/sympyprinting.cpython-38.pyc new file mode 100644 index 00000000..122d08fb Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/extensions/__pycache__/sympyprinting.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/extensions/autoreload.py b/.venv/lib/python3.8/site-packages/IPython/extensions/autoreload.py new file mode 100644 index 00000000..ada680fc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/extensions/autoreload.py @@ -0,0 +1,550 @@ +"""IPython extension to reload modules before executing user code. + +``autoreload`` reloads modules automatically before entering the execution of +code typed at the IPython prompt. + +This makes for example the following workflow possible: + +.. sourcecode:: ipython + + In [1]: %load_ext autoreload + + In [2]: %autoreload 2 + + In [3]: from foo import some_function + + In [4]: some_function() + Out[4]: 42 + + In [5]: # open foo.py in an editor and change some_function to return 43 + + In [6]: some_function() + Out[6]: 43 + +The module was reloaded without reloading it explicitly, and the object +imported with ``from foo import ...`` was also updated. + +Usage +===== + +The following magic commands are provided: + +``%autoreload`` + + Reload all modules (except those excluded by ``%aimport``) + automatically now. + +``%autoreload 0`` + + Disable automatic reloading. + +``%autoreload 1`` + + Reload all modules imported with ``%aimport`` every time before + executing the Python code typed. + +``%autoreload 2`` + + Reload all modules (except those excluded by ``%aimport``) every + time before executing the Python code typed. + +``%aimport`` + + List modules which are to be automatically imported or not to be imported. + +``%aimport foo`` + + Import module 'foo' and mark it to be autoreloaded for ``%autoreload 1`` + +``%aimport foo, bar`` + + Import modules 'foo', 'bar' and mark them to be autoreloaded for ``%autoreload 1`` + +``%aimport -foo`` + + Mark module 'foo' to not be autoreloaded. + +Caveats +======= + +Reloading Python modules in a reliable way is in general difficult, +and unexpected things may occur. ``%autoreload`` tries to work around +common pitfalls by replacing function code objects and parts of +classes previously in the module with new versions. This makes the +following things to work: + +- Functions and classes imported via 'from xxx import foo' are upgraded + to new versions when 'xxx' is reloaded. + +- Methods and properties of classes are upgraded on reload, so that + calling 'c.foo()' on an object 'c' created before the reload causes + the new code for 'foo' to be executed. + +Some of the known remaining caveats are: + +- Replacing code objects does not always succeed: changing a @property + in a class to an ordinary method or a method to a member variable + can cause problems (but in old objects only). + +- Functions that are removed (eg. via monkey-patching) from a module + before it is reloaded are not upgraded. + +- C extension modules cannot be reloaded, and so cannot be autoreloaded. +""" + +skip_doctest = True + +#----------------------------------------------------------------------------- +# Copyright (C) 2000 Thomas Heller +# Copyright (C) 2008 Pauli Virtanen +# Copyright (C) 2012 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- +# +# This IPython module is written by Pauli Virtanen, based on the autoreload +# code by Thomas Heller. + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +import os +import sys +import traceback +import types +import weakref +import gc +from importlib import import_module +from importlib.util import source_from_cache +from imp import reload + +#------------------------------------------------------------------------------ +# Autoreload functionality +#------------------------------------------------------------------------------ + +class ModuleReloader(object): + enabled = False + """Whether this reloader is enabled""" + + check_all = True + """Autoreload all modules, not just those listed in 'modules'""" + + def __init__(self): + # Modules that failed to reload: {module: mtime-on-failed-reload, ...} + self.failed = {} + # Modules specially marked as autoreloadable. + self.modules = {} + # Modules specially marked as not autoreloadable. + self.skip_modules = {} + # (module-name, name) -> weakref, for replacing old code objects + self.old_objects = {} + # Module modification timestamps + self.modules_mtimes = {} + + # Cache module modification times + self.check(check_all=True, do_reload=False) + + def mark_module_skipped(self, module_name): + """Skip reloading the named module in the future""" + try: + del self.modules[module_name] + except KeyError: + pass + self.skip_modules[module_name] = True + + def mark_module_reloadable(self, module_name): + """Reload the named module in the future (if it is imported)""" + try: + del self.skip_modules[module_name] + except KeyError: + pass + self.modules[module_name] = True + + def aimport_module(self, module_name): + """Import a module, and mark it reloadable + + Returns + ------- + top_module : module + The imported module if it is top-level, or the top-level + top_name : module + Name of top_module + + """ + self.mark_module_reloadable(module_name) + + import_module(module_name) + top_name = module_name.split('.')[0] + top_module = sys.modules[top_name] + return top_module, top_name + + def filename_and_mtime(self, module): + if not hasattr(module, '__file__') or module.__file__ is None: + return None, None + + if getattr(module, '__name__', None) in [None, '__mp_main__', '__main__']: + # we cannot reload(__main__) or reload(__mp_main__) + return None, None + + filename = module.__file__ + path, ext = os.path.splitext(filename) + + if ext.lower() == '.py': + py_filename = filename + else: + try: + py_filename = source_from_cache(filename) + except ValueError: + return None, None + + try: + pymtime = os.stat(py_filename).st_mtime + except OSError: + return None, None + + return py_filename, pymtime + + def check(self, check_all=False, do_reload=True): + """Check whether some modules need to be reloaded.""" + + if not self.enabled and not check_all: + return + + if check_all or self.check_all: + modules = list(sys.modules.keys()) + else: + modules = list(self.modules.keys()) + + for modname in modules: + m = sys.modules.get(modname, None) + + if modname in self.skip_modules: + continue + + py_filename, pymtime = self.filename_and_mtime(m) + if py_filename is None: + continue + + try: + if pymtime <= self.modules_mtimes[modname]: + continue + except KeyError: + self.modules_mtimes[modname] = pymtime + continue + else: + if self.failed.get(py_filename, None) == pymtime: + continue + + self.modules_mtimes[modname] = pymtime + + # If we've reached this point, we should try to reload the module + if do_reload: + try: + superreload(m, reload, self.old_objects) + if py_filename in self.failed: + del self.failed[py_filename] + except: + print("[autoreload of %s failed: %s]" % ( + modname, traceback.format_exc(10)), file=sys.stderr) + self.failed[py_filename] = pymtime + +#------------------------------------------------------------------------------ +# superreload +#------------------------------------------------------------------------------ + + +func_attrs = ['__code__', '__defaults__', '__doc__', + '__closure__', '__globals__', '__dict__'] + + +def update_function(old, new): + """Upgrade the code object of a function""" + for name in func_attrs: + try: + setattr(old, name, getattr(new, name)) + except (AttributeError, TypeError): + pass + + +def update_instances(old, new): + """Use garbage collector to find all instances that refer to the old + class definition and update their __class__ to point to the new class + definition""" + + refs = gc.get_referrers(old) + + for ref in refs: + if type(ref) is old: + ref.__class__ = new + + +def update_class(old, new): + """Replace stuff in the __dict__ of a class, and upgrade + method code objects, and add new methods, if any""" + for key in list(old.__dict__.keys()): + old_obj = getattr(old, key) + try: + new_obj = getattr(new, key) + # explicitly checking that comparison returns True to handle + # cases where `==` doesn't return a boolean. + if (old_obj == new_obj) is True: + continue + except AttributeError: + # obsolete attribute: remove it + try: + delattr(old, key) + except (AttributeError, TypeError): + pass + continue + + if update_generic(old_obj, new_obj): continue + + try: + setattr(old, key, getattr(new, key)) + except (AttributeError, TypeError): + pass # skip non-writable attributes + + for key in list(new.__dict__.keys()): + if key not in list(old.__dict__.keys()): + try: + setattr(old, key, getattr(new, key)) + except (AttributeError, TypeError): + pass # skip non-writable attributes + + # update all instances of class + update_instances(old, new) + + +def update_property(old, new): + """Replace get/set/del functions of a property""" + update_generic(old.fdel, new.fdel) + update_generic(old.fget, new.fget) + update_generic(old.fset, new.fset) + + +def isinstance2(a, b, typ): + return isinstance(a, typ) and isinstance(b, typ) + + +UPDATE_RULES = [ + (lambda a, b: isinstance2(a, b, type), + update_class), + (lambda a, b: isinstance2(a, b, types.FunctionType), + update_function), + (lambda a, b: isinstance2(a, b, property), + update_property), +] +UPDATE_RULES.extend([(lambda a, b: isinstance2(a, b, types.MethodType), + lambda a, b: update_function(a.__func__, b.__func__)), +]) + + +def update_generic(a, b): + for type_check, update in UPDATE_RULES: + if type_check(a, b): + update(a, b) + return True + return False + + +class StrongRef(object): + def __init__(self, obj): + self.obj = obj + def __call__(self): + return self.obj + + +def superreload(module, reload=reload, old_objects=None): + """Enhanced version of the builtin reload function. + + superreload remembers objects previously in the module, and + + - upgrades the class dictionary of every old class in the module + - upgrades the code object of every old function and method + - clears the module's namespace before reloading + + """ + if old_objects is None: + old_objects = {} + + # collect old objects in the module + for name, obj in list(module.__dict__.items()): + if not hasattr(obj, '__module__') or obj.__module__ != module.__name__: + continue + key = (module.__name__, name) + try: + old_objects.setdefault(key, []).append(weakref.ref(obj)) + except TypeError: + pass + + # reload module + try: + # clear namespace first from old cruft + old_dict = module.__dict__.copy() + old_name = module.__name__ + module.__dict__.clear() + module.__dict__['__name__'] = old_name + module.__dict__['__loader__'] = old_dict['__loader__'] + except (TypeError, AttributeError, KeyError): + pass + + try: + module = reload(module) + except: + # restore module dictionary on failed reload + module.__dict__.update(old_dict) + raise + + # iterate over all objects and update functions & classes + for name, new_obj in list(module.__dict__.items()): + key = (module.__name__, name) + if key not in old_objects: continue + + new_refs = [] + for old_ref in old_objects[key]: + old_obj = old_ref() + if old_obj is None: continue + new_refs.append(old_ref) + update_generic(old_obj, new_obj) + + if new_refs: + old_objects[key] = new_refs + else: + del old_objects[key] + + return module + +#------------------------------------------------------------------------------ +# IPython connectivity +#------------------------------------------------------------------------------ + +from IPython.core.magic import Magics, magics_class, line_magic + +@magics_class +class AutoreloadMagics(Magics): + def __init__(self, *a, **kw): + super(AutoreloadMagics, self).__init__(*a, **kw) + self._reloader = ModuleReloader() + self._reloader.check_all = False + self.loaded_modules = set(sys.modules) + + @line_magic + def autoreload(self, parameter_s=''): + r"""%autoreload => Reload modules automatically + + %autoreload + Reload all modules (except those excluded by %aimport) automatically + now. + + %autoreload 0 + Disable automatic reloading. + + %autoreload 1 + Reload all modules imported with %aimport every time before executing + the Python code typed. + + %autoreload 2 + Reload all modules (except those excluded by %aimport) every time + before executing the Python code typed. + + Reloading Python modules in a reliable way is in general + difficult, and unexpected things may occur. %autoreload tries to + work around common pitfalls by replacing function code objects and + parts of classes previously in the module with new versions. This + makes the following things to work: + + - Functions and classes imported via 'from xxx import foo' are upgraded + to new versions when 'xxx' is reloaded. + + - Methods and properties of classes are upgraded on reload, so that + calling 'c.foo()' on an object 'c' created before the reload causes + the new code for 'foo' to be executed. + + Some of the known remaining caveats are: + + - Replacing code objects does not always succeed: changing a @property + in a class to an ordinary method or a method to a member variable + can cause problems (but in old objects only). + + - Functions that are removed (eg. via monkey-patching) from a module + before it is reloaded are not upgraded. + + - C extension modules cannot be reloaded, and so cannot be + autoreloaded. + + """ + if parameter_s == '': + self._reloader.check(True) + elif parameter_s == '0': + self._reloader.enabled = False + elif parameter_s == '1': + self._reloader.check_all = False + self._reloader.enabled = True + elif parameter_s == '2': + self._reloader.check_all = True + self._reloader.enabled = True + + @line_magic + def aimport(self, parameter_s='', stream=None): + """%aimport => Import modules for automatic reloading. + + %aimport + List modules to automatically import and not to import. + + %aimport foo + Import module 'foo' and mark it to be autoreloaded for %autoreload 1 + + %aimport foo, bar + Import modules 'foo', 'bar' and mark them to be autoreloaded for %autoreload 1 + + %aimport -foo + Mark module 'foo' to not be autoreloaded for %autoreload 1 + """ + modname = parameter_s + if not modname: + to_reload = sorted(self._reloader.modules.keys()) + to_skip = sorted(self._reloader.skip_modules.keys()) + if stream is None: + stream = sys.stdout + if self._reloader.check_all: + stream.write("Modules to reload:\nall-except-skipped\n") + else: + stream.write("Modules to reload:\n%s\n" % ' '.join(to_reload)) + stream.write("\nModules to skip:\n%s\n" % ' '.join(to_skip)) + elif modname.startswith('-'): + modname = modname[1:] + self._reloader.mark_module_skipped(modname) + else: + for _module in ([_.strip() for _ in modname.split(',')]): + top_module, top_name = self._reloader.aimport_module(_module) + + # Inject module to user namespace + self.shell.push({top_name: top_module}) + + def pre_run_cell(self): + if self._reloader.enabled: + try: + self._reloader.check() + except: + pass + + def post_execute_hook(self): + """Cache the modification times of any modules imported in this execution + """ + newly_loaded_modules = set(sys.modules) - self.loaded_modules + for modname in newly_loaded_modules: + _, pymtime = self._reloader.filename_and_mtime(sys.modules[modname]) + if pymtime is not None: + self._reloader.modules_mtimes[modname] = pymtime + + self.loaded_modules.update(newly_loaded_modules) + + +def load_ipython_extension(ip): + """Load the extension in IPython.""" + auto_reload = AutoreloadMagics(ip) + ip.register_magics(auto_reload) + ip.events.register('pre_run_cell', auto_reload.pre_run_cell) + ip.events.register('post_execute', auto_reload.post_execute_hook) diff --git a/.venv/lib/python3.8/site-packages/IPython/extensions/cythonmagic.py b/.venv/lib/python3.8/site-packages/IPython/extensions/cythonmagic.py new file mode 100644 index 00000000..3c88e7c2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/extensions/cythonmagic.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +""" +**DEPRECATED** + +The cython magic has been integrated into Cython itself, +which is now released in version 0.21. + +cf github `Cython` organisation, `Cython` repo, under the +file `Cython/Build/IpythonMagic.py` +""" +#----------------------------------------------------------------------------- +# Copyright (C) 2010-2011, IPython Development Team. +#----------------------------------------------------------------------------- + +import warnings + +## still load the magic in IPython 3.x, remove completely in future versions. +def load_ipython_extension(ip): + """Load the extension in IPython.""" + + warnings.warn("""The Cython magic has been moved to the Cython package""") diff --git a/.venv/lib/python3.8/site-packages/IPython/extensions/rmagic.py b/.venv/lib/python3.8/site-packages/IPython/extensions/rmagic.py new file mode 100644 index 00000000..ec576397 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/extensions/rmagic.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- + +#----------------------------------------------------------------------------- +# Copyright (C) 2012 The IPython Development Team +#----------------------------------------------------------------------------- + +import warnings + +def load_ipython_extension(ip): + """Load the extension in IPython.""" + warnings.warn("The rmagic extension in IPython has moved to " + "`rpy2.ipython`, please see `rpy2` documentation.") diff --git a/.venv/lib/python3.8/site-packages/IPython/extensions/storemagic.py b/.venv/lib/python3.8/site-packages/IPython/extensions/storemagic.py new file mode 100644 index 00000000..51b79ad3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/extensions/storemagic.py @@ -0,0 +1,233 @@ +# -*- coding: utf-8 -*- +""" +%store magic for lightweight persistence. + +Stores variables, aliases and macros in IPython's database. + +To automatically restore stored variables at startup, add this to your +:file:`ipython_config.py` file:: + + c.StoreMagics.autorestore = True +""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +import inspect, os, sys, textwrap + +from IPython.core.error import UsageError +from IPython.core.magic import Magics, magics_class, line_magic +from traitlets import Bool + + +def restore_aliases(ip, alias=None): + staliases = ip.db.get('stored_aliases', {}) + if alias is None: + for k,v in staliases.items(): + #print "restore alias",k,v # dbg + #self.alias_table[k] = v + ip.alias_manager.define_alias(k,v) + else: + ip.alias_manager.define_alias(alias, staliases[alias]) + + +def refresh_variables(ip): + db = ip.db + for key in db.keys('autorestore/*'): + # strip autorestore + justkey = os.path.basename(key) + try: + obj = db[key] + except KeyError: + print("Unable to restore variable '%s', ignoring (use %%store -d to forget!)" % justkey) + print("The error was:", sys.exc_info()[0]) + else: + #print "restored",justkey,"=",obj #dbg + ip.user_ns[justkey] = obj + + +def restore_dhist(ip): + ip.user_ns['_dh'] = ip.db.get('dhist',[]) + + +def restore_data(ip): + refresh_variables(ip) + restore_aliases(ip) + restore_dhist(ip) + + +@magics_class +class StoreMagics(Magics): + """Lightweight persistence for python variables. + + Provides the %store magic.""" + + autorestore = Bool(False, help= + """If True, any %store-d variables will be automatically restored + when IPython starts. + """ + ).tag(config=True) + + def __init__(self, shell): + super(StoreMagics, self).__init__(shell=shell) + self.shell.configurables.append(self) + if self.autorestore: + restore_data(self.shell) + + @line_magic + def store(self, parameter_s=''): + """Lightweight persistence for python variables. + + Example:: + + In [1]: l = ['hello',10,'world'] + In [2]: %store l + In [3]: exit + + (IPython session is closed and started again...) + + ville@badger:~$ ipython + In [1]: l + NameError: name 'l' is not defined + In [2]: %store -r + In [3]: l + Out[3]: ['hello', 10, 'world'] + + Usage: + + * ``%store`` - Show list of all variables and their current + values + * ``%store spam bar`` - Store the *current* value of the variables spam + and bar to disk + * ``%store -d spam`` - Remove the variable and its value from storage + * ``%store -z`` - Remove all variables from storage + * ``%store -r`` - Refresh all variables, aliases and directory history + from store (overwrite current vals) + * ``%store -r spam bar`` - Refresh specified variables and aliases from store + (delete current val) + * ``%store foo >a.txt`` - Store value of foo to new file a.txt + * ``%store foo >>a.txt`` - Append value of foo to file a.txt + + It should be noted that if you change the value of a variable, you + need to %store it again if you want to persist the new value. + + Note also that the variables will need to be pickleable; most basic + python types can be safely %store'd. + + Also aliases can be %store'd across sessions. + To remove an alias from the storage, use the %unalias magic. + """ + + opts,argsl = self.parse_options(parameter_s,'drz',mode='string') + args = argsl.split() + ip = self.shell + db = ip.db + # delete + if 'd' in opts: + try: + todel = args[0] + except IndexError: + raise UsageError('You must provide the variable to forget') + else: + try: + del db['autorestore/' + todel] + except: + raise UsageError("Can't delete variable '%s'" % todel) + # reset + elif 'z' in opts: + for k in db.keys('autorestore/*'): + del db[k] + + elif 'r' in opts: + if args: + for arg in args: + try: + obj = db['autorestore/' + arg] + except KeyError: + try: + restore_aliases(ip, alias=arg) + except KeyError: + print("no stored variable or alias %s" % arg) + else: + ip.user_ns[arg] = obj + else: + restore_data(ip) + + # run without arguments -> list variables & values + elif not args: + vars = db.keys('autorestore/*') + vars.sort() + if vars: + size = max(map(len, vars)) + else: + size = 0 + + print('Stored variables and their in-db values:') + fmt = '%-'+str(size)+'s -> %s' + get = db.get + for var in vars: + justkey = os.path.basename(var) + # print 30 first characters from every var + print(fmt % (justkey, repr(get(var, ''))[:50])) + + # default action - store the variable + else: + # %store foo >file.txt or >>file.txt + if len(args) > 1 and args[1].startswith('>'): + fnam = os.path.expanduser(args[1].lstrip('>').lstrip()) + if args[1].startswith('>>'): + fil = open(fnam, 'a') + else: + fil = open(fnam, 'w') + with fil: + obj = ip.ev(args[0]) + print("Writing '%s' (%s) to file '%s'." % (args[0], + obj.__class__.__name__, fnam)) + + if not isinstance (obj, str): + from pprint import pprint + pprint(obj, fil) + else: + fil.write(obj) + if not obj.endswith('\n'): + fil.write('\n') + + return + + # %store foo + for arg in args: + try: + obj = ip.user_ns[arg] + except KeyError: + # it might be an alias + name = arg + try: + cmd = ip.alias_manager.retrieve_alias(name) + except ValueError: + raise UsageError("Unknown variable '%s'" % name) + + staliases = db.get('stored_aliases',{}) + staliases[name] = cmd + db['stored_aliases'] = staliases + print("Alias stored: %s (%s)" % (name, cmd)) + return + + else: + modname = getattr(inspect.getmodule(obj), '__name__', '') + if modname == '__main__': + print(textwrap.dedent("""\ + Warning:%s is %s + Proper storage of interactively declared classes (or instances + of those classes) is not possible! Only instances + of classes in real modules on file system can be %%store'd. + """ % (arg, obj) )) + return + #pickled = pickle.dumps(obj) + db[ 'autorestore/' + arg ] = obj + print("Stored '%s' (%s)" % (arg, obj.__class__.__name__)) + + +def load_ipython_extension(ip): + """Load the extension in IPython.""" + ip.register_magics(StoreMagics) + diff --git a/.venv/lib/python3.8/site-packages/IPython/extensions/sympyprinting.py b/.venv/lib/python3.8/site-packages/IPython/extensions/sympyprinting.py new file mode 100644 index 00000000..e6a83cd3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/extensions/sympyprinting.py @@ -0,0 +1,32 @@ +""" +**DEPRECATED** + +A print function that pretty prints sympy Basic objects. + +:moduleauthor: Brian Granger + +Usage +===== + +Once the extension is loaded, Sympy Basic objects are automatically +pretty-printed. + +As of SymPy 0.7.2, maintenance of this extension has moved to SymPy under +sympy.interactive.ipythonprinting, any modifications to account for changes to +SymPy should be submitted to SymPy rather than changed here. This module is +maintained here for backwards compatibility with old SymPy versions. + +""" +#----------------------------------------------------------------------------- +# Copyright (C) 2008 The IPython Development Team +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +import warnings + +def load_ipython_extension(ip): + warnings.warn("The sympyprinting extension has moved to `sympy`, " + "use `from sympy import init_printing; init_printing()`") diff --git a/.venv/lib/python3.8/site-packages/IPython/extensions/tests/__init__.py b/.venv/lib/python3.8/site-packages/IPython/extensions/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/IPython/extensions/tests/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/extensions/tests/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..88884c1e Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/extensions/tests/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/extensions/tests/__pycache__/test_autoreload.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/extensions/tests/__pycache__/test_autoreload.cpython-38.pyc new file mode 100644 index 00000000..d35cf278 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/extensions/tests/__pycache__/test_autoreload.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/extensions/tests/__pycache__/test_storemagic.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/extensions/tests/__pycache__/test_storemagic.cpython-38.pyc new file mode 100644 index 00000000..1766ff04 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/extensions/tests/__pycache__/test_storemagic.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/extensions/tests/test_autoreload.py b/.venv/lib/python3.8/site-packages/IPython/extensions/tests/test_autoreload.py new file mode 100644 index 00000000..e81bf221 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/extensions/tests/test_autoreload.py @@ -0,0 +1,447 @@ +"""Tests for autoreload extension. +""" +#----------------------------------------------------------------------------- +# Copyright (c) 2012 IPython Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +import os +import sys +import tempfile +import textwrap +import shutil +import random +import time +from io import StringIO + +import nose.tools as nt +import IPython.testing.tools as tt + +from unittest import TestCase + +from IPython.extensions.autoreload import AutoreloadMagics +from IPython.core.events import EventManager, pre_run_cell + +#----------------------------------------------------------------------------- +# Test fixture +#----------------------------------------------------------------------------- + +noop = lambda *a, **kw: None + +class FakeShell: + + def __init__(self): + self.ns = {} + self.user_ns = self.ns + self.user_ns_hidden = {} + self.events = EventManager(self, {'pre_run_cell', pre_run_cell}) + self.auto_magics = AutoreloadMagics(shell=self) + self.events.register('pre_run_cell', self.auto_magics.pre_run_cell) + + register_magics = set_hook = noop + + def run_code(self, code): + self.events.trigger('pre_run_cell') + exec(code, self.user_ns) + self.auto_magics.post_execute_hook() + + def push(self, items): + self.ns.update(items) + + def magic_autoreload(self, parameter): + self.auto_magics.autoreload(parameter) + + def magic_aimport(self, parameter, stream=None): + self.auto_magics.aimport(parameter, stream=stream) + self.auto_magics.post_execute_hook() + + +class Fixture(TestCase): + """Fixture for creating test module files""" + + test_dir = None + old_sys_path = None + filename_chars = "abcdefghijklmopqrstuvwxyz0123456789" + + def setUp(self): + self.test_dir = tempfile.mkdtemp() + self.old_sys_path = list(sys.path) + sys.path.insert(0, self.test_dir) + self.shell = FakeShell() + + def tearDown(self): + shutil.rmtree(self.test_dir) + sys.path = self.old_sys_path + + self.test_dir = None + self.old_sys_path = None + self.shell = None + + def get_module(self): + module_name = "tmpmod_" + "".join(random.sample(self.filename_chars,20)) + if module_name in sys.modules: + del sys.modules[module_name] + file_name = os.path.join(self.test_dir, module_name + ".py") + return module_name, file_name + + def write_file(self, filename, content): + """ + Write a file, and force a timestamp difference of at least one second + + Notes + ----- + Python's .pyc files record the timestamp of their compilation + with a time resolution of one second. + + Therefore, we need to force a timestamp difference between .py + and .pyc, without having the .py file be timestamped in the + future, and without changing the timestamp of the .pyc file + (because that is stored in the file). The only reliable way + to achieve this seems to be to sleep. + """ + content = textwrap.dedent(content) + # Sleep one second + eps + time.sleep(1.05) + + # Write + with open(filename, 'w') as f: + f.write(content) + + def new_module(self, code): + code = textwrap.dedent(code) + mod_name, mod_fn = self.get_module() + with open(mod_fn, 'w') as f: + f.write(code) + return mod_name, mod_fn + +#----------------------------------------------------------------------------- +# Test automatic reloading +#----------------------------------------------------------------------------- + +def pickle_get_current_class(obj): + """ + Original issue comes from pickle; hence the name. + """ + name = obj.__class__.__name__ + module_name = getattr(obj, "__module__", None) + obj2 = sys.modules[module_name] + for subpath in name.split("."): + obj2 = getattr(obj2, subpath) + return obj2 + +class TestAutoreload(Fixture): + + def test_reload_enums(self): + mod_name, mod_fn = self.new_module(textwrap.dedent(""" + from enum import Enum + class MyEnum(Enum): + A = 'A' + B = 'B' + """)) + self.shell.magic_autoreload("2") + self.shell.magic_aimport(mod_name) + self.write_file(mod_fn, textwrap.dedent(""" + from enum import Enum + class MyEnum(Enum): + A = 'A' + B = 'B' + C = 'C' + """)) + with tt.AssertNotPrints(('[autoreload of %s failed:' % mod_name), channel='stderr'): + self.shell.run_code("pass") # trigger another reload + + def test_reload_class_type(self): + self.shell.magic_autoreload("2") + mod_name, mod_fn = self.new_module( + """ + class Test(): + def meth(self): + return "old" + """ + ) + assert "test" not in self.shell.ns + assert "result" not in self.shell.ns + + self.shell.run_code("from %s import Test" % mod_name) + self.shell.run_code("test = Test()") + + self.write_file( + mod_fn, + """ + class Test(): + def meth(self): + return "new" + """, + ) + + test_object = self.shell.ns["test"] + + # important to trigger autoreload logic ! + self.shell.run_code("pass") + + test_class = pickle_get_current_class(test_object) + assert isinstance(test_object, test_class) + + # extra check. + self.shell.run_code("import pickle") + self.shell.run_code("p = pickle.dumps(test)") + + def test_reload_class_attributes(self): + self.shell.magic_autoreload("2") + mod_name, mod_fn = self.new_module(textwrap.dedent(""" + class MyClass: + + def __init__(self, a=10): + self.a = a + self.b = 22 + # self.toto = 33 + + def square(self): + print('compute square') + return self.a*self.a + """ + ) + ) + self.shell.run_code("from %s import MyClass" % mod_name) + self.shell.run_code("first = MyClass(5)") + self.shell.run_code("first.square()") + with nt.assert_raises(AttributeError): + self.shell.run_code("first.cube()") + with nt.assert_raises(AttributeError): + self.shell.run_code("first.power(5)") + self.shell.run_code("first.b") + with nt.assert_raises(AttributeError): + self.shell.run_code("first.toto") + + # remove square, add power + + self.write_file( + mod_fn, + textwrap.dedent( + """ + class MyClass: + + def __init__(self, a=10): + self.a = a + self.b = 11 + + def power(self, p): + print('compute power '+str(p)) + return self.a**p + """ + ), + ) + + self.shell.run_code("second = MyClass(5)") + + for object_name in {'first', 'second'}: + self.shell.run_code("{object_name}.power(5)".format(object_name=object_name)) + with nt.assert_raises(AttributeError): + self.shell.run_code("{object_name}.cube()".format(object_name=object_name)) + with nt.assert_raises(AttributeError): + self.shell.run_code("{object_name}.square()".format(object_name=object_name)) + self.shell.run_code("{object_name}.b".format(object_name=object_name)) + self.shell.run_code("{object_name}.a".format(object_name=object_name)) + with nt.assert_raises(AttributeError): + self.shell.run_code("{object_name}.toto".format(object_name=object_name)) + + def _check_smoketest(self, use_aimport=True): + """ + Functional test for the automatic reloader using either + '%autoreload 1' or '%autoreload 2' + """ + + mod_name, mod_fn = self.new_module(""" +x = 9 + +z = 123 # this item will be deleted + +def foo(y): + return y + 3 + +class Baz(object): + def __init__(self, x): + self.x = x + def bar(self, y): + return self.x + y + @property + def quux(self): + return 42 + def zzz(self): + '''This method will be deleted below''' + return 99 + +class Bar: # old-style class: weakref doesn't work for it on Python < 2.7 + def foo(self): + return 1 +""") + + # + # Import module, and mark for reloading + # + if use_aimport: + self.shell.magic_autoreload("1") + self.shell.magic_aimport(mod_name) + stream = StringIO() + self.shell.magic_aimport("", stream=stream) + nt.assert_in(("Modules to reload:\n%s" % mod_name), stream.getvalue()) + + with nt.assert_raises(ImportError): + self.shell.magic_aimport("tmpmod_as318989e89ds") + else: + self.shell.magic_autoreload("2") + self.shell.run_code("import %s" % mod_name) + stream = StringIO() + self.shell.magic_aimport("", stream=stream) + nt.assert_true("Modules to reload:\nall-except-skipped" in + stream.getvalue()) + nt.assert_in(mod_name, self.shell.ns) + + mod = sys.modules[mod_name] + + # + # Test module contents + # + old_foo = mod.foo + old_obj = mod.Baz(9) + old_obj2 = mod.Bar() + + def check_module_contents(): + nt.assert_equal(mod.x, 9) + nt.assert_equal(mod.z, 123) + + nt.assert_equal(old_foo(0), 3) + nt.assert_equal(mod.foo(0), 3) + + obj = mod.Baz(9) + nt.assert_equal(old_obj.bar(1), 10) + nt.assert_equal(obj.bar(1), 10) + nt.assert_equal(obj.quux, 42) + nt.assert_equal(obj.zzz(), 99) + + obj2 = mod.Bar() + nt.assert_equal(old_obj2.foo(), 1) + nt.assert_equal(obj2.foo(), 1) + + check_module_contents() + + # + # Simulate a failed reload: no reload should occur and exactly + # one error message should be printed + # + self.write_file(mod_fn, """ +a syntax error +""") + + with tt.AssertPrints(('[autoreload of %s failed:' % mod_name), channel='stderr'): + self.shell.run_code("pass") # trigger reload + with tt.AssertNotPrints(('[autoreload of %s failed:' % mod_name), channel='stderr'): + self.shell.run_code("pass") # trigger another reload + check_module_contents() + + # + # Rewrite module (this time reload should succeed) + # + self.write_file(mod_fn, """ +x = 10 + +def foo(y): + return y + 4 + +class Baz(object): + def __init__(self, x): + self.x = x + def bar(self, y): + return self.x + y + 1 + @property + def quux(self): + return 43 + +class Bar: # old-style class + def foo(self): + return 2 +""") + + def check_module_contents(): + nt.assert_equal(mod.x, 10) + nt.assert_false(hasattr(mod, 'z')) + + nt.assert_equal(old_foo(0), 4) # superreload magic! + nt.assert_equal(mod.foo(0), 4) + + obj = mod.Baz(9) + nt.assert_equal(old_obj.bar(1), 11) # superreload magic! + nt.assert_equal(obj.bar(1), 11) + + nt.assert_equal(old_obj.quux, 43) + nt.assert_equal(obj.quux, 43) + + nt.assert_false(hasattr(old_obj, 'zzz')) + nt.assert_false(hasattr(obj, 'zzz')) + + obj2 = mod.Bar() + nt.assert_equal(old_obj2.foo(), 2) + nt.assert_equal(obj2.foo(), 2) + + self.shell.run_code("pass") # trigger reload + check_module_contents() + + # + # Another failure case: deleted file (shouldn't reload) + # + os.unlink(mod_fn) + + self.shell.run_code("pass") # trigger reload + check_module_contents() + + # + # Disable autoreload and rewrite module: no reload should occur + # + if use_aimport: + self.shell.magic_aimport("-" + mod_name) + stream = StringIO() + self.shell.magic_aimport("", stream=stream) + nt.assert_true(("Modules to skip:\n%s" % mod_name) in + stream.getvalue()) + + # This should succeed, although no such module exists + self.shell.magic_aimport("-tmpmod_as318989e89ds") + else: + self.shell.magic_autoreload("0") + + self.write_file(mod_fn, """ +x = -99 +""") + + self.shell.run_code("pass") # trigger reload + self.shell.run_code("pass") + check_module_contents() + + # + # Re-enable autoreload: reload should now occur + # + if use_aimport: + self.shell.magic_aimport(mod_name) + else: + self.shell.magic_autoreload("") + + self.shell.run_code("pass") # trigger reload + nt.assert_equal(mod.x, -99) + + def test_smoketest_aimport(self): + self._check_smoketest(use_aimport=True) + + def test_smoketest_autoreload(self): + self._check_smoketest(use_aimport=False) + + + + + diff --git a/.venv/lib/python3.8/site-packages/IPython/extensions/tests/test_storemagic.py b/.venv/lib/python3.8/site-packages/IPython/extensions/tests/test_storemagic.py new file mode 100644 index 00000000..6f8371d3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/extensions/tests/test_storemagic.py @@ -0,0 +1,66 @@ +import tempfile, os + +from traitlets.config.loader import Config +import nose.tools as nt + + +def setup_module(): + ip.magic('load_ext storemagic') + +def test_store_restore(): + assert 'bar' not in ip.user_ns, "Error: some other test leaked `bar` in user_ns" + assert 'foo' not in ip.user_ns, "Error: some other test leaked `foo` in user_ns" + assert 'foobar' not in ip.user_ns, "Error: some other test leaked `foobar` in user_ns" + assert 'foobaz' not in ip.user_ns, "Error: some other test leaked `foobaz` in user_ns" + ip.user_ns['foo'] = 78 + ip.magic('alias bar echo "hello"') + ip.user_ns['foobar'] = 79 + ip.user_ns['foobaz'] = '80' + tmpd = tempfile.mkdtemp() + ip.magic('cd ' + tmpd) + ip.magic('store foo') + ip.magic('store bar') + ip.magic('store foobar foobaz') + + # Check storing + nt.assert_equal(ip.db['autorestore/foo'], 78) + nt.assert_in('bar', ip.db['stored_aliases']) + nt.assert_equal(ip.db['autorestore/foobar'], 79) + nt.assert_equal(ip.db['autorestore/foobaz'], '80') + + # Remove those items + ip.user_ns.pop('foo', None) + ip.user_ns.pop('foobar', None) + ip.user_ns.pop('foobaz', None) + ip.alias_manager.undefine_alias('bar') + ip.magic('cd -') + ip.user_ns['_dh'][:] = [] + + # Check restoring + ip.magic('store -r foo bar foobar foobaz') + nt.assert_equal(ip.user_ns['foo'], 78) + assert ip.alias_manager.is_alias('bar') + nt.assert_equal(ip.user_ns['foobar'], 79) + nt.assert_equal(ip.user_ns['foobaz'], '80') + + ip.magic('store -r') # restores _dh too + nt.assert_in(os.path.realpath(tmpd), ip.user_ns['_dh']) + + os.rmdir(tmpd) + +def test_autorestore(): + ip.user_ns['foo'] = 95 + ip.magic('store foo') + del ip.user_ns['foo'] + c = Config() + c.StoreMagics.autorestore = False + orig_config = ip.config + try: + ip.config = c + ip.extension_manager.reload_extension('storemagic') + nt.assert_not_in('foo', ip.user_ns) + c.StoreMagics.autorestore = True + ip.extension_manager.reload_extension('storemagic') + nt.assert_equal(ip.user_ns['foo'], 95) + finally: + ip.config = orig_config diff --git a/.venv/lib/python3.8/site-packages/IPython/external/__init__.py b/.venv/lib/python3.8/site-packages/IPython/external/__init__.py new file mode 100644 index 00000000..1c8c546f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/external/__init__.py @@ -0,0 +1,5 @@ +""" +This package contains all third-party modules bundled with IPython. +""" + +__all__ = [] diff --git a/.venv/lib/python3.8/site-packages/IPython/external/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/external/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..467f8dfb Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/external/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/external/__pycache__/mathjax.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/external/__pycache__/mathjax.cpython-38.pyc new file mode 100644 index 00000000..226845d0 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/external/__pycache__/mathjax.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/external/__pycache__/qt_for_kernel.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/external/__pycache__/qt_for_kernel.cpython-38.pyc new file mode 100644 index 00000000..2b9d66be Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/external/__pycache__/qt_for_kernel.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/external/__pycache__/qt_loaders.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/external/__pycache__/qt_loaders.cpython-38.pyc new file mode 100644 index 00000000..013c9a8f Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/external/__pycache__/qt_loaders.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/external/decorators/__init__.py b/.venv/lib/python3.8/site-packages/IPython/external/decorators/__init__.py new file mode 100644 index 00000000..1db80edd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/external/decorators/__init__.py @@ -0,0 +1,8 @@ +try: + from numpy.testing import KnownFailure, knownfailureif +except ImportError: + from ._decorators import knownfailureif + try: + from ._numpy_testing_noseclasses import KnownFailure + except ImportError: + pass diff --git a/.venv/lib/python3.8/site-packages/IPython/external/decorators/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/external/decorators/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..97171367 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/external/decorators/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/external/decorators/__pycache__/_decorators.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/external/decorators/__pycache__/_decorators.cpython-38.pyc new file mode 100644 index 00000000..b8940f39 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/external/decorators/__pycache__/_decorators.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/external/decorators/__pycache__/_numpy_testing_noseclasses.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/external/decorators/__pycache__/_numpy_testing_noseclasses.cpython-38.pyc new file mode 100644 index 00000000..d2a56b48 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/external/decorators/__pycache__/_numpy_testing_noseclasses.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/external/decorators/_decorators.py b/.venv/lib/python3.8/site-packages/IPython/external/decorators/_decorators.py new file mode 100644 index 00000000..18f847ad --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/external/decorators/_decorators.py @@ -0,0 +1,143 @@ +""" +Decorators for labeling and modifying behavior of test objects. + +Decorators that merely return a modified version of the original +function object are straightforward. Decorators that return a new +function object need to use +:: + + nose.tools.make_decorator(original_function)(decorator) + +in returning the decorator, in order to preserve meta-data such as +function name, setup and teardown functions and so on - see +``nose.tools`` for more information. + +""" + +# IPython changes: make this work if numpy not available +# Original code: +try: + from ._numpy_testing_noseclasses import KnownFailureTest +except: + pass + +# End IPython changes + + +def skipif(skip_condition, msg=None): + """ + Make function raise SkipTest exception if a given condition is true. + + If the condition is a callable, it is used at runtime to dynamically + make the decision. This is useful for tests that may require costly + imports, to delay the cost until the test suite is actually executed. + + Parameters + ---------- + skip_condition : bool or callable + Flag to determine whether to skip the decorated test. + msg : str, optional + Message to give on raising a SkipTest exception. Default is None. + + Returns + ------- + decorator : function + Decorator which, when applied to a function, causes SkipTest + to be raised when `skip_condition` is True, and the function + to be called normally otherwise. + + Notes + ----- + The decorator itself is decorated with the ``nose.tools.make_decorator`` + function in order to transmit function name, and various other metadata. + + """ + + def skip_decorator(f): + # Local import to avoid a hard nose dependency and only incur the + # import time overhead at actual test-time. + import nose + + # Allow for both boolean or callable skip conditions. + if callable(skip_condition): + skip_val = lambda : skip_condition() + else: + skip_val = lambda : skip_condition + + def get_msg(func,msg=None): + """Skip message with information about function being skipped.""" + if msg is None: + out = 'Test skipped due to test condition' + else: + out = '\n'+msg + + return "Skipping test: %s%s" % (func.__name__,out) + + # We need to define *two* skippers because Python doesn't allow both + # return with value and yield inside the same function. + def skipper_func(*args, **kwargs): + """Skipper for normal test functions.""" + if skip_val(): + raise nose.SkipTest(get_msg(f,msg)) + else: + return f(*args, **kwargs) + + def skipper_gen(*args, **kwargs): + """Skipper for test generators.""" + if skip_val(): + raise nose.SkipTest(get_msg(f,msg)) + else: + for x in f(*args, **kwargs): + yield x + + # Choose the right skipper to use when building the actual decorator. + if nose.util.isgenerator(f): + skipper = skipper_gen + else: + skipper = skipper_func + + return nose.tools.make_decorator(f)(skipper) + + return skip_decorator + +def knownfailureif(fail_condition, msg=None): + """ + Make function raise KnownFailureTest exception if given condition is true. + + Parameters + ---------- + fail_condition : bool + Flag to determine whether to mark the decorated test as a known + failure (if True) or not (if False). + msg : str, optional + Message to give on raising a KnownFailureTest exception. + Default is None. + + Returns + ------- + decorator : function + Decorator, which, when applied to a function, causes KnownFailureTest to + be raised when `fail_condition` is True and the test fails. + + Notes + ----- + The decorator itself is decorated with the ``nose.tools.make_decorator`` + function in order to transmit function name, and various other metadata. + + """ + if msg is None: + msg = 'Test skipped due to known failure' + + def knownfail_decorator(f): + # Local import to avoid a hard nose dependency and only incur the + # import time overhead at actual test-time. + import nose + + def knownfailer(*args, **kwargs): + if fail_condition: + raise KnownFailureTest(msg) + else: + return f(*args, **kwargs) + return nose.tools.make_decorator(f)(knownfailer) + + return knownfail_decorator diff --git a/.venv/lib/python3.8/site-packages/IPython/external/decorators/_numpy_testing_noseclasses.py b/.venv/lib/python3.8/site-packages/IPython/external/decorators/_numpy_testing_noseclasses.py new file mode 100644 index 00000000..ca6ccd87 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/external/decorators/_numpy_testing_noseclasses.py @@ -0,0 +1,41 @@ +# IPython: modified copy of numpy.testing.noseclasses, so +# IPython.external._decorators works without numpy being installed. + +# These classes implement a "known failure" error class. + +import os + +from nose.plugins.errorclass import ErrorClass, ErrorClassPlugin + +class KnownFailureTest(Exception): + '''Raise this exception to mark a test as a known failing test.''' + pass + + +class KnownFailure(ErrorClassPlugin): + '''Plugin that installs a KNOWNFAIL error class for the + KnownFailureClass exception. When KnownFailureTest is raised, + the exception will be logged in the knownfail attribute of the + result, 'K' or 'KNOWNFAIL' (verbose) will be output, and the + exception will not be counted as an error or failure.''' + enabled = True + knownfail = ErrorClass(KnownFailureTest, + label='KNOWNFAIL', + isfailure=False) + + def options(self, parser, env=os.environ): + env_opt = 'NOSE_WITHOUT_KNOWNFAIL' + parser.add_option('--no-knownfail', action='store_true', + dest='noKnownFail', default=env.get(env_opt, False), + help='Disable special handling of KnownFailureTest ' + 'exceptions') + + def configure(self, options, conf): + if not self.can_configure: + return + self.conf = conf + disable = getattr(options, 'noKnownFail', False) + if disable: + self.enabled = False + + diff --git a/.venv/lib/python3.8/site-packages/IPython/external/mathjax.py b/.venv/lib/python3.8/site-packages/IPython/external/mathjax.py new file mode 100644 index 00000000..1b9b8090 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/external/mathjax.py @@ -0,0 +1,13 @@ +#!/usr/bin/python +""" +`IPython.external.mathjax` is deprecated with IPython 4.0+ + +mathjax is now install by default with the notebook package + +""" + +import sys + +if __name__ == '__main__' : + sys.exit("IPython.external.mathjax is deprecated, Mathjax is now installed by default with the notebook package") + diff --git a/.venv/lib/python3.8/site-packages/IPython/external/qt_for_kernel.py b/.venv/lib/python3.8/site-packages/IPython/external/qt_for_kernel.py new file mode 100644 index 00000000..1a94e7e0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/external/qt_for_kernel.py @@ -0,0 +1,95 @@ +""" Import Qt in a manner suitable for an IPython kernel. + +This is the import used for the `gui=qt` or `matplotlib=qt` initialization. + +Import Priority: + +if Qt has been imported anywhere else: + use that + +if matplotlib has been imported and doesn't support v2 (<= 1.0.1): + use PyQt4 @v1 + +Next, ask QT_API env variable + +if QT_API not set: + ask matplotlib what it's using. If Qt4Agg or Qt5Agg, then use the + version matplotlib is configured with + + else: (matplotlib said nothing) + # this is the default path - nobody told us anything + try in this order: + PyQt default version, PySide, PyQt5 +else: + use what QT_API says + +""" +# NOTE: This is no longer an external, third-party module, and should be +# considered part of IPython. For compatibility however, it is being kept in +# IPython/external. + +import os +import sys + +from IPython.utils.version import check_version +from IPython.external.qt_loaders import (load_qt, loaded_api, QT_API_PYSIDE, + QT_API_PYSIDE2, QT_API_PYQT, QT_API_PYQT5, + QT_API_PYQTv1, QT_API_PYQT_DEFAULT) + +_qt_apis = (QT_API_PYSIDE, QT_API_PYSIDE2, QT_API_PYQT, QT_API_PYQT5, QT_API_PYQTv1, + QT_API_PYQT_DEFAULT) + +#Constraints placed on an imported matplotlib +def matplotlib_options(mpl): + if mpl is None: + return + backend = mpl.rcParams.get('backend', None) + if backend == 'Qt4Agg': + mpqt = mpl.rcParams.get('backend.qt4', None) + if mpqt is None: + return None + if mpqt.lower() == 'pyside': + return [QT_API_PYSIDE] + elif mpqt.lower() == 'pyqt4': + return [QT_API_PYQT_DEFAULT] + elif mpqt.lower() == 'pyqt4v2': + return [QT_API_PYQT] + raise ImportError("unhandled value for backend.qt4 from matplotlib: %r" % + mpqt) + elif backend == 'Qt5Agg': + mpqt = mpl.rcParams.get('backend.qt5', None) + if mpqt is None: + return None + if mpqt.lower() == 'pyqt5': + return [QT_API_PYQT5] + raise ImportError("unhandled value for backend.qt5 from matplotlib: %r" % + mpqt) + +def get_options(): + """Return a list of acceptable QT APIs, in decreasing order of + preference + """ + #already imported Qt somewhere. Use that + loaded = loaded_api() + if loaded is not None: + return [loaded] + + mpl = sys.modules.get('matplotlib', None) + + if mpl is not None and not check_version(mpl.__version__, '1.0.2'): + #1.0.1 only supports PyQt4 v1 + return [QT_API_PYQT_DEFAULT] + + qt_api = os.environ.get('QT_API', None) + if qt_api is None: + #no ETS variable. Ask mpl, then use default fallback path + return matplotlib_options(mpl) or [QT_API_PYQT_DEFAULT, QT_API_PYSIDE, + QT_API_PYQT5, QT_API_PYSIDE2] + elif qt_api not in _qt_apis: + raise RuntimeError("Invalid Qt API %r, valid values are: %r" % + (qt_api, ', '.join(_qt_apis))) + else: + return [qt_api] + +api_opts = get_options() +QtCore, QtGui, QtSvg, QT_API = load_qt(api_opts) diff --git a/.venv/lib/python3.8/site-packages/IPython/external/qt_loaders.py b/.venv/lib/python3.8/site-packages/IPython/external/qt_loaders.py new file mode 100644 index 00000000..46cd9c35 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/external/qt_loaders.py @@ -0,0 +1,329 @@ +""" +This module contains factory functions that attempt +to return Qt submodules from the various python Qt bindings. + +It also protects against double-importing Qt with different +bindings, which is unstable and likely to crash + +This is used primarily by qt and qt_for_kernel, and shouldn't +be accessed directly from the outside +""" +import sys +import types +from functools import partial +from importlib import import_module + +from IPython.utils.version import check_version + +# Available APIs. +QT_API_PYQT = 'pyqt' # Force version 2 +QT_API_PYQT5 = 'pyqt5' +QT_API_PYQTv1 = 'pyqtv1' # Force version 2 +QT_API_PYQT_DEFAULT = 'pyqtdefault' # use system default for version 1 vs. 2 +QT_API_PYSIDE = 'pyside' +QT_API_PYSIDE2 = 'pyside2' + +api_to_module = {QT_API_PYSIDE2: 'PySide2', + QT_API_PYSIDE: 'PySide', + QT_API_PYQT: 'PyQt4', + QT_API_PYQTv1: 'PyQt4', + QT_API_PYQT5: 'PyQt5', + QT_API_PYQT_DEFAULT: 'PyQt4', + } + + +class ImportDenier(object): + """Import Hook that will guard against bad Qt imports + once IPython commits to a specific binding + """ + + def __init__(self): + self.__forbidden = set() + + def forbid(self, module_name): + sys.modules.pop(module_name, None) + self.__forbidden.add(module_name) + + def find_module(self, fullname, path=None): + if path: + return + if fullname in self.__forbidden: + return self + + def load_module(self, fullname): + raise ImportError(""" + Importing %s disabled by IPython, which has + already imported an Incompatible QT Binding: %s + """ % (fullname, loaded_api())) + +ID = ImportDenier() +sys.meta_path.insert(0, ID) + + +def commit_api(api): + """Commit to a particular API, and trigger ImportErrors on subsequent + dangerous imports""" + + if api == QT_API_PYSIDE2: + ID.forbid('PySide') + ID.forbid('PyQt4') + ID.forbid('PyQt5') + elif api == QT_API_PYSIDE: + ID.forbid('PySide2') + ID.forbid('PyQt4') + ID.forbid('PyQt5') + elif api == QT_API_PYQT5: + ID.forbid('PySide2') + ID.forbid('PySide') + ID.forbid('PyQt4') + else: # There are three other possibilities, all representing PyQt4 + ID.forbid('PyQt5') + ID.forbid('PySide2') + ID.forbid('PySide') + + +def loaded_api(): + """Return which API is loaded, if any + + If this returns anything besides None, + importing any other Qt binding is unsafe. + + Returns + ------- + None, 'pyside2', 'pyside', 'pyqt', 'pyqt5', or 'pyqtv1' + """ + if 'PyQt4.QtCore' in sys.modules: + if qtapi_version() == 2: + return QT_API_PYQT + else: + return QT_API_PYQTv1 + elif 'PySide.QtCore' in sys.modules: + return QT_API_PYSIDE + elif 'PySide2.QtCore' in sys.modules: + return QT_API_PYSIDE2 + elif 'PyQt5.QtCore' in sys.modules: + return QT_API_PYQT5 + return None + + +def has_binding(api): + """Safely check for PyQt4/5, PySide or PySide2, without importing submodules + + Parameters + ---------- + api : str [ 'pyqtv1' | 'pyqt' | 'pyqt5' | 'pyside' | 'pyside2' | 'pyqtdefault'] + Which module to check for + + Returns + ------- + True if the relevant module appears to be importable + """ + module_name = api_to_module[api] + from importlib.util import find_spec + + required = ['QtCore', 'QtGui', 'QtSvg'] + if api in (QT_API_PYQT5, QT_API_PYSIDE2): + # QT5 requires QtWidgets too + required.append('QtWidgets') + + for submod in required: + try: + spec = find_spec('%s.%s' % (module_name, submod)) + except ImportError: + # Package (e.g. PyQt5) not found + return False + else: + if spec is None: + # Submodule (e.g. PyQt5.QtCore) not found + return False + + if api == QT_API_PYSIDE: + # We can also safely check PySide version + import PySide + return check_version(PySide.__version__, '1.0.3') + + return True + + +def qtapi_version(): + """Return which QString API has been set, if any + + Returns + ------- + The QString API version (1 or 2), or None if not set + """ + try: + import sip + except ImportError: + return + try: + return sip.getapi('QString') + except ValueError: + return + + +def can_import(api): + """Safely query whether an API is importable, without importing it""" + if not has_binding(api): + return False + + current = loaded_api() + if api == QT_API_PYQT_DEFAULT: + return current in [QT_API_PYQT, QT_API_PYQTv1, None] + else: + return current in [api, None] + + +def import_pyqt4(version=2): + """ + Import PyQt4 + + Parameters + ---------- + version : 1, 2, or None + Which QString/QVariant API to use. Set to None to use the system + default + + ImportErrors rasied within this function are non-recoverable + """ + # The new-style string API (version=2) automatically + # converts QStrings to Unicode Python strings. Also, automatically unpacks + # QVariants to their underlying objects. + import sip + + if version is not None: + sip.setapi('QString', version) + sip.setapi('QVariant', version) + + from PyQt4 import QtGui, QtCore, QtSvg + + if not check_version(QtCore.PYQT_VERSION_STR, '4.7'): + raise ImportError("IPython requires PyQt4 >= 4.7, found %s" % + QtCore.PYQT_VERSION_STR) + + # Alias PyQt-specific functions for PySide compatibility. + QtCore.Signal = QtCore.pyqtSignal + QtCore.Slot = QtCore.pyqtSlot + + # query for the API version (in case version == None) + version = sip.getapi('QString') + api = QT_API_PYQTv1 if version == 1 else QT_API_PYQT + return QtCore, QtGui, QtSvg, api + + +def import_pyqt5(): + """ + Import PyQt5 + + ImportErrors rasied within this function are non-recoverable + """ + + from PyQt5 import QtCore, QtSvg, QtWidgets, QtGui + + # Alias PyQt-specific functions for PySide compatibility. + QtCore.Signal = QtCore.pyqtSignal + QtCore.Slot = QtCore.pyqtSlot + + # Join QtGui and QtWidgets for Qt4 compatibility. + QtGuiCompat = types.ModuleType('QtGuiCompat') + QtGuiCompat.__dict__.update(QtGui.__dict__) + QtGuiCompat.__dict__.update(QtWidgets.__dict__) + + api = QT_API_PYQT5 + return QtCore, QtGuiCompat, QtSvg, api + + +def import_pyside(): + """ + Import PySide + + ImportErrors raised within this function are non-recoverable + """ + from PySide import QtGui, QtCore, QtSvg + return QtCore, QtGui, QtSvg, QT_API_PYSIDE + +def import_pyside2(): + """ + Import PySide2 + + ImportErrors raised within this function are non-recoverable + """ + from PySide2 import QtGui, QtCore, QtSvg, QtWidgets, QtPrintSupport + + # Join QtGui and QtWidgets for Qt4 compatibility. + QtGuiCompat = types.ModuleType('QtGuiCompat') + QtGuiCompat.__dict__.update(QtGui.__dict__) + QtGuiCompat.__dict__.update(QtWidgets.__dict__) + QtGuiCompat.__dict__.update(QtPrintSupport.__dict__) + + return QtCore, QtGuiCompat, QtSvg, QT_API_PYSIDE2 + + +def load_qt(api_options): + """ + Attempt to import Qt, given a preference list + of permissible bindings + + It is safe to call this function multiple times. + + Parameters + ---------- + api_options: List of strings + The order of APIs to try. Valid items are 'pyside', 'pyside2', + 'pyqt', 'pyqt5', 'pyqtv1' and 'pyqtdefault' + + Returns + ------- + + A tuple of QtCore, QtGui, QtSvg, QT_API + The first three are the Qt modules. The last is the + string indicating which module was loaded. + + Raises + ------ + ImportError, if it isn't possible to import any requested + bindings (either because they aren't installed, or because + an incompatible library has already been installed) + """ + loaders = { + QT_API_PYSIDE2: import_pyside2, + QT_API_PYSIDE: import_pyside, + QT_API_PYQT: import_pyqt4, + QT_API_PYQT5: import_pyqt5, + QT_API_PYQTv1: partial(import_pyqt4, version=1), + QT_API_PYQT_DEFAULT: partial(import_pyqt4, version=None) + } + + for api in api_options: + + if api not in loaders: + raise RuntimeError( + "Invalid Qt API %r, valid values are: %s" % + (api, ", ".join(["%r" % k for k in loaders.keys()]))) + + if not can_import(api): + continue + + #cannot safely recover from an ImportError during this + result = loaders[api]() + api = result[-1] # changed if api = QT_API_PYQT_DEFAULT + commit_api(api) + return result + else: + raise ImportError(""" + Could not load requested Qt binding. Please ensure that + PyQt4 >= 4.7, PyQt5, PySide >= 1.0.3 or PySide2 is available, + and only one is imported per session. + + Currently-imported Qt library: %r + PyQt4 available (requires QtCore, QtGui, QtSvg): %s + PyQt5 available (requires QtCore, QtGui, QtSvg, QtWidgets): %s + PySide >= 1.0.3 installed: %s + PySide2 installed: %s + Tried to load: %r + """ % (loaded_api(), + has_binding(QT_API_PYQT), + has_binding(QT_API_PYQT5), + has_binding(QT_API_PYSIDE), + has_binding(QT_API_PYSIDE2), + api_options)) diff --git a/.venv/lib/python3.8/site-packages/IPython/frontend.py b/.venv/lib/python3.8/site-packages/IPython/frontend.py new file mode 100644 index 00000000..9cc3eaff --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/frontend.py @@ -0,0 +1,29 @@ +""" +Shim to maintain backwards compatibility with old frontend imports. + +We have moved all contents of the old `frontend` subpackage into top-level +subpackages (`html`, `qt` and `terminal`), and flattened the notebook into +just `IPython.html`, formerly `IPython.frontend.html.notebook`. + +This will let code that was making `from IPython.frontend...` calls continue +working, though a warning will be printed. +""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +import sys +from warnings import warn + +from IPython.utils.shimmodule import ShimModule, ShimWarning + +warn("The top-level `frontend` package has been deprecated since IPython 1.0. " + "All its subpackages have been moved to the top `IPython` level.", ShimWarning) + +# Unconditionally insert the shim into sys.modules so that further import calls +# trigger the custom attribute access above + +sys.modules['IPython.frontend.html.notebook'] = ShimModule( + src='IPython.frontend.html.notebook', mirror='IPython.html') +sys.modules['IPython.frontend'] = ShimModule( + src='IPython.frontend', mirror='IPython') diff --git a/.venv/lib/python3.8/site-packages/IPython/html.py b/.venv/lib/python3.8/site-packages/IPython/html.py new file mode 100644 index 00000000..050be5c5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/html.py @@ -0,0 +1,28 @@ +""" +Shim to maintain backwards compatibility with old IPython.html imports. +""" +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +import sys +from warnings import warn + +from IPython.utils.shimmodule import ShimModule, ShimWarning + +warn("The `IPython.html` package has been deprecated since IPython 4.0. " + "You should import from `notebook` instead. " + "`IPython.html.widgets` has moved to `ipywidgets`.", ShimWarning) + +_widgets = sys.modules['IPython.html.widgets'] = ShimModule( + src='IPython.html.widgets', mirror='ipywidgets') + +_html = ShimModule( + src='IPython.html', mirror='notebook') + +# hook up widgets +_html.widgets = _widgets +sys.modules['IPython.html'] = _html + +if __name__ == '__main__': + from notebook import notebookapp as app + app.launch_new_instance() diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/__init__.py b/.venv/lib/python3.8/site-packages/IPython/kernel/__init__.py new file mode 100644 index 00000000..70a05ed4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/kernel/__init__.py @@ -0,0 +1,35 @@ +""" +Shim to maintain backwards compatibility with old IPython.kernel imports. +""" +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +import sys +from warnings import warn + +from IPython.utils.shimmodule import ShimModule, ShimWarning + +warn("The `IPython.kernel` package has been deprecated since IPython 4.0." + "You should import from ipykernel or jupyter_client instead.", ShimWarning) + + +# zmq subdir is gone +sys.modules['IPython.kernel.zmq.session'] = ShimModule( + src='IPython.kernel.zmq.session', mirror='jupyter_client.session') +sys.modules['IPython.kernel.zmq'] = ShimModule( + src='IPython.kernel.zmq', mirror='ipykernel') + +for pkg in ('comm', 'inprocess'): + src = 'IPython.kernel.%s' % pkg + sys.modules[src] = ShimModule(src=src, mirror='ipykernel.%s' % pkg) + +for pkg in ('ioloop', 'blocking'): + src = 'IPython.kernel.%s' % pkg + sys.modules[src] = ShimModule(src=src, mirror='jupyter_client.%s' % pkg) + +# required for `from IPython.kernel import PKG` +from ipykernel import comm, inprocess +from jupyter_client import ioloop, blocking +# public API +from ipykernel.connect import * +from jupyter_client import * diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/__main__.py b/.venv/lib/python3.8/site-packages/IPython/kernel/__main__.py new file mode 100644 index 00000000..d1f0cf53 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/kernel/__main__.py @@ -0,0 +1,3 @@ +if __name__ == '__main__': + from ipykernel import kernelapp as app + app.launch_new_instance() diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..36bdbe34 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/__main__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/__main__.cpython-38.pyc new file mode 100644 index 00000000..9402c2a7 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/__main__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/adapter.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/adapter.cpython-38.pyc new file mode 100644 index 00000000..4226c28c Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/adapter.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/channels.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/channels.cpython-38.pyc new file mode 100644 index 00000000..016af287 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/channels.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/channelsabc.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/channelsabc.cpython-38.pyc new file mode 100644 index 00000000..7b74d6f4 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/channelsabc.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/client.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/client.cpython-38.pyc new file mode 100644 index 00000000..372d3e38 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/client.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/clientabc.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/clientabc.cpython-38.pyc new file mode 100644 index 00000000..1fd8f1ba Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/clientabc.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/connect.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/connect.cpython-38.pyc new file mode 100644 index 00000000..d1dde6a0 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/connect.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/kernelspec.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/kernelspec.cpython-38.pyc new file mode 100644 index 00000000..ffe46091 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/kernelspec.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/kernelspecapp.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/kernelspecapp.cpython-38.pyc new file mode 100644 index 00000000..67b915e3 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/kernelspecapp.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/launcher.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/launcher.cpython-38.pyc new file mode 100644 index 00000000..de298179 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/launcher.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/manager.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/manager.cpython-38.pyc new file mode 100644 index 00000000..4524919a Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/manager.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/managerabc.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/managerabc.cpython-38.pyc new file mode 100644 index 00000000..d8afd841 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/managerabc.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/multikernelmanager.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/multikernelmanager.cpython-38.pyc new file mode 100644 index 00000000..46ac34f1 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/multikernelmanager.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/restarter.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/restarter.cpython-38.pyc new file mode 100644 index 00000000..414b2fb8 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/restarter.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/threaded.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/threaded.cpython-38.pyc new file mode 100644 index 00000000..cdc7023a Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/kernel/__pycache__/threaded.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/adapter.py b/.venv/lib/python3.8/site-packages/IPython/kernel/adapter.py new file mode 100644 index 00000000..3b8c046b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/kernel/adapter.py @@ -0,0 +1 @@ +from jupyter_client.adapter import * diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/channels.py b/.venv/lib/python3.8/site-packages/IPython/kernel/channels.py new file mode 100644 index 00000000..8c7fe2a0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/kernel/channels.py @@ -0,0 +1 @@ +from jupyter_client.channels import * diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/channelsabc.py b/.venv/lib/python3.8/site-packages/IPython/kernel/channelsabc.py new file mode 100644 index 00000000..88944012 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/kernel/channelsabc.py @@ -0,0 +1 @@ +from jupyter_client.channelsabc import * diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/client.py b/.venv/lib/python3.8/site-packages/IPython/kernel/client.py new file mode 100644 index 00000000..a98690b7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/kernel/client.py @@ -0,0 +1 @@ +from jupyter_client.client import * diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/clientabc.py b/.venv/lib/python3.8/site-packages/IPython/kernel/clientabc.py new file mode 100644 index 00000000..e0cf06c9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/kernel/clientabc.py @@ -0,0 +1 @@ +from jupyter_client.clientabc import * diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/connect.py b/.venv/lib/python3.8/site-packages/IPython/kernel/connect.py new file mode 100644 index 00000000..5b6d40a5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/kernel/connect.py @@ -0,0 +1,2 @@ +from ipykernel.connect import * +from jupyter_client.connect import * diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/kernelspec.py b/.venv/lib/python3.8/site-packages/IPython/kernel/kernelspec.py new file mode 100644 index 00000000..123419b2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/kernel/kernelspec.py @@ -0,0 +1 @@ +from jupyter_client.kernelspec import * diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/kernelspecapp.py b/.venv/lib/python3.8/site-packages/IPython/kernel/kernelspecapp.py new file mode 100644 index 00000000..28cd33ab --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/kernel/kernelspecapp.py @@ -0,0 +1 @@ +from jupyter_client.kernelspecapp import * diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/launcher.py b/.venv/lib/python3.8/site-packages/IPython/kernel/launcher.py new file mode 100644 index 00000000..1953bc48 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/kernel/launcher.py @@ -0,0 +1 @@ +from jupyter_client.launcher import * diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/manager.py b/.venv/lib/python3.8/site-packages/IPython/kernel/manager.py new file mode 100644 index 00000000..c88097cf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/kernel/manager.py @@ -0,0 +1 @@ +from jupyter_client.manager import * diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/managerabc.py b/.venv/lib/python3.8/site-packages/IPython/kernel/managerabc.py new file mode 100644 index 00000000..6b40827f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/kernel/managerabc.py @@ -0,0 +1 @@ +from jupyter_client.managerabc import * diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/multikernelmanager.py b/.venv/lib/python3.8/site-packages/IPython/kernel/multikernelmanager.py new file mode 100644 index 00000000..ce576e27 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/kernel/multikernelmanager.py @@ -0,0 +1 @@ +from jupyter_client.multikernelmanager import * diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/restarter.py b/.venv/lib/python3.8/site-packages/IPython/kernel/restarter.py new file mode 100644 index 00000000..dc24117c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/kernel/restarter.py @@ -0,0 +1 @@ +from jupyter_client.restarter import * diff --git a/.venv/lib/python3.8/site-packages/IPython/kernel/threaded.py b/.venv/lib/python3.8/site-packages/IPython/kernel/threaded.py new file mode 100644 index 00000000..4a1072f7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/kernel/threaded.py @@ -0,0 +1 @@ +from jupyter_client.threaded import * diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__init__.py b/.venv/lib/python3.8/site-packages/IPython/lib/__init__.py new file mode 100644 index 00000000..8eb89012 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/__init__.py @@ -0,0 +1,21 @@ +# encoding: utf-8 +""" +Extra capabilities for IPython +""" + +#----------------------------------------------------------------------------- +# Copyright (C) 2008-2011 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +from IPython.lib.security import passwd + +#----------------------------------------------------------------------------- +# Code +#----------------------------------------------------------------------------- diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..b82ebf68 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/backgroundjobs.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/backgroundjobs.cpython-38.pyc new file mode 100644 index 00000000..224ded2e Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/backgroundjobs.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/clipboard.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/clipboard.cpython-38.pyc new file mode 100644 index 00000000..19202f79 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/clipboard.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/deepreload.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/deepreload.cpython-38.pyc new file mode 100644 index 00000000..4daa5110 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/deepreload.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/demo.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/demo.cpython-38.pyc new file mode 100644 index 00000000..47d64c2e Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/demo.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/display.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/display.cpython-38.pyc new file mode 100644 index 00000000..cabf8a56 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/display.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/editorhooks.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/editorhooks.cpython-38.pyc new file mode 100644 index 00000000..7ae8956d Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/editorhooks.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/guisupport.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/guisupport.cpython-38.pyc new file mode 100644 index 00000000..f5dcd9ff Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/guisupport.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhook.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhook.cpython-38.pyc new file mode 100644 index 00000000..52a10ff5 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhook.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhookglut.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhookglut.cpython-38.pyc new file mode 100644 index 00000000..4cf177e5 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhookglut.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhookgtk.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhookgtk.cpython-38.pyc new file mode 100644 index 00000000..c5f0243c Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhookgtk.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhookgtk3.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhookgtk3.cpython-38.pyc new file mode 100644 index 00000000..40ee6f21 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhookgtk3.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhookpyglet.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhookpyglet.cpython-38.pyc new file mode 100644 index 00000000..f7ec823f Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhookpyglet.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhookqt4.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhookqt4.cpython-38.pyc new file mode 100644 index 00000000..540825f8 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhookqt4.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhookwx.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhookwx.cpython-38.pyc new file mode 100644 index 00000000..469e5fbf Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/inputhookwx.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/kernel.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/kernel.cpython-38.pyc new file mode 100644 index 00000000..3be20684 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/kernel.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/latextools.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/latextools.cpython-38.pyc new file mode 100644 index 00000000..58d97f9d Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/latextools.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/lexers.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/lexers.cpython-38.pyc new file mode 100644 index 00000000..cedde62e Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/lexers.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/pretty.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/pretty.cpython-38.pyc new file mode 100644 index 00000000..3b50a4ae Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/pretty.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/security.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/security.cpython-38.pyc new file mode 100644 index 00000000..a3025f4a Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/__pycache__/security.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/backgroundjobs.py b/.venv/lib/python3.8/site-packages/IPython/lib/backgroundjobs.py new file mode 100644 index 00000000..31997e13 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/backgroundjobs.py @@ -0,0 +1,491 @@ +# -*- coding: utf-8 -*- +"""Manage background (threaded) jobs conveniently from an interactive shell. + +This module provides a BackgroundJobManager class. This is the main class +meant for public usage, it implements an object which can create and manage +new background jobs. + +It also provides the actual job classes managed by these BackgroundJobManager +objects, see their docstrings below. + + +This system was inspired by discussions with B. Granger and the +BackgroundCommand class described in the book Python Scripting for +Computational Science, by H. P. Langtangen: + +http://folk.uio.no/hpl/scripting + +(although ultimately no code from this text was used, as IPython's system is a +separate implementation). + +An example notebook is provided in our documentation illustrating interactive +use of the system. +""" + +#***************************************************************************** +# Copyright (C) 2005-2006 Fernando Perez +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#***************************************************************************** + +# Code begins +import sys +import threading + +from IPython import get_ipython +from IPython.core.ultratb import AutoFormattedTB +from logging import error, debug + + +class BackgroundJobManager(object): + """Class to manage a pool of backgrounded threaded jobs. + + Below, we assume that 'jobs' is a BackgroundJobManager instance. + + Usage summary (see the method docstrings for details): + + jobs.new(...) -> start a new job + + jobs() or jobs.status() -> print status summary of all jobs + + jobs[N] -> returns job number N. + + foo = jobs[N].result -> assign to variable foo the result of job N + + jobs[N].traceback() -> print the traceback of dead job N + + jobs.remove(N) -> remove (finished) job N + + jobs.flush() -> remove all finished jobs + + As a convenience feature, BackgroundJobManager instances provide the + utility result and traceback methods which retrieve the corresponding + information from the jobs list: + + jobs.result(N) <--> jobs[N].result + jobs.traceback(N) <--> jobs[N].traceback() + + While this appears minor, it allows you to use tab completion + interactively on the job manager instance. + """ + + def __init__(self): + # Lists for job management, accessed via a property to ensure they're + # up to date.x + self._running = [] + self._completed = [] + self._dead = [] + # A dict of all jobs, so users can easily access any of them + self.all = {} + # For reporting + self._comp_report = [] + self._dead_report = [] + # Store status codes locally for fast lookups + self._s_created = BackgroundJobBase.stat_created_c + self._s_running = BackgroundJobBase.stat_running_c + self._s_completed = BackgroundJobBase.stat_completed_c + self._s_dead = BackgroundJobBase.stat_dead_c + self._current_job_id = 0 + + @property + def running(self): + self._update_status() + return self._running + + @property + def dead(self): + self._update_status() + return self._dead + + @property + def completed(self): + self._update_status() + return self._completed + + def new(self, func_or_exp, *args, **kwargs): + """Add a new background job and start it in a separate thread. + + There are two types of jobs which can be created: + + 1. Jobs based on expressions which can be passed to an eval() call. + The expression must be given as a string. For example: + + job_manager.new('myfunc(x,y,z=1)'[,glob[,loc]]) + + The given expression is passed to eval(), along with the optional + global/local dicts provided. If no dicts are given, they are + extracted automatically from the caller's frame. + + A Python statement is NOT a valid eval() expression. Basically, you + can only use as an eval() argument something which can go on the right + of an '=' sign and be assigned to a variable. + + For example,"print 'hello'" is not valid, but '2+3' is. + + 2. Jobs given a function object, optionally passing additional + positional arguments: + + job_manager.new(myfunc, x, y) + + The function is called with the given arguments. + + If you need to pass keyword arguments to your function, you must + supply them as a dict named kw: + + job_manager.new(myfunc, x, y, kw=dict(z=1)) + + The reason for this assymmetry is that the new() method needs to + maintain access to its own keywords, and this prevents name collisions + between arguments to new() and arguments to your own functions. + + In both cases, the result is stored in the job.result field of the + background job object. + + You can set `daemon` attribute of the thread by giving the keyword + argument `daemon`. + + Notes and caveats: + + 1. All threads running share the same standard output. Thus, if your + background jobs generate output, it will come out on top of whatever + you are currently writing. For this reason, background jobs are best + used with silent functions which simply return their output. + + 2. Threads also all work within the same global namespace, and this + system does not lock interactive variables. So if you send job to the + background which operates on a mutable object for a long time, and + start modifying that same mutable object interactively (or in another + backgrounded job), all sorts of bizarre behaviour will occur. + + 3. If a background job is spending a lot of time inside a C extension + module which does not release the Python Global Interpreter Lock + (GIL), this will block the IPython prompt. This is simply because the + Python interpreter can only switch between threads at Python + bytecodes. While the execution is inside C code, the interpreter must + simply wait unless the extension module releases the GIL. + + 4. There is no way, due to limitations in the Python threads library, + to kill a thread once it has started.""" + + if callable(func_or_exp): + kw = kwargs.get('kw',{}) + job = BackgroundJobFunc(func_or_exp,*args,**kw) + elif isinstance(func_or_exp, str): + if not args: + frame = sys._getframe(1) + glob, loc = frame.f_globals, frame.f_locals + elif len(args)==1: + glob = loc = args[0] + elif len(args)==2: + glob,loc = args + else: + raise ValueError( + 'Expression jobs take at most 2 args (globals,locals)') + job = BackgroundJobExpr(func_or_exp, glob, loc) + else: + raise TypeError('invalid args for new job') + + if kwargs.get('daemon', False): + job.daemon = True + job.num = self._current_job_id + self._current_job_id += 1 + self.running.append(job) + self.all[job.num] = job + debug('Starting job # %s in a separate thread.' % job.num) + job.start() + return job + + def __getitem__(self, job_key): + num = job_key if isinstance(job_key, int) else job_key.num + return self.all[num] + + def __call__(self): + """An alias to self.status(), + + This allows you to simply call a job manager instance much like the + Unix `jobs` shell command.""" + + return self.status() + + def _update_status(self): + """Update the status of the job lists. + + This method moves finished jobs to one of two lists: + - self.completed: jobs which completed successfully + - self.dead: jobs which finished but died. + + It also copies those jobs to corresponding _report lists. These lists + are used to report jobs completed/dead since the last update, and are + then cleared by the reporting function after each call.""" + + # Status codes + srun, scomp, sdead = self._s_running, self._s_completed, self._s_dead + # State lists, use the actual lists b/c the public names are properties + # that call this very function on access + running, completed, dead = self._running, self._completed, self._dead + + # Now, update all state lists + for num, job in enumerate(running): + stat = job.stat_code + if stat == srun: + continue + elif stat == scomp: + completed.append(job) + self._comp_report.append(job) + running[num] = False + elif stat == sdead: + dead.append(job) + self._dead_report.append(job) + running[num] = False + # Remove dead/completed jobs from running list + running[:] = filter(None, running) + + def _group_report(self,group,name): + """Report summary for a given job group. + + Return True if the group had any elements.""" + + if group: + print('%s jobs:' % name) + for job in group: + print('%s : %s' % (job.num,job)) + print() + return True + + def _group_flush(self,group,name): + """Flush a given job group + + Return True if the group had any elements.""" + + njobs = len(group) + if njobs: + plural = {1:''}.setdefault(njobs,'s') + print('Flushing %s %s job%s.' % (njobs,name,plural)) + group[:] = [] + return True + + def _status_new(self): + """Print the status of newly finished jobs. + + Return True if any new jobs are reported. + + This call resets its own state every time, so it only reports jobs + which have finished since the last time it was called.""" + + self._update_status() + new_comp = self._group_report(self._comp_report, 'Completed') + new_dead = self._group_report(self._dead_report, + 'Dead, call jobs.traceback() for details') + self._comp_report[:] = [] + self._dead_report[:] = [] + return new_comp or new_dead + + def status(self,verbose=0): + """Print a status of all jobs currently being managed.""" + + self._update_status() + self._group_report(self.running,'Running') + self._group_report(self.completed,'Completed') + self._group_report(self.dead,'Dead') + # Also flush the report queues + self._comp_report[:] = [] + self._dead_report[:] = [] + + def remove(self,num): + """Remove a finished (completed or dead) job.""" + + try: + job = self.all[num] + except KeyError: + error('Job #%s not found' % num) + else: + stat_code = job.stat_code + if stat_code == self._s_running: + error('Job #%s is still running, it can not be removed.' % num) + return + elif stat_code == self._s_completed: + self.completed.remove(job) + elif stat_code == self._s_dead: + self.dead.remove(job) + + def flush(self): + """Flush all finished jobs (completed and dead) from lists. + + Running jobs are never flushed. + + It first calls _status_new(), to update info. If any jobs have + completed since the last _status_new() call, the flush operation + aborts.""" + + # Remove the finished jobs from the master dict + alljobs = self.all + for job in self.completed+self.dead: + del(alljobs[job.num]) + + # Now flush these lists completely + fl_comp = self._group_flush(self.completed, 'Completed') + fl_dead = self._group_flush(self.dead, 'Dead') + if not (fl_comp or fl_dead): + print('No jobs to flush.') + + def result(self,num): + """result(N) -> return the result of job N.""" + try: + return self.all[num].result + except KeyError: + error('Job #%s not found' % num) + + def _traceback(self, job): + num = job if isinstance(job, int) else job.num + try: + self.all[num].traceback() + except KeyError: + error('Job #%s not found' % num) + + def traceback(self, job=None): + if job is None: + self._update_status() + for deadjob in self.dead: + print("Traceback for: %r" % deadjob) + self._traceback(deadjob) + print() + else: + self._traceback(job) + + +class BackgroundJobBase(threading.Thread): + """Base class to build BackgroundJob classes. + + The derived classes must implement: + + - Their own __init__, since the one here raises NotImplementedError. The + derived constructor must call self._init() at the end, to provide common + initialization. + + - A strform attribute used in calls to __str__. + + - A call() method, which will make the actual execution call and must + return a value to be held in the 'result' field of the job object. + """ + + # Class constants for status, in string and as numerical codes (when + # updating jobs lists, we don't want to do string comparisons). This will + # be done at every user prompt, so it has to be as fast as possible + stat_created = 'Created'; stat_created_c = 0 + stat_running = 'Running'; stat_running_c = 1 + stat_completed = 'Completed'; stat_completed_c = 2 + stat_dead = 'Dead (Exception), call jobs.traceback() for details' + stat_dead_c = -1 + + def __init__(self): + """Must be implemented in subclasses. + + Subclasses must call :meth:`_init` for standard initialisation. + """ + raise NotImplementedError("This class can not be instantiated directly.") + + def _init(self): + """Common initialization for all BackgroundJob objects""" + + for attr in ['call','strform']: + assert hasattr(self,attr), "Missing attribute <%s>" % attr + + # The num tag can be set by an external job manager + self.num = None + + self.status = BackgroundJobBase.stat_created + self.stat_code = BackgroundJobBase.stat_created_c + self.finished = False + self.result = '' + + # reuse the ipython traceback handler if we can get to it, otherwise + # make a new one + try: + make_tb = get_ipython().InteractiveTB.text + except: + make_tb = AutoFormattedTB(mode = 'Context', + color_scheme='NoColor', + tb_offset = 1).text + # Note that the actual API for text() requires the three args to be + # passed in, so we wrap it in a simple lambda. + self._make_tb = lambda : make_tb(None, None, None) + + # Hold a formatted traceback if one is generated. + self._tb = None + + threading.Thread.__init__(self) + + def __str__(self): + return self.strform + + def __repr__(self): + return '' % (self.num, self.strform) + + def traceback(self): + print(self._tb) + + def run(self): + try: + self.status = BackgroundJobBase.stat_running + self.stat_code = BackgroundJobBase.stat_running_c + self.result = self.call() + except: + self.status = BackgroundJobBase.stat_dead + self.stat_code = BackgroundJobBase.stat_dead_c + self.finished = None + self.result = ('') + self._tb = self._make_tb() + else: + self.status = BackgroundJobBase.stat_completed + self.stat_code = BackgroundJobBase.stat_completed_c + self.finished = True + + +class BackgroundJobExpr(BackgroundJobBase): + """Evaluate an expression as a background job (uses a separate thread).""" + + def __init__(self, expression, glob=None, loc=None): + """Create a new job from a string which can be fed to eval(). + + global/locals dicts can be provided, which will be passed to the eval + call.""" + + # fail immediately if the given expression can't be compiled + self.code = compile(expression,'','eval') + + glob = {} if glob is None else glob + loc = {} if loc is None else loc + self.expression = self.strform = expression + self.glob = glob + self.loc = loc + self._init() + + def call(self): + return eval(self.code,self.glob,self.loc) + + +class BackgroundJobFunc(BackgroundJobBase): + """Run a function call as a background job (uses a separate thread).""" + + def __init__(self, func, *args, **kwargs): + """Create a new job from a callable object. + + Any positional arguments and keyword args given to this constructor + after the initial callable are passed directly to it.""" + + if not callable(func): + raise TypeError( + 'first argument to BackgroundJobFunc must be callable') + + self.func = func + self.args = args + self.kwargs = kwargs + # The string form will only include the function passed, because + # generating string representations of the arguments is a potentially + # _very_ expensive operation (e.g. with large arrays). + self.strform = str(func) + self._init() + + def call(self): + return self.func(*self.args, **self.kwargs) diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/clipboard.py b/.venv/lib/python3.8/site-packages/IPython/lib/clipboard.py new file mode 100644 index 00000000..316a8ab1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/clipboard.py @@ -0,0 +1,69 @@ +""" Utilities for accessing the platform's clipboard. +""" + +import subprocess + +from IPython.core.error import TryNext +import IPython.utils.py3compat as py3compat + +class ClipboardEmpty(ValueError): + pass + +def win32_clipboard_get(): + """ Get the current clipboard's text on Windows. + + Requires Mark Hammond's pywin32 extensions. + """ + try: + import win32clipboard + except ImportError: + raise TryNext("Getting text from the clipboard requires the pywin32 " + "extensions: http://sourceforge.net/projects/pywin32/") + win32clipboard.OpenClipboard() + try: + text = win32clipboard.GetClipboardData(win32clipboard.CF_UNICODETEXT) + except (TypeError, win32clipboard.error): + try: + text = win32clipboard.GetClipboardData(win32clipboard.CF_TEXT) + text = py3compat.cast_unicode(text, py3compat.DEFAULT_ENCODING) + except (TypeError, win32clipboard.error): + raise ClipboardEmpty + finally: + win32clipboard.CloseClipboard() + return text + +def osx_clipboard_get() -> str: + """ Get the clipboard's text on OS X. + """ + p = subprocess.Popen(['pbpaste', '-Prefer', 'ascii'], + stdout=subprocess.PIPE) + bytes_, stderr = p.communicate() + # Text comes in with old Mac \r line endings. Change them to \n. + bytes_ = bytes_.replace(b'\r', b'\n') + text = py3compat.decode(bytes_) + return text + +def tkinter_clipboard_get(): + """ Get the clipboard's text using Tkinter. + + This is the default on systems that are not Windows or OS X. It may + interfere with other UI toolkits and should be replaced with an + implementation that uses that toolkit. + """ + try: + from tkinter import Tk, TclError + except ImportError: + raise TryNext("Getting text from the clipboard on this platform requires tkinter.") + + root = Tk() + root.withdraw() + try: + text = root.clipboard_get() + except TclError: + raise ClipboardEmpty + finally: + root.destroy() + text = py3compat.cast_unicode(text, py3compat.DEFAULT_ENCODING) + return text + + diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/deepreload.py b/.venv/lib/python3.8/site-packages/IPython/lib/deepreload.py new file mode 100644 index 00000000..bd8c01b2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/deepreload.py @@ -0,0 +1,341 @@ +# -*- coding: utf-8 -*- +""" +Provides a reload() function that acts recursively. + +Python's normal :func:`python:reload` function only reloads the module that it's +passed. The :func:`reload` function in this module also reloads everything +imported from that module, which is useful when you're changing files deep +inside a package. + +To use this as your default reload function, type this:: + + import builtins + from IPython.lib import deepreload + builtins.reload = deepreload.reload + +A reference to the original :func:`python:reload` is stored in this module as +:data:`original_reload`, so you can restore it later. + +This code is almost entirely based on knee.py, which is a Python +re-implementation of hierarchical module import. +""" +#***************************************************************************** +# Copyright (C) 2001 Nathaniel Gray +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#***************************************************************************** + +import builtins as builtin_mod +from contextlib import contextmanager +import imp +import sys + +from types import ModuleType +from warnings import warn +import types + +original_import = builtin_mod.__import__ + +@contextmanager +def replace_import_hook(new_import): + saved_import = builtin_mod.__import__ + builtin_mod.__import__ = new_import + try: + yield + finally: + builtin_mod.__import__ = saved_import + +def get_parent(globals, level): + """ + parent, name = get_parent(globals, level) + + Return the package that an import is being performed in. If globals comes + from the module foo.bar.bat (not itself a package), this returns the + sys.modules entry for foo.bar. If globals is from a package's __init__.py, + the package's entry in sys.modules is returned. + + If globals doesn't come from a package or a module in a package, or a + corresponding entry is not found in sys.modules, None is returned. + """ + orig_level = level + + if not level or not isinstance(globals, dict): + return None, '' + + pkgname = globals.get('__package__', None) + + if pkgname is not None: + # __package__ is set, so use it + if not hasattr(pkgname, 'rindex'): + raise ValueError('__package__ set to non-string') + if len(pkgname) == 0: + if level > 0: + raise ValueError('Attempted relative import in non-package') + return None, '' + name = pkgname + else: + # __package__ not set, so figure it out and set it + if '__name__' not in globals: + return None, '' + modname = globals['__name__'] + + if '__path__' in globals: + # __path__ is set, so modname is already the package name + globals['__package__'] = name = modname + else: + # Normal module, so work out the package name if any + lastdot = modname.rfind('.') + if lastdot < 0 < level: + raise ValueError("Attempted relative import in non-package") + if lastdot < 0: + globals['__package__'] = None + return None, '' + globals['__package__'] = name = modname[:lastdot] + + dot = len(name) + for x in range(level, 1, -1): + try: + dot = name.rindex('.', 0, dot) + except ValueError: + raise ValueError("attempted relative import beyond top-level " + "package") + name = name[:dot] + + try: + parent = sys.modules[name] + except: + if orig_level < 1: + warn("Parent module '%.200s' not found while handling absolute " + "import" % name) + parent = None + else: + raise SystemError("Parent module '%.200s' not loaded, cannot " + "perform relative import" % name) + + # We expect, but can't guarantee, if parent != None, that: + # - parent.__name__ == name + # - parent.__dict__ is globals + # If this is violated... Who cares? + return parent, name + +def load_next(mod, altmod, name, buf): + """ + mod, name, buf = load_next(mod, altmod, name, buf) + + altmod is either None or same as mod + """ + + if len(name) == 0: + # completely empty module name should only happen in + # 'from . import' (or '__import__("")') + return mod, None, buf + + dot = name.find('.') + if dot == 0: + raise ValueError('Empty module name') + + if dot < 0: + subname = name + next = None + else: + subname = name[:dot] + next = name[dot+1:] + + if buf != '': + buf += '.' + buf += subname + + result = import_submodule(mod, subname, buf) + if result is None and mod != altmod: + result = import_submodule(altmod, subname, subname) + if result is not None: + buf = subname + + if result is None: + raise ImportError("No module named %.200s" % name) + + return result, next, buf + + +# Need to keep track of what we've already reloaded to prevent cyclic evil +found_now = {} + +def import_submodule(mod, subname, fullname): + """m = import_submodule(mod, subname, fullname)""" + # Require: + # if mod == None: subname == fullname + # else: mod.__name__ + "." + subname == fullname + + global found_now + if fullname in found_now and fullname in sys.modules: + m = sys.modules[fullname] + else: + print('Reloading', fullname) + found_now[fullname] = 1 + oldm = sys.modules.get(fullname, None) + + if mod is None: + path = None + elif hasattr(mod, '__path__'): + path = mod.__path__ + else: + return None + + try: + # This appears to be necessary on Python 3, because imp.find_module() + # tries to import standard libraries (like io) itself, and we don't + # want them to be processed by our deep_import_hook. + with replace_import_hook(original_import): + fp, filename, stuff = imp.find_module(subname, path) + except ImportError: + return None + + try: + m = imp.load_module(fullname, fp, filename, stuff) + except: + # load_module probably removed name from modules because of + # the error. Put back the original module object. + if oldm: + sys.modules[fullname] = oldm + raise + finally: + if fp: fp.close() + + add_submodule(mod, m, fullname, subname) + + return m + +def add_submodule(mod, submod, fullname, subname): + """mod.{subname} = submod""" + if mod is None: + return #Nothing to do here. + + if submod is None: + submod = sys.modules[fullname] + + setattr(mod, subname, submod) + + return + +def ensure_fromlist(mod, fromlist, buf, recursive): + """Handle 'from module import a, b, c' imports.""" + if not hasattr(mod, '__path__'): + return + for item in fromlist: + if not hasattr(item, 'rindex'): + raise TypeError("Item in ``from list'' not a string") + if item == '*': + if recursive: + continue # avoid endless recursion + try: + all = mod.__all__ + except AttributeError: + pass + else: + ret = ensure_fromlist(mod, all, buf, 1) + if not ret: + return 0 + elif not hasattr(mod, item): + import_submodule(mod, item, buf + '.' + item) + +def deep_import_hook(name, globals=None, locals=None, fromlist=None, level=-1): + """Replacement for __import__()""" + parent, buf = get_parent(globals, level) + + head, name, buf = load_next(parent, None if level < 0 else parent, name, buf) + + tail = head + while name: + tail, name, buf = load_next(tail, tail, name, buf) + + # If tail is None, both get_parent and load_next found + # an empty module name: someone called __import__("") or + # doctored faulty bytecode + if tail is None: + raise ValueError('Empty module name') + + if not fromlist: + return head + + ensure_fromlist(tail, fromlist, buf, 0) + return tail + +modules_reloading = {} + +def deep_reload_hook(m): + """Replacement for reload().""" + # Hardcode this one as it would raise a NotImplementedError from the + # bowels of Python and screw up the import machinery after. + # unlike other imports the `exclude` list already in place is not enough. + + if m is types: + return m + if not isinstance(m, ModuleType): + raise TypeError("reload() argument must be module") + + name = m.__name__ + + if name not in sys.modules: + raise ImportError("reload(): module %.200s not in sys.modules" % name) + + global modules_reloading + try: + return modules_reloading[name] + except: + modules_reloading[name] = m + + dot = name.rfind('.') + if dot < 0: + subname = name + path = None + else: + try: + parent = sys.modules[name[:dot]] + except KeyError: + modules_reloading.clear() + raise ImportError("reload(): parent %.200s not in sys.modules" % name[:dot]) + subname = name[dot+1:] + path = getattr(parent, "__path__", None) + + try: + # This appears to be necessary on Python 3, because imp.find_module() + # tries to import standard libraries (like io) itself, and we don't + # want them to be processed by our deep_import_hook. + with replace_import_hook(original_import): + fp, filename, stuff = imp.find_module(subname, path) + finally: + modules_reloading.clear() + + try: + newm = imp.load_module(name, fp, filename, stuff) + except: + # load_module probably removed name from modules because of + # the error. Put back the original module object. + sys.modules[name] = m + raise + finally: + if fp: fp.close() + + modules_reloading.clear() + return newm + +# Save the original hooks +original_reload = imp.reload + +# Replacement for reload() +def reload(module, exclude=('sys', 'os.path', 'builtins', '__main__', + 'numpy', 'numpy._globals')): + """Recursively reload all modules used in the given module. Optionally + takes a list of modules to exclude from reloading. The default exclude + list contains sys, __main__, and __builtin__, to prevent, e.g., resetting + display, exception, and io hooks. + """ + global found_now + for i in exclude: + found_now[i] = 1 + try: + with replace_import_hook(deep_import_hook): + return deep_reload_hook(module) + finally: + found_now = {} diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/demo.py b/.venv/lib/python3.8/site-packages/IPython/lib/demo.py new file mode 100644 index 00000000..0b19c413 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/demo.py @@ -0,0 +1,671 @@ +"""Module for interactive demos using IPython. + +This module implements a few classes for running Python scripts interactively +in IPython for demonstrations. With very simple markup (a few tags in +comments), you can control points where the script stops executing and returns +control to IPython. + + +Provided classes +---------------- + +The classes are (see their docstrings for further details): + + - Demo: pure python demos + + - IPythonDemo: demos with input to be processed by IPython as if it had been + typed interactively (so magics work, as well as any other special syntax you + may have added via input prefilters). + + - LineDemo: single-line version of the Demo class. These demos are executed + one line at a time, and require no markup. + + - IPythonLineDemo: IPython version of the LineDemo class (the demo is + executed a line at a time, but processed via IPython). + + - ClearMixin: mixin to make Demo classes with less visual clutter. It + declares an empty marquee and a pre_cmd that clears the screen before each + block (see Subclassing below). + + - ClearDemo, ClearIPDemo: mixin-enabled versions of the Demo and IPythonDemo + classes. + +Inheritance diagram: + +.. inheritance-diagram:: IPython.lib.demo + :parts: 3 + +Subclassing +----------- + +The classes here all include a few methods meant to make customization by +subclassing more convenient. Their docstrings below have some more details: + + - highlight(): format every block and optionally highlight comments and + docstring content. + + - marquee(): generates a marquee to provide visible on-screen markers at each + block start and end. + + - pre_cmd(): run right before the execution of each block. + + - post_cmd(): run right after the execution of each block. If the block + raises an exception, this is NOT called. + + +Operation +--------- + +The file is run in its own empty namespace (though you can pass it a string of +arguments as if in a command line environment, and it will see those as +sys.argv). But at each stop, the global IPython namespace is updated with the +current internal demo namespace, so you can work interactively with the data +accumulated so far. + +By default, each block of code is printed (with syntax highlighting) before +executing it and you have to confirm execution. This is intended to show the +code to an audience first so you can discuss it, and only proceed with +execution once you agree. There are a few tags which allow you to modify this +behavior. + +The supported tags are: + +# stop + + Defines block boundaries, the points where IPython stops execution of the + file and returns to the interactive prompt. + + You can optionally mark the stop tag with extra dashes before and after the + word 'stop', to help visually distinguish the blocks in a text editor: + + # --- stop --- + + +# silent + + Make a block execute silently (and hence automatically). Typically used in + cases where you have some boilerplate or initialization code which you need + executed but do not want to be seen in the demo. + +# auto + + Make a block execute automatically, but still being printed. Useful for + simple code which does not warrant discussion, since it avoids the extra + manual confirmation. + +# auto_all + + This tag can _only_ be in the first block, and if given it overrides the + individual auto tags to make the whole demo fully automatic (no block asks + for confirmation). It can also be given at creation time (or the attribute + set later) to override what's in the file. + +While _any_ python file can be run as a Demo instance, if there are no stop +tags the whole file will run in a single block (no different that calling +first %pycat and then %run). The minimal markup to make this useful is to +place a set of stop tags; the other tags are only there to let you fine-tune +the execution. + +This is probably best explained with the simple example file below. You can +copy this into a file named ex_demo.py, and try running it via:: + + from IPython.lib.demo import Demo + d = Demo('ex_demo.py') + d() + +Each time you call the demo object, it runs the next block. The demo object +has a few useful methods for navigation, like again(), edit(), jump(), seek() +and back(). It can be reset for a new run via reset() or reloaded from disk +(in case you've edited the source) via reload(). See their docstrings below. + +Note: To make this simpler to explore, a file called "demo-exercizer.py" has +been added to the "docs/examples/core" directory. Just cd to this directory in +an IPython session, and type:: + + %run demo-exercizer.py + +and then follow the directions. + +Example +------- + +The following is a very simple example of a valid demo file. + +:: + + #################### EXAMPLE DEMO ############################### + '''A simple interactive demo to illustrate the use of IPython's Demo class.''' + + print 'Hello, welcome to an interactive IPython demo.' + + # The mark below defines a block boundary, which is a point where IPython will + # stop execution and return to the interactive prompt. The dashes are actually + # optional and used only as a visual aid to clearly separate blocks while + # editing the demo code. + # stop + + x = 1 + y = 2 + + # stop + + # the mark below makes this block as silent + # silent + + print 'This is a silent block, which gets executed but not printed.' + + # stop + # auto + print 'This is an automatic block.' + print 'It is executed without asking for confirmation, but printed.' + z = x+y + + print 'z=',x + + # stop + # This is just another normal block. + print 'z is now:', z + + print 'bye!' + ################### END EXAMPLE DEMO ############################ +""" + + +#***************************************************************************** +# Copyright (C) 2005-2006 Fernando Perez. +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +# +#***************************************************************************** + +import os +import re +import shlex +import sys +import pygments + +from IPython.utils.text import marquee +from IPython.utils import openpy +from IPython.utils import py3compat +__all__ = ['Demo','IPythonDemo','LineDemo','IPythonLineDemo','DemoError'] + +class DemoError(Exception): pass + +def re_mark(mark): + return re.compile(r'^\s*#\s+\s+%s\s*$' % mark,re.MULTILINE) + +class Demo(object): + + re_stop = re_mark(r'-*\s?stop\s?-*') + re_silent = re_mark('silent') + re_auto = re_mark('auto') + re_auto_all = re_mark('auto_all') + + def __init__(self,src,title='',arg_str='',auto_all=None, format_rst=False, + formatter='terminal', style='default'): + """Make a new demo object. To run the demo, simply call the object. + + See the module docstring for full details and an example (you can use + IPython.Demo? in IPython to see it). + + Inputs: + + - src is either a file, or file-like object, or a + string that can be resolved to a filename. + + Optional inputs: + + - title: a string to use as the demo name. Of most use when the demo + you are making comes from an object that has no filename, or if you + want an alternate denotation distinct from the filename. + + - arg_str(''): a string of arguments, internally converted to a list + just like sys.argv, so the demo script can see a similar + environment. + + - auto_all(None): global flag to run all blocks automatically without + confirmation. This attribute overrides the block-level tags and + applies to the whole demo. It is an attribute of the object, and + can be changed at runtime simply by reassigning it to a boolean + value. + + - format_rst(False): a bool to enable comments and doc strings + formatting with pygments rst lexer + + - formatter('terminal'): a string of pygments formatter name to be + used. Useful values for terminals: terminal, terminal256, + terminal16m + + - style('default'): a string of pygments style name to be used. + """ + if hasattr(src, "read"): + # It seems to be a file or a file-like object + self.fname = "from a file-like object" + if title == '': + self.title = "from a file-like object" + else: + self.title = title + else: + # Assume it's a string or something that can be converted to one + self.fname = src + if title == '': + (filepath, filename) = os.path.split(src) + self.title = filename + else: + self.title = title + self.sys_argv = [src] + shlex.split(arg_str) + self.auto_all = auto_all + self.src = src + + try: + ip = get_ipython() # this is in builtins whenever IPython is running + self.inside_ipython = True + except NameError: + self.inside_ipython = False + + if self.inside_ipython: + # get a few things from ipython. While it's a bit ugly design-wise, + # it ensures that things like color scheme and the like are always in + # sync with the ipython mode being used. This class is only meant to + # be used inside ipython anyways, so it's OK. + self.ip_ns = ip.user_ns + self.ip_colorize = ip.pycolorize + self.ip_showtb = ip.showtraceback + self.ip_run_cell = ip.run_cell + self.shell = ip + + self.formatter = pygments.formatters.get_formatter_by_name(formatter, + style=style) + self.python_lexer = pygments.lexers.get_lexer_by_name("py3") + self.format_rst = format_rst + if format_rst: + self.rst_lexer = pygments.lexers.get_lexer_by_name("rst") + + # load user data and initialize data structures + self.reload() + + def fload(self): + """Load file object.""" + # read data and parse into blocks + if hasattr(self, 'fobj') and self.fobj is not None: + self.fobj.close() + if hasattr(self.src, "read"): + # It seems to be a file or a file-like object + self.fobj = self.src + else: + # Assume it's a string or something that can be converted to one + self.fobj = openpy.open(self.fname) + + def reload(self): + """Reload source from disk and initialize state.""" + self.fload() + + self.src = "".join(openpy.strip_encoding_cookie(self.fobj)) + src_b = [b.strip() for b in self.re_stop.split(self.src) if b] + self._silent = [bool(self.re_silent.findall(b)) for b in src_b] + self._auto = [bool(self.re_auto.findall(b)) for b in src_b] + + # if auto_all is not given (def. None), we read it from the file + if self.auto_all is None: + self.auto_all = bool(self.re_auto_all.findall(src_b[0])) + else: + self.auto_all = bool(self.auto_all) + + # Clean the sources from all markup so it doesn't get displayed when + # running the demo + src_blocks = [] + auto_strip = lambda s: self.re_auto.sub('',s) + for i,b in enumerate(src_b): + if self._auto[i]: + src_blocks.append(auto_strip(b)) + else: + src_blocks.append(b) + # remove the auto_all marker + src_blocks[0] = self.re_auto_all.sub('',src_blocks[0]) + + self.nblocks = len(src_blocks) + self.src_blocks = src_blocks + + # also build syntax-highlighted source + self.src_blocks_colored = list(map(self.highlight,self.src_blocks)) + + # ensure clean namespace and seek offset + self.reset() + + def reset(self): + """Reset the namespace and seek pointer to restart the demo""" + self.user_ns = {} + self.finished = False + self.block_index = 0 + + def _validate_index(self,index): + if index<0 or index>=self.nblocks: + raise ValueError('invalid block index %s' % index) + + def _get_index(self,index): + """Get the current block index, validating and checking status. + + Returns None if the demo is finished""" + + if index is None: + if self.finished: + print('Demo finished. Use .reset() if you want to rerun it.') + return None + index = self.block_index + else: + self._validate_index(index) + return index + + def seek(self,index): + """Move the current seek pointer to the given block. + + You can use negative indices to seek from the end, with identical + semantics to those of Python lists.""" + if index<0: + index = self.nblocks + index + self._validate_index(index) + self.block_index = index + self.finished = False + + def back(self,num=1): + """Move the seek pointer back num blocks (default is 1).""" + self.seek(self.block_index-num) + + def jump(self,num=1): + """Jump a given number of blocks relative to the current one. + + The offset can be positive or negative, defaults to 1.""" + self.seek(self.block_index+num) + + def again(self): + """Move the seek pointer back one block and re-execute.""" + self.back(1) + self() + + def edit(self,index=None): + """Edit a block. + + If no number is given, use the last block executed. + + This edits the in-memory copy of the demo, it does NOT modify the + original source file. If you want to do that, simply open the file in + an editor and use reload() when you make changes to the file. This + method is meant to let you change a block during a demonstration for + explanatory purposes, without damaging your original script.""" + + index = self._get_index(index) + if index is None: + return + # decrease the index by one (unless we're at the very beginning), so + # that the default demo.edit() call opens up the sblock we've last run + if index>0: + index -= 1 + + filename = self.shell.mktempfile(self.src_blocks[index]) + self.shell.hooks.editor(filename,1) + with open(filename, 'r') as f: + new_block = f.read() + # update the source and colored block + self.src_blocks[index] = new_block + self.src_blocks_colored[index] = self.highlight(new_block) + self.block_index = index + # call to run with the newly edited index + self() + + def show(self,index=None): + """Show a single block on screen""" + + index = self._get_index(index) + if index is None: + return + + print(self.marquee('<%s> block # %s (%s remaining)' % + (self.title,index,self.nblocks-index-1))) + print(self.src_blocks_colored[index]) + sys.stdout.flush() + + def show_all(self): + """Show entire demo on screen, block by block""" + + fname = self.title + title = self.title + nblocks = self.nblocks + silent = self._silent + marquee = self.marquee + for index,block in enumerate(self.src_blocks_colored): + if silent[index]: + print(marquee('<%s> SILENT block # %s (%s remaining)' % + (title,index,nblocks-index-1))) + else: + print(marquee('<%s> block # %s (%s remaining)' % + (title,index,nblocks-index-1))) + print(block, end=' ') + sys.stdout.flush() + + def run_cell(self,source): + """Execute a string with one or more lines of code""" + + exec(source, self.user_ns) + + def __call__(self,index=None): + """run a block of the demo. + + If index is given, it should be an integer >=1 and <= nblocks. This + means that the calling convention is one off from typical Python + lists. The reason for the inconsistency is that the demo always + prints 'Block n/N, and N is the total, so it would be very odd to use + zero-indexing here.""" + + index = self._get_index(index) + if index is None: + return + try: + marquee = self.marquee + next_block = self.src_blocks[index] + self.block_index += 1 + if self._silent[index]: + print(marquee('Executing silent block # %s (%s remaining)' % + (index,self.nblocks-index-1))) + else: + self.pre_cmd() + self.show(index) + if self.auto_all or self._auto[index]: + print(marquee('output:')) + else: + print(marquee('Press to quit, to execute...'), end=' ') + ans = py3compat.input().strip() + if ans: + print(marquee('Block NOT executed')) + return + try: + save_argv = sys.argv + sys.argv = self.sys_argv + self.run_cell(next_block) + self.post_cmd() + finally: + sys.argv = save_argv + + except: + if self.inside_ipython: + self.ip_showtb(filename=self.fname) + else: + if self.inside_ipython: + self.ip_ns.update(self.user_ns) + + if self.block_index == self.nblocks: + mq1 = self.marquee('END OF DEMO') + if mq1: + # avoid spurious print if empty marquees are used + print() + print(mq1) + print(self.marquee('Use .reset() if you want to rerun it.')) + self.finished = True + + # These methods are meant to be overridden by subclasses who may wish to + # customize the behavior of of their demos. + def marquee(self,txt='',width=78,mark='*'): + """Return the input string centered in a 'marquee'.""" + return marquee(txt,width,mark) + + def pre_cmd(self): + """Method called before executing each block.""" + pass + + def post_cmd(self): + """Method called after executing each block.""" + pass + + def highlight(self, block): + """Method called on each block to highlight it content""" + tokens = pygments.lex(block, self.python_lexer) + if self.format_rst: + from pygments.token import Token + toks = [] + for token in tokens: + if token[0] == Token.String.Doc and len(token[1]) > 6: + toks += pygments.lex(token[1][:3], self.python_lexer) + # parse doc string content by rst lexer + toks += pygments.lex(token[1][3:-3], self.rst_lexer) + toks += pygments.lex(token[1][-3:], self.python_lexer) + elif token[0] == Token.Comment.Single: + toks.append((Token.Comment.Single, token[1][0])) + # parse comment content by rst lexer + # remove the extrat newline added by rst lexer + toks += list(pygments.lex(token[1][1:], self.rst_lexer))[:-1] + else: + toks.append(token) + tokens = toks + return pygments.format(tokens, self.formatter) + + +class IPythonDemo(Demo): + """Class for interactive demos with IPython's input processing applied. + + This subclasses Demo, but instead of executing each block by the Python + interpreter (via exec), it actually calls IPython on it, so that any input + filters which may be in place are applied to the input block. + + If you have an interactive environment which exposes special input + processing, you can use this class instead to write demo scripts which + operate exactly as if you had typed them interactively. The default Demo + class requires the input to be valid, pure Python code. + """ + + def run_cell(self,source): + """Execute a string with one or more lines of code""" + + self.shell.run_cell(source) + +class LineDemo(Demo): + """Demo where each line is executed as a separate block. + + The input script should be valid Python code. + + This class doesn't require any markup at all, and it's meant for simple + scripts (with no nesting or any kind of indentation) which consist of + multiple lines of input to be executed, one at a time, as if they had been + typed in the interactive prompt. + + Note: the input can not have *any* indentation, which means that only + single-lines of input are accepted, not even function definitions are + valid.""" + + def reload(self): + """Reload source from disk and initialize state.""" + # read data and parse into blocks + self.fload() + lines = self.fobj.readlines() + src_b = [l for l in lines if l.strip()] + nblocks = len(src_b) + self.src = ''.join(lines) + self._silent = [False]*nblocks + self._auto = [True]*nblocks + self.auto_all = True + self.nblocks = nblocks + self.src_blocks = src_b + + # also build syntax-highlighted source + self.src_blocks_colored = list(map(self.highlight,self.src_blocks)) + + # ensure clean namespace and seek offset + self.reset() + + +class IPythonLineDemo(IPythonDemo,LineDemo): + """Variant of the LineDemo class whose input is processed by IPython.""" + pass + + +class ClearMixin(object): + """Use this mixin to make Demo classes with less visual clutter. + + Demos using this mixin will clear the screen before every block and use + blank marquees. + + Note that in order for the methods defined here to actually override those + of the classes it's mixed with, it must go /first/ in the inheritance + tree. For example: + + class ClearIPDemo(ClearMixin,IPythonDemo): pass + + will provide an IPythonDemo class with the mixin's features. + """ + + def marquee(self,txt='',width=78,mark='*'): + """Blank marquee that returns '' no matter what the input.""" + return '' + + def pre_cmd(self): + """Method called before executing each block. + + This one simply clears the screen.""" + from IPython.utils.terminal import _term_clear + _term_clear() + +class ClearDemo(ClearMixin,Demo): + pass + + +class ClearIPDemo(ClearMixin,IPythonDemo): + pass + + +def slide(file_path, noclear=False, format_rst=True, formatter="terminal", + style="native", auto_all=False, delimiter='...'): + if noclear: + demo_class = Demo + else: + demo_class = ClearDemo + demo = demo_class(file_path, format_rst=format_rst, formatter=formatter, + style=style, auto_all=auto_all) + while not demo.finished: + demo() + try: + py3compat.input('\n' + delimiter) + except KeyboardInterrupt: + exit(1) + +if __name__ == '__main__': + import argparse + parser = argparse.ArgumentParser(description='Run python demos') + parser.add_argument('--noclear', '-C', action='store_true', + help='Do not clear terminal on each slide') + parser.add_argument('--rst', '-r', action='store_true', + help='Highlight comments and dostrings as rst') + parser.add_argument('--formatter', '-f', default='terminal', + help='pygments formatter name could be: terminal, ' + 'terminal256, terminal16m') + parser.add_argument('--style', '-s', default='default', + help='pygments style name') + parser.add_argument('--auto', '-a', action='store_true', + help='Run all blocks automatically without' + 'confirmation') + parser.add_argument('--delimiter', '-d', default='...', + help='slides delimiter added after each slide run') + parser.add_argument('file', nargs=1, + help='python demo file') + args = parser.parse_args() + slide(args.file[0], noclear=args.noclear, format_rst=args.rst, + formatter=args.formatter, style=args.style, auto_all=args.auto, + delimiter=args.delimiter) diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/display.py b/.venv/lib/python3.8/site-packages/IPython/lib/display.py new file mode 100644 index 00000000..de31788a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/display.py @@ -0,0 +1,654 @@ +"""Various display related classes. + +Authors : MinRK, gregcaporaso, dannystaple +""" +from html import escape as html_escape +from os.path import exists, isfile, splitext, abspath, join, isdir +from os import walk, sep, fsdecode + +from IPython.core.display import DisplayObject, TextDisplayObject + +__all__ = ['Audio', 'IFrame', 'YouTubeVideo', 'VimeoVideo', 'ScribdDocument', + 'FileLink', 'FileLinks', 'Code'] + + +class Audio(DisplayObject): + """Create an audio object. + + When this object is returned by an input cell or passed to the + display function, it will result in Audio controls being displayed + in the frontend (only works in the notebook). + + Parameters + ---------- + data : numpy array, list, unicode, str or bytes + Can be one of + + * Numpy 1d array containing the desired waveform (mono) + * Numpy 2d array containing waveforms for each channel. + Shape=(NCHAN, NSAMPLES). For the standard channel order, see + http://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx + * List of float or integer representing the waveform (mono) + * String containing the filename + * Bytestring containing raw PCM data or + * URL pointing to a file on the web. + + If the array option is used, the waveform will be normalized. + + If a filename or url is used, the format support will be browser + dependent. + url : unicode + A URL to download the data from. + filename : unicode + Path to a local file to load the data from. + embed : boolean + Should the audio data be embedded using a data URI (True) or should + the original source be referenced. Set this to True if you want the + audio to playable later with no internet connection in the notebook. + + Default is `True`, unless the keyword argument `url` is set, then + default value is `False`. + rate : integer + The sampling rate of the raw data. + Only required when data parameter is being used as an array + autoplay : bool + Set to True if the audio should immediately start playing. + Default is `False`. + normalize : bool + Whether audio should be normalized (rescaled) to the maximum possible + range. Default is `True`. When set to `False`, `data` must be between + -1 and 1 (inclusive), otherwise an error is raised. + Applies only when `data` is a list or array of samples; other types of + audio are never normalized. + + Examples + -------- + :: + + # Generate a sound + import numpy as np + framerate = 44100 + t = np.linspace(0,5,framerate*5) + data = np.sin(2*np.pi*220*t) + np.sin(2*np.pi*224*t) + Audio(data,rate=framerate) + + # Can also do stereo or more channels + dataleft = np.sin(2*np.pi*220*t) + dataright = np.sin(2*np.pi*224*t) + Audio([dataleft, dataright],rate=framerate) + + Audio("http://www.nch.com.au/acm/8k16bitpcm.wav") # From URL + Audio(url="http://www.w3schools.com/html/horse.ogg") + + Audio('/path/to/sound.wav') # From file + Audio(filename='/path/to/sound.ogg') + + Audio(b'RAW_WAV_DATA..) # From bytes + Audio(data=b'RAW_WAV_DATA..) + + See Also + -------- + + See also the ``Audio`` widgets form the ``ipywidget`` package for more flexibility and options. + + """ + _read_flags = 'rb' + + def __init__(self, data=None, filename=None, url=None, embed=None, rate=None, autoplay=False, normalize=True, *, + element_id=None): + if filename is None and url is None and data is None: + raise ValueError("No audio data found. Expecting filename, url, or data.") + if embed is False and url is None: + raise ValueError("No url found. Expecting url when embed=False") + + if url is not None and embed is not True: + self.embed = False + else: + self.embed = True + self.autoplay = autoplay + self.element_id = element_id + super(Audio, self).__init__(data=data, url=url, filename=filename) + + if self.data is not None and not isinstance(self.data, bytes): + if rate is None: + raise ValueError("rate must be specified when data is a numpy array or list of audio samples.") + self.data = Audio._make_wav(data, rate, normalize) + + def reload(self): + """Reload the raw data from file or URL.""" + import mimetypes + if self.embed: + super(Audio, self).reload() + + if self.filename is not None: + self.mimetype = mimetypes.guess_type(self.filename)[0] + elif self.url is not None: + self.mimetype = mimetypes.guess_type(self.url)[0] + else: + self.mimetype = "audio/wav" + + @staticmethod + def _make_wav(data, rate, normalize): + """ Transform a numpy array to a PCM bytestring """ + from io import BytesIO + import wave + + try: + scaled, nchan = Audio._validate_and_normalize_with_numpy(data, normalize) + except ImportError: + scaled, nchan = Audio._validate_and_normalize_without_numpy(data, normalize) + + fp = BytesIO() + waveobj = wave.open(fp,mode='wb') + waveobj.setnchannels(nchan) + waveobj.setframerate(rate) + waveobj.setsampwidth(2) + waveobj.setcomptype('NONE','NONE') + waveobj.writeframes(scaled) + val = fp.getvalue() + waveobj.close() + + return val + + @staticmethod + def _validate_and_normalize_with_numpy(data, normalize): + import numpy as np + + data = np.array(data, dtype=float) + if len(data.shape) == 1: + nchan = 1 + elif len(data.shape) == 2: + # In wave files,channels are interleaved. E.g., + # "L1R1L2R2..." for stereo. See + # http://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx + # for channel ordering + nchan = data.shape[0] + data = data.T.ravel() + else: + raise ValueError('Array audio input must be a 1D or 2D array') + + max_abs_value = np.max(np.abs(data)) + normalization_factor = Audio._get_normalization_factor(max_abs_value, normalize) + scaled = data / normalization_factor * 32767 + return scaled.astype(' 1: + raise ValueError('Audio data must be between -1 and 1 when normalize=False.') + return max_abs_value if normalize else 1 + + def _data_and_metadata(self): + """shortcut for returning metadata with url information, if defined""" + md = {} + if self.url: + md['url'] = self.url + if md: + return self.data, md + else: + return self.data + + def _repr_html_(self): + src = """ + + """ + return src.format(src=self.src_attr(), type=self.mimetype, autoplay=self.autoplay_attr(), + element_id=self.element_id_attr()) + + def src_attr(self): + import base64 + if self.embed and (self.data is not None): + data = base64=base64.b64encode(self.data).decode('ascii') + return """data:{type};base64,{base64}""".format(type=self.mimetype, + base64=data) + elif self.url is not None: + return self.url + else: + return "" + + def autoplay_attr(self): + if(self.autoplay): + return 'autoplay="autoplay"' + else: + return '' + + def element_id_attr(self): + if (self.element_id): + return 'id="{element_id}"'.format(element_id=self.element_id) + else: + return '' + +class IFrame(object): + """ + Generic class to embed an iframe in an IPython notebook + """ + + iframe = """ + + """ + + def __init__(self, src, width, height, **kwargs): + self.src = src + self.width = width + self.height = height + self.params = kwargs + + def _repr_html_(self): + """return the embed iframe""" + if self.params: + try: + from urllib.parse import urlencode # Py 3 + except ImportError: + from urllib import urlencode + params = "?" + urlencode(self.params) + else: + params = "" + return self.iframe.format(src=self.src, + width=self.width, + height=self.height, + params=params) + +class YouTubeVideo(IFrame): + """Class for embedding a YouTube Video in an IPython session, based on its video id. + + e.g. to embed the video from https://www.youtube.com/watch?v=foo , you would + do:: + + vid = YouTubeVideo("foo") + display(vid) + + To start from 30 seconds:: + + vid = YouTubeVideo("abc", start=30) + display(vid) + + To calculate seconds from time as hours, minutes, seconds use + :class:`datetime.timedelta`:: + + start=int(timedelta(hours=1, minutes=46, seconds=40).total_seconds()) + + Other parameters can be provided as documented at + https://developers.google.com/youtube/player_parameters#Parameters + + When converting the notebook using nbconvert, a jpeg representation of the video + will be inserted in the document. + """ + + def __init__(self, id, width=400, height=300, **kwargs): + self.id=id + src = "https://www.youtube.com/embed/{0}".format(id) + super(YouTubeVideo, self).__init__(src, width, height, **kwargs) + + def _repr_jpeg_(self): + # Deferred import + from urllib.request import urlopen + + try: + return urlopen("https://img.youtube.com/vi/{id}/hqdefault.jpg".format(id=self.id)).read() + except IOError: + return None + +class VimeoVideo(IFrame): + """ + Class for embedding a Vimeo video in an IPython session, based on its video id. + """ + + def __init__(self, id, width=400, height=300, **kwargs): + src="https://player.vimeo.com/video/{0}".format(id) + super(VimeoVideo, self).__init__(src, width, height, **kwargs) + +class ScribdDocument(IFrame): + """ + Class for embedding a Scribd document in an IPython session + + Use the start_page params to specify a starting point in the document + Use the view_mode params to specify display type one off scroll | slideshow | book + + e.g to Display Wes' foundational paper about PANDAS in book mode from page 3 + + ScribdDocument(71048089, width=800, height=400, start_page=3, view_mode="book") + """ + + def __init__(self, id, width=400, height=300, **kwargs): + src="https://www.scribd.com/embeds/{0}/content".format(id) + super(ScribdDocument, self).__init__(src, width, height, **kwargs) + +class FileLink(object): + """Class for embedding a local file link in an IPython session, based on path + + e.g. to embed a link that was generated in the IPython notebook as my/data.txt + + you would do:: + + local_file = FileLink("my/data.txt") + display(local_file) + + or in the HTML notebook, just:: + + FileLink("my/data.txt") + """ + + html_link_str = "%s" + + def __init__(self, + path, + url_prefix='', + result_html_prefix='', + result_html_suffix='
'): + """ + Parameters + ---------- + path : str + path to the file or directory that should be formatted + url_prefix : str + prefix to be prepended to all files to form a working link [default: + ''] + result_html_prefix : str + text to append to beginning to link [default: ''] + result_html_suffix : str + text to append at the end of link [default: '
'] + """ + if isdir(path): + raise ValueError("Cannot display a directory using FileLink. " + "Use FileLinks to display '%s'." % path) + self.path = fsdecode(path) + self.url_prefix = url_prefix + self.result_html_prefix = result_html_prefix + self.result_html_suffix = result_html_suffix + + def _format_path(self): + fp = ''.join([self.url_prefix, html_escape(self.path)]) + return ''.join([self.result_html_prefix, + self.html_link_str % \ + (fp, html_escape(self.path, quote=False)), + self.result_html_suffix]) + + def _repr_html_(self): + """return html link to file + """ + if not exists(self.path): + return ("Path (%s) doesn't exist. " + "It may still be in the process of " + "being generated, or you may have the " + "incorrect path." % self.path) + + return self._format_path() + + def __repr__(self): + """return absolute path to file + """ + return abspath(self.path) + +class FileLinks(FileLink): + """Class for embedding local file links in an IPython session, based on path + + e.g. to embed links to files that were generated in the IPython notebook + under ``my/data``, you would do:: + + local_files = FileLinks("my/data") + display(local_files) + + or in the HTML notebook, just:: + + FileLinks("my/data") + """ + def __init__(self, + path, + url_prefix='', + included_suffixes=None, + result_html_prefix='', + result_html_suffix='
', + notebook_display_formatter=None, + terminal_display_formatter=None, + recursive=True): + """ + See :class:`FileLink` for the ``path``, ``url_prefix``, + ``result_html_prefix`` and ``result_html_suffix`` parameters. + + included_suffixes : list + Filename suffixes to include when formatting output [default: include + all files] + + notebook_display_formatter : function + Used to format links for display in the notebook. See discussion of + formatter functions below. + + terminal_display_formatter : function + Used to format links for display in the terminal. See discussion of + formatter functions below. + + Formatter functions must be of the form:: + + f(dirname, fnames, included_suffixes) + + dirname : str + The name of a directory + fnames : list + The files in that directory + included_suffixes : list + The file suffixes that should be included in the output (passing None + meansto include all suffixes in the output in the built-in formatters) + recursive : boolean + Whether to recurse into subdirectories. Default is True. + + The function should return a list of lines that will be printed in the + notebook (if passing notebook_display_formatter) or the terminal (if + passing terminal_display_formatter). This function is iterated over for + each directory in self.path. Default formatters are in place, can be + passed here to support alternative formatting. + + """ + if isfile(path): + raise ValueError("Cannot display a file using FileLinks. " + "Use FileLink to display '%s'." % path) + self.included_suffixes = included_suffixes + # remove trailing slashes for more consistent output formatting + path = path.rstrip('/') + + self.path = path + self.url_prefix = url_prefix + self.result_html_prefix = result_html_prefix + self.result_html_suffix = result_html_suffix + + self.notebook_display_formatter = \ + notebook_display_formatter or self._get_notebook_display_formatter() + self.terminal_display_formatter = \ + terminal_display_formatter or self._get_terminal_display_formatter() + + self.recursive = recursive + + def _get_display_formatter(self, + dirname_output_format, + fname_output_format, + fp_format, + fp_cleaner=None): + """ generate built-in formatter function + + this is used to define both the notebook and terminal built-in + formatters as they only differ by some wrapper text for each entry + + dirname_output_format: string to use for formatting directory + names, dirname will be substituted for a single "%s" which + must appear in this string + fname_output_format: string to use for formatting file names, + if a single "%s" appears in the string, fname will be substituted + if two "%s" appear in the string, the path to fname will be + substituted for the first and fname will be substituted for the + second + fp_format: string to use for formatting filepaths, must contain + exactly two "%s" and the dirname will be substituted for the first + and fname will be substituted for the second + """ + def f(dirname, fnames, included_suffixes=None): + result = [] + # begin by figuring out which filenames, if any, + # are going to be displayed + display_fnames = [] + for fname in fnames: + if (isfile(join(dirname,fname)) and + (included_suffixes is None or + splitext(fname)[1] in included_suffixes)): + display_fnames.append(fname) + + if len(display_fnames) == 0: + # if there are no filenames to display, don't print anything + # (not even the directory name) + pass + else: + # otherwise print the formatted directory name followed by + # the formatted filenames + dirname_output_line = dirname_output_format % dirname + result.append(dirname_output_line) + for fname in display_fnames: + fp = fp_format % (dirname,fname) + if fp_cleaner is not None: + fp = fp_cleaner(fp) + try: + # output can include both a filepath and a filename... + fname_output_line = fname_output_format % (fp, fname) + except TypeError: + # ... or just a single filepath + fname_output_line = fname_output_format % fname + result.append(fname_output_line) + return result + return f + + def _get_notebook_display_formatter(self, + spacer="  "): + """ generate function to use for notebook formatting + """ + dirname_output_format = \ + self.result_html_prefix + "%s/" + self.result_html_suffix + fname_output_format = \ + self.result_html_prefix + spacer + self.html_link_str + self.result_html_suffix + fp_format = self.url_prefix + '%s/%s' + if sep == "\\": + # Working on a platform where the path separator is "\", so + # must convert these to "/" for generating a URI + def fp_cleaner(fp): + # Replace all occurrences of backslash ("\") with a forward + # slash ("/") - this is necessary on windows when a path is + # provided as input, but we must link to a URI + return fp.replace('\\','/') + else: + fp_cleaner = None + + return self._get_display_formatter(dirname_output_format, + fname_output_format, + fp_format, + fp_cleaner) + + def _get_terminal_display_formatter(self, + spacer=" "): + """ generate function to use for terminal formatting + """ + dirname_output_format = "%s/" + fname_output_format = spacer + "%s" + fp_format = '%s/%s' + + return self._get_display_formatter(dirname_output_format, + fname_output_format, + fp_format) + + def _format_path(self): + result_lines = [] + if self.recursive: + walked_dir = list(walk(self.path)) + else: + walked_dir = [next(walk(self.path))] + walked_dir.sort() + for dirname, subdirs, fnames in walked_dir: + result_lines += self.notebook_display_formatter(dirname, fnames, self.included_suffixes) + return '\n'.join(result_lines) + + def __repr__(self): + """return newline-separated absolute paths + """ + result_lines = [] + if self.recursive: + walked_dir = list(walk(self.path)) + else: + walked_dir = [next(walk(self.path))] + walked_dir.sort() + for dirname, subdirs, fnames in walked_dir: + result_lines += self.terminal_display_formatter(dirname, fnames, self.included_suffixes) + return '\n'.join(result_lines) + + +class Code(TextDisplayObject): + """Display syntax-highlighted source code. + + This uses Pygments to highlight the code for HTML and Latex output. + + Parameters + ---------- + data : str + The code as a string + url : str + A URL to fetch the code from + filename : str + A local filename to load the code from + language : str + The short name of a Pygments lexer to use for highlighting. + If not specified, it will guess the lexer based on the filename + or the code. Available lexers: http://pygments.org/docs/lexers/ + """ + def __init__(self, data=None, url=None, filename=None, language=None): + self.language = language + super().__init__(data=data, url=url, filename=filename) + + def _get_lexer(self): + if self.language: + from pygments.lexers import get_lexer_by_name + return get_lexer_by_name(self.language) + elif self.filename: + from pygments.lexers import get_lexer_for_filename + return get_lexer_for_filename(self.filename) + else: + from pygments.lexers import guess_lexer + return guess_lexer(self.data) + + def __repr__(self): + return self.data + + def _repr_html_(self): + from pygments import highlight + from pygments.formatters import HtmlFormatter + fmt = HtmlFormatter() + style = ''.format(fmt.get_style_defs('.output_html')) + return style + highlight(self.data, self._get_lexer(), fmt) + + def _repr_latex_(self): + from pygments import highlight + from pygments.formatters import LatexFormatter + return highlight(self.data, self._get_lexer(), LatexFormatter()) diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/editorhooks.py b/.venv/lib/python3.8/site-packages/IPython/lib/editorhooks.py new file mode 100644 index 00000000..7ce0577a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/editorhooks.py @@ -0,0 +1,128 @@ +""" 'editor' hooks for common editors that work well with ipython + +They should honor the line number argument, at least. + +Contributions are *very* welcome. +""" + +import os +import pipes +import shlex +import subprocess +import sys + +from IPython import get_ipython +from IPython.core.error import TryNext +from IPython.utils import py3compat + + +def install_editor(template, wait=False): + """Installs the editor that is called by IPython for the %edit magic. + + This overrides the default editor, which is generally set by your EDITOR + environment variable or is notepad (windows) or vi (linux). By supplying a + template string `run_template`, you can control how the editor is invoked + by IPython -- (e.g. the format in which it accepts command line options) + + Parameters + ---------- + template : basestring + run_template acts as a template for how your editor is invoked by + the shell. It should contain '{filename}', which will be replaced on + invocation with the file name, and '{line}', $line by line number + (or 0) to invoke the file with. + wait : bool + If `wait` is true, wait until the user presses enter before returning, + to facilitate non-blocking editors that exit immediately after + the call. + """ + + # not all editors support $line, so we'll leave out this check + # for substitution in ['$file', '$line']: + # if not substitution in run_template: + # raise ValueError(('run_template should contain %s' + # ' for string substitution. You supplied "%s"' % (substitution, + # run_template))) + + def call_editor(self, filename, line=0): + if line is None: + line = 0 + cmd = template.format(filename=pipes.quote(filename), line=line) + print(">", cmd) + # pipes.quote doesn't work right on Windows, but it does after splitting + if sys.platform.startswith('win'): + cmd = shlex.split(cmd) + proc = subprocess.Popen(cmd, shell=True) + if proc.wait() != 0: + raise TryNext() + if wait: + py3compat.input("Press Enter when done editing:") + + get_ipython().set_hook('editor', call_editor) + get_ipython().editor = template + + +# in these, exe is always the path/name of the executable. Useful +# if you don't have the editor directory in your path +def komodo(exe=u'komodo'): + """ Activestate Komodo [Edit] """ + install_editor(exe + u' -l {line} {filename}', wait=True) + + +def scite(exe=u"scite"): + """ SciTE or Sc1 """ + install_editor(exe + u' {filename} -goto:{line}') + + +def notepadplusplus(exe=u'notepad++'): + """ Notepad++ http://notepad-plus.sourceforge.net """ + install_editor(exe + u' -n{line} {filename}') + + +def jed(exe=u'jed'): + """ JED, the lightweight emacsish editor """ + install_editor(exe + u' +{line} {filename}') + + +def idle(exe=u'idle'): + """ Idle, the editor bundled with python + + Parameters + ---------- + exe : str, None + If none, should be pretty smart about finding the executable. + """ + if exe is None: + import idlelib + p = os.path.dirname(idlelib.__filename__) + # i'm not sure if this actually works. Is this idle.py script + # guaranteed to be executable? + exe = os.path.join(p, 'idle.py') + install_editor(exe + u' {filename}') + + +def mate(exe=u'mate'): + """ TextMate, the missing editor""" + # wait=True is not required since we're using the -w flag to mate + install_editor(exe + u' -w -l {line} {filename}') + + +# ########################################## +# these are untested, report any problems +# ########################################## + + +def emacs(exe=u'emacs'): + install_editor(exe + u' +{line} {filename}') + + +def gnuclient(exe=u'gnuclient'): + install_editor(exe + u' -nw +{line} {filename}') + + +def crimson_editor(exe=u'cedt.exe'): + install_editor(exe + u' /L:{line} {filename}') + + +def kate(exe=u'kate'): + install_editor(exe + u' -u -l {line} {filename}') diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/guisupport.py b/.venv/lib/python3.8/site-packages/IPython/lib/guisupport.py new file mode 100644 index 00000000..cfd325e9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/guisupport.py @@ -0,0 +1,155 @@ +# coding: utf-8 +""" +Support for creating GUI apps and starting event loops. + +IPython's GUI integration allows interactive plotting and GUI usage in IPython +session. IPython has two different types of GUI integration: + +1. The terminal based IPython supports GUI event loops through Python's + PyOS_InputHook. PyOS_InputHook is a hook that Python calls periodically + whenever raw_input is waiting for a user to type code. We implement GUI + support in the terminal by setting PyOS_InputHook to a function that + iterates the event loop for a short while. It is important to note that + in this situation, the real GUI event loop is NOT run in the normal + manner, so you can't use the normal means to detect that it is running. +2. In the two process IPython kernel/frontend, the GUI event loop is run in + the kernel. In this case, the event loop is run in the normal manner by + calling the function or method of the GUI toolkit that starts the event + loop. + +In addition to starting the GUI event loops in one of these two ways, IPython +will *always* create an appropriate GUI application object when GUi +integration is enabled. + +If you want your GUI apps to run in IPython you need to do two things: + +1. Test to see if there is already an existing main application object. If + there is, you should use it. If there is not an existing application object + you should create one. +2. Test to see if the GUI event loop is running. If it is, you should not + start it. If the event loop is not running you may start it. + +This module contains functions for each toolkit that perform these things +in a consistent manner. Because of how PyOS_InputHook runs the event loop +you cannot detect if the event loop is running using the traditional calls +(such as ``wx.GetApp.IsMainLoopRunning()`` in wxPython). If PyOS_InputHook is +set These methods will return a false negative. That is, they will say the +event loop is not running, when is actually is. To work around this limitation +we proposed the following informal protocol: + +* Whenever someone starts the event loop, they *must* set the ``_in_event_loop`` + attribute of the main application object to ``True``. This should be done + regardless of how the event loop is actually run. +* Whenever someone stops the event loop, they *must* set the ``_in_event_loop`` + attribute of the main application object to ``False``. +* If you want to see if the event loop is running, you *must* use ``hasattr`` + to see if ``_in_event_loop`` attribute has been set. If it is set, you + *must* use its value. If it has not been set, you can query the toolkit + in the normal manner. +* If you want GUI support and no one else has created an application or + started the event loop you *must* do this. We don't want projects to + attempt to defer these things to someone else if they themselves need it. + +The functions below implement this logic for each GUI toolkit. If you need +to create custom application subclasses, you will likely have to modify this +code for your own purposes. This code can be copied into your own project +so you don't have to depend on IPython. + +""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +from IPython.core.getipython import get_ipython + +#----------------------------------------------------------------------------- +# wx +#----------------------------------------------------------------------------- + +def get_app_wx(*args, **kwargs): + """Create a new wx app or return an exiting one.""" + import wx + app = wx.GetApp() + if app is None: + if 'redirect' not in kwargs: + kwargs['redirect'] = False + app = wx.PySimpleApp(*args, **kwargs) + return app + +def is_event_loop_running_wx(app=None): + """Is the wx event loop running.""" + # New way: check attribute on shell instance + ip = get_ipython() + if ip is not None: + if ip.active_eventloop and ip.active_eventloop == 'wx': + return True + # Fall through to checking the application, because Wx has a native way + # to check if the event loop is running, unlike Qt. + + # Old way: check Wx application + if app is None: + app = get_app_wx() + if hasattr(app, '_in_event_loop'): + return app._in_event_loop + else: + return app.IsMainLoopRunning() + +def start_event_loop_wx(app=None): + """Start the wx event loop in a consistent manner.""" + if app is None: + app = get_app_wx() + if not is_event_loop_running_wx(app): + app._in_event_loop = True + app.MainLoop() + app._in_event_loop = False + else: + app._in_event_loop = True + +#----------------------------------------------------------------------------- +# qt4 +#----------------------------------------------------------------------------- + +def get_app_qt4(*args, **kwargs): + """Create a new qt4 app or return an existing one.""" + from IPython.external.qt_for_kernel import QtGui + app = QtGui.QApplication.instance() + if app is None: + if not args: + args = ([''],) + app = QtGui.QApplication(*args, **kwargs) + return app + +def is_event_loop_running_qt4(app=None): + """Is the qt4 event loop running.""" + # New way: check attribute on shell instance + ip = get_ipython() + if ip is not None: + return ip.active_eventloop and ip.active_eventloop.startswith('qt') + + # Old way: check attribute on QApplication singleton + if app is None: + app = get_app_qt4(['']) + if hasattr(app, '_in_event_loop'): + return app._in_event_loop + else: + # Does qt4 provide a other way to detect this? + return False + +def start_event_loop_qt4(app=None): + """Start the qt4 event loop in a consistent manner.""" + if app is None: + app = get_app_qt4(['']) + if not is_event_loop_running_qt4(app): + app._in_event_loop = True + app.exec_() + app._in_event_loop = False + else: + app._in_event_loop = True + +#----------------------------------------------------------------------------- +# Tk +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# gtk +#----------------------------------------------------------------------------- diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/inputhook.py b/.venv/lib/python3.8/site-packages/IPython/lib/inputhook.py new file mode 100644 index 00000000..e6e8f2db --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/inputhook.py @@ -0,0 +1,666 @@ +# coding: utf-8 +""" +Deprecated since IPython 5.0 + +Inputhook management for GUI event loop integration. +""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +try: + import ctypes +except ImportError: + ctypes = None +except SystemError: # IronPython issue, 2/8/2014 + ctypes = None +import os +import platform +import sys +from distutils.version import LooseVersion as V + +from warnings import warn + + +warn("`IPython.lib.inputhook` is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + + +#----------------------------------------------------------------------------- +# Constants +#----------------------------------------------------------------------------- + +# Constants for identifying the GUI toolkits. +GUI_WX = 'wx' +GUI_QT = 'qt' +GUI_QT4 = 'qt4' +GUI_GTK = 'gtk' +GUI_TK = 'tk' +GUI_OSX = 'osx' +GUI_GLUT = 'glut' +GUI_PYGLET = 'pyglet' +GUI_GTK3 = 'gtk3' +GUI_NONE = 'none' # i.e. disable + +#----------------------------------------------------------------------------- +# Utilities +#----------------------------------------------------------------------------- + +def _stdin_ready_posix(): + """Return True if there's something to read on stdin (posix version).""" + infds, outfds, erfds = select.select([sys.stdin],[],[],0) + return bool(infds) + +def _stdin_ready_nt(): + """Return True if there's something to read on stdin (nt version).""" + return msvcrt.kbhit() + +def _stdin_ready_other(): + """Return True, assuming there's something to read on stdin.""" + return True + +def _use_appnope(): + """Should we use appnope for dealing with OS X app nap? + + Checks if we are on OS X 10.9 or greater. + """ + return sys.platform == 'darwin' and V(platform.mac_ver()[0]) >= V('10.9') + +def _ignore_CTRL_C_posix(): + """Ignore CTRL+C (SIGINT).""" + signal.signal(signal.SIGINT, signal.SIG_IGN) + +def _allow_CTRL_C_posix(): + """Take CTRL+C into account (SIGINT).""" + signal.signal(signal.SIGINT, signal.default_int_handler) + +def _ignore_CTRL_C_other(): + """Ignore CTRL+C (not implemented).""" + pass + +def _allow_CTRL_C_other(): + """Take CTRL+C into account (not implemented).""" + pass + +if os.name == 'posix': + import select + import signal + stdin_ready = _stdin_ready_posix + ignore_CTRL_C = _ignore_CTRL_C_posix + allow_CTRL_C = _allow_CTRL_C_posix +elif os.name == 'nt': + import msvcrt + stdin_ready = _stdin_ready_nt + ignore_CTRL_C = _ignore_CTRL_C_other + allow_CTRL_C = _allow_CTRL_C_other +else: + stdin_ready = _stdin_ready_other + ignore_CTRL_C = _ignore_CTRL_C_other + allow_CTRL_C = _allow_CTRL_C_other + + +#----------------------------------------------------------------------------- +# Main InputHookManager class +#----------------------------------------------------------------------------- + + +class InputHookManager(object): + """DEPRECATED since IPython 5.0 + + Manage PyOS_InputHook for different GUI toolkits. + + This class installs various hooks under ``PyOSInputHook`` to handle + GUI event loop integration. + """ + + def __init__(self): + if ctypes is None: + warn("IPython GUI event loop requires ctypes, %gui will not be available") + else: + self.PYFUNC = ctypes.PYFUNCTYPE(ctypes.c_int) + self.guihooks = {} + self.aliases = {} + self.apps = {} + self._reset() + + def _reset(self): + self._callback_pyfunctype = None + self._callback = None + self._installed = False + self._current_gui = None + + def get_pyos_inputhook(self): + """DEPRECATED since IPython 5.0 + + Return the current PyOS_InputHook as a ctypes.c_void_p.""" + warn("`get_pyos_inputhook` is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + return ctypes.c_void_p.in_dll(ctypes.pythonapi,"PyOS_InputHook") + + def get_pyos_inputhook_as_func(self): + """DEPRECATED since IPython 5.0 + + Return the current PyOS_InputHook as a ctypes.PYFUNCYPE.""" + warn("`get_pyos_inputhook_as_func` is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + return self.PYFUNC.in_dll(ctypes.pythonapi,"PyOS_InputHook") + + def set_inputhook(self, callback): + """DEPRECATED since IPython 5.0 + + Set PyOS_InputHook to callback and return the previous one.""" + # On platforms with 'readline' support, it's all too likely to + # have a KeyboardInterrupt signal delivered *even before* an + # initial ``try:`` clause in the callback can be executed, so + # we need to disable CTRL+C in this situation. + ignore_CTRL_C() + self._callback = callback + self._callback_pyfunctype = self.PYFUNC(callback) + pyos_inputhook_ptr = self.get_pyos_inputhook() + original = self.get_pyos_inputhook_as_func() + pyos_inputhook_ptr.value = \ + ctypes.cast(self._callback_pyfunctype, ctypes.c_void_p).value + self._installed = True + return original + + def clear_inputhook(self, app=None): + """DEPRECATED since IPython 5.0 + + Set PyOS_InputHook to NULL and return the previous one. + + Parameters + ---------- + app : optional, ignored + This parameter is allowed only so that clear_inputhook() can be + called with a similar interface as all the ``enable_*`` methods. But + the actual value of the parameter is ignored. This uniform interface + makes it easier to have user-level entry points in the main IPython + app like :meth:`enable_gui`.""" + warn("`clear_inputhook` is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + pyos_inputhook_ptr = self.get_pyos_inputhook() + original = self.get_pyos_inputhook_as_func() + pyos_inputhook_ptr.value = ctypes.c_void_p(None).value + allow_CTRL_C() + self._reset() + return original + + def clear_app_refs(self, gui=None): + """DEPRECATED since IPython 5.0 + + Clear IPython's internal reference to an application instance. + + Whenever we create an app for a user on qt4 or wx, we hold a + reference to the app. This is needed because in some cases bad things + can happen if a user doesn't hold a reference themselves. This + method is provided to clear the references we are holding. + + Parameters + ---------- + gui : None or str + If None, clear all app references. If ('wx', 'qt4') clear + the app for that toolkit. References are not held for gtk or tk + as those toolkits don't have the notion of an app. + """ + warn("`clear_app_refs` is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + if gui is None: + self.apps = {} + elif gui in self.apps: + del self.apps[gui] + + def register(self, toolkitname, *aliases): + """DEPRECATED since IPython 5.0 + + Register a class to provide the event loop for a given GUI. + + This is intended to be used as a class decorator. It should be passed + the names with which to register this GUI integration. The classes + themselves should subclass :class:`InputHookBase`. + + :: + + @inputhook_manager.register('qt') + class QtInputHook(InputHookBase): + def enable(self, app=None): + ... + """ + warn("`register` is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + def decorator(cls): + if ctypes is not None: + inst = cls(self) + self.guihooks[toolkitname] = inst + for a in aliases: + self.aliases[a] = toolkitname + return cls + return decorator + + def current_gui(self): + """DEPRECATED since IPython 5.0 + + Return a string indicating the currently active GUI or None.""" + warn("`current_gui` is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + return self._current_gui + + def enable_gui(self, gui=None, app=None): + """DEPRECATED since IPython 5.0 + + Switch amongst GUI input hooks by name. + + This is a higher level method than :meth:`set_inputhook` - it uses the + GUI name to look up a registered object which enables the input hook + for that GUI. + + Parameters + ---------- + gui : optional, string or None + If None (or 'none'), clears input hook, otherwise it must be one + of the recognized GUI names (see ``GUI_*`` constants in module). + + app : optional, existing application object. + For toolkits that have the concept of a global app, you can supply an + existing one. If not given, the toolkit will be probed for one, and if + none is found, a new one will be created. Note that GTK does not have + this concept, and passing an app if ``gui=="GTK"`` will raise an error. + + Returns + ------- + The output of the underlying gui switch routine, typically the actual + PyOS_InputHook wrapper object or the GUI toolkit app created, if there was + one. + """ + warn("`enable_gui` is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + if gui in (None, GUI_NONE): + return self.disable_gui() + + if gui in self.aliases: + return self.enable_gui(self.aliases[gui], app) + + try: + gui_hook = self.guihooks[gui] + except KeyError: + e = "Invalid GUI request {!r}, valid ones are: {}" + raise ValueError(e.format(gui, ', '.join(self.guihooks))) + self._current_gui = gui + + app = gui_hook.enable(app) + if app is not None: + app._in_event_loop = True + self.apps[gui] = app + return app + + def disable_gui(self): + """DEPRECATED since IPython 5.0 + + Disable GUI event loop integration. + + If an application was registered, this sets its ``_in_event_loop`` + attribute to False. It then calls :meth:`clear_inputhook`. + """ + warn("`disable_gui` is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + gui = self._current_gui + if gui in self.apps: + self.apps[gui]._in_event_loop = False + return self.clear_inputhook() + +class InputHookBase(object): + """DEPRECATED since IPython 5.0 + + Base class for input hooks for specific toolkits. + + Subclasses should define an :meth:`enable` method with one argument, ``app``, + which will either be an instance of the toolkit's application class, or None. + They may also define a :meth:`disable` method with no arguments. + """ + def __init__(self, manager): + self.manager = manager + + def disable(self): + pass + +inputhook_manager = InputHookManager() + +@inputhook_manager.register('osx') +class NullInputHook(InputHookBase): + """DEPRECATED since IPython 5.0 + + A null inputhook that doesn't need to do anything""" + def enable(self, app=None): + warn("This function is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + +@inputhook_manager.register('wx') +class WxInputHook(InputHookBase): + def enable(self, app=None): + """DEPRECATED since IPython 5.0 + + Enable event loop integration with wxPython. + + Parameters + ---------- + app : WX Application, optional. + Running application to use. If not given, we probe WX for an + existing application object, and create a new one if none is found. + + Notes + ----- + This methods sets the ``PyOS_InputHook`` for wxPython, which allows + the wxPython to integrate with terminal based applications like + IPython. + + If ``app`` is not given we probe for an existing one, and return it if + found. If no existing app is found, we create an :class:`wx.App` as + follows:: + + import wx + app = wx.App(redirect=False, clearSigInt=False) + """ + warn("This function is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + import wx + + wx_version = V(wx.__version__).version + + if wx_version < [2, 8]: + raise ValueError("requires wxPython >= 2.8, but you have %s" % wx.__version__) + + from IPython.lib.inputhookwx import inputhook_wx + self.manager.set_inputhook(inputhook_wx) + if _use_appnope(): + from appnope import nope + nope() + + import wx + if app is None: + app = wx.GetApp() + if app is None: + app = wx.App(redirect=False, clearSigInt=False) + + return app + + def disable(self): + """DEPRECATED since IPython 5.0 + + Disable event loop integration with wxPython. + + This restores appnapp on OS X + """ + warn("This function is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + if _use_appnope(): + from appnope import nap + nap() + +@inputhook_manager.register('qt', 'qt4') +class Qt4InputHook(InputHookBase): + def enable(self, app=None): + """DEPRECATED since IPython 5.0 + + Enable event loop integration with PyQt4. + + Parameters + ---------- + app : Qt Application, optional. + Running application to use. If not given, we probe Qt for an + existing application object, and create a new one if none is found. + + Notes + ----- + This methods sets the PyOS_InputHook for PyQt4, which allows + the PyQt4 to integrate with terminal based applications like + IPython. + + If ``app`` is not given we probe for an existing one, and return it if + found. If no existing app is found, we create an :class:`QApplication` + as follows:: + + from PyQt4 import QtCore + app = QtGui.QApplication(sys.argv) + """ + warn("This function is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + from IPython.lib.inputhookqt4 import create_inputhook_qt4 + app, inputhook_qt4 = create_inputhook_qt4(self.manager, app) + self.manager.set_inputhook(inputhook_qt4) + if _use_appnope(): + from appnope import nope + nope() + + return app + + def disable_qt4(self): + """DEPRECATED since IPython 5.0 + + Disable event loop integration with PyQt4. + + This restores appnapp on OS X + """ + warn("This function is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + if _use_appnope(): + from appnope import nap + nap() + + +@inputhook_manager.register('qt5') +class Qt5InputHook(Qt4InputHook): + def enable(self, app=None): + warn("This function is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + os.environ['QT_API'] = 'pyqt5' + return Qt4InputHook.enable(self, app) + + +@inputhook_manager.register('gtk') +class GtkInputHook(InputHookBase): + def enable(self, app=None): + """DEPRECATED since IPython 5.0 + + Enable event loop integration with PyGTK. + + Parameters + ---------- + app : ignored + Ignored, it's only a placeholder to keep the call signature of all + gui activation methods consistent, which simplifies the logic of + supporting magics. + + Notes + ----- + This methods sets the PyOS_InputHook for PyGTK, which allows + the PyGTK to integrate with terminal based applications like + IPython. + """ + warn("This function is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + import gtk + try: + gtk.set_interactive(True) + except AttributeError: + # For older versions of gtk, use our own ctypes version + from IPython.lib.inputhookgtk import inputhook_gtk + self.manager.set_inputhook(inputhook_gtk) + + +@inputhook_manager.register('tk') +class TkInputHook(InputHookBase): + def enable(self, app=None): + """DEPRECATED since IPython 5.0 + + Enable event loop integration with Tk. + + Parameters + ---------- + app : toplevel :class:`Tkinter.Tk` widget, optional. + Running toplevel widget to use. If not given, we probe Tk for an + existing one, and create a new one if none is found. + + Notes + ----- + If you have already created a :class:`Tkinter.Tk` object, the only + thing done by this method is to register with the + :class:`InputHookManager`, since creating that object automatically + sets ``PyOS_InputHook``. + """ + warn("This function is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + if app is None: + try: + from tkinter import Tk # Py 3 + except ImportError: + from Tkinter import Tk # Py 2 + app = Tk() + app.withdraw() + self.manager.apps[GUI_TK] = app + return app + + +@inputhook_manager.register('glut') +class GlutInputHook(InputHookBase): + def enable(self, app=None): + """DEPRECATED since IPython 5.0 + + Enable event loop integration with GLUT. + + Parameters + ---------- + + app : ignored + Ignored, it's only a placeholder to keep the call signature of all + gui activation methods consistent, which simplifies the logic of + supporting magics. + + Notes + ----- + + This methods sets the PyOS_InputHook for GLUT, which allows the GLUT to + integrate with terminal based applications like IPython. Due to GLUT + limitations, it is currently not possible to start the event loop + without first creating a window. You should thus not create another + window but use instead the created one. See 'gui-glut.py' in the + docs/examples/lib directory. + + The default screen mode is set to: + glut.GLUT_DOUBLE | glut.GLUT_RGBA | glut.GLUT_DEPTH + """ + warn("This function is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + + import OpenGL.GLUT as glut + from IPython.lib.inputhookglut import glut_display_mode, \ + glut_close, glut_display, \ + glut_idle, inputhook_glut + + if GUI_GLUT not in self.manager.apps: + glut.glutInit( sys.argv ) + glut.glutInitDisplayMode( glut_display_mode ) + # This is specific to freeglut + if bool(glut.glutSetOption): + glut.glutSetOption( glut.GLUT_ACTION_ON_WINDOW_CLOSE, + glut.GLUT_ACTION_GLUTMAINLOOP_RETURNS ) + glut.glutCreateWindow( sys.argv[0] ) + glut.glutReshapeWindow( 1, 1 ) + glut.glutHideWindow( ) + glut.glutWMCloseFunc( glut_close ) + glut.glutDisplayFunc( glut_display ) + glut.glutIdleFunc( glut_idle ) + else: + glut.glutWMCloseFunc( glut_close ) + glut.glutDisplayFunc( glut_display ) + glut.glutIdleFunc( glut_idle) + self.manager.set_inputhook( inputhook_glut ) + + + def disable(self): + """DEPRECATED since IPython 5.0 + + Disable event loop integration with glut. + + This sets PyOS_InputHook to NULL and set the display function to a + dummy one and set the timer to a dummy timer that will be triggered + very far in the future. + """ + warn("This function is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + import OpenGL.GLUT as glut + from glut_support import glutMainLoopEvent + + glut.glutHideWindow() # This is an event to be processed below + glutMainLoopEvent() + super(GlutInputHook, self).disable() + +@inputhook_manager.register('pyglet') +class PygletInputHook(InputHookBase): + def enable(self, app=None): + """DEPRECATED since IPython 5.0 + + Enable event loop integration with pyglet. + + Parameters + ---------- + app : ignored + Ignored, it's only a placeholder to keep the call signature of all + gui activation methods consistent, which simplifies the logic of + supporting magics. + + Notes + ----- + This methods sets the ``PyOS_InputHook`` for pyglet, which allows + pyglet to integrate with terminal based applications like + IPython. + + """ + warn("This function is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + from IPython.lib.inputhookpyglet import inputhook_pyglet + self.manager.set_inputhook(inputhook_pyglet) + return app + + +@inputhook_manager.register('gtk3') +class Gtk3InputHook(InputHookBase): + def enable(self, app=None): + """DEPRECATED since IPython 5.0 + + Enable event loop integration with Gtk3 (gir bindings). + + Parameters + ---------- + app : ignored + Ignored, it's only a placeholder to keep the call signature of all + gui activation methods consistent, which simplifies the logic of + supporting magics. + + Notes + ----- + This methods sets the PyOS_InputHook for Gtk3, which allows + the Gtk3 to integrate with terminal based applications like + IPython. + """ + warn("This function is deprecated since IPython 5.0 and will be removed in future versions.", + DeprecationWarning, stacklevel=2) + from IPython.lib.inputhookgtk3 import inputhook_gtk3 + self.manager.set_inputhook(inputhook_gtk3) + + +clear_inputhook = inputhook_manager.clear_inputhook +set_inputhook = inputhook_manager.set_inputhook +current_gui = inputhook_manager.current_gui +clear_app_refs = inputhook_manager.clear_app_refs +enable_gui = inputhook_manager.enable_gui +disable_gui = inputhook_manager.disable_gui +register = inputhook_manager.register +guis = inputhook_manager.guihooks + + +def _deprecated_disable(): + warn("This function is deprecated since IPython 4.0 use disable_gui() instead", + DeprecationWarning, stacklevel=2) + inputhook_manager.disable_gui() + +disable_wx = disable_qt4 = disable_gtk = disable_gtk3 = disable_glut = \ + disable_pyglet = disable_osx = _deprecated_disable diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/inputhookglut.py b/.venv/lib/python3.8/site-packages/IPython/lib/inputhookglut.py new file mode 100644 index 00000000..e6f7f125 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/inputhookglut.py @@ -0,0 +1,172 @@ +# coding: utf-8 +""" +GLUT Inputhook support functions +""" + +#----------------------------------------------------------------------------- +# Copyright (C) 2008-2011 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +# GLUT is quite an old library and it is difficult to ensure proper +# integration within IPython since original GLUT does not allow to handle +# events one by one. Instead, it requires for the mainloop to be entered +# and never returned (there is not even a function to exit he +# mainloop). Fortunately, there are alternatives such as freeglut +# (available for linux and windows) and the OSX implementation gives +# access to a glutCheckLoop() function that blocks itself until a new +# event is received. This means we have to setup the idle callback to +# ensure we got at least one event that will unblock the function. +# +# Furthermore, it is not possible to install these handlers without a window +# being first created. We choose to make this window invisible. This means that +# display mode options are set at this level and user won't be able to change +# them later without modifying the code. This should probably be made available +# via IPython options system. + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- +import os +import sys +import time +import signal +import OpenGL.GLUT as glut +import OpenGL.platform as platform +from timeit import default_timer as clock + +#----------------------------------------------------------------------------- +# Constants +#----------------------------------------------------------------------------- + +# Frame per second : 60 +# Should probably be an IPython option +glut_fps = 60 + + +# Display mode : double buffeed + rgba + depth +# Should probably be an IPython option +glut_display_mode = (glut.GLUT_DOUBLE | + glut.GLUT_RGBA | + glut.GLUT_DEPTH) + +glutMainLoopEvent = None +if sys.platform == 'darwin': + try: + glutCheckLoop = platform.createBaseFunction( + 'glutCheckLoop', dll=platform.GLUT, resultType=None, + argTypes=[], + doc='glutCheckLoop( ) -> None', + argNames=(), + ) + except AttributeError: + raise RuntimeError( + '''Your glut implementation does not allow interactive sessions''' + '''Consider installing freeglut.''') + glutMainLoopEvent = glutCheckLoop +elif glut.HAVE_FREEGLUT: + glutMainLoopEvent = glut.glutMainLoopEvent +else: + raise RuntimeError( + '''Your glut implementation does not allow interactive sessions. ''' + '''Consider installing freeglut.''') + + +#----------------------------------------------------------------------------- +# Platform-dependent imports and functions +#----------------------------------------------------------------------------- + +if os.name == 'posix': + import select + + def stdin_ready(): + infds, outfds, erfds = select.select([sys.stdin],[],[],0) + if infds: + return True + else: + return False + +elif sys.platform == 'win32': + import msvcrt + + def stdin_ready(): + return msvcrt.kbhit() + +#----------------------------------------------------------------------------- +# Callback functions +#----------------------------------------------------------------------------- + +def glut_display(): + # Dummy display function + pass + +def glut_idle(): + # Dummy idle function + pass + +def glut_close(): + # Close function only hides the current window + glut.glutHideWindow() + glutMainLoopEvent() + +def glut_int_handler(signum, frame): + # Catch sigint and print the default message + signal.signal(signal.SIGINT, signal.default_int_handler) + print('\nKeyboardInterrupt') + # Need to reprint the prompt at this stage + + + +#----------------------------------------------------------------------------- +# Code +#----------------------------------------------------------------------------- +def inputhook_glut(): + """Run the pyglet event loop by processing pending events only. + + This keeps processing pending events until stdin is ready. After + processing all pending events, a call to time.sleep is inserted. This is + needed, otherwise, CPU usage is at 100%. This sleep time should be tuned + though for best performance. + """ + # We need to protect against a user pressing Control-C when IPython is + # idle and this is running. We trap KeyboardInterrupt and pass. + + signal.signal(signal.SIGINT, glut_int_handler) + + try: + t = clock() + + # Make sure the default window is set after a window has been closed + if glut.glutGetWindow() == 0: + glut.glutSetWindow( 1 ) + glutMainLoopEvent() + return 0 + + while not stdin_ready(): + glutMainLoopEvent() + # We need to sleep at this point to keep the idle CPU load + # low. However, if sleep to long, GUI response is poor. As + # a compromise, we watch how often GUI events are being processed + # and switch between a short and long sleep time. Here are some + # stats useful in helping to tune this. + # time CPU load + # 0.001 13% + # 0.005 3% + # 0.01 1.5% + # 0.05 0.5% + used_time = clock() - t + if used_time > 10.0: + # print 'Sleep for 1 s' # dbg + time.sleep(1.0) + elif used_time > 0.1: + # Few GUI events coming in, so we can sleep longer + # print 'Sleep for 0.05 s' # dbg + time.sleep(0.05) + else: + # Many GUI events coming in, so sleep only very little + time.sleep(0.001) + except KeyboardInterrupt: + pass + return 0 diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/inputhookgtk.py b/.venv/lib/python3.8/site-packages/IPython/lib/inputhookgtk.py new file mode 100644 index 00000000..98569f54 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/inputhookgtk.py @@ -0,0 +1,35 @@ +# encoding: utf-8 +""" +Enable pygtk to be used interactively by setting PyOS_InputHook. + +Authors: Brian Granger +""" + +#----------------------------------------------------------------------------- +# Copyright (C) 2008-2011 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +import sys +import gtk, gobject + +#----------------------------------------------------------------------------- +# Code +#----------------------------------------------------------------------------- + + +def _main_quit(*args, **kwargs): + gtk.main_quit() + return False + +def inputhook_gtk(): + gobject.io_add_watch(sys.stdin, gobject.IO_IN, _main_quit) + gtk.main() + return 0 + diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/inputhookgtk3.py b/.venv/lib/python3.8/site-packages/IPython/lib/inputhookgtk3.py new file mode 100644 index 00000000..b797e862 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/inputhookgtk3.py @@ -0,0 +1,34 @@ +# encoding: utf-8 +""" +Enable Gtk3 to be used interactively by IPython. + +Authors: Thomi Richards +""" +#----------------------------------------------------------------------------- +# Copyright (c) 2012, the IPython Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +import sys +from gi.repository import Gtk, GLib + +#----------------------------------------------------------------------------- +# Code +#----------------------------------------------------------------------------- + +def _main_quit(*args, **kwargs): + Gtk.main_quit() + return False + + +def inputhook_gtk3(): + GLib.io_add_watch(sys.stdin, GLib.PRIORITY_DEFAULT, GLib.IO_IN, _main_quit) + Gtk.main() + return 0 diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/inputhookpyglet.py b/.venv/lib/python3.8/site-packages/IPython/lib/inputhookpyglet.py new file mode 100644 index 00000000..fb91ffed --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/inputhookpyglet.py @@ -0,0 +1,111 @@ +# encoding: utf-8 +""" +Enable pyglet to be used interactively by setting PyOS_InputHook. + +Authors +------- + +* Nicolas P. Rougier +* Fernando Perez +""" + +#----------------------------------------------------------------------------- +# Copyright (C) 2008-2011 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +import os +import sys +import time +from timeit import default_timer as clock +import pyglet + +#----------------------------------------------------------------------------- +# Platform-dependent imports and functions +#----------------------------------------------------------------------------- + +if os.name == 'posix': + import select + + def stdin_ready(): + infds, outfds, erfds = select.select([sys.stdin],[],[],0) + if infds: + return True + else: + return False + +elif sys.platform == 'win32': + import msvcrt + + def stdin_ready(): + return msvcrt.kbhit() + + +# On linux only, window.flip() has a bug that causes an AttributeError on +# window close. For details, see: +# http://groups.google.com/group/pyglet-users/browse_thread/thread/47c1aab9aa4a3d23/c22f9e819826799e?#c22f9e819826799e + +if sys.platform.startswith('linux'): + def flip(window): + try: + window.flip() + except AttributeError: + pass +else: + def flip(window): + window.flip() + +#----------------------------------------------------------------------------- +# Code +#----------------------------------------------------------------------------- + +def inputhook_pyglet(): + """Run the pyglet event loop by processing pending events only. + + This keeps processing pending events until stdin is ready. After + processing all pending events, a call to time.sleep is inserted. This is + needed, otherwise, CPU usage is at 100%. This sleep time should be tuned + though for best performance. + """ + # We need to protect against a user pressing Control-C when IPython is + # idle and this is running. We trap KeyboardInterrupt and pass. + try: + t = clock() + while not stdin_ready(): + pyglet.clock.tick() + for window in pyglet.app.windows: + window.switch_to() + window.dispatch_events() + window.dispatch_event('on_draw') + flip(window) + + # We need to sleep at this point to keep the idle CPU load + # low. However, if sleep to long, GUI response is poor. As + # a compromise, we watch how often GUI events are being processed + # and switch between a short and long sleep time. Here are some + # stats useful in helping to tune this. + # time CPU load + # 0.001 13% + # 0.005 3% + # 0.01 1.5% + # 0.05 0.5% + used_time = clock() - t + if used_time > 10.0: + # print 'Sleep for 1 s' # dbg + time.sleep(1.0) + elif used_time > 0.1: + # Few GUI events coming in, so we can sleep longer + # print 'Sleep for 0.05 s' # dbg + time.sleep(0.05) + else: + # Many GUI events coming in, so sleep only very little + time.sleep(0.001) + except KeyboardInterrupt: + pass + return 0 diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/inputhookqt4.py b/.venv/lib/python3.8/site-packages/IPython/lib/inputhookqt4.py new file mode 100644 index 00000000..8a83902f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/inputhookqt4.py @@ -0,0 +1,180 @@ +# -*- coding: utf-8 -*- +""" +Qt4's inputhook support function + +Author: Christian Boos +""" + +#----------------------------------------------------------------------------- +# Copyright (C) 2011 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +import os +import signal +import threading + +from IPython.core.interactiveshell import InteractiveShell +from IPython.external.qt_for_kernel import QtCore, QtGui +from IPython.lib.inputhook import allow_CTRL_C, ignore_CTRL_C, stdin_ready + +#----------------------------------------------------------------------------- +# Module Globals +#----------------------------------------------------------------------------- + +got_kbdint = False +sigint_timer = None + +#----------------------------------------------------------------------------- +# Code +#----------------------------------------------------------------------------- + +def create_inputhook_qt4(mgr, app=None): + """Create an input hook for running the Qt4 application event loop. + + Parameters + ---------- + mgr : an InputHookManager + + app : Qt Application, optional. + Running application to use. If not given, we probe Qt for an + existing application object, and create a new one if none is found. + + Returns + ------- + A pair consisting of a Qt Application (either the one given or the + one found or created) and a inputhook. + + Notes + ----- + We use a custom input hook instead of PyQt4's default one, as it + interacts better with the readline packages (issue #481). + + The inputhook function works in tandem with a 'pre_prompt_hook' + which automatically restores the hook as an inputhook in case the + latter has been temporarily disabled after having intercepted a + KeyboardInterrupt. + """ + + if app is None: + app = QtCore.QCoreApplication.instance() + if app is None: + app = QtGui.QApplication([" "]) + + # Re-use previously created inputhook if any + ip = InteractiveShell.instance() + if hasattr(ip, '_inputhook_qt4'): + return app, ip._inputhook_qt4 + + # Otherwise create the inputhook_qt4/preprompthook_qt4 pair of + # hooks (they both share the got_kbdint flag) + + def inputhook_qt4(): + """PyOS_InputHook python hook for Qt4. + + Process pending Qt events and if there's no pending keyboard + input, spend a short slice of time (50ms) running the Qt event + loop. + + As a Python ctypes callback can't raise an exception, we catch + the KeyboardInterrupt and temporarily deactivate the hook, + which will let a *second* CTRL+C be processed normally and go + back to a clean prompt line. + """ + try: + allow_CTRL_C() + app = QtCore.QCoreApplication.instance() + if not app: # shouldn't happen, but safer if it happens anyway... + return 0 + app.processEvents(QtCore.QEventLoop.AllEvents, 300) + if not stdin_ready(): + # Generally a program would run QCoreApplication::exec() + # from main() to enter and process the Qt event loop until + # quit() or exit() is called and the program terminates. + # + # For our input hook integration, we need to repeatedly + # enter and process the Qt event loop for only a short + # amount of time (say 50ms) to ensure that Python stays + # responsive to other user inputs. + # + # A naive approach would be to repeatedly call + # QCoreApplication::exec(), using a timer to quit after a + # short amount of time. Unfortunately, QCoreApplication + # emits an aboutToQuit signal before stopping, which has + # the undesirable effect of closing all modal windows. + # + # To work around this problem, we instead create a + # QEventLoop and call QEventLoop::exec(). Other than + # setting some state variables which do not seem to be + # used anywhere, the only thing QCoreApplication adds is + # the aboutToQuit signal which is precisely what we are + # trying to avoid. + timer = QtCore.QTimer() + event_loop = QtCore.QEventLoop() + timer.timeout.connect(event_loop.quit) + while not stdin_ready(): + timer.start(50) + event_loop.exec_() + timer.stop() + except KeyboardInterrupt: + global got_kbdint, sigint_timer + + ignore_CTRL_C() + got_kbdint = True + mgr.clear_inputhook() + + # This generates a second SIGINT so the user doesn't have to + # press CTRL+C twice to get a clean prompt. + # + # Since we can't catch the resulting KeyboardInterrupt here + # (because this is a ctypes callback), we use a timer to + # generate the SIGINT after we leave this callback. + # + # Unfortunately this doesn't work on Windows (SIGINT kills + # Python and CTRL_C_EVENT doesn't work). + if(os.name == 'posix'): + pid = os.getpid() + if(not sigint_timer): + sigint_timer = threading.Timer(.01, os.kill, + args=[pid, signal.SIGINT] ) + sigint_timer.start() + else: + print("\nKeyboardInterrupt - Ctrl-C again for new prompt") + + + except: # NO exceptions are allowed to escape from a ctypes callback + ignore_CTRL_C() + from traceback import print_exc + print_exc() + print("Got exception from inputhook_qt4, unregistering.") + mgr.clear_inputhook() + finally: + allow_CTRL_C() + return 0 + + def preprompthook_qt4(ishell): + """'pre_prompt_hook' used to restore the Qt4 input hook + + (in case the latter was temporarily deactivated after a + CTRL+C) + """ + global got_kbdint, sigint_timer + + if(sigint_timer): + sigint_timer.cancel() + sigint_timer = None + + if got_kbdint: + mgr.set_inputhook(inputhook_qt4) + got_kbdint = False + + ip._inputhook_qt4 = inputhook_qt4 + ip.set_hook('pre_prompt_hook', preprompthook_qt4) + + return app, inputhook_qt4 diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/inputhookwx.py b/.venv/lib/python3.8/site-packages/IPython/lib/inputhookwx.py new file mode 100644 index 00000000..60520a29 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/inputhookwx.py @@ -0,0 +1,167 @@ +# encoding: utf-8 + +""" +Enable wxPython to be used interactively by setting PyOS_InputHook. + +Authors: Robin Dunn, Brian Granger, Ondrej Certik +""" + +#----------------------------------------------------------------------------- +# Copyright (C) 2008-2011 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +import sys +import signal +import time +from timeit import default_timer as clock +import wx + +from IPython.lib.inputhook import stdin_ready + + +#----------------------------------------------------------------------------- +# Code +#----------------------------------------------------------------------------- + +def inputhook_wx1(): + """Run the wx event loop by processing pending events only. + + This approach seems to work, but its performance is not great as it + relies on having PyOS_InputHook called regularly. + """ + try: + app = wx.GetApp() + if app is not None: + assert wx.Thread_IsMain() + + # Make a temporary event loop and process system events until + # there are no more waiting, then allow idle events (which + # will also deal with pending or posted wx events.) + evtloop = wx.EventLoop() + ea = wx.EventLoopActivator(evtloop) + while evtloop.Pending(): + evtloop.Dispatch() + app.ProcessIdle() + del ea + except KeyboardInterrupt: + pass + return 0 + +class EventLoopTimer(wx.Timer): + + def __init__(self, func): + self.func = func + wx.Timer.__init__(self) + + def Notify(self): + self.func() + +class EventLoopRunner(object): + + def Run(self, time): + self.evtloop = wx.EventLoop() + self.timer = EventLoopTimer(self.check_stdin) + self.timer.Start(time) + self.evtloop.Run() + + def check_stdin(self): + if stdin_ready(): + self.timer.Stop() + self.evtloop.Exit() + +def inputhook_wx2(): + """Run the wx event loop, polling for stdin. + + This version runs the wx eventloop for an undetermined amount of time, + during which it periodically checks to see if anything is ready on + stdin. If anything is ready on stdin, the event loop exits. + + The argument to elr.Run controls how often the event loop looks at stdin. + This determines the responsiveness at the keyboard. A setting of 1000 + enables a user to type at most 1 char per second. I have found that a + setting of 10 gives good keyboard response. We can shorten it further, + but eventually performance would suffer from calling select/kbhit too + often. + """ + try: + app = wx.GetApp() + if app is not None: + assert wx.Thread_IsMain() + elr = EventLoopRunner() + # As this time is made shorter, keyboard response improves, but idle + # CPU load goes up. 10 ms seems like a good compromise. + elr.Run(time=10) # CHANGE time here to control polling interval + except KeyboardInterrupt: + pass + return 0 + +def inputhook_wx3(): + """Run the wx event loop by processing pending events only. + + This is like inputhook_wx1, but it keeps processing pending events + until stdin is ready. After processing all pending events, a call to + time.sleep is inserted. This is needed, otherwise, CPU usage is at 100%. + This sleep time should be tuned though for best performance. + """ + # We need to protect against a user pressing Control-C when IPython is + # idle and this is running. We trap KeyboardInterrupt and pass. + try: + app = wx.GetApp() + if app is not None: + assert wx.Thread_IsMain() + + # The import of wx on Linux sets the handler for signal.SIGINT + # to 0. This is a bug in wx or gtk. We fix by just setting it + # back to the Python default. + if not callable(signal.getsignal(signal.SIGINT)): + signal.signal(signal.SIGINT, signal.default_int_handler) + + evtloop = wx.EventLoop() + ea = wx.EventLoopActivator(evtloop) + t = clock() + while not stdin_ready(): + while evtloop.Pending(): + t = clock() + evtloop.Dispatch() + app.ProcessIdle() + # We need to sleep at this point to keep the idle CPU load + # low. However, if sleep to long, GUI response is poor. As + # a compromise, we watch how often GUI events are being processed + # and switch between a short and long sleep time. Here are some + # stats useful in helping to tune this. + # time CPU load + # 0.001 13% + # 0.005 3% + # 0.01 1.5% + # 0.05 0.5% + used_time = clock() - t + if used_time > 10.0: + # print 'Sleep for 1 s' # dbg + time.sleep(1.0) + elif used_time > 0.1: + # Few GUI events coming in, so we can sleep longer + # print 'Sleep for 0.05 s' # dbg + time.sleep(0.05) + else: + # Many GUI events coming in, so sleep only very little + time.sleep(0.001) + del ea + except KeyboardInterrupt: + pass + return 0 + +if sys.platform == 'darwin': + # On OSX, evtloop.Pending() always returns True, regardless of there being + # any events pending. As such we can't use implementations 1 or 3 of the + # inputhook as those depend on a pending/dispatch loop. + inputhook_wx = inputhook_wx2 +else: + # This is our default implementation + inputhook_wx = inputhook_wx3 diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/kernel.py b/.venv/lib/python3.8/site-packages/IPython/lib/kernel.py new file mode 100644 index 00000000..af982766 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/kernel.py @@ -0,0 +1,13 @@ +"""[DEPRECATED] Utilities for connecting to kernels + +Moved to IPython.kernel.connect +""" + +import warnings +warnings.warn("IPython.lib.kernel moved to IPython.kernel.connect in IPython 1.0," + " and will be removed in IPython 6.0.", + DeprecationWarning +) + +from ipykernel.connect import * + diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/latextools.py b/.venv/lib/python3.8/site-packages/IPython/lib/latextools.py new file mode 100644 index 00000000..cbcc7d96 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/latextools.py @@ -0,0 +1,220 @@ +# -*- coding: utf-8 -*- +"""Tools for handling LaTeX.""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +from io import BytesIO, open +import os +import tempfile +import shutil +import subprocess +from base64 import encodebytes +import textwrap + +from IPython.utils.process import find_cmd, FindCmdError +from traitlets.config import get_config +from traitlets.config.configurable import SingletonConfigurable +from traitlets import List, Bool, Unicode +from IPython.utils.py3compat import cast_unicode + + +class LaTeXTool(SingletonConfigurable): + """An object to store configuration of the LaTeX tool.""" + def _config_default(self): + return get_config() + + backends = List( + Unicode(), ["matplotlib", "dvipng"], + help="Preferred backend to draw LaTeX math equations. " + "Backends in the list are checked one by one and the first " + "usable one is used. Note that `matplotlib` backend " + "is usable only for inline style equations. To draw " + "display style equations, `dvipng` backend must be specified. ", + # It is a List instead of Enum, to make configuration more + # flexible. For example, to use matplotlib mainly but dvipng + # for display style, the default ["matplotlib", "dvipng"] can + # be used. To NOT use dvipng so that other repr such as + # unicode pretty printing is used, you can use ["matplotlib"]. + ).tag(config=True) + + use_breqn = Bool( + True, + help="Use breqn.sty to automatically break long equations. " + "This configuration takes effect only for dvipng backend.", + ).tag(config=True) + + packages = List( + ['amsmath', 'amsthm', 'amssymb', 'bm'], + help="A list of packages to use for dvipng backend. " + "'breqn' will be automatically appended when use_breqn=True.", + ).tag(config=True) + + preamble = Unicode( + help="Additional preamble to use when generating LaTeX source " + "for dvipng backend.", + ).tag(config=True) + + +def latex_to_png(s, encode=False, backend=None, wrap=False, color='Black', + scale=1.0): + """Render a LaTeX string to PNG. + + Parameters + ---------- + s : str + The raw string containing valid inline LaTeX. + encode : bool, optional + Should the PNG data base64 encoded to make it JSON'able. + backend : {matplotlib, dvipng} + Backend for producing PNG data. + wrap : bool + If true, Automatically wrap `s` as a LaTeX equation. + color : string + Foreground color name among dvipsnames, e.g. 'Maroon' or on hex RGB + format, e.g. '#AA20FA'. + scale : float + Scale factor for the resulting PNG. + + None is returned when the backend cannot be used. + + """ + s = cast_unicode(s) + allowed_backends = LaTeXTool.instance().backends + if backend is None: + backend = allowed_backends[0] + if backend not in allowed_backends: + return None + if backend == 'matplotlib': + f = latex_to_png_mpl + elif backend == 'dvipng': + f = latex_to_png_dvipng + if color.startswith('#'): + # Convert hex RGB color to LaTeX RGB color. + if len(color) == 7: + try: + color = "RGB {}".format(" ".join([str(int(x, 16)) for x in + textwrap.wrap(color[1:], 2)])) + except ValueError: + raise ValueError('Invalid color specification {}.'.format(color)) + else: + raise ValueError('Invalid color specification {}.'.format(color)) + else: + raise ValueError('No such backend {0}'.format(backend)) + bin_data = f(s, wrap, color, scale) + if encode and bin_data: + bin_data = encodebytes(bin_data) + return bin_data + + +def latex_to_png_mpl(s, wrap, color='Black', scale=1.0): + try: + from matplotlib import mathtext + from pyparsing import ParseFatalException + except ImportError: + return None + + # mpl mathtext doesn't support display math, force inline + s = s.replace('$$', '$') + if wrap: + s = u'${0}$'.format(s) + + try: + mt = mathtext.MathTextParser('bitmap') + f = BytesIO() + dpi = 120*scale + mt.to_png(f, s, fontsize=12, dpi=dpi, color=color) + return f.getvalue() + except (ValueError, RuntimeError, ParseFatalException): + return None + + +def latex_to_png_dvipng(s, wrap, color='Black', scale=1.0): + try: + find_cmd('latex') + find_cmd('dvipng') + except FindCmdError: + return None + try: + workdir = tempfile.mkdtemp() + tmpfile = os.path.join(workdir, "tmp.tex") + dvifile = os.path.join(workdir, "tmp.dvi") + outfile = os.path.join(workdir, "tmp.png") + + with open(tmpfile, "w", encoding='utf8') as f: + f.writelines(genelatex(s, wrap)) + + with open(os.devnull, 'wb') as devnull: + subprocess.check_call( + ["latex", "-halt-on-error", "-interaction", "batchmode", tmpfile], + cwd=workdir, stdout=devnull, stderr=devnull) + + resolution = round(150*scale) + subprocess.check_call( + ["dvipng", "-T", "tight", "-D", str(resolution), "-z", "9", + "-bg", "transparent", "-o", outfile, dvifile, "-fg", color], + cwd=workdir, stdout=devnull, stderr=devnull) + + with open(outfile, "rb") as f: + return f.read() + except subprocess.CalledProcessError: + return None + finally: + shutil.rmtree(workdir) + + +def kpsewhich(filename): + """Invoke kpsewhich command with an argument `filename`.""" + try: + find_cmd("kpsewhich") + proc = subprocess.Popen( + ["kpsewhich", filename], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + (stdout, stderr) = proc.communicate() + return stdout.strip().decode('utf8', 'replace') + except FindCmdError: + pass + + +def genelatex(body, wrap): + """Generate LaTeX document for dvipng backend.""" + lt = LaTeXTool.instance() + breqn = wrap and lt.use_breqn and kpsewhich("breqn.sty") + yield r'\documentclass{article}' + packages = lt.packages + if breqn: + packages = packages + ['breqn'] + for pack in packages: + yield r'\usepackage{{{0}}}'.format(pack) + yield r'\pagestyle{empty}' + if lt.preamble: + yield lt.preamble + yield r'\begin{document}' + if breqn: + yield r'\begin{dmath*}' + yield body + yield r'\end{dmath*}' + elif wrap: + yield u'$${0}$$'.format(body) + else: + yield body + yield u'\\end{document}' + + +_data_uri_template_png = u"""%s""" + +def latex_to_html(s, alt='image'): + """Render LaTeX to HTML with embedded PNG data using data URIs. + + Parameters + ---------- + s : str + The raw string containing valid inline LateX. + alt : str + The alt text to use for the HTML. + """ + base64_data = latex_to_png(s, encode=True).decode('ascii') + if base64_data: + return _data_uri_template_png % (base64_data, alt) + + diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/lexers.py b/.venv/lib/python3.8/site-packages/IPython/lib/lexers.py new file mode 100644 index 00000000..4494da56 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/lexers.py @@ -0,0 +1,532 @@ +# -*- coding: utf-8 -*- +""" +Defines a variety of Pygments lexers for highlighting IPython code. + +This includes: + + IPythonLexer, IPython3Lexer + Lexers for pure IPython (python + magic/shell commands) + + IPythonPartialTracebackLexer, IPythonTracebackLexer + Supports 2.x and 3.x via keyword `python3`. The partial traceback + lexer reads everything but the Python code appearing in a traceback. + The full lexer combines the partial lexer with an IPython lexer. + + IPythonConsoleLexer + A lexer for IPython console sessions, with support for tracebacks. + + IPyLexer + A friendly lexer which examines the first line of text and from it, + decides whether to use an IPython lexer or an IPython console lexer. + This is probably the only lexer that needs to be explicitly added + to Pygments. + +""" +#----------------------------------------------------------------------------- +# Copyright (c) 2013, the IPython Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +# Standard library +import re + +# Third party +from pygments.lexers import ( + BashLexer, HtmlLexer, JavascriptLexer, RubyLexer, PerlLexer, PythonLexer, + Python3Lexer, TexLexer) +from pygments.lexer import ( + Lexer, DelegatingLexer, RegexLexer, do_insertions, bygroups, using, +) +from pygments.token import ( + Generic, Keyword, Literal, Name, Operator, Other, Text, Error, +) +from pygments.util import get_bool_opt + +# Local + +line_re = re.compile('.*?\n') + +__all__ = ['build_ipy_lexer', 'IPython3Lexer', 'IPythonLexer', + 'IPythonPartialTracebackLexer', 'IPythonTracebackLexer', + 'IPythonConsoleLexer', 'IPyLexer'] + + +def build_ipy_lexer(python3): + """Builds IPython lexers depending on the value of `python3`. + + The lexer inherits from an appropriate Python lexer and then adds + information about IPython specific keywords (i.e. magic commands, + shell commands, etc.) + + Parameters + ---------- + python3 : bool + If `True`, then build an IPython lexer from a Python 3 lexer. + + """ + # It would be nice to have a single IPython lexer class which takes + # a boolean `python3`. But since there are two Python lexer classes, + # we will also have two IPython lexer classes. + if python3: + PyLexer = Python3Lexer + name = 'IPython3' + aliases = ['ipython3'] + doc = """IPython3 Lexer""" + else: + PyLexer = PythonLexer + name = 'IPython' + aliases = ['ipython2', 'ipython'] + doc = """IPython Lexer""" + + ipython_tokens = [ + (r'(?s)(\s*)(%%capture)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(PyLexer))), + (r'(?s)(\s*)(%%debug)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(PyLexer))), + (r'(?is)(\s*)(%%html)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(HtmlLexer))), + (r'(?s)(\s*)(%%javascript)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(JavascriptLexer))), + (r'(?s)(\s*)(%%js)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(JavascriptLexer))), + (r'(?s)(\s*)(%%latex)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(TexLexer))), + (r'(?s)(\s*)(%%perl)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(PerlLexer))), + (r'(?s)(\s*)(%%prun)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(PyLexer))), + (r'(?s)(\s*)(%%pypy)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(PyLexer))), + (r'(?s)(\s*)(%%python)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(PyLexer))), + (r'(?s)(\s*)(%%python2)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(PythonLexer))), + (r'(?s)(\s*)(%%python3)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(Python3Lexer))), + (r'(?s)(\s*)(%%ruby)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(RubyLexer))), + (r'(?s)(\s*)(%%time)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(PyLexer))), + (r'(?s)(\s*)(%%timeit)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(PyLexer))), + (r'(?s)(\s*)(%%writefile)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(PyLexer))), + (r'(?s)(\s*)(%%file)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(PyLexer))), + (r"(?s)(\s*)(%%)(\w+)(.*)", bygroups(Text, Operator, Keyword, Text)), + (r'(?s)(^\s*)(%%!)([^\n]*\n)(.*)', bygroups(Text, Operator, Text, using(BashLexer))), + (r"(%%?)(\w+)(\?\??)$", bygroups(Operator, Keyword, Operator)), + (r"\b(\?\??)(\s*)$", bygroups(Operator, Text)), + (r'(%)(sx|sc|system)(.*)(\n)', bygroups(Operator, Keyword, + using(BashLexer), Text)), + (r'(%)(\w+)(.*\n)', bygroups(Operator, Keyword, Text)), + (r'^(!!)(.+)(\n)', bygroups(Operator, using(BashLexer), Text)), + (r'(!)(?!=)(.+)(\n)', bygroups(Operator, using(BashLexer), Text)), + (r'^(\s*)(\?\??)(\s*%{0,2}[\w\.\*]*)', bygroups(Text, Operator, Text)), + (r'(\s*%{0,2}[\w\.\*]*)(\?\??)(\s*)$', bygroups(Text, Operator, Text)), + ] + + tokens = PyLexer.tokens.copy() + tokens['root'] = ipython_tokens + tokens['root'] + + attrs = {'name': name, 'aliases': aliases, 'filenames': [], + '__doc__': doc, 'tokens': tokens} + + return type(name, (PyLexer,), attrs) + + +IPython3Lexer = build_ipy_lexer(python3=True) +IPythonLexer = build_ipy_lexer(python3=False) + + +class IPythonPartialTracebackLexer(RegexLexer): + """ + Partial lexer for IPython tracebacks. + + Handles all the non-python output. + + """ + name = 'IPython Partial Traceback' + + tokens = { + 'root': [ + # Tracebacks for syntax errors have a different style. + # For both types of tracebacks, we mark the first line with + # Generic.Traceback. For syntax errors, we mark the filename + # as we mark the filenames for non-syntax tracebacks. + # + # These two regexps define how IPythonConsoleLexer finds a + # traceback. + # + ## Non-syntax traceback + (r'^(\^C)?(-+\n)', bygroups(Error, Generic.Traceback)), + ## Syntax traceback + (r'^( File)(.*)(, line )(\d+\n)', + bygroups(Generic.Traceback, Name.Namespace, + Generic.Traceback, Literal.Number.Integer)), + + # (Exception Identifier)(Whitespace)(Traceback Message) + (r'(?u)(^[^\d\W]\w*)(\s*)(Traceback.*?\n)', + bygroups(Name.Exception, Generic.Whitespace, Text)), + # (Module/Filename)(Text)(Callee)(Function Signature) + # Better options for callee and function signature? + (r'(.*)( in )(.*)(\(.*\)\n)', + bygroups(Name.Namespace, Text, Name.Entity, Name.Tag)), + # Regular line: (Whitespace)(Line Number)(Python Code) + (r'(\s*?)(\d+)(.*?\n)', + bygroups(Generic.Whitespace, Literal.Number.Integer, Other)), + # Emphasized line: (Arrow)(Line Number)(Python Code) + # Using Exception token so arrow color matches the Exception. + (r'(-*>?\s?)(\d+)(.*?\n)', + bygroups(Name.Exception, Literal.Number.Integer, Other)), + # (Exception Identifier)(Message) + (r'(?u)(^[^\d\W]\w*)(:.*?\n)', + bygroups(Name.Exception, Text)), + # Tag everything else as Other, will be handled later. + (r'.*\n', Other), + ], + } + + +class IPythonTracebackLexer(DelegatingLexer): + """ + IPython traceback lexer. + + For doctests, the tracebacks can be snipped as much as desired with the + exception to the lines that designate a traceback. For non-syntax error + tracebacks, this is the line of hyphens. For syntax error tracebacks, + this is the line which lists the File and line number. + + """ + # The lexer inherits from DelegatingLexer. The "root" lexer is an + # appropriate IPython lexer, which depends on the value of the boolean + # `python3`. First, we parse with the partial IPython traceback lexer. + # Then, any code marked with the "Other" token is delegated to the root + # lexer. + # + name = 'IPython Traceback' + aliases = ['ipythontb'] + + def __init__(self, **options): + self.python3 = get_bool_opt(options, 'python3', False) + if self.python3: + self.aliases = ['ipython3tb'] + else: + self.aliases = ['ipython2tb', 'ipythontb'] + + if self.python3: + IPyLexer = IPython3Lexer + else: + IPyLexer = IPythonLexer + + DelegatingLexer.__init__(self, IPyLexer, + IPythonPartialTracebackLexer, **options) + +class IPythonConsoleLexer(Lexer): + """ + An IPython console lexer for IPython code-blocks and doctests, such as: + + .. code-block:: rst + + .. code-block:: ipythonconsole + + In [1]: a = 'foo' + + In [2]: a + Out[2]: 'foo' + + In [3]: print a + foo + + In [4]: 1 / 0 + + + Support is also provided for IPython exceptions: + + .. code-block:: rst + + .. code-block:: ipythonconsole + + In [1]: raise Exception + + --------------------------------------------------------------------------- + Exception Traceback (most recent call last) + in + ----> 1 raise Exception + + Exception: + + """ + name = 'IPython console session' + aliases = ['ipythonconsole'] + mimetypes = ['text/x-ipython-console'] + + # The regexps used to determine what is input and what is output. + # The default prompts for IPython are: + # + # in = 'In [#]: ' + # continuation = ' .D.: ' + # template = 'Out[#]: ' + # + # Where '#' is the 'prompt number' or 'execution count' and 'D' + # D is a number of dots matching the width of the execution count + # + in1_regex = r'In \[[0-9]+\]: ' + in2_regex = r' \.\.+\.: ' + out_regex = r'Out\[[0-9]+\]: ' + + #: The regex to determine when a traceback starts. + ipytb_start = re.compile(r'^(\^C)?(-+\n)|^( File)(.*)(, line )(\d+\n)') + + def __init__(self, **options): + """Initialize the IPython console lexer. + + Parameters + ---------- + python3 : bool + If `True`, then the console inputs are parsed using a Python 3 + lexer. Otherwise, they are parsed using a Python 2 lexer. + in1_regex : RegexObject + The compiled regular expression used to detect the start + of inputs. Although the IPython configuration setting may have a + trailing whitespace, do not include it in the regex. If `None`, + then the default input prompt is assumed. + in2_regex : RegexObject + The compiled regular expression used to detect the continuation + of inputs. Although the IPython configuration setting may have a + trailing whitespace, do not include it in the regex. If `None`, + then the default input prompt is assumed. + out_regex : RegexObject + The compiled regular expression used to detect outputs. If `None`, + then the default output prompt is assumed. + + """ + self.python3 = get_bool_opt(options, 'python3', False) + if self.python3: + self.aliases = ['ipython3console'] + else: + self.aliases = ['ipython2console', 'ipythonconsole'] + + in1_regex = options.get('in1_regex', self.in1_regex) + in2_regex = options.get('in2_regex', self.in2_regex) + out_regex = options.get('out_regex', self.out_regex) + + # So that we can work with input and output prompts which have been + # rstrip'd (possibly by editors) we also need rstrip'd variants. If + # we do not do this, then such prompts will be tagged as 'output'. + # The reason can't just use the rstrip'd variants instead is because + # we want any whitespace associated with the prompt to be inserted + # with the token. This allows formatted code to be modified so as hide + # the appearance of prompts, with the whitespace included. One example + # use of this is in copybutton.js from the standard lib Python docs. + in1_regex_rstrip = in1_regex.rstrip() + '\n' + in2_regex_rstrip = in2_regex.rstrip() + '\n' + out_regex_rstrip = out_regex.rstrip() + '\n' + + # Compile and save them all. + attrs = ['in1_regex', 'in2_regex', 'out_regex', + 'in1_regex_rstrip', 'in2_regex_rstrip', 'out_regex_rstrip'] + for attr in attrs: + self.__setattr__(attr, re.compile(locals()[attr])) + + Lexer.__init__(self, **options) + + if self.python3: + pylexer = IPython3Lexer + tblexer = IPythonTracebackLexer + else: + pylexer = IPythonLexer + tblexer = IPythonTracebackLexer + + self.pylexer = pylexer(**options) + self.tblexer = tblexer(**options) + + self.reset() + + def reset(self): + self.mode = 'output' + self.index = 0 + self.buffer = u'' + self.insertions = [] + + def buffered_tokens(self): + """ + Generator of unprocessed tokens after doing insertions and before + changing to a new state. + + """ + if self.mode == 'output': + tokens = [(0, Generic.Output, self.buffer)] + elif self.mode == 'input': + tokens = self.pylexer.get_tokens_unprocessed(self.buffer) + else: # traceback + tokens = self.tblexer.get_tokens_unprocessed(self.buffer) + + for i, t, v in do_insertions(self.insertions, tokens): + # All token indexes are relative to the buffer. + yield self.index + i, t, v + + # Clear it all + self.index += len(self.buffer) + self.buffer = u'' + self.insertions = [] + + def get_mci(self, line): + """ + Parses the line and returns a 3-tuple: (mode, code, insertion). + + `mode` is the next mode (or state) of the lexer, and is always equal + to 'input', 'output', or 'tb'. + + `code` is a portion of the line that should be added to the buffer + corresponding to the next mode and eventually lexed by another lexer. + For example, `code` could be Python code if `mode` were 'input'. + + `insertion` is a 3-tuple (index, token, text) representing an + unprocessed "token" that will be inserted into the stream of tokens + that are created from the buffer once we change modes. This is usually + the input or output prompt. + + In general, the next mode depends on current mode and on the contents + of `line`. + + """ + # To reduce the number of regex match checks, we have multiple + # 'if' blocks instead of 'if-elif' blocks. + + # Check for possible end of input + in2_match = self.in2_regex.match(line) + in2_match_rstrip = self.in2_regex_rstrip.match(line) + if (in2_match and in2_match.group().rstrip() == line.rstrip()) or \ + in2_match_rstrip: + end_input = True + else: + end_input = False + if end_input and self.mode != 'tb': + # Only look for an end of input when not in tb mode. + # An ellipsis could appear within the traceback. + mode = 'output' + code = u'' + insertion = (0, Generic.Prompt, line) + return mode, code, insertion + + # Check for output prompt + out_match = self.out_regex.match(line) + out_match_rstrip = self.out_regex_rstrip.match(line) + if out_match or out_match_rstrip: + mode = 'output' + if out_match: + idx = out_match.end() + else: + idx = out_match_rstrip.end() + code = line[idx:] + # Use the 'heading' token for output. We cannot use Generic.Error + # since it would conflict with exceptions. + insertion = (0, Generic.Heading, line[:idx]) + return mode, code, insertion + + + # Check for input or continuation prompt (non stripped version) + in1_match = self.in1_regex.match(line) + if in1_match or (in2_match and self.mode != 'tb'): + # New input or when not in tb, continued input. + # We do not check for continued input when in tb since it is + # allowable to replace a long stack with an ellipsis. + mode = 'input' + if in1_match: + idx = in1_match.end() + else: # in2_match + idx = in2_match.end() + code = line[idx:] + insertion = (0, Generic.Prompt, line[:idx]) + return mode, code, insertion + + # Check for input or continuation prompt (stripped version) + in1_match_rstrip = self.in1_regex_rstrip.match(line) + if in1_match_rstrip or (in2_match_rstrip and self.mode != 'tb'): + # New input or when not in tb, continued input. + # We do not check for continued input when in tb since it is + # allowable to replace a long stack with an ellipsis. + mode = 'input' + if in1_match_rstrip: + idx = in1_match_rstrip.end() + else: # in2_match + idx = in2_match_rstrip.end() + code = line[idx:] + insertion = (0, Generic.Prompt, line[:idx]) + return mode, code, insertion + + # Check for traceback + if self.ipytb_start.match(line): + mode = 'tb' + code = line + insertion = None + return mode, code, insertion + + # All other stuff... + if self.mode in ('input', 'output'): + # We assume all other text is output. Multiline input that + # does not use the continuation marker cannot be detected. + # For example, the 3 in the following is clearly output: + # + # In [1]: print 3 + # 3 + # + # But the following second line is part of the input: + # + # In [2]: while True: + # print True + # + # In both cases, the 2nd line will be 'output'. + # + mode = 'output' + else: + mode = 'tb' + + code = line + insertion = None + + return mode, code, insertion + + def get_tokens_unprocessed(self, text): + self.reset() + for match in line_re.finditer(text): + line = match.group() + mode, code, insertion = self.get_mci(line) + + if mode != self.mode: + # Yield buffered tokens before transitioning to new mode. + for token in self.buffered_tokens(): + yield token + self.mode = mode + + if insertion: + self.insertions.append((len(self.buffer), [insertion])) + self.buffer += code + + for token in self.buffered_tokens(): + yield token + +class IPyLexer(Lexer): + r""" + Primary lexer for all IPython-like code. + + This is a simple helper lexer. If the first line of the text begins with + "In \[[0-9]+\]:", then the entire text is parsed with an IPython console + lexer. If not, then the entire text is parsed with an IPython lexer. + + The goal is to reduce the number of lexers that are registered + with Pygments. + + """ + name = 'IPy session' + aliases = ['ipy'] + + def __init__(self, **options): + self.python3 = get_bool_opt(options, 'python3', False) + if self.python3: + self.aliases = ['ipy3'] + else: + self.aliases = ['ipy2', 'ipy'] + + Lexer.__init__(self, **options) + + self.IPythonLexer = IPythonLexer(**options) + self.IPythonConsoleLexer = IPythonConsoleLexer(**options) + + def get_tokens_unprocessed(self, text): + # Search for the input prompt anywhere...this allows code blocks to + # begin with comments as well. + if re.match(r'.*(In \[[0-9]+\]:)', text.strip(), re.DOTALL): + lex = self.IPythonConsoleLexer + else: + lex = self.IPythonLexer + for token in lex.get_tokens_unprocessed(text): + yield token + diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/pretty.py b/.venv/lib/python3.8/site-packages/IPython/lib/pretty.py new file mode 100644 index 00000000..1cb46b14 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/pretty.py @@ -0,0 +1,873 @@ +# -*- coding: utf-8 -*- +""" +Python advanced pretty printer. This pretty printer is intended to +replace the old `pprint` python module which does not allow developers +to provide their own pretty print callbacks. + +This module is based on ruby's `prettyprint.rb` library by `Tanaka Akira`. + + +Example Usage +------------- + +To directly print the representation of an object use `pprint`:: + + from pretty import pprint + pprint(complex_object) + +To get a string of the output use `pretty`:: + + from pretty import pretty + string = pretty(complex_object) + + +Extending +--------- + +The pretty library allows developers to add pretty printing rules for their +own objects. This process is straightforward. All you have to do is to +add a `_repr_pretty_` method to your object and call the methods on the +pretty printer passed:: + + class MyObject(object): + + def _repr_pretty_(self, p, cycle): + ... + +Here is an example implementation of a `_repr_pretty_` method for a list +subclass:: + + class MyList(list): + + def _repr_pretty_(self, p, cycle): + if cycle: + p.text('MyList(...)') + else: + with p.group(8, 'MyList([', '])'): + for idx, item in enumerate(self): + if idx: + p.text(',') + p.breakable() + p.pretty(item) + +The `cycle` parameter is `True` if pretty detected a cycle. You *have* to +react to that or the result is an infinite loop. `p.text()` just adds +non breaking text to the output, `p.breakable()` either adds a whitespace +or breaks here. If you pass it an argument it's used instead of the +default space. `p.pretty` prettyprints another object using the pretty print +method. + +The first parameter to the `group` function specifies the extra indentation +of the next line. In this example the next item will either be on the same +line (if the items are short enough) or aligned with the right edge of the +opening bracket of `MyList`. + +If you just want to indent something you can use the group function +without open / close parameters. You can also use this code:: + + with p.indent(2): + ... + +Inheritance diagram: + +.. inheritance-diagram:: IPython.lib.pretty + :parts: 3 + +:copyright: 2007 by Armin Ronacher. + Portions (c) 2009 by Robert Kern. +:license: BSD License. +""" + +from contextlib import contextmanager +import datetime +import os +import re +import sys +import types +from collections import deque +from inspect import signature +from io import StringIO +from warnings import warn + +from IPython.utils.decorators import undoc +from IPython.utils.py3compat import PYPY + +__all__ = ['pretty', 'pprint', 'PrettyPrinter', 'RepresentationPrinter', + 'for_type', 'for_type_by_name'] + + +MAX_SEQ_LENGTH = 1000 +_re_pattern_type = type(re.compile('')) + +def _safe_getattr(obj, attr, default=None): + """Safe version of getattr. + + Same as getattr, but will return ``default`` on any Exception, + rather than raising. + """ + try: + return getattr(obj, attr, default) + except Exception: + return default + +@undoc +class CUnicodeIO(StringIO): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + warn(("CUnicodeIO is deprecated since IPython 6.0. " + "Please use io.StringIO instead."), + DeprecationWarning, stacklevel=2) + +def _sorted_for_pprint(items): + """ + Sort the given items for pretty printing. Since some predictable + sorting is better than no sorting at all, we sort on the string + representation if normal sorting fails. + """ + items = list(items) + try: + return sorted(items) + except Exception: + try: + return sorted(items, key=str) + except Exception: + return items + +def pretty(obj, verbose=False, max_width=79, newline='\n', max_seq_length=MAX_SEQ_LENGTH): + """ + Pretty print the object's representation. + """ + stream = StringIO() + printer = RepresentationPrinter(stream, verbose, max_width, newline, max_seq_length=max_seq_length) + printer.pretty(obj) + printer.flush() + return stream.getvalue() + + +def pprint(obj, verbose=False, max_width=79, newline='\n', max_seq_length=MAX_SEQ_LENGTH): + """ + Like `pretty` but print to stdout. + """ + printer = RepresentationPrinter(sys.stdout, verbose, max_width, newline, max_seq_length=max_seq_length) + printer.pretty(obj) + printer.flush() + sys.stdout.write(newline) + sys.stdout.flush() + +class _PrettyPrinterBase(object): + + @contextmanager + def indent(self, indent): + """with statement support for indenting/dedenting.""" + self.indentation += indent + try: + yield + finally: + self.indentation -= indent + + @contextmanager + def group(self, indent=0, open='', close=''): + """like begin_group / end_group but for the with statement.""" + self.begin_group(indent, open) + try: + yield + finally: + self.end_group(indent, close) + +class PrettyPrinter(_PrettyPrinterBase): + """ + Baseclass for the `RepresentationPrinter` prettyprinter that is used to + generate pretty reprs of objects. Contrary to the `RepresentationPrinter` + this printer knows nothing about the default pprinters or the `_repr_pretty_` + callback method. + """ + + def __init__(self, output, max_width=79, newline='\n', max_seq_length=MAX_SEQ_LENGTH): + self.output = output + self.max_width = max_width + self.newline = newline + self.max_seq_length = max_seq_length + self.output_width = 0 + self.buffer_width = 0 + self.buffer = deque() + + root_group = Group(0) + self.group_stack = [root_group] + self.group_queue = GroupQueue(root_group) + self.indentation = 0 + + def _break_one_group(self, group): + while group.breakables: + x = self.buffer.popleft() + self.output_width = x.output(self.output, self.output_width) + self.buffer_width -= x.width + while self.buffer and isinstance(self.buffer[0], Text): + x = self.buffer.popleft() + self.output_width = x.output(self.output, self.output_width) + self.buffer_width -= x.width + + def _break_outer_groups(self): + while self.max_width < self.output_width + self.buffer_width: + group = self.group_queue.deq() + if not group: + return + self._break_one_group(group) + + def text(self, obj): + """Add literal text to the output.""" + width = len(obj) + if self.buffer: + text = self.buffer[-1] + if not isinstance(text, Text): + text = Text() + self.buffer.append(text) + text.add(obj, width) + self.buffer_width += width + self._break_outer_groups() + else: + self.output.write(obj) + self.output_width += width + + def breakable(self, sep=' '): + """ + Add a breakable separator to the output. This does not mean that it + will automatically break here. If no breaking on this position takes + place the `sep` is inserted which default to one space. + """ + width = len(sep) + group = self.group_stack[-1] + if group.want_break: + self.flush() + self.output.write(self.newline) + self.output.write(' ' * self.indentation) + self.output_width = self.indentation + self.buffer_width = 0 + else: + self.buffer.append(Breakable(sep, width, self)) + self.buffer_width += width + self._break_outer_groups() + + def break_(self): + """ + Explicitly insert a newline into the output, maintaining correct indentation. + """ + group = self.group_queue.deq() + if group: + self._break_one_group(group) + self.flush() + self.output.write(self.newline) + self.output.write(' ' * self.indentation) + self.output_width = self.indentation + self.buffer_width = 0 + + + def begin_group(self, indent=0, open=''): + """ + Begin a group. + The first parameter specifies the indentation for the next line (usually + the width of the opening text), the second the opening text. All + parameters are optional. + """ + if open: + self.text(open) + group = Group(self.group_stack[-1].depth + 1) + self.group_stack.append(group) + self.group_queue.enq(group) + self.indentation += indent + + def _enumerate(self, seq): + """like enumerate, but with an upper limit on the number of items""" + for idx, x in enumerate(seq): + if self.max_seq_length and idx >= self.max_seq_length: + self.text(',') + self.breakable() + self.text('...') + return + yield idx, x + + def end_group(self, dedent=0, close=''): + """End a group. See `begin_group` for more details.""" + self.indentation -= dedent + group = self.group_stack.pop() + if not group.breakables: + self.group_queue.remove(group) + if close: + self.text(close) + + def flush(self): + """Flush data that is left in the buffer.""" + for data in self.buffer: + self.output_width += data.output(self.output, self.output_width) + self.buffer.clear() + self.buffer_width = 0 + + +def _get_mro(obj_class): + """ Get a reasonable method resolution order of a class and its superclasses + for both old-style and new-style classes. + """ + if not hasattr(obj_class, '__mro__'): + # Old-style class. Mix in object to make a fake new-style class. + try: + obj_class = type(obj_class.__name__, (obj_class, object), {}) + except TypeError: + # Old-style extension type that does not descend from object. + # FIXME: try to construct a more thorough MRO. + mro = [obj_class] + else: + mro = obj_class.__mro__[1:-1] + else: + mro = obj_class.__mro__ + return mro + + +class RepresentationPrinter(PrettyPrinter): + """ + Special pretty printer that has a `pretty` method that calls the pretty + printer for a python object. + + This class stores processing data on `self` so you must *never* use + this class in a threaded environment. Always lock it or reinstanciate + it. + + Instances also have a verbose flag callbacks can access to control their + output. For example the default instance repr prints all attributes and + methods that are not prefixed by an underscore if the printer is in + verbose mode. + """ + + def __init__(self, output, verbose=False, max_width=79, newline='\n', + singleton_pprinters=None, type_pprinters=None, deferred_pprinters=None, + max_seq_length=MAX_SEQ_LENGTH): + + PrettyPrinter.__init__(self, output, max_width, newline, max_seq_length=max_seq_length) + self.verbose = verbose + self.stack = [] + if singleton_pprinters is None: + singleton_pprinters = _singleton_pprinters.copy() + self.singleton_pprinters = singleton_pprinters + if type_pprinters is None: + type_pprinters = _type_pprinters.copy() + self.type_pprinters = type_pprinters + if deferred_pprinters is None: + deferred_pprinters = _deferred_type_pprinters.copy() + self.deferred_pprinters = deferred_pprinters + + def pretty(self, obj): + """Pretty print the given object.""" + obj_id = id(obj) + cycle = obj_id in self.stack + self.stack.append(obj_id) + self.begin_group() + try: + obj_class = _safe_getattr(obj, '__class__', None) or type(obj) + # First try to find registered singleton printers for the type. + try: + printer = self.singleton_pprinters[obj_id] + except (TypeError, KeyError): + pass + else: + return printer(obj, self, cycle) + # Next walk the mro and check for either: + # 1) a registered printer + # 2) a _repr_pretty_ method + for cls in _get_mro(obj_class): + if cls in self.type_pprinters: + # printer registered in self.type_pprinters + return self.type_pprinters[cls](obj, self, cycle) + else: + # deferred printer + printer = self._in_deferred_types(cls) + if printer is not None: + return printer(obj, self, cycle) + else: + # Finally look for special method names. + # Some objects automatically create any requested + # attribute. Try to ignore most of them by checking for + # callability. + if '_repr_pretty_' in cls.__dict__: + meth = cls._repr_pretty_ + if callable(meth): + return meth(obj, self, cycle) + if cls is not object \ + and callable(cls.__dict__.get('__repr__')): + return _repr_pprint(obj, self, cycle) + + return _default_pprint(obj, self, cycle) + finally: + self.end_group() + self.stack.pop() + + def _in_deferred_types(self, cls): + """ + Check if the given class is specified in the deferred type registry. + + Returns the printer from the registry if it exists, and None if the + class is not in the registry. Successful matches will be moved to the + regular type registry for future use. + """ + mod = _safe_getattr(cls, '__module__', None) + name = _safe_getattr(cls, '__name__', None) + key = (mod, name) + printer = None + if key in self.deferred_pprinters: + # Move the printer over to the regular registry. + printer = self.deferred_pprinters.pop(key) + self.type_pprinters[cls] = printer + return printer + + +class Printable(object): + + def output(self, stream, output_width): + return output_width + + +class Text(Printable): + + def __init__(self): + self.objs = [] + self.width = 0 + + def output(self, stream, output_width): + for obj in self.objs: + stream.write(obj) + return output_width + self.width + + def add(self, obj, width): + self.objs.append(obj) + self.width += width + + +class Breakable(Printable): + + def __init__(self, seq, width, pretty): + self.obj = seq + self.width = width + self.pretty = pretty + self.indentation = pretty.indentation + self.group = pretty.group_stack[-1] + self.group.breakables.append(self) + + def output(self, stream, output_width): + self.group.breakables.popleft() + if self.group.want_break: + stream.write(self.pretty.newline) + stream.write(' ' * self.indentation) + return self.indentation + if not self.group.breakables: + self.pretty.group_queue.remove(self.group) + stream.write(self.obj) + return output_width + self.width + + +class Group(Printable): + + def __init__(self, depth): + self.depth = depth + self.breakables = deque() + self.want_break = False + + +class GroupQueue(object): + + def __init__(self, *groups): + self.queue = [] + for group in groups: + self.enq(group) + + def enq(self, group): + depth = group.depth + while depth > len(self.queue) - 1: + self.queue.append([]) + self.queue[depth].append(group) + + def deq(self): + for stack in self.queue: + for idx, group in enumerate(reversed(stack)): + if group.breakables: + del stack[idx] + group.want_break = True + return group + for group in stack: + group.want_break = True + del stack[:] + + def remove(self, group): + try: + self.queue[group.depth].remove(group) + except ValueError: + pass + + +def _default_pprint(obj, p, cycle): + """ + The default print function. Used if an object does not provide one and + it's none of the builtin objects. + """ + klass = _safe_getattr(obj, '__class__', None) or type(obj) + if _safe_getattr(klass, '__repr__', None) is not object.__repr__: + # A user-provided repr. Find newlines and replace them with p.break_() + _repr_pprint(obj, p, cycle) + return + p.begin_group(1, '<') + p.pretty(klass) + p.text(' at 0x%x' % id(obj)) + if cycle: + p.text(' ...') + elif p.verbose: + first = True + for key in dir(obj): + if not key.startswith('_'): + try: + value = getattr(obj, key) + except AttributeError: + continue + if isinstance(value, types.MethodType): + continue + if not first: + p.text(',') + p.breakable() + p.text(key) + p.text('=') + step = len(key) + 1 + p.indentation += step + p.pretty(value) + p.indentation -= step + first = False + p.end_group(1, '>') + + +def _seq_pprinter_factory(start, end): + """ + Factory that returns a pprint function useful for sequences. Used by + the default pprint for tuples, dicts, and lists. + """ + def inner(obj, p, cycle): + if cycle: + return p.text(start + '...' + end) + step = len(start) + p.begin_group(step, start) + for idx, x in p._enumerate(obj): + if idx: + p.text(',') + p.breakable() + p.pretty(x) + if len(obj) == 1 and type(obj) is tuple: + # Special case for 1-item tuples. + p.text(',') + p.end_group(step, end) + return inner + + +def _set_pprinter_factory(start, end): + """ + Factory that returns a pprint function useful for sets and frozensets. + """ + def inner(obj, p, cycle): + if cycle: + return p.text(start + '...' + end) + if len(obj) == 0: + # Special case. + p.text(type(obj).__name__ + '()') + else: + step = len(start) + p.begin_group(step, start) + # Like dictionary keys, we will try to sort the items if there aren't too many + if not (p.max_seq_length and len(obj) >= p.max_seq_length): + items = _sorted_for_pprint(obj) + else: + items = obj + for idx, x in p._enumerate(items): + if idx: + p.text(',') + p.breakable() + p.pretty(x) + p.end_group(step, end) + return inner + + +def _dict_pprinter_factory(start, end): + """ + Factory that returns a pprint function used by the default pprint of + dicts and dict proxies. + """ + def inner(obj, p, cycle): + if cycle: + return p.text('{...}') + step = len(start) + p.begin_group(step, start) + keys = obj.keys() + for idx, key in p._enumerate(keys): + if idx: + p.text(',') + p.breakable() + p.pretty(key) + p.text(': ') + p.pretty(obj[key]) + p.end_group(step, end) + return inner + + +def _super_pprint(obj, p, cycle): + """The pprint for the super type.""" + p.begin_group(8, '') + + +def _re_pattern_pprint(obj, p, cycle): + """The pprint function for regular expression patterns.""" + p.text('re.compile(') + pattern = repr(obj.pattern) + if pattern[:1] in 'uU': + pattern = pattern[1:] + prefix = 'ur' + else: + prefix = 'r' + pattern = prefix + pattern.replace('\\\\', '\\') + p.text(pattern) + if obj.flags: + p.text(',') + p.breakable() + done_one = False + for flag in ('TEMPLATE', 'IGNORECASE', 'LOCALE', 'MULTILINE', 'DOTALL', + 'UNICODE', 'VERBOSE', 'DEBUG'): + if obj.flags & getattr(re, flag): + if done_one: + p.text('|') + p.text('re.' + flag) + done_one = True + p.text(')') + + +def _types_simplenamespace_pprint(obj, p, cycle): + """The pprint function for types.SimpleNamespace.""" + name = 'namespace' + with p.group(len(name) + 1, name + '(', ')'): + if cycle: + p.text('...') + else: + for idx, (attr, value) in enumerate(obj.__dict__.items()): + if idx: + p.text(',') + p.breakable() + attr_kwarg = '{}='.format(attr) + with p.group(len(attr_kwarg), attr_kwarg): + p.pretty(value) + + +def _type_pprint(obj, p, cycle): + """The pprint for classes and types.""" + # Heap allocated types might not have the module attribute, + # and others may set it to None. + + # Checks for a __repr__ override in the metaclass. Can't compare the + # type(obj).__repr__ directly because in PyPy the representation function + # inherited from type isn't the same type.__repr__ + if [m for m in _get_mro(type(obj)) if "__repr__" in vars(m)][:1] != [type]: + _repr_pprint(obj, p, cycle) + return + + mod = _safe_getattr(obj, '__module__', None) + try: + name = obj.__qualname__ + if not isinstance(name, str): + # This can happen if the type implements __qualname__ as a property + # or other descriptor in Python 2. + raise Exception("Try __name__") + except Exception: + name = obj.__name__ + if not isinstance(name, str): + name = '' + + if mod in (None, '__builtin__', 'builtins', 'exceptions'): + p.text(name) + else: + p.text(mod + '.' + name) + + +def _repr_pprint(obj, p, cycle): + """A pprint that just redirects to the normal repr function.""" + # Find newlines and replace them with p.break_() + output = repr(obj) + lines = output.splitlines() + with p.group(): + for idx, output_line in enumerate(lines): + if idx: + p.break_() + p.text(output_line) + + +def _function_pprint(obj, p, cycle): + """Base pprint for all functions and builtin functions.""" + name = _safe_getattr(obj, '__qualname__', obj.__name__) + mod = obj.__module__ + if mod and mod not in ('__builtin__', 'builtins', 'exceptions'): + name = mod + '.' + name + try: + func_def = name + str(signature(obj)) + except ValueError: + func_def = name + p.text('' % func_def) + + +def _exception_pprint(obj, p, cycle): + """Base pprint for all exceptions.""" + name = getattr(obj.__class__, '__qualname__', obj.__class__.__name__) + if obj.__class__.__module__ not in ('exceptions', 'builtins'): + name = '%s.%s' % (obj.__class__.__module__, name) + step = len(name) + 1 + p.begin_group(step, name + '(') + for idx, arg in enumerate(getattr(obj, 'args', ())): + if idx: + p.text(',') + p.breakable() + p.pretty(arg) + p.end_group(step, ')') + + +#: the exception base +try: + _exception_base = BaseException +except NameError: + _exception_base = Exception + + +#: printers for builtin types +_type_pprinters = { + int: _repr_pprint, + float: _repr_pprint, + str: _repr_pprint, + tuple: _seq_pprinter_factory('(', ')'), + list: _seq_pprinter_factory('[', ']'), + dict: _dict_pprinter_factory('{', '}'), + set: _set_pprinter_factory('{', '}'), + frozenset: _set_pprinter_factory('frozenset({', '})'), + super: _super_pprint, + _re_pattern_type: _re_pattern_pprint, + type: _type_pprint, + types.FunctionType: _function_pprint, + types.BuiltinFunctionType: _function_pprint, + types.MethodType: _repr_pprint, + types.SimpleNamespace: _types_simplenamespace_pprint, + datetime.datetime: _repr_pprint, + datetime.timedelta: _repr_pprint, + _exception_base: _exception_pprint +} + +# render os.environ like a dict +_env_type = type(os.environ) +# future-proof in case os.environ becomes a plain dict? +if _env_type is not dict: + _type_pprinters[_env_type] = _dict_pprinter_factory('environ{', '}') + +try: + # In PyPy, types.DictProxyType is dict, setting the dictproxy printer + # using dict.setdefault avoids overwriting the dict printer + _type_pprinters.setdefault(types.DictProxyType, + _dict_pprinter_factory('dict_proxy({', '})')) + _type_pprinters[types.ClassType] = _type_pprint + _type_pprinters[types.SliceType] = _repr_pprint +except AttributeError: # Python 3 + _type_pprinters[types.MappingProxyType] = \ + _dict_pprinter_factory('mappingproxy({', '})') + _type_pprinters[slice] = _repr_pprint + +_type_pprinters[range] = _repr_pprint +_type_pprinters[bytes] = _repr_pprint + +#: printers for types specified by name +_deferred_type_pprinters = { +} + +def for_type(typ, func): + """ + Add a pretty printer for a given type. + """ + oldfunc = _type_pprinters.get(typ, None) + if func is not None: + # To support easy restoration of old pprinters, we need to ignore Nones. + _type_pprinters[typ] = func + return oldfunc + +def for_type_by_name(type_module, type_name, func): + """ + Add a pretty printer for a type specified by the module and name of a type + rather than the type object itself. + """ + key = (type_module, type_name) + oldfunc = _deferred_type_pprinters.get(key, None) + if func is not None: + # To support easy restoration of old pprinters, we need to ignore Nones. + _deferred_type_pprinters[key] = func + return oldfunc + + +#: printers for the default singletons +_singleton_pprinters = dict.fromkeys(map(id, [None, True, False, Ellipsis, + NotImplemented]), _repr_pprint) + + +def _defaultdict_pprint(obj, p, cycle): + name = obj.__class__.__name__ + with p.group(len(name) + 1, name + '(', ')'): + if cycle: + p.text('...') + else: + p.pretty(obj.default_factory) + p.text(',') + p.breakable() + p.pretty(dict(obj)) + +def _ordereddict_pprint(obj, p, cycle): + name = obj.__class__.__name__ + with p.group(len(name) + 1, name + '(', ')'): + if cycle: + p.text('...') + elif len(obj): + p.pretty(list(obj.items())) + +def _deque_pprint(obj, p, cycle): + name = obj.__class__.__name__ + with p.group(len(name) + 1, name + '(', ')'): + if cycle: + p.text('...') + else: + p.pretty(list(obj)) + + +def _counter_pprint(obj, p, cycle): + name = obj.__class__.__name__ + with p.group(len(name) + 1, name + '(', ')'): + if cycle: + p.text('...') + elif len(obj): + p.pretty(dict(obj)) + +for_type_by_name('collections', 'defaultdict', _defaultdict_pprint) +for_type_by_name('collections', 'OrderedDict', _ordereddict_pprint) +for_type_by_name('collections', 'deque', _deque_pprint) +for_type_by_name('collections', 'Counter', _counter_pprint) + +if __name__ == '__main__': + from random import randrange + class Foo(object): + def __init__(self): + self.foo = 1 + self.bar = re.compile(r'\s+') + self.blub = dict.fromkeys(range(30), randrange(1, 40)) + self.hehe = 23424.234234 + self.list = ["blub", "blah", self] + + def get_foo(self): + print("foo") + + pprint(Foo(), verbose=True) diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/security.py b/.venv/lib/python3.8/site-packages/IPython/lib/security.py new file mode 100644 index 00000000..91a2344e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/security.py @@ -0,0 +1,114 @@ +""" +Password generation for the IPython notebook. +""" +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- +# Stdlib +import getpass +import hashlib +import random + +# Our own +from IPython.core.error import UsageError +from IPython.utils.py3compat import encode + +#----------------------------------------------------------------------------- +# Globals +#----------------------------------------------------------------------------- + +# Length of the salt in nr of hex chars, which implies salt_len * 4 +# bits of randomness. +salt_len = 12 + +#----------------------------------------------------------------------------- +# Functions +#----------------------------------------------------------------------------- + +def passwd(passphrase=None, algorithm='sha1'): + """Generate hashed password and salt for use in notebook configuration. + + In the notebook configuration, set `c.NotebookApp.password` to + the generated string. + + Parameters + ---------- + passphrase : str + Password to hash. If unspecified, the user is asked to input + and verify a password. + algorithm : str + Hashing algorithm to use (e.g, 'sha1' or any argument supported + by :func:`hashlib.new`). + + Returns + ------- + hashed_passphrase : str + Hashed password, in the format 'hash_algorithm:salt:passphrase_hash'. + + Examples + -------- + >>> passwd('mypassword') + 'sha1:7cf3:b7d6da294ea9592a9480c8f52e63cd42cfb9dd12' + + """ + if passphrase is None: + for i in range(3): + p0 = getpass.getpass('Enter password: ') + p1 = getpass.getpass('Verify password: ') + if p0 == p1: + passphrase = p0 + break + else: + print('Passwords do not match.') + else: + raise UsageError('No matching passwords found. Giving up.') + + h = hashlib.new(algorithm) + salt = ('%0' + str(salt_len) + 'x') % random.getrandbits(4 * salt_len) + h.update(encode(passphrase, 'utf-8') + encode(salt, 'ascii')) + + return ':'.join((algorithm, salt, h.hexdigest())) + + +def passwd_check(hashed_passphrase, passphrase): + """Verify that a given passphrase matches its hashed version. + + Parameters + ---------- + hashed_passphrase : str + Hashed password, in the format returned by `passwd`. + passphrase : str + Passphrase to validate. + + Returns + ------- + valid : bool + True if the passphrase matches the hash. + + Examples + -------- + >>> from IPython.lib.security import passwd_check + >>> passwd_check('sha1:0e112c3ddfce:a68df677475c2b47b6e86d0467eec97ac5f4b85a', + ... 'mypassword') + True + + >>> passwd_check('sha1:0e112c3ddfce:a68df677475c2b47b6e86d0467eec97ac5f4b85a', + ... 'anotherpassword') + False + """ + try: + algorithm, salt, pw_digest = hashed_passphrase.split(':', 2) + except (ValueError, TypeError): + return False + + try: + h = hashlib.new(algorithm) + except ValueError: + return False + + if len(pw_digest) == 0: + return False + + h.update(encode(passphrase, 'utf-8') + encode(salt, 'ascii')) + + return h.hexdigest() == pw_digest diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/tests/__init__.py b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..06686eb3 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_backgroundjobs.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_backgroundjobs.cpython-38.pyc new file mode 100644 index 00000000..584e535c Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_backgroundjobs.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_clipboard.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_clipboard.cpython-38.pyc new file mode 100644 index 00000000..4dff410f Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_clipboard.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_deepreload.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_deepreload.cpython-38.pyc new file mode 100644 index 00000000..4f7bfaf1 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_deepreload.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_display.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_display.cpython-38.pyc new file mode 100644 index 00000000..174136e7 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_display.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_editorhooks.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_editorhooks.cpython-38.pyc new file mode 100644 index 00000000..94d7dc04 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_editorhooks.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_imports.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_imports.cpython-38.pyc new file mode 100644 index 00000000..c1591c92 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_imports.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_latextools.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_latextools.cpython-38.pyc new file mode 100644 index 00000000..9789eb96 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_latextools.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_lexers.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_lexers.cpython-38.pyc new file mode 100644 index 00000000..1878c91a Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_lexers.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_pretty.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_pretty.cpython-38.pyc new file mode 100644 index 00000000..edc29565 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_pretty.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_security.cpython-38.pyc b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_security.cpython-38.pyc new file mode 100644 index 00000000..d819b20d Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/tests/__pycache__/test_security.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/tests/test.wav b/.venv/lib/python3.8/site-packages/IPython/lib/tests/test.wav new file mode 100644 index 00000000..aa74fc5b Binary files /dev/null and b/.venv/lib/python3.8/site-packages/IPython/lib/tests/test.wav differ diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/tests/test_backgroundjobs.py b/.venv/lib/python3.8/site-packages/IPython/lib/tests/test_backgroundjobs.py new file mode 100644 index 00000000..d7793f50 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/tests/test_backgroundjobs.py @@ -0,0 +1,88 @@ +"""Tests for pylab tools module. +""" +#----------------------------------------------------------------------------- +# Copyright (c) 2011, the IPython Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +# Stdlib imports +import time + +# Third-party imports +import nose.tools as nt + +# Our own imports +from IPython.lib import backgroundjobs as bg + +#----------------------------------------------------------------------------- +# Globals and constants +#----------------------------------------------------------------------------- +t_short = 0.0001 # very short interval to wait on jobs + +#----------------------------------------------------------------------------- +# Local utilities +#----------------------------------------------------------------------------- +def sleeper(interval=t_short, *a, **kw): + args = dict(interval=interval, + other_args=a, + kw_args=kw) + time.sleep(interval) + return args + +def crasher(interval=t_short, *a, **kw): + time.sleep(interval) + raise Exception("Dead job with interval %s" % interval) + +#----------------------------------------------------------------------------- +# Classes and functions +#----------------------------------------------------------------------------- + +def test_result(): + """Test job submission and result retrieval""" + jobs = bg.BackgroundJobManager() + j = jobs.new(sleeper) + j.join() + nt.assert_equal(j.result['interval'], t_short) + + +def test_flush(): + """Test job control""" + jobs = bg.BackgroundJobManager() + j = jobs.new(sleeper) + j.join() + nt.assert_equal(len(jobs.completed), 1) + nt.assert_equal(len(jobs.dead), 0) + jobs.flush() + nt.assert_equal(len(jobs.completed), 0) + + +def test_dead(): + """Test control of dead jobs""" + jobs = bg.BackgroundJobManager() + j = jobs.new(crasher) + j.join() + nt.assert_equal(len(jobs.completed), 0) + nt.assert_equal(len(jobs.dead), 1) + jobs.flush() + nt.assert_equal(len(jobs.dead), 0) + + +def test_longer(): + """Test control of longer-running jobs""" + jobs = bg.BackgroundJobManager() + # Sleep for long enough for the following two checks to still report the + # job as running, but not so long that it makes the test suite noticeably + # slower. + j = jobs.new(sleeper, 0.1) + nt.assert_equal(len(jobs.running), 1) + nt.assert_equal(len(jobs.completed), 0) + j.join() + nt.assert_equal(len(jobs.running), 0) + nt.assert_equal(len(jobs.completed), 1) diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/tests/test_clipboard.py b/.venv/lib/python3.8/site-packages/IPython/lib/tests/test_clipboard.py new file mode 100644 index 00000000..f1050bfb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/tests/test_clipboard.py @@ -0,0 +1,21 @@ +import nose.tools as nt + +from IPython.core.error import TryNext +from IPython.lib.clipboard import ClipboardEmpty +from IPython.testing.decorators import skip_if_no_x11 + +@skip_if_no_x11 +def test_clipboard_get(): + # Smoketest for clipboard access - we can't easily guarantee that the + # clipboard is accessible and has something on it, but this tries to + # exercise the relevant code anyway. + try: + a = get_ipython().hooks.clipboard_get() + except ClipboardEmpty: + # Nothing in clipboard to get + pass + except TryNext: + # No clipboard access API available + pass + else: + nt.assert_is_instance(a, str) diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/tests/test_deepreload.py b/.venv/lib/python3.8/site-packages/IPython/lib/tests/test_deepreload.py new file mode 100644 index 00000000..abc57a38 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/tests/test_deepreload.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +"""Test suite for the deepreload module.""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +import os + +import nose.tools as nt + +from IPython.utils.syspathcontext import prepended_to_syspath +from IPython.utils.tempdir import TemporaryDirectory +from IPython.lib.deepreload import reload as dreload + +def test_deepreload(): + "Test that dreload does deep reloads and skips excluded modules." + with TemporaryDirectory() as tmpdir: + with prepended_to_syspath(tmpdir): + with open(os.path.join(tmpdir, 'A.py'), 'w') as f: + f.write("class Object(object):\n pass\n") + with open(os.path.join(tmpdir, 'B.py'), 'w') as f: + f.write("import A\n") + import A + import B + + # Test that A is not reloaded. + obj = A.Object() + dreload(B, exclude=['A']) + nt.assert_true(isinstance(obj, A.Object)) + + # Test that A is reloaded. + obj = A.Object() + dreload(B) + nt.assert_false(isinstance(obj, A.Object)) diff --git a/.venv/lib/python3.8/site-packages/IPython/lib/tests/test_display.py b/.venv/lib/python3.8/site-packages/IPython/lib/tests/test_display.py new file mode 100644 index 00000000..7e98a185 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/IPython/lib/tests/test_display.py @@ -0,0 +1,266 @@ +"""Tests for IPython.lib.display. + +""" +#----------------------------------------------------------------------------- +# Copyright (c) 2012, the IPython Development Team. +# +# Distributed under the terms of the Modified BSD License. +# +# The full license is in the file COPYING.txt, distributed with this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- +from tempfile import NamedTemporaryFile, mkdtemp +from os.path import split, join as pjoin, dirname +import pathlib +from unittest import TestCase, mock +import struct +import wave +from io import BytesIO + +# Third-party imports +import nose.tools as nt + +try: + import numpy +except ImportError: + pass + +# Our own imports +from IPython.lib import display + +from IPython.testing.decorators import skipif_not_numpy + +#----------------------------------------------------------------------------- +# Classes and functions +#----------------------------------------------------------------------------- + +#-------------------------- +# FileLink tests +#-------------------------- + +def test_instantiation_FileLink(): + """FileLink: Test class can be instantiated""" + fl = display.FileLink('example.txt') + # TODO: remove if when only Python >= 3.6 is supported + fl = display.FileLink(pathlib.PurePath('example.txt')) + +def test_warning_on_non_existent_path_FileLink(): + """FileLink: Calling _repr_html_ on non-existent files returns a warning + """ + fl = display.FileLink('example.txt') + nt.assert_true(fl._repr_html_().startswith('Path (example.txt)')) + +def test_existing_path_FileLink(): + """FileLink: Calling _repr_html_ functions as expected on existing filepath + """ + tf = NamedTemporaryFile() + fl = display.FileLink(tf.name) + actual = fl._repr_html_() + expected = "%s
" % (tf.name,tf.name) + nt.assert_equal(actual,expected) + +def test_existing_path_FileLink_repr(): + """FileLink: Calling repr() functions as expected on existing filepath + """ + tf = NamedTemporaryFile() + fl = display.FileLink(tf.name) + actual = repr(fl) + expected = tf.name + nt.assert_equal(actual,expected) + +def test_error_on_directory_to_FileLink(): + """FileLink: Raises error when passed directory + """ + td = mkdtemp() + nt.assert_raises(ValueError,display.FileLink,td) + +#-------------------------- +# FileLinks tests +#-------------------------- + +def test_instantiation_FileLinks(): + """FileLinks: Test class can be instantiated + """ + fls = display.FileLinks('example') + +def test_warning_on_non_existent_path_FileLinks(): + """FileLinks: Calling _repr_html_ on non-existent files returns a warning + """ + fls = display.FileLinks('example') + nt.assert_true(fls._repr_html_().startswith('Path (example)')) + +def test_existing_path_FileLinks(): + """FileLinks: Calling _repr_html_ functions as expected on existing dir + """ + td = mkdtemp() + tf1 = NamedTemporaryFile(dir=td) + tf2 = NamedTemporaryFile(dir=td) + fl = display.FileLinks(td) + actual = fl._repr_html_() + actual = actual.split('\n') + actual.sort() + # the links should always have forward slashes, even on windows, so replace + # backslashes with forward slashes here + expected = ["%s/
" % td, + "  %s
" %\ + (tf2.name.replace("\\","/"),split(tf2.name)[1]), + "  %s
" %\ + (tf1.name.replace("\\","/"),split(tf1.name)[1])] + expected.sort() + # We compare the sorted list of links here as that's more reliable + nt.assert_equal(actual,expected) + +def test_existing_path_FileLinks_alt_formatter(): + """FileLinks: Calling _repr_html_ functions as expected w/ an alt formatter + """ + td = mkdtemp() + tf1 = NamedTemporaryFile(dir=td) + tf2 = NamedTemporaryFile(dir=td) + def fake_formatter(dirname,fnames,included_suffixes): + return ["hello","world"] + fl = display.FileLinks(td,notebook_display_formatter=fake_formatter) + actual = fl._repr_html_() + actual = actual.split('\n') + actual.sort() + expected = ["hello","world"] + expected.sort() + # We compare the sorted list of links here as that's more reliable + nt.assert_equal(actual,expected) + +def test_existing_path_FileLinks_repr(): + """FileLinks: Calling repr() functions as expected on existing directory """ + td = mkdtemp() + tf1 = NamedTemporaryFile(dir=td) + tf2 = NamedTemporaryFile(dir=td) + fl = display.FileLinks(td) + actual = repr(fl) + actual = actual.split('\n') + actual.sort() + expected = ['%s/' % td, ' %s' % split(tf1.name)[1],' %s' % split(tf2.name)[1]] + expected.sort() + # We compare the sorted list of links here as that's more reliable + nt.assert_equal(actual,expected) + +def test_existing_path_FileLinks_repr_alt_formatter(): + """FileLinks: Calling repr() functions as expected w/ alt formatter + """ + td = mkdtemp() + tf1 = NamedTemporaryFile(dir=td) + tf2 = NamedTemporaryFile(dir=td) + def fake_formatter(dirname,fnames,included_suffixes): + return ["hello","world"] + fl = display.FileLinks(td,terminal_display_formatter=fake_formatter) + actual = repr(fl) + actual = actual.split('\n') + actual.sort() + expected = ["hello","world"] + expected.sort() + # We compare the sorted list of links here as that's more reliable + nt.assert_equal(actual,expected) + +def test_error_on_file_to_FileLinks(): + """FileLinks: Raises error when passed file + """ + td = mkdtemp() + tf1 = NamedTemporaryFile(dir=td) + nt.assert_raises(ValueError,display.FileLinks,tf1.name) + +def test_recursive_FileLinks(): + """FileLinks: Does not recurse when recursive=False + """ + td = mkdtemp() + tf = NamedTemporaryFile(dir=td) + subtd = mkdtemp(dir=td) + subtf = NamedTemporaryFile(dir=subtd) + fl = display.FileLinks(td) + actual = str(fl) + actual = actual.split('\n') + nt.assert_equal(len(actual), 4, actual) + fl = display.FileLinks(td, recursive=False) + actual = str(fl) + actual = actual.split('\n') + nt.assert_equal(len(actual), 2, actual) + +def test_audio_from_file(): + path = pjoin(dirname(__file__), 'test.wav') + display.Audio(filename=path) + +class TestAudioDataWithNumpy(TestCase): + + @skipif_not_numpy + def test_audio_from_numpy_array(self): + test_tone = get_test_tone() + audio = display.Audio(test_tone, rate=44100) + nt.assert_equal(len(read_wav(audio.data)), len(test_tone)) + + @skipif_not_numpy + def test_audio_from_list(self): + test_tone = get_test_tone() + audio = display.Audio(list(test_tone), rate=44100) + nt.assert_equal(len(read_wav(audio.data)), len(test_tone)) + + @skipif_not_numpy + def test_audio_from_numpy_array_without_rate_raises(self): + nt.assert_raises(ValueError, display.Audio, get_test_tone()) + + @skipif_not_numpy + def test_audio_data_normalization(self): + expected_max_value = numpy.iinfo(numpy.int16).max + for scale in [1, 0.5, 2]: + audio = display.Audio(get_test_tone(scale), rate=44100) + actual_max_value = numpy.max(numpy.abs(read_wav(audio.data))) + nt.assert_equal(actual_max_value, expected_max_value) + + @skipif_not_numpy + def test_audio_data_without_normalization(self): + max_int16 = numpy.iinfo(numpy.int16).max + for scale in [1, 0.5, 0.2]: + test_tone = get_test_tone(scale) + test_tone_max_abs = numpy.max(numpy.abs(test_tone)) + expected_max_value = int(max_int16 * test_tone_max_abs) + audio = display.Audio(test_tone, rate=44100, normalize=False) + actual_max_value = numpy.max(numpy.abs(read_wav(audio.data))) + nt.assert_equal(actual_max_value, expected_max_value) + + def test_audio_data_without_normalization_raises_for_invalid_data(self): + nt.assert_raises( + ValueError, + lambda: display.Audio([1.001], rate=44100, normalize=False)) + nt.assert_raises( + ValueError, + lambda: display.Audio([-1.001], rate=44100, normalize=False)) + +def simulate_numpy_not_installed(): + try: + import numpy + return mock.patch('numpy.array', mock.MagicMock(side_effect=ImportError)) + except ModuleNotFoundError: + return lambda x:x + +@simulate_numpy_not_installed() +class TestAudioDataWithoutNumpy(TestAudioDataWithNumpy): + # All tests from `TestAudioDataWithNumpy` are inherited. + + @skipif_not_numpy + def test_audio_raises_for_nested_list(self): + stereo_signal = [list(get_test_tone())] * 2 + nt.assert_raises( + TypeError, + lambda: display.Audio(stereo_signal, rate=44100)) + +@skipif_not_numpy +def get_test_tone(scale=1): + return numpy.sin(2 * numpy.pi * 440 * numpy.linspace(0, 1, 44100)) * scale + +def read_wav(data): + with wave.open(BytesIO(data)) as wave_file: + wave_data = wave_file.readframes(wave_file.getnframes()) + num_samples = wave_file.getnframes() * wave_file.getnchannels() + return struct.unpack('<%sh' % num_samples, wave_data) + +def test_code_from_file(): + c = display.Code(filename=__file__) + assert c._repr_html_().startswith(' + {% endblock %} + {% block head %} + {% endblock %} + {% block head_tail %} + {% endblock %} + + + {% block page_body %} +
+ + + {% block messages %} + {{ layout.messages() }} + {% endblock %} + + {# store the jinja2 context for form_rules rendering logic #} + {% set render_ctx = h.resolve_ctx() %} + + {% block body %}{% endblock %} +
+ {% endblock %} + + {% block tail_js %} + + + + + {% if admin_view.extra_js %} + {% for js_url in admin_view.extra_js %} + + {% endfor %} + {% endif %} + {% endblock %} + + {% block tail %} + {% endblock %} + + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/file/form.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/file/form.html new file mode 100644 index 00000000..7a4474ad --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/file/form.html @@ -0,0 +1,9 @@ +{% extends 'admin/master.html' %} +{% import 'admin/lib.html' as lib with context %} + +{% block body %} + {% block header %}

{{ header_text }}

{% endblock %} + {% block fa_form %} + {{ lib.render_form(form, dir_url) }} + {% endblock %} +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/file/list.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/file/list.html new file mode 100644 index 00000000..f3883c9c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/file/list.html @@ -0,0 +1,196 @@ +{% extends 'admin/master.html' %} +{% import 'admin/lib.html' as lib with context %} +{% import 'admin/actions.html' as actionslib with context %} + +{% block body %} + {% block breadcrums %} + + {% endblock %} + + {% block file_list_table %} +
+ + + + {% block list_header scoped %} + {% if actions %} + + {% endif %} + + {% for column in admin_view.column_list %} + + {% endfor %} + {% endblock %} + + + {% for name, path, is_dir, size, date in items %} + + {% block list_row scoped %} + {% if actions %} + + {% endif %} + + {% if is_dir %} + + {% else %} + + {% if admin_view.is_column_visible('size') %} + + {% endif %} + {% if admin_view.is_column_visible('date') %} + + {% endif %} + {% endif %} + {% endblock %} + + {% endfor %} +
+ +   + {% if admin_view.is_column_sortable(column) %} + {% if sort_column == column %} + + {{ admin_view.column_label(column) }} + {% if sort_desc %} + + {% else %} + + {% endif %} + + {% else %} + {{ admin_view.column_label(column) }} + {% endif %} + {% else %} + {{ _gettext(admin_view.column_label(column)) }} + {% endif %} +
+ {% if not is_dir %} + + {% endif %} + + {% block list_row_actions scoped %} + {% if admin_view.can_rename and path and name != '..' %} + {%- if admin_view.rename_modal -%} + {{ lib.add_modal_button(url=get_url('.rename', path=path, modal=True), + title=_gettext('Rename File'), + content='') }} + {% else %} + + + + {%- endif -%} + {% endif %} + {%- if admin_view.can_delete and path -%} + {% if is_dir %} + {% if name != '..' and admin_view.can_delete_dirs %} +
+ {{ delete_form.path(value=path) }} + {% if delete_form.csrf_token %} + {{ delete_form.csrf_token }} + {% elif csrf_token %} + + {% endif %} + +
+ {% endif %} + {% else %} +
+ {{ delete_form.path(value=path) }} + {% if delete_form.csrf_token %} + {{ delete_form.csrf_token }} + {% elif csrf_token %} + + {% endif %} + +
+ {% endif %} + {%- endif -%} + {% endblock %} +
+ + {{ name }} + + + {% if admin_view.can_download %} + {%- if admin_view.edit_modal and admin_view.is_file_editable(path) -%} + {{ lib.add_modal_button(url=get_file_url(path, modal=True)|safe, + btn_class='', content=name) }} + {% else %} + {{ name }} + {%- endif -%} + {% else %} + {{ name }} + {% endif %} + + {{ size|filesizeformat }} + + {{ timestamp_format(date) }} +
+
+ {% endblock %} + {% block toolbar %} +
+ {% if admin_view.can_upload %} +
+ {%- if admin_view.upload_modal -%} + {{ lib.add_modal_button(url=get_dir_url('.upload', path=dir_path, modal=True), + btn_class="btn btn-large", + content=_gettext('Upload File')) }} + {% else %} + {{ _gettext('Upload File') }} + {%- endif -%} +
+ {% endif %} + {% if admin_view.can_mkdir %} +
+ {%- if admin_view.mkdir_modal -%} + {{ lib.add_modal_button(url=get_dir_url('.mkdir', path=dir_path, modal=True), + btn_class="btn btn-large", + content=_gettext('Create Directory')) }} + {% else %} + {{ _gettext('Create Directory') }} + {%- endif -%} +
+ {% endif %} + {% if actions %} +
+ {{ actionslib.dropdown(actions, 'dropdown-toggle btn btn-large') }} +
+ {% endif %} +
+ {% endblock %} + + {% block actions %} + {{ actionslib.form(actions, get_url('.action_view')) }} + {% endblock %} + + {%- if admin_view.rename_modal or admin_view.mkdir_modal + or admin_view.upload_modal or admin_view.edit_modal -%} + {{ lib.add_modal_window() }} + {%- endif -%} +{% endblock %} + +{% block tail %} + {{ super() }} + {{ actionslib.script(_gettext('Please select at least one file.'), + actions, + actions_confirmation) }} +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/file/modals/form.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/file/modals/form.html new file mode 100644 index 00000000..6148596c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/file/modals/form.html @@ -0,0 +1,18 @@ +{% import 'admin/static.html' as admin_static with context %} +{% import 'admin/lib.html' as lib with context %} + +{% block body %} + {# content added to modal-content #} + {% block fa_form %} + {{ lib.render_form(form, dir_url, action=request.url, is_modal=True) }} + {% endblock %} +{% endblock %} + +{% block tail %} + + + +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/index.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/index.html new file mode 100644 index 00000000..fbfdf4c0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/index.html @@ -0,0 +1,4 @@ +{% extends 'admin/master.html' %} + +{% block body %} +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/layout.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/layout.html new file mode 100644 index 00000000..6ac9e9be --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/layout.html @@ -0,0 +1,96 @@ +{% macro menu_icon(item) -%} +{% set icon_type = item.get_icon_type() %} +{%- if icon_type %} + {% set icon_value = item.get_icon_value() %} + {% if icon_type == 'glyph' %} + + {% elif icon_type == 'fa' %} + + {% elif icon_type == 'image' %} + menu image + {% elif icon_type == 'image-url' %} + menu image + {% endif %} +{% endif %} +{%- endmacro %} + +{% macro menu(menu_root=None) %} + {% if menu_root is none %}{% set menu_root = admin_view.admin.menu() %}{% endif %} + {%- for item in menu_root %} + {%- if item.is_category() -%} + {% set children = item.get_children() %} + {%- if children %} + {% set class_name = item.get_class_name() or '' %} + {%- if item.is_active(admin_view) %} + + {% endif %} + {%- else %} + {%- if item.is_accessible() and item.is_visible() -%} + {% set class_name = item.get_class_name() %} + {%- if item.is_active(admin_view) %} +
  • + {%- else %} + + {%- endif %} + {{ menu_icon(item) }}{{ item.name }} +
  • + {%- endif -%} + {% endif -%} + {% endfor %} +{% endmacro %} + +{% macro menu_links(links=None) %} + {% if links is none %}{% set links = admin_view.admin.menu_links() %}{% endif %} + {% for item in links %} + {% set class_name = item.get_class_name() %} + {% if item.is_accessible() and item.is_visible() %} + + {{ menu_icon(item) }}{{ item.name }} + + {% endif %} + {% endfor %} +{% endmacro %} + +{% macro messages() %} + {% with messages = get_flashed_messages(with_categories=True) %} + {% if messages %} + {% for category, m in messages %} + {% if category %} +
    + {% else %} +
    + {% endif %} + x + {{ m }} +
    + {% endfor %} + {% endif %} + {% endwith %} +{% endmacro %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/lib.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/lib.html new file mode 100644 index 00000000..f05d5f93 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/lib.html @@ -0,0 +1,265 @@ +{% import 'admin/static.html' as admin_static with context %} + +{# ---------------------- Pager -------------------------- #} +{% macro pager(page, pages, generator) -%} +{% if pages > 1 %} + +{% endif %} +{%- endmacro %} + +{% macro simple_pager(page, have_next, generator) -%} + +{%- endmacro %} + +{# ---------------------- Modal Window -------------------------- #} +{% macro add_modal_window(modal_window_id='fa_modal_window') %} + +{% endmacro %} + +{% macro add_modal_button(url='', title='', content='', modal_window_id='fa_modal_window', btn_class='icon') %} + + {{ content|safe }} + +{% endmacro %} + +{# ---------------------- Forms -------------------------- #} +{% macro render_field(form, field, kwargs={}, caller=None) %} + {% set direct_error = h.is_field_error(field.errors) %} +
    +
    + +
    +
    +
    + {{ field(**kwargs)|safe }} +
    + {% if field.description %} +

    {{ field.description|safe }}

    + {% endif %} + {% if direct_error %} +
      + {% for e in field.errors if e is string %} +
    • {{ e }}
    • + {% endfor %} +
    + {% endif %} +
    + {% if caller %} + {{ caller(form, field, direct_error, kwargs) }} + {% endif %} +
    +{% endmacro %} + +{% macro render_header(form, text) %} +

    {{ text }}

    +{% endmacro %} + +{% macro render_form_fields(form, form_opts=None) %} + {% if form.hidden_tag is defined %} + {{ form.hidden_tag() }} + {% else %} + {% if csrf_token %} + + {% endif %} + {% for f in form if f.widget.input_type == 'hidden' %} + {{ f }} + {% endfor %} + {% endif %} + + {% if form_opts and form_opts.form_rules %} + {% for r in form_opts.form_rules %} + {{ r(form, form_opts=form_opts) }} + {% endfor %} + {% else %} + {% for f in form if f.widget.input_type != 'hidden' %} + {% if form_opts %} + {% set kwargs = form_opts.widget_args.get(f.short_name, {}) %} + {% else %} + {% set kwargs = {} %} + {% endif %} + {{ render_field(form, f, kwargs) }} + {% endfor %} + {% endif %} +{% endmacro %} + +{% macro form_tag(form=None, action=None) %} +
    +
    + {{ caller() }} +
    +
    +{% endmacro %} + +{% macro render_form_buttons(cancel_url, extra=None, is_modal=False) %} +
    +
    +
    + + {% if extra %} + {{ extra }} + {% endif %} + {% if cancel_url %} + {{ _gettext('Cancel') }} + {% endif %} +
    +
    +{% endmacro %} + +{% macro render_form(form, cancel_url, extra=None, form_opts=None, action=None, is_modal=False) -%} + {% call form_tag(action=action) %} + {{ render_form_fields(form, form_opts=form_opts) }} + {{ render_form_buttons(cancel_url, extra, is_modal) }} + {% endcall %} +{% endmacro %} + +{% macro form_css() %} + + + {% if config.MAPBOX_MAP_ID %} + + + {% endif %} + {% if editable_columns %} + + {% endif %} +{% endmacro %} + +{% macro form_js() %} + {% if config.MAPBOX_MAP_ID %} + + + + {% if config.MAPBOX_SEARCH %} + + + {% endif %} + {% endif %} + + {% if editable_columns %} + + {% endif %} + +{% endmacro %} + +{% macro extra() %} + {% if admin_view.can_create %} + + {% endif %} + {% if admin_view.can_edit %} + + {% endif %} +{% endmacro %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/master.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/master.html new file mode 100644 index 00000000..8f27dad0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/master.html @@ -0,0 +1 @@ +{% extends admin_base_template %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/create.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/create.html new file mode 100644 index 00000000..9e0834ed --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/create.html @@ -0,0 +1,30 @@ +{% extends 'admin/master.html' %} +{% import 'admin/lib.html' as lib with context %} +{% from 'admin/lib.html' import extra with context %} {# backward compatible #} + +{% block head %} + {{ super() }} + {{ lib.form_css() }} +{% endblock %} + +{% block body %} + {% block navlinks %} + + {% endblock %} + + {% block create_form %} + {{ lib.render_form(form, return_url, extra(), form_opts) }} + {% endblock %} +{% endblock %} + +{% block tail %} + {{ super() }} + {{ lib.form_js() }} +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/details.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/details.html new file mode 100644 index 00000000..2d516b81 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/details.html @@ -0,0 +1,54 @@ +{% extends 'admin/master.html' %} +{% import 'admin/lib.html' as lib with context %} + +{% block body %} + {% block navlinks %} + + {% endblock %} + + {% block details_search %} +
    +
    + {{ _gettext('Filter') }} + +
    +
    + {% endblock %} + + {% block details_table %} + + {% for c, name in details_columns %} + + + + + {% endfor %} +
    + {{ name }} + + {{ get_value(model, c) }} +
    + {% endblock %} +{% endblock %} + +{% block tail %} + {{ super() }} + +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/edit.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/edit.html new file mode 100644 index 00000000..5bd40999 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/edit.html @@ -0,0 +1,40 @@ +{% extends 'admin/master.html' %} +{% import 'admin/lib.html' as lib with context %} +{% from 'admin/lib.html' import extra with context %} {# backward compatible #} + +{% block head %} + {{ super() }} + {{ lib.form_css() }} +{% endblock %} + +{% block body %} + {% block navlinks %} + + {% endblock %} + + {% block edit_form %} + {{ lib.render_form(form, return_url, extra(), form_opts) }} + {% endblock %} +{% endblock %} + +{% block tail %} + {{ super() }} + {{ lib.form_js() }} +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/inline_field_list.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/inline_field_list.html new file mode 100644 index 00000000..12073343 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/inline_field_list.html @@ -0,0 +1,15 @@ +{% import 'admin/model/inline_list_base.html' as base with context %} + +{% macro render_field(field) %} + {{ field }} + + {% if h.is_field_error(field.errors) %} +
      + {% for e in field.errors if e is string %} +
    • {{ e }}
    • + {% endfor %} +
    + {% endif %} +{% endmacro %} + +{{ base.render_inline_fields(field, template, render_field, check) }} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/inline_form.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/inline_form.html new file mode 100644 index 00000000..6ae3f6c0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/inline_form.html @@ -0,0 +1,4 @@ +{% import 'admin/lib.html' as lib with context %} +
    + {{ lib.render_form_fields(field.form, form_opts=form_opts) }} +
    diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/inline_list_base.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/inline_list_base.html new file mode 100644 index 00000000..c0fb9faf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/inline_list_base.html @@ -0,0 +1,42 @@ +{% macro render_inline_fields(field, template, render, check=None) %} +
    + {# existing inline form fields #} +
    + {% for subfield in field %} +
    + {%- if not check or check(subfield) %} + + {{ field.label.text }} #{{ loop.index }} +
    + {% if subfield.get_pk and subfield.get_pk() %} + + + {% else %} + + {% endif %} +
    +
    + {%- endif -%} + {{ render(subfield) }} +
    + {% endfor %} +
    + + {# template for new inline form fields #} +
    + {% filter forceescape %} +
    + + {{ _gettext('New') }} {{ field.label.text }} +
    + +
    +
    + {{ render(template) }} +
    + {% endfilter %} +
    + + {{ _gettext('Add') }} {{ field.label.text }} +
    +{% endmacro %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/layout.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/layout.html new file mode 100644 index 00000000..39631398 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/layout.html @@ -0,0 +1,105 @@ +{% macro filter_options(btn_class='dropdown-toggle') %} + + {{ _gettext('Add Filter') }} + + +{% endmacro %} + +{% macro export_options(btn_class='dropdown-toggle') %} + {% if admin_view.export_types|length > 1 %} + + {% else %} +
  • + {{ _gettext('Export') }} +
  • + {% endif %} +{% endmacro %} + +{% macro filter_form() %} +
    + {% for arg_name, arg_value in extra_args.items() %} + + {% endfor %} + {% if sort_column is not none %} + + {% endif %} + {% if sort_desc %} + + {% endif %} + {% if search %} + + {% endif %} + {% if page_size != default_page_size %} + + {% endif %} +
    + + {% if active_filters %} + {{ _gettext('Reset Filters') }} + {% endif %} +
    + +
    +
    +
    +{% endmacro %} + +{% macro search_form(input_class=None) %} +
    + {% for flt_name, flt_value in filter_args.items() %} + + {% endfor %} + {% for arg_name, arg_value in extra_args.items() %} + + {% endfor %} + {% if page_size != default_page_size %} + + {% endif %} + {% if sort_column is not none %} + + {% endif %} + {% if sort_desc %} + + {% endif %} + {%- set full_search_placeholder = _gettext('Search') %} + {%- if search_placeholder %}{% set full_search_placeholder = [full_search_placeholder, search_placeholder] | join(": ") %}{% endif %} + {% if search %} +
    + + + + +
    + {% else %} + + {% endif %} +
    +{% endmacro %} + +{% macro page_size_form(generator, btn_class='dropdown-toggle') %} + + {{ page_size }} {{ _gettext('items') }} + + +{% endmacro %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/list.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/list.html new file mode 100755 index 00000000..c3b29593 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/list.html @@ -0,0 +1,196 @@ +{% extends 'admin/master.html' %} +{% import 'admin/lib.html' as lib with context %} +{% import 'admin/static.html' as admin_static with context%} +{% import 'admin/model/layout.html' as model_layout with context %} +{% import 'admin/actions.html' as actionlib with context %} +{% import 'admin/model/row_actions.html' as row_actions with context %} + +{% block head %} + {{ super() }} + {{ lib.form_css() }} +{% endblock %} + +{% block body %} + {% block model_menu_bar %} + + {% endblock %} + + {% if filters %} + {{ model_layout.filter_form() }} +
    + {% endif %} + + {% block model_list_table %} +
    + + + + {% block list_header scoped %} + {% if actions %} + + {% endif %} + {% block list_row_actions_header %} + {% if admin_view.column_display_actions %} + + {% endif %} + {% endblock %} + {% for c, name in list_columns %} + {% set column = loop.index0 %} + + {% endfor %} + {% endblock %} + + + {% for row in data %} + + {% block list_row scoped %} + {% if actions %} + + {% endif %} + {% block list_row_actions_column scoped %} + {% if admin_view.column_display_actions %} + + {%- endif -%} + {% endblock %} + + {% for c, name in list_columns %} + + {% endfor %} + {% endblock %} + + {% else %} + + + + {% endfor %} +
    + +   + {% if admin_view.is_sortable(c) %} + {% if sort_column == column %} + + {{ name }} + {% if sort_desc %} + + {% else %} + + {% endif %} + + {% else %} + {{ name }} + {% endif %} + {% else %} + {{ name }} + {% endif %} + {% if admin_view.column_descriptions.get(c) %} + + {% endif %} +
    + + + {% block list_row_actions scoped %} + {% for action in list_row_actions %} + {{ action.render_ctx(get_pk_value(row), row) }} + {% endfor %} + {% endblock %} + + {% if admin_view.is_editable(c) %} + {% set form = list_forms[get_pk_value(row)] %} + {% if form.csrf_token %} + {{ form[c](pk=get_pk_value(row), display_value=get_value(row, c), csrf=form.csrf_token._value()) }} + {% elif csrf_token %} + {{ form[c](pk=get_pk_value(row), display_value=get_value(row, c), csrf=csrf_token()) }} + {% else %} + {{ form[c](pk=get_pk_value(row), display_value=get_value(row, c)) }} + {% endif %} + {% else %} + {{ get_value(row, c) }} + {% endif %} +
    + {% block empty_list_message %} +
    + {{ admin_view.get_empty_list_message() }} +
    + {% endblock %} +
    +
    + {% block list_pager %} + {% if num_pages is not none %} + {{ lib.pager(page, num_pages, pager_url) }} + {% else %} + {{ lib.simple_pager(page, data|length == page_size, pager_url) }} + {% endif %} + {% endblock %} + {% endblock %} + + {{ actionlib.form(actions, get_url('.action_view')) }} + + {%- if admin_view.edit_modal or admin_view.create_modal or admin_view.details_modal -%} + {{ lib.add_modal_window() }} + {%- endif -%} +{% endblock %} + +{% block tail %} + {{ super() }} + + {% if filter_groups %} + + + {% endif %} + + {{ lib.form_js() }} + + + {{ actionlib.script(_gettext('Please select at least one record.'), + actions, + actions_confirmation) }} +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/modals/create.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/modals/create.html new file mode 100644 index 00000000..58b3f45e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/modals/create.html @@ -0,0 +1,25 @@ +{% import 'admin/static.html' as admin_static with context%} +{% import 'admin/lib.html' as lib with context %} + +{# store the jinja2 context for form_rules rendering logic #} +{% set render_ctx = h.resolve_ctx() %} + +{% block body %} + {# "save and add" button is removed from modal (it won't function properly) #} + {% block create_form %} + {{ lib.render_form(form, return_url, extra=None, form_opts=form_opts, + action=url_for('.create_view', url=return_url), + is_modal=True) }} + {% endblock %} +{% endblock %} + +{% block tail %} + + + +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/modals/details.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/modals/details.html new file mode 100755 index 00000000..a08a2e43 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/modals/details.html @@ -0,0 +1,40 @@ +{% import 'admin/static.html' as admin_static with context%} +{% import 'admin/lib.html' as lib with context %} + +{% block body %} + {% block details_search %} +
    +
    + {{ _gettext('Filter') }} + +
    +
    + {% endblock %} + + {% block details_table %} + + {% for c, name in details_columns %} + + + + + {% endfor %} +
    + {{ name }} + + {{ get_value(model, c) }} +
    + {% endblock %} +{% endblock %} + +{% block tail %} + + + + +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/modals/edit.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/modals/edit.html new file mode 100644 index 00000000..569aab99 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/modals/edit.html @@ -0,0 +1,25 @@ +{% import 'admin/static.html' as admin_static with context%} +{% import 'admin/lib.html' as lib with context %} + +{# store the jinja2 context for form_rules rendering logic #} +{% set render_ctx = h.resolve_ctx() %} + +{% block body %} + {# "save and continue" button is removed from modal (it won't function properly) #} + {% block edit_form %} + {{ lib.render_form(form, return_url, extra=None, form_opts=form_opts, + action=url_for('.edit_view', id=request.args.get('id'), url=return_url), + is_modal=True) }} + {% endblock %} +{% endblock %} + +{% block tail %} + + + +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/row_actions.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/row_actions.html new file mode 100644 index 00000000..31463ed2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/model/row_actions.html @@ -0,0 +1,38 @@ +{% import 'admin/lib.html' as lib with context %} + +{% macro link(action, url, icon_class=None) %} + + + +{% endmacro %} + +{% macro view_row(action, row_id, row) %} + {{ link(action, get_url('.details_view', id=row_id, url=return_url), 'fa fa-eye glyphicon icon-eye-open') }} +{% endmacro %} + +{% macro view_row_popup(action, row_id, row) %} + {{ lib.add_modal_button(url=get_url('.details_view', id=row_id, url=return_url, modal=True), title=action.title, content='') }} +{% endmacro %} + +{% macro edit_row(action, row_id, row) %} + {{ link(action, get_url('.edit_view', id=row_id, url=return_url), 'fa fa-pencil glyphicon icon-pencil') }} +{% endmacro %} + +{% macro edit_row_popup(action, row_id, row) %} + {{ lib.add_modal_button(url=get_url('.edit_view', id=row_id, url=return_url, modal=True), title=action.title, content='') }} +{% endmacro %} + +{% macro delete_row(action, row_id, row) %} +
    + {{ delete_form.id(value=get_pk_value(row)) }} + {{ delete_form.url(value=return_url) }} + {% if delete_form.csrf_token %} + {{ delete_form.csrf_token }} + {% elif csrf_token %} + + {% endif %} + +
    +{% endmacro %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/rediscli/console.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/rediscli/console.html new file mode 100644 index 00000000..465f817f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/rediscli/console.html @@ -0,0 +1,27 @@ +{% extends 'admin/master.html' %} +{% import 'admin/lib.html' as lib with context %} +{% import 'admin/static.html' as admin_static with context%} + +{% block head %} + {{ super() }} + +{% endblock %} + +{% block body %} +
    +
    +
    +
    +
    + +
    +
    +
    +{% endblock %} + +{% block tail %} + {{ super() }} + + + +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/rediscli/response.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/rediscli/response.html new file mode 100644 index 00000000..f4a950a8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/rediscli/response.html @@ -0,0 +1,32 @@ +{% macro render(item, depth=0) %} + {% set type = type_name(item) %} + + {% if type == 'tuple' or type == 'list' %} + {% if not item %} + Empty {{ type }}. + {% else %} + {% for n in item %} + {{ loop.index }}) {{ render(n, depth + 1) }}
    + {% endfor %} + {% endif %} + {% elif type == 'bool' %} + {% if depth == 0 and item %} + OK + {% else %} + {{ item }} + {% endif %} + {% elif type == 'str' or type == 'unicode' %} + "{{ item }}" + {% elif type == 'bytes' %} + "{{ item.decode('utf-8') }}" + {% elif type == 'TextWrapper' %} +
    {{ item }}
    + {% elif type == 'dict' %} + {% for k, v in item.items() %} + {{ loop.index }}) {{ k }} - {{ render(v, depth + 1) }}
    + {% endfor %} + {% else %} + {{ item }} + {% endif %} +{% endmacro %} +{{ render(result) }} \ No newline at end of file diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/static.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/static.html new file mode 100644 index 00000000..5735fbd4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap2/admin/static.html @@ -0,0 +1,3 @@ +{% macro url() -%} + {{ get_url('admin.static', *varargs, **kwargs) }} +{%- endmacro %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/actions.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/actions.html new file mode 100644 index 00000000..02257bb0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/actions.html @@ -0,0 +1,34 @@ +{% import 'admin/static.html' as admin_static with context %} + +{% macro dropdown(actions, btn_class='btn dropdown-toggle') -%} + {{ _gettext('With selected') }} + +{% endmacro %} + +{% macro form(actions, url) %} + {% if actions %} + + {% endif %} +{% endmacro %} + +{% macro script(message, actions, actions_confirmation) %} + {% if actions %} + + + + {% endif %} +{% endmacro %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/base.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/base.html new file mode 100644 index 00000000..823df517 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/base.html @@ -0,0 +1,98 @@ +{% import 'admin/layout.html' as layout with context -%} +{% import 'admin/static.html' as admin_static with context %} + + + + {% block title %}{% if admin_view.category %}{{ admin_view.category }} - {% endif %}{{ admin_view.name }} - {{ admin_view.admin.name }}{% endblock %} + {% block head_meta %} + + + + + + {% endblock %} + {% block head_css %} + + {%if config.get('FLASK_ADMIN_SWATCH', 'default') == 'default' %} + + {%endif%} + + + {% if admin_view.extra_css %} + {% for css_url in admin_view.extra_css %} + + {% endfor %} + {% endif %} + + {% endblock %} + {% block head %} + {% endblock %} + {% block head_tail %} + {% endblock %} + + + {% block page_body %} +
    + + + {% block messages %} + {{ layout.messages() }} + {% endblock %} + + {# store the jinja2 context for form_rules rendering logic #} + {% set render_ctx = h.resolve_ctx() %} + + {% block body %}{% endblock %} +
    + {% endblock %} + + {% block tail_js %} + + + + + + {% if admin_view.extra_js %} + {% for js_url in admin_view.extra_js %} + + {% endfor %} + {% endif %} + {% endblock %} + + {% block tail %} + {% endblock %} + + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/file/form.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/file/form.html new file mode 100644 index 00000000..7a4474ad --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/file/form.html @@ -0,0 +1,9 @@ +{% extends 'admin/master.html' %} +{% import 'admin/lib.html' as lib with context %} + +{% block body %} + {% block header %}

    {{ header_text }}

    {% endblock %} + {% block fa_form %} + {{ lib.render_form(form, dir_url) }} + {% endblock %} +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/file/list.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/file/list.html new file mode 100644 index 00000000..1fb093e1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/file/list.html @@ -0,0 +1,196 @@ +{% extends 'admin/master.html' %} +{% import 'admin/lib.html' as lib with context %} +{% import 'admin/actions.html' as actionslib with context %} + +{% block body %} + {% block breadcrums %} + + {% endblock %} + + {% block file_list_table %} +
    + + + + {% block list_header scoped %} + {% if actions %} + + {% endif %} + + {% for column in admin_view.column_list %} + + {% endfor %} + {% endblock %} + + + {% for name, path, is_dir, size, date in items %} + + {% block list_row scoped %} + {% if actions %} + + {% endif %} + + {% if is_dir %} + + {% else %} + + {% if admin_view.is_column_visible('size') %} + + {% endif %} + {% endif %} + {% if admin_view.is_column_visible('date') %} + + {% endif %} + {% endblock %} + + {% endfor %} +
    + +   + {% if admin_view.is_column_sortable(column) %} + {% if sort_column == column %} + + {{ admin_view.column_label(column) }} + {% if sort_desc %} + + {% else %} + + {% endif %} + + {% else %} + {{ admin_view.column_label(column) }} + {% endif %} + {% else %} + {{ _gettext(admin_view.column_label(column)) }} + {% endif %} +
    + {% if not is_dir %} + + {% endif %} + + {% block list_row_actions scoped %} + {% if admin_view.can_rename and path and name != '..' %} + {%- if admin_view.rename_modal -%} + {{ lib.add_modal_button(url=get_url('.rename', path=path, modal=True), + title=_gettext('Rename File'), + content='') }} + {% else %} + + + + {%- endif -%} + {% endif %} + {%- if admin_view.can_delete and path -%} + {% if is_dir %} + {% if name != '..' and admin_view.can_delete_dirs %} +
    + {{ delete_form.path(value=path) }} + {% if delete_form.csrf_token %} + {{ delete_form.csrf_token }} + {% elif csrf_token %} + + {% endif %} + +
    + {% endif %} + {% else %} +
    + {{ delete_form.path(value=path) }} + {% if delete_form.csrf_token %} + {{ delete_form.csrf_token }} + {% elif csrf_token %} + + {% endif %} + +
    + {% endif %} + {%- endif -%} + {% endblock %} +
    + + {{ name }} + + + {% if admin_view.can_download %} + {%- if admin_view.edit_modal and admin_view.is_file_editable(path) -%} + {{ lib.add_modal_button(url=get_file_url(path, modal=True)|safe, + btn_class='', content=name) }} + {% else %} + {{ name }} + {%- endif -%} + {% else %} + {{ name }} + {% endif %} + + {{ size|filesizeformat }} + + {{ timestamp_format(date) }} +
    +
    + {% endblock %} + {% block toolbar %} +
    + {% if admin_view.can_upload %} +
    + {%- if admin_view.upload_modal -%} + {{ lib.add_modal_button(url=get_dir_url('.upload', path=dir_path, modal=True), + btn_class="btn btn-default btn-large", + content=_gettext('Upload File')) }} + {% else %} + {{ _gettext('Upload File') }} + {%- endif -%} +
    + {% endif %} + {% if admin_view.can_mkdir %} +
    + {%- if admin_view.mkdir_modal -%} + {{ lib.add_modal_button(url=get_dir_url('.mkdir', path=dir_path, modal=True), + btn_class="btn btn-default btn-large", + content=_gettext('Create Directory')) }} + {% else %} + {{ _gettext('Create Directory') }} + {%- endif -%} +
    + {% endif %} + {% if actions %} +
    + {{ actionslib.dropdown(actions, 'dropdown-toggle btn btn-default btn-large') }} +
    + {% endif %} +
    + {% endblock %} + + {% block actions %} + {{ actionslib.form(actions, get_url('.action_view')) }} + {% endblock %} + + {%- if admin_view.rename_modal or admin_view.mkdir_modal + or admin_view.upload_modal or admin_view.edit_modal -%} + {{ lib.add_modal_window() }} + {%- endif -%} +{% endblock %} + +{% block tail %} + {{ super() }} + {{ actionslib.script(_gettext('Please select at least one file.'), + actions, + actions_confirmation) }} +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/file/modals/form.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/file/modals/form.html new file mode 100644 index 00000000..68d2f872 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/file/modals/form.html @@ -0,0 +1,19 @@ +{% import 'admin/static.html' as admin_static with context %} +{% import 'admin/lib.html' as lib with context %} + +{% block body %} + {# content added to modal-content #} + + +{% endblock %} + +{% block tail %} + +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/index.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/index.html new file mode 100644 index 00000000..fbfdf4c0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/index.html @@ -0,0 +1,4 @@ +{% extends 'admin/master.html' %} + +{% block body %} +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/layout.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/layout.html new file mode 100644 index 00000000..a2f63ea1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/layout.html @@ -0,0 +1,102 @@ +{% macro menu_icon(item) -%} +{% set icon_type = item.get_icon_type() %} +{%- if icon_type %} + {% set icon_value = item.get_icon_value() %} + {% if icon_type == 'glyph' %} + + {% elif icon_type == 'fa' %} + + {% elif icon_type == 'image' %} + menu image + {% elif icon_type == 'image-url' %} + menu image + {% endif %} +{% endif %} +{%- endmacro %} + +{% macro menu(menu_root=None) %} + {% if menu_root is none %}{% set menu_root = admin_view.admin.menu() %}{% endif %} + {%- for item in menu_root %} + {%- if item.is_category() -%} + {% set children = item.get_children() %} + {%- if children %} + {% set class_name = item.get_class_name() or '' %} + {%- if item.is_active(admin_view) %} + + {% endif %} + {%- else %} + {%- if item.is_accessible() and item.is_visible() -%} + {% set class_name = item.get_class_name() %} + {%- if item.is_active(admin_view) %} +
  • + {%- else %} + + {%- endif %} + {{ menu_icon(item) }}{{ item.name }} +
  • + {%- endif -%} + {% endif -%} + {% endfor %} +{% endmacro %} + +{% macro menu_links(links=None) %} + {% if links is none %}{% set links = admin_view.admin.menu_links() %}{% endif %} + {% for item in links %} + {% set class_name = item.get_class_name() %} + {% if item.is_accessible() and item.is_visible() %} + + {{ menu_icon(item) }}{{ item.name }} + + {% endif %} + {% endfor %} +{% endmacro %} + +{% macro messages() %} + {% with messages = get_flashed_messages(with_categories=True) %} + {% if messages %} + {% for category, m in messages %} + {% if category %} + {# alert-error changed to alert-danger in bootstrap 3, mapping is for backwards compatibility #} + {% set mapping = {'message': 'info', 'error': 'danger'} %} +
    + {% else %} +
    + {% endif %} + + {{ m }} +
    + {% endfor %} + {% endif %} + {% endwith %} +{% endmacro %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/lib.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/lib.html new file mode 100644 index 00000000..6bfdb05a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/lib.html @@ -0,0 +1,256 @@ +{% import 'admin/static.html' as admin_static with context %} + +{# ---------------------- Pager -------------------------- #} +{% macro pager(page, pages, generator) -%} +{% if pages > 1 %} +
      + {% set min = page - 3 %} + {% set max = page + 3 + 1 %} + + {% if min < 0 %} + {% set max = max - min %} + {% endif %} + {% if max >= pages %} + {% set min = min - max + pages %} + {% endif %} + + {% if min < 0 %} + {% set min = 0 %} + {% endif %} + {% if max >= pages %} + {% set max = pages %} + {% endif %} + + {% if min > 0 %} +
    • + « +
    • + {% else %} +
    • + « +
    • + {% endif %} + {% if page > 0 %} +
    • + < +
    • + {% else %} +
    • + < +
    • + {% endif %} + + {% for p in range(min, max) %} + {% if page == p %} +
    • + {{ p + 1 }} +
    • + {% else %} +
    • + {{ p + 1 }} +
    • + {% endif %} + {% endfor %} + + {% if page + 1 < pages %} +
    • + > +
    • + {% else %} +
    • + > +
    • + {% endif %} + {% if max < pages %} +
    • + » +
    • + {% else %} +
    • + » +
    • + {% endif %} +
    +{% endif %} +{%- endmacro %} + +{% macro simple_pager(page, have_next, generator) -%} +
      + {% if page > 0 %} +
    • + < +
    • + {% else %} +
    • + < +
    • + {% endif %} + {% if have_next %} +
    • + > +
    • + {% else %} +
    • + > +
    • + {% endif %} +
    +{%- endmacro %} + +{# ---------------------- Modal Window ------------------- #} +{% macro add_modal_window(modal_window_id='fa_modal_window', modal_label_id='fa_modal_label') %} + +{% endmacro %} + +{% macro add_modal_button(url='', title='', content='', modal_window_id='fa_modal_window', btn_class='icon') %} + + {{ content|safe }} + +{% endmacro %} + +{# ---------------------- Forms -------------------------- #} +{% macro render_field(form, field, kwargs={}, caller=None) %} + {% set direct_error = h.is_field_error(field.errors) %} +
    + +
    + {% set _dummy = kwargs.setdefault('class', 'form-control') %} + {{ field(**kwargs)|safe }} + {% if field.description %} +

    {{ field.description|safe }}

    + {% endif %} + {% if direct_error %} +
      + {% for e in field.errors if e is string %} +
    • {{ e }}
    • + {% endfor %} +
    + {% endif %} +
    + {% if caller %} + {{ caller(form, field, direct_error, kwargs) }} + {% endif %} +
    +{% endmacro %} + +{% macro render_header(form, text) %} +

    {{ text }}

    +{% endmacro %} + +{% macro render_form_fields(form, form_opts=None) %} + {% if form.hidden_tag is defined %} + {{ form.hidden_tag() }} + {% else %} + {% if csrf_token %} + + {% endif %} + {% for f in form if f.widget.input_type == 'hidden' %} + {{ f }} + {% endfor %} + {% endif %} + + {% if form_opts and form_opts.form_rules %} + {% for r in form_opts.form_rules %} + {{ r(form, form_opts=form_opts) }} + {% endfor %} + {% else %} + {% for f in form if f.widget.input_type != 'hidden' %} + {% if form_opts %} + {% set kwargs = form_opts.widget_args.get(f.short_name, {}) %} + {% else %} + {% set kwargs = {} %} + {% endif %} + {{ render_field(form, f, kwargs) }} + {% endfor %} + {% endif %} +{% endmacro %} + +{% macro form_tag(form=None, action=None) %} +
    + {{ caller() }} +
    +{% endmacro %} + +{% macro render_form_buttons(cancel_url, extra=None, is_modal=False) %} +
    +
    +
    + + {% if extra %} + {{ extra }} + {% endif %} + {% if cancel_url %} + {{ _gettext('Cancel') }} + {% endif %} +
    +
    +{% endmacro %} + +{% macro render_form(form, cancel_url, extra=None, form_opts=None, action=None, is_modal=False) -%} + {% call form_tag(action=action) %} + {{ render_form_fields(form, form_opts=form_opts) }} + {{ render_form_buttons(cancel_url, extra, is_modal) }} + {% endcall %} +{% endmacro %} + +{% macro form_css() %} + + + + {% if config.MAPBOX_MAP_ID %} + + + {% endif %} + {% if editable_columns %} + + {% endif %} +{% endmacro %} + +{% macro form_js() %} + {% if config.MAPBOX_MAP_ID %} + + + + {% if config.MAPBOX_SEARCH %} + + + {% endif %} + {% endif %} + + {% if editable_columns %} + + {% endif %} + +{% endmacro %} + +{% macro extra() %} + {% if admin_view.can_create %} + + {% endif %} + {% if admin_view.can_edit %} + + {% endif %} +{% endmacro %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/master.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/master.html new file mode 100644 index 00000000..8f27dad0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/master.html @@ -0,0 +1 @@ +{% extends admin_base_template %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/create.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/create.html new file mode 100644 index 00000000..9e0834ed --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/create.html @@ -0,0 +1,30 @@ +{% extends 'admin/master.html' %} +{% import 'admin/lib.html' as lib with context %} +{% from 'admin/lib.html' import extra with context %} {# backward compatible #} + +{% block head %} + {{ super() }} + {{ lib.form_css() }} +{% endblock %} + +{% block body %} + {% block navlinks %} + + {% endblock %} + + {% block create_form %} + {{ lib.render_form(form, return_url, extra(), form_opts) }} + {% endblock %} +{% endblock %} + +{% block tail %} + {{ super() }} + {{ lib.form_js() }} +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/details.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/details.html new file mode 100644 index 00000000..0008c5a1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/details.html @@ -0,0 +1,52 @@ +{% extends 'admin/master.html' %} +{% import 'admin/lib.html' as lib with context %} + +{% block body %} + {% block navlinks %} + + {% endblock %} + + {% block details_search %} +
    + {{ _gettext('Filter') }} + +
    + {% endblock %} + + {% block details_table %} + + {% for c, name in details_columns %} + + + + + {% endfor %} +
    + {{ name }} + + {{ get_value(model, c) }} +
    + {% endblock %} +{% endblock %} + +{% block tail %} + {{ super() }} + +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/edit.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/edit.html new file mode 100644 index 00000000..5bd40999 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/edit.html @@ -0,0 +1,40 @@ +{% extends 'admin/master.html' %} +{% import 'admin/lib.html' as lib with context %} +{% from 'admin/lib.html' import extra with context %} {# backward compatible #} + +{% block head %} + {{ super() }} + {{ lib.form_css() }} +{% endblock %} + +{% block body %} + {% block navlinks %} + + {% endblock %} + + {% block edit_form %} + {{ lib.render_form(form, return_url, extra(), form_opts) }} + {% endblock %} +{% endblock %} + +{% block tail %} + {{ super() }} + {{ lib.form_js() }} +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/inline_field_list.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/inline_field_list.html new file mode 100644 index 00000000..b19dc2ee --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/inline_field_list.html @@ -0,0 +1,15 @@ +{% import 'admin/model/inline_list_base.html' as base with context %} + +{% macro render_field(field) %} + {{ field }} + + {% if h.is_field_error(field.errors) %} +
      + {% for e in field.errors if e is string %} +
    • {{ e }}
    • + {% endfor %} +
    + {% endif %} +{% endmacro %} + +{{ base.render_inline_fields(field, template, render_field, check) }} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/inline_form.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/inline_form.html new file mode 100644 index 00000000..6ae3f6c0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/inline_form.html @@ -0,0 +1,4 @@ +{% import 'admin/lib.html' as lib with context %} +
    + {{ lib.render_form_fields(field.form, form_opts=form_opts) }} +
    diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/inline_list_base.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/inline_list_base.html new file mode 100644 index 00000000..79a93db3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/inline_list_base.html @@ -0,0 +1,45 @@ +{% macro render_inline_fields(field, template, render, check=None) %} +
    + {# existing inline form fields #} +
    + {% for subfield in field %} +
    + {%- if not check or check(subfield) %} + + + {{ field.label.text }} #{{ loop.index }} +
    + {% if subfield.get_pk and subfield.get_pk() %} + + + {% else %} + + {% endif %} +
    +
    +
    +
    + {%- endif -%} + {{ render(subfield) }} +
    + {% endfor %} +
    + + {# template for new inline form fields #} +
    + {% filter forceescape %} +
    + + {{ _gettext('New') }} {{ field.label.text }} +
    + +
    +
    +
    + {{ render(template) }} +
    + {% endfilter %} +
    + {{ _gettext('Add') }} {{ field.label.text }} +
    +{% endmacro %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/layout.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/layout.html new file mode 100644 index 00000000..792eb5b8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/layout.html @@ -0,0 +1,107 @@ +{% macro filter_options(btn_class='dropdown-toggle') %} + + {{ _gettext('Add Filter') }} + + +{% endmacro %} + +{% macro export_options(btn_class='dropdown-toggle') %} + {% if admin_view.export_types|length > 1 %} + + {% else %} +
  • + {{ _gettext('Export') }} +
  • + {% endif %} +{% endmacro %} + +{% macro filter_form() %} +
    + {% for arg_name, arg_value in extra_args.items() %} + + {% endfor %} + {% if sort_column is not none %} + + {% endif %} + {% if sort_desc %} + + {% endif %} + {% if search %} + + {% endif %} + {% if page_size != default_page_size %} + + {% endif %} +
    + + {% if active_filters %} + {{ _gettext('Reset Filters') }} + {% endif %} +
    + +
    +
    +
    +{% endmacro %} + +{% macro search_form(input_class=None) %} + +{% endmacro %} + +{% macro page_size_form(generator, btn_class='dropdown-toggle') %} + + {{ page_size }} {{ _gettext('items') }} + + +{% endmacro %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/list.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/list.html new file mode 100755 index 00000000..08c1d574 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/list.html @@ -0,0 +1,197 @@ +{% extends 'admin/master.html' %} +{% import 'admin/lib.html' as lib with context %} +{% import 'admin/static.html' as admin_static with context%} +{% import 'admin/model/layout.html' as model_layout with context %} +{% import 'admin/actions.html' as actionlib with context %} +{% import 'admin/model/row_actions.html' as row_actions with context %} + +{% block head %} + {{ super() }} + {{ lib.form_css() }} +{% endblock %} + +{% block body %} + {% block model_menu_bar %} + + {% endblock %} + + {% if filters %} + {{ model_layout.filter_form() }} +
    + {% endif %} + + {% block model_list_table %} +
    + + + + {% block list_header scoped %} + {% if actions %} + + {% endif %} + {% block list_row_actions_header %} + {% if admin_view.column_display_actions %} + + {% endif %} + {% endblock %} + {% for c, name in list_columns %} + {% set column = loop.index0 %} + + {% endfor %} + {% endblock %} + + + {% for row in data %} + + {% block list_row scoped %} + {% if actions %} + + {% endif %} + {% block list_row_actions_column scoped %} + {% if admin_view.column_display_actions %} + + {%- endif -%} + {% endblock %} + + {% for c, name in list_columns %} + + {% endfor %} + {% endblock %} + + {% else %} + + + + {% endfor %} +
    + +   + {% if admin_view.is_sortable(c) %} + {% if sort_column == column %} + + {{ name }} + {% if sort_desc %} + + {% else %} + + {% endif %} + + {% else %} + {{ name }} + {% endif %} + {% else %} + {{ name }} + {% endif %} + {% if admin_view.column_descriptions.get(c) %} + + {% endif %} +
    + + + {% block list_row_actions scoped %} + {% for action in list_row_actions %} + {{ action.render_ctx(get_pk_value(row), row) }} + {% endfor %} + {% endblock %} + + {% if admin_view.is_editable(c) %} + {% set form = list_forms[get_pk_value(row)] %} + {% if form.csrf_token %} + {{ form[c](pk=get_pk_value(row), display_value=get_value(row, c), csrf=form.csrf_token._value()) }} + {% elif csrf_token %} + {{ form[c](pk=get_pk_value(row), display_value=get_value(row, c), csrf=csrf_token()) }} + {% else %} + {{ form[c](pk=get_pk_value(row), display_value=get_value(row, c)) }} + {% endif %} + {% else %} + {{ get_value(row, c) }} + {% endif %} +
    + {% block empty_list_message %} +
    + {{ admin_view.get_empty_list_message() }} +
    + {% endblock %} +
    +
    + {% block list_pager %} + {% if num_pages is not none %} + {{ lib.pager(page, num_pages, pager_url) }} + {% else %} + {{ lib.simple_pager(page, data|length == page_size, pager_url) }} + {% endif %} + {% endblock %} + {% endblock %} + + {% block actions %} + {{ actionlib.form(actions, get_url('.action_view')) }} + {% endblock %} + + {%- if admin_view.edit_modal or admin_view.create_modal or admin_view.details_modal -%} + {{ lib.add_modal_window() }} + {%- endif -%} +{% endblock %} + +{% block tail %} + {{ super() }} + + {% if filter_groups %} + + + {% endif %} + + {{ lib.form_js() }} + + + {{ actionlib.script(_gettext('Please select at least one record.'), + actions, + actions_confirmation) }} +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/modals/create.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/modals/create.html new file mode 100644 index 00000000..abc1cf58 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/modals/create.html @@ -0,0 +1,24 @@ +{% import 'admin/static.html' as admin_static with context%} +{% import 'admin/lib.html' as lib with context %} + +{# store the jinja2 context for form_rules rendering logic #} +{% set render_ctx = h.resolve_ctx() %} + +{% block body %} + + +{% endblock %} + +{% block tail %} + +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/modals/details.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/modals/details.html new file mode 100755 index 00000000..3a684346 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/modals/details.html @@ -0,0 +1,40 @@ +{% import 'admin/static.html' as admin_static with context%} +{% import 'admin/lib.html' as lib with context %} + +{% block body %} + + + +{% endblock %} + +{% block tail %} + + +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/modals/edit.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/modals/edit.html new file mode 100644 index 00000000..8897810f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/modals/edit.html @@ -0,0 +1,26 @@ +{% import 'admin/static.html' as admin_static with context%} +{% import 'admin/lib.html' as lib with context %} + +{# store the jinja2 context for form_rules rendering logic #} +{% set render_ctx = h.resolve_ctx() %} + +{% block body %} + + +{% endblock %} + +{% block tail %} + +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/row_actions.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/row_actions.html new file mode 100644 index 00000000..74d65ca4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/model/row_actions.html @@ -0,0 +1,38 @@ +{% import 'admin/lib.html' as lib with context %} + +{% macro link(action, url, icon_class=None) %} + + + +{% endmacro %} + +{% macro view_row(action, row_id, row) %} + {{ link(action, get_url('.details_view', id=row_id, url=return_url), 'fa fa-eye glyphicon glyphicon-eye-open') }} +{% endmacro %} + +{% macro view_row_popup(action, row_id, row) %} + {{ lib.add_modal_button(url=get_url('.details_view', id=row_id, url=return_url, modal=True), title=action.title, content='') }} +{% endmacro %} + +{% macro edit_row(action, row_id, row) %} + {{ link(action, get_url('.edit_view', id=row_id, url=return_url), 'fa fa-pencil glyphicon glyphicon-pencil') }} +{% endmacro %} + +{% macro edit_row_popup(action, row_id, row) %} + {{ lib.add_modal_button(url=get_url('.edit_view', id=row_id, url=return_url, modal=True), title=action.title, content='') }} +{% endmacro %} + +{% macro delete_row(action, row_id, row) %} +
    + {{ delete_form.id(value=get_pk_value(row)) }} + {{ delete_form.url(value=return_url) }} + {% if delete_form.csrf_token %} + {{ delete_form.csrf_token }} + {% elif csrf_token %} + + {% endif %} + +
    +{% endmacro %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/rediscli/console.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/rediscli/console.html new file mode 100644 index 00000000..368f55dd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/rediscli/console.html @@ -0,0 +1,27 @@ +{% extends 'admin/master.html' %} +{% import 'admin/lib.html' as lib with context %} +{% import 'admin/static.html' as admin_static with context%} + +{% block head %} + {{ super() }} + +{% endblock %} + +{% block body %} +
    +
    +
    +
    +
    + +
    +
    +
    +{% endblock %} + +{% block tail %} + {{ super() }} + + + +{% endblock %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/rediscli/response.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/rediscli/response.html new file mode 100644 index 00000000..f4a950a8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/rediscli/response.html @@ -0,0 +1,32 @@ +{% macro render(item, depth=0) %} + {% set type = type_name(item) %} + + {% if type == 'tuple' or type == 'list' %} + {% if not item %} + Empty {{ type }}. + {% else %} + {% for n in item %} + {{ loop.index }}) {{ render(n, depth + 1) }}
    + {% endfor %} + {% endif %} + {% elif type == 'bool' %} + {% if depth == 0 and item %} + OK + {% else %} + {{ item }} + {% endif %} + {% elif type == 'str' or type == 'unicode' %} + "{{ item }}" + {% elif type == 'bytes' %} + "{{ item.decode('utf-8') }}" + {% elif type == 'TextWrapper' %} +
    {{ item }}
    + {% elif type == 'dict' %} + {% for k, v in item.items() %} + {{ loop.index }}) {{ k }} - {{ render(v, depth + 1) }}
    + {% endfor %} + {% else %} + {{ item }} + {% endif %} +{% endmacro %} +{{ render(result) }} \ No newline at end of file diff --git a/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/static.html b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/static.html new file mode 100644 index 00000000..5735fbd4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/templates/bootstrap3/admin/static.html @@ -0,0 +1,3 @@ +{% macro url() -%} + {{ get_url('admin.static', *varargs, **kwargs) }} +{%- endmacro %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/__init__.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..77228b4c Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/mock.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/mock.cpython-38.pyc new file mode 100644 index 00000000..64eb5469 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/mock.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/test_base.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/test_base.cpython-38.pyc new file mode 100644 index 00000000..54bb18c3 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/test_base.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/test_form_upload.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/test_form_upload.cpython-38.pyc new file mode 100644 index 00000000..f17d8f0a Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/test_form_upload.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/test_helpers.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/test_helpers.cpython-38.pyc new file mode 100644 index 00000000..20276feb Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/test_helpers.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/test_model.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/test_model.cpython-38.pyc new file mode 100644 index 00000000..b5d007f1 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/test_model.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/test_tools.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/test_tools.cpython-38.pyc new file mode 100644 index 00000000..441b05be Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/__pycache__/test_tools.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/data/copyleft.gif b/.venv/lib/python3.8/site-packages/flask_admin/tests/data/copyleft.gif new file mode 100644 index 00000000..cd056988 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/data/copyleft.gif differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/data/copyleft.jpeg b/.venv/lib/python3.8/site-packages/flask_admin/tests/data/copyleft.jpeg new file mode 100644 index 00000000..aa916da6 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/data/copyleft.jpeg differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/data/copyleft.jpg b/.venv/lib/python3.8/site-packages/flask_admin/tests/data/copyleft.jpg new file mode 100644 index 00000000..87be5446 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/data/copyleft.jpg differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/data/copyleft.png b/.venv/lib/python3.8/site-packages/flask_admin/tests/data/copyleft.png new file mode 100644 index 00000000..cdf2d11b Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/data/copyleft.png differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/data/copyleft.tiff b/.venv/lib/python3.8/site-packages/flask_admin/tests/data/copyleft.tiff new file mode 100644 index 00000000..d8b7f730 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/data/copyleft.tiff differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/fileadmin/__init__.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/fileadmin/__init__.py new file mode 100644 index 00000000..3f34de3b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/fileadmin/__init__.py @@ -0,0 +1,11 @@ +from flask import Flask +from flask_admin import Admin + + +def setup(): + app = Flask(__name__) + app.config['SECRET_KEY'] = '1' + app.config['CSRF_ENABLED'] = False + + admin = Admin(app) + return app, admin diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/fileadmin/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/fileadmin/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..0e2aea00 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/fileadmin/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/fileadmin/__pycache__/test_fileadmin.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/fileadmin/__pycache__/test_fileadmin.cpython-38.pyc new file mode 100644 index 00000000..2403aded Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/fileadmin/__pycache__/test_fileadmin.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/fileadmin/__pycache__/test_fileadmin_azure.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/fileadmin/__pycache__/test_fileadmin_azure.cpython-38.pyc new file mode 100644 index 00000000..f5a6e72d Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/fileadmin/__pycache__/test_fileadmin_azure.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/fileadmin/files/dummy.txt b/.venv/lib/python3.8/site-packages/flask_admin/tests/fileadmin/files/dummy.txt new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/fileadmin/test_fileadmin.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/fileadmin/test_fileadmin.py new file mode 100644 index 00000000..2e27c33d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/fileadmin/test_fileadmin.py @@ -0,0 +1,245 @@ +import os +import os.path as op +import unittest + +from nose.tools import eq_, ok_ + +from flask_admin.contrib import fileadmin +from flask_admin import Admin +from flask import Flask + +from . import setup + +try: + from StringIO import StringIO +except ImportError: + from io import StringIO + + +class Base: + class FileAdminTests(unittest.TestCase): + _test_files_root = op.join(op.dirname(__file__), 'files') + + def fileadmin_class(self): + raise NotImplementedError + + def fileadmin_args(self): + raise NotImplementedError + + def test_file_admin(self): + fileadmin_class = self.fileadmin_class() + fileadmin_args, fileadmin_kwargs = self.fileadmin_args() + + app, admin = setup() + + class MyFileAdmin(fileadmin_class): + editable_extensions = ('txt',) + + view_kwargs = dict(fileadmin_kwargs) + view_kwargs.setdefault('name', 'Files') + view = MyFileAdmin(*fileadmin_args, **view_kwargs) + + admin.add_view(view) + + client = app.test_client() + + # index + rv = client.get('/admin/myfileadmin/') + eq_(rv.status_code, 200) + ok_('path=dummy.txt' in rv.data.decode('utf-8')) + + # edit + rv = client.get('/admin/myfileadmin/edit/?path=dummy.txt') + eq_(rv.status_code, 200) + ok_('dummy.txt' in rv.data.decode('utf-8')) + + rv = client.post('/admin/myfileadmin/edit/?path=dummy.txt', + data=dict(content='new_string')) + eq_(rv.status_code, 302) + + rv = client.get('/admin/myfileadmin/edit/?path=dummy.txt') + eq_(rv.status_code, 200) + ok_('dummy.txt' in rv.data.decode('utf-8')) + ok_('new_string' in rv.data.decode('utf-8')) + + # rename + rv = client.get('/admin/myfileadmin/rename/?path=dummy.txt') + eq_(rv.status_code, 200) + ok_('dummy.txt' in rv.data.decode('utf-8')) + + rv = client.post('/admin/myfileadmin/rename/?path=dummy.txt', + data=dict(name='dummy_renamed.txt', + path='dummy.txt')) + eq_(rv.status_code, 302) + + rv = client.get('/admin/myfileadmin/') + eq_(rv.status_code, 200) + ok_('path=dummy_renamed.txt' in rv.data.decode('utf-8')) + ok_('path=dummy.txt' not in rv.data.decode('utf-8')) + + # upload + rv = client.get('/admin/myfileadmin/upload/') + eq_(rv.status_code, 200) + + rv = client.post('/admin/myfileadmin/upload/', + data=dict(upload=(StringIO(""), 'dummy.txt'))) + eq_(rv.status_code, 302) + + rv = client.get('/admin/myfileadmin/') + eq_(rv.status_code, 200) + ok_('path=dummy.txt' in rv.data.decode('utf-8')) + ok_('path=dummy_renamed.txt' in rv.data.decode('utf-8')) + + # delete + rv = client.post('/admin/myfileadmin/delete/', + data=dict(path='dummy_renamed.txt')) + eq_(rv.status_code, 302) + + rv = client.get('/admin/myfileadmin/') + eq_(rv.status_code, 200) + ok_('path=dummy_renamed.txt' not in rv.data.decode('utf-8')) + ok_('path=dummy.txt' in rv.data.decode('utf-8')) + + # mkdir + rv = client.get('/admin/myfileadmin/mkdir/') + eq_(rv.status_code, 200) + + rv = client.post('/admin/myfileadmin/mkdir/', + data=dict(name='dummy_dir')) + eq_(rv.status_code, 302) + + rv = client.get('/admin/myfileadmin/') + eq_(rv.status_code, 200) + ok_('path=dummy.txt' in rv.data.decode('utf-8')) + ok_('path=dummy_dir' in rv.data.decode('utf-8')) + + # rename - directory + rv = client.get('/admin/myfileadmin/rename/?path=dummy_dir') + eq_(rv.status_code, 200) + ok_('dummy_dir' in rv.data.decode('utf-8')) + + rv = client.post('/admin/myfileadmin/rename/?path=dummy_dir', + data=dict(name='dummy_renamed_dir', + path='dummy_dir')) + eq_(rv.status_code, 302) + + rv = client.get('/admin/myfileadmin/') + eq_(rv.status_code, 200) + ok_('path=dummy_renamed_dir' in rv.data.decode('utf-8')) + ok_('path=dummy_dir' not in rv.data.decode('utf-8')) + + # delete - directory + rv = client.post('/admin/myfileadmin/delete/', + data=dict(path='dummy_renamed_dir')) + eq_(rv.status_code, 302) + + rv = client.get('/admin/myfileadmin/') + eq_(rv.status_code, 200) + ok_('path=dummy_renamed_dir' not in rv.data.decode('utf-8')) + ok_('path=dummy.txt' in rv.data.decode('utf-8')) + + def test_modal_edit(self): + # bootstrap 2 - test edit_modal + app_bs2 = Flask(__name__) + admin_bs2 = Admin(app_bs2, template_mode="bootstrap2") + + fileadmin_class = self.fileadmin_class() + fileadmin_args, fileadmin_kwargs = self.fileadmin_args() + + class EditModalOn(fileadmin_class): + edit_modal = True + editable_extensions = ('txt',) + + class EditModalOff(fileadmin_class): + edit_modal = False + editable_extensions = ('txt',) + + on_view_kwargs = dict(fileadmin_kwargs) + on_view_kwargs.setdefault('endpoint', 'edit_modal_on') + edit_modal_on = EditModalOn(*fileadmin_args, **on_view_kwargs) + + off_view_kwargs = dict(fileadmin_kwargs) + off_view_kwargs.setdefault('endpoint', 'edit_modal_off') + edit_modal_off = EditModalOff(*fileadmin_args, **off_view_kwargs) + + admin_bs2.add_view(edit_modal_on) + admin_bs2.add_view(edit_modal_off) + + client_bs2 = app_bs2.test_client() + + # bootstrap 2 - ensure modal window is added when edit_modal is + # enabled + rv = client_bs2.get('/admin/edit_modal_on/') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('fa_modal_window' in data) + + # bootstrap 2 - test edit modal disabled + rv = client_bs2.get('/admin/edit_modal_off/') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('fa_modal_window' not in data) + + # bootstrap 3 + app_bs3 = Flask(__name__) + admin_bs3 = Admin(app_bs3, template_mode="bootstrap3") + + admin_bs3.add_view(edit_modal_on) + admin_bs3.add_view(edit_modal_off) + + client_bs3 = app_bs3.test_client() + + # bootstrap 3 - ensure modal window is added when edit_modal is + # enabled + rv = client_bs3.get('/admin/edit_modal_on/') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('fa_modal_window' in data) + + # bootstrap 3 - test modal disabled + rv = client_bs3.get('/admin/edit_modal_off/') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('fa_modal_window' not in data) + + +class LocalFileAdminTests(Base.FileAdminTests): + def fileadmin_class(self): + return fileadmin.FileAdmin + + def fileadmin_args(self): + return (self._test_files_root, '/files'), {} + + def test_fileadmin_sort_bogus_url_param(self): + fileadmin_class = self.fileadmin_class() + fileadmin_args, fileadmin_kwargs = self.fileadmin_args() + app, admin = setup() + + class MyFileAdmin(fileadmin_class): + editable_extensions = ('txt',) + + view_kwargs = dict(fileadmin_kwargs) + view_kwargs.setdefault('name', 'Files') + view = MyFileAdmin(*fileadmin_args, **view_kwargs) + + admin.add_view(view) + + client = app.test_client() + with open(op.join(self._test_files_root, 'dummy2.txt'), 'w') as fp: + # make sure that 'files/dummy2.txt' exists, is newest and has bigger size + fp.write('test') + + rv = client.get('/admin/myfileadmin/?sort=bogus') + eq_(rv.status_code, 200) + ok_(rv.data.decode('utf-8').find('path=dummy2.txt') < + rv.data.decode('utf-8').find('path=dummy.txt')) + + rv = client.get('/admin/myfileadmin/?sort=name') + eq_(rv.status_code, 200) + ok_(rv.data.decode('utf-8').find('path=dummy.txt') < + rv.data.decode('utf-8').find('path=dummy2.txt')) + try: + # clean up + os.remove(op.join(self._test_files_root, 'dummy2.txt')) + except (IOError, OSError): + pass diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/fileadmin/test_fileadmin_azure.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/fileadmin/test_fileadmin_azure.py new file mode 100644 index 00000000..8fa87d37 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/fileadmin/test_fileadmin_azure.py @@ -0,0 +1,37 @@ +import os.path as op +from os import getenv +from uuid import uuid4 + +from nose import SkipTest + +from flask_admin.contrib.fileadmin import azure + +from .test_fileadmin import Base + + +class AzureFileAdminTests(Base.FileAdminTests): + _test_storage = getenv('AZURE_STORAGE_CONNECTION_STRING') + + def setUp(self): + if not azure.BlockBlobService: + raise SkipTest('AzureFileAdmin dependencies not installed') + + self._container_name = 'fileadmin-tests-%s' % uuid4() + + if not self._test_storage or not self._container_name: + raise SkipTest('AzureFileAdmin test credentials not set') + + client = azure.BlockBlobService(connection_string=self._test_storage) + client.create_container(self._container_name) + dummy = op.join(self._test_files_root, 'dummy.txt') + client.create_blob_from_path(self._container_name, 'dummy.txt', dummy) + + def tearDown(self): + client = azure.BlockBlobService(connection_string=self._test_storage) + client.delete_container(self._container_name) + + def fileadmin_class(self): + return azure.AzureFileAdmin + + def fileadmin_args(self): + return (self._container_name, self._test_storage), {} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/geoa/__init__.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/geoa/__init__.py new file mode 100644 index 00000000..4380a5c2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/geoa/__init__.py @@ -0,0 +1,17 @@ +from flask import Flask +from flask_admin import Admin +from flask_sqlalchemy import SQLAlchemy + + +def setup(): + app = Flask(__name__) + app.config['SECRET_KEY'] = '1' + app.config['CSRF_ENABLED'] = False + app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://localhost/flask_admin_test' + app.config['SQLALCHEMY_ECHO'] = True + app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False + + db = SQLAlchemy(app) + admin = Admin(app) + + return app, db, admin diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/geoa/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/geoa/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..d34288a4 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/geoa/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/geoa/__pycache__/test_basic.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/geoa/__pycache__/test_basic.cpython-38.pyc new file mode 100644 index 00000000..96ee11c2 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/geoa/__pycache__/test_basic.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/geoa/test_basic.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/geoa/test_basic.py new file mode 100644 index 00000000..4595666a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/geoa/test_basic.py @@ -0,0 +1,153 @@ +from __future__ import unicode_literals +import json +import re + +from flask_admin.contrib.geoa import ModelView +from flask_admin.contrib.geoa.fields import GeoJSONField +from geoalchemy2 import Geometry +from geoalchemy2.shape import to_shape +from nose.tools import eq_, ok_ + +from . import setup + + +def create_models(db): + class GeoModel(db.Model): + id = db.Column(db.Integer, primary_key=True) + name = db.Column(db.String(20)) + point = db.Column(Geometry("POINT")) + line = db.Column(Geometry("LINESTRING")) + polygon = db.Column(Geometry("POLYGON")) + multi = db.Column(Geometry("MULTIPOINT")) + + def __unicode__(self): + return self.name + + db.create_all() + + return GeoModel + + +def test_model(): + app, db, admin = setup() + GeoModel = create_models(db) + db.create_all() + GeoModel.query.delete() + db.session.commit() + + view = ModelView(GeoModel, db.session) + admin.add_view(view) + + eq_(view.model, GeoModel) + eq_(view._primary_key, 'id') + + # Verify form + eq_(view._create_form_class.point.field_class, GeoJSONField) + eq_(view._create_form_class.point.kwargs['geometry_type'], "POINT") + eq_(view._create_form_class.line.field_class, GeoJSONField) + eq_(view._create_form_class.line.kwargs['geometry_type'], "LINESTRING") + eq_(view._create_form_class.polygon.field_class, GeoJSONField) + eq_(view._create_form_class.polygon.kwargs['geometry_type'], "POLYGON") + eq_(view._create_form_class.multi.field_class, GeoJSONField) + eq_(view._create_form_class.multi.kwargs['geometry_type'], "MULTIPOINT") + + # Make some test clients + client = app.test_client() + + rv = client.get('/admin/geomodel/') + eq_(rv.status_code, 200) + + rv = client.get('/admin/geomodel/new/') + eq_(rv.status_code, 200) + + rv = client.post('/admin/geomodel/new/', data={ + "name": "test1", + "point": '{"type": "Point", "coordinates": [125.8, 10.0]}', + "line": '{"type": "LineString", "coordinates": [[50.2345, 94.2], [50.21, 94.87]]}', + "polygon": ('{"type": "Polygon", "coordinates": [[[100.0, 0.0], [101.0, 0.0],' + ' [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]}'), + "multi": '{"type": "MultiPoint", "coordinates": [[100.0, 0.0], [101.0, 1.0]]}', + }) + eq_(rv.status_code, 302) + + model = db.session.query(GeoModel).first() + eq_(model.name, "test1") + eq_(to_shape(model.point).geom_type, "Point") + eq_(list(to_shape(model.point).coords), [(125.8, 10.0)]) + eq_(to_shape(model.line).geom_type, "LineString") + eq_(list(to_shape(model.line).coords), [(50.2345, 94.2), (50.21, 94.87)]) + eq_(to_shape(model.polygon).geom_type, "Polygon") + eq_(list(to_shape(model.polygon).exterior.coords), + [(100.0, 0.0), (101.0, 0.0), (101.0, 1.0), (100.0, 1.0), (100.0, 0.0)]) + eq_(to_shape(model.multi).geom_type, "MultiPoint") + eq_(len(to_shape(model.multi).geoms), 2) + eq_(list(to_shape(model.multi).geoms[0].coords), [(100.0, 0.0)]) + eq_(list(to_shape(model.multi).geoms[1].coords), [(101.0, 1.0)]) + + rv = client.get('/admin/geomodel/') + eq_(rv.status_code, 200) + + html = rv.data.decode('utf-8') + pattern = r'(.|\n)+({.*"type": ?"Point".*})(.|\n)+' + group = re.match(pattern, html).group(2) + p = json.loads(group) + eq_(p['coordinates'][0], 125.8) + eq_(p['coordinates'][1], 10.0) + + url = '/admin/geomodel/edit/?id=%s' % model.id + rv = client.get(url) + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_(r' name="multi">{"type":"MultiPoint","coordinates":[[100,0],[101,1]]}' in data) + + # rv = client.post(url, data={ + # "name": "edited", + # "point": '{"type": "Point", "coordinates": [99.9, 10.5]}', + # "line": '', # set to NULL in the database + # }) + # eq_(rv.status_code, 302) + # + # model = db.session.query(GeoModel).first() + # eq_(model.name, "edited") + # eq_(to_shape(model.point).geom_type, "Point") + # eq_(list(to_shape(model.point).coords), [(99.9, 10.5)]) + # eq_(to_shape(model.line), None) + # eq_(to_shape(model.polygon).geom_type, "Polygon") + # eq_(list(to_shape(model.polygon).exterior.coords), + # [(100.0, 0.0), (101.0, 0.0), (101.0, 1.0), (100.0, 1.0), (100.0, 0.0)]) + # eq_(to_shape(model.multi).geom_type, "MultiPoint") + # eq_(len(to_shape(model.multi).geoms), 2) + # eq_(list(to_shape(model.multi).geoms[0].coords), [(100.0, 0.0)]) + # eq_(list(to_shape(model.multi).geoms[1].coords), [(101.0, 1.0)]) + + url = '/admin/geomodel/delete/?id=%s' % model.id + rv = client.post(url) + eq_(rv.status_code, 302) + eq_(db.session.query(GeoModel).count(), 0) + + +def test_none(): + app, db, admin = setup() + GeoModel = create_models(db) + db.create_all() + GeoModel.query.delete() + db.session.commit() + + view = ModelView(GeoModel, db.session) + admin.add_view(view) + + # Make some test clients + client = app.test_client() + + rv = client.post('/admin/geomodel/new/', data={ + "name": "test1", + }) + eq_(rv.status_code, 302) + + model = db.session.query(GeoModel).first() + + url = '/admin/geomodel/edit/?id=%s' % model.id + rv = client.get(url) + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_(r' name="point">' in data) diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/mock.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/mock.py new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/mongoengine/__init__.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/mongoengine/__init__.py new file mode 100644 index 00000000..86e94cb0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/mongoengine/__init__.py @@ -0,0 +1,28 @@ +from nose.plugins.skip import SkipTest +from wtforms import __version__ as wtforms_version + +# Skip test on PY3 +from flask_admin._compat import PY2 +if not PY2: + raise SkipTest('MongoEngine is not Python 3 compatible') + +if int(wtforms_version[0]) < 2: + raise SkipTest('MongoEngine does not support WTForms 1.') + +from flask import Flask +from flask_admin import Admin +from flask_mongoengine import MongoEngine + + +def setup(): + app = Flask(__name__) + app.config['SECRET_KEY'] = '1' + app.config['CSRF_ENABLED'] = False + app.config['MONGODB_SETTINGS'] = {'DB': 'tests'} + + db = MongoEngine() + db.init_app(app) + + admin = Admin(app) + + return app, db, admin diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/mongoengine/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/mongoengine/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..948ab28c Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/mongoengine/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/mongoengine/__pycache__/test_basic.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/mongoengine/__pycache__/test_basic.cpython-38.pyc new file mode 100644 index 00000000..4ee23f4a Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/mongoengine/__pycache__/test_basic.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/mongoengine/test_basic.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/mongoengine/test_basic.py new file mode 100644 index 00000000..a2e7163a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/mongoengine/test_basic.py @@ -0,0 +1,1210 @@ +from nose.tools import eq_, ok_ + +from wtforms import fields, validators + +from flask_admin import form +from flask_admin._compat import as_unicode +from flask_admin.contrib.mongoengine import ModelView + +from . import setup + +from datetime import datetime + + +class CustomModelView(ModelView): + def __init__(self, model, + name=None, category=None, endpoint=None, url=None, + **kwargs): + for k, v in kwargs.iteritems(): + setattr(self, k, v) + + super(CustomModelView, self).__init__(model, + name, category, + endpoint, url) + + +def create_models(db): + class Model1(db.Document): + test1 = db.StringField(max_length=20) + test2 = db.StringField(max_length=20) + test3 = db.StringField() + test4 = db.StringField() + datetime_field = db.DateTimeField() + + def __str__(self): + return self.test1 + + class Model2(db.Document): + string_field = db.StringField() + int_field = db.IntField() + float_field = db.FloatField() + bool_field = db.BooleanField() + + model1 = db.ReferenceField(Model1) + + Model1.objects.delete() + Model2.objects.delete() + + return Model1, Model2 + + +def fill_db(Model1, Model2): + Model1('test1_val_1', 'test2_val_1').save() + Model1('test1_val_2', 'test2_val_2').save() + Model1('test1_val_3', 'test2_val_3').save() + Model1('test1_val_4', 'test2_val_4').save() + Model1(None, 'empty_obj').save() + + Model2('string_field_val_1', None, None, True).save() + Model2('string_field_val_2', None, None, False).save() + Model2('string_field_val_3', 5000, 25.9).save() + Model2('string_field_val_4', 9000, 75.5).save() + Model2('string_field_val_5', 6169453081680413441).save() + + Model1('datetime_obj1', datetime_field=datetime(2014, 4, 3, 1, 9, 0)).save() + Model1('datetime_obj2', datetime_field=datetime(2013, 3, 2, 0, 8, 0)).save() + + +def test_model(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + view = CustomModelView(Model1) + admin.add_view(view) + + eq_(view.model, Model1) + eq_(view.name, 'Model1') + eq_(view.endpoint, 'model1') + + eq_(view._primary_key, 'id') + + ok_('test1' in view._sortable_columns) + ok_('test2' in view._sortable_columns) + ok_('test3' in view._sortable_columns) + ok_('test4' in view._sortable_columns) + + ok_(view._create_form_class is not None) + ok_(view._edit_form_class is not None) + eq_(view._search_supported, False) + eq_(view._filters, None) + + eq_(view._create_form_class.test1.field_class, fields.StringField) + eq_(view._create_form_class.test2.field_class, fields.StringField) + + eq_(view._create_form_class.test3.field_class, fields.TextAreaField) + eq_(view._create_form_class.test4.field_class, fields.TextAreaField) + + # Make some test clients + client = app.test_client() + + rv = client.get('/admin/model1/') + eq_(rv.status_code, 200) + + rv = client.get('/admin/model1/new/') + eq_(rv.status_code, 200) + + rv = client.post('/admin/model1/new/', + data=dict(test1='test1large', test2='test2')) + eq_(rv.status_code, 302) + + model = Model1.objects.first() + eq_(model.test1, 'test1large') + eq_(model.test2, 'test2') + eq_(model.test3, '') + eq_(model.test4, '') + + rv = client.get('/admin/model1/') + eq_(rv.status_code, 200) + ok_('test1large' in rv.data) + + url = '/admin/model1/edit/?id=%s' % model.id + rv = client.get(url) + eq_(rv.status_code, 200) + + rv = client.post(url, + data=dict(test1='test1small', test2='test2large')) + eq_(rv.status_code, 302) + + model = Model1.objects.first() + eq_(model.test1, 'test1small') + eq_(model.test2, 'test2large') + eq_(model.test3, '') + eq_(model.test4, '') + + url = '/admin/model1/delete/?id=%s' % model.id + rv = client.post(url) + eq_(rv.status_code, 302) + eq_(Model1.objects.count(), 0) + + +def test_column_editable_list(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + view = CustomModelView(Model1, + column_editable_list=['test1', 'datetime_field']) + admin.add_view(view) + + fill_db(Model1, Model2) + + client = app.test_client() + + # Test in-line edit field rendering + rv = client.get('/admin/model1/') + data = rv.data.decode('utf-8') + ok_('data-role="x-editable"' in data) + + # Form - Test basic in-line edit functionality + obj1 = Model1.objects.get(test1='test1_val_3') + rv = client.post('/admin/model1/ajax/update/', data={ + 'list_form_pk': str(obj1.id), + 'test1': 'change-success-1', + }) + data = rv.data.decode('utf-8') + ok_('Record was successfully saved.' == data) + + # confirm the value has changed + rv = client.get('/admin/model1/') + data = rv.data.decode('utf-8') + ok_('change-success-1' in data) + + # Test validation error + obj2 = Model1.objects.get(test1='datetime_obj1') + rv = client.post('/admin/model1/ajax/update/', data={ + 'list_form_pk': str(obj2.id), + 'datetime_field': 'problematic-input', + }) + eq_(rv.status_code, 500) + + # Test invalid primary key + rv = client.post('/admin/model1/ajax/update/', data={ + 'list_form_pk': '1000', + 'test1': 'problematic-input', + }) + data = rv.data.decode('utf-8') + eq_(rv.status_code, 500) + + # Test editing column not in column_editable_list + rv = client.post('/admin/model1/ajax/update/', data={ + 'list_form_pk': '1', + 'test2': 'problematic-input', + }) + data = rv.data.decode('utf-8') + ok_('problematic-input' not in data) + + # Test in-line editing for relations + view = CustomModelView(Model2, column_editable_list=['model1']) + admin.add_view(view) + + obj3 = Model2.objects.get(string_field='string_field_val_1') + rv = client.post('/admin/model2/ajax/update/', data={ + 'list_form_pk': str(obj3.id), + 'model1': str(obj1.id), + }) + data = rv.data.decode('utf-8') + ok_('Record was successfully saved.' == data) + + # confirm the value has changed + rv = client.get('/admin/model2/') + data = rv.data.decode('utf-8') + ok_('test1_val_1' in data) + + +def test_details_view(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + view_no_details = CustomModelView(Model1) + admin.add_view(view_no_details) + + # fields are scaffolded + view_w_details = CustomModelView(Model2, can_view_details=True) + admin.add_view(view_w_details) + + # show only specific fields in details w/ column_details_list + string_field_view = CustomModelView(Model2, can_view_details=True, + column_details_list=["string_field"], + endpoint="sf_view") + admin.add_view(string_field_view) + + fill_db(Model1, Model2) + + client = app.test_client() + + m1_id = Model1.objects.first().id + m2_id = Model2.objects.first().id + + # ensure link to details is hidden when can_view_details is disabled + rv = client.get('/admin/model1/') + data = rv.data.decode('utf-8') + ok_('/admin/model1/details/' not in data) + + # ensure link to details view appears + rv = client.get('/admin/model2/') + data = rv.data.decode('utf-8') + ok_('/admin/model2/details/' in data) + + # test redirection when details are disabled + url = '/admin/model1/details/?url=%2Fadmin%2Fmodel1%2F&id=' + str(m1_id) + rv = client.get(url) + eq_(rv.status_code, 302) + + # test if correct data appears in details view when enabled + url = '/admin/model2/details/?url=%2Fadmin%2Fmodel2%2F&id=' + str(m2_id) + rv = client.get(url) + data = rv.data.decode('utf-8') + ok_('String Field' in data) + ok_('string_field_val_1' in data) + ok_('Int Field' in data) + + # test column_details_list + url = '/admin/sf_view/details/?url=%2Fadmin%2Fsf_view%2F&id=' + str(m2_id) + rv = client.get(url) + data = rv.data.decode('utf-8') + ok_('String Field' in data) + ok_('string_field_val_1' in data) + ok_('Int Field' not in data) + + +def test_column_filters(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + # fill DB with values + fill_db(Model1, Model2) + + # Test string filter + view = CustomModelView(Model1, column_filters=['test1']) + admin.add_view(view) + + eq_(len(view._filters), 7) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Test1']], + [ + (0, 'contains'), + (1, 'not contains'), + (2, 'equals'), + (3, 'not equal'), + (4, 'empty'), + (5, 'in list'), + (6, 'not in list'), + ] + ) + + # Make some test clients + client = app.test_client() + + # string - equals + rv = client.get('/admin/model1/?flt0_0=test1_val_1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' in data) + ok_('test1_val_2' not in data) + + # string - not equal + rv = client.get('/admin/model1/?flt0_1=test1_val_1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' not in data) + ok_('test1_val_2' in data) + + # string - contains + rv = client.get('/admin/model1/?flt0_2=test1_val_1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' in data) + ok_('test1_val_2' not in data) + + # string - not contains + rv = client.get('/admin/model1/?flt0_3=test1_val_1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' not in data) + ok_('test1_val_2' in data) + + # string - empty + rv = client.get('/admin/model1/?flt0_4=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('empty_obj' in data) + ok_('test1_val_1' not in data) + ok_('test1_val_2' not in data) + + # string - not empty + rv = client.get('/admin/model1/?flt0_4=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('empty_obj' not in data) + ok_('test1_val_1' in data) + ok_('test1_val_2' in data) + + # string - in list + rv = client.get('/admin/model1/?flt0_5=test1_val_1%2Ctest1_val_2') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' in data) + ok_('test2_val_2' in data) + ok_('test1_val_3' not in data) + ok_('test1_val_4' not in data) + + # string - not in list + rv = client.get('/admin/model1/?flt0_6=test1_val_1%2Ctest1_val_2') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' not in data) + ok_('test2_val_2' not in data) + ok_('test1_val_3' in data) + ok_('test1_val_4' in data) + + # Test numeric filter + view = CustomModelView(Model2, column_filters=['int_field']) + admin.add_view(view) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Int Field']], + [ + (0, 'equals'), + (1, 'not equal'), + (2, 'greater than'), + (3, 'smaller than'), + (4, 'empty'), + (5, 'in list'), + (6, 'not in list'), + ] + ) + + # integer - equals + rv = client.get('/admin/model2/?flt0_0=5000') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_3' in data) + ok_('string_field_val_4' not in data) + + # integer - equals (huge number) + rv = client.get('/admin/model2/?flt0_0=6169453081680413441') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_5' in data) + ok_('string_field_val_4' not in data) + + # integer - equals - test validation + rv = client.get('/admin/model2/?flt0_0=badval') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('Invalid Filter Value' in data) + + # integer - not equal + rv = client.get('/admin/model2/?flt0_1=5000') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_3' not in data) + ok_('string_field_val_4' in data) + + # integer - greater + rv = client.get('/admin/model2/?flt0_2=6000') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_3' not in data) + ok_('string_field_val_4' in data) + + # integer - smaller + rv = client.get('/admin/model2/?flt0_3=6000') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_3' in data) + ok_('string_field_val_4' not in data) + + # integer - empty + rv = client.get('/admin/model2/?flt0_4=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_1' in data) + ok_('string_field_val_2' in data) + ok_('string_field_val_3' not in data) + ok_('string_field_val_4' not in data) + + # integer - not empty + rv = client.get('/admin/model2/?flt0_4=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_1' not in data) + ok_('string_field_val_2' not in data) + ok_('string_field_val_3' in data) + ok_('string_field_val_4' in data) + + # integer - in list + rv = client.get('/admin/model2/?flt0_5=5000%2C9000') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_1' not in data) + ok_('string_field_val_2' not in data) + ok_('string_field_val_3' in data) + ok_('string_field_val_4' in data) + + # integer - in list (huge number) + rv = client.get('/admin/model2/?flt0_5=6169453081680413441') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_1' not in data) + ok_('string_field_val_5' in data) + + # integer - in list - test validation + rv = client.get('/admin/model2/?flt0_5=5000%2Cbadval') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('Invalid Filter Value' in data) + + # integer - not in list + rv = client.get('/admin/model2/?flt0_6=5000%2C9000') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_1' in data) + ok_('string_field_val_2' in data) + ok_('string_field_val_3' not in data) + ok_('string_field_val_4' not in data) + + # Test boolean filter + view = CustomModelView(Model2, column_filters=['bool_field'], + endpoint="_bools") + admin.add_view(view) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Bool Field']], + [ + (0, 'equals'), + (1, 'not equal'), + ] + ) + + # boolean - equals - Yes + rv = client.get('/admin/_bools/?flt0_0=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_1' in data) + ok_('string_field_val_2' not in data) + + # boolean - equals - No + rv = client.get('/admin/_bools/?flt0_0=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_1' not in data) + ok_('string_field_val_2' in data) + + # boolean - not equals - Yes + rv = client.get('/admin/_bools/?flt0_1=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_1' not in data) + ok_('string_field_val_2' in data) + + # boolean - not equals - No + rv = client.get('/admin/_bools/?flt0_1=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_1' in data) + ok_('string_field_val_2' not in data) + + # Test float filter + view = CustomModelView(Model2, column_filters=['float_field'], + endpoint="_float") + admin.add_view(view) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Float Field']], + [ + (0, 'equals'), + (1, 'not equal'), + (2, 'greater than'), + (3, 'smaller than'), + (4, 'empty'), + (5, 'in list'), + (6, 'not in list'), + ] + ) + + # float - equals + rv = client.get('/admin/_float/?flt0_0=25.9') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_3' in data) + ok_('string_field_val_4' not in data) + + # float - equals - test validation + rv = client.get('/admin/_float/?flt0_0=badval') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('Invalid Filter Value' in data) + + # float - not equal + rv = client.get('/admin/_float/?flt0_1=25.9') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_3' not in data) + ok_('string_field_val_4' in data) + + # float - greater + rv = client.get('/admin/_float/?flt0_2=60.5') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_3' not in data) + ok_('string_field_val_4' in data) + + # float - smaller + rv = client.get('/admin/_float/?flt0_3=60.5') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_3' in data) + ok_('string_field_val_4' not in data) + + # float - empty + rv = client.get('/admin/_float/?flt0_4=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_1' in data) + ok_('string_field_val_2' in data) + ok_('string_field_val_3' not in data) + ok_('string_field_val_4' not in data) + + # float - not empty + rv = client.get('/admin/_float/?flt0_4=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_1' not in data) + ok_('string_field_val_2' not in data) + ok_('string_field_val_3' in data) + ok_('string_field_val_4' in data) + + # float - in list + rv = client.get('/admin/_float/?flt0_5=25.9%2C75.5') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_1' not in data) + ok_('string_field_val_2' not in data) + ok_('string_field_val_3' in data) + ok_('string_field_val_4' in data) + + # float - in list - test validation + rv = client.get('/admin/_float/?flt0_5=25.9%2Cbadval') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('Invalid Filter Value' in data) + + # float - not in list + rv = client.get('/admin/_float/?flt0_6=25.9%2C75.5') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('string_field_val_1' in data) + ok_('string_field_val_2' in data) + ok_('string_field_val_3' not in data) + ok_('string_field_val_4' not in data) + + # Test datetime filter + view = CustomModelView(Model1, + column_filters=['datetime_field'], + endpoint="_datetime") + admin.add_view(view) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Datetime Field']], + [ + (0, 'equals'), + (1, 'not equal'), + (2, 'greater than'), + (3, 'smaller than'), + (4, 'between'), + (5, 'not between'), + (6, 'empty'), + ] + ) + + # datetime - equals + rv = client.get('/admin/_datetime/?flt0_0=2014-04-03+01%3A09%3A00') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('datetime_obj1' in data) + ok_('datetime_obj2' not in data) + + # datetime - not equal + rv = client.get('/admin/_datetime/?flt0_1=2014-04-03+01%3A09%3A00') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('datetime_obj1' not in data) + ok_('datetime_obj2' in data) + + # datetime - greater + rv = client.get('/admin/_datetime/?flt0_2=2014-04-03+01%3A08%3A00') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('datetime_obj1' in data) + ok_('datetime_obj2' not in data) + + # datetime - smaller + rv = client.get('/admin/_datetime/?flt0_3=2014-04-03+01%3A08%3A00') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('datetime_obj1' not in data) + ok_('datetime_obj2' in data) + + # datetime - between + rv = client.get('/admin/_datetime/?flt0_4=2014-04-02+00%3A00%3A00+to+2014-11-20+23%3A59%3A59') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('datetime_obj1' in data) + ok_('datetime_obj2' not in data) + + # datetime - not between + rv = client.get('/admin/_datetime/?flt0_5=2014-04-02+00%3A00%3A00+to+2014-11-20+23%3A59%3A59') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('datetime_obj1' not in data) + ok_('datetime_obj2' in data) + + # datetime - empty + rv = client.get('/admin/_datetime/?flt0_6=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1_val_1' in data) + ok_('datetime_obj1' not in data) + ok_('datetime_obj2' not in data) + + # datetime - not empty + rv = client.get('/admin/_datetime/?flt0_6=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1_val_1' not in data) + ok_('datetime_obj1' in data) + ok_('datetime_obj2' in data) + + +def test_default_sort(): + app, db, admin = setup() + M1, _ = create_models(db) + + M1(test1='c', test2='x').save() + M1(test1='b', test2='x').save() + M1(test1='a', test2='y').save() + + eq_(M1.objects.count(), 3) + + view = CustomModelView(M1, column_default_sort='test1') + admin.add_view(view) + + _, data = view.get_list(0, None, None, None, None) + + eq_(data[0].test1, 'a') + eq_(data[1].test1, 'b') + eq_(data[2].test1, 'c') + + # test default sort with multiple columns + order = [('test2', False), ('test1', False)] + view2 = CustomModelView(M1, column_default_sort=order, endpoint='m1_2') + admin.add_view(view2) + + _, data = view2.get_list(0, None, None, None, None) + + eq_(len(data), 3) + eq_(data[0].test1, 'b') + eq_(data[1].test1, 'c') + eq_(data[2].test1, 'a') + + +def test_extra_fields(): + app, db, admin = setup() + + Model1, _ = create_models(db) + + view = CustomModelView( + Model1, + form_extra_fields={ + 'extra_field': fields.StringField('Extra Field') + } + ) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model1/new/') + eq_(rv.status_code, 200) + + # Check presence and order + data = rv.data.decode('utf-8') + ok_('Extra Field' in data) + pos1 = data.find('Extra Field') + pos2 = data.find('Test1') + ok_(pos2 < pos1) + + +def test_extra_field_order(): + app, db, admin = setup() + + Model1, _ = create_models(db) + + view = CustomModelView( + Model1, + form_extra_fields={ + 'extra_field': fields.StringField('Extra Field') + } + ) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model1/new/') + eq_(rv.status_code, 200) + + # Check presence and order + data = rv.data.decode('utf-8') + ok_('Extra Field' in data) + pos1 = data.find('Extra Field') + pos2 = data.find('Test1') + ok_(pos2 < pos1) + + +def test_custom_form_base(): + app, db, admin = setup() + + class TestForm(form.BaseForm): + pass + + Model1, _ = create_models(db) + + view = CustomModelView( + Model1, + form_base_class=TestForm + ) + admin.add_view(view) + + ok_(hasattr(view._create_form_class, 'test1')) + + create_form = view.create_form() + ok_(isinstance(create_form, TestForm)) + + +def test_subdocument_config(): + app, db, admin = setup() + + class Comment(db.EmbeddedDocument): + name = db.StringField(max_length=20, required=True) + value = db.StringField(max_length=20) + + class Model1(db.Document): + test1 = db.StringField(max_length=20) + subdoc = db.EmbeddedDocumentField(Comment) + + # Check only + view1 = CustomModelView( + Model1, + form_subdocuments={ + 'subdoc': { + 'form_columns': ('name',) + } + } + ) + + ok_(hasattr(view1._create_form_class, 'subdoc')) + + form = view1.create_form() + ok_('name' in dir(form.subdoc.form)) + ok_('value' not in dir(form.subdoc.form)) + + # Check exclude + view2 = CustomModelView( + Model1, + form_subdocuments={ + 'subdoc': { + 'form_excluded_columns': ('value',) + } + } + ) + + form = view2.create_form() + ok_('name' in dir(form.subdoc.form)) + ok_('value' not in dir(form.subdoc.form)) + + +def test_subdocument_class_config(): + app, db, admin = setup() + + from flask_admin.contrib.mongoengine import EmbeddedForm + + class Comment(db.EmbeddedDocument): + name = db.StringField(max_length=20, required=True) + value = db.StringField(max_length=20) + + class Model1(db.Document): + test1 = db.StringField(max_length=20) + subdoc = db.EmbeddedDocumentField(Comment) + + class EmbeddedConfig(EmbeddedForm): + form_columns = ('name',) + + # Check only + view1 = CustomModelView( + Model1, + form_subdocuments={ + 'subdoc': EmbeddedConfig() + } + ) + + form = view1.create_form() + ok_('name' in dir(form.subdoc.form)) + ok_('value' not in dir(form.subdoc.form)) + + +def test_nested_subdocument_config(): + app, db, admin = setup() + + # Check recursive + class Comment(db.EmbeddedDocument): + name = db.StringField(max_length=20, required=True) + value = db.StringField(max_length=20) + + class Nested(db.EmbeddedDocument): + name = db.StringField(max_length=20, required=True) + comment = db.EmbeddedDocumentField(Comment) + + class Model1(db.Document): + test1 = db.StringField(max_length=20) + nested = db.EmbeddedDocumentField(Nested) + + view1 = CustomModelView( + Model1, + form_subdocuments={ + 'nested': { + 'form_subdocuments': { + 'comment': { + 'form_columns': ('name',) + } + } + } + } + ) + + form = view1.create_form() + ok_('name' in dir(form.nested.form.comment.form)) + ok_('value' not in dir(form.nested.form.comment.form)) + + +def test_nested_list_subdocument(): + app, db, admin = setup() + + class Comment(db.EmbeddedDocument): + name = db.StringField(max_length=20, required=True) + value = db.StringField(max_length=20) + + class Model1(db.Document): + test1 = db.StringField(max_length=20) + subdoc = db.ListField(db.EmbeddedDocumentField(Comment)) + + # Check only + view1 = CustomModelView( + Model1, + form_subdocuments={ + 'subdoc': { + 'form_subdocuments': { + None: { + 'form_columns': ('name',) + } + } + + } + } + ) + + form = view1.create_form() + inline_form = form.subdoc.unbound_field.args[2] + + ok_('name' in dir(inline_form)) + ok_('value' not in dir(inline_form)) + + +def test_nested_sortedlist_subdocument(): + app, db, admin = setup() + + class Comment(db.EmbeddedDocument): + name = db.StringField(max_length=20, required=True) + value = db.StringField(max_length=20) + + class Model1(db.Document): + test1 = db.StringField(max_length=20) + subdoc = db.SortedListField(db.EmbeddedDocumentField(Comment)) + + # Check only + view1 = CustomModelView( + Model1, + form_subdocuments={ + 'subdoc': { + 'form_subdocuments': { + None: { + 'form_columns': ('name',) + } + } + } + } + ) + + form = view1.create_form() + inline_form = form.subdoc.unbound_field.args[2] + + ok_('name' in dir(inline_form)) + ok_('value' not in dir(inline_form)) + + +def test_sortedlist_subdocument_validation(): + app, db, admin = setup() + + class Comment(db.EmbeddedDocument): + name = db.StringField(max_length=20, required=True) + value = db.StringField(max_length=20) + + class Model1(db.Document): + test1 = db.StringField(max_length=20) + subdoc = db.SortedListField(db.EmbeddedDocumentField(Comment)) + + view = CustomModelView(Model1) + admin.add_view(view) + client = app.test_client() + + rv = client.post('/admin/model1/new/', + data={'test1': 'test1large', 'subdoc-0-name': 'comment', 'subdoc-0-value': 'test'}) + eq_(rv.status_code, 302) + + rv = client.post('/admin/model1/new/', + data={'test1': 'test1large', 'subdoc-0-name': '', 'subdoc-0-value': 'test'}) + eq_(rv.status_code, 200) + ok_('This field is required' in rv.data) + + +def test_list_subdocument_validation(): + app, db, admin = setup() + + class Comment(db.EmbeddedDocument): + name = db.StringField(max_length=20, required=True) + value = db.StringField(max_length=20) + + class Model1(db.Document): + test1 = db.StringField(max_length=20) + subdoc = db.ListField(db.EmbeddedDocumentField(Comment)) + + view = CustomModelView(Model1) + admin.add_view(view) + client = app.test_client() + + rv = client.post('/admin/model1/new/', + data={'test1': 'test1large', 'subdoc-0-name': 'comment', 'subdoc-0-value': 'test'}) + eq_(rv.status_code, 302) + + rv = client.post('/admin/model1/new/', + data={'test1': 'test1large', 'subdoc-0-name': '', 'subdoc-0-value': 'test'}) + eq_(rv.status_code, 200) + ok_('This field is required' in rv.data) + + +def test_ajax_fk(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + view = CustomModelView( + Model2, + url='view', + form_ajax_refs={ + 'model1': { + 'fields': ('test1', 'test2') + } + } + ) + admin.add_view(view) + + ok_(u'model1' in view._form_ajax_refs) + + model = Model1(test1=u'first') + model.save() + model2 = Model1(test1=u'foo', test2=u'bar').save() + + # Check loader + loader = view._form_ajax_refs[u'model1'] + mdl = loader.get_one(model.id) + eq_(mdl.test1, model.test1) + + items = loader.get_list(u'fir') + eq_(len(items), 1) + eq_(items[0].id, model.id) + + items = loader.get_list(u'bar') + eq_(len(items), 1) + eq_(items[0].test1, u'foo') + + # Check form generation + form = view.create_form() + eq_(form.model1.__class__.__name__, u'AjaxSelectField') + + with app.test_request_context('/admin/view/'): + ok_(u'value=""' not in form.model1()) + + form.model1.data = model + needle = u'data-json="["%s", "first"]"' % as_unicode(model.id) + ok_(needle in form.model1()) + ok_(u'value="%s"' % as_unicode(model.id) in form.model1()) + + # Check querying + client = app.test_client() + + req = client.get(u'/admin/view/ajax/lookup/?name=model1&query=foo') + eq_(req.data, u'[["%s", "foo"]]' % model2.id) + + # Check submitting + client.post('/admin/view/new/', data={u'model1': as_unicode(model.id)}) + mdl = Model2.objects.first() + + ok_(mdl is not None) + ok_(mdl.model1 is not None) + eq_(mdl.model1.id, model.id) + eq_(mdl.model1.test1, u'first') + + +def test_nested_ajax_refs(): + app, db, admin = setup() + + # Check recursive + class Comment(db.Document): + name = db.StringField(max_length=20, required=True) + value = db.StringField(max_length=20) + + class Nested(db.EmbeddedDocument): + name = db.StringField(max_length=20, required=True) + comment = db.ReferenceField(Comment) + + class Model1(db.Document): + test1 = db.StringField(max_length=20) + nested = db.EmbeddedDocumentField(Nested) + + view1 = CustomModelView( + Model1, + form_subdocuments={ + 'nested': { + 'form_ajax_refs': { + 'comment': { + 'fields': ['name'] + } + } + } + } + ) + + form = view1.create_form() + eq_(type(form.nested.form.comment).__name__, 'AjaxSelectField') + ok_('nested-comment' in view1._form_ajax_refs) + + +def test_form_flat_choices(): + app, db, admin = setup() + + class Model(db.Document): + name = db.StringField(max_length=20, choices=('a', 'b', 'c')) + + view = CustomModelView(Model) + admin.add_view(view) + + form = view.create_form() + eq_(form.name.choices, [('a', 'a'), ('b', 'b'), ('c', 'c')]) + + +def test_form_args(): + app, db, admin = setup() + + class Model(db.Document): + test = db.StringField(required=True) + + shared_form_args = {'test': {'validators': [validators.Regexp('test')]}} + + view = CustomModelView(Model, form_args=shared_form_args) + admin.add_view(view) + + # ensure shared field_args don't create duplicate validators + create_form = view.create_form() + eq_(len(create_form.test.validators), 2) + + edit_form = view.edit_form() + eq_(len(edit_form.test.validators), 2) + + +def test_form_args_embeddeddoc(): + app, db, admin = setup() + + class Info(db.EmbeddedDocument): + name = db.StringField() + age = db.StringField() + + class Model(db.Document): + info = db.EmbeddedDocumentField('Info') + timestamp = db.DateTimeField() + + view = CustomModelView( + Model, + form_args={ + 'info': {'label': 'Information'}, + 'timestamp': {'label': 'Last Updated Time'} + } + ) + admin.add_view(view) + form = view.create_form() + eq_(form.timestamp.label.text, 'Last Updated Time') + # This is the failure + eq_(form.info.label.text, 'Information') + + +def test_simple_list_pager(): + app, db, admin = setup() + Model1, _ = create_models(db) + + class TestModelView(CustomModelView): + simple_list_pager = True + + def get_count_query(self): + assert False + + view = TestModelView(Model1) + admin.add_view(view) + + count, data = view.get_list(0, None, None, None, None) + ok_(count is None) + + +def test_export_csv(): + app, db, admin = setup() + Model1, Model2 = create_models(db) + + view = CustomModelView(Model1, can_export=True, + column_list=['test1', 'test2'], export_max_rows=2, + endpoint='row_limit_2') + admin.add_view(view) + + for x in range(5): + fill_db(Model1, Model2) + + client = app.test_client() + + # test export_max_rows + rv = client.get('/admin/row_limit_2/export/csv/') + data = rv.data.decode('utf-8') + eq_(rv.status_code, 200) + ok_("Test1,Test2\r\n" + "test1_val_1,test2_val_1\r\n" + "test1_val_2,test2_val_2\r\n" == data) + + view = CustomModelView(Model1, can_export=True, + column_list=['test1', 'test2'], + endpoint='no_row_limit') + admin.add_view(view) + + # test row limit without export_max_rows + rv = client.get('/admin/no_row_limit/export/csv/') + data = rv.data.decode('utf-8') + eq_(rv.status_code, 200) + ok_(len(data.splitlines()) > 21) diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/peeweemodel/__init__.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/peeweemodel/__init__.py new file mode 100644 index 00000000..20fe5543 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/peeweemodel/__init__.py @@ -0,0 +1,15 @@ +from flask import Flask +from flask_admin import Admin +import peewee + + +def setup(): + app = Flask(__name__) + app.config['SECRET_KEY'] = '1' + app.config['CSRF_ENABLED'] = False + app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + + db = peewee.SqliteDatabase(':memory:') + admin = Admin(app) + + return app, db, admin diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/peeweemodel/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/peeweemodel/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..e0a19824 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/peeweemodel/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/peeweemodel/__pycache__/test_basic.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/peeweemodel/__pycache__/test_basic.cpython-38.pyc new file mode 100644 index 00000000..26590f60 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/peeweemodel/__pycache__/test_basic.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/peeweemodel/test_basic.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/peeweemodel/test_basic.py new file mode 100644 index 00000000..a7a80d03 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/peeweemodel/test_basic.py @@ -0,0 +1,1083 @@ +from nose.tools import eq_, ok_ +from nose.plugins.skip import SkipTest + +# Skip test on PY3 +from flask_admin._compat import PY2, as_unicode +if not PY2: + raise SkipTest('Peewee is not Python 3 compatible') + +import peewee + +from wtforms import fields, validators + +from flask_admin import form +from flask_admin._compat import iteritems +from flask_admin.contrib.peewee import ModelView + +from . import setup + +from datetime import datetime, time, date + + +class CustomModelView(ModelView): + def __init__(self, model, + name=None, category=None, endpoint=None, url=None, + **kwargs): + for k, v in iteritems(kwargs): + setattr(self, k, v) + + super(CustomModelView, self).__init__(model, + name, category, + endpoint, url) + + +def create_models(db): + class BaseModel(peewee.Model): + class Meta: + database = db + + class Model1(BaseModel): + def __init__(self, test1=None, test2=None, test3=None, test4=None, + date_field=None, timeonly_field=None, + datetime_field=None, **kwargs): + super(Model1, self).__init__(**kwargs) + + self.test1 = test1 + self.test2 = test2 + self.test3 = test3 + self.test4 = test4 + self.date_field = date_field + self.timeonly_field = timeonly_field + self.datetime_field = datetime_field + + test1 = peewee.CharField(max_length=20, null=True) + test2 = peewee.CharField(max_length=20, null=True) + test3 = peewee.TextField(null=True) + test4 = peewee.TextField(null=True) + date_field = peewee.DateField(null=True) + timeonly_field = peewee.TimeField(null=True) + datetime_field = peewee.DateTimeField(null=True) + + def __str__(self): + # "or ''" fixes error when loading choices for relation field: + # TypeError: coercing to Unicode: need string or buffer, NoneType found + return self.test1 or '' + + class Model2(BaseModel): + def __init__(self, char_field=None, int_field=None, float_field=None, + bool_field=0, **kwargs): + super(Model2, self).__init__(**kwargs) + + self.char_field = char_field + self.int_field = int_field + self.float_field = float_field + self.bool_field = bool_field + + char_field = peewee.CharField(max_length=20) + int_field = peewee.IntegerField(null=True) + float_field = peewee.FloatField(null=True) + bool_field = peewee.BooleanField() + + # Relation + model1 = peewee.ForeignKeyField(Model1, null=True) + + Model1.create_table() + Model2.create_table() + + return Model1, Model2 + + +def fill_db(Model1, Model2): + Model1('test1_val_1', 'test2_val_1').save() + Model1('test1_val_2', 'test2_val_2').save() + Model1('test1_val_3', 'test2_val_3').save() + Model1('test1_val_4', 'test2_val_4').save() + Model1(None, 'empty_obj').save() + + Model2('char_field_val_1', None, None, bool_field=True).save() + Model2('char_field_val_2', None, None, bool_field=False).save() + Model2('char_field_val_3', 5000, 25.9).save() + Model2('char_field_val_4', 9000, 75.5).save() + Model2('char_field_val_5', 6169453081680413441).save() + + Model1('date_obj1', date_field=date(2014, 11, 17)).save() + Model1('date_obj2', date_field=date(2013, 10, 16)).save() + Model1('timeonly_obj1', timeonly_field=time(11, 10, 9)).save() + Model1('timeonly_obj2', timeonly_field=time(10, 9, 8)).save() + Model1('datetime_obj1', datetime_field=datetime(2014, 4, 3, 1, 9, 0)).save() + Model1('datetime_obj2', datetime_field=datetime(2013, 3, 2, 0, 8, 0)).save() + + +def test_model(): + app, db, admin = setup() + Model1, Model2 = create_models(db) + + view = CustomModelView(Model1) + admin.add_view(view) + + eq_(view.model, Model1) + eq_(view.name, 'Model1') + eq_(view.endpoint, 'model1') + + eq_(view._primary_key, 'id') + + ok_('test1' in view._sortable_columns) + ok_('test2' in view._sortable_columns) + ok_('test3' in view._sortable_columns) + ok_('test4' in view._sortable_columns) + + ok_(view._create_form_class is not None) + ok_(view._edit_form_class is not None) + eq_(view._search_supported, False) + eq_(view._filters, None) + + # Verify form + eq_(view._create_form_class.test1.field_class, fields.StringField) + eq_(view._create_form_class.test2.field_class, fields.StringField) + eq_(view._create_form_class.test3.field_class, fields.TextAreaField) + eq_(view._create_form_class.test4.field_class, fields.TextAreaField) + + # Make some test clients + client = app.test_client() + + rv = client.get('/admin/model1/') + eq_(rv.status_code, 200) + + rv = client.get('/admin/model1/new/') + eq_(rv.status_code, 200) + + rv = client.post('/admin/model1/new/', + data=dict(test1='test1large', test2='test2')) + eq_(rv.status_code, 302) + + model = Model1.select().get() + eq_(model.test1, 'test1large') + eq_(model.test2, 'test2') + ok_(model.test3 is None or model.test3 == '') + ok_(model.test4 is None or model.test4 == '') + + rv = client.get('/admin/model1/') + eq_(rv.status_code, 200) + ok_('test1large' in rv.data) + + url = '/admin/model1/edit/?id=%s' % model.id + rv = client.get(url) + eq_(rv.status_code, 200) + + rv = client.post(url, + data=dict(test1='test1small', test2='test2large')) + eq_(rv.status_code, 302) + + model = Model1.select().get() + eq_(model.test1, 'test1small') + eq_(model.test2, 'test2large') + ok_(model.test3 is None or model.test3 == '') + ok_(model.test4 is None or model.test4 == '') + + url = '/admin/model1/delete/?id=%s' % model.id + rv = client.post(url) + eq_(rv.status_code, 302) + eq_(Model1.select().count(), 0) + + +def test_column_editable_list(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + # wtf-peewee doesn't automatically add length validators for max_length + form_args = {'test1': {'validators': [validators.Length(max=20)]}} + view = CustomModelView(Model1, column_editable_list=['test1'], + form_args=form_args) + admin.add_view(view) + + fill_db(Model1, Model2) + + client = app.test_client() + + # Test in-line edit field rendering + rv = client.get('/admin/model1/') + data = rv.data.decode('utf-8') + ok_('data-role="x-editable"' in data) + + # Form - Test basic in-line edit functionality + rv = client.post('/admin/model1/ajax/update/', data={ + 'list_form_pk': '1', + 'test1': 'change-success-1', + }) + data = rv.data.decode('utf-8') + ok_('Record was successfully saved.' == data) + + # ensure the value has changed + rv = client.get('/admin/model1/') + data = rv.data.decode('utf-8') + ok_('change-success-1' in data) + + # Test validation error + rv = client.post('/admin/model1/ajax/update/', data={ + 'list_form_pk': '1', + 'test1': ('longerthantwentycharacterslongerthantwentycharacterslonger' + 'thantwentycharacterslongerthantwentycharacters'), + }) + data = rv.data.decode('utf-8') + eq_(rv.status_code, 500) + + # Test invalid primary key + rv = client.post('/admin/model1/ajax/update/', data={ + 'list_form_pk': '1000', + 'test1': 'problematic-input', + }) + data = rv.data.decode('utf-8') + eq_(rv.status_code, 500) + + # Test editing column not in column_editable_list + rv = client.post('/admin/model1/ajax/update/', data={ + 'list_form_pk': '1', + 'test2': 'problematic-input', + }) + data = rv.data.decode('utf-8') + ok_('problematic-input' not in data) + + # Test in-line editing for relations + view = CustomModelView(Model2, column_editable_list=['model1']) + admin.add_view(view) + + rv = client.post('/admin/model2/ajax/update/', data={ + 'list_form_pk': '1', + 'model1': '3', + }) + data = rv.data.decode('utf-8') + ok_('Record was successfully saved.' == data) + + # confirm the value has changed + rv = client.get('/admin/model2/') + data = rv.data.decode('utf-8') + ok_('test1_val_3' in data) + + +def test_details_view(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + view_no_details = CustomModelView(Model1) + admin.add_view(view_no_details) + + # fields are scaffolded + view_w_details = CustomModelView(Model2, can_view_details=True) + admin.add_view(view_w_details) + + # show only specific fields in details w/ column_details_list + char_field_view = CustomModelView(Model2, can_view_details=True, + column_details_list=["char_field"], + endpoint="cf_view") + admin.add_view(char_field_view) + + fill_db(Model1, Model2) + + client = app.test_client() + + # ensure link to details is hidden when can_view_details is disabled + rv = client.get('/admin/model1/') + data = rv.data.decode('utf-8') + ok_('/admin/model1/details/' not in data) + + # ensure link to details view appears + rv = client.get('/admin/model2/') + data = rv.data.decode('utf-8') + ok_('/admin/model2/details/' in data) + + # test redirection when details are disabled + rv = client.get('/admin/model1/details/?url=%2Fadmin%2Fmodel1%2F&id=3') + eq_(rv.status_code, 302) + + # test if correct data appears in details view when enabled + rv = client.get('/admin/model2/details/?url=%2Fadmin%2Fmodel2%2F&id=3') + data = rv.data.decode('utf-8') + ok_('Char Field' in data) + ok_('char_field_val_3' in data) + ok_('Int Field' in data) + ok_('5000' in data) + + # test column_details_list + rv = client.get('/admin/cf_view/details/?url=%2Fadmin%2Fcf_view%2F&id=3') + data = rv.data.decode('utf-8') + ok_('Char Field' in data) + ok_('char_field_val_3' in data) + ok_('Int Field' not in data) + ok_('5000' not in data) + + +def test_column_filters(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + fill_db(Model1, Model2) + + # Test string filter + view = CustomModelView(Model1, column_filters=['test1']) + admin.add_view(view) + + eq_(len(view._filters), 7) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Test1']], + [ + (0, 'contains'), + (1, 'not contains'), + (2, 'equals'), + (3, 'not equal'), + (4, 'empty'), + (5, 'in list'), + (6, 'not in list'), + ] + ) + + # Make some test clients + client = app.test_client() + + # string - equals + rv = client.get('/admin/model1/?flt0_0=test1_val_1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' in data) + ok_('test1_val_2' not in data) + + # string - not equal + rv = client.get('/admin/model1/?flt0_1=test1_val_1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' not in data) + ok_('test1_val_2' in data) + + # string - contains + rv = client.get('/admin/model1/?flt0_2=test1_val_1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' in data) + ok_('test1_val_2' not in data) + + # string - not contains + rv = client.get('/admin/model1/?flt0_3=test1_val_1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' not in data) + ok_('test1_val_2' in data) + + # string - empty + rv = client.get('/admin/model1/?flt0_4=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('empty_obj' in data) + ok_('test1_val_1' not in data) + ok_('test1_val_2' not in data) + + # string - not empty + rv = client.get('/admin/model1/?flt0_4=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('empty_obj' not in data) + ok_('test1_val_1' in data) + ok_('test1_val_2' in data) + + # string - in list + rv = client.get('/admin/model1/?flt0_5=test1_val_1%2Ctest1_val_2') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' in data) + ok_('test2_val_2' in data) + ok_('test1_val_3' not in data) + ok_('test1_val_4' not in data) + + # string - not in list + rv = client.get('/admin/model1/?flt0_6=test1_val_1%2Ctest1_val_2') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' not in data) + ok_('test2_val_2' not in data) + ok_('test1_val_3' in data) + ok_('test1_val_4' in data) + + # Test int filter + view = CustomModelView(Model2, column_filters=['int_field']) + admin.add_view(view) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Int Field']], + [ + (0, 'equals'), + (1, 'not equal'), + (2, 'greater than'), + (3, 'smaller than'), + (4, 'empty'), + (5, 'in list'), + (6, 'not in list'), + ] + ) + + # integer - equals + rv = client.get('/admin/model2/?flt0_0=5000') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_3' in data) + ok_('char_field_val_4' not in data) + + # integer - equals (huge number) + rv = client.get('/admin/model2/?flt0_0=6169453081680413441') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_5' in data) + ok_('char_field_val_4' not in data) + + # integer - equals - test validation + rv = client.get('/admin/model2/?flt0_0=badval') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('Invalid Filter Value' in data) + + # integer - not equal + rv = client.get('/admin/model2/?flt0_1=5000') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_3' not in data) + ok_('char_field_val_4' in data) + + # integer - greater + rv = client.get('/admin/model2/?flt0_2=6000') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_3' not in data) + ok_('char_field_val_4' in data) + + # integer - smaller + rv = client.get('/admin/model2/?flt0_3=6000') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_3' in data) + ok_('char_field_val_4' not in data) + + # integer - empty + rv = client.get('/admin/model2/?flt0_4=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_1' in data) + ok_('char_field_val_2' in data) + ok_('char_field_val_3' not in data) + ok_('char_field_val_4' not in data) + + # integer - not empty + rv = client.get('/admin/model2/?flt0_4=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_1' not in data) + ok_('char_field_val_2' not in data) + ok_('char_field_val_3' in data) + ok_('char_field_val_4' in data) + + # integer - in list + rv = client.get('/admin/model2/?flt0_5=5000%2C9000') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_1' not in data) + ok_('char_field_val_2' not in data) + ok_('char_field_val_3' in data) + ok_('char_field_val_4' in data) + + # integer - in list (huge number) + rv = client.get('/admin/model2/?flt0_5=6169453081680413441') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_1' not in data) + ok_('char_field_val_5' in data) + + # integer - in list - test validation + rv = client.get('/admin/model2/?flt0_5=5000%2Cbadval') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('Invalid Filter Value' in data) + + # integer - not in list + rv = client.get('/admin/model2/?flt0_6=5000%2C9000') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_1' in data) + ok_('char_field_val_2' in data) + ok_('char_field_val_3' not in data) + ok_('char_field_val_4' not in data) + + # Test boolean filter + view = CustomModelView(Model2, column_filters=['bool_field'], + endpoint="_bools") + admin.add_view(view) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Bool Field']], + [ + (0, 'equals'), + (1, 'not equal'), + ] + ) + + # boolean - equals - Yes + rv = client.get('/admin/_bools/?flt0_0=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_1' in data) + ok_('char_field_val_2' not in data) + ok_('char_field_val_3' not in data) + + # boolean - equals - No + rv = client.get('/admin/_bools/?flt0_0=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_1' not in data) + ok_('char_field_val_2' in data) + ok_('char_field_val_3' in data) + + # boolean - not equals - Yes + rv = client.get('/admin/_bools/?flt0_1=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_1' not in data) + ok_('char_field_val_2' in data) + ok_('char_field_val_3' in data) + + # boolean - not equals - No + rv = client.get('/admin/_bools/?flt0_1=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_1' in data) + ok_('char_field_val_2' not in data) + ok_('char_field_val_3' not in data) + + # Test float filter + view = CustomModelView(Model2, column_filters=['float_field'], + endpoint="_float") + admin.add_view(view) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Float Field']], + [ + (0, 'equals'), + (1, 'not equal'), + (2, 'greater than'), + (3, 'smaller than'), + (4, 'empty'), + (5, 'in list'), + (6, 'not in list'), + ] + ) + + # float - equals + rv = client.get('/admin/_float/?flt0_0=25.9') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_3' in data) + ok_('char_field_val_4' not in data) + + # float - equals - test validation + rv = client.get('/admin/_float/?flt0_0=badval') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('Invalid Filter Value' in data) + + # float - not equal + rv = client.get('/admin/_float/?flt0_1=25.9') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_3' not in data) + ok_('char_field_val_4' in data) + + # float - greater + rv = client.get('/admin/_float/?flt0_2=60.5') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_3' not in data) + ok_('char_field_val_4' in data) + + # float - smaller + rv = client.get('/admin/_float/?flt0_3=60.5') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_3' in data) + ok_('char_field_val_4' not in data) + + # float - empty + rv = client.get('/admin/_float/?flt0_4=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_1' in data) + ok_('char_field_val_2' in data) + ok_('char_field_val_3' not in data) + ok_('char_field_val_4' not in data) + + # float - not empty + rv = client.get('/admin/_float/?flt0_4=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_1' not in data) + ok_('char_field_val_2' not in data) + ok_('char_field_val_3' in data) + ok_('char_field_val_4' in data) + + # float - in list + rv = client.get('/admin/_float/?flt0_5=25.9%2C75.5') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_1' not in data) + ok_('char_field_val_2' not in data) + ok_('char_field_val_3' in data) + ok_('char_field_val_4' in data) + + # float - in list - test validation + rv = client.get('/admin/_float/?flt0_5=25.9%2Cbadval') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('Invalid Filter Value' in data) + + # float - not in list + rv = client.get('/admin/_float/?flt0_6=25.9%2C75.5') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('char_field_val_1' in data) + ok_('char_field_val_2' in data) + ok_('char_field_val_3' not in data) + ok_('char_field_val_4' not in data) + + # Test date, time, and datetime filters + view = CustomModelView(Model1, + column_filters=['date_field', 'datetime_field', 'timeonly_field'], + endpoint="_datetime") + admin.add_view(view) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Date Field']], + [ + (0, 'equals'), + (1, 'not equal'), + (2, 'greater than'), + (3, 'smaller than'), + (4, 'between'), + (5, 'not between'), + (6, 'empty'), + ] + ) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Datetime Field']], + [ + (7, 'equals'), + (8, 'not equal'), + (9, 'greater than'), + (10, 'smaller than'), + (11, 'between'), + (12, 'not between'), + (13, 'empty'), + ] + ) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Timeonly Field']], + [ + (14, 'equals'), + (15, 'not equal'), + (16, 'greater than'), + (17, 'smaller than'), + (18, 'between'), + (19, 'not between'), + (20, 'empty'), + ] + ) + + # date - equals + rv = client.get('/admin/_datetime/?flt0_0=2014-11-17') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('date_obj1' in data) + ok_('date_obj2' not in data) + + # date - not equal + rv = client.get('/admin/_datetime/?flt0_1=2014-11-17') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('date_obj1' not in data) + ok_('date_obj2' in data) + + # date - greater + rv = client.get('/admin/_datetime/?flt0_2=2014-11-16') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('date_obj1' in data) + ok_('date_obj2' not in data) + + # date - smaller + rv = client.get('/admin/_datetime/?flt0_3=2014-11-16') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('date_obj1' not in data) + ok_('date_obj2' in data) + + # date - between + rv = client.get('/admin/_datetime/?flt0_4=2014-11-13+to+2014-11-20') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('date_obj1' in data) + ok_('date_obj2' not in data) + + # date - not between + rv = client.get('/admin/_datetime/?flt0_5=2014-11-13+to+2014-11-20') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('date_obj1' not in data) + ok_('date_obj2' in data) + + # date - empty + rv = client.get('/admin/_datetime/?flt0_6=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1_val_1' in data) + ok_('date_obj1' not in data) + ok_('date_obj2' not in data) + + # date - empty + rv = client.get('/admin/_datetime/?flt0_6=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1_val_1' not in data) + ok_('date_obj1' in data) + ok_('date_obj2' in data) + + # datetime - equals + rv = client.get('/admin/_datetime/?flt0_7=2014-04-03+01%3A09%3A00') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('datetime_obj1' in data) + ok_('datetime_obj2' not in data) + + # datetime - not equal + rv = client.get('/admin/_datetime/?flt0_8=2014-04-03+01%3A09%3A00') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('datetime_obj1' not in data) + ok_('datetime_obj2' in data) + + # datetime - greater + rv = client.get('/admin/_datetime/?flt0_9=2014-04-03+01%3A08%3A00') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('datetime_obj1' in data) + ok_('datetime_obj2' not in data) + + # datetime - smaller + rv = client.get('/admin/_datetime/?flt0_10=2014-04-03+01%3A08%3A00') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('datetime_obj1' not in data) + ok_('datetime_obj2' in data) + + # datetime - between + rv = client.get('/admin/_datetime/?flt0_11=2014-04-02+00%3A00%3A00+to+2014-11-20+23%3A59%3A59') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('datetime_obj1' in data) + ok_('datetime_obj2' not in data) + + # datetime - not between + rv = client.get('/admin/_datetime/?flt0_12=2014-04-02+00%3A00%3A00+to+2014-11-20+23%3A59%3A59') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('datetime_obj1' not in data) + ok_('datetime_obj2' in data) + + # datetime - empty + rv = client.get('/admin/_datetime/?flt0_13=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1_val_1' in data) + ok_('datetime_obj1' not in data) + ok_('datetime_obj2' not in data) + + # datetime - not empty + rv = client.get('/admin/_datetime/?flt0_13=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1_val_1' not in data) + ok_('datetime_obj1' in data) + ok_('datetime_obj2' in data) + + # time - equals + rv = client.get('/admin/_datetime/?flt0_14=11%3A10%3A09') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('timeonly_obj1' in data) + ok_('timeonly_obj2' not in data) + + # time - not equal + rv = client.get('/admin/_datetime/?flt0_15=11%3A10%3A09') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('timeonly_obj1' not in data) + ok_('timeonly_obj2' in data) + + # time - greater + rv = client.get('/admin/_datetime/?flt0_16=11%3A09%3A09') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('timeonly_obj1' in data) + ok_('timeonly_obj2' not in data) + + # time - smaller + rv = client.get('/admin/_datetime/?flt0_17=11%3A09%3A09') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('timeonly_obj1' not in data) + ok_('timeonly_obj2' in data) + + # time - between + rv = client.get('/admin/_datetime/?flt0_18=10%3A40%3A00+to+11%3A50%3A59') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('timeonly_obj1' in data) + ok_('timeonly_obj2' not in data) + + # time - not between + rv = client.get('/admin/_datetime/?flt0_19=10%3A40%3A00+to+11%3A50%3A59') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('timeonly_obj1' not in data) + ok_('timeonly_obj2' in data) + + # time - empty + rv = client.get('/admin/_datetime/?flt0_20=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1_val_1' in data) + ok_('timeonly_obj1' not in data) + ok_('timeonly_obj2' not in data) + + # time - not empty + rv = client.get('/admin/_datetime/?flt0_20=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1_val_1' not in data) + ok_('timeonly_obj1' in data) + ok_('timeonly_obj2' in data) + + +def test_default_sort(): + app, db, admin = setup() + M1, _ = create_models(db) + + M1('c', 1).save() + M1('b', 1).save() + M1('a', 2).save() + + eq_(M1.select().count(), 3) + + view = CustomModelView(M1, column_default_sort='test1') + admin.add_view(view) + + _, data = view.get_list(0, None, None, None, None) + + eq_(data[0].test1, 'a') + eq_(data[1].test1, 'b') + eq_(data[2].test1, 'c') + + # test default sort with multiple columns + order = [('test2', False), ('test1', False)] + view2 = CustomModelView(M1, column_default_sort=order, endpoint='m1_2') + admin.add_view(view2) + + _, data = view2.get_list(0, None, None, None, None) + + eq_(len(data), 3) + eq_(data[0].test1, 'b') + eq_(data[1].test1, 'c') + eq_(data[2].test1, 'a') + + +def test_extra_fields(): + app, db, admin = setup() + + Model1, _ = create_models(db) + + view = CustomModelView( + Model1, + form_extra_fields={ + 'extra_field': fields.StringField('Extra Field') + } + ) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model1/new/') + eq_(rv.status_code, 200) + + # Check presence and order + data = rv.data.decode('utf-8') + ok_('Extra Field' in data) + pos1 = data.find('Extra Field') + pos2 = data.find('Test1') + ok_(pos2 < pos1) + + +def test_custom_form_base(): + app, db, admin = setup() + + class TestForm(form.BaseForm): + pass + + Model1, _ = create_models(db) + + view = CustomModelView( + Model1, + form_base_class=TestForm + ) + admin.add_view(view) + + ok_(hasattr(view._create_form_class, 'test1')) + + create_form = view.create_form() + ok_(isinstance(create_form, TestForm)) + + +def test_form_args(): + app, db, admin = setup() + + class BaseModel(peewee.Model): + class Meta: + database = db + + class Model(BaseModel): + test = peewee.CharField(null=False) + + Model.create_table() + + shared_form_args = {'test': {'validators': [validators.Regexp('test')]}} + + view = CustomModelView(Model, form_args=shared_form_args) + admin.add_view(view) + + # ensure shared field_args don't create duplicate validators + create_form = view.create_form() + + eq_(len(create_form.test.validators), 2) + + edit_form = view.edit_form() + eq_(len(edit_form.test.validators), 2) + + +def test_ajax_fk(): + app, db, admin = setup() + + class BaseModel(peewee.Model): + class Meta: + database = db + + class Model1(BaseModel): + test1 = peewee.CharField(max_length=20) + test2 = peewee.CharField(max_length=20) + + def __str__(self): + return self.test1 + + class Model2(BaseModel): + model1 = peewee.ForeignKeyField(Model1) + + Model1.create_table() + Model2.create_table() + + view = CustomModelView( + Model2, + url='view', + form_ajax_refs={ + 'model1': { + 'fields': ('test1', 'test2') + } + } + ) + admin.add_view(view) + + ok_(u'model1' in view._form_ajax_refs) + + model = Model1(test1=u'first', test2=u'') + model.save() + model2 = Model1(test1=u'foo', test2=u'bar') + model2.save() + + # Check loader + loader = view._form_ajax_refs[u'model1'] + mdl = loader.get_one(model.id) + eq_(mdl.test1, model.test1) + + items = loader.get_list(u'fir') + eq_(len(items), 1) + eq_(items[0].id, model.id) + + items = loader.get_list(u'bar') + eq_(len(items), 1) + eq_(items[0].test1, u'foo') + + # Check form generation + form = view.create_form() + eq_(form.model1.__class__.__name__, u'AjaxSelectField') + + with app.test_request_context('/admin/view/'): + ok_(u'value=""' not in form.model1()) + + form.model1.data = model + needle = u'data-json="[%s, "first"]"' % as_unicode(model.id) + ok_(needle in form.model1()) + ok_(u'value="%s"' % as_unicode(model.id) in form.model1()) + + # Check querying + client = app.test_client() + + req = client.get(u'/admin/view/ajax/lookup/?name=model1&query=foo') + eq_(req.data, u'[[%s, "foo"]]' % model2.id) + + # Check submitting + client.post('/admin/view/new/', data={u'model1': as_unicode(model.id)}) + mdl = Model2.select().first() + + ok_(mdl is not None) + ok_(mdl.model1 is not None) + eq_(mdl.model1.id, model.id) + eq_(mdl.model1.test1, u'first') + + +def test_export_csv(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + view = CustomModelView(Model1, can_export=True, + column_list=['test1', 'test2'], export_max_rows=2, + endpoint='row_limit_2') + admin.add_view(view) + + for x in range(5): + fill_db(Model1, Model2) + + client = app.test_client() + + # test export_max_rows + rv = client.get('/admin/row_limit_2/export/csv/') + data = rv.data.decode('utf-8') + eq_(rv.status_code, 200) + ok_("Test1,Test2\r\n" + "test1_val_1,test2_val_1\r\n" + "test1_val_2,test2_val_2\r\n" == data) + + view = CustomModelView(Model1, can_export=True, + column_list=['test1', 'test2'], + endpoint='no_row_limit') + admin.add_view(view) + + # test row limit without export_max_rows + rv = client.get('/admin/no_row_limit/export/csv/') + data = rv.data.decode('utf-8') + eq_(rv.status_code, 200) + ok_(len(data.splitlines()) > 21) diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/pymongo/__init__.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/pymongo/__init__.py new file mode 100644 index 00000000..5d1d21df --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/pymongo/__init__.py @@ -0,0 +1,17 @@ +import pymongo + +from flask import Flask +from flask_admin import Admin + + +def setup(): + app = Flask(__name__) + app.config['SECRET_KEY'] = '1' + app.config['CSRF_ENABLED'] = False + + conn = pymongo.Connection() + db = conn.tests + + admin = Admin(app) + + return app, db, admin diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/pymongo/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/pymongo/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..1dfa41c6 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/pymongo/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/pymongo/__pycache__/test_basic.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/pymongo/__pycache__/test_basic.cpython-38.pyc new file mode 100644 index 00000000..d0707a26 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/pymongo/__pycache__/test_basic.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/pymongo/test_basic.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/pymongo/test_basic.py new file mode 100644 index 00000000..c191895b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/pymongo/test_basic.py @@ -0,0 +1,81 @@ +from nose.tools import eq_, ok_ + +from wtforms import form, fields + +from flask_admin.contrib.pymongo import ModelView + +from . import setup + + +class TestForm(form.Form): + test1 = fields.StringField('Test1') + test2 = fields.StringField('Test2') + + +class TestView(ModelView): + column_list = ('test1', 'test2', 'test3', 'test4') + column_sortable_list = ('test1', 'test2') + + form = TestForm + + +def test_model(): + app, db, admin = setup() + + view = TestView(db.test, 'Test') + admin.add_view(view) + + # Drop existing data (if any) + db.test.remove() + + eq_(view.name, 'Test') + eq_(view.endpoint, 'testview') + + ok_('test1' in view._sortable_columns) + ok_('test2' in view._sortable_columns) + + ok_(view._create_form_class is not None) + ok_(view._edit_form_class is not None) + eq_(view._search_supported, False) + eq_(view._filters, None) + + # Make some test clients + client = app.test_client() + + rv = client.get('/admin/testview/') + eq_(rv.status_code, 200) + + rv = client.get('/admin/testview/new/') + eq_(rv.status_code, 200) + + rv = client.post('/admin/testview/new/', + data=dict(test1='test1large', test2='test2')) + eq_(rv.status_code, 302) + + model = db.test.find()[0] + print(model) + eq_(model['test1'], 'test1large') + eq_(model['test2'], 'test2') + + rv = client.get('/admin/testview/') + eq_(rv.status_code, 200) + ok_('test1large' in rv.data.decode('utf-8')) + + url = '/admin/testview/edit/?id=%s' % model['_id'] + rv = client.get(url) + eq_(rv.status_code, 200) + + rv = client.post(url, + data=dict(test1='test1small', test2='test2large')) + eq_(rv.status_code, 302) + + print(db.test.find()[0]) + + model = db.test.find()[0] + eq_(model['test1'], 'test1small') + eq_(model['test2'], 'test2large') + + url = '/admin/testview/delete/?id=%s' % model['_id'] + rv = client.post(url) + eq_(rv.status_code, 302) + eq_(db.test.count(), 0) diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__init__.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__init__.py new file mode 100644 index 00000000..d206c812 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__init__.py @@ -0,0 +1,31 @@ +from flask import Flask +from flask_admin import Admin +from flask_sqlalchemy import SQLAlchemy + + +def setup(): + app = Flask(__name__) + app.config['SECRET_KEY'] = '1' + app.config['CSRF_ENABLED'] = False + app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + app.config['SQLALCHEMY_ECHO'] = True + app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False + + db = SQLAlchemy(app) + admin = Admin(app) + + return app, db, admin + + +def setup_postgres(): + app = Flask(__name__) + app.config['SECRET_KEY'] = '1' + app.config['CSRF_ENABLED'] = False + app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://localhost/flask_admin_test' + app.config['SQLALCHEMY_ECHO'] = True + app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False + + db = SQLAlchemy(app) + admin = Admin(app) + + return app, db, admin diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..20d5acba Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/test_basic.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/test_basic.cpython-38.pyc new file mode 100644 index 00000000..c11d69d9 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/test_basic.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/test_form_rules.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/test_form_rules.cpython-38.pyc new file mode 100644 index 00000000..b9271803 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/test_form_rules.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/test_inlineform.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/test_inlineform.cpython-38.pyc new file mode 100644 index 00000000..9fe86a61 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/test_inlineform.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/test_multi_pk.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/test_multi_pk.cpython-38.pyc new file mode 100644 index 00000000..c1142f46 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/test_multi_pk.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/test_postgres.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/test_postgres.cpython-38.pyc new file mode 100644 index 00000000..539e2461 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/test_postgres.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/test_translation.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/test_translation.cpython-38.pyc new file mode 100644 index 00000000..d30aad8c Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/__pycache__/test_translation.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/templates/another_macro.html b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/templates/another_macro.html new file mode 100644 index 00000000..54182bca --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/templates/another_macro.html @@ -0,0 +1,3 @@ +{% macro another_test() %} + Hello another_test +{% endmacro %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/templates/macro.html b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/templates/macro.html new file mode 100644 index 00000000..fda38493 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/templates/macro.html @@ -0,0 +1,12 @@ +{% extends 'admin/model/create.html' %} +{% import 'another_macro.html' as test_lib %} + +{% macro test(arg) %} + Value = {{ arg }} +{% endmacro %} + +{% macro wrap() %} + + {{ caller() }} + +{% endmacro %} diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/test_basic.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/test_basic.py new file mode 100644 index 00000000..c80e01ea --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/test_basic.py @@ -0,0 +1,2603 @@ +from nose.tools import eq_, ok_, raises, assert_true + +from wtforms import fields, validators + +from flask_admin import form +from flask_admin.form.fields import Select2Field, DateTimeField +from flask_admin._compat import as_unicode +from flask_admin._compat import iteritems +from flask_admin.contrib.sqla import ModelView, filters, tools +from flask_babelex import Babel + +from sqlalchemy.ext.hybrid import hybrid_property +from sqlalchemy import cast +from sqlalchemy_utils import EmailType, ChoiceType, UUIDType, URLType, CurrencyType, ColorType, ArrowType, IPAddressType +from . import setup + +from datetime import datetime, time, date +import uuid +import enum +import arrow + + +class CustomModelView(ModelView): + def __init__(self, model, session, + name=None, category=None, endpoint=None, url=None, + **kwargs): + for k, v in iteritems(kwargs): + setattr(self, k, v) + + super(CustomModelView, self).__init__(model, session, name, category, + endpoint, url) + form_choices = { + 'choice_field': [ + ('choice-1', 'One'), + ('choice-2', 'Two') + ] + } + + +def create_models(db): + class Model1(db.Model): + def __init__(self, test1=None, test2=None, test3=None, test4=None, + bool_field=False, date_field=None, time_field=None, + datetime_field=None, email_field=None, + choice_field=None, enum_field=None): + self.test1 = test1 + self.test2 = test2 + self.test3 = test3 + self.test4 = test4 + self.bool_field = bool_field + self.date_field = date_field + self.time_field = time_field + self.datetime_field = datetime_field + self.email_field = email_field + self.choice_field = choice_field + self.enum_field = enum_field + + class EnumChoices(enum.Enum): + first = 1 + second = 2 + + id = db.Column(db.Integer, primary_key=True) + test1 = db.Column(db.String(20)) + test2 = db.Column(db.Unicode(20)) + test3 = db.Column(db.Text) + test4 = db.Column(db.UnicodeText) + bool_field = db.Column(db.Boolean) + date_field = db.Column(db.Date) + time_field = db.Column(db.Time) + datetime_field = db.Column(db.DateTime) + email_field = db.Column(EmailType) + enum_field = db.Column(db.Enum('model1_v1', 'model1_v2'), nullable=True) + choice_field = db.Column(db.String, nullable=True) + sqla_utils_choice = db.Column(ChoiceType([ + ('choice-1', u'First choice'), + ('choice-2', u'Second choice') + ])) + sqla_utils_enum = db.Column(ChoiceType(EnumChoices, impl=db.Integer())) + sqla_utils_arrow = db.Column(ArrowType, default=arrow.utcnow()) + sqla_utils_uuid = db.Column(UUIDType(binary=False), default=uuid.uuid4) + sqla_utils_url = db.Column(URLType) + sqla_utils_ip_address = db.Column(IPAddressType) + sqla_utils_currency = db.Column(CurrencyType) + sqla_utils_color = db.Column(ColorType) + + def __unicode__(self): + return self.test1 + + def __str__(self): + return self.test1 + + class Model2(db.Model): + def __init__(self, string_field=None, int_field=None, bool_field=None, + model1=None, float_field=None, string_field_default=None, + string_field_empty_default=None): + self.string_field = string_field + self.int_field = int_field + self.bool_field = bool_field + self.model1 = model1 + self.float_field = float_field + self.string_field_default = string_field_default + self.string_field_empty_default = string_field_empty_default + + id = db.Column(db.Integer, primary_key=True) + string_field = db.Column(db.String) + string_field_default = db.Column(db.Text, nullable=False, + default='') + string_field_empty_default = db.Column(db.Text, nullable=False, + default='') + int_field = db.Column(db.Integer) + bool_field = db.Column(db.Boolean) + enum_field = db.Column(db.Enum('model2_v1', 'model2_v2'), nullable=True) + float_field = db.Column(db.Float) + + # Relation + model1_id = db.Column(db.Integer, db.ForeignKey(Model1.id)) + model1 = db.relationship(lambda: Model1, backref='model2') + + db.create_all() + + return Model1, Model2 + + +def fill_db(db, Model1, Model2): + model1_obj1 = Model1('test1_val_1', 'test2_val_1', bool_field=True) + model1_obj2 = Model1('test1_val_2', 'test2_val_2', bool_field=False) + model1_obj3 = Model1('test1_val_3', 'test2_val_3') + model1_obj4 = Model1('test1_val_4', 'test2_val_4', email_field="test@test.com", choice_field="choice-1") + + model2_obj1 = Model2('test2_val_1', model1=model1_obj1, float_field=None) + model2_obj2 = Model2('test2_val_2', model1=model1_obj2, float_field=None) + model2_obj3 = Model2('test2_val_3', int_field=5000, float_field=25.9) + model2_obj4 = Model2('test2_val_4', int_field=9000, float_field=75.5) + model2_obj5 = Model2('test2_val_5', int_field=6169453081680413441) + + date_obj1 = Model1('date_obj1', date_field=date(2014, 11, 17)) + date_obj2 = Model1('date_obj2', date_field=date(2013, 10, 16)) + timeonly_obj1 = Model1('timeonly_obj1', time_field=time(11, 10, 9)) + timeonly_obj2 = Model1('timeonly_obj2', time_field=time(10, 9, 8)) + datetime_obj1 = Model1('datetime_obj1', datetime_field=datetime(2014, 4, 3, 1, 9, 0)) + datetime_obj2 = Model1('datetime_obj2', datetime_field=datetime(2013, 3, 2, 0, 8, 0)) + + enum_obj1 = Model1('enum_obj1', enum_field="model1_v1") + enum_obj2 = Model1('enum_obj2', enum_field="model1_v2") + + empty_obj = Model1(test2="empty_obj") + + db.session.add_all([ + model1_obj1, model1_obj2, model1_obj3, model1_obj4, + model2_obj1, model2_obj2, model2_obj3, model2_obj4, model2_obj5, + date_obj1, timeonly_obj1, datetime_obj1, + date_obj2, timeonly_obj2, datetime_obj2, + enum_obj1, enum_obj2, empty_obj + ]) + db.session.commit() + + +def test_model(): + app, db, admin = setup() + Model1, Model2 = create_models(db) + + view = CustomModelView(Model1, db.session) + + admin.add_view(view) + + eq_(view.model, Model1) + eq_(view.name, 'Model1') + eq_(view.endpoint, 'model1') + + eq_(view._primary_key, 'id') + + ok_('test1' in view._sortable_columns) + ok_('test2' in view._sortable_columns) + ok_('test3' in view._sortable_columns) + ok_('test4' in view._sortable_columns) + + ok_(view._create_form_class is not None) + ok_(view._edit_form_class is not None) + eq_(view._search_supported, False) + eq_(view._filters, None) + + # Verify form + eq_(view._create_form_class.test1.field_class, fields.StringField) + eq_(view._create_form_class.test2.field_class, fields.StringField) + eq_(view._create_form_class.test3.field_class, fields.TextAreaField) + eq_(view._create_form_class.test4.field_class, fields.TextAreaField) + eq_(view._create_form_class.email_field.field_class, fields.StringField) + eq_(view._create_form_class.choice_field.field_class, Select2Field) + eq_(view._create_form_class.enum_field.field_class, Select2Field) + eq_(view._create_form_class.sqla_utils_choice.field_class, Select2Field) + eq_(view._create_form_class.sqla_utils_enum.field_class, Select2Field) + eq_(view._create_form_class.sqla_utils_arrow.field_class, DateTimeField) + eq_(view._create_form_class.sqla_utils_uuid.field_class, fields.StringField) + eq_(view._create_form_class.sqla_utils_url.field_class, fields.StringField) + eq_(view._create_form_class.sqla_utils_ip_address.field_class, fields.StringField) + eq_(view._create_form_class.sqla_utils_currency.field_class, fields.StringField) + eq_(view._create_form_class.sqla_utils_color.field_class, fields.StringField) + + # Make some test clients + client = app.test_client() + + # check that we can retrieve a list view + rv = client.get('/admin/model1/') + eq_(rv.status_code, 200) + + # check that we can retrieve a 'create' view + rv = client.get('/admin/model1/new/') + eq_(rv.status_code, 200) + + # create a new record + uuid_obj = uuid.uuid4() + rv = client.post( + '/admin/model1/new/', + data=dict( + test1='test1large', + test2='test2', + time_field=time(0, 0, 0), + email_field="Test@TEST.com", + choice_field="choice-1", + enum_field='model1_v1', + sqla_utils_choice="choice-1", + sqla_utils_enum=1, + sqla_utils_arrow='2018-10-27 14:17:00', + sqla_utils_uuid=str(uuid_obj), + sqla_utils_url="http://www.example.com", + sqla_utils_ip_address='127.0.0.1', + sqla_utils_currency='USD', + sqla_utils_color='#f0f0f0', + ) + ) + eq_(rv.status_code, 302) + + # check that the new record was persisted + model = db.session.query(Model1).first() + eq_(model.test1, u'test1large') + eq_(model.test2, u'test2') + eq_(model.test3, u'') + eq_(model.test4, u'') + eq_(model.email_field, u'test@test.com') + eq_(model.choice_field, u'choice-1') + eq_(model.enum_field, u'model1_v1') + eq_(model.sqla_utils_choice, u'choice-1') + eq_(model.sqla_utils_enum.value, 1) + eq_(model.sqla_utils_arrow, arrow.get('2018-10-27 14:17:00')) + eq_(model.sqla_utils_uuid, uuid_obj) + eq_(model.sqla_utils_url, "http://www.example.com") + eq_(str(model.sqla_utils_ip_address), '127.0.0.1') + eq_(str(model.sqla_utils_currency), 'USD') + eq_(model.sqla_utils_color.hex, '#f0f0f0') + + # check that the new record shows up on the list view + rv = client.get('/admin/model1/') + eq_(rv.status_code, 200) + ok_(u'test1large' in rv.data.decode('utf-8')) + + # check that we can retrieve an edit view + url = '/admin/model1/edit/?id=%s' % model.id + rv = client.get(url) + eq_(rv.status_code, 200) + + # verify that midnight does not show as blank + ok_(u'00:00:00' in rv.data.decode('utf-8')) + + # edit the record + new_uuid_obj = uuid.uuid4() + rv = client.post(url, + data=dict(test1='test1small', + test2='test2large', + email_field='Test2@TEST.com', + choice_field='__None', + enum_field='__None', + sqla_utils_choice='__None', + sqla_utils_enum='__None', + sqla_utils_arrow='', + sqla_utils_uuid=str(new_uuid_obj), + sqla_utils_url='', + sqla_utils_ip_address='', + sqla_utils_currency='', + sqla_utils_color='', + )) + eq_(rv.status_code, 302) + + # check that the changes were persisted + model = db.session.query(Model1).first() + eq_(model.test1, 'test1small') + eq_(model.test2, 'test2large') + eq_(model.test3, '') + eq_(model.test4, '') + eq_(model.email_field, u'test2@test.com') + eq_(model.choice_field, None) + eq_(model.enum_field, None) + eq_(model.sqla_utils_choice, None) + eq_(model.sqla_utils_enum, None) + eq_(model.sqla_utils_arrow, None) + eq_(model.sqla_utils_uuid, new_uuid_obj) + eq_(model.sqla_utils_url, None) + eq_(model.sqla_utils_ip_address, None) + eq_(model.sqla_utils_currency, None) + eq_(model.sqla_utils_color, None) + + # check that the model can be deleted + url = '/admin/model1/delete/?id=%s' % model.id + rv = client.post(url) + eq_(rv.status_code, 302) + eq_(db.session.query(Model1).count(), 0) + + +@raises(Exception) +def test_no_pk(): + app, db, admin = setup() + + class Model(db.Model): + test = db.Column(db.Integer) + + view = CustomModelView(Model) + admin.add_view(view) + + +def test_list_columns(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + # test column_list with a list of strings + view = CustomModelView(Model1, db.session, + column_list=['test1', 'test3'], + column_labels=dict(test1='Column1')) + admin.add_view(view) + + eq_(len(view._list_columns), 2) + eq_(view._list_columns, [('test1', 'Column1'), ('test3', 'Test3')]) + + client = app.test_client() + + rv = client.get('/admin/model1/') + data = rv.data.decode('utf-8') + ok_('Column1' in data) + ok_('Test2' not in data) + + # test column_list with a list of SQLAlchemy columns + view2 = CustomModelView(Model1, db.session, endpoint='model1_2', + column_list=[Model1.test1, Model1.test3], + column_labels=dict(test1='Column1')) + admin.add_view(view2) + + eq_(len(view2._list_columns), 2) + eq_(view2._list_columns, [('test1', 'Column1'), ('test3', 'Test3')]) + + rv = client.get('/admin/model1_2/') + data = rv.data.decode('utf-8') + ok_('Column1' in data) + ok_('Test2' not in data) + + +def test_complex_list_columns(): + app, db, admin = setup() + M1, M2 = create_models(db) + + m1 = M1('model1_val1') + db.session.add(m1) + db.session.add(M2('model2_val1', model1=m1)) + + db.session.commit() + + # test column_list with a list of strings on a relation + view = CustomModelView(M2, db.session, + column_list=['model1.test1']) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model2/') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('model1_val1' in data) + + +def test_exclude_columns(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + view = CustomModelView( + Model1, db.session, + column_exclude_list=['test2', 'test4', 'enum_field', 'date_field', 'time_field', 'datetime_field', + 'sqla_utils_choice', 'sqla_utils_enum', 'sqla_utils_arrow', 'sqla_utils_uuid', + 'sqla_utils_url', 'sqla_utils_ip_address', 'sqla_utils_currency', 'sqla_utils_color'] + ) + admin.add_view(view) + + eq_( + view._list_columns, + [('test1', 'Test1'), ('test3', 'Test3'), ('bool_field', 'Bool Field'), + ('email_field', 'Email Field'), ('choice_field', 'Choice Field')] + ) + + client = app.test_client() + + rv = client.get('/admin/model1/') + data = rv.data.decode('utf-8') + ok_('Test1' in data) + ok_('Test2' not in data) + + +def test_column_searchable_list(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + view = CustomModelView(Model2, db.session, + column_searchable_list=['string_field', 'int_field']) + admin.add_view(view) + + eq_(view._search_supported, True) + eq_(len(view._search_fields), 2) + + ok_(isinstance(view._search_fields[0][0], db.Column)) + ok_(isinstance(view._search_fields[1][0], db.Column)) + eq_(view._search_fields[0][0].name, 'string_field') + eq_(view._search_fields[1][0].name, 'int_field') + + db.session.add(Model2('model1-test', 5000)) + db.session.add(Model2('model2-test', 9000)) + db.session.commit() + + client = app.test_client() + + rv = client.get('/admin/model2/?search=model1') + data = rv.data.decode('utf-8') + ok_('model1-test' in data) + ok_('model2-test' not in data) + + rv = client.get('/admin/model2/?search=9000') + data = rv.data.decode('utf-8') + ok_('model1-test' not in data) + ok_('model2-test' in data) + + +def test_extra_args_search(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + view1 = CustomModelView(Model1, db.session, + column_searchable_list=['test1', ]) + + admin.add_view(view1) + + db.session.add(Model2('model1-test', )) + db.session.commit() + + client = app.test_client() + + # check that extra args in the url are propagated as hidden fields in the search form + rv = client.get('/admin/model1/?search=model1&foo=bar') + data = rv.data.decode('utf-8') + ok_('' in data) + + +def test_extra_args_filter(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + view2 = CustomModelView(Model2, db.session, + column_filters=['int_field', ]) + admin.add_view(view2) + + db.session.add(Model2('model2-test', 5000)) + db.session.commit() + + client = app.test_client() + + # check that extra args in the url are propagated as hidden fields in the form + rv = client.get('/admin/model2/?flt1_0=5000&foo=bar') + data = rv.data.decode('utf-8') + ok_('' in data) + + +def test_complex_searchable_list(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + view = CustomModelView(Model2, db.session, + column_searchable_list=['model1.test1']) + admin.add_view(view) + + m1 = Model1('model1-test1-val') + m2 = Model1('model1-test2-val') + db.session.add(m1) + db.session.add(m2) + db.session.add(Model2('model2-test1-val', model1=m1)) + db.session.add(Model2('model2-test2-val', model1=m2)) + db.session.commit() + + client = app.test_client() + + # test relation string - 'model1.test1' + rv = client.get('/admin/model2/?search=model1-test1') + data = rv.data.decode('utf-8') + ok_('model2-test1-val' in data) + ok_('model2-test2-val' not in data) + + view2 = CustomModelView(Model1, db.session, + column_searchable_list=[Model2.string_field]) + admin.add_view(view2) + + # test relation object - Model2.string_field + rv = client.get('/admin/model1/?search=model2-test1') + data = rv.data.decode('utf-8') + ok_('model1-test1-val' in data) + ok_('model1-test2-val' not in data) + + +def test_complex_searchable_list_missing_children(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + view = CustomModelView(Model1, db.session, + column_searchable_list=[ + 'test1', 'model2.string_field']) + admin.add_view(view) + + db.session.add(Model1('magic string')) + db.session.commit() + + client = app.test_client() + + rv = client.get('/admin/model1/?search=magic') + data = rv.data.decode('utf-8') + ok_('magic string' in data) + + +def test_column_editable_list(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + view = CustomModelView(Model1, db.session, + column_editable_list=['test1', 'enum_field']) + admin.add_view(view) + + fill_db(db, Model1, Model2) + + client = app.test_client() + + # Test in-line edit field rendering + rv = client.get('/admin/model1/') + data = rv.data.decode('utf-8') + ok_('data-role="x-editable"' in data) + + # Form - Test basic in-line edit functionality + rv = client.post('/admin/model1/ajax/update/', data={ + 'list_form_pk': '1', + 'test1': 'change-success-1', + }) + data = rv.data.decode('utf-8') + ok_('Record was successfully saved.' == data) + + # ensure the value has changed + rv = client.get('/admin/model1/') + data = rv.data.decode('utf-8') + ok_('change-success-1' in data) + + # Test validation error + rv = client.post('/admin/model1/ajax/update/', data={ + 'list_form_pk': '1', + 'enum_field': 'problematic-input', + }) + eq_(rv.status_code, 500) + + # Test invalid primary key + rv = client.post('/admin/model1/ajax/update/', data={ + 'list_form_pk': '1000', + 'test1': 'problematic-input', + }) + data = rv.data.decode('utf-8') + eq_(rv.status_code, 500) + + # Test editing column not in column_editable_list + rv = client.post('/admin/model1/ajax/update/', data={ + 'list_form_pk': '1', + 'test2': 'problematic-input', + }) + data = rv.data.decode('utf-8') + ok_('problematic-input' not in data) + + # Test in-line editing for relations + view = CustomModelView(Model2, db.session, column_editable_list=['model1']) + admin.add_view(view) + + rv = client.post('/admin/model2/ajax/update/', data={ + 'list_form_pk': '1', + 'model1': '3', + }) + data = rv.data.decode('utf-8') + ok_('Record was successfully saved.' == data) + + # confirm the value has changed + rv = client.get('/admin/model2/') + data = rv.data.decode('utf-8') + ok_('test1_val_3' in data) + + +def test_details_view(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + view_no_details = CustomModelView(Model1, db.session) + admin.add_view(view_no_details) + + # fields are scaffolded + view_w_details = CustomModelView(Model2, db.session, can_view_details=True) + admin.add_view(view_w_details) + + # show only specific fields in details w/ column_details_list + string_field_view = CustomModelView(Model2, db.session, + can_view_details=True, + column_details_list=["string_field"], + endpoint="sf_view") + admin.add_view(string_field_view) + + fill_db(db, Model1, Model2) + + client = app.test_client() + + # ensure link to details is hidden when can_view_details is disabled + rv = client.get('/admin/model1/') + data = rv.data.decode('utf-8') + ok_('/admin/model1/details/' not in data) + + # ensure link to details view appears + rv = client.get('/admin/model2/') + data = rv.data.decode('utf-8') + ok_('/admin/model2/details/' in data) + + # test redirection when details are disabled + rv = client.get('/admin/model1/details/?url=%2Fadmin%2Fmodel1%2F&id=1') + eq_(rv.status_code, 302) + + # test if correct data appears in details view when enabled + rv = client.get('/admin/model2/details/?url=%2Fadmin%2Fmodel2%2F&id=1') + data = rv.data.decode('utf-8') + ok_('String Field' in data) + ok_('test2_val_1' in data) + ok_('test1_val_1' in data) + + # test column_details_list + rv = client.get('/admin/sf_view/details/?url=%2Fadmin%2Fsf_view%2F&id=1') + data = rv.data.decode('utf-8') + ok_('String Field' in data) + ok_('test2_val_1' in data) + ok_('test1_val_1' not in data) + + +def test_editable_list_special_pks(): + ''' Tests editable list view + a primary key with special characters + ''' + app, db, admin = setup() + + class Model1(db.Model): + def __init__(self, id=None, val1=None): + self.id = id + self.val1 = val1 + + id = db.Column(db.String(20), primary_key=True) + val1 = db.Column(db.String(20)) + + db.create_all() + + view = CustomModelView(Model1, db.session, column_editable_list=['val1']) + admin.add_view(view) + + db.session.add(Model1('1-1', 'test1')) + db.session.add(Model1('1-5', 'test2')) + db.session.commit() + + client = app.test_client() + + # Form - Test basic in-line edit functionality + rv = client.post('/admin/model1/ajax/update/', data={ + 'list_form_pk': '1-1', + 'val1': 'change-success-1', + }) + data = rv.data.decode('utf-8') + ok_('Record was successfully saved.' == data) + + # ensure the value has changed + rv = client.get('/admin/model1/') + data = rv.data.decode('utf-8') + ok_('change-success-1' in data) + + +def test_column_filters(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + view = CustomModelView( + Model1, db.session, + column_filters=['test1'] + ) + admin.add_view(view) + + client = app.test_client() + + eq_(len(view._filters), 7) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Test1']], + [ + (0, u'contains'), + (1, u'not contains'), + (2, u'equals'), + (3, u'not equal'), + (4, u'empty'), + (5, u'in list'), + (6, u'not in list'), + ] + ) + + # Test filter that references property + view = CustomModelView(Model2, db.session, + column_filters=['model1']) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Model1 / Test1']], + [ + (0, u'contains'), + (1, u'not contains'), + (2, u'equals'), + (3, u'not equal'), + (4, u'empty'), + (5, u'in list'), + (6, u'not in list'), + ] + ) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Model1 / Test2']], + [ + (7, u'contains'), + (8, u'not contains'), + (9, u'equals'), + (10, u'not equal'), + (11, u'empty'), + (12, u'in list'), + (13, u'not in list'), + ] + ) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Model1 / Test3']], + [ + (14, u'contains'), + (15, u'not contains'), + (16, u'equals'), + (17, u'not equal'), + (18, u'empty'), + (19, u'in list'), + (20, u'not in list'), + ] + ) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Model1 / Test4']], + [ + (21, u'contains'), + (22, u'not contains'), + (23, u'equals'), + (24, u'not equal'), + (25, u'empty'), + (26, u'in list'), + (27, u'not in list'), + ] + ) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Model1 / Bool Field']], + [ + (28, u'equals'), + (29, u'not equal'), + ] + ) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Model1 / Date Field']], + [ + (30, u'equals'), + (31, u'not equal'), + (32, u'greater than'), + (33, u'smaller than'), + (34, u'between'), + (35, u'not between'), + (36, u'empty'), + ] + ) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Model1 / Time Field']], + [ + (37, u'equals'), + (38, u'not equal'), + (39, u'greater than'), + (40, u'smaller than'), + (41, u'between'), + (42, u'not between'), + (43, u'empty'), + ] + ) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Model1 / Datetime Field']], + [ + (44, u'equals'), + (45, u'not equal'), + (46, u'greater than'), + (47, u'smaller than'), + (48, u'between'), + (49, u'not between'), + (50, u'empty'), + ] + ) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Model1 / Email Field']], + [ + (51, u'contains'), + (52, u'not contains'), + (53, u'equals'), + (54, u'not equal'), + (55, u'empty'), + (56, u'in list'), + (57, u'not in list'), + ] + ) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Model1 / Enum Field']], + [ + (58, u'equals'), + (59, u'not equal'), + (60, u'empty'), + (61, u'in list'), + (62, u'not in list'), + ] + ) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Model1 / Choice Field']], + [ + (63, u'contains'), + (64, u'not contains'), + (65, u'equals'), + (66, u'not equal'), + (67, u'empty'), + (68, u'in list'), + (69, u'not in list'), + ] + ) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Model1 / Sqla Utils Choice']], + [ + (70, u'equals'), + (71, u'not equal'), + (72, u'contains'), + (73, u'not contains'), + (74, u'empty'), + ] + ) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Model1 / Sqla Utils Enum']], + [ + (75, u'equals'), + (76, u'not equal'), + (77, u'contains'), + (78, u'not contains'), + (79, u'empty'), + ] + ) + + # Test filter with a dot + view = CustomModelView(Model2, db.session, + column_filters=['model1.bool_field']) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'model1 / Model1 / Bool Field']], + [ + (0, 'equals'), + (1, 'not equal'), + ] + ) + + # Test column_labels on filters + view = CustomModelView(Model2, db.session, + column_filters=['model1.bool_field', 'string_field'], + column_labels={ + 'model1.bool_field': 'Test Filter #1', + 'string_field': 'Test Filter #2', + }) + + eq_(list(view._filter_groups.keys()), [u'Test Filter #1', u'Test Filter #2']) + + fill_db(db, Model1, Model2) + + # Test equals + rv = client.get('/admin/model1/?flt0_0=test1_val_1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + # the filter value is always in "data" + # need to check a different column than test1 for the expected row + + ok_('test2_val_1' in data) + ok_('test1_val_2' not in data) + + # Test NOT IN filter + rv = client.get('/admin/model1/?flt0_6=test1_val_1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + + ok_('test1_val_2' in data) + ok_('test2_val_1' not in data) + + # Test string filter + view = CustomModelView(Model1, db.session, + column_filters=['test1'], endpoint='_strings') + admin.add_view(view) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Test1']], + [ + (0, 'contains'), + (1, 'not contains'), + (2, 'equals'), + (3, 'not equal'), + (4, 'empty'), + (5, 'in list'), + (6, 'not in list'), + ] + ) + + # string - equals + rv = client.get('/admin/_strings/?flt0_0=test1_val_1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' in data) + ok_('test1_val_2' not in data) + + # string - not equal + rv = client.get('/admin/_strings/?flt0_1=test1_val_1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' not in data) + ok_('test1_val_2' in data) + + # string - contains + rv = client.get('/admin/_strings/?flt0_2=test1_val_1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' in data) + ok_('test1_val_2' not in data) + + # string - not contains + rv = client.get('/admin/_strings/?flt0_3=test1_val_1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' not in data) + ok_('test1_val_2' in data) + + # string - empty + rv = client.get('/admin/_strings/?flt0_4=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('empty_obj' in data) + ok_('test1_val_1' not in data) + ok_('test1_val_2' not in data) + + # string - not empty + rv = client.get('/admin/_strings/?flt0_4=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('empty_obj' not in data) + ok_('test1_val_1' in data) + ok_('test1_val_2' in data) + + # string - in list + rv = client.get('/admin/_strings/?flt0_5=test1_val_1%2Ctest1_val_2') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' in data) + ok_('test2_val_2' in data) + ok_('test1_val_3' not in data) + ok_('test1_val_4' not in data) + + # string - not in list + rv = client.get('/admin/_strings/?flt0_6=test1_val_1%2Ctest1_val_2') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' not in data) + ok_('test2_val_2' not in data) + ok_('test1_val_3' in data) + ok_('test1_val_4' in data) + + # Test integer filter + view = CustomModelView(Model2, db.session, + column_filters=['int_field']) + admin.add_view(view) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Int Field']], + [ + (0, 'equals'), + (1, 'not equal'), + (2, 'greater than'), + (3, 'smaller than'), + (4, 'empty'), + (5, 'in list'), + (6, 'not in list'), + ] + ) + + # integer - equals + rv = client.get('/admin/model2/?flt0_0=5000') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_3' in data) + ok_('test2_val_4' not in data) + + # integer - equals (huge number) + rv = client.get('/admin/model2/?flt0_0=6169453081680413441') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_5' in data) + ok_('test2_val_4' not in data) + + # integer - equals - test validation + rv = client.get('/admin/model2/?flt0_0=badval') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('Invalid Filter Value' in data) + + # integer - not equal + rv = client.get('/admin/model2/?flt0_1=5000') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_3' not in data) + ok_('test2_val_4' in data) + + # integer - greater + rv = client.get('/admin/model2/?flt0_2=6000') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_3' not in data) + ok_('test2_val_4' in data) + + # integer - smaller + rv = client.get('/admin/model2/?flt0_3=6000') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_3' in data) + ok_('test2_val_4' not in data) + + # integer - empty + rv = client.get('/admin/model2/?flt0_4=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' in data) + ok_('test2_val_2' in data) + ok_('test2_val_3' not in data) + ok_('test2_val_4' not in data) + + # integer - not empty + rv = client.get('/admin/model2/?flt0_4=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' not in data) + ok_('test2_val_2' not in data) + ok_('test2_val_3' in data) + ok_('test2_val_4' in data) + + # integer - in list + rv = client.get('/admin/model2/?flt0_5=5000%2C9000') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' not in data) + ok_('test2_val_2' not in data) + ok_('test2_val_3' in data) + ok_('test2_val_4' in data) + + # integer - in list (huge number) + rv = client.get('/admin/model2/?flt0_5=6169453081680413441') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' not in data) + ok_('test2_val_5' in data) + + # integer - in list - test validation + rv = client.get('/admin/model2/?flt0_5=5000%2Cbadval') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('Invalid Filter Value' in data) + + # integer - not in list + rv = client.get('/admin/model2/?flt0_6=5000%2C9000') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' in data) + ok_('test2_val_2' in data) + ok_('test2_val_3' not in data) + ok_('test2_val_4' not in data) + + # Test boolean filter + view = CustomModelView(Model1, db.session, column_filters=['bool_field'], + endpoint="_bools") + admin.add_view(view) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Bool Field']], + [ + (0, 'equals'), + (1, 'not equal'), + ] + ) + + # boolean - equals - Yes + rv = client.get('/admin/_bools/?flt0_0=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' in data) + ok_('test2_val_2' not in data) + ok_('test2_val_3' not in data) + + # boolean - equals - No + rv = client.get('/admin/_bools/?flt0_0=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' not in data) + ok_('test2_val_2' in data) + ok_('test2_val_3' in data) + + # boolean - not equals - Yes + rv = client.get('/admin/_bools/?flt0_1=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' not in data) + ok_('test2_val_2' in data) + ok_('test2_val_3' in data) + + # boolean - not equals - No + rv = client.get('/admin/_bools/?flt0_1=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' in data) + ok_('test2_val_2' not in data) + ok_('test2_val_3' not in data) + + # Test float filter + view = CustomModelView(Model2, db.session, column_filters=['float_field'], + endpoint="_float") + admin.add_view(view) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Float Field']], + [ + (0, 'equals'), + (1, 'not equal'), + (2, 'greater than'), + (3, 'smaller than'), + (4, 'empty'), + (5, 'in list'), + (6, 'not in list'), + ] + ) + + # float - equals + rv = client.get('/admin/_float/?flt0_0=25.9') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_3' in data) + ok_('test2_val_4' not in data) + + # float - equals - test validation + rv = client.get('/admin/_float/?flt0_0=badval') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('Invalid Filter Value' in data) + + # float - not equal + rv = client.get('/admin/_float/?flt0_1=25.9') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_3' not in data) + ok_('test2_val_4' in data) + + # float - greater + rv = client.get('/admin/_float/?flt0_2=60.5') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_3' not in data) + ok_('test2_val_4' in data) + + # float - smaller + rv = client.get('/admin/_float/?flt0_3=60.5') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_3' in data) + ok_('test2_val_4' not in data) + + # float - empty + rv = client.get('/admin/_float/?flt0_4=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' in data) + ok_('test2_val_2' in data) + ok_('test2_val_3' not in data) + ok_('test2_val_4' not in data) + + # float - not empty + rv = client.get('/admin/_float/?flt0_4=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' not in data) + ok_('test2_val_2' not in data) + ok_('test2_val_3' in data) + ok_('test2_val_4' in data) + + # float - in list + rv = client.get('/admin/_float/?flt0_5=25.9%2C75.5') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' not in data) + ok_('test2_val_2' not in data) + ok_('test2_val_3' in data) + ok_('test2_val_4' in data) + + # float - in list - test validation + rv = client.get('/admin/_float/?flt0_5=25.9%2Cbadval') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('Invalid Filter Value' in data) + + # float - not in list + rv = client.get('/admin/_float/?flt0_6=25.9%2C75.5') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' in data) + ok_('test2_val_2' in data) + ok_('test2_val_3' not in data) + ok_('test2_val_4' not in data) + + # Test filters to joined table field + view = CustomModelView( + Model2, db.session, + endpoint='_model2', + column_filters=['model1.bool_field'], + column_list=[ + 'string_field', + 'model1.id', + 'model1.bool_field', + ] + ) + admin.add_view(view) + + rv = client.get('/admin/_model2/?flt1_0=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2_val_1' in data) + ok_('test2_val_2' not in data) + ok_('test2_val_3' not in data) + ok_('test2_val_4' not in data) + + # Test human readable URLs + view = CustomModelView( + Model1, db.session, + column_filters=['test1'], + endpoint='_model3', + named_filter_urls=True + ) + admin.add_view(view) + + rv = client.get('/admin/_model3/?flt1_test1_equals=test1_val_1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1_val_1' in data) + ok_('test1_val_2' not in data) + + # Test date, time, and datetime filters + view = CustomModelView(Model1, db.session, + column_filters=['date_field', 'datetime_field', 'time_field'], + endpoint="_datetime") + admin.add_view(view) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Date Field']], + [ + (0, 'equals'), + (1, 'not equal'), + (2, 'greater than'), + (3, 'smaller than'), + (4, 'between'), + (5, 'not between'), + (6, 'empty'), + ] + ) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Datetime Field']], + [ + (7, 'equals'), + (8, 'not equal'), + (9, 'greater than'), + (10, 'smaller than'), + (11, 'between'), + (12, 'not between'), + (13, 'empty'), + ] + ) + + eq_( + [(f['index'], f['operation']) for f in view._filter_groups[u'Time Field']], + [ + (14, 'equals'), + (15, 'not equal'), + (16, 'greater than'), + (17, 'smaller than'), + (18, 'between'), + (19, 'not between'), + (20, 'empty'), + ] + ) + + # date - equals + rv = client.get('/admin/_datetime/?flt0_0=2014-11-17') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('date_obj1' in data) + ok_('date_obj2' not in data) + + # date - not equal + rv = client.get('/admin/_datetime/?flt0_1=2014-11-17') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('date_obj1' not in data) + ok_('date_obj2' in data) + + # date - greater + rv = client.get('/admin/_datetime/?flt0_2=2014-11-16') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('date_obj1' in data) + ok_('date_obj2' not in data) + + # date - smaller + rv = client.get('/admin/_datetime/?flt0_3=2014-11-16') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('date_obj1' not in data) + ok_('date_obj2' in data) + + # date - between + rv = client.get('/admin/_datetime/?flt0_4=2014-11-13+to+2014-11-20') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('date_obj1' in data) + ok_('date_obj2' not in data) + + # date - not between + rv = client.get('/admin/_datetime/?flt0_5=2014-11-13+to+2014-11-20') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('date_obj1' not in data) + ok_('date_obj2' in data) + + # date - empty + rv = client.get('/admin/_datetime/?flt0_6=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1_val_1' in data) + ok_('date_obj1' not in data) + ok_('date_obj2' not in data) + + # date - empty + rv = client.get('/admin/_datetime/?flt0_6=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1_val_1' not in data) + ok_('date_obj1' in data) + ok_('date_obj2' in data) + + # datetime - equals + rv = client.get('/admin/_datetime/?flt0_7=2014-04-03+01%3A09%3A00') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('datetime_obj1' in data) + ok_('datetime_obj2' not in data) + + # datetime - not equal + rv = client.get('/admin/_datetime/?flt0_8=2014-04-03+01%3A09%3A00') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('datetime_obj1' not in data) + ok_('datetime_obj2' in data) + + # datetime - greater + rv = client.get('/admin/_datetime/?flt0_9=2014-04-03+01%3A08%3A00') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('datetime_obj1' in data) + ok_('datetime_obj2' not in data) + + # datetime - smaller + rv = client.get('/admin/_datetime/?flt0_10=2014-04-03+01%3A08%3A00') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('datetime_obj1' not in data) + ok_('datetime_obj2' in data) + + # datetime - between + rv = client.get('/admin/_datetime/?flt0_11=2014-04-02+00%3A00%3A00+to+2014-11-20+23%3A59%3A59') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('datetime_obj1' in data) + ok_('datetime_obj2' not in data) + + # datetime - not between + rv = client.get('/admin/_datetime/?flt0_12=2014-04-02+00%3A00%3A00+to+2014-11-20+23%3A59%3A59') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('datetime_obj1' not in data) + ok_('datetime_obj2' in data) + + # datetime - empty + rv = client.get('/admin/_datetime/?flt0_13=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1_val_1' in data) + ok_('datetime_obj1' not in data) + ok_('datetime_obj2' not in data) + + # datetime - not empty + rv = client.get('/admin/_datetime/?flt0_13=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1_val_1' not in data) + ok_('datetime_obj1' in data) + ok_('datetime_obj2' in data) + + # time - equals + rv = client.get('/admin/_datetime/?flt0_14=11%3A10%3A09') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('timeonly_obj1' in data) + ok_('timeonly_obj2' not in data) + + # time - not equal + rv = client.get('/admin/_datetime/?flt0_15=11%3A10%3A09') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('timeonly_obj1' not in data) + ok_('timeonly_obj2' in data) + + # time - greater + rv = client.get('/admin/_datetime/?flt0_16=11%3A09%3A09') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('timeonly_obj1' in data) + ok_('timeonly_obj2' not in data) + + # time - smaller + rv = client.get('/admin/_datetime/?flt0_17=11%3A09%3A09') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('timeonly_obj1' not in data) + ok_('timeonly_obj2' in data) + + # time - between + rv = client.get('/admin/_datetime/?flt0_18=10%3A40%3A00+to+11%3A50%3A59') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('timeonly_obj1' in data) + ok_('timeonly_obj2' not in data) + + # time - not between + rv = client.get('/admin/_datetime/?flt0_19=10%3A40%3A00+to+11%3A50%3A59') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('timeonly_obj1' not in data) + ok_('timeonly_obj2' in data) + + # time - empty + rv = client.get('/admin/_datetime/?flt0_20=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1_val_1' in data) + ok_('timeonly_obj1' not in data) + ok_('timeonly_obj2' not in data) + + # time - not empty + rv = client.get('/admin/_datetime/?flt0_20=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1_val_1' not in data) + ok_('timeonly_obj1' in data) + ok_('timeonly_obj2' in data) + + # Test enum filter + view = CustomModelView(Model1, db.session, + column_filters=['enum_field'], + endpoint="_enumfield") + admin.add_view(view) + + # enum - equals + rv = client.get('/admin/_enumfield/?flt0_0=model1_v1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('enum_obj1' in data) + ok_('enum_obj2' not in data) + + # enum - not equal + rv = client.get('/admin/_enumfield/?flt0_1=model1_v1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('enum_obj1' not in data) + ok_('enum_obj2' in data) + + # enum - empty + rv = client.get('/admin/_enumfield/?flt0_2=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1_val_1' in data) + ok_('enum_obj1' not in data) + ok_('enum_obj2' not in data) + + # enum - not empty + rv = client.get('/admin/_enumfield/?flt0_2=0') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1_val_1' not in data) + ok_('enum_obj1' in data) + ok_('enum_obj2' in data) + + # enum - in list + rv = client.get('/admin/_enumfield/?flt0_3=model1_v1%2Cmodel1_v2') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1_val_1' not in data) + ok_('enum_obj1' in data) + ok_('enum_obj2' in data) + + # enum - not in list + rv = client.get('/admin/_enumfield/?flt0_4=model1_v1%2Cmodel1_v2') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1_val_1' in data) + ok_('enum_obj1' not in data) + ok_('enum_obj2' not in data) + + # Test single custom filter on relation + view = CustomModelView(Model2, db.session, + column_filters=[ + filters.FilterEqual(Model1.test1, "Test1") + ], endpoint='_relation_test') + admin.add_view(view) + + rv = client.get('/admin/_relation_test/?flt1_0=test1_val_1') + data = rv.data.decode('utf-8') + + ok_('test1_val_1' in data) + ok_('test1_val_2' not in data) + + +def test_column_filters_sqla_obj(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + view = CustomModelView( + Model1, db.session, + column_filters=[Model1.test1] + ) + admin.add_view(view) + + eq_(len(view._filters), 7) + + +def test_hybrid_property(): + app, db, admin = setup() + + class Model1(db.Model): + id = db.Column(db.Integer, primary_key=True) + name = db.Column(db.String) + width = db.Column(db.Integer) + height = db.Column(db.Integer) + + @hybrid_property + def number_of_pixels(self): + return self.width * self.height + + @hybrid_property + def number_of_pixels_str(self): + return str(self.number_of_pixels()) + + @number_of_pixels_str.expression + def number_of_pixels_str(cls): + return cast(cls.width * cls.height, db.String) + + db.create_all() + + db.session.add(Model1(id=1, name="test_row_1", width=25, height=25)) + db.session.add(Model1(id=2, name="test_row_2", width=10, height=10)) + db.session.commit() + + client = app.test_client() + + view = CustomModelView( + Model1, db.session, + column_default_sort='number_of_pixels', + column_filters=[filters.IntGreaterFilter(Model1.number_of_pixels, + 'Number of Pixels')], + column_searchable_list=['number_of_pixels_str', ] + ) + admin.add_view(view) + + # filters - hybrid_property integer - greater + rv = client.get('/admin/model1/?flt0_0=600') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test_row_1' in data) + ok_('test_row_2' not in data) + + # sorting + rv = client.get('/admin/model1/?sort=0') + eq_(rv.status_code, 200) + + _, data = view.get_list(0, None, None, None, None) + + eq_(len(data), 2) + eq_(data[0].name, 'test_row_2') + eq_(data[1].name, 'test_row_1') + + # searching + rv = client.get('/admin/model1/?search=100') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test_row_2' in data) + ok_('test_row_1' not in data) + + +def test_url_args(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + view = CustomModelView(Model1, db.session, + page_size=2, + column_searchable_list=['test1'], + column_filters=['test1']) + admin.add_view(view) + + db.session.add(Model1('data1')) + db.session.add(Model1('data2')) + db.session.add(Model1('data3')) + db.session.add(Model1('data4')) + db.session.commit() + + client = app.test_client() + + rv = client.get('/admin/model1/') + data = rv.data.decode('utf-8') + ok_('data1' in data) + ok_('data3' not in data) + + # page + rv = client.get('/admin/model1/?page=1') + data = rv.data.decode('utf-8') + ok_('data1' not in data) + ok_('data3' in data) + + # sort + rv = client.get('/admin/model1/?sort=0&desc=1') + data = rv.data.decode('utf-8') + ok_('data1' not in data) + ok_('data3' in data) + ok_('data4' in data) + + # search + rv = client.get('/admin/model1/?search=data1') + data = rv.data.decode('utf-8') + ok_('data1' in data) + ok_('data2' not in data) + + rv = client.get('/admin/model1/?search=^data1') + data = rv.data.decode('utf-8') + ok_('data2' not in data) + + # like + rv = client.get('/admin/model1/?flt0=0&flt0v=data1') + data = rv.data.decode('utf-8') + ok_('data1' in data) + + # not like + rv = client.get('/admin/model1/?flt0=1&flt0v=data1') + data = rv.data.decode('utf-8') + ok_('data2' in data) + + +def test_non_int_pk(): + app, db, admin = setup() + + class Model(db.Model): + id = db.Column(db.String, primary_key=True) + test = db.Column(db.String) + + db.create_all() + + view = CustomModelView(Model, db.session, form_columns=['id', 'test']) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model/') + eq_(rv.status_code, 200) + + rv = client.post('/admin/model/new/', + data=dict(id='test1', test='test2')) + eq_(rv.status_code, 302) + + rv = client.get('/admin/model/') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1' in data) + + rv = client.get('/admin/model/edit/?id=test1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test2' in data) + + +def test_form_columns(): + app, db, admin = setup() + + class Model(db.Model): + id = db.Column(db.String, primary_key=True) + int_field = db.Column(db.Integer) + datetime_field = db.Column(db.DateTime) + text_field = db.Column(db.UnicodeText) + excluded_column = db.Column(db.String) + + class ChildModel(db.Model): + class EnumChoices(enum.Enum): + first = 1 + second = 2 + + id = db.Column(db.String, primary_key=True) + model_id = db.Column(db.Integer, db.ForeignKey(Model.id)) + model = db.relationship(Model, backref='backref') + enum_field = db.Column(db.Enum('model1_v1', 'model1_v2'), nullable=True) + choice_field = db.Column(db.String, nullable=True) + sqla_utils_choice = db.Column(ChoiceType([ + ('choice-1', u'First choice'), + ('choice-2', u'Second choice') + ])) + sqla_utils_enum = db.Column(ChoiceType(EnumChoices, impl=db.Integer())) + + db.create_all() + + view1 = CustomModelView(Model, db.session, endpoint='view1', + form_columns=('int_field', 'text_field')) + view2 = CustomModelView(Model, db.session, endpoint='view2', + form_excluded_columns=('excluded_column',)) + view3 = CustomModelView(ChildModel, db.session, endpoint='view3') + + form1 = view1.create_form() + form2 = view2.create_form() + form3 = view3.create_form() + + ok_('int_field' in form1._fields) + ok_('text_field' in form1._fields) + ok_('datetime_field' not in form1._fields) + ok_('excluded_column' not in form2._fields) + + # check that relation shows up as a query select + ok_(type(form3.model).__name__ == 'QuerySelectField') + + # check that select field is rendered if form_choices were specified + ok_(type(form3.choice_field).__name__ == 'Select2Field') + + # check that select field is rendered for enum fields + ok_(type(form3.enum_field).__name__ == 'Select2Field') + + # check that sqlalchemy_utils field types are handled appropriately + ok_(type(form3.sqla_utils_choice).__name__ == 'Select2Field') + ok_(type(form3.sqla_utils_enum).__name__ == 'Select2Field') + + # test form_columns with model objects + view4 = CustomModelView(Model, db.session, endpoint='view1', + form_columns=[Model.int_field]) + form4 = view4.create_form() + ok_('int_field' in form4._fields) + + +@raises(Exception) +def test_complex_form_columns(): + app, db, admin = setup() + M1, M2 = create_models(db) + + # test using a form column in another table + view = CustomModelView(M2, db.session, form_columns=['model1.test1']) + view.create_form() + + +def test_form_args(): + app, db, admin = setup() + + class Model(db.Model): + id = db.Column(db.String, primary_key=True) + test = db.Column(db.String, nullable=False) + + db.create_all() + + shared_form_args = {'test': {'validators': [validators.Regexp('test')]}} + + view = CustomModelView(Model, db.session, form_args=shared_form_args) + admin.add_view(view) + + create_form = view.create_form() + eq_(len(create_form.test.validators), 2) + + # ensure shared field_args don't create duplicate validators + edit_form = view.edit_form() + eq_(len(edit_form.test.validators), 2) + + +def test_form_override(): + app, db, admin = setup() + + class Model(db.Model): + id = db.Column(db.String, primary_key=True) + test = db.Column(db.String) + + db.create_all() + + view1 = CustomModelView(Model, db.session, endpoint='view1') + view2 = CustomModelView(Model, db.session, endpoint='view2', form_overrides=dict(test=fields.FileField)) + admin.add_view(view1) + admin.add_view(view2) + + eq_(view1._create_form_class.test.field_class, fields.StringField) + eq_(view2._create_form_class.test.field_class, fields.FileField) + + +def test_form_onetoone(): + app, db, admin = setup() + + class Model1(db.Model): + id = db.Column(db.Integer, primary_key=True) + test = db.Column(db.String) + + class Model2(db.Model): + id = db.Column(db.Integer, primary_key=True) + + model1_id = db.Column(db.Integer, db.ForeignKey(Model1.id)) + model1 = db.relationship(Model1, backref=db.backref('model2', uselist=False)) + + db.create_all() + + view1 = CustomModelView(Model1, db.session, endpoint='view1') + view2 = CustomModelView(Model2, db.session, endpoint='view2') + admin.add_view(view1) + admin.add_view(view2) + + model1 = Model1(test='test') + model2 = Model2(model1=model1) + db.session.add(model1) + db.session.add(model2) + db.session.commit() + + eq_(model1.model2, model2) + eq_(model2.model1, model1) + + eq_(view1._create_form_class.model2.field_class.widget.multiple, False) + eq_(view2._create_form_class.model1.field_class.widget.multiple, False) + + +def test_relations(): + # TODO: test relations + pass + + +def test_on_model_change_delete(): + app, db, admin = setup() + Model1, _ = create_models(db) + + class ModelView(CustomModelView): + def on_model_change(self, form, model, is_created): + model.test1 = model.test1.upper() + + def on_model_delete(self, model): + self.deleted = True + + view = ModelView(Model1, db.session) + admin.add_view(view) + + client = app.test_client() + + client.post('/admin/model1/new/', + data=dict(test1='test1large', test2='test2')) + + model = db.session.query(Model1).first() + eq_(model.test1, 'TEST1LARGE') + + url = '/admin/model1/edit/?id=%s' % model.id + client.post(url, data=dict(test1='test1small', test2='test2large')) + + model = db.session.query(Model1).first() + eq_(model.test1, 'TEST1SMALL') + + url = '/admin/model1/delete/?id=%s' % model.id + client.post(url) + ok_(view.deleted) + + +def test_multiple_delete(): + app, db, admin = setup() + M1, _ = create_models(db) + + db.session.add_all([M1('a'), M1('b'), M1('c')]) + db.session.commit() + eq_(M1.query.count(), 3) + + view = ModelView(M1, db.session) + admin.add_view(view) + + client = app.test_client() + + rv = client.post('/admin/model1/action/', data=dict(action='delete', rowid=[1, 2, 3])) + eq_(rv.status_code, 302) + eq_(M1.query.count(), 0) + + +def test_default_sort(): + app, db, admin = setup() + M1, _ = create_models(db) + + db.session.add_all([M1('c', 'x'), M1('b', 'x'), M1('a', 'y')]) + db.session.commit() + eq_(M1.query.count(), 3) + + view = CustomModelView(M1, db.session, column_default_sort='test1') + admin.add_view(view) + + _, data = view.get_list(0, None, None, None, None) + + eq_(len(data), 3) + eq_(data[0].test1, 'a') + eq_(data[1].test1, 'b') + eq_(data[2].test1, 'c') + + # test default sort on renamed columns - with column_list scaffolding + view2 = CustomModelView(M1, db.session, column_default_sort='test1', + column_labels={'test1': 'blah'}, endpoint='m1_2') + admin.add_view(view2) + + _, data = view2.get_list(0, None, None, None, None) + + eq_(len(data), 3) + eq_(data[0].test1, 'a') + eq_(data[1].test1, 'b') + eq_(data[2].test1, 'c') + + # test default sort on renamed columns - without column_list scaffolding + view3 = CustomModelView(M1, db.session, column_default_sort='test1', + column_labels={'test1': 'blah'}, endpoint='m1_3', + column_list=['test1']) + admin.add_view(view3) + + _, data = view3.get_list(0, None, None, None, None) + + eq_(len(data), 3) + eq_(data[0].test1, 'a') + eq_(data[1].test1, 'b') + eq_(data[2].test1, 'c') + + # test default sort with multiple columns + order = [('test2', False), ('test1', False)] + view4 = CustomModelView(M1, db.session, column_default_sort=order, endpoint='m1_4') + admin.add_view(view4) + + _, data = view4.get_list(0, None, None, None, None) + + eq_(len(data), 3) + eq_(data[0].test1, 'b') + eq_(data[1].test1, 'c') + eq_(data[2].test1, 'a') + + +def test_complex_sort(): + app, db, admin = setup() + M1, M2 = create_models(db) + + m1 = M1(test1='c', test2='x') + db.session.add(m1) + db.session.add(M2('c', model1=m1)) + + m2 = M1(test1='b', test2='x') + db.session.add(m2) + db.session.add(M2('b', model1=m2)) + + m3 = M1(test1='a', test2='y') + db.session.add(m3) + db.session.add(M2('a', model1=m3)) + + db.session.commit() + + # test sorting on relation string - 'model1.test1' + view = CustomModelView(M2, db.session, + column_list=['string_field', 'model1.test1'], + column_sortable_list=['model1.test1']) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model2/?sort=0') + eq_(rv.status_code, 200) + + _, data = view.get_list(0, 'model1.test1', False, None, None) + + eq_(data[0].model1.test1, 'a') + eq_(data[1].model1.test1, 'b') + eq_(data[2].model1.test1, 'c') + + # test sorting on multiple columns in related model + view2 = CustomModelView(M2, db.session, + column_list=['string_field', 'model1'], + column_sortable_list=[('model1', ('model1.test2', 'model1.test1'))], endpoint="m1_2") + admin.add_view(view2) + + rv = client.get('/admin/m1_2/?sort=0') + eq_(rv.status_code, 200) + + _, data = view2.get_list(0, 'model1', False, None, None) + + eq_(data[0].model1.test1, 'b') + eq_(data[1].model1.test1, 'c') + eq_(data[2].model1.test1, 'a') + + +@raises(Exception) +def test_complex_sort_exception(): + app, db, admin = setup() + M1, M2 = create_models(db) + + # test column_sortable_list on a related table's column object + view = CustomModelView(M2, db.session, endpoint="model2_3", + column_sortable_list=[M1.test1]) + admin.add_view(view) + + sort_column = view._get_column_by_idx(0)[0] + _, data = view.get_list(0, sort_column, False, None, None) + + eq_(len(data), 2) + eq_(data[0].model1.test1, 'a') + eq_(data[1].model1.test1, 'b') + + +def test_default_complex_sort(): + app, db, admin = setup() + M1, M2 = create_models(db) + + m1 = M1('b') + db.session.add(m1) + db.session.add(M2('c', model1=m1)) + + m2 = M1('a') + db.session.add(m2) + db.session.add(M2('c', model1=m2)) + + db.session.commit() + + view = CustomModelView(M2, db.session, column_default_sort='model1.test1') + admin.add_view(view) + + _, data = view.get_list(0, None, None, None, None) + + eq_(len(data), 2) + eq_(data[0].model1.test1, 'a') + eq_(data[1].model1.test1, 'b') + + # test column_default_sort on a related table's column object + view2 = CustomModelView(M2, db.session, endpoint="model2_2", + column_default_sort=(M1.test1, False)) + admin.add_view(view2) + + _, data = view2.get_list(0, None, None, None, None) + + eq_(len(data), 2) + eq_(data[0].model1.test1, 'a') + eq_(data[1].model1.test1, 'b') + + +def test_extra_fields(): + app, db, admin = setup() + + Model1, _ = create_models(db) + + view = CustomModelView( + Model1, db.session, + form_extra_fields={ + 'extra_field': fields.StringField('Extra Field') + } + ) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model1/new/') + eq_(rv.status_code, 200) + + # Check presence and order + data = rv.data.decode('utf-8') + ok_('Extra Field' in data) + pos1 = data.find('Extra Field') + pos2 = data.find('Test1') + ok_(pos2 < pos1) + + +def test_extra_field_order(): + app, db, admin = setup() + + Model1, _ = create_models(db) + + view = CustomModelView( + Model1, db.session, + form_columns=('extra_field', 'test1'), + form_extra_fields={ + 'extra_field': fields.StringField('Extra Field') + } + ) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model1/new/') + eq_(rv.status_code, 200) + + # Check presence and order + data = rv.data.decode('utf-8') + pos1 = data.find('Extra Field') + pos2 = data.find('Test1') + ok_(pos2 > pos1) + + +def test_modelview_localization(): + def test_locale(locale): + try: + app, db, admin = setup() + + app.config['BABEL_DEFAULT_LOCALE'] = locale + Babel(app) + + Model1, _ = create_models(db) + + view = CustomModelView( + Model1, db.session, + column_filters=['test1', 'bool_field', 'date_field', 'datetime_field', 'time_field'] + ) + + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model1/') + eq_(rv.status_code, 200) + + rv = client.get('/admin/model1/new/') + eq_(rv.status_code, 200) + except: + print("Error on the following locale:", locale) + raise + + locales = ['en', 'cs', 'de', 'es', 'fa', 'fr', 'pt', 'ru', 'zh_CN', 'zh_TW'] + for locale in locales: + test_locale(locale) + + +def test_modelview_named_filter_localization(): + app, db, admin = setup() + + app.config['BABEL_DEFAULT_LOCALE'] = 'de' + Babel(app) + + Model1, _ = create_models(db) + + view = CustomModelView( + Model1, db.session, + named_filter_urls=True, + column_filters=['test1'], + ) + + filters = view.get_filters() + flt = filters[2] + with app.test_request_context(): + flt_name = view.get_filter_arg(2, flt) + eq_('test1_equals', flt_name) + + +def test_custom_form_base(): + app, db, admin = setup() + + class TestForm(form.BaseForm): + pass + + Model1, _ = create_models(db) + + view = CustomModelView( + Model1, db.session, + form_base_class=TestForm + ) + admin.add_view(view) + + ok_(hasattr(view._create_form_class, 'test1')) + + create_form = view.create_form() + ok_(isinstance(create_form, TestForm)) + + +def test_ajax_fk(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + + view = CustomModelView( + Model2, db.session, + url='view', + form_ajax_refs={ + 'model1': { + 'fields': ('test1', 'test2') + } + } + ) + admin.add_view(view) + + ok_(u'model1' in view._form_ajax_refs) + + model = Model1(u'first') + model2 = Model1(u'foo', u'bar') + db.session.add_all([model, model2]) + db.session.commit() + + # Check loader + loader = view._form_ajax_refs[u'model1'] + mdl = loader.get_one(model.id) + eq_(mdl.test1, model.test1) + + items = loader.get_list(u'fir') + eq_(len(items), 1) + eq_(items[0].id, model.id) + + items = loader.get_list(u'bar') + eq_(len(items), 1) + eq_(items[0].test1, u'foo') + + # Check form generation + form = view.create_form() + eq_(form.model1.__class__.__name__, u'AjaxSelectField') + + with app.test_request_context('/admin/view/'): + ok_(u'value=""' not in form.model1()) + + form.model1.data = model + ok_(u'data-json="[%s, "first"]"' % model.id in form.model1()) + ok_(u'value="1"' in form.model1()) + + # Check querying + client = app.test_client() + + req = client.get(u'/admin/view/ajax/lookup/?name=model1&query=foo') + eq_(req.data.decode('utf-8'), u'[[%s, "foo"]]' % model2.id) + + # Check submitting + req = client.post('/admin/view/new/', data={u'model1': as_unicode(model.id)}) + mdl = db.session.query(Model2).first() + + ok_(mdl is not None) + ok_(mdl.model1 is not None) + eq_(mdl.model1.id, model.id) + eq_(mdl.model1.test1, u'first') + + +def test_ajax_fk_multi(): + app, db, admin = setup() + + class Model1(db.Model): + __tablename__ = 'model1' + + id = db.Column(db.Integer, primary_key=True) + name = db.Column(db.String(20)) + + def __str__(self): + return self.name + + table = db.Table('m2m', db.Model.metadata, + db.Column('model1_id', db.Integer, db.ForeignKey('model1.id')), + db.Column('model2_id', db.Integer, db.ForeignKey('model2.id')) + ) + + class Model2(db.Model): + __tablename__ = 'model2' + + id = db.Column(db.Integer, primary_key=True) + name = db.Column(db.String(20)) + + model1_id = db.Column(db.Integer(), db.ForeignKey(Model1.id)) + model1 = db.relationship(Model1, backref='models2', secondary=table) + + db.create_all() + + view = CustomModelView( + Model2, db.session, + url='view', + form_ajax_refs={ + 'model1': { + 'fields': ['name'] + } + } + ) + admin.add_view(view) + + ok_(u'model1' in view._form_ajax_refs) + + model = Model1(name=u'first') + db.session.add_all([model, Model1(name=u'foo')]) + db.session.commit() + + # Check form generation + form = view.create_form() + eq_(form.model1.__class__.__name__, u'AjaxSelectMultipleField') + + with app.test_request_context('/admin/view/'): + ok_(u'data-json="[]"' in form.model1()) + + form.model1.data = [model] + ok_(u'data-json="[[1, "first"]]"' in form.model1()) + + # Check submitting + client = app.test_client() + client.post('/admin/view/new/', data={u'model1': as_unicode(model.id)}) + mdl = db.session.query(Model2).first() + + ok_(mdl is not None) + ok_(mdl.model1 is not None) + eq_(len(mdl.model1), 1) + + +def test_safe_redirect(): + app, db, admin = setup() + Model1, _ = create_models(db) + + view = CustomModelView(Model1, db.session) + admin.add_view(view) + + client = app.test_client() + + rv = client.post('/admin/model1/new/?url=http://localhost/admin/model2view/', + data=dict(test1='test1large', test2='test2', + _continue_editing='Save and Continue Editing')) + + eq_(rv.status_code, 302) + assert_true(rv.location.startswith('http://localhost/admin/model1/edit/')) + assert_true('url=http%3A%2F%2Flocalhost%2Fadmin%2Fmodel2view%2F' in rv.location) + assert_true('id=1' in rv.location) + + rv = client.post('/admin/model1/new/?url=http://google.com/evil/', + data=dict(test1='test1large', test2='test2', + _continue_editing='Save and Continue Editing')) + + eq_(rv.status_code, 302) + assert_true(rv.location.startswith('http://localhost/admin/model1/edit/')) + assert_true('url=%2Fadmin%2Fmodel1%2F' in rv.location) + assert_true('id=2' in rv.location) + + +def test_simple_list_pager(): + app, db, admin = setup() + Model1, _ = create_models(db) + + class TestModelView(CustomModelView): + simple_list_pager = True + + def get_count_query(self): + assert False + + view = TestModelView(Model1, db.session) + admin.add_view(view) + + count, data = view.get_list(0, None, None, None, None) + assert_true(count is None) + + +def test_unlimited_page_size(): + app, db, admin = setup() + M1, _ = create_models(db) + + db.session.add_all([M1('1'), M1('2'), M1('3'), M1('4'), M1('5'), M1('6'), + M1('7'), M1('8'), M1('9'), M1('10'), M1('11'), + M1('12'), M1('13'), M1('14'), M1('15'), M1('16'), + M1('17'), M1('18'), M1('19'), M1('20'), M1('21')]) + + view = CustomModelView(M1, db.session) + + # test 0 as page_size + _, data = view.get_list(0, None, None, None, None, execute=True, + page_size=0) + eq_(len(data), 21) + + # test False as page_size + _, data = view.get_list(0, None, None, None, None, execute=True, + page_size=False) + eq_(len(data), 21) + + +def test_advanced_joins(): + app, db, admin = setup() + + class Model1(db.Model): + id = db.Column(db.Integer, primary_key=True) + val1 = db.Column(db.String(20)) + test = db.Column(db.String(20)) + + class Model2(db.Model): + id = db.Column(db.Integer, primary_key=True) + val2 = db.Column(db.String(20)) + + model1_id = db.Column(db.Integer, db.ForeignKey(Model1.id)) + model1 = db.relationship(Model1, backref='model2') + + class Model3(db.Model): + id = db.Column(db.Integer, primary_key=True) + val2 = db.Column(db.String(20)) + + model2_id = db.Column(db.Integer, db.ForeignKey(Model2.id)) + model2 = db.relationship(Model2, backref='model3') + + view1 = CustomModelView(Model1, db.session) + admin.add_view(view1) + + view2 = CustomModelView(Model2, db.session) + admin.add_view(view2) + + view3 = CustomModelView(Model3, db.session) + admin.add_view(view3) + + # Test joins + attr, path = tools.get_field_with_path(Model2, 'model1.val1') + eq_(attr, Model1.val1) + eq_(path, [Model2.model1]) + + attr, path = tools.get_field_with_path(Model1, 'model2.val2') + eq_(attr, Model2.val2) + eq_(id(path[0]), id(Model1.model2)) + + attr, path = tools.get_field_with_path(Model3, 'model2.model1.val1') + eq_(attr, Model1.val1) + eq_(path, [Model3.model2, Model2.model1]) + + # Test how joins are applied + query = view3.get_query() + + joins = {} + q1, joins, alias = view3._apply_path_joins(query, joins, path) + ok_((True, Model3.model2) in joins) + ok_((True, Model2.model1) in joins) + ok_(alias is not None) + + # Check if another join would use same path + attr, path = tools.get_field_with_path(Model2, 'model1.test') + q2, joins, alias = view2._apply_path_joins(query, joins, path) + + eq_(len(joins), 2) + for p in q2._join_entities: + ok_(p in q1._join_entities) + + ok_(alias is not None) + + # Check if normal properties are supported by tools.get_field_with_path + attr, path = tools.get_field_with_path(Model2, Model1.test) + eq_(attr, Model1.test) + eq_(path, [Model1.__table__]) + + q3, joins, alias = view2._apply_path_joins(view2.get_query(), joins, path) + eq_(len(joins), 3) + ok_(alias is None) + + +def test_multipath_joins(): + app, db, admin = setup() + + class Model1(db.Model): + id = db.Column(db.Integer, primary_key=True) + val1 = db.Column(db.String(20)) + test = db.Column(db.String(20)) + + class Model2(db.Model): + id = db.Column(db.Integer, primary_key=True) + val2 = db.Column(db.String(20)) + + first_id = db.Column(db.Integer, db.ForeignKey(Model1.id)) + first = db.relationship(Model1, backref='first', foreign_keys=[first_id]) + + second_id = db.Column(db.Integer, db.ForeignKey(Model1.id)) + second = db.relationship(Model1, backref='second', foreign_keys=[second_id]) + + db.create_all() + + view = CustomModelView(Model2, db.session, filters=['first.test']) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model2/') + eq_(rv.status_code, 200) + + +def test_different_bind_joins(): + app, db, admin = setup() + app.config['SQLALCHEMY_BINDS'] = { + 'other': 'sqlite:///' + } + + class Model1(db.Model): + id = db.Column(db.Integer, primary_key=True) + val1 = db.Column(db.String(20)) + + class Model2(db.Model): + __bind_key__ = 'other' + id = db.Column(db.Integer, primary_key=True) + val1 = db.Column(db.String(20)) + first_id = db.Column(db.Integer, db.ForeignKey(Model1.id)) + first = db.relationship(Model1) + + db.create_all() + + view = CustomModelView(Model2, db.session) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model2/') + eq_(rv.status_code, 200) + + +def test_model_default(): + app, db, admin = setup() + _, Model2 = create_models(db) + + class ModelView(CustomModelView): + pass + + view = ModelView(Model2, db.session) + admin.add_view(view) + + client = app.test_client() + rv = client.post('/admin/model2/new/', data=dict()) + assert_true(b'This field is required' not in rv.data) + + +def test_export_csv(): + app, db, admin = setup() + Model1, Model2 = create_models(db) + + for x in range(5): + fill_db(db, Model1, Model2) + + view = CustomModelView(Model1, db.session, can_export=True, + column_list=['test1', 'test2'], export_max_rows=2, + endpoint='row_limit_2') + admin.add_view(view) + + client = app.test_client() + + # test export_max_rows + rv = client.get('/admin/row_limit_2/export/csv/') + data = rv.data.decode('utf-8') + eq_(rv.status_code, 200) + ok_("Test1,Test2\r\n" + "test1_val_1,test2_val_1\r\n" + "test1_val_2,test2_val_2\r\n" == data) + + view = CustomModelView(Model1, db.session, can_export=True, + column_list=['test1', 'test2'], + endpoint='no_row_limit') + admin.add_view(view) + + # test row limit without export_max_rows + rv = client.get('/admin/no_row_limit/export/csv/') + data = rv.data.decode('utf-8') + eq_(rv.status_code, 200) + ok_(len(data.splitlines()) > 21) diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/test_form_rules.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/test_form_rules.py new file mode 100644 index 00000000..6f937519 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/test_form_rules.py @@ -0,0 +1,160 @@ +from nose.tools import eq_, ok_ + +from . import setup +from .test_basic import CustomModelView, create_models + +from flask_admin.form import rules + + +def test_form_rules(): + app, db, admin = setup() + + Model1, _ = create_models(db) + db.create_all() + + view = CustomModelView(Model1, db.session, + form_rules=('test2', 'test1', rules.Field('test4'))) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model1/new/') + eq_(rv.status_code, 200) + + data = rv.data.decode('utf-8') + pos1 = data.find('Test1') + pos2 = data.find('Test2') + pos3 = data.find('Test3') + pos4 = data.find('Test4') + ok_(pos1 > pos2) + ok_(pos4 > pos1) + ok_(pos3 == -1) + + +def test_rule_macro(): + app, db, admin = setup() + + Model1, _ = create_models(db) + db.create_all() + + view = CustomModelView(Model1, db.session, + create_template='macro.html', + form_create_rules=(rules.Macro('test', arg='foobar'), + rules.Macro('test_lib.another_test'))) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model1/new/') + eq_(rv.status_code, 200) + + data = rv.data.decode('utf-8') + ok_('Value = foobar' in data) + ok_('Hello another_test' in data) + + +def test_rule_container(): + app, db, admin = setup() + + Model1, _ = create_models(db) + db.create_all() + + view = CustomModelView(Model1, db.session, + create_template='macro.html', + form_create_rules=(rules.Container('wrap', rules.Macro('test_lib.another_test')),)) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model1/new/') + eq_(rv.status_code, 200) + + data = rv.data.decode('utf-8') + pos1 = data.find('') + pos2 = data.find('another_test') + pos3 = data.find('') + ok_(pos1 != -1) + ok_(pos2 != -1) + ok_(pos3 != -1) + ok_(pos1 < pos2 < pos3) + + +def test_rule_header(): + app, db, admin = setup() + + Model1, _ = create_models(db) + db.create_all() + + view = CustomModelView(Model1, db.session, + form_create_rules=(rules.Header('hello'),)) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model1/new/') + eq_(rv.status_code, 200) + + data = rv.data.decode('utf-8') + ok_('

    hello

    ' in data) + + +def test_rule_field_set(): + app, db, admin = setup() + + Model1, _ = create_models(db) + db.create_all() + + view = CustomModelView(Model1, db.session, + form_create_rules=(rules.FieldSet(['test2', 'test1', 'test4'], 'header'),)) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model1/new/') + eq_(rv.status_code, 200) + + data = rv.data.decode('utf-8') + ok_('

    header

    ' in data) + pos1 = data.find('Test1') + pos2 = data.find('Test2') + pos3 = data.find('Test3') + pos4 = data.find('Test4') + ok_(pos1 > pos2) + ok_(pos4 > pos1) + ok_(pos3 == -1) + + +def test_rule_inlinefieldlist(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + db.create_all() + + view = CustomModelView(Model1, db.session, + inline_models=(Model2,), + form_create_rules=('test1', 'model2')) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model1/new/') + eq_(rv.status_code, 200) + + +def test_inline_model_rules(): + app, db, admin = setup() + + Model1, Model2 = create_models(db) + db.create_all() + + view = CustomModelView(Model1, db.session, + inline_models=[(Model2, dict(form_rules=('string_field', 'bool_field')))]) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model1/new/') + eq_(rv.status_code, 200) + + data = rv.data.decode('utf-8') + ok_('int_field' not in data) diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/test_inlineform.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/test_inlineform.py new file mode 100644 index 00000000..b0665fe2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/test_inlineform.py @@ -0,0 +1,291 @@ +# -*- coding: utf-8 -*- +from nose.tools import eq_, ok_ + +from wtforms import fields + +from flask_admin import form +from flask_admin.contrib.sqla import ModelView +from flask_admin.contrib.sqla.fields import InlineModelFormList +from flask_admin.contrib.sqla.validators import ItemsRequired + +from . import setup + + +def test_inline_form(): + app, db, admin = setup() + client = app.test_client() + + # Set up models and database + class User(db.Model): + __tablename__ = 'users' + id = db.Column(db.Integer, primary_key=True) + name = db.Column(db.String, unique=True) + + def __init__(self, name=None): + self.name = name + + class UserInfo(db.Model): + __tablename__ = 'user_info' + id = db.Column(db.Integer, primary_key=True) + key = db.Column(db.String, nullable=False) + val = db.Column(db.String) + user_id = db.Column(db.Integer, db.ForeignKey(User.id)) + user = db.relationship(User, backref=db.backref('info', cascade="all, delete-orphan", single_parent=True)) + + db.create_all() + + # Set up Admin + class UserModelView(ModelView): + inline_models = (UserInfo,) + + view = UserModelView(User, db.session) + admin.add_view(view) + + # Basic tests + ok_(view._create_form_class is not None) + ok_(view._edit_form_class is not None) + eq_(view.endpoint, 'user') + + # Verify form + eq_(view._create_form_class.name.field_class, fields.StringField) + eq_(view._create_form_class.info.field_class, InlineModelFormList) + + rv = client.get('/admin/user/') + eq_(rv.status_code, 200) + + rv = client.get('/admin/user/new/') + eq_(rv.status_code, 200) + + # Create + rv = client.post('/admin/user/new/', data=dict(name=u'äõüxyz')) + eq_(rv.status_code, 302) + eq_(User.query.count(), 1) + eq_(UserInfo.query.count(), 0) + + data = {'name': u'fbar', 'info-0-key': 'foo', 'info-0-val': 'bar'} + rv = client.post('/admin/user/new/', data=data) + eq_(rv.status_code, 302) + eq_(User.query.count(), 2) + eq_(UserInfo.query.count(), 1) + + # Edit + rv = client.get('/admin/user/edit/?id=2') + eq_(rv.status_code, 200) + # Edit - update + data = { + 'name': u'barfoo', + 'info-0-id': 1, + 'info-0-key': u'xxx', + 'info-0-val': u'yyy', + } + rv = client.post('/admin/user/edit/?id=2', data=data) + eq_(UserInfo.query.count(), 1) + eq_(UserInfo.query.one().key, u'xxx') + + # Edit - add & delete + data = { + 'name': u'barf', + 'del-info-0': 'on', + 'info-0-id': '1', + 'info-0-key': 'yyy', + 'info-0-val': 'xxx', + 'info-1-id': None, + 'info-1-key': u'bar', + 'info-1-val': u'foo', + } + rv = client.post('/admin/user/edit/?id=2', data=data) + eq_(rv.status_code, 302) + eq_(User.query.count(), 2) + eq_(User.query.get(2).name, u'barf') + eq_(UserInfo.query.count(), 1) + eq_(UserInfo.query.one().key, u'bar') + + # Delete + rv = client.post('/admin/user/delete/?id=2') + eq_(rv.status_code, 302) + eq_(User.query.count(), 1) + rv = client.post('/admin/user/delete/?id=1') + eq_(rv.status_code, 302) + eq_(User.query.count(), 0) + eq_(UserInfo.query.count(), 0) + + +def test_inline_form_required(): + app, db, admin = setup() + client = app.test_client() + + # Set up models and database + class User(db.Model): + __tablename__ = 'users' + id = db.Column(db.Integer, primary_key=True) + name = db.Column(db.String, unique=True) + + def __init__(self, name=None): + self.name = name + + class UserEmail(db.Model): + __tablename__ = 'user_info' + id = db.Column(db.Integer, primary_key=True) + email = db.Column(db.String, nullable=False, unique=True) + verified_at = db.Column(db.DateTime) + user_id = db.Column(db.Integer, db.ForeignKey(User.id)) + user = db.relationship(User, backref=db.backref('emails', cascade="all, delete-orphan", single_parent=True)) + + db.create_all() + + # Set up Admin + class UserModelView(ModelView): + inline_models = (UserEmail,) + form_args = { + "emails": {"validators": [ItemsRequired()]} + } + + view = UserModelView(User, db.session) + admin.add_view(view) + + # Create + rv = client.post('/admin/user/new/', data=dict(name=u'no-email')) + eq_(rv.status_code, 200) + eq_(User.query.count(), 0) + + data = { + 'name': 'hasEmail', + 'emails-0-email': 'foo@bar.com', + } + rv = client.post('/admin/user/new/', data=data) + eq_(rv.status_code, 302) + eq_(User.query.count(), 1) + eq_(UserEmail.query.count(), 1) + + +def test_inline_form_ajax_fk(): + app, db, admin = setup() + + # Set up models and database + class User(db.Model): + __tablename__ = 'users' + id = db.Column(db.Integer, primary_key=True) + name = db.Column(db.String, unique=True) + + def __init__(self, name=None): + self.name = name + + class Tag(db.Model): + __tablename__ = 'tags' + + id = db.Column(db.Integer, primary_key=True) + name = db.Column(db.String, unique=True) + + class UserInfo(db.Model): + __tablename__ = 'user_info' + id = db.Column(db.Integer, primary_key=True) + key = db.Column(db.String, nullable=False) + val = db.Column(db.String) + + user_id = db.Column(db.Integer, db.ForeignKey(User.id)) + user = db.relationship(User, backref=db.backref('info', cascade="all, delete-orphan", single_parent=True)) + + tag_id = db.Column(db.Integer, db.ForeignKey(Tag.id)) + tag = db.relationship(Tag, backref='user_info') + + db.create_all() + + # Set up Admin + class UserModelView(ModelView): + opts = { + 'form_ajax_refs': { + 'tag': { + 'fields': ['name'] + } + } + } + + inline_models = [(UserInfo, opts)] + + view = UserModelView(User, db.session) + admin.add_view(view) + + form = view.create_form() + user_info_form = form.info.unbound_field.args[0] + loader = user_info_form.tag.args[0] + eq_(loader.name, 'userinfo-tag') + eq_(loader.model, Tag) + + ok_('userinfo-tag' in view._form_ajax_refs) + + +def test_inline_form_self(): + app, db, admin = setup() + + class Tree(db.Model): + id = db.Column(db.Integer, primary_key=True) + parent_id = db.Column(db.Integer, db.ForeignKey('tree.id')) + parent = db.relationship('Tree', remote_side=[id], backref='children') + + db.create_all() + + class TreeView(ModelView): + inline_models = (Tree,) + + view = TreeView(Tree, db.session) + + parent = Tree() + child = Tree(parent=parent) + form = view.edit_form(child) + eq_(form.parent.data, parent) + + +def test_inline_form_base_class(): + app, db, admin = setup() + client = app.test_client() + + # Set up models and database + class User(db.Model): + __tablename__ = 'users' + id = db.Column(db.Integer, primary_key=True) + name = db.Column(db.String, unique=True) + + def __init__(self, name=None): + self.name = name + + class UserEmail(db.Model): + __tablename__ = 'user_info' + id = db.Column(db.Integer, primary_key=True) + email = db.Column(db.String, nullable=False, unique=True) + verified_at = db.Column(db.DateTime) + user_id = db.Column(db.Integer, db.ForeignKey(User.id)) + user = db.relationship(User, backref=db.backref('emails', cascade="all, delete-orphan", single_parent=True)) + + db.create_all() + + # Customize error message + class StubTranslation(object): + def gettext(self, *args): + return 'success!' + + def ngettext(self, *args): + return 'success!' + + class StubBaseForm(form.BaseForm): + def _get_translations(self): + return StubTranslation() + + # Set up Admin + class UserModelView(ModelView): + inline_models = ((UserEmail, {"form_base_class": StubBaseForm}),) + form_args = { + "emails": {"validators": [ItemsRequired()]} + } + + view = UserModelView(User, db.session) + admin.add_view(view) + + # Create + data = { + 'name': 'emptyEmail', + 'emails-0-email': '', + } + rv = client.post('/admin/user/new/', data=data) + eq_(rv.status_code, 200) + eq_(User.query.count(), 0) + ok_(b'success!' in rv.data, rv.data) diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/test_multi_pk.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/test_multi_pk.py new file mode 100644 index 00000000..fc96df76 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/test_multi_pk.py @@ -0,0 +1,195 @@ +from nose.tools import eq_, ok_ + +from . import setup +from .test_basic import CustomModelView + +from flask_sqlalchemy import Model +from sqlalchemy.ext.declarative import declarative_base + + +def test_multiple_pk(): + # Test multiple primary keys - mix int and string together + app, db, admin = setup() + + class Model(db.Model): + id = db.Column(db.Integer, primary_key=True) + id2 = db.Column(db.String(20), primary_key=True) + test = db.Column(db.String) + + db.create_all() + + view = CustomModelView(Model, db.session, form_columns=['id', 'id2', 'test']) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model/') + eq_(rv.status_code, 200) + + rv = client.post('/admin/model/new/', + data=dict(id=1, id2='two', test='test3')) + eq_(rv.status_code, 302) + + rv = client.get('/admin/model/') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test3' in data) + + rv = client.get('/admin/model/edit/?id=1,two') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test3' in data) + + # Correct order is mandatory -> fail here + rv = client.get('/admin/model/edit/?id=two,1') + eq_(rv.status_code, 302) + + +def test_joined_inheritance(): + # Test multiple primary keys - mix int and string together + app, db, admin = setup() + + class Parent(db.Model): + id = db.Column(db.Integer, primary_key=True) + test = db.Column(db.String) + + discriminator = db.Column('type', db.String(50)) + __mapper_args__ = {'polymorphic_on': discriminator} + + class Child(Parent): + __tablename__ = 'children' + __mapper_args__ = {'polymorphic_identity': 'child'} + + id = db.Column(db.ForeignKey(Parent.id), primary_key=True) + name = db.Column(db.String(100)) + + db.create_all() + + view = CustomModelView(Child, db.session, form_columns=['id', 'test', 'name']) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/child/') + eq_(rv.status_code, 200) + + rv = client.post('/admin/child/new/', + data=dict(id=1, test='foo', name='bar')) + eq_(rv.status_code, 302) + + rv = client.get('/admin/child/edit/?id=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('foo' in data) + ok_('bar' in data) + + +def test_single_table_inheritance(): + # Test multiple primary keys - mix int and string together + app, db, admin = setup() + + CustomModel = declarative_base(Model, name='Model') + + class Parent(CustomModel): + __tablename__ = 'parent' + + id = db.Column(db.Integer, primary_key=True) + test = db.Column(db.String) + + discriminator = db.Column('type', db.String(50)) + __mapper_args__ = {'polymorphic_on': discriminator} + + class Child(Parent): + __mapper_args__ = {'polymorphic_identity': 'child'} + name = db.Column(db.String(100)) + + CustomModel.metadata.create_all(db.engine) + + view = CustomModelView(Child, db.session, form_columns=['id', 'test', 'name']) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/child/') + eq_(rv.status_code, 200) + + rv = client.post('/admin/child/new/', + data=dict(id=1, test='foo', name='bar')) + eq_(rv.status_code, 302) + + rv = client.get('/admin/child/edit/?id=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('foo' in data) + ok_('bar' in data) + + +def test_concrete_table_inheritance(): + # Test multiple primary keys - mix int and string together + app, db, admin = setup() + + class Parent(db.Model): + id = db.Column(db.Integer, primary_key=True) + test = db.Column(db.String) + + class Child(Parent): + __mapper_args__ = {'concrete': True} + id = db.Column(db.Integer, primary_key=True) + name = db.Column(db.String(100)) + test = db.Column(db.String) + + db.create_all() + + view = CustomModelView(Child, db.session, form_columns=['id', 'test', 'name']) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/child/') + eq_(rv.status_code, 200) + + rv = client.post('/admin/child/new/', + data=dict(id=1, test='foo', name='bar')) + eq_(rv.status_code, 302) + + rv = client.get('/admin/child/edit/?id=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('foo' in data) + ok_('bar' in data) + + +def test_concrete_multipk_inheritance(): + # Test multiple primary keys - mix int and string together + app, db, admin = setup() + + class Parent(db.Model): + id = db.Column(db.Integer, primary_key=True) + test = db.Column(db.String) + + class Child(Parent): + __mapper_args__ = {'concrete': True} + id = db.Column(db.Integer, primary_key=True) + id2 = db.Column(db.Integer, primary_key=True) + name = db.Column(db.String(100)) + test = db.Column(db.String) + + db.create_all() + + view = CustomModelView(Child, db.session, form_columns=['id', 'id2', 'test', 'name']) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/child/') + eq_(rv.status_code, 200) + + rv = client.post('/admin/child/new/', + data=dict(id=1, id2=2, test='foo', name='bar')) + eq_(rv.status_code, 302) + + rv = client.get('/admin/child/edit/?id=1,2') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('foo' in data) + ok_('bar' in data) diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/test_postgres.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/test_postgres.py new file mode 100644 index 00000000..c8085bd0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/test_postgres.py @@ -0,0 +1,114 @@ +from nose.tools import eq_, ok_ + +from . import setup_postgres +from .test_basic import CustomModelView + +from sqlalchemy.dialects.postgresql import HSTORE, JSON +from citext import CIText + + +def test_hstore(): + app, db, admin = setup_postgres() + + class Model(db.Model): + id = db.Column(db.Integer, primary_key=True, autoincrement=True) + hstore_test = db.Column(HSTORE) + + db.create_all() + + view = CustomModelView(Model, db.session) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model/') + eq_(rv.status_code, 200) + + rv = client.post('/admin/model/new/', data={ + 'hstore_test-0-key': 'test_val1', + 'hstore_test-0-value': 'test_val2' + }) + eq_(rv.status_code, 302) + + rv = client.get('/admin/model/') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test_val1' in data) + ok_('test_val2' in data) + + rv = client.get('/admin/model/edit/?id=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test_val1' in data) + ok_('test_val2' in data) + + +def test_json(): + app, db, admin = setup_postgres() + + class JSONModel(db.Model): + id = db.Column(db.Integer, primary_key=True, autoincrement=True) + json_test = db.Column(JSON) + + db.create_all() + + view = CustomModelView(JSONModel, db.session) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/jsonmodel/') + eq_(rv.status_code, 200) + + rv = client.post('/admin/jsonmodel/new/', data={ + 'json_test': '{"test_key1": "test_value1"}', + }) + eq_(rv.status_code, 302) + + rv = client.get('/admin/jsonmodel/') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('json_test' in data) + ok_('{"test_key1": "test_value1"}' in data) + + rv = client.get('/admin/jsonmodel/edit/?id=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('json_test' in data) + ok_('>{"test_key1": "test_value1"}<' in data) + + +def test_citext(): + app, db, admin = setup_postgres() + + class CITextModel(db.Model): + id = db.Column(db.Integer, primary_key=True, autoincrement=True) + citext_test = db.Column(CIText) + + db.engine.execute('CREATE EXTENSION IF NOT EXISTS citext') + db.create_all() + + view = CustomModelView(CITextModel, db.session) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/citextmodel/') + eq_(rv.status_code, 200) + + rv = client.post('/admin/citextmodel/new/', data={ + 'citext_test': 'Foo', + }) + eq_(rv.status_code, 302) + + rv = client.get('/admin/citextmodel/') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('citext_test' in data) + ok_('Foo' in data) + + rv = client.get('/admin/citextmodel/edit/?id=1') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('name="citext_test"' in data) + ok_('>Foo<' in data) diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/test_translation.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/test_translation.py new file mode 100644 index 00000000..cd382764 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/sqla/test_translation.py @@ -0,0 +1,29 @@ +from flask_admin.babel import lazy_gettext +from flask_babelex import Babel +from nose.tools import eq_, ok_ + +from . import setup +from .test_basic import CustomModelView, create_models + + +def test_column_label_translation(): + app, db, admin = setup() + + Model1, _ = create_models(db) + + app.config['BABEL_DEFAULT_LOCALE'] = 'es' + Babel(app) + + label = lazy_gettext('Name') + + view = CustomModelView(Model1, db.session, + column_list=['test1', 'test3'], + column_labels=dict(test1=label), + column_filters=('test1',)) + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/model1/?flt1_0=test') + eq_(rv.status_code, 200) + ok_('{"Nombre":' in rv.data.decode('utf-8')) diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/templates/method.html b/.venv/lib/python3.8/site-packages/flask_admin/tests/templates/method.html new file mode 100644 index 00000000..8e9c6f6e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/templates/method.html @@ -0,0 +1 @@ +{{ request.method }} - {{ name }} \ No newline at end of file diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/templates/mock.html b/.venv/lib/python3.8/site-packages/flask_admin/tests/templates/mock.html new file mode 100644 index 00000000..e2746ad4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/templates/mock.html @@ -0,0 +1 @@ +{% if admin_view %}Success!{% else %}Failure{% endif %} \ No newline at end of file diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/test_base.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/test_base.py new file mode 100644 index 00000000..ab6edbc3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/test_base.py @@ -0,0 +1,443 @@ +import os + +from nose.tools import ok_, eq_, raises + +from flask import Flask, request, abort, url_for +from flask.views import MethodView +from flask_admin import base + + +class MockView(base.BaseView): + # Various properties + allow_call = True + allow_access = True + visible = True + + @base.expose('/') + def index(self): + return 'Success!' + + @base.expose('/test/') + def test(self): + return self.render('mock.html') + + def _handle_view(self, name, **kwargs): + if self.allow_call: + return super(MockView, self)._handle_view(name, **kwargs) + else: + return 'Failure!' + + def is_accessible(self): + if self.allow_access: + return super(MockView, self).is_accessible() + + return False + + def is_visible(self): + if self.visible: + return super(MockView, self).is_visible() + + return False + + +class MockMethodView(base.BaseView): + @base.expose('/') + def index(self): + return 'Success!' + + @base.expose_plugview('/_api/1') + class API1(MethodView): + def get(self, cls): + return cls.render('method.html', request=request, name='API1') + + def post(self, cls): + return cls.render('method.html', request=request, name='API1') + + def put(self, cls): + return cls.render('method.html', request=request, name='API1') + + def delete(self, cls): + return cls.render('method.html', request=request, name='API1') + + @base.expose_plugview('/_api/2') + class API2(MethodView): + def get(self, cls): + return cls.render('method.html', request=request, name='API2') + + def post(self, cls): + return cls.render('method.html', request=request, name='API2') + + @base.expose_plugview('/_api/3') + @base.expose_plugview('/_api/4') + class DoubleExpose(MethodView): + def get(self, cls): + return cls.render('method.html', request=request, name='API3') + + +def test_baseview_defaults(): + view = MockView() + eq_(view.name, None) + eq_(view.category, None) + eq_(view.endpoint, 'mockview') + eq_(view.url, None) + eq_(view.static_folder, None) + eq_(view.admin, None) + eq_(view.blueprint, None) + + +def test_base_defaults(): + admin = base.Admin() + eq_(admin.name, 'Admin') + eq_(admin.url, '/admin') + eq_(admin.endpoint, 'admin') + eq_(admin.app, None) + ok_(admin.index_view is not None) + eq_(admin.index_view._template, 'admin/index.html') + + # Check if default view was added + eq_(len(admin._views), 1) + eq_(admin._views[0], admin.index_view) + + +def test_custom_index_view(): + view = base.AdminIndexView(name='a', category='b', endpoint='c', + url='/d', template='e') + admin = base.Admin(index_view=view) + + eq_(admin.endpoint, 'c') + eq_(admin.url, '/d') + ok_(admin.index_view is view) + eq_(view.name, 'a') + eq_(view.category, 'b') + eq_(view._template, 'e') + + # Check if view was added + eq_(len(admin._views), 1) + eq_(admin._views[0], view) + + +def test_custom_index_view_in_init_app(): + view = base.AdminIndexView(name='a', category='b', endpoint='c', + url='/d', template='e') + app = Flask(__name__) + admin = base.Admin() + admin.init_app(app, index_view=view) + + eq_(admin.endpoint, 'c') + eq_(admin.url, '/d') + ok_(admin.index_view is view) + eq_(view.name, 'a') + eq_(view.category, 'b') + eq_(view._template, 'e') + + # Check if view was added + eq_(len(admin._views), 1) + eq_(admin._views[0], view) + + +def test_base_registration(): + app = Flask(__name__) + admin = base.Admin(app) + + eq_(admin.app, app) + ok_(admin.index_view.blueprint is not None) + + +def test_admin_customizations(): + app = Flask(__name__) + admin = base.Admin(app, name='Test', url='/foobar', static_url_path='/static/my/admin') + eq_(admin.name, 'Test') + eq_(admin.url, '/foobar') + eq_(admin.index_view.blueprint.static_url_path, '/static/my/admin') + + client = app.test_client() + rv = client.get('/foobar/') + eq_(rv.status_code, 200) + + # test custom static_url_path + with app.test_request_context('/'): + rv = client.get(url_for('admin.static', filename='bootstrap/bootstrap2/css/bootstrap.css')) + eq_(rv.status_code, 200) + + +def test_baseview_registration(): + admin = base.Admin() + + view = MockView() + bp = view.create_blueprint(admin) + + # Base properties + eq_(view.admin, admin) + ok_(view.blueprint is not None) + + # Calculated properties + eq_(view.endpoint, 'mockview') + eq_(view.url, '/admin/mockview') + eq_(view.name, 'Mock View') + + # Verify generated blueprint properties + eq_(bp.name, view.endpoint) + eq_(bp.url_prefix, view.url) + eq_(bp.template_folder, os.path.join('templates', 'bootstrap2')) + eq_(bp.static_folder, view.static_folder) + + # Verify customizations + view = MockView(name='Test', endpoint='foobar') + view.create_blueprint(base.Admin()) + + eq_(view.name, 'Test') + eq_(view.endpoint, 'foobar') + eq_(view.url, '/admin/foobar') + + view = MockView(url='test') + view.create_blueprint(base.Admin()) + eq_(view.url, '/admin/test') + + view = MockView(url='/test/test') + view.create_blueprint(base.Admin()) + eq_(view.url, '/test/test') + + view = MockView(endpoint='test') + view.create_blueprint(base.Admin(url='/')) + eq_(view.url, '/test') + + view = MockView(static_url_path='/static/my/test') + view.create_blueprint(base.Admin()) + eq_(view.blueprint.static_url_path, '/static/my/test') + + +def test_baseview_urls(): + app = Flask(__name__) + admin = base.Admin(app) + + view = MockView() + admin.add_view(view) + + eq_(len(view._urls), 2) + + +def test_add_views(): + app = Flask(__name__) + admin = base.Admin(app) + + admin.add_views(MockView(endpoint='test1'), MockView(endpoint='test2')) + + eq_(len(admin.menu()), 3) + + +@raises(Exception) +def test_no_default(): + app = Flask(__name__) + admin = base.Admin(app) + admin.add_view(base.BaseView()) + + +def test_call(): + app = Flask(__name__) + admin = base.Admin(app) + view = MockView() + admin.add_view(view) + client = app.test_client() + + rv = client.get('/admin/') + eq_(rv.status_code, 200) + + rv = client.get('/admin/mockview/') + eq_(rv.data, b'Success!') + + rv = client.get('/admin/mockview/test/') + eq_(rv.data, b'Success!') + + # Check authentication failure + view.allow_call = False + rv = client.get('/admin/mockview/') + eq_(rv.data, b'Failure!') + + +def test_permissions(): + app = Flask(__name__) + admin = base.Admin(app) + view = MockView() + admin.add_view(view) + client = app.test_client() + + view.allow_access = False + + rv = client.get('/admin/mockview/') + eq_(rv.status_code, 403) + + +def test_inaccessible_callback(): + app = Flask(__name__) + admin = base.Admin(app) + view = MockView() + admin.add_view(view) + client = app.test_client() + + view.allow_access = False + view.inaccessible_callback = lambda *args, **kwargs: abort(418) + + rv = client.get('/admin/mockview/') + eq_(rv.status_code, 418) + + +def get_visibility(): + app = Flask(__name__) + admin = base.Admin(app) + + view = MockView(name='TestMenuItem') + view.visible = False + + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/mockview/') + ok_('TestMenuItem' not in rv.data.decode('utf-8')) + + +def test_submenu(): + app = Flask(__name__) + admin = base.Admin(app) + admin.add_view(MockView(name='Test 1', category='Test', endpoint='test1')) + + # Second view is not normally accessible + view = MockView(name='Test 2', category='Test', endpoint='test2') + view.allow_access = False + admin.add_view(view) + + ok_('Test' in admin._menu_categories) + eq_(len(admin._menu), 2) + eq_(admin._menu[1].name, 'Test') + eq_(len(admin._menu[1]._children), 2) + + # Categories don't have URLs + eq_(admin._menu[1].get_url(), None) + + # Categories are only accessible if there is at least one accessible child + eq_(admin._menu[1].is_accessible(), True) + + children = admin._menu[1].get_children() + eq_(len(children), 1) + + ok_(children[0].is_accessible()) + + +def test_delayed_init(): + app = Flask(__name__) + admin = base.Admin() + admin.add_view(MockView()) + admin.init_app(app) + + client = app.test_client() + + rv = client.get('/admin/mockview/') + eq_(rv.data, b'Success!') + + +def test_multi_instances_init(): + app = Flask(__name__) + _ = base.Admin(app) + + class ManageIndex(base.AdminIndexView): + pass + + _ = base.Admin(app, index_view=ManageIndex(url='/manage', endpoint='manage')) # noqa: F841 + + +@raises(Exception) +def test_double_init(): + app = Flask(__name__) + admin = base.Admin(app) + admin.init_app(app) + + +def test_nested_flask_views(): + app = Flask(__name__) + admin = base.Admin(app) + + view = MockMethodView() + admin.add_view(view) + + client = app.test_client() + + rv = client.get('/admin/mockmethodview/_api/1') + print('"', rv.data, '"') + eq_(rv.data, b'GET - API1') + rv = client.put('/admin/mockmethodview/_api/1') + eq_(rv.data, b'PUT - API1') + rv = client.post('/admin/mockmethodview/_api/1') + eq_(rv.data, b'POST - API1') + rv = client.delete('/admin/mockmethodview/_api/1') + eq_(rv.data, b'DELETE - API1') + + rv = client.get('/admin/mockmethodview/_api/2') + eq_(rv.data, b'GET - API2') + rv = client.post('/admin/mockmethodview/_api/2') + eq_(rv.data, b'POST - API2') + rv = client.delete('/admin/mockmethodview/_api/2') + eq_(rv.status_code, 405) + rv = client.put('/admin/mockmethodview/_api/2') + eq_(rv.status_code, 405) + + rv = client.get('/admin/mockmethodview/_api/3') + eq_(rv.data, b'GET - API3') + rv = client.get('/admin/mockmethodview/_api/4') + eq_(rv.data, b'GET - API3') + + +def test_root_mount(): + app = Flask(__name__) + admin = base.Admin(app, url='/') + admin.add_view(MockView()) + + client = app.test_client() + rv = client.get('/mockview/') + eq_(rv.data, b'Success!') + + # test static files when url='/' + with app.test_request_context('/'): + rv = client.get(url_for('admin.static', filename='bootstrap/bootstrap2/css/bootstrap.css')) + eq_(rv.status_code, 200) + + +def test_menu_links(): + app = Flask(__name__) + admin = base.Admin(app) + admin.add_link(base.MenuLink('TestMenuLink1', endpoint='.index')) + admin.add_link(base.MenuLink('TestMenuLink2', url='http://python.org/')) + + client = app.test_client() + rv = client.get('/admin/') + + data = rv.data.decode('utf-8') + ok_('TestMenuLink1' in data) + ok_('TestMenuLink2' in data) + + +def test_add_links(): + app = Flask(__name__) + admin = base.Admin(app) + admin.add_links(base.MenuLink('TestMenuLink1', endpoint='.index'), + base.MenuLink('TestMenuLink2', url='http://python.org/')) + + client = app.test_client() + rv = client.get('/admin/') + + data = rv.data.decode('utf-8') + ok_('TestMenuLink1' in data) + ok_('TestMenuLink2' in data) + + +def check_class_name(): + view = MockView() + eq_(view.name, 'Mock View') + + +def check_endpoint(): + class CustomView(MockView): + def _get_endpoint(self, endpoint): + return 'admin.' + super(CustomView, self)._get_endpoint(endpoint) + + view = CustomView() + eq_(view.endpoint, 'admin.customview') diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/test_form_upload.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/test_form_upload.py new file mode 100644 index 00000000..11926f66 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/test_form_upload.py @@ -0,0 +1,284 @@ +import os +import os.path as op + +from io import BytesIO + +from nose.tools import eq_, ok_ + +from flask import Flask, url_for +from flask_admin import form, helpers + + +def _create_temp(): + path = op.join(op.dirname(__file__), 'tmp') + if not op.exists(path): + os.mkdir(path) + + inner = op.join(path, 'inner') + if not op.exists(inner): + os.mkdir(inner) + + return path + + +def safe_delete(path, name): + try: + os.remove(op.join(path, name)) + except: + pass + + +def test_upload_field(): + app = Flask(__name__) + + path = _create_temp() + + def _remove_testfiles(): + safe_delete(path, 'test1.txt') + safe_delete(path, 'test2.txt') + + class TestForm(form.BaseForm): + upload = form.FileUploadField('Upload', base_path=path) + + class TestNoOverWriteForm(form.BaseForm): + upload = form.FileUploadField('Upload', base_path=path, allow_overwrite=False) + + class Dummy(object): + pass + + my_form = TestForm() + eq_(my_form.upload.base_path, path) + + _remove_testfiles() + + dummy = Dummy() + + # Check upload + with app.test_request_context(method='POST', data={'upload': (BytesIO(b'Hello World 1'), 'test1.txt')}): + my_form = TestForm(helpers.get_form_data()) + + ok_(my_form.validate()) + + my_form.populate_obj(dummy) + + eq_(dummy.upload, 'test1.txt') + ok_(op.exists(op.join(path, 'test1.txt'))) + + # Check replace + with app.test_request_context(method='POST', data={'upload': (BytesIO(b'Hello World 2'), 'test2.txt')}): + my_form = TestForm(helpers.get_form_data()) + + ok_(my_form.validate()) + my_form.populate_obj(dummy) + + eq_(dummy.upload, 'test2.txt') + ok_(not op.exists(op.join(path, 'test1.txt'))) + ok_(op.exists(op.join(path, 'test2.txt'))) + + # Check delete + with app.test_request_context(method='POST', data={'_upload-delete': 'checked'}): + + my_form = TestForm(helpers.get_form_data()) + + ok_(my_form.validate()) + + my_form.populate_obj(dummy) + eq_(dummy.upload, None) + + ok_(not op.exists(op.join(path, 'test2.txt'))) + + # Check overwrite + _remove_testfiles() + my_form_ow = TestNoOverWriteForm() + with app.test_request_context(method='POST', data={'upload': (BytesIO(b'Hullo'), 'test1.txt')}): + my_form_ow = TestNoOverWriteForm(helpers.get_form_data()) + + ok_(my_form_ow.validate()) + my_form_ow.populate_obj(dummy) + eq_(dummy.upload, 'test1.txt') + ok_(op.exists(op.join(path, 'test1.txt'))) + + with app.test_request_context(method='POST', data={'upload': (BytesIO(b'Hullo'), 'test1.txt')}): + my_form_ow = TestNoOverWriteForm(helpers.get_form_data()) + + ok_(not my_form_ow.validate()) + + _remove_testfiles() + + +def test_image_upload_field(): + app = Flask(__name__) + + path = _create_temp() + + def _remove_testimages(): + safe_delete(path, 'test1.png') + safe_delete(path, 'test1_thumb.jpg') + safe_delete(path, 'test2.png') + safe_delete(path, 'test2_thumb.jpg') + safe_delete(path, 'test1.jpg') + safe_delete(path, 'test1.jpeg') + safe_delete(path, 'test1.gif') + safe_delete(path, 'test1.png') + safe_delete(path, 'test1.tiff') + + class TestForm(form.BaseForm): + upload = form.ImageUploadField('Upload', + base_path=path, + thumbnail_size=(100, 100, True)) + + class TestNoResizeForm(form.BaseForm): + upload = form.ImageUploadField('Upload', base_path=path, endpoint='test') + + class TestAutoResizeForm(form.BaseForm): + upload = form.ImageUploadField('Upload', + base_path=path, + max_size=(64, 64, True)) + + class Dummy(object): + pass + + my_form = TestForm() + eq_(my_form.upload.base_path, path) + eq_(my_form.upload.endpoint, 'static') + + _remove_testimages() + + dummy = Dummy() + + # Check upload + filename = op.join(op.dirname(__file__), 'data', 'copyleft.png') + + with open(filename, 'rb') as fp: + with app.test_request_context(method='POST', data={'upload': (fp, 'test1.png')}): + my_form = TestForm(helpers.get_form_data()) + + ok_(my_form.validate()) + + my_form.populate_obj(dummy) + + eq_(dummy.upload, 'test1.png') + ok_(op.exists(op.join(path, 'test1.png'))) + ok_(op.exists(op.join(path, 'test1_thumb.png'))) + + # Check replace + with open(filename, 'rb') as fp: + with app.test_request_context(method='POST', data={'upload': (fp, 'test2.png')}): + my_form = TestForm(helpers.get_form_data()) + + ok_(my_form.validate()) + + my_form.populate_obj(dummy) + + eq_(dummy.upload, 'test2.png') + ok_(op.exists(op.join(path, 'test2.png'))) + ok_(op.exists(op.join(path, 'test2_thumb.png'))) + + ok_(not op.exists(op.join(path, 'test1.png'))) + ok_(not op.exists(op.join(path, 'test1_thumb.jpg'))) + + # Check delete + with app.test_request_context(method='POST', data={'_upload-delete': 'checked'}): + my_form = TestForm(helpers.get_form_data()) + + ok_(my_form.validate()) + + my_form.populate_obj(dummy) + eq_(dummy.upload, None) + + ok_(not op.exists(op.join(path, 'test2.png'))) + ok_(not op.exists(op.join(path, 'test2_thumb.png'))) + + # Check upload no-resize + with open(filename, 'rb') as fp: + with app.test_request_context(method='POST', data={'upload': (fp, 'test1.png')}): + my_form = TestNoResizeForm(helpers.get_form_data()) + + ok_(my_form.validate()) + + my_form.populate_obj(dummy) + + eq_(dummy.upload, 'test1.png') + ok_(op.exists(op.join(path, 'test1.png'))) + ok_(not op.exists(op.join(path, 'test1_thumb.png'))) + + # Check upload, auto-resize + filename = op.join(op.dirname(__file__), 'data', 'copyleft.png') + + with open(filename, 'rb') as fp: + with app.test_request_context(method='POST', data={'upload': (fp, 'test1.png')}): + my_form = TestAutoResizeForm(helpers.get_form_data()) + + ok_(my_form.validate()) + + my_form.populate_obj(dummy) + + eq_(dummy.upload, 'test1.png') + ok_(op.exists(op.join(path, 'test1.png'))) + + filename = op.join(op.dirname(__file__), 'data', 'copyleft.tiff') + + with open(filename, 'rb') as fp: + with app.test_request_context(method='POST', data={'upload': (fp, 'test1.tiff')}): + my_form = TestAutoResizeForm(helpers.get_form_data()) + + ok_(my_form.validate()) + + my_form.populate_obj(dummy) + + eq_(dummy.upload, 'test1.jpg') + ok_(op.exists(op.join(path, 'test1.jpg'))) + + # check allowed extensions + for extension in ('gif', 'jpg', 'jpeg', 'png', 'tiff'): + filename = 'copyleft.' + extension + filepath = op.join(op.dirname(__file__), 'data', filename) + with open(filepath, 'rb') as fp: + with app.test_request_context(method='POST', data={'upload': (fp, filename)}): + my_form = TestNoResizeForm(helpers.get_form_data()) + ok_(my_form.validate()) + my_form.populate_obj(dummy) + eq_(dummy.upload, my_form.upload.data.filename) + + # check case-sensitivity for extensions + filename = op.join(op.dirname(__file__), 'data', 'copyleft.jpg') + with open(filename, 'rb') as fp: + with app.test_request_context(method='POST', data={'upload': (fp, 'copyleft.JPG')}): + my_form = TestNoResizeForm(helpers.get_form_data()) + ok_(my_form.validate()) + + +def test_relative_path(): + app = Flask(__name__) + + path = _create_temp() + + def _remove_testfiles(): + safe_delete(path, 'test1.txt') + + class TestForm(form.BaseForm): + upload = form.FileUploadField('Upload', base_path=path, relative_path='inner/') + + class Dummy(object): + pass + + my_form = TestForm() + eq_(my_form.upload.base_path, path) + eq_(my_form.upload.relative_path, 'inner/') + + _remove_testfiles() + + dummy = Dummy() + + # Check upload + with app.test_request_context(method='POST', data={'upload': (BytesIO(b'Hello World 1'), 'test1.txt')}): + my_form = TestForm(helpers.get_form_data()) + + ok_(my_form.validate()) + + my_form.populate_obj(dummy) + + eq_(dummy.upload, 'inner/test1.txt') + ok_(op.exists(op.join(path, 'inner/test1.txt'))) + + eq_(url_for('static', filename=dummy.upload), '/static/inner/test1.txt') diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/test_helpers.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/test_helpers.py new file mode 100644 index 00000000..ad6cb755 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/test_helpers.py @@ -0,0 +1,24 @@ +import flask + +from flask_admin import helpers + + +def test_is_safe_url(): + app = flask.Flask(__name__) + + with app.test_request_context('http://127.0.0.1/admin/car/edit/'): + assert helpers.is_safe_url('http://127.0.0.1/admin/car/') + assert helpers.is_safe_url('https://127.0.0.1/admin/car/') + assert helpers.is_safe_url('/admin/car/') + assert helpers.is_safe_url('admin/car/') + assert helpers.is_safe_url('http////www.google.com') + + assert not helpers.is_safe_url('http://127.0.0.2/admin/car/') + assert not helpers.is_safe_url(' javascript:alert(document.domain)') + assert not helpers.is_safe_url('javascript:alert(document.domain)') + assert not helpers.is_safe_url('javascrip\nt:alert(document.domain)') + assert not helpers.is_safe_url(r'\\www.google.com') + assert not helpers.is_safe_url(r'\\/www.google.com') + assert not helpers.is_safe_url('/////www.google.com') + assert not helpers.is_safe_url('http:///www.google.com') + assert not helpers.is_safe_url('https:////www.google.com') diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/test_model.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/test_model.py new file mode 100644 index 00000000..03d2eac9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/test_model.py @@ -0,0 +1,815 @@ +import wtforms + +from nose.tools import eq_, ok_ + +from flask import Flask + +try: + from werkzeug.middleware.dispatcher import DispatcherMiddleware +except ImportError: + from werkzeug.wsgi import DispatcherMiddleware +from werkzeug.test import Client + +from wtforms import fields + +from flask_admin import Admin, form +from flask_admin._compat import iteritems, itervalues +from flask_admin.model import base, filters +from flask_admin.model.template import macro + + +def wtforms2_and_up(func): + """Decorator for skipping test if wtforms <2 + """ + if int(wtforms.__version__[0]) < 2: + func.__test__ = False + return func + + +class Model(object): + def __init__(self, id=None, c1=1, c2=2, c3=3): + self.id = id + self.col1 = c1 + self.col2 = c2 + self.col3 = c3 + + +class Form(form.BaseForm): + col1 = fields.StringField() + col2 = fields.StringField() + col3 = fields.StringField() + + +class SimpleFilter(filters.BaseFilter): + def apply(self, query): + query._applied = True + return query + + def operation(self): + return 'test' + + +class MockModelView(base.BaseModelView): + def __init__(self, model, data=None, name=None, category=None, + endpoint=None, url=None, **kwargs): + # Allow to set any attributes from parameters + for k, v in iteritems(kwargs): + setattr(self, k, v) + + super(MockModelView, self).__init__(model, name, category, endpoint, url) + + self.created_models = [] + self.updated_models = [] + self.deleted_models = [] + + self.search_arguments = [] + + if data is None: + self.all_models = {1: Model(1), 2: Model(2)} + else: + self.all_models = data + + self.last_id = len(self.all_models) + 1 + + # Scaffolding + def get_pk_value(self, model): + return model.id + + def scaffold_list_columns(self): + columns = ['col1', 'col2', 'col3'] + + if self.column_exclude_list: + return filter(lambda x: x not in self.column_exclude_list, columns) + + return columns + + def init_search(self): + return bool(self.column_searchable_list) + + def scaffold_filters(self, name): + return [SimpleFilter(name)] + + def scaffold_sortable_columns(self): + return ['col1', 'col2', 'col3'] + + def scaffold_form(self): + return Form + + # Data + def get_list(self, page, sort_field, sort_desc, search, filters, + page_size=None): + self.search_arguments.append((page, sort_field, sort_desc, search, filters)) + return len(self.all_models), itervalues(self.all_models) + + def get_one(self, id): + return self.all_models.get(int(id)) + + def create_model(self, form): + model = Model(self.last_id) + self.last_id += 1 + + form.populate_obj(model) + self.created_models.append(model) + self.all_models[model.id] = model + + return True + + def update_model(self, form, model): + form.populate_obj(model) + self.updated_models.append(model) + return True + + def delete_model(self, model): + self.deleted_models.append(model) + return True + + +def setup(): + app = Flask(__name__) + app.config['CSRF_ENABLED'] = False + app.secret_key = '1' + admin = Admin(app) + + return app, admin + + +def test_mockview(): + app, admin = setup() + + view = MockModelView(Model) + admin.add_view(view) + + eq_(view.model, Model) + + eq_(view.name, 'Model') + eq_(view.endpoint, 'model') + + # Verify scaffolding + eq_(view._sortable_columns, ['col1', 'col2', 'col3']) + eq_(view._create_form_class, Form) + eq_(view._edit_form_class, Form) + eq_(view._search_supported, False) + eq_(view._filters, None) + + client = app.test_client() + + # Make model view requests + rv = client.get('/admin/model/') + eq_(rv.status_code, 200) + + # Test model creation view + rv = client.get('/admin/model/new/') + eq_(rv.status_code, 200) + + rv = client.post('/admin/model/new/', + data=dict(col1='test1', col2='test2', col3='test3')) + eq_(rv.status_code, 302) + eq_(len(view.created_models), 1) + + model = view.created_models.pop() + eq_(model.id, 3) + eq_(model.col1, 'test1') + eq_(model.col2, 'test2') + eq_(model.col3, 'test3') + + # Try model edit view + rv = client.get('/admin/model/edit/?id=3') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('test1' in data) + + rv = client.post('/admin/model/edit/?id=3', + data=dict(col1='test!', col2='test@', col3='test#')) + eq_(rv.status_code, 302) + eq_(len(view.updated_models), 1) + + model = view.updated_models.pop() + eq_(model.col1, 'test!') + eq_(model.col2, 'test@') + eq_(model.col3, 'test#') + + rv = client.get('/admin/model/edit/?id=4') + eq_(rv.status_code, 302) + + # Attempt to delete model + rv = client.post('/admin/model/delete/?id=3') + eq_(rv.status_code, 302) + eq_(rv.headers['location'], 'http://localhost/admin/model/') + + # Create a dispatched application to test that edit view's "save and + # continue" functionality works when app is not located at root + dummy_app = Flask('dummy_app') + dispatched_app = DispatcherMiddleware(dummy_app, {'/dispatched': app}) + dispatched_client = Client(dispatched_app) + + app_iter, status, headers = dispatched_client.post( + '/dispatched/admin/model/edit/?id=3', + data=dict(col1='another test!', col2='test@', col3='test#', _continue_editing='True')) + + eq_(status, '302 FOUND') + eq_(headers['Location'], 'http://localhost/dispatched/admin/model/edit/?id=3') + model = view.updated_models.pop() + eq_(model.col1, 'another test!') + + +def test_permissions(): + app, admin = setup() + + view = MockModelView(Model) + admin.add_view(view) + + client = app.test_client() + + view.can_create = False + rv = client.get('/admin/model/new/') + eq_(rv.status_code, 302) + + view.can_edit = False + rv = client.get('/admin/model/edit/?id=1') + eq_(rv.status_code, 302) + + view.can_delete = False + rv = client.post('/admin/model/delete/?id=1') + eq_(rv.status_code, 302) + + +def test_templates(): + app, admin = setup() + + view = MockModelView(Model) + admin.add_view(view) + + client = app.test_client() + + view.list_template = 'mock.html' + view.create_template = 'mock.html' + view.edit_template = 'mock.html' + + rv = client.get('/admin/model/') + eq_(rv.data, b'Success!') + + rv = client.get('/admin/model/new/') + eq_(rv.data, b'Success!') + + rv = client.get('/admin/model/edit/?id=1') + eq_(rv.data, b'Success!') + + +def test_list_columns(): + app, admin = setup() + + view = MockModelView(Model, + column_list=['col1', 'col3'], + column_labels=dict(col1='Column1')) + admin.add_view(view) + + eq_(len(view._list_columns), 2) + eq_(view._list_columns, [('col1', 'Column1'), ('col3', 'Col3')]) + + client = app.test_client() + + rv = client.get('/admin/model/') + data = rv.data.decode('utf-8') + ok_('Column1' in data) + ok_('Col2' not in data) + + +def test_exclude_columns(): + app, admin = setup() + + view = MockModelView(Model, column_exclude_list=['col2']) + admin.add_view(view) + + eq_(view._list_columns, [('col1', 'Col1'), ('col3', 'Col3')]) + + client = app.test_client() + + rv = client.get('/admin/model/') + data = rv.data.decode('utf-8') + ok_('Col1' in data) + ok_('Col2' not in data) + + +def test_sortable_columns(): + app, admin = setup() + + view = MockModelView(Model, column_sortable_list=['col1', ('col2', 'test1')]) + admin.add_view(view) + + eq_(view._sortable_columns, dict(col1='col1', col2='test1')) + + +def test_column_searchable_list(): + app, admin = setup() + + view = MockModelView(Model, column_searchable_list=['col1', 'col2']) + admin.add_view(view) + + eq_(view._search_supported, True) + + # TODO: Make calls with search + + +def test_column_filters(): + app, admin = setup() + + view = MockModelView(Model, column_filters=['col1', 'col2']) + admin.add_view(view) + + eq_(len(view._filters), 2) + eq_(view._filters[0].name, 'col1') + eq_(view._filters[1].name, 'col2') + + eq_([(f['index'], f['operation']) for f in view._filter_groups[u'col1']], [(0, 'test')]) + eq_([(f['index'], f['operation']) for f in view._filter_groups[u'col2']], [(1, 'test')]) + + # TODO: Make calls with filters + + +def test_filter_list_callable(): + app, admin = setup() + + flt = SimpleFilter('test', options=lambda: [('1', 'Test 1'), ('2', 'Test 2')]) + + view = MockModelView(Model, column_filters=[flt]) + admin.add_view(view) + + opts = flt.get_options(view) + eq_(len(opts), 2) + eq_(opts, [('1', 'Test 1'), ('2', 'Test 2')]) + + +def test_form(): + # TODO: form_columns + # TODO: form_excluded_columns + # TODO: form_args + # TODO: form_widget_args + pass + + +@wtforms2_and_up +def test_csrf(): + class SecureModelView(MockModelView): + form_base_class = form.SecureForm + + def scaffold_form(self): + return form.SecureForm + + def get_csrf_token(data): + data = data.split('name="csrf_token" type="hidden" value="')[1] + token = data.split('"')[0] + return token + + app, admin = setup() + + view = SecureModelView(Model, endpoint='secure') + admin.add_view(view) + + client = app.test_client() + + ################ + # create_view + ################ + rv = client.get('/admin/secure/new/') + eq_(rv.status_code, 200) + ok_(u'name="csrf_token"' in rv.data.decode('utf-8')) + + csrf_token = get_csrf_token(rv.data.decode('utf-8')) + + # Create without CSRF token + rv = client.post('/admin/secure/new/', data=dict(name='test1')) + eq_(rv.status_code, 200) + + # Create with CSRF token + rv = client.post('/admin/secure/new/', data=dict(name='test1', + csrf_token=csrf_token)) + eq_(rv.status_code, 302) + + ############### + # edit_view + ############### + rv = client.get('/admin/secure/edit/?url=%2Fadmin%2Fsecure%2F&id=1') + eq_(rv.status_code, 200) + ok_(u'name="csrf_token"' in rv.data.decode('utf-8')) + + csrf_token = get_csrf_token(rv.data.decode('utf-8')) + + # Edit without CSRF token + rv = client.post('/admin/secure/edit/?url=%2Fadmin%2Fsecure%2F&id=1', + data=dict(name='test1')) + eq_(rv.status_code, 200) + + # Edit with CSRF token + rv = client.post('/admin/secure/edit/?url=%2Fadmin%2Fsecure%2F&id=1', + data=dict(name='test1', csrf_token=csrf_token)) + eq_(rv.status_code, 302) + + ################ + # delete_view + ################ + rv = client.get('/admin/secure/') + eq_(rv.status_code, 200) + ok_(u'name="csrf_token"' in rv.data.decode('utf-8')) + + csrf_token = get_csrf_token(rv.data.decode('utf-8')) + + # Delete without CSRF token, test validation errors + rv = client.post('/admin/secure/delete/', + data=dict(id="1", url="/admin/secure/"), follow_redirects=True) + eq_(rv.status_code, 200) + ok_(u'Record was successfully deleted.' not in rv.data.decode('utf-8')) + ok_(u'Failed to delete record.' in rv.data.decode('utf-8')) + + # Delete with CSRF token + rv = client.post('/admin/secure/delete/', + data=dict(id="1", url="/admin/secure/", csrf_token=csrf_token), + follow_redirects=True) + eq_(rv.status_code, 200) + ok_(u'Record was successfully deleted.' in rv.data.decode('utf-8')) + + ################ + # actions + ################ + rv = client.get('/admin/secure/') + eq_(rv.status_code, 200) + ok_(u'name="csrf_token"' in rv.data.decode('utf-8')) + + csrf_token = get_csrf_token(rv.data.decode('utf-8')) + + # Delete without CSRF token, test validation errors + rv = client.post('/admin/secure/action/', + data=dict(rowid='1', url='/admin/secure/', action='delete'), + follow_redirects=True) + eq_(rv.status_code, 200) + ok_(u'Record was successfully deleted.' not in rv.data.decode('utf-8')) + ok_(u'Failed to perform action.' in rv.data.decode('utf-8')) + + +def test_custom_form(): + app, admin = setup() + + class TestForm(form.BaseForm): + pass + + view = MockModelView(Model, form=TestForm) + admin.add_view(view) + + eq_(view._create_form_class, TestForm) + eq_(view._edit_form_class, TestForm) + + ok_(not hasattr(view._create_form_class, 'col1')) + + +def test_modal_edit(): + # bootstrap 2 - test edit_modal + app_bs2 = Flask(__name__) + admin_bs2 = Admin(app_bs2, template_mode="bootstrap2") + + edit_modal_on = MockModelView(Model, edit_modal=True, + endpoint="edit_modal_on") + edit_modal_off = MockModelView(Model, edit_modal=False, + endpoint="edit_modal_off") + create_modal_on = MockModelView(Model, create_modal=True, + endpoint="create_modal_on") + create_modal_off = MockModelView(Model, create_modal=False, + endpoint="create_modal_off") + admin_bs2.add_view(edit_modal_on) + admin_bs2.add_view(edit_modal_off) + admin_bs2.add_view(create_modal_on) + admin_bs2.add_view(create_modal_off) + + client_bs2 = app_bs2.test_client() + + # bootstrap 2 - ensure modal window is added when edit_modal is enabled + rv = client_bs2.get('/admin/edit_modal_on/') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('fa_modal_window' in data) + + # bootstrap 2 - test edit modal disabled + rv = client_bs2.get('/admin/edit_modal_off/') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('fa_modal_window' not in data) + + # bootstrap 2 - ensure modal window is added when create_modal is enabled + rv = client_bs2.get('/admin/create_modal_on/') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('fa_modal_window' in data) + + # bootstrap 2 - test create modal disabled + rv = client_bs2.get('/admin/create_modal_off/') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('fa_modal_window' not in data) + + # bootstrap 3 + app_bs3 = Flask(__name__) + admin_bs3 = Admin(app_bs3, template_mode="bootstrap3") + + admin_bs3.add_view(edit_modal_on) + admin_bs3.add_view(edit_modal_off) + admin_bs3.add_view(create_modal_on) + admin_bs3.add_view(create_modal_off) + + client_bs3 = app_bs3.test_client() + + # bootstrap 3 - ensure modal window is added when edit_modal is enabled + rv = client_bs3.get('/admin/edit_modal_on/') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('fa_modal_window' in data) + + # bootstrap 3 - test modal disabled + rv = client_bs3.get('/admin/edit_modal_off/') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('fa_modal_window' not in data) + + # bootstrap 3 - ensure modal window is added when edit_modal is enabled + rv = client_bs3.get('/admin/create_modal_on/') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('fa_modal_window' in data) + + # bootstrap 3 - test modal disabled + rv = client_bs3.get('/admin/create_modal_off/') + eq_(rv.status_code, 200) + data = rv.data.decode('utf-8') + ok_('fa_modal_window' not in data) + + +def check_class_name(): + class DummyView(MockModelView): + pass + + view = DummyView(Model) + eq_(view.name, 'Dummy View') + + +def test_export_csv(): + app, admin = setup() + client = app.test_client() + + # test redirect when csv export is disabled + view = MockModelView(Model, column_list=['col1', 'col2'], endpoint="test") + admin.add_view(view) + + rv = client.get('/admin/test/export/csv/') + eq_(rv.status_code, 302) + + # basic test of csv export with a few records + view_data = { + 1: Model(1, "col1_1", "col2_1"), + 2: Model(2, "col1_2", "col2_2"), + 3: Model(3, "col1_3", "col2_3"), + } + + view = MockModelView(Model, view_data, can_export=True, + column_list=['col1', 'col2']) + admin.add_view(view) + + rv = client.get('/admin/model/export/csv/') + data = rv.data.decode('utf-8') + eq_(rv.mimetype, 'text/csv') + eq_(rv.status_code, 200) + ok_("Col1,Col2\r\n" + "col1_1,col2_1\r\n" + "col1_2,col2_2\r\n" + "col1_3,col2_3\r\n" == data) + + # test explicit use of column_export_list + view = MockModelView(Model, view_data, can_export=True, + column_list=['col1', 'col2'], + column_export_list=['id', 'col1', 'col2'], + endpoint='exportinclusion') + admin.add_view(view) + + rv = client.get('/admin/exportinclusion/export/csv/') + data = rv.data.decode('utf-8') + eq_(rv.mimetype, 'text/csv') + eq_(rv.status_code, 200) + ok_("Id,Col1,Col2\r\n" + "1,col1_1,col2_1\r\n" + "2,col1_2,col2_2\r\n" + "3,col1_3,col2_3\r\n" == data) + + # test explicit use of column_export_exclude_list + view = MockModelView(Model, view_data, can_export=True, + column_list=['col1', 'col2'], + column_export_exclude_list=['col2'], + endpoint='exportexclusion') + admin.add_view(view) + + rv = client.get('/admin/exportexclusion/export/csv/') + data = rv.data.decode('utf-8') + eq_(rv.mimetype, 'text/csv') + eq_(rv.status_code, 200) + ok_("Col1\r\n" + "col1_1\r\n" + "col1_2\r\n" + "col1_3\r\n" == data) + + # test utf8 characters in csv export + view_data[4] = Model(1, u'\u2013ut8_1\u2013', u'\u2013utf8_2\u2013') + view = MockModelView(Model, view_data, can_export=True, + column_list=['col1', 'col2'], endpoint="utf8") + admin.add_view(view) + + rv = client.get('/admin/utf8/export/csv/') + data = rv.data.decode('utf-8') + eq_(rv.status_code, 200) + ok_(u'\u2013ut8_1\u2013,\u2013utf8_2\u2013\r\n' in data) + + # test None type, integer type, column_labels, and column_formatters + view_data = { + 1: Model(1, "col1_1", 1), + 2: Model(2, "col1_2", 2), + 3: Model(3, None, 3), + } + + view = MockModelView( + Model, view_data, can_export=True, column_list=['col1', 'col2'], + column_labels={'col1': 'Str Field', 'col2': 'Int Field'}, + column_formatters=dict(col2=lambda v, c, m, p: m.col2 * 2), + endpoint="types_and_formatters" + ) + admin.add_view(view) + + rv = client.get('/admin/types_and_formatters/export/csv/') + data = rv.data.decode('utf-8') + eq_(rv.status_code, 200) + ok_("Str Field,Int Field\r\n" + "col1_1,2\r\n" + "col1_2,4\r\n" + ",6\r\n" == data) + + # test column_formatters_export and column_formatters_export + type_formatters = {type(None): lambda view, value: "null"} + + view = MockModelView( + Model, view_data, can_export=True, column_list=['col1', 'col2'], + column_formatters_export=dict(col2=lambda v, c, m, p: m.col2 * 3), + column_formatters=dict(col2=lambda v, c, m, p: m.col2 * 2), # overridden + column_type_formatters_export=type_formatters, + endpoint="export_types_and_formatters" + ) + admin.add_view(view) + + rv = client.get('/admin/export_types_and_formatters/export/csv/') + data = rv.data.decode('utf-8') + eq_(rv.status_code, 200) + ok_("Col1,Col2\r\n" + "col1_1,3\r\n" + "col1_2,6\r\n" + "null,9\r\n" == data) + + # Macros are not implemented for csv export yet and will throw an error + view = MockModelView( + Model, can_export=True, column_list=['col1', 'col2'], + column_formatters=dict(col1=macro('render_macro')), + endpoint="macro_exception" + ) + admin.add_view(view) + + rv = client.get('/admin/macro_exception/export/csv/') + data = rv.data.decode('utf-8') + eq_(rv.status_code, 500) + + # We should be able to specify column_formatters_export + # and not get an exception if a column_formatter is using a macro + def export_formatter(v, c, m, p): + return m.col1 if m else '' + + view = MockModelView( + Model, view_data, can_export=True, column_list=['col1', 'col2'], + column_formatters=dict(col1=macro('render_macro')), + column_formatters_export=dict(col1=export_formatter), + endpoint="macro_exception_formatter_override" + ) + admin.add_view(view) + + rv = client.get('/admin/macro_exception_formatter_override/export/csv/') + data = rv.data.decode('utf-8') + eq_(rv.status_code, 200) + ok_("Col1,Col2\r\n" + "col1_1,1\r\n" + "col1_2,2\r\n" + ",3\r\n" == data) + + # We should not get an exception if a column_formatter is + # using a macro but it is on the column_export_exclude_list + view = MockModelView( + Model, view_data, can_export=True, column_list=['col1', 'col2'], + column_formatters=dict(col1=macro('render_macro')), + column_export_exclude_list=['col1'], + endpoint="macro_exception_exclude_override" + ) + admin.add_view(view) + + rv = client.get('/admin/macro_exception_exclude_override/export/csv/') + data = rv.data.decode('utf-8') + eq_(rv.status_code, 200) + ok_("Col2\r\n" + "1\r\n" + "2\r\n" + "3\r\n" == data) + + # When we use column_export_list to hide the macro field + # we should not get an exception + view = MockModelView( + Model, view_data, can_export=True, column_list=['col1', 'col2'], + column_formatters=dict(col1=macro('render_macro')), + column_export_list=['col2'], + endpoint="macro_exception_list_override" + ) + admin.add_view(view) + + rv = client.get('/admin/macro_exception_list_override/export/csv/') + data = rv.data.decode('utf-8') + eq_(rv.status_code, 200) + ok_("Col2\r\n" + "1\r\n" + "2\r\n" + "3\r\n" == data) + + # If they define a macro on the column_formatters_export list + # then raise an exception + view = MockModelView( + Model, view_data, can_export=True, column_list=['col1', 'col2'], + column_formatters=dict(col1=macro('render_macro')), + endpoint="macro_exception_macro_override" + ) + admin.add_view(view) + + rv = client.get('/admin/macro_exception_macro_override/export/csv/') + data = rv.data.decode('utf-8') + eq_(rv.status_code, 500) + + +def test_list_row_actions(): + app, admin = setup() + client = app.test_client() + + from flask_admin.model import template + + # Test default actions + view = MockModelView(Model, endpoint='test') + admin.add_view(view) + + actions = view.get_list_row_actions() + ok_(isinstance(actions[0], template.EditRowAction)) + ok_(isinstance(actions[1], template.DeleteRowAction)) + + rv = client.get('/admin/test/') + eq_(rv.status_code, 200) + + # Test default actions + view = MockModelView(Model, endpoint='test1', can_edit=False, can_delete=False, can_view_details=True) + admin.add_view(view) + + actions = view.get_list_row_actions() + eq_(len(actions), 1) + ok_(isinstance(actions[0], template.ViewRowAction)) + + rv = client.get('/admin/test1/') + eq_(rv.status_code, 200) + + # Test popups + view = MockModelView(Model, endpoint='test2', + can_view_details=True, + details_modal=True, + edit_modal=True) + admin.add_view(view) + + actions = view.get_list_row_actions() + ok_(isinstance(actions[0], template.ViewPopupRowAction)) + ok_(isinstance(actions[1], template.EditPopupRowAction)) + ok_(isinstance(actions[2], template.DeleteRowAction)) + + rv = client.get('/admin/test2/') + eq_(rv.status_code, 200) + + # Test custom views + view = MockModelView(Model, endpoint='test3', + column_extra_row_actions=[ + template.LinkRowAction('glyphicon glyphicon-off', 'http://localhost/?id={row_id}'), + template.EndpointLinkRowAction('glyphicon glyphicon-test', 'test1.index_view') + ]) + admin.add_view(view) + + actions = view.get_list_row_actions() + ok_(isinstance(actions[0], template.EditRowAction)) + ok_(isinstance(actions[1], template.DeleteRowAction)) + ok_(isinstance(actions[2], template.LinkRowAction)) + ok_(isinstance(actions[3], template.EndpointLinkRowAction)) + + rv = client.get('/admin/test3/') + eq_(rv.status_code, 200) + + data = rv.data.decode('utf-8') + + ok_('glyphicon-off' in data) + ok_('http://localhost/?id=' in data) + ok_('glyphicon-test' in data) diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tests/test_tools.py b/.venv/lib/python3.8/site-packages/flask_admin/tests/test_tools.py new file mode 100644 index 00000000..fd4b20a7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tests/test_tools.py @@ -0,0 +1,19 @@ +from nose.tools import eq_, ok_ + +from flask_admin import tools + + +def test_encode_decode(): + eq_(tools.iterdecode(tools.iterencode([1, 2, 3])), (u'1', u'2', u'3')) + + eq_(tools.iterdecode(tools.iterencode([',', ',', ','])), (u',', u',', u',')) + + eq_(tools.iterdecode(tools.iterencode(['.hello.,', ',', ','])), (u'.hello.,', u',', u',')) + + eq_(tools.iterdecode(tools.iterencode(['.....,,,.,,..,.,,.,'])), (u'.....,,,.,,..,.,,.,',)) + + eq_(tools.iterdecode(tools.iterencode([])), tuple()) + + # Malformed inputs should not crash + ok_(tools.iterdecode('.')) + eq_(tools.iterdecode(','), (u'', u'')) diff --git a/.venv/lib/python3.8/site-packages/flask_admin/tools.py b/.venv/lib/python3.8/site-packages/flask_admin/tools.py new file mode 100644 index 00000000..b0533aae --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/tools.py @@ -0,0 +1,152 @@ +import sys +import traceback + +# Python 3 compatibility +from ._compat import reduce, as_unicode + +CHAR_ESCAPE = u'.' +CHAR_SEPARATOR = u',' + + +def import_module(name, required=True): + """ + Import module by name + + :param name: + Module name + :param required: + If set to `True` and module was not found - will throw exception. + If set to `False` and module was not found - will return None. + Default is `True`. + """ + try: + __import__(name, globals(), locals(), []) + except ImportError: + if not required and module_not_found(): + return None + raise + return sys.modules[name] + + +def import_attribute(name): + """ + Import attribute using string reference. + + :param name: + String reference. + + Raises ImportError or AttributeError if module or attribute do not exist. + + Example:: + + import_attribute('a.b.c.foo') + + """ + path, attr = name.rsplit('.', 1) + module = __import__(path, globals(), locals(), [attr]) + + return getattr(module, attr) + + +def module_not_found(additional_depth=0): + """ + Checks if ImportError was raised because module does not exist or + something inside it raised ImportError + + :param additional_depth: + supply int of depth of your call if you're not doing + import on the same level of code - f.e., if you call function, which is + doing import, you should pass 1 for single additional level of depth + """ + tb = sys.exc_info()[2] + if len(traceback.extract_tb(tb)) > (1 + additional_depth): + return False + return True + + +def rec_getattr(obj, attr, default=None): + """ + Recursive getattr. + + :param attr: + Dot delimited attribute name + :param default: + Default value + + Example:: + + rec_getattr(obj, 'a.b.c') + """ + try: + return reduce(getattr, attr.split('.'), obj) + except AttributeError: + return default + + +def get_dict_attr(obj, attr, default=None): + """ + Get attribute of the object without triggering its __getattr__. + + :param obj: + Object + :param attr: + Attribute name + :param default: + Default value if attribute was not found + """ + for obj in [obj] + obj.__class__.mro(): + if attr in obj.__dict__: + return obj.__dict__[attr] + + return default + + +def escape(value): + return (as_unicode(value) + .replace(CHAR_ESCAPE, CHAR_ESCAPE + CHAR_ESCAPE) + .replace(CHAR_SEPARATOR, CHAR_ESCAPE + CHAR_SEPARATOR)) + + +def iterencode(iter): + """ + Encode enumerable as compact string representation. + + :param iter: + Enumerable + """ + return ','.join(as_unicode(v) + .replace(CHAR_ESCAPE, CHAR_ESCAPE + CHAR_ESCAPE) + .replace(CHAR_SEPARATOR, CHAR_ESCAPE + CHAR_SEPARATOR) + for v in iter) + + +def iterdecode(value): + """ + Decode enumerable from string presentation as a tuple + """ + + if not value: + return tuple() + + result = [] + accumulator = u'' + + escaped = False + + for c in value: + if not escaped: + if c == CHAR_ESCAPE: + escaped = True + continue + elif c == CHAR_SEPARATOR: + result.append(accumulator) + accumulator = u'' + continue + else: + escaped = False + + accumulator += c + + result.append(accumulator) + + return tuple(result) diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/README.md b/.venv/lib/python3.8/site-packages/flask_admin/translations/README.md new file mode 100644 index 00000000..01e1da23 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/README.md @@ -0,0 +1,2 @@ +Translations are ONLY handled through Crowdin! +https://crowdin.com/project/flask-admin diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/__init__.py b/.venv/lib/python3.8/site-packages/flask_admin/translations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_admin/translations/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..6e5b2761 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/af/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/af/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..65e1224b Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/af/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/af/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/af/LC_MESSAGES/admin.po new file mode 100644 index 00000000..3cf6f570 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/af/LC_MESSAGES/admin.po @@ -0,0 +1,661 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Afrikaans\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: af\n" +"X-Crowdin-File: admin.pot\n" +"Language: af_ZA\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Tuiste" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "Cli: Ongeldige opdrag." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Lêer te laai" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Lêer vereis." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Ongeldig lêer tipe." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Inhoud" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Ongeldige naam" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Naam" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "Lêer \"%(name)s\" bestaan reeds." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Toestemming geweier." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Lêer oplaai is afgeskakel." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Suksesvol gestoor lêer: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Kon lêer te stoor: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Laai Lêer" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Gids skepping is afgeskakel." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Suksesvol geskep gids: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Kon gids te skep: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Skep Gids" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Skrap is afgeskakel." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Gids skrap is afgeskakel." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Gids \"%(path)s\" is suksesvol verwyder." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Kon directory verwyder: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Lêer \"%(name)s\" is suksesvol verwyder." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Kon lêer verwyder: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Herbenaming is afgeskakel." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Pad bestaan nie." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Suksesvol herdoop \"%(src)s\" na \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Versuim om te hernoem: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Hernoem %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Fout tydens stoor veranderinge aan %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Wysigings aan %(name)s suksesvol gestoor." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Fout lees %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Onverwagte fout met die lees van %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "Kan %(name)s nie wysig." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Redigering %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Verwyder" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Is jy seker jy wil hierdie lêers verwyder?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Lêer skrap is afgeskakel." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Wysig" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "gelyk" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "nie gelyk" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "bevat" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "nie bevat" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "groter as" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "kleiner as" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "leë" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "in lys" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "nie in die lys" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "nie tussen" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Kon model kry. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Kon rekord te skep. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Kon rekord te werk. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Kon rekord verwyder. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Is jy seker jy wil gekies rekords skrap?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Rekord is suksesvol verwyder." +msgstr[1] "%(count)s rekords is suksesvol verwyder." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Versuim om rekords te skrap. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Nie 'n geldige keuse" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Bestaan reeds." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "Ten minste %(num)d item vereis" +msgstr[1] "Ten minste %(num)d items vereis" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Integriteit fout. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Ongeldige tyd formaat" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Ongeldig Choice: kon nie dwing" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "Ongeldig JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Ongeldig lêer uitbreiding" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "Lêer \"%s\" bestaan reeds." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Daar is geen items in die tabel." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Ongeldig Filter Waarde: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Rekord is suksesvol geskep." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Rekord bestaan nie." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Rekord suksesvol gestoor." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "" + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Ja" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "Geen" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "tussen" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "View Record" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Rekord Wysig" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "Met geselekteerde" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Red" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Kanselleer" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Wortel" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Sorteer %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Hernoem Lêer" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Is jy seker jy wil \\'%(name)s\\' rekursief verwyder?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Is jy seker jy wil verwyder \\'%(name)s \\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Kies ten minste een lêer." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Lys" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Skep" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Filtreer" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Verwyder?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Voeg" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Filter Voeg" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Toepassing" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Filters Herstel" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Soek" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Skep Nuwe Rekord" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Kies alle rekords" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Kies rekord" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Kies ten minste een rekord." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Is jy seker jy wil hierdie rekord verwyder?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/ar/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/ar/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..a29d3e41 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/ar/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/ar/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/ar/LC_MESSAGES/admin.po new file mode 100644 index 00000000..a864e1d1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/ar/LC_MESSAGES/admin.po @@ -0,0 +1,669 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Arabic\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=6; plural=(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: ar\n" +"X-Crowdin-File: admin.pot\n" +"Language: ar_SA\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "الصفحة الرئيسية" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "Cli: أمر غير صالح." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "ملف لتحميله" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "الملف المطلوب." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "امتداد الملف غير صالح." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "محتوى السكريبت" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "اسم غير صالح" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "الإسم" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "ملف \"%(name)s\" موجود بالفعل." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "ممنوع الدخول." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "تحميل الملف معطل." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "ملف تم حفظه بنجاح: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "فشل في حفظ الملف: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "تحميل الملف" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "يتم تعطيل إنشاء الدليل." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "الدليل الذي تم إنشاؤه بنجاح: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "فشل إنشاء الدليل: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "إنشاء دليل" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "يتم تعطيل الحذف." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "يتم تعطيل حذف الدليل." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "تم بنجاح حذف الدليل \"%(path)s\"." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "فشل في حذف الدليل: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "تم بنجاح حذف الملف \"%(name)s\"." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "فشل في حذف الملف: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "إعادة تسمية معطل." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "المسار غير موجود." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "أعيدت تسميته بنجاح \"%(src)s\" إلى \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "فشل إعادة تسمية: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "إعادة تسمية %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "حدث خطأ أثناء حفظ التغييرات إلى %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "التغييرات إلى %(name)s حفظه بنجاح." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "خطأ القراءة %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "حدث خطأ غير متوقع أثناء القراءة من %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "لا يمكن تحرير %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "تحرير %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "مسح" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "هل تريد فعلا حذف %d من الملفات؟?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "يتم تعطيل حذف الملف." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "عدل" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "يساوي" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "لا تساوي" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "يحتوي على" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "لا تحتوي علي" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "اكبر من" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "أصغر من" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "فارغ" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "في قائمة" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "غير موجود في قائمة" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "ليس بين" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "فشل في الحصول على نموذج. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "فشل في إنشاء سجل. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "فشل في إنشاء سجل. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "فشل في حذف السجل. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "هل أنت متأكد من أنك تريد حذف السجلات المحددة؟?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "تم بنجاح حذف السجلات %(count)s." +msgstr[1] "تم حذف السجل بنجاح." +msgstr[2] "تم بنجاح حذف السجلات %(count)s." +msgstr[3] "تم بنجاح حذف السجلات %(count)s." +msgstr[4] "تم بنجاح حذف السجلات %(count)s." +msgstr[5] "تم بنجاح حذف السجلات %(count)s." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "فشل في حذف السجل. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "ليس خياراً صالحاً" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "موجود بالفعل." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "" +msgstr[1] "" +msgstr[2] "" +msgstr[3] "" +msgstr[4] "" +msgstr[5] "" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "خطأ سلامة. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "تنسيق الوقت غير صالح" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "خيار غير صالح: لا يمكن إرغام" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "JSON غير صالح" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "ملحق الملف غير صالح" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "ملف \"%s\" موجود بالفعل." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "لا توجد أي عناصر في الجدول." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "قيمة عامل التصفية غير صالح: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "تم إنشاء السجل بنجاح." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "السجل غير موجود." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "تم حفظ السجل بنجاح." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "" + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "نعم" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "لا" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "بين" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "عرض السجل" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "تحرير سجل" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "مع تحديد" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "احفظ" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "إالغاء" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "الجذر" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "فرز حسب %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "إعادة تسمية الملف" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "هل أنت متأكد من أنك تريد حذف \\'%(name)s\\' بشكل متكرر؟" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "هل أنت متأكد من أنك تريد حذف \\'%(name)s\\ '؟" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "الرجاء تحديد ملف واحد على الأقل." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "قائمة" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "إنشاء" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "الذهاب »" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "مسح?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "إضافة" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "إضافة عامل تصفية" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "تطبيق" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "إعادة تعيين عوامل تصفية" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "البحث" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "قم بإنشاء سجل جديد" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "تحديد كافة السجلات" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "حدد السجل" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "الرجاء تحديد سجل واحد على الأقل." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "هل أنت متأكد من أنك تريد حذف هذا السجل؟" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/be/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/be/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..9322646c Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/be/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/be/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/be/LC_MESSAGES/admin.po new file mode 100644 index 00000000..bf81ed08 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/be/LC_MESSAGES/admin.po @@ -0,0 +1,663 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-13 09:18-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Belarusian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: be\n" +"X-Crowdin-File: admin.pot\n" +"Language: be_BY\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Галоўная" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "Cli: хібны загад." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Файл для ладавання" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Патрабуецца файл." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Хібны тып файлу." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Змесціва" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Хібная назва" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Назва" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "Файл \"%(name)s\" ужо йснуе." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Бракуе дазволу." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Ладаванне файлаў адключанае." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Файл паспяхова захаваны: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Памылка захавання файлу: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Заладаваць файл" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Стварэнне тэчак адключанае." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Тэчка паспяхова створаная: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Памылка стварэння тэчкі: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Стварыць тэчку" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Выдаленне адключанае." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Выдаленне тэчак адключанае." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Тэчка \"%(path)s\" паспяхова выдаленая." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Памылка выдалення тэчкі: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Файл \"%(name)s\" паспяхова выдалены." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Памылка выдалення файлу: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Перайменаванне адключанае." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Шлях не йснуе." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Паспяхова змененае імя з \"%(src)s\" у \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Памылка перайменавання: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Перайменаваць %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Памылка захавання зменаў у %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Змены ў %(name)s паспяхова захаваныя." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Памылка чытання %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Непрадугледжаная памылка падчас чытання з %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "Немагчыма рэдагаваць %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Рэдагаванне %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Выдаліць" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Вы дакладна хочаце выдаліць гэтыя файлы?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Выдаленне файлаў адключанае." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Рэдагаваць" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "Дзеянне з непустымі тэчкамі немагчымае" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "роўны" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "няроўны" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "утрымлівае" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "ня ўтрымлівае" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "большы за" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "меншы за" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "пусты" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "у спісе" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "ня ў спісе" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "не паміж" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "ObjectId роўны" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Памылка атрымання мадэлі. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Памылка стварэння запісу. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Памылка аднаўлення запісу. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Памылка выдалення запісу. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Вы дакладна хочаце выдаліць пазначаныя запісы?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Запіс быў паспяхова выдалены." +msgstr[1] "%(count)s запісы былі паспяхова выдаленыя." +msgstr[2] "%(count)s запісаў было паспяхова выдалена." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Памылка выдалення запісаў. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Няслушны выбар" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "Ключ" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "Значэнне" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Ужо йснуе." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "Патрабуецца як найменш %(num)d аб'ект" +msgstr[1] "Патрабуецца як найменш %(num)d аб'екты" +msgstr[2] "Патрабуецца як найменш %(num)d аб'ектаў" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Памылка цэласнасці. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Хібны фармат часу" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Хібны выбар: немагчыма пераўтварыць тып" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "Хібны JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Хібнае пашырэнне файла" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "Файл \"%s\" ужо йснуе." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Няма элементаў ў табліцы." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Хібнае значэнне цэдалю: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Запіс быў паспяхова створаны." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Запіс не йснуе." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Запіс быў паспяхова захаваны." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "Неабходны пакунак tablib не ўсталяваны." + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "Тып экспарта \"%(type)s\" не падтрымліваецца." + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Так" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "Не" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "паміж" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Глядзець запіс" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Рэдагаваць запіс" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "Выберыце, калі ласка, мадэль" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "З выбранымі" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Захаваць" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Скасаваць" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "Захаваць і дадаць іншы" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "Захаваць і працягнуць рэдагаванне" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Корань" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Сартаваць па %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Перайменаваць файл" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Вы дакладна жадаеце выдаліць \\'%(name)s\\' рэкурсіўна?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Вы дакладна жадаеце выдаліць \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "Памер" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Выберыце, калі ласка, як найменш адзін файл." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Спіс" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Стварыць" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "Падрабязнасці" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Цэдаль" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Выдаліць?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "Новы" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Дадаць" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Дадаць цэдаль" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "Экспарт" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Ужыць" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Скасаваць цэдалі" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Пошук" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "элементы" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Стварыць новы запіс" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Выбраць усе запісы" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Выбраць запіс" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Выберыце, калі ласка, як найменш адзін запіс." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Вы дакладна жадаеце выдаліць гэты запіс?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/ca_ES/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/ca_ES/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..d26d62f3 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/ca_ES/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/ca_ES/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/ca_ES/LC_MESSAGES/admin.po new file mode 100644 index 00000000..eb366d90 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/ca_ES/LC_MESSAGES/admin.po @@ -0,0 +1,661 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Catalan\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: ca\n" +"X-Crowdin-File: admin.pot\n" +"Language: ca_ES\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Inici" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "Cli: comanda no vàlid" + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Arxiu per carregar" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Requereix Arxiu." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Tipus de fitxer no vàlid." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Contingut" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Nom no vàlid" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Nom" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "L'Arxiu \"%(name)s\" ja existeix." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Permis denegat" + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "La pujada de fitxers està desactivada." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Fitxer desat correctament: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Error en desar el fitxer: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Carrega un fitxer" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Creació directory està desactivada." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Directori reeixidament creat: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "No s'ha pogut crear el directori: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Crear un directori" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Eliminar està desactivat." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "La opció eliminar directori està deshabilitada" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "El directori \"%(path)s\" s'ha eliminat correctament." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Error en esborrar el directori: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "L'arxiu \"%(name)s\" ha estat eliminat correctament " + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Error en eliminar fitxer: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "La opció canvi de nom està deshabilitada" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "La ruta no extisteix" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Èxit en reanomenar \"%(src)s\" per \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Error en canviar el nom de: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Rebategi %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Error en desar canvis a %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Canvis a %(name)s guardat correctament \"." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Error llegint %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Error inesperat en llegir des de %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "No es pot editar %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "%(path)s d'edició" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Eliminar" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Esteu segur que voleu eliminar aquests arxius?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Eliminació de fitxer inhabilitada." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Editar" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "igual" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "no és igual" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "te" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "no te" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "més que" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "menor que" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "buit" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "en la llista" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "no en la llista" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "no entre" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "No s'ha pogut obtenir el model. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Error en eliminar el registre. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Error en actualitzar el registre. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Error en eliminar el registre. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "¿Segur que vols esborrar els registres seleccionats?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "El registre he sigut eliminat correctament." +msgstr[1] "%(count)s registres s'han eliminat amb èxit." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Error en eliminar registres. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Selecció no valida" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Ja existeixen" + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "" +msgstr[1] "" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Error d'integritat. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Format d'hora no vàlida" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Opció no vàlida: no es pot realitxar" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "JSON no vàlid" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Extensió de fitxer no vàlid" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "L'Arxiu \"%s\" ja existeix." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "No hi ha registres a la taula." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Valor de filtre no vàlid" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Registre ha estat creat correctament." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Registre no existeix." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "El registre ha estat guardat amb èxit " + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "" + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Si" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "No" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "entre" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Veure Registre" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Editar Registre" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "Amb la selecció" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Desa" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Cancel·lar" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Arrel" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Ordena per %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Reanomenar arxiu" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Esteu segur que voleu eliminar \\'%(name)s\\' recursivament" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Esteu segur que voleu eliminar \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Seleccionar almenys un fitxer" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "LLista" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Crear" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Filtre" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Esborrar?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Afegir" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Afegir filtre" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Aplicar" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "restabliment de filtre" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Cercar" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Crea Un Nou Registre" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Seleccionar tots els registres" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Seleccionar registre" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Seleccionar almenys un registre." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Esteu segurs que voleu eliminar el registre?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/cs/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/cs/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..4413d1c1 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/cs/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/cs/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/cs/LC_MESSAGES/admin.po new file mode 100644 index 00000000..47067b5b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/cs/LC_MESSAGES/admin.po @@ -0,0 +1,663 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Czech\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: cs\n" +"X-Crowdin-File: admin.pot\n" +"Language: cs_CZ\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Domů" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "CLI: Neplatný příkaz." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Soubor k nahrání" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Soubor vyžadován." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Nesprávný formát souboru." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Obsah" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Neplatný název" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Jméno" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "Soubor s názvem \"%(name)s\" již existuje." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Přístup zamezen." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Nahrávání souborů není povoleno." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Úspěšně uložený soubor: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Chyba při ukládání souboru: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Nahrát soubor" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Vytváření adresářů není povoleno." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Úspěšně vytvořen adresář: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Chyba při vytváření adresáře: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Vytvořit adresář" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Mazání není povoleno." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Mazání adresářů není povoleno." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Adresář \"%(path)s\" byla úspěšně odstraněna." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Chyba při mazání adresáře: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Soubor \"%(name)s\" byl úspěšně smazán." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Chyba při mazání souboru: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Přejmenovávání není povoleno." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Cesta neexistuje." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Úspěšné přejmenování \"%(src)s\" na \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Chyba při přejmenování: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Přejmenovat %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Chyba při ukládání změn do %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Změny v %(name)s byl úspěšně uložen." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Chyba při čtení %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Neočekávaná chyba při čtení z %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "Nelze upravovat %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Editace %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Smazat" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Skutečně chcete vymazat následující soubory?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Odstranění souborů je zakázáno." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Úpravy" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "rovno" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "není rovno" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "obsahuje" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "neobsahuje" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "větší než" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "menší než" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "prázdné" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "v seznamu" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "není v seznamu" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "není mezi" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Nepodařilo se získat modelu. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Chyba při vytváření modelu. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Chyba při aktualizaci modelu. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Chyba při mazání modelu. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Skutečně chcete vymazat vybrané modely?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "%(count)s model byl úspěšně smazán." +msgstr[1] "%(count)s modely byly úspěšně smazány." +msgstr[2] "%(count)s modelů bylo úspěšně smazáno." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Chyba při mazání modelu. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Tato volba není přípustná" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Již existuje." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "" +msgstr[1] "" +msgstr[2] "" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Chyba integrity. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Nesprávný formát času" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Neplatná volba: nebylo převedeno" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "Neplatný JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Neplatná přípona souboru" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "Soubor s názvem \"%s\" již existuje." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "V tabulce nejsou žádné položky." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Neplatná hodnota filtru: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Model byl úspěšně vytvořen." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Záznam neexistuje." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Záznam byl úspěšně uložen." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "" + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Ano" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "Ne" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "mezi" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Zobrazit záznam" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Upravit Záznam" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "S vybranými" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Uložit" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Zrušit" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Kořen" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Seřadit podle %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Přejmenovat Soubor" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Opravdu chcete vymazat \\'%(name)s\\' rekurzivně?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Opravdu chcete vymazat \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Vyberte prosím alespoň jeden soubor." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Seznam" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Vytvořit" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Filtr" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Smazat?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Přidat" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Přidat filtr" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Potvrdit" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Zrušit filtry" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Hledat" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Vytvořit Nový Záznam" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Vybrat všechny záznamy" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Výběr záznamu" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Vyberte prosím alespoň jeden model." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Opravdu chcete vymazat tento záznam?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/da/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/da/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..044e7e3d Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/da/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/da/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/da/LC_MESSAGES/admin.po new file mode 100644 index 00000000..6dbbaddc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/da/LC_MESSAGES/admin.po @@ -0,0 +1,661 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Danish\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: da\n" +"X-Crowdin-File: admin.pot\n" +"Language: da_DK\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Hjem" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "CLI: Ugyldig kommando." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Fil til upload" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Fil kræves." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Ugyldig filtype." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Indhold" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Ugyldigt navn" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Navn" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "Filen \"%(name)s\" findes allerede." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Tilladelse nægtet." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Fil-upload er deaktiveret." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Med held gemt fil: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Kunne ikke gemme fil: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Upload fil" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Directory oprettelse er deaktiveret." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Med held oprettede mappe: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Kunne ikke oprette denne mappe: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Oprette Register" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Sletning er deaktiveret." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Directory sletning er deaktiveret." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Register \"%(path)s\" blev slettet." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Kunne ikke slette mappe: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Filen \"%(name)s\" blev slettet." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Kunne ikke slette fil: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Omdøbning er deaktiveret." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Stien findes ikke." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Med held omdøbt \"%(src)s\" til \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Undladt at omdøbe: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Omdøbe %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Fejl under lagring af ændringer til %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Ændringer til %(name)s gemmes korrekt." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Fejl læsning %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Uventet fejl under læsning fra %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "Kan ikke redigere %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Redigering af %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Slet" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Er du sikker på du vil slette disse filer?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Filsletningen er deaktiveret." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Rediger" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "er lig med" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "ikke lige" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "indeholder" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "ikke indeholder" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "større end" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "mindre end" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "Tom" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "i listen" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "ikke på listen" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "ikke mellem" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Undladt at få model. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Kunne ikke oprette posten. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Kunne ikke oprette posten. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Kunne ikke slette posten. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Er du sikker på du vil slette de valgte poster?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Posten blev slettet." +msgstr[1] "%(count)s poster blev slettet." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Kunne ikke slette posten. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Ikke et gyldigt valg" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Der findes allerede." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "" +msgstr[1] "" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Integritetsfejl. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Ugyldigt klokkeslætsformat" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Ugyldigt valg: kunne ikke tvinge" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "Ugyldig JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Ugyldig fil forlængelse" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "Filen \"%s\" findes allerede." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Der er ingen varer i tabellen." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Ugyldig filterværdi: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Posten blev oprettet." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Posten findes ikke." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Post blev gemt." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "" + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Ja" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "Nej" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "mellem" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "View Post" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Redigere Posten" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "Med udvalgte" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Gem" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Annuller" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Roden" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Sorter efter %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Omdøb filen" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Er du sikker på du vil slette \\'%(name)s\\' \"rekursivt?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Er du sikker på du vil slette \\'%(name)s\\' \"?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Vælg mindst én fil." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Liste" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Oprette" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Filter" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Slet?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Tilføje" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Tilføj Filter" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Anvende" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Nulstil filtre" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Søg" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Opret Ny Rekord" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Marker alle poster" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Vælg post" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Vælg mindst én post." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Er du sikker på du vil slette denne post?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/de/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/de/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..10456618 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/de/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/de/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/de/LC_MESSAGES/admin.po new file mode 100644 index 00000000..3b8a1d7f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/de/LC_MESSAGES/admin.po @@ -0,0 +1,661 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-13 09:18-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: German\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: de\n" +"X-Crowdin-File: admin.pot\n" +"Language: de_DE\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Start" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "Kommandozeile: Ungültiger Befehl." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Datei für Upload" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Datei erforderlich." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Ungültiges Dateiformat." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Inhalt" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Ungültiger Name" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Name" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "Datei \"%(name)s\" existiert bereits." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Zugriff verweigert." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Datei-Upload ist deaktiviert." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Datei erfolgreich gespeichert: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Speichern der Datei fehlgeschlagen: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Datei-Upload" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Erzeugen von Verzeichnissen ist deaktiviert." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Verzeichnis erfolgreich erstellt: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Erzeugen von Verzeichnis fehlgeschlagen: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Verzeichnis erstellen" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Löschen ist deaktiviert." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Löschen von Verzeichnissen ist deaktiviert." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Verzeichnis \"%(path)s\" wurde erfolgreich gelöscht." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Löschen von Verzeichnis fehlgeschlagen: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Datei \"%(name)s\" wurde erfolgreich gelöscht." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Löschen der Datei %(name)s fehlgeschlagen" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Umbenennen ist deaktiviert." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Pfad existiert nicht." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "\"%(src)s\" wurde erfolgreich in \"%(dst)s\" umbenannt" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Umbenennen fehlgeschlagen: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "%(name)s umbenennen" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Fehler beim Speichern von Änderungen an %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Änderungen an %(name)s erfolgreich gespeichert." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Fehler beim Einlesen von %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Unerwarteter Fehler beim Lesen von %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "%(name)s kann nicht bearbeitet werden." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Bearbeiten von %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Löschen" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Sind Sie sicher, dass Sie diese Dateien löschen möchten?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Löschen von Dateien ist deaktiviert." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Bearbeiten" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "Operieren in nicht-leeren Verzeichnissen nicht möglich" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "gleich" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "ungleich" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "enthält" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "enthält nicht" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "größer als" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "kleiner als" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "leer" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "in Liste" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "nicht in Liste" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "nicht zwischen" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "ObjectId entspricht" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Fehler beim Holen des Modells. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Erstellen von Eintrag fehlgeschlagen: %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Aktualisieren von Eintrag fehlgeschlagen: %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Eintrag konnte nicht gelöscht werden: %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Sind Sie sicher, dass Sie die ausgewählten Einträge löschen möchten?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Eintrag wurde erfolgreich gelöscht." +msgstr[1] "%(count)s Einträge wurden erfolgreich gelöscht." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Löschen von Einträgen fehlgeschlagen: %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Keine gültige Auswahl" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "Eigenschaft" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "Wert" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Existiert bereits." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "Mindestens %(num)d Element ist erforderlich" +msgstr[1] "Mindestens %(num)d Elemente sind erforderlich" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Integritätsfehler. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Ungültiges Zeitformat" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Ungültige Auswahl: Konnte nicht umwandeln" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "Ungültiges JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Ungültiger Dateityp" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "Datei \"%s\" existiert bereits." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Die Tabelle ist leer." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Ungültiger Filter-Wert: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Eintrag wurde erfolgreich erstellt." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Eintrag existiert nicht." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Eintrag wurde erfolgreich gespeichert." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "Abhängigkeit \"Tablib\" nicht installiert." + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "Export-Typ \"%(type)s nicht unterstützt." + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Ja" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "Nein" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "zwischen" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Eintrag ansehen" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Eintrag bearbeiten" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "Bitte Modell auswählen" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "Mit Auswahl" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Speichern" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Abbrechen" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "Speichern und neuer Eintrag" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "Speichern und Fortfahren" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Wurzelverzeichnis" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Nach %(name)s sortieren" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Datei umbenennen" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Sind Sie sicher, dass Sie \\'%(name)s\\' rekursiv löschen möchten?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Sind Sie sicher, dass Sie \\'%(name)s\\' löschen möchten?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "Größe" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Bitte mindestens eine Datei auswählen." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Liste" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Erstellen" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "Details" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Filter" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Löschen?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "Neu" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Hinzufügen:" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Filter hinzufügen" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "Export" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Übernehmen" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Filter zurücksetzen" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Suche" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "Elemente" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Neuen Eintrag erstellen" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Alle Datensätze auswählen" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Datensatz auswählen" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Bitte wählen Sie mindestens einen Eintrag aus." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Sind Sie sicher, dass Sie diesen Eintrag löschen möchten?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/el/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/el/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..f7215339 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/el/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/el/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/el/LC_MESSAGES/admin.po new file mode 100644 index 00000000..9be4a5aa --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/el/LC_MESSAGES/admin.po @@ -0,0 +1,661 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Greek\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: el\n" +"X-Crowdin-File: admin.pot\n" +"Language: el_GR\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Αρχή" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "CLI: Άκυρη εντολή." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Αρχείο για ανέβασμα" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Απαιτείται αρχείο." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Μη έγκυρος τύπος αρχείου." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Περιεχόμενο" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Μη έγκυρο όνομα" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Όνομα" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "Το αρχείο \"%(name)s\" υπάρχει ήδη." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Απαγορευεται η προσβαση." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Το ανέβασμα αρχείων είναι απενεργοποιημένο." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Το αρχείο: %(name)s αποθηκεύτηκε με επιτυχία" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Η αποθήκευση του αρχείου απέτυχε: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Ανεβάστε αρχείο" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Η δημιουργία καταλόγου είναι απενεργοποιημένη." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Ο κατάλογος δημιουργήθηκε με επιτυχία: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Η δημιουργία καταλόγου απέτυχε: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Δημιουργήστε κατάλογο" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Η διαγραφή είναι απενεργοποιημένη." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Η διαγραφή καταλόγου είναι απενεργοποιημένη." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Ο κατάλογος \"%(path)s\" διαγράφηκε με επιτυχία." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Απέτυχε η διαγραφή καταλόγου: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Το αρχείο \"%(name)s\" διαγράφηκε με επιτυχία." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Απέτυχε η διαγραφή του αρχείου: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Η μετονομασία είναι απενεργοποιημένη." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Η διαδρομή δεν υπάρχει." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Μετονομάστηκε επιτυχώς από \"%(src)s\" σε \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Απέτυχε η μετονομασία: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Μετονομάσια %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Σφάλμα κατά την αποθήκευση αλλαγών σε %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Οι αλλαγές στο %(name)s αποθηκεύτηκαν με επιτυχία." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Σφάλμα ανάγνωσης %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Μη αναμενόμενο σφάλμα κατά την ανάγνωση από %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "Αδυναμία επεξεργασίας %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Επεξεργασία %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Διαγραφή" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Είστε βέβαιοι ότι θέλετε να διαγράψετε αυτά τα αρχεία;" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Η διαγραφή αρχείων είναι απενεργοποιημένη." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Επεξεργασία" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "ισούται με" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "διάφορο" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "περιέχει" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "δεν περιέχει" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "μεγαλύτερο από" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "μικρότερο από" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "κενό" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "στη λίστα" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "εκτός λίστας" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "δεν μεταξύ" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Απέτυχε η λήψη του μοντέλου. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Απέτυχε η δημιουργία ρεκόρ. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Απέτυχε η δημιουργία εγγραφής. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Απέτυχε η διαγραφή της εγγραφής. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Είστε βέβαιοι ότι θέλετε να διαγράψετε τις επιλεγμένες εγγραφές;" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Η εγγραφή διαγράφηκε με επιτυχία." +msgstr[1] "%(count)s εγγραφές διαγράφηκαν με επιτυχία." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Απέτυχε η διαγραφή της εγγραφής. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Άκυρη επιλογή" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Υπάρχει ήδη." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "" +msgstr[1] "" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Σφάλμα ακεραιότητας. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Άκυρη μορφή ώρας" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Μη έγκυρη επιλογή: δεν θα μπορούσε να εξαναγκάσει" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "Μη έγκυρο JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Μη έγκυρη επέκταση αρχείου" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "Το αρχείο \"%s\" υπάρχει ήδη." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Δεν υπάρχουν στοιχεία στον πίνακα." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Άκυρη τιμή φίλτρου: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Η εγγραφή δημιουργήθηκε με επιτυχία." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Η εγγραφή δεν υπάρχει." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Η καρτέλα αποθηκεύτηκε με επιτυχία." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "" + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Ναι" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "Όχι" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "μεταξύ" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Προβολή καρτέλας" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Επεξεργασία εγγραφής" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "Με επιλεγμένο" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Αποθήκευση" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Άκυρο" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "Αποθήκευση και Προσθήκη Άλλου" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "Αποθήκευση και Συνέχεια Επεξεργασίας" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Ρίζα" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Ταξινόμηση κατά %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Μετονοσία αρχείου" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Είστε βέβαιοι ότι θέλετε να διαγράψετε \\'%(name)s\\' αναδρομικά;" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Είστε βέβαιοι ότι θέλετε να διαγράψετε \\'%(name)s\\';" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Παρακαλώ επιλέξτε τουλάχιστον ένα αρχείο." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Λίστα" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Δημιουργία" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "Λεπτομέρειες" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Φίλτρο" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Διαγραφή?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Προσθήκη" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Προσθήκη φίλτρου" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "Εξαγωγή" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Εφαρμογή" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Επαναφορά αρχικών φίλτρων" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Αναζήτηση" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Δημιουργία νέας εγγραφής" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Επιλογή όλων των εγγραφών" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Επιλέξτε εγγραφή" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Παρακαλώ επιλέξτε τουλάχιστον μία εγγραφή." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Είστε βέβαιοι ότι θέλετε να διαγράψετε αυτήν την εγγραφή;" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/en/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/en/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..0e4180a2 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/en/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/en/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/en/LC_MESSAGES/admin.po new file mode 100644 index 00000000..ff882d61 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/en/LC_MESSAGES/admin.po @@ -0,0 +1,535 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2015-04-22 20:22-0500\n" +"PO-Revision-Date: 2015-04-22 21:56-0400\n" +"Last-Translator: mrjoes \n" +"Language-Team: English\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 1.3\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: en\n" +"X-Crowdin-File: admin.pot\n" +"Language: en_US\n" + +#: ../flask_admin/base.py:427 +msgid "Home" +msgstr "Home" + +#: ../flask_admin/contrib/fileadmin.py:222 +msgid "File to upload" +msgstr "File to upload" + +#: ../flask_admin/contrib/fileadmin.py:230 +msgid "File required." +msgstr "File required." + +#: ../flask_admin/contrib/fileadmin.py:235 +msgid "Invalid file type." +msgstr "Invalid file type." + +#: ../flask_admin/contrib/fileadmin.py:246 +msgid "Content" +msgstr "Content" + +#: ../flask_admin/contrib/fileadmin.py:260 +msgid "Invalid name" +msgstr "Invalid name" + +#: ../flask_admin/contrib/fileadmin.py:268 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:35 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:35 +msgid "Name" +msgstr "Name" + +#: ../flask_admin/contrib/fileadmin.py:546 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "File \"%(name)s\" already exists." + +#: ../flask_admin/contrib/fileadmin.py:570 +#: ../flask_admin/contrib/fileadmin.py:637 +#: ../flask_admin/contrib/fileadmin.py:690 +#: ../flask_admin/contrib/fileadmin.py:731 +#: ../flask_admin/contrib/fileadmin.py:777 +#: ../flask_admin/contrib/fileadmin.py:826 +msgid "Permission denied." +msgstr "Permission denied." + +#: ../flask_admin/contrib/fileadmin.py:633 +msgid "File uploading is disabled." +msgstr "File uploading is disabled." + +#: ../flask_admin/contrib/fileadmin.py:646 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Failed to save file: %(error)s" + +#: ../flask_admin/contrib/fileadmin.py:686 +msgid "Directory creation is disabled." +msgstr "Directory creation is disabled." + +#: ../flask_admin/contrib/fileadmin.py:701 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Failed to create directory: %(error)s" + +#: ../flask_admin/contrib/fileadmin.py:727 +msgid "Deletion is disabled." +msgstr "Deletion is disabled." + +#: ../flask_admin/contrib/fileadmin.py:736 +msgid "Directory deletion is disabled." +msgstr "Directory deletion is disabled." + +#: ../flask_admin/contrib/fileadmin.py:742 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Directory \"%(path)s\" was successfully deleted." + +#: ../flask_admin/contrib/fileadmin.py:744 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Failed to delete directory: %(error)s" + +#: ../flask_admin/contrib/fileadmin.py:749 +#: ../flask_admin/contrib/fileadmin.py:894 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "File \"%(name)s\" was successfully deleted." + +#: ../flask_admin/contrib/fileadmin.py:751 +#: ../flask_admin/contrib/fileadmin.py:896 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Failed to delete file: %(name)s" + +#: ../flask_admin/contrib/fileadmin.py:773 +msgid "Renaming is disabled." +msgstr "Renaming is disabled." + +#: ../flask_admin/contrib/fileadmin.py:781 +msgid "Path does not exist." +msgstr "Path does not exist." + +#: ../flask_admin/contrib/fileadmin.py:792 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Successfully renamed \"%(src)s\" to \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin.py:795 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Failed to rename: %(error)s" + +#: ../flask_admin/contrib/fileadmin.py:842 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Error saving changes to %(name)s." + +#: ../flask_admin/contrib/fileadmin.py:846 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Changes to %(name)s saved successfully." + +#: ../flask_admin/contrib/fileadmin.py:855 +#, python-format +msgid "Error reading %(name)s." +msgstr "Error reading %(name)s." + +#: ../flask_admin/contrib/fileadmin.py:858 +#: ../flask_admin/contrib/fileadmin.py:867 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Unexpected error while reading from %(name)s" + +#: ../flask_admin/contrib/fileadmin.py:864 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "Cannot edit %(name)s." + +#: ../flask_admin/contrib/fileadmin.py:881 +#: ../flask_admin/contrib/mongoengine/view.py:626 +#: ../flask_admin/contrib/peewee/view.py:429 +#: ../flask_admin/contrib/pymongo/view.py:349 +#: ../flask_admin/contrib/sqla/view.py:956 +msgid "Delete" +msgstr "Delete" + +#: ../flask_admin/contrib/fileadmin.py:882 +msgid "Are you sure you want to delete these files?" +msgstr "Are you sure you want to delete these files?" + +#: ../flask_admin/contrib/fileadmin.py:885 +msgid "File deletion is disabled." +msgstr "File deletion is disabled." + +#: ../flask_admin/contrib/fileadmin.py:898 +msgid "Edit" +msgstr "Edit" + +#: ../flask_admin/contrib/rediscli.py:125 +msgid "Cli: Invalid command." +msgstr "Cli: Invalid command." + +#: ../flask_admin/contrib/geoa/fields.py:29 +msgid "Invalid JSON" +msgstr "Invalid JSON" + +#: ../flask_admin/contrib/mongoengine/filters.py:38 +#: ../flask_admin/contrib/peewee/filters.py:38 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:38 +msgid "equals" +msgstr "equals" + +#: ../flask_admin/contrib/mongoengine/filters.py:47 +#: ../flask_admin/contrib/peewee/filters.py:46 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:46 +msgid "not equal" +msgstr "not equal" + +#: ../flask_admin/contrib/mongoengine/filters.py:57 +#: ../flask_admin/contrib/peewee/filters.py:55 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:55 +msgid "contains" +msgstr "contains" + +#: ../flask_admin/contrib/mongoengine/filters.py:67 +#: ../flask_admin/contrib/peewee/filters.py:64 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:64 +msgid "not contains" +msgstr "not contains" + +#: ../flask_admin/contrib/mongoengine/filters.py:76 +#: ../flask_admin/contrib/peewee/filters.py:72 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:72 +msgid "greater than" +msgstr "greater than" + +#: ../flask_admin/contrib/mongoengine/filters.py:85 +#: ../flask_admin/contrib/peewee/filters.py:80 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:80 +msgid "smaller than" +msgstr "smaller than" + +#: ../flask_admin/contrib/mongoengine/filters.py:97 +#: ../flask_admin/contrib/peewee/filters.py:91 +#: ../flask_admin/contrib/sqla/filters.py:91 +msgid "empty" +msgstr "empty" + +#: ../flask_admin/contrib/mongoengine/filters.py:112 +#: ../flask_admin/contrib/peewee/filters.py:105 +#: ../flask_admin/contrib/sqla/filters.py:105 +msgid "in list" +msgstr "in list" + +#: ../flask_admin/contrib/mongoengine/filters.py:121 +#: ../flask_admin/contrib/peewee/filters.py:114 +#: ../flask_admin/contrib/sqla/filters.py:114 +msgid "not in list" +msgstr "not in list" + +#: ../flask_admin/contrib/mongoengine/filters.py:221 +#: ../flask_admin/contrib/peewee/filters.py:208 +#: ../flask_admin/contrib/peewee/filters.py:245 +#: ../flask_admin/contrib/peewee/filters.py:282 +#: ../flask_admin/contrib/sqla/filters.py:209 +#: ../flask_admin/contrib/sqla/filters.py:246 +#: ../flask_admin/contrib/sqla/filters.py:283 +msgid "not between" +msgstr "not between" + +#: ../flask_admin/contrib/mongoengine/view.py:520 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Failed to get model. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:539 +#: ../flask_admin/contrib/peewee/view.py:380 +#: ../flask_admin/contrib/pymongo/view.py:284 +#: ../flask_admin/contrib/sqla/view.py:888 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Failed to create record. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:565 +#: ../flask_admin/contrib/peewee/view.py:399 +#: ../flask_admin/contrib/pymongo/view.py:309 +#: ../flask_admin/contrib/sqla/view.py:914 ../flask_admin/model/base.py:1671 +#: ../flask_admin/model/base.py:1680 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Failed to update record. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:589 +#: ../flask_admin/contrib/peewee/view.py:415 +#: ../flask_admin/contrib/pymongo/view.py:335 +#: ../flask_admin/contrib/sqla/view.py:940 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Failed to delete record. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:627 +#: ../flask_admin/contrib/peewee/view.py:430 +#: ../flask_admin/contrib/pymongo/view.py:350 +#: ../flask_admin/contrib/sqla/view.py:957 +msgid "Are you sure you want to delete selected records?" +msgstr "Are you sure you want to delete selected records?" + +#: ../flask_admin/contrib/mongoengine/view.py:636 +#: ../flask_admin/contrib/peewee/view.py:446 +#: ../flask_admin/contrib/pymongo/view.py:360 +#: ../flask_admin/contrib/sqla/view.py:973 ../flask_admin/model/base.py:1619 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Record was successfully deleted." +msgstr[1] "%(count)s records were successfully deleted." + +#: ../flask_admin/contrib/mongoengine/view.py:642 +#: ../flask_admin/contrib/peewee/view.py:452 +#: ../flask_admin/contrib/pymongo/view.py:365 +#: ../flask_admin/contrib/sqla/view.py:981 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Failed to delete records. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:123 +#: ../flask_admin/contrib/sqla/fields.py:173 +#: ../flask_admin/contrib/sqla/fields.py:178 ../flask_admin/model/fields.py:225 +#: ../flask_admin/model/fields.py:274 +msgid "Not a valid choice" +msgstr "Not a valid choice" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Already exists." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %d item is required" +msgid_plural "At least %d items are required" +msgstr[0] "At least %d item is required" +msgstr[1] "At least %d items are required" + +#: ../flask_admin/contrib/sqla/view.py:867 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Integrity error. %(message)s" + +#: ../flask_admin/form/fields.py:92 +msgid "Invalid time format" +msgstr "Invalid time format" + +#: ../flask_admin/form/fields.py:138 +msgid "Invalid Choice: could not coerce" +msgstr "Invalid Choice: could not coerce" + +#: ../flask_admin/form/upload.py:189 +msgid "Invalid file extension" +msgstr "Invalid file extension" + +#: ../flask_admin/model/base.py:1281 +msgid "There are no items in the table." +msgstr "There are no items in the table." + +#: ../flask_admin/model/base.py:1305 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Invalid Filter Value: %(value)s" + +#: ../flask_admin/model/base.py:1539 +msgid "Record was successfully created." +msgstr "Record was successfully created." + +#: ../flask_admin/model/base.py:1578 ../flask_admin/model/base.py:1676 +msgid "Record was successfully saved." +msgstr "Record was successfully saved." + +#: ../flask_admin/model/filters.py:99 +msgid "Yes" +msgstr "Yes" + +#: ../flask_admin/model/filters.py:100 +msgid "No" +msgstr "No" + +#: ../flask_admin/model/filters.py:162 ../flask_admin/model/filters.py:202 +#: ../flask_admin/model/filters.py:247 +msgid "between" +msgstr "between" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "With selected" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:156 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:150 +msgid "Save" +msgstr "Save" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:161 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:155 +msgid "Cancel" +msgstr "Cancel" + +#: ../flask_admin/templates/bootstrap2/admin/file/edit.html:5 +#: ../flask_admin/templates/bootstrap3/admin/file/edit.html:5 +#, python-format +msgid "You are editing %(path)s" +msgstr "You are editing %(path)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Root" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:36 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:36 +msgid "Size" +msgstr "Size" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:63 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:63 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Are you sure you want to delete \\'%(name)s\\' recursively?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:72 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:72 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Are you sure you want to delete \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:107 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:107 +msgid "Upload File" +msgstr "Upload File" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:112 +msgid "Create Directory" +msgstr "Create Directory" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:129 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:129 +msgid "Please select at least one file." +msgstr "Please select at least one file." + +#: ../flask_admin/templates/bootstrap2/admin/file/rename.html:5 +#: ../flask_admin/templates/bootstrap3/admin/file/rename.html:5 +#, python-format +msgid "Please provide new name for %(name)s" +msgstr "Please provide new name for %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:5 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:5 +msgid "Save and Add" +msgstr "Save and Add" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:16 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:16 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:16 +msgid "List" +msgstr "List" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:19 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:20 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:20 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:20 +msgid "Create" +msgstr "Create" + +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:5 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:5 +msgid "Save and Continue" +msgstr "Save and Continue" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Delete?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Add" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Add Filter" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:17 +msgid "Apply" +msgstr "Apply" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:19 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:19 +msgid "Reset Filters" +msgstr "Reset Filters" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:45 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:43 +msgid "Search" +msgstr "Search" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:20 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:20 +msgid "Create new record" +msgstr "Create new record" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:56 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:56 +msgid "Select all records" +msgstr "Select all records" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:67 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:67 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +#, python-format +msgid "Sort by %(name)s" +msgstr "Sort by %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:98 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +msgid "Select record" +msgstr "Select record" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:105 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:105 +msgid "Edit record" +msgstr "Edit record" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:114 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:114 +msgid "Are you sure you want to delete this record?" +msgstr "Are you sure you want to delete this record?" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:114 +msgid "Delete record" +msgstr "Delete record" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:158 +msgid "Please select at least one record." +msgstr "Please select at least one record." + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/es/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/es/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..16f96580 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/es/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/es/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/es/LC_MESSAGES/admin.po new file mode 100644 index 00000000..09ae2cd0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/es/LC_MESSAGES/admin.po @@ -0,0 +1,661 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-13 09:18-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Spanish\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: es-ES\n" +"X-Crowdin-File: admin.pot\n" +"Language: es_ES\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Inicio" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "CLI: Comando no válido." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Archivo a subir" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Se necesita un archivo" + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "El tipo de archivo no es válido." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Contenido" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Nombre inválido" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Nombre" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "El archivo \"%(name)s\" ya existe." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Permiso denegado." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "La subida de archivos está deshabilitada." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Archivo guardado con éxito: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Error al guardar el archivo: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Subir archivo" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Creación de carpetas deshabilitada." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Directorio creado correctamente: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "No se ha podido crear la carpeta: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Crear carpeta" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "El borrado está deshabilitado." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "El borrado de carpetas está deshabilitado." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Con éxito se suprimió el directorio \"%(path)s\"." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "No se ha podido borrar la carpeta: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "El archivo \"%(name)s\" se ha borrado con éxito." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "No se ha podido borrar el archivo: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Renombrar está deshabilitado." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "La ruta no existe." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "\"%(src)s\" ha sido renombrado a \"%(dst)s\" correctamente" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "No se ha podido renombrar: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Cambiar el nombre de %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Error al guardar los cambios en %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Cambios %(name)s guardado correctamente." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Error %(name)s de lectura." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Error inesperado durante la lectura de %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "No se puede editar %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Edición %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Borrar" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "¿Está seguro de que desea borrar estos archivos?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Eliminación de archivos está deshabilitado." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Editar" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "No puede funcionar en directorios no vacíos" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "igual a" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "no es igual a" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "contiene" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "no contiene" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "mayor que" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "menor que" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "vacío" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "en la lista" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "no en la lista" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "No entre" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "ObjectId es igual a" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Error al obtener el modelo. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Error al crear el registro. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Error al actualizar el registro. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Error al borrar el registro. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "¿Está seguro de que desea borrar los elementos seleccionados?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "El elemento se ha borrado correctamente." +msgstr[1] "%(count)s elementos se han borrado correctamente." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "No se han podido borrar los elementos seleccionados. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "No es una opción válida" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "Clave" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "Valor" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Ya existe." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "Al menos %(num)d item es requerido" +msgstr[1] "Al menos %(num)d item son requeridos" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Error de integridad. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "El formato de hora no es válido" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Elección inválida: no se puede ajustar" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "JSON no válido" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Extensión del archivo no válido" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "El archivo \"%s\" ya existe." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "No hay objetos en la tabla." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Valor de filtro no válido: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "El elemento se ha creado correctamente." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "No existe ningún registro." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Registro fue guardado con éxito." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "Tablib dependencia no instalado." + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "Exportación de tipo \"%(type)s no compatible." + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Si" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "No" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "entre" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Ver registro" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Editar Registro" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "Por favor, seleccione el modelo" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "Con seleccionados" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Salvar" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Cancelar" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "Guardar y agregar otro" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "Guardar y continuar editando" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Raíz" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Ordenar por %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Renombrar El Archivo" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "¿Está seguro de que desea borrar \\'%(name)s\\' de forma recursiva?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "¿Está seguro de que desea borrar \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "Tamaño" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Por favor, seleccione al menos un archivo." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Listado" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Crear" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "Detalles" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Filtrar" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "¿Borrar?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "Nuevo" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Nuevo" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Añadir filtro" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "Exportar" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Aplicar" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Restaurar filtros" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Buscar" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "artículos" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Crear Nuevo Registro" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Seleccionar todos los registros" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Seleccione registro" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Por favor, seleccione al menos un elemento." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "¿Está seguro de que quiere borrar este elemento?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/et/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/et/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..03d1b080 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/et/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/et/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/et/LC_MESSAGES/admin.po new file mode 100644 index 00000000..050cb499 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/et/LC_MESSAGES/admin.po @@ -0,0 +1,661 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Estonian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: et\n" +"X-Crowdin-File: admin.pot\n" +"Language: et_EE\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Esileht" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "CLI: Sobimatu käsk." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Üleslaaditav fail" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Fail puudub." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Vale failitüüp." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Sisu" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Lubamatu nimi" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Nimi" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "Fail \"%(name)s\" on juba olemas." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Õigused puuduvad." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Faili üleslaadimine on keelatud." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Fail %(name)s edukalt salvestatud" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Faili salvestamine nurjus: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Failide üleslaadimine" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Kataloogide loomine on keelatud." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Kataloog %(directory)s edukalt loodud" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Kataloogi loomine nurjus: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Kausta loomine" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Kustutamine on keelatud." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Kataloogide kustutamine on keelatud." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Kataloog \"%(path)s\" on edukalt kustutatud." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Kataloogi ei saanud kustutada: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Fail \"%(name)s\" on edukalt kustutatud." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Faili kustutamine nurjus: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Ümbernimetamine on keelatud." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Asukohta pole olemas." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Ümbernimetamine \"%(src)s\" \"%(dst)s\" oli edukas" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Ümbernimetamine nurjus: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Faili %(name)s ümbernimetamine" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Faili %(name)s muutuste salvestamisel ilmnes tõrge." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Faili %(name)s muudatused on edukalt salvestatud." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Tõrge faili %(name)s lugemisel." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Ootamatu tõrge faili %(name)s lugemisel" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "%(name)s ei saa redigeerida." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "%(path)s redigeerimine" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Kustuta" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Olete kindel, et soovite neid faile kustutada?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Failide kustutamine on keelatud." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Redigeeri" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "võrdub" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "ei võrdu" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "sisaldab" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "ei sisalda" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "suurem kui" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "väiksem kui" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "tühi" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "loendis" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "pole loendis" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "pole vahemikus" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Mudeli päring ebaõnnestus. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Kirje loomine nurjus. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Kirje uuendamine nurjus. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Kirje kustutamine nurjus. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Kas soovite kindlasti valitud kirjed kustutada?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Kirje kustutati edukalt." +msgstr[1] "%(count)s kirjet kustutati edukalt." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Kirjete kustutamine nurjus. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Ebasobiv valik" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "On juba olemas." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "Vaja vähemalt %(num)d elementi" +msgstr[1] "Vaja vähemalt %(num)d elementi" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Terviklikkuse viga. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Vigane kellaajavorming" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Vigane valik: pole teisendatav" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "Sobimatu JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Vigane faililaiend" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "Fail \"%s\" on juba olemas." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Tabel on tühi." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Sobimatu filtriväärtus: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Kirje loomine oli edukas." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Kirje pole olemas." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Kirje salvestamine oli edukas." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "" + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Jah" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "Ei" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "vahemikus" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Kirje vaade" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Kirje redigeerimine" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "Toiming valikuga" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Salvesta" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Loobu" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "Salvesta ja lisa uus" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "Salvesta ja jätka muutmist" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Juurkataloog" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Sorteeri %(name)s alusel" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Faili ümbernimetamine" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Kas soovite kindlasti kustutada \\'%(name)s\\' rekursiivselt?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Kas soovite kindlasti kustutada \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Palun valige vähemalt üks fail." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Loend" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Loo" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "Detailvaade" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Filter" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Kustutada?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "Uus" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Lisamine" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Filtri lisamine" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "Eksport" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Rakenda" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Filtrite lähtestamine" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Otsing" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Loo Uus Kirje" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Kõigi kirjete valimine" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Vali kirje" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Palun valige vähemalt üks kirje." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Kas soovite kindlasti selle kirje kustutada?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/fa/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/fa/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..8affba1e Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/fa/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/fa/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/fa/LC_MESSAGES/admin.po new file mode 100644 index 00000000..2faf7077 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/fa/LC_MESSAGES/admin.po @@ -0,0 +1,661 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Persian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: fa\n" +"X-Crowdin-File: admin.pot\n" +"Language: fa_IR\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "خانه" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "Cli: دستور نامعتبر است." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "فایلی که باید آپلود شود" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "فایل لازم است" + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "نوع فایل غیرمجاز است" + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "محتوا" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "نام اشتباه" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "نام" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "پرونده \"%(name)s\" وجود دارد." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "خطای دسترسی" + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "آپلود فایل غیر فعال است" + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "فایل با موفقیت ذخیره شده: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "ذخیره ی فایل بامشکل روبرو شد %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "آپلود فایل" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "ساخت پوشه غیر فعال است" + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "پوشه با موفقیت ایجاد شده: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "ساخت پوشه ی با مشکل روبرو شد %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "ایجاد پوشه" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "حذف غیر فعال شده است." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "حذف دایرکتوری غیر فعال شده است." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "پوشه %(path)s با موفقیت حذف شد." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "حذف پوشه ی با مشکل روبرو شد %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "فایل \"%(name)s\" با موفقیت حذف شد" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "حذف فایل%(name)s با مشکل روبرو شد" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "تغییر نام غیر فعال است" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "مسیر وجود ندارد" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "با موفقیت از\"%(src)s\" به \"%(dst)s\" تغییر نام داده شد" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "تغییر نام با مشکل روبرو شد %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "تغییر نام %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "مشکل در ذخیره ی تغییرات %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "تغییرات%(name)s با موفقیت صورت گرفت" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "مشکل در خواندن %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "خطای غیر منتظره در حال خواندن %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "عدم توانایی در ویرایش %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "ویرایش %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "حذف" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "آیا از حذف این فایل ها اطمینان دارید؟" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "امکان حذف فایل وجود ندارد" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "ویرایش" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "برابر با" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "برابر نیست با" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "محتوی" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "محتوی نیست" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "بزرگتر از" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "کوچکتر از" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "خالی باشد" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "در این لیست باشد" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "در این لیست نباشد" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "بین این دو نباشد" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "خواندن مدل با مشکل روبرو شد. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "ساخت مدل با مشکل روبرو شد %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "بروزرسانی مدل با مشکل روبرو شد%(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "حذف مدل با مشکل روبرو شد %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "آیا از حذف مدل ها اطمینان دارید" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "مدل با موفقیت حذف شد" +msgstr[1] "%(count)s رکورد با موفقیت حذف شد." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "حذف مدل ها با مشکل روبرو شد %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "انتخاب مناسبی نیست" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "قبلا وجود داشته است" + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "" +msgstr[1] "" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "خطای یکپارچگی داده. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "قالب زمان اشتباه است" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "انتخاب اشتباه" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "JSON نامعتبر است" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "پسوند فایل غیرمجاز است" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "فایل \"%s\" قبلا وجود داشته است" + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "هیچ موردی در این جدول وجود ندارد." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "مقدار فیلتر معتبر نیست: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "مدل با موفقیت ساخته شد" + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "رکورد وجود ندارد." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "مدل با موفقیت ذخیره شد" + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "" + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "بله" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "خیر" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "بین این دو باشد" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "مشاهده سابقه" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "ویرایش رکورد" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "با انتخاب شده ها" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "ذخیره" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "لغو" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "ذخیره و اضافه یک ردیف جدید" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "ذخیره و ادامه ویرایش" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "ریشه" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "مرتب سازی بر اساس %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "تغییر نام پرونده" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "آیا از حذف محتویات \\'%(name)s\\' اطمینان دارید؟" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "آیا از حذف \\'%(name)s\\'اطمینان دارید؟" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "حداقل یک فایل انتخاب کنید" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "لیست" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "ایجاد" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "جزییات" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "فیلتر" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "حذف؟" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "تازه" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "اضافه" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "اضافه کردن فیلتر" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "خروجی گرفتن" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "اعمال" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "برگرداندن فیلتر ها به حالت اول" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "جستجو" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "ایجاد رکورد جدید" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "انتخاب همه رکوردها" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "انتخاب رکورد" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "حداقل یک پوشه انتخاب کنید" + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "آیا از حذف این موارد اطمینان دارید؟" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/fi/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/fi/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..c8332a89 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/fi/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/fi/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/fi/LC_MESSAGES/admin.po new file mode 100644 index 00000000..43e9db4e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/fi/LC_MESSAGES/admin.po @@ -0,0 +1,661 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Finnish\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: fi\n" +"X-Crowdin-File: admin.pot\n" +"Language: fi_FI\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Etusivu" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "CLI: Virheellinen komento." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Ladattava tiedosto" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Tarvittava tiedosto." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Virheellinen tiedostotyyppi." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Sisältö" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Nimi ei kelpaa" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Nimi" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "Tiedosto \"%(name)s\" on jo olemassa." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Käyttö estetty." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Tiedostojen lataaminen on poistettu käytöstä." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Onnistuneesti tallennettu tiedosto: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Tiedostoa ei voi tallentaa: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Lataa tiedosto" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Hakemiston luominen on poistettu käytöstä." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Onnistuneesti perustettu hakemistoon: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Ei voi luoda hakemiston: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Luo hakemisto" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Poistaminen on poistettu käytöstä." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Kansion poistaminen on poistettu käytöstä." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Hakemisto \"%(path)s\" poistaminen onnistui." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Ei voinut poistaa hakemistoa: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Poistettiin tiedoston \"%(name)s\"." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Tiedoston poistaminen epäonnistui: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Uudelleennimeäminen ei ole käytettävissä." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Polkua ei ole." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Onnistuneesti nimetty \"%(src)s\" \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Uudelleennimeäminen epäonnistui: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Nimeä %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Virhe tallennettaessa muutoksia %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Muutokset tallennettu %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Virhe käsittelyssä %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Odottamaton virhe luettaessa %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "Ei voi muokata %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Muokkaus %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Poista" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Oletko varma, että haluat poistaa nämä tiedostot?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Tiedoston poistaminen on poistettu käytöstä." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Muokkaa" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "vastaa" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "eri suuri" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "sisältää" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "ei sisällä" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "suurempi kuin" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "pienempi kuin" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "tyhjä" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "-luettelosta" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "ei luettelossa" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "ei välillä" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Ei saanut malli. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Tietueen luominen epäonnistui. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Tietueen luominen epäonnistui. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Tietueen poistaminen epäonnistui. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Oletko varma, että haluat poistaa valitut tietueet?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Tietueen poistaminen onnistui." +msgstr[1] "%(count)s tietueet on poistettu." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Tietueen poistaminen epäonnistui. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Ei ole kelvollinen valinta" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "On jo olemassa." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "" +msgstr[1] "" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Virhe eheydessä. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Virheellinen aikaformaatti" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Virheellinen valinta: ei voitu pakottaa" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "Virheellinen JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Virheellinen tunniste" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "Tiedosto \"%s\" on jo olemassa." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Näytettäviä kohteita ei ole taulukossa." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Virheellinen suodattimen arvo: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Tietue on luotu." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Tietuetta ei ole." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Tietueen tallentaminen onnistui." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "" + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Kyllä" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "Ei" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "välillä" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Näytä tietue" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Tietueen Muokkaaminen" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "Valittu" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Tallenna" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Peruuta" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Root" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Lajittele %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Nimeä tiedosto uudelleen" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Oletko varma, että haluat poistaa \\'%(name)s\\' rekursiivisesti?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Oletko varma, että haluat poistaa \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Valitse vähintään yksi tiedosto." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Luettelo" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Luo" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Suodata" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Poista?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Lisää" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Lisää suodatin" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Sovelletaan" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Palauta suodattimet" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Etsi" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Luo Uusi Tietue" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Valitse kaikki tietueet" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Valitse tietue" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Valitse vähintään yksi tietue." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Oletko varma, että haluat poistaa tämän tietueen?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/fr/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/fr/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..b1b397e4 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/fr/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/fr/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/fr/LC_MESSAGES/admin.po new file mode 100644 index 00000000..0884b6d2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/fr/LC_MESSAGES/admin.po @@ -0,0 +1,661 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: French\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: fr\n" +"X-Crowdin-File: admin.pot\n" +"Language: fr_FR\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Accueil" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "CLI : Commande non valide." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Fichier à déposer" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Fichier requis." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Type de fichier invalide." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Contenu" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Nom invalide" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Nom" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "Le fichier \"%(name)s\" existe déjà." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Autorisation refusée." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Dépose de fichier désactivée." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Fichier enregistré avec succès : %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Échec dans la sauvegarde du fichier: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Déposer un fichier" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "La création de répertoire est désactivée." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Répertoire est créé avec succès : %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Échec dans la création du fichier: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Créer un répertoire" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "La suppression est désactivée." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "La suppression de répertoire est désactivée." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Répertoire «%(path)s » a été supprimé avec succès." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Échec dans la suppression du répertoire: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Le fichier \"%(name)s\" a bien été supprimé." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Échec dans la suppression du fichier: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Le renommage est désactivé." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Le chemin n'existe pas." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "\"%(src)s\" a bien été renommé en \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Échec dans le renommage: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Renommer %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Erreur d'enregistrement des modifications dans %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Changements à %(name)s enregistré avec succès." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Erreur lecture %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Erreur inattendue lors de la lecture de %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "Impossible de modifier %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Montage %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Supprimer" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Êtes-vous bien sûr de vouloir supprimer ces fichiers?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Suppression des fichiers est désactivée." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Editer" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "vaut" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "est différent de" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "contient" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "ne contient pas" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "plus grand que" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "plus petit que" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "vide" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "dans la liste" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "pas dans la liste" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "pas entre" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Impossible d'obtenir le modèle. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Échec dans la création de l'objet. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Échec dans la mise à jour de l'objet. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Échec dans la suppression de l'objet: %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Êtes-vous bien sûr de vouloir supprimer ces objets?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "L'objet a bien été détruit." +msgstr[1] "Les %(count)s objets ont bien été détruits." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Échec dans la suppression des objets: %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Choix incorrect" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Existe déjà." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "Au moins %(num)d items sont obligatoires" +msgstr[1] "Au moins %(num)d objets sont requis" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Erreur d'intégrité. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Format temporel invalide" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Choix non accepté: ne peut pas forcer la valeur" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "JSON non valide" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Extension de fichier invalide" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "Le fichier \"%s\" existe déjà dans le répertoire de destination." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Il n'y a aucun élément dans le tableau." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Valeur de filtre non valide : %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "L'objet a bien été créé." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Aucun enregistrement n'existe." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "A été enregistrée avec succès." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "La dépendance Tablib n'est pas installé." + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Oui" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "Non" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "entre" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Afficher L'enregistrement" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Modifier enregistrement" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "Avec la sélection" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Enregistrer" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Annuler" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "Enregistrer et en ajouter un autre" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "Enregistrer et continuer à éditer" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Racine" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Trier par %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Renommer Le Fichier" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Êtes-vous bien sûr de vouloir supprimer \\'%(name)s\\' récursivement?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Êtes-vous bien sûr de vouloir supprimer \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Veuillez sélectionner au moins un fichier." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Liste" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Créer" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "Détails" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Filtre" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Supprimer?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "Nouveau" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Ajouter" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Ajouter un filtre" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "Export" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Appliquer" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Filtres réinitialisés" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Chercher" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Créer Nouvel Enregistrement" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Sélectionner tous les enregistrements" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Sélectionner l'enregistrement" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Veuillez choisir au moins un modèle." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Êtes-vous bien sûr de vouloir supprimer cet objet?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/he/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/he/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..e6733d18 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/he/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/he/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/he/LC_MESSAGES/admin.po new file mode 100644 index 00000000..fe8beac7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/he/LC_MESSAGES/admin.po @@ -0,0 +1,665 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Hebrew\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3;\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: he\n" +"X-Crowdin-File: admin.pot\n" +"Language: he_IL\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "הבית" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "Cli: פקודה לא חוקית." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "קובץ לטעינה" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "קובץ הדרוש." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "סוג קובץ לא חוקי." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "תוכן" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "שם לא חוקי" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "שם" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "קובץ \"%(name)s\" כבר קיים." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr ". נדחית." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "העלאת קובץ אינו זמין." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "הקובץ שנשמר בהצלחה: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "שמירת הקובץ נכשלה: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "העלאת קובץ" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "מדריך יצירה אינו זמין." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "מדריך שנוצרו בהצלחה: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "יצירת ספריה נכשלה: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "ליצור ספריה" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "מחיקה אינה זמינה." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "מדריך המחיקה אינה זמינה." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "מדריך \"%(path)s\" נמחק בהצלחה." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "מחיקת ספריה נכשלה: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "קובץ \"%(name)s\" נמחק בהצלחה." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "מחיקת הקובץ נכשלה: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "שינוי שם אינו זמין." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "הנתיב אינו קיים." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "בהצלחה ששמם \"%(src)s\" ל \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "לא ניתן לשנות שם: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "שינוי שם %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "שגיאה בעת שמירת שינויים %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "שינויים %(name)s שנשמרו בהצלחה." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "שגיאה בקריאה %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "שגיאה לא צפויה במהלך הקריאה מתוך %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "לא ניתן לערוך %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "עריכת %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "מחק" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "האם אתה בטוח שברצונך למחוק את הקבצים הללו?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "מחיקת קבצים אינו זמין." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "עריכה" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "שווה ל-" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "לא שווה" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "מכיל" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "לא מכיל" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "גדול מ-" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "קטן יותר" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "ריק" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "ברשימה" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "לא ברשימה" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "לא בין" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "מודל נכשלה. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "יצירת רשומה נכשלה. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "יצירת רשומה נכשלה. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "לא ניתן למחוק רשומה. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "האם אתה בטוח שברצונך למחוק את הרשומות שנבחרו?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "שיא נמחק בהצלחה." +msgstr[1] "%(count)s רשומות נמחקו בהצלחה." +msgstr[2] "%(count)s רשומות נמחקו בהצלחה." +msgstr[3] "%(count)s רשומות נמחקו בהצלחה." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "לא ניתן למחוק רשומה. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "לא אפשרו" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "כבר קיים." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "" +msgstr[1] "" +msgstr[2] "" +msgstr[3] "" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "שגיאה שלמות. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "תבנית השעה לא חוקי" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "בחירה לא חוקית: לא יכול לאלץ" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "JSON לא חוקי" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "סיומת קובץ לא חוקי" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "קובץ \"%s\" כבר קיים." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "לא קיימים פריטים בטבלה." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "ערך לא חוקי מסנן: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "הרשומה נוצרה בהצלחה." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "רשומה אינה קיימת." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "הרשומה נשמרה בהצלחה." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "" + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "כן" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "לא" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "לא" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "רשומת התצוגה" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "לערוך רשומה" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "עם נבחרת" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "שמור" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "ביטול" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "שורש" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "מיין לפי %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "שינוי שם של קובץ" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "האם אתה בטוח שברצונך למחוק את \\'%(name)s\\' באופן רקורסיבי?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "האם אתה בטוח שברצונך למחוק את \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "נא בחר קובץ אחד לפחות." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "הרשימה" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "צור" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "מסנן" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "מחק?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "להוסיף" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "להוסיף מסנן" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "החל" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "איפוס מסננים" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "חיפוש" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "יצירת רשומה חדשה" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "בחר כל הרשומות" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "בחר רשומה" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "נא בחר רשומה אחת לפחות." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "האם אתה בטוח שברצונך למחוק רשומה זו?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/hu/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/hu/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..b42cf2c9 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/hu/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/hu/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/hu/LC_MESSAGES/admin.po new file mode 100644 index 00000000..ba449f48 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/hu/LC_MESSAGES/admin.po @@ -0,0 +1,661 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Hungarian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: hu\n" +"X-Crowdin-File: admin.pot\n" +"Language: hu_HU\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Kezdőlap" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "CLI: Érvénytelen parancs." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Feltöltendő fájl" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Fájl szükséges." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Érvénytelen fájltípus." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Tartalom" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Érvénytelen név" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Név" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "\"%(name)s\" fájl már létezik." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Engedély megtagadva." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Fájl feltöltése le van tiltva." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Sikeresen mentett fájl: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Nem sikerült menteni a fájlt: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Fájl feltöltése" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Könyvtár létrehozása le van tiltva." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Sikeresen létrehozott könyvtár: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Nem sikerült létrehozni a könyvtár: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Könyvtár létrehozása" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Törlés le van tiltva." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Könyvtár törlése le van tiltva." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "A \"%(path)s\" könyvtár sikeresen törölve." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Nem sikerült törölni a könyvtárat: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Sikeresen törölte a fájl \"%(name)s\"." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Nem sikerült törölni a fájlt: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Átnevezése le van tiltva." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Elérési út nem létezik." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Sikeresen átnevezve \"%(src)s\", \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Nem sikerült átnevezni a: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Nevezze át a %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Hiba a módosítások mentése a %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Módosítások mentése sikeres %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Hiba olvasó %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Váratlan hiba a következő olvasásakor, a %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "Nem lehet szerkeszteni a %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "%(path)s szerkesztése" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Törlése" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Biztosan törli ezeket a fájlokat?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Fájltörlés le van tiltva." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Szerkesztése" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "egyenlő" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "nem egyenlő" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "tartalmaz" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "nem tartalmaz" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "nagyobb, mint" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "kisebb, mint" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "üres" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "a lista" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "listán nem szereplő" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "nem között" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Nem sikerült lekérni a modell. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Nem sikerült létrehozni a rekord. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Nem sikerült létrehozni a rekord. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Nem sikerült törölni a rekordot. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Biztosan törli a kijelölt rekordokat?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Rekord törlésének sikerességét." +msgstr[1] "%(count)s rekordok törlése sikeres volt." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Nem sikerült törölni a rekordot. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Nem egy érvényes választás" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Már létezik." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "Legalább %(num)d tétel szükség" +msgstr[1] "Legalább %(num)d elemek szükségesek" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Integritási hiba. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Érvénytelen időformátum" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Érvénytelen időformátum" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "Érvénytelen JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Érvénytelen fájlkiterjesztés" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "\"%s\" fájl már létezik." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Vannak olyan cikkek, a táblázatban." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Érvénytelen szűrőérték: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Rekord létrehozása sikeresen megtörtént." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Nem létezik rekord." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Rekord mentése sikeres." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "" + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "igen" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "nem" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "között" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Bejegyzések" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "-Rekord Szerkesztése" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "A kiválasztott" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Mentés" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Mégse" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "Mentés és új hozzáadása" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "Mentés és szerkesztés folytatása" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Gyökér" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "%(name)s rendezés" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Fájl átnevezése" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Biztos, hogy törli a \\'%(name)s\\' rekurzív?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Biztos, hogy törli a \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Jelöljön ki legalább egy fájlt." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Lista" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Létrehozása" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "Részletek" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Szűrő" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Törlése?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "Új" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Add hozzá" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Szűrő hozzáadása" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "Exportálás" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Alkalmazása" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Reset szűrők" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Keresés" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Új Rekord Létrehozása" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Válassza az összes rekord" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Rekord kijelölése" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Jelöljön ki legalább egy bejegyzést." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Biztosan törli ezt a rekordot?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/it/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/it/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..86fe1b39 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/it/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/it/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/it/LC_MESSAGES/admin.po new file mode 100644 index 00000000..a2cf2cdc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/it/LC_MESSAGES/admin.po @@ -0,0 +1,661 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Italian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: it\n" +"X-Crowdin-File: admin.pot\n" +"Language: it_IT\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Pagina Principale" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "Cli: Comando non valido." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "File da caricare" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "File obbligatorio." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Tipo di file non valido." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Contenuto" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Nome non valido" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Nome" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "Il file \"%(name)s\" esiste giá." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Permesso negato." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Il caricamento dei file é stato disabilitato." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "File salvato con successo: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Impossibile salvare il file: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Carica file" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "La creazione di cartelle é disabilitata." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Cartella creata con successo: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Impossibile creare la cartella: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Crea cartella" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "L'eliminazione é disabilitata." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "L'eliminazione di cartelle é disabilitata." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "È stata eliminata la directory \"%(path)s\"." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Impossibile eliminare la cartella: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Il file \"%(name)s\" é stato eliminato correttamente." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Impossibile eliminare il file: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "La rinominazione é disabilitata." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Il percorso non esiste." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "\"%(src)s\" rinominato in \"%(dst)s\" con successo" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Impossibile rinominare: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Rinomina %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Errore nel salvataggio delle modifiche di %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Le modifiche a %(name)s sono state salvate con successo." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Errore di lettura di %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Errore imprevisto durante la lettura di %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "Non è possibile modificare %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Modifica %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Elimina" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Sei sicuro di voler eliminare questi file?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "La cancellazione del file è disattivata." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Modifica" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "Non può funzionare in directory non vuote" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "uguale" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "differente" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "contiene" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "non contiene" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "piú grande di" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "piú piccolo di" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "vuoto" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "nell'elenco" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "non in elenco" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "non tra" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "ObjectId uguale" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Impossibile ottenere il modello. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Impossibile creare il record. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Impossibile aggiornare il record. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Impossibile eliminare il record: %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Sei sicuro di voler eliminare i record selezionati?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Il record é stato eliminato con successo." +msgstr[1] "%(count)s records eliminati con successo." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Impossibile eliminare le righe: %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Scelta non valida" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "Chiave" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "Valore" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Esiste già." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "È necessario almeno %(num)d elemento" +msgstr[1] "Sono necessari almeno %(num)d elementi" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Errore di integrità. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Formato orario non valido" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Scelta non valida: impossibile forzare" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "JSON non valido" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Estensione del file non valida" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "Il file \"%s\" esiste giá." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Non ci sono elementi nella tabella." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Valore del filtro non valido: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Riga aggiunta con successo." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "La riga non esiste." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Record stato salvato con successo." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "Dipendenza Tablib non installata." + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "Esportazione tipo \"%(type)s non supportata." + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Si" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "No" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "tra" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Visualizza riga" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Modifica riga" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "Selezionare un modello" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "Con la selezione" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Salva" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Annulla" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "Salva e aggiungi un altro" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "Salva e continua a modificare" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Categoria principale" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Ordina per %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Rinomina File" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Sei sicuro di voler elminare \\'%(name)s\\' ricorsivamente?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Sei sicuro di voler elminare \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Selezionare almeno un file." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Elenco" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Crea" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "Dettagli" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Filtra" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Eliminare?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "Nuovo" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Aggiungi" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Aggiungi filtro" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "Esporta" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Applica" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Reimposta filtri" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Cerca" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Aggiungi nuova riga" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Seleziona tutti i record" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Seleziona riga" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Selezionare almeno un record." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Sei sicuro di voler eliminare questo record?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/ja/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/ja/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..a0b58b37 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/ja/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/ja/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/ja/LC_MESSAGES/admin.po new file mode 100644 index 00000000..18201bc8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/ja/LC_MESSAGES/admin.po @@ -0,0 +1,659 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Japanese\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: ja\n" +"X-Crowdin-File: admin.pot\n" +"Language: ja_JP\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "ホーム" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "Cli: コマンドが無効です。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "アップロードするファイル" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "ファイルが必要です。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "ファイルの種類が無効です。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "内容" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "名前が無効です。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "名前" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "ファイル「%(name)s」は既に存在します。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "アクセスが拒否されました。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "ファイルのアップロードは無効です" + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "ファイルが正常に保存されました: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "ファイルの保存に失敗しました: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "ファイルのアップロード" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "ディレクトリの作成は無効です" + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "ディレクトリが正常に作成されました: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "ディレクトリの作成に失敗しました: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "ディレクトリを作成" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "削除はできません。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "ディレクトリの削除は無効です" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "ディレクトリ「%(path)s」が正常に削除されました。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "ディレクトリの削除に失敗しました: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "ファイル「%(name)s」が正常に削除されました。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "ファイルの削除に失敗しました: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "名前の変更はできません。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "パスは存在しません。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "「%(src)s」を「%(dst)s」に変更しました。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "名前の変更に失敗しました: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "%(name)s の名前を変更します。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "%(name)s の変更を保存中にエラーが発生しました。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "%(name)s への変更に成功しました。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "%(name)s を読込中にエラーが発生しました。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "%(name)s からの読み取り中に予期しないエラーが発生しました。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "%(name)s が編集できません。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "%(path)s を編集中" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "削除" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "これらのファイルを削除してもよろしいですか。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "ファイルの削除は出来ません。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "編集" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "ディレクトリがからではないため、操作できません" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "等しい" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "等しくない" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "含む" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "含まれていません" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "より大きい" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "より小さい" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "空" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "一覧にある" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "一覧にない" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "間ではなく" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "モデルを取得できませんでした。%(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "レコードの作成に失敗しました。%(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "レコードの更新に失敗しました。%(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "レコードの削除に失敗しました。%(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "選択したレコードを削除してもよろしいですか。" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "%(count)s レコードが正常に削除されました。" + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "レコードの削除に失敗しました。%(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "選択が無効です" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "鍵(キー)" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "値(バリュー)" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "既に存在します。" + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "残り %(num)d 個のアイテムが必要です。" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "整合性エラーが発生しました。%(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "無効な時刻の形式" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "無効な選択: 強制できません。" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "無効な JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "無効なファイル拡張子" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "ファイル「%s」は既に存在します。" + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "表にはアイテムがありません。" + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "無効なフィルター値: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "レコードが正常に作成されました。" + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "レコードが存在しません。" + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "レコードが正常に保存されました。" + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "Tablib の依存関係がインストールされていません。" + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "\"%(type)sエクスポートの種類 はサポートされていません。" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "はい" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "いいえ" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "間" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "レコードを見る" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "レコードを編集" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "選択" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "保存" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "キャンセル" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "保存してもう一つ追加" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "保存して編集を続ける" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "ルート" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "%(name)s による並び替え" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "ファイル名を変更" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "\\'%(name)s\\' を削除するよろしいです ' を再帰的にですか?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "\\本当に '%(name)s\\' を削除してもいいですか?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "少なくとも 1 つのファイルを選択してください。" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "一覧" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "作成" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "詳細" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "移動»" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "削除" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "新規" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "追加" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "フィルターを追加" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "出力" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "適用" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "フィルターをリセット" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "検索" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "新しいレコードを作成" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "すべてのレコードを選択" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "レコードを選択" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "少なくとも1つのレコードを選択してください。" + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "このレコードを削除してもよろしいですか。" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/ko/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/ko/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..eccacf23 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/ko/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/ko/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/ko/LC_MESSAGES/admin.po new file mode 100644 index 00000000..6334aa1c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/ko/LC_MESSAGES/admin.po @@ -0,0 +1,659 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-03-03 00:31-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Korean\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: ko\n" +"X-Crowdin-File: admin.pot\n" +"Language: ko_KR\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "홈" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "Cli: 잘못된 명령입니다." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "파일 업로드" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "필수사항." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "지원되지않는 파일 형식입니다." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "콘텐츠" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "잘못 된 이름" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "이름" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "\"%(name)s\" 파일은 이미 존재합니다." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "권한이 없습니다." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "파일 업로드를 사용할 수 없습니다." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "성공적으로 파일을 저장했습니다: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "파일을 저장하지 못했습니다: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "파일 업로드" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "디렉터리를 만들 수 없습니다." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "성공적으로 디렉터리를 생성했습니다: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "디렉터리 생성실패: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "디렉터리 생성" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "삭제 비활성화" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "디렉토리 삭제 비활성화." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "디렉터리 삭제 성공 \"%(path)s\" " + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "디렉터리를 삭제 실패: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "파일 삭제 성공 \"%(name)s\" " + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "파일삭제 실패: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "이름을 바꿀 수 없습니다." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "경로가 존재하지 않습니다." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "이름변경 성공 \"%(dst)s\" <- 원본:\"%(src)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "이름변경실패: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "이름 변경: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "%(name)s으로 이름변경 중 오류가 발생 했습니다." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "변경된 내용 저장성공 %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "읽기실패 %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "%(name)s 을 읽는 동안 예기치 않은 오류발생." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "%(name)s을 편집할 수 없습니다." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "%(path)s 편집 중" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "삭제" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "파일을 삭제 하겠습니까?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "파일을 삭제할 수 없습니다." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "편집" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "비어 있지 않은 디렉토리에 작업할 수 없습니다." + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "같음" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "같지 않음" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "포함" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "포함되지않은" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "보다 큰" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "보다 작은" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "빈" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "목록에서" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "목록에 없는" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "사이에 존재하지않는" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "ObjectId 같음" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "모델을 가져오는 데 실패하였습니다. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "레코드를 만들지 못했습니다. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "레코드를 업데이트하지 못했습니다. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "레코드를 삭제하지 못했습니다. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "선택한 레코드를 삭제하시겠습니까?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "%(count)s 레코드 성공적으로 삭제되었습니다." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "레코드를 삭제하지 못했습니다. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "유효하지 않은 선택" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "키" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "Value" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "이미 존재합니다." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "최소 %(num)d 개의 항목이 필요합니다." + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "무결성 오류입니다. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "잘못된 시간 형식" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "유효하지 않은 선택: 강제할 수 없습니다." + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "잘못된 JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "잘못된 파일 확장명" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "\"%s\" 파일은 이미 있습니다." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "테이블에 아무 항목도 없습니다." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "잘못된 필터 값: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "레코드가 성공적으로 만들어졌습니다." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "레코드가 없습니다." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "레코드가 저장되었습니다." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "Tablib 종속성 설치 되지 않았습니다." + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "\"%(type)s 타입의 가져오기가 지원되지 않습니다." + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "예" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "없음" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "사이" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "레코드 보기" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "레코드 편집" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "모델을 선택 하십시오" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "선택한 항목들을..." + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "저장" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "취소" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "저장하고 새로 추가" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "저장하고 계속 편집" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "루트" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "%(name)s 정렬" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "파일 이름 바꾸기" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "\\'%(name)s\\' 과 하위 항목을 모두 삭제하시겠습니까?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "\\'%(name)s\\' 를 삭제 하시겠습니까 '?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "최소한 파일 하나를 선택해야 합니다." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "목록" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "생성" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "자세히" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "필터" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "삭제하시겠습니까?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "신규" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "추가" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "필터 추가" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "내보내기" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "적용" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "필터 재설정" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "검색" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "새 레코드 만들기" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "모든 레코드 선택" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "레코드 선택" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "최소한 하나 이상의 레코드를 선택하십시오." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "이 레코드를 삭제 하시겠습니까?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/nl/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/nl/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..972ac78e Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/nl/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/nl/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/nl/LC_MESSAGES/admin.po new file mode 100644 index 00000000..0dd1ac8d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/nl/LC_MESSAGES/admin.po @@ -0,0 +1,661 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Dutch\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: nl\n" +"X-Crowdin-File: admin.pot\n" +"Language: nl_NL\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Thuis" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "Cli: Ongeldige opdracht." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Bestand om te uploaden" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Bestand nodig." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Ongeldig bestandstype." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Inhoud" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Ongeldige naam" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Naam" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "Er bestaat al een bestand \"%(name)s\"." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Toegang geweigerd." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Bestanden uploaden is uitgeschakeld." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Bestand succesvol opgeslagen: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Opslaan van bestand mislukt: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Bestand uploaden" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Mappen maken is uitgeschakeld." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Map succesvol aangemaakt: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Map maken is mislukt: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Map maken" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Verwijderen is uitgeschakeld." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Mappen verwijderen is uitgeschakeld." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Map \"%(path)s\" is succesvol verwijderd." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Fout bij het verwijderen van de map: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Bestand \"%(name)s\" is succesvol verwijderd." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Fout bij het verwijderen van bestand: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Namen wijzigen is uitgeschakeld." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Pad bestaat niet." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Naam succesvol gewijzigd van \"%(src)s\" naar \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Naam wijzigen mislukt: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "%(name)s van naam veranderen" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Fout bij het opslaan van wijzigingen in %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Wijzigingen in %(name)s zijn opgeslagen." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Fout bij het lezen van %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Onverwachte fout bij het lezen van %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "%(name)s kan niet bewerkt worden." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "%(path)s bewerken" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Verwijderen" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Weet u zeker dat u deze bestanden wilt verwijderen?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Het verwijderen van bestanden is uitgeschakeld." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Bewerken" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "Operatie kan alleen worden uitgevoerd op lege mappen" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "gelijk" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "niet gelijk" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "bevat" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "bevat niet" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "groter dan" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "kleiner dan" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "leeg" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "in lijst" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "niet in lijst" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "niet tussen" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Fout bij het ophalen van model. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Is mislukt om record te maken. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Is mislukt om record te maken. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Fout bij het verwijderen van de record. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Weet u zeker dat u wilt verwijderen van geselecteerde records?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Record is met succes verwijderd." +msgstr[1] "%(count)s records zijn met succes verwijderd." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Fout bij het verwijderen van de record. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Niet een geldige keuze" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "Sleutel" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "Waarde" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Er bestaat al." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "Ten minste %(num)d item is vereist" +msgstr[1] "Ten minste %(num)d item is vereist" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Integriteit fout. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Ongeldige tijdnotatie" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Ongeldige keuze: kon niet dwingen" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "Ongeldige JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Ongeldige bestanden met de extensie" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "Er bestaat al een bestand \"%s\"." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Er zijn geen objecten in de tabel." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Ongeldige filterwaarde: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Record is met succes gemaakt." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Record bestaat niet." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Record is met succes opgeslagen." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "Talbib dependency is niet geïnstalleerd." + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "Exporteren naar type %(type)s wordt niet ondersteund." + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Ja" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "No" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "tussen" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Weergave Record" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Een Record Bewerken" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "Met geselecteerd" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Opslaan" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Annuleren" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "Opslaan en nog een item toevoegen" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "Opslaan en blijven bewerken" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Root" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Sorteren op %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Bestand Hernoemen" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Weet u zeker dat u wilt verwijderen van \\'%(name)s\\' recursief?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Weet u zeker dat u wilt verwijderen van \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Selecteer ten minste één bestand." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Lijst" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Maken" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "Details" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Filter" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Verwijderen?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "Nieuw" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Toevoegen" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Filter toevoegen" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "Exporteren" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Toepassing" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Reset Filters" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Zoeken" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Nieuwe Record Maken" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Alle records selecteren" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Record selecteren" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Selecteer ten minste één record." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Weet u zeker dat u wilt verwijderen van deze record?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/no/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/no/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..46b18366 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/no/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/no/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/no/LC_MESSAGES/admin.po new file mode 100644 index 00000000..fe4763d4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/no/LC_MESSAGES/admin.po @@ -0,0 +1,661 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Norwegian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: no\n" +"X-Crowdin-File: admin.pot\n" +"Language: no_NO\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Hjem" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "CLI: Ugyldig kommando." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Fil for opplasting" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Fil er nødvendig." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Ugyldig filtype." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Innhold" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Ugyldig navn" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "navn" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "Filen \"%(name)s\" finnes allerede." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Tillatelse nektet." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Filopplasting er deaktivert." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Lagret fil: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Kan ikke lagre fil: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Filopplasting" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Opprettelse av mappe er deaktivert." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Opprettet mappen: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Kan ikke opprette mappe: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Opprett mappe" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Sletting er deaktivert." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Sletting av mapper er deaktivert." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Mappen \"%(path)s\" ble slettet." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Kan ikke slette mappen: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Filen \"%(name)s\" ble slettet." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Kan ikke slette fil: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Bytte av navn er deaktivert." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Banen finnes ikke." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Endret navn fra \"%(src)s\" til \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Kan ikke gi nytt navn: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Endre %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Feil ved lagring av endringer i %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Endringer i %(name)s lagret." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Feil i lesing av %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Uventet feil under lesing fra %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "Kan ikke redigere %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Redigerer %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Slett" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Er du sikker på at du vil slette disse filene?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Sletting av filer er deaktivert." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Rediger" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "er lik" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "ikke lik" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "inneholder" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "inneholder ikke" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "større enn" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "mindre enn" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "Tom" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "i listen" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "ikke i listen" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "ikke mellom" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Kan ikke hente modell. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Kan ikke opprette posten. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Kan ikke opprette posten. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Kan ikke slette posten. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Er du sikker på at du vil slette valgte oppføringer?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Posten ble slettet." +msgstr[1] "%(count)s poster ble slettet." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Kan ikke slette posten(e). %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Ikke et gyldig valg" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Finnes allerede." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "" +msgstr[1] "" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Integritets feil. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Ugyldig tidsformat" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Ugyldig valg: kan ikke tvinge" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "Ugyldig JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Ugyldig filtype" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "Filen \"%s\" finnes allerede." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Det finnes ingen elementer i tabellen." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Ugyldig filterverdi: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Posten ble opprettet." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Post finnes ikke." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Oppføringen ble lagret." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "" + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "ja" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "nei" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "mellom" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Vis posten" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Rediger Post" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "Med utvalgte" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Lagre" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Avbryt" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Rot" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Sorter etter %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Gi Filen Nytt Navn" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Er du sikker på at du vil slette \\'%(name)s\\' rekursivt?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Er du sikker på at du vil slette \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Velg minst én fil." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Liste" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Opprett" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Filter" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Slette?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Legge til" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Legg til Filter" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Bruk" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Tilbakestille filtre" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Søk" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Opprette Ny Post" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Velg alle poster" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Velg post" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Velg minst én post." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Er du sikker på at du vil slette denne posten?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/pa/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/pa/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..8bc821b4 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/pa/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/pa/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/pa/LC_MESSAGES/admin.po new file mode 100644 index 00000000..60c0eaa3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/pa/LC_MESSAGES/admin.po @@ -0,0 +1,661 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Punjabi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: pa-IN\n" +"X-Crowdin-File: admin.pot\n" +"Language: pa_IN\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "ਹੋਮ" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "Cli: ਨਾ ਵਾਜਿਬ ਕਮਾਂਡ" + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "ਅਪਲੋਡ ਕਰਨ ਲਈ ਫਾਈਲ" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "ਫ਼ਾਈਲ ਜ਼ਰੂਰੀ ਹੈ |" + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "ਗਲਤ ਕਿਸਮ ਦੀ ਫਾਈਲ" + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "ਸਮਗਰੀ" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "ਗਲਤ ਨਾਮ" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "ਨਾਮ" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "ਫ਼ਾਈਲ \"%(name)s\" ਪਹਿਲਾਂ ਹੀ ਮੌਜੂਦ ਹੈ |" + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "ਮਨਜ਼ੂਰੀ ਨਹੀਂ ਹੈ |" + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "ਫ਼ਾਈਲ ਅਪਲੋਡ ਕਰਨ ਤੇ ਰੋਕ ਹੈ |" + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "ਫ਼ਾਈਲ ਕਾਮਯਾਬੀ ਨਾਲ ਸਾਂਭੀ ਗਈ : %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "ਫ਼ਾਈਲ ਸਾਂਭੀ ਨਹੀਂ ਜਾ ਸਕੀ : %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "ਫ਼ਾਈਲ ਅਪਲੋਡ ਕਰੋ" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "ਡਾਇਰੈਕਟਰੀ ਬਣਾਉਣ ਤੇ ਰੋਕ ਹੈ |" + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "ਡਾਇਰੈਕਟਰੀ ਕਾਮਯਾਬੀ ਨਾਲ ਬਣ ਗਈ : %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "ਡਾਇਰੈਕਟਰੀ ਨਹੀਂ ਬਣਾਈ ਜਾ ਸਕੀ : %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "ਡਾਇਰੈਕਟਰੀ ਬਣਾਓ" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "ਮਿਟਾਉਣ ਦੀ ਮਨਾਹੀ ਹੈ |" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "ਡਾਇਰੈਕਟਰੀ ਮਿਟਾਉਣ ਦੀ ਮਨਾਹੀ ਹੈ |" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "ਡਾਇਰੈਕਟਰੀ \"%(path)s\" ਕਾਮਯਾਬੀ ਨਾਲ ਮਿਟਾ ਦਿੱਤੀ ਗਈ |" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "ਡਾਇਰੈਕਟਰੀ ਮਿਟਾਉਣ ਵਿੱਚ ਨਾਕਾਮਯਾਬੀ: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "ਫ਼ਾਈਲ \"%(name)s\" ਕਾਮਯਾਬੀ ਨਾਲ ਮਿਟਾ ਦਿੱਤੀ ਗਈ |" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "ਫ਼ਾਈਲ ਮਿਟਾਉਣ ਵਿੱਚ ਨਾਕਾਮਯਾਬੀ: %(name)s " + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "ਨਾਮ ਬਦਲਣ ਦੀ ਮਨਾਹੀ ਹੈ |" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "ਪਾਥ ਮੌਜੂਦ ਨਹੀਂ ਹੈ |" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "ਨਾਮ \"%(src)s\" ਤੋਂ \"%(dst)s\" ਬਦਲਣ ਵਿੱਚ ਕਾਮਯਾਬੀ |" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "ਨਾਮ ਬਦਲਣ ਵਿੱਚ ਨਾਕਾਮਯਾਬੀ : %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "ਨਾਮ ਬਦਲੋ %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "%(name)s ਵਿੱਚ ਬਦਲਾਅ ਸਾਂਭਣ ਵਿੱਚ ਗਲਤੀ |" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "%(name)s ਵਿੱਚ ਬਦਲਾਅ ਸਾਂਭਣ ਵਿੱਚ ਕਾਮਯਾਬੀ |" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr " %(name)s ਪੜਨ ਵਿੱਚ ਗਲਤੀ |" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "%(name)s ਤੋਂ ਪੜਨ ਵਿੱਚ ਅਚਨਚੇਤ ਗਲਤੀ |" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "%(name)s ਨਹੀਂ ਬਦਲਿਆ ਜਾ ਸਕਦਾ |" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr " %(path)s ਬਦਲਿਆ ਜਾ ਰਿਹਾ " + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "ਮਿਟਾਓ" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "ਕੀ ਤੁਹਾਨੂੰ ਯਕੀਨ ਹੈ ਇੱਕ ਤੁਸੀਂ ਇਹ ਫ਼ਾਈਲਾਂ ਮਿਟਾਉਣੀਆਂ ਚਾਹੁੰਦੇ ਹੋ?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "ਫ਼ਾਈਲ ਮਿਟਾਉਣ ਦੀ ਮਨਾਹੀ ਹੈ |" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "ਬਦਲੋ" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "ਬਰਾਬਰ" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "ਨਾ ਬਰਾਬਰ" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "ਸ਼ਾਮਲ" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "ਸ਼ਾਮਲ ਨਹੀਂ" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "ਤੋਂ ਵੱਧ ਹੈ" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "ਤੋਂ ਘੱਟ ਹੈ" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "ਖਾਲੀ" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "ਸੂਚੀ ਵਿੱਚ ਹੈ" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "ਸੂਚੀ ਵਿੱਚ ਨਹੀਂ ਹੈ " + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "ਵਿਚਾਲੇ ਨਹੀਂ ਹੈ " + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "ਮੌਡਲ ਕੱਢਣ ਵਿੱਚ ਨਾਕਾਮਯਾਬੀ | %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "ਰਿਕਾਰਡ ਬਨਾਉਣ ਵਿੱਚ ਨਾਕਾਮਯਾਬੀ | %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "ਰਿਕਾਰਡ ਬਦਲਣ ਵਿੱਚ ਨਾਕਾਮਯਾਬੀ | %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "ਰਿਕਾਰਡ ਮਿਟਾਉਣ ਵਿੱਚ ਨਾਕਾਮਯਾਬੀ | %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "ਕੀ ਤੁਹਾਨੂੰ ਯਕੀਨ ਹੈ ਕਿ ਤੁਸੀਂ ਚੁਣੇ ਹੋਏ ਰਿਕਾਰਡ ਮਿਟਾਉਣਾ ਚਾਹੁੰਦੇ ਹੋ?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "ਰਿਕਾਰਡ ਕਾਮਯਾਬੀ ਨਾਲ ਮਿਟਾਇਆ ਗਿਆ |" +msgstr[1] "%(count)s ਰਿਕਾਰਡ ਕਾਮਯਾਬੀ ਨਾਲ ਮਿਟਾਏ ਗਏ |" + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "ਰਿਕਾਰਡ ਮਿਟਾਉਣ ਵਿੱਚ ਨਾਕਾਮਯਾਬੀ | %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "ਸਹੀ ਚੋਣ ਨਹੀਂ ਹੈ " + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "ਪਹਿਲਾਂ ਹੀ ਮੌਜੂਦ ਹੈ |" + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "" +msgstr[1] "" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "ਪੂਰਨਤਾ ਗਲਤੀ| %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "ਨਾ ਵਾਜਿਬ ਟਾਈਮ ਫ਼ੌਰਮੈਟ" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "ਨਾ ਵਾਜਿਬ ਚੋਣ : ਮਜ਼ਬੂਰ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ " + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "ਨਾ ਵਾਜਿਬ JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "ਨਾ ਵਾਜਿਬ ਫ਼ਾਈਲ ਐਕਸਟੇਨਸ਼ਨ" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "ਫ਼ਾਈਲ \"%s\" ਪਹਿਲਾਂ ਹੀ ਮੌਜੂਦ ਹੈ |" + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "ਟੇਬਲ ਵਿੱਚ ਕੋਈ ਸ਼ੈ ਨਹੀਂ ਹੈ |" + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "ਨਾ ਵਾਜਿਬ ਫਿਲਟਰ ਸੰਖਿਆ: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "ਰਿਕੌਰਡ ਕਾਮਯਾਬੀ ਨਾਲ ਬਣਾਇਆ ਗਿਆ |" + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "ਦਾ ਰਿਕਾਰਡ ਮੌਜੂਦ ਨਹੀ ਹੈ." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "ਰਿਕੌਰਡ ਕਾਮਯਾਬੀ ਨਾਲ ਸਾਂਭਿਆ ਗਿਆ |" + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "" + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "ਹਾਂ" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "ਨਹੀਂ" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "ਵਿਚਕਾਰ" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "ਵੇਖੋ ਰਿਕਾਰਡ" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "ਰਿਕੌਰਡ ਬਦਲੋ" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "ਚੁਣੇ ਹੋਏ ਨੂੰ" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "ਸਾਂਭੋ" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "ਰੱਦ ਕਰੋ" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "ਜੜ" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "%(name)s ਮੁਤਾਬਿਕ ਸ਼੍ਰੇਣੀਬੱਧ ਕਰੋ" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "ਫ਼ਾਈਲ ਦਾ ਨਾਮ ਬਦਲੋ" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "ਕੀ ਤੁਹਾਨੂੰ ਯਕੀਨ ਹੈ ਕਿ ਤੁਸੀਂ \\'%(name)s\\' ਅਤੇ ਇਸਦੇ ਵਿਚਲੀਆਂ ਸ਼ੈਆਂ ਨੂੰ ਮਿਟਾਉਣਾ ਚਾਹੁੰਦੇ ਹੋ?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "ਕੀ ਤੁਹਾਨੂੰ ਯਕੀਨ ਹੈ ਕਿ ਤੁਸੀਂ \\'%(name)s\\' ਨੂੰ ਮਿਟਾਉਣਾ ਚਾਹੁੰਦੇ ਹੋ?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "ਕਿਰਪਾ ਕਰਕੇ ਘੱਟੋ ਘੱਟ ਇੱਕ ਫ਼ਾਈਲ ਚੁਣੋ |" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "ਲਿਸਟ" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "ਬਣਾਓ" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "ਫਿਲਟਰ" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "ਮਿਟਾਓ?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "ਜੋੜੋ" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "ਫਿਲਟਰ ਜੋੜੋ" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "ਲਾਗੂ ਕਰੋ" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "ਫਿਲਟਰ ਬਦਲੋ" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "ਲੱਭੋ" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "ਨਵਾਂ ਰਿਕੌਰਡ ਬਣਾਓ" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "ਸਾਰੇ ਰਿਕੌਰਡ ਚੁਣੋ" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "ਰਿਕੌਰਡ ਚੁਣੋ" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "ਕਿਰਪਾ ਕਰਕੇ ਘੱਟੋ ਘੱਟ ਇੱਕ ਰਿਕੌਰਡ ਜਰੂਰ ਚੁਣੋ |" + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "ਕੀ ਤੁਹਾਨੂੰ ਯਕੀਨ ਹੈ ਕਿ ਤੁਸੀਂ ਰਿਕੌਰਡ ਮਿਟਾਉਣਾ ਚਾਹੁੰਦੇ ਹੋ?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/pl/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/pl/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..f243a233 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/pl/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/pl/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/pl/LC_MESSAGES/admin.po new file mode 100644 index 00000000..54bea475 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/pl/LC_MESSAGES/admin.po @@ -0,0 +1,663 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Polish\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: pl\n" +"X-Crowdin-File: admin.pot\n" +"Language: pl_PL\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Strona główna" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "Cli: Nieprawidłowe polecenie." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Plik do wgrania" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Plik wymagany." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Nieprawidłowy typ pliku." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Zawartość" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Nieprawidłowa nazwa" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Nazwa" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "Plik \"%(name)s\" już istnieje." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Odmowa uprawnień." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Wgrywanie plików jest wyłączone." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Plik zapisany pomyślnie: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Nie można zapisać pliku: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Prześlij plik" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Tworzenie katalogu jest wyłączona." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Katalog utworzony pomyślnie: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Nie można utworzyć katalogu: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Utwórz katalog" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Usunięcie jest wyłączona." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Usunięcie katalogu jest wyłączona." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Katalog \"%(path)s\" zostało pomyślnie usunięte." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Nie można usunąć katalog: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Pomyślnie usunięto plik \"%(name)s\"." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Nie można usunąć pliku: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Zmiana nazwy jest wyłączona." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Ścieżka nie istnieje." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Pomyślnie zmieniono nazwę \"%(src)s\" na \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Nie udało się zmienić nazwy: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Zmień nazwę %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Wystąpił błąd podczas zapisywania zmian na %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Zmiany %(name)s zapisane pomyślnie." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Błąd odczytu %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Wystąpił nieoczekiwany błąd podczas odczytu z %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "Nie można edytować %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Edycja %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Usuń" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Czy na pewno chcesz usunąć te pliki?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Usuwanie pliku jest wyłączone." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Edycja" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "Nie może operować na niepustych katalogach" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "jest równe" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "nie równe" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "zawiera" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "nie zawiera" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "większe niż" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "mniejsze niż" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "puste" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "na liście" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "nie na liście" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "nie pomiędzy" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Nie udało się uzyskać modelu. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Nie udało się utworzyć rekordu. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Nie udało się zaktualizować rekordu. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Nie można usunąć rekordu. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Czy na pewno chcesz usunąć zaznaczone rekordy?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Rekord został pomyślnie usunięty." +msgstr[1] "%(count)s rekordy zostały pomyślnie usunięte." +msgstr[2] "%(count)s rekordy zostały pomyślnie usunięte." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Nie można usunąć rekordów. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Nieprawidłowy wybór" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "Klucz" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "Wartość" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Już istnieje." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "Przynajmniej %(num)d element jest wymagany" +msgstr[1] "Przynajmniej %(num)d elementy są wymagane" +msgstr[2] "Przynajmniej %(num)d elementów jest wymaganych" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Błąd integralności. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Nieprawidłowy format czasu" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Nieprawidłowy wybór: nie można zmusić" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "Nieprawidłowy JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Nieprawidłowe rozszerzenie pliku" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "Plik \"%s\" już istnieje." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Nie istnieją pozycje w tabeli." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Nieprawidłowa wartość filtru: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Rekord został utworzony pomyślnie." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Rekord nie istnieje." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Rekord został pomyślnie zapisany." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "Zależność Tablib nie zainstalowana." + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "Niewspierany typ eksportowy \"%(type)s." + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Tak" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "Nie" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "pomiędzy" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Zobacz rekord" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Edytuj Rekord" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "Z wybranych" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Zapisz" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Anuluj" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "Zapisz i dodaj kolejny" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "Zapisz i kontynuuj edycję" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Korzeń" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Sortuj według %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Zmień nazwę pliku" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Czy na pewno chcesz usunąć rekursywnie \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Czy na pewno chcesz usunąć \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Wybierz co najmniej jeden plik." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Lista" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Tworzenie" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "Szczegóły" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Filtr" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Usunąć?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "Nowy" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Dodaj" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Dodaj filtr" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "Eksport" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Zastosuj" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Zresetuj filtry" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Szukaj" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Utwórz nowy rekord" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Zaznacz wszystkie rekordy" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Zaznacz rekord" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Wybierz co najmniej jeden rekord." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Czy na pewno chcesz usunąć ten rekord?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/pt/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/pt/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..804cc383 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/pt/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/pt/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/pt/LC_MESSAGES/admin.po new file mode 100644 index 00000000..e1f21d0d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/pt/LC_MESSAGES/admin.po @@ -0,0 +1,661 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Portuguese\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: pt-PT\n" +"X-Crowdin-File: admin.pot\n" +"Language: pt_PT\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Início" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "Cli: Comando inválido" + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Ficheiro para carregar" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Arquivo requerido." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Tipo de arquivo inválido." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Conteúdo" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Nome inválido" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Nome" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "O arquivo \"%(name)s\" já existe." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Permissão negada." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "O Upload de arquivos está desabilitado." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Arquivo salvo com êxito: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Falha ao gravar arquivo: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Carregar Ficheiro" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "A criação de diretórios está desabilitada." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Diretório criado com sucesso: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Falha ao criar diretório: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Criar diretório" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Exclusão está desabilitada." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Exclusão de diretórios está desabilitada" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Diretório \"%(path)s\" foi excluído com sucesso." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Falha ao excluir diretório: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Arquivo \"%(name)s\" foi excluído com sucesso." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Falha ao excluir arquivo: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Renomear está desabilitado." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "O caminho não existe." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Renomeado com sucesso: de \"%(src)s\" para \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Falha ao renomear: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Renomeie %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Erro ao salvar alterações para %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Alterações para %(name)s salvas com sucesso." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Erro ao ler %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Erro inesperado ao ler %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "Não é ṕossível editar %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Edição %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Excluir" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Você tem certeza que deseja excluir estes arquivos?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Exclusão de arquivos desabilitada." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Editar" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "igual" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "diferente" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "contém" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "não contém" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "maior que" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "menor que" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "vazio" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "na lista" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "Não está na lista" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "Não entre" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Falha ao obter model. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Falha ao criar model. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Falha ao atualizar model. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Falha ao excluir model. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Você tem certeza que deseja excluir os models selecionados?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Registo eliminado com sucesso." +msgstr[1] "%(count)s registos foram eliminados com sucesso." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Falha ao excluir models. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Não é uma escolha válida" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Já existe." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "" +msgstr[1] "" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Erro de integridade. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Formato de hora inválido" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Escolha inválida: não é possível converter" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "JSON inválido" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Extensão de arquivo inválida" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "O \"%s\" já existe." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Não existem itens na tabela." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Valor de filtro inválido: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Model criado com sucesso." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Registro não existe." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Model salvo com sucesso." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "" + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Sim" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "Não" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "entre" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Mostrar Registo" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Editar Registro" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "Com o(s) selecionado(s)" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Salvar" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Cancelar" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "Guardar e Adicionar Outro" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "Guardar e Continuar a Editar" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Raíz" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Ordenar por %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Renomear Arquivo" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Você tem certeza que deseja excluir \\'%(name)s\\' recursivamente?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Você tem certeza que deseja excluir \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Por favor, selecione pelo menos um arquivo." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Listar" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Criar" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "Detalhes" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Filtro" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Excluir?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Adicionar" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Adicionar Filtro" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "Exportar" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Aplicar" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Limpar Filtros" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Pesquisar" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Criar Novo Registro" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Selecionar todos os registros" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Selecionar registro" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Por favor, selecione pelo menos um model." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Você tem a certeza que deseja excluir este item?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/pt_BR/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/pt_BR/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..d7ce7192 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/pt_BR/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/pt_BR/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/pt_BR/LC_MESSAGES/admin.po new file mode 100644 index 00000000..9f867111 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/pt_BR/LC_MESSAGES/admin.po @@ -0,0 +1,661 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Portuguese, Brazilian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: pt-BR\n" +"X-Crowdin-File: admin.pot\n" +"Language: pt_BR\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Início" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "Cli: Comando inválido." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Arquivo para upload" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Arquivo requerido." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Tipo de arquivo inválido." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Conteúdo" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Nome inválido" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Nome" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "O arquivo \"%(name)s\" já existe." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Permissão negada." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "O Upload de arquivos está desabilitado." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Arquivo salvo com êxito: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Falha ao gravar arquivo: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Upload de arquivo" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "A criação de diretórios está desabilitada." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Diretório criado com sucesso: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Falha ao criar diretório: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Criar diretório" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Exclusão está desabilitada." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Exclusão de diretórios está desabilitada." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Diretório \"%(path)s\" foi excluído com sucesso." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Falha ao excluir diretório: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Arquivo \"%(name)s\" foi excluído com sucesso." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Falha ao excluir arquivo: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Renomear está desabilitado." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "O caminho não existe." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Renomeado com sucesso: de \"%(src)s\" para \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Falha ao renomear: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Renomeie %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Erro ao salvar alterações para %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Alterações para %(name)s salvas com sucesso." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Erro ao ler %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Erro inesperado ao ler %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "Não é ṕossível editar %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Edição %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Excluir" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Você tem certeza que deseja excluir estes arquivos?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Exclusão de arquivos desabilitada." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Editar" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "Não é possível operar em diretórios não-vazios" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "igual" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "diferente" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "contém" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "não contém" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "maior que" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "menor que" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "vazio" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "na lista" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "Não está na lista" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "não entre" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "ObjectId é igual a" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Falha ao obter registro. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Falha ao criar o registro. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Falha ao atualizar registro. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Falha ao excluir o registro. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Tem certeza que deseja excluir os registros selecionados?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Registro foi excluído com êxito." +msgstr[1] "%(count)s registros foram excluídos com êxito." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Falha ao excluir registros. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Não é uma escolha válida" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "Chave" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "Valor" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Já existe." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "Pelo menos %(num)d item é exigido" +msgstr[1] "Pelo menos %(num)d itens são exigidos" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Erro de integridade. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Formato de hora inválido" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Escolha inválida: não é possível converter" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "JSON inválido" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Extensão de arquivo inválida" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "O \"%s\" já existe." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Não existem itens na tabela." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Valor de filtro inválido: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Registro criado com sucesso." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Registro não existe." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Registro salvo com sucesso." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "Depedência Tablib não instalada." + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "Tipo de exportação \"%(type)s não é suportado." + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Sim" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "Não" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "entre" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Exibir registro" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Editar Registro" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "Por favor, selecione o modelo" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "Com selecionado" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Salvar" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Cancelar" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "Salvar e adicionar outro" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "Salvar e continuar editando" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Raíz" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Ordenar por %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Renomear arquivo" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Você tem certeza que deseja excluir \\'%(name)s\\' recursivamente?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Você tem certeza que deseja excluir \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Por favor, selecione pelo menos um arquivo." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Listar" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Criar" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "Detalhes" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Filtro" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Excluir?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "Novo" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Adicionar" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Adicionar Filtro" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "Exportar" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Aplicar" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Limpar Filtros" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Pesquisar" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Criar Novo Registro" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Selecionar todos os registros" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Selecionar registro" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Por favor, selecione pelo menos um registro." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Você tem certeza que deseja excluir este item?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/ro/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/ro/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..4ed230f2 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/ro/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/ro/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/ro/LC_MESSAGES/admin.po new file mode 100644 index 00000000..359a4e87 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/ro/LC_MESSAGES/admin.po @@ -0,0 +1,663 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Romanian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : (n==0 || (n%100>0 && n%100<20)) ? 1 : 2);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: ro\n" +"X-Crowdin-File: admin.pot\n" +"Language: ro_RO\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Acasă" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "CLI: Comanda Invalid." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Dosar la spre încărcat" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Fişier necesare." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Invalid tip de fişier." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Conţinut" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Nume nevalid" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "nume" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "Fişier \"%(name)s\" există deja." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Permisiune refuzată." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Încărcarea fişierelor este dezactivat." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Fişier salvat cu succes: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Nu a reuşit să salvaţi fişier: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Încărcaţi fişier" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Crearea de director este dezactivat." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Director cu succes creat: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Imposibil de creat Director: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Crea Director" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Ştergerea este dezactivat." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Director stergerea este dezactivat." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Director \"%(path)s\" a fost şters cu succes." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Imposibil de șters Director: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Fişier \"%(name)s\" a fost şters cu succes." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Imposibil de șters fişier: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Redenumirea este dezactivat." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Cale nu exista." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Cu succes redenumit \"%(src)s\" la \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Nu a reuşit să redenumiţi: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Redenumiţi %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Eroare la salvarea modificărilor la %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Modificări %(name)s salvat cu succes." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Eroare citire %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Eroare neașteptată în timp ce citirea de la %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "Imposibil de editat %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Editare %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Ştergeţi" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Sunteţi sigur că doriţi să ştergeţi aceste fişiere?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Ştergere fişier este dezactivat." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Editare" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "este egal cu" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "nu este egal" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "conţine" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "nu conţine" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "mai mare decât" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "mai mică decât" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "gol" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "în lista" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "nu în lista" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "nu între" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Nu pentru a obţine model. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Nu a reuşit să creaţi înregistrarea. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Nu a reuşit să creaţi înregistrarea. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Imposibil de șters înregistrări. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Sigur ștergeți înregistrările selectate?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Recordul a fost şters cu succes." +msgstr[1] "%(count)s înregistrări au fost şters cu succes." +msgstr[2] "%(count)s înregistrări au fost şters cu succes." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Imposibil de șters înregistrări. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Nu o alegere valabilă" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Există deja." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "" +msgstr[1] "" +msgstr[2] "" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Eroare de integritate. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Format nevalid timp" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Alegerea nevalid: nu ar putea constrânge" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "JSON valid" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Extensia de fişier nevalid" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "Fişier \"%s\" există deja." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Nu există elemente în masă." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Valoare nevalidă filtru: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Recordul a fost creat cu succes." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Nu există înregistrare." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Înregistrarea a fost salvată cu succes." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "" + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "da" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "nu" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "între" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Vezi Record" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Editaţi înregistrarea" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "Cu selectate" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Salvaţi" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Revocare" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Rădăcină" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Un fel de %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Redenumiţi Fişierul" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Sunteţi sigur că doriţi să ştergeţi \\'%(name)s\\' recursiv?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Sunteţi sigur că doriţi să ştergeţi \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Vă rugăm să selectaţi cel puţin un fişier." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Lista" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Crea" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Filtrare" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Ştergeţi?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Adauga" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Adauga filtru" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Se aplică" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Resetaţi filtrele" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Căutare" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Creare Nou Record" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Selectaţi toate înregistrările" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Selectaţi înregistrare" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Vă rugăm să selectaţi cel puţin o înregistrare." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Sigur ștergeți această înregistrare?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/ru/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/ru/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..e697d9c8 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/ru/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/ru/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/ru/LC_MESSAGES/admin.po new file mode 100644 index 00000000..e288a57b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/ru/LC_MESSAGES/admin.po @@ -0,0 +1,663 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-13 09:18-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Russian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: ru\n" +"X-Crowdin-File: admin.pot\n" +"Language: ru_RU\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Главная" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "CLI: Недопустимая команда." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Файл для загрузки" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Необходимо выбрать файл" + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Недопустимый тип файла." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Содержимое сайта" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Недопустимое имя" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Имя" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "Файл с именем \"%(name)s\" уже существует." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Доступ запрещён." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Загрузка файлов запрещена." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Файл успешно сохранён: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Ошибка сохранения файла: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Загрузить файл" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Создание новых директорий запрещено." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Каталог успешно создан: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Ошибка создания директории: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Создать директорию" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Удаление запрещено." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Удаление директорий запрещено." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Каталог «%(path)s» был успешно удален." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Ошибка удаления директории: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Файл \"%(name)s\" был удален." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Ошибка удаления файла: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Переименование отключено." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Путь не существует." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "\"%(src)s\" был переименован в \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Ошибка переименования: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Переименовать %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Ошибка при сохранении изменений в %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Изменения в %(name)s успешно сохранены." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Ошибка чтения %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Непредвиденная ошибка при чтении из %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "Не удается изменить %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Редактирование %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Удалить" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Вы уверены что хотите удалить эти файлы?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Удаление файлов отключено." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Изменить" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "Невозможно редактировать непустые директории" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "равно" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "не равно" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "содержит" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "не содержит" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "больше чем" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "меньше чем" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "пусто" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "в списке" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "нет в списке" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "не между" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "Id объекта равно" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Не удалось получить модель. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Ошибка создания записи: %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Ошибка обновления записи: %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Ошибка удаления записи: %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Вы уверены что хотите удалить ?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Запись успешно удалена." +msgstr[1] "Было удалено %(count)s записей." +msgstr[2] "Было удалено %(count)s записей." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Не удалось удалить записи. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Неверный вариант" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "Ключ" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "Значение" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Уже существует." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "По крайней мере %(num)d элемент требуется" +msgstr[1] "По крайней мере %(num)d элемента требуется" +msgstr[2] "По крайней мере %(num)d элементов требуется" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Ошибка целостности. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Неправильный формат времени." + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Неверный вариант: невозможно преобразовать" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "Недопустимый JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Недопустимое расширение" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "Файл с именем \"%s\" уже существует." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Нет элементов в таблице." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Недопустимое значение фильтра: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Запись была создана." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Запись не существует." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Запись была сохранена." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "Tablib не установлена." + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "Экспорт в формате %(type)s не поддерживается." + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Да" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "Нет" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "между" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Просмотр записи" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Редактировать запись" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "Пожалуйста, выберите модель" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "С выбранным" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Сохранить" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Отмена" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "Сохранить и добавить новый объект" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "Сохранить и продолжить редактирование" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Корень" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Сортировать по %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Переименовать файла" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Вы уверены что хотите рекурсивно удалить \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Вы уверены что хотите удалить \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "Размер" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Выберите по крайней мере один файл." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Список" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Создать" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "Подробнее" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Фильтровать" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Удалить?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "Новый" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Добавить" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Добавить Фильтр" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "Экспортировать" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Применить" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Сброс Фильтров" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Поиск" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "элементы" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Создать новую запись" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Выбрать все записи" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Выберите запись" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Выберите по крайней мере одну запись." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Вы уверены что хотите удалить эту запись?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/sk/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/sk/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..e54c0e22 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/sk/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/sk/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/sk/LC_MESSAGES/admin.po new file mode 100644 index 00000000..2396f78a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/sk/LC_MESSAGES/admin.po @@ -0,0 +1,663 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Slovak\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: sk\n" +"X-Crowdin-File: admin.pot\n" +"Language: sk_SK\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Domov" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "CLI: Neplatný príkaz." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Súbor na nahranie" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Súbor je požadovaný." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Nesprávny formát súboru." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Obsah" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Nesprávny názov" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Názov" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "Súbor s názvom \"%(name)s\" už existuje." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Nepovolený prístup." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Nahrávanie súborov nie je povolené." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Súbor s názvom %(name)s bol úspešne uložený" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Nepodarilo sa uložiť súbor: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Nahrať súbor" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Vytváranie adresárov je zakázané." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Adresár: %(directory)s bol úspešne vytvorený" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Nepodarilo sa vytvoriť adresár: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Vytvoriť adresár" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Mazanie je zakázané." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Mazanie adresárov je zakázané." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Adresár \"%(path)s\" bol úspešne odstránený." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Nepodarilo sa odstrániť adresár: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Súbor s názvom \"%(name)s\" bol úspešne odstránený." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Nepodarilo sa odstrániť súbor: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Premenovanie je zakázané." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Cesta k súboru neexistuje." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Úspešne premenované z \"%(src)s\" na \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Nepodarilo sa premenovať: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Premenovať %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Chyba pri ukladaní zmien do %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Zmeny %(name)s boli úspešne uložené." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Chyba pri čítaní %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Neočakávaná chyba pri čítaní z %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "%(name)s sa nedá upraviť." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Editovať %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Vymazať" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Naozaj chcete odstrániť tieto súbory?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Mazanie súborov je zakázané." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Upraviť" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "Nedá sa pracovať s prázdnymi adresármi" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "rovná sa" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "nerovná sa" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "obsahuje" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "neobsahuje" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "viac než" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "menej než" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "prázdne" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "v zozname" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "nie je v zozname" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "nie je medzi" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Nepodarilo sa získať model. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Nepodarilo sa vytvoriť záznam. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Nepodarilo sa aktualizovať záznam. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Nepodarilo sa odstrániť záznam. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Naozaj chcete odstrániť vybrané záznamy?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Záznam bol úspešne odstránený." +msgstr[1] "%(count)s záznamy boli úspešne odstránené." +msgstr[2] "%(count)s záznamov bolo úspešne odstránených." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Nepodarilo sa odstrániť záznam. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Nie je platným výberom" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "Kľúč" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "Hodnota" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Už existuje." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "Minimálne %(num)d položka je povinná" +msgstr[1] "Minimálne %(num)d položka je povinná" +msgstr[2] "Minimálne %(num)d položky sú povinné" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Chyba integrity. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Nesprávny formátu času" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Neplatný výber: Nepodarilo sa vynútiť konverziu" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "Neplatný JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Neplatná prípona súboru" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "Súbor s názvom \"%s\" už existuje." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Neexistujú žiadne položky v tabuľke." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Nesprávna hodnota filtra: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Záznam bol úspešne vytvorený." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Záznam neexistuje." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Záznam bol úspešne uložený." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "Tablib závislosti nie sú nainštalované." + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "Typ exportu \"%(type)s nie je podporovaný." + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Áno" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "Nie" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "medzi" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Zobrazenie záznamu" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Upraviť záznam" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "S vybranými" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Uložiť" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Storno" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "Uložiť a pridať ďalšie" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "Uložiť a pokračovať v úpravách" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Hlavný" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Podľa %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Premenovať súbor" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Naozaj chcete odstrániť \\'%(name)s\\' rekurzívne?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Naozaj chcete odstrániť \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Prosím, vyberte aspoň jeden súbor." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Zoznam" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Vytvoriť" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "Detaily" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Filter" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Odstrániť?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "Nový" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Pridať" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Pridať filter" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "Exportovať" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Aplikovať" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Odstrániť filtre" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Vyhľadávanie" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Vytvoriť nový záznam" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Vybrať všetky záznamy" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Vyberte záznam" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Prosím, vyberte aspoň jeden záznam." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Ste si istý, že chcete odstrániť tento záznam?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/sr/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/sr/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..19f4f899 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/sr/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/sr/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/sr/LC_MESSAGES/admin.po new file mode 100644 index 00000000..e5e215df --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/sr/LC_MESSAGES/admin.po @@ -0,0 +1,663 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Serbian (Cyrillic)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: sr\n" +"X-Crowdin-File: admin.pot\n" +"Language: sr_SP\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Dom" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "Cli: Nevažećih komandu." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Arhivski snimak, da možemo ubaciti" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Arhivski snimak traži." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Nevažećih fajl tip." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Sadržaj" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Nevažećih ime" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Ime" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "Dokument \"%(name)s\" već postoji." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Zahtjev se odbija." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Arhivski snimak dobijamo invalid." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Uspešno sačuvana datoteka: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Nije uspeo da spasi dosije: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Postavljanja fajl" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Režija kreacija sa invaliditetom." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Uspešno kreirano kataloga: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Nije uspela da stvori železničku upravu: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Stvori železničku upravu" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Brisanje sa invaliditetom." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Režija brisanje sa invaliditetom." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Režija \"%(path)s\" uspešno izbriše." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Nije uspeo da obrišem režija: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Dokument \"%(name)s\" uspešno izbriše." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Nije uspeo da obrišem dosije: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Preimenovanje invalid." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Ne postoji put." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Uspešno preimenovane \"%(src)s\" da \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Nije uspeo da nazovu: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Preimenuj %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Greške spašavanje promene u %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Izmene %(name)s spasio uspešno." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Greške čitanje %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Neočekivano greške dok čitajući iz %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "Ne mogu edit %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Uređivanje %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Čim je" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Da li si siguran da želiš da čim je ovi fajlovi?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Arhivski snimak brisanje sa invaliditetom." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Snimanje" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "jednaki" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "Ne ravnopravan" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "sadrži" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "ne sadrži" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "veći od" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "manji nego" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "prazan" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "na listi" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "nije na listi" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "Ne između" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Nije uspeo da dobije model. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Nije uspeo da se stvori rekord. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Nije uspeo da se stvori rekord. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Nije uspeo da obrišem rekord. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Da li si siguran da želiš da obrišem odabrani ploče?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Rekord uspešno izbriše." +msgstr[1] "%(count)s ploče su uspešno izbriše." +msgstr[2] "%(count)s ploče su uspešno izbriše." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Nije uspeo da obrišem rekord. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Nije važeći izbor" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Već postoji." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "Bar %(num)d zapisa je potrebno" +msgstr[1] "" +msgstr[2] "" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Integritet grešku. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Nevažećih vreme formatu" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Nevažećih izbor: ne mogu muza" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "JSON važeći" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Produženje nevažećih fajl" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "Dokument \"%s\" već postoji." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Postoje nema predmeti na sto." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Nevažećih Filter vrednost: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Rekord je uspešno uspostavljena." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Zapis ne postoji." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Rekord uspešno spasao." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "" + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Da" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "ne" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "između" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Prikaz zapisa" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Uredite Zapis" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "Sa izabran" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Spasi" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Otkaži" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "Spremite i dodajte novi" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "Spremite i nastavite s uređivanjem" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Rut" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Vrsta koju %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Preimenuj datoteku" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Jesi li siguran da hoćeš da obrišem \\'%(name)s\\' recursively?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Jesi li siguran da hoćeš da obrišem \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Molim te izabere najmanje jedan dokument." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Listu" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Stvori" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "Detalji" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Филтер" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Čim je?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Dodaj" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Dodajte Filter" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "Izvezite" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Primeni" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Reset filteri" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Potraga" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Stvori Novi Zapis" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Izaberu sve podatke" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Izaberu rekord" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Molimo odaberite najmanje jedan zapis." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Da li ste sigurani da želite obrisati ovaj zapis?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/sv/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/sv/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..0acaeee6 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/sv/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/sv/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/sv/LC_MESSAGES/admin.po new file mode 100644 index 00000000..312974e1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/sv/LC_MESSAGES/admin.po @@ -0,0 +1,661 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Swedish\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: sv-SE\n" +"X-Crowdin-File: admin.pot\n" +"Language: sv_SE\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Hem" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "CLI: Ogiltigt kommando." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Fil att ladda upp" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Fil krävs." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Ogiltig filtyp." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Innehåll" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Ogiltigt namn" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Namn" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "Filen \"%(name)s\" finns redan." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Åtkomst nekad." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Filuppladdning är inaktiverad." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Framgångsrikt sparade filen: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Det gick inte att spara filen: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Ladda upp fil" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Skapa Directory inaktiveras." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Framgångsrikt skapade katalog: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Det gick inte att skapa katalog: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Skapa katalog" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Strykningen är inaktiverad." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Strykningen är inaktiverad." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Katalogen \"%(path)s\" har tagits bort." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Det gick inte att ta bort katalog: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Filen \"%(name)s\" har tagits bort." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Det gick inte att ta bort filen: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Byta namn avaktiveras." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Sökvägen finns inte." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Framgångsrikt omdöpt till \"%(src)s\" till \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Det gick inte att byta namn på: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Byt namn på %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Fel spara ändringar i %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Ändringar %(name)s sparats." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Fel läsning %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Oväntat fel vid läsning från %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "Kan inte redigera %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Redigera %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Ta bort" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Är du säker du vill ta bort dessa filer?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Arkivera strykningen är inaktiverad." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Ändra" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "motsvarar" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "inte jämnlikt" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "innehåller" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "innehåller inte" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "större än" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "mindre än" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "tom" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "i listan" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "inte i listan" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "inte mellan" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Det gick inte att få modell. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Det gick inte att skapa post. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Det gick inte att skapa post. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Det gick inte att ta bort posten. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Är du säker du vill ta bort markerade poster?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Posten har tagits bort." +msgstr[1] "%(count)s poster togs framgångsrikt bort." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Det gick inte att ta bort posten. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Inte ett giltigt val" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "Nyckel" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "Värde" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Det finns redan." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "" +msgstr[1] "" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Integritet fel. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Ogiltig tidsformat" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Ogiltigt val: kunde inte tvinga" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "Ogiltig JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Ogiltig filnamnstillägg" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "Filen \"%s\" finns redan." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Det finns inga objekt i tabellen." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Ogiltig filtervärdet: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Posten har skapats." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Det finns ingen post." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Posten sparades framgångsrikt." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "" + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Ja" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "Nej" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "mellan" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Vy-post" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Redigera Posten" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "Med utvalda" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Spara" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Avbryt" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "Spara och lägg till en ny" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "Spara och fortsätt redigera" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Rot" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Sortera efter %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Byt namn på filen" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Är du säker du vill ta bort \\'%(name)s\\' rekursivt?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Är du säker du vill ta bort \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Markera minst en fil." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Lista" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Skapa" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "Detaljer" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Filter" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Ta bort?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "Ny" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Lägg till" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Lägg till Filter" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "Exportera" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Tillämpa" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Återställa filter" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Sök" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Skapa Ny Post" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Väljer du alla poster" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Välj post" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Välj minst en post." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Är du säker du vill ta bort denna post?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/tr/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/tr/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..116de214 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/tr/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/tr/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/tr/LC_MESSAGES/admin.po new file mode 100644 index 00000000..e484d35a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/tr/LC_MESSAGES/admin.po @@ -0,0 +1,661 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-13 09:18-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Turkish\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: tr\n" +"X-Crowdin-File: admin.pot\n" +"Language: tr_TR\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Ana sayfa" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "CLI: Geçersiz komut." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Yüklenecek dosya" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Gerekli dosya." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Geçersiz dosya tipi." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "İçerik" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Geçersiz ad" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Adı" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "\"%(name)s\" dosyası zaten var." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "İzin verilmedi." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Karşıya dosya yükleme devre dışı." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Başarıyla kaydedilmiş dosya: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Dosya kaydetme başarısız oldu: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Dosya Yükle" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Dizin oluşturma devre dışı bırakıldı." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Dizin başarıya oluşturuldu: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Dizin oluşturma başarısız oldu: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Dizin oluşturma" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Silme işlemi devre dışı bırakıldı." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Dizin silme işlemi devre dışı bırakıldı." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Dizin \"%(path)s\" başarıyla silindi." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Dizini silme başarısız oldu: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "\"%(name)s\" dosyası başarıyla silindi." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Dosya silinemedi: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Yeniden adlandırma devre dışı bırakılır." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Yol yok." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Başarılı bir şekilde yeniden adlandırılan \"%(src)s\" \"%(dst)s\" için" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Yeniden adlandırılamadı: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "%(name)s yeniden adlandırma" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "%(name)s için değişiklikler kaydedilirken bir hata oluştu." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Değişiklikler başarıyla kaydedildi %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Hata okuma %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "%(name)s üzerinden okuma sırasında beklenmeyen hata" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "%(name)s düzenleyemezsiniz." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "%(path)s düzenleme" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Sil" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Bu dosyaları silmek istediğinizden emin misiniz?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Dosya silmeyi devre dışı bırakılır." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Düzenle" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "Boş olmayan dizinler üzerinde çalışamaz" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "eşittir" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "eşit değil" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "içerir" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "değil içerir" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "daha büyük" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "daha küçük" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "boş" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "listede" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "liste değildir" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "arasında değil" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "ObjectId eşittir" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Model alma başarısız oldu. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Kayıt oluşturulamadı. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Kaydı oluşturulamadı. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Kaydı silinemedi. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Seçili kayıtları silmek istediğinizden emin misiniz?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Kaydı başarıyla silindi." +msgstr[1] "%(count)s kayıtlarını başarıyla silindi." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Kaydı silinemedi. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Geçersiz bir seçim" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "Anahtar" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "Değer" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Zaten var." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "En az %(num)d adet nesne gerekli" +msgstr[1] "En az %(num)d adet nesne gerekli" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Bütünlüğü hatası. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Geçersiz saat biçimi" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Geçersiz seçenek: dönüştürülemedi" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "Geçersiz JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Geçersiz dosya uzantısı" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "\"%s\" dosyası zaten var." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Tabloda hiçbir öğe vardır." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Geçersiz filtre değeri: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Kaydı başarıyla oluşturuldu." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Kaydı yok." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Kaydı başarıyla kaydedildi." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "Tablib bağımlılığı yüklü değil." + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "%(type)s türünde dışa aktarım desteklenmiyor." + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Evet" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "Hayır" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "arasında" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Görünüm kaydı" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Kaydı Düzenleme" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "Lütfen modelini seçin" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "İle işaretli" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Kaydet" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "İptal" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "Kaydet ve Başka bir tane daha ekle" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "Kaydet ve düzenlemeye devam et" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Kök" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "%(name)s göre sırala" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Dosyayı Yeniden Adlandırma" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "\\'%(name)s\\' silmek istedi─ƒinizden emin misiniz özyinelemeli olarak?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "\\'%(name)s\\' silmek istedi─ƒinizden emin misiniz?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "Boyut" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Lütfen en az bir dosya seçin." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Liste" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Oluştur" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "Detaylar" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Filtre" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Sil?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "Yeni" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Ekle" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Filtre Ekle" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "Dışa Aktar" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Uygula" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Filtreleri Sıfırla" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Arama" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "Öğeler" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Yeni Kayıt Oluştur" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Tüm kayıtları seçme" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Çek'i seçin" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Lütfen en az bir kayıt seçin." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Bu kaydı silmek istediğinizden emin misiniz?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/uk/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/uk/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..4c462f2d Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/uk/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/uk/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/uk/LC_MESSAGES/admin.po new file mode 100644 index 00000000..138b1431 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/uk/LC_MESSAGES/admin.po @@ -0,0 +1,663 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Ukrainian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: uk\n" +"X-Crowdin-File: admin.pot\n" +"Language: uk_UA\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Головна" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "CLI: Неприпустима команда." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Файл для завантаження" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Файл, необхідний." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Тип файлу неприпустимий." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Зміст" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Неприпустиме ім'я" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Ім’я" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "Файл \"%(name)s\" вже існує." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Доступ заборонено." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Завантаження файлу буде вимкнуто." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Успішно збереженого файлу: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Не вдалося зберегти файл: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Завантажте файл" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Створення каталогів вимикається." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Успішно витягтий: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Не вдалося створити каталог: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Створіть каталог" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Видалення вимкнуто." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Видалення каталогів вимикається." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Довідник \"%(path)s\" було успішно вилучено." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Не вдалося видалити каталогу: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Файл «%(name)s» успішно видалено." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Не вдалося видалити файл: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Перейменування вимкнуто." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Шлях не існує." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Успішно перейменовано \"%(src)s\" до \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Не вдалося перейменувати: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Перейменувати %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Помилка під час збереження змін до %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Зміни, внесені до %(name)s успішно збережено." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "%(name)s помилка читання." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Неочікувана помилка під час читання %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "Не можна редагувати %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Редагування %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Видалити" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Ви дійсно бажаєте видалити ці файли?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Видалення файлів вимкнуто." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Редагувати" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "Не можу працювати с непорожніми директоріями" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "дорівнює" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "не дорівнює" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "містить" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "не містить" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "більше, ніж" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "менше, ніж" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "порожній" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "у списку" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "немає у списку" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "не між" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Не вдалося отримати моделі. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Не вдалося створити запис. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Не вдалося створити запис. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Не вдалося видалити запис. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Ви дійсно бажаєте видалити вибрані записи?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "Запис успішно вилучено." +msgstr[1] "%(count)s records були успішно вилучено." +msgstr[2] "%(count)s records були успішно вилучено." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Не вдалося видалити запис. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Не дійсний вибір" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "Ключ" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "Значення" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Уже існує." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "Принаймні %(num)d елемент є обов'язковим" +msgstr[1] "Принаймні %(num)d елемента є обов'язковими" +msgstr[2] "Принаймні %(num)d елементів є обов'язковими" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Цілісність помилка. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Неприпустимий час формат" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Неправильний вибір: не вдалося звести" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "Неприпустимий JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Неприпустиме розширення" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "Файл \"%s\" вже існує." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Нема записів у таблиці." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Неприпустиме значення фільтру: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Запис створено." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Запис не існує." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Запис успішно збережено." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "Tablib залежність не інстальовано." + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "Експорт \"%(type)s типу не підтримується." + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Так" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "Ні" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "між" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Перегляд запису" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Редагування запису" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "Будь ласка, оберіть модель" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "З вибраних" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Зберегти" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "\"Скасувати\"" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "Зберегти й додати інший" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "Зберегти та продовжити редагування" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Корінь" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Сортувати за %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Перейменування файлу" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Ви впевнені, що бажаєте видалити \\'%(name)s\\' рекурсивно?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Ви впевнені, що бажаєте видалити \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Будь ласка, виберіть принаймні один файл." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Список" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Створити" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "Детальніше" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Фільтр" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Видалити?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "Новий" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Додати" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Додати фільтр" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "Зберегти" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Застосувати" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Скинути фільтри" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Пошук" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Створіть новий запис" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Виберіть усі записи" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Виберіть запис" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Будь ласка, оберіть хоча б один запис." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Ви дійсно бажаєте видалити цей запис?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/vi/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/vi/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..35a36152 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/vi/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/vi/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/vi/LC_MESSAGES/admin.po new file mode 100644 index 00000000..1fe50798 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/vi/LC_MESSAGES/admin.po @@ -0,0 +1,659 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-07 01:19-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Vietnamese\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: vi\n" +"X-Crowdin-File: admin.pot\n" +"Language: vi_VN\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "Trang chủ" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "CLI: Lệnh không hợp lệ." + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "Các tập tin để tải lên" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "Tập tin cần thiết." + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "Loại tệp không hợp lệ." + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "Nội dung" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "Tên không hợp lệ" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "Tên" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "Tập tin \"%(name)s\" đã tồn tại." + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "Từ chối cho phép." + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "Tập tin tải lên bị vô hiệu hóa." + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "Tệp đã lưu thành công: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "Không thể lưu tập tin: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "Tải lên tập tin" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "Tạo ra thư mục bị vô hiệu hóa." + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "Thành công tạo ra thư mục: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "Không thể tạo thư mục: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "Tạo thư mục" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "Xóa bị vô hiệu hóa." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "Xóa thư mục bị vô hiệu hóa." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "Thư mục \"%(path)s\" đã được xóa thành công." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "Không thể xoá thư mục: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "Tập tin \"%(name)s\" đã được xóa thành công." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "Không xóa tập tin: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "Đổi tên bị vô hiệu hóa." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "Đường dẫn không tồn tại." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "Thành công được đổi tên thành \"%(src)s\" để \"%(dst)s\"" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "Không thể đổi tên: %(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "Đổi tên %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "Lỗi khi lưu thay đổi để %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "Thay đổi cho %(name)s đã được lưu thành công." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "Lỗi đọc %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "Lỗi bất ngờ trong khi đọc từ %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "Không thể chỉnh sửa %(name)s." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "Chỉnh sửa %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "Xóa" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "Bạn có chắc bạn muốn xóa các tệp này không?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "Xóa tập tin bị vô hiệu hóa." + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "Chỉnh sửa" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "Không thể hoạt động trên thư mục không trống" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "bằng" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "không bằng" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "chứa" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "không có" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "lớn hơn" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "nhỏ hơn" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "sản phẩm nào" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "trong danh sách" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "không có trong danh sách" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "không giữa" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "Không thể có được mô hình. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "Hỏng khi tạo hồ sơ. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "Hỏng khi tạo hồ sơ. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "Không xóa hồ sơ. %(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "Bạn có chắc bạn muốn xóa hồ sơ đã chọn không?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "%(count)s hồ sơ đã được xóa thành công." + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "Không xóa hồ sơ. %(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "Không phải là một lựa chọn hợp lệ" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "Đã tồn tại." + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "Tính toàn vẹn lỗi. %(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "Định dạng thời gian không hợp lệ" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "Lựa chọn không hợp lệ: không có thể ép buộc" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "JSON không hợp lệ" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "Phần mở rộng tệp không hợp lệ" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "Tập tin \"%s\" đã tồn tại." + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "Không có mục nào trong bảng." + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "Giá trị không hợp lệ bộ lọc: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "Kỷ lục được tạo thành công." + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "Hồ sơ không tồn tại." + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "Hồ sơ đã được lưu thành công." + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "" + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "Có" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "Không" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "giữa" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "Xem hồ sơ" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "Chỉnh sửa bản ghi" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "Với lựa chọn" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "Lưu" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "Hủy bỏ" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "Lưu và thêm cái khác" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "Lưu và tiếp tục chỉnh sửa" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "Gốc" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "Sắp xếp theo %(name)s" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "Đổi tên tập tin" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "Bạn có chắc bạn muốn xóa \\'%(name)s\\' đệ quy?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "Bạn có chắc bạn muốn xóa \\'%(name)s\\'?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "Vui lòng chọn ít nhất một tệp." + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "Danh sách" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "Tạo" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "Chi tiết" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "Lọc" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "Xóa?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "Mới" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "Thêm" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "Thêm bộ lọc" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "Kết xuất" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "Áp dụng" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "Đặt lại bộ lọc" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "Tìm" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "Tạo Hồ Sơ Mới" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "Chọn tất cả hồ sơ" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "Chọn hồ sơ" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "Vui lòng chọn ít nhất một kỷ lục." + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "Bạn có chắc bạn muốn xóa hồ sơ này không?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/zh_Hans_CN/LC_MESSAGES/adding_a_new_model_backend.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/zh_Hans_CN/LC_MESSAGES/adding_a_new_model_backend.po new file mode 100644 index 00000000..c8c30b5d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/zh_Hans_CN/LC_MESSAGES/adding_a_new_model_backend.po @@ -0,0 +1,355 @@ +# Adding A Model Backend +# http://flask-admin.readthedocs.io/en/latest/adding_a_new_model_backend/ +# +# Copyright (C) 2012-2015, Serge S. Koval +# This file is distributed under the same license as the flask-admin +# package. +# 1dot75cm , 2016. +# +msgid "" +msgstr "" +"Project-Id-Version: flask-admin 1.4.2\n" +"Report-Msgid-Bugs-To: https://github.com/sixu05202004/Flask-extensions-docs\n" +"POT-Creation-Date: 2016-11-25 03:00+0800\n" +"PO-Revision-Date: 2016-11-27 03:00+0800\n" +"Last-Translator: 1dot75cm \n" +"Language-Team: zh_CN \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.3.4\n" + +#: ../../adding_a_new_model_backend.rst:4 +msgid "Adding A Model Backend" +msgstr "添加一个模型后端" + +#: ../../adding_a_new_model_backend.rst:6 +msgid "" +"Flask-Admin makes a few assumptions about the database models that it " +"works with. If you want to implement your own database backend, and still" +" have Flask-Admin's model views work as expected, then you should take " +"note of the following:" +msgstr "" +"Flask-Admin 对它使用的数据库模型做了一些假设。如果你想实现你自己的数据库后端," +"并且保证 Flask-Admin 的模型视图按预期工作,那么应该注意以下几点:" + +#: ../../adding_a_new_model_backend.rst:9 +msgid "" +"Each model must have one field which acts as a `primary key` to uniquely " +"identify instances of that model. However, there are no restriction on " +"the data type or the field name of the `primary key` field." +msgstr "" +"每个模型必须有一个字段作为主键,以唯一标识该模型的实例。对主键字段的数据类型或字段名没有限制。" + +#: ../../adding_a_new_model_backend.rst:11 +msgid "Models must make their data accessible as python properties." +msgstr "模型的数据必须为可访问的 python 属性。" + +#: ../../adding_a_new_model_backend.rst:13 +msgid "" +"If that is the case, then you can implement your own database backend by " +"extending the `BaseModelView` class, and implementing the set of " +"scaffolding methods listed below." +msgstr "" +"如果是这样,您可以通过扩展 `BaseModelView` 类并实现以下列出的一组方法" +"来实现您自己的数据库后端。" + +#: ../../adding_a_new_model_backend.rst:17 +msgid "Extending BaseModelView" +msgstr "扩展 BaseModelView" + +#: ../../adding_a_new_model_backend.rst:19 +msgid "" +"Start off by defining a new class, which derives from from " +":class:`~flask_admin.model.BaseModelView`::" +msgstr "" +"定义一个新类,继承自 :class:`~flask_admin.model.BaseModelView`::" + +#: ../../adding_a_new_model_backend.rst:24 +msgid "" +"This class inherits BaseModelView's `__init__` method, which accepts a " +"model class as first argument. The model class is stored as the attribute" +" ``self.model`` so that other methods may access it." +msgstr "" +"这个类继承了 BaseModelView 的 `__init__` 方法,它接受一个模型类作为第一个参数。" +"模型类被存储为属性 ``self.model``,以便其他方法可以访问它。" + +#: ../../adding_a_new_model_backend.rst:27 +msgid "Now, implement the following scaffolding methods for the new class:" +msgstr "现在,为新类实现以下脚手架方法:" + +#: ../../adding_a_new_model_backend.rst:29 +msgid ":meth:`~flask_admin.model.BaseModelView.get_pk_value`" +msgstr ":meth:`~flask_admin.model.BaseModelView.get_pk_value`" + +#: ../../adding_a_new_model_backend.rst:31 +msgid "" +"This method returns a primary key value from the model instance. In the " +"SQLAlchemy backend, it gets the primary key from the model using " +":meth:`~flask_admin.contrib.sqla.ModelView.scaffold_pk`, caches it and " +"then returns the value from the model whenever requested." +msgstr "" +"此方法从模型实例返回主键值。在 SQLAlchemy 后端,它使用 " +":meth:`~flask_admin.contrib.sqla.ModelView.scaffold_pk` 从模型中获取主键," +"将其缓存,然后在请求时从模型返回值。" + +#: ../../adding_a_new_model_backend.rst:36 +#: ../../adding_a_new_model_backend.rst:85 +#: ../../adding_a_new_model_backend.rst:155 +#: ../../adding_a_new_model_backend.rst:191 +msgid "For example::" +msgstr "例如::" + +#: ../../adding_a_new_model_backend.rst:42 +msgid ":meth:`~flask_admin.model.BaseModelView.scaffold_list_columns`" +msgstr ":meth:`~flask_admin.model.BaseModelView.scaffold_list_columns`" + +#: ../../adding_a_new_model_backend.rst:44 +msgid "Returns a list of columns to be displayed in a list view. For example::" +msgstr "返回 list 视图需要显示的字段列表。例如::" + +#: ../../adding_a_new_model_backend.rst:57 +msgid ":meth:`~flask_admin.model.BaseModelView.scaffold_sortable_columns`" +msgstr ":meth:`~flask_admin.model.BaseModelView.scaffold_sortable_columns`" + +#: ../../adding_a_new_model_backend.rst:59 +msgid "" +"Returns a dictionary of sortable columns. The keys in the dictionary " +"should correspond to the model's field names. The values should be those " +"variables that will be used for sorting." +msgstr "" +"返回可排序字典。字典的键对应模型的字段名称。这些值将用于排序。" + +#: ../../adding_a_new_model_backend.rst:62 +msgid "" +"For example, in the SQLAlchemy backend it is possible to sort by a " +"foreign key field. So, if there is a field named `user`, which is a " +"foreign key for the `Users` table, and the `Users` table also has a name " +"field, then the key will be `user` and value will be `Users.name`." +msgstr "" +"例如,在 SQLAlchemy 后端,可以按外键字段排序。因此,如果有一个名为 `user` 的字段," +"它是 `Users` 表的外键,并且 `Users` 表也有一个 name 字段,那么键将是 `user`," +"值将是 `Users.name`。" + +#: ../../adding_a_new_model_backend.rst:66 +msgid "" +"If your backend does not support sorting, return `None` or an empty " +"dictionary." +msgstr "" +"如果您的后端不支持排序,则返回 `None` 或空字典。" + +#: ../../adding_a_new_model_backend.rst:69 +msgid ":meth:`~flask_admin.model.BaseModelView.init_search`" +msgstr ":meth:`~flask_admin.model.BaseModelView.init_search`" + +#: ../../adding_a_new_model_backend.rst:71 +msgid "" +"Initialize search functionality. If your backend supports full-text " +"search, do initializations and return `True`. If your backend does not " +"support full-text search, return `False`." +msgstr "" +"初始化搜索功能。如果您的后端支持全文搜索,请进行初始化并返回 `True`。" +"如果您的后端不支持全文搜索,请返回 `False`。" + +#: ../../adding_a_new_model_backend.rst:76 +msgid "" +"For example, SQLAlchemy backend reads value of the " +"`self.searchable_columns` and verifies if all fields are of text type, if" +" they're local to the current model (if not, it will add a join, etc) and" +" caches this information for future use." +msgstr "" +"例如,SQLAlchemy 后端读取 `self.searchable_columns` 的值,并验证所有字段是否为" +"文本类型,是否为当前模块的本地字段 (如果不是,则添加 join 等),并缓存此信息以供将来使用。" + +#: ../../adding_a_new_model_backend.rst:81 +msgid ":meth:`~flask_admin.model.BaseModelView.scaffold_form`" +msgstr ":meth:`~flask_admin.model.BaseModelView.scaffold_form`" + +#: ../../adding_a_new_model_backend.rst:83 +msgid "Generate `WTForms` form class from the model." +msgstr "从模型生成 `WTForms` 表单类。" + +#: ../../adding_a_new_model_backend.rst:95 +msgid ":meth:`~flask_admin.model.BaseModelView.get_list`" +msgstr ":meth:`~flask_admin.model.BaseModelView.get_list`" + +#: ../../adding_a_new_model_backend.rst:97 +msgid "" +"This method should return list of model instances with paging, sorting, " +"etc applied." +msgstr "" +"此方法应返回用于分页,排序等操作的模型实例的列表。" + +#: ../../adding_a_new_model_backend.rst:100 +msgid "For SQLAlchemy backend it looks like:" +msgstr "对于 SQLAlchemy 后端的示例如下:" + +#: ../../adding_a_new_model_backend.rst:102 +msgid "" +"If search was enabled and provided search value is not empty, generate " +"LIKE statements for each field from `self.searchable_columns`" +msgstr "" +"如果启用搜索并且提供的搜索值不为空,请从 `self.searchable_columns` 中" +"为每个字段生成 LIKE 语句。" + +#: ../../adding_a_new_model_backend.rst:105 +msgid "If filter values were passed, call `apply` method with values::" +msgstr "如果已向过滤器传值,请调用具有该值的 `apply` 方法::" + +#: ../../adding_a_new_model_backend.rst:111 +msgid "Execute query to get total number of rows in the database (count)" +msgstr "执行查询以获取数据库中的总行数 (count)" + +#: ../../adding_a_new_model_backend.rst:114 +msgid "" +"If `sort_column` was passed, will do something like (with some extra FK " +"logic which is omitted in this example)::" +msgstr "" +"如果 `sort_column` 被传递,将做类似的事情 (在这个例子中省略一些额外的 FK 逻辑)::" + +#: ../../adding_a_new_model_backend.rst:121 +msgid "Apply paging" +msgstr "应用分页" + +#: ../../adding_a_new_model_backend.rst:123 +msgid "Return count, list as a tuple" +msgstr "返回 count, list 作为一个元组" + +#: ../../adding_a_new_model_backend.rst:125 +msgid ":meth:`~flask_admin.model.BaseModelView.get_one`" +msgstr ":meth:`~flask_admin.model.BaseModelView.get_one`" + +#: ../../adding_a_new_model_backend.rst:127 +msgid "Return a model instance by its primary key." +msgstr "通过其主键返回模型实例。" + +#: ../../adding_a_new_model_backend.rst:129 +msgid ":meth:`~flask_admin.model.BaseModelView.create_model`" +msgstr ":meth:`~flask_admin.model.BaseModelView.create_model`" + +#: ../../adding_a_new_model_backend.rst:131 +msgid "Create a new instance of the model from the `Form` object." +msgstr "从 `Form` 对象创建新的模型实例。" + +#: ../../adding_a_new_model_backend.rst:133 +msgid ":meth:`~flask_admin.model.BaseModelView.update_model`" +msgstr ":meth:`~flask_admin.model.BaseModelView.update_model`" + +#: ../../adding_a_new_model_backend.rst:135 +msgid "Update the model instance with data from the form." +msgstr "用表单数据更新模型实例。" + +#: ../../adding_a_new_model_backend.rst:137 +msgid ":meth:`~flask_admin.model.BaseModelView.delete_model`" +msgstr ":meth:`~flask_admin.model.BaseModelView.delete_model`" + +#: ../../adding_a_new_model_backend.rst:139 +msgid "Delete the specified model instance from the data store." +msgstr "从数据存储中删除指定的模型实例。" + +#: ../../adding_a_new_model_backend.rst:141 +msgid ":meth:`~flask_admin.model.BaseModelView.is_valid_filter`" +msgstr ":meth:`~flask_admin.model.BaseModelView.is_valid_filter`" + +#: ../../adding_a_new_model_backend.rst:143 +msgid "Verify whether the given object is a valid filter." +msgstr "验证给定对象是否是有效的过滤器。" + +#: ../../adding_a_new_model_backend.rst:145 +msgid ":meth:`~flask_admin.model.BaseModelView.scaffold_filters`" +msgstr ":meth:`~flask_admin.model.BaseModelView.scaffold_filters`" + +#: ../../adding_a_new_model_backend.rst:147 +msgid "Return a list of filter objects for one model field." +msgstr "返回一个模型字段的过滤器对象列表。" + +#: ../../adding_a_new_model_backend.rst:149 +msgid "" +"This method will be called once for each entry in the " +"`self.column_filters` setting." +msgstr "" +"对于 `self.column_filters` 设置中的每个条目,都将调用一次该方法。" + +#: ../../adding_a_new_model_backend.rst:152 +msgid "" +"If your backend does not know how to generate filters for the provided " +"field, it should return `None`." +msgstr "" +"如果您的后端不知道如何为提供的字段生成过滤器,则它应该返回 `None`。" + +#: ../../adding_a_new_model_backend.rst:165 +msgid "Implementing filters" +msgstr "实现过滤器" + +#: ../../adding_a_new_model_backend.rst:167 +msgid "" +"Each model backend should have its own set of filter implementations. It " +"is not possible to use the filters from SQLAlchemy models in a non-" +"SQLAlchemy backend. This also means that different backends might have " +"different set of available filters." +msgstr "" +"每个模型后端应该有自己的一组过滤器实现。不能在非 SQLAlchemy 后端中使用 SQLAlchemy " +"模型的过滤器。这意味着不同的后端可能具有不同的可用过滤器集。" + +#: ../../adding_a_new_model_backend.rst:171 +msgid "" +"The filter is a class derived from " +":class:`~flask_admin.model.filters.BaseFilter` which implements at least " +"two methods:" +msgstr "" +"过滤器继承 :class:`~flask_admin.model.filters.BaseFilter` 类," +"至少需要实现以下两个方法:" + +#: ../../adding_a_new_model_backend.rst:173 +msgid ":meth:`~flask_admin.model.filters.BaseFilter.apply`" +msgstr ":meth:`~flask_admin.model.filters.BaseFilter.apply`" + +#: ../../adding_a_new_model_backend.rst:174 +msgid ":meth:`~flask_admin.model.filters.BaseFilter.operation`" +msgstr ":meth:`~flask_admin.model.filters.BaseFilter.operation`" + +#: ../../adding_a_new_model_backend.rst:176 +msgid "" +"`apply` method accepts two parameters: `query` object and a value from " +"the client. Here you can add filtering logic for the filter type." +msgstr "" +"`apply` 方法允许两个参数:`query` 对象和来自客户端的值。" +"在这里,您可以为该过滤器类型添加过滤逻辑。" + +#: ../../adding_a_new_model_backend.rst:179 +msgid "Lets take SQLAlchemy model backend as an example:" +msgstr "让我们以 SQLAlchemy 模型后端为例:" + +#: ../../adding_a_new_model_backend.rst:181 +msgid "" +"All SQLAlchemy filters derive from " +":class:`~flask_admin.contrib.sqla.filters.BaseSQLAFilter` class." +msgstr "" +"所有 SQLAlchemy 过滤器都继承自 " +":class:`~flask_admin.contrib.sqla.filters.BaseSQLAFilter` 类。" + +#: ../../adding_a_new_model_backend.rst:183 +msgid "" +"Each filter implements one simple filter SQL operation (like, not like, " +"greater, etc) and accepts a column as input parameter." +msgstr "" +"每个过滤器实现一个简单的 SQL 过滤器操作 (like, not like, greater 等)," +"并接受列作为输入参数。" + +#: ../../adding_a_new_model_backend.rst:186 +msgid "" +"Whenever model view wants to apply a filter to a query object, it will " +"call `apply` method in a filter class with a query and value. Filter will" +" then apply real filter operation." +msgstr "" +"每当模型视图想要对 query 对象应用过滤器时,它将调用已传入 query 和值的过滤器类的 `apply` " +"方法。然后过滤器将进行实际的 SQL 过滤器操作。" + +#: ../../adding_a_new_model_backend.rst:217 +msgid "" +"Feel free ask questions if you have problems adding a new model backend. " +"Also, if you get stuck, try taking a look at the SQLAlchemy model backend" +" and use it as a reference." +msgstr "" +"如果您在添加新模型后端时遇到问题,请随时提出问题。此外,如果您遇到困难," +"建议将 SQLAlchemy 模型后端的实现作为参考。" diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/zh_Hans_CN/LC_MESSAGES/admin.mo b/.venv/lib/python3.8/site-packages/flask_admin/translations/zh_Hans_CN/LC_MESSAGES/admin.mo new file mode 100644 index 00000000..d1cfaa38 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_admin/translations/zh_Hans_CN/LC_MESSAGES/admin.mo differ diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/zh_Hans_CN/LC_MESSAGES/admin.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/zh_Hans_CN/LC_MESSAGES/admin.po new file mode 100644 index 00000000..edbc113d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/zh_Hans_CN/LC_MESSAGES/admin.po @@ -0,0 +1,659 @@ +msgid "" +msgstr "" +"Project-Id-Version: flask-admin\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2017-02-07 00:17-0600\n" +"PO-Revision-Date: 2017-02-13 09:18-0500\n" +"Last-Translator: mrjoes \n" +"Language-Team: Chinese Simplified\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: crowdin.com\n" +"X-Crowdin-Project: flask-admin\n" +"X-Crowdin-Language: zh-CN\n" +"X-Crowdin-File: admin.pot\n" +"Language: zh_CN\n" + +#: ../flask_admin/base.py:440 +msgid "Home" +msgstr "首页" + +#: ../flask_admin/contrib/rediscli.py:127 +msgid "Cli: Invalid command." +msgstr "Cli:无效命令。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:352 +msgid "File to upload" +msgstr "要上传的文件" + +#: ../flask_admin/contrib/fileadmin/__init__.py:360 +msgid "File required." +msgstr "请上传有效的文件。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:365 +msgid "Invalid file type." +msgstr "不允许的文件类型。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:376 +msgid "Content" +msgstr "内容" + +#: ../flask_admin/contrib/fileadmin/__init__.py:390 +msgid "Invalid name" +msgstr "无效的名称。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:398 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:106 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:112 +#: ../flask_admin/tests/sqla/test_translation.py:17 +msgid "Name" +msgstr "名称" + +#: ../flask_admin/contrib/fileadmin/__init__.py:757 +#, python-format +msgid "File \"%(name)s\" already exists." +msgstr "文件 %(name)s 已经存在。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:802 +#: ../flask_admin/contrib/fileadmin/__init__.py:885 +#: ../flask_admin/contrib/fileadmin/__init__.py:947 +#: ../flask_admin/contrib/fileadmin/__init__.py:1000 +#: ../flask_admin/contrib/fileadmin/__init__.py:1047 +#: ../flask_admin/contrib/fileadmin/__init__.py:1099 +#: ../flask_admin/model/base.py:2168 +msgid "Permission denied." +msgstr "权限被拒绝。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:881 +msgid "File uploading is disabled." +msgstr "文件上传功能已被禁用。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:892 +#, python-format +msgid "Successfully saved file: %(name)s" +msgstr "已成功保存的文件: %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:896 +#, python-format +msgid "Failed to save file: %(error)s" +msgstr "保存文件失败:%(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:904 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:150 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:148 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:150 +msgid "Upload File" +msgstr "上传文件" + +#: ../flask_admin/contrib/fileadmin/__init__.py:943 +msgid "Directory creation is disabled." +msgstr "文件夹创建功能已被禁用。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:956 +#, python-format +msgid "Successfully created directory: %(directory)s" +msgstr "成功创建的目录: %(directory)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:960 +#, python-format +msgid "Failed to create directory: %(error)s" +msgstr "创建文件夹失败:%(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:970 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:161 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:159 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:161 +msgid "Create Directory" +msgstr "创建文件夹" + +#: ../flask_admin/contrib/fileadmin/__init__.py:996 +msgid "Deletion is disabled." +msgstr "删除功能已被禁用。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1005 +msgid "Directory deletion is disabled." +msgstr "删除文件夹功能已被禁用。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1011 +#, python-format +msgid "Directory \"%(path)s\" was successfully deleted." +msgstr "已成功删除目录\"%(path)s\"。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1013 +#, python-format +msgid "Failed to delete directory: %(error)s" +msgstr "删除文件夹失败:$(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1019 +#: ../flask_admin/contrib/fileadmin/__init__.py:1176 +#, python-format +msgid "File \"%(name)s\" was successfully deleted." +msgstr "删除文件 %(name)s 成功。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1021 +#: ../flask_admin/contrib/fileadmin/__init__.py:1178 +#, python-format +msgid "Failed to delete file: %(name)s" +msgstr "删除文件 %(name)s 失败" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1043 +msgid "Renaming is disabled." +msgstr "重命名功能已被禁用。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1051 +msgid "Path does not exist." +msgstr "路径不存在。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1061 +#, python-format +msgid "Successfully renamed \"%(src)s\" to \"%(dst)s\"" +msgstr "重命名文件 %(src)s 为 %(dst)s 成功" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1064 +#, python-format +msgid "Failed to rename: %(error)s" +msgstr "重命名文件失败:%(error)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1078 +#, python-format +msgid "Rename %(name)s" +msgstr "重命名 %(name)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1115 +#, python-format +msgid "Error saving changes to %(name)s." +msgstr "保存修改到 %(name)s 出现错误。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1119 +#, python-format +msgid "Changes to %(name)s saved successfully." +msgstr "保存修改到 %(name)s 成功。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1128 +#, python-format +msgid "Error reading %(name)s." +msgstr "读取 %(name)s 错误。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1131 +#: ../flask_admin/contrib/fileadmin/__init__.py:1140 +#, python-format +msgid "Unexpected error while reading from %(name)s" +msgstr "读取文件文件 %(name)s 出现未知错误" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1137 +#, python-format +msgid "Cannot edit %(name)s." +msgstr "无法编辑 %(name)s。" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1155 +#, python-format +msgid "Editing %(path)s" +msgstr "编辑 %(path)s" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1163 +#: ../flask_admin/contrib/mongoengine/view.py:658 +#: ../flask_admin/contrib/peewee/view.py:487 +#: ../flask_admin/contrib/pymongo/view.py:384 +#: ../flask_admin/contrib/sqla/view.py:1149 +msgid "Delete" +msgstr "删除" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1164 +msgid "Are you sure you want to delete these files?" +msgstr "你打算要删除这些文件吗?" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1167 +msgid "File deletion is disabled." +msgstr "删除文件功能已被禁用" + +#: ../flask_admin/contrib/fileadmin/__init__.py:1180 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:22 +msgid "Edit" +msgstr "编辑" + +#: ../flask_admin/contrib/fileadmin/s3.py:153 +msgid "Cannot operate on non empty directories" +msgstr "无法对非空的目录操作" + +#: ../flask_admin/contrib/mongoengine/filters.py:39 +#: ../flask_admin/contrib/peewee/filters.py:35 +#: ../flask_admin/contrib/pymongo/filters.py:38 +#: ../flask_admin/contrib/sqla/filters.py:41 +msgid "equals" +msgstr "等于" + +#: ../flask_admin/contrib/mongoengine/filters.py:48 +#: ../flask_admin/contrib/peewee/filters.py:43 +#: ../flask_admin/contrib/pymongo/filters.py:47 +#: ../flask_admin/contrib/sqla/filters.py:49 +msgid "not equal" +msgstr "不等于" + +#: ../flask_admin/contrib/mongoengine/filters.py:58 +#: ../flask_admin/contrib/peewee/filters.py:52 +#: ../flask_admin/contrib/pymongo/filters.py:57 +#: ../flask_admin/contrib/sqla/filters.py:58 +msgid "contains" +msgstr "包含" + +#: ../flask_admin/contrib/mongoengine/filters.py:68 +#: ../flask_admin/contrib/peewee/filters.py:61 +#: ../flask_admin/contrib/pymongo/filters.py:67 +#: ../flask_admin/contrib/sqla/filters.py:67 +msgid "not contains" +msgstr "不包含" + +#: ../flask_admin/contrib/mongoengine/filters.py:77 +#: ../flask_admin/contrib/peewee/filters.py:69 +#: ../flask_admin/contrib/pymongo/filters.py:80 +#: ../flask_admin/contrib/sqla/filters.py:75 +msgid "greater than" +msgstr "大于" + +#: ../flask_admin/contrib/mongoengine/filters.py:86 +#: ../flask_admin/contrib/peewee/filters.py:77 +#: ../flask_admin/contrib/pymongo/filters.py:93 +#: ../flask_admin/contrib/sqla/filters.py:83 +msgid "smaller than" +msgstr "小于" + +#: ../flask_admin/contrib/mongoengine/filters.py:98 +#: ../flask_admin/contrib/peewee/filters.py:88 +#: ../flask_admin/contrib/sqla/filters.py:94 +msgid "empty" +msgstr "空" + +#: ../flask_admin/contrib/mongoengine/filters.py:113 +#: ../flask_admin/contrib/peewee/filters.py:102 +#: ../flask_admin/contrib/sqla/filters.py:108 +msgid "in list" +msgstr "在列表中" + +#: ../flask_admin/contrib/mongoengine/filters.py:122 +#: ../flask_admin/contrib/peewee/filters.py:111 +#: ../flask_admin/contrib/sqla/filters.py:118 +msgid "not in list" +msgstr "不在列表中" + +#: ../flask_admin/contrib/mongoengine/filters.py:222 +#: ../flask_admin/contrib/peewee/filters.py:207 +#: ../flask_admin/contrib/peewee/filters.py:244 +#: ../flask_admin/contrib/peewee/filters.py:281 +#: ../flask_admin/contrib/sqla/filters.py:213 +#: ../flask_admin/contrib/sqla/filters.py:250 +#: ../flask_admin/contrib/sqla/filters.py:287 +msgid "not between" +msgstr "不是之间" + +#: ../flask_admin/contrib/mongoengine/filters.py:247 +msgid "ObjectId equals" +msgstr "ObjectId 等于" + +#: ../flask_admin/contrib/mongoengine/view.py:551 +#, python-format +msgid "Failed to get model. %(error)s" +msgstr "获取 model 失败。%(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:570 +#: ../flask_admin/contrib/peewee/view.py:435 +#: ../flask_admin/contrib/pymongo/view.py:316 +#: ../flask_admin/contrib/sqla/view.py:1078 +#, python-format +msgid "Failed to create record. %(error)s" +msgstr "创建 model 失败。%(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:596 +#: ../flask_admin/contrib/peewee/view.py:454 +#: ../flask_admin/contrib/pymongo/view.py:341 +#: ../flask_admin/contrib/sqla/view.py:1104 ../flask_admin/model/base.py:2305 +#: ../flask_admin/model/base.py:2313 ../flask_admin/model/base.py:2315 +#, python-format +msgid "Failed to update record. %(error)s" +msgstr "更新记录失败。%(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:619 +#: ../flask_admin/contrib/peewee/view.py:469 +#: ../flask_admin/contrib/pymongo/view.py:366 +#: ../flask_admin/contrib/sqla/view.py:1129 +#, python-format +msgid "Failed to delete record. %(error)s" +msgstr "删除记录失败。%(error)s" + +#: ../flask_admin/contrib/mongoengine/view.py:659 +#: ../flask_admin/contrib/peewee/view.py:488 +#: ../flask_admin/contrib/pymongo/view.py:385 +#: ../flask_admin/contrib/sqla/view.py:1150 +msgid "Are you sure you want to delete selected records?" +msgstr "你打算要删除这些选中的记录吗?" + +#: ../flask_admin/contrib/mongoengine/view.py:668 +#: ../flask_admin/contrib/peewee/view.py:505 +#: ../flask_admin/contrib/pymongo/view.py:395 +#: ../flask_admin/contrib/sqla/view.py:1166 ../flask_admin/model/base.py:2118 +#, python-format +msgid "Record was successfully deleted." +msgid_plural "%(count)s records were successfully deleted." +msgstr[0] "%(count)s 记录被成功删除。" + +#: ../flask_admin/contrib/mongoengine/view.py:674 +#: ../flask_admin/contrib/peewee/view.py:511 +#: ../flask_admin/contrib/pymongo/view.py:400 +#: ../flask_admin/contrib/sqla/view.py:1174 +#, python-format +msgid "Failed to delete records. %(error)s" +msgstr "删除记录失败。%(error)s" + +#: ../flask_admin/contrib/sqla/fields.py:126 +#: ../flask_admin/contrib/sqla/fields.py:176 +#: ../flask_admin/contrib/sqla/fields.py:181 ../flask_admin/model/fields.py:173 +#: ../flask_admin/model/fields.py:222 +msgid "Not a valid choice" +msgstr "选择的值无效" + +#: ../flask_admin/contrib/sqla/fields.py:186 +msgid "Key" +msgstr "名称" + +#: ../flask_admin/contrib/sqla/fields.py:187 +msgid "Value" +msgstr "值" + +#: ../flask_admin/contrib/sqla/validators.py:42 +msgid "Already exists." +msgstr "已经存在。" + +#: ../flask_admin/contrib/sqla/validators.py:60 +#, python-format +msgid "At least %(num)d item is required" +msgid_plural "At least %(num)d items are required" +msgstr[0] "至少需要 %(num)d 个选项" + +#: ../flask_admin/contrib/sqla/view.py:1057 +#, python-format +msgid "Integrity error. %(message)s" +msgstr "完整性错误。%(message)s" + +#: ../flask_admin/form/fields.py:98 +msgid "Invalid time format" +msgstr "无效时间格式" + +#: ../flask_admin/form/fields.py:144 +msgid "Invalid Choice: could not coerce" +msgstr "无效选择的值:强制格式转换失败" + +#: ../flask_admin/form/fields.py:208 +msgid "Invalid JSON" +msgstr "无效的 JSON" + +#: ../flask_admin/form/upload.py:207 +msgid "Invalid file extension" +msgstr "无效文件扩展名" + +#: ../flask_admin/form/upload.py:214 ../flask_admin/form/upload.py:281 +#, python-format +msgid "File \"%s\" already exists." +msgstr "文件 %s 已经存在。" + +#: ../flask_admin/model/base.py:1649 +msgid "There are no items in the table." +msgstr "表中没有任何记录" + +#: ../flask_admin/model/base.py:1673 +#, python-format +msgid "Invalid Filter Value: %(value)s" +msgstr "无效的筛选器值: %(value)s" + +#: ../flask_admin/model/base.py:1984 +msgid "Record was successfully created." +msgstr "创建记录成功。" + +#: ../flask_admin/model/base.py:2028 ../flask_admin/model/base.py:2080 +#: ../flask_admin/model/base.py:2113 ../flask_admin/model/base.py:2297 +msgid "Record does not exist." +msgstr "记录不存在。" + +#: ../flask_admin/model/base.py:2037 ../flask_admin/model/base.py:2301 +msgid "Record was successfully saved." +msgstr "保存记录成功" + +#: ../flask_admin/model/base.py:2222 +msgid "Tablib dependency not installed." +msgstr "Tablib 依赖项未安装。" + +#: ../flask_admin/model/base.py:2249 +#, python-format +msgid "Export type \"%(type)s not supported." +msgstr "不支持导出类型 \"%(type)s 。" + +#: ../flask_admin/model/filters.py:103 ../flask_admin/model/widgets.py:111 +msgid "Yes" +msgstr "是" + +#: ../flask_admin/model/filters.py:104 ../flask_admin/model/widgets.py:110 +msgid "No" +msgstr "否" + +#: ../flask_admin/model/filters.py:172 ../flask_admin/model/filters.py:212 +#: ../flask_admin/model/filters.py:257 +msgid "between" +msgstr "之间" + +#: ../flask_admin/model/template.py:81 ../flask_admin/model/template.py:88 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:37 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:8 +msgid "View Record" +msgstr "查看记录" + +#: ../flask_admin/model/template.py:95 ../flask_admin/model/template.py:102 +#: ../flask_admin/model/template.py:109 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/edit.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/edit.html:11 +msgid "Edit Record" +msgstr "编辑记录" + +#: ../flask_admin/model/widgets.py:61 +msgid "Please select model" +msgstr "请选择模型" + +#: ../flask_admin/templates/bootstrap2/admin/actions.html:4 +#: ../flask_admin/templates/bootstrap3/admin/actions.html:4 +msgid "With selected" +msgstr "选中的" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:200 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:190 +msgid "Save" +msgstr "保存" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:205 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:195 +msgid "Cancel" +msgstr "取消" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:256 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:247 +msgid "Save and Add Another" +msgstr "保存并添加另一个" + +#: ../flask_admin/templates/bootstrap2/admin/lib.html:259 +#: ../flask_admin/templates/bootstrap3/admin/lib.html:250 +msgid "Save and Continue Editing" +msgstr "保存并继续编辑" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:9 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:9 +msgid "Root" +msgstr "根" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:90 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:99 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:40 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:49 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:89 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:98 +#, python-format +msgid "Sort by %(name)s" +msgstr "按 %(name)s 进行排序" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:74 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:77 +msgid "Rename File" +msgstr "重命名文件" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:88 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:88 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\' recursively?" +msgstr "你打算递归地删除 %(name)s 吗?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:97 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:97 +#, python-format +msgid "Are you sure you want to delete \\'%(name)s\\'?" +msgstr "你打算删除 %(name)s 吗?" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:125 +msgid "Size" +msgstr "大小" + +#: ../flask_admin/templates/bootstrap2/admin/file/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/file/list.html:185 +msgid "Please select at least one file." +msgstr "请至少选择一个文件。" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:14 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:17 +msgid "List" +msgstr "列表" + +#: ../flask_admin/templates/bootstrap2/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/create.html:17 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:12 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +msgid "Create" +msgstr "创建" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap2/admin/model/edit.html:26 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:21 +#: ../flask_admin/templates/bootstrap3/admin/model/edit.html:26 +msgid "Details" +msgstr "详情" + +#: ../flask_admin/templates/bootstrap2/admin/model/details.html:29 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/details.html:8 +#: ../flask_admin/templates/bootstrap3/admin/model/details.html:28 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/details.html:15 +msgid "Filter" +msgstr "筛选器" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:13 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:14 +msgid "Delete?" +msgstr "删除?" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:33 +msgid "New" +msgstr "新增" + +#: ../flask_admin/templates/bootstrap2/admin/model/inline_list_base.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/inline_list_base.html:43 +msgid "Add" +msgstr "增加" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:3 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:3 +msgid "Add Filter" +msgstr "新增筛选器" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:30 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:18 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:30 +msgid "Export" +msgstr "导出" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:38 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:38 +msgid "Apply" +msgstr "应用" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:40 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:40 +msgid "Reset Filters" +msgstr "重置" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:66 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:59 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:64 +msgid "Search" +msgstr "搜索" + +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:74 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:77 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:78 +#: ../flask_admin/templates/bootstrap2/admin/model/layout.html:79 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:72 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:75 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:76 +#: ../flask_admin/templates/bootstrap3/admin/model/layout.html:77 +msgid "items" +msgstr "项目" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap2/admin/model/modals/create.html:22 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:23 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:25 +#: ../flask_admin/templates/bootstrap3/admin/model/modals/create.html:10 +msgid "Create New Record" +msgstr "创建新记录" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:77 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:76 +msgid "Select all records" +msgstr "选择所有记录" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:120 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:119 +msgid "Select record" +msgstr "选择记录" + +#: ../flask_admin/templates/bootstrap2/admin/model/list.html:185 +#: ../flask_admin/templates/bootstrap3/admin/model/list.html:186 +msgid "Please select at least one record." +msgstr "请至少选择一个 model。" + +#: ../flask_admin/templates/bootstrap2/admin/model/row_actions.html:34 +#: ../flask_admin/templates/bootstrap3/admin/model/row_actions.html:34 +msgid "Are you sure you want to delete this record?" +msgstr "你打算删除这条记录?" + diff --git a/.venv/lib/python3.8/site-packages/flask_admin/translations/zh_Hans_CN/LC_MESSAGES/advanced.po b/.venv/lib/python3.8/site-packages/flask_admin/translations/zh_Hans_CN/LC_MESSAGES/advanced.po new file mode 100644 index 00000000..455b4e22 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_admin/translations/zh_Hans_CN/LC_MESSAGES/advanced.po @@ -0,0 +1,999 @@ +# Advanced Functionality +# http://flask-admin.readthedocs.io/en/latest/advanced/ +# +# Copyright (C) 2012-2015, Serge S. Koval +# This file is distributed under the same license as the flask-admin +# package. +# 1dot75cm , 2016. +msgid "" +msgstr "" +"Project-Id-Version: flask-admin 1.4.2\n" +"Report-Msgid-Bugs-To: https://github.com/sixu05202004/Flask-extensions-" +"docs\n" +"POT-Creation-Date: 2017-02-07 00:18-0600\n" +"PO-Revision-Date: 2016-11-27 03:00+0800\n" +"Last-Translator: 1dot75cm \n" +"Language-Team: zh_CN \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.1.1\n" + +#: ../../doc/advanced.rst:4 +msgid "Advanced Functionality" +msgstr "高级功能" + +#: ../../doc/advanced.rst:7 +msgid "Enabling CSRF Protection" +msgstr "启用 CSRF 保护" + +#: ../../doc/advanced.rst:9 +msgid "" +"To add CSRF protection to the forms that are generated by *ModelView* " +"instances, use the SecureForm class in your *ModelView* subclass by " +"specifying the *form_base_class* parameter::" +msgstr "" +"要向 *ModelView* 实例生成的表单添加 CSRF 保护,请在 *ModelView* 子类中将 *form_base_class* " +"参数值设为 SecureForm 类::" + +#: ../../doc/advanced.rst:18 +msgid "" +"SecureForm requires WTForms 2 or greater. It uses the WTForms SessionCSRF" +" class to generate and validate the tokens for you when the forms are " +"submitted." +msgstr "SecureForm 需要 WTForms 2+。当表单提交时,它使用 WTForms SessionCSRF 类来生成和验证令牌。" + +#: ../../doc/advanced.rst:22 +msgid "Localization With Flask-Babelex" +msgstr "使用 Flask-Babelex 本地化" + +#: ../../doc/advanced.rst:26 +msgid "" +"Flask-Admin comes with translations for several languages. Enabling " +"localization is simple:" +msgstr "Flask-Admin 提供多种语言的翻译。启用本地化非常简单:" + +#: ../../doc/advanced.rst:29 +msgid "" +"Install `Flask-BabelEx `_ to do " +"the heavy lifting. It's a fork of the `Flask-Babel " +"`_ package::" +msgstr "" +"安装 `Flask-BabelEx `_ 扩展,它是 " +"`Flask-Babel `_ 的分支::" + +#: ../../doc/advanced.rst:35 +msgid "Initialize Flask-BabelEx by creating instance of `Babel` class::" +msgstr "通过创建 `Babel` 类实例,初始化 Flask-BabelEx 扩展::" + +#: ../../doc/advanced.rst:43 +msgid "Create a locale selector function::" +msgstr "创建区域选择器函数::" + +#: ../../doc/advanced.rst:51 +msgid "" +"Now, you could try a French version of the application at: " +"`http://localhost:5000/admin/?lang=fr " +"`_." +msgstr "" +"现在,您能够访问法语版本的管理界面: `http://localhost:5000/admin/?lang=fr " +"`_。" + +#: ../../doc/advanced.rst:53 +msgid "" +"Go ahead and add your own logic to the locale selector function. The " +"application can store locale in a user profile, cookie, session, etc. It " +"can also use the `Accept-Language` header to make the selection " +"automatically." +msgstr "" +"继续,添加您的区域设置到语言选择器函数。应用程序可以将区域设置存储在用户 profile, cookie, session 中。它还可以使用 " +"`Accept-Language` 头来自动选择语言。" + +#: ../../doc/advanced.rst:57 +msgid "" +"If the built-in translations are not enough, look at the `Flask-BabelEx " +"documentation `_ to see how you " +"can add your own." +msgstr "" +"如果内置的翻译不够,请查看 `Flask-BabelEx 文档 `_ 了解如何添加翻译。" + +#: ../../doc/advanced.rst:63 +msgid "Managing Files & Folders" +msgstr "管理文件 & 目录" + +#: ../../doc/advanced.rst:67 +msgid "" +"To manage static files instead of database records, Flask-Admin comes " +"with the FileAdmin plug-in. It gives you the ability to upload, delete, " +"rename, etc. You can use it by adding a FileAdmin view to your app::" +msgstr "" +"为了管理静态文件而不是数据库记录,Flask-Admin 附带了 FileAdmin " +"插件。它使您能够上传,删除,重命名文件。您可以通过向应用程序添加 FileAdmin 视图来使用该功能::" + +#: ../../doc/advanced.rst:83 +msgid "" +"FileAdmin also has out-of-the-box support for managing files located on a" +" Amazon Simple Storage Service bucket. To add it to your app::" +msgstr "FileAdmin 还具有管理 Amazon Simple Storage 服务的文件的开箱支持。将该功能添加到应用程序::" + +#: ../../doc/advanced.rst:93 +msgid "" +"You can disable uploads, disable file deletion, restrict file uploads to " +"certain types, etc. Check :mod:`flask_admin.contrib.fileadmin` in the API" +" documentation for more details." +msgstr "" +"您可以配置禁用上传,禁用文件删除,限制上传文件的类型等功能。详细信息,请参阅 " +":mod:`flask_admin.contrib.fileadmin` API 文档。" + +#: ../../doc/advanced.rst:97 +msgid "Adding new file backends" +msgstr "添加新文件后端" + +#: ../../doc/advanced.rst:99 +msgid "" +"You can also implement your own storage backend by creating a class that " +"implements the same methods defined in the `LocalFileStorage` class. " +"Check :mod:`flask_admin.contrib.fileadmin` in the API documentation for " +"details on the methods." +msgstr "" +"您还可以通过继承 `LocalFileStorage` 类并重写其中的方法来实现自己的存储后端。有关方法的详细信息,请参阅 " +":mod:`flask_admin.contrib.fileadmin` API 文档。" + +#: ../../doc/advanced.rst:104 +msgid "Adding A Redis Console" +msgstr "添加 Redis 控制台" + +#: ../../doc/advanced.rst:108 +msgid "" +"Another plug-in that's available is the Redis Console. If you have a " +"Redis instance running on the same machine as your app, you can::" +msgstr "另一个可用的插件是 Redis 控制台。如果您的 Redis 实例与应用程序在同一个节点上运行,您可以::" + +#: ../../doc/advanced.rst:122 +msgid "Replacing Individual Form Fields" +msgstr "替换单个表单域" + +#: ../../doc/advanced.rst:126 +msgid "" +"The `form_overrides` attribute allows you to replace individual fields " +"within a form. A common use-case for this would be to add a *What-You-" +"See-Is-What-You-Get* (WYSIWIG) editor, or to handle file / image uploads " +"that need to be tied to a field in your model." +msgstr "" +"`form_overrides` 属性允许您替换表单中的单个字段。一个常见的用例是添加一个 What-You-See-Is-What-You-" +"Get (WYSIWIG, 所见即所得) 编辑器,或处理需要绑定到模型中的文件/图像上传字段。" + +#: ../../doc/advanced.rst:131 +msgid "WYSIWIG Text Fields" +msgstr "WYSIWIG 文本字段" + +#: ../../doc/advanced.rst:132 +msgid "" +"To handle complicated text content, you can use `CKEditor " +"`_ by subclassing some of the built-in WTForms " +"classes as follows::" +msgstr "" +"要处理复杂的文本内容,可以通过子类化一些内置的 WTForms 类来集成 `CKEditor `_ " +"编辑器,示例如下::" + +#: ../../doc/advanced.rst:158 +msgid "File & Image Fields" +msgstr "文件 & 图片字段" + +#: ../../doc/advanced.rst:160 +msgid "" +"Flask-Admin comes with a built-in " +":meth:`~flask_admin.form.upload.FileUploadField` and " +":meth:`~flask_admin.form.upload.ImageUploadField`. To make use of them, " +"you'll need to specify an upload directory and add them to the forms in " +"question. Image handling also requires you to have `Pillow " +"`_ installed if you need to do" +" any processing on the image files." +msgstr "" +"Flask-Admin 内置有 :meth:`~flask_admin.form.upload.FileUploadField` 和 " +":meth:`~flask_admin.form.upload.ImageUploadField`。要使用它们,您需要指定一个上传目录,并将它们添加到表单中。如果您需要对图像文件进行处理,则需要安装" +" `Pillow `_。" + +#: ../../doc/advanced.rst:166 +msgid "" +"Have a look at the example at https://github.com/flask-admin/Flask-" +"Admin/tree/master/examples/forms." +msgstr "" +"请查看 https://github.com/flask-admin/Flask-Admin/tree/master/examples/forms" +" 示例。" + +#: ../../doc/advanced.rst:169 +msgid "" +"If you are using the MongoEngine backend, Flask-Admin supports GridFS-" +"backed image and file uploads through WTForms fields. Documentation can " +"be found at :mod:`flask_admin.contrib.mongoengine.fields`." +msgstr "" +"如果您使用 MongoEngine 后端,Flask-Admin 支持通过 WTForms 字段上传的文件/图片,保存在 GridFS " +"后端中。详细信息,请参阅 :mod:`flask_admin.contrib.mongoengine.fields` 文档。" + +#: ../../doc/advanced.rst:171 +msgid "" +"If you just want to manage static files in a directory, without tying " +"them to a database model, then use the :ref:`File-Admin` " +"plug-in." +msgstr "如果您只想管理目录中的静态文件,而不是将其绑定到数据库模型,则使用 :ref:`File-Admin` 插件。" + +#: ../../doc/advanced.rst:175 +msgid "Managing Geographical Models" +msgstr "管理地理模型" + +#: ../../doc/advanced.rst:179 +msgid "" +"If you want to store spatial information in a GIS database, Flask-Admin " +"has you covered. The GeoAlchemy backend extends the SQLAlchemy backend " +"(just as `GeoAlchemy `_ extends " +"SQLAlchemy) to give you a pretty and functional map-based editor for your" +" admin pages." +msgstr "" +"如果你想在 GIS 数据库中存储空间信息,Flask-Admin 同样支持。GeoAlchemy 后端扩展了 SQLAlchemy 后端 (类似 " +"`GeoAlchemy `_ 扩展了 SQLAlchemy " +"),为您的管理页面提供一个漂亮且功能强大的基于地图的编辑器。" + +#: ../../doc/advanced.rst:184 +msgid "Some notable features include:" +msgstr "一些显著的功能包括:" + +#: ../../doc/advanced.rst:186 +msgid "" +"Maps are displayed using the amazing `Leaflet `_ " +"Javascript library, with map data from `Mapbox " +"`_." +msgstr "" +"使用惊人的 `Leaflet `_ Javascript 库显示地图,地图数据来自 `Mapbox " +"`_。" + +#: ../../doc/advanced.rst:188 +msgid "" +"Geographic information, including points, lines and polygons, can be " +"edited interactively using `Leaflet.Draw " +"`_." +msgstr "" +"地理信息,包括点,线和多边形,可以使用 `Leaflet.Draw " +"`_ 交互式编辑。" + +#: ../../doc/advanced.rst:190 +msgid "" +"Graceful fallback: `GeoJSON `_ data can be edited in" +" a ``
    ' + + '
    ' + + '
    ' + // Set to the height of the text, causes scrolling + '
    ' + // Moved around its parent to cover visible view + '
    ' + + // Provides positioning relative to (visible) text origin + '
    ' + + '
    ' + + '
     
    ' + // Absolutely positioned blinky cursor + '
    ' + // DIVs containing the selection and the actual code + '
    '; + if (place.appendChild) place.appendChild(wrapper); else place(wrapper); + // I've never seen more elegant code in my life. + var inputDiv = wrapper.firstChild, input = inputDiv.firstChild, + scroller = wrapper.lastChild, code = scroller.firstChild, + mover = code.firstChild, gutter = mover.firstChild, gutterText = gutter.firstChild, + lineSpace = gutter.nextSibling.firstChild, measure = lineSpace.firstChild, + cursor = measure.nextSibling, selectionDiv = cursor.nextSibling, + lineDiv = selectionDiv.nextSibling; + themeChanged(); + // Needed to hide big blue blinking cursor on Mobile Safari + if (ios) input.style.width = "0px"; + if (!webkit) lineSpace.draggable = true; + lineSpace.style.outline = "none"; + if (options.tabindex != null) input.tabIndex = options.tabindex; + if (options.autofocus) focusInput(); + if (!options.gutter && !options.lineNumbers) gutter.style.display = "none"; + // Needed to handle Tab key in KHTML + if (khtml) inputDiv.style.height = "1px", inputDiv.style.position = "absolute"; + + // Check for problem with IE innerHTML not working when we have a + // P (or similar) parent node. + try { stringWidth("x"); } + catch (e) { + if (e.message.match(/runtime/i)) + e = new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)"); + throw e; + } + + // Delayed object wrap timeouts, making sure only one is active. blinker holds an interval. + var poll = new Delayed(), highlight = new Delayed(), blinker; + + // mode holds a mode API object. doc is the tree of Line objects, + // work an array of lines that should be parsed, and history the + // undo history (instance of History constructor). + var mode, doc = new BranchChunk([new LeafChunk([new Line("")])]), work, focused; + loadMode(); + // The selection. These are always maintained to point at valid + // positions. Inverted is used to remember that the user is + // selecting bottom-to-top. + var sel = {from: {line: 0, ch: 0}, to: {line: 0, ch: 0}, inverted: false}; + // Selection-related flags. shiftSelecting obviously tracks + // whether the user is holding shift. + var shiftSelecting, lastClick, lastDoubleClick, lastScrollPos = 0, draggingText, + overwrite = false, suppressEdits = false; + // Variables used by startOperation/endOperation to track what + // happened during the operation. + var updateInput, userSelChange, changes, textChanged, selectionChanged, leaveInputAlone, + gutterDirty, callbacks; + // Current visible range (may be bigger than the view window). + var displayOffset = 0, showingFrom = 0, showingTo = 0, lastSizeC = 0; + // bracketHighlighted is used to remember that a bracket has been + // marked. + var bracketHighlighted; + // Tracks the maximum line length so that the horizontal scrollbar + // can be kept static when scrolling. + var maxLine = "", maxWidth; + var tabCache = {}; + + // Initialize the content. + operation(function(){setValue(options.value || ""); updateInput = false;})(); + var history = new History(); + + // Register our event handlers. + connect(scroller, "mousedown", operation(onMouseDown)); + connect(scroller, "dblclick", operation(onDoubleClick)); + connect(lineSpace, "dragstart", onDragStart); + connect(lineSpace, "selectstart", e_preventDefault); + // Gecko browsers fire contextmenu *after* opening the menu, at + // which point we can't mess with it anymore. Context menu is + // handled in onMouseDown for Gecko. + if (!gecko) connect(scroller, "contextmenu", onContextMenu); + connect(scroller, "scroll", function() { + lastScrollPos = scroller.scrollTop; + updateDisplay([]); + if (options.fixedGutter) gutter.style.left = scroller.scrollLeft + "px"; + if (options.onScroll) options.onScroll(instance); + }); + connect(window, "resize", function() {updateDisplay(true);}); + connect(input, "keyup", operation(onKeyUp)); + connect(input, "input", fastPoll); + connect(input, "keydown", operation(onKeyDown)); + connect(input, "keypress", operation(onKeyPress)); + connect(input, "focus", onFocus); + connect(input, "blur", onBlur); + + connect(scroller, "dragenter", e_stop); + connect(scroller, "dragover", e_stop); + connect(scroller, "drop", operation(onDrop)); + connect(scroller, "paste", function(){focusInput(); fastPoll();}); + connect(input, "paste", fastPoll); + connect(input, "cut", operation(function(){ + if (!options.readOnly) replaceSelection(""); + })); + + // Needed to handle Tab key in KHTML + if (khtml) connect(code, "mouseup", function() { + if (document.activeElement == input) input.blur(); + focusInput(); + }); + + // IE throws unspecified error in certain cases, when + // trying to access activeElement before onload + var hasFocus; try { hasFocus = (document.activeElement == input); } catch(e) { } + if (hasFocus || options.autofocus) setTimeout(onFocus, 20); + else onBlur(); + + function isLine(l) {return l >= 0 && l < doc.size;} + // The instance object that we'll return. Mostly calls out to + // local functions in the CodeMirror function. Some do some extra + // range checking and/or clipping. operation is used to wrap the + // call so that changes it makes are tracked, and the display is + // updated afterwards. + var instance = wrapper.CodeMirror = { + getValue: getValue, + setValue: operation(setValue), + getSelection: getSelection, + replaceSelection: operation(replaceSelection), + focus: function(){window.focus(); focusInput(); onFocus(); fastPoll();}, + setOption: function(option, value) { + var oldVal = options[option]; + options[option] = value; + if (option == "mode" || option == "indentUnit") loadMode(); + else if (option == "readOnly" && value == "nocursor") {onBlur(); input.blur();} + else if (option == "readOnly" && !value) {resetInput(true);} + else if (option == "theme") themeChanged(); + else if (option == "lineWrapping" && oldVal != value) operation(wrappingChanged)(); + else if (option == "tabSize") updateDisplay(true); + if (option == "lineNumbers" || option == "gutter" || option == "firstLineNumber" || option == "theme") { + gutterChanged(); + updateDisplay(true); + } + }, + getOption: function(option) {return options[option];}, + undo: operation(undo), + redo: operation(redo), + indentLine: operation(function(n, dir) { + if (typeof dir != "string") { + if (dir == null) dir = options.smartIndent ? "smart" : "prev"; + else dir = dir ? "add" : "subtract"; + } + if (isLine(n)) indentLine(n, dir); + }), + indentSelection: operation(indentSelected), + historySize: function() {return {undo: history.done.length, redo: history.undone.length};}, + clearHistory: function() {history = new History();}, + matchBrackets: operation(function(){matchBrackets(true);}), + getTokenAt: operation(function(pos) { + pos = clipPos(pos); + return getLine(pos.line).getTokenAt(mode, getStateBefore(pos.line), pos.ch); + }), + getStateAfter: function(line) { + line = clipLine(line == null ? doc.size - 1: line); + return getStateBefore(line + 1); + }, + cursorCoords: function(start, mode) { + if (start == null) start = sel.inverted; + return this.charCoords(start ? sel.from : sel.to, mode); + }, + charCoords: function(pos, mode) { + pos = clipPos(pos); + if (mode == "local") return localCoords(pos, false); + if (mode == "div") return localCoords(pos, true); + return pageCoords(pos); + }, + coordsChar: function(coords) { + var off = eltOffset(lineSpace); + return coordsChar(coords.x - off.left, coords.y - off.top); + }, + markText: operation(markText), + setBookmark: setBookmark, + findMarksAt: findMarksAt, + setMarker: operation(addGutterMarker), + clearMarker: operation(removeGutterMarker), + setLineClass: operation(setLineClass), + hideLine: operation(function(h) {return setLineHidden(h, true);}), + showLine: operation(function(h) {return setLineHidden(h, false);}), + onDeleteLine: function(line, f) { + if (typeof line == "number") { + if (!isLine(line)) return null; + line = getLine(line); + } + (line.handlers || (line.handlers = [])).push(f); + return line; + }, + lineInfo: lineInfo, + addWidget: function(pos, node, scroll, vert, horiz) { + pos = localCoords(clipPos(pos)); + var top = pos.yBot, left = pos.x; + node.style.position = "absolute"; + code.appendChild(node); + if (vert == "over") top = pos.y; + else if (vert == "near") { + var vspace = Math.max(scroller.offsetHeight, doc.height * textHeight()), + hspace = Math.max(code.clientWidth, lineSpace.clientWidth) - paddingLeft(); + if (pos.yBot + node.offsetHeight > vspace && pos.y > node.offsetHeight) + top = pos.y - node.offsetHeight; + if (left + node.offsetWidth > hspace) + left = hspace - node.offsetWidth; + } + node.style.top = (top + paddingTop()) + "px"; + node.style.left = node.style.right = ""; + if (horiz == "right") { + left = code.clientWidth - node.offsetWidth; + node.style.right = "0px"; + } else { + if (horiz == "left") left = 0; + else if (horiz == "middle") left = (code.clientWidth - node.offsetWidth) / 2; + node.style.left = (left + paddingLeft()) + "px"; + } + if (scroll) + scrollIntoView(left, top, left + node.offsetWidth, top + node.offsetHeight); + }, + + lineCount: function() {return doc.size;}, + clipPos: clipPos, + getCursor: function(start) { + if (start == null) start = sel.inverted; + return copyPos(start ? sel.from : sel.to); + }, + somethingSelected: function() {return !posEq(sel.from, sel.to);}, + setCursor: operation(function(line, ch, user) { + if (ch == null && typeof line.line == "number") setCursor(line.line, line.ch, user); + else setCursor(line, ch, user); + }), + setSelection: operation(function(from, to, user) { + (user ? setSelectionUser : setSelection)(clipPos(from), clipPos(to || from)); + }), + getLine: function(line) {if (isLine(line)) return getLine(line).text;}, + getLineHandle: function(line) {if (isLine(line)) return getLine(line);}, + setLine: operation(function(line, text) { + if (isLine(line)) replaceRange(text, {line: line, ch: 0}, {line: line, ch: getLine(line).text.length}); + }), + removeLine: operation(function(line) { + if (isLine(line)) replaceRange("", {line: line, ch: 0}, clipPos({line: line+1, ch: 0})); + }), + replaceRange: operation(replaceRange), + getRange: function(from, to) {return getRange(clipPos(from), clipPos(to));}, + + triggerOnKeyDown: operation(onKeyDown), + execCommand: function(cmd) {return commands[cmd](instance);}, + // Stuff used by commands, probably not much use to outside code. + moveH: operation(moveH), + deleteH: operation(deleteH), + moveV: operation(moveV), + toggleOverwrite: function() { + if(overwrite){ + overwrite = false; + cursor.className = cursor.className.replace(" CodeMirror-overwrite", ""); + } else { + overwrite = true; + cursor.className += " CodeMirror-overwrite"; + } + }, + + posFromIndex: function(off) { + var lineNo = 0, ch; + doc.iter(0, doc.size, function(line) { + var sz = line.text.length + 1; + if (sz > off) { ch = off; return true; } + off -= sz; + ++lineNo; + }); + return clipPos({line: lineNo, ch: ch}); + }, + indexFromPos: function (coords) { + if (coords.line < 0 || coords.ch < 0) return 0; + var index = coords.ch; + doc.iter(0, coords.line, function (line) { + index += line.text.length + 1; + }); + return index; + }, + scrollTo: function(x, y) { + if (x != null) scroller.scrollLeft = x; + if (y != null) scroller.scrollTop = y; + updateDisplay([]); + }, + + operation: function(f){return operation(f)();}, + refresh: function(){ + updateDisplay(true); + if (scroller.scrollHeight > lastScrollPos) + scroller.scrollTop = lastScrollPos; + }, + getInputField: function(){return input;}, + getWrapperElement: function(){return wrapper;}, + getScrollerElement: function(){return scroller;}, + getGutterElement: function(){return gutter;} + }; + + function getLine(n) { return getLineAt(doc, n); } + function updateLineHeight(line, height) { + gutterDirty = true; + var diff = height - line.height; + for (var n = line; n; n = n.parent) n.height += diff; + } + + function setValue(code) { + var top = {line: 0, ch: 0}; + updateLines(top, {line: doc.size - 1, ch: getLine(doc.size-1).text.length}, + splitLines(code), top, top); + updateInput = true; + } + function getValue(code) { + var text = []; + doc.iter(0, doc.size, function(line) { text.push(line.text); }); + return text.join("\n"); + } + + function onMouseDown(e) { + setShift(e_prop(e, "shiftKey")); + // Check whether this is a click in a widget + for (var n = e_target(e); n != wrapper; n = n.parentNode) + if (n.parentNode == code && n != mover) return; + + // See if this is a click in the gutter + for (var n = e_target(e); n != wrapper; n = n.parentNode) + if (n.parentNode == gutterText) { + if (options.onGutterClick) + options.onGutterClick(instance, indexOf(gutterText.childNodes, n) + showingFrom, e); + return e_preventDefault(e); + } + + var start = posFromMouse(e); + + switch (e_button(e)) { + case 3: + if (gecko && !mac) onContextMenu(e); + return; + case 2: + if (start) setCursor(start.line, start.ch, true); + return; + } + // For button 1, if it was clicked inside the editor + // (posFromMouse returning non-null), we have to adjust the + // selection. + if (!start) {if (e_target(e) == scroller) e_preventDefault(e); return;} + + if (!focused) onFocus(); + + var now = +new Date; + if (lastDoubleClick && lastDoubleClick.time > now - 400 && posEq(lastDoubleClick.pos, start)) { + e_preventDefault(e); + setTimeout(focusInput, 20); + return selectLine(start.line); + } else if (lastClick && lastClick.time > now - 400 && posEq(lastClick.pos, start)) { + lastDoubleClick = {time: now, pos: start}; + e_preventDefault(e); + return selectWordAt(start); + } else { lastClick = {time: now, pos: start}; } + + var last = start, going; + if (dragAndDrop && !options.readOnly && !posEq(sel.from, sel.to) && + !posLess(start, sel.from) && !posLess(sel.to, start)) { + // Let the drag handler handle this. + if (webkit) lineSpace.draggable = true; + var up = connect(document, "mouseup", operation(function(e2) { + if (webkit) lineSpace.draggable = false; + draggingText = false; + up(); + if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) { + e_preventDefault(e2); + setCursor(start.line, start.ch, true); + focusInput(); + } + }), true); + draggingText = true; + // IE's approach to draggable + if (lineSpace.dragDrop) lineSpace.dragDrop(); + return; + } + e_preventDefault(e); + setCursor(start.line, start.ch, true); + + function extend(e) { + var cur = posFromMouse(e, true); + if (cur && !posEq(cur, last)) { + if (!focused) onFocus(); + last = cur; + setSelectionUser(start, cur); + updateInput = false; + var visible = visibleLines(); + if (cur.line >= visible.to || cur.line < visible.from) + going = setTimeout(operation(function(){extend(e);}), 150); + } + } + + function done(e) { + clearTimeout(going); + var cur = posFromMouse(e); + if (cur) setSelectionUser(start, cur); + e_preventDefault(e); + focusInput(); + updateInput = true; + move(); up(); + } + var move = connect(document, "mousemove", operation(function(e) { + clearTimeout(going); + e_preventDefault(e); + if (!ie && !e_button(e)) done(e); + else extend(e); + }), true); + var up = connect(document, "mouseup", operation(done), true); + } + function onDoubleClick(e) { + for (var n = e_target(e); n != wrapper; n = n.parentNode) + if (n.parentNode == gutterText) return e_preventDefault(e); + var start = posFromMouse(e); + if (!start) return; + lastDoubleClick = {time: +new Date, pos: start}; + e_preventDefault(e); + selectWordAt(start); + } + function onDrop(e) { + e.preventDefault(); + var pos = posFromMouse(e, true), files = e.dataTransfer.files; + if (!pos || options.readOnly) return; + if (files && files.length && window.FileReader && window.File) { + function loadFile(file, i) { + var reader = new FileReader; + reader.onload = function() { + text[i] = reader.result; + if (++read == n) { + pos = clipPos(pos); + operation(function() { + var end = replaceRange(text.join(""), pos, pos); + setSelectionUser(pos, end); + })(); + } + }; + reader.readAsText(file); + } + var n = files.length, text = Array(n), read = 0; + for (var i = 0; i < n; ++i) loadFile(files[i], i); + } + else { + try { + var text = e.dataTransfer.getData("Text"); + if (text) { + var curFrom = sel.from, curTo = sel.to; + setSelectionUser(pos, pos); + if (draggingText) replaceRange("", curFrom, curTo); + replaceSelection(text); + focusInput(); + } + } + catch(e){} + } + } + function onDragStart(e) { + var txt = getSelection(); + e.dataTransfer.setData("Text", txt); + + // Use dummy image instead of default browsers image. + if (gecko || chrome) { + var img = document.createElement('img'); + img.scr = 'data:image/gif;base64,R0lGODdhAgACAIAAAAAAAP///ywAAAAAAgACAAACAoRRADs='; //1x1 image + e.dataTransfer.setDragImage(img, 0, 0); + } + } + + function doHandleBinding(bound, dropShift) { + if (typeof bound == "string") { + bound = commands[bound]; + if (!bound) return false; + } + var prevShift = shiftSelecting; + try { + if (options.readOnly) suppressEdits = true; + if (dropShift) shiftSelecting = null; + bound(instance); + } catch(e) { + if (e != Pass) throw e; + return false; + } finally { + shiftSelecting = prevShift; + suppressEdits = false; + } + return true; + } + function handleKeyBinding(e) { + // Handle auto keymap transitions + var startMap = getKeyMap(options.keyMap), next = startMap.auto; + clearTimeout(maybeTransition); + if (next && !isModifierKey(e)) maybeTransition = setTimeout(function() { + if (getKeyMap(options.keyMap) == startMap) { + options.keyMap = (next.call ? next.call(null, instance) : next); + } + }, 50); + + var name = keyNames[e_prop(e, "keyCode")], handled = false; + if (name == null || e.altGraphKey) return false; + if (e_prop(e, "altKey")) name = "Alt-" + name; + if (e_prop(e, "ctrlKey")) name = "Ctrl-" + name; + if (e_prop(e, "metaKey")) name = "Cmd-" + name; + + if (e_prop(e, "shiftKey")) { + handled = lookupKey("Shift-" + name, options.extraKeys, options.keyMap, + function(b) {return doHandleBinding(b, true);}) + || lookupKey(name, options.extraKeys, options.keyMap, function(b) { + if (typeof b == "string" && /^go[A-Z]/.test(b)) return doHandleBinding(b); + }); + } else { + handled = lookupKey(name, options.extraKeys, options.keyMap, doHandleBinding); + } + if (handled) { + e_preventDefault(e); + if (ie) { e.oldKeyCode = e.keyCode; e.keyCode = 0; } + } + return handled; + } + function handleCharBinding(e, ch) { + var handled = lookupKey("'" + ch + "'", options.extraKeys, + options.keyMap, doHandleBinding); + if (handled) e_preventDefault(e); + return handled; + } + + var lastStoppedKey = null, maybeTransition; + function onKeyDown(e) { + if (!focused) onFocus(); + if (ie && e.keyCode == 27) { e.returnValue = false; } + if (pollingFast) { if (readInput()) pollingFast = false; } + if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e))) return; + var code = e_prop(e, "keyCode"); + // IE does strange things with escape. + setShift(code == 16 || e_prop(e, "shiftKey")); + // First give onKeyEvent option a chance to handle this. + var handled = handleKeyBinding(e); + if (window.opera) { + lastStoppedKey = handled ? code : null; + // Opera has no cut event... we try to at least catch the key combo + if (!handled && code == 88 && e_prop(e, mac ? "metaKey" : "ctrlKey")) + replaceSelection(""); + } + } + function onKeyPress(e) { + if (pollingFast) readInput(); + if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e))) return; + var keyCode = e_prop(e, "keyCode"), charCode = e_prop(e, "charCode"); + if (window.opera && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;} + if (((window.opera && !e.which) || khtml) && handleKeyBinding(e)) return; + var ch = String.fromCharCode(charCode == null ? keyCode : charCode); + if (options.electricChars && mode.electricChars && options.smartIndent && !options.readOnly) { + if (mode.electricChars.indexOf(ch) > -1) + setTimeout(operation(function() {indentLine(sel.to.line, "smart");}), 75); + } + if (handleCharBinding(e, ch)) return; + fastPoll(); + } + function onKeyUp(e) { + if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e))) return; + if (e_prop(e, "keyCode") == 16) shiftSelecting = null; + } + + function onFocus() { + if (options.readOnly == "nocursor") return; + if (!focused) { + if (options.onFocus) options.onFocus(instance); + focused = true; + if (wrapper.className.search(/\bCodeMirror-focused\b/) == -1) + wrapper.className += " CodeMirror-focused"; + if (!leaveInputAlone) resetInput(true); + } + slowPoll(); + restartBlink(); + } + function onBlur() { + if (focused) { + if (options.onBlur) options.onBlur(instance); + focused = false; + if (bracketHighlighted) + operation(function(){ + if (bracketHighlighted) { bracketHighlighted(); bracketHighlighted = null; } + })(); + wrapper.className = wrapper.className.replace(" CodeMirror-focused", ""); + } + clearInterval(blinker); + setTimeout(function() {if (!focused) shiftSelecting = null;}, 150); + } + + // Replace the range from from to to by the strings in newText. + // Afterwards, set the selection to selFrom, selTo. + function updateLines(from, to, newText, selFrom, selTo) { + if (suppressEdits) return; + if (history) { + var old = []; + doc.iter(from.line, to.line + 1, function(line) { old.push(line.text); }); + history.addChange(from.line, newText.length, old); + while (history.done.length > options.undoDepth) history.done.shift(); + } + updateLinesNoUndo(from, to, newText, selFrom, selTo); + } + function unredoHelper(from, to) { + if (!from.length) return; + var set = from.pop(), out = []; + for (var i = set.length - 1; i >= 0; i -= 1) { + var change = set[i]; + var replaced = [], end = change.start + change.added; + doc.iter(change.start, end, function(line) { replaced.push(line.text); }); + out.push({start: change.start, added: change.old.length, old: replaced}); + var pos = clipPos({line: change.start + change.old.length - 1, + ch: editEnd(replaced[replaced.length-1], change.old[change.old.length-1])}); + updateLinesNoUndo({line: change.start, ch: 0}, {line: end - 1, ch: getLine(end-1).text.length}, change.old, pos, pos); + } + updateInput = true; + to.push(out); + } + function undo() {unredoHelper(history.done, history.undone);} + function redo() {unredoHelper(history.undone, history.done);} + + function updateLinesNoUndo(from, to, newText, selFrom, selTo) { + if (suppressEdits) return; + var recomputeMaxLength = false, maxLineLength = maxLine.length; + if (!options.lineWrapping) + doc.iter(from.line, to.line, function(line) { + if (line.text.length == maxLineLength) {recomputeMaxLength = true; return true;} + }); + if (from.line != to.line || newText.length > 1) gutterDirty = true; + + var nlines = to.line - from.line, firstLine = getLine(from.line), lastLine = getLine(to.line); + // First adjust the line structure, taking some care to leave highlighting intact. + if (from.ch == 0 && to.ch == 0 && newText[newText.length - 1] == "") { + // This is a whole-line replace. Treated specially to make + // sure line objects move the way they are supposed to. + var added = [], prevLine = null; + if (from.line) { + prevLine = getLine(from.line - 1); + prevLine.fixMarkEnds(lastLine); + } else lastLine.fixMarkStarts(); + for (var i = 0, e = newText.length - 1; i < e; ++i) + added.push(Line.inheritMarks(newText[i], prevLine)); + if (nlines) doc.remove(from.line, nlines, callbacks); + if (added.length) doc.insert(from.line, added); + } else if (firstLine == lastLine) { + if (newText.length == 1) + firstLine.replace(from.ch, to.ch, newText[0]); + else { + lastLine = firstLine.split(to.ch, newText[newText.length-1]); + firstLine.replace(from.ch, null, newText[0]); + firstLine.fixMarkEnds(lastLine); + var added = []; + for (var i = 1, e = newText.length - 1; i < e; ++i) + added.push(Line.inheritMarks(newText[i], firstLine)); + added.push(lastLine); + doc.insert(from.line + 1, added); + } + } else if (newText.length == 1) { + firstLine.replace(from.ch, null, newText[0]); + lastLine.replace(null, to.ch, ""); + firstLine.append(lastLine); + doc.remove(from.line + 1, nlines, callbacks); + } else { + var added = []; + firstLine.replace(from.ch, null, newText[0]); + lastLine.replace(null, to.ch, newText[newText.length-1]); + firstLine.fixMarkEnds(lastLine); + for (var i = 1, e = newText.length - 1; i < e; ++i) + added.push(Line.inheritMarks(newText[i], firstLine)); + if (nlines > 1) doc.remove(from.line + 1, nlines - 1, callbacks); + doc.insert(from.line + 1, added); + } + if (options.lineWrapping) { + var perLine = scroller.clientWidth / charWidth() - 3; + doc.iter(from.line, from.line + newText.length, function(line) { + if (line.hidden) return; + var guess = Math.ceil(line.text.length / perLine) || 1; + if (guess != line.height) updateLineHeight(line, guess); + }); + } else { + doc.iter(from.line, i + newText.length, function(line) { + var l = line.text; + if (l.length > maxLineLength) { + maxLine = l; maxLineLength = l.length; maxWidth = null; + recomputeMaxLength = false; + } + }); + if (recomputeMaxLength) { + maxLineLength = 0; maxLine = ""; maxWidth = null; + doc.iter(0, doc.size, function(line) { + var l = line.text; + if (l.length > maxLineLength) { + maxLineLength = l.length; maxLine = l; + } + }); + } + } + + // Add these lines to the work array, so that they will be + // highlighted. Adjust work lines if lines were added/removed. + var newWork = [], lendiff = newText.length - nlines - 1; + for (var i = 0, l = work.length; i < l; ++i) { + var task = work[i]; + if (task < from.line) newWork.push(task); + else if (task > to.line) newWork.push(task + lendiff); + } + var hlEnd = from.line + Math.min(newText.length, 500); + highlightLines(from.line, hlEnd); + newWork.push(hlEnd); + work = newWork; + startWorker(100); + // Remember that these lines changed, for updating the display + changes.push({from: from.line, to: to.line + 1, diff: lendiff}); + var changeObj = {from: from, to: to, text: newText}; + if (textChanged) { + for (var cur = textChanged; cur.next; cur = cur.next) {} + cur.next = changeObj; + } else textChanged = changeObj; + + // Update the selection + function updateLine(n) {return n <= Math.min(to.line, to.line + lendiff) ? n : n + lendiff;} + setSelection(selFrom, selTo, updateLine(sel.from.line), updateLine(sel.to.line)); + + // Make sure the scroll-size div has the correct height. + if (scroller.clientHeight) + code.style.height = (doc.height * textHeight() + 2 * paddingTop()) + "px"; + } + + function replaceRange(code, from, to) { + from = clipPos(from); + if (!to) to = from; else to = clipPos(to); + code = splitLines(code); + function adjustPos(pos) { + if (posLess(pos, from)) return pos; + if (!posLess(to, pos)) return end; + var line = pos.line + code.length - (to.line - from.line) - 1; + var ch = pos.ch; + if (pos.line == to.line) + ch += code[code.length-1].length - (to.ch - (to.line == from.line ? from.ch : 0)); + return {line: line, ch: ch}; + } + var end; + replaceRange1(code, from, to, function(end1) { + end = end1; + return {from: adjustPos(sel.from), to: adjustPos(sel.to)}; + }); + return end; + } + function replaceSelection(code, collapse) { + replaceRange1(splitLines(code), sel.from, sel.to, function(end) { + if (collapse == "end") return {from: end, to: end}; + else if (collapse == "start") return {from: sel.from, to: sel.from}; + else return {from: sel.from, to: end}; + }); + } + function replaceRange1(code, from, to, computeSel) { + var endch = code.length == 1 ? code[0].length + from.ch : code[code.length-1].length; + var newSel = computeSel({line: from.line + code.length - 1, ch: endch}); + updateLines(from, to, code, newSel.from, newSel.to); + } + + function getRange(from, to) { + var l1 = from.line, l2 = to.line; + if (l1 == l2) return getLine(l1).text.slice(from.ch, to.ch); + var code = [getLine(l1).text.slice(from.ch)]; + doc.iter(l1 + 1, l2, function(line) { code.push(line.text); }); + code.push(getLine(l2).text.slice(0, to.ch)); + return code.join("\n"); + } + function getSelection() { + return getRange(sel.from, sel.to); + } + + var pollingFast = false; // Ensures slowPoll doesn't cancel fastPoll + function slowPoll() { + if (pollingFast) return; + poll.set(options.pollInterval, function() { + startOperation(); + readInput(); + if (focused) slowPoll(); + endOperation(); + }); + } + function fastPoll() { + var missed = false; + pollingFast = true; + function p() { + startOperation(); + var changed = readInput(); + if (!changed && !missed) {missed = true; poll.set(60, p);} + else {pollingFast = false; slowPoll();} + endOperation(); + } + poll.set(20, p); + } + + // Previnput is a hack to work with IME. If we reset the textarea + // on every change, that breaks IME. So we look for changes + // compared to the previous content instead. (Modern browsers have + // events that indicate IME taking place, but these are not widely + // supported or compatible enough yet to rely on.) + var prevInput = ""; + function readInput() { + if (leaveInputAlone || !focused || hasSelection(input) || options.readOnly) return false; + var text = input.value; + if (text == prevInput) return false; + shiftSelecting = null; + var same = 0, l = Math.min(prevInput.length, text.length); + while (same < l && prevInput[same] == text[same]) ++same; + if (same < prevInput.length) + sel.from = {line: sel.from.line, ch: sel.from.ch - (prevInput.length - same)}; + else if (overwrite && posEq(sel.from, sel.to)) + sel.to = {line: sel.to.line, ch: Math.min(getLine(sel.to.line).text.length, sel.to.ch + (text.length - same))}; + replaceSelection(text.slice(same), "end"); + prevInput = text; + return true; + } + function resetInput(user) { + if (!posEq(sel.from, sel.to)) { + prevInput = ""; + input.value = getSelection(); + selectInput(input); + } else if (user) prevInput = input.value = ""; + } + + function focusInput() { + if (options.readOnly != "nocursor") input.focus(); + } + + function scrollEditorIntoView() { + if (!cursor.getBoundingClientRect) return; + var rect = cursor.getBoundingClientRect(); + // IE returns bogus coordinates when the instance sits inside of an iframe and the cursor is hidden + if (ie && rect.top == rect.bottom) return; + var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight); + if (rect.top < 0 || rect.bottom > winH) cursor.scrollIntoView(); + } + function scrollCursorIntoView() { + var cursor = localCoords(sel.inverted ? sel.from : sel.to); + var x = options.lineWrapping ? Math.min(cursor.x, lineSpace.offsetWidth) : cursor.x; + return scrollIntoView(x, cursor.y, x, cursor.yBot); + } + function scrollIntoView(x1, y1, x2, y2) { + var pl = paddingLeft(), pt = paddingTop(); + y1 += pt; y2 += pt; x1 += pl; x2 += pl; + var screen = scroller.clientHeight, screentop = scroller.scrollTop, scrolled = false, result = true; + if (y1 < screentop) {scroller.scrollTop = Math.max(0, y1); scrolled = true;} + else if (y2 > screentop + screen) {scroller.scrollTop = y2 - screen; scrolled = true;} + + var screenw = scroller.clientWidth, screenleft = scroller.scrollLeft; + var gutterw = options.fixedGutter ? gutter.clientWidth : 0; + if (x1 < screenleft + gutterw) { + if (x1 < 50) x1 = 0; + scroller.scrollLeft = Math.max(0, x1 - 10 - gutterw); + scrolled = true; + } + else if (x2 > screenw + screenleft - 3) { + scroller.scrollLeft = x2 + 10 - screenw; + scrolled = true; + if (x2 > code.clientWidth) result = false; + } + if (scrolled && options.onScroll) options.onScroll(instance); + return result; + } + + function visibleLines() { + var lh = textHeight(), top = scroller.scrollTop - paddingTop(); + var from_height = Math.max(0, Math.floor(top / lh)); + var to_height = Math.ceil((top + scroller.clientHeight) / lh); + return {from: lineAtHeight(doc, from_height), + to: lineAtHeight(doc, to_height)}; + } + // Uses a set of changes plus the current scroll position to + // determine which DOM updates have to be made, and makes the + // updates. + function updateDisplay(changes, suppressCallback) { + if (!scroller.clientWidth) { + showingFrom = showingTo = displayOffset = 0; + return; + } + // Compute the new visible window + var visible = visibleLines(); + // Bail out if the visible area is already rendered and nothing changed. + if (changes !== true && changes.length == 0 && visible.from > showingFrom && visible.to < showingTo) return; + var from = Math.max(visible.from - 100, 0), to = Math.min(doc.size, visible.to + 100); + if (showingFrom < from && from - showingFrom < 20) from = showingFrom; + if (showingTo > to && showingTo - to < 20) to = Math.min(doc.size, showingTo); + + // Create a range of theoretically intact lines, and punch holes + // in that using the change info. + var intact = changes === true ? [] : + computeIntact([{from: showingFrom, to: showingTo, domStart: 0}], changes); + // Clip off the parts that won't be visible + var intactLines = 0; + for (var i = 0; i < intact.length; ++i) { + var range = intact[i]; + if (range.from < from) {range.domStart += (from - range.from); range.from = from;} + if (range.to > to) range.to = to; + if (range.from >= range.to) intact.splice(i--, 1); + else intactLines += range.to - range.from; + } + if (intactLines == to - from) return; + intact.sort(function(a, b) {return a.domStart - b.domStart;}); + + var th = textHeight(), gutterDisplay = gutter.style.display; + lineDiv.style.display = "none"; + patchDisplay(from, to, intact); + lineDiv.style.display = gutter.style.display = ""; + + // Position the mover div to align with the lines it's supposed + // to be showing (which will cover the visible display) + var different = from != showingFrom || to != showingTo || lastSizeC != scroller.clientHeight + th; + // This is just a bogus formula that detects when the editor is + // resized or the font size changes. + if (different) lastSizeC = scroller.clientHeight + th; + showingFrom = from; showingTo = to; + displayOffset = heightAtLine(doc, from); + mover.style.top = (displayOffset * th) + "px"; + if (scroller.clientHeight) + code.style.height = (doc.height * th + 2 * paddingTop()) + "px"; + + // Since this is all rather error prone, it is honoured with the + // only assertion in the whole file. + if (lineDiv.childNodes.length != showingTo - showingFrom) + throw new Error("BAD PATCH! " + JSON.stringify(intact) + " size=" + (showingTo - showingFrom) + + " nodes=" + lineDiv.childNodes.length); + + function checkHeights() { + maxWidth = scroller.clientWidth; + var curNode = lineDiv.firstChild, heightChanged = false; + doc.iter(showingFrom, showingTo, function(line) { + if (!line.hidden) { + var height = Math.round(curNode.offsetHeight / th) || 1; + if (line.height != height) { + updateLineHeight(line, height); + gutterDirty = heightChanged = true; + } + } + curNode = curNode.nextSibling; + }); + if (heightChanged) + code.style.height = (doc.height * th + 2 * paddingTop()) + "px"; + return heightChanged; + } + + if (options.lineWrapping) { + checkHeights(); + } else { + if (maxWidth == null) maxWidth = stringWidth(maxLine); + if (maxWidth > scroller.clientWidth) { + lineSpace.style.width = maxWidth + "px"; + // Needed to prevent odd wrapping/hiding of widgets placed in here. + code.style.width = ""; + code.style.width = scroller.scrollWidth + "px"; + } else { + lineSpace.style.width = code.style.width = ""; + } + } + + gutter.style.display = gutterDisplay; + if (different || gutterDirty) { + // If the gutter grew in size, re-check heights. If those changed, re-draw gutter. + updateGutter() && options.lineWrapping && checkHeights() && updateGutter(); + } + updateSelection(); + if (!suppressCallback && options.onUpdate) options.onUpdate(instance); + return true; + } + + function computeIntact(intact, changes) { + for (var i = 0, l = changes.length || 0; i < l; ++i) { + var change = changes[i], intact2 = [], diff = change.diff || 0; + for (var j = 0, l2 = intact.length; j < l2; ++j) { + var range = intact[j]; + if (change.to <= range.from && change.diff) + intact2.push({from: range.from + diff, to: range.to + diff, + domStart: range.domStart}); + else if (change.to <= range.from || change.from >= range.to) + intact2.push(range); + else { + if (change.from > range.from) + intact2.push({from: range.from, to: change.from, domStart: range.domStart}); + if (change.to < range.to) + intact2.push({from: change.to + diff, to: range.to + diff, + domStart: range.domStart + (change.to - range.from)}); + } + } + intact = intact2; + } + return intact; + } + + function patchDisplay(from, to, intact) { + // The first pass removes the DOM nodes that aren't intact. + if (!intact.length) lineDiv.innerHTML = ""; + else { + function killNode(node) { + var tmp = node.nextSibling; + node.parentNode.removeChild(node); + return tmp; + } + var domPos = 0, curNode = lineDiv.firstChild, n; + for (var i = 0; i < intact.length; ++i) { + var cur = intact[i]; + while (cur.domStart > domPos) {curNode = killNode(curNode); domPos++;} + for (var j = 0, e = cur.to - cur.from; j < e; ++j) {curNode = curNode.nextSibling; domPos++;} + } + while (curNode) curNode = killNode(curNode); + } + // This pass fills in the lines that actually changed. + var nextIntact = intact.shift(), curNode = lineDiv.firstChild, j = from; + var scratch = document.createElement("div"); + doc.iter(from, to, function(line) { + if (nextIntact && nextIntact.to == j) nextIntact = intact.shift(); + if (!nextIntact || nextIntact.from > j) { + if (line.hidden) var html = scratch.innerHTML = "
    ";
    +          else {
    +            var html = ''
    +              + line.getHTML(makeTab) + '';
    +            // Kludge to make sure the styled element lies behind the selection (by z-index)
    +            if (line.bgClassName)
    +              html = '
     
    ' + html + "
    "; + } + scratch.innerHTML = html; + lineDiv.insertBefore(scratch.firstChild, curNode); + } else { + curNode = curNode.nextSibling; + } + ++j; + }); + } + + function updateGutter() { + if (!options.gutter && !options.lineNumbers) return; + var hText = mover.offsetHeight, hEditor = scroller.clientHeight; + gutter.style.height = (hText - hEditor < 2 ? hEditor : hText) + "px"; + var html = [], i = showingFrom, normalNode; + doc.iter(showingFrom, Math.max(showingTo, showingFrom + 1), function(line) { + if (line.hidden) { + html.push("
    ");
    +        } else {
    +          var marker = line.gutterMarker;
    +          var text = options.lineNumbers ? i + options.firstLineNumber : null;
    +          if (marker && marker.text)
    +            text = marker.text.replace("%N%", text != null ? text : "");
    +          else if (text == null)
    +            text = "\u00a0";
    +          html.push((marker && marker.style ? '
    ' : "
    "), text);
    +          for (var j = 1; j < line.height; ++j) html.push("
     "); + html.push("
    "); + if (!marker) normalNode = i; + } + ++i; + }); + gutter.style.display = "none"; + gutterText.innerHTML = html.join(""); + // Make sure scrolling doesn't cause number gutter size to pop + if (normalNode != null) { + var node = gutterText.childNodes[normalNode - showingFrom]; + var minwidth = String(doc.size).length, val = eltText(node), pad = ""; + while (val.length + pad.length < minwidth) pad += "\u00a0"; + if (pad) node.insertBefore(document.createTextNode(pad), node.firstChild); + } + gutter.style.display = ""; + var resized = Math.abs((parseInt(lineSpace.style.marginLeft) || 0) - gutter.offsetWidth) > 2; + lineSpace.style.marginLeft = gutter.offsetWidth + "px"; + gutterDirty = false; + return resized; + } + function updateSelection() { + var collapsed = posEq(sel.from, sel.to); + var fromPos = localCoords(sel.from, true); + var toPos = collapsed ? fromPos : localCoords(sel.to, true); + var headPos = sel.inverted ? fromPos : toPos, th = textHeight(); + var wrapOff = eltOffset(wrapper), lineOff = eltOffset(lineDiv); + inputDiv.style.top = Math.max(0, Math.min(scroller.offsetHeight, headPos.y + lineOff.top - wrapOff.top)) + "px"; + inputDiv.style.left = Math.max(0, Math.min(scroller.offsetWidth, headPos.x + lineOff.left - wrapOff.left)) + "px"; + if (collapsed) { + cursor.style.top = headPos.y + "px"; + cursor.style.left = (options.lineWrapping ? Math.min(headPos.x, lineSpace.offsetWidth) : headPos.x) + "px"; + cursor.style.display = ""; + selectionDiv.style.display = "none"; + } else { + var sameLine = fromPos.y == toPos.y, html = ""; + function add(left, top, right, height) { + html += '
    '; + } + var clientWidth = lineSpace.clientWidth || lineSpace.offsetWidth; + var clientHeight = lineSpace.clientHeight || lineSpace.offsetHeight; + if (sel.from.ch && fromPos.y >= 0) { + var right = sameLine ? clientWidth - toPos.x : 0; + add(fromPos.x, fromPos.y, right, th); + } + var middleStart = Math.max(0, fromPos.y + (sel.from.ch ? th : 0)); + var middleHeight = Math.min(toPos.y, clientHeight) - middleStart; + if (middleHeight > 0.2 * th) + add(0, middleStart, 0, middleHeight); + if ((!sameLine || !sel.from.ch) && toPos.y < clientHeight - .5 * th) + add(0, toPos.y, clientWidth - toPos.x, th); + selectionDiv.innerHTML = html; + cursor.style.display = "none"; + selectionDiv.style.display = ""; + } + } + + function setShift(val) { + if (val) shiftSelecting = shiftSelecting || (sel.inverted ? sel.to : sel.from); + else shiftSelecting = null; + } + function setSelectionUser(from, to) { + var sh = shiftSelecting && clipPos(shiftSelecting); + if (sh) { + if (posLess(sh, from)) from = sh; + else if (posLess(to, sh)) to = sh; + } + setSelection(from, to); + userSelChange = true; + } + // Update the selection. Last two args are only used by + // updateLines, since they have to be expressed in the line + // numbers before the update. + function setSelection(from, to, oldFrom, oldTo) { + goalColumn = null; + if (oldFrom == null) {oldFrom = sel.from.line; oldTo = sel.to.line;} + if (posEq(sel.from, from) && posEq(sel.to, to)) return; + if (posLess(to, from)) {var tmp = to; to = from; from = tmp;} + + // Skip over hidden lines. + if (from.line != oldFrom) { + var from1 = skipHidden(from, oldFrom, sel.from.ch); + // If there is no non-hidden line left, force visibility on current line + if (!from1) setLineHidden(from.line, false); + else from = from1; + } + if (to.line != oldTo) to = skipHidden(to, oldTo, sel.to.ch); + + if (posEq(from, to)) sel.inverted = false; + else if (posEq(from, sel.to)) sel.inverted = false; + else if (posEq(to, sel.from)) sel.inverted = true; + + if (options.autoClearEmptyLines && posEq(sel.from, sel.to)) { + var head = sel.inverted ? from : to; + if (head.line != sel.from.line && sel.from.line < doc.size) { + var oldLine = getLine(sel.from.line); + if (/^\s+$/.test(oldLine.text)) + setTimeout(operation(function() { + if (oldLine.parent && /^\s+$/.test(oldLine.text)) { + var no = lineNo(oldLine); + replaceRange("", {line: no, ch: 0}, {line: no, ch: oldLine.text.length}); + } + }, 10)); + } + } + + sel.from = from; sel.to = to; + selectionChanged = true; + } + function skipHidden(pos, oldLine, oldCh) { + function getNonHidden(dir) { + var lNo = pos.line + dir, end = dir == 1 ? doc.size : -1; + while (lNo != end) { + var line = getLine(lNo); + if (!line.hidden) { + var ch = pos.ch; + if (ch > oldCh || ch > line.text.length) ch = line.text.length; + return {line: lNo, ch: ch}; + } + lNo += dir; + } + } + var line = getLine(pos.line); + if (!line.hidden) return pos; + if (pos.line >= oldLine) return getNonHidden(1) || getNonHidden(-1); + else return getNonHidden(-1) || getNonHidden(1); + } + function setCursor(line, ch, user) { + var pos = clipPos({line: line, ch: ch || 0}); + (user ? setSelectionUser : setSelection)(pos, pos); + } + + function clipLine(n) {return Math.max(0, Math.min(n, doc.size-1));} + function clipPos(pos) { + if (pos.line < 0) return {line: 0, ch: 0}; + if (pos.line >= doc.size) return {line: doc.size-1, ch: getLine(doc.size-1).text.length}; + var ch = pos.ch, linelen = getLine(pos.line).text.length; + if (ch == null || ch > linelen) return {line: pos.line, ch: linelen}; + else if (ch < 0) return {line: pos.line, ch: 0}; + else return pos; + } + + function findPosH(dir, unit) { + var end = sel.inverted ? sel.from : sel.to, line = end.line, ch = end.ch; + var lineObj = getLine(line); + function findNextLine() { + for (var l = line + dir, e = dir < 0 ? -1 : doc.size; l != e; l += dir) { + var lo = getLine(l); + if (!lo.hidden) { line = l; lineObj = lo; return true; } + } + } + function moveOnce(boundToLine) { + if (ch == (dir < 0 ? 0 : lineObj.text.length)) { + if (!boundToLine && findNextLine()) ch = dir < 0 ? lineObj.text.length : 0; + else return false; + } else ch += dir; + return true; + } + if (unit == "char") moveOnce(); + else if (unit == "column") moveOnce(true); + else if (unit == "word") { + var sawWord = false; + for (;;) { + if (dir < 0) if (!moveOnce()) break; + if (isWordChar(lineObj.text.charAt(ch))) sawWord = true; + else if (sawWord) {if (dir < 0) {dir = 1; moveOnce();} break;} + if (dir > 0) if (!moveOnce()) break; + } + } + return {line: line, ch: ch}; + } + function moveH(dir, unit) { + var pos = dir < 0 ? sel.from : sel.to; + if (shiftSelecting || posEq(sel.from, sel.to)) pos = findPosH(dir, unit); + setCursor(pos.line, pos.ch, true); + } + function deleteH(dir, unit) { + if (!posEq(sel.from, sel.to)) replaceRange("", sel.from, sel.to); + else if (dir < 0) replaceRange("", findPosH(dir, unit), sel.to); + else replaceRange("", sel.from, findPosH(dir, unit)); + userSelChange = true; + } + var goalColumn = null; + function moveV(dir, unit) { + var dist = 0, pos = localCoords(sel.inverted ? sel.from : sel.to, true); + if (goalColumn != null) pos.x = goalColumn; + if (unit == "page") dist = Math.min(scroller.clientHeight, window.innerHeight || document.documentElement.clientHeight); + else if (unit == "line") dist = textHeight(); + var target = coordsChar(pos.x, pos.y + dist * dir + 2); + if (unit == "page") scroller.scrollTop += localCoords(target, true).y - pos.y; + setCursor(target.line, target.ch, true); + goalColumn = pos.x; + } + + function selectWordAt(pos) { + var line = getLine(pos.line).text; + var start = pos.ch, end = pos.ch; + while (start > 0 && isWordChar(line.charAt(start - 1))) --start; + while (end < line.length && isWordChar(line.charAt(end))) ++end; + setSelectionUser({line: pos.line, ch: start}, {line: pos.line, ch: end}); + } + function selectLine(line) { + setSelectionUser({line: line, ch: 0}, clipPos({line: line + 1, ch: 0})); + } + function indentSelected(mode) { + if (posEq(sel.from, sel.to)) return indentLine(sel.from.line, mode); + var e = sel.to.line - (sel.to.ch ? 0 : 1); + for (var i = sel.from.line; i <= e; ++i) indentLine(i, mode); + } + + function indentLine(n, how) { + if (!how) how = "add"; + if (how == "smart") { + if (!mode.indent) how = "prev"; + else var state = getStateBefore(n); + } + + var line = getLine(n), curSpace = line.indentation(options.tabSize), + curSpaceString = line.text.match(/^\s*/)[0], indentation; + if (how == "prev") { + if (n) indentation = getLine(n-1).indentation(options.tabSize); + else indentation = 0; + } + else if (how == "smart") indentation = mode.indent(state, line.text.slice(curSpaceString.length), line.text); + else if (how == "add") indentation = curSpace + options.indentUnit; + else if (how == "subtract") indentation = curSpace - options.indentUnit; + indentation = Math.max(0, indentation); + var diff = indentation - curSpace; + + if (!diff) { + if (sel.from.line != n && sel.to.line != n) return; + var indentString = curSpaceString; + } + else { + var indentString = "", pos = 0; + if (options.indentWithTabs) + for (var i = Math.floor(indentation / options.tabSize); i; --i) {pos += options.tabSize; indentString += "\t";} + while (pos < indentation) {++pos; indentString += " ";} + } + + replaceRange(indentString, {line: n, ch: 0}, {line: n, ch: curSpaceString.length}); + } + + function loadMode() { + mode = CodeMirror.getMode(options, options.mode); + doc.iter(0, doc.size, function(line) { line.stateAfter = null; }); + work = [0]; + startWorker(); + } + function gutterChanged() { + var visible = options.gutter || options.lineNumbers; + gutter.style.display = visible ? "" : "none"; + if (visible) gutterDirty = true; + else lineDiv.parentNode.style.marginLeft = 0; + } + function wrappingChanged(from, to) { + if (options.lineWrapping) { + wrapper.className += " CodeMirror-wrap"; + var perLine = scroller.clientWidth / charWidth() - 3; + doc.iter(0, doc.size, function(line) { + if (line.hidden) return; + var guess = Math.ceil(line.text.length / perLine) || 1; + if (guess != 1) updateLineHeight(line, guess); + }); + lineSpace.style.width = code.style.width = ""; + } else { + wrapper.className = wrapper.className.replace(" CodeMirror-wrap", ""); + maxWidth = null; maxLine = ""; + doc.iter(0, doc.size, function(line) { + if (line.height != 1 && !line.hidden) updateLineHeight(line, 1); + if (line.text.length > maxLine.length) maxLine = line.text; + }); + } + changes.push({from: 0, to: doc.size}); + } + function makeTab(col) { + var w = options.tabSize - col % options.tabSize, cached = tabCache[w]; + if (cached) return cached; + for (var str = '', i = 0; i < w; ++i) str += " "; + return (tabCache[w] = {html: str + "", width: w}); + } + function themeChanged() { + scroller.className = scroller.className.replace(/\s*cm-s-\w+/g, "") + + options.theme.replace(/(^|\s)\s*/g, " cm-s-"); + } + + function TextMarker() { this.set = []; } + TextMarker.prototype.clear = operation(function() { + var min = Infinity, max = -Infinity; + for (var i = 0, e = this.set.length; i < e; ++i) { + var line = this.set[i], mk = line.marked; + if (!mk || !line.parent) continue; + var lineN = lineNo(line); + min = Math.min(min, lineN); max = Math.max(max, lineN); + for (var j = 0; j < mk.length; ++j) + if (mk[j].marker == this) mk.splice(j--, 1); + } + if (min != Infinity) + changes.push({from: min, to: max + 1}); + }); + TextMarker.prototype.find = function() { + var from, to; + for (var i = 0, e = this.set.length; i < e; ++i) { + var line = this.set[i], mk = line.marked; + for (var j = 0; j < mk.length; ++j) { + var mark = mk[j]; + if (mark.marker == this) { + if (mark.from != null || mark.to != null) { + var found = lineNo(line); + if (found != null) { + if (mark.from != null) from = {line: found, ch: mark.from}; + if (mark.to != null) to = {line: found, ch: mark.to}; + } + } + } + } + } + return {from: from, to: to}; + }; + + function markText(from, to, className) { + from = clipPos(from); to = clipPos(to); + var tm = new TextMarker(); + if (!posLess(from, to)) return tm; + function add(line, from, to, className) { + getLine(line).addMark(new MarkedText(from, to, className, tm)); + } + if (from.line == to.line) add(from.line, from.ch, to.ch, className); + else { + add(from.line, from.ch, null, className); + for (var i = from.line + 1, e = to.line; i < e; ++i) + add(i, null, null, className); + add(to.line, null, to.ch, className); + } + changes.push({from: from.line, to: to.line + 1}); + return tm; + } + + function setBookmark(pos) { + pos = clipPos(pos); + var bm = new Bookmark(pos.ch); + getLine(pos.line).addMark(bm); + return bm; + } + + function findMarksAt(pos) { + pos = clipPos(pos); + var markers = [], marked = getLine(pos.line).marked; + if (!marked) return markers; + for (var i = 0, e = marked.length; i < e; ++i) { + var m = marked[i]; + if ((m.from == null || m.from <= pos.ch) && + (m.to == null || m.to >= pos.ch)) + markers.push(m.marker || m); + } + return markers; + } + + function addGutterMarker(line, text, className) { + if (typeof line == "number") line = getLine(clipLine(line)); + line.gutterMarker = {text: text, style: className}; + gutterDirty = true; + return line; + } + function removeGutterMarker(line) { + if (typeof line == "number") line = getLine(clipLine(line)); + line.gutterMarker = null; + gutterDirty = true; + } + + function changeLine(handle, op) { + var no = handle, line = handle; + if (typeof handle == "number") line = getLine(clipLine(handle)); + else no = lineNo(handle); + if (no == null) return null; + if (op(line, no)) changes.push({from: no, to: no + 1}); + else return null; + return line; + } + function setLineClass(handle, className, bgClassName) { + return changeLine(handle, function(line) { + if (line.className != className || line.bgClassName != bgClassName) { + line.className = className; + line.bgClassName = bgClassName; + return true; + } + }); + } + function setLineHidden(handle, hidden) { + return changeLine(handle, function(line, no) { + if (line.hidden != hidden) { + line.hidden = hidden; + updateLineHeight(line, hidden ? 0 : 1); + var fline = sel.from.line, tline = sel.to.line; + if (hidden && (fline == no || tline == no)) { + var from = fline == no ? skipHidden({line: fline, ch: 0}, fline, 0) : sel.from; + var to = tline == no ? skipHidden({line: tline, ch: 0}, tline, 0) : sel.to; + // Can't hide the last visible line, we'd have no place to put the cursor + if (!to) return; + setSelection(from, to); + } + return (gutterDirty = true); + } + }); + } + + function lineInfo(line) { + if (typeof line == "number") { + if (!isLine(line)) return null; + var n = line; + line = getLine(line); + if (!line) return null; + } + else { + var n = lineNo(line); + if (n == null) return null; + } + var marker = line.gutterMarker; + return {line: n, handle: line, text: line.text, markerText: marker && marker.text, + markerClass: marker && marker.style, lineClass: line.className, bgClass: line.bgClassName}; + } + + function stringWidth(str) { + measure.innerHTML = "
    x
    "; + measure.firstChild.firstChild.firstChild.nodeValue = str; + return measure.firstChild.firstChild.offsetWidth || 10; + } + // These are used to go from pixel positions to character + // positions, taking varying character widths into account. + function charFromX(line, x) { + if (x <= 0) return 0; + var lineObj = getLine(line), text = lineObj.text; + function getX(len) { + measure.innerHTML = "
    " + lineObj.getHTML(makeTab, len) + "
    "; + return measure.firstChild.firstChild.offsetWidth; + } + var from = 0, fromX = 0, to = text.length, toX; + // Guess a suitable upper bound for our search. + var estimated = Math.min(to, Math.ceil(x / charWidth())); + for (;;) { + var estX = getX(estimated); + if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2)); + else {toX = estX; to = estimated; break;} + } + if (x > toX) return to; + // Try to guess a suitable lower bound as well. + estimated = Math.floor(to * 0.8); estX = getX(estimated); + if (estX < x) {from = estimated; fromX = estX;} + // Do a binary search between these bounds. + for (;;) { + if (to - from <= 1) return (toX - x > x - fromX) ? from : to; + var middle = Math.ceil((from + to) / 2), middleX = getX(middle); + if (middleX > x) {to = middle; toX = middleX;} + else {from = middle; fromX = middleX;} + } + } + + var tempId = Math.floor(Math.random() * 0xffffff).toString(16); + function measureLine(line, ch) { + if (ch == 0) return {top: 0, left: 0}; + var extra = ""; + // Include extra text at the end to make sure the measured line is wrapped in the right way. + if (options.lineWrapping) { + var end = line.text.indexOf(" ", ch + 6); + extra = htmlEscape(line.text.slice(ch + 1, end < 0 ? line.text.length : end + (ie ? 5 : 0))); + } + measure.innerHTML = "
    " + line.getHTML(makeTab, ch) +
    +        '' + htmlEscape(line.text.charAt(ch) || " ") + "" +
    +        extra + "
    "; + var elt = document.getElementById("CodeMirror-temp-" + tempId); + var top = elt.offsetTop, left = elt.offsetLeft; + // Older IEs report zero offsets for spans directly after a wrap + if (ie && top == 0 && left == 0) { + var backup = document.createElement("span"); + backup.innerHTML = "x"; + elt.parentNode.insertBefore(backup, elt.nextSibling); + top = backup.offsetTop; + } + return {top: top, left: left}; + } + function localCoords(pos, inLineWrap) { + var x, lh = textHeight(), y = lh * (heightAtLine(doc, pos.line) - (inLineWrap ? displayOffset : 0)); + if (pos.ch == 0) x = 0; + else { + var sp = measureLine(getLine(pos.line), pos.ch); + x = sp.left; + if (options.lineWrapping) y += Math.max(0, sp.top); + } + return {x: x, y: y, yBot: y + lh}; + } + // Coords must be lineSpace-local + function coordsChar(x, y) { + if (y < 0) y = 0; + var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th); + var lineNo = lineAtHeight(doc, heightPos); + if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length}; + var lineObj = getLine(lineNo), text = lineObj.text; + var tw = options.lineWrapping, innerOff = tw ? heightPos - heightAtLine(doc, lineNo) : 0; + if (x <= 0 && innerOff == 0) return {line: lineNo, ch: 0}; + function getX(len) { + var sp = measureLine(lineObj, len); + if (tw) { + var off = Math.round(sp.top / th); + return Math.max(0, sp.left + (off - innerOff) * scroller.clientWidth); + } + return sp.left; + } + var from = 0, fromX = 0, to = text.length, toX; + // Guess a suitable upper bound for our search. + var estimated = Math.min(to, Math.ceil((x + innerOff * scroller.clientWidth * .9) / cw)); + for (;;) { + var estX = getX(estimated); + if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2)); + else {toX = estX; to = estimated; break;} + } + if (x > toX) return {line: lineNo, ch: to}; + // Try to guess a suitable lower bound as well. + estimated = Math.floor(to * 0.8); estX = getX(estimated); + if (estX < x) {from = estimated; fromX = estX;} + // Do a binary search between these bounds. + for (;;) { + if (to - from <= 1) return {line: lineNo, ch: (toX - x > x - fromX) ? from : to}; + var middle = Math.ceil((from + to) / 2), middleX = getX(middle); + if (middleX > x) {to = middle; toX = middleX;} + else {from = middle; fromX = middleX;} + } + } + function pageCoords(pos) { + var local = localCoords(pos, true), off = eltOffset(lineSpace); + return {x: off.left + local.x, y: off.top + local.y, yBot: off.top + local.yBot}; + } + + var cachedHeight, cachedHeightFor, measureText; + function textHeight() { + if (measureText == null) { + measureText = "
    ";
    +        for (var i = 0; i < 49; ++i) measureText += "x
    "; + measureText += "x
    "; + } + var offsetHeight = lineDiv.clientHeight; + if (offsetHeight == cachedHeightFor) return cachedHeight; + cachedHeightFor = offsetHeight; + measure.innerHTML = measureText; + cachedHeight = measure.firstChild.offsetHeight / 50 || 1; + measure.innerHTML = ""; + return cachedHeight; + } + var cachedWidth, cachedWidthFor = 0; + function charWidth() { + if (scroller.clientWidth == cachedWidthFor) return cachedWidth; + cachedWidthFor = scroller.clientWidth; + return (cachedWidth = stringWidth("x")); + } + function paddingTop() {return lineSpace.offsetTop;} + function paddingLeft() {return lineSpace.offsetLeft;} + + function posFromMouse(e, liberal) { + var offW = eltOffset(scroller, true), x, y; + // Fails unpredictably on IE[67] when mouse is dragged around quickly. + try { x = e.clientX; y = e.clientY; } catch (e) { return null; } + // This is a mess of a heuristic to try and determine whether a + // scroll-bar was clicked or not, and to return null if one was + // (and !liberal). + if (!liberal && (x - offW.left > scroller.clientWidth || y - offW.top > scroller.clientHeight)) + return null; + var offL = eltOffset(lineSpace, true); + return coordsChar(x - offL.left, y - offL.top); + } + function onContextMenu(e) { + var pos = posFromMouse(e), scrollPos = scroller.scrollTop; + if (!pos || window.opera) return; // Opera is difficult. + if (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to)) + operation(setCursor)(pos.line, pos.ch); + + var oldCSS = input.style.cssText; + inputDiv.style.position = "absolute"; + input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) + + "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: white; " + + "border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; + leaveInputAlone = true; + var val = input.value = getSelection(); + focusInput(); + selectInput(input); + function rehide() { + var newVal = splitLines(input.value).join("\n"); + if (newVal != val) operation(replaceSelection)(newVal, "end"); + inputDiv.style.position = "relative"; + input.style.cssText = oldCSS; + if (ie_lt9) scroller.scrollTop = scrollPos; + leaveInputAlone = false; + resetInput(true); + slowPoll(); + } + + if (gecko) { + e_stop(e); + var mouseup = connect(window, "mouseup", function() { + mouseup(); + setTimeout(rehide, 20); + }, true); + } else { + setTimeout(rehide, 50); + } + } + + // Cursor-blinking + function restartBlink() { + clearInterval(blinker); + var on = true; + cursor.style.visibility = ""; + blinker = setInterval(function() { + cursor.style.visibility = (on = !on) ? "" : "hidden"; + }, 650); + } + + var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"}; + function matchBrackets(autoclear) { + var head = sel.inverted ? sel.from : sel.to, line = getLine(head.line), pos = head.ch - 1; + var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)]; + if (!match) return; + var ch = match.charAt(0), forward = match.charAt(1) == ">", d = forward ? 1 : -1, st = line.styles; + for (var off = pos + 1, i = 0, e = st.length; i < e; i+=2) + if ((off -= st[i].length) <= 0) {var style = st[i+1]; break;} + + var stack = [line.text.charAt(pos)], re = /[(){}[\]]/; + function scan(line, from, to) { + if (!line.text) return; + var st = line.styles, pos = forward ? 0 : line.text.length - 1, cur; + for (var i = forward ? 0 : st.length - 2, e = forward ? st.length : -2; i != e; i += 2*d) { + var text = st[i]; + if (st[i+1] != null && st[i+1] != style) {pos += d * text.length; continue;} + for (var j = forward ? 0 : text.length - 1, te = forward ? text.length : -1; j != te; j += d, pos+=d) { + if (pos >= from && pos < to && re.test(cur = text.charAt(j))) { + var match = matching[cur]; + if (match.charAt(1) == ">" == forward) stack.push(cur); + else if (stack.pop() != match.charAt(0)) return {pos: pos, match: false}; + else if (!stack.length) return {pos: pos, match: true}; + } + } + } + } + for (var i = head.line, e = forward ? Math.min(i + 100, doc.size) : Math.max(-1, i - 100); i != e; i+=d) { + var line = getLine(i), first = i == head.line; + var found = scan(line, first && forward ? pos + 1 : 0, first && !forward ? pos : line.text.length); + if (found) break; + } + if (!found) found = {pos: null, match: false}; + var style = found.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; + var one = markText({line: head.line, ch: pos}, {line: head.line, ch: pos+1}, style), + two = found.pos != null && markText({line: i, ch: found.pos}, {line: i, ch: found.pos + 1}, style); + var clear = operation(function(){one.clear(); two && two.clear();}); + if (autoclear) setTimeout(clear, 800); + else bracketHighlighted = clear; + } + + // Finds the line to start with when starting a parse. Tries to + // find a line with a stateAfter, so that it can start with a + // valid state. If that fails, it returns the line with the + // smallest indentation, which tends to need the least context to + // parse correctly. + function findStartLine(n) { + var minindent, minline; + for (var search = n, lim = n - 40; search > lim; --search) { + if (search == 0) return 0; + var line = getLine(search-1); + if (line.stateAfter) return search; + var indented = line.indentation(options.tabSize); + if (minline == null || minindent > indented) { + minline = search - 1; + minindent = indented; + } + } + return minline; + } + function getStateBefore(n) { + var start = findStartLine(n), state = start && getLine(start-1).stateAfter; + if (!state) state = startState(mode); + else state = copyState(mode, state); + doc.iter(start, n, function(line) { + line.highlight(mode, state, options.tabSize); + line.stateAfter = copyState(mode, state); + }); + if (start < n) changes.push({from: start, to: n}); + if (n < doc.size && !getLine(n).stateAfter) work.push(n); + return state; + } + function highlightLines(start, end) { + var state = getStateBefore(start); + doc.iter(start, end, function(line) { + line.highlight(mode, state, options.tabSize); + line.stateAfter = copyState(mode, state); + }); + } + function highlightWorker() { + var end = +new Date + options.workTime; + var foundWork = work.length; + while (work.length) { + if (!getLine(showingFrom).stateAfter) var task = showingFrom; + else var task = work.pop(); + if (task >= doc.size) continue; + var start = findStartLine(task), state = start && getLine(start-1).stateAfter; + if (state) state = copyState(mode, state); + else state = startState(mode); + + var unchanged = 0, compare = mode.compareStates, realChange = false, + i = start, bail = false; + doc.iter(i, doc.size, function(line) { + var hadState = line.stateAfter; + if (+new Date > end) { + work.push(i); + startWorker(options.workDelay); + if (realChange) changes.push({from: task, to: i + 1}); + return (bail = true); + } + var changed = line.highlight(mode, state, options.tabSize); + if (changed) realChange = true; + line.stateAfter = copyState(mode, state); + if (compare) { + if (hadState && compare(hadState, state)) return true; + } else { + if (changed !== false || !hadState) unchanged = 0; + else if (++unchanged > 3 && (!mode.indent || mode.indent(hadState, "") == mode.indent(state, ""))) + return true; + } + ++i; + }); + if (bail) return; + if (realChange) changes.push({from: task, to: i + 1}); + } + if (foundWork && options.onHighlightComplete) + options.onHighlightComplete(instance); + } + function startWorker(time) { + if (!work.length) return; + highlight.set(time, operation(highlightWorker)); + } + + // Operations are used to wrap changes in such a way that each + // change won't have to update the cursor and display (which would + // be awkward, slow, and error-prone), but instead updates are + // batched and then all combined and executed at once. + function startOperation() { + updateInput = userSelChange = textChanged = null; + changes = []; selectionChanged = false; callbacks = []; + } + function endOperation() { + var reScroll = false, updated; + if (selectionChanged) reScroll = !scrollCursorIntoView(); + if (changes.length) updated = updateDisplay(changes, true); + else { + if (selectionChanged) updateSelection(); + if (gutterDirty) updateGutter(); + } + if (reScroll) scrollCursorIntoView(); + if (selectionChanged) {scrollEditorIntoView(); restartBlink();} + + if (focused && !leaveInputAlone && + (updateInput === true || (updateInput !== false && selectionChanged))) + resetInput(userSelChange); + + if (selectionChanged && options.matchBrackets) + setTimeout(operation(function() { + if (bracketHighlighted) {bracketHighlighted(); bracketHighlighted = null;} + if (posEq(sel.from, sel.to)) matchBrackets(false); + }), 20); + var tc = textChanged, cbs = callbacks; // these can be reset by callbacks + if (selectionChanged && options.onCursorActivity) + options.onCursorActivity(instance); + if (tc && options.onChange && instance) + options.onChange(instance, tc); + for (var i = 0; i < cbs.length; ++i) cbs[i](instance); + if (updated && options.onUpdate) options.onUpdate(instance); + } + var nestedOperation = 0; + function operation(f) { + return function() { + if (!nestedOperation++) startOperation(); + try {var result = f.apply(this, arguments);} + finally {if (!--nestedOperation) endOperation();} + return result; + }; + } + + for (var ext in extensions) + if (extensions.propertyIsEnumerable(ext) && + !instance.propertyIsEnumerable(ext)) + instance[ext] = extensions[ext]; + return instance; + } // (end of function CodeMirror) + + // The default configuration options. + CodeMirror.defaults = { + value: "", + mode: null, + theme: "default", + indentUnit: 2, + indentWithTabs: false, + smartIndent: true, + tabSize: 4, + keyMap: "default", + extraKeys: null, + electricChars: true, + autoClearEmptyLines: false, + onKeyEvent: null, + lineWrapping: false, + lineNumbers: false, + gutter: false, + fixedGutter: false, + firstLineNumber: 1, + readOnly: false, + onChange: null, + onCursorActivity: null, + onGutterClick: null, + onHighlightComplete: null, + onUpdate: null, + onFocus: null, onBlur: null, onScroll: null, + matchBrackets: false, + workTime: 100, + workDelay: 200, + pollInterval: 100, + undoDepth: 40, + tabindex: null, + autofocus: null + }; + + var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent); + var mac = ios || /Mac/.test(navigator.platform); + var win = /Win/.test(navigator.platform); + + // Known modes, by name and by MIME + var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {}; + CodeMirror.defineMode = function(name, mode) { + if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name; + modes[name] = mode; + }; + CodeMirror.defineMIME = function(mime, spec) { + mimeModes[mime] = spec; + }; + CodeMirror.resolveMode = function(spec) { + if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) + spec = mimeModes[spec]; + else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) + return CodeMirror.resolveMode("application/xml"); + if (typeof spec == "string") return {name: spec}; + else return spec || {name: "null"}; + }; + CodeMirror.getMode = function(options, spec) { + var spec = CodeMirror.resolveMode(spec); + var mfactory = modes[spec.name]; + if (!mfactory) { + if (window.console) console.warn("No mode " + spec.name + " found, falling back to plain text."); + return CodeMirror.getMode(options, "text/plain"); + } + return mfactory(options, spec); + }; + CodeMirror.listModes = function() { + var list = []; + for (var m in modes) + if (modes.propertyIsEnumerable(m)) list.push(m); + return list; + }; + CodeMirror.listMIMEs = function() { + var list = []; + for (var m in mimeModes) + if (mimeModes.propertyIsEnumerable(m)) list.push({mime: m, mode: mimeModes[m]}); + return list; + }; + + var extensions = CodeMirror.extensions = {}; + CodeMirror.defineExtension = function(name, func) { + extensions[name] = func; + }; + + var commands = CodeMirror.commands = { + selectAll: function(cm) {cm.setSelection({line: 0, ch: 0}, {line: cm.lineCount() - 1});}, + killLine: function(cm) { + var from = cm.getCursor(true), to = cm.getCursor(false), sel = !posEq(from, to); + if (!sel && cm.getLine(from.line).length == from.ch) cm.replaceRange("", from, {line: from.line + 1, ch: 0}); + else cm.replaceRange("", from, sel ? to : {line: from.line}); + }, + deleteLine: function(cm) {var l = cm.getCursor().line; cm.replaceRange("", {line: l, ch: 0}, {line: l});}, + undo: function(cm) {cm.undo();}, + redo: function(cm) {cm.redo();}, + goDocStart: function(cm) {cm.setCursor(0, 0, true);}, + goDocEnd: function(cm) {cm.setSelection({line: cm.lineCount() - 1}, null, true);}, + goLineStart: function(cm) {cm.setCursor(cm.getCursor().line, 0, true);}, + goLineStartSmart: function(cm) { + var cur = cm.getCursor(); + var text = cm.getLine(cur.line), firstNonWS = Math.max(0, text.search(/\S/)); + cm.setCursor(cur.line, cur.ch <= firstNonWS && cur.ch ? 0 : firstNonWS, true); + }, + goLineEnd: function(cm) {cm.setSelection({line: cm.getCursor().line}, null, true);}, + goLineUp: function(cm) {cm.moveV(-1, "line");}, + goLineDown: function(cm) {cm.moveV(1, "line");}, + goPageUp: function(cm) {cm.moveV(-1, "page");}, + goPageDown: function(cm) {cm.moveV(1, "page");}, + goCharLeft: function(cm) {cm.moveH(-1, "char");}, + goCharRight: function(cm) {cm.moveH(1, "char");}, + goColumnLeft: function(cm) {cm.moveH(-1, "column");}, + goColumnRight: function(cm) {cm.moveH(1, "column");}, + goWordLeft: function(cm) {cm.moveH(-1, "word");}, + goWordRight: function(cm) {cm.moveH(1, "word");}, + delCharLeft: function(cm) {cm.deleteH(-1, "char");}, + delCharRight: function(cm) {cm.deleteH(1, "char");}, + delWordLeft: function(cm) {cm.deleteH(-1, "word");}, + delWordRight: function(cm) {cm.deleteH(1, "word");}, + indentAuto: function(cm) {cm.indentSelection("smart");}, + indentMore: function(cm) {cm.indentSelection("add");}, + indentLess: function(cm) {cm.indentSelection("subtract");}, + insertTab: function(cm) {cm.replaceSelection("\t", "end");}, + transposeChars: function(cm) { + var cur = cm.getCursor(), line = cm.getLine(cur.line); + if (cur.ch > 0 && cur.ch < line.length - 1) + cm.replaceRange(line.charAt(cur.ch) + line.charAt(cur.ch - 1), + {line: cur.line, ch: cur.ch - 1}, {line: cur.line, ch: cur.ch + 1}); + }, + newlineAndIndent: function(cm) { + cm.replaceSelection("\n", "end"); + cm.indentLine(cm.getCursor().line); + }, + toggleOverwrite: function(cm) {cm.toggleOverwrite();} + }; + + var keyMap = CodeMirror.keyMap = {}; + keyMap.basic = { + "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", + "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", + "Delete": "delCharRight", "Backspace": "delCharLeft", "Tab": "insertTab", "Shift-Tab": "indentAuto", + "Enter": "newlineAndIndent", "Insert": "toggleOverwrite" + }; + // Note that the save and find-related commands aren't defined by + // default. Unknown commands are simply ignored. + keyMap.pcDefault = { + "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", + "Ctrl-Home": "goDocStart", "Alt-Up": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Down": "goDocEnd", + "Ctrl-Left": "goWordLeft", "Ctrl-Right": "goWordRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", + "Ctrl-Backspace": "delWordLeft", "Ctrl-Delete": "delWordRight", "Ctrl-S": "save", "Ctrl-F": "find", + "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", + "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", + fallthrough: "basic" + }; + keyMap.macDefault = { + "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", + "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goWordLeft", + "Alt-Right": "goWordRight", "Cmd-Left": "goLineStart", "Cmd-Right": "goLineEnd", "Alt-Backspace": "delWordLeft", + "Ctrl-Alt-Backspace": "delWordRight", "Alt-Delete": "delWordRight", "Cmd-S": "save", "Cmd-F": "find", + "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", + "Cmd-[": "indentLess", "Cmd-]": "indentMore", + fallthrough: ["basic", "emacsy"] + }; + keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; + keyMap.emacsy = { + "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", + "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", + "Ctrl-V": "goPageUp", "Shift-Ctrl-V": "goPageDown", "Ctrl-D": "delCharRight", "Ctrl-H": "delCharLeft", + "Alt-D": "delWordRight", "Alt-Backspace": "delWordLeft", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars" + }; + + function getKeyMap(val) { + if (typeof val == "string") return keyMap[val]; + else return val; + } + function lookupKey(name, extraMap, map, handle) { + function lookup(map) { + map = getKeyMap(map); + var found = map[name]; + if (found != null && handle(found)) return true; + if (map.catchall) return handle(map.catchall); + var fallthrough = map.fallthrough; + if (fallthrough == null) return false; + if (Object.prototype.toString.call(fallthrough) != "[object Array]") + return lookup(fallthrough); + for (var i = 0, e = fallthrough.length; i < e; ++i) { + if (lookup(fallthrough[i])) return true; + } + return false; + } + if (extraMap && lookup(extraMap)) return true; + return lookup(map); + } + function isModifierKey(event) { + var name = keyNames[e_prop(event, "keyCode")]; + return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"; + } + + CodeMirror.fromTextArea = function(textarea, options) { + if (!options) options = {}; + options.value = textarea.value; + if (!options.tabindex && textarea.tabindex) + options.tabindex = textarea.tabindex; + if (options.autofocus == null && textarea.getAttribute("autofocus") != null) + options.autofocus = true; + + function save() {textarea.value = instance.getValue();} + if (textarea.form) { + // Deplorable hack to make the submit method do the right thing. + var rmSubmit = connect(textarea.form, "submit", save, true); + if (typeof textarea.form.submit == "function") { + var realSubmit = textarea.form.submit; + function wrappedSubmit() { + save(); + textarea.form.submit = realSubmit; + textarea.form.submit(); + textarea.form.submit = wrappedSubmit; + } + textarea.form.submit = wrappedSubmit; + } + } + + textarea.style.display = "none"; + var instance = CodeMirror(function(node) { + textarea.parentNode.insertBefore(node, textarea.nextSibling); + }, options); + instance.save = save; + instance.getTextArea = function() { return textarea; }; + instance.toTextArea = function() { + save(); + textarea.parentNode.removeChild(instance.getWrapperElement()); + textarea.style.display = ""; + if (textarea.form) { + rmSubmit(); + if (typeof textarea.form.submit == "function") + textarea.form.submit = realSubmit; + } + }; + return instance; + }; + + // Utility functions for working with state. Exported because modes + // sometimes need to do this. + function copyState(mode, state) { + if (state === true) return state; + if (mode.copyState) return mode.copyState(state); + var nstate = {}; + for (var n in state) { + var val = state[n]; + if (val instanceof Array) val = val.concat([]); + nstate[n] = val; + } + return nstate; + } + CodeMirror.copyState = copyState; + function startState(mode, a1, a2) { + return mode.startState ? mode.startState(a1, a2) : true; + } + CodeMirror.startState = startState; + + // The character stream used by a mode's parser. + function StringStream(string, tabSize) { + this.pos = this.start = 0; + this.string = string; + this.tabSize = tabSize || 8; + } + StringStream.prototype = { + eol: function() {return this.pos >= this.string.length;}, + sol: function() {return this.pos == 0;}, + peek: function() {return this.string.charAt(this.pos);}, + next: function() { + if (this.pos < this.string.length) + return this.string.charAt(this.pos++); + }, + eat: function(match) { + var ch = this.string.charAt(this.pos); + if (typeof match == "string") var ok = ch == match; + else var ok = ch && (match.test ? match.test(ch) : match(ch)); + if (ok) {++this.pos; return ch;} + }, + eatWhile: function(match) { + var start = this.pos; + while (this.eat(match)){} + return this.pos > start; + }, + eatSpace: function() { + var start = this.pos; + while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; + return this.pos > start; + }, + skipToEnd: function() {this.pos = this.string.length;}, + skipTo: function(ch) { + var found = this.string.indexOf(ch, this.pos); + if (found > -1) {this.pos = found; return true;} + }, + backUp: function(n) {this.pos -= n;}, + column: function() {return countColumn(this.string, this.start, this.tabSize);}, + indentation: function() {return countColumn(this.string, null, this.tabSize);}, + match: function(pattern, consume, caseInsensitive) { + if (typeof pattern == "string") { + function cased(str) {return caseInsensitive ? str.toLowerCase() : str;} + if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) { + if (consume !== false) this.pos += pattern.length; + return true; + } + } + else { + var match = this.string.slice(this.pos).match(pattern); + if (match && consume !== false) this.pos += match[0].length; + return match; + } + }, + current: function(){return this.string.slice(this.start, this.pos);} + }; + CodeMirror.StringStream = StringStream; + + function MarkedText(from, to, className, marker) { + this.from = from; this.to = to; this.style = className; this.marker = marker; + } + MarkedText.prototype = { + attach: function(line) { this.marker.set.push(line); }, + detach: function(line) { + var ix = indexOf(this.marker.set, line); + if (ix > -1) this.marker.set.splice(ix, 1); + }, + split: function(pos, lenBefore) { + if (this.to <= pos && this.to != null) return null; + var from = this.from < pos || this.from == null ? null : this.from - pos + lenBefore; + var to = this.to == null ? null : this.to - pos + lenBefore; + return new MarkedText(from, to, this.style, this.marker); + }, + dup: function() { return new MarkedText(null, null, this.style, this.marker); }, + clipTo: function(fromOpen, from, toOpen, to, diff) { + if (fromOpen && to > this.from && (to < this.to || this.to == null)) + this.from = null; + else if (this.from != null && this.from >= from) + this.from = Math.max(to, this.from) + diff; + if (toOpen && (from < this.to || this.to == null) && (from > this.from || this.from == null)) + this.to = null; + else if (this.to != null && this.to > from) + this.to = to < this.to ? this.to + diff : from; + }, + isDead: function() { return this.from != null && this.to != null && this.from >= this.to; }, + sameSet: function(x) { return this.marker == x.marker; } + }; + + function Bookmark(pos) { + this.from = pos; this.to = pos; this.line = null; + } + Bookmark.prototype = { + attach: function(line) { this.line = line; }, + detach: function(line) { if (this.line == line) this.line = null; }, + split: function(pos, lenBefore) { + if (pos < this.from) { + this.from = this.to = (this.from - pos) + lenBefore; + return this; + } + }, + isDead: function() { return this.from > this.to; }, + clipTo: function(fromOpen, from, toOpen, to, diff) { + if ((fromOpen || from < this.from) && (toOpen || to > this.to)) { + this.from = 0; this.to = -1; + } else if (this.from > from) { + this.from = this.to = Math.max(to, this.from) + diff; + } + }, + sameSet: function(x) { return false; }, + find: function() { + if (!this.line || !this.line.parent) return null; + return {line: lineNo(this.line), ch: this.from}; + }, + clear: function() { + if (this.line) { + var found = indexOf(this.line.marked, this); + if (found != -1) this.line.marked.splice(found, 1); + this.line = null; + } + } + }; + + // Line objects. These hold state related to a line, including + // highlighting info (the styles array). + function Line(text, styles) { + this.styles = styles || [text, null]; + this.text = text; + this.height = 1; + this.marked = this.gutterMarker = this.className = this.bgClassName = this.handlers = null; + this.stateAfter = this.parent = this.hidden = null; + } + Line.inheritMarks = function(text, orig) { + var ln = new Line(text), mk = orig && orig.marked; + if (mk) { + for (var i = 0; i < mk.length; ++i) { + if (mk[i].to == null && mk[i].style) { + var newmk = ln.marked || (ln.marked = []), mark = mk[i]; + var nmark = mark.dup(); newmk.push(nmark); nmark.attach(ln); + } + } + } + return ln; + } + Line.prototype = { + // Replace a piece of a line, keeping the styles around it intact. + replace: function(from, to_, text) { + var st = [], mk = this.marked, to = to_ == null ? this.text.length : to_; + copyStyles(0, from, this.styles, st); + if (text) st.push(text, null); + copyStyles(to, this.text.length, this.styles, st); + this.styles = st; + this.text = this.text.slice(0, from) + text + this.text.slice(to); + this.stateAfter = null; + if (mk) { + var diff = text.length - (to - from); + for (var i = 0; i < mk.length; ++i) { + var mark = mk[i]; + mark.clipTo(from == null, from || 0, to_ == null, to, diff); + if (mark.isDead()) {mark.detach(this); mk.splice(i--, 1);} + } + } + }, + // Split a part off a line, keeping styles and markers intact. + split: function(pos, textBefore) { + var st = [textBefore, null], mk = this.marked; + copyStyles(pos, this.text.length, this.styles, st); + var taken = new Line(textBefore + this.text.slice(pos), st); + if (mk) { + for (var i = 0; i < mk.length; ++i) { + var mark = mk[i]; + var newmark = mark.split(pos, textBefore.length); + if (newmark) { + if (!taken.marked) taken.marked = []; + taken.marked.push(newmark); newmark.attach(taken); + if (newmark == mark) mk.splice(i--, 1); + } + } + } + return taken; + }, + append: function(line) { + var mylen = this.text.length, mk = line.marked, mymk = this.marked; + this.text += line.text; + copyStyles(0, line.text.length, line.styles, this.styles); + if (mymk) { + for (var i = 0; i < mymk.length; ++i) + if (mymk[i].to == null) mymk[i].to = mylen; + } + if (mk && mk.length) { + if (!mymk) this.marked = mymk = []; + outer: for (var i = 0; i < mk.length; ++i) { + var mark = mk[i]; + if (!mark.from) { + for (var j = 0; j < mymk.length; ++j) { + var mymark = mymk[j]; + if (mymark.to == mylen && mymark.sameSet(mark)) { + mymark.to = mark.to == null ? null : mark.to + mylen; + if (mymark.isDead()) { + mymark.detach(this); + mk.splice(i--, 1); + } + continue outer; + } + } + } + mymk.push(mark); + mark.attach(this); + mark.from += mylen; + if (mark.to != null) mark.to += mylen; + } + } + }, + fixMarkEnds: function(other) { + var mk = this.marked, omk = other.marked; + if (!mk) return; + for (var i = 0; i < mk.length; ++i) { + var mark = mk[i], close = mark.to == null; + if (close && omk) { + for (var j = 0; j < omk.length; ++j) + if (omk[j].sameSet(mark)) {close = false; break;} + } + if (close) mark.to = this.text.length; + } + }, + fixMarkStarts: function() { + var mk = this.marked; + if (!mk) return; + for (var i = 0; i < mk.length; ++i) + if (mk[i].from == null) mk[i].from = 0; + }, + addMark: function(mark) { + mark.attach(this); + if (this.marked == null) this.marked = []; + this.marked.push(mark); + this.marked.sort(function(a, b){return (a.from || 0) - (b.from || 0);}); + }, + // Run the given mode's parser over a line, update the styles + // array, which contains alternating fragments of text and CSS + // classes. + highlight: function(mode, state, tabSize) { + var stream = new StringStream(this.text, tabSize), st = this.styles, pos = 0; + var changed = false, curWord = st[0], prevWord; + if (this.text == "" && mode.blankLine) mode.blankLine(state); + while (!stream.eol()) { + var style = mode.token(stream, state); + var substr = this.text.slice(stream.start, stream.pos); + stream.start = stream.pos; + if (pos && st[pos-1] == style) + st[pos-2] += substr; + else if (substr) { + if (!changed && (st[pos+1] != style || (pos && st[pos-2] != prevWord))) changed = true; + st[pos++] = substr; st[pos++] = style; + prevWord = curWord; curWord = st[pos]; + } + // Give up when line is ridiculously long + if (stream.pos > 5000) { + st[pos++] = this.text.slice(stream.pos); st[pos++] = null; + break; + } + } + if (st.length != pos) {st.length = pos; changed = true;} + if (pos && st[pos-2] != prevWord) changed = true; + // Short lines with simple highlights return null, and are + // counted as changed by the driver because they are likely to + // highlight the same way in various contexts. + return changed || (st.length < 5 && this.text.length < 10 ? null : false); + }, + // Fetch the parser token for a given character. Useful for hacks + // that want to inspect the mode state (say, for completion). + getTokenAt: function(mode, state, ch) { + var txt = this.text, stream = new StringStream(txt); + while (stream.pos < ch && !stream.eol()) { + stream.start = stream.pos; + var style = mode.token(stream, state); + } + return {start: stream.start, + end: stream.pos, + string: stream.current(), + className: style || null, + state: state}; + }, + indentation: function(tabSize) {return countColumn(this.text, null, tabSize);}, + // Produces an HTML fragment for the line, taking selection, + // marking, and highlighting into account. + getHTML: function(makeTab, endAt) { + var html = [], first = true, col = 0; + function span(text, style) { + if (!text) return; + // Work around a bug where, in some compat modes, IE ignores leading spaces + if (first && ie && text.charAt(0) == " ") text = "\u00a0" + text.slice(1); + first = false; + if (text.indexOf("\t") == -1) { + col += text.length; + var escaped = htmlEscape(text); + } else { + var escaped = ""; + for (var pos = 0;;) { + var idx = text.indexOf("\t", pos); + if (idx == -1) { + escaped += htmlEscape(text.slice(pos)); + col += text.length - pos; + break; + } else { + col += idx - pos; + var tab = makeTab(col); + escaped += htmlEscape(text.slice(pos, idx)) + tab.html; + col += tab.width; + pos = idx + 1; + } + } + } + if (style) html.push('', escaped, ""); + else html.push(escaped); + } + var st = this.styles, allText = this.text, marked = this.marked; + var len = allText.length; + if (endAt != null) len = Math.min(endAt, len); + function styleToClass(style) { + if (!style) return null; + return "cm-" + style.replace(/ +/g, " cm-"); + } + + if (!allText && endAt == null) + span(" "); + else if (!marked || !marked.length) + for (var i = 0, ch = 0; ch < len; i+=2) { + var str = st[i], style = st[i+1], l = str.length; + if (ch + l > len) str = str.slice(0, len - ch); + ch += l; + span(str, styleToClass(style)); + } + else { + var pos = 0, i = 0, text = "", style, sg = 0; + var nextChange = marked[0].from || 0, marks = [], markpos = 0; + function advanceMarks() { + var m; + while (markpos < marked.length && + ((m = marked[markpos]).from == pos || m.from == null)) { + if (m.style != null) marks.push(m); + ++markpos; + } + nextChange = markpos < marked.length ? marked[markpos].from : Infinity; + for (var i = 0; i < marks.length; ++i) { + var to = marks[i].to || Infinity; + if (to == pos) marks.splice(i--, 1); + else nextChange = Math.min(to, nextChange); + } + } + var m = 0; + while (pos < len) { + if (nextChange == pos) advanceMarks(); + var upto = Math.min(len, nextChange); + while (true) { + if (text) { + var end = pos + text.length; + var appliedStyle = style; + for (var j = 0; j < marks.length; ++j) + appliedStyle = (appliedStyle ? appliedStyle + " " : "") + marks[j].style; + span(end > upto ? text.slice(0, upto - pos) : text, appliedStyle); + if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;} + pos = end; + } + text = st[i++]; style = styleToClass(st[i++]); + } + } + } + return html.join(""); + }, + cleanUp: function() { + this.parent = null; + if (this.marked) + for (var i = 0, e = this.marked.length; i < e; ++i) this.marked[i].detach(this); + } + }; + // Utility used by replace and split above + function copyStyles(from, to, source, dest) { + for (var i = 0, pos = 0, state = 0; pos < to; i+=2) { + var part = source[i], end = pos + part.length; + if (state == 0) { + if (end > from) dest.push(part.slice(from - pos, Math.min(part.length, to - pos)), source[i+1]); + if (end >= from) state = 1; + } + else if (state == 1) { + if (end > to) dest.push(part.slice(0, to - pos), source[i+1]); + else dest.push(part, source[i+1]); + } + pos = end; + } + } + + // Data structure that holds the sequence of lines. + function LeafChunk(lines) { + this.lines = lines; + this.parent = null; + for (var i = 0, e = lines.length, height = 0; i < e; ++i) { + lines[i].parent = this; + height += lines[i].height; + } + this.height = height; + } + LeafChunk.prototype = { + chunkSize: function() { return this.lines.length; }, + remove: function(at, n, callbacks) { + for (var i = at, e = at + n; i < e; ++i) { + var line = this.lines[i]; + this.height -= line.height; + line.cleanUp(); + if (line.handlers) + for (var j = 0; j < line.handlers.length; ++j) callbacks.push(line.handlers[j]); + } + this.lines.splice(at, n); + }, + collapse: function(lines) { + lines.splice.apply(lines, [lines.length, 0].concat(this.lines)); + }, + insertHeight: function(at, lines, height) { + this.height += height; + this.lines.splice.apply(this.lines, [at, 0].concat(lines)); + for (var i = 0, e = lines.length; i < e; ++i) lines[i].parent = this; + }, + iterN: function(at, n, op) { + for (var e = at + n; at < e; ++at) + if (op(this.lines[at])) return true; + } + }; + function BranchChunk(children) { + this.children = children; + var size = 0, height = 0; + for (var i = 0, e = children.length; i < e; ++i) { + var ch = children[i]; + size += ch.chunkSize(); height += ch.height; + ch.parent = this; + } + this.size = size; + this.height = height; + this.parent = null; + } + BranchChunk.prototype = { + chunkSize: function() { return this.size; }, + remove: function(at, n, callbacks) { + this.size -= n; + for (var i = 0; i < this.children.length; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at < sz) { + var rm = Math.min(n, sz - at), oldHeight = child.height; + child.remove(at, rm, callbacks); + this.height -= oldHeight - child.height; + if (sz == rm) { this.children.splice(i--, 1); child.parent = null; } + if ((n -= rm) == 0) break; + at = 0; + } else at -= sz; + } + if (this.size - n < 25) { + var lines = []; + this.collapse(lines); + this.children = [new LeafChunk(lines)]; + this.children[0].parent = this; + } + }, + collapse: function(lines) { + for (var i = 0, e = this.children.length; i < e; ++i) this.children[i].collapse(lines); + }, + insert: function(at, lines) { + var height = 0; + for (var i = 0, e = lines.length; i < e; ++i) height += lines[i].height; + this.insertHeight(at, lines, height); + }, + insertHeight: function(at, lines, height) { + this.size += lines.length; + this.height += height; + for (var i = 0, e = this.children.length; i < e; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at <= sz) { + child.insertHeight(at, lines, height); + if (child.lines && child.lines.length > 50) { + while (child.lines.length > 50) { + var spilled = child.lines.splice(child.lines.length - 25, 25); + var newleaf = new LeafChunk(spilled); + child.height -= newleaf.height; + this.children.splice(i + 1, 0, newleaf); + newleaf.parent = this; + } + this.maybeSpill(); + } + break; + } + at -= sz; + } + }, + maybeSpill: function() { + if (this.children.length <= 10) return; + var me = this; + do { + var spilled = me.children.splice(me.children.length - 5, 5); + var sibling = new BranchChunk(spilled); + if (!me.parent) { // Become the parent node + var copy = new BranchChunk(me.children); + copy.parent = me; + me.children = [copy, sibling]; + me = copy; + } else { + me.size -= sibling.size; + me.height -= sibling.height; + var myIndex = indexOf(me.parent.children, me); + me.parent.children.splice(myIndex + 1, 0, sibling); + } + sibling.parent = me.parent; + } while (me.children.length > 10); + me.parent.maybeSpill(); + }, + iter: function(from, to, op) { this.iterN(from, to - from, op); }, + iterN: function(at, n, op) { + for (var i = 0, e = this.children.length; i < e; ++i) { + var child = this.children[i], sz = child.chunkSize(); + if (at < sz) { + var used = Math.min(n, sz - at); + if (child.iterN(at, used, op)) return true; + if ((n -= used) == 0) break; + at = 0; + } else at -= sz; + } + } + }; + + function getLineAt(chunk, n) { + while (!chunk.lines) { + for (var i = 0;; ++i) { + var child = chunk.children[i], sz = child.chunkSize(); + if (n < sz) { chunk = child; break; } + n -= sz; + } + } + return chunk.lines[n]; + } + function lineNo(line) { + if (line.parent == null) return null; + var cur = line.parent, no = indexOf(cur.lines, line); + for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { + for (var i = 0, e = chunk.children.length; ; ++i) { + if (chunk.children[i] == cur) break; + no += chunk.children[i].chunkSize(); + } + } + return no; + } + function lineAtHeight(chunk, h) { + var n = 0; + outer: do { + for (var i = 0, e = chunk.children.length; i < e; ++i) { + var child = chunk.children[i], ch = child.height; + if (h < ch) { chunk = child; continue outer; } + h -= ch; + n += child.chunkSize(); + } + return n; + } while (!chunk.lines); + for (var i = 0, e = chunk.lines.length; i < e; ++i) { + var line = chunk.lines[i], lh = line.height; + if (h < lh) break; + h -= lh; + } + return n + i; + } + function heightAtLine(chunk, n) { + var h = 0; + outer: do { + for (var i = 0, e = chunk.children.length; i < e; ++i) { + var child = chunk.children[i], sz = child.chunkSize(); + if (n < sz) { chunk = child; continue outer; } + n -= sz; + h += child.height; + } + return h; + } while (!chunk.lines); + for (var i = 0; i < n; ++i) h += chunk.lines[i].height; + return h; + } + + // The history object 'chunks' changes that are made close together + // and at almost the same time into bigger undoable units. + function History() { + this.time = 0; + this.done = []; this.undone = []; + } + History.prototype = { + addChange: function(start, added, old) { + this.undone.length = 0; + var time = +new Date, cur = this.done[this.done.length - 1], last = cur && cur[cur.length - 1]; + var dtime = time - this.time; + if (dtime > 400 || !last) { + this.done.push([{start: start, added: added, old: old}]); + } else if (last.start > start + old.length || last.start + last.added < start - last.added + last.old.length) { + cur.push({start: start, added: added, old: old}); + } else { + var oldoff = 0; + if (start < last.start) { + for (var i = last.start - start - 1; i >= 0; --i) + last.old.unshift(old[i]); + oldoff = Math.min(0, added - old.length); + last.added += last.start - start + oldoff; + last.start = start; + } else if (last.start < start) { + oldoff = start - last.start; + added += oldoff; + } + for (var i = last.added - oldoff, e = old.length; i < e; ++i) + last.old.push(old[i]); + if (last.added < added) last.added = added; + } + this.time = time; + } + }; + + function stopMethod() {e_stop(this);} + // Ensure an event has a stop method. + function addStop(event) { + if (!event.stop) event.stop = stopMethod; + return event; + } + + function e_preventDefault(e) { + if (e.preventDefault) e.preventDefault(); + else e.returnValue = false; + } + function e_stopPropagation(e) { + if (e.stopPropagation) e.stopPropagation(); + else e.cancelBubble = true; + } + function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);} + CodeMirror.e_stop = e_stop; + CodeMirror.e_preventDefault = e_preventDefault; + CodeMirror.e_stopPropagation = e_stopPropagation; + + function e_target(e) {return e.target || e.srcElement;} + function e_button(e) { + if (e.which) return e.which; + else if (e.button & 1) return 1; + else if (e.button & 2) return 3; + else if (e.button & 4) return 2; + } + + // Allow 3rd-party code to override event properties by adding an override + // object to an event object. + function e_prop(e, prop) { + var overridden = e.override && e.override.hasOwnProperty(prop); + return overridden ? e.override[prop] : e[prop]; + } + + // Event handler registration. If disconnect is true, it'll return a + // function that unregisters the handler. + function connect(node, type, handler, disconnect) { + if (typeof node.addEventListener == "function") { + node.addEventListener(type, handler, false); + if (disconnect) return function() {node.removeEventListener(type, handler, false);}; + } + else { + var wrapHandler = function(event) {handler(event || window.event);}; + node.attachEvent("on" + type, wrapHandler); + if (disconnect) return function() {node.detachEvent("on" + type, wrapHandler);}; + } + } + CodeMirror.connect = connect; + + function Delayed() {this.id = null;} + Delayed.prototype = {set: function(ms, f) {clearTimeout(this.id); this.id = setTimeout(f, ms);}}; + + var Pass = CodeMirror.Pass = {toString: function(){return "CodeMirror.Pass";}}; + + var gecko = /gecko\/\d{7}/i.test(navigator.userAgent); + var ie = /MSIE \d/.test(navigator.userAgent); + var ie_lt9 = /MSIE [1-8]\b/.test(navigator.userAgent); + var webkit = /WebKit\//.test(navigator.userAgent); + var chrome = /Chrome\//.test(navigator.userAgent); + var khtml = /KHTML\//.test(navigator.userAgent); + + // Detect drag-and-drop + var dragAndDrop = function() { + // There is *some* kind of drag-and-drop support in IE6-8, but I + // couldn't get it to work yet. + if (ie_lt9) return false; + var div = document.createElement('div'); + return "draggable" in div || "dragDrop" in div; + }(); + + var lineSep = "\n"; + // Feature-detect whether newlines in textareas are converted to \r\n + (function () { + var te = document.createElement("textarea"); + te.value = "foo\nbar"; + if (te.value.indexOf("\r") > -1) lineSep = "\r\n"; + }()); + + // Counts the column offset in a string, taking tabs into account. + // Used mostly to find indentation. + function countColumn(string, end, tabSize) { + if (end == null) { + end = string.search(/[^\s\u00a0]/); + if (end == -1) end = string.length; + } + for (var i = 0, n = 0; i < end; ++i) { + if (string.charAt(i) == "\t") n += tabSize - (n % tabSize); + else ++n; + } + return n; + } + + function computedStyle(elt) { + if (elt.currentStyle) return elt.currentStyle; + return window.getComputedStyle(elt, null); + } + + // Find the position of an element by following the offsetParent chain. + // If screen==true, it returns screen (rather than page) coordinates. + function eltOffset(node, screen) { + var bod = node.ownerDocument.body; + var x = 0, y = 0, skipBody = false; + for (var n = node; n; n = n.offsetParent) { + var ol = n.offsetLeft, ot = n.offsetTop; + // Firefox reports weird inverted offsets when the body has a border. + if (n == bod) { x += Math.abs(ol); y += Math.abs(ot); } + else { x += ol, y += ot; } + if (screen && computedStyle(n).position == "fixed") + skipBody = true; + } + var e = screen && !skipBody ? null : bod; + for (var n = node.parentNode; n != e; n = n.parentNode) + if (n.scrollLeft != null) { x -= n.scrollLeft; y -= n.scrollTop;} + return {left: x, top: y}; + } + // Use the faster and saner getBoundingClientRect method when possible. + if (document.documentElement.getBoundingClientRect != null) eltOffset = function(node, screen) { + // Take the parts of bounding client rect that we are interested in so we are able to edit if need be, + // since the returned value cannot be changed externally (they are kept in sync as the element moves within the page) + try { var box = node.getBoundingClientRect(); box = { top: box.top, left: box.left }; } + catch(e) { box = {top: 0, left: 0}; } + if (!screen) { + // Get the toplevel scroll, working around browser differences. + if (window.pageYOffset == null) { + var t = document.documentElement || document.body.parentNode; + if (t.scrollTop == null) t = document.body; + box.top += t.scrollTop; box.left += t.scrollLeft; + } else { + box.top += window.pageYOffset; box.left += window.pageXOffset; + } + } + return box; + }; + + // Get a node's text content. + function eltText(node) { + return node.textContent || node.innerText || node.nodeValue || ""; + } + function selectInput(node) { + if (ios) { // Mobile Safari apparently has a bug where select() is broken. + node.selectionStart = 0; + node.selectionEnd = node.value.length; + } else node.select(); + } + + // Operations on {line, ch} objects. + function posEq(a, b) {return a.line == b.line && a.ch == b.ch;} + function posLess(a, b) {return a.line < b.line || (a.line == b.line && a.ch < b.ch);} + function copyPos(x) {return {line: x.line, ch: x.ch};} + + var escapeElement = document.createElement("pre"); + function htmlEscape(str) { + escapeElement.textContent = str; + return escapeElement.innerHTML; + } + // Recent (late 2011) Opera betas insert bogus newlines at the start + // of the textContent, so we strip those. + if (htmlEscape("a") == "\na") + htmlEscape = function(str) { + escapeElement.textContent = str; + return escapeElement.innerHTML.slice(1); + }; + // Some IEs don't preserve tabs through innerHTML + else if (htmlEscape("\t") != "\t") + htmlEscape = function(str) { + escapeElement.innerHTML = ""; + escapeElement.appendChild(document.createTextNode(str)); + return escapeElement.innerHTML; + }; + CodeMirror.htmlEscape = htmlEscape; + + // Used to position the cursor after an undo/redo by finding the + // last edited character. + function editEnd(from, to) { + if (!to) return 0; + if (!from) return to.length; + for (var i = from.length, j = to.length; i >= 0 && j >= 0; --i, --j) + if (from.charAt(i) != to.charAt(j)) break; + return j + 1; + } + + function indexOf(collection, elt) { + if (collection.indexOf) return collection.indexOf(elt); + for (var i = 0, e = collection.length; i < e; ++i) + if (collection[i] == elt) return i; + return -1; + } + function isWordChar(ch) { + return /\w/.test(ch) || ch.toUpperCase() != ch.toLowerCase(); + } + + // See if "".split is the broken IE version, if so, provide an + // alternative way to split lines. + var splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) { + var pos = 0, nl, result = []; + while ((nl = string.indexOf("\n", pos)) > -1) { + result.push(string.slice(pos, string.charAt(nl-1) == "\r" ? nl - 1 : nl)); + pos = nl + 1; + } + result.push(string.slice(pos)); + return result; + } : function(string){return string.split(/\r?\n/);}; + CodeMirror.splitLines = splitLines; + + var hasSelection = window.getSelection ? function(te) { + try { return te.selectionStart != te.selectionEnd; } + catch(e) { return false; } + } : function(te) { + try {var range = te.ownerDocument.selection.createRange();} + catch(e) {} + if (!range || range.parentElement() != te) return false; + return range.compareEndPoints("StartToEnd", range) != 0; + }; + + CodeMirror.defineMode("null", function() { + return {token: function(stream) {stream.skipToEnd();}}; + }); + CodeMirror.defineMIME("text/plain", "null"); + + var keyNames = {3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", + 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", + 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", + 46: "Delete", 59: ";", 91: "Mod", 92: "Mod", 93: "Mod", 127: "Delete", 186: ";", 187: "=", 188: ",", + 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", 221: "]", 222: "'", 63276: "PageUp", + 63277: "PageDown", 63275: "End", 63273: "Home", 63234: "Left", 63232: "Up", 63235: "Right", + 63233: "Down", 63302: "Insert", 63272: "Delete"}; + CodeMirror.keyNames = keyNames; + (function() { + // Number keys + for (var i = 0; i < 10; i++) keyNames[i + 48] = String(i); + // Alphabetic keys + for (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i); + // Function keys + for (var i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = "F" + i; + })(); + + return CodeMirror; +})(); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/clike/clike.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/clike/clike.js new file mode 100644 index 00000000..66443fb8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/clike/clike.js @@ -0,0 +1,234 @@ +CodeMirror.defineMode("clike", function(config, parserConfig) { + var indentUnit = config.indentUnit, + keywords = parserConfig.keywords || {}, + blockKeywords = parserConfig.blockKeywords || {}, + atoms = parserConfig.atoms || {}, + hooks = parserConfig.hooks || {}, + multiLineStrings = parserConfig.multiLineStrings; + var isOperatorChar = /[+\-*&%=<>!?|\/]/; + + var curPunc; + + function tokenBase(stream, state) { + var ch = stream.next(); + if (hooks[ch]) { + var result = hooks[ch](stream, state); + if (result !== false) return result; + } + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + curPunc = ch; + return null + } + if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return "number"; + } + if (ch == "/") { + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + } + if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + stream.eatWhile(/[\w\$_]/); + var cur = stream.current(); + if (keywords.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "keyword"; + } + if (atoms.propertyIsEnumerable(cur)) return "atom"; + return "word"; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) {end = true; break;} + escaped = !escaped && next == "\\"; + } + if (end || !(escaped || multiLineStrings)) + state.tokenize = null; + return "string"; + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = null; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + function pushContext(state, col, type) { + return state.context = new Context(state.indented, col, type, null, state.context); + } + function popContext(state) { + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") + state.indented = state.context.indented; + return state.context = state.context.prev; + } + + // Interface + + return { + startState: function(basecolumn) { + return { + tokenize: null, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + indented: 0, + startOfLine: true + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (stream.eatSpace()) return null; + curPunc = null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment" || style == "meta") return style; + if (ctx.align == null) ctx.align = true; + + if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); + else if (curPunc == "{") pushContext(state, stream.column(), "}"); + else if (curPunc == "[") pushContext(state, stream.column(), "]"); + else if (curPunc == "(") pushContext(state, stream.column(), ")"); + else if (curPunc == "}") { + while (ctx.type == "statement") ctx = popContext(state); + if (ctx.type == "}") ctx = popContext(state); + while (ctx.type == "statement") ctx = popContext(state); + } + else if (curPunc == ctx.type) popContext(state); + else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) + pushContext(state, stream.column(), "statement"); + state.startOfLine = false; + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase && state.tokenize != null) return 0; + var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); + if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; + var closing = firstChar == ctx.type; + if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit); + else if (ctx.align) return ctx.column + (closing ? 0 : 1); + else return ctx.indented + (closing ? 0 : indentUnit); + }, + + electricChars: "{}" + }; +}); + +(function() { + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + var cKeywords = "auto if break int case long char register continue return default short do sizeof " + + "double static else struct entry switch extern typedef float union for unsigned " + + "goto while enum void const signed volatile"; + + function cppHook(stream, state) { + if (!state.startOfLine) return false; + stream.skipToEnd(); + return "meta"; + } + + // C#-style strings where "" escapes a quote. + function tokenAtString(stream, state) { + var next; + while ((next = stream.next()) != null) { + if (next == '"' && !stream.eat('"')) { + state.tokenize = null; + break; + } + } + return "string"; + } + + CodeMirror.defineMIME("text/x-csrc", { + name: "clike", + keywords: words(cKeywords), + blockKeywords: words("case do else for if switch while struct"), + atoms: words("null"), + hooks: {"#": cppHook} + }); + CodeMirror.defineMIME("text/x-c++src", { + name: "clike", + keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try bool explicit new " + + "static_cast typeid catch operator template typename class friend private " + + "this using const_cast inline public throw virtual delete mutable protected " + + "wchar_t"), + blockKeywords: words("catch class do else finally for if struct switch try while"), + atoms: words("true false null"), + hooks: {"#": cppHook} + }); + CodeMirror.defineMIME("text/x-java", { + name: "clike", + keywords: words("abstract assert boolean break byte case catch char class const continue default " + + "do double else enum extends final finally float for goto if implements import " + + "instanceof int interface long native new package private protected public " + + "return short static strictfp super switch synchronized this throw throws transient " + + "try void volatile while"), + blockKeywords: words("catch class do else finally for if switch try while"), + atoms: words("true false null"), + hooks: { + "@": function(stream, state) { + stream.eatWhile(/[\w\$_]/); + return "meta"; + } + } + }); + CodeMirror.defineMIME("text/x-csharp", { + name: "clike", + keywords: words("abstract as base bool break byte case catch char checked class const continue decimal" + + " default delegate do double else enum event explicit extern finally fixed float for" + + " foreach goto if implicit in int interface internal is lock long namespace new object" + + " operator out override params private protected public readonly ref return sbyte sealed short" + + " sizeof stackalloc static string struct switch this throw try typeof uint ulong unchecked" + + " unsafe ushort using virtual void volatile while add alias ascending descending dynamic from get" + + " global group into join let orderby partial remove select set value var yield"), + blockKeywords: words("catch class do else finally for foreach if struct switch try while"), + atoms: words("true false null"), + hooks: { + "@": function(stream, state) { + if (stream.eat('"')) { + state.tokenize = tokenAtString; + return tokenAtString(stream, state); + } + stream.eatWhile(/[\w\$_]/); + return "meta"; + } + } + }); +}()); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/clike/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/clike/index.html new file mode 100644 index 00000000..64d02f11 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/clike/index.html @@ -0,0 +1,101 @@ + + + + CodeMirror: C-like mode + + + + + + + +

    CodeMirror: C-like mode

    + +
    + + + +

    Simple mode that tries to handle C-like languages as well as it + can. Takes two configuration parameters: keywords, an + object whose property names are the keywords in the language, + and useCPP, which determines whether C preprocessor + directives are recognized.

    + +

    MIME types defined: text/x-csrc + (C code), text/x-c++src (C++ + code), text/x-java (Java + code), text/x-csharp (C#).

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/clojure/clojure.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/clojure/clojure.js new file mode 100644 index 00000000..c6836415 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/clojure/clojure.js @@ -0,0 +1,207 @@ +/** + * Author: Hans Engel + * Branched from CodeMirror's Scheme mode (by Koh Zi Han, based on implementation by Koh Zi Chun) + */ +CodeMirror.defineMode("clojure", function (config, mode) { + var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", TAG = "tag", + ATOM = "atom", NUMBER = "number", BRACKET = "bracket", KEYWORD = "keyword"; + var INDENT_WORD_SKIP = 2, KEYWORDS_SKIP = 1; + + function makeKeywords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + var atoms = makeKeywords("true false nil"); + + var keywords = makeKeywords( + "defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord defproject deftest slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"); + + var builtins = makeKeywords( + "* *1 *2 *3 *agent* *allow-unresolved-vars* *assert *clojure-version* *command-line-args* *compile-files* *compile-path* *e *err* *file* *flush-on-newline* *in* *macro-meta* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *use-context-classloader* *warn-on-reflection* + - / < <= = == > >= accessor aclone agent agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec decimal? declare definline defmacro defmethod defmulti defn defn- defonce defstruct delay delay? deliver deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall doc dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq eval even? every? extend extend-protocol extend-type extends? extenders false? ffirst file-seq filter find find-doc find-ns find-var first float float-array float? floats flush fn fn? fnext for force format future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator hash hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map? mapcat max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod name namespace neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext num number? odd? or parents partial partition pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-doc print-dup print-method print-namespace-doc print-simple print-special-doc print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string reify reduce ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure release-pending-sends rem remove remove-method remove-ns repeat repeatedly replace replicate require reset! reset-meta! resolve rest resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-validator! set? short short-array shorts shutdown-agents slurp some sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-form-anchor special-symbol? split-at split-with str stream? string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync syntax-symbol-anchor take take-last take-nth take-while test the-ns time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-dec unchecked-divide unchecked-inc unchecked-multiply unchecked-negate unchecked-remainder unchecked-subtract underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision xml-seq"); + + var indentKeys = makeKeywords( + // Built-ins + "ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch " + + + // Binding forms + "let letfn binding loop for doseq dotimes when-let if-let " + + + // Data structures + "defstruct struct-map assoc " + + + // clojure.test + "testing deftest " + + + // contrib + "handler-case handle dotrace deftrace"); + + var tests = { + digit: /\d/, + digit_or_colon: /[\d:]/, + hex: /[0-9a-fA-F]/, + sign: /[+-]/, + exponent: /[eE]/, + keyword_char: /[^\s\(\[\;\)\]]/, + basic: /[\w\$_\-]/, + lang_keyword: /[\w*+!\-_?:\/]/ + }; + + function stateStack(indent, type, prev) { // represents a state stack object + this.indent = indent; + this.type = type; + this.prev = prev; + } + + function pushStack(state, indent, type) { + state.indentStack = new stateStack(indent, type, state.indentStack); + } + + function popStack(state) { + state.indentStack = state.indentStack.prev; + } + + function isNumber(ch, stream){ + // hex + if ( ch === '0' && 'x' == stream.peek().toLowerCase() ) { + stream.eat('x'); + stream.eatWhile(tests.hex); + return true; + } + + // leading sign + if ( ch == '+' || ch == '-' ) { + stream.eat(tests.sign); + ch = stream.next(); + } + + if ( tests.digit.test(ch) ) { + stream.eat(ch); + stream.eatWhile(tests.digit); + + if ( '.' == stream.peek() ) { + stream.eat('.'); + stream.eatWhile(tests.digit); + } + + if ( 'e' == stream.peek().toLowerCase() ) { + stream.eat(tests.exponent); + stream.eat(tests.sign); + stream.eatWhile(tests.digit); + } + + return true; + } + + return false; + } + + return { + startState: function () { + return { + indentStack: null, + indentation: 0, + mode: false + }; + }, + + token: function (stream, state) { + if (state.indentStack == null && stream.sol()) { + // update indentation, but only if indentStack is empty + state.indentation = stream.indentation(); + } + + // skip spaces + if (stream.eatSpace()) { + return null; + } + var returnType = null; + + switch(state.mode){ + case "string": // multi-line string parsing mode + var next, escaped = false; + while ((next = stream.next()) != null) { + if (next == "\"" && !escaped) { + + state.mode = false; + break; + } + escaped = !escaped && next == "\\"; + } + returnType = STRING; // continue on in string mode + break; + default: // default parsing mode + var ch = stream.next(); + + if (ch == "\"") { + state.mode = "string"; + returnType = STRING; + } else if (ch == "'" && !( tests.digit_or_colon.test(stream.peek()) )) { + returnType = ATOM; + } else if (ch == ";") { // comment + stream.skipToEnd(); // rest of the line is a comment + returnType = COMMENT; + } else if (isNumber(ch,stream)){ + returnType = NUMBER; + } else if (ch == "(" || ch == "[") { + var keyWord = ''; var indentTemp = stream.column(); + /** + Either + (indent-word .. + (non-indent-word .. + (;something else, bracket, etc. + */ + + if (ch == "(") while ((letter = stream.eat(tests.keyword_char)) != null) { + keyWord += letter; + } + + if (keyWord.length > 0 && indentKeys.propertyIsEnumerable(keyWord)) { // indent-word + pushStack(state, indentTemp + INDENT_WORD_SKIP, ch); + } else { // non-indent word + // we continue eating the spaces + stream.eatSpace(); + if (stream.eol() || stream.peek() == ";") { + // nothing significant after + // we restart indentation 1 space after + pushStack(state, indentTemp + 1, ch); + } else { + pushStack(state, indentTemp + stream.current().length, ch); // else we match + } + } + stream.backUp(stream.current().length - 1); // undo all the eating + + returnType = BRACKET; + } else if (ch == ")" || ch == "]") { + returnType = BRACKET; + if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : "[")) { + popStack(state); + } + } else if ( ch == ":" ) { + stream.eatWhile(tests.lang_keyword); + return ATOM; + } else { + stream.eatWhile(tests.basic); + + if (keywords && keywords.propertyIsEnumerable(stream.current())) { + returnType = KEYWORD; + } else if (builtins && builtins.propertyIsEnumerable(stream.current())) { + returnType = BUILTIN; + } else if (atoms && atoms.propertyIsEnumerable(stream.current())) { + returnType = ATOM; + } else returnType = null; + } + } + + return returnType; + }, + + indent: function (state, textAfter) { + if (state.indentStack == null) return state.indentation; + return state.indentStack.indent; + } + }; +}); + +CodeMirror.defineMIME("text/x-clojure", "clojure"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/clojure/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/clojure/index.html new file mode 100644 index 00000000..9762d589 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/clojure/index.html @@ -0,0 +1,66 @@ + + + + CodeMirror: Clojure mode + + + + + + + +

    CodeMirror: Clojure mode

    +
    + + +

    MIME types defined: text/x-clojure.

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/coffeescript/LICENSE b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/coffeescript/LICENSE new file mode 100644 index 00000000..977e284e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/coffeescript/LICENSE @@ -0,0 +1,22 @@ +The MIT License + +Copyright (c) 2011 Jeff Pickhardt +Modified from the Python CodeMirror mode, Copyright (c) 2010 Timothy Farrell + +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +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. \ No newline at end of file diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/coffeescript/coffeescript.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/coffeescript/coffeescript.js new file mode 100644 index 00000000..4f2bd66d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/coffeescript/coffeescript.js @@ -0,0 +1,341 @@ +/** + * Link to the project's GitHub page: + * https://github.com/pickhardt/coffeescript-codemirror-mode + */ +CodeMirror.defineMode('coffeescript', function(conf) { + var ERRORCLASS = 'error'; + + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b"); + } + + var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!\?]"); + var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]'); + var doubleOperators = new RegExp("^((\->)|(\=>)|(\\+\\+)|(\\+\\=)|(\\-\\-)|(\\-\\=)|(\\*\\*)|(\\*\\=)|(\\/\\/)|(\\/\\=)|(==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//))"); + var doubleDelimiters = new RegExp("^((\\.\\.)|(\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); + var tripleDelimiters = new RegExp("^((\\.\\.\\.)|(//=)|(>>=)|(<<=)|(\\*\\*=))"); + var identifiers = new RegExp("^[_A-Za-z$][_A-Za-z$0-9]*"); + + var wordOperators = wordRegexp(['and', 'or', 'not', + 'is', 'isnt', 'in', + 'instanceof', 'typeof']); + var indentKeywords = ['for', 'while', 'loop', 'if', 'unless', 'else', + 'switch', 'try', 'catch', 'finally', 'class']; + var commonKeywords = ['break', 'by', 'continue', 'debugger', 'delete', + 'do', 'in', 'of', 'new', 'return', 'then', + 'this', 'throw', 'when', 'until']; + + var keywords = wordRegexp(indentKeywords.concat(commonKeywords)); + + indentKeywords = wordRegexp(indentKeywords); + + + var stringPrefixes = new RegExp("^('{3}|\"{3}|['\"])"); + var regexPrefixes = new RegExp("^(/{3}|/)"); + var commonConstants = ['Infinity', 'NaN', 'undefined', 'null', 'true', 'false', 'on', 'off', 'yes', 'no']; + var constants = wordRegexp(commonConstants); + + // Tokenizers + function tokenBase(stream, state) { + // Handle scope changes + if (stream.sol()) { + var scopeOffset = state.scopes[0].offset; + if (stream.eatSpace()) { + var lineOffset = stream.indentation(); + if (lineOffset > scopeOffset) { + return 'indent'; + } else if (lineOffset < scopeOffset) { + return 'dedent'; + } + return null; + } else { + if (scopeOffset > 0) { + dedent(stream, state); + } + } + } + if (stream.eatSpace()) { + return null; + } + + var ch = stream.peek(); + + // Handle multi line comments + if (stream.match("###")) { + state.tokenize = longComment; + return state.tokenize(stream, state); + } + + // Single line comment + if (ch === '#') { + stream.skipToEnd(); + return 'comment'; + } + + // Handle number literals + if (stream.match(/^-?[0-9\.]/, false)) { + var floatLiteral = false; + // Floats + if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)) { + floatLiteral = true; + } + if (stream.match(/^-?\d+\.\d*/)) { + floatLiteral = true; + } + if (stream.match(/^-?\.\d+/)) { + floatLiteral = true; + } + + if (floatLiteral) { + // prevent from getting extra . on 1.. + if (stream.peek() == "."){ + stream.backUp(1); + } + return 'number'; + } + // Integers + var intLiteral = false; + // Hex + if (stream.match(/^-?0x[0-9a-f]+/i)) { + intLiteral = true; + } + // Decimal + if (stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)) { + intLiteral = true; + } + // Zero by itself with no other piece of number. + if (stream.match(/^-?0(?![\dx])/i)) { + intLiteral = true; + } + if (intLiteral) { + return 'number'; + } + } + + // Handle strings + if (stream.match(stringPrefixes)) { + state.tokenize = tokenFactory(stream.current(), 'string'); + return state.tokenize(stream, state); + } + // Handle regex literals + if (stream.match(regexPrefixes)) { + if (stream.current() != '/' || stream.match(/^.*\//, false)) { // prevent highlight of division + state.tokenize = tokenFactory(stream.current(), 'string-2'); + return state.tokenize(stream, state); + } else { + stream.backUp(1); + } + } + + // Handle operators and delimiters + if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) { + return 'punctuation'; + } + if (stream.match(doubleOperators) + || stream.match(singleOperators) + || stream.match(wordOperators)) { + return 'operator'; + } + if (stream.match(singleDelimiters)) { + return 'punctuation'; + } + + if (stream.match(constants)) { + return 'atom'; + } + + if (stream.match(keywords)) { + return 'keyword'; + } + + if (stream.match(identifiers)) { + return 'variable'; + } + + // Handle non-detected items + stream.next(); + return ERRORCLASS; + } + + function tokenFactory(delimiter, outclass) { + var singleline = delimiter.length == 1; + return function tokenString(stream, state) { + while (!stream.eol()) { + stream.eatWhile(/[^'"\/\\]/); + if (stream.eat('\\')) { + stream.next(); + if (singleline && stream.eol()) { + return outclass; + } + } else if (stream.match(delimiter)) { + state.tokenize = tokenBase; + return outclass; + } else { + stream.eat(/['"\/]/); + } + } + if (singleline) { + if (conf.mode.singleLineStringErrors) { + outclass = ERRORCLASS + } else { + state.tokenize = tokenBase; + } + } + return outclass; + }; + } + + function longComment(stream, state) { + while (!stream.eol()) { + stream.eatWhile(/[^#]/); + if (stream.match("###")) { + state.tokenize = tokenBase; + break; + } + stream.eatWhile("#"); + } + return "comment" + } + + function indent(stream, state, type) { + type = type || 'coffee'; + var indentUnit = 0; + if (type === 'coffee') { + for (var i = 0; i < state.scopes.length; i++) { + if (state.scopes[i].type === 'coffee') { + indentUnit = state.scopes[i].offset + conf.indentUnit; + break; + } + } + } else { + indentUnit = stream.column() + stream.current().length; + } + state.scopes.unshift({ + offset: indentUnit, + type: type + }); + } + + function dedent(stream, state) { + if (state.scopes.length == 1) return; + if (state.scopes[0].type === 'coffee') { + var _indent = stream.indentation(); + var _indent_index = -1; + for (var i = 0; i < state.scopes.length; ++i) { + if (_indent === state.scopes[i].offset) { + _indent_index = i; + break; + } + } + if (_indent_index === -1) { + return true; + } + while (state.scopes[0].offset !== _indent) { + state.scopes.shift(); + } + return false + } else { + state.scopes.shift(); + return false; + } + } + + function tokenLexer(stream, state) { + var style = state.tokenize(stream, state); + var current = stream.current(); + + // Handle '.' connected identifiers + if (current === '.') { + style = state.tokenize(stream, state); + current = stream.current(); + if (style === 'variable') { + return 'variable'; + } else { + return ERRORCLASS; + } + } + + // Handle properties + if (current === '@') { + stream.eat('@'); + return 'keyword'; + } + + // Handle scope changes. + if (current === 'return') { + state.dedent += 1; + } + if (((current === '->' || current === '=>') && + !state.lambda && + state.scopes[0].type == 'coffee' && + stream.peek() === '') + || style === 'indent') { + indent(stream, state); + } + var delimiter_index = '[({'.indexOf(current); + if (delimiter_index !== -1) { + indent(stream, state, '])}'.slice(delimiter_index, delimiter_index+1)); + } + if (indentKeywords.exec(current)){ + indent(stream, state); + } + if (current == 'then'){ + dedent(stream, state); + } + + + if (style === 'dedent') { + if (dedent(stream, state)) { + return ERRORCLASS; + } + } + delimiter_index = '])}'.indexOf(current); + if (delimiter_index !== -1) { + if (dedent(stream, state)) { + return ERRORCLASS; + } + } + if (state.dedent > 0 && stream.eol() && state.scopes[0].type == 'coffee') { + if (state.scopes.length > 1) state.scopes.shift(); + state.dedent -= 1; + } + + return style; + } + + var external = { + startState: function(basecolumn) { + return { + tokenize: tokenBase, + scopes: [{offset:basecolumn || 0, type:'coffee'}], + lastToken: null, + lambda: false, + dedent: 0 + }; + }, + + token: function(stream, state) { + var style = tokenLexer(stream, state); + + state.lastToken = {style:style, content: stream.current()}; + + if (stream.eol() && stream.lambda) { + state.lambda = false; + } + + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase) { + return 0; + } + + return state.scopes[0].offset; + } + + }; + return external; +}); + +CodeMirror.defineMIME('text/x-coffeescript', 'coffeescript'); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/coffeescript/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/coffeescript/index.html new file mode 100644 index 00000000..127c4bf9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/coffeescript/index.html @@ -0,0 +1,721 @@ + + + + CodeMirror: CoffeeScript mode + + + + + + + +

    CodeMirror: CoffeeScript mode

    +
    + + +

    MIME types defined: text/x-coffeescript.

    + +

    The CoffeeScript mode was written by Jeff Pickhardt (license).

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/css/css.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/css/css.js new file mode 100644 index 00000000..050e1124 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/css/css.js @@ -0,0 +1,124 @@ +CodeMirror.defineMode("css", function(config) { + var indentUnit = config.indentUnit, type; + function ret(style, tp) {type = tp; return style;} + + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("meta", stream.current());} + else if (ch == "/" && stream.eat("*")) { + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } + else if (ch == "<" && stream.eat("!")) { + state.tokenize = tokenSGMLComment; + return tokenSGMLComment(stream, state); + } + else if (ch == "=") ret(null, "compare"); + else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare"); + else if (ch == "\"" || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + else if (ch == "#") { + stream.eatWhile(/[\w\\\-]/); + return ret("atom", "hash"); + } + else if (ch == "!") { + stream.match(/^\s*\w*/); + return ret("keyword", "important"); + } + else if (/\d/.test(ch)) { + stream.eatWhile(/[\w.%]/); + return ret("number", "unit"); + } + else if (/[,.+>*\/]/.test(ch)) { + return ret(null, "select-op"); + } + else if (/[;{}:\[\]]/.test(ch)) { + return ret(null, ch); + } + else { + stream.eatWhile(/[\w\\\-]/); + return ret("variable", "variable"); + } + } + + function tokenCComment(stream, state) { + var maybeEnd = false, ch; + while ((ch = stream.next()) != null) { + if (maybeEnd && ch == "/") { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return ret("comment", "comment"); + } + + function tokenSGMLComment(stream, state) { + var dashes = 0, ch; + while ((ch = stream.next()) != null) { + if (dashes >= 2 && ch == ">") { + state.tokenize = tokenBase; + break; + } + dashes = (ch == "-") ? dashes + 1 : 0; + } + return ret("comment", "comment"); + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) + break; + escaped = !escaped && ch == "\\"; + } + if (!escaped) state.tokenize = tokenBase; + return ret("string", "string"); + }; + } + + return { + startState: function(base) { + return {tokenize: tokenBase, + baseIndent: base || 0, + stack: []}; + }, + + token: function(stream, state) { + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + + var context = state.stack[state.stack.length-1]; + if (type == "hash" && context != "rule") style = "string-2"; + else if (style == "variable") { + if (context == "rule") style = "number"; + else if (!context || context == "@media{") style = "tag"; + } + + if (context == "rule" && /^[\{\};]$/.test(type)) + state.stack.pop(); + if (type == "{") { + if (context == "@media") state.stack[state.stack.length-1] = "@media{"; + else state.stack.push("{"); + } + else if (type == "}") state.stack.pop(); + else if (type == "@media") state.stack.push("@media"); + else if (context == "{" && type != "comment") state.stack.push("rule"); + return style; + }, + + indent: function(state, textAfter) { + var n = state.stack.length; + if (/^\}/.test(textAfter)) + n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1; + return state.baseIndent + n * indentUnit; + }, + + electricChars: "}" + }; +}); + +CodeMirror.defineMIME("text/css", "css"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/css/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/css/index.html new file mode 100644 index 00000000..49934346 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/css/index.html @@ -0,0 +1,55 @@ + + + + CodeMirror: CSS mode + + + + + + + +

    CodeMirror: CSS mode

    +
    + + +

    MIME types defined: text/css.

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/diff/diff.css b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/diff/diff.css new file mode 100644 index 00000000..0e96ab21 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/diff/diff.css @@ -0,0 +1,3 @@ +span.cm-rangeinfo {color: #a0b;} +span.cm-minus {color: red;} +span.cm-plus {color: #2b2;} diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/diff/diff.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/diff/diff.js new file mode 100644 index 00000000..725bb2c7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/diff/diff.js @@ -0,0 +1,13 @@ +CodeMirror.defineMode("diff", function() { + return { + token: function(stream) { + var ch = stream.next(); + stream.skipToEnd(); + if (ch == "+") return "plus"; + if (ch == "-") return "minus"; + if (ch == "@") return "rangeinfo"; + } + }; +}); + +CodeMirror.defineMIME("text/x-diff", "diff"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/diff/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/diff/index.html new file mode 100644 index 00000000..2540236c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/diff/index.html @@ -0,0 +1,99 @@ + + + + CodeMirror: Diff mode + + + + + + + + +

    CodeMirror: Diff mode

    +
    + + +

    MIME types defined: text/x-diff.

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ecl/ecl.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ecl/ecl.js new file mode 100644 index 00000000..09373ede --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ecl/ecl.js @@ -0,0 +1,203 @@ +CodeMirror.defineMode("ecl", function(config) { + + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + function metaHook(stream, state) { + if (!state.startOfLine) return false; + stream.skipToEnd(); + return "meta"; + } + + function tokenAtString(stream, state) { + var next; + while ((next = stream.next()) != null) { + if (next == '"' && !stream.eat('"')) { + state.tokenize = null; + break; + } + } + return "string"; + } + + var indentUnit = config.indentUnit; + var keyword = words("abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode"); + var variable = words("apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait"); + var variable_2 = words("__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath"); + var variable_3 = words("ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode"); + var builtin = words("checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when"); + var blockKeywords = words("catch class do else finally for if switch try while"); + var atoms = words("true false null"); + var hooks = {"#": metaHook}; + var multiLineStrings; + var isOperatorChar = /[+\-*&%=<>!?|\/]/; + + var curPunc; + + function tokenBase(stream, state) { + var ch = stream.next(); + if (hooks[ch]) { + var result = hooks[ch](stream, state); + if (result !== false) return result; + } + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + curPunc = ch; + return null + } + if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return "number"; + } + if (ch == "/") { + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + } + if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + stream.eatWhile(/[\w\$_]/); + var cur = stream.current().toLowerCase(); + if (keyword.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "keyword"; + } else if (variable.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "variable"; + } else if (variable_2.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "variable-2"; + } else if (variable_3.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "variable-3"; + } else if (builtin.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "builtin"; + } else { //Data types are of from KEYWORD## + var i = cur.length - 1; + while(i >= 0 && (!isNaN(cur[i]) || cur[i] == '_')) + --i; + + if (i > 0) { + var cur2 = cur.substr(0, i + 1); + if (variable_3.propertyIsEnumerable(cur2)) { + if (blockKeywords.propertyIsEnumerable(cur2)) curPunc = "newstatement"; + return "variable-3"; + } + } + } + if (atoms.propertyIsEnumerable(cur)) return "atom"; + return "word"; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) {end = true; break;} + escaped = !escaped && next == "\\"; + } + if (end || !(escaped || multiLineStrings)) + state.tokenize = tokenBase; + return "string"; + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + function pushContext(state, col, type) { + return state.context = new Context(state.indented, col, type, null, state.context); + } + function popContext(state) { + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") + state.indented = state.context.indented; + return state.context = state.context.prev; + } + + // Interface + + return { + startState: function(basecolumn) { + return { + tokenize: null, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + indented: 0, + startOfLine: true + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (stream.eatSpace()) return null; + curPunc = null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment" || style == "meta") return style; + if (ctx.align == null) ctx.align = true; + + if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); + else if (curPunc == "{") pushContext(state, stream.column(), "}"); + else if (curPunc == "[") pushContext(state, stream.column(), "]"); + else if (curPunc == "(") pushContext(state, stream.column(), ")"); + else if (curPunc == "}") { + while (ctx.type == "statement") ctx = popContext(state); + if (ctx.type == "}") ctx = popContext(state); + while (ctx.type == "statement") ctx = popContext(state); + } + else if (curPunc == ctx.type) popContext(state); + else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) + pushContext(state, stream.column(), "statement"); + state.startOfLine = false; + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase && state.tokenize != null) return 0; + var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); + if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; + var closing = firstChar == ctx.type; + if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit); + else if (ctx.align) return ctx.column + (closing ? 0 : 1); + else return ctx.indented + (closing ? 0 : indentUnit); + }, + + electricChars: "{}" + }; +}); + +CodeMirror.defineMIME("text/x-ecl"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ecl/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ecl/index.html new file mode 100644 index 00000000..a3542eda --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ecl/index.html @@ -0,0 +1,42 @@ + + + + CodeMirror: ECL mode + + + + + + + +

    CodeMirror: ECL mode

    +
    + + +

    Based on CodeMirror's clike mode. For more information see HPCC Systems web site.

    +

    MIME types defined: text/x-ecl.

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/gfm/gfm.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/gfm/gfm.js new file mode 100644 index 00000000..01afed7b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/gfm/gfm.js @@ -0,0 +1,108 @@ +CodeMirror.defineMode("gfm", function(config, parserConfig) { + var mdMode = CodeMirror.getMode(config, "markdown"); + var aliases = { + html: "htmlmixed", + js: "javascript", + json: "application/json", + c: "text/x-csrc", + "c++": "text/x-c++src", + java: "text/x-java", + csharp: "text/x-csharp", + "c#": "text/x-csharp" + }; + + // make this lazy so that we don't need to load GFM last + var getMode = (function () { + var i, modes = {}, mimes = {}, mime; + + var list = CodeMirror.listModes(); + for (i = 0; i < list.length; i++) { + modes[list[i]] = list[i]; + } + var mimesList = CodeMirror.listMIMEs(); + for (i = 0; i < mimesList.length; i++) { + mime = mimesList[i].mime; + mimes[mime] = mimesList[i].mime; + } + + for (var a in aliases) { + if (aliases[a] in modes || aliases[a] in mimes) + modes[a] = aliases[a]; + } + + return function (lang) { + return modes[lang] ? CodeMirror.getMode(config, modes[lang]) : null; + } + }()); + + function markdown(stream, state) { + // intercept fenced code blocks + if (stream.sol() && stream.match(/^```([\w+#]*)/)) { + // try switching mode + state.localMode = getMode(RegExp.$1) + if (state.localMode) + state.localState = state.localMode.startState(); + + state.token = local; + return 'code'; + } + + return mdMode.token(stream, state.mdState); + } + + function local(stream, state) { + if (stream.sol() && stream.match(/^```/)) { + state.localMode = state.localState = null; + state.token = markdown; + return 'code'; + } + else if (state.localMode) { + return state.localMode.token(stream, state.localState); + } else { + stream.skipToEnd(); + return 'code'; + } + } + + // custom handleText to prevent emphasis in the middle of a word + // and add autolinking + function handleText(stream, mdState) { + var match; + if (stream.match(/^\w+:\/\/\S+/)) { + return 'linkhref'; + } + if (stream.match(/^[^\[*\\<>` _][^\[*\\<>` ]*[^\[*\\<>` _]/)) { + return mdMode.getType(mdState); + } + if (match = stream.match(/^[^\[*\\<>` ]+/)) { + var word = match[0]; + if (word[0] === '_' && word[word.length-1] === '_') { + stream.backUp(word.length); + return undefined; + } + return mdMode.getType(mdState); + } + if (stream.eatSpace()) { + return null; + } + } + + return { + startState: function() { + var mdState = mdMode.startState(); + mdState.text = handleText; + return {token: markdown, mode: "markdown", mdState: mdState, + localMode: null, localState: null}; + }, + + copyState: function(state) { + return {token: state.token, mode: state.mode, mdState: CodeMirror.copyState(mdMode, state.mdState), + localMode: state.localMode, + localState: state.localMode ? CodeMirror.copyState(state.localMode, state.localState) : null}; + }, + + token: function(stream, state) { + return state.token(stream, state); + } + } +}); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/gfm/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/gfm/index.html new file mode 100644 index 00000000..b27d49ab --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/gfm/index.html @@ -0,0 +1,47 @@ + + + + CodeMirror: GFM mode + + + + + + + + + + + +

    CodeMirror: GFM mode

    + + +
    + + + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/go/go.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/go/go.js new file mode 100644 index 00000000..00e5d6c2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/go/go.js @@ -0,0 +1,170 @@ +CodeMirror.defineMode("go", function(config, parserConfig) { + var indentUnit = config.indentUnit; + + var keywords = { + "break":true, "case":true, "chan":true, "const":true, "continue":true, + "default":true, "defer":true, "else":true, "fallthrough":true, "for":true, + "func":true, "go":true, "goto":true, "if":true, "import":true, + "interface":true, "map":true, "package":true, "range":true, "return":true, + "select":true, "struct":true, "switch":true, "type":true, "var":true, + "bool":true, "byte":true, "complex64":true, "complex128":true, + "float32":true, "float64":true, "int8":true, "int16":true, "int32":true, + "int64":true, "string":true, "uint8":true, "uint16":true, "uint32":true, + "uint64":true, "int":true, "uint":true, "uintptr":true + }; + + var atoms = { + "true":true, "false":true, "iota":true, "nil":true, "append":true, + "cap":true, "close":true, "complex":true, "copy":true, "imag":true, + "len":true, "make":true, "new":true, "panic":true, "print":true, + "println":true, "real":true, "recover":true + }; + + var blockKeywords = { + "else":true, "for":true, "func":true, "if":true, "interface":true, + "select":true, "struct":true, "switch":true + }; + + var isOperatorChar = /[+\-*&^%:=<>!|\/]/; + + var curPunc; + + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'" || ch == "`") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + if (/[\d\.]/.test(ch)) { + if (ch == ".") { + stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/); + } else if (ch == "0") { + stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/); + } else { + stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/); + } + return "number"; + } + if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + curPunc = ch; + return null + } + if (ch == "/") { + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + } + if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + stream.eatWhile(/[\w\$_]/); + var cur = stream.current(); + if (keywords.propertyIsEnumerable(cur)) { + if (cur == "case" || cur == "default") curPunc = "case"; + return "keyword"; + } + if (atoms.propertyIsEnumerable(cur)) return "atom"; + return "word"; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) {end = true; break;} + escaped = !escaped && next == "\\"; + } + if (end || !(escaped || quote == "`")) + state.tokenize = tokenBase; + return "string"; + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + function pushContext(state, col, type) { + return state.context = new Context(state.indented, col, type, null, state.context); + } + function popContext(state) { + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") + state.indented = state.context.indented; + return state.context = state.context.prev; + } + + // Interface + + return { + startState: function(basecolumn) { + return { + tokenize: null, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + indented: 0, + startOfLine: true + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + if (ctx.type == "case") ctx.type = "}"; + } + if (stream.eatSpace()) return null; + curPunc = null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment") return style; + if (ctx.align == null) ctx.align = true; + + if (curPunc == "{") pushContext(state, stream.column(), "}"); + else if (curPunc == "[") pushContext(state, stream.column(), "]"); + else if (curPunc == "(") pushContext(state, stream.column(), ")"); + else if (curPunc == "case") ctx.type = "case" + else if (curPunc == "}" && ctx.type == "}") ctx = popContext(state); + else if (curPunc == ctx.type) popContext(state); + state.startOfLine = false; + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase && state.tokenize != null) return 0; + var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); + if (ctx.type == "case" && /^(?:case|default)\b/.test(textAfter)) { + state.context.type = "}"; + return ctx.indented; + } + var closing = firstChar == ctx.type; + if (ctx.align) return ctx.column + (closing ? 0 : 1); + else return ctx.indented + (closing ? 0 : indentUnit); + }, + + electricChars: "{}:" + }; +}); + +CodeMirror.defineMIME("text/x-go", "go"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/go/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/go/index.html new file mode 100644 index 00000000..9cdad1ad --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/go/index.html @@ -0,0 +1,72 @@ + + + + CodeMirror: Go mode + + + + + + + + +

    CodeMirror: Go mode

    + +
    + + + +

    MIME type: text/x-go

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/groovy/groovy.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/groovy/groovy.js new file mode 100644 index 00000000..029e0c9b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/groovy/groovy.js @@ -0,0 +1,210 @@ +CodeMirror.defineMode("groovy", function(config, parserConfig) { + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + var keywords = words( + "abstract as assert boolean break byte case catch char class const continue def default " + + "do double else enum extends final finally float for goto if implements import in " + + "instanceof int interface long native new package private protected public return " + + "short static strictfp super switch synchronized threadsafe throw throws transient " + + "try void volatile while"); + var blockKeywords = words("catch class do else finally for if switch try while enum interface def"); + var atoms = words("null true false this"); + + var curPunc; + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") { + return startString(ch, stream, state); + } + if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + curPunc = ch; + return null + } + if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + if (stream.eat(/eE/)) { stream.eat(/\+\-/); stream.eatWhile(/\d/); } + return "number"; + } + if (ch == "/") { + if (stream.eat("*")) { + state.tokenize.push(tokenComment); + return tokenComment(stream, state); + } + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + if (expectExpression(state.lastToken)) { + return startString(ch, stream, state); + } + } + if (ch == "-" && stream.eat(">")) { + curPunc = "->"; + return null; + } + if (/[+\-*&%=<>!?|\/~]/.test(ch)) { + stream.eatWhile(/[+\-*&%=<>|~]/); + return "operator"; + } + stream.eatWhile(/[\w\$_]/); + if (ch == "@") { stream.eatWhile(/[\w\$_\.]/); return "meta"; } + if (state.lastToken == ".") return "property"; + if (stream.eat(":")) { curPunc = "proplabel"; return "property"; } + var cur = stream.current(); + if (atoms.propertyIsEnumerable(cur)) { return "atom"; } + if (keywords.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "keyword"; + } + return "word"; + } + tokenBase.isBase = true; + + function startString(quote, stream, state) { + var tripleQuoted = false; + if (quote != "/" && stream.eat(quote)) { + if (stream.eat(quote)) tripleQuoted = true; + else return "string"; + } + function t(stream, state) { + var escaped = false, next, end = !tripleQuoted; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) { + if (!tripleQuoted) { break; } + if (stream.match(quote + quote)) { end = true; break; } + } + if (quote == '"' && next == "$" && !escaped && stream.eat("{")) { + state.tokenize.push(tokenBaseUntilBrace()); + return "string"; + } + escaped = !escaped && next == "\\"; + } + if (end) state.tokenize.pop(); + return "string"; + } + state.tokenize.push(t); + return t(stream, state); + } + + function tokenBaseUntilBrace() { + var depth = 1; + function t(stream, state) { + if (stream.peek() == "}") { + depth--; + if (depth == 0) { + state.tokenize.pop(); + return state.tokenize[state.tokenize.length-1](stream, state); + } + } else if (stream.peek() == "{") { + depth++; + } + return tokenBase(stream, state); + } + t.isBase = true; + return t; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize.pop(); + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function expectExpression(last) { + return !last || last == "operator" || last == "->" || /[\.\[\{\(,;:]/.test(last) || + last == "newstatement" || last == "keyword" || last == "proplabel"; + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + function pushContext(state, col, type) { + return state.context = new Context(state.indented, col, type, null, state.context); + } + function popContext(state) { + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") + state.indented = state.context.indented; + return state.context = state.context.prev; + } + + // Interface + + return { + startState: function(basecolumn) { + return { + tokenize: [tokenBase], + context: new Context((basecolumn || 0) - config.indentUnit, 0, "top", false), + indented: 0, + startOfLine: true, + lastToken: null + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + // Automatic semicolon insertion + if (ctx.type == "statement" && !expectExpression(state.lastToken)) { + popContext(state); ctx = state.context; + } + } + if (stream.eatSpace()) return null; + curPunc = null; + var style = state.tokenize[state.tokenize.length-1](stream, state); + if (style == "comment") return style; + if (ctx.align == null) ctx.align = true; + + if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); + // Handle indentation for {x -> \n ... } + else if (curPunc == "->" && ctx.type == "statement" && ctx.prev.type == "}") { + popContext(state); + state.context.align = false; + } + else if (curPunc == "{") pushContext(state, stream.column(), "}"); + else if (curPunc == "[") pushContext(state, stream.column(), "]"); + else if (curPunc == "(") pushContext(state, stream.column(), ")"); + else if (curPunc == "}") { + while (ctx.type == "statement") ctx = popContext(state); + if (ctx.type == "}") ctx = popContext(state); + while (ctx.type == "statement") ctx = popContext(state); + } + else if (curPunc == ctx.type) popContext(state); + else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) + pushContext(state, stream.column(), "statement"); + state.startOfLine = false; + state.lastToken = curPunc || style; + return style; + }, + + indent: function(state, textAfter) { + if (!state.tokenize[state.tokenize.length-1].isBase) return 0; + var firstChar = textAfter && textAfter.charAt(0), ctx = state.context; + if (ctx.type == "statement" && !expectExpression(state.lastToken)) ctx = ctx.prev; + var closing = firstChar == ctx.type; + if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : config.indentUnit); + else if (ctx.align) return ctx.column + (closing ? 0 : 1); + else return ctx.indented + (closing ? 0 : config.indentUnit); + }, + + electricChars: "{}" + }; +}); + +CodeMirror.defineMIME("text/x-groovy", "groovy"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/groovy/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/groovy/index.html new file mode 100644 index 00000000..226475ca --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/groovy/index.html @@ -0,0 +1,71 @@ + + + + CodeMirror: Groovy mode + + + + + + + +

    CodeMirror: Groovy mode

    + +
    + + + +

    MIME types defined: text/x-groovy

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/haskell/haskell.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/haskell/haskell.js new file mode 100644 index 00000000..aac50410 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/haskell/haskell.js @@ -0,0 +1,242 @@ +CodeMirror.defineMode("haskell", function(cmCfg, modeCfg) { + + function switchState(source, setState, f) { + setState(f); + return f(source, setState); + } + + // These should all be Unicode extended, as per the Haskell 2010 report + var smallRE = /[a-z_]/; + var largeRE = /[A-Z]/; + var digitRE = /[0-9]/; + var hexitRE = /[0-9A-Fa-f]/; + var octitRE = /[0-7]/; + var idRE = /[a-z_A-Z0-9']/; + var symbolRE = /[-!#$%&*+.\/<=>?@\\^|~:]/; + var specialRE = /[(),;[\]`{}]/; + var whiteCharRE = /[ \t\v\f]/; // newlines are handled in tokenizer + + function normal(source, setState) { + if (source.eatWhile(whiteCharRE)) { + return null; + } + + var ch = source.next(); + if (specialRE.test(ch)) { + if (ch == '{' && source.eat('-')) { + var t = "comment"; + if (source.eat('#')) { + t = "meta"; + } + return switchState(source, setState, ncomment(t, 1)); + } + return null; + } + + if (ch == '\'') { + if (source.eat('\\')) { + source.next(); // should handle other escapes here + } + else { + source.next(); + } + if (source.eat('\'')) { + return "string"; + } + return "error"; + } + + if (ch == '"') { + return switchState(source, setState, stringLiteral); + } + + if (largeRE.test(ch)) { + source.eatWhile(idRE); + if (source.eat('.')) { + return "qualifier"; + } + return "variable-2"; + } + + if (smallRE.test(ch)) { + source.eatWhile(idRE); + return "variable"; + } + + if (digitRE.test(ch)) { + if (ch == '0') { + if (source.eat(/[xX]/)) { + source.eatWhile(hexitRE); // should require at least 1 + return "integer"; + } + if (source.eat(/[oO]/)) { + source.eatWhile(octitRE); // should require at least 1 + return "number"; + } + } + source.eatWhile(digitRE); + var t = "number"; + if (source.eat('.')) { + t = "number"; + source.eatWhile(digitRE); // should require at least 1 + } + if (source.eat(/[eE]/)) { + t = "number"; + source.eat(/[-+]/); + source.eatWhile(digitRE); // should require at least 1 + } + return t; + } + + if (symbolRE.test(ch)) { + if (ch == '-' && source.eat(/-/)) { + source.eatWhile(/-/); + if (!source.eat(symbolRE)) { + source.skipToEnd(); + return "comment"; + } + } + var t = "variable"; + if (ch == ':') { + t = "variable-2"; + } + source.eatWhile(symbolRE); + return t; + } + + return "error"; + } + + function ncomment(type, nest) { + if (nest == 0) { + return normal; + } + return function(source, setState) { + var currNest = nest; + while (!source.eol()) { + var ch = source.next(); + if (ch == '{' && source.eat('-')) { + ++currNest; + } + else if (ch == '-' && source.eat('}')) { + --currNest; + if (currNest == 0) { + setState(normal); + return type; + } + } + } + setState(ncomment(type, currNest)); + return type; + } + } + + function stringLiteral(source, setState) { + while (!source.eol()) { + var ch = source.next(); + if (ch == '"') { + setState(normal); + return "string"; + } + if (ch == '\\') { + if (source.eol() || source.eat(whiteCharRE)) { + setState(stringGap); + return "string"; + } + if (source.eat('&')) { + } + else { + source.next(); // should handle other escapes here + } + } + } + setState(normal); + return "error"; + } + + function stringGap(source, setState) { + if (source.eat('\\')) { + return switchState(source, setState, stringLiteral); + } + source.next(); + setState(normal); + return "error"; + } + + + var wellKnownWords = (function() { + var wkw = {}; + function setType(t) { + return function () { + for (var i = 0; i < arguments.length; i++) + wkw[arguments[i]] = t; + } + } + + setType("keyword")( + "case", "class", "data", "default", "deriving", "do", "else", "foreign", + "if", "import", "in", "infix", "infixl", "infixr", "instance", "let", + "module", "newtype", "of", "then", "type", "where", "_"); + + setType("keyword")( + "\.\.", ":", "::", "=", "\\", "\"", "<-", "->", "@", "~", "=>"); + + setType("builtin")( + "!!", "$!", "$", "&&", "+", "++", "-", ".", "/", "/=", "<", "<=", "=<<", + "==", ">", ">=", ">>", ">>=", "^", "^^", "||", "*", "**"); + + setType("builtin")( + "Bool", "Bounded", "Char", "Double", "EQ", "Either", "Enum", "Eq", + "False", "FilePath", "Float", "Floating", "Fractional", "Functor", "GT", + "IO", "IOError", "Int", "Integer", "Integral", "Just", "LT", "Left", + "Maybe", "Monad", "Nothing", "Num", "Ord", "Ordering", "Rational", "Read", + "ReadS", "Real", "RealFloat", "RealFrac", "Right", "Show", "ShowS", + "String", "True"); + + setType("builtin")( + "abs", "acos", "acosh", "all", "and", "any", "appendFile", "asTypeOf", + "asin", "asinh", "atan", "atan2", "atanh", "break", "catch", "ceiling", + "compare", "concat", "concatMap", "const", "cos", "cosh", "curry", + "cycle", "decodeFloat", "div", "divMod", "drop", "dropWhile", "either", + "elem", "encodeFloat", "enumFrom", "enumFromThen", "enumFromThenTo", + "enumFromTo", "error", "even", "exp", "exponent", "fail", "filter", + "flip", "floatDigits", "floatRadix", "floatRange", "floor", "fmap", + "foldl", "foldl1", "foldr", "foldr1", "fromEnum", "fromInteger", + "fromIntegral", "fromRational", "fst", "gcd", "getChar", "getContents", + "getLine", "head", "id", "init", "interact", "ioError", "isDenormalized", + "isIEEE", "isInfinite", "isNaN", "isNegativeZero", "iterate", "last", + "lcm", "length", "lex", "lines", "log", "logBase", "lookup", "map", + "mapM", "mapM_", "max", "maxBound", "maximum", "maybe", "min", "minBound", + "minimum", "mod", "negate", "not", "notElem", "null", "odd", "or", + "otherwise", "pi", "pred", "print", "product", "properFraction", + "putChar", "putStr", "putStrLn", "quot", "quotRem", "read", "readFile", + "readIO", "readList", "readLn", "readParen", "reads", "readsPrec", + "realToFrac", "recip", "rem", "repeat", "replicate", "return", "reverse", + "round", "scaleFloat", "scanl", "scanl1", "scanr", "scanr1", "seq", + "sequence", "sequence_", "show", "showChar", "showList", "showParen", + "showString", "shows", "showsPrec", "significand", "signum", "sin", + "sinh", "snd", "span", "splitAt", "sqrt", "subtract", "succ", "sum", + "tail", "take", "takeWhile", "tan", "tanh", "toEnum", "toInteger", + "toRational", "truncate", "uncurry", "undefined", "unlines", "until", + "unwords", "unzip", "unzip3", "userError", "words", "writeFile", "zip", + "zip3", "zipWith", "zipWith3"); + + return wkw; + })(); + + + + return { + startState: function () { return { f: normal }; }, + copyState: function (s) { return { f: s.f }; }, + + token: function(stream, state) { + var t = state.f(stream, function(s) { state.f = s; }); + var w = stream.current(); + return (w in wellKnownWords) ? wellKnownWords[w] : t; + } + }; + +}); + +CodeMirror.defineMIME("text/x-haskell", "haskell"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/haskell/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/haskell/index.html new file mode 100644 index 00000000..15706e71 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/haskell/index.html @@ -0,0 +1,60 @@ + + + + CodeMirror: Haskell mode + + + + + + + + +

    CodeMirror: Haskell mode

    + +
    + + + +

    MIME types defined: text/x-haskell.

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/htmlembedded/htmlembedded.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/htmlembedded/htmlembedded.js new file mode 100644 index 00000000..08e170ea --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/htmlembedded/htmlembedded.js @@ -0,0 +1,68 @@ +CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { + + //config settings + var scriptStartRegex = parserConfig.scriptStartRegex || /^<%/i, + scriptEndRegex = parserConfig.scriptEndRegex || /^%>/i; + + //inner modes + var scriptingMode, htmlMixedMode; + + //tokenizer when in html mode + function htmlDispatch(stream, state) { + if (stream.match(scriptStartRegex, false)) { + state.token=scriptingDispatch; + return scriptingMode.token(stream, state.scriptState); + } + else + return htmlMixedMode.token(stream, state.htmlState); + } + + //tokenizer when in scripting mode + function scriptingDispatch(stream, state) { + if (stream.match(scriptEndRegex, false)) { + state.token=htmlDispatch; + return htmlMixedMode.token(stream, state.htmlState); + } + else + return scriptingMode.token(stream, state.scriptState); + } + + + return { + startState: function() { + scriptingMode = scriptingMode || CodeMirror.getMode(config, parserConfig.scriptingModeSpec); + htmlMixedMode = htmlMixedMode || CodeMirror.getMode(config, "htmlmixed"); + return { + token : parserConfig.startOpen ? scriptingDispatch : htmlDispatch, + htmlState : htmlMixedMode.startState(), + scriptState : scriptingMode.startState() + } + }, + + token: function(stream, state) { + return state.token(stream, state); + }, + + indent: function(state, textAfter) { + if (state.token == htmlDispatch) + return htmlMixedMode.indent(state.htmlState, textAfter); + else + return scriptingMode.indent(state.scriptState, textAfter); + }, + + copyState: function(state) { + return { + token : state.token, + htmlState : CodeMirror.copyState(htmlMixedMode, state.htmlState), + scriptState : CodeMirror.copyState(scriptingMode, state.scriptState) + } + }, + + + electricChars: "/{}:" + } +}); + +CodeMirror.defineMIME("application/x-ejs", { name: "htmlembedded", scriptingModeSpec:"javascript"}); +CodeMirror.defineMIME("application/x-aspx", { name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); +CodeMirror.defineMIME("application/x-jsp", { name: "htmlembedded", scriptingModeSpec:"text/x-java"}); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/htmlembedded/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/htmlembedded/index.html new file mode 100644 index 00000000..c1374e58 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/htmlembedded/index.html @@ -0,0 +1,49 @@ + + + + CodeMirror: Html Embedded Scripts mode + + + + + + + + + + + +

    CodeMirror: Html Embedded Scripts mode

    + +
    + + + +

    Mode for html embedded scripts like JSP and ASP.NET. Depends on HtmlMixed which in turn depends on + JavaScript, CSS and XML.
    Other dependancies include those of the scriping language chosen.

    + +

    MIME types defined: application/x-aspx (ASP.NET), + application/x-ejs (Embedded Javascript), application/x-jsp (JavaServer Pages)

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/htmlmixed/htmlmixed.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/htmlmixed/htmlmixed.js new file mode 100644 index 00000000..c66a6583 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/htmlmixed/htmlmixed.js @@ -0,0 +1,83 @@ +CodeMirror.defineMode("htmlmixed", function(config, parserConfig) { + var htmlMode = CodeMirror.getMode(config, {name: "xml", htmlMode: true}); + var jsMode = CodeMirror.getMode(config, "javascript"); + var cssMode = CodeMirror.getMode(config, "css"); + + function html(stream, state) { + var style = htmlMode.token(stream, state.htmlState); + if (style == "tag" && stream.current() == ">" && state.htmlState.context) { + if (/^script$/i.test(state.htmlState.context.tagName)) { + state.token = javascript; + state.localState = jsMode.startState(htmlMode.indent(state.htmlState, "")); + state.mode = "javascript"; + } + else if (/^style$/i.test(state.htmlState.context.tagName)) { + state.token = css; + state.localState = cssMode.startState(htmlMode.indent(state.htmlState, "")); + state.mode = "css"; + } + } + return style; + } + function maybeBackup(stream, pat, style) { + var cur = stream.current(); + var close = cur.search(pat); + if (close > -1) stream.backUp(cur.length - close); + return style; + } + function javascript(stream, state) { + if (stream.match(/^<\/\s*script\s*>/i, false)) { + state.token = html; + state.localState = null; + state.mode = "html"; + return html(stream, state); + } + return maybeBackup(stream, /<\/\s*script\s*>/, + jsMode.token(stream, state.localState)); + } + function css(stream, state) { + if (stream.match(/^<\/\s*style\s*>/i, false)) { + state.token = html; + state.localState = null; + state.mode = "html"; + return html(stream, state); + } + return maybeBackup(stream, /<\/\s*style\s*>/, + cssMode.token(stream, state.localState)); + } + + return { + startState: function() { + var state = htmlMode.startState(); + return {token: html, localState: null, mode: "html", htmlState: state}; + }, + + copyState: function(state) { + if (state.localState) + var local = CodeMirror.copyState(state.token == css ? cssMode : jsMode, state.localState); + return {token: state.token, localState: local, mode: state.mode, + htmlState: CodeMirror.copyState(htmlMode, state.htmlState)}; + }, + + token: function(stream, state) { + return state.token(stream, state); + }, + + indent: function(state, textAfter) { + if (state.token == html || /^\s*<\//.test(textAfter)) + return htmlMode.indent(state.htmlState, textAfter); + else if (state.token == javascript) + return jsMode.indent(state.localState, textAfter); + else + return cssMode.indent(state.localState, textAfter); + }, + + compareStates: function(a, b) { + return htmlMode.compareStates(a.htmlState, b.htmlState); + }, + + electricChars: "/{}:" + } +}); + +CodeMirror.defineMIME("text/html", "htmlmixed"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/htmlmixed/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/htmlmixed/index.html new file mode 100644 index 00000000..63fc4120 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/htmlmixed/index.html @@ -0,0 +1,51 @@ + + + + CodeMirror: HTML mixed mode + + + + + + + + + + +

    CodeMirror: HTML mixed mode

    +
    + + +

    The HTML mixed mode depends on the XML, JavaScript, and CSS modes.

    + +

    MIME types defined: text/html + (redefined, only takes effect if you load this parser after the + XML parser).

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/javascript/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/javascript/index.html new file mode 100644 index 00000000..c3ab91dc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/javascript/index.html @@ -0,0 +1,77 @@ + + + + CodeMirror: JavaScript mode + + + + + + + +

    CodeMirror: JavaScript mode

    + +
    + + + +

    JavaScript mode supports a single configuration + option, json, which will set the mode to expect JSON + data rather than a JavaScript program.

    + +

    MIME types defined: text/javascript, application/json.

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/javascript/javascript.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/javascript/javascript.js new file mode 100644 index 00000000..462f4863 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/javascript/javascript.js @@ -0,0 +1,360 @@ +CodeMirror.defineMode("javascript", function(config, parserConfig) { + var indentUnit = config.indentUnit; + var jsonMode = parserConfig.json; + + // Tokenizer + + var keywords = function(){ + function kw(type) {return {type: type, style: "keyword"};} + var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); + var operator = kw("operator"), atom = {type: "atom", style: "atom"}; + return { + "if": A, "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, + "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, + "var": kw("var"), "const": kw("var"), "let": kw("var"), + "function": kw("function"), "catch": kw("catch"), + "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), + "in": operator, "typeof": operator, "instanceof": operator, + "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom + }; + }(); + + var isOperatorChar = /[+\-*&%=<>!?|]/; + + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + + function nextUntilUnescaped(stream, end) { + var escaped = false, next; + while ((next = stream.next()) != null) { + if (next == end && !escaped) + return false; + escaped = !escaped && next == "\\"; + } + return escaped; + } + + // Used as scratch variables to communicate multiple values without + // consing up tons of objects. + var type, content; + function ret(tp, style, cont) { + type = tp; content = cont; + return style; + } + + function jsTokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") + return chain(stream, state, jsTokenString(ch)); + else if (/[\[\]{}\(\),;\:\.]/.test(ch)) + return ret(ch); + else if (ch == "0" && stream.eat(/x/i)) { + stream.eatWhile(/[\da-f]/i); + return ret("number", "number"); + } + else if (/\d/.test(ch)) { + stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); + return ret("number", "number"); + } + else if (ch == "/") { + if (stream.eat("*")) { + return chain(stream, state, jsTokenComment); + } + else if (stream.eat("/")) { + stream.skipToEnd(); + return ret("comment", "comment"); + } + else if (state.reAllowed) { + nextUntilUnescaped(stream, "/"); + stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozilla + return ret("regexp", "string-2"); + } + else { + stream.eatWhile(isOperatorChar); + return ret("operator", null, stream.current()); + } + } + else if (ch == "#") { + stream.skipToEnd(); + return ret("error", "error"); + } + else if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return ret("operator", null, stream.current()); + } + else { + stream.eatWhile(/[\w\$_]/); + var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; + return (known && state.kwAllowed) ? ret(known.type, known.style, word) : + ret("variable", "variable", word); + } + } + + function jsTokenString(quote) { + return function(stream, state) { + if (!nextUntilUnescaped(stream, quote)) + state.tokenize = jsTokenBase; + return ret("string", "string"); + }; + } + + function jsTokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = jsTokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return ret("comment", "comment"); + } + + // Parser + + var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true}; + + function JSLexical(indented, column, type, align, prev, info) { + this.indented = indented; + this.column = column; + this.type = type; + this.prev = prev; + this.info = info; + if (align != null) this.align = align; + } + + function inScope(state, varname) { + for (var v = state.localVars; v; v = v.next) + if (v.name == varname) return true; + } + + function parseJS(state, style, type, content, stream) { + var cc = state.cc; + // Communicate our context to the combinators. + // (Less wasteful than consing up a hundred closures on every call.) + cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; + + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = true; + + while(true) { + var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; + if (combinator(type, content)) { + while(cc.length && cc[cc.length - 1].lex) + cc.pop()(); + if (cx.marked) return cx.marked; + if (type == "variable" && inScope(state, content)) return "variable-2"; + return style; + } + } + } + + // Combinator utils + + var cx = {state: null, column: null, marked: null, cc: null}; + function pass() { + for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); + } + function cont() { + pass.apply(null, arguments); + return true; + } + function register(varname) { + var state = cx.state; + if (state.context) { + cx.marked = "def"; + for (var v = state.localVars; v; v = v.next) + if (v.name == varname) return; + state.localVars = {name: varname, next: state.localVars}; + } + } + + // Combinators + + var defaultVars = {name: "this", next: {name: "arguments"}}; + function pushcontext() { + if (!cx.state.context) cx.state.localVars = defaultVars; + cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; + } + function popcontext() { + cx.state.localVars = cx.state.context.vars; + cx.state.context = cx.state.context.prev; + } + function pushlex(type, info) { + var result = function() { + var state = cx.state; + state.lexical = new JSLexical(state.indented, cx.stream.column(), type, null, state.lexical, info) + }; + result.lex = true; + return result; + } + function poplex() { + var state = cx.state; + if (state.lexical.prev) { + if (state.lexical.type == ")") + state.indented = state.lexical.indented; + state.lexical = state.lexical.prev; + } + } + poplex.lex = true; + + function expect(wanted) { + return function expecting(type) { + if (type == wanted) return cont(); + else if (wanted == ";") return pass(); + else return cont(arguments.callee); + }; + } + + function statement(type) { + if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex); + if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); + if (type == "keyword b") return cont(pushlex("form"), statement, poplex); + if (type == "{") return cont(pushlex("}"), block, poplex); + if (type == ";") return cont(); + if (type == "function") return cont(functiondef); + if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), + poplex, statement, poplex); + if (type == "variable") return cont(pushlex("stat"), maybelabel); + if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), + block, poplex, poplex); + if (type == "case") return cont(expression, expect(":")); + if (type == "default") return cont(expect(":")); + if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), + statement, poplex, popcontext); + return pass(pushlex("stat"), expression, expect(";"), poplex); + } + function expression(type) { + if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator); + if (type == "function") return cont(functiondef); + if (type == "keyword c") return cont(maybeexpression); + if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator); + if (type == "operator") return cont(expression); + if (type == "[") return cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator); + if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator); + return cont(); + } + function maybeexpression(type) { + if (type.match(/[;\}\)\],]/)) return pass(); + return pass(expression); + } + + function maybeoperator(type, value) { + if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator); + if (type == "operator") return cont(expression); + if (type == ";") return; + if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator); + if (type == ".") return cont(property, maybeoperator); + if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator); + } + function maybelabel(type) { + if (type == ":") return cont(poplex, statement); + return pass(maybeoperator, expect(";"), poplex); + } + function property(type) { + if (type == "variable") {cx.marked = "property"; return cont();} + } + function objprop(type) { + if (type == "variable") cx.marked = "property"; + if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression); + } + function commasep(what, end) { + function proceed(type) { + if (type == ",") return cont(what, proceed); + if (type == end) return cont(); + return cont(expect(end)); + } + return function commaSeparated(type) { + if (type == end) return cont(); + else return pass(what, proceed); + }; + } + function block(type) { + if (type == "}") return cont(); + return pass(statement, block); + } + function vardef1(type, value) { + if (type == "variable"){register(value); return cont(vardef2);} + return cont(); + } + function vardef2(type, value) { + if (value == "=") return cont(expression, vardef2); + if (type == ",") return cont(vardef1); + } + function forspec1(type) { + if (type == "var") return cont(vardef1, forspec2); + if (type == ";") return pass(forspec2); + if (type == "variable") return cont(formaybein); + return pass(forspec2); + } + function formaybein(type, value) { + if (value == "in") return cont(expression); + return cont(maybeoperator, forspec2); + } + function forspec2(type, value) { + if (type == ";") return cont(forspec3); + if (value == "in") return cont(expression); + return cont(expression, expect(";"), forspec3); + } + function forspec3(type) { + if (type != ")") cont(expression); + } + function functiondef(type, value) { + if (type == "variable") {register(value); return cont(functiondef);} + if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, statement, popcontext); + } + function funarg(type, value) { + if (type == "variable") {register(value); return cont();} + } + + // Interface + + return { + startState: function(basecolumn) { + return { + tokenize: jsTokenBase, + reAllowed: true, + kwAllowed: true, + cc: [], + lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), + localVars: parserConfig.localVars, + context: parserConfig.localVars && {vars: parserConfig.localVars}, + indented: 0 + }; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = false; + state.indented = stream.indentation(); + } + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + if (type == "comment") return style; + state.reAllowed = !!(type == "operator" || type == "keyword c" || type.match(/^[\[{}\(,;:]$/)); + state.kwAllowed = type != '.'; + return parseJS(state, style, type, content, stream); + }, + + indent: function(state, textAfter) { + if (state.tokenize != jsTokenBase) return 0; + var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, + type = lexical.type, closing = firstChar == type; + if (type == "vardef") return lexical.indented + 4; + else if (type == "form" && firstChar == "{") return lexical.indented; + else if (type == "stat" || type == "form") return lexical.indented + indentUnit; + else if (lexical.info == "switch" && !closing) + return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); + else if (lexical.align) return lexical.column + (closing ? 0 : 1); + else return lexical.indented + (closing ? 0 : indentUnit); + }, + + electricChars: ":{}" + }; +}); + +CodeMirror.defineMIME("text/javascript", "javascript"); +CodeMirror.defineMIME("application/json", {name: "javascript", json: true}); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/jinja2/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/jinja2/index.html new file mode 100644 index 00000000..021a2829 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/jinja2/index.html @@ -0,0 +1,37 @@ + + + + CodeMirror: Jinja2 mode + + + + + + + +

    CodeMirror: Jinja2 mode

    +
    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/jinja2/jinja2.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/jinja2/jinja2.js new file mode 100644 index 00000000..7c14dc92 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/jinja2/jinja2.js @@ -0,0 +1,51 @@ +CodeMirror.defineMode("jinja2", function(config, parserConf) { + var keywords = ["block", "endblock", "for", "endfor", "in", "true", "false", + "loop", "none", "self", "super", "if", "as", "not", "and", + "else", "import", "with", "without", "context", 'extends', 'macro', 'endmacro']; + + var blocks = ['block', 'for', 'if', 'import', 'with', 'macro', 'raw', 'call', 'filter']; + // TODO raw should stop highlighting until the endraw + var standalone = ['extends', 'import', 'else', 'elif', 'from', 'include', 'set']; + var special = ['in', 'is', 'true', 'false', 'loop', 'none', 'self', 'super', + 'as', 'not', 'and', 'if', 'else', 'without', 'with', + 'context', 'ignore', 'missing', 'import']; + // TODO list builtin filters and tests + + keywords = new RegExp("^((" + keywords.join(")|(") + "))\\b"); + + function tokenBase (stream, state) { + var ch = stream.next(); + if (ch == "{") { + if (ch = stream.eat(/\{|%|#/)) { + stream.eat("-"); + state.tokenize = inTag(ch); + return "tag"; + } + } + } + function inTag (close) { + if (close == "{") { + close = "}"; + } + return function (stream, state) { + var ch = stream.next(); + if ((ch == close || (ch == "-" && stream.eat(close))) + && stream.eat("}")) { + state.tokenize = tokenBase; + return "tag"; + } + if (stream.match(keywords)) { + return "keyword"; + } + return close == "#" ? "comment" : "string"; + }; + } + return { + startState: function () { + return {tokenize: tokenBase}; + }, + token: function (stream, state) { + return state.tokenize(stream, state); + } + }; +}); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/less/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/less/index.html new file mode 100644 index 00000000..f7705205 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/less/index.html @@ -0,0 +1,603 @@ + + + + CodeMirror: LESS mode + + + + + + + + + +

    CodeMirror: LESS mode

    +
    + + +

    MIME types defined: text/less.

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/less/less.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/less/less.js new file mode 100644 index 00000000..1c20bd81 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/less/less.js @@ -0,0 +1,218 @@ +/* +LESS mode - http://www.lesscss.org/ +Ported to CodeMirror by Peter Kroon +*/ + +CodeMirror.defineMode("css", function(config) { + var indentUnit = config.indentUnit, type; + function ret(style, tp) {type = tp; return style;} + //html5 tags + var tags = ["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","command","datalist","dd","del","details","dfn","dir","div","dl","dt","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","keygen","kbd","label","legend","li","link","map","mark","menu","meta","meter","nav","noframes","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strike","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr"]; + + function inTagsArray(val){ + for(var i=0; i*\/]/.test(ch)) {//removed . dot character original was [,.+>*\/] + return ret(null, "select-op"); + } + else if (/[;{}:\[\]()]/.test(ch)) { //added () char for lesscss original was [;{}:\[\]] + if(ch == ":"){ + stream.eatWhile(/[active|hover|link|visited]/); + if( stream.current().match(/active|hover|link|visited/)){ + return ret("tag", "tag"); + }else{ + return ret(null, ch); + } + }else{ + return ret(null, ch); + } + } + else if (ch == ".") { // lesscss + stream.eatWhile(/[\a-zA-Z0-9\-_]/); + return ret("tag", "tag"); + } + else if (ch == "#") { // lesscss + //we don't eat white-space, we want the hex color and or id only + stream.eatWhile(/[A-Za-z0-9]/); + //check if there is a proper hex color length e.g. #eee || #eeeEEE + if(stream.current().length ===4 || stream.current().length ===7){ + if(stream.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,false) != null){//is there a valid hex color value present in the current stream + //when not a valid hex value, parse as id + if(stream.current().substring(1) != stream.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,false))return ret("atom", "tag"); + //eat white-space + stream.eatSpace(); + //when hex value declaration doesn't end with [;,] but is does with a slash/cc comment treat it as an id, just like the other hex values that don't end with[;,] + if( /[\/<>.(){!$%^&*_\-\\?=+\|#'~`]/.test(stream.peek()) )return ret("atom", "tag"); + //#time { color: #aaa } + else if(stream.peek() == "}" )return ret("number", "unit"); + //we have a valid hex color value, parse as id whenever an element/class is defined after the hex(id) value e.g. #eee aaa || #eee .aaa + else if( /[a-zA-Z\\]/.test(stream.peek()) )return ret("atom", "tag"); + //when a hex value is on the end of a line, parse as id + else if(stream.eol())return ret("atom", "tag"); + //default + else return ret("number", "unit"); + }else{//when not a valid hexvalue in the current stream e.g. #footer + stream.eatWhile(/[\w\\\-]/); + return ret("atom", "tag"); + } + }else{ + stream.eatWhile(/[\w\\\-]/); + return ret("atom", "tag"); + } + } + else if (ch == "&") { + stream.eatWhile(/[\w\-]/); + return ret(null, ch); + } + else if (ch == "&") { + stream.eatWhile(/[\w\-]/); + return ret(null, ch); + } + else { + stream.eatWhile(/[\w\\\-_.%]/); + if( stream.peek().match(/\(/) != null ){// lesscss + stream.eatWhile(/[a-zA-Z\s]/); + if(stream.peek() == "(")return ret(null, ch); + }else if( stream.current().match(/\-\d|\-.\d/) ){ // lesscss match e.g.: -5px -0.4 etc... + return ret("number", "unit"); + }else if( inTagsArray(stream.current()) ){ // lesscss match html tags + return ret("tag", "tag"); + }else if( /\/|\)/.test(stream.peek() || stream.eol() || (stream.eatSpace() && stream.peek() == ")")) && stream.current().indexOf(".") !== -1){ + return ret("string", "string");//let url(/images/logo.png) without quotes return as string + }else{ + return ret("variable", "variable"); + } + } + + } + + function tokenSComment(stream, state) {// SComment = Slash comment + stream.skipToEnd(); + state.tokenize = tokenBase; + return ret("comment", "comment"); + } + + function tokenCComment(stream, state) { + var maybeEnd = false, ch; + while ((ch = stream.next()) != null) { + if (maybeEnd && ch == "/") { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return ret("comment", "comment"); + } + + function tokenSGMLComment(stream, state) { + var dashes = 0, ch; + while ((ch = stream.next()) != null) { + if (dashes >= 2 && ch == ">") { + state.tokenize = tokenBase; + break; + } + dashes = (ch == "-") ? dashes + 1 : 0; + } + return ret("comment", "comment"); + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) + break; + escaped = !escaped && ch == "\\"; + } + if (!escaped) state.tokenize = tokenBase; + return ret("string", "string"); + }; + } + + return { + startState: function(base) { + return {tokenize: tokenBase, + baseIndent: base || 0, + stack: []}; + }, + + token: function(stream, state) { + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + + var context = state.stack[state.stack.length-1]; + if (type == "hash" && context == "rule") style = "atom"; + else if (style == "variable") { + if (context == "rule") style = null; //"tag" + else if (!context || context == "@media{"){ + style = stream.current() == "when" ? "variable" : + stream.string.match(/#/g) != undefined ? null : + /[\s,|\s\)]/.test(stream.peek()) ? "tag" : null; + } + } + + if (context == "rule" && /^[\{\};]$/.test(type)) + state.stack.pop(); + if (type == "{") { + if (context == "@media") state.stack[state.stack.length-1] = "@media{"; + else state.stack.push("{"); + } + else if (type == "}") state.stack.pop(); + else if (type == "@media") state.stack.push("@media"); + else if (context == "{" && type != "comment") state.stack.push("rule"); + return style; + }, + + indent: function(state, textAfter) { + var n = state.stack.length; + if (/^\}/.test(textAfter)) + n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1; + return state.baseIndent + n * indentUnit; + }, + + electricChars: "}" + }; +}); + +CodeMirror.defineMIME("text/css", "css"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/lua/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/lua/index.html new file mode 100644 index 00000000..600ddb0e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/lua/index.html @@ -0,0 +1,72 @@ + + + + CodeMirror: Lua mode + + + + + + + + +

    CodeMirror: Lua mode

    +
    + + +

    Loosely based on Franciszek + Wawrzak's CodeMirror + 1 mode. One configuration parameter is + supported, specials, to which you can provide an + array of strings to have those identifiers highlighted with + the lua-special style.

    +

    MIME types defined: text/x-lua.

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/lua/lua.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/lua/lua.js new file mode 100644 index 00000000..60e84a92 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/lua/lua.js @@ -0,0 +1,140 @@ +// LUA mode. Ported to CodeMirror 2 from Franciszek Wawrzak's +// CodeMirror 1 mode. +// highlights keywords, strings, comments (no leveling supported! ("[==[")), tokens, basic indenting + +CodeMirror.defineMode("lua", function(config, parserConfig) { + var indentUnit = config.indentUnit; + + function prefixRE(words) { + return new RegExp("^(?:" + words.join("|") + ")", "i"); + } + function wordRE(words) { + return new RegExp("^(?:" + words.join("|") + ")$", "i"); + } + var specials = wordRE(parserConfig.specials || []); + + // long list of standard functions from lua manual + var builtins = wordRE([ + "_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load", + "loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require", + "select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall", + + "coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield", + + "debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable", + "debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable", + "debug.setupvalue","debug.traceback", + + "close","flush","lines","read","seek","setvbuf","write", + + "io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin", + "io.stdout","io.tmpfile","io.type","io.write", + + "math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg", + "math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max", + "math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh", + "math.sqrt","math.tan","math.tanh", + + "os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale", + "os.time","os.tmpname", + + "package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload", + "package.seeall", + + "string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub", + "string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper", + + "table.concat","table.insert","table.maxn","table.remove","table.sort" + ]); + var keywords = wordRE(["and","break","elseif","false","nil","not","or","return", + "true","function", "end", "if", "then", "else", "do", + "while", "repeat", "until", "for", "in", "local" ]); + + var indentTokens = wordRE(["function", "if","repeat","do", "\\(", "{"]); + var dedentTokens = wordRE(["end", "until", "\\)", "}"]); + var dedentPartial = prefixRE(["end", "until", "\\)", "}", "else", "elseif"]); + + function readBracket(stream) { + var level = 0; + while (stream.eat("=")) ++level; + stream.eat("["); + return level; + } + + function normal(stream, state) { + var ch = stream.next(); + if (ch == "-" && stream.eat("-")) { + if (stream.eat("[")) + return (state.cur = bracketed(readBracket(stream), "comment"))(stream, state); + stream.skipToEnd(); + return "comment"; + } + if (ch == "\"" || ch == "'") + return (state.cur = string(ch))(stream, state); + if (ch == "[" && /[\[=]/.test(stream.peek())) + return (state.cur = bracketed(readBracket(stream), "string"))(stream, state); + if (/\d/.test(ch)) { + stream.eatWhile(/[\w.%]/); + return "number"; + } + if (/[\w_]/.test(ch)) { + stream.eatWhile(/[\w\\\-_.]/); + return "variable"; + } + return null; + } + + function bracketed(level, style) { + return function(stream, state) { + var curlev = null, ch; + while ((ch = stream.next()) != null) { + if (curlev == null) {if (ch == "]") curlev = 0;} + else if (ch == "=") ++curlev; + else if (ch == "]" && curlev == level) { state.cur = normal; break; } + else curlev = null; + } + return style; + }; + } + + function string(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) break; + escaped = !escaped && ch == "\\"; + } + if (!escaped) state.cur = normal; + return "string"; + }; + } + + return { + startState: function(basecol) { + return {basecol: basecol || 0, indentDepth: 0, cur: normal}; + }, + + token: function(stream, state) { + if (stream.eatSpace()) return null; + var style = state.cur(stream, state); + var word = stream.current(); + if (style == "variable") { + if (keywords.test(word)) style = "keyword"; + else if (builtins.test(word)) style = "builtin"; + else if (specials.test(word)) style = "variable-2"; + } + if ((style != "comment") && (style != "string")){ + if (indentTokens.test(word)) ++state.indentDepth; + else if (dedentTokens.test(word)) --state.indentDepth; + } + return style; + }, + + indent: function(state, textAfter) { + var closing = dedentPartial.test(textAfter); + return state.basecol + indentUnit * (state.indentDepth - (closing ? 1 : 0)); + } + }; +}); + +CodeMirror.defineMIME("text/x-lua", "lua"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/markdown/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/markdown/index.html new file mode 100644 index 00000000..cae8df44 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/markdown/index.html @@ -0,0 +1,338 @@ + + + + CodeMirror: Markdown mode + + + + + + + + +

    CodeMirror: Markdown mode

    + + +
    + + + +

    MIME types defined: text/x-markdown.

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/markdown/markdown.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/markdown/markdown.js new file mode 100644 index 00000000..af95753e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/markdown/markdown.js @@ -0,0 +1,245 @@ +CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { + + var htmlMode = CodeMirror.getMode(cmCfg, { name: 'xml', htmlMode: true }); + + var header = 'header' + , code = 'comment' + , quote = 'quote' + , list = 'string' + , hr = 'hr' + , linktext = 'link' + , linkhref = 'string' + , em = 'em' + , strong = 'strong' + , emstrong = 'emstrong'; + + var hrRE = /^([*\-=_])(?:\s*\1){2,}\s*$/ + , ulRE = /^[*\-+]\s+/ + , olRE = /^[0-9]+\.\s+/ + , headerRE = /^(?:\={3,}|-{3,})$/ + , textRE = /^[^\[*_\\<>`]+/; + + function switchInline(stream, state, f) { + state.f = state.inline = f; + return f(stream, state); + } + + function switchBlock(stream, state, f) { + state.f = state.block = f; + return f(stream, state); + } + + + // Blocks + + function blankLine(state) { + // Reset EM state + state.em = false; + // Reset STRONG state + state.strong = false; + return null; + } + + function blockNormal(stream, state) { + var match; + if (state.indentationDiff >= 4) { + state.indentation -= state.indentationDiff; + stream.skipToEnd(); + return code; + } else if (stream.eatSpace()) { + return null; + } else if (stream.peek() === '#' || stream.match(headerRE)) { + state.header = true; + } else if (stream.eat('>')) { + state.indentation++; + state.quote = true; + } else if (stream.peek() === '[') { + return switchInline(stream, state, footnoteLink); + } else if (stream.match(hrRE, true)) { + return hr; + } else if (match = stream.match(ulRE, true) || stream.match(olRE, true)) { + state.indentation += match[0].length; + return list; + } + + return switchInline(stream, state, state.inline); + } + + function htmlBlock(stream, state) { + var style = htmlMode.token(stream, state.htmlState); + if (style === 'tag' && state.htmlState.type !== 'openTag' && !state.htmlState.context) { + state.f = inlineNormal; + state.block = blockNormal; + } + return style; + } + + + // Inline + function getType(state) { + var styles = []; + + if (state.strong) { styles.push(state.em ? emstrong : strong); } + else if (state.em) { styles.push(em); } + + if (state.header) { styles.push(header); } + if (state.quote) { styles.push(quote); } + + return styles.length ? styles.join(' ') : null; + } + + function handleText(stream, state) { + if (stream.match(textRE, true)) { + return getType(state); + } + return undefined; + } + + function inlineNormal(stream, state) { + var style = state.text(stream, state) + if (typeof style !== 'undefined') + return style; + + var ch = stream.next(); + + if (ch === '\\') { + stream.next(); + return getType(state); + } + if (ch === '`') { + return switchInline(stream, state, inlineElement(code, '`')); + } + if (ch === '[') { + return switchInline(stream, state, linkText); + } + if (ch === '<' && stream.match(/^\w/, false)) { + stream.backUp(1); + return switchBlock(stream, state, htmlBlock); + } + + var t = getType(state); + if (ch === '*' || ch === '_') { + if (stream.eat(ch)) { + return (state.strong = !state.strong) ? getType(state) : t; + } + return (state.em = !state.em) ? getType(state) : t; + } + + return getType(state); + } + + function linkText(stream, state) { + while (!stream.eol()) { + var ch = stream.next(); + if (ch === '\\') stream.next(); + if (ch === ']') { + state.inline = state.f = linkHref; + return linktext; + } + } + return linktext; + } + + function linkHref(stream, state) { + stream.eatSpace(); + var ch = stream.next(); + if (ch === '(' || ch === '[') { + return switchInline(stream, state, inlineElement(linkhref, ch === '(' ? ')' : ']')); + } + return 'error'; + } + + function footnoteLink(stream, state) { + if (stream.match(/^[^\]]*\]:/, true)) { + state.f = footnoteUrl; + return linktext; + } + return switchInline(stream, state, inlineNormal); + } + + function footnoteUrl(stream, state) { + stream.eatSpace(); + stream.match(/^[^\s]+/, true); + state.f = state.inline = inlineNormal; + return linkhref; + } + + function inlineRE(endChar) { + if (!inlineRE[endChar]) { + // match any not-escaped-non-endChar and any escaped char + // then match endChar or eol + inlineRE[endChar] = new RegExp('^(?:[^\\\\\\' + endChar + ']|\\\\.)*(?:\\' + endChar + '|$)'); + } + return inlineRE[endChar]; + } + + function inlineElement(type, endChar, next) { + next = next || inlineNormal; + return function(stream, state) { + stream.match(inlineRE(endChar)); + state.inline = state.f = next; + return type; + }; + } + + return { + startState: function() { + return { + f: blockNormal, + + block: blockNormal, + htmlState: htmlMode.startState(), + indentation: 0, + + inline: inlineNormal, + text: handleText, + em: false, + strong: false, + header: false, + quote: false + }; + }, + + copyState: function(s) { + return { + f: s.f, + + block: s.block, + htmlState: CodeMirror.copyState(htmlMode, s.htmlState), + indentation: s.indentation, + + inline: s.inline, + text: s.text, + em: s.em, + strong: s.strong, + header: s.header, + quote: s.quote + }; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (stream.match(/^\s*$/, true)) { return blankLine(state); } + + // Reset state.header + state.header = false; + // Reset state.quote + state.quote = false; + + state.f = state.block; + var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, ' ').length; + state.indentationDiff = indentation - state.indentation; + state.indentation = indentation; + if (indentation > 0) { return null; } + } + return state.f(stream, state); + }, + + blankLine: blankLine, + + getType: getType + }; + +}); + +CodeMirror.defineMIME("text/x-markdown", "markdown"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/mysql/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/mysql/index.html new file mode 100644 index 00000000..006918c0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/mysql/index.html @@ -0,0 +1,41 @@ + + + + CodeMirror: MySQL mode + + + + + + + +

    CodeMirror: MySQL mode

    +
    + + +

    MIME types defined: text/x-mysql.

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/mysql/mysql.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/mysql/mysql.js new file mode 100644 index 00000000..dca5b0f6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/mysql/mysql.js @@ -0,0 +1,188 @@ +/* + * MySQL Mode for CodeMirror 2 by MySQL-Tools + * @author James Thorne (partydroid) + * @link http://github.com/partydroid/MySQL-Tools + * @link http://mysqltools.org + * @version 02/Jan/2012 +*/ +CodeMirror.defineMode("mysql", function(config) { + var indentUnit = config.indentUnit; + var curPunc; + + function wordRegexp(words) { + return new RegExp("^(?:" + words.join("|") + ")$", "i"); + } + var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri", + "isblank", "isliteral", "union", "a"]); + var keywords = wordRegexp([ + ('ACCESSIBLE'),('ALTER'),('AS'),('BEFORE'),('BINARY'),('BY'),('CASE'),('CHARACTER'),('COLUMN'),('CONTINUE'),('CROSS'),('CURRENT_TIMESTAMP'),('DATABASE'),('DAY_MICROSECOND'),('DEC'),('DEFAULT'), + ('DESC'),('DISTINCT'),('DOUBLE'),('EACH'),('ENCLOSED'),('EXIT'),('FETCH'),('FLOAT8'),('FOREIGN'),('GRANT'),('HIGH_PRIORITY'),('HOUR_SECOND'),('IN'),('INNER'),('INSERT'),('INT2'),('INT8'), + ('INTO'),('JOIN'),('KILL'),('LEFT'),('LINEAR'),('LOCALTIME'),('LONG'),('LOOP'),('MATCH'),('MEDIUMTEXT'),('MINUTE_SECOND'),('NATURAL'),('NULL'),('OPTIMIZE'),('OR'),('OUTER'),('PRIMARY'), + ('RANGE'),('READ_WRITE'),('REGEXP'),('REPEAT'),('RESTRICT'),('RIGHT'),('SCHEMAS'),('SENSITIVE'),('SHOW'),('SPECIFIC'),('SQLSTATE'),('SQL_CALC_FOUND_ROWS'),('STARTING'),('TERMINATED'), + ('TINYINT'),('TRAILING'),('UNDO'),('UNLOCK'),('USAGE'),('UTC_DATE'),('VALUES'),('VARCHARACTER'),('WHERE'),('WRITE'),('ZEROFILL'),('ALL'),('AND'),('ASENSITIVE'),('BIGINT'),('BOTH'),('CASCADE'), + ('CHAR'),('COLLATE'),('CONSTRAINT'),('CREATE'),('CURRENT_TIME'),('CURSOR'),('DAY_HOUR'),('DAY_SECOND'),('DECLARE'),('DELETE'),('DETERMINISTIC'),('DIV'),('DUAL'),('ELSEIF'),('EXISTS'),('FALSE'), + ('FLOAT4'),('FORCE'),('FULLTEXT'),('HAVING'),('HOUR_MINUTE'),('IGNORE'),('INFILE'),('INSENSITIVE'),('INT1'),('INT4'),('INTERVAL'),('ITERATE'),('KEYS'),('LEAVE'),('LIMIT'),('LOAD'),('LOCK'), + ('LONGTEXT'),('MASTER_SSL_VERIFY_SERVER_CERT'),('MEDIUMINT'),('MINUTE_MICROSECOND'),('MODIFIES'),('NO_WRITE_TO_BINLOG'),('ON'),('OPTIONALLY'),('OUT'),('PRECISION'),('PURGE'),('READS'), + ('REFERENCES'),('RENAME'),('REQUIRE'),('REVOKE'),('SCHEMA'),('SELECT'),('SET'),('SPATIAL'),('SQLEXCEPTION'),('SQL_BIG_RESULT'),('SSL'),('TABLE'),('TINYBLOB'),('TO'),('TRUE'),('UNIQUE'), + ('UPDATE'),('USING'),('UTC_TIMESTAMP'),('VARCHAR'),('WHEN'),('WITH'),('YEAR_MONTH'),('ADD'),('ANALYZE'),('ASC'),('BETWEEN'),('BLOB'),('CALL'),('CHANGE'),('CHECK'),('CONDITION'),('CONVERT'), + ('CURRENT_DATE'),('CURRENT_USER'),('DATABASES'),('DAY_MINUTE'),('DECIMAL'),('DELAYED'),('DESCRIBE'),('DISTINCTROW'),('DROP'),('ELSE'),('ESCAPED'),('EXPLAIN'),('FLOAT'),('FOR'),('FROM'), + ('GROUP'),('HOUR_MICROSECOND'),('IF'),('INDEX'),('INOUT'),('INT'),('INT3'),('INTEGER'),('IS'),('KEY'),('LEADING'),('LIKE'),('LINES'),('LOCALTIMESTAMP'),('LONGBLOB'),('LOW_PRIORITY'), + ('MEDIUMBLOB'),('MIDDLEINT'),('MOD'),('NOT'),('NUMERIC'),('OPTION'),('ORDER'),('OUTFILE'),('PROCEDURE'),('READ'),('REAL'),('RELEASE'),('REPLACE'),('RETURN'),('RLIKE'),('SECOND_MICROSECOND'), + ('SEPARATOR'),('SMALLINT'),('SQL'),('SQLWARNING'),('SQL_SMALL_RESULT'),('STRAIGHT_JOIN'),('THEN'),('TINYTEXT'),('TRIGGER'),('UNION'),('UNSIGNED'),('USE'),('UTC_TIME'),('VARBINARY'),('VARYING'), + ('WHILE'),('XOR'),('FULL'),('COLUMNS'),('MIN'),('MAX'),('STDEV'),('COUNT') + ]); + var operatorChars = /[*+\-<>=&|]/; + + function tokenBase(stream, state) { + var ch = stream.next(); + curPunc = null; + if (ch == "$" || ch == "?") { + stream.match(/^[\w\d]*/); + return "variable-2"; + } + else if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) { + stream.match(/^[^\s\u00a0>]*>?/); + return "atom"; + } + else if (ch == "\"" || ch == "'") { + state.tokenize = tokenLiteral(ch); + return state.tokenize(stream, state); + } + else if (ch == "`") { + state.tokenize = tokenOpLiteral(ch); + return state.tokenize(stream, state); + } + else if (/[{}\(\),\.;\[\]]/.test(ch)) { + curPunc = ch; + return null; + } + else if (ch == "-") { + ch2 = stream.next(); + if(ch2=="-") + { + stream.skipToEnd(); + return "comment"; + } + + } + else if (operatorChars.test(ch)) { + stream.eatWhile(operatorChars); + return null; + } + else if (ch == ":") { + stream.eatWhile(/[\w\d\._\-]/); + return "atom"; + } + else { + stream.eatWhile(/[_\w\d]/); + if (stream.eat(":")) { + stream.eatWhile(/[\w\d_\-]/); + return "atom"; + } + var word = stream.current(), type; + if (ops.test(word)) + return null; + else if (keywords.test(word)) + return "keyword"; + else + return "variable"; + } + } + + function tokenLiteral(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) { + state.tokenize = tokenBase; + break; + } + escaped = !escaped && ch == "\\"; + } + return "string"; + }; + } + + function tokenOpLiteral(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) { + state.tokenize = tokenBase; + break; + } + escaped = !escaped && ch == "\\"; + } + return "variable-2"; + }; + } + + + function pushContext(state, type, col) { + state.context = {prev: state.context, indent: state.indent, col: col, type: type}; + } + function popContext(state) { + state.indent = state.context.indent; + state.context = state.context.prev; + } + + return { + startState: function(base) { + return {tokenize: tokenBase, + context: null, + indent: 0, + col: 0}; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (state.context && state.context.align == null) state.context.align = false; + state.indent = stream.indentation(); + } + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + + if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") { + state.context.align = true; + } + + if (curPunc == "(") pushContext(state, ")", stream.column()); + else if (curPunc == "[") pushContext(state, "]", stream.column()); + else if (curPunc == "{") pushContext(state, "}", stream.column()); + else if (/[\]\}\)]/.test(curPunc)) { + while (state.context && state.context.type == "pattern") popContext(state); + if (state.context && curPunc == state.context.type) popContext(state); + } + else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state); + else if (/atom|string|variable/.test(style) && state.context) { + if (/[\}\]]/.test(state.context.type)) + pushContext(state, "pattern", stream.column()); + else if (state.context.type == "pattern" && !state.context.align) { + state.context.align = true; + state.context.col = stream.column(); + } + } + + return style; + }, + + indent: function(state, textAfter) { + var firstChar = textAfter && textAfter.charAt(0); + var context = state.context; + if (/[\]\}]/.test(firstChar)) + while (context && context.type == "pattern") context = context.prev; + + var closing = context && firstChar == context.type; + if (!context) + return 0; + else if (context.type == "pattern") + return context.col; + else if (context.align) + return context.col + (closing ? 0 : 1); + else + return context.indent + (closing ? 0 : indentUnit); + } + }; +}); + +CodeMirror.defineMIME("text/x-mysql", "mysql"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ntriples/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ntriples/index.html new file mode 100644 index 00000000..08d33bab --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ntriples/index.html @@ -0,0 +1,32 @@ + + + + CodeMirror: NTriples mode + + + + + + + +

    CodeMirror: NTriples mode

    +
    + +
    + + +

    MIME types defined: text/n-triples.

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ntriples/ntriples.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ntriples/ntriples.js new file mode 100644 index 00000000..3b6cb416 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ntriples/ntriples.js @@ -0,0 +1,172 @@ +/********************************************************** +* This script provides syntax highlighting support for +* the Ntriples format. +* Ntriples format specification: +* http://www.w3.org/TR/rdf-testcases/#ntriples +***********************************************************/ + +/* + The following expression defines the defined ASF grammar transitions. + + pre_subject -> + { + ( writing_subject_uri | writing_bnode_uri ) + -> pre_predicate + -> writing_predicate_uri + -> pre_object + -> writing_object_uri | writing_object_bnode | + ( + writing_object_literal + -> writing_literal_lang | writing_literal_type + ) + -> post_object + -> BEGIN + } otherwise { + -> ERROR + } +*/ +CodeMirror.defineMode("ntriples", function() { + + Location = { + PRE_SUBJECT : 0, + WRITING_SUB_URI : 1, + WRITING_BNODE_URI : 2, + PRE_PRED : 3, + WRITING_PRED_URI : 4, + PRE_OBJ : 5, + WRITING_OBJ_URI : 6, + WRITING_OBJ_BNODE : 7, + WRITING_OBJ_LITERAL : 8, + WRITING_LIT_LANG : 9, + WRITING_LIT_TYPE : 10, + POST_OBJ : 11, + ERROR : 12 + }; + function transitState(currState, c) { + var currLocation = currState.location; + var ret; + + // Opening. + if (currLocation == Location.PRE_SUBJECT && c == '<') ret = Location.WRITING_SUB_URI; + else if(currLocation == Location.PRE_SUBJECT && c == '_') ret = Location.WRITING_BNODE_URI; + else if(currLocation == Location.PRE_PRED && c == '<') ret = Location.WRITING_PRED_URI; + else if(currLocation == Location.PRE_OBJ && c == '<') ret = Location.WRITING_OBJ_URI; + else if(currLocation == Location.PRE_OBJ && c == '_') ret = Location.WRITING_OBJ_BNODE; + else if(currLocation == Location.PRE_OBJ && c == '"') ret = Location.WRITING_OBJ_LITERAL; + + // Closing. + else if(currLocation == Location.WRITING_SUB_URI && c == '>') ret = Location.PRE_PRED; + else if(currLocation == Location.WRITING_BNODE_URI && c == ' ') ret = Location.PRE_PRED; + else if(currLocation == Location.WRITING_PRED_URI && c == '>') ret = Location.PRE_OBJ; + else if(currLocation == Location.WRITING_OBJ_URI && c == '>') ret = Location.POST_OBJ; + else if(currLocation == Location.WRITING_OBJ_BNODE && c == ' ') ret = Location.POST_OBJ; + else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '"') ret = Location.POST_OBJ; + else if(currLocation == Location.WRITING_LIT_LANG && c == ' ') ret = Location.POST_OBJ; + else if(currLocation == Location.WRITING_LIT_TYPE && c == '>') ret = Location.POST_OBJ; + + // Closing typed and language literal. + else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '@') ret = Location.WRITING_LIT_LANG; + else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '^') ret = Location.WRITING_LIT_TYPE; + + // Spaces. + else if( c == ' ' && + ( + currLocation == Location.PRE_SUBJECT || + currLocation == Location.PRE_PRED || + currLocation == Location.PRE_OBJ || + currLocation == Location.POST_OBJ + ) + ) ret = currLocation; + + // Reset. + else if(currLocation == Location.POST_OBJ && c == '.') ret = Location.PRE_SUBJECT; + + // Error + else ret = Location.ERROR; + + currState.location=ret; + } + + untilSpace = function(c) { return c != ' '; }; + untilEndURI = function(c) { return c != '>'; }; + return { + startState: function() { + return { + location : Location.PRE_SUBJECT, + uris : [], + anchors : [], + bnodes : [], + langs : [], + types : [] + }; + }, + token: function(stream, state) { + var ch = stream.next(); + if(ch == '<') { + transitState(state, ch); + var parsedURI = ''; + stream.eatWhile( function(c) { if( c != '#' && c != '>' ) { parsedURI += c; return true; } return false;} ); + state.uris.push(parsedURI); + if( stream.match('#', false) ) return 'variable'; + stream.next(); + transitState(state, '>'); + return 'variable'; + } + if(ch == '#') { + var parsedAnchor = ''; + stream.eatWhile(function(c) { if(c != '>' && c != ' ') { parsedAnchor+= c; return true; } return false}); + state.anchors.push(parsedAnchor); + return 'variable-2'; + } + if(ch == '>') { + transitState(state, '>'); + return 'variable'; + } + if(ch == '_') { + transitState(state, ch); + var parsedBNode = ''; + stream.eatWhile(function(c) { if( c != ' ' ) { parsedBNode += c; return true; } return false;}); + state.bnodes.push(parsedBNode); + stream.next(); + transitState(state, ' '); + return 'builtin'; + } + if(ch == '"') { + transitState(state, ch); + stream.eatWhile( function(c) { return c != '"'; } ); + stream.next(); + if( stream.peek() != '@' && stream.peek() != '^' ) { + transitState(state, '"'); + } + return 'string'; + } + if( ch == '@' ) { + transitState(state, '@'); + var parsedLang = ''; + stream.eatWhile(function(c) { if( c != ' ' ) { parsedLang += c; return true; } return false;}); + state.langs.push(parsedLang); + stream.next(); + transitState(state, ' '); + return 'string-2'; + } + if( ch == '^' ) { + stream.next(); + transitState(state, '^'); + var parsedType = ''; + stream.eatWhile(function(c) { if( c != '>' ) { parsedType += c; return true; } return false;} ); + state.types.push(parsedType); + stream.next(); + transitState(state, '>'); + return 'variable'; + } + if( ch == ' ' ) { + transitState(state, ch); + } + if( ch == '.' ) { + transitState(state, ch); + } + } + }; +}); + +CodeMirror.defineMIME("text/n-triples", "ntriples"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/pascal/LICENSE b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/pascal/LICENSE new file mode 100644 index 00000000..8e3747e7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/pascal/LICENSE @@ -0,0 +1,7 @@ +Copyright (c) 2011 souceLair + +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: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +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. diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/pascal/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/pascal/index.html new file mode 100644 index 00000000..6af6b460 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/pascal/index.html @@ -0,0 +1,48 @@ + + + + CodeMirror: Pascal mode + + + + + + + +

    CodeMirror: Pascal mode

    + +
    + + + +

    MIME types defined: text/x-pascal.

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/pascal/pascal.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/pascal/pascal.js new file mode 100644 index 00000000..9ac522f7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/pascal/pascal.js @@ -0,0 +1,94 @@ +CodeMirror.defineMode("pascal", function(config) { + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + var keywords = words("and array begin case const div do downto else end file for forward integer " + + "boolean char function goto if in label mod nil not of or packed procedure " + + "program record repeat set string then to type until var while with"); + var atoms = {"null": true}; + + var isOperatorChar = /[+\-*&%=<>!?|\/]/; + + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == "#" && state.startOfLine) { + stream.skipToEnd(); + return "meta"; + } + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + if (ch == "(" && stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + return null + } + if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return "number"; + } + if (ch == "/") { + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + } + if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + stream.eatWhile(/[\w\$_]/); + var cur = stream.current(); + if (keywords.propertyIsEnumerable(cur)) return "keyword"; + if (atoms.propertyIsEnumerable(cur)) return "atom"; + return "word"; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) {end = true; break;} + escaped = !escaped && next == "\\"; + } + if (end || !escaped) state.tokenize = null; + return "string"; + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == ")" && maybeEnd) { + state.tokenize = null; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + // Interface + + return { + startState: function(basecolumn) { + return {tokenize: null}; + }, + + token: function(stream, state) { + if (stream.eatSpace()) return null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment" || style == "meta") return style; + return style; + }, + + electricChars: "{}" + }; +}); + +CodeMirror.defineMIME("text/x-pascal", "pascal"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/perl/LICENSE b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/perl/LICENSE new file mode 100644 index 00000000..96f4115a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/perl/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2011 by Sabaca under the MIT license. + +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +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. diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/perl/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/perl/index.html new file mode 100644 index 00000000..5ef55d32 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/perl/index.html @@ -0,0 +1,62 @@ + + + + CodeMirror: Perl mode + + + + + + + +

    CodeMirror: Perl mode

    + +
    + + + +

    MIME types defined: text/x-perl.

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/perl/perl.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/perl/perl.js new file mode 100644 index 00000000..7fa129ea --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/perl/perl.js @@ -0,0 +1,816 @@ +// CodeMirror2 mode/perl/perl.js (text/x-perl) beta 0.10 (2011-11-08) +// This is a part of CodeMirror from https://github.com/sabaca/CodeMirror_mode_perl (mail@sabaca.com) +CodeMirror.defineMode("perl",function(config,parserConfig){ + // http://perldoc.perl.org + var PERL={ // null - magic touch + // 1 - keyword + // 2 - def + // 3 - atom + // 4 - operator + // 5 - variable-2 (predefined) + // [x,y] - x=1,2,3; y=must be defined if x{...} + // PERL operators + '->' : 4, + '++' : 4, + '--' : 4, + '**' : 4, + // ! ~ \ and unary + and - + '=~' : 4, + '!~' : 4, + '*' : 4, + '/' : 4, + '%' : 4, + 'x' : 4, + '+' : 4, + '-' : 4, + '.' : 4, + '<<' : 4, + '>>' : 4, + // named unary operators + '<' : 4, + '>' : 4, + '<=' : 4, + '>=' : 4, + 'lt' : 4, + 'gt' : 4, + 'le' : 4, + 'ge' : 4, + '==' : 4, + '!=' : 4, + '<=>' : 4, + 'eq' : 4, + 'ne' : 4, + 'cmp' : 4, + '~~' : 4, + '&' : 4, + '|' : 4, + '^' : 4, + '&&' : 4, + '||' : 4, + '//' : 4, + '..' : 4, + '...' : 4, + '?' : 4, + ':' : 4, + '=' : 4, + '+=' : 4, + '-=' : 4, + '*=' : 4, // etc. ??? + ',' : 4, + '=>' : 4, + '::' : 4, + // list operators (rightward) + 'not' : 4, + 'and' : 4, + 'or' : 4, + 'xor' : 4, + // PERL predefined variables (I know, what this is a paranoid idea, but may be needed for people, who learn PERL, and for me as well, ...and may be for you?;) + 'BEGIN' : [5,1], + 'END' : [5,1], + 'PRINT' : [5,1], + 'PRINTF' : [5,1], + 'GETC' : [5,1], + 'READ' : [5,1], + 'READLINE' : [5,1], + 'DESTROY' : [5,1], + 'TIE' : [5,1], + 'TIEHANDLE' : [5,1], + 'UNTIE' : [5,1], + 'STDIN' : 5, + 'STDIN_TOP' : 5, + 'STDOUT' : 5, + 'STDOUT_TOP' : 5, + 'STDERR' : 5, + 'STDERR_TOP' : 5, + '$ARG' : 5, + '$_' : 5, + '@ARG' : 5, + '@_' : 5, + '$LIST_SEPARATOR' : 5, + '$"' : 5, + '$PROCESS_ID' : 5, + '$PID' : 5, + '$$' : 5, + '$REAL_GROUP_ID' : 5, + '$GID' : 5, + '$(' : 5, + '$EFFECTIVE_GROUP_ID' : 5, + '$EGID' : 5, + '$)' : 5, + '$PROGRAM_NAME' : 5, + '$0' : 5, + '$SUBSCRIPT_SEPARATOR' : 5, + '$SUBSEP' : 5, + '$;' : 5, + '$REAL_USER_ID' : 5, + '$UID' : 5, + '$<' : 5, + '$EFFECTIVE_USER_ID' : 5, + '$EUID' : 5, + '$>' : 5, + '$a' : 5, + '$b' : 5, + '$COMPILING' : 5, + '$^C' : 5, + '$DEBUGGING' : 5, + '$^D' : 5, + '${^ENCODING}' : 5, + '$ENV' : 5, + '%ENV' : 5, + '$SYSTEM_FD_MAX' : 5, + '$^F' : 5, + '@F' : 5, + '${^GLOBAL_PHASE}' : 5, + '$^H' : 5, + '%^H' : 5, + '@INC' : 5, + '%INC' : 5, + '$INPLACE_EDIT' : 5, + '$^I' : 5, + '$^M' : 5, + '$OSNAME' : 5, + '$^O' : 5, + '${^OPEN}' : 5, + '$PERLDB' : 5, + '$^P' : 5, + '$SIG' : 5, + '%SIG' : 5, + '$BASETIME' : 5, + '$^T' : 5, + '${^TAINT}' : 5, + '${^UNICODE}' : 5, + '${^UTF8CACHE}' : 5, + '${^UTF8LOCALE}' : 5, + '$PERL_VERSION' : 5, + '$^V' : 5, + '${^WIN32_SLOPPY_STAT}' : 5, + '$EXECUTABLE_NAME' : 5, + '$^X' : 5, + '$1' : 5, // - regexp $1, $2... + '$MATCH' : 5, + '$&' : 5, + '${^MATCH}' : 5, + '$PREMATCH' : 5, + '$`' : 5, + '${^PREMATCH}' : 5, + '$POSTMATCH' : 5, + "$'" : 5, + '${^POSTMATCH}' : 5, + '$LAST_PAREN_MATCH' : 5, + '$+' : 5, + '$LAST_SUBMATCH_RESULT' : 5, + '$^N' : 5, + '@LAST_MATCH_END' : 5, + '@+' : 5, + '%LAST_PAREN_MATCH' : 5, + '%+' : 5, + '@LAST_MATCH_START' : 5, + '@-' : 5, + '%LAST_MATCH_START' : 5, + '%-' : 5, + '$LAST_REGEXP_CODE_RESULT' : 5, + '$^R' : 5, + '${^RE_DEBUG_FLAGS}' : 5, + '${^RE_TRIE_MAXBUF}' : 5, + '$ARGV' : 5, + '@ARGV' : 5, + 'ARGV' : 5, + 'ARGVOUT' : 5, + '$OUTPUT_FIELD_SEPARATOR' : 5, + '$OFS' : 5, + '$,' : 5, + '$INPUT_LINE_NUMBER' : 5, + '$NR' : 5, + '$.' : 5, + '$INPUT_RECORD_SEPARATOR' : 5, + '$RS' : 5, + '$/' : 5, + '$OUTPUT_RECORD_SEPARATOR' : 5, + '$ORS' : 5, + '$\\' : 5, + '$OUTPUT_AUTOFLUSH' : 5, + '$|' : 5, + '$ACCUMULATOR' : 5, + '$^A' : 5, + '$FORMAT_FORMFEED' : 5, + '$^L' : 5, + '$FORMAT_PAGE_NUMBER' : 5, + '$%' : 5, + '$FORMAT_LINES_LEFT' : 5, + '$-' : 5, + '$FORMAT_LINE_BREAK_CHARACTERS' : 5, + '$:' : 5, + '$FORMAT_LINES_PER_PAGE' : 5, + '$=' : 5, + '$FORMAT_TOP_NAME' : 5, + '$^' : 5, + '$FORMAT_NAME' : 5, + '$~' : 5, + '${^CHILD_ERROR_NATIVE}' : 5, + '$EXTENDED_OS_ERROR' : 5, + '$^E' : 5, + '$EXCEPTIONS_BEING_CAUGHT' : 5, + '$^S' : 5, + '$WARNING' : 5, + '$^W' : 5, + '${^WARNING_BITS}' : 5, + '$OS_ERROR' : 5, + '$ERRNO' : 5, + '$!' : 5, + '%OS_ERROR' : 5, + '%ERRNO' : 5, + '%!' : 5, + '$CHILD_ERROR' : 5, + '$?' : 5, + '$EVAL_ERROR' : 5, + '$@' : 5, + '$OFMT' : 5, + '$#' : 5, + '$*' : 5, + '$ARRAY_BASE' : 5, + '$[' : 5, + '$OLD_PERL_VERSION' : 5, + '$]' : 5, + // PERL blocks + 'if' :[1,1], + elsif :[1,1], + 'else' :[1,1], + 'while' :[1,1], + unless :[1,1], + 'for' :[1,1], + foreach :[1,1], + // PERL functions + 'abs' :1, // - absolute value function + accept :1, // - accept an incoming socket connect + alarm :1, // - schedule a SIGALRM + 'atan2' :1, // - arctangent of Y/X in the range -PI to PI + bind :1, // - binds an address to a socket + binmode :1, // - prepare binary files for I/O + bless :1, // - create an object + bootstrap :1, // + 'break' :1, // - break out of a "given" block + caller :1, // - get context of the current subroutine call + chdir :1, // - change your current working directory + chmod :1, // - changes the permissions on a list of files + chomp :1, // - remove a trailing record separator from a string + chop :1, // - remove the last character from a string + chown :1, // - change the owership on a list of files + chr :1, // - get character this number represents + chroot :1, // - make directory new root for path lookups + close :1, // - close file (or pipe or socket) handle + closedir :1, // - close directory handle + connect :1, // - connect to a remote socket + 'continue' :[1,1], // - optional trailing block in a while or foreach + 'cos' :1, // - cosine function + crypt :1, // - one-way passwd-style encryption + dbmclose :1, // - breaks binding on a tied dbm file + dbmopen :1, // - create binding on a tied dbm file + 'default' :1, // + defined :1, // - test whether a value, variable, or function is defined + 'delete' :1, // - deletes a value from a hash + die :1, // - raise an exception or bail out + 'do' :1, // - turn a BLOCK into a TERM + dump :1, // - create an immediate core dump + each :1, // - retrieve the next key/value pair from a hash + endgrent :1, // - be done using group file + endhostent :1, // - be done using hosts file + endnetent :1, // - be done using networks file + endprotoent :1, // - be done using protocols file + endpwent :1, // - be done using passwd file + endservent :1, // - be done using services file + eof :1, // - test a filehandle for its end + 'eval' :1, // - catch exceptions or compile and run code + 'exec' :1, // - abandon this program to run another + exists :1, // - test whether a hash key is present + exit :1, // - terminate this program + 'exp' :1, // - raise I to a power + fcntl :1, // - file control system call + fileno :1, // - return file descriptor from filehandle + flock :1, // - lock an entire file with an advisory lock + fork :1, // - create a new process just like this one + format :1, // - declare a picture format with use by the write() function + formline :1, // - internal function used for formats + getc :1, // - get the next character from the filehandle + getgrent :1, // - get next group record + getgrgid :1, // - get group record given group user ID + getgrnam :1, // - get group record given group name + gethostbyaddr :1, // - get host record given its address + gethostbyname :1, // - get host record given name + gethostent :1, // - get next hosts record + getlogin :1, // - return who logged in at this tty + getnetbyaddr :1, // - get network record given its address + getnetbyname :1, // - get networks record given name + getnetent :1, // - get next networks record + getpeername :1, // - find the other end of a socket connection + getpgrp :1, // - get process group + getppid :1, // - get parent process ID + getpriority :1, // - get current nice value + getprotobyname :1, // - get protocol record given name + getprotobynumber :1, // - get protocol record numeric protocol + getprotoent :1, // - get next protocols record + getpwent :1, // - get next passwd record + getpwnam :1, // - get passwd record given user login name + getpwuid :1, // - get passwd record given user ID + getservbyname :1, // - get services record given its name + getservbyport :1, // - get services record given numeric port + getservent :1, // - get next services record + getsockname :1, // - retrieve the sockaddr for a given socket + getsockopt :1, // - get socket options on a given socket + given :1, // + glob :1, // - expand filenames using wildcards + gmtime :1, // - convert UNIX time into record or string using Greenwich time + 'goto' :1, // - create spaghetti code + grep :1, // - locate elements in a list test true against a given criterion + hex :1, // - convert a string to a hexadecimal number + 'import' :1, // - patch a module's namespace into your own + index :1, // - find a substring within a string + 'int' :1, // - get the integer portion of a number + ioctl :1, // - system-dependent device control system call + 'join' :1, // - join a list into a string using a separator + keys :1, // - retrieve list of indices from a hash + kill :1, // - send a signal to a process or process group + last :1, // - exit a block prematurely + lc :1, // - return lower-case version of a string + lcfirst :1, // - return a string with just the next letter in lower case + length :1, // - return the number of bytes in a string + 'link' :1, // - create a hard link in the filesytem + listen :1, // - register your socket as a server + local : 2, // - create a temporary value for a global variable (dynamic scoping) + localtime :1, // - convert UNIX time into record or string using local time + lock :1, // - get a thread lock on a variable, subroutine, or method + 'log' :1, // - retrieve the natural logarithm for a number + lstat :1, // - stat a symbolic link + m :null, // - match a string with a regular expression pattern + map :1, // - apply a change to a list to get back a new list with the changes + mkdir :1, // - create a directory + msgctl :1, // - SysV IPC message control operations + msgget :1, // - get SysV IPC message queue + msgrcv :1, // - receive a SysV IPC message from a message queue + msgsnd :1, // - send a SysV IPC message to a message queue + my : 2, // - declare and assign a local variable (lexical scoping) + 'new' :1, // + next :1, // - iterate a block prematurely + no :1, // - unimport some module symbols or semantics at compile time + oct :1, // - convert a string to an octal number + open :1, // - open a file, pipe, or descriptor + opendir :1, // - open a directory + ord :1, // - find a character's numeric representation + our : 2, // - declare and assign a package variable (lexical scoping) + pack :1, // - convert a list into a binary representation + 'package' :1, // - declare a separate global namespace + pipe :1, // - open a pair of connected filehandles + pop :1, // - remove the last element from an array and return it + pos :1, // - find or set the offset for the last/next m//g search + print :1, // - output a list to a filehandle + printf :1, // - output a formatted list to a filehandle + prototype :1, // - get the prototype (if any) of a subroutine + push :1, // - append one or more elements to an array + q :null, // - singly quote a string + qq :null, // - doubly quote a string + qr :null, // - Compile pattern + quotemeta :null, // - quote regular expression magic characters + qw :null, // - quote a list of words + qx :null, // - backquote quote a string + rand :1, // - retrieve the next pseudorandom number + read :1, // - fixed-length buffered input from a filehandle + readdir :1, // - get a directory from a directory handle + readline :1, // - fetch a record from a file + readlink :1, // - determine where a symbolic link is pointing + readpipe :1, // - execute a system command and collect standard output + recv :1, // - receive a message over a Socket + redo :1, // - start this loop iteration over again + ref :1, // - find out the type of thing being referenced + rename :1, // - change a filename + require :1, // - load in external functions from a library at runtime + reset :1, // - clear all variables of a given name + 'return' :1, // - get out of a function early + reverse :1, // - flip a string or a list + rewinddir :1, // - reset directory handle + rindex :1, // - right-to-left substring search + rmdir :1, // - remove a directory + s :null, // - replace a pattern with a string + say :1, // - print with newline + scalar :1, // - force a scalar context + seek :1, // - reposition file pointer for random-access I/O + seekdir :1, // - reposition directory pointer + select :1, // - reset default output or do I/O multiplexing + semctl :1, // - SysV semaphore control operations + semget :1, // - get set of SysV semaphores + semop :1, // - SysV semaphore operations + send :1, // - send a message over a socket + setgrent :1, // - prepare group file for use + sethostent :1, // - prepare hosts file for use + setnetent :1, // - prepare networks file for use + setpgrp :1, // - set the process group of a process + setpriority :1, // - set a process's nice value + setprotoent :1, // - prepare protocols file for use + setpwent :1, // - prepare passwd file for use + setservent :1, // - prepare services file for use + setsockopt :1, // - set some socket options + shift :1, // - remove the first element of an array, and return it + shmctl :1, // - SysV shared memory operations + shmget :1, // - get SysV shared memory segment identifier + shmread :1, // - read SysV shared memory + shmwrite :1, // - write SysV shared memory + shutdown :1, // - close down just half of a socket connection + 'sin' :1, // - return the sine of a number + sleep :1, // - block for some number of seconds + socket :1, // - create a socket + socketpair :1, // - create a pair of sockets + 'sort' :1, // - sort a list of values + splice :1, // - add or remove elements anywhere in an array + 'split' :1, // - split up a string using a regexp delimiter + sprintf :1, // - formatted print into a string + 'sqrt' :1, // - square root function + srand :1, // - seed the random number generator + stat :1, // - get a file's status information + state :1, // - declare and assign a state variable (persistent lexical scoping) + study :1, // - optimize input data for repeated searches + 'sub' :1, // - declare a subroutine, possibly anonymously + 'substr' :1, // - get or alter a portion of a stirng + symlink :1, // - create a symbolic link to a file + syscall :1, // - execute an arbitrary system call + sysopen :1, // - open a file, pipe, or descriptor + sysread :1, // - fixed-length unbuffered input from a filehandle + sysseek :1, // - position I/O pointer on handle used with sysread and syswrite + system :1, // - run a separate program + syswrite :1, // - fixed-length unbuffered output to a filehandle + tell :1, // - get current seekpointer on a filehandle + telldir :1, // - get current seekpointer on a directory handle + tie :1, // - bind a variable to an object class + tied :1, // - get a reference to the object underlying a tied variable + time :1, // - return number of seconds since 1970 + times :1, // - return elapsed time for self and child processes + tr :null, // - transliterate a string + truncate :1, // - shorten a file + uc :1, // - return upper-case version of a string + ucfirst :1, // - return a string with just the next letter in upper case + umask :1, // - set file creation mode mask + undef :1, // - remove a variable or function definition + unlink :1, // - remove one link to a file + unpack :1, // - convert binary structure into normal perl variables + unshift :1, // - prepend more elements to the beginning of a list + untie :1, // - break a tie binding to a variable + use :1, // - load in a module at compile time + utime :1, // - set a file's last access and modify times + values :1, // - return a list of the values in a hash + vec :1, // - test or set particular bits in a string + wait :1, // - wait for any child process to die + waitpid :1, // - wait for a particular child process to die + wantarray :1, // - get void vs scalar vs list context of current subroutine call + warn :1, // - print debugging info + when :1, // + write :1, // - print a picture record + y :null}; // - transliterate a string + + var RXstyle="string-2"; + var RXmodifiers=/[goseximacplud]/; // NOTE: "m", "s", "y" and "tr" need to correct real modifiers for each regexp type + + function tokenChain(stream,state,chain,style,tail){ // NOTE: chain.length > 2 is not working now (it's for s[...][...]geos;) + state.chain=null; // 12 3tail + state.style=null; + state.tail=null; + state.tokenize=function(stream,state){ + var e=false,c,i=0; + while(c=stream.next()){ + if(c===chain[i]&&!e){ + if(chain[++i]!==undefined){ + state.chain=chain[i]; + state.style=style; + state.tail=tail} + else if(tail) + stream.eatWhile(tail); + state.tokenize=tokenPerl; + return style} + e=!e&&c=="\\"} + return style}; + return state.tokenize(stream,state)} + + function tokenSOMETHING(stream,state,string){ + state.tokenize=function(stream,state){ + if(stream.string==string) + state.tokenize=tokenPerl; + stream.skipToEnd(); + return "string"}; + return state.tokenize(stream,state)} + + function tokenPerl(stream,state){ + if(stream.eatSpace()) + return null; + if(state.chain) + return tokenChain(stream,state,state.chain,state.style,state.tail); + if(stream.match(/^\-?[\d\.]/,false)) + if(stream.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/)) + return 'number'; + if(stream.match(/^<<(?=\w)/)){ // NOTE: <"],RXstyle,RXmodifiers)} + if(/[\^'"!~\/]/.test(c)){ + stream.eatSuffix(1); + return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers)}} + else if(c=="q"){ + c=stream.look(1); + if(c=="("){ + stream.eatSuffix(2); + return tokenChain(stream,state,[")"],"string")} + if(c=="["){ + stream.eatSuffix(2); + return tokenChain(stream,state,["]"],"string")} + if(c=="{"){ + stream.eatSuffix(2); + return tokenChain(stream,state,["}"],"string")} + if(c=="<"){ + stream.eatSuffix(2); + return tokenChain(stream,state,[">"],"string")} + if(/[\^'"!~\/]/.test(c)){ + stream.eatSuffix(1); + return tokenChain(stream,state,[stream.eat(c)],"string")}} + else if(c=="w"){ + c=stream.look(1); + if(c=="("){ + stream.eatSuffix(2); + return tokenChain(stream,state,[")"],"bracket")} + if(c=="["){ + stream.eatSuffix(2); + return tokenChain(stream,state,["]"],"bracket")} + if(c=="{"){ + stream.eatSuffix(2); + return tokenChain(stream,state,["}"],"bracket")} + if(c=="<"){ + stream.eatSuffix(2); + return tokenChain(stream,state,[">"],"bracket")} + if(/[\^'"!~\/]/.test(c)){ + stream.eatSuffix(1); + return tokenChain(stream,state,[stream.eat(c)],"bracket")}} + else if(c=="r"){ + c=stream.look(1); + if(c=="("){ + stream.eatSuffix(2); + return tokenChain(stream,state,[")"],RXstyle,RXmodifiers)} + if(c=="["){ + stream.eatSuffix(2); + return tokenChain(stream,state,["]"],RXstyle,RXmodifiers)} + if(c=="{"){ + stream.eatSuffix(2); + return tokenChain(stream,state,["}"],RXstyle,RXmodifiers)} + if(c=="<"){ + stream.eatSuffix(2); + return tokenChain(stream,state,[">"],RXstyle,RXmodifiers)} + if(/[\^'"!~\/]/.test(c)){ + stream.eatSuffix(1); + return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers)}} + else if(/[\^'"!~\/(\[{<]/.test(c)){ + if(c=="("){ + stream.eatSuffix(1); + return tokenChain(stream,state,[")"],"string")} + if(c=="["){ + stream.eatSuffix(1); + return tokenChain(stream,state,["]"],"string")} + if(c=="{"){ + stream.eatSuffix(1); + return tokenChain(stream,state,["}"],"string")} + if(c=="<"){ + stream.eatSuffix(1); + return tokenChain(stream,state,[">"],"string")} + if(/[\^'"!~\/]/.test(c)){ + return tokenChain(stream,state,[stream.eat(c)],"string")}}}} + if(ch=="m"){ + var c=stream.look(-2); + if(!(c&&/\w/.test(c))){ + c=stream.eat(/[(\[{<\^'"!~\/]/); + if(c){ + if(/[\^'"!~\/]/.test(c)){ + return tokenChain(stream,state,[c],RXstyle,RXmodifiers)} + if(c=="("){ + return tokenChain(stream,state,[")"],RXstyle,RXmodifiers)} + if(c=="["){ + return tokenChain(stream,state,["]"],RXstyle,RXmodifiers)} + if(c=="{"){ + return tokenChain(stream,state,["}"],RXstyle,RXmodifiers)} + if(c=="<"){ + return tokenChain(stream,state,[">"],RXstyle,RXmodifiers)}}}} + if(ch=="s"){ + var c=/[\/>\]})\w]/.test(stream.look(-2)); + if(!c){ + c=stream.eat(/[(\[{<\^'"!~\/]/); + if(c){ + if(c=="[") + return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); + if(c=="{") + return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); + if(c=="<") + return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); + if(c=="(") + return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); + return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers)}}} + if(ch=="y"){ + var c=/[\/>\]})\w]/.test(stream.look(-2)); + if(!c){ + c=stream.eat(/[(\[{<\^'"!~\/]/); + if(c){ + if(c=="[") + return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); + if(c=="{") + return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); + if(c=="<") + return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); + if(c=="(") + return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); + return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers)}}} + if(ch=="t"){ + var c=/[\/>\]})\w]/.test(stream.look(-2)); + if(!c){ + c=stream.eat("r");if(c){ + c=stream.eat(/[(\[{<\^'"!~\/]/); + if(c){ + if(c=="[") + return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); + if(c=="{") + return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); + if(c=="<") + return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); + if(c=="(") + return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); + return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers)}}}} + if(ch=="`"){ + return tokenChain(stream,state,[ch],"variable-2")} + if(ch=="/"){ + if(!/~\s*$/.test(stream.prefix())) + return "operator"; + else + return tokenChain(stream,state,[ch],RXstyle,RXmodifiers)} + if(ch=="$"){ + var p=stream.pos; + if(stream.eatWhile(/\d/)||stream.eat("{")&&stream.eatWhile(/\d/)&&stream.eat("}")) + return "variable-2"; + else + stream.pos=p} + if(/[$@%]/.test(ch)){ + var p=stream.pos; + if(stream.eat("^")&&stream.eat(/[A-Z]/)||!/[@$%&]/.test(stream.look(-2))&&stream.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){ + var c=stream.current(); + if(PERL[c]) + return "variable-2"} + stream.pos=p} + if(/[$@%&]/.test(ch)){ + if(stream.eatWhile(/[\w$\[\]]/)||stream.eat("{")&&stream.eatWhile(/[\w$\[\]]/)&&stream.eat("}")){ + var c=stream.current(); + if(PERL[c]) + return "variable-2"; + else + return "variable"}} + if(ch=="#"){ + if(stream.look(-2)!="$"){ + stream.skipToEnd(); + return "comment"}} + if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(ch)){ + var p=stream.pos; + stream.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/); + if(PERL[stream.current()]) + return "operator"; + else + stream.pos=p} + if(ch=="_"){ + if(stream.pos==1){ + if(stream.suffix(6)=="_END__"){ + return tokenChain(stream,state,['\0'],"comment")} + else if(stream.suffix(7)=="_DATA__"){ + return tokenChain(stream,state,['\0'],"variable-2")} + else if(stream.suffix(7)=="_C__"){ + return tokenChain(stream,state,['\0'],"string")}}} + if(/\w/.test(ch)){ + var p=stream.pos; + if(stream.look(-2)=="{"&&(stream.look(0)=="}"||stream.eatWhile(/\w/)&&stream.look(0)=="}")) + return "string"; + else + stream.pos=p} + if(/[A-Z]/.test(ch)){ + var l=stream.look(-2); + var p=stream.pos; + stream.eatWhile(/[A-Z_]/); + if(/[\da-z]/.test(stream.look(0))){ + stream.pos=p} + else{ + var c=PERL[stream.current()]; + if(!c) + return "meta"; + if(c[1]) + c=c[0]; + if(l!=":"){ + if(c==1) + return "keyword"; + else if(c==2) + return "def"; + else if(c==3) + return "atom"; + else if(c==4) + return "operator"; + else if(c==5) + return "variable-2"; + else + return "meta"} + else + return "meta"}} + if(/[a-zA-Z_]/.test(ch)){ + var l=stream.look(-2); + stream.eatWhile(/\w/); + var c=PERL[stream.current()]; + if(!c) + return "meta"; + if(c[1]) + c=c[0]; + if(l!=":"){ + if(c==1) + return "keyword"; + else if(c==2) + return "def"; + else if(c==3) + return "atom"; + else if(c==4) + return "operator"; + else if(c==5) + return "variable-2"; + else + return "meta"} + else + return "meta"} + return null} + + return{ + startState:function(){ + return{ + tokenize:tokenPerl, + chain:null, + style:null, + tail:null}}, + token:function(stream,state){ + return (state.tokenize||tokenPerl)(stream,state)}, + electricChars:"{}"}}); + +CodeMirror.defineMIME("text/x-perl", "perl"); + +// it's like "peek", but need for look-ahead or look-behind if index < 0 +CodeMirror.StringStream.prototype.look=function(c){ + return this.string.charAt(this.pos+(c||0))}; + +// return a part of prefix of current stream from current position +CodeMirror.StringStream.prototype.prefix=function(c){ + if(c){ + var x=this.pos-c; + return this.string.substr((x>=0?x:0),c)} + else{ + return this.string.substr(0,this.pos-1)}}; + +// return a part of suffix of current stream from current position +CodeMirror.StringStream.prototype.suffix=function(c){ + var y=this.string.length; + var x=y-this.pos+1; + return this.string.substr(this.pos,(c&&c=(y=this.string.length-1)) + this.pos=y; + else + this.pos=x}; diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/php/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/php/index.html new file mode 100644 index 00000000..7949044e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/php/index.html @@ -0,0 +1,48 @@ + + + + CodeMirror: PHP mode + + + + + + + + + + + +

    CodeMirror: PHP mode

    + +
    + + + +

    Simple HTML/PHP mode based on + the C-like mode. Depends on XML, + JavaScript, CSS, and C-like modes.

    + +

    MIME types defined: application/x-httpd-php (HTML with PHP code), text/x-php (plain, non-wrapped PHP code).

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/php/php.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/php/php.js new file mode 100644 index 00000000..5406a5ce --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/php/php.js @@ -0,0 +1,150 @@ +(function() { + function keywords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + function heredoc(delim) { + return function(stream, state) { + if (stream.match(delim)) state.tokenize = null; + else stream.skipToEnd(); + return "string"; + } + } + var phpConfig = { + name: "clike", + keywords: keywords("abstract and array as break case catch class clone const continue declare default " + + "do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final " + + "for foreach function global goto if implements interface instanceof namespace " + + "new or private protected public static switch throw trait try use var while xor " + + "die echo empty exit eval include include_once isset list require require_once return " + + "print unset __halt_compiler self static parent"), + blockKeywords: keywords("catch do else elseif for foreach if switch try while"), + atoms: keywords("true false null TRUE FALSE NULL"), + multiLineStrings: true, + hooks: { + "$": function(stream, state) { + stream.eatWhile(/[\w\$_]/); + return "variable-2"; + }, + "<": function(stream, state) { + if (stream.match(/<", false)) stream.next(); + return "comment"; + }, + "/": function(stream, state) { + if (stream.eat("/")) { + while (!stream.eol() && !stream.match("?>", false)) stream.next(); + return "comment"; + } + return false; + } + } + }; + + CodeMirror.defineMode("php", function(config, parserConfig) { + var htmlMode = CodeMirror.getMode(config, {name: "xml", htmlMode: true}); + var jsMode = CodeMirror.getMode(config, "javascript"); + var cssMode = CodeMirror.getMode(config, "css"); + var phpMode = CodeMirror.getMode(config, phpConfig); + + function dispatch(stream, state) { // TODO open PHP inside text/css + var isPHP = state.mode == "php"; + if (stream.sol() && state.pending != '"') state.pending = null; + if (state.curMode == htmlMode) { + if (stream.match(/^<\?\w*/)) { + state.curMode = phpMode; + state.curState = state.php; + state.curClose = "?>"; + state.mode = "php"; + return "meta"; + } + if (state.pending == '"') { + while (!stream.eol() && stream.next() != '"') {} + var style = "string"; + } else if (state.pending && stream.pos < state.pending.end) { + stream.pos = state.pending.end; + var style = state.pending.style; + } else { + var style = htmlMode.token(stream, state.curState); + } + state.pending = null; + var cur = stream.current(), openPHP = cur.search(/<\?/); + if (openPHP != -1) { + if (style == "string" && /\"$/.test(cur) && !/\?>/.test(cur)) state.pending = '"'; + else state.pending = {end: stream.pos, style: style}; + stream.backUp(cur.length - openPHP); + } else if (style == "tag" && stream.current() == ">" && state.curState.context) { + if (/^script$/i.test(state.curState.context.tagName)) { + state.curMode = jsMode; + state.curState = jsMode.startState(htmlMode.indent(state.curState, "")); + state.curClose = /^<\/\s*script\s*>/i; + state.mode = "javascript"; + } + else if (/^style$/i.test(state.curState.context.tagName)) { + state.curMode = cssMode; + state.curState = cssMode.startState(htmlMode.indent(state.curState, "")); + state.curClose = /^<\/\s*style\s*>/i; + state.mode = "css"; + } + } + return style; + } else if ((!isPHP || state.php.tokenize == null) && + stream.match(state.curClose, isPHP)) { + state.curMode = htmlMode; + state.curState = state.html; + state.curClose = null; + state.mode = "html"; + if (isPHP) return "meta"; + else return dispatch(stream, state); + } else { + return state.curMode.token(stream, state.curState); + } + } + + return { + startState: function() { + var html = htmlMode.startState(); + return {html: html, + php: phpMode.startState(), + curMode: parserConfig.startOpen ? phpMode : htmlMode, + curState: parserConfig.startOpen ? phpMode.startState() : html, + curClose: parserConfig.startOpen ? /^\?>/ : null, + mode: parserConfig.startOpen ? "php" : "html", + pending: null} + }, + + copyState: function(state) { + var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html), + php = state.php, phpNew = CodeMirror.copyState(phpMode, php), cur; + if (state.curState == html) cur = htmlNew; + else if (state.curState == php) cur = phpNew; + else cur = CodeMirror.copyState(state.curMode, state.curState); + return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur, + curClose: state.curClose, mode: state.mode, + pending: state.pending}; + }, + + token: dispatch, + + indent: function(state, textAfter) { + if ((state.curMode != phpMode && /^\s*<\//.test(textAfter)) || + (state.curMode == phpMode && /^\?>/.test(textAfter))) + return htmlMode.indent(state.html, textAfter); + return state.curMode.indent(state.curState, textAfter); + }, + + electricChars: "/{}:" + } + }); + CodeMirror.defineMIME("application/x-httpd-php", "php"); + CodeMirror.defineMIME("application/x-httpd-php-open", {name: "php", startOpen: true}); + CodeMirror.defineMIME("text/x-php", phpConfig); +})(); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/plsql/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/plsql/index.html new file mode 100644 index 00000000..be603d99 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/plsql/index.html @@ -0,0 +1,62 @@ + + + + CodeMirror: Oracle PL/SQL mode + + + + + + + +

    CodeMirror: Oracle PL/SQL mode

    + +
    + + + +

    + Simple mode that handles Oracle PL/SQL language (and Oracle SQL, of course). +

    + +

    MIME type defined: text/x-plsql + (PLSQL code) + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/plsql/plsql.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/plsql/plsql.js new file mode 100644 index 00000000..a2ac2e8d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/plsql/plsql.js @@ -0,0 +1,217 @@ +CodeMirror.defineMode("plsql", function(config, parserConfig) { + var indentUnit = config.indentUnit, + keywords = parserConfig.keywords, + functions = parserConfig.functions, + types = parserConfig.types, + sqlplus = parserConfig.sqlplus, + multiLineStrings = parserConfig.multiLineStrings; + var isOperatorChar = /[+\-*&%=<>!?:\/|]/; + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + + var type; + function ret(tp, style) { + type = tp; + return style; + } + + function tokenBase(stream, state) { + var ch = stream.next(); + // start of string? + if (ch == '"' || ch == "'") + return chain(stream, state, tokenString(ch)); + // is it one of the special signs []{}().,;? Seperator? + else if (/[\[\]{}\(\),;\.]/.test(ch)) + return ret(ch); + // start of a number value? + else if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return ret("number", "number"); + } + // multi line comment or simple operator? + else if (ch == "/") { + if (stream.eat("*")) { + return chain(stream, state, tokenComment); + } + else { + stream.eatWhile(isOperatorChar); + return ret("operator", "operator"); + } + } + // single line comment or simple operator? + else if (ch == "-") { + if (stream.eat("-")) { + stream.skipToEnd(); + return ret("comment", "comment"); + } + else { + stream.eatWhile(isOperatorChar); + return ret("operator", "operator"); + } + } + // pl/sql variable? + else if (ch == "@" || ch == "$") { + stream.eatWhile(/[\w\d\$_]/); + return ret("word", "variable"); + } + // is it a operator? + else if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return ret("operator", "operator"); + } + else { + // get the whole word + stream.eatWhile(/[\w\$_]/); + // is it one of the listed keywords? + if (keywords && keywords.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "keyword"); + // is it one of the listed functions? + if (functions && functions.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "builtin"); + // is it one of the listed types? + if (types && types.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "variable-2"); + // is it one of the listed sqlplus keywords? + if (sqlplus && sqlplus.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "variable-3"); + // default: just a "word" + return ret("word", "plsql-word"); + } + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) {end = true; break;} + escaped = !escaped && next == "\\"; + } + if (end || !(escaped || multiLineStrings)) + state.tokenize = tokenBase; + return ret("string", "plsql-string"); + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return ret("comment", "plsql-comment"); + } + + // Interface + + return { + startState: function(basecolumn) { + return { + tokenize: tokenBase, + startOfLine: true + }; + }, + + token: function(stream, state) { + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + return style; + } + }; +}); + +(function() { + function keywords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + var cKeywords = "abort accept access add all alter and any array arraylen as asc assert assign at attributes audit " + + "authorization avg " + + "base_table begin between binary_integer body boolean by " + + "case cast char char_base check close cluster clusters colauth column comment commit compress connect " + + "connected constant constraint crash create current currval cursor " + + "data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete " + + "desc digits dispose distinct do drop " + + "else elsif enable end entry escape exception exception_init exchange exclusive exists exit external " + + "fast fetch file for force form from function " + + "generic goto grant group " + + "having " + + "identified if immediate in increment index indexes indicator initial initrans insert interface intersect " + + "into is " + + "key " + + "level library like limited local lock log logging long loop " + + "master maxextents maxtrans member minextents minus mislabel mode modify multiset " + + "new next no noaudit nocompress nologging noparallel not nowait number_base " + + "object of off offline on online only open option or order out " + + "package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior " + + "private privileges procedure public " + + "raise range raw read rebuild record ref references refresh release rename replace resource restrict return " + + "returning reverse revoke rollback row rowid rowlabel rownum rows run " + + "savepoint schema segment select separate session set share snapshot some space split sql start statement " + + "storage subtype successful synonym " + + "tabauth table tables tablespace task terminate then to trigger truncate type " + + "union unique unlimited unrecoverable unusable update use using " + + "validate value values variable view views " + + "when whenever where while with work"; + + var cFunctions = "abs acos add_months ascii asin atan atan2 average " + + "bfilename " + + "ceil chartorowid chr concat convert cos cosh count " + + "decode deref dual dump dup_val_on_index " + + "empty error exp " + + "false floor found " + + "glb greatest " + + "hextoraw " + + "initcap instr instrb isopen " + + "last_day least lenght lenghtb ln lower lpad ltrim lub " + + "make_ref max min mod months_between " + + "new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower " + + "nls_sort nls_upper nlssort no_data_found notfound null nvl " + + "others " + + "power " + + "rawtohex reftohex round rowcount rowidtochar rpad rtrim " + + "sign sin sinh soundex sqlcode sqlerrm sqrt stddev substr substrb sum sysdate " + + "tan tanh to_char to_date to_label to_multi_byte to_number to_single_byte translate true trunc " + + "uid upper user userenv " + + "variance vsize"; + + var cTypes = "bfile blob " + + "character clob " + + "dec " + + "float " + + "int integer " + + "mlslabel " + + "natural naturaln nchar nclob number numeric nvarchar2 " + + "real rowtype " + + "signtype smallint string " + + "varchar varchar2"; + + var cSqlplus = "appinfo arraysize autocommit autoprint autorecovery autotrace " + + "blockterminator break btitle " + + "cmdsep colsep compatibility compute concat copycommit copytypecheck " + + "define describe " + + "echo editfile embedded escape exec execute " + + "feedback flagger flush " + + "heading headsep " + + "instance " + + "linesize lno loboffset logsource long longchunksize " + + "markup " + + "native newpage numformat numwidth " + + "pagesize pause pno " + + "recsep recsepchar release repfooter repheader " + + "serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber " + + "sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix " + + "tab term termout time timing trimout trimspool ttitle " + + "underline " + + "verify version " + + "wrap"; + + CodeMirror.defineMIME("text/x-plsql", { + name: "plsql", + keywords: keywords(cKeywords), + functions: keywords(cFunctions), + types: keywords(cTypes), + sqlplus: keywords(cSqlplus) + }); +}()); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/properties/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/properties/index.html new file mode 100755 index 00000000..4f0c269c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/properties/index.html @@ -0,0 +1,40 @@ + + + + CodeMirror: Properties files mode + + + + + + + +

    CodeMirror: Properties files mode

    +
    + + +

    MIME types defined: text/x-properties, + text/x-ini.

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/properties/properties.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/properties/properties.js new file mode 100755 index 00000000..d3a13c76 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/properties/properties.js @@ -0,0 +1,63 @@ +CodeMirror.defineMode("properties", function() { + return { + token: function(stream, state) { + var sol = stream.sol() || state.afterSection; + var eol = stream.eol(); + + state.afterSection = false; + + if (sol) { + if (state.nextMultiline) { + state.inMultiline = true; + state.nextMultiline = false; + } else { + state.position = "def"; + } + } + + if (eol && ! state.nextMultiline) { + state.inMultiline = false; + state.position = "def"; + } + + if (sol) { + while(stream.eatSpace()); + } + + var ch = stream.next(); + + if (sol && (ch === "#" || ch === "!" || ch === ";")) { + state.position = "comment"; + stream.skipToEnd(); + return "comment"; + } else if (sol && ch === "[") { + state.afterSection = true; + stream.skipTo("]"); stream.eat("]"); + return "header"; + } else if (ch === "=" || ch === ":") { + state.position = "quote"; + return null; + } else if (ch === "\\" && state.position === "quote") { + if (stream.next() !== "u") { // u = Unicode sequence \u1234 + // Multiline value + state.nextMultiline = true; + } + } + + return state.position; + }, + + startState: function() { + return { + position : "def", // Current position, "def", "quote" or "comment" + nextMultiline : false, // Is the next line multiline value + inMultiline : false, // Is the current line a multiline value + afterSection : false // Did we just open a section + }; + } + + }; +}); + +CodeMirror.defineMIME("text/x-properties", "properties"); +CodeMirror.defineMIME("text/x-ini", "properties"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/python/LICENSE.txt b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/python/LICENSE.txt new file mode 100644 index 00000000..918866b4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/python/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2010 Timothy Farrell + +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +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. \ No newline at end of file diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/python/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/python/index.html new file mode 100644 index 00000000..47e0e9d0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/python/index.html @@ -0,0 +1,122 @@ + + + + CodeMirror: Python mode + + + + + + + +

    CodeMirror: Python mode

    + +
    + +

    Configuration Options:

    +
      +
    • version - 2/3 - The version of Python to recognize. Default is 2.
    • +
    • singleLineStringErrors - true/false - If you have a single-line string that is not terminated at the end of the line, this will show subsequent lines as errors if true, otherwise it will consider the newline as the end of the string. Default is false.
    • +
    + +

    MIME types defined: text/x-python.

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/python/python.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/python/python.js new file mode 100644 index 00000000..cfe8a774 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/python/python.js @@ -0,0 +1,340 @@ +CodeMirror.defineMode("python", function(conf, parserConf) { + var ERRORCLASS = 'error'; + + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b"); + } + + var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"); + var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]'); + var doubleOperators = new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"); + var doubleDelimiters = new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); + var tripleDelimiters = new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"); + var identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); + + var wordOperators = wordRegexp(['and', 'or', 'not', 'is', 'in']); + var commonkeywords = ['as', 'assert', 'break', 'class', 'continue', + 'def', 'del', 'elif', 'else', 'except', 'finally', + 'for', 'from', 'global', 'if', 'import', + 'lambda', 'pass', 'raise', 'return', + 'try', 'while', 'with', 'yield']; + var commonBuiltins = ['abs', 'all', 'any', 'bin', 'bool', 'bytearray', 'callable', 'chr', + 'classmethod', 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', + 'enumerate', 'eval', 'filter', 'float', 'format', 'frozenset', + 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', + 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', + 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next', + 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range', + 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', + 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', + 'type', 'vars', 'zip', '__import__', 'NotImplemented', + 'Ellipsis', '__debug__']; + var py2 = {'builtins': ['apply', 'basestring', 'buffer', 'cmp', 'coerce', 'execfile', + 'file', 'intern', 'long', 'raw_input', 'reduce', 'reload', + 'unichr', 'unicode', 'xrange', 'False', 'True', 'None'], + 'keywords': ['exec', 'print']}; + var py3 = {'builtins': ['ascii', 'bytes', 'exec', 'print'], + 'keywords': ['nonlocal', 'False', 'True', 'None']}; + + if (!!parserConf.version && parseInt(parserConf.version, 10) === 3) { + commonkeywords = commonkeywords.concat(py3.keywords); + commonBuiltins = commonBuiltins.concat(py3.builtins); + var stringPrefixes = new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))", "i"); + } else { + commonkeywords = commonkeywords.concat(py2.keywords); + commonBuiltins = commonBuiltins.concat(py2.builtins); + var stringPrefixes = new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))", "i"); + } + var keywords = wordRegexp(commonkeywords); + var builtins = wordRegexp(commonBuiltins); + + var indentInfo = null; + + // tokenizers + function tokenBase(stream, state) { + // Handle scope changes + if (stream.sol()) { + var scopeOffset = state.scopes[0].offset; + if (stream.eatSpace()) { + var lineOffset = stream.indentation(); + if (lineOffset > scopeOffset) { + indentInfo = 'indent'; + } else if (lineOffset < scopeOffset) { + indentInfo = 'dedent'; + } + return null; + } else { + if (scopeOffset > 0) { + dedent(stream, state); + } + } + } + if (stream.eatSpace()) { + return null; + } + + var ch = stream.peek(); + + // Handle Comments + if (ch === '#') { + stream.skipToEnd(); + return 'comment'; + } + + // Handle Number Literals + if (stream.match(/^[0-9\.]/, false)) { + var floatLiteral = false; + // Floats + if (stream.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)) { floatLiteral = true; } + if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; } + if (stream.match(/^\.\d+/)) { floatLiteral = true; } + if (floatLiteral) { + // Float literals may be "imaginary" + stream.eat(/J/i); + return 'number'; + } + // Integers + var intLiteral = false; + // Hex + if (stream.match(/^0x[0-9a-f]+/i)) { intLiteral = true; } + // Binary + if (stream.match(/^0b[01]+/i)) { intLiteral = true; } + // Octal + if (stream.match(/^0o[0-7]+/i)) { intLiteral = true; } + // Decimal + if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) { + // Decimal literals may be "imaginary" + stream.eat(/J/i); + // TODO - Can you have imaginary longs? + intLiteral = true; + } + // Zero by itself with no other piece of number. + if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; } + if (intLiteral) { + // Integer literals may be "long" + stream.eat(/L/i); + return 'number'; + } + } + + // Handle Strings + if (stream.match(stringPrefixes)) { + state.tokenize = tokenStringFactory(stream.current()); + return state.tokenize(stream, state); + } + + // Handle operators and Delimiters + if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) { + return null; + } + if (stream.match(doubleOperators) + || stream.match(singleOperators) + || stream.match(wordOperators)) { + return 'operator'; + } + if (stream.match(singleDelimiters)) { + return null; + } + + if (stream.match(keywords)) { + return 'keyword'; + } + + if (stream.match(builtins)) { + return 'builtin'; + } + + if (stream.match(identifiers)) { + return 'variable'; + } + + // Handle non-detected items + stream.next(); + return ERRORCLASS; + } + + function tokenStringFactory(delimiter) { + while ('rub'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) { + delimiter = delimiter.substr(1); + } + var singleline = delimiter.length == 1; + var OUTCLASS = 'string'; + + return function tokenString(stream, state) { + while (!stream.eol()) { + stream.eatWhile(/[^'"\\]/); + if (stream.eat('\\')) { + stream.next(); + if (singleline && stream.eol()) { + return OUTCLASS; + } + } else if (stream.match(delimiter)) { + state.tokenize = tokenBase; + return OUTCLASS; + } else { + stream.eat(/['"]/); + } + } + if (singleline) { + if (parserConf.singleLineStringErrors) { + return ERRORCLASS; + } else { + state.tokenize = tokenBase; + } + } + return OUTCLASS; + }; + } + + function indent(stream, state, type) { + type = type || 'py'; + var indentUnit = 0; + if (type === 'py') { + if (state.scopes[0].type !== 'py') { + state.scopes[0].offset = stream.indentation(); + return; + } + for (var i = 0; i < state.scopes.length; ++i) { + if (state.scopes[i].type === 'py') { + indentUnit = state.scopes[i].offset + conf.indentUnit; + break; + } + } + } else { + indentUnit = stream.column() + stream.current().length; + } + state.scopes.unshift({ + offset: indentUnit, + type: type + }); + } + + function dedent(stream, state, type) { + type = type || 'py'; + if (state.scopes.length == 1) return; + if (state.scopes[0].type === 'py') { + var _indent = stream.indentation(); + var _indent_index = -1; + for (var i = 0; i < state.scopes.length; ++i) { + if (_indent === state.scopes[i].offset) { + _indent_index = i; + break; + } + } + if (_indent_index === -1) { + return true; + } + while (state.scopes[0].offset !== _indent) { + state.scopes.shift(); + } + return false + } else { + if (type === 'py') { + state.scopes[0].offset = stream.indentation(); + return false; + } else { + if (state.scopes[0].type != type) { + return true; + } + state.scopes.shift(); + return false; + } + } + } + + function tokenLexer(stream, state) { + indentInfo = null; + var style = state.tokenize(stream, state); + var current = stream.current(); + + // Handle '.' connected identifiers + if (current === '.') { + style = state.tokenize(stream, state); + current = stream.current(); + if (style === 'variable' || style === 'builtin') { + return 'variable'; + } else { + return ERRORCLASS; + } + } + + // Handle decorators + if (current === '@') { + style = state.tokenize(stream, state); + current = stream.current(); + if (style === 'variable' + || current === '@staticmethod' + || current === '@classmethod') { + return 'meta'; + } else { + return ERRORCLASS; + } + } + + // Handle scope changes. + if (current === 'pass' || current === 'return') { + state.dedent += 1; + } + if ((current === ':' && !state.lambda && state.scopes[0].type == 'py') + || indentInfo === 'indent') { + indent(stream, state); + } + var delimiter_index = '[({'.indexOf(current); + if (delimiter_index !== -1) { + indent(stream, state, '])}'.slice(delimiter_index, delimiter_index+1)); + } + if (indentInfo === 'dedent') { + if (dedent(stream, state)) { + return ERRORCLASS; + } + } + delimiter_index = '])}'.indexOf(current); + if (delimiter_index !== -1) { + if (dedent(stream, state, current)) { + return ERRORCLASS; + } + } + if (state.dedent > 0 && stream.eol() && state.scopes[0].type == 'py') { + if (state.scopes.length > 1) state.scopes.shift(); + state.dedent -= 1; + } + + return style; + } + + var external = { + startState: function(basecolumn) { + return { + tokenize: tokenBase, + scopes: [{offset:basecolumn || 0, type:'py'}], + lastToken: null, + lambda: false, + dedent: 0 + }; + }, + + token: function(stream, state) { + var style = tokenLexer(stream, state); + + state.lastToken = {style:style, content: stream.current()}; + + if (stream.eol() && stream.lambda) { + state.lambda = false; + } + + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase) { + return 0; + } + + return state.scopes[0].offset; + } + + }; + return external; +}); + +CodeMirror.defineMIME("text/x-python", "python"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/r/LICENSE b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/r/LICENSE new file mode 100644 index 00000000..2510ae16 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/r/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2011, Ubalo, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Ubalo, Inc nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL UBALO, INC BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/r/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/r/index.html new file mode 100644 index 00000000..69775055 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/r/index.html @@ -0,0 +1,73 @@ + + + + CodeMirror: R mode + + + + + + + +

    CodeMirror: R mode

    +
    + + +

    MIME types defined: text/x-rsrc.

    + +

    Development of the CodeMirror R mode was kindly sponsored + by Ubalo, who hold + the license.

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/r/r.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/r/r.js new file mode 100644 index 00000000..53647f23 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/r/r.js @@ -0,0 +1,141 @@ +CodeMirror.defineMode("r", function(config) { + function wordObj(str) { + var words = str.split(" "), res = {}; + for (var i = 0; i < words.length; ++i) res[words[i]] = true; + return res; + } + var atoms = wordObj("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_"); + var builtins = wordObj("list quote bquote eval return call parse deparse"); + var keywords = wordObj("if else repeat while function for in next break"); + var blockkeywords = wordObj("if else repeat while function for"); + var opChars = /[+\-*\/^<>=!&|~$:]/; + var curPunc; + + function tokenBase(stream, state) { + curPunc = null; + var ch = stream.next(); + if (ch == "#") { + stream.skipToEnd(); + return "comment"; + } else if (ch == "0" && stream.eat("x")) { + stream.eatWhile(/[\da-f]/i); + return "number"; + } else if (ch == "." && stream.eat(/\d/)) { + stream.match(/\d*(?:e[+\-]?\d+)?/); + return "number"; + } else if (/\d/.test(ch)) { + stream.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/); + return "number"; + } else if (ch == "'" || ch == '"') { + state.tokenize = tokenString(ch); + return "string"; + } else if (ch == "." && stream.match(/.[.\d]+/)) { + return "keyword"; + } else if (/[\w\.]/.test(ch) && ch != "_") { + stream.eatWhile(/[\w\.]/); + var word = stream.current(); + if (atoms.propertyIsEnumerable(word)) return "atom"; + if (keywords.propertyIsEnumerable(word)) { + if (blockkeywords.propertyIsEnumerable(word)) curPunc = "block"; + return "keyword"; + } + if (builtins.propertyIsEnumerable(word)) return "builtin"; + return "variable"; + } else if (ch == "%") { + if (stream.skipTo("%")) stream.next(); + return "variable-2"; + } else if (ch == "<" && stream.eat("-")) { + return "arrow"; + } else if (ch == "=" && state.ctx.argList) { + return "arg-is"; + } else if (opChars.test(ch)) { + if (ch == "$") return "dollar"; + stream.eatWhile(opChars); + return "operator"; + } else if (/[\(\){}\[\];]/.test(ch)) { + curPunc = ch; + if (ch == ";") return "semi"; + return null; + } else { + return null; + } + } + + function tokenString(quote) { + return function(stream, state) { + if (stream.eat("\\")) { + var ch = stream.next(); + if (ch == "x") stream.match(/^[a-f0-9]{2}/i); + else if ((ch == "u" || ch == "U") && stream.eat("{") && stream.skipTo("}")) stream.next(); + else if (ch == "u") stream.match(/^[a-f0-9]{4}/i); + else if (ch == "U") stream.match(/^[a-f0-9]{8}/i); + else if (/[0-7]/.test(ch)) stream.match(/^[0-7]{1,2}/); + return "string-2"; + } else { + var next; + while ((next = stream.next()) != null) { + if (next == quote) { state.tokenize = tokenBase; break; } + if (next == "\\") { stream.backUp(1); break; } + } + return "string"; + } + }; + } + + function push(state, type, stream) { + state.ctx = {type: type, + indent: state.indent, + align: null, + column: stream.column(), + prev: state.ctx}; + } + function pop(state) { + state.indent = state.ctx.indent; + state.ctx = state.ctx.prev; + } + + return { + startState: function(base) { + return {tokenize: tokenBase, + ctx: {type: "top", + indent: -config.indentUnit, + align: false}, + indent: 0, + afterIdent: false}; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (state.ctx.align == null) state.ctx.align = false; + state.indent = stream.indentation(); + } + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + if (style != "comment" && state.ctx.align == null) state.ctx.align = true; + + var ctype = state.ctx.type; + if ((curPunc == ";" || curPunc == "{" || curPunc == "}") && ctype == "block") pop(state); + if (curPunc == "{") push(state, "}", stream); + else if (curPunc == "(") { + push(state, ")", stream); + if (state.afterIdent) state.ctx.argList = true; + } + else if (curPunc == "[") push(state, "]", stream); + else if (curPunc == "block") push(state, "block", stream); + else if (curPunc == ctype) pop(state); + state.afterIdent = style == "variable" || style == "keyword"; + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase) return 0; + var firstChar = textAfter && textAfter.charAt(0), ctx = state.ctx, + closing = firstChar == ctx.type; + if (ctx.type == "block") return ctx.indent + (firstChar == "{" ? 0 : config.indentUnit); + else if (ctx.align) return ctx.column + (closing ? 0 : 1); + else return ctx.indent + (closing ? 0 : config.indentUnit); + } + }; +}); + +CodeMirror.defineMIME("text/x-rsrc", "r"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rpm/changes/changes.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rpm/changes/changes.js new file mode 100644 index 00000000..cb45f9e5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rpm/changes/changes.js @@ -0,0 +1,19 @@ +CodeMirror.defineMode("changes", function(config, modeConfig) { + var headerSeperator = /^-+$/; + var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /; + var simpleEmail = /^[\w+.-]+@[\w.-]+/; + + return { + token: function(stream) { + if (stream.sol()) { + if (stream.match(headerSeperator)) { return 'tag'; } + if (stream.match(headerLine)) { return 'tag'; } + } + if (stream.match(simpleEmail)) { return 'string'; } + stream.next(); + return null; + } + }; +}); + +CodeMirror.defineMIME("text/x-rpm-changes", "changes"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rpm/changes/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rpm/changes/index.html new file mode 100644 index 00000000..b7ff952d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rpm/changes/index.html @@ -0,0 +1,53 @@ + + + + CodeMirror: RPM changes mode + + + + + + + +

    CodeMirror: RPM changes mode

    + +
    + + +

    MIME types defined: text/x-rpm-changes.

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rpm/spec/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rpm/spec/index.html new file mode 100644 index 00000000..e3bca152 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rpm/spec/index.html @@ -0,0 +1,99 @@ + + + + CodeMirror: RPM spec mode + + + + + + + + +

    CodeMirror: RPM spec mode

    + +
    + + +

    MIME types defined: text/x-rpm-spec.

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rpm/spec/spec.css b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rpm/spec/spec.css new file mode 100644 index 00000000..d0a5d430 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rpm/spec/spec.css @@ -0,0 +1,5 @@ +.cm-s-default span.cm-preamble {color: #b26818; font-weight: bold;} +.cm-s-default span.cm-macro {color: #b218b2;} +.cm-s-default span.cm-section {color: green; font-weight: bold;} +.cm-s-default span.cm-script {color: red;} +.cm-s-default span.cm-issue {color: yellow;} diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rpm/spec/spec.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rpm/spec/spec.js new file mode 100644 index 00000000..902db6ae --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rpm/spec/spec.js @@ -0,0 +1,66 @@ +// Quick and dirty spec file highlighting + +CodeMirror.defineMode("spec", function(config, modeConfig) { + var arch = /^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/; + + var preamble = /^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/; + var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preun|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/; + var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros + var control_flow_simple = /^%(else|endif)/; // rpm control flow macros + var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros + + return { + startState: function () { + return { + controlFlow: false, + macroParameters: false, + section: false + }; + }, + token: function (stream, state) { + var ch = stream.peek(); + if (ch == "#") { stream.skipToEnd(); return "comment"; } + + if (stream.sol()) { + if (stream.match(preamble)) { return "preamble"; } + if (stream.match(section)) { return "section"; } + } + + if (stream.match(/^\$\w+/)) { return "def"; } // Variables like '$RPM_BUILD_ROOT' + if (stream.match(/^\$\{\w+\}/)) { return "def"; } // Variables like '${RPM_BUILD_ROOT}' + + if (stream.match(control_flow_simple)) { return "keyword"; } + if (stream.match(control_flow_complex)) { + state.controlFlow = true; + return "keyword"; + } + if (state.controlFlow) { + if (stream.match(operators)) { return "operator"; } + if (stream.match(/^(\d+)/)) { return "number"; } + if (stream.eol()) { state.controlFlow = false; } + } + + if (stream.match(arch)) { return "number"; } + + // Macros like '%make_install' or '%attr(0775,root,root)' + if (stream.match(/^%[\w]+/)) { + if (stream.match(/^\(/)) { state.macroParameters = true; } + return "macro"; + } + if (state.macroParameters) { + if (stream.match(/^\d+/)) { return "number";} + if (stream.match(/^\)/)) { + state.macroParameters = false; + return "macro"; + } + } + if (stream.match(/^%\{\??[\w \-]+\}/)) { return "macro"; } // Macros like '%{defined fedora}' + + //TODO: Include bash script sub-parser (CodeMirror supports that) + stream.next(); + return null; + } + }; +}); + +CodeMirror.defineMIME("text/x-rpm-spec", "spec"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rst/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rst/index.html new file mode 100644 index 00000000..fd75a284 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rst/index.html @@ -0,0 +1,525 @@ + + + + CodeMirror: reStructuredText mode + + + + + + + +

    CodeMirror: reStructuredText mode

    + +
    + + +

    The reStructuredText mode supports one configuration parameter:

    +
    +
    verbatim (string)
    +
    A name or MIME type of a mode that will be used for highlighting + verbatim blocks. By default, reStructuredText mode uses uniform color + for whole block of verbatim text if no mode is given.
    +
    +

    If python mode is available, + it will be used for highlighting blocks containing Python/IPython terminal + sessions (blocks starting with >>> (for Python) or + In [num]: (for IPython). + +

    MIME types defined: text/x-rst.

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rst/rst.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rst/rst.js new file mode 100644 index 00000000..411bac56 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rst/rst.js @@ -0,0 +1,326 @@ +CodeMirror.defineMode('rst', function(config, options) { + function setState(state, fn, ctx) { + state.fn = fn; + setCtx(state, ctx); + } + + function setCtx(state, ctx) { + state.ctx = ctx || {}; + } + + function setNormal(state, ch) { + if (ch && (typeof ch !== 'string')) { + var str = ch.current(); + ch = str[str.length-1]; + } + + setState(state, normal, {back: ch}); + } + + function hasMode(mode) { + if (mode) { + var modes = CodeMirror.listModes(); + + for (var i in modes) { + if (modes[i] == mode) { + return true; + } + } + } + + return false; + } + + function getMode(mode) { + if (hasMode(mode)) { + return CodeMirror.getMode(config, mode); + } else { + return null; + } + } + + var verbatimMode = getMode(options.verbatim); + var pythonMode = getMode('python'); + + var reSection = /^[!"#$%&'()*+,-./:;<=>?@[\\\]^_`{|}~]/; + var reDirective = /^\s*\w([-:.\w]*\w)?::(\s|$)/; + var reHyperlink = /^\s*_[\w-]+:(\s|$)/; + var reFootnote = /^\s*\[(\d+|#)\](\s|$)/; + var reCitation = /^\s*\[[A-Za-z][\w-]*\](\s|$)/; + var reFootnoteRef = /^\[(\d+|#)\]_/; + var reCitationRef = /^\[[A-Za-z][\w-]*\]_/; + var reDirectiveMarker = /^\.\.(\s|$)/; + var reVerbatimMarker = /^::\s*$/; + var rePreInline = /^[-\s"([{/:.,;!?\\_]/; + var reEnumeratedList = /^\s*((\d+|[A-Za-z#])[.)]|\((\d+|[A-Z-a-z#])\))\s/; + var reBulletedList = /^\s*[-\+\*]\s/; + var reExamples = /^\s+(>>>|In \[\d+\]:)\s/; + + function normal(stream, state) { + var ch, sol, i; + + if (stream.eat(/\\/)) { + ch = stream.next(); + setNormal(state, ch); + return null; + } + + sol = stream.sol(); + + if (sol && (ch = stream.eat(reSection))) { + for (i = 0; stream.eat(ch); i++); + + if (i >= 3 && stream.match(/^\s*$/)) { + setNormal(state, null); + return 'header'; + } else { + stream.backUp(i + 1); + } + } + + if (sol && stream.match(reDirectiveMarker)) { + if (!stream.eol()) { + setState(state, directive); + } + return 'meta'; + } + + if (stream.match(reVerbatimMarker)) { + if (!verbatimMode) { + setState(state, verbatim); + } else { + var mode = verbatimMode; + + setState(state, verbatim, { + mode: mode, + local: mode.startState() + }); + } + return 'meta'; + } + + if (sol && stream.match(reExamples, false)) { + if (!pythonMode) { + setState(state, verbatim); + return 'meta'; + } else { + var mode = pythonMode; + + setState(state, verbatim, { + mode: mode, + local: mode.startState() + }); + + return null; + } + } + + function testBackward(re) { + return sol || !state.ctx.back || re.test(state.ctx.back); + } + + function testForward(re) { + return stream.eol() || stream.match(re, false); + } + + function testInline(re) { + return stream.match(re) && testBackward(/\W/) && testForward(/\W/); + } + + if (testInline(reFootnoteRef)) { + setNormal(state, stream); + return 'footnote'; + } + + if (testInline(reCitationRef)) { + setNormal(state, stream); + return 'citation'; + } + + ch = stream.next(); + + if (testBackward(rePreInline)) { + if ((ch === ':' || ch === '|') && stream.eat(/\S/)) { + var token; + + if (ch === ':') { + token = 'builtin'; + } else { + token = 'atom'; + } + + setState(state, inline, { + ch: ch, + wide: false, + prev: null, + token: token + }); + + return token; + } + + if (ch === '*' || ch === '`') { + var orig = ch, + wide = false; + + ch = stream.next(); + + if (ch == orig) { + wide = true; + ch = stream.next(); + } + + if (ch && !/\s/.test(ch)) { + var token; + + if (orig === '*') { + token = wide ? 'strong' : 'em'; + } else { + token = wide ? 'string' : 'string-2'; + } + + setState(state, inline, { + ch: orig, // inline() has to know what to search for + wide: wide, // are we looking for `ch` or `chch` + prev: null, // terminator must not be preceeded with whitespace + token: token // I don't want to recompute this all the time + }); + + return token; + } + } + } + + setNormal(state, ch); + return null; + } + + function inline(stream, state) { + var ch = stream.next(), + token = state.ctx.token; + + function finish(ch) { + state.ctx.prev = ch; + return token; + } + + if (ch != state.ctx.ch) { + return finish(ch); + } + + if (/\s/.test(state.ctx.prev)) { + return finish(ch); + } + + if (state.ctx.wide) { + ch = stream.next(); + + if (ch != state.ctx.ch) { + return finish(ch); + } + } + + if (!stream.eol() && !rePostInline.test(stream.peek())) { + if (state.ctx.wide) { + stream.backUp(1); + } + + return finish(ch); + } + + setState(state, normal); + setNormal(state, ch); + + return token; + } + + function directive(stream, state) { + var token = null; + + if (stream.match(reDirective)) { + token = 'attribute'; + } else if (stream.match(reHyperlink)) { + token = 'link'; + } else if (stream.match(reFootnote)) { + token = 'quote'; + } else if (stream.match(reCitation)) { + token = 'quote'; + } else { + stream.eatSpace(); + + if (stream.eol()) { + setNormal(state, stream); + return null; + } else { + stream.skipToEnd(); + setState(state, comment); + return 'comment'; + } + } + + // FIXME this is unreachable + setState(state, body, {start: true}); + return token; + } + + function body(stream, state) { + var token = 'body'; + + if (!state.ctx.start || stream.sol()) { + return block(stream, state, token); + } + + stream.skipToEnd(); + setCtx(state); + + return token; + } + + function comment(stream, state) { + return block(stream, state, 'comment'); + } + + function verbatim(stream, state) { + if (!verbatimMode) { + return block(stream, state, 'meta'); + } else { + if (stream.sol()) { + if (!stream.eatSpace()) { + setNormal(state, stream); + } + + return null; + } + + return verbatimMode.token(stream, state.ctx.local); + } + } + + function block(stream, state, token) { + if (stream.eol() || stream.eatSpace()) { + stream.skipToEnd(); + return token; + } else { + setNormal(state, stream); + return null; + } + } + + return { + startState: function() { + return {fn: normal, ctx: {}}; + }, + + copyState: function(state) { + return {fn: state.fn, ctx: state.ctx}; + }, + + token: function(stream, state) { + var token = state.fn(stream, state); + return token; + } + }; +}); + +CodeMirror.defineMIME("text/x-rst", "rst"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ruby/LICENSE b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ruby/LICENSE new file mode 100644 index 00000000..ac09fc40 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ruby/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2011, Ubalo, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Ubalo, Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL UBALO, INC BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ruby/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ruby/index.html new file mode 100644 index 00000000..6d33db19 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ruby/index.html @@ -0,0 +1,171 @@ + + + + CodeMirror: Ruby mode + + + + + + + +

    CodeMirror: Ruby mode

    +
    + + +

    MIME types defined: text/x-ruby.

    + +

    Development of the CodeMirror Ruby mode was kindly sponsored + by Ubalo, who hold + the license.

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ruby/ruby.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ruby/ruby.js new file mode 100644 index 00000000..b647efd0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/ruby/ruby.js @@ -0,0 +1,200 @@ +CodeMirror.defineMode("ruby", function(config, parserConfig) { + function wordObj(words) { + var o = {}; + for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true; + return o; + } + var keywords = wordObj([ + "alias", "and", "BEGIN", "begin", "break", "case", "class", "def", "defined?", "do", "else", + "elsif", "END", "end", "ensure", "false", "for", "if", "in", "module", "next", "not", "or", + "redo", "rescue", "retry", "return", "self", "super", "then", "true", "undef", "unless", + "until", "when", "while", "yield", "nil", "raise", "throw", "catch", "fail", "loop", "callcc", + "caller", "lambda", "proc", "public", "protected", "private", "require", "load", + "require_relative", "extend", "autoload" + ]); + var indentWords = wordObj(["def", "class", "case", "for", "while", "do", "module", "then", + "catch", "loop", "proc", "begin"]); + var dedentWords = wordObj(["end", "until"]); + var matching = {"[": "]", "{": "}", "(": ")"}; + var curPunc; + + function chain(newtok, stream, state) { + state.tokenize.push(newtok); + return newtok(stream, state); + } + + function tokenBase(stream, state) { + curPunc = null; + if (stream.sol() && stream.match("=begin") && stream.eol()) { + state.tokenize.push(readBlockComment); + return "comment"; + } + if (stream.eatSpace()) return null; + var ch = stream.next(); + if (ch == "`" || ch == "'" || ch == '"' || + (ch == "/" && !stream.eol() && stream.peek() != " ")) { + return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state); + } else if (ch == "%") { + var style, embed = false; + if (stream.eat("s")) style = "atom"; + else if (stream.eat(/[WQ]/)) { style = "string"; embed = true; } + else if (stream.eat(/[wxqr]/)) style = "string"; + var delim = stream.eat(/[^\w\s]/); + if (!delim) return "operator"; + if (matching.propertyIsEnumerable(delim)) delim = matching[delim]; + return chain(readQuoted(delim, style, embed, true), stream, state); + } else if (ch == "#") { + stream.skipToEnd(); + return "comment"; + } else if (ch == "<" && stream.eat("<")) { + stream.eat("-"); + stream.eat(/[\'\"\`]/); + var match = stream.match(/^\w+/); + stream.eat(/[\'\"\`]/); + if (match) return chain(readHereDoc(match[0]), stream, state); + return null; + } else if (ch == "0") { + if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/); + else if (stream.eat("b")) stream.eatWhile(/[01]/); + else stream.eatWhile(/[0-7]/); + return "number"; + } else if (/\d/.test(ch)) { + stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/); + return "number"; + } else if (ch == "?") { + while (stream.match(/^\\[CM]-/)) {} + if (stream.eat("\\")) stream.eatWhile(/\w/); + else stream.next(); + return "string"; + } else if (ch == ":") { + if (stream.eat("'")) return chain(readQuoted("'", "atom", false), stream, state); + if (stream.eat('"')) return chain(readQuoted('"', "atom", true), stream, state); + stream.eatWhile(/[\w\?]/); + return "atom"; + } else if (ch == "@") { + stream.eat("@"); + stream.eatWhile(/[\w\?]/); + return "variable-2"; + } else if (ch == "$") { + stream.next(); + stream.eatWhile(/[\w\?]/); + return "variable-3"; + } else if (/\w/.test(ch)) { + stream.eatWhile(/[\w\?]/); + if (stream.eat(":")) return "atom"; + return "ident"; + } else if (ch == "|" && (state.varList || state.lastTok == "{" || state.lastTok == "do")) { + curPunc = "|"; + return null; + } else if (/[\(\)\[\]{}\\;]/.test(ch)) { + curPunc = ch; + return null; + } else if (ch == "-" && stream.eat(">")) { + return "arrow"; + } else if (/[=+\-\/*:\.^%<>~|]/.test(ch)) { + stream.eatWhile(/[=+\-\/*:\.^%<>~|]/); + return "operator"; + } else { + return null; + } + } + + function tokenBaseUntilBrace() { + var depth = 1; + return function(stream, state) { + if (stream.peek() == "}") { + depth--; + if (depth == 0) { + state.tokenize.pop(); + return state.tokenize[state.tokenize.length-1](stream, state); + } + } else if (stream.peek() == "{") { + depth++; + } + return tokenBase(stream, state); + }; + } + function readQuoted(quote, style, embed, unescaped) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && (unescaped || !escaped)) { + state.tokenize.pop(); + break; + } + if (embed && ch == "#" && !escaped && stream.eat("{")) { + state.tokenize.push(tokenBaseUntilBrace(arguments.callee)); + break; + } + escaped = !escaped && ch == "\\"; + } + return style; + }; + } + function readHereDoc(phrase) { + return function(stream, state) { + if (stream.match(phrase)) state.tokenize.pop(); + else stream.skipToEnd(); + return "string"; + }; + } + function readBlockComment(stream, state) { + if (stream.sol() && stream.match("=end") && stream.eol()) + state.tokenize.pop(); + stream.skipToEnd(); + return "comment"; + } + + return { + startState: function() { + return {tokenize: [tokenBase], + indented: 0, + context: {type: "top", indented: -config.indentUnit}, + continuedLine: false, + lastTok: null, + varList: false}; + }, + + token: function(stream, state) { + if (stream.sol()) state.indented = stream.indentation(); + var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype; + if (style == "ident") { + var word = stream.current(); + style = keywords.propertyIsEnumerable(stream.current()) ? "keyword" + : /^[A-Z]/.test(word) ? "tag" + : (state.lastTok == "def" || state.lastTok == "class" || state.varList) ? "def" + : "variable"; + if (indentWords.propertyIsEnumerable(word)) kwtype = "indent"; + else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent"; + else if ((word == "if" || word == "unless") && stream.column() == stream.indentation()) + kwtype = "indent"; + } + if (curPunc || (style && style != "comment")) state.lastTok = word || curPunc || style; + if (curPunc == "|") state.varList = !state.varList; + + if (kwtype == "indent" || /[\(\[\{]/.test(curPunc)) + state.context = {prev: state.context, type: curPunc || style, indented: state.indented}; + else if ((kwtype == "dedent" || /[\)\]\}]/.test(curPunc)) && state.context.prev) + state.context = state.context.prev; + + if (stream.eol()) + state.continuedLine = (curPunc == "\\" || style == "operator"); + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize[state.tokenize.length-1] != tokenBase) return 0; + var firstChar = textAfter && textAfter.charAt(0); + var ct = state.context; + var closing = ct.type == matching[firstChar] || + ct.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(textAfter); + return ct.indented + (closing ? 0 : config.indentUnit) + + (state.continuedLine ? config.indentUnit : 0); + }, + electricChars: "}de" // enD and rescuE + + }; +}); + +CodeMirror.defineMIME("text/x-ruby", "ruby"); + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rust/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rust/index.html new file mode 100644 index 00000000..3b811e35 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rust/index.html @@ -0,0 +1,48 @@ + + + + CodeMirror: Rust mode + + + + + + + +

    CodeMirror: Rust mode

    + +
    + + + +

    MIME types defined: text/x-rustsrc.

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rust/rust.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rust/rust.js new file mode 100644 index 00000000..2a5caac2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/rust/rust.js @@ -0,0 +1,432 @@ +CodeMirror.defineMode("rust", function() { + var indentUnit = 4, altIndentUnit = 2; + var valKeywords = { + "if": "if-style", "while": "if-style", "else": "else-style", + "do": "else-style", "ret": "else-style", "fail": "else-style", + "break": "atom", "cont": "atom", "const": "let", "resource": "fn", + "let": "let", "fn": "fn", "for": "for", "alt": "alt", "iface": "iface", + "impl": "impl", "type": "type", "enum": "enum", "mod": "mod", + "as": "op", "true": "atom", "false": "atom", "assert": "op", "check": "op", + "claim": "op", "native": "ignore", "unsafe": "ignore", "import": "else-style", + "export": "else-style", "copy": "op", "log": "op", "log_err": "op", + "use": "op", "bind": "op", "self": "atom" + }; + var typeKeywords = function() { + var keywords = {"fn": "fn", "block": "fn", "obj": "obj"}; + var atoms = "bool uint int i8 i16 i32 i64 u8 u16 u32 u64 float f32 f64 str char".split(" "); + for (var i = 0, e = atoms.length; i < e; ++i) keywords[atoms[i]] = "atom"; + return keywords; + }(); + var operatorChar = /[+\-*&%=<>!?|\.@]/; + + // Tokenizer + + // Used as scratch variable to communicate multiple values without + // consing up tons of objects. + var tcat, content; + function r(tc, style) { + tcat = tc; + return style; + } + + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"') { + state.tokenize = tokenString; + return state.tokenize(stream, state); + } + if (ch == "'") { + tcat = "atom"; + if (stream.eat("\\")) { + if (stream.skipTo("'")) { stream.next(); return "string"; } + else { return "error"; } + } else { + stream.next(); + return stream.eat("'") ? "string" : "error"; + } + } + if (ch == "/") { + if (stream.eat("/")) { stream.skipToEnd(); return "comment"; } + if (stream.eat("*")) { + state.tokenize = tokenComment(1); + return state.tokenize(stream, state); + } + } + if (ch == "#") { + if (stream.eat("[")) { tcat = "open-attr"; return null; } + stream.eatWhile(/\w/); + return r("macro", "meta"); + } + if (ch == ":" && stream.match(":<")) { + return r("op", null); + } + if (ch.match(/\d/) || (ch == "." && stream.eat(/\d/))) { + var flp = false; + if (!stream.match(/^x[\da-f]+/i) && !stream.match(/^b[01]+/)) { + stream.eatWhile(/\d/); + if (stream.eat(".")) { flp = true; stream.eatWhile(/\d/); } + if (stream.match(/^e[+\-]?\d+/i)) { flp = true; } + } + if (flp) stream.match(/^f(?:32|64)/); + else stream.match(/^[ui](?:8|16|32|64)/); + return r("atom", "number"); + } + if (ch.match(/[()\[\]{}:;,]/)) return r(ch, null); + if (ch == "-" && stream.eat(">")) return r("->", null); + if (ch.match(operatorChar)) { + stream.eatWhile(operatorChar); + return r("op", null); + } + stream.eatWhile(/\w/); + content = stream.current(); + if (stream.match(/^::\w/)) { + stream.backUp(1); + return r("prefix", "variable-2"); + } + if (state.keywords.propertyIsEnumerable(content)) + return r(state.keywords[content], content.match(/true|false/) ? "atom" : "keyword"); + return r("name", "variable"); + } + + function tokenString(stream, state) { + var ch, escaped = false; + while (ch = stream.next()) { + if (ch == '"' && !escaped) { + state.tokenize = tokenBase; + return r("atom", "string"); + } + escaped = !escaped && ch == "\\"; + } + // Hack to not confuse the parser when a string is split in + // pieces. + return r("op", "string"); + } + + function tokenComment(depth) { + return function(stream, state) { + var lastCh = null, ch; + while (ch = stream.next()) { + if (ch == "/" && lastCh == "*") { + if (depth == 1) { + state.tokenize = tokenBase; + break; + } else { + state.tokenize = tokenComment(depth - 1); + return state.tokenize(stream, state); + } + } + if (ch == "*" && lastCh == "/") { + state.tokenize = tokenComment(depth + 1); + return state.tokenize(stream, state); + } + lastCh = ch; + } + return "comment"; + }; + } + + // Parser + + var cx = {state: null, stream: null, marked: null, cc: null}; + function pass() { + for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); + } + function cont() { + pass.apply(null, arguments); + return true; + } + + function pushlex(type, info) { + var result = function() { + var state = cx.state; + state.lexical = {indented: state.indented, column: cx.stream.column(), + type: type, prev: state.lexical, info: info}; + }; + result.lex = true; + return result; + } + function poplex() { + var state = cx.state; + if (state.lexical.prev) { + if (state.lexical.type == ")") + state.indented = state.lexical.indented; + state.lexical = state.lexical.prev; + } + } + function typecx() { cx.state.keywords = typeKeywords; } + function valcx() { cx.state.keywords = valKeywords; } + poplex.lex = typecx.lex = valcx.lex = true; + + function commasep(comb, end) { + function more(type) { + if (type == ",") return cont(comb, more); + if (type == end) return cont(); + return cont(more); + } + return function(type) { + if (type == end) return cont(); + return pass(comb, more); + }; + } + + function stat_of(comb, tag) { + return cont(pushlex("stat", tag), comb, poplex, block); + } + function block(type) { + if (type == "}") return cont(); + if (type == "let") return stat_of(letdef1, "let"); + if (type == "fn") return stat_of(fndef); + if (type == "type") return cont(pushlex("stat"), tydef, endstatement, poplex, block); + if (type == "enum") return stat_of(enumdef); + if (type == "mod") return stat_of(mod); + if (type == "iface") return stat_of(iface); + if (type == "impl") return stat_of(impl); + if (type == "open-attr") return cont(pushlex("]"), commasep(expression, "]"), poplex); + if (type == "ignore" || type.match(/[\]\);,]/)) return cont(block); + return pass(pushlex("stat"), expression, poplex, endstatement, block); + } + function endstatement(type) { + if (type == ";") return cont(); + return pass(); + } + function expression(type) { + if (type == "atom" || type == "name") return cont(maybeop); + if (type == "{") return cont(pushlex("}"), exprbrace, poplex); + if (type.match(/[\[\(]/)) return matchBrackets(type, expression); + if (type.match(/[\]\)\};,]/)) return pass(); + if (type == "if-style") return cont(expression, expression); + if (type == "else-style" || type == "op") return cont(expression); + if (type == "for") return cont(pattern, maybetype, inop, expression, expression); + if (type == "alt") return cont(expression, altbody); + if (type == "fn") return cont(fndef); + if (type == "macro") return cont(macro); + return cont(); + } + function maybeop(type) { + if (content == ".") return cont(maybeprop); + if (content == "::<"){return cont(typarams, maybeop);} + if (type == "op" || content == ":") return cont(expression); + if (type == "(" || type == "[") return matchBrackets(type, expression); + return pass(); + } + function maybeprop(type) { + if (content.match(/^\w+$/)) {cx.marked = "variable"; return cont(maybeop);} + return pass(expression); + } + function exprbrace(type) { + if (type == "op") { + if (content == "|") return cont(blockvars, poplex, pushlex("}", "block"), block); + if (content == "||") return cont(poplex, pushlex("}", "block"), block); + } + if (content == "mutable" || (content.match(/^\w+$/) && cx.stream.peek() == ":" + && !cx.stream.match("::", false))) + return pass(record_of(expression)); + return pass(block); + } + function record_of(comb) { + function ro(type) { + if (content == "mutable" || content == "with") {cx.marked = "keyword"; return cont(ro);} + if (content.match(/^\w*$/)) {cx.marked = "variable"; return cont(ro);} + if (type == ":") return cont(comb, ro); + if (type == "}") return cont(); + return cont(ro); + } + return ro; + } + function blockvars(type) { + if (type == "name") {cx.marked = "def"; return cont(blockvars);} + if (type == "op" && content == "|") return cont(); + return cont(blockvars); + } + + function letdef1(type) { + if (type.match(/[\]\)\};]/)) return cont(); + if (content == "=") return cont(expression, letdef2); + if (type == ",") return cont(letdef1); + return pass(pattern, maybetype, letdef1); + } + function letdef2(type) { + if (type.match(/[\]\)\};,]/)) return pass(letdef1); + else return pass(expression, letdef2); + } + function maybetype(type) { + if (type == ":") return cont(typecx, rtype, valcx); + return pass(); + } + function inop(type) { + if (type == "name" && content == "in") {cx.marked = "keyword"; return cont();} + return pass(); + } + function fndef(type) { + if (content == "@" || content == "~") {cx.marked = "keyword"; return cont(fndef);} + if (type == "name") {cx.marked = "def"; return cont(fndef);} + if (content == "<") return cont(typarams, fndef); + if (type == "{") return pass(expression); + if (type == "(") return cont(pushlex(")"), commasep(argdef, ")"), poplex, fndef); + if (type == "->") return cont(typecx, rtype, valcx, fndef); + if (type == ";") return cont(); + return cont(fndef); + } + function tydef(type) { + if (type == "name") {cx.marked = "def"; return cont(tydef);} + if (content == "<") return cont(typarams, tydef); + if (content == "=") return cont(typecx, rtype, valcx); + return cont(tydef); + } + function enumdef(type) { + if (type == "name") {cx.marked = "def"; return cont(enumdef);} + if (content == "<") return cont(typarams, enumdef); + if (content == "=") return cont(typecx, rtype, valcx, endstatement); + if (type == "{") return cont(pushlex("}"), typecx, enumblock, valcx, poplex); + return cont(enumdef); + } + function enumblock(type) { + if (type == "}") return cont(); + if (type == "(") return cont(pushlex(")"), commasep(rtype, ")"), poplex, enumblock); + if (content.match(/^\w+$/)) cx.marked = "def"; + return cont(enumblock); + } + function mod(type) { + if (type == "name") {cx.marked = "def"; return cont(mod);} + if (type == "{") return cont(pushlex("}"), block, poplex); + return pass(); + } + function iface(type) { + if (type == "name") {cx.marked = "def"; return cont(iface);} + if (content == "<") return cont(typarams, iface); + if (type == "{") return cont(pushlex("}"), block, poplex); + return pass(); + } + function impl(type) { + if (content == "<") return cont(typarams, impl); + if (content == "of" || content == "for") {cx.marked = "keyword"; return cont(rtype, impl);} + if (type == "name") {cx.marked = "def"; return cont(impl);} + if (type == "{") return cont(pushlex("}"), block, poplex); + return pass(); + } + function typarams(type) { + if (content == ">") return cont(); + if (content == ",") return cont(typarams); + if (content == ":") return cont(rtype, typarams); + return pass(rtype, typarams); + } + function argdef(type) { + if (type == "name") {cx.marked = "def"; return cont(argdef);} + if (type == ":") return cont(typecx, rtype, valcx); + return pass(); + } + function rtype(type) { + if (type == "name") {cx.marked = "variable-3"; return cont(rtypemaybeparam); } + if (content == "mutable") {cx.marked = "keyword"; return cont(rtype);} + if (type == "atom") return cont(rtypemaybeparam); + if (type == "op" || type == "obj") return cont(rtype); + if (type == "fn") return cont(fntype); + if (type == "{") return cont(pushlex("{"), record_of(rtype), poplex); + return matchBrackets(type, rtype); + } + function rtypemaybeparam(type) { + if (content == "<") return cont(typarams); + return pass(); + } + function fntype(type) { + if (type == "(") return cont(pushlex("("), commasep(rtype, ")"), poplex, fntype); + if (type == "->") return cont(rtype); + return pass(); + } + function pattern(type) { + if (type == "name") {cx.marked = "def"; return cont(patternmaybeop);} + if (type == "atom") return cont(patternmaybeop); + if (type == "op") return cont(pattern); + if (type.match(/[\]\)\};,]/)) return pass(); + return matchBrackets(type, pattern); + } + function patternmaybeop(type) { + if (type == "op" && content == ".") return cont(); + if (content == "to") {cx.marked = "keyword"; return cont(pattern);} + else return pass(); + } + function altbody(type) { + if (type == "{") return cont(pushlex("}", "alt"), altblock1, poplex); + return pass(); + } + function altblock1(type) { + if (type == "}") return cont(); + if (type == "|") return cont(altblock1); + if (content == "when") {cx.marked = "keyword"; return cont(expression, altblock2);} + if (type.match(/[\]\);,]/)) return cont(altblock1); + return pass(pattern, altblock2); + } + function altblock2(type) { + if (type == "{") return cont(pushlex("}", "alt"), block, poplex, altblock1); + else return pass(altblock1); + } + + function macro(type) { + if (type.match(/[\[\(\{]/)) return matchBrackets(type, expression); + return pass(); + } + function matchBrackets(type, comb) { + if (type == "[") return cont(pushlex("]"), commasep(comb, "]"), poplex); + if (type == "(") return cont(pushlex(")"), commasep(comb, ")"), poplex); + if (type == "{") return cont(pushlex("}"), commasep(comb, "}"), poplex); + return cont(); + } + + function parse(state, stream, style) { + var cc = state.cc; + // Communicate our context to the combinators. + // (Less wasteful than consing up a hundred closures on every call.) + cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; + + while (true) { + var combinator = cc.length ? cc.pop() : block; + if (combinator(tcat)) { + while(cc.length && cc[cc.length - 1].lex) + cc.pop()(); + return cx.marked || style; + } + } + } + + return { + startState: function() { + return { + tokenize: tokenBase, + cc: [], + lexical: {indented: -indentUnit, column: 0, type: "top", align: false}, + keywords: valKeywords, + indented: 0 + }; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = false; + state.indented = stream.indentation(); + } + if (stream.eatSpace()) return null; + tcat = content = null; + var style = state.tokenize(stream, state); + if (style == "comment") return style; + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = true; + if (tcat == "prefix") return style; + if (!content) content = stream.current(); + return parse(state, stream, style); + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase) return 0; + var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, + type = lexical.type, closing = firstChar == type; + if (type == "stat") return lexical.indented + indentUnit; + if (lexical.align) return lexical.column + (closing ? 0 : 1); + return lexical.indented + (closing ? 0 : (lexical.info == "alt" ? altIndentUnit : indentUnit)); + }, + + electricChars: "{}" + }; +}); + +CodeMirror.defineMIME("text/x-rustsrc", "rust"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/scheme/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/scheme/index.html new file mode 100644 index 00000000..2a6105fa --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/scheme/index.html @@ -0,0 +1,64 @@ + + + + CodeMirror: Scheme mode + + + + + + + +

    CodeMirror: Scheme mode

    +
    + + +

    MIME types defined: text/x-scheme.

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/scheme/scheme.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/scheme/scheme.js new file mode 100644 index 00000000..caf78db0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/scheme/scheme.js @@ -0,0 +1,202 @@ +/** + * Author: Koh Zi Han, based on implementation by Koh Zi Chun + */ +CodeMirror.defineMode("scheme", function (config, mode) { + var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", + ATOM = "atom", NUMBER = "number", BRACKET = "bracket", KEYWORD="keyword"; + var INDENT_WORD_SKIP = 2, KEYWORDS_SKIP = 1; + + function makeKeywords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + var keywords = makeKeywords("λ case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"); + var indentKeys = makeKeywords("define let letrec let* lambda"); + + + function stateStack(indent, type, prev) { // represents a state stack object + this.indent = indent; + this.type = type; + this.prev = prev; + } + + function pushStack(state, indent, type) { + state.indentStack = new stateStack(indent, type, state.indentStack); + } + + function popStack(state) { + state.indentStack = state.indentStack.prev; + } + + /** + * Scheme numbers are complicated unfortunately. + * Checks if we're looking at a number, which might be possibly a fraction. + * Also checks that it is not part of a longer identifier. Returns true/false accordingly. + */ + function isNumber(ch, stream){ + if(/[0-9]/.exec(ch) != null){ + stream.eatWhile(/[0-9]/); + stream.eat(/\//); + stream.eatWhile(/[0-9]/); + if (stream.eol() || !(/[a-zA-Z\-\_\/]/.exec(stream.peek()))) return true; + stream.backUp(stream.current().length - 1); // undo all the eating + } + return false; + } + + return { + startState: function () { + return { + indentStack: null, + indentation: 0, + mode: false, + sExprComment: false + }; + }, + + token: function (stream, state) { + if (state.indentStack == null && stream.sol()) { + // update indentation, but only if indentStack is empty + state.indentation = stream.indentation(); + } + + // skip spaces + if (stream.eatSpace()) { + return null; + } + var returnType = null; + + switch(state.mode){ + case "string": // multi-line string parsing mode + var next, escaped = false; + while ((next = stream.next()) != null) { + if (next == "\"" && !escaped) { + + state.mode = false; + break; + } + escaped = !escaped && next == "\\"; + } + returnType = STRING; // continue on in scheme-string mode + break; + case "comment": // comment parsing mode + var next, maybeEnd = false; + while ((next = stream.next()) != null) { + if (next == "#" && maybeEnd) { + + state.mode = false; + break; + } + maybeEnd = (next == "|"); + } + returnType = COMMENT; + break; + case "s-expr-comment": // s-expr commenting mode + state.mode = false; + if(stream.peek() == "(" || stream.peek() == "["){ + // actually start scheme s-expr commenting mode + state.sExprComment = 0; + }else{ + // if not we just comment the entire of the next token + stream.eatWhile(/[^/s]/); // eat non spaces + returnType = COMMENT; + break; + } + default: // default parsing mode + var ch = stream.next(); + + if (ch == "\"") { + state.mode = "string"; + returnType = STRING; + + } else if (ch == "'") { + returnType = ATOM; + } else if (ch == '#') { + if (stream.eat("|")) { // Multi-line comment + state.mode = "comment"; // toggle to comment mode + returnType = COMMENT; + } else if (stream.eat(/[tf]/)) { // #t/#f (atom) + returnType = ATOM; + } else if (stream.eat(';')) { // S-Expr comment + state.mode = "s-expr-comment"; + returnType = COMMENT; + } + + } else if (ch == ";") { // comment + stream.skipToEnd(); // rest of the line is a comment + returnType = COMMENT; + } else if (ch == "-"){ + + if(!isNaN(parseInt(stream.peek()))){ + stream.eatWhile(/[\/0-9]/); + returnType = NUMBER; + }else{ + returnType = null; + } + } else if (isNumber(ch,stream)){ + returnType = NUMBER; + } else if (ch == "(" || ch == "[") { + var keyWord = ''; var indentTemp = stream.column(); + /** + Either + (indent-word .. + (non-indent-word .. + (;something else, bracket, etc. + */ + + while ((letter = stream.eat(/[^\s\(\[\;\)\]]/)) != null) { + keyWord += letter; + } + + if (keyWord.length > 0 && indentKeys.propertyIsEnumerable(keyWord)) { // indent-word + + pushStack(state, indentTemp + INDENT_WORD_SKIP, ch); + } else { // non-indent word + // we continue eating the spaces + stream.eatSpace(); + if (stream.eol() || stream.peek() == ";") { + // nothing significant after + // we restart indentation 1 space after + pushStack(state, indentTemp + 1, ch); + } else { + pushStack(state, indentTemp + stream.current().length, ch); // else we match + } + } + stream.backUp(stream.current().length - 1); // undo all the eating + + if(typeof state.sExprComment == "number") state.sExprComment++; + + returnType = BRACKET; + } else if (ch == ")" || ch == "]") { + returnType = BRACKET; + if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : "[")) { + popStack(state); + + if(typeof state.sExprComment == "number"){ + if(--state.sExprComment == 0){ + returnType = COMMENT; // final closing bracket + state.sExprComment = false; // turn off s-expr commenting mode + } + } + } + } else { + stream.eatWhile(/[\w\$_\-]/); + + if (keywords && keywords.propertyIsEnumerable(stream.current())) { + returnType = BUILTIN; + }else returnType = null; + } + } + return (typeof state.sExprComment == "number") ? COMMENT : returnType; + }, + + indent: function (state, textAfter) { + if (state.indentStack == null) return state.indentation; + return state.indentStack.indent; + } + }; +}); + +CodeMirror.defineMIME("text/x-scheme", "scheme"); \ No newline at end of file diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/smalltalk/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/smalltalk/index.html new file mode 100644 index 00000000..8a85c39e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/smalltalk/index.html @@ -0,0 +1,55 @@ + + + + CodeMirror: Smalltalk mode + + + + + + + +

    CodeMirror: Smalltalk mode

    + +
    + + + +

    Simple Smalltalk mode.

    + +

    MIME types defined: text/x-stsrc.

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/smalltalk/smalltalk.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/smalltalk/smalltalk.js new file mode 100644 index 00000000..e5893322 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/smalltalk/smalltalk.js @@ -0,0 +1,139 @@ +CodeMirror.defineMode('smalltalk', function(config, modeConfig) { + + var specialChars = /[+\-/\\*~<>=@%|&?!.:;^]/; + var keywords = /true|false|nil|self|super|thisContext/; + + var Context = function(tokenizer, parent) { + this.next = tokenizer; + this.parent = parent; + }; + + var Token = function(name, context, eos) { + this.name = name; + this.context = context; + this.eos = eos; + }; + + var State = function() { + this.context = new Context(next, null); + this.expectVariable = true; + this.indentation = 0; + this.userIndentationDelta = 0; + }; + + State.prototype.userIndent = function(indentation) { + this.userIndentationDelta = indentation > 0 ? (indentation / config.indentUnit - this.indentation) : 0; + }; + + var next = function(stream, context, state) { + var token = new Token(null, context, false); + var aChar = stream.next(); + + if (aChar === '"') { + token = nextComment(stream, new Context(nextComment, context)); + + } else if (aChar === '\'') { + token = nextString(stream, new Context(nextString, context)); + + } else if (aChar === '#') { + stream.eatWhile(/[^ .]/); + token.name = 'string-2'; + + } else if (aChar === '$') { + stream.eatWhile(/[^ ]/); + token.name = 'string-2'; + + } else if (aChar === '|' && state.expectVariable) { + token.context = new Context(nextTemporaries, context); + + } else if (/[\[\]{}()]/.test(aChar)) { + token.name = 'bracket'; + token.eos = /[\[{(]/.test(aChar); + + if (aChar === '[') { + state.indentation++; + } else if (aChar === ']') { + state.indentation = Math.max(0, state.indentation - 1); + } + + } else if (specialChars.test(aChar)) { + stream.eatWhile(specialChars); + token.name = 'operator'; + token.eos = aChar !== ';'; // ; cascaded message expression + + } else if (/\d/.test(aChar)) { + stream.eatWhile(/[\w\d]/); + token.name = 'number' + + } else if (/[\w_]/.test(aChar)) { + stream.eatWhile(/[\w\d_]/); + token.name = state.expectVariable ? (keywords.test(stream.current()) ? 'keyword' : 'variable') : null; + + } else { + token.eos = state.expectVariable; + } + + return token; + }; + + var nextComment = function(stream, context) { + stream.eatWhile(/[^"]/); + return new Token('comment', stream.eat('"') ? context.parent : context, true); + }; + + var nextString = function(stream, context) { + stream.eatWhile(/[^']/); + return new Token('string', stream.eat('\'') ? context.parent : context, false); + }; + + var nextTemporaries = function(stream, context, state) { + var token = new Token(null, context, false); + var aChar = stream.next(); + + if (aChar === '|') { + token.context = context.parent; + token.eos = true; + + } else { + stream.eatWhile(/[^|]/); + token.name = 'variable'; + } + + return token; + } + + return { + startState: function() { + return new State; + }, + + token: function(stream, state) { + state.userIndent(stream.indentation()); + + if (stream.eatSpace()) { + return null; + } + + var token = state.context.next(stream, state.context, state); + state.context = token.context; + state.expectVariable = token.eos; + + state.lastToken = token; + return token.name; + }, + + blankLine: function(state) { + state.userIndent(0); + }, + + indent: function(state, textAfter) { + var i = state.context.next === next && textAfter && textAfter.charAt(0) === ']' ? -1 : state.userIndentationDelta; + return (state.indentation + i) * config.indentUnit; + }, + + electricChars: ']' + }; + +}); + +CodeMirror.defineMIME('text/x-stsrc', {name: 'smalltalk'}); \ No newline at end of file diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/smarty/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/smarty/index.html new file mode 100644 index 00000000..ad4dccf0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/smarty/index.html @@ -0,0 +1,82 @@ + + + + CodeMirror: Smarty mode + + + + + + + +

    CodeMirror: Smarty mode

    + +
    + + + +
    + +
    + + + +

    A plain text/Smarty mode which allows for custom delimiter tags (defaults to { and }).

    + +

    MIME types defined: text/x-smarty

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/smarty/smarty.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/smarty/smarty.js new file mode 100644 index 00000000..9da7da62 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/smarty/smarty.js @@ -0,0 +1,148 @@ +CodeMirror.defineMode("smarty", function(config, parserConfig) { + var keyFuncs = ["debug", "extends", "function", "include", "literal"]; + var last; + var regs = { + operatorChars: /[+\-*&%=<>!?]/, + validIdentifier: /[a-zA-Z0-9\_]/, + stringChar: /[\'\"]/ + } + var leftDelim = (typeof config.mode.leftDelimiter != 'undefined') ? config.mode.leftDelimiter : "{"; + var rightDelim = (typeof config.mode.rightDelimiter != 'undefined') ? config.mode.rightDelimiter : "}"; + function ret(style, lst) { last = lst; return style; } + + + function tokenizer(stream, state) { + function chain(parser) { + state.tokenize = parser; + return parser(stream, state); + } + + if (stream.match(leftDelim, true)) { + if (stream.eat("*")) { + return chain(inBlock("comment", "*" + rightDelim)); + } + else { + state.tokenize = inSmarty; + return "tag"; + } + } + else { + // I'd like to do an eatWhile() here, but I can't get it to eat only up to the rightDelim string/char + stream.next(); + return null; + } + } + + function inSmarty(stream, state) { + if (stream.match(rightDelim, true)) { + state.tokenize = tokenizer; + return ret("tag", null); + } + + var ch = stream.next(); + if (ch == "$") { + stream.eatWhile(regs.validIdentifier); + return ret("variable-2", "variable"); + } + else if (ch == ".") { + return ret("operator", "property"); + } + else if (regs.stringChar.test(ch)) { + state.tokenize = inAttribute(ch); + return ret("string", "string"); + } + else if (regs.operatorChars.test(ch)) { + stream.eatWhile(regs.operatorChars); + return ret("operator", "operator"); + } + else if (ch == "[" || ch == "]") { + return ret("bracket", "bracket"); + } + else if (/\d/.test(ch)) { + stream.eatWhile(/\d/); + return ret("number", "number"); + } + else { + if (state.last == "variable") { + if (ch == "@") { + stream.eatWhile(regs.validIdentifier); + return ret("property", "property"); + } + else if (ch == "|") { + stream.eatWhile(regs.validIdentifier); + return ret("qualifier", "modifier"); + } + } + else if (state.last == "whitespace") { + stream.eatWhile(regs.validIdentifier); + return ret("attribute", "modifier"); + } + else if (state.last == "property") { + stream.eatWhile(regs.validIdentifier); + return ret("property", null); + } + else if (/\s/.test(ch)) { + last = "whitespace"; + return null; + } + + var str = ""; + if (ch != "/") { + str += ch; + } + var c = ""; + while ((c = stream.eat(regs.validIdentifier))) { + str += c; + } + var i, j; + for (i=0, j=keyFuncs.length; i + + + CodeMirror: SPARQL mode + + + + + + + +

    CodeMirror: SPARQL mode

    +
    + + +

    MIME types defined: application/x-sparql-query.

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/sparql/sparql.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/sparql/sparql.js new file mode 100644 index 00000000..ceb52942 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/sparql/sparql.js @@ -0,0 +1,143 @@ +CodeMirror.defineMode("sparql", function(config) { + var indentUnit = config.indentUnit; + var curPunc; + + function wordRegexp(words) { + return new RegExp("^(?:" + words.join("|") + ")$", "i"); + } + var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri", + "isblank", "isliteral", "union", "a"]); + var keywords = wordRegexp(["base", "prefix", "select", "distinct", "reduced", "construct", "describe", + "ask", "from", "named", "where", "order", "limit", "offset", "filter", "optional", + "graph", "by", "asc", "desc"]); + var operatorChars = /[*+\-<>=&|]/; + + function tokenBase(stream, state) { + var ch = stream.next(); + curPunc = null; + if (ch == "$" || ch == "?") { + stream.match(/^[\w\d]*/); + return "variable-2"; + } + else if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) { + stream.match(/^[^\s\u00a0>]*>?/); + return "atom"; + } + else if (ch == "\"" || ch == "'") { + state.tokenize = tokenLiteral(ch); + return state.tokenize(stream, state); + } + else if (/[{}\(\),\.;\[\]]/.test(ch)) { + curPunc = ch; + return null; + } + else if (ch == "#") { + stream.skipToEnd(); + return "comment"; + } + else if (operatorChars.test(ch)) { + stream.eatWhile(operatorChars); + return null; + } + else if (ch == ":") { + stream.eatWhile(/[\w\d\._\-]/); + return "atom"; + } + else { + stream.eatWhile(/[_\w\d]/); + if (stream.eat(":")) { + stream.eatWhile(/[\w\d_\-]/); + return "atom"; + } + var word = stream.current(), type; + if (ops.test(word)) + return null; + else if (keywords.test(word)) + return "keyword"; + else + return "variable"; + } + } + + function tokenLiteral(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) { + state.tokenize = tokenBase; + break; + } + escaped = !escaped && ch == "\\"; + } + return "string"; + }; + } + + function pushContext(state, type, col) { + state.context = {prev: state.context, indent: state.indent, col: col, type: type}; + } + function popContext(state) { + state.indent = state.context.indent; + state.context = state.context.prev; + } + + return { + startState: function(base) { + return {tokenize: tokenBase, + context: null, + indent: 0, + col: 0}; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (state.context && state.context.align == null) state.context.align = false; + state.indent = stream.indentation(); + } + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + + if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") { + state.context.align = true; + } + + if (curPunc == "(") pushContext(state, ")", stream.column()); + else if (curPunc == "[") pushContext(state, "]", stream.column()); + else if (curPunc == "{") pushContext(state, "}", stream.column()); + else if (/[\]\}\)]/.test(curPunc)) { + while (state.context && state.context.type == "pattern") popContext(state); + if (state.context && curPunc == state.context.type) popContext(state); + } + else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state); + else if (/atom|string|variable/.test(style) && state.context) { + if (/[\}\]]/.test(state.context.type)) + pushContext(state, "pattern", stream.column()); + else if (state.context.type == "pattern" && !state.context.align) { + state.context.align = true; + state.context.col = stream.column(); + } + } + + return style; + }, + + indent: function(state, textAfter) { + var firstChar = textAfter && textAfter.charAt(0); + var context = state.context; + if (/[\]\}]/.test(firstChar)) + while (context && context.type == "pattern") context = context.prev; + + var closing = context && firstChar == context.type; + if (!context) + return 0; + else if (context.type == "pattern") + return context.col; + else if (context.align) + return context.col + (closing ? 0 : 1); + else + return context.indent + (closing ? 0 : indentUnit); + } + }; +}); + +CodeMirror.defineMIME("application/x-sparql-query", "sparql"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/stex/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/stex/index.html new file mode 100644 index 00000000..e49289e9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/stex/index.html @@ -0,0 +1,95 @@ + + + + CodeMirror: sTeX mode + + + + + + + +

    CodeMirror: sTeX mode

    +
    + + +

    MIME types defined: text/x-stex.

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/stex/stex.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/stex/stex.js new file mode 100644 index 00000000..b89e619e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/stex/stex.js @@ -0,0 +1,180 @@ +/* + * Author: Constantin Jucovschi (c.jucovschi@jacobs-university.de) + * Licence: MIT + */ + +CodeMirror.defineMode("stex", function(cmCfg, modeCfg) +{ + function pushCommand(state, command) { + state.cmdState.push(command); + } + + function peekCommand(state) { + if (state.cmdState.length>0) + return state.cmdState[state.cmdState.length-1]; + else + return null; + } + + function popCommand(state) { + if (state.cmdState.length>0) { + var plug = state.cmdState.pop(); + plug.closeBracket(); + } + } + + function applyMostPowerful(state) { + var context = state.cmdState; + for (var i = context.length - 1; i >= 0; i--) { + var plug = context[i]; + if (plug.name=="DEFAULT") + continue; + return plug.styleIdentifier(); + } + return null; + } + + function addPluginPattern(pluginName, cmdStyle, brackets, styles) { + return function () { + this.name=pluginName; + this.bracketNo = 0; + this.style=cmdStyle; + this.styles = styles; + this.brackets = brackets; + + this.styleIdentifier = function(content) { + if (this.bracketNo<=this.styles.length) + return this.styles[this.bracketNo-1]; + else + return null; + }; + this.openBracket = function(content) { + this.bracketNo++; + return "bracket"; + }; + this.closeBracket = function(content) { + }; + } + } + + var plugins = new Array(); + + plugins["importmodule"] = addPluginPattern("importmodule", "tag", "{[", ["string", "builtin"]); + plugins["documentclass"] = addPluginPattern("documentclass", "tag", "{[", ["", "atom"]); + plugins["usepackage"] = addPluginPattern("documentclass", "tag", "[", ["atom"]); + plugins["begin"] = addPluginPattern("documentclass", "tag", "[", ["atom"]); + plugins["end"] = addPluginPattern("documentclass", "tag", "[", ["atom"]); + + plugins["DEFAULT"] = function () { + this.name="DEFAULT"; + this.style="tag"; + + this.styleIdentifier = function(content) { + }; + this.openBracket = function(content) { + }; + this.closeBracket = function(content) { + }; + }; + + function setState(state, f) { + state.f = f; + } + + function normal(source, state) { + if (source.match(/^\\[a-zA-Z@]+/)) { + var cmdName = source.current(); + cmdName = cmdName.substr(1, cmdName.length-1); + var plug = plugins[cmdName]; + if (typeof(plug) == 'undefined') { + plug = plugins["DEFAULT"]; + } + plug = new plug(); + pushCommand(state, plug); + setState(state, beginParams); + return plug.style; + } + + // escape characters + if (source.match(/^\\[$&%#{}_]/)) { + return "tag"; + } + + // white space control characters + if (source.match(/^\\[,;!\/]/)) { + return "tag"; + } + + var ch = source.next(); + if (ch == "%") { + // special case: % at end of its own line; stay in same state + if (!source.eol()) { + setState(state, inCComment); + } + return "comment"; + } + else if (ch=='}' || ch==']') { + plug = peekCommand(state); + if (plug) { + plug.closeBracket(ch); + setState(state, beginParams); + } else + return "error"; + return "bracket"; + } else if (ch=='{' || ch=='[') { + plug = plugins["DEFAULT"]; + plug = new plug(); + pushCommand(state, plug); + return "bracket"; + } + else if (/\d/.test(ch)) { + source.eatWhile(/[\w.%]/); + return "atom"; + } + else { + source.eatWhile(/[\w-_]/); + return applyMostPowerful(state); + } + } + + function inCComment(source, state) { + source.skipToEnd(); + setState(state, normal); + return "comment"; + } + + function beginParams(source, state) { + var ch = source.peek(); + if (ch == '{' || ch == '[') { + var lastPlug = peekCommand(state); + var style = lastPlug.openBracket(ch); + source.eat(ch); + setState(state, normal); + return "bracket"; + } + if (/[ \t\r]/.test(ch)) { + source.eat(ch); + return null; + } + setState(state, normal); + lastPlug = peekCommand(state); + if (lastPlug) { + popCommand(state); + } + return normal(source, state); + } + + return { + startState: function() { return { f:normal, cmdState:[] }; }, + copyState: function(s) { return { f: s.f, cmdState: s.cmdState.slice(0, s.cmdState.length) }; }, + + token: function(stream, state) { + var t = state.f(stream, state); + var w = stream.current(); + return t; + } + }; +}); + + +CodeMirror.defineMIME("text/x-stex", "stex"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/stex/test.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/stex/test.html new file mode 100644 index 00000000..b53a6a24 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/stex/test.html @@ -0,0 +1,251 @@ + + + + CodeMirror: sTeX mode + + + + + + + + +

    Tests for the sTeX Mode

    +

    Basics

    + + +

    Tags

    + + +

    Comments

    + + +

    Errors

    + + +

    Character Escapes

    + + +

    Spacing control

    + + + +

    Summary

    + + + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/tiddlywiki/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/tiddlywiki/index.html new file mode 100644 index 00000000..2f7da0e0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/tiddlywiki/index.html @@ -0,0 +1,140 @@ + + + + CodeMirror: TiddlyWiki mode + + + + + + + + +

    CodeMirror: TiddlyWiki mode

    + +
    + + + +

    TiddlyWiki mode supports a single configuration.

    + +

    MIME types defined: text/x-tiddlywiki.

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/tiddlywiki/tiddlywiki.css b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/tiddlywiki/tiddlywiki.css new file mode 100644 index 00000000..dba05c0f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/tiddlywiki/tiddlywiki.css @@ -0,0 +1,21 @@ +.cm-s-default span.cm-header {color: blue; font-weight:bold;} +.cm-s-default span.cm-code {color: #a50;} +.cm-s-default span.cm-code-inline {color: #660;} + +.cm-s-default span.cm-quote {color: #555;} +.cm-s-default span.cm-list {color: #c60;} +.cm-s-default span.cm-hr {color: #999;} +.cm-s-default span.cm-em {font-style: italic;} +.cm-s-default span.cm-strong {font-weight: bold;} + +.cm-s-default span.cm-link-external {color: blue;} +.cm-s-default span.cm-brace {color: #170; font-weight: bold;} +.cm-s-default span.cm-macro {color: #9E3825;} +.cm-s-default span.cm-table {color: blue; font-weight: bold;} +.cm-s-default span.cm-warning {color: red; font-weight: bold;} + +.cm-s-default span.cm-underlined {text-decoration: underline;} +.cm-s-default span.cm-line-through {text-decoration: line-through;} + +.cm-s-default span.cm-comment {color: #666;} + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/tiddlywiki/tiddlywiki.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/tiddlywiki/tiddlywiki.js new file mode 100644 index 00000000..1d26967e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/tiddlywiki/tiddlywiki.js @@ -0,0 +1,384 @@ +/*** +|''Name''|tiddlywiki.js| +|''Description''|Enables TiddlyWikiy syntax highlighting using CodeMirror| +|''Author''|PMario| +|''Version''|0.1.7| +|''Status''|''stable''| +|''Source''|[[GitHub|https://github.com/pmario/CodeMirror2/blob/tw-syntax/mode/tiddlywiki]]| +|''Documentation''|http://codemirror.tiddlyspace.com/| +|''License''|[[MIT License|http://www.opensource.org/licenses/mit-license.php]]| +|''CoreVersion''|2.5.0| +|''Requires''|codemirror.js| +|''Keywords''|syntax highlighting color code mirror codemirror| +! Info +CoreVersion parameter is needed for TiddlyWiki only! +***/ +//{{{ +CodeMirror.defineMode("tiddlywiki", function (config, parserConfig) { + var indentUnit = config.indentUnit; + + // Tokenizer + var textwords = function () { + function kw(type) { + return { + type: type, + style: "text" + }; + } + return {}; + }(); + + var keywords = function () { + function kw(type) { + return { type: type, style: "macro"}; + } + return { + "allTags": kw('allTags'), "closeAll": kw('closeAll'), "list": kw('list'), + "newJournal": kw('newJournal'), "newTiddler": kw('newTiddler'), + "permaview": kw('permaview'), "saveChanges": kw('saveChanges'), + "search": kw('search'), "slider": kw('slider'), "tabs": kw('tabs'), + "tag": kw('tag'), "tagging": kw('tagging'), "tags": kw('tags'), + "tiddler": kw('tiddler'), "timeline": kw('timeline'), + "today": kw('today'), "version": kw('version'), "option": kw('option'), + + "with": kw('with'), + "filter": kw('filter') + }; + }(); + + var isSpaceName = /[\w_\-]/i, + reHR = /^\-\-\-\-+$/, //
    + reWikiCommentStart = /^\/\*\*\*$/, // /*** + reWikiCommentStop = /^\*\*\*\/$/, // ***/ + reBlockQuote = /^<<<$/, + + reJsCodeStart = /^\/\/\{\{\{$/, // //{{{ js block start + reJsCodeStop = /^\/\/\}\}\}$/, // //}}} js stop + reXmlCodeStart = /^$/, // xml block start + reXmlCodeStop = /^$/, // xml stop + + reCodeBlockStart = /^\{\{\{$/, // {{{ TW text div block start + reCodeBlockStop = /^\}\}\}$/, // }}} TW text stop + + reCodeStart = /\{\{\{/, // {{{ code span start + reUntilCodeStop = /.*?\}\}\}/; + + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + + // used for strings + function nextUntilUnescaped(stream, end) { + var escaped = false, + next; + while ((next = stream.next()) != null) { + if (next == end && !escaped) return false; + escaped = !escaped && next == "\\"; + } + return escaped; + } + + // Used as scratch variables to communicate multiple values without + // consing up tons of objects. + var type, content; + + function ret(tp, style, cont) { + type = tp; + content = cont; + return style; + } + + function jsTokenBase(stream, state) { + var sol = stream.sol(), + ch, tch; + + state.block = false; // indicates the start of a code block. + + ch = stream.peek(); // don't eat, to make matching simpler + + // check start of blocks + if (sol && /[<\/\*{}\-]/.test(ch)) { + if (stream.match(reCodeBlockStart)) { + state.block = true; + return chain(stream, state, twTokenCode); + } + if (stream.match(reBlockQuote)) { + return ret('quote', 'quote'); + } + if (stream.match(reWikiCommentStart) || stream.match(reWikiCommentStop)) { + return ret('code', 'code'); + } + if (stream.match(reJsCodeStart) || stream.match(reJsCodeStop) || stream.match(reXmlCodeStart) || stream.match(reXmlCodeStop)) { + return ret('code', 'code'); + } + if (stream.match(reHR)) { + return ret('hr', 'hr'); + } + } // sol + ch = stream.next(); + + if (sol && /[\/\*!#;:>|]/.test(ch)) { + if (ch == "!") { // tw header + stream.skipToEnd(); + return ret("header", "header"); + } + if (ch == "*") { // tw list + stream.eatWhile('*'); + return ret("list", "list"); + } + if (ch == "#") { // tw numbered list + stream.eatWhile('#'); + return ret("list", "list"); + } + if (ch == ";") { // definition list, term + stream.eatWhile(';'); + return ret("list", "list"); + } + if (ch == ":") { // definition list, description + stream.eatWhile(':'); + return ret("list", "list"); + } + if (ch == ">") { // single line quote + stream.eatWhile(">"); + return ret("quote", "quote"); + } + if (ch == '|') { + return ret('table', 'table'); + } + } + + if (ch == '{' && stream.match(/\{\{/)) { + return chain(stream, state, twTokenCode); + } + + // rudimentary html:// file:// link matching. TW knows much more ... + if (/[hf]/i.test(ch)) { + if (/[ti]/i.test(stream.peek()) && stream.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i)) { + return ret("link-external", "link-external"); + } + } + // just a little string indicator, don't want to have the whole string covered + if (ch == '"') { + return ret('string', 'string'); + } + if (ch == '~') { // _no_ CamelCase indicator should be bold + return ret('text', 'brace'); + } + if (/[\[\]]/.test(ch)) { // check for [[..]] + if (stream.peek() == ch) { + stream.next(); + return ret('brace', 'brace'); + } + } + if (ch == "@") { // check for space link. TODO fix @@...@@ highlighting + stream.eatWhile(isSpaceName); + return ret("link-external", "link-external"); + } + if (/\d/.test(ch)) { // numbers + stream.eatWhile(/\d/); + return ret("number", "number"); + } + if (ch == "/") { // tw invisible comment + if (stream.eat("%")) { + return chain(stream, state, twTokenComment); + } + else if (stream.eat("/")) { // + return chain(stream, state, twTokenEm); + } + } + if (ch == "_") { // tw underline + if (stream.eat("_")) { + return chain(stream, state, twTokenUnderline); + } + } + // strikethrough and mdash handling + if (ch == "-") { + if (stream.eat("-")) { + // if strikethrough looks ugly, change CSS. + if (stream.peek() != ' ') + return chain(stream, state, twTokenStrike); + // mdash + if (stream.peek() == ' ') + return ret('text', 'brace'); + } + } + if (ch == "'") { // tw bold + if (stream.eat("'")) { + return chain(stream, state, twTokenStrong); + } + } + if (ch == "<") { // tw macro + if (stream.eat("<")) { + return chain(stream, state, twTokenMacro); + } + } + else { + return ret(ch); + } + + // core macro handling + stream.eatWhile(/[\w\$_]/); + var word = stream.current(), + known = textwords.propertyIsEnumerable(word) && textwords[word]; + + return known ? ret(known.type, known.style, word) : ret("text", null, word); + + } // jsTokenBase() + + function twTokenString(quote) { + return function (stream, state) { + if (!nextUntilUnescaped(stream, quote)) state.tokenize = jsTokenBase; + return ret("string", "string"); + }; + } + + // tw invisible comment + function twTokenComment(stream, state) { + var maybeEnd = false, + ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = jsTokenBase; + break; + } + maybeEnd = (ch == "%"); + } + return ret("comment", "comment"); + } + + // tw strong / bold + function twTokenStrong(stream, state) { + var maybeEnd = false, + ch; + while (ch = stream.next()) { + if (ch == "'" && maybeEnd) { + state.tokenize = jsTokenBase; + break; + } + maybeEnd = (ch == "'"); + } + return ret("text", "strong"); + } + + // tw code + function twTokenCode(stream, state) { + var ch, sb = state.block; + + if (sb && stream.current()) { + return ret("code", "code"); + } + + if (!sb && stream.match(reUntilCodeStop)) { + state.tokenize = jsTokenBase; + return ret("code", "code-inline"); + } + + if (sb && stream.sol() && stream.match(reCodeBlockStop)) { + state.tokenize = jsTokenBase; + return ret("code", "code"); + } + + ch = stream.next(); + return (sb) ? ret("code", "code") : ret("code", "code-inline"); + } + + // tw em / italic + function twTokenEm(stream, state) { + var maybeEnd = false, + ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = jsTokenBase; + break; + } + maybeEnd = (ch == "/"); + } + return ret("text", "em"); + } + + // tw underlined text + function twTokenUnderline(stream, state) { + var maybeEnd = false, + ch; + while (ch = stream.next()) { + if (ch == "_" && maybeEnd) { + state.tokenize = jsTokenBase; + break; + } + maybeEnd = (ch == "_"); + } + return ret("text", "underlined"); + } + + // tw strike through text looks ugly + // change CSS if needed + function twTokenStrike(stream, state) { + var maybeEnd = false, + ch, nr; + + while (ch = stream.next()) { + if (ch == "-" && maybeEnd) { + state.tokenize = jsTokenBase; + break; + } + maybeEnd = (ch == "-"); + } + return ret("text", "line-through"); + } + + // macro + function twTokenMacro(stream, state) { + var ch, tmp, word, known; + + if (stream.current() == '<<') { + return ret('brace', 'macro'); + } + + ch = stream.next(); + if (!ch) { + state.tokenize = jsTokenBase; + return ret(ch); + } + if (ch == ">") { + if (stream.peek() == '>') { + stream.next(); + state.tokenize = jsTokenBase; + return ret("brace", "macro"); + } + } + + stream.eatWhile(/[\w\$_]/); + word = stream.current(); + known = keywords.propertyIsEnumerable(word) && keywords[word]; + + if (known) { + return ret(known.type, known.style, word); + } + else { + return ret("macro", null, word); + } + } + + // Interface + return { + startState: function (basecolumn) { + return { + tokenize: jsTokenBase, + indented: 0, + level: 0 + }; + }, + + token: function (stream, state) { + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + return style; + }, + + electricChars: "" + }; +}); + +CodeMirror.defineMIME("text/x-tiddlywiki", "tiddlywiki"); +//}}} diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/vbscript/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/vbscript/index.html new file mode 100644 index 00000000..dd207cae --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/vbscript/index.html @@ -0,0 +1,42 @@ + + + + CodeMirror: VBScript mode + + + + + + + +

    CodeMirror: VBScript mode

    + +
    + + + +

    MIME types defined: text/vbscript.

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/vbscript/vbscript.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/vbscript/vbscript.js new file mode 100644 index 00000000..65d6c212 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/vbscript/vbscript.js @@ -0,0 +1,26 @@ +CodeMirror.defineMode("vbscript", function() { + var regexVBScriptKeyword = /^(?:Call|Case|CDate|Clear|CInt|CLng|Const|CStr|Description|Dim|Do|Each|Else|ElseIf|End|Err|Error|Exit|False|For|Function|If|LCase|Loop|LTrim|Next|Nothing|Now|Number|On|Preserve|Quit|ReDim|Resume|RTrim|Select|Set|Sub|Then|To|Trim|True|UBound|UCase|Until|VbCr|VbCrLf|VbLf|VbTab)$/im; + + return { + token: function(stream) { + if (stream.eatSpace()) return null; + var ch = stream.next(); + if (ch == "'") { + stream.skipToEnd(); + return "comment"; + } + if (ch == '"') { + stream.skipTo('"'); + return "string"; + } + + if (/\w/.test(ch)) { + stream.eatWhile(/\w/); + if (regexVBScriptKeyword.test(stream.current())) return "keyword"; + } + return null; + } + }; +}); + +CodeMirror.defineMIME("text/vbscript", "vbscript"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/velocity/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/velocity/index.html new file mode 100644 index 00000000..49dba382 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/velocity/index.html @@ -0,0 +1,103 @@ + + + + CodeMirror: Velocity mode + + + + + + + + +

    CodeMirror: Velocity mode

    +
    + + +

    MIME types defined: text/velocity.

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/velocity/velocity.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/velocity/velocity.js new file mode 100644 index 00000000..0b80c758 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/velocity/velocity.js @@ -0,0 +1,146 @@ +CodeMirror.defineMode("velocity", function(config) { + function parseWords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + var indentUnit = config.indentUnit + var keywords = parseWords("#end #else #break #stop #[[ #]] " + + "#{end} #{else} #{break} #{stop}"); + var functions = parseWords("#if #elseif #foreach #set #include #parse #macro #define #evaluate " + + "#{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}"); + var specials = parseWords("$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent $velocityCount"); + var isOperatorChar = /[+\-*&%=<>!?:\/|]/; + var multiLineStrings =true; + + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + function tokenBase(stream, state) { + var beforeParams = state.beforeParams; + state.beforeParams = false; + var ch = stream.next(); + // start of string? + if ((ch == '"' || ch == "'") && state.inParams) + return chain(stream, state, tokenString(ch)); + // is it one of the special signs []{}().,;? Seperator? + else if (/[\[\]{}\(\),;\.]/.test(ch)) { + if (ch == "(" && beforeParams) state.inParams = true; + else if (ch == ")") state.inParams = false; + return null; + } + // start of a number value? + else if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return "number"; + } + // multi line comment? + else if (ch == "#" && stream.eat("*")) { + return chain(stream, state, tokenComment); + } + // unparsed content? + else if (ch == "#" && stream.match(/ *\[ *\[/)) { + return chain(stream, state, tokenUnparsed); + } + // single line comment? + else if (ch == "#" && stream.eat("#")) { + stream.skipToEnd(); + return "comment"; + } + // variable? + else if (ch == "$") { + stream.eatWhile(/[\w\d\$_\.{}]/); + // is it one of the specials? + if (specials && specials.propertyIsEnumerable(stream.current().toLowerCase())) { + return "keyword"; + } + else { + state.beforeParams = true; + return "builtin"; + } + } + // is it a operator? + else if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + else { + // get the whole word + stream.eatWhile(/[\w\$_{}]/); + var word = stream.current().toLowerCase(); + // is it one of the listed keywords? + if (keywords && keywords.propertyIsEnumerable(word)) + return "keyword"; + // is it one of the listed functions? + if (functions && functions.propertyIsEnumerable(word) || + stream.current().match(/^#[a-z0-9_]+ *$/i) && stream.peek()=="(") { + state.beforeParams = true; + return "keyword"; + } + // default: just a "word" + return null; + } + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) { + end = true; + break; + } + escaped = !escaped && next == "\\"; + } + if (end) state.tokenize = tokenBase; + return "string"; + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "#" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function tokenUnparsed(stream, state) { + var maybeEnd = 0, ch; + while (ch = stream.next()) { + if (ch == "#" && maybeEnd == 2) { + state.tokenize = tokenBase; + break; + } + if (ch == "]") + maybeEnd++; + else if (ch != " ") + maybeEnd = 0; + } + return "meta"; + } + // Interface + + return { + startState: function(basecolumn) { + return { + tokenize: tokenBase, + beforeParams: false, + inParams: false + }; + }, + + token: function(stream, state) { + if (stream.eatSpace()) return null; + return state.tokenize(stream, state); + } + }; +}); + +CodeMirror.defineMIME("text/velocity", "velocity"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/verilog/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/verilog/index.html new file mode 100644 index 00000000..775dd537 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/verilog/index.html @@ -0,0 +1,210 @@ + + + + CodeMirror: Verilog mode + + + + + + + +

    CodeMirror: Verilog mode

    + +
    + + + +

    Simple mode that tries to handle Verilog-like languages as well as it + can. Takes one configuration parameters: keywords, an + object whose property names are the keywords in the language.

    + +

    MIME types defined: text/x-verilog (Verilog code).

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/verilog/verilog.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/verilog/verilog.js new file mode 100644 index 00000000..65a6cf71 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/verilog/verilog.js @@ -0,0 +1,194 @@ +CodeMirror.defineMode("verilog", function(config, parserConfig) { + var indentUnit = config.indentUnit, + keywords = parserConfig.keywords || {}, + blockKeywords = parserConfig.blockKeywords || {}, + atoms = parserConfig.atoms || {}, + hooks = parserConfig.hooks || {}, + multiLineStrings = parserConfig.multiLineStrings; + var isOperatorChar = /[&|~> + + + CodeMirror: XML mode + + + + + + + +

    CodeMirror: XML mode

    +
    + +

    The XML mode supports two configuration parameters:

    +
    +
    htmlMode (boolean)
    +
    This switches the mode to parse HTML instead of XML. This + means attributes do not have to be quoted, and some elements + (such as br) do not require a closing tag.
    +
    alignCDATA (boolean)
    +
    Setting this to true will force the opening tag of CDATA + blocks to not be indented.
    +
    + +

    MIME types defined: application/xml, text/html.

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xml/xml.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xml/xml.js new file mode 100644 index 00000000..d8f17efb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xml/xml.js @@ -0,0 +1,268 @@ +CodeMirror.defineMode("xml", function(config, parserConfig) { + var indentUnit = config.indentUnit; + var Kludges = parserConfig.htmlMode ? { + autoSelfClosers: {"br": true, "img": true, "hr": true, "link": true, "input": true, + "meta": true, "col": true, "frame": true, "base": true, "area": true}, + doNotIndent: {"pre": true}, + allowUnquoted: true, + allowMissing: false + } : {autoSelfClosers: {}, doNotIndent: {}, allowUnquoted: false, allowMissing: false}; + var alignCDATA = parserConfig.alignCDATA; + + // Return variables for tokenizers + var tagName, type; + + function inText(stream, state) { + function chain(parser) { + state.tokenize = parser; + return parser(stream, state); + } + + var ch = stream.next(); + if (ch == "<") { + if (stream.eat("!")) { + if (stream.eat("[")) { + if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>")); + else return null; + } + else if (stream.match("--")) return chain(inBlock("comment", "-->")); + else if (stream.match("DOCTYPE", true, true)) { + stream.eatWhile(/[\w\._\-]/); + return chain(doctype(1)); + } + else return null; + } + else if (stream.eat("?")) { + stream.eatWhile(/[\w\._\-]/); + state.tokenize = inBlock("meta", "?>"); + return "meta"; + } + else { + type = stream.eat("/") ? "closeTag" : "openTag"; + stream.eatSpace(); + tagName = ""; + var c; + while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c; + state.tokenize = inTag; + return "tag"; + } + } + else if (ch == "&") { + var ok; + if (stream.eat("#")) { + if (stream.eat("x")) { + ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";"); + } else { + ok = stream.eatWhile(/[\d]/) && stream.eat(";"); + } + } else { + ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";"); + } + return ok ? "atom" : "error"; + } + else { + stream.eatWhile(/[^&<]/); + return null; + } + } + + function inTag(stream, state) { + var ch = stream.next(); + if (ch == ">" || (ch == "/" && stream.eat(">"))) { + state.tokenize = inText; + type = ch == ">" ? "endTag" : "selfcloseTag"; + return "tag"; + } + else if (ch == "=") { + type = "equals"; + return null; + } + else if (/[\'\"]/.test(ch)) { + state.tokenize = inAttribute(ch); + return state.tokenize(stream, state); + } + else { + stream.eatWhile(/[^\s\u00a0=<>\"\'\/?]/); + return "word"; + } + } + + function inAttribute(quote) { + return function(stream, state) { + while (!stream.eol()) { + if (stream.next() == quote) { + state.tokenize = inTag; + break; + } + } + return "string"; + }; + } + + function inBlock(style, terminator) { + return function(stream, state) { + while (!stream.eol()) { + if (stream.match(terminator)) { + state.tokenize = inText; + break; + } + stream.next(); + } + return style; + }; + } + function doctype(depth) { + return function(stream, state) { + var ch; + while ((ch = stream.next()) != null) { + if (ch == "<") { + state.tokenize = doctype(depth + 1); + return state.tokenize(stream, state); + } else if (ch == ">") { + if (depth == 1) { + state.tokenize = inText; + break; + } else { + state.tokenize = doctype(depth - 1); + return state.tokenize(stream, state); + } + } + } + return "meta"; + }; + } + + var curState, setStyle; + function pass() { + for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]); + } + function cont() { + pass.apply(null, arguments); + return true; + } + + function pushContext(tagName, startOfLine) { + var noIndent = Kludges.doNotIndent.hasOwnProperty(tagName) || (curState.context && curState.context.noIndent); + curState.context = { + prev: curState.context, + tagName: tagName, + indent: curState.indented, + startOfLine: startOfLine, + noIndent: noIndent + }; + } + function popContext() { + if (curState.context) curState.context = curState.context.prev; + } + + function element(type) { + if (type == "openTag") { + curState.tagName = tagName; + return cont(attributes, endtag(curState.startOfLine)); + } else if (type == "closeTag") { + var err = false; + if (curState.context) { + err = curState.context.tagName != tagName; + } else { + err = true; + } + if (err) setStyle = "error"; + return cont(endclosetag(err)); + } + return cont(); + } + function endtag(startOfLine) { + return function(type) { + if (type == "selfcloseTag" || + (type == "endTag" && Kludges.autoSelfClosers.hasOwnProperty(curState.tagName.toLowerCase()))) + return cont(); + if (type == "endTag") {pushContext(curState.tagName, startOfLine); return cont();} + return cont(); + }; + } + function endclosetag(err) { + return function(type) { + if (err) setStyle = "error"; + if (type == "endTag") { popContext(); return cont(); } + setStyle = "error"; + return cont(arguments.callee); + } + } + + function attributes(type) { + if (type == "word") {setStyle = "attribute"; return cont(attribute, attributes);} + if (type == "endTag" || type == "selfcloseTag") return pass(); + setStyle = "error"; + return cont(attributes); + } + function attribute(type) { + if (type == "equals") return cont(attvalue, attributes); + if (!Kludges.allowMissing) setStyle = "error"; + return (type == "endTag" || type == "selfcloseTag") ? pass() : cont(); + } + function attvalue(type) { + if (type == "string") return cont(attvaluemaybe); + if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return cont();} + setStyle = "error"; + return (type == "endTag" || type == "selfCloseTag") ? pass() : cont(); + } + function attvaluemaybe(type) { + if (type == "string") return cont(attvaluemaybe); + else return pass(); + } + + return { + startState: function() { + return {tokenize: inText, cc: [], indented: 0, startOfLine: true, tagName: null, context: null}; + }, + + token: function(stream, state) { + if (stream.sol()) { + state.startOfLine = true; + state.indented = stream.indentation(); + } + if (stream.eatSpace()) return null; + + setStyle = type = tagName = null; + var style = state.tokenize(stream, state); + state.type = type; + if ((style || type) && style != "comment") { + curState = state; + while (true) { + var comb = state.cc.pop() || element; + if (comb(type || style)) break; + } + } + state.startOfLine = false; + return setStyle || style; + }, + + indent: function(state, textAfter, fullLine) { + var context = state.context; + if ((state.tokenize != inTag && state.tokenize != inText) || + context && context.noIndent) + return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0; + if (alignCDATA && / + + + CodeMirror: Pure XML mode + + + + + + + +

    CodeMirror: XML mode

    +
    + + +

    This is my XML parser, based on the original:

    +
      +
    • No html mode - this is pure xml
    • +
    • Illegal attributes and element names are errors
    • +
    • Attributes must have a value
    • +
    • XML declaration supported (e.g.: <?xml version="1.0" encoding="utf-8" standalone="no" ?>)
    • +
    • CDATA and comment blocks are not indented (except for their start-tag)
    • +
    • Better handling of errors per line with the state object - provides good infrastructure for extending it
    • +
    + +

    What's missing:

    +
      +
    • Make sure only a single root element exists at the document level
    • +
    • Multi-line attributes should NOT indent
    • +
    • Start tags are not painted red when they have no matching end tags (is this really wrong?)
    • +
    + +

    MIME types defined: application/xml, text/xml.

    + +

    @author: Dror BG (deebug.dev[at]gmail.com)
    +

    @date: August, 2011
    +

    @github: https://github.com/deebugger/CodeMirror2

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xmlpure/xmlpure.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xmlpure/xmlpure.js new file mode 100644 index 00000000..18d710cf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xmlpure/xmlpure.js @@ -0,0 +1,490 @@ +/** + * xmlpure.js + * + * Building upon and improving the CodeMirror 2 XML parser + * @author: Dror BG (deebug.dev@gmail.com) + * @date: August, 2011 + */ + +CodeMirror.defineMode("xmlpure", function(config, parserConfig) { + // constants + var STYLE_ERROR = "error"; + var STYLE_INSTRUCTION = "comment"; + var STYLE_COMMENT = "comment"; + var STYLE_ELEMENT_NAME = "tag"; + var STYLE_ATTRIBUTE = "attribute"; + var STYLE_WORD = "string"; + var STYLE_TEXT = "atom"; + var STYLE_ENTITIES = "string"; + + var TAG_INSTRUCTION = "!instruction"; + var TAG_CDATA = "!cdata"; + var TAG_COMMENT = "!comment"; + var TAG_TEXT = "!text"; + + var doNotIndent = { + "!cdata": true, + "!comment": true, + "!text": true, + "!instruction": true + }; + + // options + var indentUnit = config.indentUnit; + + /////////////////////////////////////////////////////////////////////////// + // helper functions + + // chain a parser to another parser + function chain(stream, state, parser) { + state.tokenize = parser; + return parser(stream, state); + } + + // parse a block (comment, CDATA or text) + function inBlock(style, terminator, nextTokenize) { + return function(stream, state) { + while (!stream.eol()) { + if (stream.match(terminator)) { + popContext(state); + state.tokenize = nextTokenize; + break; + } + stream.next(); + } + return style; + }; + } + + // go down a level in the document + // (hint: look at who calls this function to know what the contexts are) + function pushContext(state, tagName) { + var noIndent = doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.doIndent); + var newContext = { + tagName: tagName, + prev: state.context, + indent: state.context ? state.context.indent + indentUnit : 0, + lineNumber: state.lineNumber, + indented: state.indented, + noIndent: noIndent + }; + state.context = newContext; + } + + // go up a level in the document + function popContext(state) { + if (state.context) { + var oldContext = state.context; + state.context = oldContext.prev; + return oldContext; + } + + // we shouldn't be here - it means we didn't have a context to pop + return null; + } + + // return true if the current token is seperated from the tokens before it + // which means either this is the start of the line, or there is at least + // one space or tab character behind the token + // otherwise returns false + function isTokenSeparated(stream) { + return stream.sol() || + stream.string.charAt(stream.start - 1) == " " || + stream.string.charAt(stream.start - 1) == "\t"; + } + + /////////////////////////////////////////////////////////////////////////// + // context: document + // + // an XML document can contain: + // - a single declaration (if defined, it must be the very first line) + // - exactly one root element + // @todo try to actually limit the number of root elements to 1 + // - zero or more comments + function parseDocument(stream, state) { + if(stream.eat("<")) { + if(stream.eat("?")) { + // processing instruction + pushContext(state, TAG_INSTRUCTION); + state.tokenize = parseProcessingInstructionStartTag; + return STYLE_INSTRUCTION; + } else if(stream.match("!--")) { + // new context: comment + pushContext(state, TAG_COMMENT); + return chain(stream, state, inBlock(STYLE_COMMENT, "-->", parseDocument)); + } else if(stream.eatSpace() || stream.eol() ) { + stream.skipToEnd(); + return STYLE_ERROR; + } else { + // element + state.tokenize = parseElementTagName; + return STYLE_ELEMENT_NAME; + } + } + + // error on line + stream.skipToEnd(); + return STYLE_ERROR; + } + + /////////////////////////////////////////////////////////////////////////// + // context: XML element start-tag or end-tag + // + // - element start-tag can contain attributes + // - element start-tag may self-close (or start an element block if it doesn't) + // - element end-tag can contain only the tag name + function parseElementTagName(stream, state) { + // get the name of the tag + var startPos = stream.pos; + if(stream.match(/^[a-zA-Z_:][-a-zA-Z0-9_:.]*/)) { + // element start-tag + var tagName = stream.string.substring(startPos, stream.pos); + pushContext(state, tagName); + state.tokenize = parseElement; + return STYLE_ELEMENT_NAME; + } else if(stream.match(/^\/[a-zA-Z_:][-a-zA-Z0-9_:.]*( )*>/)) { + // element end-tag + var endTagName = stream.string.substring(startPos + 1, stream.pos - 1).trim(); + var oldContext = popContext(state); + state.tokenize = state.context == null ? parseDocument : parseElementBlock; + if(oldContext == null || endTagName != oldContext.tagName) { + // the start and end tag names should match - error + return STYLE_ERROR; + } + return STYLE_ELEMENT_NAME; + } else { + // no tag name - error + state.tokenize = state.context == null ? parseDocument : parseElementBlock; + stream.eatWhile(/[^>]/); + stream.eat(">"); + return STYLE_ERROR; + } + + stream.skipToEnd(); + return null; + } + + function parseElement(stream, state) { + if(stream.match(/^\/>/)) { + // self-closing tag + popContext(state); + state.tokenize = state.context == null ? parseDocument : parseElementBlock; + return STYLE_ELEMENT_NAME; + } else if(stream.eat(/^>/)) { + state.tokenize = parseElementBlock; + return STYLE_ELEMENT_NAME; + } else if(isTokenSeparated(stream) && stream.match(/^[a-zA-Z_:][-a-zA-Z0-9_:.]*( )*=/)) { + // attribute + state.tokenize = parseAttribute; + return STYLE_ATTRIBUTE; + } + + // no other options - this is an error + state.tokenize = state.context == null ? parseDocument : parseDocument; + stream.eatWhile(/[^>]/); + stream.eat(">"); + return STYLE_ERROR; + } + + /////////////////////////////////////////////////////////////////////////// + // context: attribute + // + // attribute values may contain everything, except: + // - the ending quote (with ' or ") - this marks the end of the value + // - the character "<" - should never appear + // - ampersand ("&") - unless it starts a reference: a string that ends with a semi-colon (";") + // ---> note: this parser is lax in what may be put into a reference string, + // ---> consult http://www.w3.org/TR/REC-xml/#NT-Reference if you want to make it tighter + function parseAttribute(stream, state) { + var quote = stream.next(); + if(quote != "\"" && quote != "'") { + // attribute must be quoted + stream.skipToEnd(); + state.tokenize = parseElement; + return STYLE_ERROR; + } + + state.tokParams.quote = quote; + state.tokenize = parseAttributeValue; + return STYLE_WORD; + } + + // @todo: find out whether this attribute value spans multiple lines, + // and if so, push a context for it in order not to indent it + // (or something of the sort..) + function parseAttributeValue(stream, state) { + var ch = ""; + while(!stream.eol()) { + ch = stream.next(); + if(ch == state.tokParams.quote) { + // end quote found + state.tokenize = parseElement; + return STYLE_WORD; + } else if(ch == "<") { + // can't have less-than signs in an attribute value, ever + stream.skipToEnd() + state.tokenize = parseElement; + return STYLE_ERROR; + } else if(ch == "&") { + // reference - look for a semi-colon, or return error if none found + ch = stream.next(); + + // make sure that semi-colon isn't right after the ampersand + if(ch == ';') { + stream.skipToEnd() + state.tokenize = parseElement; + return STYLE_ERROR; + } + + // make sure no less-than characters slipped in + while(!stream.eol() && ch != ";") { + if(ch == "<") { + // can't have less-than signs in an attribute value, ever + stream.skipToEnd() + state.tokenize = parseElement; + return STYLE_ERROR; + } + ch = stream.next(); + } + if(stream.eol() && ch != ";") { + // no ampersand found - error + stream.skipToEnd(); + state.tokenize = parseElement; + return STYLE_ERROR; + } + } + } + + // attribute value continues to next line + return STYLE_WORD; + } + + /////////////////////////////////////////////////////////////////////////// + // context: element block + // + // a block can contain: + // - elements + // - text + // - CDATA sections + // - comments + function parseElementBlock(stream, state) { + if(stream.eat("<")) { + if(stream.match("?")) { + pushContext(state, TAG_INSTRUCTION); + state.tokenize = parseProcessingInstructionStartTag; + return STYLE_INSTRUCTION; + } else if(stream.match("!--")) { + // new context: comment + pushContext(state, TAG_COMMENT); + return chain(stream, state, inBlock(STYLE_COMMENT, "-->", + state.context == null ? parseDocument : parseElementBlock)); + } else if(stream.match("![CDATA[")) { + // new context: CDATA section + pushContext(state, TAG_CDATA); + return chain(stream, state, inBlock(STYLE_TEXT, "]]>", + state.context == null ? parseDocument : parseElementBlock)); + } else if(stream.eatSpace() || stream.eol() ) { + stream.skipToEnd(); + return STYLE_ERROR; + } else { + // element + state.tokenize = parseElementTagName; + return STYLE_ELEMENT_NAME; + } + } else if(stream.eat("&")) { + stream.eatWhile(/[^;]/); + stream.eat(";"); + return STYLE_ENTITIES; + } else { + // new context: text + pushContext(state, TAG_TEXT); + state.tokenize = parseText; + return null; + } + + state.tokenize = state.context == null ? parseDocument : parseElementBlock; + stream.skipToEnd(); + return null; + } + + function parseText(stream, state) { + stream.eatWhile(/[^<]/); + if(!stream.eol()) { + // we cannot possibly be in the document context, + // just inside an element block + popContext(state); + state.tokenize = parseElementBlock; + } + return STYLE_TEXT; + } + + /////////////////////////////////////////////////////////////////////////// + // context: XML processing instructions + // + // XML processing instructions (PIs) allow documents to contain instructions for applications. + // PI format: + // - 'name' can be anything other than 'xml' (case-insensitive) + // - 'data' can be anything which doesn't contain '?>' + // XML declaration is a special PI (see XML declaration context below) + function parseProcessingInstructionStartTag(stream, state) { + if(stream.match("xml", true, true)) { + // xml declaration + if(state.lineNumber > 1 || stream.pos > 5) { + state.tokenize = parseDocument; + stream.skipToEnd(); + return STYLE_ERROR; + } else { + state.tokenize = parseDeclarationVersion; + return STYLE_INSTRUCTION; + } + } + + // regular processing instruction + if(isTokenSeparated(stream) || stream.match("?>")) { + // we have a space after the start-tag, or nothing but the end-tag + // either way - error! + state.tokenize = parseDocument; + stream.skipToEnd(); + return STYLE_ERROR; + } + + state.tokenize = parseProcessingInstructionBody; + return STYLE_INSTRUCTION; + } + + function parseProcessingInstructionBody(stream, state) { + stream.eatWhile(/[^?]/); + if(stream.eat("?")) { + if(stream.eat(">")) { + popContext(state); + state.tokenize = state.context == null ? parseDocument : parseElementBlock; + } + } + return STYLE_INSTRUCTION; + } + + + /////////////////////////////////////////////////////////////////////////// + // context: XML declaration + // + // XML declaration is of the following format: + // + // - must start at the first character of the first line + // - may span multiple lines + // - must include 'version' + // - may include 'encoding' and 'standalone' (in that order after 'version') + // - attribute names must be lowercase + // - cannot contain anything else on the line + function parseDeclarationVersion(stream, state) { + state.tokenize = parseDeclarationEncoding; + + if(isTokenSeparated(stream) && stream.match(/^version( )*=( )*"([a-zA-Z0-9_.:]|\-)+"/)) { + return STYLE_INSTRUCTION; + } + stream.skipToEnd(); + return STYLE_ERROR; + } + + function parseDeclarationEncoding(stream, state) { + state.tokenize = parseDeclarationStandalone; + + if(isTokenSeparated(stream) && stream.match(/^encoding( )*=( )*"[A-Za-z]([A-Za-z0-9._]|\-)*"/)) { + return STYLE_INSTRUCTION; + } + return null; + } + + function parseDeclarationStandalone(stream, state) { + state.tokenize = parseDeclarationEndTag; + + if(isTokenSeparated(stream) && stream.match(/^standalone( )*=( )*"(yes|no)"/)) { + return STYLE_INSTRUCTION; + } + return null; + } + + function parseDeclarationEndTag(stream, state) { + state.tokenize = parseDocument; + + if(stream.match("?>") && stream.eol()) { + popContext(state); + return STYLE_INSTRUCTION; + } + stream.skipToEnd(); + return STYLE_ERROR; + } + + /////////////////////////////////////////////////////////////////////////// + // returned object + return { + electricChars: "/[", + + startState: function() { + return { + tokenize: parseDocument, + tokParams: {}, + lineNumber: 0, + lineError: false, + context: null, + indented: 0 + }; + }, + + token: function(stream, state) { + if(stream.sol()) { + // initialize a new line + state.lineNumber++; + state.lineError = false; + state.indented = stream.indentation(); + } + + // eat all (the spaces) you can + if(stream.eatSpace()) return null; + + // run the current tokenize function, according to the state + var style = state.tokenize(stream, state); + + // is there an error somewhere in the line? + state.lineError = (state.lineError || style == "error"); + + return style; + }, + + blankLine: function(state) { + // blank lines are lines too! + state.lineNumber++; + state.lineError = false; + }, + + indent: function(state, textAfter) { + if(state.context) { + if(state.context.noIndent == true) { + // do not indent - no return value at all + return; + } + if(textAfter.match(/^<\/.*/)) { + // end-tag - indent back to last context + return state.context.indent; + } + if(textAfter.match(/^ + +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +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. \ No newline at end of file diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/index.html new file mode 100644 index 00000000..82f00d24 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/index.html @@ -0,0 +1,222 @@ + + + + + CodeMirror 2: JavaScript mode + + + + + + + + +

    CodeMirror 2: XQuery mode

    + +
    + +
    + + + +

    MIME types defined: application/xquery.

    + +

    Development of the CodeMirror XQuery mode was sponsored by + MarkLogic and developed by + Mike Brevoort. +

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/index.html new file mode 100644 index 00000000..ba82e54f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/index.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + +

    XQuery CodeMirror Mode

    +

    +

    +
      +
    +
    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/testBase.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/testBase.js new file mode 100644 index 00000000..d40e9eea --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/testBase.js @@ -0,0 +1,42 @@ + $(document).ready(function(){ + module("testBase"); + test("eviltest", function() { + expect(1); + + var input = 'xquery version "1.0-ml";\ + (: this is\ + : a \ + "comment" :)\ + let $let := <x attr="value">"test"<func>function() $var {function()} {$var}</func></x>\ + let $joe:=1\ + return element element {\ + attribute attribute { 1 },\ + element test { 'a' }, \ + attribute foo { "bar" },\ + fn:doc()[ foo/@bar eq $let ],\ + //x } \ + \ + (: a more \'evil\' test :)\ + (: Modified Blakeley example (: with nested comment :) ... :)\ + declare private function local:declare() {()};\ + declare private function local:private() {()};\ + declare private function local:function() {()};\ + declare private function local:local() {()};\ + let $let := <let>let $let := "let"</let>\ + return element element {\ + attribute attribute { try { xdmp:version() } catch($e) { xdmp:log($e) } },\ + attribute fn:doc { "bar" castable as xs:string },\ + element text { text { "text" } },\ + fn:doc()[ child::eq/(@bar | attribute::attribute) eq $let ],\ + //fn:doc\ + }'; + var expected = 'xquery version "1.0-ml"; (: this is : a "comment" :) let $let := <x attr="value">"test"<func>function() $var {function()} {$var}</func></x> let $joe:=1 return element element { attribute attribute { 1 }, element test { \'a\' }, attribute foo { "bar" }, fn:doc()[ foo/@bar eq $let ], //x } (: a more \'evil\' test :) (: Modified Blakeley example (: with nested comment :) ... :) declare private function local:declare() {()}; declare private function local:private() {()}; declare private function local:function() {()}; declare private function local:local() {()}; let $let := <let>let $let := "let"</let> return element element { attribute attribute { try { xdmp:version() } catch($e) { xdmp:log($e) } }, attribute fn:doc { "bar" castable as xs:string }, element text { text { "text" } }, fn:doc()[ child::eq/(@bar | attribute::attribute) eq $let ], //fn:doc }'; + + $("#sandbox").html(''); + var editor = CodeMirror.fromTextArea($("#editor")[0]); + var result = $(".CodeMirror-lines div div pre")[0].innerHTML; + + equal(result, expected); + $("#editor").html(""); + }); + }); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/testEmptySequenceKeyword.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/testEmptySequenceKeyword.js new file mode 100644 index 00000000..39ed0905 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/testEmptySequenceKeyword.js @@ -0,0 +1,16 @@ +$(document).ready(function(){ + module("testEmptySequenceKeyword"); + test("testEmptySequenceKeyword", function() { + expect(1); + + var input = '"foo" instance of empty-sequence()'; + var expected = '"foo" instance of empty-sequence()'; + + $("#sandbox").html(''); + var editor = CodeMirror.fromTextArea($("#editor")[0]); + var result = $(".CodeMirror-lines div div pre")[0].innerHTML; + + equal(result, expected); + $("#editor").html(""); + }); +}); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/testMultiAttr.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/testMultiAttr.js new file mode 100644 index 00000000..8e98c47d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/testMultiAttr.js @@ -0,0 +1,16 @@ + $(document).ready(function(){ + module("testMultiAttr"); + test("test1", function() { + expect(1); + + var expected = '<p a1="foo" a2="bar">hello world</p>'; + + $("#sandbox").html(''); + $("#editor").html('

    hello world

    '); + var editor = CodeMirror.fromTextArea($("#editor")[0]); + var result = $(".CodeMirror-lines div div pre")[0].innerHTML; + + equal(result, expected); + $("#editor").html(""); + }); + }); \ No newline at end of file diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/testNamespaces.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/testNamespaces.js new file mode 100644 index 00000000..4efea63e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/testNamespaces.js @@ -0,0 +1,91 @@ +$(document).ready(function(){ + module("test namespaces"); + +// -------------------------------------------------------------------------------- +// this test is based on this: +//http://mbrevoort.github.com/CodeMirror2/#!exprSeqTypes/PrologExpr/VariableProlog/ExternalVariablesWith/K2-ExternalVariablesWith-10.xq +// -------------------------------------------------------------------------------- + test("test namespaced variable", function() { + expect(1); + + var input = 'declare namespace e = "http://example.com/ANamespace";\ +declare variable $e:exampleComThisVarIsNotRecognized as element(*) external;'; + + var expected = 'declare namespace e = "http://example.com/ANamespace";declare variable $e:exampleComThisVarIsNotRecognized as element(*) external;'; + + $("#sandbox").html(''); + var editor = CodeMirror.fromTextArea($("#editor")[0]); + var result = $(".CodeMirror-lines div div pre")[0].innerHTML; + + equal(result, expected); + $("#editor").html(""); + }); + + +// -------------------------------------------------------------------------------- +// this test is based on: +// http://mbrevoort.github.com/CodeMirror2/#!Basics/EQNames/eqname-002.xq +// -------------------------------------------------------------------------------- + test("test EQName variable", function() { + expect(1); + + var input = 'declare variable $"http://www.example.com/ns/my":var := 12;\ +{$"http://www.example.com/ns/my":var}'; + + var expected = 'declare variable $"http://www.example.com/ns/my":var := 12;<out>{$"http://www.example.com/ns/my":var}</out>'; + + $("#sandbox").html(''); + var editor = CodeMirror.fromTextArea($("#editor")[0]); + var result = $(".CodeMirror-lines div div pre")[0].innerHTML; + + equal(result, expected); + $("#editor").html(""); + }); + +// -------------------------------------------------------------------------------- +// this test is based on: +// http://mbrevoort.github.com/CodeMirror2/#!Basics/EQNames/eqname-003.xq +// -------------------------------------------------------------------------------- + test("test EQName function", function() { + expect(1); + + var input = 'declare function "http://www.example.com/ns/my":fn ($a as xs:integer) as xs:integer {\ + $a + 2\ +};\ +{"http://www.example.com/ns/my":fn(12)}'; + + var expected = 'declare function "http://www.example.com/ns/my":fn ($a as xs:integer) as xs:integer { $a + 2};<out>{"http://www.example.com/ns/my":fn(12)}</out>'; + + $("#sandbox").html(''); + var editor = CodeMirror.fromTextArea($("#editor")[0]); + var result = $(".CodeMirror-lines div div pre")[0].innerHTML; + + equal(result, expected); + $("#editor").html(""); + }); + +// -------------------------------------------------------------------------------- +// this test is based on: +// http://mbrevoort.github.com/CodeMirror2/#!Basics/EQNames/eqname-003.xq +// -------------------------------------------------------------------------------- + test("test EQName function with single quotes", function() { + expect(1); + + var input = 'declare function \'http://www.example.com/ns/my\':fn ($a as xs:integer) as xs:integer {\ + $a + 2\ +};\ +{\'http://www.example.com/ns/my\':fn(12)}'; + + var expected = 'declare function \'http://www.example.com/ns/my\':fn ($a as xs:integer) as xs:integer { $a + 2};<out>{\'http://www.example.com/ns/my\':fn(12)}</out>'; + + $("#sandbox").html(''); + var editor = CodeMirror.fromTextArea($("#editor")[0]); + var result = $(".CodeMirror-lines div div pre")[0].innerHTML; + + equal(result, expected); + $("#editor").html(""); + }); + +}); + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/testProcessingInstructions.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/testProcessingInstructions.js new file mode 100644 index 00000000..9b753052 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/testProcessingInstructions.js @@ -0,0 +1,16 @@ +$(document).ready(function(){ + module("testProcessingInstructions"); + test("testProcessingInstructions", function() { + expect(1); + + var input = 'data() instance of xs:string'; + var expected = 'data(<?target content?>) instance of xs:string'; + + $("#sandbox").html(''); + var editor = CodeMirror.fromTextArea($("#editor")[0]); + var result = $(".CodeMirror-lines div div pre")[0].innerHTML; + + equal(result, expected); + $("#editor").html(""); + }); +}); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/testQuotes.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/testQuotes.js new file mode 100644 index 00000000..79e5142d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/test/testQuotes.js @@ -0,0 +1,19 @@ + $(document).ready(function(){ + module("testQuoteEscape"); + test("testQuoteEscapeDouble", function() { + expect(1); + + var input = 'let $rootfolder := "c:\\builds\\winnt\\HEAD\\qa\\scripts\\"\ +let $keysfolder := concat($rootfolder, "keys\\")\ +return\ +$keysfolder'; + var expected = 'let $rootfolder := "c:\\builds\\winnt\\HEAD\\qa\\scripts\\"let $keysfolder := concat($rootfolder, "keys\\")return$keysfolder'; + + $("#sandbox").html(''); + var editor = CodeMirror.fromTextArea($("#editor")[0]); + var result = $(".CodeMirror-lines div div pre")[0].innerHTML; + + equal(result, expected); + $("#editor").html(""); + }); + }); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/xquery.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/xquery.js new file mode 100644 index 00000000..78916dae --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/xquery/xquery.js @@ -0,0 +1,448 @@ +/* +Copyright (C) 2011 by MarkLogic Corporation +Author: Mike Brevoort + +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +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. +*/ +CodeMirror.defineMode("xquery", function(config, parserConfig) { + + // The keywords object is set to the result of this self executing + // function. Each keyword is a property of the keywords object whose + // value is {type: atype, style: astyle} + var keywords = function(){ + // conveinence functions used to build keywords object + function kw(type) {return {type: type, style: "keyword"};} + var A = kw("keyword a") + , B = kw("keyword b") + , C = kw("keyword c") + , operator = kw("operator") + , atom = {type: "atom", style: "atom"} + , punctuation = {type: "punctuation", style: ""} + , qualifier = {type: "axis_specifier", style: "qualifier"}; + + // kwObj is what is return from this function at the end + var kwObj = { + 'if': A, 'switch': A, 'while': A, 'for': A, + 'else': B, 'then': B, 'try': B, 'finally': B, 'catch': B, + 'element': C, 'attribute': C, 'let': C, 'implements': C, 'import': C, 'module': C, 'namespace': C, + 'return': C, 'super': C, 'this': C, 'throws': C, 'where': C, 'private': C, + ',': punctuation, + 'null': atom, 'fn:false()': atom, 'fn:true()': atom + }; + + // a list of 'basic' keywords. For each add a property to kwObj with the value of + // {type: basic[i], style: "keyword"} e.g. 'after' --> {type: "after", style: "keyword"} + var basic = ['after','ancestor','ancestor-or-self','and','as','ascending','assert','attribute','before', + 'by','case','cast','child','comment','declare','default','define','descendant','descendant-or-self', + 'descending','document','document-node','element','else','eq','every','except','external','following', + 'following-sibling','follows','for','function','if','import','in','instance','intersect','item', + 'let','module','namespace','node','node','of','only','or','order','parent','precedes','preceding', + 'preceding-sibling','processing-instruction','ref','return','returns','satisfies','schema','schema-element', + 'self','some','sortby','stable','text','then','to','treat','typeswitch','union','variable','version','where', + 'xquery', 'empty-sequence']; + for(var i=0, l=basic.length; i < l; i++) { kwObj[basic[i]] = kw(basic[i])}; + + // a list of types. For each add a property to kwObj with the value of + // {type: "atom", style: "atom"} + var types = ['xs:string', 'xs:float', 'xs:decimal', 'xs:double', 'xs:integer', 'xs:boolean', 'xs:date', 'xs:dateTime', + 'xs:time', 'xs:duration', 'xs:dayTimeDuration', 'xs:time', 'xs:yearMonthDuration', 'numeric', 'xs:hexBinary', + 'xs:base64Binary', 'xs:anyURI', 'xs:QName', 'xs:byte','xs:boolean','xs:anyURI','xf:yearMonthDuration']; + for(var i=0, l=types.length; i < l; i++) { kwObj[types[i]] = atom;}; + + // each operator will add a property to kwObj with value of {type: "operator", style: "keyword"} + var operators = ['eq', 'ne', 'lt', 'le', 'gt', 'ge', ':=', '=', '>', '>=', '<', '<=', '.', '|', '?', 'and', 'or', 'div', 'idiv', 'mod', '*', '/', '+', '-']; + for(var i=0, l=operators.length; i < l; i++) { kwObj[operators[i]] = operator;}; + + // each axis_specifiers will add a property to kwObj with value of {type: "axis_specifier", style: "qualifier"} + var axis_specifiers = ["self::", "attribute::", "child::", "descendant::", "descendant-or-self::", "parent::", + "ancestor::", "ancestor-or-self::", "following::", "preceding::", "following-sibling::", "preceding-sibling::"]; + for(var i=0, l=axis_specifiers.length; i < l; i++) { kwObj[axis_specifiers[i]] = qualifier; }; + + return kwObj; + }(); + + // Used as scratch variables to communicate multiple values without + // consing up tons of objects. + var type, content; + + function ret(tp, style, cont) { + type = tp; content = cont; + return style; + } + + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + + // the primary mode tokenizer + function tokenBase(stream, state) { + var ch = stream.next(), + mightBeFunction = false, + isEQName = isEQNameAhead(stream); + + // an XML tag (if not in some sub, chained tokenizer) + if (ch == "<") { + if(stream.match("!--", true)) + return chain(stream, state, tokenXMLComment); + + if(stream.match("![CDATA", false)) { + state.tokenize = tokenCDATA; + return ret("tag", "tag"); + } + + if(stream.match("?", false)) { + return chain(stream, state, tokenPreProcessing); + } + + var isclose = stream.eat("/"); + stream.eatSpace(); + var tagName = "", c; + while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c; + + return chain(stream, state, tokenTag(tagName, isclose)); + } + // start code block + else if(ch == "{") { + pushStateStack(state,{ type: "codeblock"}); + return ret("", ""); + } + // end code block + else if(ch == "}") { + popStateStack(state); + return ret("", ""); + } + // if we're in an XML block + else if(isInXmlBlock(state)) { + if(ch == ">") + return ret("tag", "tag"); + else if(ch == "/" && stream.eat(">")) { + popStateStack(state); + return ret("tag", "tag"); + } + else + return ret("word", "word"); + } + // if a number + else if (/\d/.test(ch)) { + stream.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/); + return ret("number", "atom"); + } + // comment start + else if (ch === "(" && stream.eat(":")) { + pushStateStack(state, { type: "comment"}); + return chain(stream, state, tokenComment); + } + // quoted string + else if ( !isEQName && (ch === '"' || ch === "'")) + return chain(stream, state, tokenString(ch)); + // variable + else if(ch === "$") { + return chain(stream, state, tokenVariable); + } + // assignment + else if(ch ===":" && stream.eat("=")) { + return ret("operator", "keyword"); + } + // open paren + else if(ch === "(") { + pushStateStack(state, { type: "paren"}); + return ret("", ""); + } + // close paren + else if(ch === ")") { + popStateStack(state); + return ret("", ""); + } + // open paren + else if(ch === "[") { + pushStateStack(state, { type: "bracket"}); + return ret("", ""); + } + // close paren + else if(ch === "]") { + popStateStack(state); + return ret("", ""); + } + else { + var known = keywords.propertyIsEnumerable(ch) && keywords[ch]; + + // if there's a EQName ahead, consume the rest of the string portion, it's likely a function + if(isEQName && ch === '\"') while(stream.next() !== '"'){} + if(isEQName && ch === '\'') while(stream.next() !== '\''){} + + // gobble up a word if the character is not known + if(!known) stream.eatWhile(/[\w\$_-]/); + + // gobble a colon in the case that is a lib func type call fn:doc + var foundColon = stream.eat(":") + + // if there's not a second colon, gobble another word. Otherwise, it's probably an axis specifier + // which should get matched as a keyword + if(!stream.eat(":") && foundColon) { + stream.eatWhile(/[\w\$_-]/); + } + // if the next non whitespace character is an open paren, this is probably a function (if not a keyword of other sort) + if(stream.match(/^[ \t]*\(/, false)) { + mightBeFunction = true; + } + // is the word a keyword? + var word = stream.current(); + known = keywords.propertyIsEnumerable(word) && keywords[word]; + + // if we think it's a function call but not yet known, + // set style to variable for now for lack of something better + if(mightBeFunction && !known) known = {type: "function_call", style: "variable def"}; + + // if the previous word was element, attribute, axis specifier, this word should be the name of that + if(isInXmlConstructor(state)) { + popStateStack(state); + return ret("word", "word", word); + } + // as previously checked, if the word is element,attribute, axis specifier, call it an "xmlconstructor" and + // push the stack so we know to look for it on the next word + if(word == "element" || word == "attribute" || known.type == "axis_specifier") pushStateStack(state, {type: "xmlconstructor"}); + + // if the word is known, return the details of that else just call this a generic 'word' + return known ? ret(known.type, known.style, word) : + ret("word", "word", word); + } + } + + // handle comments, including nested + function tokenComment(stream, state) { + var maybeEnd = false, maybeNested = false, nestedCount = 0, ch; + while (ch = stream.next()) { + if (ch == ")" && maybeEnd) { + if(nestedCount > 0) + nestedCount--; + else { + popStateStack(state); + break; + } + } + else if(ch == ":" && maybeNested) { + nestedCount++; + } + maybeEnd = (ch == ":"); + maybeNested = (ch == "("); + } + + return ret("comment", "comment"); + } + + // tokenizer for string literals + // optionally pass a tokenizer function to set state.tokenize back to when finished + function tokenString(quote, f) { + return function(stream, state) { + var ch; + + if(isInString(state) && stream.current() == quote) { + popStateStack(state); + if(f) state.tokenize = f; + return ret("string", "string"); + } + + pushStateStack(state, { type: "string", name: quote, tokenize: tokenString(quote, f) }); + + // if we're in a string and in an XML block, allow an embedded code block + if(stream.match("{", false) && isInXmlAttributeBlock(state)) { + state.tokenize = tokenBase; + return ret("string", "string"); + } + + + while (ch = stream.next()) { + if (ch == quote) { + popStateStack(state); + if(f) state.tokenize = f; + break; + } + else { + // if we're in a string and in an XML block, allow an embedded code block in an attribute + if(stream.match("{", false) && isInXmlAttributeBlock(state)) { + state.tokenize = tokenBase; + return ret("string", "string"); + } + + } + } + + return ret("string", "string"); + }; + } + + // tokenizer for variables + function tokenVariable(stream, state) { + var isVariableChar = /[\w\$_-]/; + + // a variable may start with a quoted EQName so if the next character is quote, consume to the next quote + if(stream.eat("\"")) { + while(stream.next() !== '\"'){}; + stream.eat(":"); + } else { + stream.eatWhile(isVariableChar); + if(!stream.match(":=", false)) stream.eat(":"); + } + stream.eatWhile(isVariableChar); + state.tokenize = tokenBase; + return ret("variable", "variable"); + } + + // tokenizer for XML tags + function tokenTag(name, isclose) { + return function(stream, state) { + stream.eatSpace(); + if(isclose && stream.eat(">")) { + popStateStack(state); + state.tokenize = tokenBase; + return ret("tag", "tag"); + } + // self closing tag without attributes? + if(!stream.eat("/")) + pushStateStack(state, { type: "tag", name: name, tokenize: tokenBase}); + if(!stream.eat(">")) { + state.tokenize = tokenAttribute; + return ret("tag", "tag"); + } + else { + state.tokenize = tokenBase; + } + return ret("tag", "tag"); + } + } + + // tokenizer for XML attributes + function tokenAttribute(stream, state) { + var ch = stream.next(); + + if(ch == "/" && stream.eat(">")) { + if(isInXmlAttributeBlock(state)) popStateStack(state); + if(isInXmlBlock(state)) popStateStack(state); + return ret("tag", "tag"); + } + if(ch == ">") { + if(isInXmlAttributeBlock(state)) popStateStack(state); + return ret("tag", "tag"); + } + if(ch == "=") + return ret("", ""); + // quoted string + if (ch == '"' || ch == "'") + return chain(stream, state, tokenString(ch, tokenAttribute)); + + if(!isInXmlAttributeBlock(state)) + pushStateStack(state, { type: "attribute", name: name, tokenize: tokenAttribute}); + + stream.eat(/[a-zA-Z_:]/); + stream.eatWhile(/[-a-zA-Z0-9_:.]/); + stream.eatSpace(); + + // the case where the attribute has not value and the tag was closed + if(stream.match(">", false) || stream.match("/", false)) { + popStateStack(state); + state.tokenize = tokenBase; + } + + return ret("attribute", "attribute"); + } + + // handle comments, including nested + function tokenXMLComment(stream, state) { + while (ch = stream.next()) { + if (ch == "-" && stream.match("->", true)) { + state.tokenize = tokenBase; + return ret("comment", "comment"); + } + } + } + + + // handle CDATA + function tokenCDATA(stream, state) { + while (ch = stream.next()) { + if (ch == "]" && stream.match("]", true)) { + state.tokenize = tokenBase; + return ret("comment", "comment"); + } + } + } + + // handle preprocessing instructions + function tokenPreProcessing(stream, state) { + while (ch = stream.next()) { + if (ch == "?" && stream.match(">", true)) { + state.tokenize = tokenBase; + return ret("comment", "comment meta"); + } + } + } + + + // functions to test the current context of the state + function isInXmlBlock(state) { return isIn(state, "tag"); } + function isInXmlAttributeBlock(state) { return isIn(state, "attribute"); } + function isInCodeBlock(state) { return isIn(state, "codeblock"); } + function isInXmlConstructor(state) { return isIn(state, "xmlconstructor"); } + function isInString(state) { return isIn(state, "string"); } + + function isEQNameAhead(stream) { + // assume we've already eaten a quote (") + if(stream.current() === '"') + return stream.match(/^[^\"]+\"\:/, false); + else if(stream.current() === '\'') + return stream.match(/^[^\"]+\'\:/, false); + else + return false; + } + + function isIn(state, type) { + return (state.stack.length && state.stack[state.stack.length - 1].type == type); + } + + function pushStateStack(state, newState) { + state.stack.push(newState); + } + + function popStateStack(state) { + var popped = state.stack.pop(); + var reinstateTokenize = state.stack.length && state.stack[state.stack.length-1].tokenize + state.tokenize = reinstateTokenize || tokenBase; + } + + // the interface for the mode API + return { + startState: function(basecolumn) { + return { + tokenize: tokenBase, + cc: [], + stack: [] + }; + }, + + token: function(stream, state) { + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + return style; + } + }; + +}); + +CodeMirror.defineMIME("application/xquery", "xquery"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/yaml/index.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/yaml/index.html new file mode 100644 index 00000000..7f2c7929 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/yaml/index.html @@ -0,0 +1,67 @@ + + + + CodeMirror: YAML mode + + + + + + + +

    CodeMirror: YAML mode

    +
    + + +

    MIME types defined: text/x-yaml.

    + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/yaml/yaml.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/yaml/yaml.js new file mode 100644 index 00000000..59e2641a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/mode/yaml/yaml.js @@ -0,0 +1,95 @@ +CodeMirror.defineMode("yaml", function() { + + var cons = ['true', 'false', 'on', 'off', 'yes', 'no']; + var keywordRegex = new RegExp("\\b(("+cons.join(")|(")+"))$", 'i'); + + return { + token: function(stream, state) { + var ch = stream.peek(); + var esc = state.escaped; + state.escaped = false; + /* comments */ + if (ch == "#") { stream.skipToEnd(); return "comment"; } + if (state.literal && stream.indentation() > state.keyCol) { + stream.skipToEnd(); return "string"; + } else if (state.literal) { state.literal = false; } + if (stream.sol()) { + state.keyCol = 0; + state.pair = false; + state.pairStart = false; + /* document start */ + if(stream.match(/---/)) { return "def"; } + /* document end */ + if (stream.match(/\.\.\./)) { return "def"; } + /* array list item */ + if (stream.match(/\s*-\s+/)) { return 'meta'; } + } + /* pairs (associative arrays) -> key */ + if (!state.pair && stream.match(/^\s*([a-z0-9\._-])+(?=\s*:)/i)) { + state.pair = true; + state.keyCol = stream.indentation(); + return "atom"; + } + if (state.pair && stream.match(/^:\s*/)) { state.pairStart = true; return 'meta'; } + + /* inline pairs/lists */ + if (stream.match(/^(\{|\}|\[|\])/)) { + if (ch == '{') + state.inlinePairs++; + else if (ch == '}') + state.inlinePairs--; + else if (ch == '[') + state.inlineList++; + else + state.inlineList--; + return 'meta'; + } + + /* list seperator */ + if (state.inlineList > 0 && !esc && ch == ',') { + stream.next(); + return 'meta'; + } + /* pairs seperator */ + if (state.inlinePairs > 0 && !esc && ch == ',') { + state.keyCol = 0; + state.pair = false; + state.pairStart = false; + stream.next(); + return 'meta'; + } + + /* start of value of a pair */ + if (state.pairStart) { + /* block literals */ + if (stream.match(/^\s*(\||\>)\s*/)) { state.literal = true; return 'meta'; }; + /* references */ + if (stream.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i)) { return 'variable-2'; } + /* numbers */ + if (state.inlinePairs == 0 && stream.match(/^\s*-?[0-9\.\,]+\s?$/)) { return 'number'; } + if (state.inlinePairs > 0 && stream.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/)) { return 'number'; } + /* keywords */ + if (stream.match(keywordRegex)) { return 'keyword'; } + } + + /* nothing found, continue */ + state.pairStart = false; + state.escaped = (ch == '\\'); + stream.next(); + return null; + }, + startState: function() { + return { + pair: false, + pairStart: false, + keyCol: 0, + inlinePairs: 0, + inlineList: 0, + literal: false, + escaped: false + }; + } + }; +}); + +CodeMirror.defineMIME("text/x-yaml", "yaml"); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/cobalt.css b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/cobalt.css new file mode 100644 index 00000000..dbbb7e49 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/cobalt.css @@ -0,0 +1,18 @@ +.cm-s-cobalt { background: #002240; color: white; } +.cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; } +.cm-s-cobalt .CodeMirror-gutter { background: #002240; border-right: 1px solid #aaa; } +.cm-s-cobalt .CodeMirror-gutter-text { color: #d0d0d0; } +.cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; } + +.cm-s-cobalt span.cm-comment { color: #08f; } +.cm-s-cobalt span.cm-atom { color: #845dc4; } +.cm-s-cobalt span.cm-number, .cm-s-cobalt span.cm-attribute { color: #ff80e1; } +.cm-s-cobalt span.cm-keyword { color: #ffee80; } +.cm-s-cobalt span.cm-string { color: #3ad900; } +.cm-s-cobalt span.cm-meta { color: #ff9d00; } +.cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; } +.cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; } +.cm-s-cobalt span.cm-error { color: #9d1e15; } +.cm-s-cobalt span.cm-bracket { color: #d8d8d8; } +.cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; } +.cm-s-cobalt span.cm-link { color: #845dc4; } diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/eclipse.css b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/eclipse.css new file mode 100644 index 00000000..47d66a01 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/eclipse.css @@ -0,0 +1,25 @@ +.cm-s-eclipse span.cm-meta {color: #FF1717;} +.cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; } +.cm-s-eclipse span.cm-atom {color: #219;} +.cm-s-eclipse span.cm-number {color: #164;} +.cm-s-eclipse span.cm-def {color: #00f;} +.cm-s-eclipse span.cm-variable {color: black;} +.cm-s-eclipse span.cm-variable-2 {color: #0000C0;} +.cm-s-eclipse span.cm-variable-3 {color: #0000C0;} +.cm-s-eclipse span.cm-property {color: black;} +.cm-s-eclipse span.cm-operator {color: black;} +.cm-s-eclipse span.cm-comment {color: #3F7F5F;} +.cm-s-eclipse span.cm-string {color: #2A00FF;} +.cm-s-eclipse span.cm-string-2 {color: #f50;} +.cm-s-eclipse span.cm-error {color: #f00;} +.cm-s-eclipse span.cm-qualifier {color: #555;} +.cm-s-eclipse span.cm-builtin {color: #30a;} +.cm-s-eclipse span.cm-bracket {color: #cc7;} +.cm-s-eclipse span.cm-tag {color: #170;} +.cm-s-eclipse span.cm-attribute {color: #00c;} +.cm-s-eclipse span.cm-link {color: #219;} + +.cm-s-eclipse .CodeMirror-matchingbracket { + border:1px solid grey; + color:black !important;; +} diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/elegant.css b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/elegant.css new file mode 100644 index 00000000..d0ce0cb5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/elegant.css @@ -0,0 +1,10 @@ +.cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;} +.cm-s-elegant span.cm-comment {color: #262; font-style: italic; line-height: 1em;} +.cm-s-elegant span.cm-meta {color: #555; font-style: italic; line-height: 1em;} +.cm-s-elegant span.cm-variable {color: black;} +.cm-s-elegant span.cm-variable-2 {color: #b11;} +.cm-s-elegant span.cm-qualifier {color: #555;} +.cm-s-elegant span.cm-keyword {color: #730;} +.cm-s-elegant span.cm-builtin {color: #30a;} +.cm-s-elegant span.cm-error {background-color: #fdd;} +.cm-s-elegant span.cm-link {color: #762;} diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/lesser-dark.css b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/lesser-dark.css new file mode 100644 index 00000000..fb5160b4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/lesser-dark.css @@ -0,0 +1,45 @@ +/* +http://lesscss.org/ dark theme +Ported to CodeMirror by Peter Kroon +*/ +.CodeMirror{ + line-height: 15px; +} +.cm-s-lesser-dark { + font-family: 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', 'Monaco', Courier, monospace !important; + font-size:12px; +} + +.cm-s-lesser-dark { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; } +.cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/ +.cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; } +.cm-s-lesser-dark .CodeMirror-lines { margin-left:3px; margin-right:3px; }/*editable code holder*/ + +div.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/ + +.cm-s-lesser-dark .CodeMirror-gutter { background: #262626; border-right:1px solid #aaa; padding-right:3px; min-width:2.5em; } +.cm-s-lesser-dark .CodeMirror-gutter-text { color: #777; } + +.cm-s-lesser-dark span.cm-keyword { color: #599eff; } +.cm-s-lesser-dark span.cm-atom { color: #C2B470; } +.cm-s-lesser-dark span.cm-number { color: #B35E4D; } +.cm-s-lesser-dark span.cm-def {color: color: white;} +.cm-s-lesser-dark span.cm-variable { color:#D9BF8C; } +.cm-s-lesser-dark span.cm-variable-2 { color: #669199; } +.cm-s-lesser-dark span.cm-variable-3 { color: white; } +.cm-s-lesser-dark span.cm-property {color: #92A75C;} +.cm-s-lesser-dark span.cm-operator {color: #92A75C;} +.cm-s-lesser-dark span.cm-comment { color: #666; } +.cm-s-lesser-dark span.cm-string { color: #BCD279; } +.cm-s-lesser-dark span.cm-string-2 {color: #f50;} +.cm-s-lesser-dark span.cm-meta { color: #738C73; } +.cm-s-lesser-dark span.cm-error { color: #9d1e15; } +.cm-s-lesser-dark span.cm-qualifier {color: #555;} +.cm-s-lesser-dark span.cm-builtin { color: #ff9e59; } +.cm-s-lesser-dark span.cm-bracket { color: #EBEFE7; } +.cm-s-lesser-dark span.cm-tag { color: #669199; } +.cm-s-lesser-dark span.cm-attribute {color: #00c;} +.cm-s-lesser-dark span.cm-header {color: #a0a;} +.cm-s-lesser-dark span.cm-quote {color: #090;} +.cm-s-lesser-dark span.cm-hr {color: #999;} +.cm-s-lesser-dark span.cm-link {color: #00c;} diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/monokai.css b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/monokai.css new file mode 100644 index 00000000..f01d066f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/monokai.css @@ -0,0 +1,28 @@ +/* Based on Sublime Text's Monokai theme */ + +.cm-s-monokai {background: #272822; color: #f8f8f2;} +.cm-s-monokai div.CodeMirror-selected {background: #49483E !important;} +.cm-s-monokai .CodeMirror-gutter {background: #272822; border-right: 0px;} +.cm-s-monokai .CodeMirror-gutter-text {color: #d0d0d0;} +.cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;} + +.cm-s-monokai span.cm-comment {color: #75715e;} +.cm-s-monokai span.cm-atom {color: #ae81ff;} +.cm-s-monokai span.cm-number {color: #ae81ff;} + +.cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;} +.cm-s-monokai span.cm-keyword {color: #f92672;} +.cm-s-monokai span.cm-string {color: #e6db74;} + +.cm-s-monokai span.cm-variable {color: #a6e22e;} +.cm-s-monokai span.cm-variable-2 {color: #9effff;} +.cm-s-monokai span.cm-def {color: #fd971f;} +.cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;} +.cm-s-monokai span.cm-bracket {color: #f8f8f2;} +.cm-s-monokai span.cm-tag {color: #f92672;} +.cm-s-monokai span.cm-link {color: #ae81ff;} + +.cm-s-monokai .CodeMirror-matchingbracket { + text-decoration: underline; + color: white !important; +} diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/neat.css b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/neat.css new file mode 100644 index 00000000..8a307f80 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/neat.css @@ -0,0 +1,9 @@ +.cm-s-neat span.cm-comment { color: #a86; } +.cm-s-neat span.cm-keyword { line-height: 1em; font-weight: bold; color: blue; } +.cm-s-neat span.cm-string { color: #a22; } +.cm-s-neat span.cm-builtin { line-height: 1em; font-weight: bold; color: #077; } +.cm-s-neat span.cm-special { line-height: 1em; font-weight: bold; color: #0aa; } +.cm-s-neat span.cm-variable { color: black; } +.cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; } +.cm-s-neat span.cm-meta {color: #555;} +.cm-s-neat span.cm-link { color: #3a3; } diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/night.css b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/night.css new file mode 100644 index 00000000..3b296e4a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/night.css @@ -0,0 +1,21 @@ +/* Loosely based on the Midnight Textmate theme */ + +.cm-s-night { background: #0a001f; color: #f8f8f8; } +.cm-s-night div.CodeMirror-selected { background: #a8f !important; } +.cm-s-night .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; } +.cm-s-night .CodeMirror-gutter-text { color: #f8f8f8; } +.cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; } + +.cm-s-night span.cm-comment { color: #6900a1; } +.cm-s-night span.cm-atom { color: #845dc4; } +.cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; } +.cm-s-night span.cm-keyword { color: #599eff; } +.cm-s-night span.cm-string { color: #37f14a; } +.cm-s-night span.cm-meta { color: #7678e2; } +.cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; } +.cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; } +.cm-s-night span.cm-error { color: #9d1e15; } +.cm-s-night span.cm-bracket { color: #8da6ce; } +.cm-s-night span.cm-comment { color: #6900a1; } +.cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; } +.cm-s-night span.cm-link { color: #845dc4; } diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/rubyblue.css b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/rubyblue.css new file mode 100644 index 00000000..502817ae --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/rubyblue.css @@ -0,0 +1,21 @@ +.cm-s-rubyblue { font:13px/1.4em Trebuchet, Verdana, sans-serif; } /* - customized editor font - */ + +.cm-s-rubyblue { background: #112435; color: white; } +.cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; } +.cm-s-rubyblue .CodeMirror-gutter { background: #1F4661; border-right: 7px solid #3E7087; min-width:2.5em; } +.cm-s-rubyblue .CodeMirror-gutter-text { color: white; } +.cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; } + +.cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; } +.cm-s-rubyblue span.cm-atom { color: #F4C20B; } +.cm-s-rubyblue span.cm-number, .cm-s-rubyblue span.cm-attribute { color: #82C6E0; } +.cm-s-rubyblue span.cm-keyword { color: #F0F; } +.cm-s-rubyblue span.cm-string { color: #F08047; } +.cm-s-rubyblue span.cm-meta { color: #F0F; } +.cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; } +.cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; } +.cm-s-rubyblue span.cm-error { color: #AF2018; } +.cm-s-rubyblue span.cm-bracket { color: #F0F; } +.cm-s-rubyblue span.cm-link { color: #F4C20B; } +.cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; } +.cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; } diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/xq-dark.css b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/xq-dark.css new file mode 100644 index 00000000..493e3a63 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/theme/xq-dark.css @@ -0,0 +1,46 @@ +/* +Copyright (C) 2011 by MarkLogic Corporation +Author: Mike Brevoort + +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +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. +*/ +.cm-s-xq-dark { background: #0a001f; color: #f8f8f8; } +.cm-s-xq-dark span.CodeMirror-selected { background: #a8f !important; } +.cm-s-xq-dark .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; } +.cm-s-xq-dark .CodeMirror-gutter-text { color: #f8f8f8; } +.cm-s-xq-dark .CodeMirror-cursor { border-left: 1px solid white !important; } + +.cm-s-xq-dark span.cm-keyword {color: #FFBD40;} +.cm-s-xq-dark span.cm-atom {color: #6C8CD5;} +.cm-s-xq-dark span.cm-number {color: #164;} +.cm-s-xq-dark span.cm-def {color: #FFF; text-decoration:underline;} +.cm-s-xq-dark span.cm-variable {color: #FFF;} +.cm-s-xq-dark span.cm-variable-2 {color: #EEE;} +.cm-s-xq-dark span.cm-variable-3 {color: #DDD;} +.cm-s-xq-dark span.cm-property {} +.cm-s-xq-dark span.cm-operator {} +.cm-s-xq-dark span.cm-comment {color: gray;} +.cm-s-xq-dark span.cm-string {color: #9FEE00;} +.cm-s-xq-dark span.cm-meta {color: yellow;} +.cm-s-xq-dark span.cm-error {color: #f00;} +.cm-s-xq-dark span.cm-qualifier {color: #FFF700;} +.cm-s-xq-dark span.cm-builtin {color: #30a;} +.cm-s-xq-dark span.cm-bracket {color: #cc7;} +.cm-s-xq-dark span.cm-tag {color: #FFBD40;} +.cm-s-xq-dark span.cm-attribute {color: #FFF700;} diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/closetag.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/closetag.js new file mode 100644 index 00000000..66f03e61 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/closetag.js @@ -0,0 +1,174 @@ +/** + * Tag-closer extension for CodeMirror. + * + * This extension adds a "closeTag" utility function that can be used with key bindings to + * insert a matching end tag after the ">" character of a start tag has been typed. It can + * also complete " + * Contributed under the same license terms as CodeMirror. + */ +(function() { + /** Option that allows tag closing behavior to be toggled. Default is true. */ + CodeMirror.defaults['closeTagEnabled'] = true; + + /** Array of tag names to add indentation after the start tag for. Default is the list of block-level html tags. */ + CodeMirror.defaults['closeTagIndent'] = ['applet', 'blockquote', 'body', 'button', 'div', 'dl', 'fieldset', 'form', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'html', 'iframe', 'layer', 'legend', 'object', 'ol', 'p', 'select', 'table', 'ul']; + + /** + * Call during key processing to close tags. Handles the key event if the tag is closed, otherwise throws CodeMirror.Pass. + * - cm: The editor instance. + * - ch: The character being processed. + * - indent: Optional. Omit or pass true to use the default indentation tag list defined in the 'closeTagIndent' option. + * Pass false to disable indentation. Pass an array to override the default list of tag names. + */ + CodeMirror.defineExtension("closeTag", function(cm, ch, indent) { + if (!cm.getOption('closeTagEnabled')) { + throw CodeMirror.Pass; + } + + var mode = cm.getOption('mode'); + + if (mode == 'text/html') { + + /* + * Relevant structure of token: + * + * htmlmixed + * className + * state + * htmlState + * type + * context + * tagName + * mode + * + * xml + * className + * state + * tagName + * type + */ + + var pos = cm.getCursor(); + var tok = cm.getTokenAt(pos); + var state = tok.state.base || tok.state; + + if (state.mode && state.mode != 'html') { + throw CodeMirror.Pass; // With htmlmixed, we only care about the html sub-mode. + } + + if (ch == '>') { + var type = state.htmlState ? state.htmlState.type : state.type; // htmlmixed : xml + + if (tok.className == 'tag' && type == 'closeTag') { + throw CodeMirror.Pass; // Don't process the '>' at the end of an end-tag. + } + + cm.replaceSelection('>'); // Mode state won't update until we finish the tag. + pos = {line: pos.line, ch: pos.ch + 1}; + cm.setCursor(pos); + + tok = cm.getTokenAt(cm.getCursor()); + state = tok.state.base || tok.state; + type = state.htmlState ? state.htmlState.type : state.type; // htmlmixed : xml + + if (tok.className == 'tag' && type != 'selfcloseTag') { + var tagName = state.htmlState ? state.htmlState.context.tagName : state.tagName; // htmlmixed : xml + if (tagName.length > 0) { + insertEndTag(cm, indent, pos, tagName); + } + return; + } + + // Undo the '>' insert and allow cm to handle the key instead. + cm.setSelection({line: pos.line, ch: pos.ch - 1}, pos); + cm.replaceSelection(""); + + } else if (ch == '/') { + if (tok.className == 'tag' && tok.string == '<') { + var tagName = state.htmlState ? (state.htmlState.context ? state.htmlState.context.tagName : '') : state.context.tagName; // htmlmixed : xml # extra htmlmized check is for ' 0) { + completeEndTag(cm, pos, tagName); + return; + } + } + } + + } else if (mode == 'xmlpure') { + + var pos = cm.getCursor(); + var tok = cm.getTokenAt(pos); + var tagName = tok.state.context.tagName; + + if (ch == '>') { + // tagName=foo, string=foo + // tagName=foo, string=/ # ignore + // tagName=foo, string=/foo # ignore + if (tok.string == tagName) { + cm.replaceSelection('>'); // parity w/html modes + pos = {line: pos.line, ch: pos.ch + 1}; + cm.setCursor(pos); + + insertEndTag(cm, indent, pos, tagName); + return; + } + + } else if (ch == '/') { + // ', 'end'); + cm.indentLine(pos.line + 1); + cm.indentLine(pos.line + 2); + cm.setCursor({line: pos.line + 1, ch: cm.getLine(pos.line + 1).length}); + } else { + cm.replaceSelection(''); + cm.setCursor(pos); + } + } + + function shouldIndent(cm, indent, tagName) { + if (typeof indent == 'undefined' || indent == null || indent == true) { + indent = cm.getOption('closeTagIndent'); + } + if (!indent) { + indent = []; + } + return indexOf(indent, tagName.toLowerCase()) != -1; + } + + // C&P from codemirror.js...would be nice if this were visible to utilities. + function indexOf(collection, elt) { + if (collection.indexOf) return collection.indexOf(elt); + for (var i = 0, e = collection.length; i < e; ++i) + if (collection[i] == elt) return i; + return -1; + } + + function completeEndTag(cm, pos, tagName) { + cm.replaceSelection('/' + tagName + '>'); + cm.setCursor({line: pos.line, ch: pos.ch + tagName.length + 2 }); + } + +})(); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/dialog.css b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/dialog.css new file mode 100644 index 00000000..4cb467ef --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/dialog.css @@ -0,0 +1,23 @@ +.CodeMirror-dialog { + position: relative; +} + +.CodeMirror-dialog > div { + position: absolute; + top: 0; left: 0; right: 0; + background: white; + border-bottom: 1px solid #eee; + z-index: 15; + padding: .1em .8em; + overflow: hidden; + color: #333; +} + +.CodeMirror-dialog input { + border: none; + outline: none; + background: transparent; + width: 20em; + color: inherit; + font-family: monospace; +} diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/dialog.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/dialog.js new file mode 100644 index 00000000..8950bf0c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/dialog.js @@ -0,0 +1,63 @@ +// Open simple dialogs on top of an editor. Relies on dialog.css. + +(function() { + function dialogDiv(cm, template) { + var wrap = cm.getWrapperElement(); + var dialog = wrap.insertBefore(document.createElement("div"), wrap.firstChild); + dialog.className = "CodeMirror-dialog"; + dialog.innerHTML = '
    ' + template + '
    '; + return dialog; + } + + CodeMirror.defineExtension("openDialog", function(template, callback) { + var dialog = dialogDiv(this, template); + var closed = false, me = this; + function close() { + if (closed) return; + closed = true; + dialog.parentNode.removeChild(dialog); + } + var inp = dialog.getElementsByTagName("input")[0]; + if (inp) { + CodeMirror.connect(inp, "keydown", function(e) { + if (e.keyCode == 13 || e.keyCode == 27) { + CodeMirror.e_stop(e); + close(); + me.focus(); + if (e.keyCode == 13) callback(inp.value); + } + }); + inp.focus(); + CodeMirror.connect(inp, "blur", close); + } + return close; + }); + + CodeMirror.defineExtension("openConfirm", function(template, callbacks) { + var dialog = dialogDiv(this, template); + var buttons = dialog.getElementsByTagName("button"); + var closed = false, me = this, blurring = 1; + function close() { + if (closed) return; + closed = true; + dialog.parentNode.removeChild(dialog); + me.focus(); + } + buttons[0].focus(); + for (var i = 0; i < buttons.length; ++i) { + var b = buttons[i]; + (function(callback) { + CodeMirror.connect(b, "click", function(e) { + CodeMirror.e_preventDefault(e); + close(); + if (callback) callback(me); + }); + })(callbacks[i]); + CodeMirror.connect(b, "blur", function() { + --blurring; + setTimeout(function() { if (blurring <= 0) close(); }, 200); + }); + CodeMirror.connect(b, "focus", function() { ++blurring; }); + } + }); +})(); \ No newline at end of file diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/foldcode.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/foldcode.js new file mode 100644 index 00000000..b700d860 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/foldcode.js @@ -0,0 +1,186 @@ +// the tagRangeFinder function is +// Copyright (C) 2011 by Daniel Glazman +// released under the MIT license (../../LICENSE) like the rest of CodeMirror +CodeMirror.tagRangeFinder = function(cm, line) { + var nameStartChar = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; + var nameChar = nameStartChar + "\-\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; + var xmlNAMERegExp = new RegExp("^[" + nameStartChar + "][" + nameChar + "]*"); + + var lineText = cm.getLine(line); + var found = false; + var tag = null; + var pos = 0; + while (!found) { + pos = lineText.indexOf("<", pos); + if (-1 == pos) // no tag on line + return; + if (pos + 1 < lineText.length && lineText[pos + 1] == "/") { // closing tag + pos++; + continue; + } + // ok we weem to have a start tag + if (!lineText.substr(pos + 1).match(xmlNAMERegExp)) { // not a tag name... + pos++; + continue; + } + var gtPos = lineText.indexOf(">", pos + 1); + if (-1 == gtPos) { // end of start tag not in line + var l = line + 1; + var foundGt = false; + var lastLine = cm.lineCount(); + while (l < lastLine && !foundGt) { + var lt = cm.getLine(l); + var gt = lt.indexOf(">"); + if (-1 != gt) { // found a > + foundGt = true; + var slash = lt.lastIndexOf("/", gt); + if (-1 != slash && slash < gt) { + var str = lineText.substr(slash, gt - slash + 1); + if (!str.match( /\/\s*\>/ )) // yep, that's the end of empty tag + return l+1; + } + } + l++; + } + found = true; + } + else { + var slashPos = lineText.lastIndexOf("/", gtPos); + if (-1 == slashPos) { // cannot be empty tag + found = true; + // don't continue + } + else { // empty tag? + // check if really empty tag + var str = lineText.substr(slashPos, gtPos - slashPos + 1); + if (!str.match( /\/\s*\>/ )) { // finally not empty + found = true; + // don't continue + } + } + } + if (found) { + var subLine = lineText.substr(pos + 1); + tag = subLine.match(xmlNAMERegExp); + if (tag) { + // we have an element name, wooohooo ! + tag = tag[0]; + // do we have the close tag on same line ??? + if (-1 != lineText.indexOf("", pos)) // yep + { + found = false; + } + // we don't, so we have a candidate... + } + else + found = false; + } + if (!found) + pos++; + } + + if (found) { + var startTag = "(\\<\\/" + tag + "\\>)|(\\<" + tag + "\\>)|(\\<" + tag + "\\s)|(\\<" + tag + "$)"; + var startTagRegExp = new RegExp(startTag, "g"); + var endTag = ""; + var depth = 1; + var l = line + 1; + var lastLine = cm.lineCount(); + while (l < lastLine) { + lineText = cm.getLine(l); + var match = lineText.match(startTagRegExp); + if (match) { + for (var i = 0; i < match.length; i++) { + if (match[i] == endTag) + depth--; + else + depth++; + if (!depth) + return l+1; + } + } + l++; + } + return; + } +}; + +CodeMirror.braceRangeFinder = function(cm, line) { + var lineText = cm.getLine(line); + var startChar = lineText.lastIndexOf("{"); + if (startChar < 0 || lineText.lastIndexOf("}") > startChar) return; + var tokenType = cm.getTokenAt({line: line, ch: startChar}).className; + var count = 1, lastLine = cm.lineCount(), end; + outer: for (var i = line + 1; i < lastLine; ++i) { + var text = cm.getLine(i), pos = 0; + for (;;) { + var nextOpen = text.indexOf("{", pos), nextClose = text.indexOf("}", pos); + if (nextOpen < 0) nextOpen = text.length; + if (nextClose < 0) nextClose = text.length; + pos = Math.min(nextOpen, nextClose); + if (pos == text.length) break; + if (cm.getTokenAt({line: i, ch: pos + 1}).className == tokenType) { + if (pos == nextOpen) ++count; + else if (!--count) { end = i; break outer; } + } + ++pos; + } + } + if (end == null || end == line + 1) return; + return end; +}; + +CodeMirror.indentRangeFinder = function(cm, line) { + var tabSize = cm.getOption("tabSize"); + var myIndent = cm.getLineHandle(line).indentation(tabSize), last; + for (var i = line + 1, end = cm.lineCount(); i < end; ++i) { + var handle = cm.getLineHandle(i); + if (!/^\s*$/.test(handle.text)) { + if (handle.indentation(tabSize) <= myIndent) break; + last = i; + } + } + if (!last) return null; + return last + 1; +}; + +CodeMirror.newFoldFunction = function(rangeFinder, markText) { + var folded = []; + if (markText == null) markText = '
    %N%'; + + function isFolded(cm, n) { + for (var i = 0; i < folded.length; ++i) { + var start = cm.lineInfo(folded[i].start); + if (!start) folded.splice(i--, 1); + else if (start.line == n) return {pos: i, region: folded[i]}; + } + } + + function expand(cm, region) { + cm.clearMarker(region.start); + for (var i = 0; i < region.hidden.length; ++i) + cm.showLine(region.hidden[i]); + } + + return function(cm, line) { + cm.operation(function() { + var known = isFolded(cm, line); + if (known) { + folded.splice(known.pos, 1); + expand(cm, known.region); + } else { + var end = rangeFinder(cm, line); + if (end == null) return; + var hidden = []; + for (var i = line + 1; i < end; ++i) { + var handle = cm.hideLine(i); + if (handle) hidden.push(handle); + } + var first = cm.setMarker(line, markText); + var region = {start: first, hidden: hidden}; + cm.onDeleteLine(first, function() { expand(cm, region); }); + folded.push(region); + } + }); + }; +}; diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/formatting.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/formatting.js new file mode 100644 index 00000000..e1891191 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/formatting.js @@ -0,0 +1,294 @@ +// ============== Formatting extensions ============================ +// A common storage for all mode-specific formatting features +if (!CodeMirror.modeExtensions) CodeMirror.modeExtensions = {}; + +// Returns the extension of the editor's current mode +CodeMirror.defineExtension("getModeExt", function () { + var mname = CodeMirror.resolveMode(this.getOption("mode")).name; + var ext = CodeMirror.modeExtensions[mname]; + if (!ext) throw new Error("No extensions found for mode " + mname); + return ext; +}); + +// If the current mode is 'htmlmixed', returns the extension of a mode located at +// the specified position (can be htmlmixed, css or javascript). Otherwise, simply +// returns the extension of the editor's current mode. +CodeMirror.defineExtension("getModeExtAtPos", function (pos) { + var token = this.getTokenAt(pos); + if (token && token.state && token.state.mode) + return CodeMirror.modeExtensions[token.state.mode == "html" ? "htmlmixed" : token.state.mode]; + else + return this.getModeExt(); +}); + +// Comment/uncomment the specified range +CodeMirror.defineExtension("commentRange", function (isComment, from, to) { + var curMode = this.getModeExtAtPos(this.getCursor()); + if (isComment) { // Comment range + var commentedText = this.getRange(from, to); + this.replaceRange(curMode.commentStart + this.getRange(from, to) + curMode.commentEnd + , from, to); + if (from.line == to.line && from.ch == to.ch) { // An empty comment inserted - put cursor inside + this.setCursor(from.line, from.ch + curMode.commentStart.length); + } + } + else { // Uncomment range + var selText = this.getRange(from, to); + var startIndex = selText.indexOf(curMode.commentStart); + var endIndex = selText.lastIndexOf(curMode.commentEnd); + if (startIndex > -1 && endIndex > -1 && endIndex > startIndex) { + // Take string till comment start + selText = selText.substr(0, startIndex) + // From comment start till comment end + + selText.substring(startIndex + curMode.commentStart.length, endIndex) + // From comment end till string end + + selText.substr(endIndex + curMode.commentEnd.length); + } + this.replaceRange(selText, from, to); + } +}); + +// Applies automatic mode-aware indentation to the specified range +CodeMirror.defineExtension("autoIndentRange", function (from, to) { + var cmInstance = this; + this.operation(function () { + for (var i = from.line; i <= to.line; i++) { + cmInstance.indentLine(i, "smart"); + } + }); +}); + +// Applies automatic formatting to the specified range +CodeMirror.defineExtension("autoFormatRange", function (from, to) { + var absStart = this.indexFromPos(from); + var absEnd = this.indexFromPos(to); + // Insert additional line breaks where necessary according to the + // mode's syntax + var res = this.getModeExt().autoFormatLineBreaks(this.getValue(), absStart, absEnd); + var cmInstance = this; + + // Replace and auto-indent the range + this.operation(function () { + cmInstance.replaceRange(res, from, to); + var startLine = cmInstance.posFromIndex(absStart).line; + var endLine = cmInstance.posFromIndex(absStart + res.length).line; + for (var i = startLine; i <= endLine; i++) { + cmInstance.indentLine(i, "smart"); + } + }); +}); + +// Define extensions for a few modes + +CodeMirror.modeExtensions["css"] = { + commentStart: "/*", + commentEnd: "*/", + wordWrapChars: [";", "\\{", "\\}"], + autoFormatLineBreaks: function (text) { + return text.replace(new RegExp("(;|\\{|\\})([^\r\n])", "g"), "$1\n$2"); + } +}; + +CodeMirror.modeExtensions["javascript"] = { + commentStart: "/*", + commentEnd: "*/", + wordWrapChars: [";", "\\{", "\\}"], + + getNonBreakableBlocks: function (text) { + var nonBreakableRegexes = [ + new RegExp("for\\s*?\\(([\\s\\S]*?)\\)"), + new RegExp("'([\\s\\S]*?)('|$)"), + new RegExp("\"([\\s\\S]*?)(\"|$)"), + new RegExp("//.*([\r\n]|$)") + ]; + var nonBreakableBlocks = new Array(); + for (var i = 0; i < nonBreakableRegexes.length; i++) { + var curPos = 0; + while (curPos < text.length) { + var m = text.substr(curPos).match(nonBreakableRegexes[i]); + if (m != null) { + nonBreakableBlocks.push({ + start: curPos + m.index, + end: curPos + m.index + m[0].length + }); + curPos += m.index + Math.max(1, m[0].length); + } + else { // No more matches + break; + } + } + } + nonBreakableBlocks.sort(function (a, b) { + return a.start - b.start; + }); + + return nonBreakableBlocks; + }, + + autoFormatLineBreaks: function (text) { + var curPos = 0; + var reLinesSplitter = new RegExp("(;|\\{|\\})([^\r\n])", "g"); + var nonBreakableBlocks = this.getNonBreakableBlocks(text); + if (nonBreakableBlocks != null) { + var res = ""; + for (var i = 0; i < nonBreakableBlocks.length; i++) { + if (nonBreakableBlocks[i].start > curPos) { // Break lines till the block + res += text.substring(curPos, nonBreakableBlocks[i].start).replace(reLinesSplitter, "$1\n$2"); + curPos = nonBreakableBlocks[i].start; + } + if (nonBreakableBlocks[i].start <= curPos + && nonBreakableBlocks[i].end >= curPos) { // Skip non-breakable block + res += text.substring(curPos, nonBreakableBlocks[i].end); + curPos = nonBreakableBlocks[i].end; + } + } + if (curPos < text.length - 1) { + res += text.substr(curPos).replace(reLinesSplitter, "$1\n$2"); + } + return res; + } + else { + return text.replace(reLinesSplitter, "$1\n$2"); + } + } +}; + +CodeMirror.modeExtensions["xml"] = { + commentStart: "", + wordWrapChars: [">"], + + autoFormatLineBreaks: function (text) { + var lines = text.split("\n"); + var reProcessedPortion = new RegExp("(^\\s*?<|^[^<]*?)(.+)(>\\s*?$|[^>]*?$)"); + var reOpenBrackets = new RegExp("<", "g"); + var reCloseBrackets = new RegExp("(>)([^\r\n])", "g"); + for (var i = 0; i < lines.length; i++) { + var mToProcess = lines[i].match(reProcessedPortion); + if (mToProcess != null && mToProcess.length > 3) { // The line starts with whitespaces and ends with whitespaces + lines[i] = mToProcess[1] + + mToProcess[2].replace(reOpenBrackets, "\n$&").replace(reCloseBrackets, "$1\n$2") + + mToProcess[3]; + continue; + } + } + + return lines.join("\n"); + } +}; + +CodeMirror.modeExtensions["htmlmixed"] = { + commentStart: "", + wordWrapChars: [">", ";", "\\{", "\\}"], + + getModeInfos: function (text, absPos) { + var modeInfos = new Array(); + modeInfos[0] = + { + pos: 0, + modeExt: CodeMirror.modeExtensions["xml"], + modeName: "xml" + }; + + var modeMatchers = new Array(); + modeMatchers[0] = + { + regex: new RegExp("]*>([\\s\\S]*?)(]*>|$)", "i"), + modeExt: CodeMirror.modeExtensions["css"], + modeName: "css" + }; + modeMatchers[1] = + { + regex: new RegExp("]*>([\\s\\S]*?)(]*>|$)", "i"), + modeExt: CodeMirror.modeExtensions["javascript"], + modeName: "javascript" + }; + + var lastCharPos = (typeof (absPos) !== "undefined" ? absPos : text.length - 1); + // Detect modes for the entire text + for (var i = 0; i < modeMatchers.length; i++) { + var curPos = 0; + while (curPos <= lastCharPos) { + var m = text.substr(curPos).match(modeMatchers[i].regex); + if (m != null) { + if (m.length > 1 && m[1].length > 0) { + // Push block begin pos + var blockBegin = curPos + m.index + m[0].indexOf(m[1]); + modeInfos.push( + { + pos: blockBegin, + modeExt: modeMatchers[i].modeExt, + modeName: modeMatchers[i].modeName + }); + // Push block end pos + modeInfos.push( + { + pos: blockBegin + m[1].length, + modeExt: modeInfos[0].modeExt, + modeName: modeInfos[0].modeName + }); + curPos += m.index + m[0].length; + continue; + } + else { + curPos += m.index + Math.max(m[0].length, 1); + } + } + else { // No more matches + break; + } + } + } + // Sort mode infos + modeInfos.sort(function sortModeInfo(a, b) { + return a.pos - b.pos; + }); + + return modeInfos; + }, + + autoFormatLineBreaks: function (text, startPos, endPos) { + var modeInfos = this.getModeInfos(text); + var reBlockStartsWithNewline = new RegExp("^\\s*?\n"); + var reBlockEndsWithNewline = new RegExp("\n\\s*?$"); + var res = ""; + // Use modes info to break lines correspondingly + if (modeInfos.length > 1) { // Deal with multi-mode text + for (var i = 1; i <= modeInfos.length; i++) { + var selStart = modeInfos[i - 1].pos; + var selEnd = (i < modeInfos.length ? modeInfos[i].pos : endPos); + + if (selStart >= endPos) { // The block starts later than the needed fragment + break; + } + if (selStart < startPos) { + if (selEnd <= startPos) { // The block starts earlier than the needed fragment + continue; + } + selStart = startPos; + } + if (selEnd > endPos) { + selEnd = endPos; + } + var textPortion = text.substring(selStart, selEnd); + if (modeInfos[i - 1].modeName != "xml") { // Starting a CSS or JavaScript block + if (!reBlockStartsWithNewline.test(textPortion) + && selStart > 0) { // The block does not start with a line break + textPortion = "\n" + textPortion; + } + if (!reBlockEndsWithNewline.test(textPortion) + && selEnd < text.length - 1) { // The block does not end with a line break + textPortion += "\n"; + } + } + res += modeInfos[i - 1].modeExt.autoFormatLineBreaks(textPortion); + } + } + else { // Single-mode text + res = modeInfos[0].modeExt.autoFormatLineBreaks(text.substring(startPos, endPos)); + } + + return res; + } +}; diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/javascript-hint.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/javascript-hint.js new file mode 100644 index 00000000..2117e5af --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/javascript-hint.js @@ -0,0 +1,134 @@ +(function () { + function forEach(arr, f) { + for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]); + } + + function arrayContains(arr, item) { + if (!Array.prototype.indexOf) { + var i = arr.length; + while (i--) { + if (arr[i] === item) { + return true; + } + } + return false; + } + return arr.indexOf(item) != -1; + } + + function scriptHint(editor, keywords, getToken) { + // Find the token at the cursor + var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token; + // If it's not a 'word-style' token, ignore the token. + if (!/^[\w$_]*$/.test(token.string)) { + token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state, + className: token.string == "." ? "property" : null}; + } + // If it is a property, find out what it is a property of. + while (tprop.className == "property") { + tprop = getToken(editor, {line: cur.line, ch: tprop.start}); + if (tprop.string != ".") return; + tprop = getToken(editor, {line: cur.line, ch: tprop.start}); + if (tprop.string == ')') { + var level = 1; + do { + tprop = getToken(editor, {line: cur.line, ch: tprop.start}); + switch (tprop.string) { + case ')': level++; break; + case '(': level--; break; + default: break; + } + } while (level > 0) + tprop = getToken(editor, {line: cur.line, ch: tprop.start}); + if (tprop.className == 'variable') + tprop.className = 'function'; + else return; // no clue + } + if (!context) var context = []; + context.push(tprop); + } + return {list: getCompletions(token, context, keywords), + from: {line: cur.line, ch: token.start}, + to: {line: cur.line, ch: token.end}}; + } + + CodeMirror.javascriptHint = function(editor) { + return scriptHint(editor, javascriptKeywords, + function (e, cur) {return e.getTokenAt(cur);}); + } + + function getCoffeeScriptToken(editor, cur) { + // This getToken, it is for coffeescript, imitates the behavior of + // getTokenAt method in javascript.js, that is, returning "property" + // type and treat "." as indepenent token. + var token = editor.getTokenAt(cur); + if (cur.ch == token.start + 1 && token.string.charAt(0) == '.') { + token.end = token.start; + token.string = '.'; + token.className = "property"; + } + else if (/^\.[\w$_]*$/.test(token.string)) { + token.className = "property"; + token.start++; + token.string = token.string.replace(/\./, ''); + } + return token; + } + + CodeMirror.coffeescriptHint = function(editor) { + return scriptHint(editor, coffeescriptKeywords, getCoffeeScriptToken); + } + + var stringProps = ("charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight " + + "toUpperCase toLowerCase split concat match replace search").split(" "); + var arrayProps = ("length concat join splice push pop shift unshift slice reverse sort indexOf " + + "lastIndexOf every some filter forEach map reduce reduceRight ").split(" "); + var funcProps = "prototype apply call bind".split(" "); + var javascriptKeywords = ("break case catch continue debugger default delete do else false finally for function " + + "if in instanceof new null return switch throw true try typeof var void while with").split(" "); + var coffeescriptKeywords = ("and break catch class continue delete do else extends false finally for " + + "if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes").split(" "); + + function getCompletions(token, context, keywords) { + var found = [], start = token.string; + function maybeAdd(str) { + if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str); + } + function gatherCompletions(obj) { + if (typeof obj == "string") forEach(stringProps, maybeAdd); + else if (obj instanceof Array) forEach(arrayProps, maybeAdd); + else if (obj instanceof Function) forEach(funcProps, maybeAdd); + for (var name in obj) maybeAdd(name); + } + + if (context) { + // If this is a property, see if it belongs to some object we can + // find in the current environment. + var obj = context.pop(), base; + if (obj.className == "variable") + base = window[obj.string]; + else if (obj.className == "string") + base = ""; + else if (obj.className == "atom") + base = 1; + else if (obj.className == "function") { + if (window.jQuery != null && (obj.string == '$' || obj.string == 'jQuery') && + (typeof window.jQuery == 'function')) + base = window.jQuery(); + else if (window._ != null && (obj.string == '_') && (typeof window._ == 'function')) + base = window._(); + } + while (base != null && context.length) + base = base[context.pop().string]; + if (base != null) gatherCompletions(base); + } + else { + // If not, just look in the window object and any local scope + // (reading into JS mode internals to get at the local variables) + for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name); + gatherCompletions(window); + forEach(keywords, maybeAdd); + } + return found; + } +})(); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/match-highlighter.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/match-highlighter.js new file mode 100644 index 00000000..b70cc4cf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/match-highlighter.js @@ -0,0 +1,44 @@ +// Define match-highlighter commands. Depends on searchcursor.js +// Use by attaching the following function call to the onCursorActivity event: + //myCodeMirror.matchHighlight(minChars); +// And including a special span.CodeMirror-matchhighlight css class (also optionally a separate one for .CodeMirror-focused -- see demo matchhighlighter.html) + +(function() { + var DEFAULT_MIN_CHARS = 2; + + function MatchHighlightState() { + this.marked = []; + } + function getMatchHighlightState(cm) { + return cm._matchHighlightState || (cm._matchHighlightState = new MatchHighlightState()); + } + + function clearMarks(cm) { + var state = getMatchHighlightState(cm); + for (var i = 0; i < state.marked.length; ++i) + state.marked[i].clear(); + state.marked = []; + } + + function markDocument(cm, className, minChars) { + clearMarks(cm); + minChars = (typeof minChars !== 'undefined' ? minChars : DEFAULT_MIN_CHARS); + if (cm.somethingSelected() && cm.getSelection().length >= minChars) { + var state = getMatchHighlightState(cm); + var query = cm.getSelection(); + cm.operation(function() { + if (cm.lineCount() < 2000) { // This is too expensive on big documents. + for (var cursor = cm.getSearchCursor(query); cursor.findNext();) { + //Only apply matchhighlight to the matches other than the one actually selected + if (!(cursor.from().line === cm.getCursor(true).line && cursor.from().ch === cm.getCursor(true).ch)) + state.marked.push(cm.markText(cursor.from(), cursor.to(), className)); + } + } + }); + } + } + + CodeMirror.defineExtension("matchHighlight", function(className, minChars) { + markDocument(this, className, minChars); + }); +})(); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/overlay.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/overlay.js new file mode 100644 index 00000000..c4cdf9fc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/overlay.js @@ -0,0 +1,51 @@ +// Utility function that allows modes to be combined. The mode given +// as the base argument takes care of most of the normal mode +// functionality, but a second (typically simple) mode is used, which +// can override the style of text. Both modes get to parse all of the +// text, but when both assign a non-null style to a piece of code, the +// overlay wins, unless the combine argument was true, in which case +// the styles are combined. + +CodeMirror.overlayParser = function(base, overlay, combine) { + return { + startState: function() { + return { + base: CodeMirror.startState(base), + overlay: CodeMirror.startState(overlay), + basePos: 0, baseCur: null, + overlayPos: 0, overlayCur: null + }; + }, + copyState: function(state) { + return { + base: CodeMirror.copyState(base, state.base), + overlay: CodeMirror.copyState(overlay, state.overlay), + basePos: state.basePos, baseCur: null, + overlayPos: state.overlayPos, overlayCur: null + }; + }, + + token: function(stream, state) { + if (stream.start == state.basePos) { + state.baseCur = base.token(stream, state.base); + state.basePos = stream.pos; + } + if (stream.start == state.overlayPos) { + stream.pos = stream.start; + state.overlayCur = overlay.token(stream, state.overlay); + state.overlayPos = stream.pos; + } + stream.pos = Math.min(state.basePos, state.overlayPos); + if (stream.eol()) state.basePos = state.overlayPos = 0; + + if (state.overlayCur == null) return state.baseCur; + if (state.baseCur != null && combine) return state.baseCur + " " + state.overlayCur; + else return state.overlayCur; + }, + + indent: function(state, textAfter) { + return base.indent(state.base, textAfter); + }, + electricChars: base.electricChars + }; +}; diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/runmode.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/runmode.js new file mode 100644 index 00000000..fc58d857 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/runmode.js @@ -0,0 +1,49 @@ +CodeMirror.runMode = function(string, modespec, callback, options) { + var mode = CodeMirror.getMode(CodeMirror.defaults, modespec); + var isNode = callback.nodeType == 1; + var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize; + if (isNode) { + var node = callback, accum = [], col = 0; + callback = function(text, style) { + if (text == "\n") { + accum.push("
    "); + col = 0; + return; + } + var escaped = ""; + // HTML-escape and replace tabs + for (var pos = 0;;) { + var idx = text.indexOf("\t", pos); + if (idx == -1) { + escaped += CodeMirror.htmlEscape(text.slice(pos)); + col += text.length - pos; + break; + } else { + col += idx - pos; + escaped += CodeMirror.htmlEscape(text.slice(pos, idx)); + var size = tabSize - col % tabSize; + col += size; + for (var i = 0; i < size; ++i) escaped += " "; + pos = idx + 1; + } + } + + if (style) + accum.push("" + escaped + ""); + else + accum.push(escaped); + } + } + var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode); + for (var i = 0, e = lines.length; i < e; ++i) { + if (i) callback("\n"); + var stream = new CodeMirror.StringStream(lines[i]); + while (!stream.eol()) { + var style = mode.token(stream, state); + callback(stream.current(), style, i, stream.start); + stream.start = stream.pos; + } + } + if (isNode) + node.innerHTML = accum.join(""); +}; diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/search.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/search.js new file mode 100644 index 00000000..63ebca9b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/search.js @@ -0,0 +1,114 @@ +// Define search commands. Depends on dialog.js or another +// implementation of the openDialog method. + +// Replace works a little oddly -- it will do the replace on the next +// Ctrl-G (or whatever is bound to findNext) press. You prevent a +// replace by making sure the match is no longer selected when hitting +// Ctrl-G. + +(function() { + function SearchState() { + this.posFrom = this.posTo = this.query = null; + this.marked = []; + } + function getSearchState(cm) { + return cm._searchState || (cm._searchState = new SearchState()); + } + function dialog(cm, text, shortText, f) { + if (cm.openDialog) cm.openDialog(text, f); + else f(prompt(shortText, "")); + } + function confirmDialog(cm, text, shortText, fs) { + if (cm.openConfirm) cm.openConfirm(text, fs); + else if (confirm(shortText)) fs[0](); + } + function parseQuery(query) { + var isRE = query.match(/^\/(.*)\/$/); + return isRE ? new RegExp(isRE[1]) : query; + } + var queryDialog = + 'Search: (Use /re/ syntax for regexp search)'; + function doSearch(cm, rev) { + var state = getSearchState(cm); + if (state.query) return findNext(cm, rev); + dialog(cm, queryDialog, "Search for:", function(query) { + cm.operation(function() { + if (!query || state.query) return; + state.query = parseQuery(query); + if (cm.lineCount() < 2000) { // This is too expensive on big documents. + for (var cursor = cm.getSearchCursor(query); cursor.findNext();) + state.marked.push(cm.markText(cursor.from(), cursor.to(), "CodeMirror-searching")); + } + state.posFrom = state.posTo = cm.getCursor(); + findNext(cm, rev); + }); + }); + } + function findNext(cm, rev) {cm.operation(function() { + var state = getSearchState(cm); + var cursor = cm.getSearchCursor(state.query, rev ? state.posFrom : state.posTo); + if (!cursor.find(rev)) { + cursor = cm.getSearchCursor(state.query, rev ? {line: cm.lineCount() - 1} : {line: 0, ch: 0}); + if (!cursor.find(rev)) return; + } + cm.setSelection(cursor.from(), cursor.to()); + state.posFrom = cursor.from(); state.posTo = cursor.to(); + })} + function clearSearch(cm) {cm.operation(function() { + var state = getSearchState(cm); + if (!state.query) return; + state.query = null; + for (var i = 0; i < state.marked.length; ++i) state.marked[i].clear(); + state.marked.length = 0; + })} + + var replaceQueryDialog = + 'Replace: (Use /re/ syntax for regexp search)'; + var replacementQueryDialog = 'With: '; + var doReplaceConfirm = "Replace? "; + function replace(cm, all) { + dialog(cm, replaceQueryDialog, "Replace:", function(query) { + if (!query) return; + query = parseQuery(query); + dialog(cm, replacementQueryDialog, "Replace with:", function(text) { + if (all) { + cm.operation(function() { + for (var cursor = cm.getSearchCursor(query); cursor.findNext();) { + if (typeof query != "string") { + var match = cm.getRange(cursor.from(), cursor.to()).match(query); + cursor.replace(text.replace(/\$(\d)/, function(w, i) {return match[i];})); + } else cursor.replace(text); + } + }); + } else { + clearSearch(cm); + var cursor = cm.getSearchCursor(query, cm.getCursor()); + function advance() { + var start = cursor.from(), match; + if (!(match = cursor.findNext())) { + cursor = cm.getSearchCursor(query); + if (!(match = cursor.findNext()) || + (cursor.from().line == start.line && cursor.from().ch == start.ch)) return; + } + cm.setSelection(cursor.from(), cursor.to()); + confirmDialog(cm, doReplaceConfirm, "Replace?", + [function() {doReplace(match);}, advance]); + } + function doReplace(match) { + cursor.replace(typeof query == "string" ? text : + text.replace(/\$(\d)/, function(w, i) {return match[i];})); + advance(); + } + advance(); + } + }); + }); + } + + CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);}; + CodeMirror.commands.findNext = doSearch; + CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);}; + CodeMirror.commands.clearSearch = clearSearch; + CodeMirror.commands.replace = replace; + CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);}; +})(); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/searchcursor.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/searchcursor.js new file mode 100644 index 00000000..3b77829f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/searchcursor.js @@ -0,0 +1,117 @@ +(function(){ + function SearchCursor(cm, query, pos, caseFold) { + this.atOccurrence = false; this.cm = cm; + if (caseFold == null) caseFold = typeof query == "string" && query == query.toLowerCase(); + + pos = pos ? cm.clipPos(pos) : {line: 0, ch: 0}; + this.pos = {from: pos, to: pos}; + + // The matches method is filled in based on the type of query. + // It takes a position and a direction, and returns an object + // describing the next occurrence of the query, or null if no + // more matches were found. + if (typeof query != "string") // Regexp match + this.matches = function(reverse, pos) { + if (reverse) { + var line = cm.getLine(pos.line).slice(0, pos.ch), match = line.match(query), start = 0; + while (match) { + var ind = line.indexOf(match[0]); + start += ind; + line = line.slice(ind + 1); + var newmatch = line.match(query); + if (newmatch) match = newmatch; + else break; + start++; + } + } + else { + var line = cm.getLine(pos.line).slice(pos.ch), match = line.match(query), + start = match && pos.ch + line.indexOf(match[0]); + } + if (match) + return {from: {line: pos.line, ch: start}, + to: {line: pos.line, ch: start + match[0].length}, + match: match}; + }; + else { // String query + if (caseFold) query = query.toLowerCase(); + var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;}; + var target = query.split("\n"); + // Different methods for single-line and multi-line queries + if (target.length == 1) + this.matches = function(reverse, pos) { + var line = fold(cm.getLine(pos.line)), len = query.length, match; + if (reverse ? (pos.ch >= len && (match = line.lastIndexOf(query, pos.ch - len)) != -1) + : (match = line.indexOf(query, pos.ch)) != -1) + return {from: {line: pos.line, ch: match}, + to: {line: pos.line, ch: match + len}}; + }; + else + this.matches = function(reverse, pos) { + var ln = pos.line, idx = (reverse ? target.length - 1 : 0), match = target[idx], line = fold(cm.getLine(ln)); + var offsetA = (reverse ? line.indexOf(match) + match.length : line.lastIndexOf(match)); + if (reverse ? offsetA >= pos.ch || offsetA != match.length + : offsetA <= pos.ch || offsetA != line.length - match.length) + return; + for (;;) { + if (reverse ? !ln : ln == cm.lineCount() - 1) return; + line = fold(cm.getLine(ln += reverse ? -1 : 1)); + match = target[reverse ? --idx : ++idx]; + if (idx > 0 && idx < target.length - 1) { + if (line != match) return; + else continue; + } + var offsetB = (reverse ? line.lastIndexOf(match) : line.indexOf(match) + match.length); + if (reverse ? offsetB != line.length - match.length : offsetB != match.length) + return; + var start = {line: pos.line, ch: offsetA}, end = {line: ln, ch: offsetB}; + return {from: reverse ? end : start, to: reverse ? start : end}; + } + }; + } + } + + SearchCursor.prototype = { + findNext: function() {return this.find(false);}, + findPrevious: function() {return this.find(true);}, + + find: function(reverse) { + var self = this, pos = this.cm.clipPos(reverse ? this.pos.from : this.pos.to); + function savePosAndFail(line) { + var pos = {line: line, ch: 0}; + self.pos = {from: pos, to: pos}; + self.atOccurrence = false; + return false; + } + + for (;;) { + if (this.pos = this.matches(reverse, pos)) { + this.atOccurrence = true; + return this.pos.match || true; + } + if (reverse) { + if (!pos.line) return savePosAndFail(0); + pos = {line: pos.line-1, ch: this.cm.getLine(pos.line-1).length}; + } + else { + var maxLine = this.cm.lineCount(); + if (pos.line == maxLine - 1) return savePosAndFail(maxLine); + pos = {line: pos.line+1, ch: 0}; + } + } + }, + + from: function() {if (this.atOccurrence) return this.pos.from;}, + to: function() {if (this.atOccurrence) return this.pos.to;}, + + replace: function(newText) { + var self = this; + if (this.atOccurrence) + self.pos.to = this.cm.replaceRange(newText, self.pos.from, self.pos.to); + } + }; + + CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) { + return new SearchCursor(this, query, pos, caseFold); + }); +})(); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/simple-hint.css b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/simple-hint.css new file mode 100644 index 00000000..4387cb94 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/simple-hint.css @@ -0,0 +1,16 @@ +.CodeMirror-completions { + position: absolute; + z-index: 10; + overflow: hidden; + -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); + -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); + box-shadow: 2px 3px 5px rgba(0,0,0,.2); +} +.CodeMirror-completions select { + background: #fafafa; + outline: none; + border: none; + padding: 0; + margin: 0; + font-family: monospace; +} diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/simple-hint.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/simple-hint.js new file mode 100644 index 00000000..7decd587 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/codemirror/util/simple-hint.js @@ -0,0 +1,72 @@ +(function() { + CodeMirror.simpleHint = function(editor, getHints) { + // We want a single cursor position. + if (editor.somethingSelected()) return; + var result = getHints(editor); + if (!result || !result.list.length) return; + var completions = result.list; + function insert(str) { + editor.replaceRange(str, result.from, result.to); + } + // When there is only one completion, use it directly. + if (completions.length == 1) {insert(completions[0]); return true;} + + // Build the select widget + var complete = document.createElement("div"); + complete.className = "CodeMirror-completions"; + var sel = complete.appendChild(document.createElement("select")); + // Opera doesn't move the selection when pressing up/down in a + // multi-select, but it does properly support the size property on + // single-selects, so no multi-select is necessary. + if (!window.opera) sel.multiple = true; + for (var i = 0; i < completions.length; ++i) { + var opt = sel.appendChild(document.createElement("option")); + opt.appendChild(document.createTextNode(completions[i])); + } + sel.firstChild.selected = true; + sel.size = Math.min(10, completions.length); + var pos = editor.cursorCoords(); + complete.style.left = pos.x + "px"; + complete.style.top = pos.yBot + "px"; + document.body.appendChild(complete); + // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor. + var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth); + if(winW - pos.x < sel.clientWidth) + complete.style.left = (pos.x - sel.clientWidth) + "px"; + // Hack to hide the scrollbar. + if (completions.length <= 10) + complete.style.width = (sel.clientWidth - 1) + "px"; + + var done = false; + function close() { + if (done) return; + done = true; + complete.parentNode.removeChild(complete); + } + function pick() { + insert(completions[sel.selectedIndex]); + close(); + setTimeout(function(){editor.focus();}, 50); + } + CodeMirror.connect(sel, "blur", close); + CodeMirror.connect(sel, "keydown", function(event) { + var code = event.keyCode; + // Enter + if (code == 13) {CodeMirror.e_stop(event); pick();} + // Escape + else if (code == 27) {CodeMirror.e_stop(event); close(); editor.focus();} + else if (code != 38 && code != 40) { + close(); editor.focus(); + // Pass the event to the CodeMirror instance so that it can handle things like backspace properly. + editor.triggerOnKeyDown(event); + setTimeout(function(){CodeMirror.simpleHint(editor, getHints);}, 50); + } + }); + CodeMirror.connect(sel, "dblclick", pick); + + sel.focus(); + // Opera sometimes ignores focusing a freshly created node + if (window.opera) setTimeout(function(){if (!done) sel.focus();}, 100); + return true; + }; +})(); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/css/toolbar.css b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/css/toolbar.css new file mode 100644 index 00000000..d93270ca --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/css/toolbar.css @@ -0,0 +1,397 @@ +/* Debug Toolbar CSS Reset, adapted from Eric Meyer's CSS Reset */ +#flDebug, #flDebug * { + margin:0; + padding:0; + border:0; + outline:0; + font-size:12px; + line-height:1.5em; + color:#000; + vertical-align:baseline; + background: none; + font-family: inherit; + text-align:left; +} + +#flDebug { font-family: sans-serif; color: #000; background: #fff; } + +#flDebug tbody, #flDebug code, #flDebug pre { + font-family: Consolas, Monaco, "Bitstream Vera Sans Mono", "Lucida Console", monospace; +} + +#flDebug #flDebugToolbar { + background:#111; + width:200px; + z-index:100000000; + position:fixed; + top:0; + bottom:0; + right:0; + opacity:0.9; +} + +#flDebug #flDebugToolbar small { + color:#999; +} + +#flDebug #flDebugToolbar ul { + margin:0; + padding:0; + list-style:none; +} + +#flDebug #flDebugToolbar li { + border-bottom:1px solid #222; + color:#fff; + display:block; + font-weight:bold; + float:none; + margin:0; + padding:0; + position:relative; + width:auto; +} + +#flDebug #flDebugToolbar li>a, +#flDebug #flDebugToolbar li>div.contentless { + font-weight:normal; + font-style:normal; + text-decoration:none; + display:block; + font-size:16px; + padding:10px 10px 5px 25px; + color:#fff; +} + +#flDebug #flDebugToolbar li a:hover { + color:#111; + background-color:#ffc; +} + +#flDebug #flDebugToolbar li.active { + background-image:url(../img/indicator.png); + background-repeat:no-repeat; + background-position:left center; + background-color:#333; + padding-left:10px; +} + +#flDebug #flDebugToolbar li.active a:hover { + color:#b36a60; + background-color:transparent; +} + +#flDebug #flDebugToolbar li small { + font-size:12px; + color:#999; + font-style:normal; + text-decoration:none; + font-variant:small-caps; +} + +#flDebug #flDebugToolbar li .switch { + font-size: 10px; + position: absolute; + display: block; + color: white; + height: 16px; + width: 16px; + cursor: pointer; + top: 15px; + right: 2px; +} + +#flDebug #flDebugToolbar li .switch.active { + background-image: url(../img/tick.png); +} + +#flDebug #flDebugToolbar li .switch.inactive { + background-image: url(../img/tick-red.png); +} + + +#flDebug #flDebugToolbarHandle { + position:fixed; + background:#fff; + border:1px solid #111; + top:30px; + right:0; + z-index:100000000; + opacity:0.75; +} + +#flDebug a#flShowToolBarButton { + display:block; + height:75px; + width:30px; + border-right:none; + border-bottom:4px solid #fff; + border-top:4px solid #fff; + border-left:4px solid #fff; + color:#fff; + font-size:10px; + font-weight:bold; + text-decoration:none; + text-align:center; + text-indent:-999999px; + background:#000 url(../img/djdt_vertical.png) no-repeat left center; + opacity:0.5; +} + +#flDebug a#flShowToolBarButton:hover { + background-color:#111; + padding-right:6px; + border-top-color:#FFE761; + border-left-color:#FFE761; + border-bottom-color:#FFE761; + opacity:1.0; +} + +#flDebug code { + display:inline; + white-space:pre; + overflow:auto; +} + +#flDebug tr.flDebugOdd { + background-color:#f5f5f5; +} + +#flDebug .panelContent { + display:none; + position:fixed; + margin:0; + top:0; + right:200px; + bottom:0; + left:0px; + background-color:#eee; + color:#666; + z-index:100000000; +} + +#flDebug .panelContent > div { + border-bottom:1px solid #ddd; +} + +#flDebug .flDebugPanelTitle { + position:absolute; + background-color:#ffc; + color:#666; + padding-left:20px; + top:0; + right:0; + left:0; + height:50px; +} + +#flDebug .flDebugPanelTitle code { + display:inline; + font-size:inherit; +} + +#flDebug .flDebugPanelContent { + position:absolute; + top:50px; + right:0; + bottom:0; + left:0; + height:auto; + padding:0 0 0 20px; +} + +#flDebug .flDebugPanelContent .scroll { + height:100%; + overflow:auto; + display:block; + padding:0 10px 0 0; +} + +#flDebug h3 { + font-size:24px; + font-weight:normal; + line-height:50px; +} + +#flDebug h4 { + font-size:20px; + font-weight:bold; + margin-top:0.8em; +} + +#flDebug h5 { + font-size: 14px; +} + +#flDebug .panelContent table { + border:1px solid #ccc; + border-collapse:collapse; + width:100%; + background-color:#fff; + display:block; + margin-top:0.8em; + overflow: auto; +} +#flDebug .panelContent tbody td, +#flDebug .panelContent tbody th { + vertical-align:top; + padding:2px 3px; +} +#flDebug .panelContent thead th { + padding:1px 6px 1px 3px; + text-align:left; + font-weight:bold; + font-size:14px; +} +#flDebug .panelContent tbody th { + width:12em; + text-align:right; + color:#666; + padding-right:.5em; +} + +#flDebug .panelContent ol li { + margin: 0 0 1em 2em; +} + +#flDebug .panelContent pre { + border:1px solid #ccc; + background-color:#fff; + display:block; + margin:0.8em 0; + padding: 0.2em 0.5em; +} + +#flDebug .flTemplateHideContextDiv { + background-color:#fff; +} + +#flDebug .panelContent .flDebugClose { + text-indent:-9999999px; + display:block; + position:absolute; + top:4px; + right:15px; + height:40px; + width:40px; + background:url(../img/close.png) no-repeat center center; +} + +#flDebug .panelContent .flDebugClose:hover { + background-image:url(../img/close_hover.png); +} + +#flDebug .panelContent .flDebugClose.flDebugBack { + background-image:url(../img/back.png); +} + +#flDebug .panelContent .flDebugClose.flDebugBack:hover { + background-image:url(../img/back_hover.png); +} + +#flDebug .panelContent dt, #flDebug .panelContent dd { + display:block; +} + +#flDebug .panelContent dt { + margin-top:0.75em; +} + +#flDebug .panelContent dd { + margin-left:10px; +} + +#flDebug a.toggleTemplate { + padding:4px; + background-color:#bbb; + -moz-border-radius:3px; + -webkit-border-radius:3px; +} + +#flDebug a.toggleTemplate:hover { + padding:4px; + background-color:#444; + color:#ffe761; + -moz-border-radius:3px; + -webkit-border-radius:3px; +} + + +#flDebug a.flTemplateShowContext, #flDebug a.flTemplateShowContext span.toggleArrow { + color:#999; +} + +#flDebug a.flTemplateShowContext:hover, #flDebug a.flTemplateShowContext:hover span.toggleArrow { + color:#000; + cursor:pointer; +} + +#flDebug .flDebugSqlWrap { + position:relative; +} + +#flDebug .flDebugSql { + z-index:100000002; +} + +#flDebug .flSQLHideStacktraceDiv tbody th { + text-align: left; +} + +#flDebug span.flDebugLineChart { + background-color:#777; + height:3px; + position:absolute; + bottom:0; + top:0; + left:0; + display:block; + z-index:1000000001; +} +#flDebug span.flDebugLineChartWarning { + background-color:#900; +} + +#flDebug .highlight { color:#000; } +#flDebug .highlight .err { color:#000; } /* Error */ +#flDebug .highlight .g { color:#000; } /* Generic */ +#flDebug .highlight .k { color:#000; font-weight:bold } /* Keyword */ +#flDebug .highlight .o { color:#000; } /* Operator */ +#flDebug .highlight .n { color:#000; } /* Name */ +#flDebug .highlight .mi { color:#000; font-weight:bold } /* Literal.Number.Integer */ +#flDebug .highlight .l { color:#000; } /* Literal */ +#flDebug .highlight .x { color:#000; } /* Other */ +#flDebug .highlight .p { color:#000; } /* Punctuation */ +#flDebug .highlight .m { color:#000; font-weight:bold } /* Literal.Number */ +#flDebug .highlight .s { color:#333 } /* Literal.String */ +#flDebug .highlight .w { color:#888888 } /* Text.Whitespace */ +#flDebug .highlight .il { color:#000; font-weight:bold } /* Literal.Number.Integer.Long */ +#flDebug .highlight .na { color:#333 } /* Name.Attribute */ +#flDebug .highlight .nt { color:#000; font-weight:bold } /* Name.Tag */ +#flDebug .highlight .nv { color:#333 } /* Name.Variable */ +#flDebug .highlight .s2 { color:#333 } /* Literal.String.Double */ +#flDebug .highlight .cp { color:#333 } /* Comment.Preproc */ + +/* tablesorted */ +#flDebug table.tablesorter { + width: 100%; +} +#flDebug table.tablesorter thead th, table.tablesorter tfoot th { + padding-right: 20px; +} +#flDebug table.tablesorter thead th { + background: url(../img/bg.gif) center right no-repeat; + cursor: pointer; +} +#flDebug table.tablesorter tbody tr.odd td { + background-color: #F0F0F6; +} +#flDebug table.tablesorter thead .headerSortUp { + background-image: url(../img/asc.gif); +} +#flDebug table.tablesorter thead .headerSortDown { + background-image: url(../img/desc.gif); +} +#flDebug table.tablesorter thead .headerSortDown, #flDebug table.tablesorter thead .headerSortUp { + background-color: #8dbdd8; +} diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/asc.gif b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/asc.gif new file mode 100644 index 00000000..74157867 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/asc.gif differ diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/back.png b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/back.png new file mode 100644 index 00000000..655906e9 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/back.png differ diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/back_hover.png b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/back_hover.png new file mode 100644 index 00000000..72c88f28 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/back_hover.png differ diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/bg.gif b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/bg.gif new file mode 100644 index 00000000..fac668fc Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/bg.gif differ diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/close.png b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/close.png new file mode 100644 index 00000000..c46416c7 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/close.png differ diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/close_hover.png b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/close_hover.png new file mode 100644 index 00000000..33a3462b Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/close_hover.png differ diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/desc.gif b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/desc.gif new file mode 100644 index 00000000..3b30b3c5 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/desc.gif differ diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/djdt_vertical.png b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/djdt_vertical.png new file mode 100644 index 00000000..4378d884 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/djdt_vertical.png differ diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/indicator.png b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/indicator.png new file mode 100644 index 00000000..769f3bad Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/indicator.png differ diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/panel_bg.png b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/panel_bg.png new file mode 100644 index 00000000..89971e9d Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/panel_bg.png differ diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/tick-red.png b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/tick-red.png new file mode 100755 index 00000000..14583c18 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/tick-red.png differ diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/tick.png b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/tick.png new file mode 100755 index 00000000..2429c1f7 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/img/tick.png differ diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/js/jquery.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/js/jquery.js new file mode 100644 index 00000000..9144b8ae --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/js/jquery.js @@ -0,0 +1,16 @@ +/*! + * jQuery JavaScript Library v1.5 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Mon Jan 31 08:31:29 2011 -0500 + */ +(function(a,b){function b$(a){return d.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function bX(a){if(!bR[a]){var b=d("<"+a+">").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c==="")c="block";bR[a]=c}return bR[a]}function bW(a,b){var c={};d.each(bV.concat.apply([],bV.slice(0,b)),function(){c[this]=a});return c}function bJ(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var e=a.dataTypes,f=a.converters,g,h=e.length,i,j=e[0],k,l,m,n,o;for(g=1;g=0===c})}function N(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function F(a,b){return(a&&a!=="*"?a+".":"")+b.replace(q,"`").replace(r,"&")}function E(a){var b,c,e,f,g,h,i,j,k,l,m,n,p,q=[],r=[],s=d._data(this,u);typeof s==="function"&&(s=s.events);if(a.liveFired!==this&&s&&s.live&&!a.target.disabled&&(!a.button||a.type!=="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var t=s.live.slice(0);for(i=0;ic)break;a.currentTarget=f.elem,a.data=f.handleObj.data,a.handleObj=f.handleObj,p=f.handleObj.origHandler.apply(f.elem,arguments);if(p===!1||a.isPropagationStopped()){c=f.level,p===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function C(a,b,c){c[0].type=a;return d.event.handle.apply(b,c)}function w(){return!0}function v(){return!1}function f(a,c,f){if(f===b&&a.nodeType===1){f=a.getAttribute("data-"+c);if(typeof f==="string"){try{f=f==="true"?!0:f==="false"?!1:f==="null"?null:d.isNaN(f)?e.test(f)?d.parseJSON(f):f:parseFloat(f)}catch(g){}d.data(a,c,f)}else f=b}return f}var c=a.document,d=function(){function I(){if(!d.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(I,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\d/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=navigator.userAgent,w,x=!1,y,z="then done fail isResolved isRejected promise".split(" "),A,B=Object.prototype.toString,C=Object.prototype.hasOwnProperty,D=Array.prototype.push,E=Array.prototype.slice,F=String.prototype.trim,G=Array.prototype.indexOf,H={};d.fn=d.prototype={constructor:d,init:function(a,e,f){var g,i,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!e&&c.body){this.context=c,this[0]=c.body,this.selector="body",this.length=1;return this}if(typeof a==="string"){g=h.exec(a);if(!g||!g[1]&&e)return!e||e.jquery?(e||f).find(a):this.constructor(e).find(a);if(g[1]){e=e instanceof d?e[0]:e,k=e?e.ownerDocument||e:c,j=m.exec(a),j?d.isPlainObject(e)?(a=[c.createElement(j[1])],d.fn.attr.call(a,e,!0)):a=[k.createElement(j[1])]:(j=d.buildFragment([g[1]],[k]),a=(j.cacheable?d.clone(j.fragment):j.fragment).childNodes);return d.merge(this,a)}i=c.getElementById(g[2]);if(i&&i.parentNode){if(i.id!==g[2])return f.find(a);this.length=1,this[0]=i}this.context=c,this.selector=a;return this}if(d.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.5",length:0,size:function(){return this.length},toArray:function(){return E.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?D.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady(),y.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(E.apply(this,arguments),"slice",E.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:D,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i==="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!=="object"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;y.resolveWith(c,[d]),d.fn.trigger&&d(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!x){x=!0;if(c.readyState==="complete")return setTimeout(d.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",A,!1),a.addEventListener("load",d.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",A),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}c.documentElement.doScroll&&b&&I()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a==="object"&&"setInterval"in a},isNaN:function(a){return a==null||!l.test(a)||isNaN(a)},type:function(a){return a==null?String(a):H[B.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!C.call(a,"constructor")&&!C.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a){}return c===b||C.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!=="string"||!b)return null;b=d.trim(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(b):(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(b,c,e){a.DOMParser?(e=new DOMParser,c=e.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),e=c.documentElement,(!e||!e.nodeName||e.nodeName==="parsererror")&&d.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(a){if(a&&i.test(a)){var b=c.getElementsByTagName("head")[0]||c.documentElement,e=c.createElement("script");e.type="text/javascript",d.support.scriptEval()?e.appendChild(c.createTextNode(a)):e.text=a,b.insertBefore(e,b.firstChild),b.removeChild(e)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g1?(g=Array(c),d.each(b,function(a,b){d.when(b).then(function(b){g[a]=arguments.length>1?E.call(arguments,0):b,--c||e.resolveWith(f,g)},e.reject)})):e!==a&&e.resolve(a);return f},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.subclass=this.subclass,a.fn.init=function b(b,c){c&&c instanceof d&&!(c instanceof a)&&(c=a(c));return d.fn.init.call(this,b,c,e)},a.fn.init.prototype=a.fn;var e=a(c);return a},browser:{}}),y=d._Deferred(),d.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){H["[object "+b+"]"]=b.toLowerCase()}),w=d.uaMatch(v),w.browser&&(d.browser[w.browser]=!0,d.browser.version=w.version),d.browser.webkit&&(d.browser.safari=!0),G&&(d.inArray=function(a,b){return G.call(b,a)}),i.test(" ")&&(j=/^[\s\xA0]+/,k=/[\s\xA0]+$/),g=d(c),c.addEventListener?A=function(){c.removeEventListener("DOMContentLoaded",A,!1),d.ready()}:c.attachEvent&&(A=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",A),d.ready())});return a.jQuery=a.$=d}();(function(){d.support={};var b=c.createElement("div");b.style.display="none",b.innerHTML="
    a";var e=b.getElementsByTagName("*"),f=b.getElementsByTagName("a")[0],g=c.createElement("select"),h=g.appendChild(c.createElement("option"));if(e&&e.length&&f){d.support={leadingWhitespace:b.firstChild.nodeType===3,tbody:!b.getElementsByTagName("tbody").length,htmlSerialize:!!b.getElementsByTagName("link").length,style:/red/.test(f.getAttribute("style")),hrefNormalized:f.getAttribute("href")==="/a",opacity:/^0.55$/.test(f.style.opacity),cssFloat:!!f.style.cssFloat,checkOn:b.getElementsByTagName("input")[0].value==="on",optSelected:h.selected,deleteExpando:!0,optDisabled:!1,checkClone:!1,_scriptEval:null,noCloneEvent:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0},g.disabled=!0,d.support.optDisabled=!h.disabled,d.support.scriptEval=function(){if(d.support._scriptEval===null){var b=c.documentElement,e=c.createElement("script"),f="script"+d.now();e.type="text/javascript";try{e.appendChild(c.createTextNode("window."+f+"=1;"))}catch(g){}b.insertBefore(e,b.firstChild),a[f]?(d.support._scriptEval=!0,delete a[f]):d.support._scriptEval=!1,b.removeChild(e),b=e=f=null}return d.support._scriptEval};try{delete b.test}catch(i){d.support.deleteExpando=!1}b.attachEvent&&b.fireEvent&&(b.attachEvent("onclick",function j(){d.support.noCloneEvent=!1,b.detachEvent("onclick",j)}),b.cloneNode(!0).fireEvent("onclick")),b=c.createElement("div"),b.innerHTML="";var k=c.createDocumentFragment();k.appendChild(b.firstChild),d.support.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,d(function(){var a=c.createElement("div"),b=c.getElementsByTagName("body")[0];if(b){a.style.width=a.style.paddingLeft="1px",b.appendChild(a),d.boxModel=d.support.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,d.support.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
    ",d.support.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
    t
    ";var e=a.getElementsByTagName("td");d.support.reliableHiddenOffsets=e[0].offsetHeight===0,e[0].style.display="",e[1].style.display="none",d.support.reliableHiddenOffsets=d.support.reliableHiddenOffsets&&e[0].offsetHeight===0,a.innerHTML="",b.removeChild(a).style.display="none",a=e=null}});var l=function(a){var b=c.createElement("div");a="on"+a;if(!b.attachEvent)return!0;var d=a in b;d||(b.setAttribute(a,"return;"),d=typeof b[a]==="function"),b=null;return d};d.support.submitBubbles=l("submit"),d.support.changeBubbles=l("change"),b=e=f=null}})();var e=/^(?:\{.*\}|\[.*\])$/;d.extend({cache:{},uuid:0,expando:"jQuery"+(d.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?d.cache[a[d.expando]]:a[d.expando];return!!a&&!d.isEmptyObject(a)},data:function(a,c,e,f){if(d.acceptData(a)){var g=d.expando,h=typeof c==="string",i,j=a.nodeType,k=j?d.cache:a,l=j?a[d.expando]:a[d.expando]&&d.expando;if((!l||f&&l&&!k[l][g])&&h&&e===b)return;l||(j?a[d.expando]=l=++d.uuid:l=d.expando),k[l]||(k[l]={}),typeof c==="object"&&(f?k[l][g]=d.extend(k[l][g],c):k[l]=d.extend(k[l],c)),i=k[l],f&&(i[g]||(i[g]={}),i=i[g]),e!==b&&(i[c]=e);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[c]:i}},removeData:function(b,c,e){if(d.acceptData(b)){var f=d.expando,g=b.nodeType,h=g?d.cache:b,i=g?b[d.expando]:d.expando;if(!h[i])return;if(c){var j=e?h[i][f]:h[i];if(j){delete j[c];if(!d.isEmptyObject(j))return}}if(e){delete h[i][f];if(!d.isEmptyObject(h[i]))return}var k=h[i][f];d.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},h[i][f]=k):g&&(d.support.deleteExpando?delete b[d.expando]:b.removeAttribute?b.removeAttribute(d.expando):b[d.expando]=null)}},_data:function(a,b,c){return d.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=d.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),d.fn.extend({data:function(a,c){var e=null;if(typeof a==="undefined"){if(this.length){e=d.data(this[0]);if(this[0].nodeType===1){var g=this[0].attributes,h;for(var i=0,j=g.length;i-1)return!0;return!1},val:function(a){if(!arguments.length){var c=this[0];if(c){if(d.nodeName(c,"option")){var e=c.attributes.value;return!e||e.specified?c.value:c.text}if(d.nodeName(c,"select")){var f=c.selectedIndex,g=[],h=c.options,j=c.type==="select-one";if(f<0)return null;for(var k=j?f:0,l=j?f+1:h.length;k=0;else if(d.nodeName(this,"select")){var f=d.makeArray(e);d("option",this).each(function(){this.selected=d.inArray(d(this).val(),f)>=0}),f.length||(this.selectedIndex=-1)}else this.value=e}})}}),d.extend({attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,e,f){if(!a||a.nodeType===3||a.nodeType===8||a.nodeType===2)return b;if(f&&c in d.attrFn)return d(a)[c](e);var g=a.nodeType!==1||!d.isXMLDoc(a),h=e!==b;c=g&&d.props[c]||c;if(a.nodeType===1){var i=j.test(c);if(c==="selected"&&!d.support.optSelected){var n=a.parentNode;n&&(n.selectedIndex,n.parentNode&&n.parentNode.selectedIndex)}if((c in a||a[c]!==b)&&g&&!i){h&&(c==="type"&&k.test(a.nodeName)&&a.parentNode&&d.error("type property can't be changed"),e===null?a.nodeType===1&&a.removeAttribute(c):a[c]=e);if(d.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c==="tabIndex"){var o=a.getAttributeNode("tabIndex");return o&&o.specified?o.value:l.test(a.nodeName)||m.test(a.nodeName)&&a.href?0:b}return a[c]}if(!d.support.style&&g&&c==="style"){h&&(a.style.cssText=""+e);return a.style.cssText}h&&a.setAttribute(c,""+e);if(!a.attributes[c]&&(a.hasAttribute&&!a.hasAttribute(c)))return b;var p=!d.support.hrefNormalized&&g&&i?a.getAttribute(c,2):a.getAttribute(c);return p===null?b:p}h&&(a[c]=e);return a[c]}});var o=/\.(.*)$/,p=/^(?:textarea|input|select)$/i,q=/\./g,r=/ /g,s=/[^\w\s.|`]/g,t=function(a){return a.replace(s,"\\$&")},u="events";d.event={add:function(c,e,f,g){if(c.nodeType!==3&&c.nodeType!==8){d.isWindow(c)&&(c!==a&&!c.frameElement)&&(c=a);if(f===!1)f=v;else if(!f)return;var h,i;f.handler&&(h=f,f=h.handler),f.guid||(f.guid=d.guid++);var j=d._data(c);if(!j)return;var k=j[u],l=j.handle;typeof k==="function"?(l=k.handle,k=k.events):k||(c.nodeType||(j[u]=j=function(){}),j.events=k={}),l||(j.handle=l=function(){return typeof d!=="undefined"&&!d.event.triggered?d.event.handle.apply(l.elem,arguments):b}),l.elem=c,e=e.split(" ");var m,n=0,o;while(m=e[n++]){i=h?d.extend({},h):{handler:f,data:g},m.indexOf(".")>-1?(o=m.split("."),m=o.shift(),i.namespace=o.slice(0).sort().join(".")):(o=[],i.namespace=""),i.type=m,i.guid||(i.guid=f.guid);var p=k[m],q=d.event.special[m]||{};if(!p){p=k[m]=[];if(!q.setup||q.setup.call(c,g,o,l)===!1)c.addEventListener?c.addEventListener(m,l,!1):c.attachEvent&&c.attachEvent("on"+m,l)}q.add&&(q.add.call(c,i),i.handler.guid||(i.handler.guid=f.guid)),p.push(i),d.event.global[m]=!0}c=null}},global:{},remove:function(a,c,e,f){if(a.nodeType!==3&&a.nodeType!==8){e===!1&&(e=v);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=d.hasData(a)&&d._data(a),w=s&&s[u];if(!s||!w)return;typeof w==="function"&&(s=w,w=w.events),c&&c.type&&(e=c.handler,c=c.type);if(!c||typeof c==="string"&&c.charAt(0)==="."){c=c||"";for(h in w)d.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+d.map(m.slice(0).sort(),t).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=w[h];if(!p)continue;if(!e){for(j=0;j=0&&(a.type=f=f.slice(0,-1),a.exclusive=!0),e||(a.stopPropagation(),d.event.global[f]&&d.each(d.cache,function(){var b=d.expando,e=this[b];e&&e.events&&e.events[f]&&d.event.trigger(a,c,e.handle.elem)}));if(!e||e.nodeType===3||e.nodeType===8)return b;a.result=b,a.target=e,c=d.makeArray(c),c.unshift(a)}a.currentTarget=e;var h=e.nodeType?d._data(e,"handle"):(d._data(e,u)||{}).handle;h&&h.apply(e,c);var i=e.parentNode||e.ownerDocument;try{e&&e.nodeName&&d.noData[e.nodeName.toLowerCase()]||e["on"+f]&&e["on"+f].apply(e,c)===!1&&(a.result=!1,a.preventDefault())}catch(j){}if(!a.isPropagationStopped()&&i)d.event.trigger(a,c,i,!0);else if(!a.isDefaultPrevented()){var k,l=a.target,m=f.replace(o,""),n=d.nodeName(l,"a")&&m==="click",p=d.event.special[m]||{};if((!p._default||p._default.call(e,a)===!1)&&!n&&!(l&&l.nodeName&&d.noData[l.nodeName.toLowerCase()])){try{l[m]&&(k=l["on"+m],k&&(l["on"+m]=null),d.event.triggered=!0,l[m]())}catch(q){}k&&(l["on"+m]=k),d.event.triggered=!1}}},handle:function(c){var e,f,g,h,i,j=[],k=d.makeArray(arguments);c=k[0]=d.event.fix(c||a.event),c.currentTarget=this,e=c.type.indexOf(".")<0&&!c.exclusive,e||(g=c.type.split("."),c.type=g.shift(),j=g.slice(0).sort(),h=new RegExp("(^|\\.)"+j.join("\\.(?:.*\\.)?")+"(\\.|$)")),c.namespace=c.namespace||j.join("."),i=d._data(this,u),typeof i==="function"&&(i=i.events),f=(i||{})[c.type];if(i&&f){f=f.slice(0);for(var l=0,m=f.length;l-1?d.map(a.options,function(a){return a.selected}).join("-"):"":a.nodeName.toLowerCase()==="select"&&(c=a.selectedIndex);return c},B=function B(a){var c=a.target,e,f;if(p.test(c.nodeName)&&!c.readOnly){e=d._data(c,"_change_data"),f=A(c),(a.type!=="focusout"||c.type!=="radio")&&d._data(c,"_change_data",f);if(e===b||f===e)return;if(e!=null||f){a.type="change",a.liveFired=b;return d.event.trigger(a,arguments[1],c)}}};d.event.special.change={filters:{focusout:B,beforedeactivate:B,click:function(a){var b=a.target,c=b.type;if(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")return B.call(this,a)},keydown:function(a){var b=a.target,c=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")return B.call(this,a)},beforeactivate:function(a){var b=a.target;d._data(b,"_change_data",A(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in z)d.event.add(this,c+".specialChange",z[c]);return p.test(this.nodeName)},teardown:function(a){d.event.remove(this,".specialChange");return p.test(this.nodeName)}},z=d.event.special.change.filters,z.focus=z.beforeactivate}c.addEventListener&&d.each({focus:"focusin",blur:"focusout"},function(a,b){function c(a){a=d.event.fix(a),a.type=b;return d.event.handle.call(this,a)}d.event.special[b]={setup:function(){this.addEventListener(a,c,!0)},teardown:function(){this.removeEventListener(a,c,!0)}}}),d.each(["bind","one"],function(a,c){d.fn[c]=function(a,e,f){if(typeof a==="object"){for(var g in a)this[c](g,e,a[g],f);return this}if(d.isFunction(e)||e===!1)f=e,e=b;var h=c==="one"?d.proxy(f,function(a){d(this).unbind(a,h);return f.apply(this,arguments)}):f;if(a==="unload"&&c!=="one")this.one(a,e,f);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},d.attrFn&&(d.attrFn[b]=!0)}),function(){function s(a,b,c,d,e,f){for(var g=0,h=d.length;g0){k=j;break}}j=j[a]}d[g]=k}}}function r(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0;[0,0].sort(function(){h=!1;return 0});var i=function(b,d,e,g){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!=="string")return e;var l,m,o,p,q,r,s,u,v=!0,w=i.isXML(d),x=[],y=b;do{a.exec(""),l=a.exec(y);if(l){y=l[3],x.push(l[1]);if(l[2]){p=l[3];break}}}while(l);if(x.length>1&&k.exec(b))if(x.length===2&&j.relative[x[0]])m=t(x[0]+x[1],d);else{m=j.relative[x[0]]?[d]:i(x.shift(),d);while(x.length)b=x.shift(),j.relative[b]&&(b+=x.shift()),m=t(b,m)}else{!g&&x.length>1&&d.nodeType===9&&!w&&j.match.ID.test(x[0])&&!j.match.ID.test(x[x.length-1])&&(q=i.find(x.shift(),d,w),d=q.expr?i.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:n(g)}:i.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),m=q.expr?i.filter(q.expr,q.set):q.set,x.length>0?o=n(m):v=!1;while(x.length)r=x.pop(),s=r,j.relative[r]?s=x.pop():r="",s==null&&(s=d),j.relative[r](o,s,w)}else o=x=[]}o||(o=m),o||i.error(r||b);if(f.call(o)==="[object Array]")if(v)if(d&&d.nodeType===1)for(u=0;o[u]!=null;u++)o[u]&&(o[u]===!0||o[u].nodeType===1&&i.contains(d,o[u]))&&e.push(m[u]);else for(u=0;o[u]!=null;u++)o[u]&&o[u].nodeType===1&&e.push(m[u]);else e.push.apply(e,o);else n(o,e);p&&(i(p,h,e,g),i.uniqueSort(e));return e};i.uniqueSort=function(a){if(p){g=h,a.sort(p);if(g)for(var b=1;b0},i.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=j.order.length;e":function(a,b){var c,d=typeof b==="string",e=0,f=a.length;if(d&&!/\W/.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(/\\/g,"")},TAG:function(a,b){return a[1].toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||i.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&i.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(/\\/g,"");!f&&j.attrMap[g]&&(a[1]=j.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(/\\/g,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=i(b[3],null,null,c);else{var g=i.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(j.match.POS.test(b[0])||j.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!i(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){return"text"===a.type},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=j.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||i.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,k=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=j.attrHandle[c]?j.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=j.setFilters[e];if(f)return f(a,c,b,d)}}},k=j.match.POS,l=function(a,b){return"\\"+(b-0+1)};for(var m in j.match)j.match[m]=new RegExp(j.match[m].source+/(?![^\[]*\])(?![^\(]*\))/.source),j.leftMatch[m]=new RegExp(/(^(?:.|\r|\n)*?)/.source+j.match[m].source.replace(/\\(\d+)/g,l));var n=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(o){n=function(a,b){var c=0,d=b||[];if(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length==="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(j.find.ID=function(a,c,d){if(typeof c.getElementById!=="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!=="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},j.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(j.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(j.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=i,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

    ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){i=function(b,e,f,g){e=e||c;if(!g&&!i.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return n(e.getElementsByTagName(b),f);if(h[2]&&j.find.CLASS&&e.getElementsByClassName)return n(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return n([e.body],f);if(h&&h[3]){var k=e.getElementById(h[3]);if(!k||!k.parentNode)return n([],f);if(k.id===h[3])return n([k],f)}try{return n(e.querySelectorAll(b),f)}catch(l){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e.getAttribute("id"),o=m||d,p=e.parentNode,q=/^\s*[+~]/.test(b);m?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),q&&p&&(e=e.parentNode);try{if(!q||p)return n(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(r){}finally{m||e.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)i[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector,d=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(e){d=!0}b&&(i.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!i.isXML(a))try{if(d||!j.match.PSEUDO.test(c)&&!/!=/.test(c))return b.call(a,c)}catch(e){}return i(c,null,null,[a]).length>0})}(),function(){var a=c.createElement("div");a.innerHTML="
    ";if(a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;j.order.splice(1,0,"CLASS"),j.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?i.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?i.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:i.contains=function(){return!1},i.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var t=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=j.match.PSEUDO.exec(a))e+=c[0],a=a.replace(j.match.PSEUDO,"");a=j.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(var g=c;g0},closest:function(a,b){var c=[],e,f,g=this[0];if(d.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(e=0,f=a.length;e-1:d(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=L.test(a)?d(a,b||this.context):null;for(e=0,f=this.length;e-1:d.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b)break}}c=c.length>1?d.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a==="string")return d.inArray(this[0],a?d(a):this.parent().children());return d.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a==="string"?d(a,b):d.makeArray(a),e=d.merge(this.get(),c);return this.pushStack(N(c[0])||N(e[0])?e:d.unique(e))},andSelf:function(){return this.add(this.prevObject)}}),d.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,c){return d.dir(a,"parentNode",c)},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},nextUntil:function(a,b,c){return d.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return d.dir(a,"previousSibling",c)},siblings:function(a){return d.sibling(a.parentNode.firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,b){d.fn[a]=function(c,e){var f=d.map(this,b,c),g=K.call(arguments);G.test(a)||(e=c),e&&typeof e==="string"&&(f=d.filter(e,f)),f=this.length>1&&!M[a]?d.unique(f):f,(this.length>1||I.test(e))&&H.test(a)&&(f=f.reverse());return this.pushStack(f,a,g.join(","))}}),d.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?d.find.matchesSelector(b[0],a)?[b[0]]:[]:d.find.matches(a,b)},dir:function(a,c,e){var f=[],g=a[c];while(g&&g.nodeType!==9&&(e===b||g.nodeType!==1||!d(g).is(e)))g.nodeType===1&&f.push(g),g=g[c];return f},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var P=/ jQuery\d+="(?:\d+|null)"/g,Q=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,S=/<([\w:]+)/,T=/",""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]};X.optgroup=X.option,X.tbody=X.tfoot=X.colgroup=X.caption=X.thead,X.th=X.td,d.support.htmlSerialize||(X._default=[1,"div
    ","
    "]),d.fn.extend({text:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.text(a.call(this,b,c.text()))});if(typeof a!=="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return d.text(this)},wrapAll:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapAll(a.call(this,b))});if(this[0]){var b=d(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapInner(a.call(this,b))});return this.each(function(){var b=d(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=d(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,d(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,e;(e=this[c])!=null;c++)if(!a||d.filter(a,[e]).length)!b&&e.nodeType===1&&(d.cleanData(e.getElementsByTagName("*")),d.cleanData([e])),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&d.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!0:a,b=b==null?a:b;return this.map(function(){return d.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(P,""):null;if(typeof a!=="string"||V.test(a)||!d.support.leadingWhitespace&&Q.test(a)||X[(S.exec(a)||["",""])[1].toLowerCase()])d.isFunction(a)?this.each(function(b){var c=d(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);else{a=a.replace(R,"<$1>");try{for(var c=0,e=this.length;c1&&l0?this.clone(!0):this).get();d(f[h])[b](j),e=e.concat(j)}return this.pushStack(e,a,f.selector)}}),d.extend({clone:function(a,b,c){var e=a.cloneNode(!0),f,g,h;if(!d.support.noCloneEvent&&(a.nodeType===1||a.nodeType===11)&&!d.isXMLDoc(a)){f=a.getElementsByTagName("*"),g=e.getElementsByTagName("*");for(h=0;f[h];++h)$(f[h],g[h]);$(a,e)}if(b){Z(a,e);if(c&&"getElementsByTagName"in a){f=a.getElementsByTagName("*"),g=e.getElementsByTagName("*");if(f.length)for(h=0;f[h];++h)Z(f[h],g[h])}}return e},clean:function(a,b,e,f){b=b||c,typeof b.createElement==="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var g=[];for(var h=0,i;(i=a[h])!=null;h++){typeof i==="number"&&(i+="");if(!i)continue;if(typeof i!=="string"||U.test(i)){if(typeof i==="string"){i=i.replace(R,"<$1>");var j=(S.exec(i)||["",""])[1].toLowerCase(),k=X[j]||X._default,l=k[0],m=b.createElement("div");m.innerHTML=k[1]+i+k[2];while(l--)m=m.lastChild;if(!d.support.tbody){var n=T.test(i),o=j==="table"&&!n?m.firstChild&&m.firstChild.childNodes:k[1]===""&&!n?m.childNodes:[];for(var p=o.length-1;p>=0;--p)d.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!d.support.leadingWhitespace&&Q.test(i)&&m.insertBefore(b.createTextNode(Q.exec(i)[0]),m.firstChild),i=m.childNodes}}else i=b.createTextNode(i);i.nodeType?g.push(i):g=d.merge(g,i)}if(e)for(h=0;g[h];h++)!f||!d.nodeName(g[h],"script")||g[h].type&&g[h].type.toLowerCase()!=="text/javascript"?(g[h].nodeType===1&&g.splice.apply(g,[h+1,0].concat(d.makeArray(g[h].getElementsByTagName("script")))),e.appendChild(g[h])):f.push(g[h].parentNode?g[h].parentNode.removeChild(g[h]):g[h]);return g},cleanData:function(a){var b,c,e=d.cache,f=d.expando,g=d.event.special,h=d.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&d.noData[j.nodeName.toLowerCase()])continue;c=j[d.expando];if(c){b=e[c]&&e[c][f];if(b&&b.events){for(var k in b.events)g[k]?d.event.remove(j,k):d.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[d.expando]:j.removeAttribute&&j.removeAttribute(d.expando),delete e[c]}}}});var ba=/alpha\([^)]*\)/i,bb=/opacity=([^)]*)/,bc=/-([a-z])/ig,bd=/([A-Z])/g,be=/^-?\d+(?:px)?$/i,bf=/^-?\d/,bg={position:"absolute",visibility:"hidden",display:"block"},bh=["Left","Right"],bi=["Top","Bottom"],bj,bk,bl,bm=function(a,b){return b.toUpperCase()};d.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return d.access(this,a,c,!0,function(a,c,e){return e!==b?d.style(a,c,e):d.css(a,c)})},d.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bj(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{"float":d.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,e,f){if(a&&a.nodeType!==3&&a.nodeType!==8&&a.style){var g,h=d.camelCase(c),i=a.style,j=d.cssHooks[h];c=d.cssProps[h]||h;if(e===b){if(j&&"get"in j&&(g=j.get(a,!1,f))!==b)return g;return i[c]}if(typeof e==="number"&&isNaN(e)||e==null)return;typeof e==="number"&&!d.cssNumber[h]&&(e+="px");if(!j||!("set"in j)||(e=j.set(a,e))!==b)try{i[c]=e}catch(k){}}},css:function(a,c,e){var f,g=d.camelCase(c),h=d.cssHooks[g];c=d.cssProps[g]||g;if(h&&"get"in h&&(f=h.get(a,!0,e))!==b)return f;if(bj)return bj(a,c,g)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bc,bm)}}),d.curCSS=d.css,d.each(["height","width"],function(a,b){d.cssHooks[b]={get:function(a,c,e){var f;if(c){a.offsetWidth!==0?f=bn(a,b,e):d.swap(a,bg,function(){f=bn(a,b,e)});if(f<=0){f=bj(a,b,b),f==="0px"&&bl&&(f=bl(a,b,b));if(f!=null)return f===""||f==="auto"?"0px":f}if(f<0||f==null){f=a.style[b];return f===""||f==="auto"?"0px":f}return typeof f==="string"?f:f+"px"}},set:function(a,b){if(!be.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),d.support.opacity||(d.cssHooks.opacity={get:function(a,b){return bb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style;c.zoom=1;var e=d.isNaN(b)?"":"alpha(opacity="+b*100+")",f=c.filter||"";c.filter=ba.test(f)?f.replace(ba,e):c.filter+" "+e}}),c.defaultView&&c.defaultView.getComputedStyle&&(bk=function(a,c,e){var f,g,h;e=e.replace(bd,"-$1").toLowerCase();if(!(g=a.ownerDocument.defaultView))return b;if(h=g.getComputedStyle(a,null))f=h.getPropertyValue(e),f===""&&!d.contains(a.ownerDocument.documentElement,a)&&(f=d.style(a,e));return f}),c.documentElement.currentStyle&&(bl=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!be.test(d)&&bf.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bj=bk||bl,d.expr&&d.expr.filters&&(d.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!d.support.reliableHiddenOffsets&&(a.style.display||d.css(a,"display"))==="none"},d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)});var bo=/%20/g,bp=/\[\]$/,bq=/\r?\n/g,br=/#.*$/,bs=/^(.*?):\s*(.*?)\r?$/mg,bt=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bu=/^(?:GET|HEAD)$/,bv=/^\/\//,bw=/\?/,bx=/)<[^<]*)*<\/script>/gi,by=/^(?:select|textarea)/i,bz=/\s+/,bA=/([?&])_=[^&]*/,bB=/^(\w+:)\/\/([^\/?#:]+)(?::(\d+))?/,bC=d.fn.load,bD={},bE={};d.fn.extend({load:function(a,b,c){if(typeof a!=="string"&&bC)return bC.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}var g="GET";b&&(d.isFunction(b)?(c=b,b=null):typeof b==="object"&&(b=d.param(b,d.ajaxSettings.traditional),g="POST"));var h=this;d.ajax({url:a,type:g,dataType:"html",data:b,complete:function(a,b,e){e=a.responseText,a.isResolved()&&(a.done(function(a){e=a}),h.html(f?d("
    ").append(e.replace(bx,"")).find(f):e)),c&&h.each(c,[e,b,a])}});return this},serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?d.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||by.test(this.nodeName)||bt.test(this.type))}).map(function(a,b){var c=d(this).val();return c==null?null:d.isArray(c)?d.map(c,function(a,c){return{name:b.name,value:a.replace(bq,"\r\n")}}):{name:b.name,value:c.replace(bq,"\r\n")}}).get()}}),d.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){d.fn[b]=function(a){return this.bind(b,a)}}),d.each(["get","post"],function(a,b){d[b]=function(a,c,e,f){d.isFunction(c)&&(f=f||e,e=c,c=null);return d.ajax({type:b,url:a,data:c,success:e,dataType:f})}}),d.extend({getScript:function(a,b){return d.get(a,null,b,"script")},getJSON:function(a,b,c){return d.get(a,b,c,"json")},ajaxSetup:function(a){d.extend(!0,d.ajaxSettings,a),a.context&&(d.ajaxSettings.context=a.context)},ajaxSettings:{url:location.href,global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":d.parseJSON,"text xml":d.parseXML}},ajaxPrefilter:bF(bD),ajaxTransport:bF(bE),ajax:function(a,e){function w(a,c,e,l){if(t!==2){t=2,p&&clearTimeout(p),o=b,m=l||"",v.readyState=a?4:0;var n,q,r,s=e?bI(f,v,e):b,u,w;if(a>=200&&a<300||a===304){if(f.ifModified){if(u=v.getResponseHeader("Last-Modified"))d.lastModified[f.url]=u;if(w=v.getResponseHeader("Etag"))d.etag[f.url]=w}if(a===304)c="notmodified",n=!0;else try{q=bJ(f,s),c="success",n=!0}catch(x){c="parsererror",r=x}}else r=c,a&&(c="error",a<0&&(a=0));v.status=a,v.statusText=c,n?i.resolveWith(g,[q,c,v]):i.rejectWith(g,[v,c,r]),v.statusCode(k),k=b,f.global&&h.trigger("ajax"+(n?"Success":"Error"),[v,f,n?q:r]),j.resolveWith(g,[v,c]),f.global&&(h.trigger("ajaxComplete",[v,f]),--d.active||d.event.trigger("ajaxStop"))}}typeof e!=="object"&&(e=a,a=b),e=e||{};var f=d.extend(!0,{},d.ajaxSettings,e),g=(f.context=("context"in e?e:d.ajaxSettings).context)||f,h=g===f?d.event:d(g),i=d.Deferred(),j=d._Deferred(),k=f.statusCode||{},l={},m,n,o,p,q=c.location,r=q.protocol||"http:",s,t=0,u,v={readyState:0,setRequestHeader:function(a,b){t===0&&(l[a.toLowerCase()]=b);return this},getAllResponseHeaders:function(){return t===2?m:null},getResponseHeader:function(a){var b;if(t===2){if(!n){n={};while(b=bs.exec(m))n[b[1].toLowerCase()]=b[2]}b=n[a.toLowerCase()]}return b||null},abort:function(a){a=a||"abort",o&&o.abort(a),w(0,a);return this}};i.promise(v),v.success=v.done,v.error=v.fail,v.complete=j.done,v.statusCode=function(a){if(a){var b;if(t<2)for(b in a)k[b]=[k[b],a[b]];else b=a[v.status],v.then(b,b)}return this},f.url=(""+(a||f.url)).replace(br,"").replace(bv,r+"//"),f.dataTypes=d.trim(f.dataType||"*").toLowerCase().split(bz),f.crossDomain||(s=bB.exec(f.url.toLowerCase()),f.crossDomain=s&&(s[1]!=r||s[2]!=q.hostname||(s[3]||(s[1]==="http:"?80:443))!=(q.port||(r==="http:"?80:443)))),f.data&&f.processData&&typeof f.data!=="string"&&(f.data=d.param(f.data,f.traditional)),bG(bD,f,e,v),f.type=f.type.toUpperCase(),f.hasContent=!bu.test(f.type),f.global&&d.active++===0&&d.event.trigger("ajaxStart");if(!f.hasContent){f.data&&(f.url+=(bw.test(f.url)?"&":"?")+f.data);if(f.cache===!1){var x=d.now(),y=f.url.replace(bA,"$1_="+x);f.url=y+(y===f.url?(bw.test(f.url)?"&":"?")+"_="+x:"")}}if(f.data&&f.hasContent&&f.contentType!==!1||e.contentType)l["content-type"]=f.contentType;f.ifModified&&(d.lastModified[f.url]&&(l["if-modified-since"]=d.lastModified[f.url]),d.etag[f.url]&&(l["if-none-match"]=d.etag[f.url])),l.accept=f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+(f.dataTypes[0]!=="*"?", */*; q=0.01":""):f.accepts["*"];for(u in f.headers)l[u.toLowerCase()]=f.headers[u];if(!f.beforeSend||f.beforeSend.call(g,v,f)!==!1&&t!==2){for(u in {success:1,error:1,complete:1})v[u](f[u]);o=bG(bE,f,e,v);if(o){t=v.readyState=1,f.global&&h.trigger("ajaxSend",[v,f]),f.async&&f.timeout>0&&(p=setTimeout(function(){v.abort("timeout")},f.timeout));try{o.send(l,w)}catch(z){status<2?w(-1,z):d.error(z)}}else w(-1,"No Transport")}else w(0,"abort"),v=!1;return v},param:function(a,c){var e=[],f=function(a,b){b=d.isFunction(b)?b():b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=d.ajaxSettings.traditional);if(d.isArray(a)||a.jquery)d.each(a,function(){f(this.name,this.value)});else for(var g in a)bH(g,a[g],c,f);return e.join("&").replace(bo,"+")}}),d.extend({active:0,lastModified:{},etag:{}});var bK=d.now(),bL=/(\=)\?(&|$)|()\?\?()/i;d.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return d.expando+"_"+bK++}}),d.ajaxPrefilter("json jsonp",function(b,c,e){e=typeof b.data==="string";if(b.dataTypes[0]==="jsonp"||c.jsonpCallback||c.jsonp!=null||b.jsonp!==!1&&(bL.test(b.url)||e&&bL.test(b.data))){var f,g=b.jsonpCallback=d.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h=a[g],i=b.url,j=b.data,k="$1"+g+"$2";b.jsonp!==!1&&(i=i.replace(bL,k),b.url===i&&(e&&(j=j.replace(bL,k)),b.data===j&&(i+=(/\?/.test(i)?"&":"?")+b.jsonp+"="+g))),b.url=i,b.data=j,a[g]=function(a){f=[a]},b.complete=[function(){a[g]=h;if(h)f&&d.isFunction(h)&&a[g](f[0]);else try{delete a[g]}catch(b){}},b.complete],b.converters["script json"]=function(){f||d.error(g+" was not called");return f[0]},b.dataTypes[0]="json";return"script"}}),d.ajaxSetup({accepts:{script:"text/javascript, application/javascript"},contents:{script:/javascript/},converters:{"text script":function(a){d.globalEval(a);return a}}}),d.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),d.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var bM=d.now(),bN={},bO,bP;d.ajaxSettings.xhr=a.ActiveXObject?function(){if(a.location.protocol!=="file:")try{return new a.XMLHttpRequest}catch(b){}try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(c){}}:function(){return new a.XMLHttpRequest};try{bP=d.ajaxSettings.xhr()}catch(bQ){}d.support.ajax=!!bP,d.support.cors=bP&&"withCredentials"in bP,bP=b,d.support.ajax&&d.ajaxTransport(function(b){if(!b.crossDomain||d.support.cors){var c;return{send:function(e,f){bO||(bO=1,d(a).bind("unload",function(){d.each(bN,function(a,b){b.onreadystatechange&&b.onreadystatechange(1)})}));var g=b.xhr(),h;b.username?g.open(b.type,b.url,b.async,b.username,b.password):g.open(b.type,b.url,b.async),(!b.crossDomain||b.hasContent)&&!e["x-requested-with"]&&(e["x-requested-with"]="XMLHttpRequest");try{d.each(e,function(a,b){g.setRequestHeader(a,b)})}catch(i){}g.send(b.hasContent&&b.data||null),c=function(a,e){if(c&&(e||g.readyState===4)){c=0,h&&(g.onreadystatechange=d.noop,delete bN[h]);if(e)g.readyState!==4&&g.abort();else{var i=g.status,j,k=g.getAllResponseHeaders(),l={},m=g.responseXML;m&&m.documentElement&&(l.xml=m),l.text=g.responseText;try{j=g.statusText}catch(n){j=""}i=i===0?!b.crossDomain||j?k?304:0:302:i==1223?204:i,f(i,j,l,k)}}},b.async&&g.readyState!==4?(h=bM++,bN[h]=g,g.onreadystatechange=c):c()},abort:function(){c&&c(0,1)}}}});var bR={},bS=/^(?:toggle|show|hide)$/,bT=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,bU,bV=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];d.fn.extend({show:function(a,b,c){var e,f;if(a||a===0)return this.animate(bW("show",3),a,b,c);for(var g=0,h=this.length;g=0;a--)c[a].elem===this&&(b&&c[a](!0),c.splice(a,1))}),b||this.dequeue();return this}}),d.each({slideDown:bW("show",1),slideUp:bW("hide",1),slideToggle:bW("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){d.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),d.extend({speed:function(a,b,c){var e=a&&typeof a==="object"?d.extend({},a):{complete:c||!c&&b||d.isFunction(a)&&a,duration:a,easing:c&&b||b&&!d.isFunction(b)&&b};e.duration=d.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in d.fx.speeds?d.fx.speeds[e.duration]:d.fx.speeds._default,e.old=e.complete,e.complete=function(){e.queue!==!1&&d(this).dequeue(),d.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig||(b.orig={})}}),d.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(d.fx.step[this.prop]||d.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(d.css(this.elem,this.prop));return a||0},custom:function(a,b,c){function g(a){return e.step(a)}var e=this,f=d.fx;this.startTime=d.now(),this.start=a,this.end=b,this.unit=c||this.unit||"px",this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&d.timers.push(g)&&!bU&&(bU=setInterval(f.tick,f.interval))},show:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),d(this.elem).show()},hide:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=d.now(),c=!0;if(a||b>=this.options.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),this.options.curAnim[this.prop]=!0;for(var e in this.options.curAnim)this.options.curAnim[e]!==!0&&(c=!1);if(c){if(this.options.overflow!=null&&!d.support.shrinkWrapBlocks){var f=this.elem,g=this.options;d.each(["","X","Y"],function(a,b){f.style["overflow"+b]=g.overflow[a]})}this.options.hide&&d(this.elem).hide();if(this.options.hide||this.options.show)for(var h in this.options.curAnim)d.style(this.elem,h,this.options.orig[h]);this.options.complete.call(this.elem)}return!1}var i=b-this.startTime;this.state=i/this.options.duration;var j=this.options.specialEasing&&this.options.specialEasing[this.prop],k=this.options.easing||(d.easing.swing?"swing":"linear");this.pos=d.easing[j||k](this.state,i,0,1,this.options.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update();return!0}},d.extend(d.fx,{tick:function(){var a=d.timers;for(var b=0;b
    ";d.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),e=b.firstChild,f=e.firstChild,h=e.nextSibling.firstChild.firstChild,this.doesNotAddBorder=f.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,f.style.position="fixed",f.style.top="20px",this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15,f.style.position=f.style.top="",e.style.overflow="hidden",e.style.position="relative",this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),a=b=e=f=g=h=null,d.offset.initialize=d.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;d.offset.initialize(),d.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(d.css(a,"marginTop"))||0,c+=parseFloat(d.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var e=d.css(a,"position");e==="static"&&(a.style.position="relative");var f=d(a),g=f.offset(),h=d.css(a,"top"),i=d.css(a,"left"),j=e==="absolute"&&d.inArray("auto",[h,i])>-1,k={},l={},m,n;j&&(l=f.position()),m=j?l.top:parseInt(h,10)||0,n=j?l.left:parseInt(i,10)||0,d.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):f.css(k)}},d.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),e=bZ.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(d.css(a,"marginTop"))||0,c.left-=parseFloat(d.css(a,"marginLeft"))||0,e.top+=parseFloat(d.css(b[0],"borderTopWidth"))||0,e.left+=parseFloat(d.css(b[0],"borderLeftWidth"))||0;return{top:c.top-e.top,left:c.left-e.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&(!bZ.test(a.nodeName)&&d.css(a,"position")==="static"))a=a.offsetParent;return a})}}),d.each(["Left","Top"],function(a,c){var e="scroll"+c;d.fn[e]=function(c){var f=this[0],g;if(!f)return null;if(c!==b)return this.each(function(){g=b$(this),g?g.scrollTo(a?d(g).scrollLeft():c,a?c:d(g).scrollTop()):this[e]=c});g=b$(f);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:d.support.boxModel&&g.document.documentElement[e]||g.document.body[e]:f[e]}}),d.each(["Height","Width"],function(a,c){var e=c.toLowerCase();d.fn["inner"+c]=function(){return this[0]?parseFloat(d.css(this[0],e,"padding")):null},d.fn["outer"+c]=function(a){return this[0]?parseFloat(d.css(this[0],e,a?"margin":"border")):null},d.fn[e]=function(a){var f=this[0];if(!f)return a==null?null:this;if(d.isFunction(a))return this.each(function(b){var c=d(this);c[e](a.call(this,b,c[e]()))});if(d.isWindow(f)){var g=f.document.documentElement["client"+c];return f.document.compatMode==="CSS1Compat"&&g||f.document.body["client"+c]||g}if(f.nodeType===9)return Math.max(f.documentElement["client"+c],f.body["scroll"+c],f.documentElement["scroll"+c],f.body["offset"+c],f.documentElement["offset"+c]);if(a===b){var h=d.css(f,e),i=parseFloat(h);return d.isNaN(i)?h:i}return this.css(e,typeof a==="string"?a:a+"px")}})})(window); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/js/jquery.tablesorter.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/js/jquery.tablesorter.js new file mode 100644 index 00000000..e8e23234 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/js/jquery.tablesorter.js @@ -0,0 +1,1031 @@ +/* + * + * TableSorter 2.0 - Client-side table sorting with ease! + * Version 2.0.5b + * @requires jQuery v1.2.3 + * + * Copyright (c) 2007 Christian Bach + * Examples and docs at: http://tablesorter.com + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + */ +/** + * + * @description Create a sortable table with multi-column sorting capabilitys + * + * @example $('table').tablesorter(); + * @desc Create a simple tablesorter interface. + * + * @example $('table').tablesorter({ sortList:[[0,0],[1,0]] }); + * @desc Create a tablesorter interface and sort on the first and secound column column headers. + * + * @example $('table').tablesorter({ headers: { 0: { sorter: false}, 1: {sorter: false} } }); + * + * @desc Create a tablesorter interface and disableing the first and second column headers. + * + * + * @example $('table').tablesorter({ headers: { 0: {sorter:"integer"}, 1: {sorter:"currency"} } }); + * + * @desc Create a tablesorter interface and set a column parser for the first + * and second column. + * + * + * @param Object + * settings An object literal containing key/value pairs to provide + * optional settings. + * + * + * @option String cssHeader (optional) A string of the class name to be appended + * to sortable tr elements in the thead of the table. Default value: + * "header" + * + * @option String cssAsc (optional) A string of the class name to be appended to + * sortable tr elements in the thead on a ascending sort. Default value: + * "headerSortUp" + * + * @option String cssDesc (optional) A string of the class name to be appended + * to sortable tr elements in the thead on a descending sort. Default + * value: "headerSortDown" + * + * @option String sortInitialOrder (optional) A string of the inital sorting + * order can be asc or desc. Default value: "asc" + * + * @option String sortMultisortKey (optional) A string of the multi-column sort + * key. Default value: "shiftKey" + * + * @option String textExtraction (optional) A string of the text-extraction + * method to use. For complex html structures inside td cell set this + * option to "complex", on large tables the complex option can be slow. + * Default value: "simple" + * + * @option Object headers (optional) An array containing the forces sorting + * rules. This option let's you specify a default sorting rule. Default + * value: null + * + * @option Array sortList (optional) An array containing the forces sorting + * rules. This option let's you specify a default sorting rule. Default + * value: null + * + * @option Array sortForce (optional) An array containing forced sorting rules. + * This option let's you specify a default sorting rule, which is + * prepended to user-selected rules. Default value: null + * + * @option Boolean sortLocaleCompare (optional) Boolean flag indicating whatever + * to use String.localeCampare method or not. Default set to true. + * + * + * @option Array sortAppend (optional) An array containing forced sorting rules. + * This option let's you specify a default sorting rule, which is + * appended to user-selected rules. Default value: null + * + * @option Boolean widthFixed (optional) Boolean flag indicating if tablesorter + * should apply fixed widths to the table columns. This is usefull when + * using the pager companion plugin. This options requires the dimension + * jquery plugin. Default value: false + * + * @option Boolean cancelSelection (optional) Boolean flag indicating if + * tablesorter should cancel selection of the table headers text. + * Default value: true + * + * @option Boolean debug (optional) Boolean flag indicating if tablesorter + * should display debuging information usefull for development. + * + * @type jQuery + * + * @name tablesorter + * + * @cat Plugins/Tablesorter + * + * @author Christian Bach/christian.bach@polyester.se + */ + +(function ($) { + $.extend({ + tablesorter: new + function () { + + var parsers = [], + widgets = []; + + this.defaults = { + cssHeader: "header", + cssAsc: "headerSortUp", + cssDesc: "headerSortDown", + cssChildRow: "expand-child", + sortInitialOrder: "asc", + sortMultiSortKey: "shiftKey", + sortForce: null, + sortAppend: null, + sortLocaleCompare: true, + textExtraction: "simple", + parsers: {}, widgets: [], + widgetZebra: { + css: ["even", "odd"] + }, headers: {}, widthFixed: false, + cancelSelection: true, + sortList: [], + headerList: [], + dateFormat: "us", + decimal: '/\.|\,/g', + onRenderHeader: null, + selectorHeaders: 'thead th', + debug: false + }; + + /* debuging utils */ + + function benchmark(s, d) { + log(s + "," + (new Date().getTime() - d.getTime()) + "ms"); + } + + this.benchmark = benchmark; + + function log(s) { + if (typeof console != "undefined" && typeof console.debug != "undefined") { + console.log(s); + } else { + alert(s); + } + } + + /* parsers utils */ + + function buildParserCache(table, $headers) { + + if (table.config.debug) { + var parsersDebug = ""; + } + + if (table.tBodies.length == 0) return; // In the case of empty tables + var rows = table.tBodies[0].rows; + + if (rows[0]) { + + var list = [], + cells = rows[0].cells, + l = cells.length; + + for (var i = 0; i < l; i++) { + + var p = false; + + if ($.metadata && ($($headers[i]).metadata() && $($headers[i]).metadata().sorter)) { + + p = getParserById($($headers[i]).metadata().sorter); + + } else if ((table.config.headers[i] && table.config.headers[i].sorter)) { + + p = getParserById(table.config.headers[i].sorter); + } + if (!p) { + + p = detectParserForColumn(table, rows, -1, i); + } + + if (table.config.debug) { + parsersDebug += "column:" + i + " parser:" + p.id + "\n"; + } + + list.push(p); + } + } + + if (table.config.debug) { + log(parsersDebug); + } + + return list; + }; + + function detectParserForColumn(table, rows, rowIndex, cellIndex) { + var l = parsers.length, + node = false, + nodeValue = false, + keepLooking = true; + while (nodeValue == '' && keepLooking) { + rowIndex++; + if (rows[rowIndex]) { + node = getNodeFromRowAndCellIndex(rows, rowIndex, cellIndex); + nodeValue = trimAndGetNodeText(table.config, node); + if (table.config.debug) { + log('Checking if value was empty on row:' + rowIndex); + } + } else { + keepLooking = false; + } + } + for (var i = 1; i < l; i++) { + if (parsers[i].is(nodeValue, table, node)) { + return parsers[i]; + } + } + // 0 is always the generic parser (text) + return parsers[0]; + } + + function getNodeFromRowAndCellIndex(rows, rowIndex, cellIndex) { + return rows[rowIndex].cells[cellIndex]; + } + + function trimAndGetNodeText(config, node) { + return $.trim(getElementText(config, node)); + } + + function getParserById(name) { + var l = parsers.length; + for (var i = 0; i < l; i++) { + if (parsers[i].id.toLowerCase() == name.toLowerCase()) { + return parsers[i]; + } + } + return false; + } + + /* utils */ + + function buildCache(table) { + + if (table.config.debug) { + var cacheTime = new Date(); + } + + var totalRows = (table.tBodies[0] && table.tBodies[0].rows.length) || 0, + totalCells = (table.tBodies[0].rows[0] && table.tBodies[0].rows[0].cells.length) || 0, + parsers = table.config.parsers, + cache = { + row: [], + normalized: [] + }; + + for (var i = 0; i < totalRows; ++i) { + + /** Add the table data to main data array */ + var c = $(table.tBodies[0].rows[i]), + cols = []; + + // if this is a child row, add it to the last row's children and + // continue to the next row + if (c.hasClass(table.config.cssChildRow)) { + cache.row[cache.row.length - 1] = cache.row[cache.row.length - 1].add(c); + // go to the next for loop + continue; + } + + cache.row.push(c); + + for (var j = 0; j < totalCells; ++j) { + cols.push(parsers[j].format(getElementText(table.config, c[0].cells[j]), table, c[0].cells[j])); + } + + cols.push(cache.normalized.length); // add position for rowCache + cache.normalized.push(cols); + cols = null; + }; + + if (table.config.debug) { + benchmark("Building cache for " + totalRows + " rows:", cacheTime); + } + + return cache; + }; + + function getElementText(config, node) { + + var text = ""; + + if (!node) return ""; + + if (!config.supportsTextContent) config.supportsTextContent = node.textContent || false; + + if (config.textExtraction == "simple") { + if (config.supportsTextContent) { + text = node.textContent; + } else { + if (node.childNodes[0] && node.childNodes[0].hasChildNodes()) { + text = node.childNodes[0].innerHTML; + } else { + text = node.innerHTML; + } + } + } else { + if (typeof(config.textExtraction) == "function") { + text = config.textExtraction(node); + } else { + text = $(node).text(); + } + } + return text; + } + + function appendToTable(table, cache) { + + if (table.config.debug) { + var appendTime = new Date() + } + + var c = cache, + r = c.row, + n = c.normalized, + totalRows = n.length, + checkCell = (n[0].length - 1), + tableBody = $(table.tBodies[0]), + rows = []; + + + for (var i = 0; i < totalRows; i++) { + var pos = n[i][checkCell]; + + rows.push(r[pos]); + + if (!table.config.appender) { + + //var o = ; + var l = r[pos].length; + for (var j = 0; j < l; j++) { + tableBody[0].appendChild(r[pos][j]); + } + + // + } + } + + + + if (table.config.appender) { + + table.config.appender(table, rows); + } + + rows = null; + + if (table.config.debug) { + benchmark("Rebuilt table:", appendTime); + } + + // apply table widgets + applyWidget(table); + + // trigger sortend + setTimeout(function () { + $(table).trigger("sortEnd"); + }, 0); + + }; + + function buildHeaders(table) { + + if (table.config.debug) { + var time = new Date(); + } + + var meta = ($.metadata) ? true : false; + + var header_index = computeTableHeaderCellIndexes(table); + + $tableHeaders = $(table.config.selectorHeaders, table).each(function (index) { + + this.column = header_index[this.parentNode.rowIndex + "-" + this.cellIndex]; + // this.column = index; + this.order = formatSortingOrder(table.config.sortInitialOrder); + + + this.count = this.order; + + if (checkHeaderMetadata(this) || checkHeaderOptions(table, index)) this.sortDisabled = true; + if (checkHeaderOptionsSortingLocked(table, index)) this.order = this.lockedOrder = checkHeaderOptionsSortingLocked(table, index); + + if (!this.sortDisabled) { + var $th = $(this).addClass(table.config.cssHeader); + if (table.config.onRenderHeader) table.config.onRenderHeader.apply($th); + } + + // add cell to headerList + table.config.headerList[index] = this; + }); + + if (table.config.debug) { + benchmark("Built headers:", time); + log($tableHeaders); + } + + return $tableHeaders; + + }; + + // from: + // http://www.javascripttoolbox.com/lib/table/examples.php + // http://www.javascripttoolbox.com/temp/table_cellindex.html + + + function computeTableHeaderCellIndexes(t) { + var matrix = []; + var lookup = {}; + var thead = t.getElementsByTagName('THEAD')[0]; + var trs = thead.getElementsByTagName('TR'); + + for (var i = 0; i < trs.length; i++) { + var cells = trs[i].cells; + for (var j = 0; j < cells.length; j++) { + var c = cells[j]; + + var rowIndex = c.parentNode.rowIndex; + var cellId = rowIndex + "-" + c.cellIndex; + var rowSpan = c.rowSpan || 1; + var colSpan = c.colSpan || 1 + var firstAvailCol; + if (typeof(matrix[rowIndex]) == "undefined") { + matrix[rowIndex] = []; + } + // Find first available column in the first row + for (var k = 0; k < matrix[rowIndex].length + 1; k++) { + if (typeof(matrix[rowIndex][k]) == "undefined") { + firstAvailCol = k; + break; + } + } + lookup[cellId] = firstAvailCol; + for (var k = rowIndex; k < rowIndex + rowSpan; k++) { + if (typeof(matrix[k]) == "undefined") { + matrix[k] = []; + } + var matrixrow = matrix[k]; + for (var l = firstAvailCol; l < firstAvailCol + colSpan; l++) { + matrixrow[l] = "x"; + } + } + } + } + return lookup; + } + + function checkCellColSpan(table, rows, row) { + var arr = [], + r = table.tHead.rows, + c = r[row].cells; + + for (var i = 0; i < c.length; i++) { + var cell = c[i]; + + if (cell.colSpan > 1) { + arr = arr.concat(checkCellColSpan(table, headerArr, row++)); + } else { + if (table.tHead.length == 1 || (cell.rowSpan > 1 || !r[row + 1])) { + arr.push(cell); + } + // headerArr[row] = (i+row); + } + } + return arr; + }; + + function checkHeaderMetadata(cell) { + if (($.metadata) && ($(cell).metadata().sorter === false)) { + return true; + }; + return false; + } + + function checkHeaderOptions(table, i) { + if ((table.config.headers[i]) && (table.config.headers[i].sorter === false)) { + return true; + }; + return false; + } + + function checkHeaderOptionsSortingLocked(table, i) { + if ((table.config.headers[i]) && (table.config.headers[i].lockedOrder)) return table.config.headers[i].lockedOrder; + return false; + } + + function applyWidget(table) { + var c = table.config.widgets; + var l = c.length; + for (var i = 0; i < l; i++) { + + getWidgetById(c[i]).format(table); + } + + } + + function getWidgetById(name) { + var l = widgets.length; + for (var i = 0; i < l; i++) { + if (widgets[i].id.toLowerCase() == name.toLowerCase()) { + return widgets[i]; + } + } + }; + + function formatSortingOrder(v) { + if (typeof(v) != "Number") { + return (v.toLowerCase() == "desc") ? 1 : 0; + } else { + return (v == 1) ? 1 : 0; + } + } + + function isValueInArray(v, a) { + var l = a.length; + for (var i = 0; i < l; i++) { + if (a[i][0] == v) { + return true; + } + } + return false; + } + + function setHeadersCss(table, $headers, list, css) { + // remove all header information + $headers.removeClass(css[0]).removeClass(css[1]); + + var h = []; + $headers.each(function (offset) { + if (!this.sortDisabled) { + h[this.column] = $(this); + } + }); + + var l = list.length; + for (var i = 0; i < l; i++) { + h[list[i][0]].addClass(css[list[i][1]]); + } + } + + function fixColumnWidth(table, $headers) { + var c = table.config; + if (c.widthFixed) { + var colgroup = $(''); + $("tr:first td", table.tBodies[0]).each(function () { + colgroup.append($('').css('width', $(this).width())); + }); + $(table).prepend(colgroup); + }; + } + + function updateHeaderSortCount(table, sortList) { + var c = table.config, + l = sortList.length; + for (var i = 0; i < l; i++) { + var s = sortList[i], + o = c.headerList[s[0]]; + o.count = s[1]; + o.count++; + } + } + + /* sorting methods */ + + function multisort(table, sortList, cache) { + + if (table.config.debug) { + var sortTime = new Date(); + } + + var dynamicExp = "var sortWrapper = function(a,b) {", + l = sortList.length; + + // TODO: inline functions. + for (var i = 0; i < l; i++) { + + var c = sortList[i][0]; + var order = sortList[i][1]; + // var s = (getCachedSortType(table.config.parsers,c) == "text") ? + // ((order == 0) ? "sortText" : "sortTextDesc") : ((order == 0) ? + // "sortNumeric" : "sortNumericDesc"); + // var s = (table.config.parsers[c].type == "text") ? ((order == 0) + // ? makeSortText(c) : makeSortTextDesc(c)) : ((order == 0) ? + // makeSortNumeric(c) : makeSortNumericDesc(c)); + var s = (table.config.parsers[c].type == "text") ? ((order == 0) ? makeSortFunction("text", "asc", c) : makeSortFunction("text", "desc", c)) : ((order == 0) ? makeSortFunction("numeric", "asc", c) : makeSortFunction("numeric", "desc", c)); + var e = "e" + i; + + dynamicExp += "var " + e + " = " + s; // + "(a[" + c + "],b[" + c + // + "]); "; + dynamicExp += "if(" + e + ") { return " + e + "; } "; + dynamicExp += "else { "; + + } + + // if value is the same keep orignal order + var orgOrderCol = cache.normalized[0].length - 1; + dynamicExp += "return a[" + orgOrderCol + "]-b[" + orgOrderCol + "];"; + + for (var i = 0; i < l; i++) { + dynamicExp += "}; "; + } + + dynamicExp += "return 0; "; + dynamicExp += "}; "; + + if (table.config.debug) { + benchmark("Evaling expression:" + dynamicExp, new Date()); + } + + eval(dynamicExp); + + cache.normalized.sort(sortWrapper); + + if (table.config.debug) { + benchmark("Sorting on " + sortList.toString() + " and dir " + order + " time:", sortTime); + } + + return cache; + }; + + function makeSortFunction(type, direction, index) { + var a = "a[" + index + "]", + b = "b[" + index + "]"; + if (type == 'text' && direction == 'asc') { + return "(" + a + " == " + b + " ? 0 : (" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : (" + a + " < " + b + ") ? -1 : 1 )));"; + } else if (type == 'text' && direction == 'desc') { + return "(" + a + " == " + b + " ? 0 : (" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : (" + b + " < " + a + ") ? -1 : 1 )));"; + } else if (type == 'numeric' && direction == 'asc') { + return "(" + a + " === null && " + b + " === null) ? 0 :(" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : " + a + " - " + b + "));"; + } else if (type == 'numeric' && direction == 'desc') { + return "(" + a + " === null && " + b + " === null) ? 0 :(" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : " + b + " - " + a + "));"; + } + }; + + function makeSortText(i) { + return "((a[" + i + "] < b[" + i + "]) ? -1 : ((a[" + i + "] > b[" + i + "]) ? 1 : 0));"; + }; + + function makeSortTextDesc(i) { + return "((b[" + i + "] < a[" + i + "]) ? -1 : ((b[" + i + "] > a[" + i + "]) ? 1 : 0));"; + }; + + function makeSortNumeric(i) { + return "a[" + i + "]-b[" + i + "];"; + }; + + function makeSortNumericDesc(i) { + return "b[" + i + "]-a[" + i + "];"; + }; + + function sortText(a, b) { + if (table.config.sortLocaleCompare) return a.localeCompare(b); + return ((a < b) ? -1 : ((a > b) ? 1 : 0)); + }; + + function sortTextDesc(a, b) { + if (table.config.sortLocaleCompare) return b.localeCompare(a); + return ((b < a) ? -1 : ((b > a) ? 1 : 0)); + }; + + function sortNumeric(a, b) { + return a - b; + }; + + function sortNumericDesc(a, b) { + return b - a; + }; + + function getCachedSortType(parsers, i) { + return parsers[i].type; + }; /* public methods */ + this.construct = function (settings) { + return this.each(function () { + // if no thead or tbody quit. + if (!this.tHead || !this.tBodies) return; + // declare + var $this, $document, $headers, cache, config, shiftDown = 0, + sortOrder; + // new blank config object + this.config = {}; + // merge and extend. + config = $.extend(this.config, $.tablesorter.defaults, settings); + // store common expression for speed + $this = $(this); + // save the settings where they read + $.data(this, "tablesorter", config); + // build headers + $headers = buildHeaders(this); + // try to auto detect column type, and store in tables config + this.config.parsers = buildParserCache(this, $headers); + // build the cache for the tbody cells + cache = buildCache(this); + // get the css class names, could be done else where. + var sortCSS = [config.cssDesc, config.cssAsc]; + // fixate columns if the users supplies the fixedWidth option + fixColumnWidth(this); + // apply event handling to headers + // this is to big, perhaps break it out? + $headers.click( + + function (e) { + var totalRows = ($this[0].tBodies[0] && $this[0].tBodies[0].rows.length) || 0; + if (!this.sortDisabled && totalRows > 0) { + // Only call sortStart if sorting is + // enabled. + $this.trigger("sortStart"); + // store exp, for speed + var $cell = $(this); + // get current column index + var i = this.column; + // get current column sort order + this.order = this.count++ % 2; + // always sort on the locked order. + if(this.lockedOrder) this.order = this.lockedOrder; + + // user only whants to sort on one + // column + if (!e[config.sortMultiSortKey]) { + // flush the sort list + config.sortList = []; + if (config.sortForce != null) { + var a = config.sortForce; + for (var j = 0; j < a.length; j++) { + if (a[j][0] != i) { + config.sortList.push(a[j]); + } + } + } + // add column to sort list + config.sortList.push([i, this.order]); + // multi column sorting + } else { + // the user has clicked on an all + // ready sortet column. + if (isValueInArray(i, config.sortList)) { + // revers the sorting direction + // for all tables. + for (var j = 0; j < config.sortList.length; j++) { + var s = config.sortList[j], + o = config.headerList[s[0]]; + if (s[0] == i) { + o.count = s[1]; + o.count++; + s[1] = o.count % 2; + } + } + } else { + // add column to sort list array + config.sortList.push([i, this.order]); + } + }; + setTimeout(function () { + // set css for headers + setHeadersCss($this[0], $headers, config.sortList, sortCSS); + appendToTable( + $this[0], multisort( + $this[0], config.sortList, cache) + ); + }, 1); + // stop normal event by returning false + return false; + } + // cancel selection + }).mousedown(function () { + if (config.cancelSelection) { + this.onselectstart = function () { + return false + }; + return false; + } + }); + // apply easy methods that trigger binded events + $this.bind("update", function () { + var me = this; + setTimeout(function () { + // rebuild parsers. + me.config.parsers = buildParserCache( + me, $headers); + // rebuild the cache map + cache = buildCache(me); + }, 1); + }).bind("updateCell", function (e, cell) { + var config = this.config; + // get position from the dom. + var pos = [(cell.parentNode.rowIndex - 1), cell.cellIndex]; + // update cache + cache.normalized[pos[0]][pos[1]] = config.parsers[pos[1]].format( + getElementText(config, cell), cell); + }).bind("sorton", function (e, list) { + $(this).trigger("sortStart"); + config.sortList = list; + // update and store the sortlist + var sortList = config.sortList; + // update header count index + updateHeaderSortCount(this, sortList); + // set css for headers + setHeadersCss(this, $headers, sortList, sortCSS); + // sort the table and append it to the dom + appendToTable(this, multisort(this, sortList, cache)); + }).bind("appendCache", function () { + appendToTable(this, cache); + }).bind("applyWidgetId", function (e, id) { + getWidgetById(id).format(this); + }).bind("applyWidgets", function () { + // apply widgets + applyWidget(this); + }); + if ($.metadata && ($(this).metadata() && $(this).metadata().sortlist)) { + config.sortList = $(this).metadata().sortlist; + } + // if user has supplied a sort list to constructor. + if (config.sortList.length > 0) { + $this.trigger("sorton", [config.sortList]); + } + // apply widgets + applyWidget(this); + }); + }; + this.addParser = function (parser) { + var l = parsers.length, + a = true; + for (var i = 0; i < l; i++) { + if (parsers[i].id.toLowerCase() == parser.id.toLowerCase()) { + a = false; + } + } + if (a) { + parsers.push(parser); + }; + }; + this.addWidget = function (widget) { + widgets.push(widget); + }; + this.formatFloat = function (s) { + var i = parseFloat(s); + return (isNaN(i)) ? 0 : i; + }; + this.formatInt = function (s) { + var i = parseInt(s); + return (isNaN(i)) ? 0 : i; + }; + this.isDigit = function (s, config) { + // replace all an wanted chars and match. + return /^[-+]?\d*$/.test($.trim(s.replace(/[,.']/g, ''))); + }; + this.clearTableBody = function (table) { + if ($.browser.msie) { + function empty() { + while (this.firstChild) + this.removeChild(this.firstChild); + } + empty.apply(table.tBodies[0]); + } else { + table.tBodies[0].innerHTML = ""; + } + }; + } + }); + + // extend plugin scope + $.fn.extend({ + tablesorter: $.tablesorter.construct + }); + + // make shortcut + var ts = $.tablesorter; + + // add default parsers + ts.addParser({ + id: "text", + is: function (s) { + return true; + }, format: function (s) { + return $.trim(s.toLocaleLowerCase()); + }, type: "text" + }); + + ts.addParser({ + id: "digit", + is: function (s, table) { + var c = table.config; + return $.tablesorter.isDigit(s, c); + }, format: function (s) { + return $.tablesorter.formatFloat(s); + }, type: "numeric" + }); + + ts.addParser({ + id: "currency", + is: function (s) { + return /^[£$€?.]/.test(s); + }, format: function (s) { + return $.tablesorter.formatFloat(s.replace(new RegExp(/[£$€]/g), "")); + }, type: "numeric" + }); + + ts.addParser({ + id: "ipAddress", + is: function (s) { + return /^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s); + }, format: function (s) { + var a = s.split("."), + r = "", + l = a.length; + for (var i = 0; i < l; i++) { + var item = a[i]; + if (item.length == 2) { + r += "0" + item; + } else { + r += item; + } + } + return $.tablesorter.formatFloat(r); + }, type: "numeric" + }); + + ts.addParser({ + id: "url", + is: function (s) { + return /^(https?|ftp|file):\/\/$/.test(s); + }, format: function (s) { + return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//), '')); + }, type: "text" + }); + + ts.addParser({ + id: "isoDate", + is: function (s) { + return /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s); + }, format: function (s) { + return $.tablesorter.formatFloat((s != "") ? new Date(s.replace( + new RegExp(/-/g), "/")).getTime() : "0"); + }, type: "numeric" + }); + + ts.addParser({ + id: "percent", + is: function (s) { + return /\%$/.test($.trim(s)); + }, format: function (s) { + return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g), "")); + }, type: "numeric" + }); + + ts.addParser({ + id: "usLongDate", + is: function (s) { + return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/)); + }, format: function (s) { + return $.tablesorter.formatFloat(new Date(s).getTime()); + }, type: "numeric" + }); + + ts.addParser({ + id: "shortDate", + is: function (s) { + return /\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s); + }, format: function (s, table) { + var c = table.config; + s = s.replace(/\-/g, "/"); + if (c.dateFormat == "us") { + // reformat the string in ISO format + s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$1/$2"); + } else if (c.dateFormat == "uk") { + // reformat the string in ISO format + s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$2/$1"); + } else if (c.dateFormat == "dd/mm/yy" || c.dateFormat == "dd-mm-yy") { + s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$1/$2/$3"); + } + return $.tablesorter.formatFloat(new Date(s).getTime()); + }, type: "numeric" + }); + ts.addParser({ + id: "time", + is: function (s) { + return /^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s); + }, format: function (s) { + return $.tablesorter.formatFloat(new Date("2000/01/01 " + s).getTime()); + }, type: "numeric" + }); + ts.addParser({ + id: "metadata", + is: function (s) { + return false; + }, format: function (s, table, cell) { + var c = table.config, + p = (!c.parserMetadataName) ? 'sortValue' : c.parserMetadataName; + return $(cell).metadata()[p]; + }, type: "numeric" + }); + // add default widgets + ts.addWidget({ + id: "zebra", + format: function (table) { + if (table.config.debug) { + var time = new Date(); + } + var $tr, row = -1, + odd; + // loop through the visible rows + $("tr:visible", table.tBodies[0]).each(function (i) { + $tr = $(this); + // style children rows the same way the parent + // row was styled + if (!$tr.hasClass(table.config.cssChildRow)) row++; + odd = (row % 2 == 0); + $tr.removeClass( + table.config.widgetZebra.css[odd ? 0 : 1]).addClass( + table.config.widgetZebra.css[odd ? 1 : 0]) + }); + if (table.config.debug) { + $.tablesorter.benchmark("Applying Zebra widget", time); + } + } + }); +})(jQuery); \ No newline at end of file diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/js/toolbar.js b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/js/toolbar.js new file mode 100644 index 00000000..c0d7048d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/static/js/toolbar.js @@ -0,0 +1,192 @@ +(function($) { + $.cookie = function(name, value, options) { if (typeof value != 'undefined') { options = options || {}; if (value === null) { value = ''; options.expires = -1; } var expires = ''; if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { var date; if (typeof options.expires == 'number') { date = new Date(); date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); } else { date = options.expires; } expires = '; expires=' + date.toUTCString(); } var path = options.path ? '; path=' + (options.path) : ''; var domain = options.domain ? '; domain=' + (options.domain) : ''; var secure = options.secure ? '; secure' : ''; document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); } else { var cookieValue = null; if (document.cookie && document.cookie != '') { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = $.trim(cookies[i]); if (cookie.substring(0, name.length + 1) == (name + '=')) { cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); break; } } } return cookieValue; } }; + $('head').append(''); + var COOKIE_NAME = 'fldt'; + var COOKIE_NAME_ACTIVE = COOKIE_NAME +'_active'; + var fldt = { + init: function() { + $('#flDebug').show(); + var current = null; + $('#flDebugPanelList li a').click(function() { + if (!this.className) { + return false; + } + current = $('#flDebug #' + this.className + '-content'); + if (current.is(':visible')) { + $(document).trigger('close.flDebug'); + $(this).parent().removeClass('active'); + } else { + $('.panelContent').hide(); // Hide any that are already open + current.show(); + $('#flDebugToolbar li').removeClass('active'); + $(this).parent().addClass('active'); + } + return false; + }); + $('#flDebugPanelList li .switch').click(function() { + var $panel = $(this).parent(); + var $this = $(this); + var dom_id = $panel.attr('id'); + + // Turn cookie content into an array of active panels + var active_str = $.cookie(COOKIE_NAME_ACTIVE); + var active = (active_str) ? active_str.split(';') : []; + active = $.grep(active, function(n,i) { return n != dom_id; }); + + if ($this.hasClass('active')) { + $this.removeClass('active'); + $this.addClass('inactive'); + } else { + active.push(dom_id); + $this.removeClass('inactive'); + $this.addClass('active'); + } + + if (active.length > 0) { + $.cookie(COOKIE_NAME_ACTIVE, active.join(';'), { + path: '/', expires: 10 + }); + } else { + $.cookie(COOKIE_NAME_ACTIVE, null, { + path: '/', expires: -1 + }); + } + }); + $('#flDebug a.flDebugClose').click(function() { + $(document).trigger('close.flDebug'); + $('#flDebugToolbar li').removeClass('active'); + return false; + }); + $('#flDebug a.remoteCall').click(function() { + $('#flDebugWindow').load(this.href, {}, function() { + $('#flDebugWindow a.flDebugBack').click(function() { + $(this).parent().parent().hide(); + return false; + }); + }); + $('#flDebugWindow').show(); + return false; + }); + $('#flDebugTemplatePanel a.flTemplateShowContext').click(function() { + fldt.toggle_arrow($(this).children('.toggleArrow')) + fldt.toggle_content($(this).parent().next()); + return false; + }); + $('#flDebugSQLPanel a.flSQLShowStacktrace').click(function() { + fldt.toggle_content($('.flSQLHideStacktraceDiv', $(this).parents('tr'))); + return false; + }); + $('#flHideToolBarButton').click(function() { + fldt.hide_toolbar(true); + return false; + }); + $('#flShowToolBarButton').click(function() { + fldt.show_toolbar(); + return false; + }); + $(document).bind('close.flDebug', function() { + // If a sub-panel is open, close that + if ($('#flDebugWindow').is(':visible')) { + $('#flDebugWindow').hide(); + return; + } + // If a panel is open, close that + if ($('.panelContent').is(':visible')) { + $('.panelContent').hide(); + return; + } + // Otherwise, just minimize the toolbar + if ($('#flDebugToolbar').is(':visible')) { + fldt.hide_toolbar(true); + return; + } + }); + if ($.cookie(COOKIE_NAME)) { + fldt.hide_toolbar(false); + } else { + fldt.show_toolbar(false); + } + $('#flDebug table.tablesorter').each(function() { + var headers = {}; + $(this).find('thead th').each(function(idx, elem) { + headers[idx] = $(elem).data(); + }); + $(this).tablesorter({headers: headers}); + }) + .bind('sortEnd', function() { + $(this).find('tbody tr').each(function(idx, elem) { + var even = idx % 2 === 0; + $(elem) + .toggleClass('flDebugEven', even) + .toggleClass('flDebugOdd', !even); + }); + }); + }, + toggle_content: function(elem) { + if (elem.is(':visible')) { + elem.hide(); + } else { + elem.show(); + } + }, + close: function() { + $(document).trigger('close.flDebug'); + return false; + }, + hide_toolbar: function(setCookie) { + // close any sub panels + $('#flDebugWindow').hide(); + // close all panels + $('.panelContent').hide(); + $('#flDebugToolbar li').removeClass('active'); + // finally close toolbar + $('#flDebugToolbar').hide('fast'); + $('#flDebugToolbarHandle').show(); + // Unbind keydown + $(document).unbind('keydown.flDebug'); + if (setCookie) { + $.cookie(COOKIE_NAME, 'hide', { + path: '/', + expires: 10 + }); + } + }, + show_toolbar: function(animate) { + // Set up keybindings + $(document).bind('keydown.flDebug', function(e) { + if (e.keyCode == 27) { + fldt.close(); + } + }); + $('#flDebugToolbarHandle').hide(); + if (animate) { + $('#flDebugToolbar').show('fast'); + } else { + $('#flDebugToolbar').show(); + } + $.cookie(COOKIE_NAME, null, { + path: '/', + expires: -1 + }); + }, + toggle_arrow: function(elem) { + var uarr = String.fromCharCode(0x25b6); + var darr = String.fromCharCode(0x25bc); + elem.html(elem.html() == uarr ? darr : uarr); + }, + load_href: function(href) { + $.get(href, function(data, status, xhr) { + document.open(); + document.write(xhr.responseText); + document.close(); + }); + return false; + }, + $: $ + }; + $(document).ready(function() { + fldt.init(); + }); + window.fldt = fldt; + +})(jQuery.noConflict(true)); diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/base.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/base.html new file mode 100644 index 00000000..59769c9b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/base.html @@ -0,0 +1,57 @@ + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/config_vars.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/config_vars.html new file mode 100644 index 00000000..97f15e6b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/config_vars.html @@ -0,0 +1,16 @@ + + + + + + + + + {% for key, value in config|dictsort %} + + + + + {% endfor %} + +
    KeyValue
    {{ key }}{{ value|printable }}
    \ No newline at end of file diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/headers.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/headers.html new file mode 100644 index 00000000..2155ce58 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/headers.html @@ -0,0 +1,16 @@ + + + + + + + + + {% for key, value in headers|dictsort %} + + + + + {% endfor %} + +
    KeyValue
    {{ key|escape }}{{ value|escape }}
    diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/logger.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/logger.html new file mode 100644 index 00000000..b7f56325 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/logger.html @@ -0,0 +1,26 @@ +{% if records %} + + + + + + + + + + + {% for record in records %} + + + + + + + {% endfor %} + +
    LevelTimeMessageLocation
    {{ record.level }}{{ record.time }}{{ record.message }}{{ record.file }}:{{ record.line }}
    +{% else %} +

    No messages logged.

    +{% endif %} + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/profiler.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/profiler.html new file mode 100644 index 00000000..f9711ae7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/profiler.html @@ -0,0 +1,24 @@ + + + + + + + + + + + + + {% for row in function_calls %} + + + + + + + + + {% endfor %} + +
    CallsTotal Time (ms)Per Call (ms)Cumulative Time (ms)Per Call (ms)Function
    {{ row.ncalls }}{{ row.tottime }}{{ '%.4f'|format(row.percall) }}{{ row.cumtime }}{{ '%.4f'|format(row.percall_cum) }}{{ row.filename|escape }}
    \ No newline at end of file diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/request_vars.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/request_vars.html new file mode 100644 index 00000000..a0182249 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/request_vars.html @@ -0,0 +1,104 @@ + +

    View information

    + + + + + + + + + + + + + + + +
    View Functionargskwargs
    {{ view_func }}{{ view_args|default("None") }} + {% if view_kwargs.items() %} + {% for k, v in view_kwargs.items() %} + {{ k }}={{ v }}{% if not loop.last %}, {% endif %} + {% endfor %} + {% else %} + None + {% endif %} +
    + +{% macro show_map(map) %} + + + + + + + + + + + + + {% for key, value in map %} + + + + + {% endfor %} + +
    VariableValue
    {{ key|printable }}{{ value|printable }}
    +{% endmacro %} + + +

    COOKIES Variables

    +{% if cookies %} + {{ show_map(cookies) }} +{% else %} +

    No COOKIE data

    +{% endif %} + +

    SESSION Variables

    +{% if session %} + {{ show_map(session) }} +{% else %} +

    No SESSION data

    +{% endif %} + + +{% macro show_multi_map(map) %} + + + + + + + + + {% for key, value in map %} + + + + + {% endfor %} + +
    VariableValue
    {{ key|printable }} + {%- set sep = joiner() -%} + {%- for v in value -%} + {{ sep() }}{{ v|printable }} + {%- endfor -%} +
    +{% endmacro %} + + +

    GET Variables

    +{% if get %} + {{ show_multi_map(get) }} +{% else %} +

    No GET data

    +{% endif %} + +

    POST Variables

    +{% if post %} + {{ show_multi_map(post) }} +{% else %} +

    No POST data

    +{% endif %} diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/route_list.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/route_list.html new file mode 100644 index 00000000..d987d230 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/route_list.html @@ -0,0 +1,28 @@ + + + + + + + + + + + + {% if routes %} + {% for route in routes|sort(attribute='rule') %} + + + + + + + + {% endfor %} + {% else %} + + + + {% endif %} + +
    URL routeEndpoint nameHTTP methodsIs aliasRedirect to
    {{ route.rule }}{{ route.endpoint }}{{ route.methods|sort|join(', ') }}{{ route.alias }}{{ route.redirect_to }}
    No routes have been configured.
    diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/sqlalchemy.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/sqlalchemy.html new file mode 100644 index 00000000..aff69c2e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/sqlalchemy.html @@ -0,0 +1,31 @@ + + + + + + + + + + + {% for query in queries %} + + + + + + + {% endfor %} + +
     (ms)ActionContextQuery
    {{ '%.4f'|format(query.duration * 1000) }} + {% if query.signed_query %} + SELECT
    + EXPLAIN
    + {% endif %} +
    + {{ query.context }} + +
    +
    {{ query.sql }}
    +
    +
    diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/sqlalchemy_error.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/sqlalchemy_error.html new file mode 100644 index 00000000..8f6c7828 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/sqlalchemy_error.html @@ -0,0 +1,44 @@ +

    Queries Unavailable

    + +

    + The toolbar was unable to fetch the SQLAlchemy queries for this request. + To enable the SQLAlchemy query display, please: +

    + +
      + {% if not sqlalchemy_available %} +
    1. +
      Install required libraries:
      +
        +
      • Flask-SQLAlchemy
      • +
      +
    2. + {% endif %} + + {% if not extension_used %} +
    3. +
      Configure Flask-SQLAlchemy:
      +

      + The Flask-SQLAlchemy extension needs to be configured for this application. + Please see the + Flask-SQLAlchemy documentation for details. +

      +
    4. + {% endif %} + + {% if not recording_enabled %} +
    5. +
      Enable query recording:
      +

      + Since this app is not currently running in DEBUG mode, Flask-SQLAlchemy will not record queries by default. To enable query recording in non-debug mode, set the following configuration value: +

      +
      app.config['SQLALCHEMY_RECORD_QUERIES'] = True
      +

      + See the + + documention of Flask-SQLAlchemy's get_debug_queries() + for additional details. +

      +
    6. + {% endif %} +
    diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/sqlalchemy_select.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/sqlalchemy_select.html new file mode 100644 index 00000000..8bacad2a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/sqlalchemy_select.html @@ -0,0 +1,36 @@ +
    + Back +

    SQL Details

    +
    +
    +
    +
    +
    Executed SQL
    +
    {{ sql }}
    +
    Original query duration
    +
    {{ '%.4f'|format(duration * 1000) }} ms
    +
    + {% if result %} + + + + {% for h in headers %} + + {% endfor %} + + + + {% for row in result %} + + {% for column in row %} + + {% endfor %} + + {% endfor %} + +
    {{ h|upper }}
    {{ column }}
    + {% else %} +

    Empty set

    + {% endif %} +
    +
    diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/template.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/template.html new file mode 100644 index 00000000..a36c5a77 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/template.html @@ -0,0 +1,26 @@ +{% if templates %} + {% if editable %} + Edit templates + {% endif %} + {% for template in templates %} +

    {{ template.template.name }}

    + + + + + + + + + {% for k, v in template.context|dictsort %} + + + + + {% endfor %} + +
    VariableValue
    {{ k }}{{ v|printable }}
    + {% endfor %} +{% else %} +

    No template rendered

    +{% endif %} diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/template_editor.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/template_editor.html new file mode 100644 index 00000000..f654aa6f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/template_editor.html @@ -0,0 +1,154 @@ + + + + + + + + + + + Editing {{ templates[0].name }} + + + + + + + +
    +
    +
    + + +
    +
    + +
    +
    +
    + + + + + + + + + + + + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/timer.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/timer.html new file mode 100644 index 00000000..5238e472 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/timer.html @@ -0,0 +1,21 @@ + + + + + + + + + + + + + {% for key, value in rows %} + + + + + {% endfor %} + +
    ResourceValue
    {{ key|escape }}{{ value|escape }}
    + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/versions.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/versions.html new file mode 100644 index 00000000..9e9c64ed --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/panels/versions.html @@ -0,0 +1,33 @@ +

    Installed Packages

    + +

    + Installation paths relative to: +

    +
    +{{ python_lib }}
    +
    + + + + + + + + + + + {% for package in packages %} + + + + + + {% else %} + + + + + + {% endfor %} + +
    PackageVersionInstalled Path
    {{ package.project_name }}{{ package.version }}{{ relpath(package.location, python_lib) }}
    setuptoolsNOT INSTALLEDInstall setuptools to display installed packages and version information
    diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/redirect.html b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/redirect.html new file mode 100644 index 00000000..28818bc1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/templates/redirect.html @@ -0,0 +1,15 @@ + + + Redirect intercepted + + +

    Redirect ({{ redirect_code }})

    +

    Location: {{ redirect_to }}

    +

    + The Flask Debug Toolbar has intercepted a redirect to the above URL for + debug viewing purposes. You can click the above link to continue with the + redirect as normal. If you'd like to disable this feature, you can set the + config variable DEBUG_TB_INTERCEPT_REDIRECTS to False. +

    + + diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/toolbar.py b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/toolbar.py new file mode 100644 index 00000000..0d38f4a7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/toolbar.py @@ -0,0 +1,77 @@ +try: + from urllib.parse import unquote +except ImportError: + from urllib import unquote + +from flask import url_for, current_app +from werkzeug.utils import import_string + + +class DebugToolbar(object): + + _cached_panel_classes = {} + + def __init__(self, request, jinja_env): + self.jinja_env = jinja_env + self.request = request + self.panels = [] + + self.template_context = { + 'static_path': url_for('_debug_toolbar.static', filename='') + } + + self.create_panels() + + def create_panels(self): + """ + Populate debug panels + """ + activated = self.request.cookies.get('fldt_active', '') + activated = unquote(activated).split(';') + + for panel_class in self._iter_panels(current_app): + panel_instance = panel_class(jinja_env=self.jinja_env, + context=self.template_context) + + if panel_instance.dom_id() in activated: + panel_instance.is_active = True + + self.panels.append(panel_instance) + + def render_toolbar(self): + context = self.template_context.copy() + context.update({'panels': self.panels}) + + template = self.jinja_env.get_template('base.html') + return template.render(**context) + + @classmethod + def load_panels(cls, app): + for panel_class in cls._iter_panels(app): + # just loop to make sure they've been loaded + pass + + @classmethod + def _iter_panels(cls, app): + for panel_path in app.config['DEBUG_TB_PANELS']: + panel_class = cls._import_panel(app, panel_path) + if panel_class is not None: + yield panel_class + + @classmethod + def _import_panel(cls, app, path): + cache = cls._cached_panel_classes + + try: + return cache[path] + except KeyError: + pass + + try: + panel_class = import_string(path) + except ImportError as e: + app.logger.warning('Disabled %s due to ImportError: %s', path, e) + panel_class = None + + cache[path] = panel_class + return panel_class diff --git a/.venv/lib/python3.8/site-packages/flask_debugtoolbar/utils.py b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/utils.py new file mode 100644 index 00000000..9b211f37 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_debugtoolbar/utils.py @@ -0,0 +1,85 @@ +import itertools +import os.path +import sys + +try: + from pygments import highlight + from pygments.formatters import HtmlFormatter + from pygments.lexers import SqlLexer + from pygments.styles import get_style_by_name + PYGMENT_STYLE = get_style_by_name('colorful') + HAVE_PYGMENTS = True +except ImportError: + HAVE_PYGMENTS = False + +try: + import sqlparse + HAVE_SQLPARSE = True +except ImportError: + HAVE_SQLPARSE = False + +from flask import current_app, Markup + + +def format_fname(value): + # If the value has a builtin prefix, return it unchanged + if value.startswith(('{', '<')): + return value + + value = os.path.normpath(value) + + # If the file is absolute, try normalizing it relative to the project root + # to handle it as a project file + if os.path.isabs(value): + value = _shortest_relative_path( + value, [current_app.root_path], os.path) + + # If the value is a relative path, it is a project file + if not os.path.isabs(value): + return os.path.join('.', value) + + # Otherwise, normalize other paths relative to sys.path + return '<%s>' % _shortest_relative_path(value, sys.path, os.path) + + +def _shortest_relative_path(value, paths, path_module): + relpaths = _relative_paths(value, paths, path_module) + return min(itertools.chain(relpaths, [value]), key=len) + + +def _relative_paths(value, paths, path_module): + for path in paths: + try: + relval = path_module.relpath(value, path) + except ValueError: + # on Windows, relpath throws a ValueError for + # paths with different drives + continue + if not relval.startswith(path_module.pardir): + yield relval + + +def decode_text(value): + """ + Decode a text-like value for display. + + Unicode values are returned unchanged. Byte strings will be decoded + with a text-safe replacement for unrecognized characters. + """ + if isinstance(value, bytes): + return value.decode('ascii', 'replace') + else: + return value + + +def format_sql(query, args): + if HAVE_SQLPARSE: + query = sqlparse.format(query, reindent=True, keyword_case='upper') + + if not HAVE_PYGMENTS: + return decode_text(query) + + return Markup(highlight( + query, + SqlLexer(), + HtmlFormatter(noclasses=True, style=PYGMENT_STYLE))) diff --git a/.venv/lib/python3.8/site-packages/flask_migrate/__init__.py b/.venv/lib/python3.8/site-packages/flask_migrate/__init__.py new file mode 100644 index 00000000..3773da70 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_migrate/__init__.py @@ -0,0 +1,387 @@ +import argparse +from functools import wraps +import logging +import os +import sys +from flask import current_app +try: + from flask_script import Manager +except ImportError: + Manager = None +from alembic import __version__ as __alembic_version__ +from alembic.config import Config as AlembicConfig +from alembic import command +from alembic.util import CommandError + +alembic_version = tuple([int(v) for v in __alembic_version__.split('.')[0:3]]) +log = logging.getLogger() + + +class _MigrateConfig(object): + def __init__(self, migrate, db, **kwargs): + self.migrate = migrate + self.db = db + self.directory = migrate.directory + self.configure_args = kwargs + + @property + def metadata(self): + """ + Backwards compatibility, in old releases app.extensions['migrate'] + was set to db, and env.py accessed app.extensions['migrate'].metadata + """ + return self.db.metadata + + +class Config(AlembicConfig): + def get_template_directory(self): + package_dir = os.path.abspath(os.path.dirname(__file__)) + return os.path.join(package_dir, 'templates') + + +class Migrate(object): + def __init__(self, app=None, db=None, directory='migrations', **kwargs): + self.configure_callbacks = [] + self.db = db + self.directory = str(directory) + self.alembic_ctx_kwargs = kwargs + if app is not None and db is not None: + self.init_app(app, db, directory) + + def init_app(self, app, db=None, directory=None, **kwargs): + self.db = db or self.db + self.directory = str(directory or self.directory) + self.alembic_ctx_kwargs.update(kwargs) + if not hasattr(app, 'extensions'): + app.extensions = {} + app.extensions['migrate'] = _MigrateConfig(self, self.db, + **self.alembic_ctx_kwargs) + + def configure(self, f): + self.configure_callbacks.append(f) + return f + + def call_configure_callbacks(self, config): + for f in self.configure_callbacks: + config = f(config) + return config + + def get_config(self, directory=None, x_arg=None, opts=None): + if directory is None: + directory = self.directory + directory = str(directory) + config = Config(os.path.join(directory, 'alembic.ini')) + config.set_main_option('script_location', directory) + if config.cmd_opts is None: + config.cmd_opts = argparse.Namespace() + for opt in opts or []: + setattr(config.cmd_opts, opt, True) + if not hasattr(config.cmd_opts, 'x'): + if x_arg is not None: + setattr(config.cmd_opts, 'x', []) + if isinstance(x_arg, list) or isinstance(x_arg, tuple): + for x in x_arg: + config.cmd_opts.x.append(x) + else: + config.cmd_opts.x.append(x_arg) + else: + setattr(config.cmd_opts, 'x', None) + return self.call_configure_callbacks(config) + + +def catch_errors(f): + @wraps(f) + def wrapped(*args, **kwargs): + try: + f(*args, **kwargs) + except (CommandError, RuntimeError) as exc: + log.error('Error: ' + str(exc)) + sys.exit(1) + return wrapped + + +if Manager is not None: + MigrateCommand = Manager(usage='Perform database migrations') +else: + class FakeCommand(object): + def option(self, *args, **kwargs): + def decorator(f): + return f + return decorator + + MigrateCommand = FakeCommand() + + +@MigrateCommand.option('-d', '--directory', dest='directory', default=None, + help=("Migration script directory (default is " + "'migrations')")) +@MigrateCommand.option('--multidb', dest='multidb', action='store_true', + default=False, + help=("Multiple databases migraton (default is " + "False)")) +@catch_errors +def init(directory=None, multidb=False): + """Creates a new migration repository""" + if directory is None: + directory = current_app.extensions['migrate'].directory + config = Config() + config.set_main_option('script_location', directory) + config.config_file_name = os.path.join(directory, 'alembic.ini') + config = current_app.extensions['migrate'].\ + migrate.call_configure_callbacks(config) + if multidb: + command.init(config, directory, 'flask-multidb') + else: + command.init(config, directory, 'flask') + + +@MigrateCommand.option('--rev-id', dest='rev_id', default=None, + help=('Specify a hardcoded revision id instead of ' + 'generating one')) +@MigrateCommand.option('--version-path', dest='version_path', default=None, + help=('Specify specific path from config for version ' + 'file')) +@MigrateCommand.option('--branch-label', dest='branch_label', default=None, + help=('Specify a branch label to apply to the new ' + 'revision')) +@MigrateCommand.option('--splice', dest='splice', action='store_true', + default=False, + help=('Allow a non-head revision as the "head" to ' + 'splice onto')) +@MigrateCommand.option('--head', dest='head', default='head', + help=('Specify head revision or @head to ' + 'base new revision on')) +@MigrateCommand.option('--sql', dest='sql', action='store_true', default=False, + help=("Don't emit SQL to database - dump to standard " + "output instead")) +@MigrateCommand.option('--autogenerate', dest='autogenerate', + action='store_true', default=False, + help=('Populate revision script with candidate ' + 'migration operations, based on comparison of ' + 'database to model')) +@MigrateCommand.option('-m', '--message', dest='message', default=None, + help='Revision message') +@MigrateCommand.option('-d', '--directory', dest='directory', default=None, + help=("Migration script directory (default is " + "'migrations')")) +@catch_errors +def revision(directory=None, message=None, autogenerate=False, sql=False, + head='head', splice=False, branch_label=None, version_path=None, + rev_id=None): + """Create a new revision file.""" + config = current_app.extensions['migrate'].migrate.get_config(directory) + command.revision(config, message, autogenerate=autogenerate, sql=sql, + head=head, splice=splice, branch_label=branch_label, + version_path=version_path, rev_id=rev_id) + + +@MigrateCommand.option('--rev-id', dest='rev_id', default=None, + help=('Specify a hardcoded revision id instead of ' + 'generating one')) +@MigrateCommand.option('--version-path', dest='version_path', default=None, + help=('Specify specific path from config for version ' + 'file')) +@MigrateCommand.option('--branch-label', dest='branch_label', default=None, + help=('Specify a branch label to apply to the new ' + 'revision')) +@MigrateCommand.option('--splice', dest='splice', action='store_true', + default=False, + help=('Allow a non-head revision as the "head" to ' + 'splice onto')) +@MigrateCommand.option('--head', dest='head', default='head', + help=('Specify head revision or @head to ' + 'base new revision on')) +@MigrateCommand.option('--sql', dest='sql', action='store_true', default=False, + help=("Don't emit SQL to database - dump to standard " + "output instead")) +@MigrateCommand.option('-m', '--message', dest='message', default=None) +@MigrateCommand.option('-d', '--directory', dest='directory', default=None, + help=("Migration script directory (default is " + "'migrations')")) +@MigrateCommand.option('-x', '--x-arg', dest='x_arg', default=None, + action='append', help=("Additional arguments consumed " + "by custom env.py scripts")) +@catch_errors +def migrate(directory=None, message=None, sql=False, head='head', splice=False, + branch_label=None, version_path=None, rev_id=None, x_arg=None): + """Alias for 'revision --autogenerate'""" + config = current_app.extensions['migrate'].migrate.get_config( + directory, opts=['autogenerate'], x_arg=x_arg) + command.revision(config, message, autogenerate=True, sql=sql, + head=head, splice=splice, branch_label=branch_label, + version_path=version_path, rev_id=rev_id) + + +@MigrateCommand.option('revision', nargs='?', default='head', + help="revision identifier") +@MigrateCommand.option('-d', '--directory', dest='directory', default=None, + help=("Migration script directory (default is " + "'migrations')")) +@catch_errors +def edit(directory=None, revision='current'): + """Edit current revision.""" + if alembic_version >= (0, 8, 0): + config = current_app.extensions['migrate'].migrate.get_config( + directory) + command.edit(config, revision) + else: + raise RuntimeError('Alembic 0.8.0 or greater is required') + + +@MigrateCommand.option('--rev-id', dest='rev_id', default=None, + help=('Specify a hardcoded revision id instead of ' + 'generating one')) +@MigrateCommand.option('--branch-label', dest='branch_label', default=None, + help=('Specify a branch label to apply to the new ' + 'revision')) +@MigrateCommand.option('-m', '--message', dest='message', default=None) +@MigrateCommand.option('revisions', nargs='+', + help='one or more revisions, or "heads" for all heads') +@MigrateCommand.option('-d', '--directory', dest='directory', default=None, + help=("Migration script directory (default is " + "'migrations')")) +@catch_errors +def merge(directory=None, revisions='', message=None, branch_label=None, + rev_id=None): + """Merge two revisions together. Creates a new migration file""" + config = current_app.extensions['migrate'].migrate.get_config(directory) + command.merge(config, revisions, message=message, + branch_label=branch_label, rev_id=rev_id) + + +@MigrateCommand.option('--tag', dest='tag', default=None, + help=("Arbitrary 'tag' name - can be used by custom " + "env.py scripts")) +@MigrateCommand.option('--sql', dest='sql', action='store_true', default=False, + help=("Don't emit SQL to database - dump to standard " + "output instead")) +@MigrateCommand.option('revision', nargs='?', default='head', + help="revision identifier") +@MigrateCommand.option('-d', '--directory', dest='directory', default=None, + help=("Migration script directory (default is " + "'migrations')")) +@MigrateCommand.option('-x', '--x-arg', dest='x_arg', default=None, + action='append', help=("Additional arguments consumed " + "by custom env.py scripts")) +@catch_errors +def upgrade(directory=None, revision='head', sql=False, tag=None, x_arg=None): + """Upgrade to a later version""" + config = current_app.extensions['migrate'].migrate.get_config(directory, + x_arg=x_arg) + command.upgrade(config, revision, sql=sql, tag=tag) + + +@MigrateCommand.option('--tag', dest='tag', default=None, + help=("Arbitrary 'tag' name - can be used by custom " + "env.py scripts")) +@MigrateCommand.option('--sql', dest='sql', action='store_true', default=False, + help=("Don't emit SQL to database - dump to standard " + "output instead")) +@MigrateCommand.option('revision', nargs='?', default="-1", + help="revision identifier") +@MigrateCommand.option('-d', '--directory', dest='directory', default=None, + help=("Migration script directory (default is " + "'migrations')")) +@MigrateCommand.option('-x', '--x-arg', dest='x_arg', default=None, + action='append', help=("Additional arguments consumed " + "by custom env.py scripts")) +@catch_errors +def downgrade(directory=None, revision='-1', sql=False, tag=None, x_arg=None): + """Revert to a previous version""" + config = current_app.extensions['migrate'].migrate.get_config(directory, + x_arg=x_arg) + if sql and revision == '-1': + revision = 'head:-1' + command.downgrade(config, revision, sql=sql, tag=tag) + + +@MigrateCommand.option('revision', nargs='?', default="head", + help="revision identifier") +@MigrateCommand.option('-d', '--directory', dest='directory', default=None, + help=("Migration script directory (default is " + "'migrations')")) +@catch_errors +def show(directory=None, revision='head'): + """Show the revision denoted by the given symbol.""" + config = current_app.extensions['migrate'].migrate.get_config(directory) + command.show(config, revision) + + +@MigrateCommand.option('-i', '--indicate-current', dest='indicate_current', action='store_true', + default=False, help='Indicate current version (Alembic 0.9.9 or greater is required)') +@MigrateCommand.option('-v', '--verbose', dest='verbose', action='store_true', + default=False, help='Use more verbose output') +@MigrateCommand.option('-r', '--rev-range', dest='rev_range', default=None, + help='Specify a revision range; format is [start]:[end]') +@MigrateCommand.option('-d', '--directory', dest='directory', default=None, + help=("Migration script directory (default is " + "'migrations')")) +@catch_errors +def history(directory=None, rev_range=None, verbose=False, indicate_current=False): + """List changeset scripts in chronological order.""" + config = current_app.extensions['migrate'].migrate.get_config(directory) + if alembic_version >= (0, 9, 9): + command.history(config, rev_range, verbose=verbose, indicate_current=indicate_current) + else: + command.history(config, rev_range, verbose=verbose) + + +@MigrateCommand.option('--resolve-dependencies', dest='resolve_dependencies', + action='store_true', default=False, + help='Treat dependency versions as down revisions') +@MigrateCommand.option('-v', '--verbose', dest='verbose', action='store_true', + default=False, help='Use more verbose output') +@MigrateCommand.option('-d', '--directory', dest='directory', default=None, + help=("Migration script directory (default is " + "'migrations')")) +@catch_errors +def heads(directory=None, verbose=False, resolve_dependencies=False): + """Show current available heads in the script directory""" + config = current_app.extensions['migrate'].migrate.get_config(directory) + command.heads(config, verbose=verbose, + resolve_dependencies=resolve_dependencies) + + +@MigrateCommand.option('-v', '--verbose', dest='verbose', action='store_true', + default=False, help='Use more verbose output') +@MigrateCommand.option('-d', '--directory', dest='directory', default=None, + help=("Migration script directory (default is " + "'migrations')")) +@catch_errors +def branches(directory=None, verbose=False): + """Show current branch points""" + config = current_app.extensions['migrate'].migrate.get_config(directory) + command.branches(config, verbose=verbose) + + +@MigrateCommand.option('--head-only', dest='head_only', action='store_true', + default=False, + help='Deprecated. Use --verbose for additional output') +@MigrateCommand.option('-v', '--verbose', dest='verbose', action='store_true', + default=False, help='Use more verbose output') +@MigrateCommand.option('-d', '--directory', dest='directory', default=None, + help=("Migration script directory (default is " + "'migrations')")) +@catch_errors +def current(directory=None, verbose=False, head_only=False): + """Display the current revision for each database.""" + config = current_app.extensions['migrate'].migrate.get_config(directory) + command.current(config, verbose=verbose, head_only=head_only) + + +@MigrateCommand.option('--tag', dest='tag', default=None, + help=("Arbitrary 'tag' name - can be used by custom " + "env.py scripts")) +@MigrateCommand.option('--sql', dest='sql', action='store_true', default=False, + help=("Don't emit SQL to database - dump to standard " + "output instead")) +@MigrateCommand.option('revision', default=None, help="revision identifier") +@MigrateCommand.option('-d', '--directory', dest='directory', default=None, + help=("Migration script directory (default is " + "'migrations')")) +@catch_errors +def stamp(directory=None, revision='head', sql=False, tag=None): + """'stamp' the revision table with the given revision; don't run any + migrations""" + config = current_app.extensions['migrate'].migrate.get_config(directory) + command.stamp(config, revision, sql=sql, tag=tag) diff --git a/.venv/lib/python3.8/site-packages/flask_migrate/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_migrate/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..c75644cc Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_migrate/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_migrate/__pycache__/cli.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_migrate/__pycache__/cli.cpython-38.pyc new file mode 100644 index 00000000..6c8b90a5 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_migrate/__pycache__/cli.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_migrate/cli.py b/.venv/lib/python3.8/site-packages/flask_migrate/cli.py new file mode 100644 index 00000000..21c1720b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_migrate/cli.py @@ -0,0 +1,226 @@ +import click +from flask.cli import with_appcontext +from flask_migrate import init as _init +from flask_migrate import revision as _revision +from flask_migrate import migrate as _migrate +from flask_migrate import edit as _edit +from flask_migrate import merge as _merge +from flask_migrate import upgrade as _upgrade +from flask_migrate import downgrade as _downgrade +from flask_migrate import show as _show +from flask_migrate import history as _history +from flask_migrate import heads as _heads +from flask_migrate import branches as _branches +from flask_migrate import current as _current +from flask_migrate import stamp as _stamp + +@click.group() +def db(): + """Perform database migrations.""" + pass + + +@db.command() +@click.option('-d', '--directory', default=None, + help=('Migration script directory (default is "migrations")')) +@click.option('--multidb', is_flag=True, + help=('Support multiple databases')) +@with_appcontext +def init(directory, multidb): + """Creates a new migration repository.""" + _init(directory, multidb) + + +@db.command() +@click.option('-d', '--directory', default=None, + help=('Migration script directory (default is "migrations")')) +@click.option('-m', '--message', default=None, help='Revision message') +@click.option('--autogenerate', is_flag=True, + help=('Populate revision script with candidate migration ' + 'operations, based on comparison of database to model')) +@click.option('--sql', is_flag=True, + help=('Don\'t emit SQL to database - dump to standard output ' + 'instead')) +@click.option('--head', default='head', + help=('Specify head revision or @head to base new ' + 'revision on')) +@click.option('--splice', is_flag=True, + help=('Allow a non-head revision as the "head" to splice onto')) +@click.option('--branch-label', default=None, + help=('Specify a branch label to apply to the new revision')) +@click.option('--version-path', default=None, + help=('Specify specific path from config for version file')) +@click.option('--rev-id', default=None, + help=('Specify a hardcoded revision id instead of generating ' + 'one')) +@with_appcontext +def revision(directory, message, autogenerate, sql, head, splice, branch_label, + version_path, rev_id): + """Create a new revision file.""" + _revision(directory, message, autogenerate, sql, head, splice, + branch_label, version_path, rev_id) + + +@db.command() +@click.option('-d', '--directory', default=None, + help=('Migration script directory (default is "migrations")')) +@click.option('-m', '--message', default=None, help='Revision message') +@click.option('--sql', is_flag=True, + help=('Don\'t emit SQL to database - dump to standard output ' + 'instead')) +@click.option('--head', default='head', + help=('Specify head revision or @head to base new ' + 'revision on')) +@click.option('--splice', is_flag=True, + help=('Allow a non-head revision as the "head" to splice onto')) +@click.option('--branch-label', default=None, + help=('Specify a branch label to apply to the new revision')) +@click.option('--version-path', default=None, + help=('Specify specific path from config for version file')) +@click.option('--rev-id', default=None, + help=('Specify a hardcoded revision id instead of generating ' + 'one')) +@click.option('-x', '--x-arg', multiple=True, + help='Additional arguments consumed by custom env.py scripts') +@with_appcontext +def migrate(directory, message, sql, head, splice, branch_label, version_path, + rev_id, x_arg): + """Autogenerate a new revision file (Alias for 'revision --autogenerate')""" + _migrate(directory, message, sql, head, splice, branch_label, version_path, + rev_id, x_arg) + + +@db.command() +@click.option('-d', '--directory', default=None, + help=('Migration script directory (default is "migrations")')) +@click.argument('revision', default='head') +@with_appcontext +def edit(directory, revision): + """Edit a revision file""" + _edit(directory, revision) + + +@db.command() +@click.option('-d', '--directory', default=None, + help=('Migration script directory (default is "migrations")')) +@click.option('-m', '--message', default=None, help='Merge revision message') +@click.option('--branch-label', default=None, + help=('Specify a branch label to apply to the new revision')) +@click.option('--rev-id', default=None, + help=('Specify a hardcoded revision id instead of generating ' + 'one')) +@click.argument('revisions', nargs=-1) +@with_appcontext +def merge(directory, message, branch_label, rev_id, revisions): + """Merge two revisions together, creating a new revision file""" + _merge(directory, revisions, message, branch_label, rev_id) + + +@db.command() +@click.option('-d', '--directory', default=None, + help=('Migration script directory (default is "migrations")')) +@click.option('--sql', is_flag=True, + help=('Don\'t emit SQL to database - dump to standard output ' + 'instead')) +@click.option('--tag', default=None, + help=('Arbitrary "tag" name - can be used by custom env.py ' + 'scripts')) +@click.option('-x', '--x-arg', multiple=True, + help='Additional arguments consumed by custom env.py scripts') +@click.argument('revision', default='head') +@with_appcontext +def upgrade(directory, sql, tag, x_arg, revision): + """Upgrade to a later version""" + _upgrade(directory, revision, sql, tag, x_arg) + + +@db.command() +@click.option('-d', '--directory', default=None, + help=('Migration script directory (default is "migrations")')) +@click.option('--sql', is_flag=True, + help=('Don\'t emit SQL to database - dump to standard output ' + 'instead')) +@click.option('--tag', default=None, + help=('Arbitrary "tag" name - can be used by custom env.py ' + 'scripts')) +@click.option('-x', '--x-arg', multiple=True, + help='Additional arguments consumed by custom env.py scripts') +@click.argument('revision', default='-1') +@with_appcontext +def downgrade(directory, sql, tag, x_arg, revision): + """Revert to a previous version""" + _downgrade(directory, revision, sql, tag, x_arg) + + +@db.command() +@click.option('-d', '--directory', default=None, + help=('Migration script directory (default is "migrations")')) +@click.argument('revision', default='head') +@with_appcontext +def show(directory, revision): + """Show the revision denoted by the given symbol.""" + _show(directory, revision) + + +@db.command() +@click.option('-d', '--directory', default=None, + help=('Migration script directory (default is "migrations")')) +@click.option('-r', '--rev-range', default=None, + help='Specify a revision range; format is [start]:[end]') +@click.option('-v', '--verbose', is_flag=True, help='Use more verbose output') +@click.option('-i', '--indicate-current', is_flag=True, help='Indicate current version (Alembic 0.9.9 or greater is required)') +@with_appcontext +def history(directory, rev_range, verbose, indicate_current): + """List changeset scripts in chronological order.""" + _history(directory, rev_range, verbose, indicate_current) + + +@db.command() +@click.option('-d', '--directory', default=None, + help=('Migration script directory (default is "migrations")')) +@click.option('-v', '--verbose', is_flag=True, help='Use more verbose output') +@click.option('--resolve-dependencies', is_flag=True, + help='Treat dependency versions as down revisions') +@with_appcontext +def heads(directory, verbose, resolve_dependencies): + """Show current available heads in the script directory""" + _heads(directory, verbose, resolve_dependencies) + + +@db.command() +@click.option('-d', '--directory', default=None, + help=('Migration script directory (default is "migrations")')) +@click.option('-v', '--verbose', is_flag=True, help='Use more verbose output') +@with_appcontext +def branches(directory, verbose): + """Show current branch points""" + _branches(directory, verbose) + + +@db.command() +@click.option('-d', '--directory', default=None, + help=('Migration script directory (default is "migrations")')) +@click.option('-v', '--verbose', is_flag=True, help='Use more verbose output') +@click.option('--head-only', is_flag=True, + help='Deprecated. Use --verbose for additional output') +@with_appcontext +def current(directory, verbose, head_only): + """Display the current revision for each database.""" + _current(directory, verbose, head_only) + + +@db.command() +@click.option('-d', '--directory', default=None, + help=('Migration script directory (default is "migrations")')) +@click.option('--sql', is_flag=True, + help=('Don\'t emit SQL to database - dump to standard output ' + 'instead')) +@click.option('--tag', default=None, + help=('Arbitrary "tag" name - can be used by custom env.py ' + 'scripts')) +@click.argument('revision', default='head') +@with_appcontext +def stamp(directory, sql, tag, revision): + """'stamp' the revision table with the given revision; don't run any + migrations""" + _stamp(directory, revision, sql, tag) diff --git a/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask-multidb/README b/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask-multidb/README new file mode 100644 index 00000000..98e4f9c4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask-multidb/README @@ -0,0 +1 @@ +Generic single-database configuration. \ No newline at end of file diff --git a/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask-multidb/__pycache__/env.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask-multidb/__pycache__/env.cpython-38.pyc new file mode 100644 index 00000000..2e36c82b Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask-multidb/__pycache__/env.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask-multidb/alembic.ini.mako b/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask-multidb/alembic.ini.mako new file mode 100644 index 00000000..f8ed4801 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask-multidb/alembic.ini.mako @@ -0,0 +1,45 @@ +# A generic, single database configuration. + +[alembic] +# template used to generate migration files +# file_template = %%(rev)s_%%(slug)s + +# set to 'true' to run the environment during +# the 'revision' command, regardless of autogenerate +# revision_environment = false + + +# Logging configuration +[loggers] +keys = root,sqlalchemy,alembic + +[handlers] +keys = console + +[formatters] +keys = generic + +[logger_root] +level = WARN +handlers = console +qualname = + +[logger_sqlalchemy] +level = WARN +handlers = +qualname = sqlalchemy.engine + +[logger_alembic] +level = INFO +handlers = +qualname = alembic + +[handler_console] +class = StreamHandler +args = (sys.stderr,) +level = NOTSET +formatter = generic + +[formatter_generic] +format = %(levelname)-5.5s [%(name)s] %(message)s +datefmt = %H:%M:%S diff --git a/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask-multidb/env.py b/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask-multidb/env.py new file mode 100644 index 00000000..c041738d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask-multidb/env.py @@ -0,0 +1,179 @@ +from __future__ import with_statement + +import logging +from logging.config import fileConfig +import re + +from sqlalchemy import engine_from_config +from sqlalchemy import MetaData +from sqlalchemy import pool +from flask import current_app + +from alembic import context + +USE_TWOPHASE = False + +# this is the Alembic Config object, which provides +# access to the values within the .ini file in use. +config = context.config + +# Interpret the config file for Python logging. +# This line sets up loggers basically. +fileConfig(config.config_file_name) +logger = logging.getLogger('alembic.env') + +# add your model's MetaData object here +# for 'autogenerate' support +# from myapp import mymodel +# target_metadata = mymodel.Base.metadata +config.set_main_option( + 'sqlalchemy.url', + str(current_app.extensions['migrate'].db.engine.url).replace('%', '%%')) +bind_names = [] +for bind in current_app.config.get("SQLALCHEMY_BINDS"): + context.config.set_section_option( + bind, "sqlalchemy.url", + str(current_app.extensions['migrate'].db.get_engine( + current_app, bind).url).replace('%', '%%')) + bind_names.append(bind) +target_metadata = current_app.extensions['migrate'].db.metadata + + +# other values from the config, defined by the needs of env.py, +# can be acquired: +# my_important_option = config.get_main_option("my_important_option") +# ... etc. + + +def get_metadata(bind): + """Return the metadata for a bind.""" + if bind == '': + bind = None + m = MetaData() + for t in target_metadata.tables.values(): + if t.info.get('bind_key') == bind: + t.tometadata(m) + return m + + +def run_migrations_offline(): + """Run migrations in 'offline' mode. + + This configures the context with just a URL + and not an Engine, though an Engine is acceptable + here as well. By skipping the Engine creation + we don't even need a DBAPI to be available. + + Calls to context.execute() here emit the given string to the + script output. + + """ + # for the --sql use case, run migrations for each URL into + # individual files. + + engines = { + '': { + 'url': context.config.get_main_option('sqlalchemy.url') + } + } + for name in bind_names: + engines[name] = rec = {} + rec['url'] = context.config.get_section_option(name, "sqlalchemy.url") + + for name, rec in engines.items(): + logger.info("Migrating database %s" % (name or '')) + file_ = "%s.sql" % name + logger.info("Writing output to %s" % file_) + with open(file_, 'w') as buffer: + context.configure( + url=rec['url'], + output_buffer=buffer, + target_metadata=get_metadata(name), + literal_binds=True, + ) + with context.begin_transaction(): + context.run_migrations(engine_name=name) + + +def run_migrations_online(): + """Run migrations in 'online' mode. + + In this scenario we need to create an Engine + and associate a connection with the context. + + """ + + # this callback is used to prevent an auto-migration from being generated + # when there are no changes to the schema + # reference: http://alembic.zzzcomputing.com/en/latest/cookbook.html + def process_revision_directives(context, revision, directives): + if getattr(config.cmd_opts, 'autogenerate', False): + script = directives[0] + if len(script.upgrade_ops_list) >= len(bind_names) + 1: + empty = True + for upgrade_ops in script.upgrade_ops_list: + if not upgrade_ops.is_empty(): + empty = False + if empty: + directives[:] = [] + logger.info('No changes in schema detected.') + + # for the direct-to-DB use case, start a transaction on all + # engines, then run all migrations, then commit all transactions. + engines = { + '': { + 'engine': engine_from_config( + config.get_section(config.config_ini_section), + prefix='sqlalchemy.', + poolclass=pool.NullPool, + ) + } + } + for name in bind_names: + engines[name] = rec = {} + rec['engine'] = engine_from_config( + context.config.get_section(name), + prefix='sqlalchemy.', + poolclass=pool.NullPool) + + for name, rec in engines.items(): + engine = rec['engine'] + rec['connection'] = conn = engine.connect() + + if USE_TWOPHASE: + rec['transaction'] = conn.begin_twophase() + else: + rec['transaction'] = conn.begin() + + try: + for name, rec in engines.items(): + logger.info("Migrating database %s" % (name or '')) + context.configure( + connection=rec['connection'], + upgrade_token="%s_upgrades" % name, + downgrade_token="%s_downgrades" % name, + target_metadata=get_metadata(name), + process_revision_directives=process_revision_directives, + **current_app.extensions['migrate'].configure_args + ) + context.run_migrations(engine_name=name) + + if USE_TWOPHASE: + for rec in engines.values(): + rec['transaction'].prepare() + + for rec in engines.values(): + rec['transaction'].commit() + except: + for rec in engines.values(): + rec['transaction'].rollback() + raise + finally: + for rec in engines.values(): + rec['connection'].close() + + +if context.is_offline_mode(): + run_migrations_offline() +else: + run_migrations_online() diff --git a/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask-multidb/script.py.mako b/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask-multidb/script.py.mako new file mode 100644 index 00000000..eedd2647 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask-multidb/script.py.mako @@ -0,0 +1,46 @@ +<%! +import re + +%>"""${message} + +Revision ID: ${up_revision} +Revises: ${down_revision | comma,n} +Create Date: ${create_date} + +""" +from alembic import op +import sqlalchemy as sa +${imports if imports else ""} + +# revision identifiers, used by Alembic. +revision = ${repr(up_revision)} +down_revision = ${repr(down_revision)} +branch_labels = ${repr(branch_labels)} +depends_on = ${repr(depends_on)} + + +def upgrade(engine_name): + globals()["upgrade_%s" % engine_name]() + + +def downgrade(engine_name): + globals()["downgrade_%s" % engine_name]() + +<% + from flask import current_app + db_names = [''] + list(current_app.config.get("SQLALCHEMY_BINDS").keys()) +%> + +## generate an "upgrade_() / downgrade_()" function +## for each database name in the ini file. + +% for db_name in db_names: + +def upgrade_${db_name}(): + ${context.get("%s_upgrades" % db_name, "pass")} + + +def downgrade_${db_name}(): + ${context.get("%s_downgrades" % db_name, "pass")} + +% endfor diff --git a/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask/README b/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask/README new file mode 100644 index 00000000..98e4f9c4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask/README @@ -0,0 +1 @@ +Generic single-database configuration. \ No newline at end of file diff --git a/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask/__pycache__/env.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask/__pycache__/env.cpython-38.pyc new file mode 100644 index 00000000..3424a657 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask/__pycache__/env.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask/alembic.ini.mako b/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask/alembic.ini.mako new file mode 100644 index 00000000..f8ed4801 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask/alembic.ini.mako @@ -0,0 +1,45 @@ +# A generic, single database configuration. + +[alembic] +# template used to generate migration files +# file_template = %%(rev)s_%%(slug)s + +# set to 'true' to run the environment during +# the 'revision' command, regardless of autogenerate +# revision_environment = false + + +# Logging configuration +[loggers] +keys = root,sqlalchemy,alembic + +[handlers] +keys = console + +[formatters] +keys = generic + +[logger_root] +level = WARN +handlers = console +qualname = + +[logger_sqlalchemy] +level = WARN +handlers = +qualname = sqlalchemy.engine + +[logger_alembic] +level = INFO +handlers = +qualname = alembic + +[handler_console] +class = StreamHandler +args = (sys.stderr,) +level = NOTSET +formatter = generic + +[formatter_generic] +format = %(levelname)-5.5s [%(name)s] %(message)s +datefmt = %H:%M:%S diff --git a/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask/env.py b/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask/env.py new file mode 100644 index 00000000..94521792 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask/env.py @@ -0,0 +1,96 @@ +from __future__ import with_statement + +import logging +from logging.config import fileConfig + +from sqlalchemy import engine_from_config +from sqlalchemy import pool + +from alembic import context + +# this is the Alembic Config object, which provides +# access to the values within the .ini file in use. +config = context.config + +# Interpret the config file for Python logging. +# This line sets up loggers basically. +fileConfig(config.config_file_name) +logger = logging.getLogger('alembic.env') + +# add your model's MetaData object here +# for 'autogenerate' support +# from myapp import mymodel +# target_metadata = mymodel.Base.metadata +from flask import current_app +config.set_main_option( + 'sqlalchemy.url', + str(current_app.extensions['migrate'].db.engine.url).replace('%', '%%')) +target_metadata = current_app.extensions['migrate'].db.metadata + +# other values from the config, defined by the needs of env.py, +# can be acquired: +# my_important_option = config.get_main_option("my_important_option") +# ... etc. + + +def run_migrations_offline(): + """Run migrations in 'offline' mode. + + This configures the context with just a URL + and not an Engine, though an Engine is acceptable + here as well. By skipping the Engine creation + we don't even need a DBAPI to be available. + + Calls to context.execute() here emit the given string to the + script output. + + """ + url = config.get_main_option("sqlalchemy.url") + context.configure( + url=url, target_metadata=target_metadata, literal_binds=True + ) + + with context.begin_transaction(): + context.run_migrations() + + +def run_migrations_online(): + """Run migrations in 'online' mode. + + In this scenario we need to create an Engine + and associate a connection with the context. + + """ + + # this callback is used to prevent an auto-migration from being generated + # when there are no changes to the schema + # reference: http://alembic.zzzcomputing.com/en/latest/cookbook.html + def process_revision_directives(context, revision, directives): + if getattr(config.cmd_opts, 'autogenerate', False): + script = directives[0] + if script.upgrade_ops.is_empty(): + directives[:] = [] + logger.info('No changes in schema detected.') + + connectable = engine_from_config( + config.get_section(config.config_ini_section), + prefix='sqlalchemy.', + poolclass=pool.NullPool, + ) + + with connectable.connect() as connection: + context.configure( + connection=connection, + target_metadata=target_metadata, + process_revision_directives=process_revision_directives, + **current_app.extensions['migrate'].configure_args + ) + + with context.begin_transaction(): + context.run_migrations() + + +if context.is_offline_mode(): + run_migrations_offline() +else: + run_migrations_online() diff --git a/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask/script.py.mako b/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask/script.py.mako new file mode 100644 index 00000000..2c015630 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_migrate/templates/flask/script.py.mako @@ -0,0 +1,24 @@ +"""${message} + +Revision ID: ${up_revision} +Revises: ${down_revision | comma,n} +Create Date: ${create_date} + +""" +from alembic import op +import sqlalchemy as sa +${imports if imports else ""} + +# revision identifiers, used by Alembic. +revision = ${repr(up_revision)} +down_revision = ${repr(down_revision)} +branch_labels = ${repr(branch_labels)} +depends_on = ${repr(depends_on)} + + +def upgrade(): + ${upgrades if upgrades else "pass"} + + +def downgrade(): + ${downgrades if downgrades else "pass"} diff --git a/.venv/lib/python3.8/site-packages/flask_oso-0.1.0.dist-info/INSTALLER b/.venv/lib/python3.8/site-packages/flask_oso-0.1.0.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_oso-0.1.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/lib/python3.8/site-packages/flask_oso-0.1.0.dist-info/METADATA b/.venv/lib/python3.8/site-packages/flask_oso-0.1.0.dist-info/METADATA new file mode 100644 index 00000000..6e29cb73 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_oso-0.1.0.dist-info/METADATA @@ -0,0 +1,20 @@ +Metadata-Version: 2.1 +Name: flask-oso +Version: 0.1.0 +Summary: oso flask integration +Home-page: UNKNOWN +Author: Oso Security, Inc. +License: UNKNOWN +Platform: UNKNOWN +Classifier: Development Status :: 4 - Beta +Classifier: Programming Language :: Python :: 3.6 +Classifier: License :: OSI Approved :: Apache Software License +Requires-Python: >=3.6 +Description-Content-Type: text/markdown +Requires-Dist: oso (~=0.4.0) +Requires-Dist: flask (>=0.12.0) + +flask-oso +========= + + diff --git a/.venv/lib/python3.8/site-packages/flask_oso-0.1.0.dist-info/RECORD b/.venv/lib/python3.8/site-packages/flask_oso-0.1.0.dist-info/RECORD new file mode 100644 index 00000000..3762e231 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_oso-0.1.0.dist-info/RECORD @@ -0,0 +1,14 @@ +flask_oso-0.1.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +flask_oso-0.1.0.dist-info/METADATA,sha256=APdcv14-22WIz_CHUnTXKVqqszLwfptoT-bomyjbFrg,468 +flask_oso-0.1.0.dist-info/RECORD,, +flask_oso-0.1.0.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92 +flask_oso-0.1.0.dist-info/entry_points.txt,sha256=eqGnTHtEVMYwfXVk1Z9MhC8O2N8wuqAbr0lisLmrkxs,20 +flask_oso-0.1.0.dist-info/top_level.txt,sha256=S2ekmZjqhvj4Rp-VZWPAkC2pzwewrR-4ZO1mlcTV-aM,10 +flask_oso/__init__.py,sha256=8yjXcaaBVZsGKY76UR7GcadaBlJXUXCGSD6iIgkTpdE,168 +flask_oso/__pycache__/__init__.cpython-38.pyc,, +flask_oso/__pycache__/context.cpython-38.pyc,, +flask_oso/__pycache__/decorators.cpython-38.pyc,, +flask_oso/__pycache__/flask_oso.cpython-38.pyc,, +flask_oso/context.py,sha256=DWtq1n9wJC9rmDLmcuj6x7jvDkjVmPjEjBn19jqRX_Y,832 +flask_oso/decorators.py,sha256=JhYRbPrBygcs7DRgdZKap4N5BZdIsHQrjGCaeTOCQpQ,1612 +flask_oso/flask_oso.py,sha256=rFkMtA70UP_fO_69H3gbFDHWDTV-4sNbwZfVgsV4MEI,8047 diff --git a/.venv/lib/python3.8/site-packages/flask_oso-0.1.0.dist-info/WHEEL b/.venv/lib/python3.8/site-packages/flask_oso-0.1.0.dist-info/WHEEL new file mode 100644 index 00000000..b552003f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_oso-0.1.0.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.34.2) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/.venv/lib/python3.8/site-packages/flask_oso-0.1.0.dist-info/entry_points.txt b/.venv/lib/python3.8/site-packages/flask_oso-0.1.0.dist-info/entry_points.txt new file mode 100644 index 00000000..3e1605ad --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_oso-0.1.0.dist-info/entry_points.txt @@ -0,0 +1,3 @@ +[console_scripts] + + diff --git a/.venv/lib/python3.8/site-packages/flask_oso-0.1.0.dist-info/top_level.txt b/.venv/lib/python3.8/site-packages/flask_oso-0.1.0.dist-info/top_level.txt new file mode 100644 index 00000000..7b390839 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_oso-0.1.0.dist-info/top_level.txt @@ -0,0 +1 @@ +flask_oso diff --git a/.venv/lib/python3.8/site-packages/flask_oso/__init__.py b/.venv/lib/python3.8/site-packages/flask_oso/__init__.py new file mode 100644 index 00000000..7d4a26ab --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_oso/__init__.py @@ -0,0 +1,6 @@ +__version__ = "0.1.0" + +from .flask_oso import FlaskOso +from .decorators import authorize, skip_authorization + +__all__ = ["FlaskOso", "authorize", "skip_authorization"] diff --git a/.venv/lib/python3.8/site-packages/flask_oso/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_oso/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..2cad058b Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_oso/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_oso/__pycache__/context.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_oso/__pycache__/context.cpython-38.pyc new file mode 100644 index 00000000..bcac32c6 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_oso/__pycache__/context.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_oso/__pycache__/decorators.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_oso/__pycache__/decorators.cpython-38.pyc new file mode 100644 index 00000000..47c190a0 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_oso/__pycache__/decorators.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_oso/__pycache__/flask_oso.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_oso/__pycache__/flask_oso.cpython-38.pyc new file mode 100644 index 00000000..e1160174 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_oso/__pycache__/flask_oso.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_oso/context.py b/.venv/lib/python3.8/site-packages/flask_oso/context.py new file mode 100644 index 00000000..5fa4ebec --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_oso/context.py @@ -0,0 +1,27 @@ +"""Storage of oso information on app context.""" +from flask import _app_ctx_stack + +from oso import OsoException + + +def _app_context(): + """Get the app context. Use this instead of direct access to raise an appropriate error""" + top = _app_ctx_stack.top + if top is None: + raise OsoException( + "Application context doesn't exist. Did you use oso outside the context of a request? " + "See https://flask.palletsprojects.com/en/1.1.x/appcontext/#manually-push-a-context" + ) + + return top + + +def _app_oso(): + """Get the flask oso plugin for the current app instance.""" + try: + return _app_context().oso_flask_oso + except AttributeError: + raise OsoException( + "No oso instance on current application. " + "Did you forget to call init_app?" + ) diff --git a/.venv/lib/python3.8/site-packages/flask_oso/decorators.py b/.venv/lib/python3.8/site-packages/flask_oso/decorators.py new file mode 100644 index 00000000..24a03418 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_oso/decorators.py @@ -0,0 +1,60 @@ +import functools + +from flask import g, current_app, request, Request + +from .context import _app_oso + + +def authorize(func=None, resource=None, actor=None, action=None): + """Flask route decorator. Calls :py:meth:`FlaskOso.authorize` before the route. + + Parameters are the same as :py:meth:`FlaskOso.authorize`. + + .. warning:: + + This decorator must come **after** the ``route`` decorator as shown below, otherwise authorization will not be + checked. + + + For example:: + + @app.route("/") + @authorize(resource=flask.request) + def route(): + return "authorized" + """ + if func is not None: + + @functools.wraps(func) + def wrap(*args, **kwargs): + oso = _app_oso() + + oso.authorize(actor=actor, action=action, resource=resource) + return func(*args, **kwargs) + + return wrap + + return functools.partial(authorize, actor=actor, action=action, resource=resource) + + +def skip_authorization(func=None, reason=None): + """Decorator to mark route as not requiring authorization. + + .. warning:: + + This decorator must come after the ``route`` decorator. + + Causes use in conjunction with :py:meth:`FlaskOso.require_authorization` to + silence errors on routes that do not need to be authorized. + """ + if func is not None: + + @functools.wraps(func) + def wrap(*args, **kwargs): + oso = _app_oso() + oso.skip_authorization(reason=reason) + return func(*args, **kwargs) + + return wrap + + return functools.partial(skip_authorization, reason=reason) diff --git a/.venv/lib/python3.8/site-packages/flask_oso/flask_oso.py b/.venv/lib/python3.8/site-packages/flask_oso/flask_oso.py new file mode 100644 index 00000000..ad98cdbf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_oso/flask_oso.py @@ -0,0 +1,235 @@ +from flask import g, current_app, request, Request +from werkzeug.exceptions import Forbidden + +from oso import OsoException, Oso + +from .context import _app_context + + +class FlaskOso: + """oso flask plugin + + This plugin must be initialized with a flask app, either using the + ``app`` parameter in the constructor, or by calling :py:meth:`init_app` after + construction. + + The plugin must be initialized with an :py:class:`oso.Oso` instance before + use, either by passing one to the constructor or calling + :py:meth:`set_oso`. + + **Authorization** + + - :py:meth:`FlaskOso.authorize`: Check whether an actor, action and resource is + authorized. Integrates with flask to provide defaults for actor & action. + + **Configuration** + + - :py:meth:`require_authorization`: Require at least one + :py:meth:`FlaskOso.authorize` call for every request. + - :py:meth:`set_get_actor`: Override how oso determines the actor + associated with a request if none is provided to :py:meth:`FlaskOso.authorize`. + - :py:meth:`set_unauthorized_action`: Control how :py:meth:`FlaskOso.authorize` + handles an unauthorized request. + - :py:meth:`perform_route_authorization`: + Call `authorize(resource=flask.request)` before every request. + """ + + def __init__(self, oso=None, app=None): + self._app = app + self._oso = None + + def unauthorized(): + raise Forbidden("Unauthorized") + + self._unauthorized_action = unauthorized + + # TODO (dhatch): A few defaults for this dependending on what + # other frameworks are in use. + self._get_actor = lambda: g.current_user + + if self._app is not None: + self.init_app(self._app) + + if oso is not None: + self.set_oso(oso) + + # TODO config parameters + + ## Initialization + + def set_oso(self, oso): + """Set the oso instance to use for authorization + + Must be called if ``oso`` is not provided to the constructor. + """ + if oso == self._oso: + return + + self._oso = oso + self._oso.register_class(Request) + + def init_app(self, app): + """Initialize ``app`` for use with this instance of ``FlaskOso``. + + Must be called if ``app`` isn't provided to the constructor. + """ + app.teardown_appcontext(self.teardown) + app.before_request(self._provide_oso) + + def set_get_actor(self, func): + """Provide a function that oso will use to get the current actor. + + :param func: A function to call with no parameters to get the actor if + it is not provided to :py:meth:`FlaskOso.authorize`. The return value + is used as the actor. + """ + self._get_actor = func + + def set_unauthorized_action(self, func): + """Set a function that will be called to handle an authorization failure. + + The default behavior is to raise a Forbidden exception, returning a 403 + response. + + :param func: A function to call with no parameters when a request is + not authorized. + """ + self._unauthorized_action = func + + ## Middleware-like functions that affect every request. + + def require_authorization(self, app=None): + """Enforce authorization on every request to ``app``. + + :param app: The app to require authorization for. Can be omitted if + the ``app`` parameter was used in the ``FlaskOso`` + constructor. + + If :py:meth:`FlaskOso.authorize` is not called during the request processing, + raises an :py:class:`oso.OsoException`. + + Call :py:meth:`FlaskOso.skip_authorization` to skip this check for a particular + request. + """ + if app is None: + app = self.app + + app.after_request(self._require_authorization) + + def perform_route_authorization(self, app=None): + """Perform route authorization before every request. + + Route authorization will call :py:meth:`oso.Oso.is_allowed` with the + current request (from ``flask.request``) as the resource and the method + (from ``flask.request.method``) as the action. + + :param app: The app to require authorization for. Can be omitted if + the ``app`` parameter was used in the ``FlaskOso`` + constructor. + """ + if app is None: + app = self.app + + app.before_request(self._perform_route_authorization) + + ## During request decorator or functions. + + def skip_authorization(self, reason=None): + """Opt-out of authorization for the current request. + + Will prevent ``require_authorization`` from causing an error. + + See also: :py:func:`flask_oso.skip_authorization` for a route decorator version. + """ + _authorize_called() + + def authorize(self, resource, *, actor=None, action=None): + """Check whether the current request should be allowed. + + Calls :py:meth:`oso.Oso.is_allowed` to check authorization. If a request + is unauthorized, raises a ``werkzeug.exceptions.Forbidden`` + exception. This behavior can be controlled with + :py:meth:`set_unauthorized_action`. + + :param actor: The actor to authorize. Defaults to ``flask.g.current_user``. + Use :py:meth:`set_get_actor` to override. + :param action: The action to authorize. Defaults to + ``flask.request.method``. + :param resource: The resource to authorize. The flask request object + (``flask.request``) can be passed to authorize a + request based on route path or other request properties. + + See also: :py:func:`flask_oso.authorize` for a route decorator version. + """ + if actor is None: + try: + actor = self.current_actor + except AttributeError as e: + raise OsoException( + "Getting the current actor failed. " + "You may need to override the current actor function with " + "FlaskOso#set_get_actor" + ) from e + + if action is None: + action = request.method + + # TODO (dhatch): Broader resource mapping functionality? + # Special handling for flask request as a resource. + # We use *is* here because == would actually need to get the request object. + # We want to check that the resource is the proxy. + if resource is request: + resource = request._get_current_object() + + allowed = self.oso.is_allowed(actor, action, resource) + _authorize_called() + + if not allowed: + self._unauthorized_action() + + @property + def app(self): + return self._app or current_app + + @property + def oso(self): + return self._oso + + @property + def current_actor(self): + return self._get_actor() + + ## Before / after + def _provide_oso(self): + top = _app_context() + if not hasattr(top, "oso_flask_oso"): + top.oso_flask_oso = self + + def _perform_route_authorization(self): + if not request.url_rule: + # If request isn't going to match any route, just return and + # let flask handle it the normal way. + return + + self.authorize(resource=request) + + def _require_authorization(self, response): + if not request.url_rule: + # No rule matched this request + # Skip requiring authorization. + # NOTE: (dhatch) Confirm this is a safe behavior, think through edge + # cases. + return response + + if not getattr(_app_context(), "oso_flask_authorize_called", False): + raise OsoException("Authorize not called.") + + return response + + def teardown(self, exception): + pass + + +def _authorize_called(): + """Mark current request as authorized.""" + _app_context().oso_flask_authorize_called = True diff --git a/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/INSTALLER b/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/LICENSE b/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/LICENSE new file mode 100644 index 00000000..472d077e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Andrew Grigorev + +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: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +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. diff --git a/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/METADATA b/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/METADATA new file mode 100644 index 00000000..3e82b0c1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/METADATA @@ -0,0 +1,44 @@ +Metadata-Version: 2.1 +Name: flask-shell-ipython +Version: 0.4.1 +Summary: Replace default `flask shell` command by similar command running IPython. +Home-page: http://github.com/ei-grad/flask-shell-ipython +Author: Andrew Grigorev +Author-email: andrew@ei-grad.ru +License: UNKNOWN +Platform: UNKNOWN +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Console +Classifier: Framework :: Flask +Classifier: Framework :: IPython +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 3 +Description-Content-Type: text/markdown +Requires-Dist: flask (>=1.0) +Requires-Dist: click +Requires-Dist: IPython (>=5.0.0) + +# flask-shell-ipython + +Replace default `flask shell` command by similar command running IPython. + +## Usage + +Just install: + + pip install flask-shell-ipython + +And here are you go: + + > flask shell + Python 3.5.1 (default, Mar 3 2016, 09:29:07) + [GCC 5.3.0] on linux + IPython: 5.0.0 + App: discharges [debug] + Instance: /home/ei-grad/repos/discharges/instance + + In [1]: + + diff --git a/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/RECORD b/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/RECORD new file mode 100644 index 00000000..de2be0cd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/RECORD @@ -0,0 +1,9 @@ +__pycache__/flask_shell_ipython.cpython-38.pyc,, +flask_shell_ipython-0.4.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +flask_shell_ipython-0.4.1.dist-info/LICENSE,sha256=bBdl7DU5ZiW08ZpBUBz0XxSshHWQx50rVj0bbpooxL0,1082 +flask_shell_ipython-0.4.1.dist-info/METADATA,sha256=Zs3yRkbH8NtkUGT7Ke1In5Rr_Q-7HopuEq5xQMw34Fc,1155 +flask_shell_ipython-0.4.1.dist-info/RECORD,, +flask_shell_ipython-0.4.1.dist-info/WHEEL,sha256=HX-v9-noUkyUoxyZ1PMSuS7auUxDAR4VBdoYLqD0xws,110 +flask_shell_ipython-0.4.1.dist-info/entry_points.txt,sha256=8h8GbOfMDya_Sk4UykNNgp8znwz300wQ9cGVqPdsiA8,52 +flask_shell_ipython-0.4.1.dist-info/top_level.txt,sha256=grJncmrmzVFfo3_J1zt2t3LQakZdH5YB-H3cWVCDLFc,20 +flask_shell_ipython.py,sha256=iIBCZbPsHWJgDrr3WRw-HsKM2mTvWagm1nCmjHVGd8I,1376 diff --git a/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/WHEEL b/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/WHEEL new file mode 100644 index 00000000..c8240f03 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.33.1) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/entry_points.txt b/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/entry_points.txt new file mode 100644 index 00000000..b9ee1232 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/entry_points.txt @@ -0,0 +1,3 @@ +[flask.commands] +shell = flask_shell_ipython:shell + diff --git a/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/top_level.txt b/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/top_level.txt new file mode 100644 index 00000000..53894491 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_shell_ipython-0.4.1.dist-info/top_level.txt @@ -0,0 +1 @@ +flask_shell_ipython diff --git a/.venv/lib/python3.8/site-packages/flask_shell_ipython.py b/.venv/lib/python3.8/site-packages/flask_shell_ipython.py new file mode 100644 index 00000000..4ed10f14 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_shell_ipython.py @@ -0,0 +1,45 @@ +import sys + +import click +from flask.cli import with_appcontext + + +@click.command(context_settings=dict(ignore_unknown_options=True)) +@click.argument('ipython_args', nargs=-1, type=click.UNPROCESSED) +@with_appcontext +def shell(ipython_args): + """Runs a shell in the app context. + + Runs an interactive Python shell in the context of a given + Flask application. The application will populate the default + namespace of this shell according to it's configuration. + This is useful for executing small snippets of management code + without having to manually configuring the application. + """ + import IPython + from IPython.terminal.ipapp import load_default_config + from traitlets.config.loader import Config + from flask.globals import _app_ctx_stack + + app = _app_ctx_stack.top.app + + if 'IPYTHON_CONFIG' in app.config: + config = Config(app.config['IPYTHON_CONFIG']) + else: + config = load_default_config() + + config.TerminalInteractiveShell.banner1 = '''Python %s on %s +IPython: %s +App: %s [%s] +Instance: %s''' % (sys.version, + sys.platform, + IPython.__version__, + app.import_name, + app.env, + app.instance_path) + + IPython.start_ipython( + argv=ipython_args, + user_ns=app.make_shell_context(), + config=config, + ) diff --git a/.venv/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py b/.venv/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py new file mode 100644 index 00000000..994266b2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py @@ -0,0 +1,1077 @@ +# -*- coding: utf-8 -*- +from __future__ import absolute_import + +import functools +import os +import sys +import time +import warnings +from math import ceil +from operator import itemgetter +from threading import Lock + +import sqlalchemy +from flask import _app_ctx_stack, abort, current_app, request +from flask.signals import Namespace +from sqlalchemy import event, inspect, orm +from sqlalchemy.engine.url import make_url +from sqlalchemy.ext.declarative import DeclarativeMeta, declarative_base +from sqlalchemy.orm.exc import UnmappedClassError +from sqlalchemy.orm.session import Session as SessionBase + +from flask_sqlalchemy.model import Model +from ._compat import itervalues, string_types, xrange +from .model import DefaultMeta +from . import utils + +__version__ = "2.4.3" + +# the best timer function for the platform +if sys.platform == 'win32': + if sys.version_info >= (3, 3): + _timer = time.perf_counter + else: + _timer = time.clock +else: + _timer = time.time + +_signals = Namespace() +models_committed = _signals.signal('models-committed') +before_models_committed = _signals.signal('before-models-committed') + + +def _make_table(db): + def _make_table(*args, **kwargs): + if len(args) > 1 and isinstance(args[1], db.Column): + args = (args[0], db.metadata) + args[1:] + info = kwargs.pop('info', None) or {} + info.setdefault('bind_key', None) + kwargs['info'] = info + return sqlalchemy.Table(*args, **kwargs) + return _make_table + + +def _set_default_query_class(d, cls): + if 'query_class' not in d: + d['query_class'] = cls + + +def _wrap_with_default_query_class(fn, cls): + @functools.wraps(fn) + def newfn(*args, **kwargs): + _set_default_query_class(kwargs, cls) + if "backref" in kwargs: + backref = kwargs['backref'] + if isinstance(backref, string_types): + backref = (backref, {}) + _set_default_query_class(backref[1], cls) + return fn(*args, **kwargs) + return newfn + + +def _include_sqlalchemy(obj, cls): + for module in sqlalchemy, sqlalchemy.orm: + for key in module.__all__: + if not hasattr(obj, key): + setattr(obj, key, getattr(module, key)) + # Note: obj.Table does not attempt to be a SQLAlchemy Table class. + obj.Table = _make_table(obj) + obj.relationship = _wrap_with_default_query_class(obj.relationship, cls) + obj.relation = _wrap_with_default_query_class(obj.relation, cls) + obj.dynamic_loader = _wrap_with_default_query_class(obj.dynamic_loader, cls) + obj.event = event + + +class _DebugQueryTuple(tuple): + statement = property(itemgetter(0)) + parameters = property(itemgetter(1)) + start_time = property(itemgetter(2)) + end_time = property(itemgetter(3)) + context = property(itemgetter(4)) + + @property + def duration(self): + return self.end_time - self.start_time + + def __repr__(self): + return '' % ( + self.statement, + self.parameters, + self.duration + ) + + +def _calling_context(app_path): + frm = sys._getframe(1) + while frm.f_back is not None: + name = frm.f_globals.get('__name__') + if name and (name == app_path or name.startswith(app_path + '.')): + funcname = frm.f_code.co_name + return '%s:%s (%s)' % ( + frm.f_code.co_filename, + frm.f_lineno, + funcname + ) + frm = frm.f_back + return '' + + +class SignallingSession(SessionBase): + """The signalling session is the default session that Flask-SQLAlchemy + uses. It extends the default session system with bind selection and + modification tracking. + + If you want to use a different session you can override the + :meth:`SQLAlchemy.create_session` function. + + .. versionadded:: 2.0 + + .. versionadded:: 2.1 + The `binds` option was added, which allows a session to be joined + to an external transaction. + """ + + def __init__(self, db, autocommit=False, autoflush=True, **options): + #: The application that this session belongs to. + self.app = app = db.get_app() + track_modifications = app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] + bind = options.pop('bind', None) or db.engine + binds = options.pop('binds', db.get_binds(app)) + + if track_modifications is None or track_modifications: + _SessionSignalEvents.register(self) + + SessionBase.__init__( + self, autocommit=autocommit, autoflush=autoflush, + bind=bind, binds=binds, **options + ) + + def get_bind(self, mapper=None, clause=None): + """Return the engine or connection for a given model or + table, using the ``__bind_key__`` if it is set. + """ + # mapper is None if someone tries to just get a connection + if mapper is not None: + try: + # SA >= 1.3 + persist_selectable = mapper.persist_selectable + except AttributeError: + # SA < 1.3 + persist_selectable = mapper.mapped_table + + info = getattr(persist_selectable, 'info', {}) + bind_key = info.get('bind_key') + if bind_key is not None: + state = get_state(self.app) + return state.db.get_engine(self.app, bind=bind_key) + return SessionBase.get_bind(self, mapper, clause) + + +class _SessionSignalEvents(object): + @classmethod + def register(cls, session): + if not hasattr(session, '_model_changes'): + session._model_changes = {} + + event.listen(session, 'before_flush', cls.record_ops) + event.listen(session, 'before_commit', cls.record_ops) + event.listen(session, 'before_commit', cls.before_commit) + event.listen(session, 'after_commit', cls.after_commit) + event.listen(session, 'after_rollback', cls.after_rollback) + + @classmethod + def unregister(cls, session): + if hasattr(session, '_model_changes'): + del session._model_changes + + event.remove(session, 'before_flush', cls.record_ops) + event.remove(session, 'before_commit', cls.record_ops) + event.remove(session, 'before_commit', cls.before_commit) + event.remove(session, 'after_commit', cls.after_commit) + event.remove(session, 'after_rollback', cls.after_rollback) + + @staticmethod + def record_ops(session, flush_context=None, instances=None): + try: + d = session._model_changes + except AttributeError: + return + + for targets, operation in ((session.new, 'insert'), (session.dirty, 'update'), (session.deleted, 'delete')): + for target in targets: + state = inspect(target) + key = state.identity_key if state.has_identity else id(target) + d[key] = (target, operation) + + @staticmethod + def before_commit(session): + try: + d = session._model_changes + except AttributeError: + return + + if d: + before_models_committed.send(session.app, changes=list(d.values())) + + @staticmethod + def after_commit(session): + try: + d = session._model_changes + except AttributeError: + return + + if d: + models_committed.send(session.app, changes=list(d.values())) + d.clear() + + @staticmethod + def after_rollback(session): + try: + d = session._model_changes + except AttributeError: + return + + d.clear() + + +class _EngineDebuggingSignalEvents(object): + """Sets up handlers for two events that let us track the execution time of + queries.""" + + def __init__(self, engine, import_name): + self.engine = engine + self.app_package = import_name + + def register(self): + event.listen( + self.engine, 'before_cursor_execute', self.before_cursor_execute + ) + event.listen( + self.engine, 'after_cursor_execute', self.after_cursor_execute + ) + + def before_cursor_execute( + self, conn, cursor, statement, parameters, context, executemany + ): + if current_app: + context._query_start_time = _timer() + + def after_cursor_execute( + self, conn, cursor, statement, parameters, context, executemany + ): + if current_app: + try: + queries = _app_ctx_stack.top.sqlalchemy_queries + except AttributeError: + queries = _app_ctx_stack.top.sqlalchemy_queries = [] + + queries.append(_DebugQueryTuple(( + statement, parameters, context._query_start_time, _timer(), + _calling_context(self.app_package) + ))) + + +def get_debug_queries(): + """In debug mode Flask-SQLAlchemy will log all the SQL queries sent + to the database. This information is available until the end of request + which makes it possible to easily ensure that the SQL generated is the + one expected on errors or in unittesting. If you don't want to enable + the DEBUG mode for your unittests you can also enable the query + recording by setting the ``'SQLALCHEMY_RECORD_QUERIES'`` config variable + to `True`. This is automatically enabled if Flask is in testing mode. + + The value returned will be a list of named tuples with the following + attributes: + + `statement` + The SQL statement issued + + `parameters` + The parameters for the SQL statement + + `start_time` / `end_time` + Time the query started / the results arrived. Please keep in mind + that the timer function used depends on your platform. These + values are only useful for sorting or comparing. They do not + necessarily represent an absolute timestamp. + + `duration` + Time the query took in seconds + + `context` + A string giving a rough estimation of where in your application + query was issued. The exact format is undefined so don't try + to reconstruct filename or function name. + """ + return getattr(_app_ctx_stack.top, 'sqlalchemy_queries', []) + + +class Pagination(object): + """Internal helper class returned by :meth:`BaseQuery.paginate`. You + can also construct it from any other SQLAlchemy query object if you are + working with other libraries. Additionally it is possible to pass `None` + as query object in which case the :meth:`prev` and :meth:`next` will + no longer work. + """ + + def __init__(self, query, page, per_page, total, items): + #: the unlimited query object that was used to create this + #: pagination object. + self.query = query + #: the current page number (1 indexed) + self.page = page + #: the number of items to be displayed on a page. + self.per_page = per_page + #: the total number of items matching the query + self.total = total + #: the items for the current page + self.items = items + + @property + def pages(self): + """The total number of pages""" + if self.per_page == 0: + pages = 0 + else: + pages = int(ceil(self.total / float(self.per_page))) + return pages + + def prev(self, error_out=False): + """Returns a :class:`Pagination` object for the previous page.""" + assert self.query is not None, 'a query object is required ' \ + 'for this method to work' + return self.query.paginate(self.page - 1, self.per_page, error_out) + + @property + def prev_num(self): + """Number of the previous page.""" + if not self.has_prev: + return None + return self.page - 1 + + @property + def has_prev(self): + """True if a previous page exists""" + return self.page > 1 + + def next(self, error_out=False): + """Returns a :class:`Pagination` object for the next page.""" + assert self.query is not None, 'a query object is required ' \ + 'for this method to work' + return self.query.paginate(self.page + 1, self.per_page, error_out) + + @property + def has_next(self): + """True if a next page exists.""" + return self.page < self.pages + + @property + def next_num(self): + """Number of the next page""" + if not self.has_next: + return None + return self.page + 1 + + def iter_pages(self, left_edge=2, left_current=2, + right_current=5, right_edge=2): + """Iterates over the page numbers in the pagination. The four + parameters control the thresholds how many numbers should be produced + from the sides. Skipped page numbers are represented as `None`. + This is how you could render such a pagination in the templates: + + .. sourcecode:: html+jinja + + {% macro render_pagination(pagination, endpoint) %} + + {% endmacro %} + """ + last = 0 + for num in xrange(1, self.pages + 1): + if num <= left_edge or \ + (num > self.page - left_current - 1 and + num < self.page + right_current) or \ + num > self.pages - right_edge: + if last + 1 != num: + yield None + yield num + last = num + + +class BaseQuery(orm.Query): + """SQLAlchemy :class:`~sqlalchemy.orm.query.Query` subclass with convenience methods for querying in a web application. + + This is the default :attr:`~Model.query` object used for models, and exposed as :attr:`~SQLAlchemy.Query`. + Override the query class for an individual model by subclassing this and setting :attr:`~Model.query_class`. + """ + + def get_or_404(self, ident, description=None): + """Like :meth:`get` but aborts with 404 if not found instead of returning ``None``.""" + + rv = self.get(ident) + if rv is None: + abort(404, description=description) + return rv + + def first_or_404(self, description=None): + """Like :meth:`first` but aborts with 404 if not found instead of returning ``None``.""" + + rv = self.first() + if rv is None: + abort(404, description=description) + return rv + + def paginate(self, page=None, per_page=None, error_out=True, max_per_page=None): + """Returns ``per_page`` items from page ``page``. + + If ``page`` or ``per_page`` are ``None``, they will be retrieved from + the request query. If ``max_per_page`` is specified, ``per_page`` will + be limited to that value. If there is no request or they aren't in the + query, they default to 1 and 20 respectively. + + When ``error_out`` is ``True`` (default), the following rules will + cause a 404 response: + + * No items are found and ``page`` is not 1. + * ``page`` is less than 1, or ``per_page`` is negative. + * ``page`` or ``per_page`` are not ints. + + When ``error_out`` is ``False``, ``page`` and ``per_page`` default to + 1 and 20 respectively. + + Returns a :class:`Pagination` object. + """ + + if request: + if page is None: + try: + page = int(request.args.get('page', 1)) + except (TypeError, ValueError): + if error_out: + abort(404) + + page = 1 + + if per_page is None: + try: + per_page = int(request.args.get('per_page', 20)) + except (TypeError, ValueError): + if error_out: + abort(404) + + per_page = 20 + else: + if page is None: + page = 1 + + if per_page is None: + per_page = 20 + + if max_per_page is not None: + per_page = min(per_page, max_per_page) + + if page < 1: + if error_out: + abort(404) + else: + page = 1 + + if per_page < 0: + if error_out: + abort(404) + else: + per_page = 20 + + items = self.limit(per_page).offset((page - 1) * per_page).all() + + if not items and page != 1 and error_out: + abort(404) + + total = self.order_by(None).count() + + return Pagination(self, page, per_page, total, items) + + +class _QueryProperty(object): + def __init__(self, sa): + self.sa = sa + + def __get__(self, obj, type): + try: + mapper = orm.class_mapper(type) + if mapper: + return type.query_class(mapper, session=self.sa.session()) + except UnmappedClassError: + return None + + +def _record_queries(app): + if app.debug: + return True + rq = app.config['SQLALCHEMY_RECORD_QUERIES'] + if rq is not None: + return rq + return bool(app.config.get('TESTING')) + + +class _EngineConnector(object): + + def __init__(self, sa, app, bind=None): + self._sa = sa + self._app = app + self._engine = None + self._connected_for = None + self._bind = bind + self._lock = Lock() + + def get_uri(self): + if self._bind is None: + return self._app.config['SQLALCHEMY_DATABASE_URI'] + binds = self._app.config.get('SQLALCHEMY_BINDS') or () + assert self._bind in binds, \ + 'Bind %r is not specified. Set it in the SQLALCHEMY_BINDS ' \ + 'configuration variable' % self._bind + return binds[self._bind] + + def get_engine(self): + with self._lock: + uri = self.get_uri() + echo = self._app.config['SQLALCHEMY_ECHO'] + if (uri, echo) == self._connected_for: + return self._engine + + sa_url = make_url(uri) + options = self.get_options(sa_url, echo) + self._engine = rv = self._sa.create_engine(sa_url, options) + + if _record_queries(self._app): + _EngineDebuggingSignalEvents(self._engine, + self._app.import_name).register() + + self._connected_for = (uri, echo) + + return rv + + def get_options(self, sa_url, echo): + options = {} + + self._sa.apply_pool_defaults(self._app, options) + self._sa.apply_driver_hacks(self._app, sa_url, options) + if echo: + options['echo'] = echo + + # Give the config options set by a developer explicitly priority + # over decisions FSA makes. + options.update(self._app.config['SQLALCHEMY_ENGINE_OPTIONS']) + + # Give options set in SQLAlchemy.__init__() ultimate priority + options.update(self._sa._engine_options) + + return options + + +def get_state(app): + """Gets the state for the application""" + assert 'sqlalchemy' in app.extensions, \ + 'The sqlalchemy extension was not registered to the current ' \ + 'application. Please make sure to call init_app() first.' + return app.extensions['sqlalchemy'] + + +class _SQLAlchemyState(object): + """Remembers configuration for the (db, app) tuple.""" + + def __init__(self, db): + self.db = db + self.connectors = {} + + +class SQLAlchemy(object): + """This class is used to control the SQLAlchemy integration to one + or more Flask applications. Depending on how you initialize the + object it is usable right away or will attach as needed to a + Flask application. + + There are two usage modes which work very similarly. One is binding + the instance to a very specific Flask application:: + + app = Flask(__name__) + db = SQLAlchemy(app) + + The second possibility is to create the object once and configure the + application later to support it:: + + db = SQLAlchemy() + + def create_app(): + app = Flask(__name__) + db.init_app(app) + return app + + The difference between the two is that in the first case methods like + :meth:`create_all` and :meth:`drop_all` will work all the time but in + the second case a :meth:`flask.Flask.app_context` has to exist. + + By default Flask-SQLAlchemy will apply some backend-specific settings + to improve your experience with them. + + As of SQLAlchemy 0.6 SQLAlchemy + will probe the library for native unicode support. If it detects + unicode it will let the library handle that, otherwise do that itself. + Sometimes this detection can fail in which case you might want to set + ``use_native_unicode`` (or the ``SQLALCHEMY_NATIVE_UNICODE`` configuration + key) to ``False``. Note that the configuration key overrides the + value you pass to the constructor. Direct support for ``use_native_unicode`` + and SQLALCHEMY_NATIVE_UNICODE are deprecated as of v2.4 and will be removed + in v3.0. ``engine_options`` and ``SQLALCHEMY_ENGINE_OPTIONS`` may be used + instead. + + This class also provides access to all the SQLAlchemy functions and classes + from the :mod:`sqlalchemy` and :mod:`sqlalchemy.orm` modules. So you can + declare models like this:: + + class User(db.Model): + username = db.Column(db.String(80), unique=True) + pw_hash = db.Column(db.String(80)) + + You can still use :mod:`sqlalchemy` and :mod:`sqlalchemy.orm` directly, but + note that Flask-SQLAlchemy customizations are available only through an + instance of this :class:`SQLAlchemy` class. Query classes default to + :class:`BaseQuery` for `db.Query`, `db.Model.query_class`, and the default + query_class for `db.relationship` and `db.backref`. If you use these + interfaces through :mod:`sqlalchemy` and :mod:`sqlalchemy.orm` directly, + the default query class will be that of :mod:`sqlalchemy`. + + .. admonition:: Check types carefully + + Don't perform type or `isinstance` checks against `db.Table`, which + emulates `Table` behavior but is not a class. `db.Table` exposes the + `Table` interface, but is a function which allows omission of metadata. + + The ``session_options`` parameter, if provided, is a dict of parameters + to be passed to the session constructor. See :class:`~sqlalchemy.orm.session.Session` + for the standard options. + + The ``engine_options`` parameter, if provided, is a dict of parameters + to be passed to create engine. See :func:`~sqlalchemy.create_engine` + for the standard options. The values given here will be merged with and + override anything set in the ``'SQLALCHEMY_ENGINE_OPTIONS'`` config + variable or othewise set by this library. + + .. versionadded:: 0.10 + The `session_options` parameter was added. + + .. versionadded:: 0.16 + `scopefunc` is now accepted on `session_options`. It allows specifying + a custom function which will define the SQLAlchemy session's scoping. + + .. versionadded:: 2.1 + The `metadata` parameter was added. This allows for setting custom + naming conventions among other, non-trivial things. + + The `query_class` parameter was added, to allow customisation + of the query class, in place of the default of :class:`BaseQuery`. + + The `model_class` parameter was added, which allows a custom model + class to be used in place of :class:`Model`. + + .. versionchanged:: 2.1 + Utilise the same query class across `session`, `Model.query` and `Query`. + + .. versionadded:: 2.4 + The `engine_options` parameter was added. + + .. versionchanged:: 2.4 + The `use_native_unicode` parameter was deprecated. + + .. versionchanged:: 2.4.3 + ``COMMIT_ON_TEARDOWN`` is deprecated and will be removed in + version 3.1. Call ``db.session.commit()`` directly instead. + """ + + #: Default query class used by :attr:`Model.query` and other queries. + #: Customize this by passing ``query_class`` to :func:`SQLAlchemy`. + #: Defaults to :class:`BaseQuery`. + Query = None + + def __init__(self, app=None, use_native_unicode=True, session_options=None, + metadata=None, query_class=BaseQuery, model_class=Model, + engine_options=None): + + self.use_native_unicode = use_native_unicode + self.Query = query_class + self.session = self.create_scoped_session(session_options) + self.Model = self.make_declarative_base(model_class, metadata) + self._engine_lock = Lock() + self.app = app + self._engine_options = engine_options or {} + _include_sqlalchemy(self, query_class) + + if app is not None: + self.init_app(app) + + @property + def metadata(self): + """The metadata associated with ``db.Model``.""" + + return self.Model.metadata + + def create_scoped_session(self, options=None): + """Create a :class:`~sqlalchemy.orm.scoping.scoped_session` + on the factory from :meth:`create_session`. + + An extra key ``'scopefunc'`` can be set on the ``options`` dict to + specify a custom scope function. If it's not provided, Flask's app + context stack identity is used. This will ensure that sessions are + created and removed with the request/response cycle, and should be fine + in most cases. + + :param options: dict of keyword arguments passed to session class in + ``create_session`` + """ + + if options is None: + options = {} + + scopefunc = options.pop('scopefunc', _app_ctx_stack.__ident_func__) + options.setdefault('query_cls', self.Query) + return orm.scoped_session( + self.create_session(options), scopefunc=scopefunc + ) + + def create_session(self, options): + """Create the session factory used by :meth:`create_scoped_session`. + + The factory **must** return an object that SQLAlchemy recognizes as a session, + or registering session events may raise an exception. + + Valid factories include a :class:`~sqlalchemy.orm.session.Session` + class or a :class:`~sqlalchemy.orm.session.sessionmaker`. + + The default implementation creates a ``sessionmaker`` for :class:`SignallingSession`. + + :param options: dict of keyword arguments passed to session class + """ + + return orm.sessionmaker(class_=SignallingSession, db=self, **options) + + def make_declarative_base(self, model, metadata=None): + """Creates the declarative base that all models will inherit from. + + :param model: base model class (or a tuple of base classes) to pass + to :func:`~sqlalchemy.ext.declarative.declarative_base`. Or a class + returned from ``declarative_base``, in which case a new base class + is not created. + :param metadata: :class:`~sqlalchemy.MetaData` instance to use, or + none to use SQLAlchemy's default. + + .. versionchanged 2.3.0:: + ``model`` can be an existing declarative base in order to support + complex customization such as changing the metaclass. + """ + if not isinstance(model, DeclarativeMeta): + model = declarative_base( + cls=model, + name='Model', + metadata=metadata, + metaclass=DefaultMeta + ) + + # if user passed in a declarative base and a metaclass for some reason, + # make sure the base uses the metaclass + if metadata is not None and model.metadata is not metadata: + model.metadata = metadata + + if not getattr(model, 'query_class', None): + model.query_class = self.Query + + model.query = _QueryProperty(self) + return model + + def init_app(self, app): + """This callback can be used to initialize an application for the + use with this database setup. Never use a database in the context + of an application not initialized that way or connections will + leak. + """ + if ( + 'SQLALCHEMY_DATABASE_URI' not in app.config and + 'SQLALCHEMY_BINDS' not in app.config + ): + warnings.warn( + 'Neither SQLALCHEMY_DATABASE_URI nor SQLALCHEMY_BINDS is set. ' + 'Defaulting SQLALCHEMY_DATABASE_URI to "sqlite:///:memory:".' + ) + + app.config.setdefault('SQLALCHEMY_DATABASE_URI', 'sqlite:///:memory:') + app.config.setdefault('SQLALCHEMY_BINDS', None) + app.config.setdefault('SQLALCHEMY_NATIVE_UNICODE', None) + app.config.setdefault('SQLALCHEMY_ECHO', False) + app.config.setdefault('SQLALCHEMY_RECORD_QUERIES', None) + app.config.setdefault('SQLALCHEMY_POOL_SIZE', None) + app.config.setdefault('SQLALCHEMY_POOL_TIMEOUT', None) + app.config.setdefault('SQLALCHEMY_POOL_RECYCLE', None) + app.config.setdefault('SQLALCHEMY_MAX_OVERFLOW', None) + app.config.setdefault('SQLALCHEMY_COMMIT_ON_TEARDOWN', False) + track_modifications = app.config.setdefault( + 'SQLALCHEMY_TRACK_MODIFICATIONS', None + ) + app.config.setdefault('SQLALCHEMY_ENGINE_OPTIONS', {}) + + if track_modifications is None: + warnings.warn(FSADeprecationWarning( + 'SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and ' + 'will be disabled by default in the future. Set it to True ' + 'or False to suppress this warning.' + )) + + # Deprecation warnings for config keys that should be replaced by SQLALCHEMY_ENGINE_OPTIONS. + utils.engine_config_warning(app.config, '3.0', 'SQLALCHEMY_POOL_SIZE', 'pool_size') + utils.engine_config_warning(app.config, '3.0', 'SQLALCHEMY_POOL_TIMEOUT', 'pool_timeout') + utils.engine_config_warning(app.config, '3.0', 'SQLALCHEMY_POOL_RECYCLE', 'pool_recycle') + utils.engine_config_warning(app.config, '3.0', 'SQLALCHEMY_MAX_OVERFLOW', 'max_overflow') + + app.extensions['sqlalchemy'] = _SQLAlchemyState(self) + + @app.teardown_appcontext + def shutdown_session(response_or_exc): + if app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN']: + warnings.warn( + "'COMMIT_ON_TEARDOWN' is deprecated and will be" + " removed in version 3.1. Call" + " 'db.session.commit()'` directly instead.", + DeprecationWarning, + ) + + if response_or_exc is None: + self.session.commit() + + self.session.remove() + return response_or_exc + + def apply_pool_defaults(self, app, options): + def _setdefault(optionkey, configkey): + value = app.config[configkey] + if value is not None: + options[optionkey] = value + _setdefault('pool_size', 'SQLALCHEMY_POOL_SIZE') + _setdefault('pool_timeout', 'SQLALCHEMY_POOL_TIMEOUT') + _setdefault('pool_recycle', 'SQLALCHEMY_POOL_RECYCLE') + _setdefault('max_overflow', 'SQLALCHEMY_MAX_OVERFLOW') + + def apply_driver_hacks(self, app, sa_url, options): + """This method is called before engine creation and used to inject + driver specific hacks into the options. The `options` parameter is + a dictionary of keyword arguments that will then be used to call + the :func:`sqlalchemy.create_engine` function. + + The default implementation provides some saner defaults for things + like pool sizes for MySQL and sqlite. Also it injects the setting of + `SQLALCHEMY_NATIVE_UNICODE`. + """ + if sa_url.drivername.startswith('mysql'): + sa_url.query.setdefault('charset', 'utf8') + if sa_url.drivername != 'mysql+gaerdbms': + options.setdefault('pool_size', 10) + options.setdefault('pool_recycle', 7200) + elif sa_url.drivername == 'sqlite': + pool_size = options.get('pool_size') + detected_in_memory = False + if sa_url.database in (None, '', ':memory:'): + detected_in_memory = True + from sqlalchemy.pool import StaticPool + options['poolclass'] = StaticPool + if 'connect_args' not in options: + options['connect_args'] = {} + options['connect_args']['check_same_thread'] = False + + # we go to memory and the pool size was explicitly set + # to 0 which is fail. Let the user know that + if pool_size == 0: + raise RuntimeError('SQLite in memory database with an ' + 'empty queue not possible due to data ' + 'loss.') + # if pool size is None or explicitly set to 0 we assume the + # user did not want a queue for this sqlite connection and + # hook in the null pool. + elif not pool_size: + from sqlalchemy.pool import NullPool + options['poolclass'] = NullPool + + # if it's not an in memory database we make the path absolute. + if not detected_in_memory: + sa_url.database = os.path.join(app.root_path, sa_url.database) + + unu = app.config['SQLALCHEMY_NATIVE_UNICODE'] + if unu is None: + unu = self.use_native_unicode + if not unu: + options['use_native_unicode'] = False + + if app.config['SQLALCHEMY_NATIVE_UNICODE'] is not None: + warnings.warn( + "The 'SQLALCHEMY_NATIVE_UNICODE' config option is deprecated and will be removed in" + " v3.0. Use 'SQLALCHEMY_ENGINE_OPTIONS' instead.", + DeprecationWarning + ) + if not self.use_native_unicode: + warnings.warn( + "'use_native_unicode' is deprecated and will be removed in v3.0." + " Use the 'engine_options' parameter instead.", + DeprecationWarning + ) + + @property + def engine(self): + """Gives access to the engine. If the database configuration is bound + to a specific application (initialized with an application) this will + always return a database connection. If however the current application + is used this might raise a :exc:`RuntimeError` if no application is + active at the moment. + """ + return self.get_engine() + + def make_connector(self, app=None, bind=None): + """Creates the connector for a given state and bind.""" + return _EngineConnector(self, self.get_app(app), bind) + + def get_engine(self, app=None, bind=None): + """Returns a specific engine.""" + + app = self.get_app(app) + state = get_state(app) + + with self._engine_lock: + connector = state.connectors.get(bind) + + if connector is None: + connector = self.make_connector(app, bind) + state.connectors[bind] = connector + + return connector.get_engine() + + def create_engine(self, sa_url, engine_opts): + """ + Override this method to have final say over how the SQLAlchemy engine + is created. + + In most cases, you will want to use ``'SQLALCHEMY_ENGINE_OPTIONS'`` + config variable or set ``engine_options`` for :func:`SQLAlchemy`. + """ + return sqlalchemy.create_engine(sa_url, **engine_opts) + + def get_app(self, reference_app=None): + """Helper method that implements the logic to look up an + application.""" + + if reference_app is not None: + return reference_app + + if current_app: + return current_app._get_current_object() + + if self.app is not None: + return self.app + + raise RuntimeError( + 'No application found. Either work inside a view function or push' + ' an application context. See' + ' http://flask-sqlalchemy.pocoo.org/contexts/.' + ) + + def get_tables_for_bind(self, bind=None): + """Returns a list of all tables relevant for a bind.""" + result = [] + for table in itervalues(self.Model.metadata.tables): + if table.info.get('bind_key') == bind: + result.append(table) + return result + + def get_binds(self, app=None): + """Returns a dictionary with a table->engine mapping. + + This is suitable for use of sessionmaker(binds=db.get_binds(app)). + """ + app = self.get_app(app) + binds = [None] + list(app.config.get('SQLALCHEMY_BINDS') or ()) + retval = {} + for bind in binds: + engine = self.get_engine(app, bind) + tables = self.get_tables_for_bind(bind) + retval.update(dict((table, engine) for table in tables)) + return retval + + def _execute_for_all_tables(self, app, bind, operation, skip_tables=False): + app = self.get_app(app) + + if bind == '__all__': + binds = [None] + list(app.config.get('SQLALCHEMY_BINDS') or ()) + elif isinstance(bind, string_types) or bind is None: + binds = [bind] + else: + binds = bind + + for bind in binds: + extra = {} + if not skip_tables: + tables = self.get_tables_for_bind(bind) + extra['tables'] = tables + op = getattr(self.Model.metadata, operation) + op(bind=self.get_engine(app, bind), **extra) + + def create_all(self, bind='__all__', app=None): + """Creates all tables. + + .. versionchanged:: 0.12 + Parameters were added + """ + self._execute_for_all_tables(app, bind, 'create_all') + + def drop_all(self, bind='__all__', app=None): + """Drops all tables. + + .. versionchanged:: 0.12 + Parameters were added + """ + self._execute_for_all_tables(app, bind, 'drop_all') + + def reflect(self, bind='__all__', app=None): + """Reflects tables from the database. + + .. versionchanged:: 0.12 + Parameters were added + """ + self._execute_for_all_tables(app, bind, 'reflect', skip_tables=True) + + def __repr__(self): + return '<%s engine=%r>' % ( + self.__class__.__name__, + self.engine.url if self.app or current_app else None + ) + + +class _BoundDeclarativeMeta(DefaultMeta): + def __init__(cls, name, bases, d): + warnings.warn(FSADeprecationWarning( + '"_BoundDeclarativeMeta" has been renamed to "DefaultMeta". The' + ' old name will be removed in 3.0.' + ), stacklevel=3) + super(_BoundDeclarativeMeta, cls).__init__(name, bases, d) + + +class FSADeprecationWarning(DeprecationWarning): + pass + + +warnings.simplefilter('always', FSADeprecationWarning) diff --git a/.venv/lib/python3.8/site-packages/flask_sqlalchemy/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_sqlalchemy/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..5b292129 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_sqlalchemy/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_sqlalchemy/__pycache__/_compat.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_sqlalchemy/__pycache__/_compat.cpython-38.pyc new file mode 100644 index 00000000..29f524c6 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_sqlalchemy/__pycache__/_compat.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_sqlalchemy/__pycache__/model.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_sqlalchemy/__pycache__/model.cpython-38.pyc new file mode 100644 index 00000000..17a69a58 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_sqlalchemy/__pycache__/model.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_sqlalchemy/__pycache__/utils.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_sqlalchemy/__pycache__/utils.cpython-38.pyc new file mode 100644 index 00000000..c69f795b Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_sqlalchemy/__pycache__/utils.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_sqlalchemy/_compat.py b/.venv/lib/python3.8/site-packages/flask_sqlalchemy/_compat.py new file mode 100644 index 00000000..058b7166 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_sqlalchemy/_compat.py @@ -0,0 +1,44 @@ +import sys + +PY2 = sys.version_info[0] == 2 + + +if PY2: + def iteritems(d): + return d.iteritems() + + def itervalues(d): + return d.itervalues() + + xrange = xrange + + string_types = (unicode, bytes) + + def to_str(x, charset='utf8', errors='strict'): + if x is None or isinstance(x, str): + return x + + if isinstance(x, unicode): + return x.encode(charset, errors) + + return str(x) + +else: + def iteritems(d): + return iter(d.items()) + + def itervalues(d): + return iter(d.values()) + + xrange = range + + string_types = (str,) + + def to_str(x, charset='utf8', errors='strict'): + if x is None or isinstance(x, str): + return x + + if isinstance(x, bytes): + return x.decode(charset, errors) + + return str(x) diff --git a/.venv/lib/python3.8/site-packages/flask_sqlalchemy/model.py b/.venv/lib/python3.8/site-packages/flask_sqlalchemy/model.py new file mode 100644 index 00000000..99a10a6d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_sqlalchemy/model.py @@ -0,0 +1,154 @@ +import re + +import sqlalchemy as sa +from sqlalchemy import inspect +from sqlalchemy.ext.declarative import DeclarativeMeta, declared_attr +from sqlalchemy.schema import _get_table_key + +from ._compat import to_str + + +def should_set_tablename(cls): + """Determine whether ``__tablename__`` should be automatically generated + for a model. + + * If no class in the MRO sets a name, one should be generated. + * If a declared attr is found, it should be used instead. + * If a name is found, it should be used if the class is a mixin, otherwise + one should be generated. + * Abstract models should not have one generated. + + Later, :meth:`._BoundDeclarativeMeta.__table_cls__` will determine if the + model looks like single or joined-table inheritance. If no primary key is + found, the name will be unset. + """ + if ( + cls.__dict__.get('__abstract__', False) + or not any(isinstance(b, DeclarativeMeta) for b in cls.__mro__[1:]) + ): + return False + + for base in cls.__mro__: + if '__tablename__' not in base.__dict__: + continue + + if isinstance(base.__dict__['__tablename__'], declared_attr): + return False + + return not ( + base is cls + or base.__dict__.get('__abstract__', False) + or not isinstance(base, DeclarativeMeta) + ) + + return True + + +camelcase_re = re.compile(r'([A-Z]+)(?=[a-z0-9])') + + +def camel_to_snake_case(name): + def _join(match): + word = match.group() + + if len(word) > 1: + return ('_%s_%s' % (word[:-1], word[-1])).lower() + + return '_' + word.lower() + + return camelcase_re.sub(_join, name).lstrip('_') + + +class NameMetaMixin(object): + def __init__(cls, name, bases, d): + if should_set_tablename(cls): + cls.__tablename__ = camel_to_snake_case(cls.__name__) + + super(NameMetaMixin, cls).__init__(name, bases, d) + + # __table_cls__ has run at this point + # if no table was created, use the parent table + if ( + '__tablename__' not in cls.__dict__ + and '__table__' in cls.__dict__ + and cls.__dict__['__table__'] is None + ): + del cls.__table__ + + def __table_cls__(cls, *args, **kwargs): + """This is called by SQLAlchemy during mapper setup. It determines the + final table object that the model will use. + + If no primary key is found, that indicates single-table inheritance, + so no table will be created and ``__tablename__`` will be unset. + """ + # check if a table with this name already exists + # allows reflected tables to be applied to model by name + key = _get_table_key(args[0], kwargs.get('schema')) + + if key in cls.metadata.tables: + return sa.Table(*args, **kwargs) + + # if a primary key or constraint is found, create a table for + # joined-table inheritance + for arg in args: + if ( + (isinstance(arg, sa.Column) and arg.primary_key) + or isinstance(arg, sa.PrimaryKeyConstraint) + ): + return sa.Table(*args, **kwargs) + + # if no base classes define a table, return one + # ensures the correct error shows up when missing a primary key + for base in cls.__mro__[1:-1]: + if '__table__' in base.__dict__: + break + else: + return sa.Table(*args, **kwargs) + + # single-table inheritance, use the parent tablename + if '__tablename__' in cls.__dict__: + del cls.__tablename__ + + +class BindMetaMixin(object): + def __init__(cls, name, bases, d): + bind_key = ( + d.pop('__bind_key__', None) + or getattr(cls, '__bind_key__', None) + ) + + super(BindMetaMixin, cls).__init__(name, bases, d) + + if bind_key is not None and getattr(cls, '__table__', None) is not None: + cls.__table__.info['bind_key'] = bind_key + + +class DefaultMeta(NameMetaMixin, BindMetaMixin, DeclarativeMeta): + pass + + +class Model(object): + """Base class for SQLAlchemy declarative base model. + + To define models, subclass :attr:`db.Model `, not this + class. To customize ``db.Model``, subclass this and pass it as + ``model_class`` to :class:`SQLAlchemy`. + """ + + #: Query class used by :attr:`query`. Defaults to + # :class:`SQLAlchemy.Query`, which defaults to :class:`BaseQuery`. + query_class = None + + #: Convenience property to query the database for instances of this model + # using the current session. Equivalent to ``db.session.query(Model)`` + # unless :attr:`query_class` has been changed. + query = None + + def __repr__(self): + identity = inspect(self).identity + if identity is None: + pk = "(transient {0})".format(id(self)) + else: + pk = ', '.join(to_str(value) for value in identity) + return '<{0} {1}>'.format(type(self).__name__, pk) diff --git a/.venv/lib/python3.8/site-packages/flask_sqlalchemy/utils.py b/.venv/lib/python3.8/site-packages/flask_sqlalchemy/utils.py new file mode 100644 index 00000000..b06ad923 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_sqlalchemy/utils.py @@ -0,0 +1,45 @@ +import warnings + +import sqlalchemy + + +def parse_version(v): + """ + Take a string version and conver it to a tuple (for easier comparison), e.g.: + + "1.2.3" --> (1, 2, 3) + "1.2" --> (1, 2, 0) + "1" --> (1, 0, 0) + """ + parts = v.split(".") + # Pad the list to make sure there is three elements so that we get major, minor, point + # comparisons that default to "0" if not given. I.e. "1.2" --> (1, 2, 0) + parts = (parts + 3 * ['0'])[:3] + return tuple(int(x) for x in parts) + + +def sqlalchemy_version(op, val): + sa_ver = parse_version(sqlalchemy.__version__) + target_ver = parse_version(val) + + assert op in ('<', '>', '<=', '>=', '=='), 'op {} not supported'.format(op) + + if op == '<': + return sa_ver < target_ver + if op == '>': + return sa_ver > target_ver + if op == '<=': + return sa_ver <= target_ver + if op == '>=': + return sa_ver >= target_ver + return sa_ver == target_ver + + +def engine_config_warning(config, version, deprecated_config_key, engine_option): + if config[deprecated_config_key] is not None: + warnings.warn( + 'The `{}` config option is deprecated and will be removed in' + ' v{}. Use `SQLALCHEMY_ENGINE_OPTIONS[\'{}\']` instead.' + .format(deprecated_config_key, version, engine_option), + DeprecationWarning + ) diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/__init__.py b/.venv/lib/python3.8/site-packages/flask_wtf/__init__.py new file mode 100644 index 00000000..d4e6f7db --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_wtf/__init__.py @@ -0,0 +1,7 @@ +from __future__ import absolute_import + +from .csrf import CSRFProtect, CsrfProtect +from .form import FlaskForm, Form +from .recaptcha import * + +__version__ = '0.14.3' diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..c030fa41 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/_compat.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/_compat.cpython-38.pyc new file mode 100644 index 00000000..de85e4ef Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/_compat.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/csrf.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/csrf.cpython-38.pyc new file mode 100644 index 00000000..0e9fee37 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/csrf.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/file.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/file.cpython-38.pyc new file mode 100644 index 00000000..38eb69cc Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/file.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/form.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/form.cpython-38.pyc new file mode 100644 index 00000000..acdeb404 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/form.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/html5.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/html5.cpython-38.pyc new file mode 100644 index 00000000..bc25b2e1 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/html5.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/i18n.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/i18n.cpython-38.pyc new file mode 100644 index 00000000..fe46c497 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_wtf/__pycache__/i18n.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/_compat.py b/.venv/lib/python3.8/site-packages/flask_wtf/_compat.py new file mode 100644 index 00000000..c5a99234 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_wtf/_compat.py @@ -0,0 +1,39 @@ +import sys +import warnings + +PY2 = sys.version_info[0] == 2 + +if not PY2: + text_type = str + string_types = (str,) + from collections import abc + from urllib.parse import urlparse +else: + text_type = unicode + string_types = (str, unicode) + import collections as abc + from urlparse import urlparse + + +def to_bytes(text): + """Transform string to bytes.""" + if isinstance(text, text_type): + text = text.encode('utf-8') + return text + + +def to_unicode(input_bytes, encoding='utf-8'): + """Decodes input_bytes to text if needed.""" + if not isinstance(input_bytes, string_types): + input_bytes = input_bytes.decode(encoding) + return input_bytes + + +class FlaskWTFDeprecationWarning(DeprecationWarning): + pass + + +warnings.simplefilter('always', FlaskWTFDeprecationWarning) +warnings.filterwarnings( + 'ignore', category=FlaskWTFDeprecationWarning, module='wtforms|flask_wtf' +) diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/csrf.py b/.venv/lib/python3.8/site-packages/flask_wtf/csrf.py new file mode 100644 index 00000000..1d70ed28 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_wtf/csrf.py @@ -0,0 +1,371 @@ +import hashlib +import logging +import os +import warnings +from functools import wraps + +from flask import Blueprint, current_app, g, request, session +from itsdangerous import BadData, SignatureExpired, URLSafeTimedSerializer +from werkzeug.exceptions import BadRequest +from werkzeug.security import safe_str_cmp +from wtforms import ValidationError +from wtforms.csrf.core import CSRF + +from ._compat import FlaskWTFDeprecationWarning, string_types, urlparse + +__all__ = ('generate_csrf', 'validate_csrf', 'CSRFProtect') +logger = logging.getLogger(__name__) + + +def generate_csrf(secret_key=None, token_key=None): + """Generate a CSRF token. The token is cached for a request, so multiple + calls to this function will generate the same token. + + During testing, it might be useful to access the signed token in + ``g.csrf_token`` and the raw token in ``session['csrf_token']``. + + :param secret_key: Used to securely sign the token. Default is + ``WTF_CSRF_SECRET_KEY`` or ``SECRET_KEY``. + :param token_key: Key where token is stored in session for comparision. + Default is ``WTF_CSRF_FIELD_NAME`` or ``'csrf_token'``. + """ + + secret_key = _get_config( + secret_key, 'WTF_CSRF_SECRET_KEY', current_app.secret_key, + message='A secret key is required to use CSRF.' + ) + field_name = _get_config( + token_key, 'WTF_CSRF_FIELD_NAME', 'csrf_token', + message='A field name is required to use CSRF.' + ) + + if field_name not in g: + s = URLSafeTimedSerializer(secret_key, salt='wtf-csrf-token') + + if field_name not in session: + session[field_name] = hashlib.sha1(os.urandom(64)).hexdigest() + + try: + token = s.dumps(session[field_name]) + except TypeError: + session[field_name] = hashlib.sha1(os.urandom(64)).hexdigest() + token = s.dumps(session[field_name]) + + setattr(g, field_name, token) + + return g.get(field_name) + + +def validate_csrf(data, secret_key=None, time_limit=None, token_key=None): + """Check if the given data is a valid CSRF token. This compares the given + signed token to the one stored in the session. + + :param data: The signed CSRF token to be checked. + :param secret_key: Used to securely sign the token. Default is + ``WTF_CSRF_SECRET_KEY`` or ``SECRET_KEY``. + :param time_limit: Number of seconds that the token is valid. Default is + ``WTF_CSRF_TIME_LIMIT`` or 3600 seconds (60 minutes). + :param token_key: Key where token is stored in session for comparision. + Default is ``WTF_CSRF_FIELD_NAME`` or ``'csrf_token'``. + + :raises ValidationError: Contains the reason that validation failed. + + .. versionchanged:: 0.14 + Raises ``ValidationError`` with a specific error message rather than + returning ``True`` or ``False``. + """ + + secret_key = _get_config( + secret_key, 'WTF_CSRF_SECRET_KEY', current_app.secret_key, + message='A secret key is required to use CSRF.' + ) + field_name = _get_config( + token_key, 'WTF_CSRF_FIELD_NAME', 'csrf_token', + message='A field name is required to use CSRF.' + ) + time_limit = _get_config( + time_limit, 'WTF_CSRF_TIME_LIMIT', 3600, required=False + ) + + if not data: + raise ValidationError('The CSRF token is missing.') + + if field_name not in session: + raise ValidationError('The CSRF session token is missing.') + + s = URLSafeTimedSerializer(secret_key, salt='wtf-csrf-token') + + try: + token = s.loads(data, max_age=time_limit) + except SignatureExpired: + raise ValidationError('The CSRF token has expired.') + except BadData: + raise ValidationError('The CSRF token is invalid.') + + if not safe_str_cmp(session[field_name], token): + raise ValidationError('The CSRF tokens do not match.') + + +def _get_config( + value, config_name, default=None, + required=True, message='CSRF is not configured.' +): + """Find config value based on provided value, Flask config, and default + value. + + :param value: already provided config value + :param config_name: Flask ``config`` key + :param default: default value if not provided or configured + :param required: whether the value must not be ``None`` + :param message: error message if required config is not found + :raises KeyError: if required config is not found + """ + + if value is None: + value = current_app.config.get(config_name, default) + + if required and value is None: + raise RuntimeError(message) + + return value + + +class _FlaskFormCSRF(CSRF): + def setup_form(self, form): + self.meta = form.meta + return super(_FlaskFormCSRF, self).setup_form(form) + + def generate_csrf_token(self, csrf_token_field): + return generate_csrf( + secret_key=self.meta.csrf_secret, + token_key=self.meta.csrf_field_name + ) + + def validate_csrf_token(self, form, field): + if g.get('csrf_valid', False): + # already validated by CSRFProtect + return + + try: + validate_csrf( + field.data, + self.meta.csrf_secret, + self.meta.csrf_time_limit, + self.meta.csrf_field_name + ) + except ValidationError as e: + logger.info(e.args[0]) + raise + + +class CSRFProtect(object): + """Enable CSRF protection globally for a Flask app. + + :: + + app = Flask(__name__) + csrf = CSRFProtect(app) + + Checks the ``csrf_token`` field sent with forms, or the ``X-CSRFToken`` + header sent with JavaScript requests. Render the token in templates using + ``{{ csrf_token() }}``. + + See the :ref:`csrf` documentation. + """ + + def __init__(self, app=None): + self._exempt_views = set() + self._exempt_blueprints = set() + + if app: + self.init_app(app) + + def init_app(self, app): + app.extensions['csrf'] = self + + app.config.setdefault('WTF_CSRF_ENABLED', True) + app.config.setdefault('WTF_CSRF_CHECK_DEFAULT', True) + app.config['WTF_CSRF_METHODS'] = set(app.config.get( + 'WTF_CSRF_METHODS', ['POST', 'PUT', 'PATCH', 'DELETE'] + )) + app.config.setdefault('WTF_CSRF_FIELD_NAME', 'csrf_token') + app.config.setdefault( + 'WTF_CSRF_HEADERS', ['X-CSRFToken', 'X-CSRF-Token'] + ) + app.config.setdefault('WTF_CSRF_TIME_LIMIT', 3600) + app.config.setdefault('WTF_CSRF_SSL_STRICT', True) + + app.jinja_env.globals['csrf_token'] = generate_csrf + app.context_processor(lambda: {'csrf_token': generate_csrf}) + + @app.before_request + def csrf_protect(): + if not app.config['WTF_CSRF_ENABLED']: + return + + if not app.config['WTF_CSRF_CHECK_DEFAULT']: + return + + if request.method not in app.config['WTF_CSRF_METHODS']: + return + + if not request.endpoint: + return + + if request.blueprint in self._exempt_blueprints: + return + + view = app.view_functions.get(request.endpoint) + dest = '{0}.{1}'.format(view.__module__, view.__name__) + + if dest in self._exempt_views: + return + + self.protect() + + def _get_csrf_token(self): + # find the token in the form data + field_name = current_app.config['WTF_CSRF_FIELD_NAME'] + base_token = request.form.get(field_name) + + if base_token: + return base_token + + # if the form has a prefix, the name will be {prefix}-csrf_token + for key in request.form: + if key.endswith(field_name): + csrf_token = request.form[key] + + if csrf_token: + return csrf_token + + # find the token in the headers + for header_name in current_app.config['WTF_CSRF_HEADERS']: + csrf_token = request.headers.get(header_name) + + if csrf_token: + return csrf_token + + return None + + def protect(self): + if request.method not in current_app.config['WTF_CSRF_METHODS']: + return + + try: + validate_csrf(self._get_csrf_token()) + except ValidationError as e: + logger.info(e.args[0]) + self._error_response(e.args[0]) + + if request.is_secure and current_app.config['WTF_CSRF_SSL_STRICT']: + if not request.referrer: + self._error_response('The referrer header is missing.') + + good_referrer = 'https://{0}/'.format(request.host) + + if not same_origin(request.referrer, good_referrer): + self._error_response('The referrer does not match the host.') + + g.csrf_valid = True # mark this request as CSRF valid + + def exempt(self, view): + """Mark a view or blueprint to be excluded from CSRF protection. + + :: + + @app.route('/some-view', methods=['POST']) + @csrf.exempt + def some_view(): + ... + + :: + + bp = Blueprint(...) + csrf.exempt(bp) + + """ + + if isinstance(view, Blueprint): + self._exempt_blueprints.add(view.name) + return view + + if isinstance(view, string_types): + view_location = view + else: + view_location = '.'.join((view.__module__, view.__name__)) + + self._exempt_views.add(view_location) + return view + + def _error_response(self, reason): + raise CSRFError(reason) + + def error_handler(self, view): + """Register a function that will generate the response for CSRF errors. + + .. deprecated:: 0.14 + Use the standard Flask error system with + ``@app.errorhandler(CSRFError)`` instead. This will be removed in + version 1.0. + + The function will be passed one argument, ``reason``. By default it + will raise a :class:`~flask_wtf.csrf.CSRFError`. :: + + @csrf.error_handler + def csrf_error(reason): + return render_template('error.html', reason=reason) + + Due to historical reasons, the function may either return a response + or raise an exception with :func:`flask.abort`. + """ + + warnings.warn(FlaskWTFDeprecationWarning( + '"@csrf.error_handler" is deprecated. Use the standard Flask ' + 'error system with "@app.errorhandler(CSRFError)" instead. This ' + 'will be removed in 1.0.' + ), stacklevel=2) + + @wraps(view) + def handler(reason): + response = current_app.make_response(view(reason)) + raise CSRFError(response=response) + + self._error_response = handler + return view + + +class CsrfProtect(CSRFProtect): + """ + .. deprecated:: 0.14 + Renamed to :class:`~flask_wtf.csrf.CSRFProtect`. + """ + + def __init__(self, app=None): + warnings.warn(FlaskWTFDeprecationWarning( + '"flask_wtf.CsrfProtect" has been renamed to "CSRFProtect" ' + 'and will be removed in 1.0.' + ), stacklevel=2) + super(CsrfProtect, self).__init__(app=app) + + +class CSRFError(BadRequest): + """Raise if the client sends invalid CSRF data with the request. + + Generates a 400 Bad Request response with the failure reason by default. + Customize the response by registering a handler with + :meth:`flask.Flask.errorhandler`. + """ + + description = 'CSRF validation failed.' + + +def same_origin(current_uri, compare_uri): + current = urlparse(current_uri) + compare = urlparse(compare_uri) + + return ( + current.scheme == compare.scheme + and current.hostname == compare.hostname + and current.port == compare.port + ) diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/file.py b/.venv/lib/python3.8/site-packages/flask_wtf/file.py new file mode 100644 index 00000000..267268b5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_wtf/file.py @@ -0,0 +1,93 @@ +import warnings + +from werkzeug.datastructures import FileStorage +from wtforms import FileField as _FileField +from wtforms.validators import DataRequired, StopValidation + +from ._compat import abc +from ._compat import FlaskWTFDeprecationWarning + + +class FileField(_FileField): + """Werkzeug-aware subclass of :class:`wtforms.fields.FileField`.""" + + def process_formdata(self, valuelist): + valuelist = (x for x in valuelist if isinstance(x, FileStorage) and x) + data = next(valuelist, None) + + if data is not None: + self.data = data + else: + self.raw_data = () + + def has_file(self): + """Return ``True`` if ``self.data`` is a + :class:`~werkzeug.datastructures.FileStorage` object. + + .. deprecated:: 0.14.1 + ``data`` is no longer set if the input is not a non-empty + ``FileStorage``. Check ``form.data is not None`` instead. + """ + + warnings.warn(FlaskWTFDeprecationWarning( + '"has_file" is deprecated and will be removed in 1.0. The data is ' + 'checked during processing instead.' + )) + return bool(self.data) + + +class FileRequired(DataRequired): + """Validates that the data is a Werkzeug + :class:`~werkzeug.datastructures.FileStorage` object. + + :param message: error message + + You can also use the synonym ``file_required``. + """ + + def __call__(self, form, field): + if not (isinstance(field.data, FileStorage) and field.data): + raise StopValidation(self.message or field.gettext( + 'This field is required.' + )) + + +file_required = FileRequired + + +class FileAllowed(object): + """Validates that the uploaded file is allowed by a given list of + extensions or a Flask-Uploads :class:`~flaskext.uploads.UploadSet`. + + :param upload_set: A list of extensions or an + :class:`~flaskext.uploads.UploadSet` + :param message: error message + + You can also use the synonym ``file_allowed``. + """ + + def __init__(self, upload_set, message=None): + self.upload_set = upload_set + self.message = message + + def __call__(self, form, field): + if not (isinstance(field.data, FileStorage) and field.data): + return + + filename = field.data.filename.lower() + + if isinstance(self.upload_set, abc.Iterable): + if any(filename.endswith('.' + x) for x in self.upload_set): + return + + raise StopValidation(self.message or field.gettext( + 'File does not have an approved extension: {extensions}' + ).format(extensions=', '.join(self.upload_set))) + + if not self.upload_set.file_allowed(field.data, filename): + raise StopValidation(self.message or field.gettext( + 'File does not have an approved extension.' + )) + + +file_allowed = FileAllowed diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/form.py b/.venv/lib/python3.8/site-packages/flask_wtf/form.py new file mode 100644 index 00000000..085d51ce --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_wtf/form.py @@ -0,0 +1,157 @@ +import warnings + +from flask import current_app, request, session +from jinja2 import Markup +from werkzeug.datastructures import CombinedMultiDict, ImmutableMultiDict +from werkzeug.utils import cached_property +from wtforms import Form +from wtforms.meta import DefaultMeta +from wtforms.widgets import HiddenInput + +from ._compat import FlaskWTFDeprecationWarning, string_types, text_type +from .csrf import _FlaskFormCSRF + +try: + from .i18n import translations +except ImportError: + translations = None # babel not installed + + +SUBMIT_METHODS = set(('POST', 'PUT', 'PATCH', 'DELETE')) +_Auto = object() + + +class FlaskForm(Form): + """Flask-specific subclass of WTForms :class:`~wtforms.form.Form`. + + If ``formdata`` is not specified, this will use :attr:`flask.request.form` + and :attr:`flask.request.files`. Explicitly pass ``formdata=None`` to + prevent this. + """ + + class Meta(DefaultMeta): + csrf_class = _FlaskFormCSRF + csrf_context = session # not used, provided for custom csrf_class + + @cached_property + def csrf(self): + return current_app.config.get('WTF_CSRF_ENABLED', True) + + @cached_property + def csrf_secret(self): + return current_app.config.get( + 'WTF_CSRF_SECRET_KEY', current_app.secret_key + ) + + @cached_property + def csrf_field_name(self): + return current_app.config.get('WTF_CSRF_FIELD_NAME', 'csrf_token') + + @cached_property + def csrf_time_limit(self): + return current_app.config.get('WTF_CSRF_TIME_LIMIT', 3600) + + def wrap_formdata(self, form, formdata): + if formdata is _Auto: + if _is_submitted(): + if request.files: + return CombinedMultiDict(( + request.files, request.form + )) + elif request.form: + return request.form + elif request.get_json(): + return ImmutableMultiDict(request.get_json()) + + return None + + return formdata + + def get_translations(self, form): + if not current_app.config.get('WTF_I18N_ENABLED', True): + return super(FlaskForm.Meta, self).get_translations(form) + + return translations + + def __init__(self, formdata=_Auto, **kwargs): + csrf_enabled = kwargs.pop('csrf_enabled', None) + + if csrf_enabled is not None: + warnings.warn(FlaskWTFDeprecationWarning( + '"csrf_enabled" is deprecated and will be removed in 1.0. ' + "Pass meta={'csrf': False} instead." + ), stacklevel=3) + kwargs['meta'] = kwargs.get('meta') or {} + kwargs['meta'].setdefault('csrf', csrf_enabled) + + super(FlaskForm, self).__init__(formdata=formdata, **kwargs) + + def is_submitted(self): + """Consider the form submitted if there is an active request and + the method is ``POST``, ``PUT``, ``PATCH``, or ``DELETE``. + """ + + return _is_submitted() + + def validate_on_submit(self): + """Call :meth:`validate` only if the form is submitted. + This is a shortcut for ``form.is_submitted() and form.validate()``. + """ + return self.is_submitted() and self.validate() + + def hidden_tag(self, *fields): + """Render the form's hidden fields in one call. + + A field is considered hidden if it uses the + :class:`~wtforms.widgets.HiddenInput` widget. + + If ``fields`` are given, only render the given fields that + are hidden. If a string is passed, render the field with that + name if it exists. + + .. versionchanged:: 0.13 + + No longer wraps inputs in hidden div. + This is valid HTML 5. + + .. versionchanged:: 0.13 + + Skip passed fields that aren't hidden. + Skip passed names that don't exist. + """ + + def hidden_fields(fields): + for f in fields: + if isinstance(f, string_types): + f = getattr(self, f, None) + + if f is None or not isinstance(f.widget, HiddenInput): + continue + + yield f + + return Markup( + u'\n'.join(text_type(f) for f in hidden_fields(fields or self)) + ) + + +def _is_submitted(): + """Consider the form submitted if there is an active request and + the method is ``POST``, ``PUT``, ``PATCH``, or ``DELETE``. + """ + + return bool(request) and request.method in SUBMIT_METHODS + + +class Form(FlaskForm): + """ + .. deprecated:: 0.13 + Renamed to :class:`~flask_wtf.FlaskForm`. + """ + + def __init__(self, *args, **kwargs): + warnings.warn(FlaskWTFDeprecationWarning( + '"flask_wtf.Form" has been renamed to "FlaskForm" ' + 'and will be removed in 1.0.' + ), stacklevel=3) + super(Form, self).__init__(*args, **kwargs) diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/html5.py b/.venv/lib/python3.8/site-packages/flask_wtf/html5.py new file mode 100644 index 00000000..a80cf678 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_wtf/html5.py @@ -0,0 +1,12 @@ +import warnings + +from ._compat import FlaskWTFDeprecationWarning + +warnings.warn(FlaskWTFDeprecationWarning( + '"flask_wtf.html5" will be removed in 1.0. ' + 'Import directly from "wtforms.fields.html5" ' + 'and "wtforms.widgets.html5".' +), stacklevel=2) + +from wtforms.widgets.html5 import * +from wtforms.fields.html5 import * diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/i18n.py b/.venv/lib/python3.8/site-packages/flask_wtf/i18n.py new file mode 100644 index 00000000..78cfcb29 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_wtf/i18n.py @@ -0,0 +1,50 @@ +from babel import support +from flask import current_app, request +from wtforms.i18n import messages_path + +try: + from flask_babel import get_locale +except ImportError: + from flask_babelex import get_locale + +__all__ = ('Translations', 'translations') + + +def _get_translations(): + """Returns the correct gettext translations. + Copy from flask-babel with some modifications. + """ + + if not request: + return None + + # babel should be in extensions for get_locale + if 'babel' not in current_app.extensions: + return None + + translations = getattr(request, 'wtforms_translations', None) + + if translations is None: + translations = support.Translations.load( + messages_path(), [get_locale()], domain='wtforms' + ) + request.wtforms_translations = translations + + return translations + + +class Translations(object): + def gettext(self, string): + t = _get_translations() + return string if t is None else t.ugettext(string) + + def ngettext(self, singular, plural, n): + t = _get_translations() + + if t is None: + return singular if n == 1 else plural + + return t.ungettext(singular, plural, n) + + +translations = Translations() diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/__init__.py b/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/__init__.py new file mode 100644 index 00000000..47627d2d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/__init__.py @@ -0,0 +1,4 @@ +# flake8: noqa +from .fields import * +from .validators import * +from .widgets import * diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..ed63d32a Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/__pycache__/fields.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/__pycache__/fields.cpython-38.pyc new file mode 100644 index 00000000..b0a0b063 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/__pycache__/fields.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/__pycache__/validators.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/__pycache__/validators.cpython-38.pyc new file mode 100644 index 00000000..4f1b2872 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/__pycache__/validators.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/__pycache__/widgets.cpython-38.pyc b/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/__pycache__/widgets.cpython-38.pyc new file mode 100644 index 00000000..95f769bc Binary files /dev/null and b/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/__pycache__/widgets.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/fields.py b/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/fields.py new file mode 100644 index 00000000..dff3d3fd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/fields.py @@ -0,0 +1,17 @@ +from wtforms.fields import Field + +from . import widgets +from .validators import Recaptcha + +__all__ = ["RecaptchaField"] + + +class RecaptchaField(Field): + widget = widgets.RecaptchaWidget() + + # error message if recaptcha validation fails + recaptcha_error = None + + def __init__(self, label='', validators=None, **kwargs): + validators = validators or [Recaptcha()] + super(RecaptchaField, self).__init__(label, validators, **kwargs) diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/validators.py b/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/validators.py new file mode 100644 index 00000000..86bb5d96 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/validators.py @@ -0,0 +1,79 @@ +try: + import urllib2 as http +except ImportError: + # Python 3 + from urllib import request as http + +import json + +from flask import current_app, request +from werkzeug.urls import url_encode +from wtforms import ValidationError + +from .._compat import to_bytes, to_unicode + +RECAPTCHA_VERIFY_SERVER = 'https://www.google.com/recaptcha/api/siteverify' +RECAPTCHA_ERROR_CODES = { + 'missing-input-secret': 'The secret parameter is missing.', + 'invalid-input-secret': 'The secret parameter is invalid or malformed.', + 'missing-input-response': 'The response parameter is missing.', + 'invalid-input-response': 'The response parameter is invalid or malformed.' +} + + +__all__ = ["Recaptcha"] + + +class Recaptcha(object): + """Validates a ReCaptcha.""" + + def __init__(self, message=None): + if message is None: + message = RECAPTCHA_ERROR_CODES['missing-input-response'] + self.message = message + + def __call__(self, form, field): + if current_app.testing: + return True + + if request.json: + response = request.json.get('g-recaptcha-response', '') + else: + response = request.form.get('g-recaptcha-response', '') + remote_ip = request.remote_addr + + if not response: + raise ValidationError(field.gettext(self.message)) + + if not self._validate_recaptcha(response, remote_ip): + field.recaptcha_error = 'incorrect-captcha-sol' + raise ValidationError(field.gettext(self.message)) + + def _validate_recaptcha(self, response, remote_addr): + """Performs the actual validation.""" + try: + private_key = current_app.config['RECAPTCHA_PRIVATE_KEY'] + except KeyError: + raise RuntimeError("No RECAPTCHA_PRIVATE_KEY config set") + + data = url_encode({ + 'secret': private_key, + 'remoteip': remote_addr, + 'response': response + }) + + http_response = http.urlopen(RECAPTCHA_VERIFY_SERVER, to_bytes(data)) + + if http_response.code != 200: + return False + + json_resp = json.loads(to_unicode(http_response.read())) + + if json_resp["success"]: + return True + + for error in json_resp.get("error-codes", []): + if error in RECAPTCHA_ERROR_CODES: + raise ValidationError(RECAPTCHA_ERROR_CODES[error]) + + return False diff --git a/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/widgets.py b/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/widgets.py new file mode 100644 index 00000000..9cdc8b18 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/flask_wtf/recaptcha/widgets.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- + +from flask import Markup, current_app, json +from werkzeug.urls import url_encode + +JSONEncoder = json.JSONEncoder + +RECAPTCHA_SCRIPT = u'https://www.google.com/recaptcha/api.js' +RECAPTCHA_TEMPLATE = u''' + +
    +''' + +__all__ = ['RecaptchaWidget'] + + +class RecaptchaWidget(object): + + def recaptcha_html(self, public_key): + html = current_app.config.get('RECAPTCHA_HTML') + if html: + return Markup(html) + params = current_app.config.get('RECAPTCHA_PARAMETERS') + script = RECAPTCHA_SCRIPT + if params: + script += u'?' + url_encode(params) + + attrs = current_app.config.get('RECAPTCHA_DATA_ATTRS', {}) + attrs['sitekey'] = public_key + snippet = u' '.join([u'data-%s="%s"' % (k, attrs[k]) for k in attrs]) + return Markup(RECAPTCHA_TEMPLATE % (script, snippet)) + + def __call__(self, field, error=None, **kwargs): + """Returns the recaptcha input HTML.""" + + try: + public_key = current_app.config['RECAPTCHA_PUBLIC_KEY'] + except KeyError: + raise RuntimeError('RECAPTCHA_PUBLIC_KEY config not set') + + return self.recaptcha_html(public_key) diff --git a/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/AUTHORS b/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/AUTHORS new file mode 100644 index 00000000..f4b148d4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/AUTHORS @@ -0,0 +1,25 @@ +aldrik +andreagrandi +bmw +dimasad +emulbreh +felixonmars +gnebehay +gotcha +IxDay +JamshedVesuna +kynan +lebedov +marciomazza +mauritsvanrees +msabramo +nikolas +omergertel +pgularski +pjdelport +Psycojoker +sas23 +steinnes +Wilfred +WouterVH +zvodd diff --git a/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/COPYING.txt b/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/COPYING.txt new file mode 100644 index 00000000..2e6b9777 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/COPYING.txt @@ -0,0 +1,30 @@ +Copyright (c) 2007-2019 ipdb development team + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +Neither the name of the ipdb Development Team nor the names of its +contributors may be used to endorse or promote products derived from this +software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/INSTALLER b/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/METADATA b/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/METADATA new file mode 100644 index 00000000..b59c7699 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/METADATA @@ -0,0 +1,496 @@ +Metadata-Version: 2.1 +Name: ipdb +Version: 0.13.3 +Summary: IPython-enabled pdb +Home-page: https://github.com/gotcha/ipdb +Author: Godefroid Chapelle +Author-email: gotcha@bubblenet.be +License: BSD +Keywords: pdb ipython +Platform: UNKNOWN +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Operating System :: MacOS :: MacOS X +Classifier: Operating System :: POSIX :: Linux +Classifier: Operating System :: Microsoft :: Windows +Classifier: Topic :: Software Development :: Debuggers +Classifier: License :: OSI Approved :: BSD License +Requires-Python: >=2.7 +Requires-Dist: setuptools +Requires-Dist: ipython (<6.0.0,>=5.1.0) ; python_version == "2.7" +Requires-Dist: ipython (>=5.1.0) ; python_version >= "3.4" + +IPython `pdb` +============= + +.. image:: https://travis-ci.org/gotcha/ipdb.png?branch=master + :target: https://travis-ci.org/gotcha/ipdb +.. image:: https://codecov.io/gh/gotcha/ipdb/branch/master/graphs/badge.svg?style=flat + :target: https://codecov.io/gh/gotcha/ipdb?branch=master + +Use +--- + +ipdb exports functions to access the IPython_ debugger, which features +tab completion, syntax highlighting, better tracebacks, better introspection +with the same interface as the `pdb` module. + +Example usage: + +.. code-block:: python + + import ipdb + ipdb.set_trace() + ipdb.set_trace(context=5) # will show five lines of code + # instead of the default three lines + # or you can set it via IPDB_CONTEXT_SIZE env variable + # or setup.cfg file + ipdb.pm() + ipdb.run('x[0] = 3') + result = ipdb.runcall(function, arg0, arg1, kwarg='foo') + result = ipdb.runeval('f(1,2) - 3') + + +Arguments for `set_trace` ++++++++++++++++++++++++++ + +The `set_trace` function accepts `context` which will show as many lines of code as defined, +and `cond`, which accepts boolean values (such as `abc == 17`) and will start ipdb's +interface whenever `cond` equals to `True`. + +Using configuration file +++++++++++++++++++++++++ + +It's possible to set up context using a `.ipdb` file on your home folder or `setup.cfg` +on your project folder. You can also set your file location via env var `$IPDB_CONFIG`. +Your environment variable has priority over the home configuration file, +which in turn has priority over the setup config file. Currently, only context setting +is available. + +A valid setup.cfg is as follows + +:: + + [ipdb] + context=5 + + +A valid .ipdb is as follows + +:: + + context=5 + + +The post-mortem function, ``ipdb.pm()``, is equivalent to the magic function +``%debug``. + +.. _IPython: http://ipython.org + +If you install ``ipdb`` with a tool which supports ``setuptools`` entry points, +an ``ipdb`` script is made for you. You can use it to debug your python 2 scripts like + +:: + + $ bin/ipdb mymodule.py + +And for python 3 + +:: + + $ bin/ipdb3 mymodule.py + +Alternatively with Python 2.7 only, you can also use + +:: + + $ python -m ipdb mymodule.py + +You can also enclose code with the ``with`` statement to launch ipdb if an exception is raised: + +.. code-block:: python + + from ipdb import launch_ipdb_on_exception + + with launch_ipdb_on_exception(): + [...] + +.. warning:: + Context managers were introduced in Python 2.5. + Adding a context manager implies dropping Python 2.4 support. + Use ``ipdb==0.6`` with 2.4. + +.. warning:: + Using ``from future import print_function`` for Python 3 compat implies dropping Python 2.5 support. + Use ``ipdb<=0.8`` with 2.5. + +Issues with ``stdout`` +---------------------- + +Some tools, like ``nose`` fiddle with ``stdout``. + +Until ``ipdb==0.9.4``, we tried to guess when we should also +fiddle with ``stdout`` to support those tools. +However, all strategies tried until 0.9.4 have proven brittle. + +If you use ``nose`` or another tool that fiddles with ``stdout``, you should +explicitly ask for ``stdout`` fiddling by using ``ipdb`` like this + +.. code-block:: python + + import ipdb + ipdb.sset_trace() + ipdb.spm() + + from ipdb import slaunch_ipdb_on_exception + with slaunch_ipdb_on_exception(): + [...] + + +Development +----------- + +``ipdb`` source code and tracker are at https://github.com/gotcha/ipdb. + +Pull requests should take care of updating the changelog ``HISTORY.txt``. + +Manual testing +++++++++++++++ + +To test your changes, make use of ``manual_test.py``. Create a virtual environment, +install IPython and run ``python manual_test.py`` and check if your changes are in effect. +If possible, create automated tests for better behaviour control. + +Third-party support +------------------- + +Products.PDBDebugMode ++++++++++++++++++++++ + +Zope2 Products.PDBDebugMode_ uses ``ipdb``, if available, in place of ``pdb``. + +.. _Products.PDBDebugMode: http://pypi.python.org/pypi/Products.PDBDebugMode + +iw.debug +++++++++ + +iw.debug_ allows you to trigger an ``ipdb`` debugger on any published object +of a Zope2 application. + +.. _iw.debug: http://pypi.python.org/pypi/iw.debug + +ipdbplugin +++++++++++ + +ipdbplugin_ is a nose_ test runner plugin that also uses the IPython debugger +instead of ``pdb``. (It does not depend on ``ipdb`` anymore). + +.. _ipdbplugin: http://pypi.python.org/pypi/ipdbplugin +.. _nose: http://readthedocs.org/docs/nose + + +Changelog +========= + +0.13.3 (2020-06-23) +------------------- + +- Allow runcall, runeval to also use set context value + [meowser] + +- Add condition argument to set_trace + [alexandrebarbaruiva] + + +0.13.2 (2020-03-03) +------------------- + +- Remove leftover debug code + [gotcha] + + +0.13.1 (2020-02-28) +------------------- + +- Fix when no configuration file + [gotcha] + + +0.13.0 (2020-02-28) +------------------- + +- Add option to set context via environment variable or configuration file + [alexandrebarbaruiva] + + +0.12.3 (2019-12-03) +------------------- + +- Fix version in usage + [gotcha] + + +0.12.2 (2019-07-30) +------------------- + +- Avoid emitting term-title bytes + [steinnes] + + +0.12.1 (2019-07-26) +------------------- + +- Fix --help + [native-api] + + +0.12 (2019-03-20) +----------------- + +- Drop support for Python 3.3.x + [bmw] +- Stop deprecation warnings from being raised when IPython >= 5.1 is used. + Support for IPython < 5.1 has been dropped. + [bmw] + + +0.11 (2018-02-15) +----------------- + +- Simplify loading IPython and getting information from it. + Drop support for python 2.6 + Drop support for IPython < 5.0.0 + [takluyver] + + +0.10.3 (2017-04-22) +------------------- + +- For users using python 2.6, do not install IPython >= 2.0.0. + And for users using python 2.7, do not install IPython >= 6.0.0. + [vphilippon] +- Drop support for python 3.2. + [vphilippon] +- Command line usage consistent with pdb - Add argument commands + [zvodd] + + +0.10.2 (2017-01-25) +------------------- + +- Ask IPython which debugger class to use. + Closes https://github.com/gotcha/ipdb/issues/105 + [gnebehay, JBKahn] + +- ipdb.set_trace() does not ignore context arg anymore. + Closes https://github.com/gotcha/ipdb/issues/93. + [gnebehay, Garrett-R] + + +0.10.1 (2016-06-14) +------------------- + +- Support IPython 5.0. + [ngoldbaum] + + +0.10.0 (2016-04-29) +------------------- + +- Stop trying to magically guess when stdout needs to be captured. + Like needed by `nose`. + Rather, provide a set of function that can be called explicitely when needed. + [gotcha] + +- drop support of IPython before 0.10.2 + + +0.9.4 (2016-04-29) +------------------ + +- Fix Restart error when using `python -m ipdb` + Closes https://github.com/gotcha/ipdb/issues/93. + [gotcha] + + +0.9.3 (2016-04-15) +------------------ + +- Don't require users to pass a traceback to post_mortem. + [Wilfred] + + +0.9.2 (2016-04-15) +------------------ + +- Closes https://github.com/gotcha/ipdb/issues/93. + [gotcha] + + +0.9.1 (2016-04-12) +------------------ + +- Reset ``sys.modules['__main__']`` to original value. + Closes https://github.com/gotcha/ipdb/issues/85 + [gotcha] + +- Fix support of IPython versions 0.x + [asivokon] + + +0.9.0 (2016-02-22) +------------------ + +- Switch to revised BSD license (with approval of all contributors). + Closes https://github.com/gotcha/ipdb/issues/68 + [lebedov, gotcha] + +0.8.3 (2016-02-17) +------------------ + +- Don't pass sys.argv to IPython for configuration. + [emulbreh] + + +0.8.2 (2016-02-15) +------------------ + +- Fix lexical comparison for version numbers. + [sas23] + +- Allow configuring how many lines of code context are displayed + by `set_trace` + [JamshedVesuna] + +- If an instance of IPython is already running its configuration will be + loaded. + [IxDay] + + +0.8.1 (2015-06-03) +------------------ + +- Make Nose support less invasive. + Closes https://github.com/gotcha/ipdb/issues/52 + Closes https://github.com/gotcha/ipdb/issues/31 + [blink1073, gotcha] + +- Fix for post_mortem in context manager. + Closes https://github.com/gotcha/ipdb/issues/20 + [omergertel] + + +0.8 (2013-09-19) +---------------- + +- More Python 3 compatibility; implies dropping Python 2.5 support. + Closes https://github.com/gotcha/ipdb/issues/37 + [gotcha] + + +0.7.1 (2013-09-19) +------------------ + +- IPython 1.0 compatibility. + Closes https://github.com/gotcha/ipdb/issues/44 + [pgularski] + +- Index into version_info in setup.py for Python 2.6 compatibility. + [kynan] + +- Add Travis CI configuration. + [kynan] + +0.7 (2012-07-06) +---------------- + +- Add ``launch_ipdb_on_exception`` context manager. Implies dropping Python 2.4 support. + [Psycojoker] + +- Wrap sys.excepthook only once. + [marciomazza] + +- Add GPL file and refer in headers. + [stan3] + +- Python 3 support. + [Piet Delport] + +- Basic tests. + [msabramo] + +- Added the functions ``runcall``, ``runeval`` and ``run``. + [dimasad] + + +0.6.1 (2011-10-17) +------------------ + +- State dependency on IPython later or equal to 0.10. + [gotcha] + + +0.6 (2011-09-01) +---------------- + +- Add setuptools ``console_scripts`` entry point. + [akrito, gotcha] + +- Nose support. + Closes https://github.com/gotcha/ipdb/issues/8 + [akaihola, gotcha] + + +0.5 (2011-08-05) +---------------- + +- IPython 0.11 support. + [lebedov] + + +0.4 (2011-06-13) +---------------- + +- When used from IPython, use its colors. + Closes https://github.com/gotcha/ipdb/issues/1 + [gotcha] + +- Fixed errors when exiting with "q". + [gotcha] + +- Allow use of ``python -m ipdb mymodule.py``. + Python 2.7 only. + Closes https://github.com/gotcha/ipdb/issues/3 + [gotcha] + +- Fixed post_mortem when the traceback is None. + [maurits] + + +0.3 (2011-01-16) +---------------- + +- Add ``post_mortem()`` for ``Products.PDBDebugMode`` support. + [Jean Jordaan] + +- Moved to github.com. + + +0.2 (2010-10-20) +---------------- + +- Added ``pm()``. + [Paulo Benedict Ang] + + +0.1 (2010-04-26) +---------------- + +- First "non dev" release. + + diff --git a/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/RECORD b/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/RECORD new file mode 100644 index 00000000..ae76179e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/RECORD @@ -0,0 +1,16 @@ +../../../bin/ipdb3,sha256=l_CbdfdqLRg4R5SokjBXY2AyKYoj78u4u4Ra8_3oa1s,241 +ipdb-0.13.3.dist-info/AUTHORS,sha256=ydCiqUOhYJXIEi2q1s1KRYGZz5-U_u6u5CPNk1XXEGs,227 +ipdb-0.13.3.dist-info/COPYING.txt,sha256=TutJ3gT0iU-OofaaBPUAeZBBt1Cz1VTAbeXKh3JY5zQ,1492 +ipdb-0.13.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +ipdb-0.13.3.dist-info/METADATA,sha256=fj4IZX3bq0N45VVgq4EqjMzMrVxafj__F3uiYpTrEPU,10963 +ipdb-0.13.3.dist-info/RECORD,, +ipdb-0.13.3.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92 +ipdb-0.13.3.dist-info/entry_points.txt,sha256=FLOujWgZeK4GBpGqhuTFcdcpJz2zkNmMdHwSzorcwDo,46 +ipdb-0.13.3.dist-info/top_level.txt,sha256=OywfuX9P9lvtyhERdr0WoH17GEyeYH9-sqs24Wtg394,5 +ipdb-0.13.3.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1 +ipdb/__init__.py,sha256=pvW5dKmnY1tidsUG2BpFcxLxiYtzou40s9IQlUahorc,507 +ipdb/__main__.py,sha256=S1OJ9SQzOOt6oot0n0DpFVbErHo_6kwEScAkQHHhWIw,8807 +ipdb/__pycache__/__init__.cpython-38.pyc,, +ipdb/__pycache__/__main__.cpython-38.pyc,, +ipdb/__pycache__/stdout.cpython-38.pyc,, +ipdb/stdout.py,sha256=p9qCDDwSFj6A3hA8PIAJff0r6OFASjZZxeLJoKENWXU,805 diff --git a/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/WHEEL b/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/WHEEL new file mode 100644 index 00000000..b552003f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.34.2) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/entry_points.txt b/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/entry_points.txt new file mode 100644 index 00000000..7481239f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/entry_points.txt @@ -0,0 +1,3 @@ +[console_scripts] +ipdb3 = ipdb.__main__:main + diff --git a/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/top_level.txt b/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/top_level.txt new file mode 100644 index 00000000..19168ea1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/top_level.txt @@ -0,0 +1 @@ +ipdb diff --git a/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/zip-safe b/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/zip-safe new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipdb-0.13.3.dist-info/zip-safe @@ -0,0 +1 @@ + diff --git a/.venv/lib/python3.8/site-packages/ipdb/__init__.py b/.venv/lib/python3.8/site-packages/ipdb/__init__.py new file mode 100644 index 00000000..fb0970e1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipdb/__init__.py @@ -0,0 +1,11 @@ +# Copyright (c) 2007-2016 Godefroid Chapelle and ipdb development team +# +# This file is part of ipdb. +# Redistributable under the revised BSD license +# https://opensource.org/licenses/BSD-3-Clause + +from ipdb.__main__ import set_trace, post_mortem, pm, run # noqa +from ipdb.__main__ import runcall, runeval, launch_ipdb_on_exception # noqa + +from ipdb.stdout import sset_trace, spost_mortem, spm # noqa +from ipdb.stdout import slaunch_ipdb_on_exception # noqa diff --git a/.venv/lib/python3.8/site-packages/ipdb/__main__.py b/.venv/lib/python3.8/site-packages/ipdb/__main__.py new file mode 100644 index 00000000..43603a1e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipdb/__main__.py @@ -0,0 +1,298 @@ +# Copyright (c) 2011-2016 Godefroid Chapelle and ipdb development team +# +# This file is part of ipdb. +# Redistributable under the revised BSD license +# https://opensource.org/licenses/BSD-3-Clause + +from __future__ import print_function +import os +import sys + +from contextlib import contextmanager + +__version__ = '0.13.3' + +from IPython import get_ipython +from IPython.core.debugger import BdbQuit_excepthook +from IPython.terminal.ipapp import TerminalIPythonApp +from IPython.terminal.embed import InteractiveShellEmbed +try: + import configparser +except: + import ConfigParser as configparser + + +shell = get_ipython() +if shell is None: + # Not inside IPython + # Build a terminal app in order to force ipython to load the + # configuration + ipapp = TerminalIPythonApp() + # Avoid output (banner, prints) + ipapp.interact = False + ipapp.initialize(['--no-term-title']) + shell = ipapp.shell +else: + # Running inside IPython + + # Detect if embed shell or not and display a message + if isinstance(shell, InteractiveShellEmbed): + sys.stderr.write( + "\nYou are currently into an embedded ipython shell,\n" + "the configuration will not be loaded.\n\n" + ) + +# Let IPython decide about which debugger class to use +# This is especially important for tools that fiddle with stdout +debugger_cls = shell.debugger_cls + + +def _init_pdb(context=None, commands=[]): + if context is None: + context = os.getenv("IPDB_CONTEXT_SIZE", get_context_from_config()) + try: + p = debugger_cls(context=context) + except TypeError: + p = debugger_cls() + p.rcLines.extend(commands) + return p + + +def wrap_sys_excepthook(): + # make sure we wrap it only once or we would end up with a cycle + # BdbQuit_excepthook.excepthook_ori == BdbQuit_excepthook + if sys.excepthook != BdbQuit_excepthook: + BdbQuit_excepthook.excepthook_ori = sys.excepthook + sys.excepthook = BdbQuit_excepthook + + +def set_trace(frame=None, context=None, cond=True): + if not cond: + return + wrap_sys_excepthook() + if frame is None: + frame = sys._getframe().f_back + p = _init_pdb(context).set_trace(frame) + if p and hasattr(p, 'shell'): + p.shell.restore_sys_module_state() + + +def get_context_from_config(): + try: + parser = get_config() + return parser.getint("ipdb", "context") + except (configparser.NoSectionError, configparser.NoOptionError): + return 3 + except ValueError: + value = parser.get("ipdb", "context") + raise ValueError( + "In %s, context value [%s] cannot be converted into an integer." + % (parser.filepath, value) + ) + + +class ConfigFile(object): + """ + Filehandle wrapper that adds a "[ipdb]" section to the start of a config + file so that users don't actually have to manually add a [ipdb] section. + Works with configparser versions from both Python 2 and 3 + """ + + def __init__(self, filepath): + self.first = True + with open(filepath) as f: + self.lines = f.readlines() + + # Python 2.7 (Older dot versions) + def readline(self): + try: + return self.__next__() + except StopIteration: + return '' + + # Python 2.7 (Newer dot versions) + def next(self): + return self.__next__() + + # Python 3 + def __iter__(self): + return self + + def __next__(self): + if self.first: + self.first = False + return "[ipdb]\n" + if self.lines: + return self.lines.pop(0) + raise StopIteration + + +def get_config(): + """ + Get ipdb config file settings. + All available config files are read. If settings are in multiple configs, + the last value encountered wins. Values specified on the command-line take + precedence over all config file settings. + Returns: A ConfigParser object. + """ + parser = configparser.ConfigParser() + + filepaths = [] + + # Low priority goes first in the list + for cfg_file in ("setup.cfg", ".ipdb"): + cwd_filepath = os.path.join(os.getcwd(), cfg_file) + if os.path.isfile(cwd_filepath): + filepaths.append(cwd_filepath) + + # Medium priority (whenever user wants to set a specific path to config file) + home = os.getenv("HOME") + if home: + default_filepath = os.path.join(home, ".ipdb") + if os.path.isfile(default_filepath): + filepaths.append(default_filepath) + + # High priority (default files) + env_filepath = os.getenv("IPDB_CONFIG") + if env_filepath and os.path.isfile(env_filepath): + filepaths.append(env_filepath) + + if filepaths: + # Python 3 has parser.read_file(iterator) while Python2 has + # parser.readfp(obj_with_readline) + try: + read_func = parser.read_file + except AttributeError: + read_func = parser.readfp + for filepath in filepaths: + parser.filepath = filepath + # Users are expected to put an [ipdb] section + # only if they use setup.cfg + if filepath.endswith('setup.cfg'): + with open(filepath) as f: + read_func(f) + else: + read_func(ConfigFile(filepath)) + return parser + + +def post_mortem(tb=None): + wrap_sys_excepthook() + p = _init_pdb() + p.reset() + if tb is None: + # sys.exc_info() returns (type, value, traceback) if an exception is + # being handled, otherwise it returns None + tb = sys.exc_info()[2] + if tb: + p.interaction(None, tb) + + +def pm(): + post_mortem(sys.last_traceback) + + +def run(statement, globals=None, locals=None): + _init_pdb().run(statement, globals, locals) + + +def runcall(*args, **kwargs): + return _init_pdb().runcall(*args, **kwargs) + + +def runeval(expression, globals=None, locals=None): + return _init_pdb().runeval(expression, globals, locals) + + +@contextmanager +def launch_ipdb_on_exception(): + try: + yield + except Exception: + e, m, tb = sys.exc_info() + print(m.__repr__(), file=sys.stderr) + post_mortem(tb) + finally: + pass + + +_usage = """\ +usage: python -m ipdb [-c command] ... pyfile [arg] ... + +Debug the Python program given by pyfile. + +Initial commands are read from .pdbrc files in your home directory +and in the current directory, if they exist. Commands supplied with +-c are executed after commands from .pdbrc files. + +To let the script run until an exception occurs, use "-c continue". +To let the script run up to a given line X in the debugged file, use +"-c 'until X'" +ipdb version %s.""" % __version__ + + +def main(): + import traceback + import sys + import getopt + + try: + from pdb import Restart + except ImportError: + class Restart(Exception): + pass + + opts, args = getopt.getopt(sys.argv[1:], 'hc:', ['help', 'command=']) + + commands = [] + for opt, optarg in opts: + if opt in ['-h', '--help']: + print(_usage) + sys.exit() + elif opt in ['-c', '--command']: + commands.append(optarg) + + if not args: + print(_usage) + sys.exit(2) + + mainpyfile = args[0] # Get script filename + if not os.path.exists(mainpyfile): + print('Error:', mainpyfile, 'does not exist') + sys.exit(1) + + sys.argv = args # Hide "pdb.py" from argument list + + # Replace pdb's dir with script's dir in front of module search path. + sys.path[0] = os.path.dirname(mainpyfile) + + # Note on saving/restoring sys.argv: it's a good idea when sys.argv was + # modified by the script being debugged. It's a bad idea when it was + # changed by the user from the command line. There is a "restart" command + # which allows explicit specification of command line arguments. + pdb = _init_pdb(commands=commands) + while 1: + try: + pdb._runscript(mainpyfile) + if pdb._user_requested_quit: + break + print("The program finished and will be restarted") + except Restart: + print("Restarting", mainpyfile, "with arguments:") + print("\t" + " ".join(sys.argv[1:])) + except SystemExit: + # In most cases SystemExit does not warrant a post-mortem session. + print("The program exited via sys.exit(). Exit status: ", end='') + print(sys.exc_info()[1]) + except: + traceback.print_exc() + print("Uncaught exception. Entering post mortem debugging") + print("Running 'cont' or 'step' will restart the program") + t = sys.exc_info()[2] + pdb.interaction(None, t) + print("Post mortem debugger finished. The " + mainpyfile + + " will be restarted") + + +if __name__ == '__main__': + main() diff --git a/.venv/lib/python3.8/site-packages/ipdb/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/ipdb/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..ab63abf6 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/ipdb/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/ipdb/__pycache__/__main__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/ipdb/__pycache__/__main__.cpython-38.pyc new file mode 100644 index 00000000..21d5172c Binary files /dev/null and b/.venv/lib/python3.8/site-packages/ipdb/__pycache__/__main__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/ipdb/__pycache__/stdout.cpython-38.pyc b/.venv/lib/python3.8/site-packages/ipdb/__pycache__/stdout.cpython-38.pyc new file mode 100644 index 00000000..d92d433b Binary files /dev/null and b/.venv/lib/python3.8/site-packages/ipdb/__pycache__/stdout.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/ipdb/stdout.py b/.venv/lib/python3.8/site-packages/ipdb/stdout.py new file mode 100644 index 00000000..933aa120 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipdb/stdout.py @@ -0,0 +1,39 @@ +from __future__ import print_function +import sys +from contextlib import contextmanager +from IPython.utils import io +from .__main__ import set_trace +from .__main__ import post_mortem + + +def update_stdout(): + # setup stdout to ensure output is available with nose + io.stdout = sys.stdout = sys.__stdout__ + + +def sset_trace(frame=None, context=3): + update_stdout() + if frame is None: + frame = sys._getframe().f_back + set_trace(frame, context) + + +def spost_mortem(tb=None): + update_stdout() + post_mortem(tb) + + +def spm(): + spost_mortem(sys.last_traceback) + + +@contextmanager +def slaunch_ipdb_on_exception(): + try: + yield + except Exception: + e, m, tb = sys.exc_info() + print(m.__repr__(), file=sys.stderr) + spost_mortem(tb) + finally: + pass diff --git a/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/DESCRIPTION.rst b/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/DESCRIPTION.rst new file mode 100644 index 00000000..ddd36ee1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/DESCRIPTION.rst @@ -0,0 +1,40 @@ + +IPython provides a rich toolkit to help you make the most out of using Python +interactively. Its main components are: + +* A powerful interactive Python shell +* A `Jupyter `_ kernel to work with Python code in Jupyter + notebooks and other interactive frontends. + +The enhanced interactive Python shells have the following main features: + +* Comprehensive object introspection. + +* Input history, persistent across sessions. + +* Caching of output results during a session with automatically generated + references. + +* Extensible tab completion, with support by default for completion of python + variables and keywords, filenames and function keywords. + +* Extensible system of 'magic' commands for controlling the environment and + performing many tasks related either to IPython or the operating system. + +* A rich configuration system with easy switching between different setups + (simpler than changing $PYTHONSTARTUP environment variables every time). + +* Session logging and reloading. + +* Extensible syntax processing for special purpose situations. + +* Access to the system shell with user-extensible alias system. + +* Easily embeddable in other Python programs and GUIs. + +* Integrated access to the pdb debugger and the Python profiler. + +The latest development version is always available from IPython's `GitHub +site `_. + + diff --git a/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/INSTALLER b/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/LICENSE.txt b/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/LICENSE.txt new file mode 100644 index 00000000..d4bb8d39 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/LICENSE.txt @@ -0,0 +1,33 @@ +BSD 3-Clause License + +- Copyright (c) 2008-Present, IPython Development Team +- Copyright (c) 2001-2007, Fernando Perez +- Copyright (c) 2001, Janko Hauser +- Copyright (c) 2001, Nathaniel Gray + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/METADATA b/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/METADATA new file mode 100644 index 00000000..70d975df --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/METADATA @@ -0,0 +1,125 @@ +Metadata-Version: 2.0 +Name: ipython +Version: 7.16.1 +Summary: IPython: Productive Interactive Computing +Home-page: https://ipython.org +Author: The IPython Development Team +Author-email: ipython-dev@python.org +License: BSD +Project-URL: Documentation, https://ipython.readthedocs.io/ +Project-URL: Funding, https://numfocus.org/ +Project-URL: Source, https://github.com/ipython/ipython +Project-URL: Tracker, https://github.com/ipython/ipython/issues +Keywords: Interactive,Interpreter,Shell,Embedding +Platform: Linux +Platform: Mac OSX +Platform: Windows +Classifier: Framework :: IPython +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: Science/Research +Classifier: License :: OSI Approved :: BSD License +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Topic :: System :: Shells +Requires-Python: >=3.6 +Provides-Extra: parallel +Provides-Extra: qtconsole +Provides-Extra: doc +Provides-Extra: test +Provides-Extra: terminal +Provides-Extra: kernel +Provides-Extra: nbformat +Provides-Extra: notebook +Provides-Extra: nbconvert +Provides-Extra: all +Requires-Dist: setuptools (>=18.5) +Requires-Dist: jedi (>=0.10) +Requires-Dist: decorator +Requires-Dist: pickleshare +Requires-Dist: traitlets (>=4.2) +Requires-Dist: prompt-toolkit (!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0) +Requires-Dist: pygments +Requires-Dist: backcall +Requires-Dist: pexpect; sys_platform != "win32" +Requires-Dist: appnope; sys_platform == "darwin" +Requires-Dist: colorama; sys_platform == "win32" +Provides-Extra: all +Requires-Dist: Sphinx (>=1.3); extra == 'all' +Requires-Dist: ipykernel; extra == 'all' +Requires-Dist: ipyparallel; extra == 'all' +Requires-Dist: ipywidgets; extra == 'all' +Requires-Dist: nbconvert; extra == 'all' +Requires-Dist: nbformat; extra == 'all' +Requires-Dist: nose (>=0.10.1); extra == 'all' +Requires-Dist: notebook; extra == 'all' +Requires-Dist: numpy (>=1.14); extra == 'all' +Requires-Dist: pygments; extra == 'all' +Requires-Dist: qtconsole; extra == 'all' +Requires-Dist: requests; extra == 'all' +Requires-Dist: testpath; extra == 'all' +Provides-Extra: doc +Requires-Dist: Sphinx (>=1.3); extra == 'doc' +Provides-Extra: kernel +Requires-Dist: ipykernel; extra == 'kernel' +Provides-Extra: nbconvert +Requires-Dist: nbconvert; extra == 'nbconvert' +Provides-Extra: nbformat +Requires-Dist: nbformat; extra == 'nbformat' +Provides-Extra: notebook +Requires-Dist: notebook; extra == 'notebook' +Requires-Dist: ipywidgets; extra == 'notebook' +Provides-Extra: parallel +Requires-Dist: ipyparallel; extra == 'parallel' +Provides-Extra: qtconsole +Requires-Dist: qtconsole; extra == 'qtconsole' +Provides-Extra: terminal +Provides-Extra: test +Requires-Dist: nose (>=0.10.1); extra == 'test' +Requires-Dist: requests; extra == 'test' +Requires-Dist: testpath; extra == 'test' +Requires-Dist: pygments; extra == 'test' +Requires-Dist: nbformat; extra == 'test' +Requires-Dist: ipykernel; extra == 'test' +Requires-Dist: numpy (>=1.14); extra == 'test' + + +IPython provides a rich toolkit to help you make the most out of using Python +interactively. Its main components are: + +* A powerful interactive Python shell +* A `Jupyter `_ kernel to work with Python code in Jupyter + notebooks and other interactive frontends. + +The enhanced interactive Python shells have the following main features: + +* Comprehensive object introspection. + +* Input history, persistent across sessions. + +* Caching of output results during a session with automatically generated + references. + +* Extensible tab completion, with support by default for completion of python + variables and keywords, filenames and function keywords. + +* Extensible system of 'magic' commands for controlling the environment and + performing many tasks related either to IPython or the operating system. + +* A rich configuration system with easy switching between different setups + (simpler than changing $PYTHONSTARTUP environment variables every time). + +* Session logging and reloading. + +* Extensible syntax processing for special purpose situations. + +* Access to the system shell with user-extensible alias system. + +* Easily embeddable in other Python programs and GUIs. + +* Integrated access to the pdb debugger and the Python profiler. + +The latest development version is always available from IPython's `GitHub +site `_. + + diff --git a/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/RECORD b/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/RECORD new file mode 100644 index 00000000..900b2eca --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/RECORD @@ -0,0 +1,630 @@ +../../../bin/iptest,sha256=P3mfzGr8Nauaab1DyyRqrslAiw3vS2SmJKA17072lqc,260 +../../../bin/iptest3,sha256=P3mfzGr8Nauaab1DyyRqrslAiw3vS2SmJKA17072lqc,260 +../../../bin/ipython,sha256=ShNH6-hjP8YjKXmnmveAtLXlNUW8wa7m0xBy8Af9xiM,253 +../../../bin/ipython3,sha256=ShNH6-hjP8YjKXmnmveAtLXlNUW8wa7m0xBy8Af9xiM,253 +../../../share/man/man1/ipython.1.gz,sha256=ytj4xaQjvrXq9YVcC0VmwjyRD4HDwMFNE3kKMB3A2tY,1039 +IPython/__init__.py,sha256=vciKUm-9XAGKaKlH-uEzLJA2GlCRhjoDM59Ih9nEzZw,5818 +IPython/__main__.py,sha256=hYwNY5SSIZN3D1P1UJV-N78biipfu4DCLLLzQvnpHMg,464 +IPython/__pycache__/__init__.cpython-38.pyc,, +IPython/__pycache__/__main__.cpython-38.pyc,, +IPython/__pycache__/config.cpython-38.pyc,, +IPython/__pycache__/conftest.cpython-38.pyc,, +IPython/__pycache__/consoleapp.cpython-38.pyc,, +IPython/__pycache__/display.cpython-38.pyc,, +IPython/__pycache__/frontend.cpython-38.pyc,, +IPython/__pycache__/html.cpython-38.pyc,, +IPython/__pycache__/nbconvert.cpython-38.pyc,, +IPython/__pycache__/nbformat.cpython-38.pyc,, +IPython/__pycache__/parallel.cpython-38.pyc,, +IPython/__pycache__/paths.cpython-38.pyc,, +IPython/__pycache__/qt.cpython-38.pyc,, +IPython/config.py,sha256=0HuY_gYXvIcuSeDR3IF5DgFeIVZmKVtKdc031jubZdo,642 +IPython/conftest.py,sha256=MJbWNJdC6xDlI0c4ly8sg_K2BAYoKogvSKmGWV5tU6I,2040 +IPython/consoleapp.py,sha256=JykFsZuW_qOIARJHknArAzc9wyC1HGUD2HvmVhzPc_0,415 +IPython/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/core/__pycache__/__init__.cpython-38.pyc,, +IPython/core/__pycache__/alias.cpython-38.pyc,, +IPython/core/__pycache__/application.cpython-38.pyc,, +IPython/core/__pycache__/async_helpers.cpython-38.pyc,, +IPython/core/__pycache__/autocall.cpython-38.pyc,, +IPython/core/__pycache__/builtin_trap.cpython-38.pyc,, +IPython/core/__pycache__/compilerop.cpython-38.pyc,, +IPython/core/__pycache__/completer.cpython-38.pyc,, +IPython/core/__pycache__/completerlib.cpython-38.pyc,, +IPython/core/__pycache__/crashhandler.cpython-38.pyc,, +IPython/core/__pycache__/debugger.cpython-38.pyc,, +IPython/core/__pycache__/display.cpython-38.pyc,, +IPython/core/__pycache__/display_trap.cpython-38.pyc,, +IPython/core/__pycache__/displayhook.cpython-38.pyc,, +IPython/core/__pycache__/displaypub.cpython-38.pyc,, +IPython/core/__pycache__/error.cpython-38.pyc,, +IPython/core/__pycache__/events.cpython-38.pyc,, +IPython/core/__pycache__/excolors.cpython-38.pyc,, +IPython/core/__pycache__/extensions.cpython-38.pyc,, +IPython/core/__pycache__/formatters.cpython-38.pyc,, +IPython/core/__pycache__/getipython.cpython-38.pyc,, +IPython/core/__pycache__/history.cpython-38.pyc,, +IPython/core/__pycache__/historyapp.cpython-38.pyc,, +IPython/core/__pycache__/hooks.cpython-38.pyc,, +IPython/core/__pycache__/inputsplitter.cpython-38.pyc,, +IPython/core/__pycache__/inputtransformer.cpython-38.pyc,, +IPython/core/__pycache__/inputtransformer2.cpython-38.pyc,, +IPython/core/__pycache__/interactiveshell.cpython-38.pyc,, +IPython/core/__pycache__/latex_symbols.cpython-38.pyc,, +IPython/core/__pycache__/logger.cpython-38.pyc,, +IPython/core/__pycache__/macro.cpython-38.pyc,, +IPython/core/__pycache__/magic.cpython-38.pyc,, +IPython/core/__pycache__/magic_arguments.cpython-38.pyc,, +IPython/core/__pycache__/oinspect.cpython-38.pyc,, +IPython/core/__pycache__/page.cpython-38.pyc,, +IPython/core/__pycache__/payload.cpython-38.pyc,, +IPython/core/__pycache__/payloadpage.cpython-38.pyc,, +IPython/core/__pycache__/prefilter.cpython-38.pyc,, +IPython/core/__pycache__/profileapp.cpython-38.pyc,, +IPython/core/__pycache__/profiledir.cpython-38.pyc,, +IPython/core/__pycache__/prompts.cpython-38.pyc,, +IPython/core/__pycache__/pylabtools.cpython-38.pyc,, +IPython/core/__pycache__/release.cpython-38.pyc,, +IPython/core/__pycache__/shellapp.cpython-38.pyc,, +IPython/core/__pycache__/splitinput.cpython-38.pyc,, +IPython/core/__pycache__/ultratb.cpython-38.pyc,, +IPython/core/__pycache__/usage.cpython-38.pyc,, +IPython/core/alias.py,sha256=S7q-haVF8diea8Fre7mo2N7IqsjfxTd2zA4fI3rZmkM,10034 +IPython/core/application.py,sha256=CXqz59rWjmAITC1qYhHHl-aZUIy1LkVLzmwasHrzQmA,18500 +IPython/core/async_helpers.py,sha256=ZvqOLyx1TLAIeongih5zkTHw64JmjQx_ElzxiLA_Qfs,4998 +IPython/core/autocall.py,sha256=cOlT7Oqj7Yps7yjUHw7oLTBsvF7NxZpVefCJGLBQNTM,2008 +IPython/core/builtin_trap.py,sha256=2kYS2hoQQ0eDFQAJE9XTp_sQrBVyadDFO2rdPXZbv2I,3009 +IPython/core/compilerop.py,sha256=hKs-dzSSGtVBprXTVO0Qspz-CzVPKmGa884h5ysmwtw,6238 +IPython/core/completer.py,sha256=KvbvwalmVtxCRXaXlmOV1TcVrtHqIBuciarVdVp2QIU,73227 +IPython/core/completerlib.py,sha256=PpHuSmWz6iPs_tmDHBLmmwPnv7x4rwGRX9XiUa-dckE,11807 +IPython/core/crashhandler.py,sha256=kETqm5hctuxgTHn1ZR2Q9FaStgvlIdWcPH-zQJirhkw,8299 +IPython/core/debugger.py,sha256=XkwduT2S3AKhsgE5JfsvRIXrs5jf4uSognYqjsKfQ1M,28459 +IPython/core/display.py,sha256=iFYj2MjMJFwP9svYvhQ16KMkcvvRy6k8ASDw0H6YG7c,51728 +IPython/core/display_trap.py,sha256=31jM26B3PhNSLJhpyRHuTWscObwVMOlH9PDC2v8HmsU,2098 +IPython/core/displayhook.py,sha256=ZQ4W8D-QdTbQeYoJxR0RdVWXkJPx-rFeTqZQOnr4928,12620 +IPython/core/displaypub.py,sha256=3lrKOHwv5viV5U9N-FqOkueM1delBKArIgcTsUrZkZY,4932 +IPython/core/error.py,sha256=lL5WP3E0sGNWkBTQL0u795wLQJCSrDCf328ft8TfCjk,1734 +IPython/core/events.py,sha256=XzOOVK8mjVOKdtQfIwEh-c2v-7eZ2UxBwbNF_Djbksw,5326 +IPython/core/excolors.py,sha256=54J1cY9AS9C8yRnfkShCrrRflAHEIP76T-r3RUB8UmI,5689 +IPython/core/extensions.py,sha256=PemZfQpNVcH0nQVFGzlKtBS1lGmpoQW2_VDga0_UbzM,5982 +IPython/core/formatters.py,sha256=M7BHaILc4BdAO2DBaODW_CXI2tJqsLiBMIqbQrmPaCw,34964 +IPython/core/getipython.py,sha256=BoeLWV2b60Jdu3rB3lbkJkwbuNXOpIsyIhpBOoyh2L4,916 +IPython/core/history.py,sha256=CAKVflcVN6k4QkZ6aJq1KpygMd0fhmTe75_3ZKmzbBM,32899 +IPython/core/historyapp.py,sha256=9Mai4CZRppz9bPAJ7BJYYfxDiQdUKzSWB4c7YU0JXL0,5969 +IPython/core/hooks.py,sha256=fFB7YS9qK8pHcrWEqDl5C1S2xsJ855c1jehpetbCKf8,6137 +IPython/core/inputsplitter.py,sha256=CjpZAPknPfCtlXJKHyelJiCnCMTwnO99i3vNJ0H5Fy8,28155 +IPython/core/inputtransformer.py,sha256=q-KQo_gK505gPqJTMAUkcuis7ipxsvlrT5qXxs37Uck,18292 +IPython/core/inputtransformer2.py,sha256=o65j6Xl4P4zkmnBH9i7LKx7TCVHYFM4A9PHsE95Ndts,26527 +IPython/core/interactiveshell.py,sha256=9RZAh0UTVBnQhxfaNhkKlMDvOCD0okscAFebHyW5Ro4,150761 +IPython/core/latex_symbols.py,sha256=YiIWrYezmqutOkwydHg7VVWyNVjPaL6uqfF_iyGEhbk,31288 +IPython/core/logger.py,sha256=5C2oc3-VbWQbSgAgAks1zVd2OhxYryiVwThmtnFJMls,7930 +IPython/core/macro.py,sha256=83KmGTzviEMXNLAzfdL-Mwi47zAGmbpFjDSnYPNYpfM,1734 +IPython/core/magic.py,sha256=sqxT6_IST_rnH5K6wjvXFyoChjUIwwPbrHfHaPOfWXE,26461 +IPython/core/magic_arguments.py,sha256=BI5_lznxvpumUhJbcWbFePt8AzsS0KwIFTcfmrJDcSI,8865 +IPython/core/magics/__init__.py,sha256=pkd-UfzjDGp5UHuFKjw192vZnigpTP9ftXzG3oLdiS8,1619 +IPython/core/magics/__pycache__/__init__.cpython-38.pyc,, +IPython/core/magics/__pycache__/auto.cpython-38.pyc,, +IPython/core/magics/__pycache__/basic.cpython-38.pyc,, +IPython/core/magics/__pycache__/code.cpython-38.pyc,, +IPython/core/magics/__pycache__/config.cpython-38.pyc,, +IPython/core/magics/__pycache__/display.cpython-38.pyc,, +IPython/core/magics/__pycache__/execution.cpython-38.pyc,, +IPython/core/magics/__pycache__/extension.cpython-38.pyc,, +IPython/core/magics/__pycache__/history.cpython-38.pyc,, +IPython/core/magics/__pycache__/logging.cpython-38.pyc,, +IPython/core/magics/__pycache__/namespace.cpython-38.pyc,, +IPython/core/magics/__pycache__/osm.cpython-38.pyc,, +IPython/core/magics/__pycache__/packaging.cpython-38.pyc,, +IPython/core/magics/__pycache__/pylab.cpython-38.pyc,, +IPython/core/magics/__pycache__/script.cpython-38.pyc,, +IPython/core/magics/auto.py,sha256=TYkb7IF1xy8Ibi3cMUj4nYJaVfAO52UZ2LH-5lAcXnE,4315 +IPython/core/magics/basic.py,sha256=DXHizGrxmK9ApTlhI-viPg4EuZdn-QEzBrbuSfj_Lhg,23017 +IPython/core/magics/code.py,sha256=ijlMuAsJa4PJz7MSeUwRaWxmv8y2cl3L8FAcs6skTt0,27149 +IPython/core/magics/config.py,sha256=4oHXTIeIAx7Dymoahv5H7gMvfy3AwKoAgLVJut5g_Os,6003 +IPython/core/magics/display.py,sha256=cHh1PGqKQCARDFT4I_BqfYsXNXVgD1xxR8mC3JOEu50,2748 +IPython/core/magics/execution.py,sha256=LD3UrtOIRc8x7cFjHFpAqKgxny4e1KMjMg7aRtfj0Pg,57595 +IPython/core/magics/extension.py,sha256=t8lImzLgOuo6S626JHf6NsMgBXMDLlesB1phYG_tOa8,2485 +IPython/core/magics/history.py,sha256=FMazxuTwEv4faYLKZhudtCS3TtnYF6jRdGDht5_OPX0,12131 +IPython/core/magics/logging.py,sha256=eUWzo8aRqmhmbxsjmJYoGdKpf1PtTvyNxafrrDZJSmg,6859 +IPython/core/magics/namespace.py,sha256=EKpFgu5HkTomad8catYGu8Q9sMwSPx4lGeq922n1uGo,24499 +IPython/core/magics/osm.py,sha256=yX_BPkcM-r2H600X0yQCoeXfX6Yqn9TE2vliNChbGJE,30489 +IPython/core/magics/packaging.py,sha256=0XlGgojMadb79aHhLY-mOH37bj8-lO4LTgtxf60orfc,3775 +IPython/core/magics/pylab.py,sha256=C64c4d2qEQJWLC8J6bGva98xtF-WAmIU4AebnDa3JiI,6448 +IPython/core/magics/script.py,sha256=IdFMupYV0FZQ2P94BfhnwXWoWwbX-qNslVXqK335sJk,9518 +IPython/core/oinspect.py,sha256=8ZUEhBtrwIe9BJ9BE6L9lchEAbxT6PYBTckht1yc9Gc,35183 +IPython/core/page.py,sha256=aK6Zh3tRkEo3fHvkNF3_lc7zDlJgbQ89GnUfkFKK2Mc,11636 +IPython/core/payload.py,sha256=SOvmxRbZgCI_fq4ZoOeMKsblk8rYsuHumUefk-3TaTI,1758 +IPython/core/payloadpage.py,sha256=gL-07cBWKTAaMc9acbgZOvUmB1_m4jfmiGx1yFnBqcw,1432 +IPython/core/prefilter.py,sha256=N8sqj-1MuTDoVb8C3tsAH5DMRj-ZflYZZQMsHMsrmrs,25893 +IPython/core/profile/README_STARTUP,sha256=Y47GtYQkWy6pdzkqylUNL6eBSZMUIRGwTxXPUF_BBBc,371 +IPython/core/profileapp.py,sha256=ANlpgfGlsp0fN6lX2Jo3PHQq0H4qtaX9UzgLMZzeYCs,10635 +IPython/core/profiledir.py,sha256=MbPWVmtkG-V78FICt2hceQui8A4YBfeUIFxkGFkXCBo,7948 +IPython/core/prompts.py,sha256=3icFefY5NVob6-JeUORH_uRK1h4JTygC3oH1HbN4Q0Q,607 +IPython/core/pylabtools.py,sha256=Nh0wd1SbRmQE-3ESV8n7F4-8womjmZD6921orShX0TM,14460 +IPython/core/release.py,sha256=9DpnrzMmvHG3hSOssjcOBi8NMdZri4p67ZwT0HHzv6A,4273 +IPython/core/shellapp.py,sha256=Y15gAUKnVxGGVX6_vVQtol6IJtHhJa5sUuKBS20q170,17635 +IPython/core/splitinput.py,sha256=JRM5bw-xD4DbEfi6k_RxFJxf8gzeSugC6UOuHinH7vk,4787 +IPython/core/tests/2x2.jpg,sha256=YF88a1SklCHZeEbuKL9H13TJM8t8myvSqgffxh7LgkY,331 +IPython/core/tests/2x2.png,sha256=ZB6RfzGIikj1RojC3sbJNIeiMAjbcfur9IvYVcfi2-I,71 +IPython/core/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/core/tests/__pycache__/__init__.cpython-38.pyc,, +IPython/core/tests/__pycache__/bad_all.cpython-38.pyc,, +IPython/core/tests/__pycache__/nonascii.cpython-38.pyc,, +IPython/core/tests/__pycache__/nonascii2.cpython-38.pyc,, +IPython/core/tests/__pycache__/print_argv.cpython-38.pyc,, +IPython/core/tests/__pycache__/refbug.cpython-38.pyc,, +IPython/core/tests/__pycache__/simpleerr.cpython-38.pyc,, +IPython/core/tests/__pycache__/tclass.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_alias.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_application.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_async_helpers.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_autocall.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_compilerop.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_completer.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_completerlib.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_debugger.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_display.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_displayhook.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_events.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_extension.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_formatters.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_handlers.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_history.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_hooks.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_imports.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_inputsplitter.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_inputtransformer.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_inputtransformer2.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_inputtransformer2_line.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_interactiveshell.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_iplib.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_logger.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_magic.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_magic_arguments.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_magic_terminal.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_oinspect.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_page.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_paths.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_prefilter.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_profile.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_prompts.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_pylabtools.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_run.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_shellapp.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_splitinput.cpython-38.pyc,, +IPython/core/tests/__pycache__/test_ultratb.cpython-38.pyc,, +IPython/core/tests/bad_all.py,sha256=GARnHj1buvbHLjoKLiEy7XTqvo91Xb7ckOrNqh8YsnY,206 +IPython/core/tests/daft_extension/__pycache__/daft_extension.cpython-38.pyc,, +IPython/core/tests/daft_extension/daft_extension.py,sha256=P1-QHT4a71h0vbRRPHItoFSTLySzH03tjXvBuEHdJFc,285 +IPython/core/tests/nonascii.py,sha256=xq_nEFXTB5twXO4Th9snKfceITMOUbm_LFJmfKRWrlo,135 +IPython/core/tests/nonascii2.py,sha256=D81kLhC1wGgYv9XjY89FKZSyKRz_rTAsKY9dOZ507cs,155 +IPython/core/tests/print_argv.py,sha256=gLlulK9hs-YwPvMAUCHzQ-BegTJKqOGMDpO2UMKmWwI,31 +IPython/core/tests/refbug.py,sha256=A9Usb4msz_SlT4MMjDoySvoJp-02ucc1mZ12IfmLKqw,1494 +IPython/core/tests/simpleerr.py,sha256=lR9umlaAHWgaYa_Sti1qBeIiOCg6JZ_TCYPibafU2H0,584 +IPython/core/tests/tclass.py,sha256=SqfWzMaQVWHQFPn7_DFI04yvATZcaxJlXAwf9aSoNE8,921 +IPython/core/tests/test_alias.py,sha256=WGiAvPHIb4yES6FjzdVh3OhOfFRIx4ehTkdzbZ2RyFI,2054 +IPython/core/tests/test_application.py,sha256=mErFcPx_bcRGK97-14uyoNdPMsUY2k3rnHPAT1rivpo,2264 +IPython/core/tests/test_async_helpers.py,sha256=L9Jdh1MDNJ-fY76MuB3KR1JDNRj43yFlwhRInYlFgfw,8892 +IPython/core/tests/test_autocall.py,sha256=ZWAkpwn256aOEse_IptWMew_Ju3E5UmcF7-Gvz1JvIs,1424 +IPython/core/tests/test_compilerop.py,sha256=w5WnyQh1G8Xfk01Xh9S-ao9Q_J9-1ySVREBnXJmdI6Q,2309 +IPython/core/tests/test_completer.py,sha256=US7ivJGINyStCtwaV6JTQziPO_Un853Zs_PZKuQQfdU,40097 +IPython/core/tests/test_completerlib.py,sha256=WYRlFB4qdwY4EAX8tPO6wsxITgBVwXletHR3kUdczZ4,5935 +IPython/core/tests/test_debugger.py,sha256=7fguk-3CjeTHTZiqDV6p0XllXgD4m2GoVNYuXSqNug4,8284 +IPython/core/tests/test_display.py,sha256=yzPP8ATiam9zflpClFF5_vzRcowrE7epe-P8LpWDZs0,15120 +IPython/core/tests/test_displayhook.py,sha256=H91rERKImgUp-8i_RXf6bEYE5eM2yynIWd20XNXcHcY,3591 +IPython/core/tests/test_events.py,sha256=M_jabi9AvdBtiiis0JWuRdY1ZTOb1tSnxVfgjpNVBVw,2822 +IPython/core/tests/test_extension.py,sha256=x4EDV3swwQMjMNv-i5f-vIF_qg6_jA5dCf4dRJ18BG4,3025 +IPython/core/tests/test_formatters.py,sha256=gldu48aStMfY4x3xcDAFcqfVattCFmgJ-J4SWiu7reo,15356 +IPython/core/tests/test_handlers.py,sha256=hrp42wW06fVseMNJC4zMBARPNuNRPEj4ruGpKIGtQFA,3180 +IPython/core/tests/test_history.py,sha256=5lIlcFdmwdaRGUzCSHs4YE-YiKKsZe4vCuO0leFjZNs,8698 +IPython/core/tests/test_hooks.py,sha256=PSkayNLhNt84mMZbEEPencZboh142Hl70GuxoxQrMiE,2452 +IPython/core/tests/test_imports.py,sha256=lR-_hRQC-AIe750c4k3AmCbN3spE-KaZevP2Cx8mzNY,1153 +IPython/core/tests/test_inputsplitter.py,sha256=MP4M0wJadZlbKVUhvRSJ-OAyldDOYzt9t6rwN3-4-vU,23149 +IPython/core/tests/test_inputtransformer.py,sha256=YdxVHAndUADHYR0zPwkOy29RNmt1D2UelAVibgXbFH4,16851 +IPython/core/tests/test_inputtransformer2.py,sha256=2rCnPJ7CDqK_EODYERCDpsYaDKVi1s1D9H10baZDedU,8732 +IPython/core/tests/test_inputtransformer2_line.py,sha256=FpGfcbWrxMq7Wo9fjmof_zAe54YLAqCIGh3fLnRnwXE,2438 +IPython/core/tests/test_interactiveshell.py,sha256=OqnXt5zADtQwj98pRjuwdgpwL0yVP5cWaMu4_Pmceoo,34697 +IPython/core/tests/test_iplib.py,sha256=LHAjWGUfqNmMmNKGF6A5ueB51U73pYJSyni1f73hak4,6107 +IPython/core/tests/test_logger.py,sha256=unNHQ0jDUG8JFnA8438gHD15D7gbcPoaZhmVY5-ikAQ,896 +IPython/core/tests/test_magic.py,sha256=w16t-UAhsWytpWs29-bwwjBrWWlMFEobhA1H2kdGrnA,36400 +IPython/core/tests/test_magic_arguments.py,sha256=JjPipcggYPBnC82NpQLE7YlL9XW5n8hpQc_2jFU04wc,4609 +IPython/core/tests/test_magic_terminal.py,sha256=iTOoidM21FjIraxOw8qceuv-eOQ_rbR1aUqcsMZUFwo,5631 +IPython/core/tests/test_oinspect.py,sha256=Qy05730_nXxlwQXc8Lwexxb-lHy-kQAWI6d-52SKrMs,12874 +IPython/core/tests/test_page.py,sha256=dA1r_xWG90NNDvtHpr11JxNUCc_E7QoIEgoUmMLvrdc,772 +IPython/core/tests/test_paths.py,sha256=Y02RajInRC6JcQCm4iUIRqOUaCxbg0-zsUQLeCyjSaQ,7408 +IPython/core/tests/test_prefilter.py,sha256=-LsXYWWG1HutvHjrRLqDL_CXVTid2IfLMVR2cMgMB3s,4290 +IPython/core/tests/test_profile.py,sha256=LfL8jUgdDjeV_6pky-Efh0ZcxUJVJEPppaHt97vfzMY,5315 +IPython/core/tests/test_prompts.py,sha256=jbga48K0Fg92Fx92k9JuKz5o74yhhoKP2dzrMKZ8Gy8,845 +IPython/core/tests/test_pylabtools.py,sha256=IwU-FjNqO3JzVa_8tbJ5dZC2iEMgG3QfdRRp-NrSvYU,7728 +IPython/core/tests/test_run.py,sha256=bHURC5UQxuswTh52QgqkhjgGltxSk9okPougPLRgctA,19315 +IPython/core/tests/test_shellapp.py,sha256=RNzxMUeaBXlVpPwIMbiVDTMeZy3S6W8uiin-AZs-dkk,2292 +IPython/core/tests/test_splitinput.py,sha256=ScQh6BZhXr8Gefg-VgaZHEa1a0DxlOZVhyviBVdlq_E,1267 +IPython/core/tests/test_ultratb.py,sha256=fmkZXkkJfYErMlYnSppmPboc6Ug25ao8Z5CPja7sHrE,13550 +IPython/core/ultratb.py,sha256=coTegkD2fbiKWwVFgQX4__U3OZ-dHt8B7L9REqAnP_Y,61276 +IPython/core/usage.py,sha256=U00m5DZTwnVTeB1o1FvO1v5EUTGM-K31aGZye9ApAR8,13542 +IPython/display.py,sha256=WWrylXrjp_tcnCV7_ofFkvUJeSTFmPvcGHp2YjjgRJc,638 +IPython/extensions/__init__.py,sha256=V4vSllFd18CVUvDTbXLYqfwTFmPXUiQZGCs5LX2IliE,78 +IPython/extensions/__pycache__/__init__.cpython-38.pyc,, +IPython/extensions/__pycache__/autoreload.cpython-38.pyc,, +IPython/extensions/__pycache__/cythonmagic.cpython-38.pyc,, +IPython/extensions/__pycache__/rmagic.cpython-38.pyc,, +IPython/extensions/__pycache__/storemagic.cpython-38.pyc,, +IPython/extensions/__pycache__/sympyprinting.cpython-38.pyc,, +IPython/extensions/autoreload.py,sha256=89Ad0G6CnsBqMyIscAArgsj2ghZHR_OwaY7JezTJnyQ,17596 +IPython/extensions/cythonmagic.py,sha256=ejUOCHfe-rPvpFjydn5XKIi1KR0e2cuT8FmPP49UovE,701 +IPython/extensions/rmagic.py,sha256=OWufuTd9ZH1wiFsBUmCSpB-57NWwDyYKyoExK7rswjg,455 +IPython/extensions/storemagic.py,sha256=Th3z_sK-Ovyu5YmTW17aJqSpUKd4O-no9VyARAo7rwI,7976 +IPython/extensions/sympyprinting.py,sha256=MgOEJxm1_dq1s-EgHmwJq6h5coPxrro5KgVOPnH2JHE,1075 +IPython/extensions/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/extensions/tests/__pycache__/__init__.cpython-38.pyc,, +IPython/extensions/tests/__pycache__/test_autoreload.cpython-38.pyc,, +IPython/extensions/tests/__pycache__/test_storemagic.cpython-38.pyc,, +IPython/extensions/tests/test_autoreload.py,sha256=JsyoYDyUdKJJ2g9dr96dBLZvFBzoSZJ0uCIQczHgCck,14037 +IPython/extensions/tests/test_storemagic.py,sha256=P2aiSxRUm9sxJQo47jRe2jD6p25GhULL5bGpnz-sw9o,2139 +IPython/external/__init__.py,sha256=_yj44pRNlv_qmC75qNNGcpSYuFQNYbXVjg4ct1ksRyQ,90 +IPython/external/__pycache__/__init__.cpython-38.pyc,, +IPython/external/__pycache__/mathjax.cpython-38.pyc,, +IPython/external/__pycache__/qt_for_kernel.cpython-38.pyc,, +IPython/external/__pycache__/qt_loaders.cpython-38.pyc,, +IPython/external/decorators/__init__.py,sha256=FJIqyNIN_54bH_iYr5vz_l4HAO0VjmSIRO7-ZESGQG8,235 +IPython/external/decorators/__pycache__/__init__.cpython-38.pyc,, +IPython/external/decorators/__pycache__/_decorators.cpython-38.pyc,, +IPython/external/decorators/__pycache__/_numpy_testing_noseclasses.cpython-38.pyc,, +IPython/external/decorators/_decorators.py,sha256=3UeRo4NRIkrUkwCxfm7ejmvFgDiIL6J0Z-rTG_qgkcI,4561 +IPython/external/decorators/_numpy_testing_noseclasses.py,sha256=reMU2uUBgO05UDZyYeVAKrD8rgr90_f372XSrHhWdUo,1482 +IPython/external/mathjax.py,sha256=mRPXlUCzevB5UNOt9ZmagOgqFcZ3_mox11SyjG4bmhM,308 +IPython/external/qt_for_kernel.py,sha256=EHm81TIS0t_fiyCFrlYc8NfDmkybz5mCX_0DiXXIBsk,3192 +IPython/external/qt_loaders.py,sha256=LveDhGS5bwDIjxaVSZdgC1Qoxedl8UCmUYD55oAPxTY,9550 +IPython/frontend.py,sha256=eiXPD2wQUwqvUOfw0u31by4I0dFW1dTsBfgsoXQcz0g,1123 +IPython/html.py,sha256=Yq0t-ATYyu1igxKRbqUZeRjfAt9Cdx0OfBY9TaPRIxY,839 +IPython/kernel/__init__.py,sha256=6IyXpYeQr4aRHY71NJ9FEQcOX-K6-mb_5sgGhWsodRc,1185 +IPython/kernel/__main__.py,sha256=g0QxcKzDBghAZZCtHwNuN8-M8CZ-Fsm4GEd3NcHYAE0,100 +IPython/kernel/__pycache__/__init__.cpython-38.pyc,, +IPython/kernel/__pycache__/__main__.cpython-38.pyc,, +IPython/kernel/__pycache__/adapter.cpython-38.pyc,, +IPython/kernel/__pycache__/channels.cpython-38.pyc,, +IPython/kernel/__pycache__/channelsabc.cpython-38.pyc,, +IPython/kernel/__pycache__/client.cpython-38.pyc,, +IPython/kernel/__pycache__/clientabc.cpython-38.pyc,, +IPython/kernel/__pycache__/connect.cpython-38.pyc,, +IPython/kernel/__pycache__/kernelspec.cpython-38.pyc,, +IPython/kernel/__pycache__/kernelspecapp.cpython-38.pyc,, +IPython/kernel/__pycache__/launcher.cpython-38.pyc,, +IPython/kernel/__pycache__/manager.cpython-38.pyc,, +IPython/kernel/__pycache__/managerabc.cpython-38.pyc,, +IPython/kernel/__pycache__/multikernelmanager.cpython-38.pyc,, +IPython/kernel/__pycache__/restarter.cpython-38.pyc,, +IPython/kernel/__pycache__/threaded.cpython-38.pyc,, +IPython/kernel/adapter.py,sha256=3dCsuiP9lr1Lq2YfvDrRgNm0GOjBjt0LUMrrU8APEM8,37 +IPython/kernel/channels.py,sha256=M53ZLUxwkafaVM1bszEA941orkQQw1hGS_N5t3piDW4,38 +IPython/kernel/channelsabc.py,sha256=NtDhImTF4XrX2Mtg4QHviVd2VDMqHrSBXVZuxJQUe6s,41 +IPython/kernel/client.py,sha256=RrRf2zQ-CP4ae8Gru8lWStNAdlmXj-F0_7t24dP8kt8,36 +IPython/kernel/clientabc.py,sha256=6ooLh9KR2yaDJA8zYBtBeYD8RBbW9Qm5vVazgriSU20,39 +IPython/kernel/connect.py,sha256=kcN4pqwkOP3F7DVxwcvgWk2qyg3q6CH8TI9JuHeZ1Uc,69 +IPython/kernel/kernelspec.py,sha256=3ObCeW9q6bHLJFNrFjaIxKjp3nNF2F7e6nH5FU2QYB0,40 +IPython/kernel/kernelspecapp.py,sha256=N1rGTvp__V0hh2E5EtbM3O8fHsxeT-3vlItbzIP8_eU,43 +IPython/kernel/launcher.py,sha256=dY7kU06LyzOuYesk7iG8-E-OK1oDai-VuidBQbSwjZg,38 +IPython/kernel/manager.py,sha256=YxuoOj-ZC942cxazsLp6ADn0AGmmUwqk1mtPRbQq_DM,37 +IPython/kernel/managerabc.py,sha256=227OmHeFTydyCFRwXeKTrvLuhGGwG859JBAH2LPZrow,40 +IPython/kernel/multikernelmanager.py,sha256=6juQjBFsnQ2VPXjTkdi2KBpzrsyL-eT-cSGKPY_TIEY,48 +IPython/kernel/restarter.py,sha256=AmwGbO_cZSaHJPw7K9yzgfkYdUma92ZNAn9a6QffmBA,39 +IPython/kernel/threaded.py,sha256=1dYwDvTjQYdWgUisF_PY-ORkWMsSCkcsZu2sf4D5C8s,38 +IPython/lib/__init__.py,sha256=OUVV-tTYPyqcEuZIiq8yu1KKRCW3dR8Xejff-bkp4VI,785 +IPython/lib/__pycache__/__init__.cpython-38.pyc,, +IPython/lib/__pycache__/backgroundjobs.cpython-38.pyc,, +IPython/lib/__pycache__/clipboard.cpython-38.pyc,, +IPython/lib/__pycache__/deepreload.cpython-38.pyc,, +IPython/lib/__pycache__/demo.cpython-38.pyc,, +IPython/lib/__pycache__/display.cpython-38.pyc,, +IPython/lib/__pycache__/editorhooks.cpython-38.pyc,, +IPython/lib/__pycache__/guisupport.cpython-38.pyc,, +IPython/lib/__pycache__/inputhook.cpython-38.pyc,, +IPython/lib/__pycache__/inputhookglut.cpython-38.pyc,, +IPython/lib/__pycache__/inputhookgtk.cpython-38.pyc,, +IPython/lib/__pycache__/inputhookgtk3.cpython-38.pyc,, +IPython/lib/__pycache__/inputhookpyglet.cpython-38.pyc,, +IPython/lib/__pycache__/inputhookqt4.cpython-38.pyc,, +IPython/lib/__pycache__/inputhookwx.cpython-38.pyc,, +IPython/lib/__pycache__/kernel.cpython-38.pyc,, +IPython/lib/__pycache__/latextools.cpython-38.pyc,, +IPython/lib/__pycache__/lexers.cpython-38.pyc,, +IPython/lib/__pycache__/pretty.cpython-38.pyc,, +IPython/lib/__pycache__/security.cpython-38.pyc,, +IPython/lib/backgroundjobs.py,sha256=IMkSj3eUGhFyIkMVXEHt9udPoSvKIviPJN_bIRGGmJ8,17747 +IPython/lib/clipboard.py,sha256=DYvE84V-cbQ2mFRMolgKWmWXBofmHGl2wtSZ-kVm7J8,2118 +IPython/lib/deepreload.py,sha256=ZSVl5CLRgi6AuYSstk5p4k4LzBrcNTUlOXF_zZCtEsc,10724 +IPython/lib/demo.py,sha256=rzaTNkr7MdQtomHk0LgBzaHKikwPV-UJsBPsbI9fPpY,24460 +IPython/lib/display.py,sha256=YDrefOM-ZPQjkkp7mjtDNMGP3ZJlOLmirxIAlJjpUrU,24175 +IPython/lib/editorhooks.py,sha256=YIgoOMKMUuKAMzKBnfJPWLwaPS2xGGmwCIqTOdiZMD0,3995 +IPython/lib/guisupport.py,sha256=ZnJMFxV-5Qe0Ai1QCuxXwk8i9e0FbFL2hoPt5P7CVYQ,6305 +IPython/lib/inputhook.py,sha256=1qaPzZNfEB55je51vctmnhWEZ4CX8ru32ucZHNM1c4Q,23594 +IPython/lib/inputhookglut.py,sha256=tvx1gDgYtnqcrLKmY6scfJfAXYnuPXO1Ak00nLLbBAg,6066 +IPython/lib/inputhookgtk.py,sha256=1HZSJx1pDuO2zISCH7OdhiuUs6B1ORbL_6lbwdusXYo,1020 +IPython/lib/inputhookgtk3.py,sha256=eXZ4N0wXU-razEs4c9rosHYgu0EWrP9xFZIbiLd3NYY,1038 +IPython/lib/inputhookpyglet.py,sha256=y--OU3aXWG46wXIVmKua66ZRVinNO00BS877AKW8NB4,3667 +IPython/lib/inputhookqt4.py,sha256=ko43EpvfbdGURlHxz_APrt3NDufnfZDI9dwurEHsk0U,6801 +IPython/lib/inputhookwx.py,sha256=1-3m6aY_7lptG26FQBggZEaqU5_8VBuSCqGvR2SjW6E,6064 +IPython/lib/kernel.py,sha256=hRZjXforDjnTiSKCPtcf5B2WZxfkHpK-F42jW8A75MM,297 +IPython/lib/latextools.py,sha256=xsVdUL-lBfFsgeh-bbJv83cqlO1TL0-qWENDEY_lN1A,7199 +IPython/lib/lexers.py,sha256=vQXSvjN_Ni3aqIvzodgnl-ZC0A0DCE4ezAW2GE2Nzxs,20451 +IPython/lib/pretty.py,sha256=vdDPlgecGT_nSzp9rSWH3OFRr8QUW6CwOEg0s-QOrqE,28407 +IPython/lib/security.py,sha256=y5wBv-VffhlFMrVlbmqrLIBh21T69LgVVI6SvpgY3IE,3297 +IPython/lib/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/lib/tests/__pycache__/__init__.cpython-38.pyc,, +IPython/lib/tests/__pycache__/test_backgroundjobs.cpython-38.pyc,, +IPython/lib/tests/__pycache__/test_clipboard.cpython-38.pyc,, +IPython/lib/tests/__pycache__/test_deepreload.cpython-38.pyc,, +IPython/lib/tests/__pycache__/test_display.cpython-38.pyc,, +IPython/lib/tests/__pycache__/test_editorhooks.cpython-38.pyc,, +IPython/lib/tests/__pycache__/test_imports.cpython-38.pyc,, +IPython/lib/tests/__pycache__/test_latextools.cpython-38.pyc,, +IPython/lib/tests/__pycache__/test_lexers.cpython-38.pyc,, +IPython/lib/tests/__pycache__/test_pretty.cpython-38.pyc,, +IPython/lib/tests/__pycache__/test_security.cpython-38.pyc,, +IPython/lib/tests/test.wav,sha256=y6O86Ch8OfzBfXicO8yG31DyYifGpYMPJgn-NTj1OS4,44144 +IPython/lib/tests/test_backgroundjobs.py,sha256=0ZFXkTGS_bLRq6oKUNsYmZZ9yvoNnNWkde-IidYE14A,2837 +IPython/lib/tests/test_clipboard.py,sha256=AnLmoitCr_nvhOBFgePIsNkyj8CDuzV36l2aKvd55tc,658 +IPython/lib/tests/test_deepreload.py,sha256=o7SAGHWrT8rmcRp8iR1-LE7YJNhv9RaDfCn5z_kzr7A,1132 +IPython/lib/tests/test_display.py,sha256=nGOaMfUiZMnHA_5v0hOEv2X2loeK_FRCEgj99_X84Eo,9461 +IPython/lib/tests/test_editorhooks.py,sha256=wZAfE4f-3-TtdhHmQY8o7lMVj3Yghj5mskBYwp51SaM,941 +IPython/lib/tests/test_imports.py,sha256=OOY3QsfXDfblB1_gnJHEux5PwzrQgu0ll3iw6dvMbP0,270 +IPython/lib/tests/test_latextools.py,sha256=x_FBbA1mokLPxcWByXFHtusVXzXDqKBHVCXz5FiAQNQ,5977 +IPython/lib/tests/test_lexers.py,sha256=GjpR161XOY4pMTYvhMR_oeTzhfT16s8M5F-UpXmF5CM,5590 +IPython/lib/tests/test_pretty.py,sha256=GzjE_je183gx6VUdKTnkYRsPaxIRlE0PWYvNtqJPmo0,13385 +IPython/lib/tests/test_security.py,sha256=bgrKi0vfjXc1WgUET27_tDfS-ptvzeEei4Z0zIULLb0,834 +IPython/nbconvert.py,sha256=ZuWoo4sBKt_fSdHU3cRY4GFfF8hni9UEnO3E4glXsQ0,651 +IPython/nbformat.py,sha256=cQxowUI0x1pzd0EC7_BOzCrLpPTWKPi7mICJW1vSfMc,645 +IPython/parallel.py,sha256=CMItIklVsosQFMjyKz8c-OqyKauN9YZb1mERp03G-pE,652 +IPython/paths.py,sha256=hdKl7cmxH0EpnbqorIQIar1ON40eefUFHmCHaXxXixg,4434 +IPython/qt.py,sha256=0YxedDtNiFiP6dATyqgw6e40kd7PvxTW1cgRzv9Vki8,762 +IPython/sphinxext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/sphinxext/__pycache__/__init__.cpython-38.pyc,, +IPython/sphinxext/__pycache__/custom_doctests.cpython-38.pyc,, +IPython/sphinxext/__pycache__/ipython_console_highlighting.cpython-38.pyc,, +IPython/sphinxext/__pycache__/ipython_directive.cpython-38.pyc,, +IPython/sphinxext/custom_doctests.py,sha256=DLXkhJal_RfqY7Rd0BoL8sRC90xxsvohqs4v1P-7H78,4603 +IPython/sphinxext/ipython_console_highlighting.py,sha256=D60MJnG-Dsv4B_Byd9FmA3ow9PJBx2Q1B2BWMQB9XYg,970 +IPython/sphinxext/ipython_directive.py,sha256=muKisv8B3b1u4Pkv6A03vTU2d1F2s03i0T9Dt6C4oy8,44538 +IPython/terminal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/terminal/__pycache__/__init__.cpython-38.pyc,, +IPython/terminal/__pycache__/console.cpython-38.pyc,, +IPython/terminal/__pycache__/debugger.cpython-38.pyc,, +IPython/terminal/__pycache__/embed.cpython-38.pyc,, +IPython/terminal/__pycache__/interactiveshell.cpython-38.pyc,, +IPython/terminal/__pycache__/ipapp.cpython-38.pyc,, +IPython/terminal/__pycache__/magics.cpython-38.pyc,, +IPython/terminal/__pycache__/prompts.cpython-38.pyc,, +IPython/terminal/__pycache__/ptshell.cpython-38.pyc,, +IPython/terminal/__pycache__/ptutils.cpython-38.pyc,, +IPython/terminal/__pycache__/shortcuts.cpython-38.pyc,, +IPython/terminal/console.py,sha256=LhKpLPNW6KCk2fPssrMNjxb3dP4tfxuVb75NtjENwN0,691 +IPython/terminal/debugger.py,sha256=cjn5VzE66aQpmzItnlPDByG_K-dvivPU3FMkCimaT7A,5541 +IPython/terminal/embed.py,sha256=Zi5lveSOuc-iOuU2BfZhkyTRl8YGTT7kuKGk0itOHGo,15474 +IPython/terminal/interactiveshell.py,sha256=pBSBC516PfjWZA1gMD5MmhWGt2g4EIvuqM9n1OYv9lc,25101 +IPython/terminal/ipapp.py,sha256=KGppKzzETqwOMmBHiJvR8pnwOdDwGp5EUP3IIBrKtQc,14215 +IPython/terminal/magics.py,sha256=RcbbyJnRoXbb7cmZ9OP92MxuTKcPTd_TSZ1Rg9sTrFo,7217 +IPython/terminal/prompts.py,sha256=0LCiFqB6fWXpgni3cGaUfkYG-TPnTQMC5-oq4hZui3g,3360 +IPython/terminal/pt_inputhooks/__init__.py,sha256=mUgCsvJi574v_6eaM4onUrAdxrO3pNsEO0nn2QGckfk,1135 +IPython/terminal/pt_inputhooks/__pycache__/__init__.cpython-38.pyc,, +IPython/terminal/pt_inputhooks/__pycache__/asyncio.cpython-38.pyc,, +IPython/terminal/pt_inputhooks/__pycache__/glut.cpython-38.pyc,, +IPython/terminal/pt_inputhooks/__pycache__/gtk.cpython-38.pyc,, +IPython/terminal/pt_inputhooks/__pycache__/gtk3.cpython-38.pyc,, +IPython/terminal/pt_inputhooks/__pycache__/osx.cpython-38.pyc,, +IPython/terminal/pt_inputhooks/__pycache__/pyglet.cpython-38.pyc,, +IPython/terminal/pt_inputhooks/__pycache__/qt.cpython-38.pyc,, +IPython/terminal/pt_inputhooks/__pycache__/tk.cpython-38.pyc,, +IPython/terminal/pt_inputhooks/__pycache__/wx.cpython-38.pyc,, +IPython/terminal/pt_inputhooks/asyncio.py,sha256=BO9_ye0f2pwaHnjmVsM-QfvT1yXf53w3OBlmcOy9Cl8,1893 +IPython/terminal/pt_inputhooks/glut.py,sha256=WVBrwOK2kKI_Eh42Z-pjaQdpdZgkFOSCmfqn50EVVn4,4983 +IPython/terminal/pt_inputhooks/gtk.py,sha256=8nikL9KtQ4n0qhKOqRthmrxvYuF-E9SsAYj2qN_Kk3k,2425 +IPython/terminal/pt_inputhooks/gtk3.py,sha256=6qb2k4E00MhbpMmnjud0R8Ri_qy-6c3VLlVfovDarLQ,278 +IPython/terminal/pt_inputhooks/osx.py,sha256=lsC8E1V6jBTlV3ffKctIHsFfrEhRtPNPp4PMX9TZuu8,4266 +IPython/terminal/pt_inputhooks/pyglet.py,sha256=_zyQkcOUGpBoMQ5DGTHbIEIIwtMjN2Ycq5hdfkPE9nQ,2368 +IPython/terminal/pt_inputhooks/qt.py,sha256=u1kaWO--Pj-0yFsQf3dO0N-5B09bb3TjmaTREMpUZQk,2099 +IPython/terminal/pt_inputhooks/tk.py,sha256=1aSYCec97FQpk7HyvIKHFiWBrJrJN7zgXHENQ3DjMEE,3648 +IPython/terminal/pt_inputhooks/wx.py,sha256=RZC045DMr17sMSWS63VZlI_7vkg_evOBZilxJuc6uZQ,7132 +IPython/terminal/ptshell.py,sha256=Lvoi7JrpthANUJw0KltD9g5JQ6BgOEL59kgJyELPHcw,296 +IPython/terminal/ptutils.py,sha256=qcnakh0rh5-YLthBAY7PwxauFYCi-DxLwCdfoTRiKUA,7179 +IPython/terminal/shortcuts.py,sha256=mRH6cYhzgLFKE_i3JzHKiH0DJHZWp0DtMayErq6l3XE,9006 +IPython/terminal/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/terminal/tests/__pycache__/__init__.cpython-38.pyc,, +IPython/terminal/tests/__pycache__/test_debug_magic.cpython-38.pyc,, +IPython/terminal/tests/__pycache__/test_embed.cpython-38.pyc,, +IPython/terminal/tests/__pycache__/test_help.cpython-38.pyc,, +IPython/terminal/tests/__pycache__/test_interactivshell.cpython-38.pyc,, +IPython/terminal/tests/test_debug_magic.py,sha256=KfrS31ZCmNsnETVKBz9o_JMhg_0r2aVIgHkuhzITzVU,2319 +IPython/terminal/tests/test_embed.py,sha256=qpcT4DkHnlhVbGn6VGGhNxuX5OFQv0iOgUNroTh-jWQ,4794 +IPython/terminal/tests/test_help.py,sha256=h-b4ayNAcHWCyX663H3_pCwWpH_zyZ71cgWePu5KI2c,672 +IPython/terminal/tests/test_interactivshell.py,sha256=NKxqon7_D_Xrd2pVOPxVf_XuZxsvU88cBGgDgDQNgKI,6888 +IPython/testing/__init__.py,sha256=NMgkVWw_GMG1QFaek8XSUv4DFZSof2kBmAnUPLXle-c,1724 +IPython/testing/__main__.py,sha256=sYZ76iOHRiRwgayjK1xF6wI-7uDiTEWzRz6dIMc8ecM,104 +IPython/testing/__pycache__/__init__.cpython-38.pyc,, +IPython/testing/__pycache__/__main__.cpython-38.pyc,, +IPython/testing/__pycache__/decorators.cpython-38.pyc,, +IPython/testing/__pycache__/globalipapp.cpython-38.pyc,, +IPython/testing/__pycache__/iptest.cpython-38.pyc,, +IPython/testing/__pycache__/iptestcontroller.cpython-38.pyc,, +IPython/testing/__pycache__/ipunittest.cpython-38.pyc,, +IPython/testing/__pycache__/skipdoctest.cpython-38.pyc,, +IPython/testing/__pycache__/tools.cpython-38.pyc,, +IPython/testing/decorators.py,sha256=3ikwM4jM9VWbz-W76-8DNnSCviS-aWnShMWk3fjkXvA,12824 +IPython/testing/globalipapp.py,sha256=ot27RlNGmZNB3_LcUoK0Z-NO__TvM2S9RfH6He30Ywk,4558 +IPython/testing/iptest.py,sha256=yixHlylKTmEor1i-B2rgvCxADJeTN6X4elzDNXQEtAI,16957 +IPython/testing/iptestcontroller.py,sha256=TbZoqrdQswMjJzgsJj3q-1PxnEBX3Ody7LGlg_0FW4c,17041 +IPython/testing/ipunittest.py,sha256=lmCOgPk1HuQnfIM4bdYX-eC7X5NmwQON-Rx_PuVPOSI,6540 +IPython/testing/plugin/README.txt,sha256=9Gkx2cWar5iNgkBoZY2HGvEvSEek3tj_MJIDbqNt5Ug,1043 +IPython/testing/plugin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/testing/plugin/__pycache__/__init__.cpython-38.pyc,, +IPython/testing/plugin/__pycache__/dtexample.cpython-38.pyc,, +IPython/testing/plugin/__pycache__/ipdoctest.cpython-38.pyc,, +IPython/testing/plugin/__pycache__/iptest.cpython-38.pyc,, +IPython/testing/plugin/__pycache__/setup.cpython-38.pyc,, +IPython/testing/plugin/__pycache__/show_refs.cpython-38.pyc,, +IPython/testing/plugin/__pycache__/simple.cpython-38.pyc,, +IPython/testing/plugin/__pycache__/simplevars.cpython-38.pyc,, +IPython/testing/plugin/__pycache__/test_ipdoctest.cpython-38.pyc,, +IPython/testing/plugin/__pycache__/test_refs.cpython-38.pyc,, +IPython/testing/plugin/dtexample.py,sha256=SImcXQdY-eKqETF99BQioXx0mqClneeWPBxSer_GRag,2839 +IPython/testing/plugin/ipdoctest.py,sha256=6oXbKNtuX2hG1yLPJ1Ixv1zlamMvFFzWLX1EJ1zBIdo,31159 +IPython/testing/plugin/iptest.py,sha256=6-0hkkJ6xtLWLyEmFGFjdN-bgDZsIZ7jZBDt2YSG6M0,485 +IPython/testing/plugin/setup.py,sha256=945a09Zm2HWWvukd5IVZ4v5p1czQPJfVlr5_Idey2AA,539 +IPython/testing/plugin/show_refs.py,sha256=EnvomBLndT4cAK_LJJk56dWoRBZMlRkVRVMd2BhNZlM,355 +IPython/testing/plugin/simple.py,sha256=mE13Fpu2hWng5DnEtdoMURiapKt9Zmbeb0fJpVi3Eh0,512 +IPython/testing/plugin/simplevars.py,sha256=VlIiArahWGnJXQC8Kda36GOQOBlhEg6QeeW4DQ-IaOQ,23 +IPython/testing/plugin/test_combo.txt,sha256=rrXjdOlRh9DltFu3GpuWuD0Hojtj4QQcEBOm52Z3-dE,923 +IPython/testing/plugin/test_example.txt,sha256=CGM8aZIYHlePDdAnR1yX3MfDGu0OceZpUiI_Y4tZGaU,730 +IPython/testing/plugin/test_exampleip.txt,sha256=IBLTjUCPoQKD-1fxzYABHE9MFOBW3kOY-jvNdXdTVSo,816 +IPython/testing/plugin/test_ipdoctest.py,sha256=kktP3F7lNzT23S0e4z_UVFN8qewFjdxrHidpjvnwBwQ,1598 +IPython/testing/plugin/test_refs.py,sha256=3fYzMVGjb9LiAumL-py0icgicvA-z7znozEQrF5wdm8,869 +IPython/testing/skipdoctest.py,sha256=oERP1rAq6XJjR4qpndhw7d76JYX3neHt0UWiUrfWgs0,713 +IPython/testing/tests/__init__.py,sha256=J4sAH04HH8RQnex-9174r9l7O15gIPzYUBXCcn6oAC0,558 +IPython/testing/tests/__pycache__/__init__.cpython-38.pyc,, +IPython/testing/tests/__pycache__/test_decorators.cpython-38.pyc,, +IPython/testing/tests/__pycache__/test_ipunittest.cpython-38.pyc,, +IPython/testing/tests/__pycache__/test_tools.cpython-38.pyc,, +IPython/testing/tests/test_decorators.py,sha256=wMxAIvo0iri9Lct8KNvEmkz050KocNPRwJJ1EdwHstw,3916 +IPython/testing/tests/test_ipunittest.py,sha256=7-1iCczPW2mH7aqcZA6F_yGpV7EBVYz8s_3rI1mNqsc,3301 +IPython/testing/tests/test_tools.py,sha256=6-VoZhoJXJUAaTZUhtQYXu2b-puasEWDm6x0v1I2fkg,4226 +IPython/testing/tools.py,sha256=6Q54Di7ogm85q3XaT_w4_8cUGFwuTQqGKZYTTRERNT8,14099 +IPython/utils/PyColorize.py,sha256=VpRFScmCJxcMpk_mpcFTkeTqbfASBuHtfXt1ruFM7Ww,10875 +IPython/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/utils/__pycache__/PyColorize.cpython-38.pyc,, +IPython/utils/__pycache__/__init__.cpython-38.pyc,, +IPython/utils/__pycache__/_process_cli.cpython-38.pyc,, +IPython/utils/__pycache__/_process_common.cpython-38.pyc,, +IPython/utils/__pycache__/_process_posix.cpython-38.pyc,, +IPython/utils/__pycache__/_process_win32.cpython-38.pyc,, +IPython/utils/__pycache__/_process_win32_controller.cpython-38.pyc,, +IPython/utils/__pycache__/_sysinfo.cpython-38.pyc,, +IPython/utils/__pycache__/capture.cpython-38.pyc,, +IPython/utils/__pycache__/colorable.cpython-38.pyc,, +IPython/utils/__pycache__/coloransi.cpython-38.pyc,, +IPython/utils/__pycache__/contexts.cpython-38.pyc,, +IPython/utils/__pycache__/daemonize.cpython-38.pyc,, +IPython/utils/__pycache__/data.cpython-38.pyc,, +IPython/utils/__pycache__/decorators.cpython-38.pyc,, +IPython/utils/__pycache__/dir2.cpython-38.pyc,, +IPython/utils/__pycache__/encoding.cpython-38.pyc,, +IPython/utils/__pycache__/eventful.cpython-38.pyc,, +IPython/utils/__pycache__/frame.cpython-38.pyc,, +IPython/utils/__pycache__/generics.cpython-38.pyc,, +IPython/utils/__pycache__/importstring.cpython-38.pyc,, +IPython/utils/__pycache__/io.cpython-38.pyc,, +IPython/utils/__pycache__/ipstruct.cpython-38.pyc,, +IPython/utils/__pycache__/jsonutil.cpython-38.pyc,, +IPython/utils/__pycache__/localinterfaces.cpython-38.pyc,, +IPython/utils/__pycache__/log.cpython-38.pyc,, +IPython/utils/__pycache__/module_paths.cpython-38.pyc,, +IPython/utils/__pycache__/openpy.cpython-38.pyc,, +IPython/utils/__pycache__/path.cpython-38.pyc,, +IPython/utils/__pycache__/pickleutil.cpython-38.pyc,, +IPython/utils/__pycache__/process.cpython-38.pyc,, +IPython/utils/__pycache__/py3compat.cpython-38.pyc,, +IPython/utils/__pycache__/sentinel.cpython-38.pyc,, +IPython/utils/__pycache__/shimmodule.cpython-38.pyc,, +IPython/utils/__pycache__/signatures.cpython-38.pyc,, +IPython/utils/__pycache__/strdispatch.cpython-38.pyc,, +IPython/utils/__pycache__/sysinfo.cpython-38.pyc,, +IPython/utils/__pycache__/syspathcontext.cpython-38.pyc,, +IPython/utils/__pycache__/tempdir.cpython-38.pyc,, +IPython/utils/__pycache__/terminal.cpython-38.pyc,, +IPython/utils/__pycache__/text.cpython-38.pyc,, +IPython/utils/__pycache__/timing.cpython-38.pyc,, +IPython/utils/__pycache__/tokenutil.cpython-38.pyc,, +IPython/utils/__pycache__/traitlets.cpython-38.pyc,, +IPython/utils/__pycache__/tz.cpython-38.pyc,, +IPython/utils/__pycache__/ulinecache.cpython-38.pyc,, +IPython/utils/__pycache__/version.cpython-38.pyc,, +IPython/utils/__pycache__/wildcard.cpython-38.pyc,, +IPython/utils/_process_cli.py,sha256=Gff6ROC8CgGjSPy2Em-dSOPwypZLcSijq__TXurkDsI,2415 +IPython/utils/_process_common.py,sha256=uG1mlkFEzgsl7AxUkYvE2LCdbOojB8V1do1YddqesoY,6981 +IPython/utils/_process_posix.py,sha256=7a-3pdHXKdzApZEC3Q27GFpUJLO4mBPdr8kGc6oKMIM,8925 +IPython/utils/_process_win32.py,sha256=6tBp4wYfR9MS-yIGFWcyxeu_8fYPn82rLfiHr757Zlw,6764 +IPython/utils/_process_win32_controller.py,sha256=PtLJ6xi62ta9386oVNneS-IaVI1YFmttnq2W3Zl7i7M,21326 +IPython/utils/_sysinfo.py,sha256=iX4G5nlXeetNn2D5cua3XuCV5I0eZ98K9c9xIHnMn04,46 +IPython/utils/capture.py,sha256=seIkDR1LnmlsapRuvon5oiJhUc0pkUA-r_cCDHcH4AI,5161 +IPython/utils/colorable.py,sha256=SCaeLJJlW14DZvoyaYPL-I6jLs78GA10xh0jCuSw8IY,786 +IPython/utils/coloransi.py,sha256=xqQRStXT7fULoRD8ikbCa55Y0FcQAjrjqKgA9XN3W7o,6958 +IPython/utils/contexts.py,sha256=KGp7J3KhuMyagEyymNAygyQ_XU5KaSyFyTJAOMPPWmY,1978 +IPython/utils/daemonize.py,sha256=91wAJwuFXA1FM8wGlbBJCPPF906jFJ-rdJOUp4b_5ZE,200 +IPython/utils/data.py,sha256=36VVGY1b0JG7_zSdbVSy8IzLqM0uT-uB12TBYWgd1lI,1015 +IPython/utils/decorators.py,sha256=ttuEp6xg6uF0h3UMZDKB9WNQSoSNiADY5uYeEg6FG5c,2071 +IPython/utils/dir2.py,sha256=D8w5dlmaTLY6yyA9AEBDC1nqx4po4Ol6i2tGG9eXuO0,2232 +IPython/utils/encoding.py,sha256=FpSYJdCsFi9g3tniRFb2Lpppq1vBhkccPtxAR4lK8BE,2851 +IPython/utils/eventful.py,sha256=ueH8yDENGzeCSLGHZX9SAvp2VU3AusGrMGd1hBNgJN8,139 +IPython/utils/frame.py,sha256=qCvAtdnKtQmR7DjXOw3pHadVOe6h_PCrh9_gTbKa48k,3051 +IPython/utils/generics.py,sha256=9Ie1dTXrX912XAEDS6G0_xRQ3OdRA3sWdjPs2HTJnU0,707 +IPython/utils/importstring.py,sha256=mCgL0WOfQqRF-F6ae-bAAiAxH5fWm5wfq8ubOpKxzyk,1035 +IPython/utils/io.py,sha256=-TZjIL1klVJcov-xjm98z_YrtEDMu-qH1kycm-MEjRg,8170 +IPython/utils/ipstruct.py,sha256=4fmnDVLWQcxCQDSxkpq-xS754flxSLpDT59C6jsBUtc,11864 +IPython/utils/jsonutil.py,sha256=2QsAXueCIbbmjyz37Im9yXU41XK_XGJ9aGA7NGilDIs,148 +IPython/utils/localinterfaces.py,sha256=7Wt6gcjgHX4mcWbx_k3Z1GL4iR388ZRqM3Hhhh4_Uwg,169 +IPython/utils/log.py,sha256=RB7Vkr2YiSyDvNg2h0qr-7MPvZ4GaFE2B9-ZLJX9ZpA,124 +IPython/utils/module_paths.py,sha256=xlsRW6cnRF6kkvrr9I7rEKRiaePn0pjDpfwanNE2kBg,2340 +IPython/utils/openpy.py,sha256=f012vesyEe2Fy94tdIxoQJtW3NDRyK_f6RfS8AIjw2E,3363 +IPython/utils/path.py,sha256=LHVR8QwFSHJBrqzc1aAFkW23LXVpPrK7_5f5FAvt9kM,14041 +IPython/utils/pickleutil.py,sha256=5rFOF4ty7PGwTsqoT6Xie3lBhBLDeI3GbPDQj91nWWA,144 +IPython/utils/process.py,sha256=Id0XV9-CzfUInpEWQJTcjJUePte4sQuaJ-pmjgPIxEA,1878 +IPython/utils/py3compat.py,sha256=O54CAzU2wQVE4KoMwQOLz_wLs9uu5y2SEOPcATAQ8pE,5496 +IPython/utils/sentinel.py,sha256=pRzWbnR7gjM5R3g0ZqjSo94QNJpxgKWOLXT-yY18FmU,421 +IPython/utils/shimmodule.py,sha256=JYJvA806JRy9ej_cCF_MhQ9RcsVe7oq23BzEALbojTI,2855 +IPython/utils/signatures.py,sha256=dIrPwSPou7WQWs5018lzs3-dEKwG-dX3g4_2_OCvdg4,474 +IPython/utils/strdispatch.py,sha256=LM8jEQo7G77PxpjusJ7EqDEQW4YHYpEyb7xnE6RrEaw,1838 +IPython/utils/sysinfo.py,sha256=ft8G7RoRWSmcrESJQKEkByq1q3kj0f9npaITkonTt7c,5160 +IPython/utils/syspathcontext.py,sha256=Q3VfzvSMHpGV4wHhHXjNfX8bVmR1T0b7ivULhvqX7sc,1694 +IPython/utils/tempdir.py,sha256=CruNRgsv0gpgYpcyAiFaCv8bRcG5gO1OY61dInSSPNk,1759 +IPython/utils/terminal.py,sha256=WdMvxwr9tsyjWG5CRiJeKsoRONq-lyrn_kvrz1KFWr8,3335 +IPython/utils/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +IPython/utils/tests/__pycache__/__init__.cpython-38.pyc,, +IPython/utils/tests/__pycache__/test_capture.cpython-38.pyc,, +IPython/utils/tests/__pycache__/test_decorators.cpython-38.pyc,, +IPython/utils/tests/__pycache__/test_dir2.cpython-38.pyc,, +IPython/utils/tests/__pycache__/test_imports.cpython-38.pyc,, +IPython/utils/tests/__pycache__/test_importstring.cpython-38.pyc,, +IPython/utils/tests/__pycache__/test_io.cpython-38.pyc,, +IPython/utils/tests/__pycache__/test_module_paths.cpython-38.pyc,, +IPython/utils/tests/__pycache__/test_openpy.cpython-38.pyc,, +IPython/utils/tests/__pycache__/test_path.cpython-38.pyc,, +IPython/utils/tests/__pycache__/test_process.cpython-38.pyc,, +IPython/utils/tests/__pycache__/test_pycolorize.cpython-38.pyc,, +IPython/utils/tests/__pycache__/test_shimmodule.cpython-38.pyc,, +IPython/utils/tests/__pycache__/test_sysinfo.cpython-38.pyc,, +IPython/utils/tests/__pycache__/test_tempdir.cpython-38.pyc,, +IPython/utils/tests/__pycache__/test_text.cpython-38.pyc,, +IPython/utils/tests/__pycache__/test_tokenutil.cpython-38.pyc,, +IPython/utils/tests/__pycache__/test_wildcard.cpython-38.pyc,, +IPython/utils/tests/test_capture.py,sha256=vhLi9RxHtYXWWut0dFln_oC-NGxWW3H6qic3BOXuDwk,5474 +IPython/utils/tests/test_decorators.py,sha256=y_Hp5tjT8YbXe87HLe0-b5qhU9BcEzKMUdzAJdy-OWg,170 +IPython/utils/tests/test_dir2.py,sha256=mCPv5TzKhsT0_LB5FUG85-Fp5gtn56wZjNi_iH1Z7Z8,1371 +IPython/utils/tests/test_imports.py,sha256=6SWziRNPdGfA47SpcjXDJG7B6173EHT6vT39juEfBd0,439 +IPython/utils/tests/test_importstring.py,sha256=GKmgvB40f5uGgItZz_jpL9imJDEycHbKGf9KhZZ_03Y,1247 +IPython/utils/tests/test_io.py,sha256=FKs86T4pHkOYiK7BmKQDAnTNHjwtyIYMkN8U784T39E,2599 +IPython/utils/tests/test_module_paths.py,sha256=ILpE5h2QescvQCrqxAariESL2nlin_Y5GNljYGuJ218,3409 +IPython/utils/tests/test_openpy.py,sha256=_gjgjZF3GI7wLBZfZAqIIyFeIDZMIAf56KyzUdwa_78,1271 +IPython/utils/tests/test_path.py,sha256=tkzzG5C1Ju8NqViBwFIV5TPIllyHccW885EVDnCE8bM,16313 +IPython/utils/tests/test_process.py,sha256=kjIRrFTbtiMnM6COp3JVVGW4gopfX1xOefFE_fBtq2c,6623 +IPython/utils/tests/test_pycolorize.py,sha256=JvmdbmKCQYaG1nimN3Cbp-D0mA8DBB4fjTD9ltdJxu0,2069 +IPython/utils/tests/test_shimmodule.py,sha256=9XeqBA_22NHdsRwdfjCmgdeGlcTKE6oPumwSDr86nMo,344 +IPython/utils/tests/test_sysinfo.py,sha256=IMtPk7v6LwaEDZZsVD6VnPgQwRHc7OJeVah6FOg9HuY,390 +IPython/utils/tests/test_tempdir.py,sha256=7kce7ULLzQBvwSwGYO3vdMVxRtmgqpUv-P6zY9xRXzg,1039 +IPython/utils/tests/test_text.py,sha256=a_qfcoMvE3uE8HTmvkqb1ih0s4nLFMIyqdGtKMsglaI,7780 +IPython/utils/tests/test_tokenutil.py,sha256=wuRrvNlbnEUFakAUoeSsCSvG4VVRoilOMLoCraJ1ETM,3955 +IPython/utils/tests/test_wildcard.py,sha256=VJVK7LxaEYJKv6Tynlj4ye_GRyMHEI_3iT80i3PJuZk,4729 +IPython/utils/text.py,sha256=o8koIch6DBZapftH-vaxnB8wJLNkVIszBAR7qZUNggQ,23288 +IPython/utils/timing.py,sha256=4zlwKOkJKmSnGlhpw6lak6qUTSZdUT3NXQESsF5fRQ4,4086 +IPython/utils/tokenutil.py,sha256=qAwI0e6h2ANU34C_2RG5f4Ro7mQ6TxHv72GEJhxtS1U,3965 +IPython/utils/traitlets.py,sha256=SnRNQ20hSnvceaWsTIjZRe2R90NAC58PVJl9bMt-41A,143 +IPython/utils/tz.py,sha256=gjMCFONMznt3xNG18BBNCXI4YRPlOFT7OJdrQ8Ntt-M,1352 +IPython/utils/ulinecache.py,sha256=WySMSMJDRsm1Z5CGY24KdmoA2eLDZEayqWR6V_sIuik,684 +IPython/utils/version.py,sha256=lLBSR8mtlF1eCzwwOejljchAyfSy0opD8b0w_QjR97Q,1227 +IPython/utils/wildcard.py,sha256=6EEc3OEYp-IuSoidL6nwpaHg--GxnzbAJTmFiz77CNE,4612 +ipython-7.16.1.dist-info/DESCRIPTION.rst,sha256=2iqlfwontsrCsyOFQju2rMHWeYYMgNOgrnGHcS-c_qE,1372 +ipython-7.16.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +ipython-7.16.1.dist-info/LICENSE.txt,sha256=4OOQdI7UQKuJPKHxNaiKkgqvVAnbuQpbQnx1xeUSaPs,1720 +ipython-7.16.1.dist-info/METADATA,sha256=I2vNI3276WTE0i9IBCAeAUATLlaN_e2Air0rJ6xG7bk,4401 +ipython-7.16.1.dist-info/RECORD,, +ipython-7.16.1.dist-info/WHEEL,sha256=8Lm45v9gcYRm70DrgFGVe4WsUtUMi1_0Tso1hqPGMjA,92 +ipython-7.16.1.dist-info/entry_points.txt,sha256=KT9gSuNYhuFMuzUiLcoBtAFuhQJqgk8KHzCD6Or8APY,340 +ipython-7.16.1.dist-info/metadata.json,sha256=BvKebhN9rSLG5wmijVV6-Vj34QYJ1pTWeYdsISYKxeY,2788 +ipython-7.16.1.dist-info/top_level.txt,sha256=PKjvHtNCBZ9EHTmd2mwJ1J_k3j0F6D1lTFzIcJFFPEU,8 diff --git a/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/WHEEL b/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/WHEEL new file mode 100644 index 00000000..6261a26e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.30.0) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/entry_points.txt b/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/entry_points.txt new file mode 100644 index 00000000..7795cb41 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/entry_points.txt @@ -0,0 +1,11 @@ +[console_scripts] +iptest = IPython.testing.iptestcontroller:main +iptest3 = IPython.testing.iptestcontroller:main +ipython = IPython:start_ipython +ipython3 = IPython:start_ipython + +[pygments.lexers] +ipython = IPython.lib.lexers:IPythonLexer +ipython3 = IPython.lib.lexers:IPython3Lexer +ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer + diff --git a/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/metadata.json b/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/metadata.json new file mode 100644 index 00000000..c280bd72 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/metadata.json @@ -0,0 +1 @@ +{"classifiers": ["Framework :: IPython", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Topic :: System :: Shells"], "extensions": {"python.commands": {"wrap_console": {"iptest": "IPython.testing.iptestcontroller:main", "iptest3": "IPython.testing.iptestcontroller:main", "ipython": "IPython:start_ipython", "ipython3": "IPython:start_ipython"}}, "python.details": {"contacts": [{"email": "ipython-dev@python.org", "name": "The IPython Development Team", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst", "license": "LICENSE.txt"}, "project_urls": {"Home": "https://ipython.org"}}, "python.exports": {"console_scripts": {"iptest": "IPython.testing.iptestcontroller:main", "iptest3": "IPython.testing.iptestcontroller:main", "ipython": "IPython:start_ipython", "ipython3": "IPython:start_ipython"}, "pygments.lexers": {"ipython": "IPython.lib.lexers:IPythonLexer", "ipython3": "IPython.lib.lexers:IPython3Lexer", "ipythonconsole": "IPython.lib.lexers:IPythonConsoleLexer"}}}, "extras": ["all", "doc", "kernel", "nbconvert", "nbformat", "notebook", "parallel", "qtconsole", "terminal", "test"], "generator": "bdist_wheel (0.30.0)", "keywords": ["Interactive", "Interpreter", "Shell", "Embedding"], "license": "BSD", "metadata_version": "2.0", "name": "ipython", "platform": "Linux", "project_url": "Documentation, https://ipython.readthedocs.io/", "requires_python": ">=3.6", "run_requires": [{"extra": "all", "requires": ["Sphinx (>=1.3)", "ipykernel", "ipyparallel", "ipywidgets", "nbconvert", "nbformat", "nose (>=0.10.1)", "notebook", "numpy (>=1.14)", "pygments", "qtconsole", "requests", "testpath"]}, {"extra": "doc", "requires": ["Sphinx (>=1.3)"]}, {"requires": ["backcall", "decorator", "jedi (>=0.10)", "pickleshare", "prompt-toolkit (!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0)", "pygments", "setuptools (>=18.5)", "traitlets (>=4.2)"]}, {"extra": "kernel", "requires": ["ipykernel"]}, {"extra": "test", "requires": ["ipykernel", "nbformat", "nose (>=0.10.1)", "numpy (>=1.14)", "pygments", "requests", "testpath"]}, {"extra": "parallel", "requires": ["ipyparallel"]}, {"extra": "notebook", "requires": ["ipywidgets", "notebook"]}, {"extra": "nbconvert", "requires": ["nbconvert"]}, {"extra": "nbformat", "requires": ["nbformat"]}, {"extra": "qtconsole", "requires": ["qtconsole"]}, {"environment": "sys_platform != \"win32\"", "requires": ["pexpect"]}, {"environment": "sys_platform == \"darwin\"", "requires": ["appnope"]}, {"environment": "sys_platform == \"win32\"", "requires": ["colorama"]}], "summary": "IPython: Productive Interactive Computing", "version": "7.16.1"} \ No newline at end of file diff --git a/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/top_level.txt b/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/top_level.txt new file mode 100644 index 00000000..7fed997b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython-7.16.1.dist-info/top_level.txt @@ -0,0 +1 @@ +IPython diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/DESCRIPTION.rst b/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/DESCRIPTION.rst new file mode 100644 index 00000000..46e7bd48 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/DESCRIPTION.rst @@ -0,0 +1,3 @@ +Pretend this doesn't exist. Nobody should use it. + + diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/INSTALLER b/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/METADATA b/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/METADATA new file mode 100644 index 00000000..9f9a0eff --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/METADATA @@ -0,0 +1,24 @@ +Metadata-Version: 2.0 +Name: ipython-genutils +Version: 0.2.0 +Summary: Vestigial utilities from IPython +Home-page: http://ipython.org +Author: IPython Development Team +Author-email: ipython-dev@scipy.org +License: BSD +Keywords: Interactive,Interpreter,Shell,Web +Platform: Linux +Platform: Mac OS X +Platform: Windows +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: System Administrators +Classifier: Intended Audience :: Science/Research +Classifier: License :: OSI Approved :: BSD License +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.3 + +Pretend this doesn't exist. Nobody should use it. + + diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/RECORD b/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/RECORD new file mode 100644 index 00000000..63302b7e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/RECORD @@ -0,0 +1,39 @@ +ipython_genutils-0.2.0.dist-info/DESCRIPTION.rst,sha256=ITviTgpIJKI-9fu7FKfbZ82e-hXbEWfbrlSpzY5GVZc,52 +ipython_genutils-0.2.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +ipython_genutils-0.2.0.dist-info/METADATA,sha256=UNTYFuFtT0GzY-_dRwgpJC3XuPoQJM5PBukrAxYQmE4,755 +ipython_genutils-0.2.0.dist-info/RECORD,, +ipython_genutils-0.2.0.dist-info/WHEEL,sha256=o2k-Qa-RMNIJmUdIc7KU6VWR_ErNRbWNlxDIpl7lm34,110 +ipython_genutils-0.2.0.dist-info/metadata.json,sha256=CTf4fAnmbHk3N_LO0Tm7JzT9LGwqs3IUQW-v8hhyM_0,836 +ipython_genutils-0.2.0.dist-info/top_level.txt,sha256=fF8lBzWha7QJej3jOc4gCSmQcRkts42118N66UU4y28,17 +ipython_genutils/__init__.py,sha256=LSTcyAtOkM7aHkXkK5DequaciF9XIBiMouehF1GjO2M,48 +ipython_genutils/__pycache__/__init__.cpython-38.pyc,, +ipython_genutils/__pycache__/_version.cpython-38.pyc,, +ipython_genutils/__pycache__/encoding.cpython-38.pyc,, +ipython_genutils/__pycache__/importstring.cpython-38.pyc,, +ipython_genutils/__pycache__/ipstruct.cpython-38.pyc,, +ipython_genutils/__pycache__/path.cpython-38.pyc,, +ipython_genutils/__pycache__/py3compat.cpython-38.pyc,, +ipython_genutils/__pycache__/tempdir.cpython-38.pyc,, +ipython_genutils/__pycache__/text.cpython-38.pyc,, +ipython_genutils/_version.py,sha256=6uzv1nkhzDbX24eRkKBA9SRKOpqoQw2Aum-nxD_dAEo,72 +ipython_genutils/encoding.py,sha256=D8S1v0JESmGWwtGyEd2UYtNClrz3U3ugssa4_G4o9Is,2869 +ipython_genutils/importstring.py,sha256=mCgL0WOfQqRF-F6ae-bAAiAxH5fWm5wfq8ubOpKxzyk,1035 +ipython_genutils/ipstruct.py,sha256=it0Bmz2LNkrfg_XRLuseTyPr89_GO89oe_e15xTAbtk,11258 +ipython_genutils/path.py,sha256=1iwXi66jFvVnOfrSWIkrgFA_nzA51-0wMUXWZE2FJpo,5386 +ipython_genutils/py3compat.py,sha256=oRf8bQc-GoafPXBv9Cq1eibAVM7X4aQ4cZ3RLR-ja5c,10810 +ipython_genutils/tempdir.py,sha256=FFF1HdBhS_fETPWt2QpRngMcoFgDCKKla6q8JCpB5tI,4929 +ipython_genutils/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +ipython_genutils/testing/__pycache__/__init__.cpython-38.pyc,, +ipython_genutils/testing/__pycache__/decorators.cpython-38.pyc,, +ipython_genutils/testing/decorators.py,sha256=ujVIJvfo6fMHClYQPgrDZu9_czlmRBgAyfnfZZngtDI,10913 +ipython_genutils/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +ipython_genutils/tests/__pycache__/__init__.cpython-38.pyc,, +ipython_genutils/tests/__pycache__/test_importstring.cpython-38.pyc,, +ipython_genutils/tests/__pycache__/test_path.cpython-38.pyc,, +ipython_genutils/tests/__pycache__/test_tempdir.cpython-38.pyc,, +ipython_genutils/tests/__pycache__/test_text.cpython-38.pyc,, +ipython_genutils/tests/test_importstring.py,sha256=Wo6l87oLXJgQ76FGFDN9xgnmpzt0SAsDZeSfry2tYMs,654 +ipython_genutils/tests/test_path.py,sha256=wpFgXteEY-JozhD0urY2sRMvep_zpoqal5rT1sza--Q,3310 +ipython_genutils/tests/test_tempdir.py,sha256=HU_cFi3Q3mKoG3OYtcXKzkJIqUj0iuXWPK2z3JxuIZ8,668 +ipython_genutils/tests/test_text.py,sha256=4-uauXhH6nD344kwkIZJMf16roQ5VKYkGUUuNQQFc6s,2043 +ipython_genutils/text.py,sha256=QgMhmf1xkeYXXTS_3_ifeJXcdTqsQyC_dQ8e1le5tpw,6929 diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/WHEEL b/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/WHEEL new file mode 100644 index 00000000..8b6dd1b5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.29.0) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/metadata.json b/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/metadata.json new file mode 100644 index 00000000..f2ecb05a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/metadata.json @@ -0,0 +1 @@ +{"classifiers": ["Intended Audience :: Developers", "Intended Audience :: System Administrators", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3"], "extensions": {"python.details": {"contacts": [{"email": "ipython-dev@scipy.org", "name": "IPython Development Team", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "http://ipython.org"}}}, "generator": "bdist_wheel (0.29.0)", "keywords": ["Interactive", "Interpreter", "Shell", "Web"], "license": "BSD", "metadata_version": "2.0", "name": "ipython-genutils", "platform": "Linux", "summary": "Vestigial utilities from IPython", "version": "0.2.0"} \ No newline at end of file diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/top_level.txt b/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/top_level.txt new file mode 100644 index 00000000..c443fe30 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils-0.2.0.dist-info/top_level.txt @@ -0,0 +1 @@ +ipython_genutils diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/__init__.py b/.venv/lib/python3.8/site-packages/ipython_genutils/__init__.py new file mode 100644 index 00000000..948f47a6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils/__init__.py @@ -0,0 +1 @@ +from ._version import __version__, version_info diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..cb6a752c Binary files /dev/null and b/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/_version.cpython-38.pyc b/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/_version.cpython-38.pyc new file mode 100644 index 00000000..cecf9f59 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/_version.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/encoding.cpython-38.pyc b/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/encoding.cpython-38.pyc new file mode 100644 index 00000000..5053ed0d Binary files /dev/null and b/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/encoding.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/importstring.cpython-38.pyc b/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/importstring.cpython-38.pyc new file mode 100644 index 00000000..0c3501d3 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/importstring.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/ipstruct.cpython-38.pyc b/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/ipstruct.cpython-38.pyc new file mode 100644 index 00000000..9587dc54 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/ipstruct.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/path.cpython-38.pyc b/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/path.cpython-38.pyc new file mode 100644 index 00000000..4a24cc56 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/path.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/py3compat.cpython-38.pyc b/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/py3compat.cpython-38.pyc new file mode 100644 index 00000000..9ee6ee85 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/py3compat.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/tempdir.cpython-38.pyc b/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/tempdir.cpython-38.pyc new file mode 100644 index 00000000..a5120d09 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/tempdir.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/text.cpython-38.pyc b/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/text.cpython-38.pyc new file mode 100644 index 00000000..f2808ce6 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/ipython_genutils/__pycache__/text.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/_version.py b/.venv/lib/python3.8/site-packages/ipython_genutils/_version.py new file mode 100644 index 00000000..f660ae1b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils/_version.py @@ -0,0 +1,2 @@ +version_info = (0, 2, 0) +__version__ = '.'.join(map(str, version_info)) diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/encoding.py b/.venv/lib/python3.8/site-packages/ipython_genutils/encoding.py new file mode 100644 index 00000000..387a2470 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils/encoding.py @@ -0,0 +1,71 @@ +# coding: utf-8 +""" +Utilities for dealing with text encodings +""" + +#----------------------------------------------------------------------------- +# Copyright (C) 2008-2012 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- +import sys +import locale +import warnings + +# to deal with the possibility of sys.std* not being a stream at all +def get_stream_enc(stream, default=None): + """Return the given stream's encoding or a default. + + There are cases where ``sys.std*`` might not actually be a stream, so + check for the encoding attribute prior to returning it, and return + a default if it doesn't exist or evaluates as False. ``default`` + is None if not provided. + """ + if not hasattr(stream, 'encoding') or not stream.encoding: + return default + else: + return stream.encoding + +# Less conservative replacement for sys.getdefaultencoding, that will try +# to match the environment. +# Defined here as central function, so if we find better choices, we +# won't need to make changes all over IPython. +def getdefaultencoding(prefer_stream=True): + """Return IPython's guess for the default encoding for bytes as text. + + If prefer_stream is True (default), asks for stdin.encoding first, + to match the calling Terminal, but that is often None for subprocesses. + + Then fall back on locale.getpreferredencoding(), + which should be a sensible platform default (that respects LANG environment), + and finally to sys.getdefaultencoding() which is the most conservative option, + and usually ASCII on Python 2 or UTF8 on Python 3. + """ + enc = None + if prefer_stream: + enc = get_stream_enc(sys.stdin) + if not enc or enc=='ascii': + try: + # There are reports of getpreferredencoding raising errors + # in some cases, which may well be fixed, but let's be conservative here. + enc = locale.getpreferredencoding() + except Exception: + pass + enc = enc or sys.getdefaultencoding() + # On windows `cp0` can be returned to indicate that there is no code page. + # Since cp0 is an invalid encoding return instead cp1252 which is the + # Western European default. + if enc == 'cp0': + warnings.warn( + "Invalid code page cp0 detected - using cp1252 instead." + "If cp1252 is incorrect please ensure a valid code page " + "is defined for the process.", RuntimeWarning) + return 'cp1252' + return enc + +DEFAULT_ENCODING = getdefaultencoding() diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/importstring.py b/.venv/lib/python3.8/site-packages/ipython_genutils/importstring.py new file mode 100644 index 00000000..c8e1840e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils/importstring.py @@ -0,0 +1,39 @@ +# encoding: utf-8 +""" +A simple utility to import something by its string name. +""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + + +def import_item(name): + """Import and return ``bar`` given the string ``foo.bar``. + + Calling ``bar = import_item("foo.bar")`` is the functional equivalent of + executing the code ``from foo import bar``. + + Parameters + ---------- + name : string + The fully qualified name of the module/package being imported. + + Returns + ------- + mod : module object + The module that was imported. + """ + + parts = name.rsplit('.', 1) + if len(parts) == 2: + # called with 'foo.bar....' + package, obj = parts + module = __import__(package, fromlist=[obj]) + try: + pak = getattr(module, obj) + except AttributeError: + raise ImportError('No module named %s' % obj) + return pak + else: + # called with un-dotted string + return __import__(parts[0]) diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/ipstruct.py b/.venv/lib/python3.8/site-packages/ipython_genutils/ipstruct.py new file mode 100644 index 00000000..31511ecd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils/ipstruct.py @@ -0,0 +1,376 @@ +# encoding: utf-8 +"""A dict subclass that supports attribute style access. + +Can probably be replaced by types.SimpleNamespace from Python 3.3 +""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +__all__ = ['Struct'] + + +class Struct(dict): + """A dict subclass with attribute style access. + + This dict subclass has a a few extra features: + + * Attribute style access. + * Protection of class members (like keys, items) when using attribute + style access. + * The ability to restrict assignment to only existing keys. + * Intelligent merging. + * Overloaded operators. + """ + _allownew = True + def __init__(self, *args, **kw): + """Initialize with a dictionary, another Struct, or data. + + Parameters + ---------- + args : dict, Struct + Initialize with one dict or Struct + kw : dict + Initialize with key, value pairs. + + Examples + -------- + + >>> s = Struct(a=10,b=30) + >>> s.a + 10 + >>> s.b + 30 + >>> s2 = Struct(s,c=30) + >>> sorted(s2.keys()) + ['a', 'b', 'c'] + """ + object.__setattr__(self, '_allownew', True) + dict.__init__(self, *args, **kw) + + def __setitem__(self, key, value): + """Set an item with check for allownew. + + Examples + -------- + + >>> s = Struct() + >>> s['a'] = 10 + >>> s.allow_new_attr(False) + >>> s['a'] = 10 + >>> s['a'] + 10 + >>> try: + ... s['b'] = 20 + ... except KeyError: + ... print('this is not allowed') + ... + this is not allowed + """ + if not self._allownew and key not in self: + raise KeyError( + "can't create new attribute %s when allow_new_attr(False)" % key) + dict.__setitem__(self, key, value) + + def __setattr__(self, key, value): + """Set an attr with protection of class members. + + This calls :meth:`self.__setitem__` but convert :exc:`KeyError` to + :exc:`AttributeError`. + + Examples + -------- + + >>> s = Struct() + >>> s.a = 10 + >>> s.a + 10 + >>> try: + ... s.get = 10 + ... except AttributeError: + ... print("you can't set a class member") + ... + you can't set a class member + """ + # If key is an str it might be a class member or instance var + if isinstance(key, str): + # I can't simply call hasattr here because it calls getattr, which + # calls self.__getattr__, which returns True for keys in + # self._data. But I only want keys in the class and in + # self.__dict__ + if key in self.__dict__ or hasattr(Struct, key): + raise AttributeError( + 'attr %s is a protected member of class Struct.' % key + ) + try: + self.__setitem__(key, value) + except KeyError as e: + raise AttributeError(e) + + def __getattr__(self, key): + """Get an attr by calling :meth:`dict.__getitem__`. + + Like :meth:`__setattr__`, this method converts :exc:`KeyError` to + :exc:`AttributeError`. + + Examples + -------- + + >>> s = Struct(a=10) + >>> s.a + 10 + >>> type(s.get) + <... 'builtin_function_or_method'> + >>> try: + ... s.b + ... except AttributeError: + ... print("I don't have that key") + ... + I don't have that key + """ + try: + result = self[key] + except KeyError: + raise AttributeError(key) + else: + return result + + def __iadd__(self, other): + """s += s2 is a shorthand for s.merge(s2). + + Examples + -------- + + >>> s = Struct(a=10,b=30) + >>> s2 = Struct(a=20,c=40) + >>> s += s2 + >>> sorted(s.keys()) + ['a', 'b', 'c'] + """ + self.merge(other) + return self + + def __add__(self,other): + """s + s2 -> New Struct made from s.merge(s2). + + Examples + -------- + + >>> s1 = Struct(a=10,b=30) + >>> s2 = Struct(a=20,c=40) + >>> s = s1 + s2 + >>> sorted(s.keys()) + ['a', 'b', 'c'] + """ + sout = self.copy() + sout.merge(other) + return sout + + def __sub__(self,other): + """s1 - s2 -> remove keys in s2 from s1. + + Examples + -------- + + >>> s1 = Struct(a=10,b=30) + >>> s2 = Struct(a=40) + >>> s = s1 - s2 + >>> s + {'b': 30} + """ + sout = self.copy() + sout -= other + return sout + + def __isub__(self,other): + """Inplace remove keys from self that are in other. + + Examples + -------- + + >>> s1 = Struct(a=10,b=30) + >>> s2 = Struct(a=40) + >>> s1 -= s2 + >>> s1 + {'b': 30} + """ + for k in other.keys(): + if k in self: + del self[k] + return self + + def __dict_invert(self, data): + """Helper function for merge. + + Takes a dictionary whose values are lists and returns a dict with + the elements of each list as keys and the original keys as values. + """ + outdict = {} + for k,lst in data.items(): + if isinstance(lst, str): + lst = lst.split() + for entry in lst: + outdict[entry] = k + return outdict + + def dict(self): + return self + + def copy(self): + """Return a copy as a Struct. + + Examples + -------- + + >>> s = Struct(a=10,b=30) + >>> s2 = s.copy() + >>> type(s2) is Struct + True + """ + return Struct(dict.copy(self)) + + def hasattr(self, key): + """hasattr function available as a method. + + Implemented like has_key. + + Examples + -------- + + >>> s = Struct(a=10) + >>> s.hasattr('a') + True + >>> s.hasattr('b') + False + >>> s.hasattr('get') + False + """ + return key in self + + def allow_new_attr(self, allow = True): + """Set whether new attributes can be created in this Struct. + + This can be used to catch typos by verifying that the attribute user + tries to change already exists in this Struct. + """ + object.__setattr__(self, '_allownew', allow) + + def merge(self, __loc_data__=None, __conflict_solve=None, **kw): + """Merge two Structs with customizable conflict resolution. + + This is similar to :meth:`update`, but much more flexible. First, a + dict is made from data+key=value pairs. When merging this dict with + the Struct S, the optional dictionary 'conflict' is used to decide + what to do. + + If conflict is not given, the default behavior is to preserve any keys + with their current value (the opposite of the :meth:`update` method's + behavior). + + Parameters + ---------- + __loc_data : dict, Struct + The data to merge into self + __conflict_solve : dict + The conflict policy dict. The keys are binary functions used to + resolve the conflict and the values are lists of strings naming + the keys the conflict resolution function applies to. Instead of + a list of strings a space separated string can be used, like + 'a b c'. + kw : dict + Additional key, value pairs to merge in + + Notes + ----- + + The `__conflict_solve` dict is a dictionary of binary functions which will be used to + solve key conflicts. Here is an example:: + + __conflict_solve = dict( + func1=['a','b','c'], + func2=['d','e'] + ) + + In this case, the function :func:`func1` will be used to resolve + keys 'a', 'b' and 'c' and the function :func:`func2` will be used for + keys 'd' and 'e'. This could also be written as:: + + __conflict_solve = dict(func1='a b c',func2='d e') + + These functions will be called for each key they apply to with the + form:: + + func1(self['a'], other['a']) + + The return value is used as the final merged value. + + As a convenience, merge() provides five (the most commonly needed) + pre-defined policies: preserve, update, add, add_flip and add_s. The + easiest explanation is their implementation:: + + preserve = lambda old,new: old + update = lambda old,new: new + add = lambda old,new: old + new + add_flip = lambda old,new: new + old # note change of order! + add_s = lambda old,new: old + ' ' + new # only for str! + + You can use those four words (as strings) as keys instead + of defining them as functions, and the merge method will substitute + the appropriate functions for you. + + For more complicated conflict resolution policies, you still need to + construct your own functions. + + Examples + -------- + + This show the default policy: + + >>> s = Struct(a=10,b=30) + >>> s2 = Struct(a=20,c=40) + >>> s.merge(s2) + >>> sorted(s.items()) + [('a', 10), ('b', 30), ('c', 40)] + + Now, show how to specify a conflict dict: + + >>> s = Struct(a=10,b=30) + >>> s2 = Struct(a=20,b=40) + >>> conflict = {'update':'a','add':'b'} + >>> s.merge(s2,conflict) + >>> sorted(s.items()) + [('a', 20), ('b', 70)] + """ + + data_dict = dict(__loc_data__,**kw) + + # policies for conflict resolution: two argument functions which return + # the value that will go in the new struct + preserve = lambda old,new: old + update = lambda old,new: new + add = lambda old,new: old + new + add_flip = lambda old,new: new + old # note change of order! + add_s = lambda old,new: old + ' ' + new + + # default policy is to keep current keys when there's a conflict + conflict_solve = dict.fromkeys(self, preserve) + + # the conflict_solve dictionary is given by the user 'inverted': we + # need a name-function mapping, it comes as a function -> names + # dict. Make a local copy (b/c we'll make changes), replace user + # strings for the three builtin policies and invert it. + if __conflict_solve: + inv_conflict_solve_user = __conflict_solve.copy() + for name, func in [('preserve',preserve), ('update',update), + ('add',add), ('add_flip',add_flip), + ('add_s',add_s)]: + if name in inv_conflict_solve_user.keys(): + inv_conflict_solve_user[func] = inv_conflict_solve_user[name] + del inv_conflict_solve_user[name] + conflict_solve.update(self.__dict_invert(inv_conflict_solve_user)) + for key in data_dict: + if key not in self: + self[key] = data_dict[key] + else: + self[key] = conflict_solve[key](self[key],data_dict[key]) + diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/path.py b/.venv/lib/python3.8/site-packages/ipython_genutils/path.py new file mode 100644 index 00000000..8d3308ed --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils/path.py @@ -0,0 +1,172 @@ +# encoding: utf-8 +""" +Utilities for path handling. +""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +import os +import sys +import errno +import shutil +import random + +from . import py3compat + + +fs_encoding = sys.getfilesystemencoding() + + +def filefind(filename, path_dirs=None): + """Find a file by looking through a sequence of paths. + + This iterates through a sequence of paths looking for a file and returns + the full, absolute path of the first occurence of the file. If no set of + path dirs is given, the filename is tested as is, after running through + :func:`expandvars` and :func:`expanduser`. Thus a simple call:: + + filefind('myfile.txt') + + will find the file in the current working dir, but:: + + filefind('~/myfile.txt') + + Will find the file in the users home directory. This function does not + automatically try any paths, such as the cwd or the user's home directory. + + Parameters + ---------- + filename : str + The filename to look for. + path_dirs : str, None or sequence of str + The sequence of paths to look for the file in. If None, the filename + need to be absolute or be in the cwd. If a string, the string is + put into a sequence and the searched. If a sequence, walk through + each element and join with ``filename``, calling :func:`expandvars` + and :func:`expanduser` before testing for existence. + + Returns + ------- + Raises :exc:`IOError` or returns absolute path to file. + """ + + # If paths are quoted, abspath gets confused, strip them... + filename = filename.strip('"').strip("'") + # If the input is an absolute path, just check it exists + if os.path.isabs(filename) and os.path.isfile(filename): + return filename + + if path_dirs is None: + path_dirs = ("",) + elif isinstance(path_dirs, py3compat.string_types): + path_dirs = (path_dirs,) + + for path in path_dirs: + if path == '.': path = py3compat.getcwd() + testname = expand_path(os.path.join(path, filename)) + if os.path.isfile(testname): + return os.path.abspath(testname) + + raise IOError("File %r does not exist in any of the search paths: %r" % + (filename, path_dirs) ) + + +def expand_path(s): + """Expand $VARS and ~names in a string, like a shell + + :Examples: + + In [2]: os.environ['FOO']='test' + + In [3]: expand_path('variable FOO is $FOO') + Out[3]: 'variable FOO is test' + """ + # This is a pretty subtle hack. When expand user is given a UNC path + # on Windows (\\server\share$\%username%), os.path.expandvars, removes + # the $ to get (\\server\share\%username%). I think it considered $ + # alone an empty var. But, we need the $ to remains there (it indicates + # a hidden share). + if os.name=='nt': + s = s.replace('$\\', 'IPYTHON_TEMP') + s = os.path.expandvars(os.path.expanduser(s)) + if os.name=='nt': + s = s.replace('IPYTHON_TEMP', '$\\') + return s + + +try: + ENOLINK = errno.ENOLINK +except AttributeError: + ENOLINK = 1998 + +def link(src, dst): + """Hard links ``src`` to ``dst``, returning 0 or errno. + + Note that the special errno ``ENOLINK`` will be returned if ``os.link`` isn't + supported by the operating system. + """ + + if not hasattr(os, "link"): + return ENOLINK + link_errno = 0 + try: + os.link(src, dst) + except OSError as e: + link_errno = e.errno + return link_errno + + +def link_or_copy(src, dst): + """Attempts to hardlink ``src`` to ``dst``, copying if the link fails. + + Attempts to maintain the semantics of ``shutil.copy``. + + Because ``os.link`` does not overwrite files, a unique temporary file + will be used if the target already exists, then that file will be moved + into place. + """ + + if os.path.isdir(dst): + dst = os.path.join(dst, os.path.basename(src)) + + link_errno = link(src, dst) + if link_errno == errno.EEXIST: + if os.stat(src).st_ino == os.stat(dst).st_ino: + # dst is already a hard link to the correct file, so we don't need + # to do anything else. If we try to link and rename the file + # anyway, we get duplicate files - see http://bugs.python.org/issue21876 + return + + new_dst = dst + "-temp-%04X" %(random.randint(1, 16**4), ) + try: + link_or_copy(src, new_dst) + except: + try: + os.remove(new_dst) + except OSError: + pass + raise + os.rename(new_dst, dst) + elif link_errno != 0: + # Either link isn't supported, or the filesystem doesn't support + # linking, or 'src' and 'dst' are on different filesystems. + shutil.copy(src, dst) + + +def ensure_dir_exists(path, mode=0o755): + """ensure that a directory exists + + If it doesn't exist, try to create it and protect against a race condition + if another process is doing the same. + + The default permissions are 755, which differ from os.makedirs default of 777. + """ + if not os.path.exists(path): + try: + os.makedirs(path, mode=mode) + except OSError as e: + if e.errno != errno.EEXIST: + raise + elif not os.path.isdir(path): + raise IOError("%r exists but is not a directory" % path) diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/py3compat.py b/.venv/lib/python3.8/site-packages/ipython_genutils/py3compat.py new file mode 100644 index 00000000..d748753f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils/py3compat.py @@ -0,0 +1,333 @@ +# coding: utf-8 +"""Compatibility tricks for Python 3. Mainly to do with unicode.""" +import functools +import os +import sys +import re +import shutil +import types + +from .encoding import DEFAULT_ENCODING + +def no_code(x, encoding=None): + return x + +def decode(s, encoding=None): + encoding = encoding or DEFAULT_ENCODING + return s.decode(encoding, "replace") + +def encode(u, encoding=None): + encoding = encoding or DEFAULT_ENCODING + return u.encode(encoding, "replace") + + +def cast_unicode(s, encoding=None): + if isinstance(s, bytes): + return decode(s, encoding) + return s + +def cast_bytes(s, encoding=None): + if not isinstance(s, bytes): + return encode(s, encoding) + return s + +def buffer_to_bytes(buf): + """Cast a buffer or memoryview object to bytes""" + if isinstance(buf, memoryview): + return buf.tobytes() + if not isinstance(buf, bytes): + return bytes(buf) + return buf + +def _modify_str_or_docstring(str_change_func): + @functools.wraps(str_change_func) + def wrapper(func_or_str): + if isinstance(func_or_str, string_types): + func = None + doc = func_or_str + else: + func = func_or_str + doc = func.__doc__ + + doc = str_change_func(doc) + + if func: + func.__doc__ = doc + return func + return doc + return wrapper + +def safe_unicode(e): + """unicode(e) with various fallbacks. Used for exceptions, which may not be + safe to call unicode() on. + """ + try: + return unicode_type(e) + except UnicodeError: + pass + + try: + return str_to_unicode(str(e)) + except UnicodeError: + pass + + try: + return str_to_unicode(repr(e)) + except UnicodeError: + pass + + return u'Unrecoverably corrupt evalue' + +# shutil.which from Python 3.4 +def _shutil_which(cmd, mode=os.F_OK | os.X_OK, path=None): + """Given a command, mode, and a PATH string, return the path which + conforms to the given mode on the PATH, or None if there is no such + file. + + `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result + of os.environ.get("PATH"), or can be overridden with a custom search + path. + + This is a backport of shutil.which from Python 3.4 + """ + # Check that a given file can be accessed with the correct mode. + # Additionally check that `file` is not a directory, as on Windows + # directories pass the os.access check. + def _access_check(fn, mode): + return (os.path.exists(fn) and os.access(fn, mode) + and not os.path.isdir(fn)) + + # If we're given a path with a directory part, look it up directly rather + # than referring to PATH directories. This includes checking relative to the + # current directory, e.g. ./script + if os.path.dirname(cmd): + if _access_check(cmd, mode): + return cmd + return None + + if path is None: + path = os.environ.get("PATH", os.defpath) + if not path: + return None + path = path.split(os.pathsep) + + if sys.platform == "win32": + # The current directory takes precedence on Windows. + if not os.curdir in path: + path.insert(0, os.curdir) + + # PATHEXT is necessary to check on Windows. + pathext = os.environ.get("PATHEXT", "").split(os.pathsep) + # See if the given file matches any of the expected path extensions. + # This will allow us to short circuit when given "python.exe". + # If it does match, only test that one, otherwise we have to try + # others. + if any(cmd.lower().endswith(ext.lower()) for ext in pathext): + files = [cmd] + else: + files = [cmd + ext for ext in pathext] + else: + # On other platforms you don't have things like PATHEXT to tell you + # what file suffixes are executable, so just pass on cmd as-is. + files = [cmd] + + seen = set() + for dir in path: + normdir = os.path.normcase(dir) + if not normdir in seen: + seen.add(normdir) + for thefile in files: + name = os.path.join(dir, thefile) + if _access_check(name, mode): + return name + return None + +import platform +if sys.version_info[0] >= 3 or platform.python_implementation() == 'IronPython': + str_to_unicode = no_code + unicode_to_str = no_code + str_to_bytes = encode + bytes_to_str = decode + cast_bytes_py2 = no_code + cast_unicode_py2 = no_code + buffer_to_bytes_py2 = no_code + + string_types = (str,) + unicode_type = str +else: + str_to_unicode = decode + unicode_to_str = encode + str_to_bytes = no_code + bytes_to_str = no_code + cast_bytes_py2 = cast_bytes + cast_unicode_py2 = cast_unicode + buffer_to_bytes_py2 = buffer_to_bytes + + string_types = (str, unicode) + unicode_type = unicode + +if sys.version_info[0] >= 3: + PY3 = True + + # keep reference to builtin_mod because the kernel overrides that value + # to forward requests to a frontend. + def input(prompt=''): + return builtin_mod.input(prompt) + + builtin_mod_name = "builtins" + import builtins as builtin_mod + + which = shutil.which + + def isidentifier(s, dotted=False): + if dotted: + return all(isidentifier(a) for a in s.split(".")) + return s.isidentifier() + + xrange = range + def iteritems(d): return iter(d.items()) + def itervalues(d): return iter(d.values()) + getcwd = os.getcwd + + MethodType = types.MethodType + + def execfile(fname, glob, loc=None, compiler=None): + loc = loc if (loc is not None) else glob + with open(fname, 'rb') as f: + compiler = compiler or compile + exec(compiler(f.read(), fname, 'exec'), glob, loc) + + # Refactor print statements in doctests. + _print_statement_re = re.compile(r"\bprint (?P.*)$", re.MULTILINE) + def _print_statement_sub(match): + expr = match.groups('expr') + return "print(%s)" % expr + + @_modify_str_or_docstring + def doctest_refactor_print(doc): + """Refactor 'print x' statements in a doctest to print(x) style. 2to3 + unfortunately doesn't pick up on our doctests. + + Can accept a string or a function, so it can be used as a decorator.""" + return _print_statement_re.sub(_print_statement_sub, doc) + + # Abstract u'abc' syntax: + @_modify_str_or_docstring + def u_format(s): + """"{u}'abc'" --> "'abc'" (Python 3) + + Accepts a string or a function, so it can be used as a decorator.""" + return s.format(u='') + + def get_closure(f): + """Get a function's closure attribute""" + return f.__closure__ + +else: + PY3 = False + + # keep reference to builtin_mod because the kernel overrides that value + # to forward requests to a frontend. + def input(prompt=''): + return builtin_mod.raw_input(prompt) + + builtin_mod_name = "__builtin__" + import __builtin__ as builtin_mod + + import re + _name_re = re.compile(r"[a-zA-Z_][a-zA-Z0-9_]*$") + def isidentifier(s, dotted=False): + if dotted: + return all(isidentifier(a) for a in s.split(".")) + return bool(_name_re.match(s)) + + xrange = xrange + def iteritems(d): return d.iteritems() + def itervalues(d): return d.itervalues() + getcwd = os.getcwdu + + def MethodType(func, instance): + return types.MethodType(func, instance, type(instance)) + + def doctest_refactor_print(func_or_str): + return func_or_str + + def get_closure(f): + """Get a function's closure attribute""" + return f.func_closure + + which = _shutil_which + + # Abstract u'abc' syntax: + @_modify_str_or_docstring + def u_format(s): + """"{u}'abc'" --> "u'abc'" (Python 2) + + Accepts a string or a function, so it can be used as a decorator.""" + return s.format(u='u') + + if sys.platform == 'win32': + def execfile(fname, glob=None, loc=None, compiler=None): + loc = loc if (loc is not None) else glob + scripttext = builtin_mod.open(fname).read()+ '\n' + # compile converts unicode filename to str assuming + # ascii. Let's do the conversion before calling compile + if isinstance(fname, unicode): + filename = unicode_to_str(fname) + else: + filename = fname + compiler = compiler or compile + exec(compiler(scripttext, filename, 'exec'), glob, loc) + + else: + def execfile(fname, glob=None, loc=None, compiler=None): + if isinstance(fname, unicode): + filename = fname.encode(sys.getfilesystemencoding()) + else: + filename = fname + where = [ns for ns in [glob, loc] if ns is not None] + if compiler is None: + builtin_mod.execfile(filename, *where) + else: + scripttext = builtin_mod.open(fname).read().rstrip() + '\n' + exec(compiler(scripttext, filename, 'exec'), glob, loc) + + +def annotate(**kwargs): + """Python 3 compatible function annotation for Python 2.""" + if not kwargs: + raise ValueError('annotations must be provided as keyword arguments') + def dec(f): + if hasattr(f, '__annotations__'): + for k, v in kwargs.items(): + f.__annotations__[k] = v + else: + f.__annotations__ = kwargs + return f + return dec + + +# Parts below taken from six: +# Copyright (c) 2010-2013 Benjamin Peterson +# +# 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: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# 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. + +def with_metaclass(meta, *bases): + """Create a base class with a metaclass.""" + return meta("_NewBase", bases, {}) diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/tempdir.py b/.venv/lib/python3.8/site-packages/ipython_genutils/tempdir.py new file mode 100644 index 00000000..2865b05b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils/tempdir.py @@ -0,0 +1,150 @@ +"""TemporaryDirectory class, copied from Python 3 + +This is copied from the stdlib and will be standard in Python 3.2 and onwards. +""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +from __future__ import print_function + +import os as _os +import warnings as _warnings +import sys as _sys + +# This code should only be used in Python versions < 3.2, since after that we +# can rely on the stdlib itself. +try: + from tempfile import TemporaryDirectory + +except ImportError: + from tempfile import mkdtemp, template + + class TemporaryDirectory(object): + """Create and return a temporary directory. This has the same + behavior as mkdtemp but can be used as a context manager. For + example: + + with TemporaryDirectory() as tmpdir: + ... + + Upon exiting the context, the directory and everthing contained + in it are removed. + """ + + def __init__(self, suffix="", prefix=template, dir=None): + self.name = mkdtemp(suffix, prefix, dir) + self._closed = False + + def __enter__(self): + return self.name + + def cleanup(self, _warn=False): + if self.name and not self._closed: + try: + self._rmtree(self.name) + except (TypeError, AttributeError) as ex: + # Issue #10188: Emit a warning on stderr + # if the directory could not be cleaned + # up due to missing globals + if "None" not in str(ex): + raise + print("ERROR: {!r} while cleaning up {!r}".format(ex, self,), + file=_sys.stderr) + return + self._closed = True + if _warn: + self._warn("Implicitly cleaning up {!r}".format(self), + Warning) + + def __exit__(self, exc, value, tb): + self.cleanup() + + def __del__(self): + # Issue a ResourceWarning if implicit cleanup needed + self.cleanup(_warn=True) + + + # XXX (ncoghlan): The following code attempts to make + # this class tolerant of the module nulling out process + # that happens during CPython interpreter shutdown + # Alas, it doesn't actually manage it. See issue #10188 + _listdir = staticmethod(_os.listdir) + _path_join = staticmethod(_os.path.join) + _isdir = staticmethod(_os.path.isdir) + _remove = staticmethod(_os.remove) + _rmdir = staticmethod(_os.rmdir) + _os_error = _os.error + _warn = _warnings.warn + + def _rmtree(self, path): + # Essentially a stripped down version of shutil.rmtree. We can't + # use globals because they may be None'ed out at shutdown. + for name in self._listdir(path): + fullname = self._path_join(path, name) + try: + isdir = self._isdir(fullname) + except self._os_error: + isdir = False + if isdir: + self._rmtree(fullname) + else: + try: + self._remove(fullname) + except self._os_error: + pass + try: + self._rmdir(path) + except self._os_error: + pass + +# extra temp-dir-related context managers + +class NamedFileInTemporaryDirectory(object): + + def __init__(self, filename, mode='w+b', bufsize=-1, **kwds): + """ + Open a file named `filename` in a temporary directory. + + This context manager is preferred over `NamedTemporaryFile` in + stdlib `tempfile` when one needs to reopen the file. + + Arguments `mode` and `bufsize` are passed to `open`. + Rest of the arguments are passed to `TemporaryDirectory`. + + """ + self._tmpdir = TemporaryDirectory(**kwds) + path = _os.path.join(self._tmpdir.name, filename) + self.file = open(path, mode, bufsize) + + def cleanup(self): + self.file.close() + self._tmpdir.cleanup() + + __del__ = cleanup + + def __enter__(self): + return self.file + + def __exit__(self, type, value, traceback): + self.cleanup() + + +class TemporaryWorkingDirectory(TemporaryDirectory): + """ + Creates a temporary directory and sets the cwd to that directory. + Automatically reverts to previous cwd upon cleanup. + Usage example: + + with TemporaryWorkingDirectory() as tmpdir: + ... + """ + def __enter__(self): + self.old_wd = _os.getcwd() + _os.chdir(self.name) + return super(TemporaryWorkingDirectory, self).__enter__() + + def __exit__(self, exc, value, tb): + _os.chdir(self.old_wd) + return super(TemporaryWorkingDirectory, self).__exit__(exc, value, tb) + diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/testing/__init__.py b/.venv/lib/python3.8/site-packages/ipython_genutils/testing/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/testing/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/ipython_genutils/testing/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..1591f378 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/ipython_genutils/testing/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/testing/__pycache__/decorators.cpython-38.pyc b/.venv/lib/python3.8/site-packages/ipython_genutils/testing/__pycache__/decorators.cpython-38.pyc new file mode 100644 index 00000000..74c74c9a Binary files /dev/null and b/.venv/lib/python3.8/site-packages/ipython_genutils/testing/__pycache__/decorators.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/testing/decorators.py b/.venv/lib/python3.8/site-packages/ipython_genutils/testing/decorators.py new file mode 100644 index 00000000..cc81ebe3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils/testing/decorators.py @@ -0,0 +1,342 @@ +# -*- coding: utf-8 -*- +"""Decorators for labeling test objects. + +Decorators that merely return a modified version of the original function +object are straightforward. Decorators that return a new function object need +to use nose.tools.make_decorator(original_function)(decorator) in returning the +decorator, in order to preserve metadata such as function name, setup and +teardown functions and so on - see nose.tools for more information. + +This module provides a set of useful decorators meant to be ready to use in +your own tests. See the bottom of the file for the ready-made ones, and if you +find yourself writing a new one that may be of generic use, add it here. + +Included decorators: + + +Lightweight testing that remains unittest-compatible. + +- An @as_unittest decorator can be used to tag any normal parameter-less + function as a unittest TestCase. Then, both nose and normal unittest will + recognize it as such. This will make it easier to migrate away from Nose if + we ever need/want to while maintaining very lightweight tests. + +NOTE: This file contains IPython-specific decorators. Using the machinery in +IPython.external.decorators, we import either numpy.testing.decorators if numpy is +available, OR use equivalent code in IPython.external._decorators, which +we've copied verbatim from numpy. + +""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +import sys +import os +import tempfile +import unittest + +# For onlyif_cmd_exists decorator +from ..py3compat import string_types, which + +#----------------------------------------------------------------------------- +# Classes and functions +#----------------------------------------------------------------------------- + +# Simple example of the basic idea +def as_unittest(func): + """Decorator to make a simple function into a normal test via unittest.""" + class Tester(unittest.TestCase): + def test(self): + func() + + Tester.__name__ = func.__name__ + + return Tester + +# Utility functions + + + +def make_label_dec(label,ds=None): + """Factory function to create a decorator that applies one or more labels. + + Parameters + ---------- + label : string or sequence + One or more labels that will be applied by the decorator to the functions + it decorates. Labels are attributes of the decorated function with their + value set to True. + + ds : string + An optional docstring for the resulting decorator. If not given, a + default docstring is auto-generated. + + Returns + ------- + A decorator. + + Examples + -------- + + A simple labeling decorator: + + >>> slow = make_label_dec('slow') + >>> slow.__doc__ + "Labels a test as 'slow'." + + And one that uses multiple labels and a custom docstring: + + >>> rare = make_label_dec(['slow','hard'], + ... "Mix labels 'slow' and 'hard' for rare tests.") + >>> rare.__doc__ + "Mix labels 'slow' and 'hard' for rare tests." + + Now, let's test using this one: + >>> @rare + ... def f(): pass + ... + >>> + >>> f.slow + True + >>> f.hard + True + """ + + if isinstance(label, string_types): + labels = [label] + else: + labels = label + + # Validate that the given label(s) are OK for use in setattr() by doing a + # dry run on a dummy function. + tmp = lambda : None + for label in labels: + setattr(tmp,label,True) + + # This is the actual decorator we'll return + def decor(f): + for label in labels: + setattr(f,label,True) + return f + + # Apply the user's docstring, or autogenerate a basic one + if ds is None: + ds = "Labels a test as %r." % label + decor.__doc__ = ds + + return decor + + +# Inspired by numpy's skipif, but uses the full apply_wrapper utility to +# preserve function metadata better and allows the skip condition to be a +# callable. +def skipif(skip_condition, msg=None): + ''' Make function raise SkipTest exception if skip_condition is true + + Parameters + ---------- + + skip_condition : bool or callable + Flag to determine whether to skip test. If the condition is a + callable, it is used at runtime to dynamically make the decision. This + is useful for tests that may require costly imports, to delay the cost + until the test suite is actually executed. + msg : string + Message to give on raising a SkipTest exception. + + Returns + ------- + decorator : function + Decorator, which, when applied to a function, causes SkipTest + to be raised when the skip_condition was True, and the function + to be called normally otherwise. + + Notes + ----- + You will see from the code that we had to further decorate the + decorator with the nose.tools.make_decorator function in order to + transmit function name, and various other metadata. + ''' + + def skip_decorator(f): + # Local import to avoid a hard nose dependency and only incur the + # import time overhead at actual test-time. + import nose + + # Allow for both boolean or callable skip conditions. + if callable(skip_condition): + skip_val = skip_condition + else: + skip_val = lambda : skip_condition + + def get_msg(func,msg=None): + """Skip message with information about function being skipped.""" + if msg is None: out = 'Test skipped due to test condition.' + else: out = msg + return "Skipping test: %s. %s" % (func.__name__,out) + + # We need to define *two* skippers because Python doesn't allow both + # return with value and yield inside the same function. + def skipper_func(*args, **kwargs): + """Skipper for normal test functions.""" + if skip_val(): + raise nose.SkipTest(get_msg(f,msg)) + else: + return f(*args, **kwargs) + + def skipper_gen(*args, **kwargs): + """Skipper for test generators.""" + if skip_val(): + raise nose.SkipTest(get_msg(f,msg)) + else: + for x in f(*args, **kwargs): + yield x + + # Choose the right skipper to use when building the actual generator. + if nose.util.isgenerator(f): + skipper = skipper_gen + else: + skipper = skipper_func + + return nose.tools.make_decorator(f)(skipper) + + return skip_decorator + +# A version with the condition set to true, common case just to attach a message +# to a skip decorator +def skip(msg=None): + """Decorator factory - mark a test function for skipping from test suite. + + Parameters + ---------- + msg : string + Optional message to be added. + + Returns + ------- + decorator : function + Decorator, which, when applied to a function, causes SkipTest + to be raised, with the optional message added. + """ + + return skipif(True,msg) + + +def onlyif(condition, msg): + """The reverse from skipif, see skipif for details.""" + + if callable(condition): + skip_condition = lambda : not condition() + else: + skip_condition = lambda : not condition + + return skipif(skip_condition, msg) + +#----------------------------------------------------------------------------- +# Utility functions for decorators +def module_not_available(module): + """Can module be imported? Returns true if module does NOT import. + + This is used to make a decorator to skip tests that require module to be + available, but delay the 'import numpy' to test execution time. + """ + def condition(): + try: + mod = __import__(module) + return False + except ImportError: + return True + return condition + + +def decorated_dummy(dec, name): + """Return a dummy function decorated with dec, with the given name. + + Examples + -------- + import IPython.testing.decorators as dec + setup = dec.decorated_dummy(dec.skip_if_no_x11, __name__) + """ + dummy = lambda: None + dummy.__name__ = name + return dec(dummy) + +#----------------------------------------------------------------------------- +# Decorators for public use + +# Decorators to skip certain tests on specific platforms. +skip_win32 = skipif(sys.platform == 'win32', + "This test does not run under Windows") +skip_linux = skipif(sys.platform.startswith('linux'), + "This test does not run under Linux") +skip_osx = skipif(sys.platform == 'darwin',"This test does not run under OS X") + + +# Decorators to skip tests if not on specific platforms. +skip_if_not_win32 = skipif(sys.platform != 'win32', + "This test only runs under Windows") +skip_if_not_linux = skipif(not sys.platform.startswith('linux'), + "This test only runs under Linux") +skip_if_not_osx = skipif(sys.platform != 'darwin', + "This test only runs under OSX") + + +_x11_skip_cond = (sys.platform not in ('darwin', 'win32') and + os.environ.get('DISPLAY', '') == '') +_x11_skip_msg = "Skipped under *nix when X11/XOrg not available" + +skip_if_no_x11 = skipif(_x11_skip_cond, _x11_skip_msg) + +# not a decorator itself, returns a dummy function to be used as setup +def skip_file_no_x11(name): + return decorated_dummy(skip_if_no_x11, name) if _x11_skip_cond else None + +# Other skip decorators + +# generic skip without module +skip_without = lambda mod: skipif(module_not_available(mod), "This test requires %s" % mod) + +skipif_not_numpy = skip_without('numpy') + +skipif_not_matplotlib = skip_without('matplotlib') + +skipif_not_sympy = skip_without('sympy') + +# A null 'decorator', useful to make more readable code that needs to pick +# between different decorators based on OS or other conditions +null_deco = lambda f: f + +# Some tests only run where we can use unicode paths. Note that we can't just +# check os.path.supports_unicode_filenames, which is always False on Linux. +try: + f = tempfile.NamedTemporaryFile(prefix=u"tmp€") +except UnicodeEncodeError: + unicode_paths = False +else: + unicode_paths = True + f.close() + +onlyif_unicode_paths = onlyif(unicode_paths, ("This test is only applicable " + "where we can use unicode in filenames.")) + + +def onlyif_cmds_exist(*commands): + """ + Decorator to skip test when at least one of `commands` is not found. + """ + for cmd in commands: + if not which(cmd): + return skip("This test runs only if command '{0}' " + "is installed".format(cmd)) + return null_deco + +def onlyif_any_cmd_exists(*commands): + """ + Decorator to skip test unless at least one of `commands` is found. + """ + for cmd in commands: + if which(cmd): + return null_deco + return skip("This test runs only if one of the commands {0} " + "is installed".format(commands)) diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/tests/__init__.py b/.venv/lib/python3.8/site-packages/ipython_genutils/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/tests/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/ipython_genutils/tests/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..e190c124 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/ipython_genutils/tests/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/tests/__pycache__/test_importstring.cpython-38.pyc b/.venv/lib/python3.8/site-packages/ipython_genutils/tests/__pycache__/test_importstring.cpython-38.pyc new file mode 100644 index 00000000..6c6c43aa Binary files /dev/null and b/.venv/lib/python3.8/site-packages/ipython_genutils/tests/__pycache__/test_importstring.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/tests/__pycache__/test_path.cpython-38.pyc b/.venv/lib/python3.8/site-packages/ipython_genutils/tests/__pycache__/test_path.cpython-38.pyc new file mode 100644 index 00000000..24e2eb2a Binary files /dev/null and b/.venv/lib/python3.8/site-packages/ipython_genutils/tests/__pycache__/test_path.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/tests/__pycache__/test_tempdir.cpython-38.pyc b/.venv/lib/python3.8/site-packages/ipython_genutils/tests/__pycache__/test_tempdir.cpython-38.pyc new file mode 100644 index 00000000..6c1ce96b Binary files /dev/null and b/.venv/lib/python3.8/site-packages/ipython_genutils/tests/__pycache__/test_tempdir.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/tests/__pycache__/test_text.cpython-38.pyc b/.venv/lib/python3.8/site-packages/ipython_genutils/tests/__pycache__/test_text.cpython-38.pyc new file mode 100644 index 00000000..a5b4acdc Binary files /dev/null and b/.venv/lib/python3.8/site-packages/ipython_genutils/tests/__pycache__/test_text.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/tests/test_importstring.py b/.venv/lib/python3.8/site-packages/ipython_genutils/tests/test_importstring.py new file mode 100644 index 00000000..3adc1a55 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils/tests/test_importstring.py @@ -0,0 +1,27 @@ +"""Tests for IPython.utils.importstring.""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +import nose.tools as nt + +from ..importstring import import_item + +def test_import_plain(): + "Test simple imports" + import os + os2 = import_item('os') + nt.assert_true(os is os2) + + +def test_import_nested(): + "Test nested imports from the stdlib" + from os import path + path2 = import_item('os.path') + nt.assert_true(path is path2) + + +def test_import_raises(): + "Test that failing imports raise the right exception" + nt.assert_raises(ImportError, import_item, 'IPython.foobar') + diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/tests/test_path.py b/.venv/lib/python3.8/site-packages/ipython_genutils/tests/test_path.py new file mode 100644 index 00000000..04ca85d0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils/tests/test_path.py @@ -0,0 +1,108 @@ +# encoding: utf-8 +"""Tests for genutils.path""" + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +import os +import sys +import tempfile + +import nose.tools as nt + +from ..testing.decorators import skip_if_not_win32, skip_win32 +from .. import path +from .. import py3compat +from ..tempdir import TemporaryDirectory + + +def test_filefind(): + f = tempfile.NamedTemporaryFile() + t = path.filefind(f.name, '.') + + +def test_ensure_dir_exists(): + with TemporaryDirectory() as td: + d = os.path.join(td, u'∂ir') + path.ensure_dir_exists(d) # create it + assert os.path.isdir(d) + path.ensure_dir_exists(d) # no-op + f = os.path.join(td, u'ƒile') + open(f, 'w').close() # touch + with nt.assert_raises(IOError): + path.ensure_dir_exists(f) + + +class TestLinkOrCopy(object): + def setUp(self): + self.tempdir = TemporaryDirectory() + self.src = self.dst("src") + with open(self.src, "w") as f: + f.write("Hello, world!") + + def tearDown(self): + self.tempdir.cleanup() + + def dst(self, *args): + return os.path.join(self.tempdir.name, *args) + + def assert_inode_not_equal(self, a, b): + nt.assert_not_equals(os.stat(a).st_ino, os.stat(b).st_ino, + "%r and %r do reference the same indoes" %(a, b)) + + def assert_inode_equal(self, a, b): + nt.assert_equals(os.stat(a).st_ino, os.stat(b).st_ino, + "%r and %r do not reference the same indoes" %(a, b)) + + def assert_content_equal(self, a, b): + with open(a) as a_f: + with open(b) as b_f: + nt.assert_equals(a_f.read(), b_f.read()) + + @skip_win32 + def test_link_successful(self): + dst = self.dst("target") + path.link_or_copy(self.src, dst) + self.assert_inode_equal(self.src, dst) + + @skip_win32 + def test_link_into_dir(self): + dst = self.dst("some_dir") + os.mkdir(dst) + path.link_or_copy(self.src, dst) + expected_dst = self.dst("some_dir", os.path.basename(self.src)) + self.assert_inode_equal(self.src, expected_dst) + + @skip_win32 + def test_target_exists(self): + dst = self.dst("target") + open(dst, "w").close() + path.link_or_copy(self.src, dst) + self.assert_inode_equal(self.src, dst) + + @skip_win32 + def test_no_link(self): + real_link = os.link + try: + del os.link + dst = self.dst("target") + path.link_or_copy(self.src, dst) + self.assert_content_equal(self.src, dst) + self.assert_inode_not_equal(self.src, dst) + finally: + os.link = real_link + + @skip_if_not_win32 + def test_windows(self): + dst = self.dst("target") + path.link_or_copy(self.src, dst) + self.assert_content_equal(self.src, dst) + + def test_link_twice(self): + # Linking the same file twice shouldn't leave duplicates around. + # See https://github.com/ipython/ipython/issues/6450 + dst = self.dst('target') + path.link_or_copy(self.src, dst) + path.link_or_copy(self.src, dst) + self.assert_inode_equal(self.src, dst) + nt.assert_equal(sorted(os.listdir(self.tempdir.name)), ['src', 'target']) diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/tests/test_tempdir.py b/.venv/lib/python3.8/site-packages/ipython_genutils/tests/test_tempdir.py new file mode 100644 index 00000000..631755ed --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils/tests/test_tempdir.py @@ -0,0 +1,22 @@ + +import os + +from ..tempdir import NamedFileInTemporaryDirectory +from ..tempdir import TemporaryWorkingDirectory + + +def test_named_file_in_temporary_directory(): + with NamedFileInTemporaryDirectory('filename') as file: + name = file.name + assert not file.closed + assert os.path.exists(name) + file.write(b'test') + assert file.closed + assert not os.path.exists(name) + +def test_temporary_working_directory(): + with TemporaryWorkingDirectory() as dir: + assert os.path.exists(dir) + assert os.path.realpath(os.curdir) == os.path.realpath(dir) + assert not os.path.exists(dir) + assert os.path.abspath(os.curdir) != dir diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/tests/test_text.py b/.venv/lib/python3.8/site-packages/ipython_genutils/tests/test_text.py new file mode 100644 index 00000000..b14170ad --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils/tests/test_text.py @@ -0,0 +1,59 @@ +# encoding: utf-8 +"""Tests for IPython.utils.text""" +from __future__ import print_function + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +import os +import math +import random +import sys + +import nose.tools as nt + +from .. import text + + +def test_columnize(): + """Basic columnize tests.""" + size = 5 + items = [l*size for l in 'abc'] + out = text.columnize(items, displaywidth=80) + nt.assert_equal(out, 'aaaaa bbbbb ccccc\n') + out = text.columnize(items, displaywidth=12) + nt.assert_equal(out, 'aaaaa ccccc\nbbbbb\n') + out = text.columnize(items, displaywidth=10) + nt.assert_equal(out, 'aaaaa\nbbbbb\nccccc\n') + +def test_columnize_random(): + """Test with random input to hopfully catch edge case """ + for nitems in [random.randint(2,70) for i in range(2,20)]: + displaywidth = random.randint(20,200) + rand_len = [random.randint(2,displaywidth) for i in range(nitems)] + items = ['x'*l for l in rand_len] + out = text.columnize(items, displaywidth=displaywidth) + longer_line = max([len(x) for x in out.split('\n')]) + longer_element = max(rand_len) + if longer_line > displaywidth: + print("Columnize displayed something lager than displaywidth : %s " % longer_line) + print("longer element : %s " % longer_element) + print("displaywidth : %s " % displaywidth) + print("number of element : %s " % nitems) + print("size of each element :\n %s" % rand_len) + assert False + +def test_columnize_medium(): + """Test with inputs than shouldn't be wider tahn 80 """ + size = 40 + items = [l*size for l in 'abc'] + out = text.columnize(items, displaywidth=80) + nt.assert_equal(out, '\n'.join(items+[''])) + +def test_columnize_long(): + """Test columnize with inputs longer than the display window""" + size = 11 + items = [l*size for l in 'abc'] + out = text.columnize(items, displaywidth=size-1) + nt.assert_equal(out, '\n'.join(items+[''])) + diff --git a/.venv/lib/python3.8/site-packages/ipython_genutils/text.py b/.venv/lib/python3.8/site-packages/ipython_genutils/text.py new file mode 100644 index 00000000..e196a70a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/ipython_genutils/text.py @@ -0,0 +1,244 @@ +# encoding: utf-8 +""" +Utilities for working with strings and text. + +Inheritance diagram: + +.. inheritance-diagram:: IPython.utils.text + :parts: 3 +""" + +import os +import re +import sys +import textwrap +from string import Formatter + +# datetime.strftime date format for ipython +if sys.platform == 'win32': + date_format = "%B %d, %Y" +else: + date_format = "%B %-d, %Y" + + +def indent(instr,nspaces=4, ntabs=0, flatten=False): + """Indent a string a given number of spaces or tabstops. + + indent(str,nspaces=4,ntabs=0) -> indent str by ntabs+nspaces. + + Parameters + ---------- + + instr : basestring + The string to be indented. + nspaces : int (default: 4) + The number of spaces to be indented. + ntabs : int (default: 0) + The number of tabs to be indented. + flatten : bool (default: False) + Whether to scrub existing indentation. If True, all lines will be + aligned to the same indentation. If False, existing indentation will + be strictly increased. + + Returns + ------- + + str|unicode : string indented by ntabs and nspaces. + + """ + if instr is None: + return + ind = '\t'*ntabs+' '*nspaces + if flatten: + pat = re.compile(r'^\s*', re.MULTILINE) + else: + pat = re.compile(r'^', re.MULTILINE) + outstr = re.sub(pat, ind, instr) + if outstr.endswith(os.linesep+ind): + return outstr[:-len(ind)] + else: + return outstr + + +def dedent(text): + """Equivalent of textwrap.dedent that ignores unindented first line. + + This means it will still dedent strings like: + '''foo + is a bar + ''' + + For use in wrap_paragraphs. + """ + + if text.startswith('\n'): + # text starts with blank line, don't ignore the first line + return textwrap.dedent(text) + + # split first line + splits = text.split('\n',1) + if len(splits) == 1: + # only one line + return textwrap.dedent(text) + + first, rest = splits + # dedent everything but the first line + rest = textwrap.dedent(rest) + return '\n'.join([first, rest]) + + +def wrap_paragraphs(text, ncols=80): + """Wrap multiple paragraphs to fit a specified width. + + This is equivalent to textwrap.wrap, but with support for multiple + paragraphs, as separated by empty lines. + + Returns + ------- + + list of complete paragraphs, wrapped to fill `ncols` columns. + """ + paragraph_re = re.compile(r'\n(\s*\n)+', re.MULTILINE) + text = dedent(text).strip() + paragraphs = paragraph_re.split(text)[::2] # every other entry is space + out_ps = [] + indent_re = re.compile(r'\n\s+', re.MULTILINE) + for p in paragraphs: + # presume indentation that survives dedent is meaningful formatting, + # so don't fill unless text is flush. + if indent_re.search(p) is None: + # wrap paragraph + p = textwrap.fill(p, ncols) + out_ps.append(p) + return out_ps + + +def strip_ansi(source): + """ + Remove ansi escape codes from text. + + Parameters + ---------- + source : str + Source to remove the ansi from + """ + return re.sub(r'\033\[(\d|;)+?m', '', source) + + +#----------------------------------------------------------------------------- +# Utils to columnize a list of string +#----------------------------------------------------------------------------- + +def _chunks(l, n): + """Yield successive n-sized chunks from l.""" + for i in range(0, len(l), n): + yield l[i:i+n] + + +def _find_optimal(rlist , separator_size=2 , displaywidth=80): + """Calculate optimal info to columnize a list of string""" + for nrow in range(1, len(rlist)+1) : + chk = list(map(max,_chunks(rlist, nrow))) + sumlength = sum(chk) + ncols = len(chk) + if sumlength+separator_size*(ncols-1) <= displaywidth : + break; + return {'columns_numbers' : ncols, + 'optimal_separator_width':(displaywidth - sumlength)/(ncols-1) if (ncols -1) else 0, + 'rows_numbers' : nrow, + 'columns_width' : chk + } + + +def _get_or_default(mylist, i, default=None): + """return list item number, or default if don't exist""" + if i >= len(mylist): + return default + else : + return mylist[i] + + +def compute_item_matrix(items, empty=None, *args, **kwargs) : + """Returns a nested list, and info to columnize items + + Parameters + ---------- + + items + list of strings to columize + empty : (default None) + default value to fill list if needed + separator_size : int (default=2) + How much caracters will be used as a separation between each columns. + displaywidth : int (default=80) + The width of the area onto wich the columns should enter + + Returns + ------- + + strings_matrix + + nested list of string, the outer most list contains as many list as + rows, the innermost lists have each as many element as colums. If the + total number of elements in `items` does not equal the product of + rows*columns, the last element of some lists are filled with `None`. + + dict_info + some info to make columnize easier: + + columns_numbers + number of columns + rows_numbers + number of rows + columns_width + list of with of each columns + optimal_separator_width + best separator width between columns + + Examples + -------- + :: + + In [1]: l = ['aaa','b','cc','d','eeeee','f','g','h','i','j','k','l'] + ...: compute_item_matrix(l,displaywidth=12) + Out[1]: + ([['aaa', 'f', 'k'], + ['b', 'g', 'l'], + ['cc', 'h', None], + ['d', 'i', None], + ['eeeee', 'j', None]], + {'columns_numbers': 3, + 'columns_width': [5, 1, 1], + 'optimal_separator_width': 2, + 'rows_numbers': 5}) + """ + info = _find_optimal(list(map(len, items)), *args, **kwargs) + nrow, ncol = info['rows_numbers'], info['columns_numbers'] + return ([[ _get_or_default(items, c*nrow+i, default=empty) for c in range(ncol) ] for i in range(nrow) ], info) + + +def columnize(items, separator=' ', displaywidth=80): + """ Transform a list of strings into a single string with columns. + + Parameters + ---------- + items : sequence of strings + The strings to process. + + separator : str, optional [default is two spaces] + The string that separates columns. + + displaywidth : int, optional [default is 80] + Width of the display in number of characters. + + Returns + ------- + The formatted string. + """ + if not items : + return '\n' + matrix, info = compute_item_matrix(items, separator_size=len(separator), displaywidth=displaywidth) + fmatrix = [filter(None, x) for x in matrix] + sjoin = lambda x : separator.join([ y.ljust(w, ' ') for y, w in zip(x, info['columns_width'])]) + return '\n'.join(map(sjoin, fmatrix))+'\n' + diff --git a/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/INSTALLER b/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/LICENSE b/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/LICENSE new file mode 100755 index 00000000..b5083a50 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013 Timothy Edmund Crosley + +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +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. diff --git a/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/METADATA b/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/METADATA new file mode 100644 index 00000000..fbc7f6c4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/METADATA @@ -0,0 +1,697 @@ +Metadata-Version: 2.1 +Name: isort +Version: 4.3.21 +Summary: A Python utility / library to sort Python imports. +Home-page: https://github.com/timothycrosley/isort +Author: Timothy Crosley +Author-email: timothy.crosley@gmail.com +License: MIT +Keywords: Refactor,Python,Python2,Python3,Refactoring,Imports,Sort,Clean +Platform: UNKNOWN +Classifier: Development Status :: 6 - Mature +Classifier: Intended Audience :: Developers +Classifier: Natural Language :: English +Classifier: Environment :: Console +Classifier: License :: OSI Approved :: MIT License +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Topic :: Software Development :: Libraries +Classifier: Topic :: Utilities +Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* +Requires-Dist: futures ; python_version < "3.2" +Requires-Dist: backports.functools-lru-cache ; python_version < "3.2" +Provides-Extra: pipfile +Requires-Dist: pipreqs ; extra == 'pipfile' +Requires-Dist: requirementslib ; extra == 'pipfile' +Provides-Extra: pyproject +Requires-Dist: toml ; extra == 'pyproject' +Provides-Extra: requirements +Requires-Dist: pipreqs ; extra == 'requirements' +Requires-Dist: pip-api ; extra == 'requirements' +Provides-Extra: xdg_home +Requires-Dist: appdirs (>=1.4.0) ; extra == 'xdg_home' + +.. image:: https://raw.github.com/timothycrosley/isort/master/logo.png + :alt: isort + +######## + +.. image:: https://badge.fury.io/py/isort.svg + :target: https://badge.fury.io/py/isort + :alt: PyPI version + +.. image:: https://travis-ci.org/timothycrosley/isort.svg?branch=master + :target: https://travis-ci.org/timothycrosley/isort + :alt: Build Status + + +.. image:: https://coveralls.io/repos/timothycrosley/isort/badge.svg?branch=release%2F2.6.0&service=github + :target: https://coveralls.io/github/timothycrosley/isort?branch=release%2F2.6.0 + :alt: Coverage + +.. image:: https://img.shields.io/github/license/mashape/apistatus.svg + :target: https://pypi.org/project/hug/ + :alt: License + +.. image:: https://badges.gitter.im/Join%20Chat.svg + :alt: Join the chat at https://gitter.im/timothycrosley/isort + :target: https://gitter.im/timothycrosley/isort?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge + +.. image:: https://pepy.tech/badge/isort + :alt: Downloads + :target: https://pepy.tech/project/isort + +isort your python imports for you so you don't have to. + +isort is a Python utility / library to sort imports alphabetically, and automatically separated into sections. +It provides a command line utility, Python library and `plugins for various editors `_ to quickly sort all your imports. +It currently cleanly supports Python 2.7 and 3.4+ without any dependencies. + +.. image:: https://raw.github.com/timothycrosley/isort/develop/example.gif + :alt: Example Usage + +Before isort: + +.. code-block:: python + + from my_lib import Object + + print("Hey") + + import os + + from my_lib import Object3 + + from my_lib import Object2 + + import sys + + from third_party import lib15, lib1, lib2, lib3, lib4, lib5, lib6, lib7, lib8, lib9, lib10, lib11, lib12, lib13, lib14 + + import sys + + from __future__ import absolute_import + + from third_party import lib3 + + print("yo") + +After isort: + +.. code-block:: python + + from __future__ import absolute_import + + import os + import sys + + from third_party import (lib1, lib2, lib3, lib4, lib5, lib6, lib7, lib8, + lib9, lib10, lib11, lib12, lib13, lib14, lib15) + + from my_lib import Object, Object2, Object3 + + print("Hey") + print("yo") + +Installing isort +================ + +Installing isort is as simple as: + +.. code-block:: bash + + pip install isort + +Install isort with requirements.txt support: + +.. code-block:: bash + + pip install isort[requirements] + +Install isort with Pipfile support: + +.. code-block:: bash + + pip install isort[pipfile] + +Install isort with both formats support: + +.. code-block:: bash + + pip install isort[requirements,pipfile] + +Using isort +=========== + +**From the command line**: + +.. code-block:: bash + + isort mypythonfile.py mypythonfile2.py + +or recursively: + +.. code-block:: bash + + isort -rc . + +*which is equivalent to:* + +.. code-block:: bash + + isort **/*.py + +or to see the proposed changes without applying them: + +.. code-block:: bash + + isort mypythonfile.py --diff + +Finally, to atomically run isort against a project, only applying changes if they don't introduce syntax errors do: + +.. code-block:: bash + + isort -rc --atomic . + +(Note: this is disabled by default as it keeps isort from being able to run against code written using a different version of Python) + +**From within Python**: + +.. code-block:: bash + + from isort import SortImports + + SortImports("pythonfile.py") + +or: + +.. code-block:: bash + + from isort import SortImports + + new_contents = SortImports(file_contents=old_contents).output + +**From within Kate:** + +.. code-block:: bash + + ctrl+[ + +or: + +.. code-block:: bash + + menu > Python > Sort Imports + +Installing isort's Kate plugin +============================== + +For KDE 4.13+ / Pate 2.0+: + +.. code-block:: bash + + wget https://raw.github.com/timothycrosley/isort/master/kate_plugin/isort_plugin.py --output-document ~/.kde/share/apps/kate/pate/isort_plugin.py + wget https://raw.github.com/timothycrosley/isort/master/kate_plugin/isort_plugin_ui.rc --output-document ~/.kde/share/apps/kate/pate/isort_plugin_ui.rc + wget https://raw.github.com/timothycrosley/isort/master/kate_plugin/katepart_isort.desktop --output-document ~/.kde/share/kde4/services/katepart_isort.desktop + +For all older versions: + +.. code-block:: bash + + wget https://raw.github.com/timothycrosley/isort/master/kate_plugin/isort_plugin_old.py --output-document ~/.kde/share/apps/kate/pate/isort_plugin.py + +You will then need to restart kate and enable Python Plugins as well as the isort plugin itself. + +Installing isort's for your preferred text editor +================================================= + +Several plugins have been written that enable to use isort from within a variety of text-editors. +You can find a full list of them `on the isort wiki `_. +Additionally, I will enthusiastically accept pull requests that include plugins for other text editors +and add documentation for them as I am notified. + +How does isort work? +==================== + +isort parses specified files for global level import lines (imports outside of try / except blocks, functions, etc..) +and puts them all at the top of the file grouped together by the type of import: + +- Future +- Python Standard Library +- Third Party +- Current Python Project +- Explicitly Local (. before import, as in: ``from . import x``) +- Custom Separate Sections (Defined by forced_separate list in configuration file) +- Custom Sections (Defined by sections list in configuration file) + +Inside of each section the imports are sorted alphabetically. isort automatically removes duplicate python imports, +and wraps long from imports to the specified line length (defaults to 79). + +When will isort not work? +========================= + +If you ever have the situation where you need to have a try / except block in the middle of top-level imports or if +your import order is directly linked to precedence. + +For example: a common practice in Django settings files is importing * from various settings files to form +a new settings file. In this case if any of the imports change order you are changing the settings definition itself. + +However, you can configure isort to skip over just these files - or even to force certain imports to the top. + +Configuring isort +================= + +If you find the default isort settings do not work well for your project, isort provides several ways to adjust +the behavior. + +To configure isort for a single user create a ``~/.isort.cfg`` or ``$XDG_CONFIG_HOME/isort.cfg`` file: + +.. code-block:: ini + + [settings] + line_length=120 + force_to_top=file1.py,file2.py + skip=file3.py,file4.py + known_future_library=future,pies + known_standard_library=std,std2 + known_third_party=randomthirdparty + known_first_party=mylib1,mylib2 + indent=' ' + multi_line_output=3 + length_sort=1 + forced_separate=django.contrib,django.utils + default_section=FIRSTPARTY + no_lines_before=LOCALFOLDER + +Additionally, you can specify project level configuration simply by placing a ``.isort.cfg`` file at the root of your +project. isort will look up to 25 directories up, from the file it is ran against, to find a project specific configuration. + +Or, if you prefer, you can add an ``isort`` or ``tool:isort`` section to your project's ``setup.cfg`` or ``tox.ini`` file with any desired settings. + +You can also add your desired settings under a ``[tool.isort]`` section in your ``pyproject.toml`` file. + +You can then override any of these settings by using command line arguments, or by passing in override values to the +SortImports class. + +Finally, as of version 3.0 isort supports editorconfig files using the standard syntax defined here: +https://editorconfig.org/ + +Meaning you place any standard isort configuration parameters within a .editorconfig file under the ``*.py`` section +and they will be honored. + +For a full list of isort settings and their meanings `take a look at the isort wiki `_. + +Multi line output modes +======================= + +You will notice above the "multi_line_output" setting. This setting defines how from imports wrap when they extend +past the line_length limit and has 6 possible settings: + +**0 - Grid** + +.. code-block:: python + + from third_party import (lib1, lib2, lib3, + lib4, lib5, ...) + +**1 - Vertical** + +.. code-block:: python + + from third_party import (lib1, + lib2, + lib3 + lib4, + lib5, + ...) + +**2 - Hanging Indent** + +.. code-block:: python + + from third_party import \ + lib1, lib2, lib3, \ + lib4, lib5, lib6 + +**3 - Vertical Hanging Indent** + +.. code-block:: python + + from third_party import ( + lib1, + lib2, + lib3, + lib4, + ) + +**4 - Hanging Grid** + +.. code-block:: python + + from third_party import ( + lib1, lib2, lib3, lib4, + lib5, ...) + +**5 - Hanging Grid Grouped** + +.. code-block:: python + + from third_party import ( + lib1, lib2, lib3, lib4, + lib5, ... + ) + +**6 - Hanging Grid Grouped, No Trailing Comma** + +In Mode 5 isort leaves a single extra space to maintain consistency of output when a comma is added at the end. +Mode 6 is the same - except that no extra space is maintained leading to the possibility of lines one character longer. +You can enforce a trailing comma by using this in conjunction with `-tc` or `trailing_comma: True`. + +.. code-block:: python + + from third_party import ( + lib1, lib2, lib3, lib4, + lib5 + ) + +**7 - NOQA** + +.. code-block:: python + + from third_party import lib1, lib2, lib3, ... # NOQA + +Alternatively, you can set ``force_single_line`` to ``True`` (``-sl`` on the command line) and every import will appear on its +own line: + +.. code-block:: python + + from third_party import lib1 + from third_party import lib2 + from third_party import lib3 + ... + +Note: to change the how constant indents appear - simply change the indent property with the following accepted formats: + +* Number of spaces you would like. For example: 4 would cause standard 4 space indentation. +* Tab +* A verbatim string with quotes around it. + +For example: + +.. code-block:: python + + " " + +is equivalent to 4. + +For the import styles that use parentheses, you can control whether or not to +include a trailing comma after the last import with the ``include_trailing_comma`` +option (defaults to ``False``). + +Intelligently Balanced Multi-line Imports +========================================= + +As of isort 3.1.0 support for balanced multi-line imports has been added. +With this enabled isort will dynamically change the import length to the one that produces the most balanced grid, +while staying below the maximum import length defined. + +Example: + +.. code-block:: python + + from __future__ import (absolute_import, division, + print_function, unicode_literals) + +Will be produced instead of: + +.. code-block:: python + + from __future__ import (absolute_import, division, print_function, + unicode_literals) + +To enable this set ``balanced_wrapping`` to ``True`` in your config or pass the ``-e`` option into the command line utility. + +Custom Sections and Ordering +============================ + +You can change the section order with ``sections`` option from the default of: + +.. code-block:: ini + + FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER + +to your preference: + +.. code-block:: ini + + sections=FUTURE,STDLIB,FIRSTPARTY,THIRDPARTY,LOCALFOLDER + +You also can define your own sections and their order. + +Example: + +.. code-block:: ini + + known_django=django + known_pandas=pandas,numpy + sections=FUTURE,STDLIB,DJANGO,THIRDPARTY,PANDAS,FIRSTPARTY,LOCALFOLDER + +would create two new sections with the specified known modules. + +The ``no_lines_before`` option will prevent the listed sections from being split from the previous section by an empty line. + +Example: + +.. code-block:: ini + + sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER + no_lines_before=LOCALFOLDER + +would produce a section with both FIRSTPARTY and LOCALFOLDER modules combined. + +Auto-comment import sections +============================ + +Some projects prefer to have import sections uniquely titled to aid in identifying the sections quickly +when visually scanning. isort can automate this as well. To do this simply set the ``import_heading_{section_name}`` +setting for each section you wish to have auto commented - to the desired comment. + +For Example: + +.. code-block:: ini + + import_heading_stdlib=Standard Library + import_heading_firstparty=My Stuff + +Would lead to output looking like the following: + +.. code-block:: python + + # Standard Library + import os + import sys + + import django.settings + + # My Stuff + import myproject.test + +Ordering by import length +========================= + +isort also makes it easy to sort your imports by length, simply by setting the ``length_sort`` option to ``True``. +This will result in the following output style: + +.. code-block:: python + + from evn.util import ( + Pool, + Dict, + Options, + Constant, + DecayDict, + UnexpectedCodePath, + ) + +It is also possible to opt-in to sorting imports by length for only specific +sections by using ``length_sort_`` followed by the section name as a +configuration item, e.g.:: + + length_sort_stdlib=1 + +Skip processing of imports (outside of configuration) +===================================================== + +To make isort ignore a single import simply add a comment at the end of the import line containing the text ``isort:skip``: + +.. code-block:: python + + import module # isort:skip + +or: + +.. code-block:: python + + from xyz import (abc, # isort:skip + yo, + hey) + +To make isort skip an entire file simply add ``isort:skip_file`` to the module's doc string: + +.. code-block:: python + + """ my_module.py + Best module ever + + isort:skip_file + """ + + import b + import a + +Adding an import to multiple files +================================== + +isort makes it easy to add an import statement across multiple files, while being assured it's correctly placed. + +From the command line: + +.. code-block:: bash + + isort -a "from __future__ import print_function" *.py + +from within Kate: + +.. code-block:: + + ctrl+] + +or: + +.. code-block:: + + menu > Python > Add Import + +Removing an import from multiple files +====================================== + +isort also makes it easy to remove an import from multiple files, without having to be concerned with how it was originally +formatted. + +From the command line: + +.. code-block:: bash + + isort -rm "os.system" *.py + +from within Kate: + +.. code-block:: + + ctrl+shift+] + +or: + +.. code-block:: + + menu > Python > Remove Import + +Using isort to verify code +========================== + +The ``--check-only`` option +--------------------------- + +isort can also be used to used to verify that code is correctly formatted by running it with ``-c``. +Any files that contain incorrectly sorted and/or formatted imports will be outputted to ``stderr``. + +.. code-block:: bash + + isort **/*.py -c -vb + + SUCCESS: /home/timothy/Projects/Open_Source/isort/isort_kate_plugin.py Everything Looks Good! + ERROR: /home/timothy/Projects/Open_Source/isort/isort/isort.py Imports are incorrectly sorted. + +One great place this can be used is with a pre-commit git hook, such as this one by @acdha: + +https://gist.github.com/acdha/8717683 + +This can help to ensure a certain level of code quality throughout a project. + + +Git hook +-------- + +isort provides a hook function that can be integrated into your Git pre-commit script to check +Python code before committing. + +To cause the commit to fail if there are isort errors (strict mode), include the following in +``.git/hooks/pre-commit``: + +.. code-block:: python + + #!/usr/bin/env python + import sys + from isort.hooks import git_hook + + sys.exit(git_hook(strict=True, modify=True)) + +If you just want to display warnings, but allow the commit to happen anyway, call ``git_hook`` without +the `strict` parameter. If you want to display warnings, but not also fix the code, call ``git_hook`` without +the `modify` parameter. + +Setuptools integration +---------------------- + +Upon installation, isort enables a ``setuptools`` command that checks Python files +declared by your project. + +Running ``python setup.py isort`` on the command line will check the files +listed in your ``py_modules`` and ``packages``. If any warning is found, +the command will exit with an error code: + +.. code-block:: bash + + $ python setup.py isort + +Also, to allow users to be able to use the command without having to install +isort themselves, add isort to the setup_requires of your ``setup()`` like so: + +.. code-block:: python + + setup( + name="project", + packages=["project"], + + setup_requires=[ + "isort" + ] + ) + + +Why isort? +========== + +isort simply stands for import sort. It was originally called "sortImports" however I got tired of typing the extra +characters and came to the realization camelCase is not pythonic. + +I wrote isort because in an organization I used to work in the manager came in one day and decided all code must +have alphabetically sorted imports. The code base was huge - and he meant for us to do it by hand. However, being a +programmer - I'm too lazy to spend 8 hours mindlessly performing a function, but not too lazy to spend 16 +hours automating it. I was given permission to open source sortImports and here we are :) + +-------------------------------------------- + +Thanks and I hope you find isort useful! + +~Timothy Crosley + + diff --git a/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/RECORD b/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/RECORD new file mode 100644 index 00000000..2c21f6e2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/RECORD @@ -0,0 +1,30 @@ +../../../bin/isort,sha256=Pi44VAPJONYOe-9NZlfLBBTG2qAOrMwzicrzyr6xlrg,238 +isort-4.3.21.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +isort-4.3.21.dist-info/LICENSE,sha256=BjKUABw9Uj26y6ud1UrCKZgnVsyvWSylMkCysM3YIGU,1089 +isort-4.3.21.dist-info/METADATA,sha256=8fY1DuLOn_UnCH58A8AcsCUZpYWeLCsQF-n-GIXlxOM,19749 +isort-4.3.21.dist-info/RECORD,, +isort-4.3.21.dist-info/WHEEL,sha256=h_aVn5OB2IERUjMbi2pucmR_zzWJtk303YXvhh60NJ8,110 +isort-4.3.21.dist-info/entry_points.txt,sha256=2M99eSFpnteDm3ekW8jya2a3A0-vFntKdT1fP93Tyks,148 +isort-4.3.21.dist-info/top_level.txt,sha256=mrBLoVpJnQWBbnMOSdzkjN1E9Z-e3Zd-MRlo88bstUk,6 +isort/__init__.py,sha256=_DTTMASePJCqsKnRJPf_YgFv5ZJOHg1uPLkrQHcqA2c,1380 +isort/__main__.py,sha256=9tThPqyOnY86bHaxJ0WciTd-rfKN3O-PQoNGBO2xhio,205 +isort/__pycache__/__init__.cpython-38.pyc,, +isort/__pycache__/__main__.cpython-38.pyc,, +isort/__pycache__/finders.cpython-38.pyc,, +isort/__pycache__/hooks.cpython-38.pyc,, +isort/__pycache__/isort.cpython-38.pyc,, +isort/__pycache__/main.cpython-38.pyc,, +isort/__pycache__/natural.cpython-38.pyc,, +isort/__pycache__/pie_slice.cpython-38.pyc,, +isort/__pycache__/pylama_isort.cpython-38.pyc,, +isort/__pycache__/settings.cpython-38.pyc,, +isort/__pycache__/utils.cpython-38.pyc,, +isort/finders.py,sha256=0w39ygCFuOv40OHixflrOv_Xna8K78usa5ySwS9GkWE,13185 +isort/hooks.py,sha256=GcyPMF7raq3B1z4ubbzIWoMiY5DePDni0Nct5U87uMQ,3230 +isort/isort.py,sha256=krLW0QgwnVjUD3hYTpQmWkMa5TDEZxx6AbX80vlVNoA,53910 +isort/main.py,sha256=rS7dAu_0T-8Jxi3sDWu00IOjt4j0r3vJi6bXZn6RnQg,21974 +isort/natural.py,sha256=hlcWsGKfIUC4Atjp5IIqDCmg1madY6ave9oNiTGjJ0Q,1794 +isort/pie_slice.py,sha256=hO6l1XocvGAd8XTR8526r-G7XIncUQB53_DHQ4AZEYI,5612 +isort/pylama_isort.py,sha256=wF6NOEVuibme0l-5pH9pCW1j4vGaFamuwll494TnzDI,785 +isort/settings.py,sha256=4_Jf-9GaBy9fi6UJctLqesIAMAegWekRIJdJmH5TBNE,17452 +isort/utils.py,sha256=KtazEoeX9XmtcrUGP6xl5lBX7Ye2N08ACGaWxiGcIaE,1344 diff --git a/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/WHEEL b/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/WHEEL new file mode 100644 index 00000000..78e6f69d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.33.4) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/entry_points.txt b/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/entry_points.txt new file mode 100644 index 00000000..3a77a18c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/entry_points.txt @@ -0,0 +1,9 @@ +[console_scripts] +isort = isort.main:main + +[distutils.commands] +isort = isort.main:ISortCommand + +[pylama.linter] +isort = isort.pylama_isort:Linter + diff --git a/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/top_level.txt b/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/top_level.txt new file mode 100644 index 00000000..2a792435 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/isort-4.3.21.dist-info/top_level.txt @@ -0,0 +1 @@ +isort diff --git a/.venv/lib/python3.8/site-packages/isort/__init__.py b/.venv/lib/python3.8/site-packages/isort/__init__.py new file mode 100644 index 00000000..9a0a0731 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/isort/__init__.py @@ -0,0 +1,28 @@ +"""__init__.py. + +Defines the isort module to include the SortImports utility class as well as any defined settings. + +Copyright (C) 2013 Timothy Edmund Crosley + +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: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +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. + +""" + +from __future__ import absolute_import, division, print_function, unicode_literals + +from . import settings # noqa: F401 +from .isort import SortImports # noqa: F401 + +__version__ = "4.3.21" diff --git a/.venv/lib/python3.8/site-packages/isort/__main__.py b/.venv/lib/python3.8/site-packages/isort/__main__.py new file mode 100644 index 00000000..91cc154d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/isort/__main__.py @@ -0,0 +1,9 @@ +from __future__ import absolute_import + +from isort.pie_slice import apply_changes_to_python_environment + +apply_changes_to_python_environment() + +from isort.main import main # noqa: E402 isort:skip + +main() diff --git a/.venv/lib/python3.8/site-packages/isort/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/isort/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..840039ed Binary files /dev/null and b/.venv/lib/python3.8/site-packages/isort/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/isort/__pycache__/__main__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/isort/__pycache__/__main__.cpython-38.pyc new file mode 100644 index 00000000..b38546ff Binary files /dev/null and b/.venv/lib/python3.8/site-packages/isort/__pycache__/__main__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/isort/__pycache__/finders.cpython-38.pyc b/.venv/lib/python3.8/site-packages/isort/__pycache__/finders.cpython-38.pyc new file mode 100644 index 00000000..6778d6bc Binary files /dev/null and b/.venv/lib/python3.8/site-packages/isort/__pycache__/finders.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/isort/__pycache__/hooks.cpython-38.pyc b/.venv/lib/python3.8/site-packages/isort/__pycache__/hooks.cpython-38.pyc new file mode 100644 index 00000000..5d79a502 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/isort/__pycache__/hooks.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/isort/__pycache__/isort.cpython-38.pyc b/.venv/lib/python3.8/site-packages/isort/__pycache__/isort.cpython-38.pyc new file mode 100644 index 00000000..2690abcd Binary files /dev/null and b/.venv/lib/python3.8/site-packages/isort/__pycache__/isort.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/isort/__pycache__/main.cpython-38.pyc b/.venv/lib/python3.8/site-packages/isort/__pycache__/main.cpython-38.pyc new file mode 100644 index 00000000..165d8b14 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/isort/__pycache__/main.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/isort/__pycache__/natural.cpython-38.pyc b/.venv/lib/python3.8/site-packages/isort/__pycache__/natural.cpython-38.pyc new file mode 100644 index 00000000..cc6d6565 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/isort/__pycache__/natural.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/isort/__pycache__/pie_slice.cpython-38.pyc b/.venv/lib/python3.8/site-packages/isort/__pycache__/pie_slice.cpython-38.pyc new file mode 100644 index 00000000..156db0c4 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/isort/__pycache__/pie_slice.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/isort/__pycache__/pylama_isort.cpython-38.pyc b/.venv/lib/python3.8/site-packages/isort/__pycache__/pylama_isort.cpython-38.pyc new file mode 100644 index 00000000..c263ec84 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/isort/__pycache__/pylama_isort.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/isort/__pycache__/settings.cpython-38.pyc b/.venv/lib/python3.8/site-packages/isort/__pycache__/settings.cpython-38.pyc new file mode 100644 index 00000000..92ed3fc3 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/isort/__pycache__/settings.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/isort/__pycache__/utils.cpython-38.pyc b/.venv/lib/python3.8/site-packages/isort/__pycache__/utils.cpython-38.pyc new file mode 100644 index 00000000..d6921353 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/isort/__pycache__/utils.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/isort/finders.py b/.venv/lib/python3.8/site-packages/isort/finders.py new file mode 100644 index 00000000..225bd121 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/isort/finders.py @@ -0,0 +1,382 @@ +"""Finders try to find right section for passed module name +""" +from __future__ import absolute_import, division, print_function, unicode_literals + +import inspect +import os +import os.path +import re +import sys +import sysconfig +from fnmatch import fnmatch +from glob import glob + +from .pie_slice import PY2 +from .utils import chdir, exists_case_sensitive + +try: + from pipreqs import pipreqs +except ImportError: + pipreqs = None + +try: + from pip_api import parse_requirements +except ImportError: + parse_requirements = None + +try: + from requirementslib import Pipfile +except ImportError: + Pipfile = None + +try: + from functools import lru_cache +except ImportError: + from backports.functools_lru_cache import lru_cache + + +KNOWN_SECTION_MAPPING = { + 'STDLIB': 'STANDARD_LIBRARY', + 'FUTURE': 'FUTURE_LIBRARY', + 'FIRSTPARTY': 'FIRST_PARTY', + 'THIRDPARTY': 'THIRD_PARTY', +} + + +class BaseFinder(object): + def __init__(self, config, sections): + self.config = config + self.sections = sections + + +class ForcedSeparateFinder(BaseFinder): + def find(self, module_name): + for forced_separate in self.config['forced_separate']: + # Ensure all forced_separate patterns will match to end of string + path_glob = forced_separate + if not forced_separate.endswith('*'): + path_glob = '%s*' % forced_separate + + if fnmatch(module_name, path_glob) or fnmatch(module_name, '.' + path_glob): + return forced_separate + + +class LocalFinder(BaseFinder): + def find(self, module_name): + if module_name.startswith("."): + return self.sections.LOCALFOLDER + + +class KnownPatternFinder(BaseFinder): + def __init__(self, config, sections): + super(KnownPatternFinder, self).__init__(config, sections) + + self.known_patterns = [] + for placement in reversed(self.sections): + known_placement = KNOWN_SECTION_MAPPING.get(placement, placement) + config_key = 'known_{0}'.format(known_placement.lower()) + known_patterns = self.config.get(config_key, []) + known_patterns = [ + pattern + for known_pattern in known_patterns + for pattern in self._parse_known_pattern(known_pattern) + ] + for known_pattern in known_patterns: + regexp = '^' + known_pattern.replace('*', '.*').replace('?', '.?') + '$' + self.known_patterns.append((re.compile(regexp), placement)) + + @staticmethod + def _is_package(path): + """ + Evaluates if path is a python package + """ + if PY2: + return os.path.exists(os.path.join(path, '__init__.py')) + else: + return os.path.isdir(path) + + def _parse_known_pattern(self, pattern): + """ + Expand pattern if identified as a directory and return found sub packages + """ + if pattern.endswith(os.path.sep): + patterns = [ + filename + for filename in os.listdir(pattern) + if self._is_package(os.path.join(pattern, filename)) + ] + else: + patterns = [pattern] + + return patterns + + def find(self, module_name): + # Try to find most specific placement instruction match (if any) + parts = module_name.split('.') + module_names_to_check = ('.'.join(parts[:first_k]) for first_k in range(len(parts), 0, -1)) + for module_name_to_check in module_names_to_check: + for pattern, placement in self.known_patterns: + if pattern.match(module_name_to_check): + return placement + + +class PathFinder(BaseFinder): + def __init__(self, config, sections): + super(PathFinder, self).__init__(config, sections) + + # restore the original import path (i.e. not the path to bin/isort) + self.paths = [os.getcwd()] + + # virtual env + self.virtual_env = self.config.get('virtual_env') or os.environ.get('VIRTUAL_ENV') + if self.virtual_env: + self.virtual_env = os.path.realpath(self.virtual_env) + self.virtual_env_src = False + if self.virtual_env: + self.virtual_env_src = '{0}/src/'.format(self.virtual_env) + for path in glob('{0}/lib/python*/site-packages'.format(self.virtual_env)): + if path not in self.paths: + self.paths.append(path) + for path in glob('{0}/lib/python*/*/site-packages'.format(self.virtual_env)): + if path not in self.paths: + self.paths.append(path) + for path in glob('{0}/src/*'.format(self.virtual_env)): + if os.path.isdir(path): + self.paths.append(path) + + # conda + self.conda_env = self.config.get('conda_env') or os.environ.get('CONDA_PREFIX') + if self.conda_env: + self.conda_env = os.path.realpath(self.conda_env) + for path in glob('{0}/lib/python*/site-packages'.format(self.conda_env)): + if path not in self.paths: + self.paths.append(path) + for path in glob('{0}/lib/python*/*/site-packages'.format(self.conda_env)): + if path not in self.paths: + self.paths.append(path) + + # handle case-insensitive paths on windows + self.stdlib_lib_prefix = os.path.normcase(sysconfig.get_paths()['stdlib']) + if self.stdlib_lib_prefix not in self.paths: + self.paths.append(self.stdlib_lib_prefix) + + # handle compiled libraries + self.ext_suffix = sysconfig.get_config_var("EXT_SUFFIX") or ".so" + + # add system paths + for path in sys.path[1:]: + if path not in self.paths: + self.paths.append(path) + + def find(self, module_name): + for prefix in self.paths: + package_path = "/".join((prefix, module_name.split(".")[0])) + is_module = (exists_case_sensitive(package_path + ".py") or + exists_case_sensitive(package_path + ".so") or + exists_case_sensitive(package_path + self.ext_suffix) or + exists_case_sensitive(package_path + "/__init__.py")) + is_package = exists_case_sensitive(package_path) and os.path.isdir(package_path) + if is_module or is_package: + if 'site-packages' in prefix: + return self.sections.THIRDPARTY + if 'dist-packages' in prefix: + return self.sections.THIRDPARTY + if self.virtual_env and self.virtual_env_src in prefix: + return self.sections.THIRDPARTY + if self.conda_env and self.conda_env in prefix: + return self.sections.THIRDPARTY + if os.path.normcase(prefix).startswith(self.stdlib_lib_prefix): + return self.sections.STDLIB + return self.config['default_section'] + + +class ReqsBaseFinder(BaseFinder): + def __init__(self, config, sections, path='.'): + super(ReqsBaseFinder, self).__init__(config, sections) + self.path = path + if self.enabled: + self.mapping = self._load_mapping() + self.names = self._load_names() + + @staticmethod + def _load_mapping(): + """Return list of mappings `package_name -> module_name` + + Example: + django-haystack -> haystack + """ + if not pipreqs: + return + path = os.path.dirname(inspect.getfile(pipreqs)) + path = os.path.join(path, 'mapping') + with open(path) as f: + # pypi_name: import_name + return dict(line.strip().split(":")[::-1] for line in f) + + def _load_names(self): + """Return list of thirdparty modules from requirements + """ + names = [] + for path in self._get_files(): + for name in self._get_names(path): + names.append(self._normalize_name(name)) + return names + + @staticmethod + def _get_parents(path): + prev = '' + while path != prev: + prev = path + yield path + path = os.path.dirname(path) + + def _get_files(self): + """Return paths to all requirements files + """ + path = os.path.abspath(self.path) + if os.path.isfile(path): + path = os.path.dirname(path) + + for path in self._get_parents(path): + for file_path in self._get_files_from_dir(path): + yield file_path + + def _normalize_name(self, name): + """Convert package name to module name + + Examples: + Django -> django + django-haystack -> haystack + Flask-RESTFul -> flask_restful + """ + if self.mapping: + name = self.mapping.get(name, name) + return name.lower().replace('-', '_') + + def find(self, module_name): + # required lib not installed yet + if not self.enabled: + return + + module_name, _sep, _submodules = module_name.partition('.') + module_name = module_name.lower() + if not module_name: + return + + for name in self.names: + if module_name == name: + return self.sections.THIRDPARTY + + +class RequirementsFinder(ReqsBaseFinder): + exts = ('.txt', '.in') + enabled = bool(parse_requirements) + + def _get_files_from_dir(self, path): + """Return paths to requirements files from passed dir. + """ + return RequirementsFinder._get_files_from_dir_cached(path) + + @classmethod + @lru_cache(maxsize=16) + def _get_files_from_dir_cached(cls, path): + result = [] + + for fname in os.listdir(path): + if 'requirements' not in fname: + continue + full_path = os.path.join(path, fname) + + # *requirements*/*.{txt,in} + if os.path.isdir(full_path): + for subfile_name in os.listdir(path): + for ext in cls.exts: + if subfile_name.endswith(ext): + result.append(os.path.join(path, subfile_name)) + continue + + # *requirements*.{txt,in} + if os.path.isfile(full_path): + for ext in cls.exts: + if fname.endswith(ext): + result.append(full_path) + break + + return result + + def _get_names(self, path): + """Load required packages from path to requirements file + """ + return RequirementsFinder._get_names_cached(path) + + @classmethod + @lru_cache(maxsize=16) + def _get_names_cached(cls, path): + results = [] + + with chdir(os.path.dirname(path)): + requirements = parse_requirements(path) + for req in requirements.values(): + if req.name: + results.append(req.name) + + return results + + +class PipfileFinder(ReqsBaseFinder): + enabled = bool(Pipfile) + + def _get_names(self, path): + with chdir(path): + project = Pipfile.load(path) + for req in project.packages: + yield req.name + + def _get_files_from_dir(self, path): + if 'Pipfile' in os.listdir(path): + yield path + + +class DefaultFinder(BaseFinder): + def find(self, module_name): + return self.config['default_section'] + + +class FindersManager(object): + finders = ( + ForcedSeparateFinder, + LocalFinder, + KnownPatternFinder, + PathFinder, + PipfileFinder, + RequirementsFinder, + DefaultFinder, + ) + + def __init__(self, config, sections, finders=None): + self.verbose = config.get('verbose', False) + + finders = self.finders if finders is None else finders + self.finders = [] + for finder in finders: + try: + self.finders.append(finder(config, sections)) + except Exception as exception: + # if one finder fails to instantiate isort can continue using the rest + if self.verbose: + print('{} encountered an error ({}) during instantiation and cannot be used'.format(finder.__name__, + str(exception))) + self.finders = tuple(self.finders) + + def find(self, module_name): + for finder in self.finders: + try: + section = finder.find(module_name) + except Exception as exception: + # isort has to be able to keep trying to identify the correct import section even if one approach fails + if self.verbose: + print('{} encountered an error ({}) while trying to identify the {} module'.format(finder.__name__, + str(exception), + module_name)) + if section is not None: + return section diff --git a/.venv/lib/python3.8/site-packages/isort/hooks.py b/.venv/lib/python3.8/site-packages/isort/hooks.py new file mode 100644 index 00000000..16a16e1f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/isort/hooks.py @@ -0,0 +1,91 @@ +"""isort.py. + +Defines a git hook to allow pre-commit warnings and errors about import order. + +usage: + exit_code = git_hook(strict=True|False, modify=True|False) + +Copyright (C) 2015 Helen Sherwood-Taylor + +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: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +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. + +""" +import subprocess + +from isort import SortImports + + +def get_output(command): + """ + Run a command and return raw output + + :param str command: the command to run + :returns: the stdout output of the command + """ + return subprocess.check_output(command.split()) + + +def get_lines(command): + """ + Run a command and return lines of output + + :param str command: the command to run + :returns: list of whitespace-stripped lines output by command + """ + stdout = get_output(command) + return [line.strip().decode('utf-8') for line in stdout.splitlines()] + + +def git_hook(strict=False, modify=False): + """ + Git pre-commit hook to check staged files for isort errors + + :param bool strict - if True, return number of errors on exit, + causing the hook to fail. If False, return zero so it will + just act as a warning. + :param bool modify - if True, fix the sources if they are not + sorted properly. If False, only report result without + modifying anything. + + :return number of errors if in strict mode, 0 otherwise. + """ + + # Get list of files modified and staged + diff_cmd = "git diff-index --cached --name-only --diff-filter=ACMRTUXB HEAD" + files_modified = get_lines(diff_cmd) + + errors = 0 + for filename in files_modified: + if filename.endswith('.py'): + # Get the staged contents of the file + staged_cmd = "git show :%s" % filename + staged_contents = get_output(staged_cmd) + + sort = SortImports( + file_path=filename, + file_contents=staged_contents.decode(), + check=True + ) + + if sort.incorrectly_sorted: + errors += 1 + if modify: + SortImports( + file_path=filename, + file_contents=staged_contents.decode(), + check=False, + ) + + return errors if strict else 0 diff --git a/.venv/lib/python3.8/site-packages/isort/isort.py b/.venv/lib/python3.8/site-packages/isort/isort.py new file mode 100644 index 00000000..245e53f1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/isort/isort.py @@ -0,0 +1,1060 @@ +"""isort.py. + +Exposes a simple library to sort through imports within Python code + +usage: + SortImports(file_name) +or: + sorted = SortImports(file_contents=file_contents).output + +Copyright (C) 2013 Timothy Edmund Crosley + +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: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +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. + +""" +from __future__ import absolute_import, division, print_function, unicode_literals + +import codecs +import copy +import io +import itertools +import os +import re +import sys +from collections import OrderedDict, namedtuple +from datetime import datetime +from difflib import unified_diff + +from . import settings +from .finders import FindersManager +from .natural import nsorted +from .pie_slice import input + + +class SortImports(object): + incorrectly_sorted = False + skipped = False + + def __init__(self, file_path=None, file_contents=None, file_=None, write_to_stdout=False, check=False, + show_diff=False, settings_path=None, ask_to_apply=False, run_path='', check_skip=True, + extension=None, **setting_overrides): + if not settings_path and file_path: + settings_path = os.path.dirname(os.path.abspath(file_path)) + settings_path = settings_path or os.getcwd() + + self.config = settings.from_path(settings_path).copy() + for key, value in setting_overrides.items(): + access_key = key.replace('not_', '').lower() + # The sections config needs to retain order and can't be converted to a set. + if access_key != 'sections' and type(self.config.get(access_key)) in (list, tuple): + if key.startswith('not_'): + self.config[access_key] = list(set(self.config[access_key]).difference(value)) + else: + self.config[access_key] = list(set(self.config[access_key]).union(value)) + else: + self.config[key] = value + + if self.config['force_alphabetical_sort']: + self.config.update({'force_alphabetical_sort_within_sections': True, + 'no_sections': True, + 'lines_between_types': 1, + 'from_first': True}) + + indent = str(self.config['indent']) + if indent.isdigit(): + indent = " " * int(indent) + else: + indent = indent.strip("'").strip('"') + if indent.lower() == "tab": + indent = "\t" + self.config['indent'] = indent + + self.config['comment_prefix'] = self.config['comment_prefix'].strip("'").strip('"') + + self.place_imports = {} + self.import_placements = {} + self.remove_imports = [self._format_simplified(removal) for removal in self.config['remove_imports']] + self.add_imports = [self._format_natural(addition) for addition in self.config['add_imports']] + self._section_comments = ["# " + value for key, value in self.config.items() if + key.startswith('import_heading') and value] + + self.file_encoding = 'utf-8' + file_name = file_path + self.file_path = file_path or "" + if file_path: + file_path = os.path.abspath(file_path) + if check_skip: + if run_path and file_path.startswith(run_path): + file_name = file_path.replace(run_path, '', 1) + else: + file_name = file_path + run_path = '' + + if settings.should_skip(file_name, self.config, run_path): + self.skipped = True + if self.config['verbose']: + print("WARNING: {0} was skipped as it's listed in 'skip' setting" + " or matches a glob in 'skip_glob' setting".format(file_path)) + file_contents = None + if not self.skipped and not file_contents: + with io.open(file_path, 'rb') as f: + file_encoding = coding_check(f) + with io.open(file_path, encoding=file_encoding, newline='') as file_to_import_sort: + try: + file_contents = file_to_import_sort.read() + self.file_path = file_path + self.file_encoding = file_encoding + encoding_success = True + except UnicodeDecodeError: + encoding_success = False + + if not encoding_success: + with io.open(file_path, newline='') as file_to_import_sort: + try: + file_contents = file_to_import_sort.read() + self.file_path = file_path + self.file_encoding = file_to_import_sort.encoding + except UnicodeDecodeError: + encoding_success = False + file_contents = None + self.skipped = True + if self.config['verbose']: + print("WARNING: {} was skipped as it couldn't be opened with the given " + "{} encoding or {} fallback encoding".format(file_path, + self.file_encoding, + file_to_import_sort.encoding)) + elif file_: + try: + file_.seek(0) + self.file_encoding = coding_check(file_) + file_.seek(0) + except (io.UnsupportedOperation, IOError): + pass + reader = codecs.getreader(self.file_encoding) + file_contents = reader(file_).read() + + # try to decode file_contents + if file_contents: + try: + basestring + # python 2 + need_decode = (str, bytes) + except NameError: + # python 3 + need_decode = bytes + + if isinstance(file_contents, need_decode): + file_contents = file_contents.decode(coding_check(file_contents.splitlines())) + + if file_contents is None or ("isort:" + "skip_file") in file_contents: + self.skipped = True + self.output = None + if write_to_stdout and file_contents: + sys.stdout.write(file_contents) + return + + if self.config['line_ending']: + self.line_separator = self.config['line_ending'] + else: + if '\r\n' in file_contents: + self.line_separator = '\r\n' + elif '\r' in file_contents: + self.line_separator = '\r' + else: + self.line_separator = '\n' + self.in_lines = file_contents.split(self.line_separator) + self.original_length = len(self.in_lines) + if (self.original_length > 1 or self.in_lines[:1] not in ([], [""])) or self.config['force_adds']: + for add_import in self.add_imports: + self.in_lines.append(add_import) + self.number_of_lines = len(self.in_lines) + + if not extension: + self.extension = file_name.split('.')[-1] if file_name else "py" + else: + self.extension = extension + + self.out_lines = [] + self.comments = {'from': {}, 'straight': {}, 'nested': {}, 'above': {'straight': {}, 'from': {}}} + self.imports = OrderedDict() + self.as_map = {} + + section_names = self.config['sections'] + self.sections = namedtuple('Sections', section_names)(*[name for name in section_names]) + for section in itertools.chain(self.sections, self.config['forced_separate']): + self.imports[section] = {'straight': OrderedDict(), 'from': OrderedDict()} + + self.finder = FindersManager(config=self.config, sections=self.sections) + + self.index = 0 + self.import_index = -1 + self._first_comment_index_start = -1 + self._first_comment_index_end = -1 + self._parse() + if self.import_index != -1: + self._add_formatted_imports() + self.length_change = len(self.out_lines) - self.original_length + while self.out_lines and self.out_lines[-1].strip() == "": + self.out_lines.pop(-1) + self.out_lines.append("") + self.output = self.line_separator.join(self.out_lines) + if self.config['atomic']: + try: + compile(self._strip_top_comments(self.out_lines, self.line_separator), self.file_path, 'exec', 0, 1) + except SyntaxError: + self.output = file_contents + self.incorrectly_sorted = True + try: + compile(self._strip_top_comments(self.in_lines, self.line_separator), self.file_path, 'exec', 0, 1) + print("ERROR: {0} isort would have introduced syntax errors, please report to the project!". + format(self.file_path)) + except SyntaxError: + print("ERROR: {0} File contains syntax errors.".format(self.file_path)) + + return + if check: + check_output = self.output + check_against = file_contents + if self.config['ignore_whitespace']: + check_output = check_output.replace(self.line_separator, "").replace(" ", "").replace("\x0c", "") + check_against = check_against.replace(self.line_separator, "").replace(" ", "").replace("\x0c", "") + + if check_output.strip() == check_against.strip(): + if self.config['verbose']: + print("SUCCESS: {0} Everything Looks Good!".format(self.file_path)) + return + + print("ERROR: {0} Imports are incorrectly sorted.".format(self.file_path)) + self.incorrectly_sorted = True + if show_diff or self.config['show_diff']: + self._show_diff(file_contents) + elif write_to_stdout: + if sys.version_info[0] < 3: + self.output = self.output.encode(self.file_encoding) + sys.stdout.write(self.output) + elif file_name and not check: + if self.output == file_contents: + return + + if ask_to_apply: + self._show_diff(file_contents) + answer = None + while answer not in ('yes', 'y', 'no', 'n', 'quit', 'q'): + answer = input("Apply suggested changes to '{0}' [y/n/q]? ".format(self.file_path)).lower() + if answer in ('no', 'n'): + return + if answer in ('quit', 'q'): + sys.exit(1) + with io.open(self.file_path, encoding=self.file_encoding, mode='w', newline='') as output_file: + if not self.config['quiet']: + print("Fixing {0}".format(self.file_path)) + output_file.write(self.output) + + @property + def correctly_sorted(self): + return not self.incorrectly_sorted + + def _show_diff(self, file_contents): + for line in unified_diff( + file_contents.splitlines(1), + self.output.splitlines(1), + fromfile=self.file_path + ':before', + tofile=self.file_path + ':after', + fromfiledate=str(datetime.fromtimestamp(os.path.getmtime(self.file_path)) + if self.file_path else datetime.now()), + tofiledate=str(datetime.now()) + ): + sys.stdout.write(line) + + @staticmethod + def _strip_top_comments(lines, line_separator): + """Strips # comments that exist at the top of the given lines""" + lines = copy.copy(lines) + while lines and lines[0].startswith("#"): + lines = lines[1:] + return line_separator.join(lines) + + def place_module(self, module_name): + """Tries to determine if a module is a python std import, third party import, or project code: + + if it can't determine - it assumes it is project code + + """ + return self.finder.find(module_name) + + def _get_line(self): + """Returns the current line from the file while incrementing the index.""" + line = self.in_lines[self.index] + self.index += 1 + return line + + @staticmethod + def _import_type(line): + """If the current line is an import line it will return its type (from or straight)""" + if "isort:skip" in line: + return + elif line.startswith('import '): + return "straight" + elif line.startswith('from '): + return "from" + + def _at_end(self): + """returns True if we are at the end of the file.""" + return self.index == self.number_of_lines + + @staticmethod + def _module_key(module_name, config, sub_imports=False, ignore_case=False, section_name=None): + match = re.match(r'^(\.+)\s*(.*)', module_name) + if match: + sep = ' ' if config['reverse_relative'] else '_' + module_name = sep.join(match.groups()) + + prefix = "" + if ignore_case: + module_name = str(module_name).lower() + else: + module_name = str(module_name) + + if sub_imports and config['order_by_type']: + if module_name.isupper() and len(module_name) > 1: + prefix = "A" + elif module_name[0:1].isupper(): + prefix = "B" + else: + prefix = "C" + if not config['case_sensitive']: + module_name = module_name.lower() + if section_name is None or 'length_sort_' + str(section_name).lower() not in config: + length_sort = config['length_sort'] + else: + length_sort = config['length_sort_' + str(section_name).lower()] + return "{0}{1}{2}".format(module_name in config['force_to_top'] and "A" or "B", prefix, + length_sort and (str(len(module_name)) + ":" + module_name) or module_name) + + def _add_comments(self, comments, original_string=""): + """ + Returns a string with comments added if ignore_comments is not set. + """ + + if not self.config['ignore_comments']: + return comments and "{0}{1} {2}".format(self._strip_comments(original_string)[0], + self.config['comment_prefix'], + "; ".join(comments)) or original_string + + return comments and self._strip_comments(original_string)[0] + + def _wrap(self, line): + """ + Returns an import wrapped to the specified line-length, if possible. + """ + wrap_mode = self.config['multi_line_output'] + if len(line) > self.config['line_length'] and wrap_mode != settings.WrapModes.NOQA: + line_without_comment = line + comment = None + if '#' in line: + line_without_comment, comment = line.split('#', 1) + for splitter in ("import ", ".", "as "): + exp = r"\b" + re.escape(splitter) + r"\b" + if re.search(exp, line_without_comment) and not line_without_comment.strip().startswith(splitter): + line_parts = re.split(exp, line_without_comment) + if comment: + line_parts[-1] = '{0}#{1}'.format(line_parts[-1], comment) + next_line = [] + while (len(line) + 2) > (self.config['wrap_length'] or self.config['line_length']) and line_parts: + next_line.append(line_parts.pop()) + line = splitter.join(line_parts) + if not line: + line = next_line.pop() + + cont_line = self._wrap(self.config['indent'] + splitter.join(next_line).lstrip()) + if self.config['use_parentheses']: + if splitter == "as ": + output = "{0}{1}{2}".format(line, splitter, cont_line.lstrip()) + else: + output = "{0}{1}({2}{3}{4}{5})".format( + line, splitter, self.line_separator, cont_line, + "," if self.config['include_trailing_comma'] else "", + self.line_separator if wrap_mode in (settings.WrapModes.VERTICAL_HANGING_INDENT, + settings.WrapModes.VERTICAL_GRID_GROUPED) + else "") + lines = output.split(self.line_separator) + if self.config['comment_prefix'] in lines[-1] and lines[-1].endswith(')'): + line, comment = lines[-1].split(self.config['comment_prefix'], 1) + lines[-1] = line + ')' + self.config['comment_prefix'] + comment[:-1] + return self.line_separator.join(lines) + return "{0}{1}\\{2}{3}".format(line, splitter, self.line_separator, cont_line) + elif len(line) > self.config['line_length'] and wrap_mode == settings.WrapModes.NOQA: + if "# NOQA" not in line: + return "{0}{1} NOQA".format(line, self.config['comment_prefix']) + + return line + + def _add_straight_imports(self, straight_modules, section, section_output): + for module in straight_modules: + if module in self.remove_imports: + continue + + if module in self.as_map: + import_definition = '' + if self.config['keep_direct_and_as_imports']: + import_definition = "import {0}\n".format(module) + import_definition += "import {0} as {1}".format(module, self.as_map[module]) + else: + import_definition = "import {0}".format(module) + + comments_above = self.comments['above']['straight'].pop(module, None) + if comments_above: + section_output.extend(comments_above) + section_output.append(self._add_comments(self.comments['straight'].get(module), import_definition)) + + def _add_from_imports(self, from_modules, section, section_output, ignore_case): + for module in from_modules: + if module in self.remove_imports: + continue + + import_start = "from {0} import ".format(module) + from_imports = list(self.imports[section]['from'][module]) + if not self.config['no_inline_sort'] or self.config['force_single_line']: + from_imports = nsorted(from_imports, key=lambda key: self._module_key(key, self.config, True, ignore_case, section_name=section)) + if self.remove_imports: + from_imports = [line for line in from_imports if not "{0}.{1}".format(module, line) in + self.remove_imports] + + sub_modules = ['{0}.{1}'.format(module, from_import) for from_import in from_imports] + as_imports = { + from_import: "{0} as {1}".format(from_import, self.as_map[sub_module]) + for from_import, sub_module in zip(from_imports, sub_modules) + if sub_module in self.as_map + } + if self.config['combine_as_imports'] and not ("*" in from_imports and self.config['combine_star']): + for from_import in copy.copy(from_imports): + if from_import in as_imports: + from_imports[from_imports.index(from_import)] = as_imports.pop(from_import) + + while from_imports: + comments = self.comments['from'].pop(module, ()) + if "*" in from_imports and self.config['combine_star']: + import_statement = self._wrap(self._add_comments(comments, "{0}*".format(import_start))) + from_imports = None + elif self.config['force_single_line']: + import_statements = [] + while from_imports: + from_import = from_imports.pop(0) + if from_import in as_imports: + from_comments = self.comments['straight'].get('{}.{}'.format(module, from_import)) + import_statements.append(self._add_comments(from_comments, + self._wrap(import_start + as_imports[from_import]))) + continue + single_import_line = self._add_comments(comments, import_start + from_import) + comment = self.comments['nested'].get(module, {}).pop(from_import, None) + if comment: + single_import_line += "{0} {1}".format(comments and ";" or self.config['comment_prefix'], + comment) + import_statements.append(self._wrap(single_import_line)) + comments = None + import_statement = self.line_separator.join(import_statements) + else: + while from_imports and from_imports[0] in as_imports: + from_import = from_imports.pop(0) + from_comments = self.comments['straight'].get('{}.{}'.format(module, from_import)) + above_comments = self.comments['above']['from'].pop(module, None) + if above_comments: + section_output.extend(above_comments) + + section_output.append(self._add_comments(from_comments, + self._wrap(import_start + as_imports[from_import]))) + + star_import = False + if "*" in from_imports: + section_output.append(self._add_comments(comments, "{0}*".format(import_start))) + from_imports.remove('*') + star_import = True + comments = None + + for from_import in copy.copy(from_imports): + if from_import in as_imports: + continue + comment = self.comments['nested'].get(module, {}).pop(from_import, None) + if comment: + single_import_line = self._add_comments(comments, import_start + from_import) + single_import_line += "{0} {1}".format(comments and ";" or self.config['comment_prefix'], + comment) + above_comments = self.comments['above']['from'].pop(module, None) + if above_comments: + section_output.extend(above_comments) + section_output.append(self._wrap(single_import_line)) + from_imports.remove(from_import) + comments = None + + from_import_section = [] + while from_imports and from_imports[0] not in as_imports: + from_import_section.append(from_imports.pop(0)) + if star_import: + import_statement = import_start + (", ").join(from_import_section) + else: + import_statement = self._add_comments(comments, import_start + (", ").join(from_import_section)) + if not from_import_section: + import_statement = "" + + do_multiline_reformat = False + + force_grid_wrap = self.config['force_grid_wrap'] + if force_grid_wrap and len(from_import_section) >= force_grid_wrap: + do_multiline_reformat = True + + if len(import_statement) > self.config['line_length'] and len(from_import_section) > 1: + do_multiline_reformat = True + + # If line too long AND have imports AND we are NOT using GRID or VERTICAL wrap modes + if (len(import_statement) > self.config['line_length'] and len(from_import_section) > 0 and + self.config['multi_line_output'] not in (1, 0)): + do_multiline_reformat = True + + if do_multiline_reformat: + import_statement = self._multi_line_reformat(import_start, from_import_section, comments) + if self.config['multi_line_output'] == 0: + self.config['multi_line_output'] = 4 + try: + other_import_statement = self._multi_line_reformat(import_start, from_import_section, comments) + if (max(len(x) + for x in import_statement.split('\n')) > self.config['line_length']): + import_statement = other_import_statement + finally: + self.config['multi_line_output'] = 0 + if not do_multiline_reformat and len(import_statement) > self.config['line_length']: + import_statement = self._wrap(import_statement) + + if import_statement: + above_comments = self.comments['above']['from'].pop(module, None) + if above_comments: + section_output.extend(above_comments) + section_output.append(import_statement) + + def _multi_line_reformat(self, import_start, from_imports, comments): + output_mode = settings.WrapModes._fields[self.config['multi_line_output']].lower() + formatter = getattr(self, "_output_" + output_mode, self._output_grid) + dynamic_indent = " " * (len(import_start) + 1) + indent = self.config['indent'] + line_length = self.config['wrap_length'] or self.config['line_length'] + import_statement = formatter(import_start, copy.copy(from_imports), + dynamic_indent, indent, line_length, comments) + if self.config['balanced_wrapping']: + lines = import_statement.split(self.line_separator) + line_count = len(lines) + if len(lines) > 1: + minimum_length = min(len(line) for line in lines[:-1]) + else: + minimum_length = 0 + new_import_statement = import_statement + while (len(lines[-1]) < minimum_length and + len(lines) == line_count and line_length > 10): + import_statement = new_import_statement + line_length -= 1 + new_import_statement = formatter(import_start, copy.copy(from_imports), + dynamic_indent, indent, line_length, comments) + lines = new_import_statement.split(self.line_separator) + if import_statement.count(self.line_separator) == 0: + return self._wrap(import_statement) + return import_statement + + def _add_formatted_imports(self): + """Adds the imports back to the file. + + (at the index of the first import) sorted alphabetically and split between groups + + """ + sort_ignore_case = self.config['force_alphabetical_sort_within_sections'] + sections = itertools.chain(self.sections, self.config['forced_separate']) + + if self.config['no_sections']: + self.imports['no_sections'] = {'straight': [], 'from': {}} + for section in sections: + self.imports['no_sections']['straight'].extend(self.imports[section].get('straight', [])) + self.imports['no_sections']['from'].update(self.imports[section].get('from', {})) + sections = ('no_sections', ) + + output = [] + pending_lines_before = False + for section in sections: + straight_modules = self.imports[section]['straight'] + straight_modules = nsorted(straight_modules, key=lambda key: self._module_key(key, self.config, section_name=section)) + from_modules = self.imports[section]['from'] + from_modules = nsorted(from_modules, key=lambda key: self._module_key(key, self.config, section_name=section)) + + section_output = [] + if self.config['from_first']: + self._add_from_imports(from_modules, section, section_output, sort_ignore_case) + if self.config['lines_between_types'] and from_modules and straight_modules: + section_output.extend([''] * self.config['lines_between_types']) + self._add_straight_imports(straight_modules, section, section_output) + else: + self._add_straight_imports(straight_modules, section, section_output) + if self.config['lines_between_types'] and from_modules and straight_modules: + section_output.extend([''] * self.config['lines_between_types']) + self._add_from_imports(from_modules, section, section_output, sort_ignore_case) + + if self.config['force_sort_within_sections']: + def by_module(line): + section = 'B' + if line.startswith('#'): + return 'AA' + + line = re.sub('^from ', '', line) + line = re.sub('^import ', '', line) + if line.split(' ')[0] in self.config['force_to_top']: + section = 'A' + if not self.config['order_by_type']: + line = line.lower() + return '{0}{1}'.format(section, line) + section_output = nsorted(section_output, key=by_module) + + section_name = section + no_lines_before = section_name in self.config['no_lines_before'] + + if section_output: + if section_name in self.place_imports: + self.place_imports[section_name] = section_output + continue + + section_title = self.config.get('import_heading_' + str(section_name).lower(), '') + if section_title: + section_comment = "# {0}".format(section_title) + if section_comment not in self.out_lines[0:1] and section_comment not in self.in_lines[0:1]: + section_output.insert(0, section_comment) + + if pending_lines_before or not no_lines_before: + output += ([''] * self.config['lines_between_sections']) + + output += section_output + + pending_lines_before = False + else: + pending_lines_before = pending_lines_before or not no_lines_before + + while output and output[-1].strip() == '': + output.pop() + while output and output[0].strip() == '': + output.pop(0) + + output_at = 0 + if self.import_index < self.original_length: + output_at = self.import_index + elif self._first_comment_index_end != -1 and self._first_comment_index_start <= 2: + output_at = self._first_comment_index_end + self.out_lines[output_at:0] = output + + imports_tail = output_at + len(output) + while [character.strip() for character in self.out_lines[imports_tail: imports_tail + 1]] == [""]: + self.out_lines.pop(imports_tail) + + if len(self.out_lines) > imports_tail: + next_construct = "" + self._in_quote = False + tail = self.out_lines[imports_tail:] + + for index, line in enumerate(tail): + in_quote = self._in_quote + if not self._skip_line(line) and line.strip(): + if line.strip().startswith("#") and len(tail) > (index + 1) and tail[index + 1].strip(): + continue + next_construct = line + break + elif not in_quote: + parts = line.split() + if len(parts) >= 3 and parts[1] == '=' and "'" not in parts[0] and '"' not in parts[0]: + next_construct = line + break + + if self.config['lines_after_imports'] != -1: + self.out_lines[imports_tail:0] = ["" for line in range(self.config['lines_after_imports'])] + elif self.extension != "pyi" and (next_construct.startswith("def ") or + next_construct.startswith("class ") or + next_construct.startswith("@") or + next_construct.startswith("async def")): + self.out_lines[imports_tail:0] = ["", ""] + else: + self.out_lines[imports_tail:0] = [""] + + if self.place_imports: + new_out_lines = [] + for index, line in enumerate(self.out_lines): + new_out_lines.append(line) + if line in self.import_placements: + new_out_lines.extend(self.place_imports[self.import_placements[line]]) + if len(self.out_lines) <= index or self.out_lines[index + 1].strip() != "": + new_out_lines.append("") + self.out_lines = new_out_lines + + def _output_grid(self, statement, imports, white_space, indent, line_length, comments): + statement += "(" + imports.pop(0) + while imports: + next_import = imports.pop(0) + next_statement = self._add_comments(comments, statement + ", " + next_import) + if len(next_statement.split(self.line_separator)[-1]) + 1 > line_length: + lines = ['{0}{1}'.format(white_space, next_import.split(" ")[0])] + for part in next_import.split(" ")[1:]: + new_line = '{0} {1}'.format(lines[-1], part) + if len(new_line) + 1 > line_length: + lines.append('{0}{1}'.format(white_space, part)) + else: + lines[-1] = new_line + next_import = self.line_separator.join(lines) + statement = (self._add_comments(comments, "{0},".format(statement)) + + "{0}{1}".format(self.line_separator, next_import)) + comments = None + else: + statement += ", " + next_import + return statement + ("," if self.config['include_trailing_comma'] else "") + ")" + + def _output_vertical(self, statement, imports, white_space, indent, line_length, comments): + first_import = self._add_comments(comments, imports.pop(0) + ",") + self.line_separator + white_space + return "{0}({1}{2}{3})".format( + statement, + first_import, + ("," + self.line_separator + white_space).join(imports), + "," if self.config['include_trailing_comma'] else "", + ) + + def _output_hanging_indent(self, statement, imports, white_space, indent, line_length, comments): + statement += imports.pop(0) + while imports: + next_import = imports.pop(0) + next_statement = self._add_comments(comments, statement + ", " + next_import) + if len(next_statement.split(self.line_separator)[-1]) + 3 > line_length: + next_statement = (self._add_comments(comments, "{0}, \\".format(statement)) + + "{0}{1}{2}".format(self.line_separator, indent, next_import)) + comments = None + statement = next_statement + return statement + + def _output_vertical_hanging_indent(self, statement, imports, white_space, indent, line_length, comments): + return "{0}({1}{2}{3}{4}{5}{2})".format( + statement, + self._add_comments(comments), + self.line_separator, + indent, + ("," + self.line_separator + indent).join(imports), + "," if self.config['include_trailing_comma'] else "", + ) + + def _output_vertical_grid_common(self, statement, imports, white_space, indent, line_length, comments, + need_trailing_char): + statement += self._add_comments(comments, "(") + self.line_separator + indent + imports.pop(0) + while imports: + next_import = imports.pop(0) + next_statement = "{0}, {1}".format(statement, next_import) + current_line_length = len(next_statement.split(self.line_separator)[-1]) + if imports or need_trailing_char: + # If we have more imports we need to account for a comma after this import + # We might also need to account for a closing ) we're going to add. + current_line_length += 1 + if current_line_length > line_length: + next_statement = "{0},{1}{2}{3}".format(statement, self.line_separator, indent, next_import) + statement = next_statement + if self.config['include_trailing_comma']: + statement += ',' + return statement + + def _output_vertical_grid(self, statement, imports, white_space, indent, line_length, comments): + return self._output_vertical_grid_common(statement, imports, white_space, indent, line_length, comments, + True) + ")" + + def _output_vertical_grid_grouped(self, statement, imports, white_space, indent, line_length, comments): + return self._output_vertical_grid_common(statement, imports, white_space, indent, line_length, comments, + True) + self.line_separator + ")" + + def _output_vertical_grid_grouped_no_comma(self, statement, imports, white_space, indent, line_length, comments): + return self._output_vertical_grid_common(statement, imports, white_space, indent, line_length, comments, + False) + self.line_separator + ")" + + def _output_noqa(self, statement, imports, white_space, indent, line_length, comments): + retval = '{0}{1}'.format(statement, ', '.join(imports)) + comment_str = ' '.join(comments) + if comments: + if len(retval) + len(self.config['comment_prefix']) + 1 + len(comment_str) <= line_length: + return '{0}{1} {2}'.format(retval, self.config['comment_prefix'], comment_str) + else: + if len(retval) <= line_length: + return retval + if comments: + if "NOQA" in comments: + return '{0}{1} {2}'.format(retval, self.config['comment_prefix'], comment_str) + else: + return '{0}{1} NOQA {2}'.format(retval, self.config['comment_prefix'], comment_str) + else: + return '{0}{1} NOQA'.format(retval, self.config['comment_prefix']) + + @staticmethod + def _strip_comments(line, comments=None): + """Removes comments from import line.""" + if comments is None: + comments = [] + + new_comments = False + comment_start = line.find("#") + if comment_start != -1: + comments.append(line[comment_start + 1:].strip()) + new_comments = True + line = line[:comment_start] + + return line, comments, new_comments + + @staticmethod + def _format_simplified(import_line): + import_line = import_line.strip() + if import_line.startswith("from "): + import_line = import_line.replace("from ", "") + import_line = import_line.replace(" import ", ".") + elif import_line.startswith("import "): + import_line = import_line.replace("import ", "") + + return import_line + + @staticmethod + def _format_natural(import_line): + import_line = import_line.strip() + if not import_line.startswith("from ") and not import_line.startswith("import "): + if "." not in import_line: + return "import {0}".format(import_line) + parts = import_line.split(".") + end = parts.pop(-1) + return "from {0} import {1}".format(".".join(parts), end) + + return import_line + + def _skip_line(self, line): + skip_line = self._in_quote + if self.index == 1 and line.startswith("#"): + self._in_top_comment = True + return True + elif self._in_top_comment: + if not line.startswith("#") or line in self._section_comments: + self._in_top_comment = False + self._first_comment_index_end = self.index - 1 + + if '"' in line or "'" in line: + index = 0 + if self._first_comment_index_start == -1 and (line.startswith('"') or line.startswith("'")): + self._first_comment_index_start = self.index + while index < len(line): + if line[index] == "\\": + index += 1 + elif self._in_quote: + if line[index:index + len(self._in_quote)] == self._in_quote: + self._in_quote = False + if self._first_comment_index_end < self._first_comment_index_start: + self._first_comment_index_end = self.index + elif line[index] in ("'", '"'): + long_quote = line[index:index + 3] + if long_quote in ('"""', "'''"): + self._in_quote = long_quote + index += 2 + else: + self._in_quote = line[index] + elif line[index] == "#": + break + index += 1 + + return skip_line or self._in_quote or self._in_top_comment + + def _strip_syntax(self, import_string): + import_string = import_string.replace("_import", "[[i]]") + for remove_syntax in ['\\', '(', ')', ',']: + import_string = import_string.replace(remove_syntax, " ") + import_list = import_string.split() + for key in ('from', 'import'): + if key in import_list: + import_list.remove(key) + import_string = ' '.join(import_list) + import_string = import_string.replace("[[i]]", "_import") + return import_string.replace("{ ", "{|").replace(" }", "|}") + + def _parse(self): + """Parses a python file taking out and categorizing imports.""" + self._in_quote = False + self._in_top_comment = False + while not self._at_end(): + raw_line = line = self._get_line() + line = line.replace("from.import ", "from . import ") + line = line.replace("\t", " ").replace('import*', 'import *') + line = line.replace(" .import ", " . import ") + statement_index = self.index + skip_line = self._skip_line(line) + + if line in self._section_comments and not skip_line: + if self.import_index == -1: + self.import_index = self.index - 1 + continue + + if "isort:imports-" in line and line.startswith("#"): + section = line.split("isort:imports-")[-1].split()[0].upper() + self.place_imports[section] = [] + self.import_placements[line] = section + + if ";" in line: + for part in (part.strip() for part in line.split(";")): + if part and not part.startswith("from ") and not part.startswith("import "): + skip_line = True + + import_type = self._import_type(line) + if not import_type or skip_line: + self.out_lines.append(raw_line) + continue + + for line in (line.strip() for line in line.split(";")): + import_type = self._import_type(line) + if not import_type: + self.out_lines.append(line) + continue + + if self.import_index == -1: + self.import_index = self.index - 1 + nested_comments = {} + import_string, comments, new_comments = self._strip_comments(line) + stripped_line = [part for part in self._strip_syntax(import_string).strip().split(" ") if part] + if import_type == "from" and len(stripped_line) == 2 and stripped_line[1] != "*" and new_comments: + nested_comments[stripped_line[-1]] = comments[0] + + if "(" in line.split("#")[0] and not self._at_end(): + while not line.strip().endswith(")") and not self._at_end(): + line, comments, new_comments = self._strip_comments(self._get_line(), comments) + stripped_line = self._strip_syntax(line).strip() + if import_type == "from" and stripped_line and " " not in stripped_line and new_comments: + nested_comments[stripped_line] = comments[-1] + import_string += self.line_separator + line + else: + while line.strip().endswith("\\"): + line, comments, new_comments = self._strip_comments(self._get_line(), comments) + + # Still need to check for parentheses after an escaped line + if "(" in line.split("#")[0] and ")" not in line.split("#")[0] and not self._at_end(): + stripped_line = self._strip_syntax(line).strip() + if import_type == "from" and stripped_line and " " not in stripped_line and new_comments: + nested_comments[stripped_line] = comments[-1] + import_string += self.line_separator + line + + while not line.strip().endswith(")") and not self._at_end(): + line, comments, new_comments = self._strip_comments(self._get_line(), comments) + stripped_line = self._strip_syntax(line).strip() + if import_type == "from" and stripped_line and " " not in stripped_line and new_comments: + nested_comments[stripped_line] = comments[-1] + import_string += self.line_separator + line + + stripped_line = self._strip_syntax(line).strip() + if import_type == "from" and stripped_line and " " not in stripped_line and new_comments: + nested_comments[stripped_line] = comments[-1] + if import_string.strip().endswith(" import") or line.strip().startswith("import "): + import_string += self.line_separator + line + else: + import_string = import_string.rstrip().rstrip("\\") + " " + line.lstrip() + + if import_type == "from": + import_string = import_string.replace("import(", "import (") + parts = import_string.split(" import ") + from_import = parts[0].split(" ") + import_string = " import ".join([from_import[0] + " " + "".join(from_import[1:])] + parts[1:]) + + imports = [item.replace("{|", "{ ").replace("|}", " }") for item in + self._strip_syntax(import_string).split()] + if "as" in imports and (imports.index('as') + 1) < len(imports): + while "as" in imports: + index = imports.index('as') + if import_type == "from": + module = imports[0] + "." + imports[index - 1] + self.as_map[module] = imports[index + 1] + else: + module = imports[index - 1] + self.as_map[module] = imports[index + 1] + if not self.config['combine_as_imports']: + self.comments['straight'][module] = comments + comments = [] + del imports[index:index + 2] + if import_type == "from": + import_from = imports.pop(0) + placed_module = self.place_module(import_from) + if self.config['verbose']: + print("from-type place_module for %s returned %s" % (import_from, placed_module)) + if placed_module == '': + print( + "WARNING: could not place module {0} of line {1} --" + " Do you need to define a default section?".format(import_from, line) + ) + root = self.imports[placed_module][import_type] + for import_name in imports: + associated_comment = nested_comments.get(import_name) + if associated_comment: + self.comments['nested'].setdefault(import_from, {})[import_name] = associated_comment + comments.pop(comments.index(associated_comment)) + if comments: + self.comments['from'].setdefault(import_from, []).extend(comments) + + if len(self.out_lines) > max(self.import_index, self._first_comment_index_end + 1, 1) - 1: + last = self.out_lines and self.out_lines[-1].rstrip() or "" + while (last.startswith("#") and not last.endswith('"""') and not last.endswith("'''") and + 'isort:imports-' not in last): + self.comments['above']['from'].setdefault(import_from, []).insert(0, self.out_lines.pop(-1)) + if len(self.out_lines) > max(self.import_index - 1, self._first_comment_index_end + 1, 1) - 1: + last = self.out_lines[-1].rstrip() + else: + last = "" + if statement_index - 1 == self.import_index: + self.import_index -= len(self.comments['above']['from'].get(import_from, [])) + + if import_from not in root: + root[import_from] = OrderedDict() + root[import_from].update((module, None) for module in imports) + else: + for module in imports: + if comments: + self.comments['straight'][module] = comments + comments = None + + if len(self.out_lines) > max(self.import_index, self._first_comment_index_end + 1, 1) - 1: + + last = self.out_lines and self.out_lines[-1].rstrip() or "" + while (last.startswith("#") and not last.endswith('"""') and not last.endswith("'''") and + 'isort:imports-' not in last): + self.comments['above']['straight'].setdefault(module, []).insert(0, + self.out_lines.pop(-1)) + if len(self.out_lines) > 0 and len(self.out_lines) != self._first_comment_index_end: + last = self.out_lines[-1].rstrip() + else: + last = "" + if self.index - 1 == self.import_index: + self.import_index -= len(self.comments['above']['straight'].get(module, [])) + placed_module = self.place_module(module) + if self.config['verbose']: + print("else-type place_module for %s returned %s" % (module, placed_module)) + if placed_module == '': + print( + "WARNING: could not place module {0} of line {1} --" + " Do you need to define a default section?".format(import_from, line) + ) + self.imports[placed_module][import_type][module] = None + + +def coding_check(lines, default='utf-8'): + + # see https://www.python.org/dev/peps/pep-0263/ + pattern = re.compile(br'coding[:=]\s*([-\w.]+)') + + for line_number, line in enumerate(lines, 1): + groups = re.findall(pattern, line) + if groups: + return groups[0].decode('ascii') + if line_number > 2: + break + + return default diff --git a/.venv/lib/python3.8/site-packages/isort/main.py b/.venv/lib/python3.8/site-packages/isort/main.py new file mode 100644 index 00000000..fe36d112 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/isort/main.py @@ -0,0 +1,401 @@ +''' Tool for sorting imports alphabetically, and automatically separated into sections. + +Copyright (C) 2013 Timothy Edmund Crosley + +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: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +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. + +''' +from __future__ import absolute_import, division, print_function, unicode_literals + +import argparse +import functools +import glob +import os +import re +import sys + +import setuptools + +from isort import SortImports, __version__ +from isort.settings import DEFAULT_SECTIONS, WrapModes, default, from_path, should_skip + +INTRO = r""" +/#######################################################################\ + + `sMMy` + .yyyy- ` + ##soos## ./o. + ` ``..-..` ``...`.`` ` ```` ``-ssso``` + .s:-y- .+osssssso/. ./ossss+:so+:` :+o-`/osso:+sssssssso/ + .s::y- osss+.``.`` -ssss+-.`-ossso` ssssso/::..::+ssss:::. + .s::y- /ssss+//:-.` `ssss+ `ssss+ sssso` :ssss` + .s::y- `-/+oossssso/ `ssss/ sssso ssss/ :ssss` + .y-/y- ````:ssss` ossso. :ssss: ssss/ :ssss. + `/so:` `-//::/osss+ `+ssss+-/ossso: /sso- `osssso/. + \/ `-/oooo++/- .:/++:/++/-` .. `://++/. + + + isort your Python imports for you so you don't have to + + VERSION {0} + +\########################################################################/ +""".format(__version__) + +shebang_re = re.compile(br'^#!.*\bpython[23w]?\b') + + +def is_python_file(path): + _root, ext = os.path.splitext(path) + if ext in ('.py', '.pyi'): + return True + if ext in ('.pex', ): + return False + + # Skip editor backup files. + if path.endswith('~'): + return False + + try: + with open(path, 'rb') as fp: + line = fp.readline(100) + except IOError: + return False + else: + return bool(shebang_re.match(line)) + + +class SortAttempt(object): + def __init__(self, incorrectly_sorted, skipped): + self.incorrectly_sorted = incorrectly_sorted + self.skipped = skipped + + +def sort_imports(file_name, **arguments): + try: + result = SortImports(file_name, **arguments) + return SortAttempt(result.incorrectly_sorted, result.skipped) + except IOError as e: + print("WARNING: Unable to parse file {0} due to {1}".format(file_name, e)) + return None + + +def iter_source_code(paths, config, skipped): + """Iterate over all Python source files defined in paths.""" + if 'not_skip' in config: + config['skip'] = list(set(config['skip']).difference(config['not_skip'])) + + for path in paths: + if os.path.isdir(path): + for dirpath, dirnames, filenames in os.walk(path, topdown=True, followlinks=True): + for dirname in list(dirnames): + if should_skip(dirname, config, dirpath): + skipped.append(dirname) + dirnames.remove(dirname) + for filename in filenames: + filepath = os.path.join(dirpath, filename) + if is_python_file(filepath): + relative_file = os.path.relpath(filepath, path) + if should_skip(relative_file, config, path): + skipped.append(filename) + else: + yield filepath + else: + yield path + + +class ISortCommand(setuptools.Command): + """The :class:`ISortCommand` class is used by setuptools to perform + imports checks on registered modules. + """ + + description = "Run isort on modules registered in setuptools" + user_options = [] + + def initialize_options(self): + default_settings = default.copy() + for key, value in default_settings.items(): + setattr(self, key, value) + + def finalize_options(self): + "Get options from config files." + self.arguments = {} + computed_settings = from_path(os.getcwd()) + for key, value in computed_settings.items(): + self.arguments[key] = value + + def distribution_files(self): + """Find distribution packages.""" + # This is verbatim from flake8 + if self.distribution.packages: + package_dirs = self.distribution.package_dir or {} + for package in self.distribution.packages: + pkg_dir = package + if package in package_dirs: + pkg_dir = package_dirs[package] + elif '' in package_dirs: + pkg_dir = package_dirs[''] + os.path.sep + pkg_dir + yield pkg_dir.replace('.', os.path.sep) + + if self.distribution.py_modules: + for filename in self.distribution.py_modules: + yield "%s.py" % filename + # Don't miss the setup.py file itself + yield "setup.py" + + def run(self): + arguments = self.arguments + wrong_sorted_files = False + arguments['check'] = True + for path in self.distribution_files(): + for python_file in glob.iglob(os.path.join(path, '*.py')): + try: + incorrectly_sorted = SortImports(python_file, **arguments).incorrectly_sorted + if incorrectly_sorted: + wrong_sorted_files = True + except IOError as e: + print("WARNING: Unable to parse file {0} due to {1}".format(python_file, e)) + if wrong_sorted_files: + sys.exit(1) + + +def parse_args(argv=None): + parser = argparse.ArgumentParser(description='Sort Python import definitions alphabetically ' + 'within logical sections. Run with no arguments to run ' + 'interactively. Run with `-` as the first argument to read from ' + 'stdin. Otherwise provide a list of files to sort.') + inline_args_group = parser.add_mutually_exclusive_group() + parser.add_argument('-a', '--add-import', dest='add_imports', action='append', + help='Adds the specified import line to all files, ' + 'automatically determining correct placement.') + parser.add_argument('-ac', '--atomic', dest='atomic', action='store_true', + help="Ensures the output doesn't save if the resulting file contains syntax errors.") + parser.add_argument('-af', '--force-adds', dest='force_adds', action='store_true', + help='Forces import adds even if the original file is empty.') + parser.add_argument('-b', '--builtin', dest='known_standard_library', action='append', + help='Force sortImports to recognize a module as part of the python standard library.') + parser.add_argument('-c', '--check-only', action='store_true', dest="check", + help='Checks the file for unsorted / unformatted imports and prints them to the ' + 'command line without modifying the file.') + parser.add_argument('-ca', '--combine-as', dest='combine_as_imports', action='store_true', + help="Combines as imports on the same line.") + parser.add_argument('-cs', '--combine-star', dest='combine_star', action='store_true', + help="Ensures that if a star import is present, nothing else is imported from that namespace.") + parser.add_argument('-d', '--stdout', help='Force resulting output to stdout, instead of in-place.', + dest='write_to_stdout', action='store_true') + parser.add_argument('-df', '--diff', dest='show_diff', action='store_true', + help="Prints a diff of all the changes isort would make to a file, instead of " + "changing it in place") + parser.add_argument('-ds', '--no-sections', help='Put all imports into the same section bucket', dest='no_sections', + action='store_true') + parser.add_argument('-dt', '--dont-order-by-type', dest='dont_order_by_type', + action='store_true', help='Only order imports alphabetically, do not attempt type ordering') + parser.add_argument('-e', '--balanced', dest='balanced_wrapping', action='store_true', + help='Balances wrapping to produce the most consistent line length possible') + parser.add_argument('-f', '--future', dest='known_future_library', action='append', + help='Force sortImports to recognize a module as part of the future compatibility libraries.') + parser.add_argument('-fas', '--force-alphabetical-sort', action='store_true', dest="force_alphabetical_sort", + help='Force all imports to be sorted as a single section') + parser.add_argument('-fass', '--force-alphabetical-sort-within-sections', action='store_true', + dest="force_alphabetical_sort", help='Force all imports to be sorted alphabetically within a ' + 'section') + parser.add_argument('-ff', '--from-first', dest='from_first', + help="Switches the typical ordering preference, showing from imports first then straight ones.") + parser.add_argument('-fgw', '--force-grid-wrap', nargs='?', const=2, type=int, dest="force_grid_wrap", + help='Force number of from imports (defaults to 2) to be grid wrapped regardless of line ' + 'length') + parser.add_argument('-fss', '--force-sort-within-sections', action='store_true', dest="force_sort_within_sections", + help='Force imports to be sorted by module, independent of import_type') + parser.add_argument('-i', '--indent', help='String to place for indents defaults to " " (4 spaces).', + dest='indent', type=str) + parser.add_argument('-j', '--jobs', help='Number of files to process in parallel.', + dest='jobs', type=int) + parser.add_argument('-k', '--keep-direct-and-as', dest='keep_direct_and_as_imports', action='store_true', + help="Turns off default behavior that removes direct imports when as imports exist.") + parser.add_argument('-l', '--lines', help='[Deprecated] The max length of an import line (used for wrapping ' + 'long imports).', + dest='line_length', type=int) + parser.add_argument('-lai', '--lines-after-imports', dest='lines_after_imports', type=int) + parser.add_argument('-lbt', '--lines-between-types', dest='lines_between_types', type=int) + parser.add_argument('-le', '--line-ending', dest='line_ending', + help="Forces line endings to the specified value. If not set, values will be guessed per-file.") + parser.add_argument('-ls', '--length-sort', help='Sort imports by their string length.', + dest='length_sort', action='store_true') + parser.add_argument('-m', '--multi-line', dest='multi_line_output', type=int, choices=range(len(WrapModes)), + help='Multi line output (0-grid, 1-vertical, 2-hanging, 3-vert-hanging, 4-vert-grid, ' + '5-vert-grid-grouped, 6-vert-grid-grouped-no-comma).') + inline_args_group.add_argument('-nis', '--no-inline-sort', dest='no_inline_sort', action='store_true', + help='Leaves `from` imports with multiple imports \'as-is\' (e.g. `from foo import a, c ,b`).') + parser.add_argument('-nlb', '--no-lines-before', help='Sections which should not be split with previous by empty lines', + dest='no_lines_before', action='append') + parser.add_argument('-ns', '--dont-skip', help='Files that sort imports should never skip over.', + dest='not_skip', action='append') + parser.add_argument('-o', '--thirdparty', dest='known_third_party', action='append', + help='Force sortImports to recognize a module as being part of a third party library.') + parser.add_argument('-ot', '--order-by-type', dest='order_by_type', + action='store_true', help='Order imports by type in addition to alphabetically') + parser.add_argument('-p', '--project', dest='known_first_party', action='append', + help='Force sortImports to recognize a module as being part of the current python project.') + parser.add_argument('-q', '--quiet', action='store_true', dest="quiet", + help='Shows extra quiet output, only errors are outputted.') + parser.add_argument('-r', dest='ambiguous_r_flag', action='store_true') + parser.add_argument('-rm', '--remove-import', dest='remove_imports', action='append', + help='Removes the specified import from all files.') + parser.add_argument('-rr', '--reverse-relative', dest='reverse_relative', action='store_true', + help='Reverse order of relative imports.') + parser.add_argument('-rc', '--recursive', dest='recursive', action='store_true', + help='Recursively look for Python files of which to sort imports') + parser.add_argument('-s', '--skip', help='Files that sort imports should skip over. If you want to skip multiple ' + 'files you should specify twice: --skip file1 --skip file2.', dest='skip', action='append') + parser.add_argument('-sd', '--section-default', dest='default_section', + help='Sets the default section for imports (by default FIRSTPARTY) options: ' + + str(DEFAULT_SECTIONS)) + parser.add_argument('-sg', '--skip-glob', help='Files that sort imports should skip over.', dest='skip_glob', + action='append') + inline_args_group.add_argument('-sl', '--force-single-line-imports', dest='force_single_line', action='store_true', + help='Forces all from imports to appear on their own line') + parser.add_argument('-sp', '--settings-path', dest="settings_path", + help='Explicitly set the settings path instead of auto determining based on file location.') + parser.add_argument('-t', '--top', help='Force specific imports to the top of their appropriate section.', + dest='force_to_top', action='append') + parser.add_argument('-tc', '--trailing-comma', dest='include_trailing_comma', action='store_true', + help='Includes a trailing comma on multi line imports that include parentheses.') + parser.add_argument('-up', '--use-parentheses', dest='use_parentheses', action='store_true', + help='Use parenthesis for line continuation on length limit instead of slashes.') + parser.add_argument('-v', '--version', action='store_true', dest='show_version') + parser.add_argument('-vb', '--verbose', action='store_true', dest="verbose", + help='Shows verbose output, such as when files are skipped or when a check is successful.') + parser.add_argument('--virtual-env', dest='virtual_env', + help='Virtual environment to use for determining whether a package is third-party') + parser.add_argument('--conda-env', dest='conda_env', + help='Conda environment to use for determining whether a package is third-party') + parser.add_argument('-vn', '--version-number', action='version', version=__version__, + help='Returns just the current version number without the logo') + parser.add_argument('-w', '--line-width', help='The max length of an import line (used for wrapping long imports).', + dest='line_length', type=int) + parser.add_argument('-wl', '--wrap-length', dest='wrap_length', + help="Specifies how long lines that are wrapped should be, if not set line_length is used.") + parser.add_argument('-ws', '--ignore-whitespace', action='store_true', dest="ignore_whitespace", + help='Tells isort to ignore whitespace differences when --check-only is being used.') + parser.add_argument('-y', '--apply', dest='apply', action='store_true', + help='Tells isort to apply changes recursively without asking') + parser.add_argument('--unsafe', dest='unsafe', action='store_true', + help='Tells isort to look for files in standard library directories, etc. ' + 'where it may not be safe to operate in') + parser.add_argument('--case-sensitive', dest='case_sensitive', action='store_true', + help='Tells isort to include casing when sorting module names') + parser.add_argument('--filter-files', dest='filter_files', action='store_true', + help='Tells isort to filter files even when they are explicitly passed in as part of the command') + parser.add_argument('files', nargs='*', help='One or more Python source files that need their imports sorted.') + + arguments = {key: value for key, value in vars(parser.parse_args(argv)).items() if value} + if 'dont_order_by_type' in arguments: + arguments['order_by_type'] = False + if arguments.pop('unsafe', False): + arguments['safety_excludes'] = False + return arguments + + +def main(argv=None): + arguments = parse_args(argv) + if arguments.get('show_version'): + print(INTRO) + return + + if arguments.get('ambiguous_r_flag'): + print('ERROR: Deprecated -r flag set. This flag has been replaced with -rm to remove ambiguity between it and ' + '-rc for recursive') + sys.exit(1) + + arguments['check_skip'] = False + if 'settings_path' in arguments: + sp = arguments['settings_path'] + arguments['settings_path'] = os.path.abspath(sp) if os.path.isdir(sp) else os.path.dirname(os.path.abspath(sp)) + if not os.path.isdir(arguments['settings_path']): + print("WARNING: settings_path dir does not exist: {0}".format(arguments['settings_path'])) + + if 'virtual_env' in arguments: + venv = arguments['virtual_env'] + arguments['virtual_env'] = os.path.abspath(venv) + if not os.path.isdir(arguments['virtual_env']): + print("WARNING: virtual_env dir does not exist: {0}".format(arguments['virtual_env'])) + + file_names = arguments.pop('files', []) + if file_names == ['-']: + try: + # python 3 + file_ = sys.stdin.buffer + except AttributeError: + # python 2 + file_ = sys.stdin + SortImports(file_=file_, write_to_stdout=True, **arguments) + else: + if not file_names: + file_names = ['.'] + arguments['recursive'] = True + if not arguments.get('apply', False): + arguments['ask_to_apply'] = True + + config = from_path(arguments.get('settings_path', '') or os.path.abspath(file_names[0]) or os.getcwd()).copy() + config.update(arguments) + wrong_sorted_files = False + skipped = [] + + if config.get('filter_files'): + filtered_files = [] + for file_name in file_names: + if should_skip(file_name, config): + skipped.append(file_name) + else: + filtered_files.append(file_name) + file_names = filtered_files + + if arguments.get('recursive', False): + file_names = iter_source_code(file_names, config, skipped) + num_skipped = 0 + if config['verbose'] or config.get('show_logo', False): + print(INTRO) + + jobs = arguments.get('jobs') + if jobs: + import multiprocessing + executor = multiprocessing.Pool(jobs) + attempt_iterator = executor.imap(functools.partial(sort_imports, **arguments), file_names) + else: + attempt_iterator = (sort_imports(file_name, **arguments) for file_name in file_names) + + for sort_attempt in attempt_iterator: + if not sort_attempt: + continue + incorrectly_sorted = sort_attempt.incorrectly_sorted + if arguments.get('check', False) and incorrectly_sorted: + wrong_sorted_files = True + if sort_attempt.skipped: + num_skipped += 1 + + if wrong_sorted_files: + sys.exit(1) + + num_skipped += len(skipped) + if num_skipped and not arguments.get('quiet', False): + if config['verbose']: + for was_skipped in skipped: + print("WARNING: {0} was skipped as it's listed in 'skip' setting" + " or matches a glob in 'skip_glob' setting".format(was_skipped)) + print("Skipped {0} files".format(num_skipped)) + + +if __name__ == "__main__": + main() diff --git a/.venv/lib/python3.8/site-packages/isort/natural.py b/.venv/lib/python3.8/site-packages/isort/natural.py new file mode 100644 index 00000000..c02b42c3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/isort/natural.py @@ -0,0 +1,47 @@ +"""isort/natural.py. + +Enables sorting strings that contain numbers naturally + +usage: + natural.nsorted(list) + +Copyright (C) 2013 Timothy Edmund Crosley + +Implementation originally from @HappyLeapSecond stack overflow user in response to: + https://stackoverflow.com/questions/5967500/how-to-correctly-sort-a-string-with-a-number-inside + +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: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +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. + +""" +import re + + +def _atoi(text): + return int(text) if text.isdigit() else text + + +def _natural_keys(text): + return [_atoi(c) for c in re.split(r'(\d+)', text)] + + +def nsorted(to_sort, key=None): + """Returns a naturally sorted list""" + if key is None: + key_callback = _natural_keys + else: + def key_callback(item): + return _natural_keys(key(item)) + + return sorted(to_sort, key=key_callback) diff --git a/.venv/lib/python3.8/site-packages/isort/pie_slice.py b/.venv/lib/python3.8/site-packages/isort/pie_slice.py new file mode 100644 index 00000000..569ea76e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/isort/pie_slice.py @@ -0,0 +1,154 @@ +"""pie_slice/overrides.py. + +Overrides Python syntax to conform to the Python3 version as much as possible using a '*' import + +Copyright (C) 2013 Timothy Edmund Crosley + +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: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +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. + +""" +from __future__ import absolute_import + +import collections +import sys + +__version__ = "1.1.0" + +PY2 = sys.version_info[0] == 2 +PY3 = sys.version_info[0] == 3 +VERSION = sys.version_info + +__all__ = ['PY2', 'PY3', 'lru_cache', 'apply_changes_to_python_environment'] + + +if PY3: + input = input + + def apply_changes_to_python_environment(): + pass +else: + input = raw_input # noqa: F821 + + python_environment_changes_applied = False + + import sys + stdout = sys.stdout + stderr = sys.stderr + + def apply_changes_to_python_environment(): + global python_environment_changes_applied + if python_environment_changes_applied or sys.getdefaultencoding() == 'utf-8': + python_environment_changes_applied = True + return + + try: + reload(sys) + sys.stdout = stdout + sys.stderr = stderr + sys.setdefaultencoding('utf-8') + except NameError: # Python 3 + sys.exit('This should not happen!') + + python_environment_changes_applied = True + + +if sys.version_info < (3, 2): + try: + from threading import Lock + except ImportError: + from dummy_threading import Lock + + from functools import wraps + + _CacheInfo = collections.namedtuple("CacheInfo", "hits misses maxsize currsize") + + def lru_cache(maxsize=100): + """Least-recently-used cache decorator. + Taking from: https://github.com/MiCHiLU/python-functools32/blob/master/functools32/functools32.py + with slight modifications. + If *maxsize* is set to None, the LRU features are disabled and the cache + can grow without bound. + Arguments to the cached function must be hashable. + View the cache statistics named tuple (hits, misses, maxsize, currsize) with + f.cache_info(). Clear the cache and statistics with f.cache_clear(). + Access the underlying function with f.__wrapped__. + See: https://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used + + """ + def decorating_function(user_function, tuple=tuple, sorted=sorted, len=len, KeyError=KeyError): + hits, misses = [0], [0] + kwd_mark = (object(),) # separates positional and keyword args + lock = Lock() + + if maxsize is None: + CACHE = {} + + @wraps(user_function) + def wrapper(*args, **kwds): + key = args + if kwds: + key += kwd_mark + tuple(sorted(kwds.items())) + try: + result = CACHE[key] + hits[0] += 1 + return result + except KeyError: + pass + result = user_function(*args, **kwds) + CACHE[key] = result + misses[0] += 1 + return result + else: + CACHE = collections.OrderedDict() + + @wraps(user_function) + def wrapper(*args, **kwds): + key = args + if kwds: + key += kwd_mark + tuple(sorted(kwds.items())) + with lock: + cached = CACHE.get(key, None) + if cached: + del CACHE[key] + CACHE[key] = cached + hits[0] += 1 + return cached + result = user_function(*args, **kwds) + with lock: + CACHE[key] = result # record recent use of this key + misses[0] += 1 + while len(CACHE) > maxsize: + CACHE.popitem(last=False) + return result + + def cache_info(): + """Report CACHE statistics.""" + with lock: + return _CacheInfo(hits[0], misses[0], maxsize, len(CACHE)) + + def cache_clear(): + """Clear the CACHE and CACHE statistics.""" + with lock: + CACHE.clear() + hits[0] = misses[0] = 0 + + wrapper.cache_info = cache_info + wrapper.cache_clear = cache_clear + return wrapper + + return decorating_function + +else: + from functools import lru_cache diff --git a/.venv/lib/python3.8/site-packages/isort/pylama_isort.py b/.venv/lib/python3.8/site-packages/isort/pylama_isort.py new file mode 100644 index 00000000..6fa235f9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/isort/pylama_isort.py @@ -0,0 +1,29 @@ +import os +import sys + +from pylama.lint import Linter as BaseLinter + +from .isort import SortImports + + +class Linter(BaseLinter): + + def allow(self, path): + """Determine if this path should be linted.""" + return path.endswith('.py') + + def run(self, path, **meta): + """Lint the file. Return an array of error dicts if appropriate.""" + with open(os.devnull, 'w') as devnull: + # Suppress isort messages + sys.stdout = devnull + + if SortImports(path, check=True).incorrectly_sorted: + return [{ + 'lnum': 0, + 'col': 0, + 'text': 'Incorrectly sorted imports.', + 'type': 'ISORT' + }] + else: + return [] diff --git a/.venv/lib/python3.8/site-packages/isort/settings.py b/.venv/lib/python3.8/site-packages/isort/settings.py new file mode 100644 index 00000000..a69471e8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/isort/settings.py @@ -0,0 +1,356 @@ +"""isort/settings.py. + +Defines how the default settings for isort should be loaded + +(First from the default setting dictionary at the top of the file, then overridden by any settings + in ~/.isort.cfg or $XDG_CONFIG_HOME/isort.cfg if there are any) + +Copyright (C) 2013 Timothy Edmund Crosley + +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: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +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. + +""" +from __future__ import absolute_import, division, print_function, unicode_literals + +import fnmatch +import io +import os +import posixpath +import re +import sys +import warnings +from collections import namedtuple +from distutils.util import strtobool + +from .pie_slice import lru_cache +from .utils import difference, union + +try: + import configparser +except ImportError: + import ConfigParser as configparser + +try: + import toml +except ImportError: + toml = False + +try: + import appdirs + if appdirs.system == 'darwin': + appdirs.system = 'linux2' +except ImportError: + appdirs = None + +MAX_CONFIG_SEARCH_DEPTH = 25 # The number of parent directories isort will look for a config file within +DEFAULT_SECTIONS = ('FUTURE', 'STDLIB', 'THIRDPARTY', 'FIRSTPARTY', 'LOCALFOLDER') + +safety_exclude_re = re.compile( + r"/(\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|_build|buck-out|build|dist|\.pants\.d" + r"|lib/python[0-9].[0-9]+)/" +) + +WrapModes = ('GRID', 'VERTICAL', 'HANGING_INDENT', 'VERTICAL_HANGING_INDENT', 'VERTICAL_GRID', 'VERTICAL_GRID_GROUPED', + 'VERTICAL_GRID_GROUPED_NO_COMMA', 'NOQA') +WrapModes = namedtuple('WrapModes', WrapModes)(*range(len(WrapModes))) + +# Note that none of these lists must be complete as they are simply fallbacks for when included auto-detection fails. +default = {'force_to_top': [], + 'skip': [], + 'skip_glob': [], + 'line_length': 79, + 'wrap_length': 0, + 'line_ending': None, + 'sections': DEFAULT_SECTIONS, + 'no_sections': False, + 'known_future_library': ['__future__'], + 'known_standard_library': ['AL', 'BaseHTTPServer', 'Bastion', 'CGIHTTPServer', 'Carbon', 'ColorPicker', + 'ConfigParser', 'Cookie', 'DEVICE', 'DocXMLRPCServer', 'EasyDialogs', 'FL', + 'FrameWork', 'GL', 'HTMLParser', 'MacOS', 'MimeWriter', 'MiniAEFrame', 'Nav', + 'PixMapWrapper', 'Queue', 'SUNAUDIODEV', 'ScrolledText', 'SimpleHTTPServer', + 'SimpleXMLRPCServer', 'SocketServer', 'StringIO', 'Tix', 'Tkinter', 'UserDict', + 'UserList', 'UserString', 'W', '__builtin__', 'abc', 'aepack', 'aetools', + 'aetypes', 'aifc', 'al', 'anydbm', 'applesingle', 'argparse', 'array', 'ast', + 'asynchat', 'asyncio', 'asyncore', 'atexit', 'audioop', 'autoGIL', 'base64', + 'bdb', 'binascii', 'binhex', 'bisect', 'bsddb', 'buildtools', 'builtins', + 'bz2', 'cPickle', 'cProfile', 'cStringIO', 'calendar', 'cd', 'cfmfile', 'cgi', + 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', 'codeop', 'collections', + 'colorsys', 'commands', 'compileall', 'compiler', 'concurrent', 'configparser', + 'contextlib', 'contextvars', 'cookielib', 'copy', 'copy_reg', 'copyreg', 'crypt', 'csv', + 'ctypes', 'curses', 'dataclasses', 'datetime', 'dbhash', 'dbm', 'decimal', 'difflib', + 'dircache', 'dis', 'distutils', 'dl', 'doctest', 'dumbdbm', 'dummy_thread', + 'dummy_threading', 'email', 'encodings', 'ensurepip', 'enum', 'errno', + 'exceptions', 'faulthandler', 'fcntl', 'filecmp', 'fileinput', 'findertools', + 'fl', 'flp', 'fm', 'fnmatch', 'formatter', 'fpectl', 'fpformat', 'fractions', + 'ftplib', 'functools', 'future_builtins', 'gc', 'gdbm', 'gensuitemodule', + 'getopt', 'getpass', 'gettext', 'gl', 'glob', 'grp', 'gzip', 'hashlib', + 'heapq', 'hmac', 'hotshot', 'html', 'htmlentitydefs', 'htmllib', 'http', + 'httplib', 'ic', 'icopen', 'imageop', 'imaplib', 'imgfile', 'imghdr', 'imp', + 'importlib', 'imputil', 'inspect', 'io', 'ipaddress', 'itertools', 'jpeg', + 'json', 'keyword', 'lib2to3', 'linecache', 'locale', 'logging', 'lzma', + 'macerrors', 'macostools', 'macpath', 'macresource', 'mailbox', 'mailcap', + 'marshal', 'math', 'md5', 'mhlib', 'mimetools', 'mimetypes', 'mimify', 'mmap', + 'modulefinder', 'msilib', 'msvcrt', 'multifile', 'multiprocessing', 'mutex', + 'netrc', 'new', 'nis', 'nntplib', 'numbers', 'operator', 'optparse', 'os', + 'ossaudiodev', 'parser', 'pathlib', 'pdb', 'pickle', 'pickletools', 'pipes', + 'pkgutil', 'platform', 'plistlib', 'popen2', 'poplib', 'posix', 'posixfile', + 'pprint', 'profile', 'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', + 'queue', 'quopri', 'random', 're', 'readline', 'reprlib', 'resource', 'rexec', + 'rfc822', 'rlcompleter', 'robotparser', 'runpy', 'sched', 'secrets', 'select', + 'selectors', 'sets', 'sgmllib', 'sha', 'shelve', 'shlex', 'shutil', 'signal', + 'site', 'sitecustomize', 'smtpd', 'smtplib', 'sndhdr', 'socket', 'socketserver', + 'spwd', 'sqlite3', 'ssl', 'stat', 'statistics', 'statvfs', 'string', 'stringprep', + 'struct', 'subprocess', 'sunau', 'sunaudiodev', 'symbol', 'symtable', 'sys', + 'sysconfig', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios', + 'test', 'textwrap', 'this', 'thread', 'threading', 'time', 'timeit', 'tkinter', + 'token', 'tokenize', 'trace', 'traceback', 'tracemalloc', 'ttk', 'tty', 'turtle', + 'turtledemo', 'types', 'typing', 'unicodedata', 'unittest', 'urllib', 'urllib2', + 'urlparse', 'usercustomize', 'uu', 'uuid', 'venv', 'videoreader', + 'warnings', 'wave', 'weakref', 'webbrowser', 'whichdb', 'winreg', 'winsound', + 'wsgiref', 'xdrlib', 'xml', 'xmlrpc', 'xmlrpclib', 'zipapp', 'zipfile', + 'zipimport', 'zlib'], + 'known_third_party': ['google.appengine.api'], + 'known_first_party': [], + 'multi_line_output': WrapModes.GRID, + 'forced_separate': [], + 'indent': ' ' * 4, + 'comment_prefix': ' #', + 'length_sort': False, + 'add_imports': [], + 'remove_imports': [], + 'reverse_relative': False, + 'force_single_line': False, + 'default_section': 'FIRSTPARTY', + 'import_heading_future': '', + 'import_heading_stdlib': '', + 'import_heading_thirdparty': '', + 'import_heading_firstparty': '', + 'import_heading_localfolder': '', + 'balanced_wrapping': False, + 'use_parentheses': False, + 'order_by_type': True, + 'atomic': False, + 'lines_after_imports': -1, + 'lines_between_sections': 1, + 'lines_between_types': 0, + 'combine_as_imports': False, + 'combine_star': False, + 'keep_direct_and_as_imports': False, + 'include_trailing_comma': False, + 'from_first': False, + 'verbose': False, + 'quiet': False, + 'force_adds': False, + 'force_alphabetical_sort_within_sections': False, + 'force_alphabetical_sort': False, + 'force_grid_wrap': 0, + 'force_sort_within_sections': False, + 'show_diff': False, + 'ignore_whitespace': False, + 'no_lines_before': [], + 'no_inline_sort': False, + 'ignore_comments': False, + 'safety_excludes': True, + 'case_sensitive': False} + + +@lru_cache() +def from_path(path): + computed_settings = default.copy() + isort_defaults = ['~/.isort.cfg'] + if appdirs: + isort_defaults = [appdirs.user_config_dir('isort.cfg')] + isort_defaults + + _update_settings_with_config(path, '.editorconfig', ['~/.editorconfig'], ('*', '*.py', '**.py'), computed_settings) + _update_settings_with_config(path, 'pyproject.toml', [], ('tool.isort', ), computed_settings) + _update_settings_with_config(path, '.isort.cfg', isort_defaults, ('settings', 'isort'), computed_settings) + _update_settings_with_config(path, 'setup.cfg', [], ('isort', 'tool:isort'), computed_settings) + _update_settings_with_config(path, 'tox.ini', [], ('isort', 'tool:isort'), computed_settings) + return computed_settings + + +def _update_settings_with_config(path, name, default, sections, computed_settings): + editor_config_file = None + for potential_settings_path in default: + expanded = os.path.expanduser(potential_settings_path) + if os.path.exists(expanded): + editor_config_file = expanded + break + + tries = 0 + current_directory = path + while current_directory and tries < MAX_CONFIG_SEARCH_DEPTH: + potential_path = os.path.join(current_directory, str(name)) + if os.path.exists(potential_path): + editor_config_file = potential_path + break + + new_directory = os.path.split(current_directory)[0] + if current_directory == new_directory: + break + current_directory = new_directory + tries += 1 + + if editor_config_file and os.path.exists(editor_config_file): + _update_with_config_file(editor_config_file, sections, computed_settings) + + +def _update_with_config_file(file_path, sections, computed_settings): + cwd = os.path.dirname(file_path) + settings = _get_config_data(file_path, sections).copy() + if not settings: + return + + if file_path.endswith('.editorconfig'): + indent_style = settings.pop('indent_style', '').strip() + indent_size = settings.pop('indent_size', '').strip() + if indent_size == "tab": + indent_size = settings.pop('tab_width', '').strip() + + if indent_style == 'space': + computed_settings['indent'] = ' ' * (indent_size and int(indent_size) or 4) + elif indent_style == 'tab': + computed_settings['indent'] = '\t' * (indent_size and int(indent_size) or 1) + + max_line_length = settings.pop('max_line_length', '').strip() + if max_line_length: + computed_settings['line_length'] = float('inf') if max_line_length == 'off' else int(max_line_length) + + for key, value in settings.items(): + access_key = key.replace('not_', '').lower() + existing_value_type = type(default.get(access_key, '')) + if existing_value_type in (list, tuple): + # sections has fixed order values; no adding or substraction from any set + if access_key == 'sections': + computed_settings[access_key] = tuple(_as_list(value)) + else: + existing_data = set(computed_settings.get(access_key, default.get(access_key))) + if key.startswith('not_'): + computed_settings[access_key] = difference(existing_data, _as_list(value)) + elif key.startswith('known_'): + computed_settings[access_key] = union(existing_data, _abspaths(cwd, _as_list(value))) + else: + computed_settings[access_key] = union(existing_data, _as_list(value)) + elif existing_value_type == bool: + # Only some configuration formats support native boolean values. + if not isinstance(value, bool): + value = bool(strtobool(value)) + computed_settings[access_key] = value + elif key.startswith('known_'): + computed_settings[access_key] = list(_abspaths(cwd, _as_list(value))) + elif key == 'force_grid_wrap': + try: + result = existing_value_type(value) + except ValueError: + # backwards compat + result = default.get(access_key) if value.lower().strip() == 'false' else 2 + computed_settings[access_key] = result + else: + computed_settings[access_key] = existing_value_type(value) + + +def _as_list(value): + if not isinstance(value, list): + value = value.replace('\n', ',').split(',') + + return filter(bool, [item.strip() for item in value]) + + +def _abspaths(cwd, values): + paths = [ + os.path.join(cwd, value) + if not value.startswith(os.path.sep) and value.endswith(os.path.sep) + else value + for value in values + ] + return paths + + +@lru_cache() +def _get_config_data(file_path, sections): + settings = {} + + with io.open(file_path) as config_file: + if file_path.endswith('.toml'): + if toml: + config = toml.load(config_file) + for section in sections: + config_section = config + for key in section.split('.'): + config_section = config_section.get(key, {}) + settings.update(config_section) + else: + if '[tool.isort]' in config_file.read(): + warnings.warn("Found {} with [tool.isort] section, but toml package is not installed. " + "To configure isort with {}, install with 'isort[pyproject]'.".format(file_path, + file_path)) + else: + if file_path.endswith('.editorconfig'): + line = '\n' + last_position = config_file.tell() + while line: + line = config_file.readline() + if '[' in line: + config_file.seek(last_position) + break + last_position = config_file.tell() + + if sys.version_info >= (3, 2): + config = configparser.ConfigParser(strict=False) + config.read_file(config_file) + else: + config = configparser.SafeConfigParser() + config.readfp(config_file) + + for section in sections: + if config.has_section(section): + settings.update(config.items(section)) + + return settings + + +def should_skip(filename, config, path=''): + """Returns True if the file and/or folder should be skipped based on the passed in settings.""" + os_path = os.path.join(path, filename) + + normalized_path = os_path.replace('\\', '/') + if normalized_path[1:2] == ':': + normalized_path = normalized_path[2:] + + if path and config['safety_excludes']: + check_exclude = '/' + filename.replace('\\', '/') + '/' + if path and os.path.basename(path) in ('lib', ): + check_exclude = '/' + os.path.basename(path) + check_exclude + if safety_exclude_re.search(check_exclude): + return True + + for skip_path in config['skip']: + if posixpath.abspath(normalized_path) == posixpath.abspath(skip_path.replace('\\', '/')): + return True + + position = os.path.split(filename) + while position[1]: + if position[1] in config['skip']: + return True + position = os.path.split(position[0]) + + for glob in config['skip_glob']: + if fnmatch.fnmatch(filename, glob) or fnmatch.fnmatch('/' + filename, glob): + return True + + if not (os.path.isfile(os_path) or os.path.isdir(os_path) or os.path.islink(os_path)): + return True + + return False diff --git a/.venv/lib/python3.8/site-packages/isort/utils.py b/.venv/lib/python3.8/site-packages/isort/utils.py new file mode 100644 index 00000000..ce4e588e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/isort/utils.py @@ -0,0 +1,53 @@ +import os +import sys +from contextlib import contextmanager + + +def exists_case_sensitive(path): + """ + Returns if the given path exists and also matches the case on Windows. + + When finding files that can be imported, it is important for the cases to match because while + file os.path.exists("module.py") and os.path.exists("MODULE.py") both return True on Windows, Python + can only import using the case of the real file. + """ + result = os.path.exists(path) + if (sys.platform.startswith('win') or sys.platform == 'darwin') and result: + directory, basename = os.path.split(path) + result = basename in os.listdir(directory) + return result + + +@contextmanager +def chdir(path): + """Context manager for changing dir and restoring previous workdir after exit. + """ + curdir = os.getcwd() + os.chdir(path) + try: + yield + finally: + os.chdir(curdir) + + +def union(a, b): + """ Return a list of items that are in `a` or `b` + """ + u = [] + for item in a: + if item not in u: + u.append(item) + for item in b: + if item not in u: + u.append(item) + return u + + +def difference(a, b): + """ Return a list of items from `a` that are not in `b`. + """ + d = [] + for item in a: + if item not in b: + d.append(item) + return d diff --git a/.venv/lib/python3.8/site-packages/itsdangerous-1.1.0.dist-info/INSTALLER b/.venv/lib/python3.8/site-packages/itsdangerous-1.1.0.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/itsdangerous-1.1.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/lib/python3.8/site-packages/itsdangerous-1.1.0.dist-info/LICENSE.rst b/.venv/lib/python3.8/site-packages/itsdangerous-1.1.0.dist-info/LICENSE.rst new file mode 100644 index 00000000..ef9c1947 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/itsdangerous-1.1.0.dist-info/LICENSE.rst @@ -0,0 +1,47 @@ +`BSD 3-Clause `_ + +Copyright © 2011 by the Pallets team. + +Some rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +- Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +We kindly ask you to use these themes in an unmodified manner only with +Pallets and Pallets-related projects, not for unrelated projects. If you +like the visual style and want to use it for your own projects, please +consider making some larger changes to the themes (such as changing font +faces, sizes, colors or margins). + +THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +---- + +The initial implementation of itsdangerous was inspired by Django's +signing module. + +Copyright © Django Software Foundation and individual contributors. +All rights reserved. diff --git a/.venv/lib/python3.8/site-packages/itsdangerous-1.1.0.dist-info/METADATA b/.venv/lib/python3.8/site-packages/itsdangerous-1.1.0.dist-info/METADATA new file mode 100644 index 00000000..7389a4d2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/itsdangerous-1.1.0.dist-info/METADATA @@ -0,0 +1,98 @@ +Metadata-Version: 2.1 +Name: itsdangerous +Version: 1.1.0 +Summary: Various helpers to pass data to untrusted environments and back. +Home-page: https://palletsprojects.com/p/itsdangerous/ +Author: Armin Ronacher +Author-email: armin.ronacher@active-4.com +Maintainer: Pallets Team +Maintainer-email: contact@palletsprojects.com +License: BSD +Project-URL: Documentation, https://itsdangerous.palletsprojects.com/ +Project-URL: Code, https://github.com/pallets/itsdangerous +Project-URL: Issue tracker, https://github.com/pallets/itsdangerous/issues +Platform: UNKNOWN +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* + +itsdangerous +============ + +... so better sign this + +Various helpers to pass data to untrusted environments and to get it +back safe and sound. Data is cryptographically signed to ensure that a +token has not been tampered with. + +It's possible to customize how data is serialized. Data is compressed as +needed. A timestamp can be added and verified automatically while +loading a token. + + +Installing +---------- + +Install and update using `pip`_: + +.. code-block:: text + + pip install -U itsdangerous + +.. _pip: https://pip.pypa.io/en/stable/quickstart/ + + +A Simple Example +---------------- + +Here's how you could generate a token for transmitting a user's id and +name between web requests. + +.. code-block:: python + + from itsdangerous import URLSafeSerializer + auth_s = URLSafeSerializer("secret key", "auth") + token = auth_s.dumps({"id": 5, "name": "itsdangerous"}) + + print(token) + # eyJpZCI6NSwibmFtZSI6Iml0c2Rhbmdlcm91cyJ9.6YP6T0BaO67XP--9UzTrmurXSmg + + data = auth_s.loads(token) + print(data["name"]) + # itsdangerous + + +Donate +------ + +The Pallets organization develops and supports itsdangerous and other +popular packages. In order to grow the community of contributors and +users, and allow the maintainers to devote more time to the projects, +`please donate today`_. + +.. _please donate today: https://palletsprojects.com/donate + + +Links +----- + +* Website: https://palletsprojects.com/p/itsdangerous/ +* Documentation: https://itsdangerous.palletsprojects.com/ +* License: `BSD `_ +* Releases: https://pypi.org/project/itsdangerous/ +* Code: https://github.com/pallets/itsdangerous +* Issue tracker: https://github.com/pallets/itsdangerous/issues +* Test status: https://travis-ci.org/pallets/itsdangerous +* Test coverage: https://codecov.io/gh/pallets/itsdangerous + + diff --git a/.venv/lib/python3.8/site-packages/itsdangerous-1.1.0.dist-info/RECORD b/.venv/lib/python3.8/site-packages/itsdangerous-1.1.0.dist-info/RECORD new file mode 100644 index 00000000..9360bbad --- /dev/null +++ b/.venv/lib/python3.8/site-packages/itsdangerous-1.1.0.dist-info/RECORD @@ -0,0 +1,26 @@ +itsdangerous-1.1.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +itsdangerous-1.1.0.dist-info/LICENSE.rst,sha256=_rKL-jSNgWsOfbrt3xhJnufoAHxngT241qs3xl4EbNQ,2120 +itsdangerous-1.1.0.dist-info/METADATA,sha256=yyKjL2WOg_WybH2Yt-7NIvGpV3B93IsMc2HbToWc7Sk,3062 +itsdangerous-1.1.0.dist-info/RECORD,, +itsdangerous-1.1.0.dist-info/WHEEL,sha256=CihQvCnsGZQBGAHLEUMf0IdA4fRduS_NBUTMgCTtvPM,110 +itsdangerous-1.1.0.dist-info/top_level.txt,sha256=gKN1OKLk81i7fbWWildJA88EQ9NhnGMSvZqhfz9ICjk,13 +itsdangerous/__init__.py,sha256=Dr-SkfFdOyiR_WjiqIXnlFpYRMW0XvPBNV5muzE5N_A,708 +itsdangerous/__pycache__/__init__.cpython-38.pyc,, +itsdangerous/__pycache__/_compat.cpython-38.pyc,, +itsdangerous/__pycache__/_json.cpython-38.pyc,, +itsdangerous/__pycache__/encoding.cpython-38.pyc,, +itsdangerous/__pycache__/exc.cpython-38.pyc,, +itsdangerous/__pycache__/jws.cpython-38.pyc,, +itsdangerous/__pycache__/serializer.cpython-38.pyc,, +itsdangerous/__pycache__/signer.cpython-38.pyc,, +itsdangerous/__pycache__/timed.cpython-38.pyc,, +itsdangerous/__pycache__/url_safe.cpython-38.pyc,, +itsdangerous/_compat.py,sha256=oAAMcQAjwQXQpIbuHT3o-aL56ztm_7Fe-4lD7IteF6A,1133 +itsdangerous/_json.py,sha256=W7BLL4RPnSOjNdo2gfKT3BeARMCIikY6O75rwWV0XoE,431 +itsdangerous/encoding.py,sha256=KhY85PsH3bGHe5JANN4LMZ_3b0IwUWRRnnw1wvLlaIg,1224 +itsdangerous/exc.py,sha256=KFxg7K2XMliMQAxL4jkRNgE8e73z2jcRaLrzwqVObnI,2959 +itsdangerous/jws.py,sha256=6Lh9W-Lu8D9s7bRazs0Zb35eyAZm3pzLeZqHmRELeII,7470 +itsdangerous/serializer.py,sha256=bT-dfjKec9zcKa8Qo8n7mHW_8M-XCTPMOFq1TQI_Fv4,8653 +itsdangerous/signer.py,sha256=OOZbK8XomBjQfOFEul8osesn7fc80MXB0L1r7E86_GQ,6345 +itsdangerous/timed.py,sha256=on5Q5lX7LT_LaETOhzF1ZmrRbia8P98263R8FiRyM6Y,5635 +itsdangerous/url_safe.py,sha256=xnFTaukIPmW6Qwn6uNQLgzdau8RuAKnp5N7ukuXykj0,2275 diff --git a/.venv/lib/python3.8/site-packages/itsdangerous-1.1.0.dist-info/WHEEL b/.venv/lib/python3.8/site-packages/itsdangerous-1.1.0.dist-info/WHEEL new file mode 100644 index 00000000..dea0e20c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/itsdangerous-1.1.0.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.32.2) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/.venv/lib/python3.8/site-packages/itsdangerous-1.1.0.dist-info/top_level.txt b/.venv/lib/python3.8/site-packages/itsdangerous-1.1.0.dist-info/top_level.txt new file mode 100644 index 00000000..e163955e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/itsdangerous-1.1.0.dist-info/top_level.txt @@ -0,0 +1 @@ +itsdangerous diff --git a/.venv/lib/python3.8/site-packages/itsdangerous/__init__.py b/.venv/lib/python3.8/site-packages/itsdangerous/__init__.py new file mode 100644 index 00000000..0fcd8c1b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/itsdangerous/__init__.py @@ -0,0 +1,22 @@ +from ._json import json +from .encoding import base64_decode +from .encoding import base64_encode +from .encoding import want_bytes +from .exc import BadData +from .exc import BadHeader +from .exc import BadPayload +from .exc import BadSignature +from .exc import BadTimeSignature +from .exc import SignatureExpired +from .jws import JSONWebSignatureSerializer +from .jws import TimedJSONWebSignatureSerializer +from .serializer import Serializer +from .signer import HMACAlgorithm +from .signer import NoneAlgorithm +from .signer import Signer +from .timed import TimedSerializer +from .timed import TimestampSigner +from .url_safe import URLSafeSerializer +from .url_safe import URLSafeTimedSerializer + +__version__ = "1.1.0" diff --git a/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..97facb8c Binary files /dev/null and b/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/_compat.cpython-38.pyc b/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/_compat.cpython-38.pyc new file mode 100644 index 00000000..50ac5aa9 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/_compat.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/_json.cpython-38.pyc b/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/_json.cpython-38.pyc new file mode 100644 index 00000000..51127aa5 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/_json.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/encoding.cpython-38.pyc b/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/encoding.cpython-38.pyc new file mode 100644 index 00000000..54ac20fa Binary files /dev/null and b/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/encoding.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/exc.cpython-38.pyc b/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/exc.cpython-38.pyc new file mode 100644 index 00000000..8bdde689 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/exc.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/jws.cpython-38.pyc b/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/jws.cpython-38.pyc new file mode 100644 index 00000000..2cda6265 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/jws.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/serializer.cpython-38.pyc b/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/serializer.cpython-38.pyc new file mode 100644 index 00000000..9f4dca78 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/serializer.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/signer.cpython-38.pyc b/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/signer.cpython-38.pyc new file mode 100644 index 00000000..8dc702e8 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/signer.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/timed.cpython-38.pyc b/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/timed.cpython-38.pyc new file mode 100644 index 00000000..dcd618a4 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/timed.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/url_safe.cpython-38.pyc b/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/url_safe.cpython-38.pyc new file mode 100644 index 00000000..e6a924f9 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/itsdangerous/__pycache__/url_safe.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/itsdangerous/_compat.py b/.venv/lib/python3.8/site-packages/itsdangerous/_compat.py new file mode 100644 index 00000000..2291bce2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/itsdangerous/_compat.py @@ -0,0 +1,46 @@ +import decimal +import hmac +import numbers +import sys + +PY2 = sys.version_info[0] == 2 + +if PY2: + from itertools import izip + + text_type = unicode # noqa: 821 +else: + izip = zip + text_type = str + +number_types = (numbers.Real, decimal.Decimal) + + +def _constant_time_compare(val1, val2): + """Return ``True`` if the two strings are equal, ``False`` + otherwise. + + The time taken is independent of the number of characters that + match. Do not use this function for anything else than comparision + with known length targets. + + This is should be implemented in C in order to get it completely + right. + + This is an alias of :func:`hmac.compare_digest` on Python>=2.7,3.3. + """ + len_eq = len(val1) == len(val2) + if len_eq: + result = 0 + left = val1 + else: + result = 1 + left = val2 + for x, y in izip(bytearray(left), bytearray(val2)): + result |= x ^ y + return result == 0 + + +# Starting with 2.7/3.3 the standard library has a c-implementation for +# constant time string compares. +constant_time_compare = getattr(hmac, "compare_digest", _constant_time_compare) diff --git a/.venv/lib/python3.8/site-packages/itsdangerous/_json.py b/.venv/lib/python3.8/site-packages/itsdangerous/_json.py new file mode 100644 index 00000000..426b36e9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/itsdangerous/_json.py @@ -0,0 +1,18 @@ +try: + import simplejson as json +except ImportError: + import json + + +class _CompactJSON(object): + """Wrapper around json module that strips whitespace.""" + + @staticmethod + def loads(payload): + return json.loads(payload) + + @staticmethod + def dumps(obj, **kwargs): + kwargs.setdefault("ensure_ascii", False) + kwargs.setdefault("separators", (",", ":")) + return json.dumps(obj, **kwargs) diff --git a/.venv/lib/python3.8/site-packages/itsdangerous/encoding.py b/.venv/lib/python3.8/site-packages/itsdangerous/encoding.py new file mode 100644 index 00000000..1e28969d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/itsdangerous/encoding.py @@ -0,0 +1,49 @@ +import base64 +import string +import struct + +from ._compat import text_type +from .exc import BadData + + +def want_bytes(s, encoding="utf-8", errors="strict"): + if isinstance(s, text_type): + s = s.encode(encoding, errors) + return s + + +def base64_encode(string): + """Base64 encode a string of bytes or text. The resulting bytes are + safe to use in URLs. + """ + string = want_bytes(string) + return base64.urlsafe_b64encode(string).rstrip(b"=") + + +def base64_decode(string): + """Base64 decode a URL-safe string of bytes or text. The result is + bytes. + """ + string = want_bytes(string, encoding="ascii", errors="ignore") + string += b"=" * (-len(string) % 4) + + try: + return base64.urlsafe_b64decode(string) + except (TypeError, ValueError): + raise BadData("Invalid base64-encoded data") + + +# The alphabet used by base64.urlsafe_* +_base64_alphabet = (string.ascii_letters + string.digits + "-_=").encode("ascii") + +_int64_struct = struct.Struct(">Q") +_int_to_bytes = _int64_struct.pack +_bytes_to_int = _int64_struct.unpack + + +def int_to_bytes(num): + return _int_to_bytes(num).lstrip(b"\x00") + + +def bytes_to_int(bytestr): + return _bytes_to_int(bytestr.rjust(8, b"\x00"))[0] diff --git a/.venv/lib/python3.8/site-packages/itsdangerous/exc.py b/.venv/lib/python3.8/site-packages/itsdangerous/exc.py new file mode 100644 index 00000000..287d6917 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/itsdangerous/exc.py @@ -0,0 +1,98 @@ +from ._compat import PY2 +from ._compat import text_type + + +class BadData(Exception): + """Raised if bad data of any sort was encountered. This is the base + for all exceptions that itsdangerous defines. + + .. versionadded:: 0.15 + """ + + message = None + + def __init__(self, message): + super(BadData, self).__init__(self, message) + self.message = message + + def __str__(self): + return text_type(self.message) + + if PY2: + __unicode__ = __str__ + + def __str__(self): + return self.__unicode__().encode("utf-8") + + +class BadSignature(BadData): + """Raised if a signature does not match.""" + + def __init__(self, message, payload=None): + BadData.__init__(self, message) + + #: The payload that failed the signature test. In some + #: situations you might still want to inspect this, even if + #: you know it was tampered with. + #: + #: .. versionadded:: 0.14 + self.payload = payload + + +class BadTimeSignature(BadSignature): + """Raised if a time-based signature is invalid. This is a subclass + of :class:`BadSignature`. + """ + + def __init__(self, message, payload=None, date_signed=None): + BadSignature.__init__(self, message, payload) + + #: If the signature expired this exposes the date of when the + #: signature was created. This can be helpful in order to + #: tell the user how long a link has been gone stale. + #: + #: .. versionadded:: 0.14 + self.date_signed = date_signed + + +class SignatureExpired(BadTimeSignature): + """Raised if a signature timestamp is older than ``max_age``. This + is a subclass of :exc:`BadTimeSignature`. + """ + + +class BadHeader(BadSignature): + """Raised if a signed header is invalid in some form. This only + happens for serializers that have a header that goes with the + signature. + + .. versionadded:: 0.24 + """ + + def __init__(self, message, payload=None, header=None, original_error=None): + BadSignature.__init__(self, message, payload) + + #: If the header is actually available but just malformed it + #: might be stored here. + self.header = header + + #: If available, the error that indicates why the payload was + #: not valid. This might be ``None``. + self.original_error = original_error + + +class BadPayload(BadData): + """Raised if a payload is invalid. This could happen if the payload + is loaded despite an invalid signature, or if there is a mismatch + between the serializer and deserializer. The original exception + that occurred during loading is stored on as :attr:`original_error`. + + .. versionadded:: 0.15 + """ + + def __init__(self, message, original_error=None): + BadData.__init__(self, message) + + #: If available, the error that indicates why the payload was + #: not valid. This might be ``None``. + self.original_error = original_error diff --git a/.venv/lib/python3.8/site-packages/itsdangerous/jws.py b/.venv/lib/python3.8/site-packages/itsdangerous/jws.py new file mode 100644 index 00000000..92e9ec8b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/itsdangerous/jws.py @@ -0,0 +1,218 @@ +import hashlib +import time +from datetime import datetime + +from ._compat import number_types +from ._json import _CompactJSON +from ._json import json +from .encoding import base64_decode +from .encoding import base64_encode +from .encoding import want_bytes +from .exc import BadData +from .exc import BadHeader +from .exc import BadPayload +from .exc import BadSignature +from .exc import SignatureExpired +from .serializer import Serializer +from .signer import HMACAlgorithm +from .signer import NoneAlgorithm + + +class JSONWebSignatureSerializer(Serializer): + """This serializer implements JSON Web Signature (JWS) support. Only + supports the JWS Compact Serialization. + """ + + jws_algorithms = { + "HS256": HMACAlgorithm(hashlib.sha256), + "HS384": HMACAlgorithm(hashlib.sha384), + "HS512": HMACAlgorithm(hashlib.sha512), + "none": NoneAlgorithm(), + } + + #: The default algorithm to use for signature generation + default_algorithm = "HS512" + + default_serializer = _CompactJSON + + def __init__( + self, + secret_key, + salt=None, + serializer=None, + serializer_kwargs=None, + signer=None, + signer_kwargs=None, + algorithm_name=None, + ): + Serializer.__init__( + self, + secret_key=secret_key, + salt=salt, + serializer=serializer, + serializer_kwargs=serializer_kwargs, + signer=signer, + signer_kwargs=signer_kwargs, + ) + if algorithm_name is None: + algorithm_name = self.default_algorithm + self.algorithm_name = algorithm_name + self.algorithm = self.make_algorithm(algorithm_name) + + def load_payload(self, payload, serializer=None, return_header=False): + payload = want_bytes(payload) + if b"." not in payload: + raise BadPayload('No "." found in value') + base64d_header, base64d_payload = payload.split(b".", 1) + try: + json_header = base64_decode(base64d_header) + except Exception as e: + raise BadHeader( + "Could not base64 decode the header because of an exception", + original_error=e, + ) + try: + json_payload = base64_decode(base64d_payload) + except Exception as e: + raise BadPayload( + "Could not base64 decode the payload because of an exception", + original_error=e, + ) + try: + header = Serializer.load_payload(self, json_header, serializer=json) + except BadData as e: + raise BadHeader( + "Could not unserialize header because it was malformed", + original_error=e, + ) + if not isinstance(header, dict): + raise BadHeader("Header payload is not a JSON object", header=header) + payload = Serializer.load_payload(self, json_payload, serializer=serializer) + if return_header: + return payload, header + return payload + + def dump_payload(self, header, obj): + base64d_header = base64_encode( + self.serializer.dumps(header, **self.serializer_kwargs) + ) + base64d_payload = base64_encode( + self.serializer.dumps(obj, **self.serializer_kwargs) + ) + return base64d_header + b"." + base64d_payload + + def make_algorithm(self, algorithm_name): + try: + return self.jws_algorithms[algorithm_name] + except KeyError: + raise NotImplementedError("Algorithm not supported") + + def make_signer(self, salt=None, algorithm=None): + if salt is None: + salt = self.salt + key_derivation = "none" if salt is None else None + if algorithm is None: + algorithm = self.algorithm + return self.signer( + self.secret_key, + salt=salt, + sep=".", + key_derivation=key_derivation, + algorithm=algorithm, + ) + + def make_header(self, header_fields): + header = header_fields.copy() if header_fields else {} + header["alg"] = self.algorithm_name + return header + + def dumps(self, obj, salt=None, header_fields=None): + """Like :meth:`.Serializer.dumps` but creates a JSON Web + Signature. It also allows for specifying additional fields to be + included in the JWS header. + """ + header = self.make_header(header_fields) + signer = self.make_signer(salt, self.algorithm) + return signer.sign(self.dump_payload(header, obj)) + + def loads(self, s, salt=None, return_header=False): + """Reverse of :meth:`dumps`. If requested via ``return_header`` + it will return a tuple of payload and header. + """ + payload, header = self.load_payload( + self.make_signer(salt, self.algorithm).unsign(want_bytes(s)), + return_header=True, + ) + if header.get("alg") != self.algorithm_name: + raise BadHeader("Algorithm mismatch", header=header, payload=payload) + if return_header: + return payload, header + return payload + + def loads_unsafe(self, s, salt=None, return_header=False): + kwargs = {"return_header": return_header} + return self._loads_unsafe_impl(s, salt, kwargs, kwargs) + + +class TimedJSONWebSignatureSerializer(JSONWebSignatureSerializer): + """Works like the regular :class:`JSONWebSignatureSerializer` but + also records the time of the signing and can be used to expire + signatures. + + JWS currently does not specify this behavior but it mentions a + possible extension like this in the spec. Expiry date is encoded + into the header similar to what's specified in `draft-ietf-oauth + -json-web-token `_. + """ + + DEFAULT_EXPIRES_IN = 3600 + + def __init__(self, secret_key, expires_in=None, **kwargs): + JSONWebSignatureSerializer.__init__(self, secret_key, **kwargs) + if expires_in is None: + expires_in = self.DEFAULT_EXPIRES_IN + self.expires_in = expires_in + + def make_header(self, header_fields): + header = JSONWebSignatureSerializer.make_header(self, header_fields) + iat = self.now() + exp = iat + self.expires_in + header["iat"] = iat + header["exp"] = exp + return header + + def loads(self, s, salt=None, return_header=False): + payload, header = JSONWebSignatureSerializer.loads( + self, s, salt, return_header=True + ) + + if "exp" not in header: + raise BadSignature("Missing expiry date", payload=payload) + + int_date_error = BadHeader("Expiry date is not an IntDate", payload=payload) + try: + header["exp"] = int(header["exp"]) + except ValueError: + raise int_date_error + if header["exp"] < 0: + raise int_date_error + + if header["exp"] < self.now(): + raise SignatureExpired( + "Signature expired", + payload=payload, + date_signed=self.get_issue_date(header), + ) + + if return_header: + return payload, header + return payload + + def get_issue_date(self, header): + rv = header.get("iat") + if isinstance(rv, number_types): + return datetime.utcfromtimestamp(int(rv)) + + def now(self): + return int(time.time()) diff --git a/.venv/lib/python3.8/site-packages/itsdangerous/serializer.py b/.venv/lib/python3.8/site-packages/itsdangerous/serializer.py new file mode 100644 index 00000000..12c20f46 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/itsdangerous/serializer.py @@ -0,0 +1,233 @@ +import hashlib + +from ._compat import text_type +from ._json import json +from .encoding import want_bytes +from .exc import BadPayload +from .exc import BadSignature +from .signer import Signer + + +def is_text_serializer(serializer): + """Checks whether a serializer generates text or binary.""" + return isinstance(serializer.dumps({}), text_type) + + +class Serializer(object): + """This class provides a serialization interface on top of the + signer. It provides a similar API to json/pickle and other modules + but is structured differently internally. If you want to change the + underlying implementation for parsing and loading you have to + override the :meth:`load_payload` and :meth:`dump_payload` + functions. + + This implementation uses simplejson if available for dumping and + loading and will fall back to the standard library's json module if + it's not available. + + You do not need to subclass this class in order to switch out or + customize the :class:`.Signer`. You can instead pass a different + class to the constructor as well as keyword arguments as a dict that + should be forwarded. + + .. code-block:: python + + s = Serializer(signer_kwargs={'key_derivation': 'hmac'}) + + You may want to upgrade the signing parameters without invalidating + existing signatures that are in use. Fallback signatures can be + given that will be tried if unsigning with the current signer fails. + + Fallback signers can be defined by providing a list of + ``fallback_signers``. Each item can be one of the following: a + signer class (which is instantiated with ``signer_kwargs``, + ``salt``, and ``secret_key``), a tuple + ``(signer_class, signer_kwargs)``, or a dict of ``signer_kwargs``. + + For example, this is a serializer that signs using SHA-512, but will + unsign using either SHA-512 or SHA1: + + .. code-block:: python + + s = Serializer( + signer_kwargs={"digest_method": hashlib.sha512}, + fallback_signers=[{"digest_method": hashlib.sha1}] + ) + + .. versionchanged:: 0.14: + The ``signer`` and ``signer_kwargs`` parameters were added to + the constructor. + + .. versionchanged:: 1.1.0: + Added support for ``fallback_signers`` and configured a default + SHA-512 fallback. This fallback is for users who used the yanked + 1.0.0 release which defaulted to SHA-512. + """ + + #: If a serializer module or class is not passed to the constructor + #: this one is picked up. This currently defaults to :mod:`json`. + default_serializer = json + + #: The default :class:`Signer` class that is being used by this + #: serializer. + #: + #: .. versionadded:: 0.14 + default_signer = Signer + + #: The default fallback signers. + default_fallback_signers = [{"digest_method": hashlib.sha512}] + + def __init__( + self, + secret_key, + salt=b"itsdangerous", + serializer=None, + serializer_kwargs=None, + signer=None, + signer_kwargs=None, + fallback_signers=None, + ): + self.secret_key = want_bytes(secret_key) + self.salt = want_bytes(salt) + if serializer is None: + serializer = self.default_serializer + self.serializer = serializer + self.is_text_serializer = is_text_serializer(serializer) + if signer is None: + signer = self.default_signer + self.signer = signer + self.signer_kwargs = signer_kwargs or {} + if fallback_signers is None: + fallback_signers = list(self.default_fallback_signers or ()) + self.fallback_signers = fallback_signers + self.serializer_kwargs = serializer_kwargs or {} + + def load_payload(self, payload, serializer=None): + """Loads the encoded object. This function raises + :class:`.BadPayload` if the payload is not valid. The + ``serializer`` parameter can be used to override the serializer + stored on the class. The encoded ``payload`` should always be + bytes. + """ + if serializer is None: + serializer = self.serializer + is_text = self.is_text_serializer + else: + is_text = is_text_serializer(serializer) + try: + if is_text: + payload = payload.decode("utf-8") + return serializer.loads(payload) + except Exception as e: + raise BadPayload( + "Could not load the payload because an exception" + " occurred on unserializing the data.", + original_error=e, + ) + + def dump_payload(self, obj): + """Dumps the encoded object. The return value is always bytes. + If the internal serializer returns text, the value will be + encoded as UTF-8. + """ + return want_bytes(self.serializer.dumps(obj, **self.serializer_kwargs)) + + def make_signer(self, salt=None): + """Creates a new instance of the signer to be used. The default + implementation uses the :class:`.Signer` base class. + """ + if salt is None: + salt = self.salt + return self.signer(self.secret_key, salt=salt, **self.signer_kwargs) + + def iter_unsigners(self, salt=None): + """Iterates over all signers to be tried for unsigning. Starts + with the configured signer, then constructs each signer + specified in ``fallback_signers``. + """ + if salt is None: + salt = self.salt + yield self.make_signer(salt) + for fallback in self.fallback_signers: + if type(fallback) is dict: + kwargs = fallback + fallback = self.signer + elif type(fallback) is tuple: + fallback, kwargs = fallback + else: + kwargs = self.signer_kwargs + yield fallback(self.secret_key, salt=salt, **kwargs) + + def dumps(self, obj, salt=None): + """Returns a signed string serialized with the internal + serializer. The return value can be either a byte or unicode + string depending on the format of the internal serializer. + """ + payload = want_bytes(self.dump_payload(obj)) + rv = self.make_signer(salt).sign(payload) + if self.is_text_serializer: + rv = rv.decode("utf-8") + return rv + + def dump(self, obj, f, salt=None): + """Like :meth:`dumps` but dumps into a file. The file handle has + to be compatible with what the internal serializer expects. + """ + f.write(self.dumps(obj, salt)) + + def loads(self, s, salt=None): + """Reverse of :meth:`dumps`. Raises :exc:`.BadSignature` if the + signature validation fails. + """ + s = want_bytes(s) + last_exception = None + for signer in self.iter_unsigners(salt): + try: + return self.load_payload(signer.unsign(s)) + except BadSignature as err: + last_exception = err + raise last_exception + + def load(self, f, salt=None): + """Like :meth:`loads` but loads from a file.""" + return self.loads(f.read(), salt) + + def loads_unsafe(self, s, salt=None): + """Like :meth:`loads` but without verifying the signature. This + is potentially very dangerous to use depending on how your + serializer works. The return value is ``(signature_valid, + payload)`` instead of just the payload. The first item will be a + boolean that indicates if the signature is valid. This function + never fails. + + Use it for debugging only and if you know that your serializer + module is not exploitable (for example, do not use it with a + pickle serializer). + + .. versionadded:: 0.15 + """ + return self._loads_unsafe_impl(s, salt) + + def _loads_unsafe_impl(self, s, salt, load_kwargs=None, load_payload_kwargs=None): + """Low level helper function to implement :meth:`loads_unsafe` + in serializer subclasses. + """ + try: + return True, self.loads(s, salt=salt, **(load_kwargs or {})) + except BadSignature as e: + if e.payload is None: + return False, None + try: + return ( + False, + self.load_payload(e.payload, **(load_payload_kwargs or {})), + ) + except BadPayload: + return False, None + + def load_unsafe(self, f, *args, **kwargs): + """Like :meth:`loads_unsafe` but loads from a file. + + .. versionadded:: 0.15 + """ + return self.loads_unsafe(f.read(), *args, **kwargs) diff --git a/.venv/lib/python3.8/site-packages/itsdangerous/signer.py b/.venv/lib/python3.8/site-packages/itsdangerous/signer.py new file mode 100644 index 00000000..6bddc039 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/itsdangerous/signer.py @@ -0,0 +1,179 @@ +import hashlib +import hmac + +from ._compat import constant_time_compare +from .encoding import _base64_alphabet +from .encoding import base64_decode +from .encoding import base64_encode +from .encoding import want_bytes +from .exc import BadSignature + + +class SigningAlgorithm(object): + """Subclasses must implement :meth:`get_signature` to provide + signature generation functionality. + """ + + def get_signature(self, key, value): + """Returns the signature for the given key and value.""" + raise NotImplementedError() + + def verify_signature(self, key, value, sig): + """Verifies the given signature matches the expected + signature. + """ + return constant_time_compare(sig, self.get_signature(key, value)) + + +class NoneAlgorithm(SigningAlgorithm): + """Provides an algorithm that does not perform any signing and + returns an empty signature. + """ + + def get_signature(self, key, value): + return b"" + + +class HMACAlgorithm(SigningAlgorithm): + """Provides signature generation using HMACs.""" + + #: The digest method to use with the MAC algorithm. This defaults to + #: SHA1, but can be changed to any other function in the hashlib + #: module. + default_digest_method = staticmethod(hashlib.sha1) + + def __init__(self, digest_method=None): + if digest_method is None: + digest_method = self.default_digest_method + self.digest_method = digest_method + + def get_signature(self, key, value): + mac = hmac.new(key, msg=value, digestmod=self.digest_method) + return mac.digest() + + +class Signer(object): + """This class can sign and unsign bytes, validating the signature + provided. + + Salt can be used to namespace the hash, so that a signed string is + only valid for a given namespace. Leaving this at the default value + or re-using a salt value across different parts of your application + where the same signed value in one part can mean something different + in another part is a security risk. + + See :ref:`the-salt` for an example of what the salt is doing and how + you can utilize it. + + .. versionadded:: 0.14 + ``key_derivation`` and ``digest_method`` were added as arguments + to the class constructor. + + .. versionadded:: 0.18 + ``algorithm`` was added as an argument to the class constructor. + """ + + #: The digest method to use for the signer. This defaults to + #: SHA1 but can be changed to any other function in the hashlib + #: module. + #: + #: .. versionadded:: 0.14 + default_digest_method = staticmethod(hashlib.sha1) + + #: Controls how the key is derived. The default is Django-style + #: concatenation. Possible values are ``concat``, ``django-concat`` + #: and ``hmac``. This is used for deriving a key from the secret key + #: with an added salt. + #: + #: .. versionadded:: 0.14 + default_key_derivation = "django-concat" + + def __init__( + self, + secret_key, + salt=None, + sep=".", + key_derivation=None, + digest_method=None, + algorithm=None, + ): + self.secret_key = want_bytes(secret_key) + self.sep = want_bytes(sep) + if self.sep in _base64_alphabet: + raise ValueError( + "The given separator cannot be used because it may be" + " contained in the signature itself. Alphanumeric" + " characters and `-_=` must not be used." + ) + self.salt = "itsdangerous.Signer" if salt is None else salt + if key_derivation is None: + key_derivation = self.default_key_derivation + self.key_derivation = key_derivation + if digest_method is None: + digest_method = self.default_digest_method + self.digest_method = digest_method + if algorithm is None: + algorithm = HMACAlgorithm(self.digest_method) + self.algorithm = algorithm + + def derive_key(self): + """This method is called to derive the key. The default key + derivation choices can be overridden here. Key derivation is not + intended to be used as a security method to make a complex key + out of a short password. Instead you should use large random + secret keys. + """ + salt = want_bytes(self.salt) + if self.key_derivation == "concat": + return self.digest_method(salt + self.secret_key).digest() + elif self.key_derivation == "django-concat": + return self.digest_method(salt + b"signer" + self.secret_key).digest() + elif self.key_derivation == "hmac": + mac = hmac.new(self.secret_key, digestmod=self.digest_method) + mac.update(salt) + return mac.digest() + elif self.key_derivation == "none": + return self.secret_key + else: + raise TypeError("Unknown key derivation method") + + def get_signature(self, value): + """Returns the signature for the given value.""" + value = want_bytes(value) + key = self.derive_key() + sig = self.algorithm.get_signature(key, value) + return base64_encode(sig) + + def sign(self, value): + """Signs the given string.""" + return want_bytes(value) + want_bytes(self.sep) + self.get_signature(value) + + def verify_signature(self, value, sig): + """Verifies the signature for the given value.""" + key = self.derive_key() + try: + sig = base64_decode(sig) + except Exception: + return False + return self.algorithm.verify_signature(key, value, sig) + + def unsign(self, signed_value): + """Unsigns the given string.""" + signed_value = want_bytes(signed_value) + sep = want_bytes(self.sep) + if sep not in signed_value: + raise BadSignature("No %r found in value" % self.sep) + value, sig = signed_value.rsplit(sep, 1) + if self.verify_signature(value, sig): + return value + raise BadSignature("Signature %r does not match" % sig, payload=value) + + def validate(self, signed_value): + """Only validates the given signed value. Returns ``True`` if + the signature exists and is valid. + """ + try: + self.unsign(signed_value) + return True + except BadSignature: + return False diff --git a/.venv/lib/python3.8/site-packages/itsdangerous/timed.py b/.venv/lib/python3.8/site-packages/itsdangerous/timed.py new file mode 100644 index 00000000..4c117e41 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/itsdangerous/timed.py @@ -0,0 +1,147 @@ +import time +from datetime import datetime + +from ._compat import text_type +from .encoding import base64_decode +from .encoding import base64_encode +from .encoding import bytes_to_int +from .encoding import int_to_bytes +from .encoding import want_bytes +from .exc import BadSignature +from .exc import BadTimeSignature +from .exc import SignatureExpired +from .serializer import Serializer +from .signer import Signer + + +class TimestampSigner(Signer): + """Works like the regular :class:`.Signer` but also records the time + of the signing and can be used to expire signatures. The + :meth:`unsign` method can raise :exc:`.SignatureExpired` if the + unsigning failed because the signature is expired. + """ + + def get_timestamp(self): + """Returns the current timestamp. The function must return an + integer. + """ + return int(time.time()) + + def timestamp_to_datetime(self, ts): + """Used to convert the timestamp from :meth:`get_timestamp` into + a datetime object. + """ + return datetime.utcfromtimestamp(ts) + + def sign(self, value): + """Signs the given string and also attaches time information.""" + value = want_bytes(value) + timestamp = base64_encode(int_to_bytes(self.get_timestamp())) + sep = want_bytes(self.sep) + value = value + sep + timestamp + return value + sep + self.get_signature(value) + + def unsign(self, value, max_age=None, return_timestamp=False): + """Works like the regular :meth:`.Signer.unsign` but can also + validate the time. See the base docstring of the class for + the general behavior. If ``return_timestamp`` is ``True`` the + timestamp of the signature will be returned as a naive + :class:`datetime.datetime` object in UTC. + """ + try: + result = Signer.unsign(self, value) + sig_error = None + except BadSignature as e: + sig_error = e + result = e.payload or b"" + sep = want_bytes(self.sep) + + # If there is no timestamp in the result there is something + # seriously wrong. In case there was a signature error, we raise + # that one directly, otherwise we have a weird situation in + # which we shouldn't have come except someone uses a time-based + # serializer on non-timestamp data, so catch that. + if sep not in result: + if sig_error: + raise sig_error + raise BadTimeSignature("timestamp missing", payload=result) + + value, timestamp = result.rsplit(sep, 1) + try: + timestamp = bytes_to_int(base64_decode(timestamp)) + except Exception: + timestamp = None + + # Signature is *not* okay. Raise a proper error now that we have + # split the value and the timestamp. + if sig_error is not None: + raise BadTimeSignature( + text_type(sig_error), payload=value, date_signed=timestamp + ) + + # Signature was okay but the timestamp is actually not there or + # malformed. Should not happen, but we handle it anyway. + if timestamp is None: + raise BadTimeSignature("Malformed timestamp", payload=value) + + # Check timestamp is not older than max_age + if max_age is not None: + age = self.get_timestamp() - timestamp + if age > max_age: + raise SignatureExpired( + "Signature age %s > %s seconds" % (age, max_age), + payload=value, + date_signed=self.timestamp_to_datetime(timestamp), + ) + + if return_timestamp: + return value, self.timestamp_to_datetime(timestamp) + return value + + def validate(self, signed_value, max_age=None): + """Only validates the given signed value. Returns ``True`` if + the signature exists and is valid.""" + try: + self.unsign(signed_value, max_age=max_age) + return True + except BadSignature: + return False + + +class TimedSerializer(Serializer): + """Uses :class:`TimestampSigner` instead of the default + :class:`.Signer`. + """ + + default_signer = TimestampSigner + + def loads(self, s, max_age=None, return_timestamp=False, salt=None): + """Reverse of :meth:`dumps`, raises :exc:`.BadSignature` if the + signature validation fails. If a ``max_age`` is provided it will + ensure the signature is not older than that time in seconds. In + case the signature is outdated, :exc:`.SignatureExpired` is + raised. All arguments are forwarded to the signer's + :meth:`~TimestampSigner.unsign` method. + """ + s = want_bytes(s) + last_exception = None + for signer in self.iter_unsigners(salt): + try: + base64d, timestamp = signer.unsign(s, max_age, return_timestamp=True) + payload = self.load_payload(base64d) + if return_timestamp: + return payload, timestamp + return payload + # If we get a signature expired it means we could read the + # signature but it's invalid. In that case we do not want to + # try the next signer. + except SignatureExpired: + raise + except BadSignature as err: + last_exception = err + raise last_exception + + def loads_unsafe(self, s, max_age=None, salt=None): + load_kwargs = {"max_age": max_age} + load_payload_kwargs = {} + return self._loads_unsafe_impl(s, salt, load_kwargs, load_payload_kwargs) diff --git a/.venv/lib/python3.8/site-packages/itsdangerous/url_safe.py b/.venv/lib/python3.8/site-packages/itsdangerous/url_safe.py new file mode 100644 index 00000000..fcaa0112 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/itsdangerous/url_safe.py @@ -0,0 +1,65 @@ +import zlib + +from ._json import _CompactJSON +from .encoding import base64_decode +from .encoding import base64_encode +from .exc import BadPayload +from .serializer import Serializer +from .timed import TimedSerializer + + +class URLSafeSerializerMixin(object): + """Mixed in with a regular serializer it will attempt to zlib + compress the string to make it shorter if necessary. It will also + base64 encode the string so that it can safely be placed in a URL. + """ + + default_serializer = _CompactJSON + + def load_payload(self, payload, *args, **kwargs): + decompress = False + if payload.startswith(b"."): + payload = payload[1:] + decompress = True + try: + json = base64_decode(payload) + except Exception as e: + raise BadPayload( + "Could not base64 decode the payload because of an exception", + original_error=e, + ) + if decompress: + try: + json = zlib.decompress(json) + except Exception as e: + raise BadPayload( + "Could not zlib decompress the payload before decoding the payload", + original_error=e, + ) + return super(URLSafeSerializerMixin, self).load_payload(json, *args, **kwargs) + + def dump_payload(self, obj): + json = super(URLSafeSerializerMixin, self).dump_payload(obj) + is_compressed = False + compressed = zlib.compress(json) + if len(compressed) < (len(json) - 1): + json = compressed + is_compressed = True + base64d = base64_encode(json) + if is_compressed: + base64d = b"." + base64d + return base64d + + +class URLSafeSerializer(URLSafeSerializerMixin, Serializer): + """Works like :class:`.Serializer` but dumps and loads into a URL + safe string consisting of the upper and lowercase character of the + alphabet as well as ``'_'``, ``'-'`` and ``'.'``. + """ + + +class URLSafeTimedSerializer(URLSafeSerializerMixin, TimedSerializer): + """Works like :class:`.TimedSerializer` but dumps and loads into a + URL safe string consisting of the upper and lowercase character of + the alphabet as well as ``'_'``, ``'-'`` and ``'.'``. + """ diff --git a/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/AUTHORS.txt b/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/AUTHORS.txt new file mode 100644 index 00000000..6e881b7e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/AUTHORS.txt @@ -0,0 +1,66 @@ +Main Authors +------------ + +- David Halter (@davidhalter) +- Takafumi Arakaki (@tkf) + +Code Contributors +----------------- + +- Danilo Bargen (@dbrgn) +- Laurens Van Houtven (@lvh) <_@lvh.cc> +- Aldo Stracquadanio (@Astrac) +- Jean-Louis Fuchs (@ganwell) +- tek (@tek) +- Yasha Borevich (@jjay) +- Aaron Griffin +- andviro (@andviro) +- Mike Gilbert (@floppym) +- Aaron Meurer (@asmeurer) +- Lubos Trilety +- Akinori Hattori (@hattya) +- srusskih (@srusskih) +- Steven Silvester (@blink1073) +- Colin Duquesnoy (@ColinDuquesnoy) +- Jorgen Schaefer (@jorgenschaefer) +- Fredrik Bergroth (@fbergroth) +- Mathias Fußenegger (@mfussenegger) +- Syohei Yoshida (@syohex) +- ppalucky (@ppalucky) +- immerrr (@immerrr) immerrr@gmail.com +- Albertas Agejevas (@alga) +- Savor d'Isavano (@KenetJervet) +- Phillip Berndt (@phillipberndt) +- Ian Lee (@IanLee1521) +- Farkhad Khatamov (@hatamov) +- Kevin Kelley (@kelleyk) +- Sid Shanker (@squidarth) +- Reinoud Elhorst (@reinhrst) +- Guido van Rossum (@gvanrossum) +- Dmytro Sadovnychyi (@sadovnychyi) +- Cristi Burcă (@scribu) +- bstaint (@bstaint) +- Mathias Rav (@Mortal) +- Daniel Fiterman (@dfit99) +- Simon Ruggier (@sruggier) +- Élie Gouzien (@ElieGouzien) +- Robin Roth (@robinro) +- Malte Plath (@langsamer) +- Anton Zub (@zabulazza) +- Maksim Novikov (@m-novikov) +- Tobias Rzepka (@TobiasRzepka) +- micbou (@micbou) +- Dima Gerasimov (@karlicoss) +- Max Woerner Chase (@mwchase) +- Johannes Maria Frank (@jmfrank63) +- Shane Steinert-Threlkeld (@shanest) +- Tim Gates (@timgates42) +- Lior Goldberg (@goldberglior) +- Ryan Clary (@mrclary) +- Max Mäusezahl (@mmaeusezahl) +- Vladislav Serebrennikov (@endilll) +- Andrii Kolomoiets (@muffinmad) + +And a few more "anonymous" contributors. + +Note: (@user) means a github user name. diff --git a/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/INSTALLER b/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/LICENSE.txt b/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/LICENSE.txt new file mode 100644 index 00000000..94f95456 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/LICENSE.txt @@ -0,0 +1,24 @@ +All contributions towards Jedi are MIT licensed. + +------------------------------------------------------------------------------- +The MIT License (MIT) + +Copyright (c) <2013> + +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +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. diff --git a/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/METADATA b/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/METADATA new file mode 100644 index 00000000..c89cbfee --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/METADATA @@ -0,0 +1,521 @@ +Metadata-Version: 2.1 +Name: jedi +Version: 0.17.1 +Summary: An autocompletion tool for Python that can be used for text editors. +Home-page: https://github.com/davidhalter/jedi +Author: David Halter +Author-email: davidhalter88@gmail.com +Maintainer: David Halter +Maintainer-email: davidhalter88@gmail.com +License: MIT +Keywords: python completion refactoring vim +Platform: any +Classifier: Development Status :: 4 - Beta +Classifier: Environment :: Plugins +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: Text Editors :: Integrated Development Environments (IDE) +Classifier: Topic :: Utilities +Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.* +Requires-Dist: parso (<0.8.0,>=0.7.0) +Provides-Extra: qa +Requires-Dist: flake8 (==3.7.9) ; extra == 'qa' +Provides-Extra: testing +Requires-Dist: Django (<3.1) ; extra == 'testing' +Requires-Dist: colorama ; extra == 'testing' +Requires-Dist: docopt ; extra == 'testing' +Requires-Dist: pytest (<5.0.0,>=3.9.0) ; extra == 'testing' + +#################################################################################### +Jedi - an awesome autocompletion, static analysis and refactoring library for Python +#################################################################################### + +.. image:: http://isitmaintained.com/badge/open/davidhalter/jedi.svg + :target: https://github.com/davidhalter/jedi/issues + :alt: The percentage of open issues and pull requests + +.. image:: http://isitmaintained.com/badge/resolution/davidhalter/jedi.svg + :target: https://github.com/davidhalter/jedi/issues + :alt: The resolution time is the median time an issue or pull request stays open. + +.. image:: https://travis-ci.org/davidhalter/jedi.svg?branch=master + :target: https://travis-ci.org/davidhalter/jedi + :alt: Linux Tests + +.. image:: https://ci.appveyor.com/api/projects/status/mgva3bbawyma1new/branch/master?svg=true + :target: https://ci.appveyor.com/project/davidhalter/jedi/branch/master + :alt: Windows Tests + +.. image:: https://coveralls.io/repos/davidhalter/jedi/badge.svg?branch=master + :target: https://coveralls.io/r/davidhalter/jedi + :alt: Coverage status + + +Jedi is a static analysis tool for Python that is typically used in +IDEs/editors plugins. Jedi has a focus on autocompletion and goto +functionality. Other features include refactoring, code search and finding +references. + +Jedi has a simple API to work with. There is a reference implementation as a +`VIM-Plugin `_. Autocompletion in your +REPL is also possible, IPython uses it natively and for the CPython REPL you +can install it. Jedi is well tested and bugs should be rare. + +Jedi can currently be used with the following editors/projects: + +- Vim (jedi-vim_, YouCompleteMe_, deoplete-jedi_, completor.vim_) +- `Visual Studio Code`_ (via `Python Extension `_) +- Emacs (Jedi.el_, company-mode_, elpy_, anaconda-mode_, ycmd_) +- Sublime Text (SublimeJEDI_ [ST2 + ST3], anaconda_ [only ST3]) +- TextMate_ (Not sure if it's actually working) +- Kate_ version 4.13+ supports it natively, you have to enable it, though. [`see + `_] +- Atom_ (autocomplete-python-jedi_) +- `GNOME Builder`_ (with support for GObject Introspection) +- Gedit (gedi_) +- wdb_ - Web Debugger +- `Eric IDE`_ (Available as a plugin) +- `IPython 6.0.0+ `_ + +and many more! + +Here are some pictures taken from jedi-vim_: + +.. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_complete.png + +Completion for almost anything: + +.. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_function.png + +Documentation: + +.. image:: https://github.com/davidhalter/jedi/raw/master/docs/_screenshots/screenshot_pydoc.png + + +Get the latest version from `github `_ +(master branch should always be kind of stable/working). + +Docs are available at `https://jedi.readthedocs.org/en/latest/ +`_. Pull requests with enhancements +and/or fixes are awesome and most welcome. Jedi uses `semantic versioning +`_. + +If you want to stay up-to-date (News / RFCs), please subscribe to this `github +thread `_.: + +Issues & Questions +================== + +You can file issues and questions in the `issue tracker +`. Alternatively you can also ask on +`Stack Overflow `_ with +the label ``python-jedi``. + +Installation +============ + +`Check out the docs `_. + +Features and Limitations +======================== + +Jedi's features are listed here: +`Features `_. + +You can run Jedi on CPython 2.7 or 3.5+ but it should also +understand code that is older than those versions. Additionally you should be +able to use `Virtualenvs `_ +very well. + +Tips on how to use Jedi efficiently can be found `here +`_. + +API +--- + +You can find a comprehensive documentation for the +`API here `_. + +Autocompletion / Goto / Documentation +------------------------------------- + +There are the following commands: + +- ``jedi.Script.goto`` +- ``jedi.Script.infer`` +- ``jedi.Script.help`` +- ``jedi.Script.complete`` +- ``jedi.Script.get_references`` +- ``jedi.Script.get_signatures`` +- ``jedi.Script.get_context`` + +The returned objects are very powerful and are really all you might need. + +Autocompletion in your REPL (IPython, etc.) +------------------------------------------- + +Jedi is a dependency of IPython. Autocompletion in IPython with Jedi is +therefore possible without additional configuration. + +Here is an `example video `_ how REPL completion +can look like. +For the ``python`` shell you can enable tab completion in a `REPL +`_. + +Static Analysis +--------------- + +For a lot of forms of static analysis, you can try to use +``jedi.Script(...).get_names``. It will return a list of names that you can +then filter and work with. There is also a way to list the syntax errors in a +file: ``jedi.Script.get_syntax_errors``. + + +Refactoring +----------- + +Jedi supports the following refactorings: + +- ``jedi.Script.inline`` +- ``jedi.Script.rename`` +- ``jedi.Script.extract_function`` +- ``jedi.Script.extract_variable`` + +Code Search +----------- + +There is support for module search with ``jedi.Script.search``, and project +search for ``jedi.Project.search``. The way to search is either by providing a +name like ``foo`` or by using dotted syntax like ``foo.bar``. Additionally you +can provide the API type like ``class foo.bar.Bar``. There are also the +functions ``jedi.Script.complete_search`` and ``jedi.Project.complete_search``. + +Development +=========== + +There's a pretty good and extensive `development documentation +`_. + +Testing +======= + +The test suite uses ``pytest``:: + + pip install pytest + +If you want to test only a specific Python version (e.g. Python 3.8), it is as +easy as:: + + python3.8 -m pytest + +For more detailed information visit the `testing documentation +`_. + +Acknowledgements +================ + +Thanks a lot to all the +`contributors `_! + + +.. _jedi-vim: https://github.com/davidhalter/jedi-vim +.. _youcompleteme: https://github.com/ycm-core/YouCompleteMe +.. _deoplete-jedi: https://github.com/zchee/deoplete-jedi +.. _completor.vim: https://github.com/maralla/completor.vim +.. _Jedi.el: https://github.com/tkf/emacs-jedi +.. _company-mode: https://github.com/syohex/emacs-company-jedi +.. _elpy: https://github.com/jorgenschaefer/elpy +.. _anaconda-mode: https://github.com/proofit404/anaconda-mode +.. _ycmd: https://github.com/abingham/emacs-ycmd +.. _sublimejedi: https://github.com/srusskih/SublimeJEDI +.. _anaconda: https://github.com/DamnWidget/anaconda +.. _wdb: https://github.com/Kozea/wdb +.. _TextMate: https://github.com/lawrenceakka/python-jedi.tmbundle +.. _Kate: https://kate-editor.org +.. _Atom: https://atom.io/ +.. _autocomplete-python-jedi: https://atom.io/packages/autocomplete-python-jedi +.. _GNOME Builder: https://wiki.gnome.org/Apps/Builder +.. _Visual Studio Code: https://code.visualstudio.com/ +.. _gedi: https://github.com/isamert/gedi +.. _Eric IDE: https://eric-ide.python-projects.org + + +.. :changelog: + +Changelog +--------- + +Unreleased +++++++++++ + +0.17.1 (2020-06-20) ++++++++++++++++++++ + +- Django ``Model`` meta class support +- Django Manager support (completion on Managers/QuerySets) +- Added Django Stubs to Jedi, thanks to all contributors of the + `Django Stubs `_ project +- Added ``SyntaxError.get_message`` +- Python 3.9 support +- Bugfixes (mostly towards Generics) + +0.17.0 (2020-04-14) ++++++++++++++++++++ + +- Added ``Project`` support. This allows a user to specify which folders Jedi + should work with. +- Added support for Refactoring. The following refactorings have been + implemented: ``Script.rename``, ``Script.inline``, + ``Script.extract_variable`` and ``Script.extract_function``. +- Added ``Script.get_syntax_errors`` to display syntax errors in the current + script. +- Added code search capabilities both for individual files and projects. The + new functions are ``Project.search``, ``Project.complete_search``, + ``Script.search`` and ``Script.complete_search``. +- Added ``Script.help`` to make it easier to display a help window to people. + Now returns pydoc information as well for Python keywords/operators. This + means that on the class keyword it will now return the docstring of Python's + builtin function ``help('class')``. +- The API documentation is now way more readable and complete. Check it out + under https://jedi.readthedocs.io. A lot of it has been rewritten. +- Removed Python 3.4 support +- Many bugfixes + +This is likely going to be the last minor version that supports Python 2 and +Python3.5. Bugfixes will be provided in 0.17.1+. The next minor/major version +will probably be Jedi 1.0.0. + +0.16.0 (2020-01-26) ++++++++++++++++++++ + +- **Added** ``Script.get_context`` to get information where you currently are. +- Completions/type inference of **Pytest fixtures**. +- Tensorflow, Numpy and Pandas completions should now be about **4-10x faster** + after the first time they are used. +- Dict key completions are working now. e.g. ``d = {1000: 3}; d[10`` will + expand to ``1000``. +- Completion for "proxies" works now. These are classes that have a + ``__getattr__(self, name)`` method that does a ``return getattr(x, name)``. + after loading them initially. +- Goto on a function/attribute in a class now goes to the definition in its + super class. +- Big **Script API Changes**: + - The line and column parameters of ``jedi.Script`` are now deprecated + - ``completions`` deprecated, use ``complete`` instead + - ``goto_assignments`` deprecated, use ``goto`` instead + - ``goto_definitions`` deprecated, use ``infer`` instead + - ``call_signatures`` deprecated, use ``get_signatures`` instead + - ``usages`` deprecated, use ``get_references`` instead + - ``jedi.names`` deprecated, use ``jedi.Script(...).get_names()`` +- ``BaseName.goto_assignments`` renamed to ``BaseName.goto`` +- Add follow_imports to ``Name.goto``. Now its signature matches + ``Script.goto``. +- **Python 2 support deprecated**. For this release it is best effort. Python 2 + has reached the end of its life and now it's just about a smooth transition. + Bugs for Python 2 will not be fixed anymore and a third of the tests are + already skipped. +- Removed ``settings.no_completion_duplicates``. It wasn't tested and nobody + was probably using it anyway. +- Removed ``settings.use_filesystem_cache`` and + ``settings.additional_dynamic_modules``, they have no usage anymore. Pretty + much nobody was probably using them. + +0.15.2 (2019-12-20) ++++++++++++++++++++ + +- Signatures are now detected a lot better +- Add fuzzy completions with ``Script(...).completions(fuzzy=True)`` +- Files bigger than one MB (about 20kLOC) get cropped to avoid getting + stuck completely. +- Many small Bugfixes +- A big refactoring around contexts/values + +0.15.1 (2019-08-13) ++++++++++++++++++++ + +- Small bugfix and removal of a print statement + +0.15.0 (2019-08-11) ++++++++++++++++++++ + +- Added file path completions, there's a **new** ``Completion.type`` now: + ``path``. Example: ``'/ho`` -> ``'/home/`` +- ``*args``/``**kwargs`` resolving. If possible Jedi replaces the parameters + with the actual alternatives. +- Better support for enums/dataclasses +- When using Interpreter, properties are now executed, since a lot of people + have complained about this. Discussion in #1299, #1347. + +New APIs: + +- ``Name.get_signatures() -> List[Signature]``. Signatures are similar to + ``CallSignature``. ``Name.params`` is therefore deprecated. +- ``Signature.to_string()`` to format signatures. +- ``Signature.params -> List[ParamName]``, ParamName has the + following additional attributes ``infer_default()``, ``infer_annotation()``, + ``to_string()``, and ``kind``. +- ``Name.execute() -> List[Name]``, makes it possible to infer + return values of functions. + + +0.14.1 (2019-07-13) ++++++++++++++++++++ + +- CallSignature.index should now be working a lot better +- A couple of smaller bugfixes + +0.14.0 (2019-06-20) ++++++++++++++++++++ + +- Added ``goto_*(prefer_stubs=True)`` as well as ``goto_*(prefer_stubs=True)`` +- Stubs are used now for type inference +- Typeshed is used for better type inference +- Reworked Name.full_name, should have more correct return values + +0.13.3 (2019-02-24) ++++++++++++++++++++ + +- Fixed an issue with embedded Python, see https://github.com/davidhalter/jedi-vim/issues/870 + +0.13.2 (2018-12-15) ++++++++++++++++++++ + +- Fixed a bug that led to Jedi spawning a lot of subprocesses. + +0.13.1 (2018-10-02) ++++++++++++++++++++ + +- Bugfixes, because tensorflow completions were still slow. + +0.13.0 (2018-10-02) ++++++++++++++++++++ + +- A small release. Some bug fixes. +- Remove Python 3.3 support. Python 3.3 support has been dropped by the Python + foundation. +- Default environments are now using the same Python version as the Python + process. In 0.12.x, we used to load the latest Python version on the system. +- Added ``include_builtins`` as a parameter to usages. +- ``goto_assignments`` has a new ``follow_builtin_imports`` parameter that + changes the previous behavior slightly. + +0.12.1 (2018-06-30) ++++++++++++++++++++ + +- This release forces you to upgrade parso. If you don't, nothing will work + anymore. Otherwise changes should be limited to bug fixes. Unfortunately Jedi + still uses a few internals of parso that make it hard to keep compatibility + over multiple releases. Parso >=0.3.0 is going to be needed. + +0.12.0 (2018-04-15) ++++++++++++++++++++ + +- Virtualenv/Environment support +- F-String Completion/Goto Support +- Cannot crash with segfaults anymore +- Cleaned up import logic +- Understand async/await and autocomplete it (including async generators) +- Better namespace completions +- Passing tests for Windows (including CI for Windows) +- Remove Python 2.6 support + +0.11.1 (2017-12-14) ++++++++++++++++++++ + +- Parso update - the caching layer was broken +- Better usages - a lot of internal code was ripped out and improved. + +0.11.0 (2017-09-20) ++++++++++++++++++++ + +- Split Jedi's parser into a separate project called ``parso``. +- Avoiding side effects in REPL completion. +- Numpy docstring support should be much better. +- Moved the `settings.*recursion*` away, they are no longer usable. + +0.10.2 (2017-04-05) ++++++++++++++++++++ + +- Python Packaging sucks. Some files were not included in 0.10.1. + +0.10.1 (2017-04-05) ++++++++++++++++++++ + +- Fixed a few very annoying bugs. +- Prepared the parser to be factored out of Jedi. + +0.10.0 (2017-02-03) ++++++++++++++++++++ + +- Actual semantic completions for the complete Python syntax. +- Basic type inference for ``yield from`` PEP 380. +- PEP 484 support (most of the important features of it). Thanks Claude! (@reinhrst) +- Added ``get_line_code`` to ``Name`` and ``Completion`` objects. +- Completely rewritten the type inference engine. +- A new and better parser for (fast) parsing diffs of Python code. + +0.9.0 (2015-04-10) +++++++++++++++++++ + +- The import logic has been rewritten to look more like Python's. There is now + an ``InferState.modules`` import cache, which resembles ``sys.modules``. +- Integrated the parser of 2to3. This will make refactoring possible. It will + also be possible to check for error messages (like compiling an AST would give) + in the future. +- With the new parser, the type inference also completely changed. It's now + simpler and more readable. +- Completely rewritten REPL completion. +- Added ``jedi.names``, a command to do static analysis. Thanks to that + sourcegraph guys for sponsoring this! +- Alpha version of the linter. + + +0.8.1 (2014-07-23) ++++++++++++++++++++ + +- Bugfix release, the last release forgot to include files that improve + autocompletion for builtin libraries. Fixed. + +0.8.0 (2014-05-05) ++++++++++++++++++++ + +- Memory Consumption for compiled modules (e.g. builtins, sys) has been reduced + drastically. Loading times are down as well (it takes basically as long as an + import). +- REPL completion is starting to become usable. +- Various small API changes. Generally this release focuses on stability and + refactoring of internal APIs. +- Introducing operator precedence, which makes calculating correct Array + indices and ``__getattr__`` strings possible. + +0.7.0 (2013-08-09) +++++++++++++++++++ + +- Switched from LGPL to MIT license. +- Added an Interpreter class to the API to make autocompletion in REPL + possible. +- Added autocompletion support for namespace packages. +- Add sith.py, a new random testing method. + +0.6.0 (2013-05-14) +++++++++++++++++++ + +- Much faster parser with builtin part caching. +- A test suite, thanks @tkf. + +0.5 versions (2012) ++++++++++++++++++++ + +- Initial development. + + diff --git a/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/RECORD b/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/RECORD new file mode 100644 index 00000000..08774231 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/RECORD @@ -0,0 +1,1763 @@ +jedi-0.17.1.dist-info/AUTHORS.txt,sha256=RIlIHU58hsRJ1FklSHBrztlqG0S9INJlLH3A24qMIL8,2423 +jedi-0.17.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +jedi-0.17.1.dist-info/LICENSE.txt,sha256=eOYM0LjyhpTzAZVILDPXaQjYRrDRUnjetzMqoiuo5BI,1241 +jedi-0.17.1.dist-info/METADATA,sha256=U9aYXu8phNC-5eRiuiXNJwbYGd5zNV_zwhHG-WlEbnU,19090 +jedi-0.17.1.dist-info/RECORD,, +jedi-0.17.1.dist-info/WHEEL,sha256=kGT74LWyRUZrL4VgLh6_g12IeVl_9u9ZVhadrgXZUEY,110 +jedi-0.17.1.dist-info/top_level.txt,sha256=SqNj9U77yOn5Zf4Ji6CqL8-D2eNg_F71GHo8V8SMV04,5 +jedi/__init__.py,sha256=deRSVY5sLSMGrqBagzledvumJgSX4lGKso_bayFKm2E,1499 +jedi/__main__.py,sha256=SONRAB5KoCcU3DRfUZhWWFG8n_fs7Rls-bzzM4VWqD0,1950 +jedi/__pycache__/__init__.cpython-38.pyc,, +jedi/__pycache__/__main__.cpython-38.pyc,, +jedi/__pycache__/_compatibility.cpython-38.pyc,, +jedi/__pycache__/cache.cpython-38.pyc,, +jedi/__pycache__/common.cpython-38.pyc,, +jedi/__pycache__/debug.cpython-38.pyc,, +jedi/__pycache__/file_io.cpython-38.pyc,, +jedi/__pycache__/parser_utils.cpython-38.pyc,, +jedi/__pycache__/settings.cpython-38.pyc,, +jedi/__pycache__/utils.cpython-38.pyc,, +jedi/_compatibility.py,sha256=U56Q9eDEmoxAqh7skVZsNfwmAZRgTU4DTjpSyxxYzKs,20255 +jedi/api/__init__.py,sha256=nVRROfcAA3f5ZMxBSpDG-HhtANdS1TMTrswYGHoJZE8,36526 +jedi/api/__pycache__/__init__.cpython-38.pyc,, +jedi/api/__pycache__/classes.cpython-38.pyc,, +jedi/api/__pycache__/completion.cpython-38.pyc,, +jedi/api/__pycache__/completion_cache.cpython-38.pyc,, +jedi/api/__pycache__/environment.cpython-38.pyc,, +jedi/api/__pycache__/errors.cpython-38.pyc,, +jedi/api/__pycache__/exceptions.cpython-38.pyc,, +jedi/api/__pycache__/file_name.cpython-38.pyc,, +jedi/api/__pycache__/helpers.cpython-38.pyc,, +jedi/api/__pycache__/interpreter.cpython-38.pyc,, +jedi/api/__pycache__/keywords.cpython-38.pyc,, +jedi/api/__pycache__/project.cpython-38.pyc,, +jedi/api/__pycache__/replstartup.cpython-38.pyc,, +jedi/api/__pycache__/strings.cpython-38.pyc,, +jedi/api/classes.py,sha256=ZdxTy3E-P15pLRZExMFCGgGsqsERuGDkuVGQ0SMf_yM,31086 +jedi/api/completion.py,sha256=LnWT2B6o_0De9zv6hm7ByAPv86J6nX4b7C55NTqiuks,27094 +jedi/api/completion_cache.py,sha256=2HoAzVJzeLzWjLcABmo9DhPVqElm1gbBeU3LRYDlXBg,668 +jedi/api/environment.py,sha256=LLAQzblteJoeioYKMFRNAVywO3OJnYhpiJeL73JyzZY,17305 +jedi/api/errors.py,sha256=kNo99M9006tbRR0hQtRU-4FtRCrNeAf0niT7Szk8Kzs,1261 +jedi/api/exceptions.py,sha256=mJ4eBaYkHh5QB5CZ_D4BkCrQp6l2Put7-dIEUZu8wTU,991 +jedi/api/file_name.py,sha256=5b-jKxAaiA0dBUIssNtWhq0QRB_4NAtafe1gRTxwzv8,5708 +jedi/api/helpers.py,sha256=nkj9X0j8Jk6liwNryNWuhIDU6RJHD7t7tY0WH2PFfHY,19029 +jedi/api/interpreter.py,sha256=M1oOxFSSpphqnqoz3s7vU9TyGlarw2nszL9h3GaqlnM,1357 +jedi/api/keywords.py,sha256=XXVKZDbDtv0DO0eRHaOflXwRUgpe5RO3Jp7JshiIbEU,1408 +jedi/api/project.py,sha256=xYPox2RwC0xAZAJGIgq-biXDf0RodFrs2zJBRYI-StE,16252 +jedi/api/refactoring/__init__.py,sha256=48HSVduaKe305DkaL6BTEnxVEYPwPPdb9aoLQKUKhs4,8854 +jedi/api/refactoring/__pycache__/__init__.cpython-38.pyc,, +jedi/api/refactoring/__pycache__/extract.cpython-38.pyc,, +jedi/api/refactoring/extract.py,sha256=DcfzWyCJ35s4BBmVHcO9dIYgJFrgWer2QjavK68yQuo,13971 +jedi/api/replstartup.py,sha256=bfD7c2sreu4v0e6eoITq0-WBtet9malU8lJWSLEOzuA,950 +jedi/api/strings.py,sha256=tO8EVBwK32yb7tISxz7gezLvAwNWe_LGHgpyrt_t5VM,3661 +jedi/cache.py,sha256=x8qrORAyFUvbPKfPncn_sCPlyU7hzr203VXrOykc5sg,3581 +jedi/common.py,sha256=9jjpAAAS1GWKNHTYi0MFadcgY4LA2YNvKLVb2DKrI_o,925 +jedi/debug.py,sha256=DzVQZmNu-FYR_z4h9mHFd1tPdi8_zVdO5K6cQpUWTM8,3724 +jedi/file_io.py,sha256=xnxb08pAOz5k_SW6CcLkThHBltg7bOYW26v1tPZGFoQ,2374 +jedi/inference/__init__.py,sha256=qJZ1u4Qec_9y0nOf621brkjgWmL_rcEVlV0p-7Vsk0g,8335 +jedi/inference/__pycache__/__init__.cpython-38.pyc,, +jedi/inference/__pycache__/analysis.cpython-38.pyc,, +jedi/inference/__pycache__/arguments.cpython-38.pyc,, +jedi/inference/__pycache__/base_value.cpython-38.pyc,, +jedi/inference/__pycache__/cache.cpython-38.pyc,, +jedi/inference/__pycache__/context.cpython-38.pyc,, +jedi/inference/__pycache__/docstrings.cpython-38.pyc,, +jedi/inference/__pycache__/dynamic_params.cpython-38.pyc,, +jedi/inference/__pycache__/filters.cpython-38.pyc,, +jedi/inference/__pycache__/finder.cpython-38.pyc,, +jedi/inference/__pycache__/flow_analysis.cpython-38.pyc,, +jedi/inference/__pycache__/helpers.cpython-38.pyc,, +jedi/inference/__pycache__/imports.cpython-38.pyc,, +jedi/inference/__pycache__/lazy_value.cpython-38.pyc,, +jedi/inference/__pycache__/names.cpython-38.pyc,, +jedi/inference/__pycache__/param.cpython-38.pyc,, +jedi/inference/__pycache__/parser_cache.cpython-38.pyc,, +jedi/inference/__pycache__/recursion.cpython-38.pyc,, +jedi/inference/__pycache__/references.cpython-38.pyc,, +jedi/inference/__pycache__/signature.cpython-38.pyc,, +jedi/inference/__pycache__/star_args.cpython-38.pyc,, +jedi/inference/__pycache__/syntax_tree.cpython-38.pyc,, +jedi/inference/__pycache__/sys_path.cpython-38.pyc,, +jedi/inference/__pycache__/utils.cpython-38.pyc,, +jedi/inference/analysis.py,sha256=Z29-f1dvykN6Ad2J1X4Z7Sm8Qh-6S2RscV0HHo1wADs,7894 +jedi/inference/arguments.py,sha256=ZKH0ExO-GCK102KVv9cgFjjB41twj7xNCaZoqxl-cWQ,12637 +jedi/inference/base_value.py,sha256=sKQ_3fOb5kRI-2b_t_lwk-F487ryd_4Bnz3yO4tbHAs,18278 +jedi/inference/cache.py,sha256=8AcW-bkKcAVCU6hegt1wvzQp3K5UoRTVbiOqXaWqerg,4212 +jedi/inference/compiled/__init__.py,sha256=392UHMw7zvIEYcYsXmea8lkax0L20vWCzMGhHhnYO4I,2590 +jedi/inference/compiled/__pycache__/__init__.cpython-38.pyc,, +jedi/inference/compiled/__pycache__/access.cpython-38.pyc,, +jedi/inference/compiled/__pycache__/getattr_static.cpython-38.pyc,, +jedi/inference/compiled/__pycache__/mixed.cpython-38.pyc,, +jedi/inference/compiled/__pycache__/value.cpython-38.pyc,, +jedi/inference/compiled/access.py,sha256=luaG2hf7EJACqjyAcKzxjYHpnCzyufS1-zumnNiCblw,18694 +jedi/inference/compiled/getattr_static.py,sha256=xlGhrZ4eJ4WUERMF-4XUQ03DPhTQlETJon1bR-x_AT8,6116 +jedi/inference/compiled/mixed.py,sha256=TRzTsZNmPNTbJpcfzvNZRV3XdmdrT9tb6h5mhWQcnk4,10986 +jedi/inference/compiled/subprocess/__init__.py,sha256=jXbQb8s6EuYhw3iUY1rNmQ5XHNSz_ku4XUSaIDhjHik,14733 +jedi/inference/compiled/subprocess/__main__.py,sha256=H5rKiOg6YyyzJWQQHsMGXt18FJuF2FjfGfzFylBOd0s,1691 +jedi/inference/compiled/subprocess/__pycache__/__init__.cpython-38.pyc,, +jedi/inference/compiled/subprocess/__pycache__/__main__.cpython-38.pyc,, +jedi/inference/compiled/subprocess/__pycache__/functions.cpython-38.pyc,, +jedi/inference/compiled/subprocess/functions.py,sha256=mqSRpdPeOmtLn-sRuLSI8BSy08m4wXtWzSFu2uv_vC4,3430 +jedi/inference/compiled/value.py,sha256=7uFbyHf9uGNu2nH1vKORQTVQZk763Zad37iq9UQSSTs,21322 +jedi/inference/context.py,sha256=jR-aA2gCfFsoavSLuNmawLBr5Jqt6d-BNHruCJaG9z0,17226 +jedi/inference/docstrings.py,sha256=1U6tfNr5SOFfB-3hz6Faac6uyhuWqH8U3DusdrJfrXY,10692 +jedi/inference/dynamic_params.py,sha256=Hc25dehMv73FLdwcxJNkTxLLp_4lviu6kRZ2QmSxwEo,8217 +jedi/inference/filters.py,sha256=AHxRs4qi1SGA_mwp6fAnfRc5tPwt9rw1roact4BVNsg,11613 +jedi/inference/finder.py,sha256=bx-TVatGVvPs696vDS-CWFbclUOdwWvXZPMJF8Vp9Gg,5326 +jedi/inference/flow_analysis.py,sha256=Sc2JY8QJnczWUGKeGmJDjzTraUEJeGchfCvi95TJ7KA,4495 +jedi/inference/gradual/__init__.py,sha256=Xzh7u-vHsvyHAzr_2kP8PY4NieFh35o-TmQY3KAttlI,143 +jedi/inference/gradual/__pycache__/__init__.cpython-38.pyc,, +jedi/inference/gradual/__pycache__/annotation.cpython-38.pyc,, +jedi/inference/gradual/__pycache__/base.cpython-38.pyc,, +jedi/inference/gradual/__pycache__/conversion.cpython-38.pyc,, +jedi/inference/gradual/__pycache__/generics.cpython-38.pyc,, +jedi/inference/gradual/__pycache__/stub_value.cpython-38.pyc,, +jedi/inference/gradual/__pycache__/type_var.cpython-38.pyc,, +jedi/inference/gradual/__pycache__/typeshed.cpython-38.pyc,, +jedi/inference/gradual/__pycache__/typing.cpython-38.pyc,, +jedi/inference/gradual/__pycache__/utils.cpython-38.pyc,, +jedi/inference/gradual/annotation.py,sha256=C8is4qYsyoSwLu9cxSKX5MZFIbFdauGG3hZsT1p7m5k,15110 +jedi/inference/gradual/base.py,sha256=-OabdAQbw0trnLzODG1anxOl0lX6aj4f-7CWHY15rWQ,15580 +jedi/inference/gradual/conversion.py,sha256=KWg4t6wUBJjvMBoxdMmyO7Y8sqOuVupdqc-BzZLcV3U,7504 +jedi/inference/gradual/generics.py,sha256=kiLDV2Xdy1szgWcTx24yBy1eRWhA9eBcL78SW6_bjhE,3152 +jedi/inference/gradual/stub_value.py,sha256=zCBpYENxl9DbOM3stZzK0vxhZxDFOBtEfVKd9aMvV3I,3558 +jedi/inference/gradual/type_var.py,sha256=ktQ3VVw7Tr9iLcX5DahiuKOvgipGAYS3sHlyCxc4qIs,4399 +jedi/inference/gradual/typeshed.py,sha256=FMIracUBgoWU1MRG0GAKsZMT3dORnLDuICRF3u66A-8,10792 +jedi/inference/gradual/typing.py,sha256=5iEPVeZEamZSbYFyWpy_w8uOPsFTJiAqrKjLVogAGfI,17373 +jedi/inference/gradual/utils.py,sha256=Thflq4AWQI4iyJSxDkKV_T1pzogQ4cBYW06XhLogR50,1070 +jedi/inference/helpers.py,sha256=UypbWvMqIeW_H7JJJICXNTRVhcKur4TCAqONSyNOzw8,6123 +jedi/inference/imports.py,sha256=osUsD_kJm0iUq8waPkY3MTVcY7gQZ8too46e72kaFVA,21511 +jedi/inference/lazy_value.py,sha256=QR_IqFSUTDovl_nni3F-i4Nqy7WzyobGlsYcIaGumEU,1716 +jedi/inference/names.py,sha256=nMPAahqWCBfWZDGzBe_He2Lmh9F08s6m5DkkG4owReU,22752 +jedi/inference/param.py,sha256=qxgffvy-7CZvn9jAf1mIPtDDPdMjoYcWYWtL4eNjNeE,10498 +jedi/inference/parser_cache.py,sha256=GOOahC8GvDcGW-Ct653Uts5IZ0EaymB4OwyfKm5WClg,191 +jedi/inference/recursion.py,sha256=PnY5x_xGwVy1j6mq1dA2LQo5CE1eOLRLJYvqpATLDPw,4947 +jedi/inference/references.py,sha256=A8zQNOuI_9FsM77dojD4DiIdwqlu1iSn9escFVwyQ0k,10407 +jedi/inference/signature.py,sha256=PP04FxtJuOp1rAtL4vN-r_UzBuSeeIZD69ZCBhphIUw,4888 +jedi/inference/star_args.py,sha256=Dp4i6TB1hoGa9RG7Vcg7m1aCG4z4UwaHXaIZsNGxARg,7745 +jedi/inference/syntax_tree.py,sha256=R36qC22e35jKWaKjgT3sxyGQi83cY9UZYf2QSdQGRcY,35216 +jedi/inference/sys_path.py,sha256=3mX5j5xe4exUWMjCzXyEXp5Hjjq1elGWidoQwmKBhFg,10283 +jedi/inference/utils.py,sha256=_kO1Trn0Qa5mb9tiW6xme3bIxESvOTEpdtnxmUiz0cI,3364 +jedi/inference/value/__init__.py,sha256=5enaIU-NKIBUpbm0KbrvriH_d0pubXcG85YdanQcL3w,311 +jedi/inference/value/__pycache__/__init__.cpython-38.pyc,, +jedi/inference/value/__pycache__/decorator.cpython-38.pyc,, +jedi/inference/value/__pycache__/dynamic_arrays.cpython-38.pyc,, +jedi/inference/value/__pycache__/function.cpython-38.pyc,, +jedi/inference/value/__pycache__/instance.cpython-38.pyc,, +jedi/inference/value/__pycache__/iterable.cpython-38.pyc,, +jedi/inference/value/__pycache__/klass.cpython-38.pyc,, +jedi/inference/value/__pycache__/module.cpython-38.pyc,, +jedi/inference/value/__pycache__/namespace.cpython-38.pyc,, +jedi/inference/value/decorator.py,sha256=7L8V10PpcT96P6mTrb5ZNSH-o6B1fjS57ieXwfu5G-c,445 +jedi/inference/value/dynamic_arrays.py,sha256=wqIv86NSEGd2avtL3-zYXyigoc3f-K_2TfmM-EJmTao,7693 +jedi/inference/value/function.py,sha256=VW5r_05W6K9odji9hcRjAz-SiarbJYZZndfu-akrz6o,17953 +jedi/inference/value/instance.py,sha256=DT2K5T4F62EwnPXtovR02bfymvbqNtfGqrvzY0W7Duc,23654 +jedi/inference/value/iterable.py,sha256=wd2HVfAekGAYkC09dqUdjubWZXW38nOELTX7C1DJW1g,23911 +jedi/inference/value/klass.py,sha256=cYmXwYwBiRvRm2RR42LeoPnwYEVBgUD6wqKhrgw_4j8,16263 +jedi/inference/value/module.py,sha256=EtiwiSwRZ_IHTuAs9aUTl7yvktKh_AV_Mt6TwbAap-I,8227 +jedi/inference/value/namespace.py,sha256=yYe0pK4pgM7fWX-cEA_mrxpS-Bc7QN0PR9o1Lrccvlk,2199 +jedi/parser_utils.py,sha256=lo-InBcdPFV-HwIB9xQ3GIvUEd3jxbUiYKPAw_kyMkk,10725 +jedi/plugins/__init__.py,sha256=CMA4JCQL9dCOCicUQ_rX3kuMyqm9yw7JcTEBBuyaVrs,1453 +jedi/plugins/__pycache__/__init__.cpython-38.pyc,, +jedi/plugins/__pycache__/django.cpython-38.pyc,, +jedi/plugins/__pycache__/flask.cpython-38.pyc,, +jedi/plugins/__pycache__/pytest.cpython-38.pyc,, +jedi/plugins/__pycache__/registry.cpython-38.pyc,, +jedi/plugins/__pycache__/stdlib.cpython-38.pyc,, +jedi/plugins/django.py,sha256=_cAq8cqV7guIO2B-tUMRtmx4Tdrs_QW0SWP6f2sWoBE,11033 +jedi/plugins/flask.py,sha256=7F88tx-mdWtlb3NEjWFX4Um338QFs7DwojCKWAqOqvM,919 +jedi/plugins/pytest.py,sha256=onn2L-yH7KuoIBwUn4BpokGajy86sGiNLq2Tgpa7HwI,6062 +jedi/plugins/registry.py,sha256=Z3aaj2W2mpwO2Av4apD_vlkPvorJPljvy4xtJsOHrfc,307 +jedi/plugins/stdlib.py,sha256=BaZzvu2xB9rpYp-4AVzzaKGvJ4Ufc5wVXEkQy1j7R58,29555 +jedi/settings.py,sha256=pnUiKeyFoncyjMJTTbUC9CjV4D176ULh_UR5PkZlyXs,3527 +jedi/third_party/django-stubs/LICENSE.txt,sha256=I16ZOWXTmaJefUk9JchiL3hxhRCIS5wFHx8YZrbzTp0,1075 +jedi/third_party/django-stubs/django-stubs/__init__.pyi,sha256=t008ZLMgegSQayAawLGBCwygFeVfDKqQEAqTpXj_9yA,432 +jedi/third_party/django-stubs/django-stubs/apps/__init__.pyi,sha256=Y3Y6Hf-auytvp3gQT19bAYTGM1e3f9BBktHVMvr2KQU,79 +jedi/third_party/django-stubs/django-stubs/apps/config.pyi,sha256=5WdAiYznWIzxBXj7DUdYwg0ZIYp2pZHi2uUuD8oumQc,834 +jedi/third_party/django-stubs/django-stubs/apps/registry.pyi,sha256=gu9N7TVSYlhW--1o8FaRhD1S7W4DbF5_tAw4VkxBcsw,2050 +jedi/third_party/django-stubs/django-stubs/conf/__init__.pyi,sha256=iD_WNEjoMcZZwVw_OsvIr-qT1D-WAyVhwGHURaVG9hQ,899 +jedi/third_party/django-stubs/django-stubs/conf/global_settings.pyi,sha256=uUXM1AzZ6y9TcZd_wEBD-MksMBnnA0S1oncpezQApoQ,17462 +jedi/third_party/django-stubs/django-stubs/conf/locale/__init__.pyi,sha256=M1UVxxBgBcKY0r7pv8DvOE6_CJavw0Od3fi8iH-APEk,62 +jedi/third_party/django-stubs/django-stubs/conf/urls/__init__.pyi,sha256=SisGWP0M2DqTBeYjxgaoseKtVjQhpvEopgidp_u0BG8,1033 +jedi/third_party/django-stubs/django-stubs/conf/urls/i18n.pyi,sha256=x4QdXccNgttRURmMrKKE5BDhfk_sc9GRyzSJPbbQDKU,297 +jedi/third_party/django-stubs/django-stubs/conf/urls/static.pyi,sha256=BXdu_MPkrP5LIynxR3lUVc6AAK_y45T8YVn_lp-UVow,172 +jedi/third_party/django-stubs/django-stubs/contrib/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/admin/__init__.pyi,sha256=EqcwNegHa1kj1bgto5_xljmuP4Ym54wt-_A7nia4WEA,881 +jedi/third_party/django-stubs/django-stubs/contrib/admin/actions.pyi,sha256=O3SXOhCX1-BkDiPxDh9BDUppLQhopWyDj2p1l71XmMo,351 +jedi/third_party/django-stubs/django-stubs/contrib/admin/apps.pyi,sha256=1q33ihcO10A_m7HB5gHdU8S1YpVohz6ihgzo9QMPYnk,142 +jedi/third_party/django-stubs/django-stubs/contrib/admin/checks.pyi,sha256=fWhQq3debqlWvigQzUZNuORAVzHw61iWmi0emeczJC8,849 +jedi/third_party/django-stubs/django-stubs/contrib/admin/decorators.pyi,sha256=Ws4zXIAH5jDgEi60FmJ_Mry9eU5rCJmpJ5lNM2XQXbs,170 +jedi/third_party/django-stubs/django-stubs/contrib/admin/filters.pyi,sha256=fQk48FO4Aik5qG-yUHr7XmW1wgJtCHM4YeWc2PEIvkU,3487 +jedi/third_party/django-stubs/django-stubs/contrib/admin/forms.pyi,sha256=vAAUpUCC7gxxUnBDCwNmPrk1L-NOCHx8lHwlceqBNDY,249 +jedi/third_party/django-stubs/django-stubs/contrib/admin/helpers.pyi,sha256=KD26oTSFhlCVWOzH2jzoAx1Oqhncx5aSUd6ySd3qR0M,4790 +jedi/third_party/django-stubs/django-stubs/contrib/admin/models.pyi,sha256=B8NtoXvvjj8pW0fyQQXwsFJ7j7j3DlaxgxuXwY4Y514,1220 +jedi/third_party/django-stubs/django-stubs/contrib/admin/options.pyi,sha256=TpeeMIIkoNO4Ky8VYdxejUzxmV8R1S3t25ofOD5Nilc,13828 +jedi/third_party/django-stubs/django-stubs/contrib/admin/sites.pyi,sha256=Di-VbTnbIqoK8xDO-IOw64s7JrRQ3CoZKYIvGXKwvOs,3288 +jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_list.pyi,sha256=HSelmnczfnb-E2QvjhmWkHbwTMp7zx9AoxTqWW_HkBI,2028 +jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_modify.pyi,sha256=7cJfilSXB5nWosnNDsgAMMJbZXExtCJAjJmCkvKT6a8,690 +jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_static.pyi,sha256=FV9QQ0gLLyXEtmmJqGFWRFRo-eJcvO71aRcFqZJn1sI,73 +jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_urls.pyi,sha256=BP_vzmHQ3W7lwC1qCuy7_CSL52pWF5_kyx9okRQT100,547 +jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/base.pyi,sha256=_2N03P5IN0Y66vpFrz5l0aRyEQjJgCll8w-FJ1CsP8Y,592 +jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/log.pyi,sha256=8m7bTnfmhLLycZoE3Aapyyz4JzO_G8I_e3L16FZATWM,454 +jedi/third_party/django-stubs/django-stubs/contrib/admin/tests.pyi,sha256=IGDA9zE9QPLNB5xgBFFr9j3AbMyufxTm2NUPqmP8mpA,1417 +jedi/third_party/django-stubs/django-stubs/contrib/admin/utils.pyi,sha256=RoMzCbcgb_dKDrY8ezXh93jNJQEEuJ3JAHDitnWZ4To,3107 +jedi/third_party/django-stubs/django-stubs/contrib/admin/views/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/admin/views/autocomplete.pyi,sha256=AmCorbocq3VfqVJnU6wtVyGESgls1a-WePP5Bl3Vi3E,349 +jedi/third_party/django-stubs/django-stubs/contrib/admin/views/decorators.pyi,sha256=xF9kl3mBijo2Ucnac0ituCn5nq2dyDYNXReYMgX-Rm8,335 +jedi/third_party/django-stubs/django-stubs/contrib/admin/views/main.pyi,sha256=MnJzYgIiYc6K7yPGAzzKokM2YwHbqYwWzVpEfQwdYf8,3390 +jedi/third_party/django-stubs/django-stubs/contrib/admin/widgets.pyi,sha256=i1bW9opYwddEL9f6hhekwMNYhg_2vbo3CPn9-DY173Y,3375 +jedi/third_party/django-stubs/django-stubs/contrib/admindocs/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/admindocs/middleware.pyi,sha256=DlifCzWN3f9RB-PoedyUCPz3MhpqODdJxEk1xRYyYu4,409 +jedi/third_party/django-stubs/django-stubs/contrib/admindocs/urls.pyi,sha256=oIadLJRRqUS4fwWe3F2TwdQViIuYuSR7iutUidncun0,59 +jedi/third_party/django-stubs/django-stubs/contrib/admindocs/utils.pyi,sha256=aKdHFqtElfEWLRx9LgJRBZby7VKeAvCFRfSh9J_yOVc,725 +jedi/third_party/django-stubs/django-stubs/contrib/admindocs/views.pyi,sha256=JvdGvkWE5fJULlrrbucwuvbOkwPSL9b2I5hsVmBZxAY,852 +jedi/third_party/django-stubs/django-stubs/contrib/auth/__init__.pyi,sha256=hDspBupLxVr58AAo69fVZa9d_pWAkORdzOcjUVxB49M,1316 +jedi/third_party/django-stubs/django-stubs/contrib/auth/admin.pyi,sha256=t3LSFWjHf93LRhNmB3Pn5bd9X4NE9kFzbYCsyDrg930,527 +jedi/third_party/django-stubs/django-stubs/contrib/auth/apps.pyi,sha256=783HiaS66kh94JjcTQDjxdhqTsecaKqZrwJ6rLSB6AQ,68 +jedi/third_party/django-stubs/django-stubs/contrib/auth/backends.pyi,sha256=OzBwXj0hB-Im6o9-2OHAOVCAkP07BG6DQzg0BIMT9d4,1605 +jedi/third_party/django-stubs/django-stubs/contrib/auth/base_user.pyi,sha256=p2mB5q8Pvv1BrE3CgnwXgfLITW3bFSNQVCp388wjxMs,1493 +jedi/third_party/django-stubs/django-stubs/contrib/auth/checks.pyi,sha256=GeMx3ueyYHAufqpprS_roDPC-MGC9jZZiiob_Yj2j1w,371 +jedi/third_party/django-stubs/django-stubs/contrib/auth/context_processors.pyi,sha256=ysQRV_JT1XA8buH6W5mkGbefSDy0nRVumXGjToqgoAg,617 +jedi/third_party/django-stubs/django-stubs/contrib/auth/decorators.pyi,sha256=D-szKzg_wbjHQsdAY7Y_SE4s7fOrE1PQRTqXDdo_acs,982 +jedi/third_party/django-stubs/django-stubs/contrib/auth/forms.pyi,sha256=jpqKdxAYIElU-TlfLzvZNefMnn1Uo3vXEJArzBainZE,3149 +jedi/third_party/django-stubs/django-stubs/contrib/auth/handlers/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/auth/handlers/modwsgi.pyi,sha256=bv6dWYpTbWYlCQjWyc76cB_lH3akN0WYDyuTmnLXiS8,204 +jedi/third_party/django-stubs/django-stubs/contrib/auth/hashers.pyi,sha256=xdR_649Y60eS-C4VcQUDn76n07U5Tzwl6DlLOcOr8Ek,1969 +jedi/third_party/django-stubs/django-stubs/contrib/auth/management/__init__.pyi,sha256=r_Nm0u9_QFypD1ZAkzWIrPzTRiKM0Vwj8N1BPgEjjUA,384 +jedi/third_party/django-stubs/django-stubs/contrib/auth/management/commands/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/auth/management/commands/changepassword.pyi,sha256=sINAEC_pucjlldxJChrjgnhv_PzIBOAi3mPOqdHYZNE,125 +jedi/third_party/django-stubs/django-stubs/contrib/auth/management/commands/createsuperuser.pyi,sha256=LI2_hmrgjeizJ0L0Pe4lo2lqvgqvfd0XDovYSbrx9bk,208 +jedi/third_party/django-stubs/django-stubs/contrib/auth/middleware.pyi,sha256=WwvDTYBlZdi21Ackk6Aksuwgt0JIOOAPOc3niDsN0J0,774 +jedi/third_party/django-stubs/django-stubs/contrib/auth/mixins.pyi,sha256=7Ca0TCSsaszq71MDnCaO2-MqySWlZc2CQQqtQZBIaL0,1150 +jedi/third_party/django-stubs/django-stubs/contrib/auth/models.pyi,sha256=nDsbZgiHmYUmC8TSu1ZAmk5uEVGlEodFN6B2dXhwaec,4641 +jedi/third_party/django-stubs/django-stubs/contrib/auth/password_validation.pyi,sha256=9KOmo5wQfvW4U_qh6yIMczt5izwIRS2GMQQ5vGX2D8I,2052 +jedi/third_party/django-stubs/django-stubs/contrib/auth/signals.pyi,sha256=0qXrIYBrx2XYwRrx1N5V5h9HgFtdmK4pzQfEMPr-EPY,120 +jedi/third_party/django-stubs/django-stubs/contrib/auth/tokens.pyi,sha256=IcHQN4Pn8ikV2qI1e4_VWkLjVbfPR5tOEM2iQR3Dz-c,361 +jedi/third_party/django-stubs/django-stubs/contrib/auth/urls.pyi,sha256=oIadLJRRqUS4fwWe3F2TwdQViIuYuSR7iutUidncun0,59 +jedi/third_party/django-stubs/django-stubs/contrib/auth/validators.pyi,sha256=3P7MK_049xYExFIZVQCaic-iuFgFGaZouQBS4RYe_6I,160 +jedi/third_party/django-stubs/django-stubs/contrib/auth/views.pyi,sha256=BPnTwECkJfap0jz0Mi1RII3PLHeHI6eH3Z3mnBZoFvQ,2478 +jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/admin.pyi,sha256=hQT_hpYtA2aHrknPNDLX9Fl6NSVJbdtKpWhiGOsk-VM,586 +jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/apps.pyi,sha256=WUN_nGxl5mnIB9IctYlkCrswHF8BpQo2yRbRywZ69c0,76 +jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/checks.pyi,sha256=3PeRWTpBcWB1u-66ueZ6RVWFIZReu5OOYpoN7r2JCBQ,318 +jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/fields.pyi,sha256=hW1z3wwu_lRFpF6Zkz2pR3pb7yh1za9PgaZFJ6o5XPY,4097 +jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/forms.pyi,sha256=-j9hvsPL-3syqd6O5gTcXzh3xeCQ-isFdtkhfuUwIX4,1159 +jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/management/__init__.pyi,sha256=B0Gku6qIM0KlOwC2zQyZVrNE2Stj4JylnzhQ4-gswiA,1350 +jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/management/commands/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/management/commands/remove_stale_contenttypes.pyi,sha256=-wUrCoB87Ueb8337psYunjcfoiKpxqyestpVHKzvaUE,411 +jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/models.pyi,sha256=PcA_Yze4dDqmxsDJqCYKm_5ZnmfaxW4VNyfGjHqkavI,1085 +jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/views.pyi,sha256=wK8to6ffyMuyyrlNJu9-7nzhOASZRr-x_MWdSgd_G_4,257 +jedi/third_party/django-stubs/django-stubs/contrib/flatpages/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/flatpages/forms.pyi,sha256=XNJrR-mHjiKpxf_r5sPxXC2De-Lyh37BL309dtR_f2I,142 +jedi/third_party/django-stubs/django-stubs/contrib/flatpages/middleware.pyi,sha256=6PzgiwFmjk4K4EBW7tfiUtdxI0x-f81N6RmbMOa5e1g,299 +jedi/third_party/django-stubs/django-stubs/contrib/flatpages/models.pyi,sha256=sd9sLh0PBc86GpcJrEtE4vaPVvs8xE1gifekJbBuyDo,445 +jedi/third_party/django-stubs/django-stubs/contrib/flatpages/sitemaps.pyi,sha256=-JeEn0-5EwpyJHOtgYd8IK_C8fGTmLPtk_UpgiwsiX4,81 +jedi/third_party/django-stubs/django-stubs/contrib/flatpages/templatetags/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/flatpages/templatetags/flatpages.pyi,sha256=U1qIuNadeeNP9oodmb1pXDt9Mrc7urXsAvA0c0bLmC0,518 +jedi/third_party/django-stubs/django-stubs/contrib/flatpages/urls.pyi,sha256=oIadLJRRqUS4fwWe3F2TwdQViIuYuSR7iutUidncun0,59 +jedi/third_party/django-stubs/django-stubs/contrib/flatpages/views.pyi,sha256=aJzjM06Iu8BG4w5frT51cpHotQ6e4GKH18Cukc-yDbo,315 +jedi/third_party/django-stubs/django-stubs/contrib/gis/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/gis/db/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/gis/db/models/__init__.pyi,sha256=I8SirL0ClZODX-As42cycJ4VjKnCc97cK9hVKBY6hH0,418 +jedi/third_party/django-stubs/django-stubs/contrib/gis/db/models/fields.pyi,sha256=HgR0BvodeWJ2iGkP8pLuFvI9SQ5DTWbP0oMzsZwEbHU,3133 +jedi/third_party/django-stubs/django-stubs/contrib/humanize/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/humanize/templatetags/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/humanize/templatetags/humanize.pyi,sha256=4pEElOr5jWoM1AAc-wq4HSLz-0iSrGwmeqqlJqdq2fs,619 +jedi/third_party/django-stubs/django-stubs/contrib/messages/__init__.pyi,sha256=UHr4xfoH6faNXSh6Xq-6OaRhgsi57MkDktuW_MgfDDs,524 +jedi/third_party/django-stubs/django-stubs/contrib/messages/api.pyi,sha256=ue6Dc8C-dHtJuRlcoQE5zPPsmSGOkgUem_H35681jk0,1169 +jedi/third_party/django-stubs/django-stubs/contrib/messages/constants.pyi,sha256=gBM2s_ImbX0K4W0mcwvmesgrEboAd_f_Pzq-lbUQ-IU,187 +jedi/third_party/django-stubs/django-stubs/contrib/messages/context_processors.pyi,sha256=FSJ6CYdzc9OLaBZyMQe1UlTIYq7ROchz_wBsQn-tEGo,249 +jedi/third_party/django-stubs/django-stubs/contrib/messages/middleware.pyi,sha256=H237yhPKbsl-Civ4R6Et_LX5uBUBLrDqTDvBT1JMef4,349 +jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/__init__.pyi,sha256=ySIlvAEkKK1c5eDrg4u2cs-Mu-xkBuIjVqMjlOMqNBo,202 +jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/base.pyi,sha256=EWpGkx7m2iNNqXTYTYTgeQtTmdH_loN6ba3XHbZo8QU,907 +jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/cookie.pyi,sha256=h99T_FYt4AvNx7MaYtCJ42yuXxw2-u4dDaWgX2aqOHQ,487 +jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/fallback.pyi,sha256=9FSrcnvxbwiGz34cVG8v8jOPOBl7cXK8Nvd97wbUCVs,240 +jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/session.pyi,sha256=MsQOXu0WRhdg3mjL51hB_VYTSYspwgCyUfwK7pyEgyA,482 +jedi/third_party/django-stubs/django-stubs/contrib/messages/utils.pyi,sha256=BMBEulwgQtm_k9l8rf5DNeZ-KpKvth7kqf7kzEL2908,69 +jedi/third_party/django-stubs/django-stubs/contrib/messages/views.pyi,sha256=kkAB26i4kilkRl9AJbWCbW5zoy_uuKr33MBLu8Fp4qA,308 +jedi/third_party/django-stubs/django-stubs/contrib/postgres/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/__init__.pyi,sha256=dDW1jG5QW0rYRWbzlmBQ8PT2v9ZdWgFJ0IRHhvBJQyQ,540 +jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/general.pyi,sha256=s1jdffCAM8P8TUYWwwu5ZAjm38N8K7wU_UWR_2wR2SI,338 +jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/mixins.pyi,sha256=BE72JG-si9GbSvdXWBTN2asV9jYrZIh2GldTVScgC1I,29 +jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/statistics.pyi,sha256=PqsAq9E7Jf6IUi3xYpm9LMCl52R6XMfMQieQxe-d49w,470 +jedi/third_party/django-stubs/django-stubs/contrib/postgres/constraints.pyi,sha256=s2FgJy9Rl1JnijuF4VQKTz6aVahFoJAwnO1C36sJQ4I,576 +jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/__init__.pyi,sha256=nAMbC_GxM8b8-dR9AlAQ9W__vybgo-3-X6bSBi0un48,695 +jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/array.pyi,sha256=B19PlhiKI8jhgJQq6fK_2SMXtZ1-yq0RyGe6QWwPHik,1729 +jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/citext.pyi,sha256=bC3-GS1JBsGcBiF5ve1dN3O8vG2eKjJSH0UB7mO7kFA,216 +jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/hstore.pyi,sha256=f6qGgeaD_ypIuIsPMGlgm_D48zms5vJ5VCclCp-iSCc,519 +jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/jsonb.pyi,sha256=XQpN-W-SzUoLm8M84ebg9ccGTZ51oMvpNU2S7PGdYMo,1011 +jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/mixins.pyi,sha256=NAiNjruhDqjVpZdusWemB8_eZhe54CHtvAGKDjvHFKY,113 +jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/ranges.pyi,sha256=yq6_zMfmqvqbCO627VtFM96DiGfUgdp3tku9RBxv7Vo,1342 +jedi/third_party/django-stubs/django-stubs/contrib/postgres/functions.pyi,sha256=__zcyTUVl9N7_5NVTzZ_SAXvflnckIVZtz46hcSiesI,95 +jedi/third_party/django-stubs/django-stubs/contrib/postgres/indexes.pyi,sha256=WsAYW3VLoP4rQ4p8ra4gkNPYcBH4XU6R-5b5HfvRZ8I,2272 +jedi/third_party/django-stubs/django-stubs/contrib/postgres/lookups.pyi,sha256=6XUZ02CEjDiE_s6sGMCTHuLk1R_MtdkGGjAASJzGVEk,579 +jedi/third_party/django-stubs/django-stubs/contrib/postgres/operations.pyi,sha256=Z8SEkq9xL8vu8ZhaEUZr9DqaN-oBSeu855ng3KXSGXg,735 +jedi/third_party/django-stubs/django-stubs/contrib/postgres/search.pyi,sha256=m0sqtO97PEv8__bspxNgeLfBaMga2rnZUnkHl-6jckk,2195 +jedi/third_party/django-stubs/django-stubs/contrib/postgres/signals.pyi,sha256=yeuM0ob6OaYoACmfLBdZCNWgPlm7A9ZwWjoZi-7Kb0M,237 +jedi/third_party/django-stubs/django-stubs/contrib/postgres/validators.pyi,sha256=s2eEtAs0EGPZdPztDX4Q4ZLLf5fm23Z_ggZU4yWSo0k,653 +jedi/third_party/django-stubs/django-stubs/contrib/redirects/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/redirects/middleware.pyi,sha256=fKa3O8n_i5HyNVUHXOaTIar7d5SmNOPwUqmo5FRDqx0,391 +jedi/third_party/django-stubs/django-stubs/contrib/redirects/models.pyi,sha256=h-aCkCB9-5rhIRn1zd1DhgCRzFbwbi8n3ogO2THqDDI,168 +jedi/third_party/django-stubs/django-stubs/contrib/sessions/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/base.pyi,sha256=Ny7D5lAHrEndxAQ_1CPFZZM2DsHMoMUnBdJanHOSw0k,1527 +jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/cache.pyi,sha256=7wCasZDS2jUxauFRfc1hgCbbMhdu3BV0eyNaJDMTTnU,299 +jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/cached_db.pyi,sha256=8jDkOaweqsMtw0xxE-TMfqKVF-EOhZYEN3kjasw_f9w,305 +jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/db.pyi,sha256=tVGmHGKuGZGDYi4l8aR1a6BlQKRYYDrNI1qorOiCOYI,577 +jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/file.pyi,sha256=cT7G4hn-3A_ZdlWH1TPH8K_Q9bAoKUUjjLlAwFvFPro,283 +jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/signed_cookies.pyi,sha256=qBbI8hMn_5IEPkzq2AQW54pFZN-d0lVUhSZ0W6DgC84,100 +jedi/third_party/django-stubs/django-stubs/contrib/sessions/base_session.pyi,sha256=1NPvIW3qfHt-WF1wOYh7FGLoPasYJ80KTw0pdrWOh3c,665 +jedi/third_party/django-stubs/django-stubs/contrib/sessions/exceptions.pyi,sha256=JjF0Gti8-WnILz7dVoTAv1yCrbhMLsvBe3e1z3Zzu50,156 +jedi/third_party/django-stubs/django-stubs/contrib/sessions/management/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/sessions/management/commands/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/sessions/management/commands/clearsessions.pyi,sha256=Gk-hDddr6HHr5PArycz3DqoeF476UpGqav9HGp_NsnI,85 +jedi/third_party/django-stubs/django-stubs/contrib/sessions/middleware.pyi,sha256=ZaLlZVRmZZgZaDMmC-j4YZVKDSMjdFYW7WOTru56gOg,478 +jedi/third_party/django-stubs/django-stubs/contrib/sessions/models.pyi,sha256=5Xexgn7rtazccT-DG_4gm4-Lc1NtQTZZBYZQn9LdWdk,176 +jedi/third_party/django-stubs/django-stubs/contrib/sessions/serializers.pyi,sha256=IDMgSeFmLRJYNp5_5jiYaTPKxPBLaEVbEWqPbSqRYaM,311 +jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/__init__.pyi,sha256=jH3-BaWLaKwI5DATtZlXtMLNVETNStRqeviv6zqvv4M,1559 +jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/management/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/management/commands/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/management/commands/ping_google.pyi,sha256=Gk-hDddr6HHr5PArycz3DqoeF476UpGqav9HGp_NsnI,85 +jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/views.pyi,sha256=JueiGm9sG9TSRfC_6FP7SpdjeOxKko1he1IJJmvWl2Q,762 +jedi/third_party/django-stubs/django-stubs/contrib/sites/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/sites/apps.pyi,sha256=hA4WuIXyL9iDiIYzysxfk73L--Va48Ede2GGIvVCxPQ,69 +jedi/third_party/django-stubs/django-stubs/contrib/sites/management.pyi,sha256=tMS5XtfebpRS5cGVshTDsfF5tQmiBZqdVLH3Exey-vw,288 +jedi/third_party/django-stubs/django-stubs/contrib/sites/managers.pyi,sha256=9NB542AluxPiwc0ey-I-FDQKSlria3-A9ROMwdg6GXI,170 +jedi/third_party/django-stubs/django-stubs/contrib/sites/middleware.pyi,sha256=XdobZMJ16FQk-rt57wCtkkJ2NoJfD1LQrRz1lZfx8ZA,209 +jedi/third_party/django-stubs/django-stubs/contrib/sites/models.pyi,sha256=CAVo7Xo9pU0SQQ_-CBooqLbMaUjgqugtqvQUXAcmLrM,614 +jedi/third_party/django-stubs/django-stubs/contrib/sites/requests.pyi,sha256=9cA6iRYob33A_N7AHCWhB5HV0u7CBaa3YFxBwKtNjXc,298 +jedi/third_party/django-stubs/django-stubs/contrib/sites/shortcuts.pyi,sha256=dPbrudBzry6CawfRV1IbbF7SHGvSa6oDjGJayELnFzI,266 +jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/apps.pyi,sha256=JiBc5TPKiv6yGihDg8hKxxONGJOnOn-rZmbU_P4rbxc,126 +jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/checks.pyi,sha256=_LvpylIL3RjCRsZOzCn7MMuBD41DFLEZNWDolU61Ihs,242 +jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/finders.pyi,sha256=uYtF_5sLYizgcESyiWVSsqwCHonIPf2CPF1Lh0Qg09w,1715 +jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/handlers.pyi,sha256=H6xAYLSqzoYTmTD20s-nvsaEaWChXbQWcMsllwq5zJQ,417 +jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/collectstatic.pyi,sha256=aauFD0KDUGYrHRVy-El3hUVhCkTXtWty213H0YRRjHc,1125 +jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/findstatic.pyi,sha256=AoPCqwNz4yYQQm1z6WCDMdxcWrBURx1I5iPsHJQvdOo,87 +jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/runserver.pyi,sha256=3uTSyH43HWzNj2ysIJXyT32MaF4q1_gz6q2hJJy2nRM,136 +jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/storage.pyi,sha256=WRfGAaDXcvPjl7ICgAkaxm_lD8dNx9EqikVnBd-Bie0,2262 +jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/templatetags/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/templatetags/staticfiles.pyi,sha256=3rNdwJS7hrGHEmWcCDQXI195iq8q2A_fB9K-mjIFLtg,234 +jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/testing.pyi,sha256=sD4CDNL4bD-9nTfvLSMK8D7_Oc0UlxpMgraoUAGzr7s,100 +jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/urls.pyi,sha256=e3hDRnM55Tey8gm6uIZkU9XaKL6K1hQCqbgwo2JEfD8,198 +jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/utils.pyi,sha256=5kh8wIGL3tKBTFQ2tv-beeXeSlQvKS9_S8LVXflcybg,438 +jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/views.pyi,sha256=Q2CX7w--nytsntQ6IkUxHuthpEHo8HQMeIsaC4Moq1c,222 +jedi/third_party/django-stubs/django-stubs/contrib/syndication/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/contrib/syndication/views.pyi,sha256=1HnKaVl09EenWI_V6xo-qcobr45hCSLC3uUtoimfGoU,1251 +jedi/third_party/django-stubs/django-stubs/core/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/core/cache/__init__.pyi,sha256=6zFjJ1q_xONqYBqBOcphnTqp49ZU8UrglfT-DCibJ-A,717 +jedi/third_party/django-stubs/django-stubs/core/cache/backends/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/core/cache/backends/base.pyi,sha256=YQGqJhft7pHV6PSlOwIi5WMK_Zhpqld19F1zp6axjnI,2327 +jedi/third_party/django-stubs/django-stubs/core/cache/backends/db.pyi,sha256=wGdUsoR-ow-u2LRIjaakjcwPByKQb8-U-KOXhTbW9wg,595 +jedi/third_party/django-stubs/django-stubs/core/cache/backends/dummy.pyi,sha256=PilEF_Ep1-fDe4bQFkVaFm_n4uTLtmzHv2ewWM8VBzo,182 +jedi/third_party/django-stubs/django-stubs/core/cache/backends/filebased.pyi,sha256=-ShvV4mAtuzKC617Q2qMr7FHZkwoBpG_KP-pfOBW02Y,216 +jedi/third_party/django-stubs/django-stubs/core/cache/backends/locmem.pyi,sha256=kz1dYtPcAvhw-OAgRG0Vd0n92M_1xxN8iaGoU-s4FZA,186 +jedi/third_party/django-stubs/django-stubs/core/cache/backends/memcached.pyi,sha256=08qEPXnng3yPOK9ZYP4WtWrtENsavVyQbI0ebWLffjI,352 +jedi/third_party/django-stubs/django-stubs/core/cache/utils.pyi,sha256=2rG3g9PW3FWNflGxI84bpIfvpVQlzYYg7FaZre1vEA0,184 +jedi/third_party/django-stubs/django-stubs/core/checks/__init__.pyi,sha256=lNFmiy3qR0A9eHFRAQT7h5sP7a8jHqRUDc6RhhBnjRo,430 +jedi/third_party/django-stubs/django-stubs/core/checks/caches.pyi,sha256=ILPwDMFMEiAA7KYy_G2He5djgU5iZiA8-kq3t8jgeTM,267 +jedi/third_party/django-stubs/django-stubs/core/checks/database.pyi,sha256=a86fSgBJq1RN7ReWxynzDzEJeRf-_SNW2pP5RuavEL4,103 +jedi/third_party/django-stubs/django-stubs/core/checks/messages.pyi,sha256=crXlAhQmqdtkL65DgmJf7T1h7zPJ6LlqXq2wVH0Nx1w,925 +jedi/third_party/django-stubs/django-stubs/core/checks/model_checks.pyi,sha256=YUzLAMcJQ8wgRiN41JJ1kUlkArL9cNW-mzN4z4qIPQ0,358 +jedi/third_party/django-stubs/django-stubs/core/checks/registry.pyi,sha256=djmQNgx4H932hka9_kArUfRrH-MRxMfQS5SchBapFqM,1212 +jedi/third_party/django-stubs/django-stubs/core/checks/security/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/core/checks/security/base.pyi,sha256=iPHQ9r4dT1LPGKvNGYzbup-1So13CsG4CB88tcL0s5w,1592 +jedi/third_party/django-stubs/django-stubs/core/checks/security/csrf.pyi,sha256=ql6NePz-3tHvFrRs1-RiUL7hu-YTeqvOjJDJKWECx4o,379 +jedi/third_party/django-stubs/django-stubs/core/checks/security/sessions.pyi,sha256=GtTSJmziKaY-VxLKo9uZ2Iv2Bm_Q1GucnscQ9IcqI3k,527 +jedi/third_party/django-stubs/django-stubs/core/checks/templates.pyi,sha256=onbDwInTuNoww68Ei0NcAl3zBYRJ1YXTL7ihxAhfyN4,391 +jedi/third_party/django-stubs/django-stubs/core/checks/translation.pyi,sha256=KB0XkeUqlgS1O-HFeVcF0gP09nv9su--tX6fJmTNFKA,155 +jedi/third_party/django-stubs/django-stubs/core/checks/urls.pyi,sha256=cPGPCVBb1TtYLLIgid6su5NcNd9p90b7-40uT9kYhq4,780 +jedi/third_party/django-stubs/django-stubs/core/exceptions.pyi,sha256=VPgD4WzafSFza0Gv5-D0WmJrdtcBAkBKhLirWk9n4h0,1543 +jedi/third_party/django-stubs/django-stubs/core/files/__init__.pyi,sha256=hdnkFb2OQ7nFCvlNdWdVo4qsMPLXN_YaeyRdMAineH0,68 +jedi/third_party/django-stubs/django-stubs/core/files/base.pyi,sha256=EEh_-8b3WGLzwLAKVaKHe_-FNW4yipUv4cEWCThurls,1435 +jedi/third_party/django-stubs/django-stubs/core/files/images.pyi,sha256=SMT0wolMYso4QmCGlPtKmBirJOnvghPc8TkUgMFGe6M,309 +jedi/third_party/django-stubs/django-stubs/core/files/locks.pyi,sha256=EHZ7epp-o3EYCF3vCAPw3DLI5QAPNTg63LDLJL-BP50,308 +jedi/third_party/django-stubs/django-stubs/core/files/move.pyi,sha256=PISpZOttN4V_udjfb3adCtD-4oZ6Xaq8W79I6MddcrY,130 +jedi/third_party/django-stubs/django-stubs/core/files/storage.pyi,sha256=JeqnJwGpqWlD-FDfKMVYM0uTcoHcCaFehqwxyrFcOsQ,1769 +jedi/third_party/django-stubs/django-stubs/core/files/temp.pyi,sha256=GXys-R-G1z3HKO90VbMZqW5mpy8e468QbczNs9k9vQM,100 +jedi/third_party/django-stubs/django-stubs/core/files/uploadedfile.pyi,sha256=mmdboWz3QcaLVWHtiB4GWI5GowWOgQXPpSZoZGJuxqo,1486 +jedi/third_party/django-stubs/django-stubs/core/files/uploadhandler.pyi,sha256=yDWGn8nxgymZGsTNoPles2N1JgzZfvJnR8SGQivSRA8,3195 +jedi/third_party/django-stubs/django-stubs/core/files/utils.pyi,sha256=-YkCeClNFbCHxU418Pbn4t8p451gwLt5UfHnv-1twCc,547 +jedi/third_party/django-stubs/django-stubs/core/handlers/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/core/handlers/base.pyi,sha256=zr5dcNLmsLL8WK45_pof5Whiw8JyVqNe-nQNNTaRBUc,572 +jedi/third_party/django-stubs/django-stubs/core/handlers/exception.pyi,sha256=9Z2sl79zEx6EkjxA7930oIYYsuaOZQNKf_zNUa21YV0,570 +jedi/third_party/django-stubs/django-stubs/core/handlers/wsgi.pyi,sha256=ZmdUpvNrkmvBNxddhxasurnqfL2cXAYWiDchJMTFfVw,1325 +jedi/third_party/django-stubs/django-stubs/core/mail/__init__.pyi,sha256=fS7DQB-KYK0_XQ5JJ_mfNooDw4aI8K3DQOGmUW2cjKQ,1504 +jedi/third_party/django-stubs/django-stubs/core/mail/backends/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/core/mail/backends/base.pyi,sha256=gRQflStnEnexigKiEhXW9ew01NFWHkgEErsO7zGkmq8,604 +jedi/third_party/django-stubs/django-stubs/core/mail/backends/console.pyi,sha256=rp3gJ_WRrP7cC6OHCZxDmMCEGpwSZTXTE_-9sYGE7qA,103 +jedi/third_party/django-stubs/django-stubs/core/mail/backends/dummy.pyi,sha256=rp3gJ_WRrP7cC6OHCZxDmMCEGpwSZTXTE_-9sYGE7qA,103 +jedi/third_party/django-stubs/django-stubs/core/mail/backends/filebased.pyi,sha256=rp3gJ_WRrP7cC6OHCZxDmMCEGpwSZTXTE_-9sYGE7qA,103 +jedi/third_party/django-stubs/django-stubs/core/mail/backends/locmem.pyi,sha256=rp3gJ_WRrP7cC6OHCZxDmMCEGpwSZTXTE_-9sYGE7qA,103 +jedi/third_party/django-stubs/django-stubs/core/mail/backends/smtp.pyi,sha256=9fsENrJbPIEXUtnYhW_1dADqpcj7I4Z3kR2-3DGwdHg,510 +jedi/third_party/django-stubs/django-stubs/core/mail/message.pyi,sha256=AJVmTc2Ih1J4hsxLyE5ESK8r611Ooqk1thh39cW28v0,4094 +jedi/third_party/django-stubs/django-stubs/core/mail/utils.pyi,sha256=HiKGzyDfshoDMKu0_OuSD262A10HLjhURdD4ZNJt1ec,95 +jedi/third_party/django-stubs/django-stubs/core/management/__init__.pyi,sha256=xqh8MGApVKxQeURNp9Rp8zkm_4VlnefNkcDNnLiF6Yw,841 +jedi/third_party/django-stubs/django-stubs/core/management/base.pyi,sha256=ek1zS9nL1nCODxJGB2tJ6UXz2KjHoJzXeYa54B_wJU4,2922 +jedi/third_party/django-stubs/django-stubs/core/management/color.pyi,sha256=vnwktv_gcMVYi1TUqZBJ1DQZzpUMkwEzyZxs4FE47OQ,1052 +jedi/third_party/django-stubs/django-stubs/core/management/commands/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/core/management/commands/dumpdata.pyi,sha256=BnOg4pY4rHhpAptNOtprYlnqdHCdnFygXlshZu_g62Y,123 +jedi/third_party/django-stubs/django-stubs/core/management/commands/loaddata.pyi,sha256=jbmimF-dEcZb-DftHd6JuveAc_o50YWVGpnajeiVKOo,625 +jedi/third_party/django-stubs/django-stubs/core/management/commands/makemessages.pyi,sha256=hXQnwklaQn5pUiJSvIq757ECX5yJd5IcE3X6-d78G84,1134 +jedi/third_party/django-stubs/django-stubs/core/management/commands/runserver.pyi,sha256=if7vEdyAi4nKamysFhqo6H_JDGRhSPSZhEGigVamK4g,194 +jedi/third_party/django-stubs/django-stubs/core/management/commands/testserver.pyi,sha256=Gk-hDddr6HHr5PArycz3DqoeF476UpGqav9HGp_NsnI,85 +jedi/third_party/django-stubs/django-stubs/core/management/sql.pyi,sha256=fi7T3XJ92IYa50gpmW8vwmA9QPag-oU5XLP2WBo6rpI,429 +jedi/third_party/django-stubs/django-stubs/core/management/templates.pyi,sha256=vHW_QxpqF7tt5xpREpcMA7pdHKkY5E53MkzQaTtkASQ,624 +jedi/third_party/django-stubs/django-stubs/core/management/utils.pyi,sha256=UfBxh4njLLSBSor3WdNJt1clcHylFcqwkiSivhLHK3s,527 +jedi/third_party/django-stubs/django-stubs/core/paginator.pyi,sha256=3ha_zAANkWUw_GUkgCYaQULZQRGcxXCS5gaBdkozVdg,1896 +jedi/third_party/django-stubs/django-stubs/core/serializers/__init__.pyi,sha256=fLovD32hc1-1o1kK0wjYy7LdtzF5VcQ0C-Pc8Ta1wGo,1377 +jedi/third_party/django-stubs/django-stubs/core/serializers/base.pyi,sha256=5Lcy5QIKxdt26oPFUeZS6ix1WGk7UlsFLnYLFCgM-GE,3388 +jedi/third_party/django-stubs/django-stubs/core/serializers/json.pyi,sha256=mAtdKicHMrrrYDSb_3TUv5lhhg41Rbdukqrupkc8SqI,422 +jedi/third_party/django-stubs/django-stubs/core/serializers/python.pyi,sha256=QctI1p3qqQiaqLpGJdLwvIvECRDz5taXFR1ElFZB1x0,535 +jedi/third_party/django-stubs/django-stubs/core/servers/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/core/servers/basehttp.pyi,sha256=7PZLnV2hBprVabl_Ph9E6v0w4pjdXcbWKP49uijiD1A,1301 +jedi/third_party/django-stubs/django-stubs/core/signals.pyi,sha256=oSxvwX4-JFULZ6XVH3IH9fIoB7yQP7qWf1q2ifN1wNw,163 +jedi/third_party/django-stubs/django-stubs/core/signing.pyi,sha256=nMLdl0czCgg1pQPSO-8Y8DRyUlbk6t_czM4GzRe1pAA,1467 +jedi/third_party/django-stubs/django-stubs/core/validators.pyi,sha256=EeHJ3xcX9cpZ75vv8vVgZ7XdrRXHU0x8c40lJYMq9G0,3934 +jedi/third_party/django-stubs/django-stubs/core/wsgi.pyi,sha256=6VtHyJCF0P4EmH0PppqXcZMZ3kV75FuSjKglcvueZ9M,98 +jedi/third_party/django-stubs/django-stubs/db/__init__.pyi,sha256=RFbCnbvJwrVkhhkwk-OUM4Q7hCIx88ESSptH3qqQGhE,936 +jedi/third_party/django-stubs/django-stubs/db/backends/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/db/backends/base/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/db/backends/base/base.pyi,sha256=NvNs0Fpr2hOcUhZu0WswbNUaxheO1_haci7_WcMnFgs,4348 +jedi/third_party/django-stubs/django-stubs/db/backends/base/client.pyi,sha256=M2_0vbL99q0t6Y0mKHT-TJ0FHOnXrfz0UFVxQxHIqWQ,274 +jedi/third_party/django-stubs/django-stubs/db/backends/base/creation.pyi,sha256=x9cz11-3RbcDHEAmN2Gr6Efvg3wMqhMx1tweI_z8jbU,1103 +jedi/third_party/django-stubs/django-stubs/db/backends/base/features.pyi,sha256=cbWlLXRFXtvJTHSOm71kTMmvlYLvzVejJ6PIu4_R5PM,4244 +jedi/third_party/django-stubs/django-stubs/db/backends/base/introspection.pyi,sha256=CGlvGS9dFb32sBC_llaLmhVlBxwcO26JTsdA3mW8-9A,1490 +jedi/third_party/django-stubs/django-stubs/db/backends/base/operations.pyi,sha256=-k3Ca4u2vUCVTYS04vxgzD-XpX7PCE9o6RBP_--kJKs,6237 +jedi/third_party/django-stubs/django-stubs/db/backends/base/schema.pyi,sha256=PrP7x6JM2lfZFJcZYIXN7OjevwSeJXHX77uIkFFGcv8,3346 +jedi/third_party/django-stubs/django-stubs/db/backends/base/validation.pyi,sha256=c-X0DuxTKiXBUrZ1xrN2vxE9EC0hRfG2aS3tg3ikZyI,386 +jedi/third_party/django-stubs/django-stubs/db/backends/ddl_references.pyi,sha256=WsOtVIe0GMwG-3kuNxjJaAjg7NDl0FgPfKAIufsvIDY,2657 +jedi/third_party/django-stubs/django-stubs/db/backends/dummy/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/db/backends/dummy/base.pyi,sha256=Bybortoqc2aftoDUI9JOW6B3eA8RmtNnPI8IswCBw_w,1029 +jedi/third_party/django-stubs/django-stubs/db/backends/mysql/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/db/backends/mysql/client.pyi,sha256=LuRBeD30YTt7ZKkIy0QPI5cUoCdDkcFUphPF3P6VHmU,383 +jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/base.pyi,sha256=m4ZIq3xup97EwKqz215v0DPzkl64DGJ8ckiJOzWkPHg,459 +jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/client.pyi,sha256=KnnW4cVB55-O1rySn8y0wxf1HmInCvUppc4Ylzg1HVM,281 +jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/creation.pyi,sha256=fnJLgXWLVw9MDbkPM_PrlgCNeEovyRFWahmCpmGtL9A,117 +jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/operations.pyi,sha256=8l4IrNRrQZJk-LLbH3zGWqgpTmBXA2-rUsP76GgpY_Y,125 +jedi/third_party/django-stubs/django-stubs/db/backends/signals.pyi,sha256=fLFzAfAJ6fuAuy0wVTa0zHBeFCgG7bMLOi_kT7diVBs,69 +jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/base.pyi,sha256=bVWwqWyV2s6IXlN9-njHCzdAwLlhw05GFlNq9QT-xG0,349 +jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/creation.pyi,sha256=fnJLgXWLVw9MDbkPM_PrlgCNeEovyRFWahmCpmGtL9A,117 +jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/features.pyi,sha256=QBNQPU-dQwPzmhxGH3AcxhgcJ5rCwtLeWJbelW3Lw3E,117 +jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/introspection.pyi,sha256=7bAlv3kwuzQxii9IDzIOLFHKsr2_TjCkC9wBFmEB2CQ,363 +jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/operations.pyi,sha256=8l4IrNRrQZJk-LLbH3zGWqgpTmBXA2-rUsP76GgpY_Y,125 +jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/schema.pyi,sha256=LYEtIfhLNap5vTN1wwBi2NvjgvyRQPhbFpMAYOybr68,127 +jedi/third_party/django-stubs/django-stubs/db/backends/utils.pyi,sha256=yDvBVaKmX_paln-6-vFqr6EQt-vqucdEqkZm3UKvpnA,1835 +jedi/third_party/django-stubs/django-stubs/db/migrations/__init__.pyi,sha256=hhLMlg4osD2PgLKlq76pVHYWqPXZMnA4BpE9v8tDWyQ,243 +jedi/third_party/django-stubs/django-stubs/db/migrations/autodetector.pyi,sha256=xQmcpsLs8jTPIMGuwaASncuUExFQeutQDKJdzNwjAQE,3011 +jedi/third_party/django-stubs/django-stubs/db/migrations/exceptions.pyi,sha256=qoLgU_vrG4a68pzirMdWXBunpPEbYOxdV_m7hJrfKh4,709 +jedi/third_party/django-stubs/django-stubs/db/migrations/executor.pyi,sha256=0s4j-NtGdXyt6dN-GUzjQfPmvvuZAiO-qph4OSIk0_I,1679 +jedi/third_party/django-stubs/django-stubs/db/migrations/graph.pyi,sha256=gZ2DtdRW8WGaNagYSS450xy37jIEYHwXrp4NK6UEUfo,2531 +jedi/third_party/django-stubs/django-stubs/db/migrations/loader.pyi,sha256=FzXHEFMvG28529zVgYPqvIUVmgu4b6ItJHmyLDOcjsU,1547 +jedi/third_party/django-stubs/django-stubs/db/migrations/migration.pyi,sha256=EC3sKQH__KdAQHdtVlB9Mdng9PZRjXfRr5kq_C4QIsU,1064 +jedi/third_party/django-stubs/django-stubs/db/migrations/operations/__init__.pyi,sha256=7V9NE9LUjCDMmYRbbA_DpyByGdwqYJGP4PP4eb9irGM,796 +jedi/third_party/django-stubs/django-stubs/db/migrations/operations/base.pyi,sha256=Yf5Kls_4hSQsIXjlL9OK08vwdBoC-U9HZUEqFAgt3iU,902 +jedi/third_party/django-stubs/django-stubs/db/migrations/operations/fields.pyi,sha256=K3iNfmrU5ih3R9q5iWbWd9vzvwfdKEI5t1mTSOQp6PM,1166 +jedi/third_party/django-stubs/django-stubs/db/migrations/operations/models.pyi,sha256=-PMXj0mF4RpqFF5EfGbXLjb6OL6M3N-IiLppkp1zhNU,3154 +jedi/third_party/django-stubs/django-stubs/db/migrations/operations/special.pyi,sha256=IUylNYPs2amdxe0LXDpAcgG38E6MidF-HqfSXB-rqT4,1340 +jedi/third_party/django-stubs/django-stubs/db/migrations/operations/utils.pyi,sha256=c3JLPgnNvLkXPqd58STsQgONi7i1eUn081TgQaGOehY,217 +jedi/third_party/django-stubs/django-stubs/db/migrations/optimizer.pyi,sha256=4oDcfA4PXyGPtc1C6MmknB-6TaaNtYdeWSyE7JTmMzk,343 +jedi/third_party/django-stubs/django-stubs/db/migrations/questioner.pyi,sha256=734ewVOcc5I9wlAUW2DJ8BVBqACx6C1pm4cHY0ZlwUo,1156 +jedi/third_party/django-stubs/django-stubs/db/migrations/recorder.pyi,sha256=j2th14mIxchOJ3s1ar2nbloAI6Xy4wiVDitnw-i9snE,806 +jedi/third_party/django-stubs/django-stubs/db/migrations/serializer.pyi,sha256=GRls6awL8QgjOVzgNassbBe6H4bEhT1h1vgdjxD97T8,1828 +jedi/third_party/django-stubs/django-stubs/db/migrations/state.pyi,sha256=3Hflqo8oiCVz-oSprFYyKetkhQsjU69QtTViZimP5Q0,2640 +jedi/third_party/django-stubs/django-stubs/db/migrations/topological_sort.pyi,sha256=NJzfRJYQwJeJS8fCVme_hYGsbrt14h7EGAcs2W0fmL8,348 +jedi/third_party/django-stubs/django-stubs/db/migrations/utils.pyi,sha256=yRlE8__8quhMrlAMU1F282hQftrxxiSQbja20o8hYmc,207 +jedi/third_party/django-stubs/django-stubs/db/migrations/writer.pyi,sha256=cNq1r8wj7KawULnICxXBTWDqO0QVGCoBKLls3O_o48M,1441 +jedi/third_party/django-stubs/django-stubs/db/models/__init__.pyi,sha256=7nR-mr7WV8G0f6Cs5Hcblfww2y2WzC1oQxd31mhnx0Q,3576 +jedi/third_party/django-stubs/django-stubs/db/models/aggregates.pyi,sha256=PrOHocknn7Wmh2aq93_WVq50dx9SOifIIBHvN8F6GVE,501 +jedi/third_party/django-stubs/django-stubs/db/models/base.pyi,sha256=77FrtJ8O86v8HFichcpzYvYxYetw0sS1ArGFdd10uNc,2400 +jedi/third_party/django-stubs/django-stubs/db/models/constraints.pyi,sha256=CXaVfiv0tWcDNPkxg8j7s1Be-teHkwMVuYZLZtMVasM,1089 +jedi/third_party/django-stubs/django-stubs/db/models/deletion.pyi,sha256=GEJcVeD0a_5KMj6u_kVxGQ1ezJj7rW5iccRZkQitN00,1149 +jedi/third_party/django-stubs/django-stubs/db/models/enums.pyi,sha256=Tu87vXSWCvRlSS_Sq3k8aptOXzmMF9JQj4Hk6pW3m3s,814 +jedi/third_party/django-stubs/django-stubs/db/models/expressions.pyi,sha256=QmaztG7k_UEThUZgtlDcwHxQASmil4xVM8ZfG6HQ-cg,8583 +jedi/third_party/django-stubs/django-stubs/db/models/fields/__init__.pyi,sha256=7cRcjZV7AVblUEXaAnQfzpnHX5yqCmenp8fyr9Ce_vA,13788 +jedi/third_party/django-stubs/django-stubs/db/models/fields/files.pyi,sha256=5EFmMvl68KKIC0O7BG7w4f-CEmLvtlxPHswHC8AtHTA,3640 +jedi/third_party/django-stubs/django-stubs/db/models/fields/mixins.pyi,sha256=myGDhO7COLmmouchsjRU57lQpXnJahzqaffXmya4r6c,453 +jedi/third_party/django-stubs/django-stubs/db/models/fields/proxy.pyi,sha256=HJvfUvqFTmnGwe3bZs0eHumpAvOdFYTJeX-KzOPvR80,161 +jedi/third_party/django-stubs/django-stubs/db/models/fields/related.pyi,sha256=6kgc4LA0vqc4JVg0Q9GRkHDuKr_6IfHwxVAoYFly2-I,9289 +jedi/third_party/django-stubs/django-stubs/db/models/fields/related_descriptors.pyi,sha256=foBVVlhgtaoOz6iRbAmh5Az18ZNbxND6gDncol863WA,3184 +jedi/third_party/django-stubs/django-stubs/db/models/fields/related_lookups.pyi,sha256=tPhBih5TNsVbpZ4_j-HM5Gt8tehukUcWxh-cnzARJw4,1500 +jedi/third_party/django-stubs/django-stubs/db/models/fields/reverse_related.pyi,sha256=EzSzqqZdtRcfUwzFDBZLZu8Nw1wbx5fyiyjzTfcSDEk,4045 +jedi/third_party/django-stubs/django-stubs/db/models/functions/__init__.pyi,sha256=zwujZ_mDvMGvDG7PZntnImLITlio1OMJlvuvH0hwmlk,2077 +jedi/third_party/django-stubs/django-stubs/db/models/functions/comparison.pyi,sha256=zMX1rKOTcfMhIyWmstp9DLfT06lDE7Yz-znCQVan-OE,312 +jedi/third_party/django-stubs/django-stubs/db/models/functions/datetime.pyi,sha256=YuYkZO0-rVO_6ChthbPlNHuB24w33RMSLAsipoUTn0s,972 +jedi/third_party/django-stubs/django-stubs/db/models/functions/math.pyi,sha256=4rGyuph9f9-2jlUnUDcCm2DKhTgkHvU4w2UOuGTzd_I,1222 +jedi/third_party/django-stubs/django-stubs/db/models/functions/mixins.pyi,sha256=HW4qO_JX_b1oScltR83xx0ekxCrXcvFMFZNCf6Hp5DY,100 +jedi/third_party/django-stubs/django-stubs/db/models/functions/text.pyi,sha256=8oIROhzzKZO1b8MvEmARBx4LgmfDNG-2ZRoNpYsK3yU,2228 +jedi/third_party/django-stubs/django-stubs/db/models/functions/window.pyi,sha256=poxMB0VKvi7XGx_8imATTi1aaOTGcEuaPLCv3zifFC0,702 +jedi/third_party/django-stubs/django-stubs/db/models/indexes.pyi,sha256=eKOgHZWF1_TUVZl3a8W3UpoDf3N73D07NU5Iw1qiaGE,1241 +jedi/third_party/django-stubs/django-stubs/db/models/lookups.pyi,sha256=BI1Ly6Sa_U1zDza00zTlC3pPF-bI4eKKev4L2bTlmqE,4475 +jedi/third_party/django-stubs/django-stubs/db/models/manager.pyi,sha256=w5myME9kNAigRReNYiUSNGjRzLUGWcwoqSfd49zmWH8,1796 +jedi/third_party/django-stubs/django-stubs/db/models/options.pyi,sha256=YC_LwZgqFGmUtfNhVmfRRTjSpTKpMCWbh8MxSXdLuoM,4993 +jedi/third_party/django-stubs/django-stubs/db/models/query.pyi,sha256=I04vyx6gHnK0Wm2atkwItk31rQBzNt2WwUx0u9YiB2M,9202 +jedi/third_party/django-stubs/django-stubs/db/models/query_utils.pyi,sha256=_FWehOpztavNcVxGBrAg7VFLdUNJeRigE7dqPt3-PDQ,3011 +jedi/third_party/django-stubs/django-stubs/db/models/signals.pyi,sha256=UvyKPck5LFYqOCeet0Z9HCxbtF9HKOofVak2mnyfPqM,850 +jedi/third_party/django-stubs/django-stubs/db/models/sql/__init__.pyi,sha256=mcrelxpwAAcq3e68wtJ3Y8vbb0JwRwln3GFy3PXTBf0,219 +jedi/third_party/django-stubs/django-stubs/db/models/sql/compiler.pyi,sha256=01_nE7RT8qgJbDsvul5mI-vifLFTQAwk1ETcJxc3U60,4712 +jedi/third_party/django-stubs/django-stubs/db/models/sql/constants.pyi,sha256=wqrVp2CmNwQGTE6G48hxopiddIaPjheG3aF0bNrfrxI,262 +jedi/third_party/django-stubs/django-stubs/db/models/sql/datastructures.pyi,sha256=aP3H2772NScQipXPMjWN8hReyS1cMtP35Tj0FOV0tTo,1909 +jedi/third_party/django-stubs/django-stubs/db/models/sql/query.pyi,sha256=HT_Qr-1R-rZvhpcYgMxLfWT3Xu82PmfvP7JyXNKMKgM,9072 +jedi/third_party/django-stubs/django-stubs/db/models/sql/subqueries.pyi,sha256=AvzqhSc6nWUiriu4jd62PAQt77fJ004mIDDuuzWpJu0,1828 +jedi/third_party/django-stubs/django-stubs/db/models/sql/where.pyi,sha256=SF_adSLaf14MqiKd-bjuWeX9eZFMBEXstMHnZS9hlT4,1918 +jedi/third_party/django-stubs/django-stubs/db/models/utils.pyi,sha256=ooqtUE_Tbh7fBMCgqzG9BkkycU8Pj3fD-tx3OEkqMuM,157 +jedi/third_party/django-stubs/django-stubs/db/transaction.pyi,sha256=8jqZMjzJCdLIVsBvkw_2elm7gagC_80GoW1SnhbmOs0,2032 +jedi/third_party/django-stubs/django-stubs/db/utils.pyi,sha256=EalrPIBxRawmO26UrJuJmUTeXCB8x24ehargXA4Gm9s,1244 +jedi/third_party/django-stubs/django-stubs/dispatch/__init__.pyi,sha256=SQUYnc7LrrXNZN_Ch5JdeGL9HDU-gaTK6G4Yxrr-rvc,78 +jedi/third_party/django-stubs/django-stubs/dispatch/dispatcher.pyi,sha256=mU0d9m4337GccA9rnNHlGm4xaj7ik5QY39cIeKK8VKM,994 +jedi/third_party/django-stubs/django-stubs/forms/__init__.pyi,sha256=4coCEFdYif8MNg0AXsb9poFP6Ih5OiB9Nytd_goGZmk,2957 +jedi/third_party/django-stubs/django-stubs/forms/boundfield.pyi,sha256=jiT0VOrFHPAwTTJYoFiHrtgZbVa8kxv8OjCwA_JuUSo,2308 +jedi/third_party/django-stubs/django-stubs/forms/fields.pyi,sha256=0F8m3ToEyszYNG0eB0VX-UgaYBlplgt2B1QPpmVAyc0,13037 +jedi/third_party/django-stubs/django-stubs/forms/forms.pyi,sha256=UHB2YbGoqojA9mu6mH7vFcHyFTgSa_y7cTcv7h2pF2s,3096 +jedi/third_party/django-stubs/django-stubs/forms/formsets.pyi,sha256=PWlKGK54Iu7khVNdt8nkqFnAHvlF1LkZCPttxU5jRpc,2397 +jedi/third_party/django-stubs/django-stubs/forms/models.pyi,sha256=B3ET3PjsUBJQWUasxTXCEOmoMsL9EOfdNTDnpchkzvw,10173 +jedi/third_party/django-stubs/django-stubs/forms/renderers.pyi,sha256=GSv3bIQiNtMy2NxLMWqZMSpGNQTJQUygIDYCecN41uE,724 +jedi/third_party/django-stubs/django-stubs/forms/utils.pyi,sha256=MgzO6rPlH29FFb7nkg-7ZSQYUjvQ92m-gqiS-bq5Z2w,1257 +jedi/third_party/django-stubs/django-stubs/forms/widgets.pyi,sha256=xO_oOqc02RaK07qV-g17bKBYlXyFhmRie6Nqrb5eq0o,6094 +jedi/third_party/django-stubs/django-stubs/http/__init__.pyi,sha256=tpXEfW48QUEnzOLVM9glXI6MLX3VX6_a-DmbzjIhvF0,988 +jedi/third_party/django-stubs/django-stubs/http/cookie.pyi,sha256=alynIOZMj8djeNCol-x2_mSUeNUtoO-stYZrboEDHnQ,102 +jedi/third_party/django-stubs/django-stubs/http/multipartparser.pyi,sha256=tq4nBvZN_mSeNC82urno1t2JhEKAqkXOPHpno5LIglQ,1986 +jedi/third_party/django-stubs/django-stubs/http/request.pyi,sha256=hxikJdIej6joG5W7mcj6h74Je5DvynLBpaoYT4vmxfg,3786 +jedi/third_party/django-stubs/django-stubs/http/response.pyi,sha256=JpWbTjhXgAGp7qotHfUTgHRLXoq49jL7YRDNrsjRi6Q,4994 +jedi/third_party/django-stubs/django-stubs/middleware/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/middleware/cache.pyi,sha256=2eNzy0MekvcFiR52WXQ1er12Gl3ZPNaYQBAesnRkaWM,1095 +jedi/third_party/django-stubs/django-stubs/middleware/clickjacking.pyi,sha256=KcQDinOFpxOnJt_bWJpFLk350ceGcODerjF3xcc4gEg,387 +jedi/third_party/django-stubs/django-stubs/middleware/common.pyi,sha256=KmN-G-bFLmSpqbZYXKF2rCWFbyT1thGKKQVscfCdLGQ,987 +jedi/third_party/django-stubs/django-stubs/middleware/csrf.pyi,sha256=-jr3w2lhfv_YPC74qNWZ_r8-CQ8jaJz9AU7c5te2FGA,1250 +jedi/third_party/django-stubs/django-stubs/middleware/gzip.pyi,sha256=If78A7dw_ILgnSCY2L8wkjNF2qqk7SkBVK17WAxVx7Q,339 +jedi/third_party/django-stubs/django-stubs/middleware/http.pyi,sha256=mdaMBPWaWuwjz0g400w1t5N3TkNGL9dG-TCmmkbAOd0,369 +jedi/third_party/django-stubs/django-stubs/middleware/locale.pyi,sha256=typ6K2fi1-vG64j0GVCSAXKCKzcpzmVE2bdDzoe8bes,423 +jedi/third_party/django-stubs/django-stubs/middleware/security.pyi,sha256=4ee7wQgRxiwpP_vwfG5IM68TYyCGpVPuTYEwp8uoM88,715 +jedi/third_party/django-stubs/django-stubs/shortcuts.pyi,sha256=WRzWWQatCnOL3yp2KLZ1H6b35J-eq3H6Ipk66YA2Y6s,1972 +jedi/third_party/django-stubs/django-stubs/template/__init__.pyi,sha256=87Omlyr7XLi5x8bbxTBby2htPXGn79eytzb2jguf2EU,648 +jedi/third_party/django-stubs/django-stubs/template/backends/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/template/backends/base.pyi,sha256=iHw-0xrm6rTptCjmp4N7VEZZRSHEGacxetcQotMVyBU,601 +jedi/third_party/django-stubs/django-stubs/template/backends/django.pyi,sha256=Ds2mLWa5DQirwlyvcy9SzMQVJDbiuvrV5jpYvTUbwbA,706 +jedi/third_party/django-stubs/django-stubs/template/backends/dummy.pyi,sha256=jhUAbJ7I1y6I56DI71u6geDjdndUJn1Fu4RkNIGh7AA,478 +jedi/third_party/django-stubs/django-stubs/template/backends/jinja2.pyi,sha256=ROpMhGxnaNlxWdYlvRWhvdEIFS7HQx1dB-x_FNK1WuQ,581 +jedi/third_party/django-stubs/django-stubs/template/backends/utils.pyi,sha256=Sbwk0bMuzGHJqvrhODl47g0H0n_LiFl7YYOwjHHWGVk,211 +jedi/third_party/django-stubs/django-stubs/template/base.pyi,sha256=eR590K7BCZtsab-Strdw8ju0Luft-YxFl7gme_g9pto,6030 +jedi/third_party/django-stubs/django-stubs/template/context.pyi,sha256=F1mgkncBKN_OeGuDO-dR3dZoYKVE2pxIoFu7ZnAcKUA,3208 +jedi/third_party/django-stubs/django-stubs/template/context_processors.pyi,sha256=bMVI13GgofaJnXyDHRgj09wVxMt0sA1DxawMrzwAtQc,640 +jedi/third_party/django-stubs/django-stubs/template/defaultfilters.pyi,sha256=fFNBc7tz39VsgxpHu5pOGyI1hyjQ44gwpSkObxGe6VA,3651 +jedi/third_party/django-stubs/django-stubs/template/defaulttags.pyi,sha256=hvxjkL-tRoFTg1JeScbEUeiMYF5HrnDw2XQpN4aY0QU,7237 +jedi/third_party/django-stubs/django-stubs/template/engine.pyi,sha256=fVxtt56BiOR-fLxGZtYFwvJD_ygYgu9Bhy5I39c7QbM,2158 +jedi/third_party/django-stubs/django-stubs/template/exceptions.pyi,sha256=XKMDInGTVL9Zr_exfpi6tS-zliwBuK5Dwg2hU9ZwAiE,596 +jedi/third_party/django-stubs/django-stubs/template/library.pyi,sha256=wqpD6-eFu6CHuraBEiO37sRG2Zhmkea1rv0I9eR2StA,3079 +jedi/third_party/django-stubs/django-stubs/template/loader.pyi,sha256=8O6_g_3h_zkRVqC5OdBbHG0MvIcPNWDr2qszobREPsM,620 +jedi/third_party/django-stubs/django-stubs/template/loader_tags.pyi,sha256=uhPtslJdwFOhqdsWtTzgOPgTFle7rf_eeQDVmmwFCuI,2363 +jedi/third_party/django-stubs/django-stubs/template/loaders/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/template/loaders/app_directories.pyi,sha256=tIrBH9Efep-8HYF_maLVfKPj8eGF_xY4ZxB22AmZsNI,88 +jedi/third_party/django-stubs/django-stubs/template/loaders/base.pyi,sha256=XNXihk_WvxirQJ20BpEPQZqcOms77836aOJYjCLwMl4,476 +jedi/third_party/django-stubs/django-stubs/template/loaders/cached.pyi,sha256=WROvtCtkV0dc4-6h2KISA3zO_h_73eo2id2bxRzLiz0,564 +jedi/third_party/django-stubs/django-stubs/template/loaders/filesystem.pyi,sha256=n3c4eQtiR0RBWkrPXGY8fi3bRTjEPlOnpEwawsQlojQ,433 +jedi/third_party/django-stubs/django-stubs/template/loaders/locmem.pyi,sha256=7P_Vsr1xLb_8tZ4QxEFF-31souSiyLHH0cKqlEcwIPA,354 +jedi/third_party/django-stubs/django-stubs/template/response.pyi,sha256=j1Fl0YSJTvostAVTfkMYy8g2KB9YlP3DBTaAZBMdLbU,2344 +jedi/third_party/django-stubs/django-stubs/template/smartif.pyi,sha256=PAKYMxW4Q6JY0l8TLmwR7B90xy8IYnMXTf7e6Atog_w,1267 +jedi/third_party/django-stubs/django-stubs/template/utils.pyi,sha256=keI7BX8onKPNwTqz9O1Osr1Rk7ZiyPIntQOvsPBo8Os,558 +jedi/third_party/django-stubs/django-stubs/templatetags/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/templatetags/cache.pyi,sha256=u-SCt-L2RlRBD9xG-pVTkwhThwJ7eNazTInZFAXHPWg,682 +jedi/third_party/django-stubs/django-stubs/templatetags/i18n.pyi,sha256=gca9DVbprTHJzIGX-GCcxEUViYDYfH10HffLu3xK9Ik,3176 +jedi/third_party/django-stubs/django-stubs/templatetags/l10n.pyi,sha256=8OV4XSr_rPNMhLOzxVu00SzC9VEnmt4OTRZmMZRqDZc,429 +jedi/third_party/django-stubs/django-stubs/templatetags/static.pyi,sha256=cUQ9iIHKXWgJXY2Qh9M1VXFgD_ASyNQbkVk4Unwg7oo,1170 +jedi/third_party/django-stubs/django-stubs/templatetags/tz.pyi,sha256=da1r04-aB0s1v4PR4d_TKredXpVkZR-kluQw1q07V-U,1166 +jedi/third_party/django-stubs/django-stubs/test/__init__.pyi,sha256=FxU0Xt4wJj1Jf3kdcL0lt-dpEDUN1wFe7LsyMiJvjjc,671 +jedi/third_party/django-stubs/django-stubs/test/client.pyi,sha256=A8dwFxbKc1rfjesp2FlOT__QXWPU0aEBOVZHmkyIFsA,5593 +jedi/third_party/django-stubs/django-stubs/test/html.pyi,sha256=k-d7X-HIXjPYhPpAggZQ9GR6MvkBGh1XmY5PnxGnuOY,1203 +jedi/third_party/django-stubs/django-stubs/test/runner.pyi,sha256=0fO4ry5uDw6o-wvnoBhSf8snCK6gd5yTQqw6b1RVJjc,5210 +jedi/third_party/django-stubs/django-stubs/test/selenium.pyi,sha256=CKW-XlD6SUu9pLyxUt6p8l5uYzN-RjkrGqnji-Dup7Y,368 +jedi/third_party/django-stubs/django-stubs/test/signals.pyi,sha256=yBlj9hfd9baDs5gt0x6Ymdg9L4cOtqPe1TRg63VXxKk,986 +jedi/third_party/django-stubs/django-stubs/test/testcases.pyi,sha256=rUMMlG0haG8l9frb1RRgLMZZtRLKEV5a0JAsLJa7jOU,8273 +jedi/third_party/django-stubs/django-stubs/test/utils.pyi,sha256=GmKL_4fBsAa__tn0gXHPJeIq1MsiUN9utqm9t2fsJ-E,5436 +jedi/third_party/django-stubs/django-stubs/urls/__init__.pyi,sha256=nQLDuDGK7FnjTv35h5oWaHGxEj7LUxTpXHmM1bPV1n0,1197 +jedi/third_party/django-stubs/django-stubs/urls/base.pyi,sha256=RtQApc1gUSPpnAw1gm3HqvNai7lYb0k3r2kS6wcKMk0,887 +jedi/third_party/django-stubs/django-stubs/urls/conf.pyi,sha256=7wH1fulW8v9yZlqEy4yQFSGfVznjPJM1DC5V-ZiSoEY,224 +jedi/third_party/django-stubs/django-stubs/urls/converters.pyi,sha256=--viS0cndpAqzNeusl7RLKBVhsrPIoOikVgmQDNxGxc,827 +jedi/third_party/django-stubs/django-stubs/urls/exceptions.pyi,sha256=4UVr_L5SexIY1ok1zhdDAq1v1iyt7l0NiDdOu7i07lg,102 +jedi/third_party/django-stubs/django-stubs/urls/resolvers.pyi,sha256=gvKPNzAwWo1kE-wvLFhWk83C7qm1hsuF7CPPzCv9ypQ,4029 +jedi/third_party/django-stubs/django-stubs/urls/utils.pyi,sha256=aHMnJJ_yLIRc1jFBsuwInS1i07sg_TNCRFfpBdVliWA,168 +jedi/third_party/django-stubs/django-stubs/utils/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/utils/_os.pyi,sha256=o_1Okw2HuOcaOrD-_SzHIgSVDNmBShknGwqd5uat8ps,307 +jedi/third_party/django-stubs/django-stubs/utils/archive.pyi,sha256=uYtbaGft9lKuO5eEfMBWnmOX3lD-ztopvgNhLZaP4QM,1043 +jedi/third_party/django-stubs/django-stubs/utils/autoreload.pyi,sha256=C8KHbfg9nGyhfbNa56RXXP0v1rlIkTUvYw1zkmv3bOk,2702 +jedi/third_party/django-stubs/django-stubs/utils/baseconv.pyi,sha256=Myy9JlfWTJ29J8Oyiq-upqag-VfsPHg3jsuq7HHU9iE,593 +jedi/third_party/django-stubs/django-stubs/utils/cache.pyi,sha256=9ss0oBvIs1-gBExjVldryr4hESowSSeQdShVgMZdugs,1338 +jedi/third_party/django-stubs/django-stubs/utils/crypto.pyi,sha256=uccSZ_WsmWkCQ_4V6SQXOJd8NUn3FdyjnUbcP5K1I0U,543 +jedi/third_party/django-stubs/django-stubs/utils/datastructures.pyi,sha256=CUquMJUCgGCjeVUk3QSx9vVcZjmHKJsgVI3Vjqti1Zk,2624 +jedi/third_party/django-stubs/django-stubs/utils/dateformat.pyi,sha256=KLHBQh9aWgLYWbeqw2kiyQauGNDiKmadeMmltidGlrk,1782 +jedi/third_party/django-stubs/django-stubs/utils/dateparse.pyi,sha256=PX8c8e3ma-IOaj-F0RrBF4XTTVngSfkGNKt24AMy4qo,425 +jedi/third_party/django-stubs/django-stubs/utils/dates.pyi,sha256=eDDUi7Z7G3VU8h_6q4Z63l_7L2zgcyYuTE3yf-GSt-I,181 +jedi/third_party/django-stubs/django-stubs/utils/datetime_safe.pyi,sha256=fXQJdx9zqee-Jac6dhydWUMKvz8JzQYnKhwPsxiDnfY,341 +jedi/third_party/django-stubs/django-stubs/utils/deconstruct.pyi,sha256=6IL3eW3s2avXEeGE_oJW3Mxg6Hk3387euuFekBeHY0A,105 +jedi/third_party/django-stubs/django-stubs/utils/decorators.pyi,sha256=AEPbjOpQtJGpOjwrri-6wV2gzUIvNZ5EIVJVsTEushk,935 +jedi/third_party/django-stubs/django-stubs/utils/deprecation.pyi,sha256=yGFYy_fyf37-YpyWdalYAdQXCX8YLVCOgu8lQVVBxpk,1345 +jedi/third_party/django-stubs/django-stubs/utils/duration.pyi,sha256=W8vapfROyCEor7wRgPdoqY7cpLg8kFEqiAKHqjEYfUk,198 +jedi/third_party/django-stubs/django-stubs/utils/encoding.pyi,sha256=e-_D5ZVUcDKL6yXDbcj1BpXsovmfiOogb9ioT1j0vl0,2416 +jedi/third_party/django-stubs/django-stubs/utils/feedgenerator.pyi,sha256=fxf5z74HoHuKF_W1XVOxHMs1VbbD233GHN1o2pkMl68,2677 +jedi/third_party/django-stubs/django-stubs/utils/formats.pyi,sha256=WLkueQDaB2Gg2MTb_SxnFkpQpR49O6ogaZEKhy2JGFQ,1271 +jedi/third_party/django-stubs/django-stubs/utils/functional.pyi,sha256=_k802K-xEtUcEFBrH09Sxsh_7ObZAARVF12UAMGqkug,1923 +jedi/third_party/django-stubs/django-stubs/utils/hashable.pyi,sha256=l25xFctJPg50l6Y129bvdAFJc8QqefkXx40amy6LkhU,66 +jedi/third_party/django-stubs/django-stubs/utils/html.pyi,sha256=uRHTbSOfG3lG2pwS5CdKwRmnfAC2DSgG7UoWkrXZRFM,1366 +jedi/third_party/django-stubs/django-stubs/utils/http.pyi,sha256=zUCz7anMbyPWISp458GPg3TfnE6iehGn1LPBsPE6ru0,1544 +jedi/third_party/django-stubs/django-stubs/utils/inspect.pyi,sha256=4ifnyH12SSqy2OzqUkuJxvFGTkiirblPt4eo1Xu8GyI,391 +jedi/third_party/django-stubs/django-stubs/utils/ipv6.pyi,sha256=_VLusX7GiWNffbeDTqd_jnJPOdxyVS179DFuB61CjhA,168 +jedi/third_party/django-stubs/django-stubs/utils/itercompat.pyi,sha256=UpxNkxuzzgXwrBfRqew_8T5D5tx5WBsCTP933uGVHwI,61 +jedi/third_party/django-stubs/django-stubs/utils/jslex.pyi,sha256=_R3st8851lEA_sUS5i_Kneche-ZPrCtpIsBtzFQZS_U,748 +jedi/third_party/django-stubs/django-stubs/utils/log.pyi,sha256=yVMX_aEDnocTx6PpJgpvOLVqD-cCmBz9-DnFDpl5ckI,1501 +jedi/third_party/django-stubs/django-stubs/utils/lorem_ipsum.pyi,sha256=hM07Nj_QipTFShSP7PrhQxlwAlYcgcEpH3vXRF_gzcA,248 +jedi/third_party/django-stubs/django-stubs/utils/module_loading.pyi,sha256=sd6wFSrhzvHm648lgnvfdcmkR3PC8SPC925rP83DNkw,247 +jedi/third_party/django-stubs/django-stubs/utils/numberformat.pyi,sha256=tGq_aAmrf_lkWdZ4XUMlf4h0DUtc185bwfgJefaXYkw,344 +jedi/third_party/django-stubs/django-stubs/utils/regex_helper.pyi,sha256=REFgvf8HYnE-XsiepvPLjd2HZyMWlUJDC2ILtUDS0Ws,658 +jedi/third_party/django-stubs/django-stubs/utils/safestring.pyi,sha256=G4jCaiDDv7gb75b9pJFVMOVRZfnECaDk0JYn8jZmxag,629 +jedi/third_party/django-stubs/django-stubs/utils/six.pyi,sha256=fGwtJGbkPulV7pzqEeAdgzVv6z2mDiFtgtios6tWzS4,3408 +jedi/third_party/django-stubs/django-stubs/utils/termcolors.pyi,sha256=gqCN0etzSjG8bN21K_j1d1Jw0UaluPrlEznqx36bGek,517 +jedi/third_party/django-stubs/django-stubs/utils/text.pyi,sha256=ZbmkpySA5CNdPKorDNm5WHh0n0hcF7pp8vI_35z2Bw4,1583 +jedi/third_party/django-stubs/django-stubs/utils/timesince.pyi,sha256=7qwEhIWEQeKk71J8pQJzr7QCljggRtDHEs8-GUiiLOU,362 +jedi/third_party/django-stubs/django-stubs/utils/timezone.pyi,sha256=S6fV8Ub-gZuQzIPWx7RSlugjjcWQFDJVlPxFnq280tE,2714 +jedi/third_party/django-stubs/django-stubs/utils/topological_sort.pyi,sha256=vaxSleSm6rJ0axW_bodRRXA6a82056AxplxL7hbdwTY,297 +jedi/third_party/django-stubs/django-stubs/utils/translation/__init__.pyi,sha256=Xb8uG790oIzlgTor_Czpto7O1o3slls-Yb1gRKqzFvc,2232 +jedi/third_party/django-stubs/django-stubs/utils/translation/reloader.pyi,sha256=WysOUTcv4mLco3UizcmXdD5Im-HrD8nrBy71A_3Phd8,299 +jedi/third_party/django-stubs/django-stubs/utils/translation/template.pyi,sha256=H4yDCnEfEMFUE4OIMg1FJYn9cvj5CbQRv1zeokTe6QY,235 +jedi/third_party/django-stubs/django-stubs/utils/translation/trans_null.pyi,sha256=x7RjAzIctThGOsg6ZKE0NpO6ekKpl1TgsCxaop9G864,729 +jedi/third_party/django-stubs/django-stubs/utils/translation/trans_real.pyi,sha256=uXK53giQyz6hE5WsJPBCkBepZjw9Ljxhwhqk7MLYo_I,1815 +jedi/third_party/django-stubs/django-stubs/utils/tree.pyi,sha256=sR1J0tJzZIGobNu8-XiJ2qr94SlwiM164sF8lD5-8aE,799 +jedi/third_party/django-stubs/django-stubs/utils/version.pyi,sha256=kwDgHzvG-PW5Gs-2ch8lTduLItyo4asFa509YOQd15A,516 +jedi/third_party/django-stubs/django-stubs/utils/xmlutils.pyi,sha256=wGOSksvFX7wd6dl7Yoz836aEyZ-D6jxi4R9kBaaeEtY,433 +jedi/third_party/django-stubs/django-stubs/views/__init__.pyi,sha256=aq7HMnOVrisbvfSuGERsghE8UbQzyGkJq-QpU0Tcv9w,39 +jedi/third_party/django-stubs/django-stubs/views/csrf.pyi,sha256=IWUdDCiJjyVfGZHpN0fHH6nu7yYmVbXyDvWg-Bea23Y,274 +jedi/third_party/django-stubs/django-stubs/views/debug.pyi,sha256=4oGmtVDkDja_yZdqDmfpXGR7-UncwY28nsYv9posmrY,2781 +jedi/third_party/django-stubs/django-stubs/views/decorators/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/django-stubs/django-stubs/views/decorators/cache.pyi,sha256=HNIBcnkLIFOVKkhlD6NCF8hX3MWGBr6pclv27ty-1LY,303 +jedi/third_party/django-stubs/django-stubs/views/decorators/clickjacking.pyi,sha256=Ok9pqjwji2pR7WQPLtZ1CrRu0W9ahdyb-JaP6c4wq5c,247 +jedi/third_party/django-stubs/django-stubs/views/decorators/csrf.pyi,sha256=AWLjm6s5aCI5QnU96JbH6Y5UZxMrmpY227yLDq0jf78,477 +jedi/third_party/django-stubs/django-stubs/views/decorators/debug.pyi,sha256=wZ1YJ1dKztkQ6wd3ED0G6G4l4WuHSRcABy5qOlmFYCo,157 +jedi/third_party/django-stubs/django-stubs/views/decorators/gzip.pyi,sha256=Xjc5S0snvNoApW9JpvSQUhGypsjoCUE8bC0HwaVdL4k,129 +jedi/third_party/django-stubs/django-stubs/views/decorators/http.pyi,sha256=ZTJ_lLWuXIdnX80y1OA230O8ep50pxlSa2acazv-1gw,576 +jedi/third_party/django-stubs/django-stubs/views/decorators/vary.pyi,sha256=yKYeW6Fa4M_bbOYU0evNeMS_0ly-9ZCJonlkD_VqhRQ,181 +jedi/third_party/django-stubs/django-stubs/views/defaults.pyi,sha256=qnKCAJ0gMNl7y0DbyQRDVDm0WnR7iWhIAFZgsILVQqY,814 +jedi/third_party/django-stubs/django-stubs/views/generic/__init__.pyi,sha256=RMzs5h07bv50ftLnRSYnrWOJXkth7PTyU5odn0GCw68,637 +jedi/third_party/django-stubs/django-stubs/views/generic/base.pyi,sha256=EcfZBLJd_E_yktw5j8YYeCKO4OKdOnY8Pns7x9XT2BI,2239 +jedi/third_party/django-stubs/django-stubs/views/generic/dates.pyi,sha256=sV3GQ35fJCDh5I19zVFQkvEHhkIUeVyHqQ9UBRRBVRM,3771 +jedi/third_party/django-stubs/django-stubs/views/generic/detail.pyi,sha256=PNnYL1e7LJxYr71wI93v0kuwfra8YGOHZvD6-1wIodA,1090 +jedi/third_party/django-stubs/django-stubs/views/generic/edit.pyi,sha256=-ngfSEOCkreuUeU0XcL9s1eNWnZHlPw6VlxdUYvix5E,2234 +jedi/third_party/django-stubs/django-stubs/views/generic/list.pyi,sha256=-Hj-OCJw6BgmXFsUgNHSJfeeECrpyqbBWShSLxJaveU,1625 +jedi/third_party/django-stubs/django-stubs/views/i18n.pyi,sha256=uL-yCYqHyEFkfL2He_UTt_OnBnom8TlqhAquvxMd1Sc,1257 +jedi/third_party/django-stubs/django-stubs/views/static.pyi,sha256=tX0ADulNf2Yh6fJhKh6PSS9a8AsAt1gijAMu2iehhP8,461 +jedi/third_party/typeshed/LICENSE,sha256=tBt49WKi5lt1yrRDVDNfb0NdTvcwZVCWAKyRDPTiL-A,12658 +jedi/third_party/typeshed/stdlib/2/BaseHTTPServer.pyi,sha256=Vn3aoORkJvQiWROghZboBponUuU0XcmMJUo2B7nnB7k,1864 +jedi/third_party/typeshed/stdlib/2/CGIHTTPServer.pyi,sha256=rdxnw2EN6dD6Pg5XTZf35L0pm-REuAx-p4Qlh2Pr3FI,227 +jedi/third_party/typeshed/stdlib/2/ConfigParser.pyi,sha256=ho-0DQ8rivi9g0lA2JVkMQz00N0ACtkPvYcBy0Fu6kA,3882 +jedi/third_party/typeshed/stdlib/2/Cookie.pyi,sha256=Ke_iU9vRRHFMkJrben9gxXLss3nTR0bw5ZPvN_abYdc,1342 +jedi/third_party/typeshed/stdlib/2/HTMLParser.pyi,sha256=V35P__PdBxNcAMqIkcGU5xes5G6TrIRaKwZyTU49_Ok,1067 +jedi/third_party/typeshed/stdlib/2/Queue.pyi,sha256=rM6dyHkpzO556CaTq3C2zWROSzHzAPE73o6c89a0q8g,925 +jedi/third_party/typeshed/stdlib/2/SimpleHTTPServer.pyi,sha256=f-YKJ8pTFBvLCfzHkdC64Pl68X3z-EzJCzjrFN7GXHw,689 +jedi/third_party/typeshed/stdlib/2/SocketServer.pyi,sha256=gSrcQtIyOY1ov9ys8s4P_CnN3bx5GjZRPC8kQb0g9SA,3950 +jedi/third_party/typeshed/stdlib/2/StringIO.pyi,sha256=DnD9yzaDJBRmDSO3Izj5iLRz0XhR0ME15_rKmGCzkEE,1179 +jedi/third_party/typeshed/stdlib/2/UserDict.pyi,sha256=SyyOjAg89p2GxW2l2Rh5K_LywO0wJOyDIrVDF3yWMx4,1632 +jedi/third_party/typeshed/stdlib/2/UserList.pyi,sha256=4QnPyFgdwmENrlNqRPFl_c9h9hGQddDmlyopbCgIYt4,630 +jedi/third_party/typeshed/stdlib/2/UserString.pyi,sha256=66KWkG76pLfFet3ZEgeSpKl44Ln9X1tcUeun1eaIJEs,3844 +jedi/third_party/typeshed/stdlib/2/__builtin__.pyi,sha256=bpOiyzZwfbnMPqo8RtBLmOFOzecZgI53YCjxP39SXdc,70641 +jedi/third_party/typeshed/stdlib/2/_ast.pyi,sha256=bbV7HmKQisI6P_yw61dS8eo5HTSaldhvNTHqNFAONYo,5777 +jedi/third_party/typeshed/stdlib/2/_collections.pyi,sha256=-8nglgcAOKkmzv4QZFAYjOczFffnanncc-Jyq9F5XUQ,1478 +jedi/third_party/typeshed/stdlib/2/_functools.pyi,sha256=X-Fg8iRti-ZpiUHzjlkBP6aqvy5AsKKUeZebm0fjz4s,645 +jedi/third_party/typeshed/stdlib/2/_hotshot.pyi,sha256=FCVHwEb2pK8iC_INUa4h4TM5BuRABrdejrhfx8EvvJM,871 +jedi/third_party/typeshed/stdlib/2/_io.pyi,sha256=FoP84phO0WcclH3ScbUqPGhWZR4Xv394BPto6DnVaSQ,7131 +jedi/third_party/typeshed/stdlib/2/_json.pyi,sha256=VkdGJetGOhdC1_e-3wjZdqwJtEmmH1oxWkbgvIukvRg,233 +jedi/third_party/typeshed/stdlib/2/_md5.pyi,sha256=pGqwb01a_RcSP1QRE8XtVPB0RKaoJOGuRdVk6pwvEag,300 +jedi/third_party/typeshed/stdlib/2/_sha.pyi,sha256=32F3_E2nGplztFti0fx5GwfPqobLiyg2rtTLHopfCw4,348 +jedi/third_party/typeshed/stdlib/2/_sha256.pyi,sha256=1Z5g4wLOL9-z6gasal2kMoBb7yBHPJMFSCgPts_GTRM,632 +jedi/third_party/typeshed/stdlib/2/_sha512.pyi,sha256=6AyOELlW_oDueP9i8yvirht0BdJO0itNx9-deuMYCeA,632 +jedi/third_party/typeshed/stdlib/2/_socket.pyi,sha256=6pmY5w0QnTNtTlqoljtwgqRovMX4yAwbO3-7J8tYY8Y,6309 +jedi/third_party/typeshed/stdlib/2/_sre.pyi,sha256=mfDfmucypU0R3GTJjHRrvq-N7wUv_0cIIzV3Je2qZG8,1976 +jedi/third_party/typeshed/stdlib/2/_struct.pyi,sha256=zB7QQMd3oHSGsrECKXYQM2H1IMlKLh32nktw7uTauLA,811 +jedi/third_party/typeshed/stdlib/2/_symtable.pyi,sha256=65zeM2TLj4T1XJ4bUsp4E6y0TQgCIP-plvkrZDtdQio,682 +jedi/third_party/typeshed/stdlib/2/_threading_local.pyi,sha256=HHs9DxAPqz-I_dN5h4Bv-Pq0SpYEUxFx-l1iK1jaA3Q,392 +jedi/third_party/typeshed/stdlib/2/abc.pyi,sha256=CcNQNUTi82hJu4vM2MwvHX9wbSm_HqozPs54vuvsdXg,1147 +jedi/third_party/typeshed/stdlib/2/ast.pyi,sha256=ZeErz44vozLzAXscRgNXeqCOwF8pHv0x6TjeQwOIXzk,1201 +jedi/third_party/typeshed/stdlib/2/atexit.pyi,sha256=RXUSKHd__cLe1yzGZ8er9pfHhGDHviF0S1LPNxCLp_Q,117 +jedi/third_party/typeshed/stdlib/2/cPickle.pyi,sha256=FVgtWCgzeEdiJJiIWfdEkRI5RKQvILZVdDUpSO8U_P8,801 +jedi/third_party/typeshed/stdlib/2/cStringIO.pyi,sha256=Cimh2tfh9f6Q0Tyf5dF6HHSHQf7x4KS6eHl03IolDus,2033 +jedi/third_party/typeshed/stdlib/2/collections.pyi,sha256=HUNGPxqJwjTrCe74Sv40zaNIm_SJOqrqa7JGgsxQZ0w,4986 +jedi/third_party/typeshed/stdlib/2/commands.pyi,sha256=512BGpfeWNdi0wFAXnH_NLFtmqsRbU3ORvZNyWPjrWg,331 +jedi/third_party/typeshed/stdlib/2/compileall.pyi,sha256=wT92EfMkifRVCeE6yMHcqxlOyAf-B9SRYtUjLKVVKOM,660 +jedi/third_party/typeshed/stdlib/2/cookielib.pyi,sha256=Q_CQUyeESJMliob9LHzxSHvzlQB5JFpCKaRfVfAaeLw,4521 +jedi/third_party/typeshed/stdlib/2/copy_reg.pyi,sha256=BsqFQ_hSsV_oqeJFO_GZ2J1tFl4EpnGZgx-NYmt_ZN0,726 +jedi/third_party/typeshed/stdlib/2/dircache.pyi,sha256=MvOj_3F6aQ5wvlvpb5pUJCSMDIknGd5dKJ0qSm4F1Y4,339 +jedi/third_party/typeshed/stdlib/2/distutils/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2/distutils/emxccompiler.pyi,sha256=oQAQE8Wj2vo56zJyq3SAO48bGYmQ9nagLIpx5jn90lo,116 +jedi/third_party/typeshed/stdlib/2/dummy_thread.pyi,sha256=755Cy6AXyEo3RowYk0pQm5I5mkAIE3yQrkWImnrlHOA,794 +jedi/third_party/typeshed/stdlib/2/email/MIMEText.pyi,sha256=4Hjv1f-LZwoj-ihndmbQNHdwpjOy6wUOJoKS_axJmNo,159 +jedi/third_party/typeshed/stdlib/2/email/__init__.pyi,sha256=iUDv6ttU1qT359eOAubG1JtxNmrJGu8QxH_aXPvOz9w,270 +jedi/third_party/typeshed/stdlib/2/email/_parseaddr.pyi,sha256=oqGaUf13WZALSq7cyULZ0c_6iFKjH8rdnAfAkm6y3Hw,1072 +jedi/third_party/typeshed/stdlib/2/email/base64mime.pyi,sha256=hcknR5OsGAU51g8EWtU48rFXHh7z8FaahWJA-7YdIWg,300 +jedi/third_party/typeshed/stdlib/2/email/charset.pyi,sha256=VVEUOTe1XZ824-FhBuIBrSCB16hMAnQ1Ygseu3Noc_Q,902 +jedi/third_party/typeshed/stdlib/2/email/encoders.pyi,sha256=s8kQE5AG1wvh0h0qbNn3_As6ExYQccVdg6Bx2PKGu8E,143 +jedi/third_party/typeshed/stdlib/2/email/feedparser.pyi,sha256=qgmZtVf0k_SLOC5o-l3_tHjV8dfgRYF9rgh0YslJzYM,537 +jedi/third_party/typeshed/stdlib/2/email/generator.pyi,sha256=nDbQYgf4oqSinAl-xZl3HxMhGYMjESOV7fZbkjash4g,378 +jedi/third_party/typeshed/stdlib/2/email/header.pyi,sha256=mFq0GIZXdDQRBWI9YwfsywG6tAaC8-fF9QtBbZnd_gE,474 +jedi/third_party/typeshed/stdlib/2/email/iterators.pyi,sha256=vPq5eJF8HBwFQ1hS--niEmurSl4x42YOrU65TxKk0Jc,256 +jedi/third_party/typeshed/stdlib/2/email/message.pyi,sha256=M3XzQbdji1k8_hygt88priwEMJqWKRixQsN4qDLmfeU,1950 +jedi/third_party/typeshed/stdlib/2/email/mime/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2/email/mime/application.pyi,sha256=3gseSXbGrYJqwLH7CzlZ6uClMHimFT-Sb4UCC53DXLo,427 +jedi/third_party/typeshed/stdlib/2/email/mime/audio.pyi,sha256=O0BQRyRkQpox5M_nbFORkWz7J_ff2o7tWYrRzXRd8hI,177 +jedi/third_party/typeshed/stdlib/2/email/mime/base.pyi,sha256=lG1Re_xRHsaw4WRUnLh1Jyneb4M6m8kxqa0NUfwuONg,128 +jedi/third_party/typeshed/stdlib/2/email/mime/image.pyi,sha256=i0OQt-93SokQjZ5qISYI1tgH7PWyXuw_fNnGvrtTfQk,177 +jedi/third_party/typeshed/stdlib/2/email/mime/message.pyi,sha256=5wSkIz4j47zMsBUkdxeYIHK4GYFlew2kHHlRwuCHhmA,148 +jedi/third_party/typeshed/stdlib/2/email/mime/multipart.pyi,sha256=1pTSK5lU6L5AJG5H35PTIQtHYIplMoipa7Kkd_m9HNQ,159 +jedi/third_party/typeshed/stdlib/2/email/mime/nonmultipart.pyi,sha256=C9WcyywCzQqkL9MPpSlWHgChmP04r0rrWVw3VlSVHQo,107 +jedi/third_party/typeshed/stdlib/2/email/mime/text.pyi,sha256=4Hjv1f-LZwoj-ihndmbQNHdwpjOy6wUOJoKS_axJmNo,159 +jedi/third_party/typeshed/stdlib/2/email/parser.pyi,sha256=9QChl7gsm0KPwZHUYy5tR_kZkmQpdSnxCwuZTnp9ceo,415 +jedi/third_party/typeshed/stdlib/2/email/quoprimime.pyi,sha256=ZRJzHi-3Fszfa8nRpz6EpGYZdSpLyGc4K3pxr1uyMUA,490 +jedi/third_party/typeshed/stdlib/2/email/utils.pyi,sha256=COa7JwpxlpBZAxOU6ThwyYU7o_7Bh5L-39Qxgd9IEdw,823 +jedi/third_party/typeshed/stdlib/2/encodings/__init__.pyi,sha256=eHh1KnNO7totX2eVsIUxfn5cNE_940T8PAX4eVYgP-k,94 +jedi/third_party/typeshed/stdlib/2/encodings/utf_8.pyi,sha256=tgCdNX8etJQWYWmOYAIZhK8lcYm_Kn67kylKJp0SgUo,573 +jedi/third_party/typeshed/stdlib/2/exceptions.pyi,sha256=caxfpKrLTonvEEp2cq2fA7CyGbeEE3RdY1G-TzTU7Lc,2640 +jedi/third_party/typeshed/stdlib/2/fcntl.pyi,sha256=9nfjW8glhBc2E_INfFIvYZByP0H_J4PsQePOSJJOwrQ,1561 +jedi/third_party/typeshed/stdlib/2/fnmatch.pyi,sha256=8kgI-ZZR0lhAGSuQk0M0kt3cYrYRx29bwhIg9ESvLbs,348 +jedi/third_party/typeshed/stdlib/2/functools.pyi,sha256=lNfYBP-DQB3oS0vJF8TnFrc5tNOWZlsnTfmgfYv-zGg,1262 +jedi/third_party/typeshed/stdlib/2/future_builtins.pyi,sha256=DbYFW8d39H2GuMb9XI4bXI23GxomislNrLbdhDqpkEo,226 +jedi/third_party/typeshed/stdlib/2/gc.pyi,sha256=iAjXpW2_tvA_JLuWswJT_S0UwokgA24kN8_mhR0onYc,787 +jedi/third_party/typeshed/stdlib/2/getopt.pyi,sha256=6hPbDzz4CuSglcyFspFGyWCNVW0AKygfMXPTD0LKI8Q,448 +jedi/third_party/typeshed/stdlib/2/getpass.pyi,sha256=wXXCl7EPrOCj-zmKjbUKe6wkVcdvECb6pjV91lKnsWE,192 +jedi/third_party/typeshed/stdlib/2/gettext.pyi,sha256=s9TQTyU5JIsWXWturgUTZnB6AXIRkdPohmRb-HzdNC8,2284 +jedi/third_party/typeshed/stdlib/2/glob.pyi,sha256=7Js1jrnzrtGyNCOKUL5z9RUe0ISki9kCT2ofpZFVutk,375 +jedi/third_party/typeshed/stdlib/2/gzip.pyi,sha256=fdKYU2jPcVb0a0XG8bhizK7xg1zoe4mxJMIzNneEKzA,1000 +jedi/third_party/typeshed/stdlib/2/hashlib.pyi,sha256=hy7FqcyGH1PYL4iHw1bCAe36_FKEPfNG2coF1e4Oe6I,1004 +jedi/third_party/typeshed/stdlib/2/heapq.pyi,sha256=Uwl92Rs8tnmAoEO_SB6UGbNgCoLdlLVkEHyMUZyF8lg,746 +jedi/third_party/typeshed/stdlib/2/htmlentitydefs.pyi,sha256=1dyH0i00daNQ_7gDuT-mxXzx-V_nDSRuF4q_vjkSUHg,114 +jedi/third_party/typeshed/stdlib/2/httplib.pyi,sha256=K5F-2VPE5Fd-Ym0WHdReg-E43Iycv-zrauPHGxTEhtg,5937 +jedi/third_party/typeshed/stdlib/2/imp.pyi,sha256=Nwy9qBm9V00qkJaM-H9cvcI9fTYgrjT1ofYnhLKFdFQ,1325 +jedi/third_party/typeshed/stdlib/2/importlib.pyi,sha256=N1OsqmcdpbeN7RTNU4s2zQgnoQhkwECT5z5bv035F-g,134 +jedi/third_party/typeshed/stdlib/2/inspect.pyi,sha256=FdpFo3cqL9euZQPvb1YXOM0lDJXv2rKsj7NL6nojW7Y,4589 +jedi/third_party/typeshed/stdlib/2/io.pyi,sha256=zU0_W_RPG8ymcyG3GnFdOGt8FGYDxSYQFs5Vv5JYS9Y,1463 +jedi/third_party/typeshed/stdlib/2/itertools.pyi,sha256=MbWXms-mT9r6kt8tv6FGrTFp7a-cFj5WbnrAlKqATnI,6499 +jedi/third_party/typeshed/stdlib/2/json.pyi,sha256=oucI1k3DW7J2sAsQA3wGNdduGFY3Zxr-n0jSUQVr-5c,3777 +jedi/third_party/typeshed/stdlib/2/markupbase.pyi,sha256=spypPmrwD5qV88nR7U1R28WjGvm6TG8gs6N6H4NER0Q,265 +jedi/third_party/typeshed/stdlib/2/md5.pyi,sha256=ujmiPT-VQ7K8Y673_oOxDFCFDaVvnRx1Yul5DKxi7EY,118 +jedi/third_party/typeshed/stdlib/2/mimetools.pyi,sha256=KBcWPPbifAysN1-9XBAOyscxCcohCiAnBDmr59W4Ibs,703 +jedi/third_party/typeshed/stdlib/2/multiprocessing/__init__.pyi,sha256=XpfjArCYhOm_T5Adz62fXLzc8VgA_s9E76M-n8DyJPo,1931 +jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/__init__.pyi,sha256=6AorQihgpvOdhn3sBii5Y6zUXGJ2ZAFWvAsyZG7tnho,1417 +jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/connection.pyi,sha256=Ity8sABpKaHetJvDymCCZcseWDEUqo2uugGYTh-IcFw,674 +jedi/third_party/typeshed/stdlib/2/multiprocessing/pool.pyi,sha256=ftkDdxJ5gEsSisA6dUgFoJRJrQ0aX0q4KEvGclJHk-A,2387 +jedi/third_party/typeshed/stdlib/2/multiprocessing/process.pyi,sha256=JgII3YNCNgvsmGPA1DL6kiA-X9xHWFxQ4Dhxaujfwec,909 +jedi/third_party/typeshed/stdlib/2/multiprocessing/util.pyi,sha256=fxZwUYlKqIXEwtNLRKqXRfL17uagU7XyWIvgQcGTyls,758 +jedi/third_party/typeshed/stdlib/2/mutex.pyi,sha256=Cqj7xmY36at4nqKKtb7th5v4HXHSVuy_5o8rVnsGIyY,426 +jedi/third_party/typeshed/stdlib/2/nturl2path.pyi,sha256=_u8yHiGMMnRRTjQAs37HCefvy5193SJDBUZTw1nZ0I4,115 +jedi/third_party/typeshed/stdlib/2/os/__init__.pyi,sha256=NnJyYj9Ht12qs2NygwA2cVbVixeRxaFVbO8h88ijKeo,13399 +jedi/third_party/typeshed/stdlib/2/os/path.pyi,sha256=KHXAq47ML8XXphkrwvNaUWEZPnR4JeEIHvM_mxClRZw,6228 +jedi/third_party/typeshed/stdlib/2/os2emxpath.pyi,sha256=KHXAq47ML8XXphkrwvNaUWEZPnR4JeEIHvM_mxClRZw,6228 +jedi/third_party/typeshed/stdlib/2/pipes.pyi,sha256=65agLGycqLLqBqNqGgiUR79o5joqm6joPBiXATRz_0Q,453 +jedi/third_party/typeshed/stdlib/2/platform.pyi,sha256=G_CDGpxhbuvyOSwqmhyXKcNuvJFnsyzCsU_hTQchkDA,1609 +jedi/third_party/typeshed/stdlib/2/popen2.pyi,sha256=QH4ryQDmuA0Sysh4YxSzDm7kS-ixHH65XFsJYvvkPn4,1000 +jedi/third_party/typeshed/stdlib/2/posix.pyi,sha256=3lcoUyMmn3my1qNxtAgSqYHZhOBden5Ho0RB_kE2rD4,6363 +jedi/third_party/typeshed/stdlib/2/random.pyi,sha256=iOojzd26HoN_JQBiYjwWL-_Gf2_rcNM82DlUYD7wuR0,3311 +jedi/third_party/typeshed/stdlib/2/re.pyi,sha256=5lrtET1RXjmitFM6RuhPG8-SYxQtpgUi4tEmNOOGZ9Y,3804 +jedi/third_party/typeshed/stdlib/2/repr.pyi,sha256=-ojmu6--kHSN28a_gJqMAgEpNIs_pkXgY3fo0YypwNo,1094 +jedi/third_party/typeshed/stdlib/2/resource.pyi,sha256=NCa0Nk2470P4HcQ_nqubB7OznbVm50B1rNiPKOkMhA0,876 +jedi/third_party/typeshed/stdlib/2/rfc822.pyi,sha256=-TJ5oMGTXnzLWDnJKiSDNCsHQWxh74IW8-S2eACyvtQ,2234 +jedi/third_party/typeshed/stdlib/2/robotparser.pyi,sha256=IpfpnvNmCtN84yyZR9TmNdCQA7F1M5MQcqbUdkwoPXQ,230 +jedi/third_party/typeshed/stdlib/2/runpy.pyi,sha256=D-ttE7Yt0BQGuEMaHf5GUyzWrdW_onB8qwW1Opwrn_E,541 +jedi/third_party/typeshed/stdlib/2/sets.pyi,sha256=9V4YpGnjbddzHk12Pvb6Maf3hrLHHqnUZeonRX57KAQ,3003 +jedi/third_party/typeshed/stdlib/2/sha.pyi,sha256=1xfyIpQeVx3Ph_U7m2iC6DFoUkb7OpT15sKlyxWe3U4,277 +jedi/third_party/typeshed/stdlib/2/shelve.pyi,sha256=4c3UMmwxKA9n_e8harfdZgs016I7J3pqsfz6ql_f72s,1585 +jedi/third_party/typeshed/stdlib/2/shlex.pyi,sha256=PmzwDY50DBoojp3Rk9YeX2ZIif1J4tvb29P33sagKmo,1000 +jedi/third_party/typeshed/stdlib/2/signal.pyi,sha256=u2h4U_43SsdgRXp9-kL-t1uftTp9S1gWzJ00WkzsB2A,1571 +jedi/third_party/typeshed/stdlib/2/smtplib.pyi,sha256=8wiSP1iFF9-l9IKgh8p6S0rGwLuguGQfFH3xyWPh4ec,2542 +jedi/third_party/typeshed/stdlib/2/spwd.pyi,sha256=BDoGUDub7DFTKhD_tzXW6DbD3uGX15Ujm2DzuFF_cvA,308 +jedi/third_party/typeshed/stdlib/2/sre_constants.pyi,sha256=DBRHOreKuYAN2gehIRjBr585TsiCwmAdTeXqLWh5iO4,1814 +jedi/third_party/typeshed/stdlib/2/sre_parse.pyi,sha256=Y5iWkibgX4tyONqkNV7X3MLxnm2tu7dqaVOLAC8TqaI,2377 +jedi/third_party/typeshed/stdlib/2/stat.pyi,sha256=gwl9Q2AHQqlIigVb2Zf7gEMNEa-sP2t0V7OgbjIFuK8,993 +jedi/third_party/typeshed/stdlib/2/string.pyi,sha256=b-Dal7fHMea8YnOgsf0JTs3nTaEw5muHcWNptTFlBO0,3706 +jedi/third_party/typeshed/stdlib/2/stringold.pyi,sha256=8oR2LNkfQvzePY1arCjPxA19Wy4Tn05Yms3G3EPFTkI,2077 +jedi/third_party/typeshed/stdlib/2/strop.pyi,sha256=DVsBbcE6F9MGzaej_40MfE-5vk6wgu7Tdp6Sdgi_qYI,1198 +jedi/third_party/typeshed/stdlib/2/subprocess.pyi,sha256=k64qM_UcJxGrViIWZyamwocM7RgQxMo-GHcFH_PK-C8,3819 +jedi/third_party/typeshed/stdlib/2/symbol.pyi,sha256=qmqdWz_h1fXHExnPWlZxn83d8OVi5Im98_Kuz110yVo,1372 +jedi/third_party/typeshed/stdlib/2/sys.pyi,sha256=8jyvI_75-bhKMSfsKz8na3UYkYhxWqY2WiDmqvcQZNY,3666 +jedi/third_party/typeshed/stdlib/2/tempfile.pyi,sha256=UFDS8YGUZMBPTJ0gsQGiBSRFDoQd-dEQdy2YoaZbhFU,3758 +jedi/third_party/typeshed/stdlib/2/textwrap.pyi,sha256=jd_r9lmNpKCLwpkgWTWCLR0C0xhhSPWpO1ARCRRMYmM,1976 +jedi/third_party/typeshed/stdlib/2/thread.pyi,sha256=y3qvJAjEE-elcJx87JdYeoap1OFygoCSW6cAGLESYng,957 +jedi/third_party/typeshed/stdlib/2/toaiff.pyi,sha256=zrENv_VOG8LvsszFHcfYAg98QRjT6CEcq_i_zls-Y3Q,337 +jedi/third_party/typeshed/stdlib/2/tokenize.pyi,sha256=CWb3mWSzXxKUp7hIgexrWTANJNUf3A0QICQ2HPsTtdo,2770 +jedi/third_party/typeshed/stdlib/2/types.pyi,sha256=Y9Y2EkystxLUxQclDAwEarPzTX3_bg2t8ksgE1UrXFs,5316 +jedi/third_party/typeshed/stdlib/2/typing.pyi,sha256=MduaLZ2ANBT14dQSZsZKX63LyXPuHmhUnGaH20CMI1M,17294 +jedi/third_party/typeshed/stdlib/2/unittest.pyi,sha256=d7dydSIAEgrlD4V-uViGygPzwZt4azhZV6EHh7Fb34M,13559 +jedi/third_party/typeshed/stdlib/2/urllib.pyi,sha256=G6PTg4wwlOQrlu-NgGYGwwz8IjChndeGAoQt1IuxqWc,4766 +jedi/third_party/typeshed/stdlib/2/urllib2.pyi,sha256=QxcOpwAa1fZ4YJr5NXYTpfptQV9nu73CpWXmYAnd7sg,8337 +jedi/third_party/typeshed/stdlib/2/urlparse.pyi,sha256=Y6HbLPC_8CCsF1QHE_vYPWlTBRwZvPRpQhpE5yEJP60,2033 +jedi/third_party/typeshed/stdlib/2/user.pyi,sha256=VmUsRNZaovrIF5qoRRIADPYkRdRmyADc54WDu6KWG2E,224 +jedi/third_party/typeshed/stdlib/2/whichdb.pyi,sha256=L2nM6tJquFezl_wNFb-E3DatgdBdWHeHIF9FusjbwEs,150 +jedi/third_party/typeshed/stdlib/2/xmlrpclib.pyi,sha256=BGfW9UUhV4h2vWTk6K2aBuJbHdQgMY3XyHd3_BPceUA,9655 +jedi/third_party/typeshed/stdlib/2and3/__future__.pyi,sha256=b7dmNhiJdcJM2cyLfX1i73MNfiVwTUfMmyOdZzBU2fw,587 +jedi/third_party/typeshed/stdlib/2and3/_bisect.pyi,sha256=s3w73IvNQd0VxWKAFTgvJvuu6x1ny_-LndUjQ5vIqO4,625 +jedi/third_party/typeshed/stdlib/2and3/_codecs.pyi,sha256=G8h8EiWwxVCcPf1MvQ0fKI_HdEtND5lKhK565nOt6tQ,5018 +jedi/third_party/typeshed/stdlib/2and3/_csv.pyi,sha256=vNlVD5JOIsjhgBVaWOkFqS5RoRUkMejjnno98dBJSQQ,1437 +jedi/third_party/typeshed/stdlib/2and3/_curses.pyi,sha256=UoRqt-xwQtp5kA9bVCuyu7DIYKsAEXqlf9ph4VfrhrM,13298 +jedi/third_party/typeshed/stdlib/2and3/_heapq.pyi,sha256=-MFZDhgnCWtzJKKSyTr0ZxdgAvEUV07pC2qLKpB6NRs,541 +jedi/third_party/typeshed/stdlib/2and3/_random.pyi,sha256=T6P7i0D5yVE_QJzqBCAbGtwcMFlp6vLoLwA8DbjFe8A,493 +jedi/third_party/typeshed/stdlib/2and3/_warnings.pyi,sha256=V4-vgIJuMT8VrN9BK-klKJpZ9OO6U9ejMZJDY9-Ucd8,1063 +jedi/third_party/typeshed/stdlib/2and3/_weakref.pyi,sha256=dsSravIF0dShEt9xDjdfpo4pVZa3uJ5TgGOsW3XjI7E,1028 +jedi/third_party/typeshed/stdlib/2and3/_weakrefset.pyi,sha256=iSw1zz1YN3MV2ostBxZ1EI6fpSMwBbAvF6T0H5vSq2U,2239 +jedi/third_party/typeshed/stdlib/2and3/aifc.pyi,sha256=z0Xnx2XORjJKLDfMvOjgDJS8O5nmUayXdEE643iBXP4,3317 +jedi/third_party/typeshed/stdlib/2and3/argparse.pyi,sha256=uuDcJlsSseYiJSkRaEfjPYOaPqztThekl2lzhRnDYPs,17501 +jedi/third_party/typeshed/stdlib/2and3/array.pyi,sha256=1ouXGl0xgCJqO7cLN47UjvZPt2K7FofB-8Einn4dq_I,2861 +jedi/third_party/typeshed/stdlib/2and3/asynchat.pyi,sha256=9tax37YM1fG21kdUs9TKs9HHkHoD2eG3xLuXqExu-qc,1557 +jedi/third_party/typeshed/stdlib/2and3/asyncore.pyi,sha256=yXRMMf2s4Y0qAkCizVDkyNRETJPUmZjAbSzRbafRbXc,5627 +jedi/third_party/typeshed/stdlib/2and3/audioop.pyi,sha256=3sUMnxkoY7ylr222J4XNbc9bntSGRCQfxwKtDmnd5S8,1991 +jedi/third_party/typeshed/stdlib/2and3/base64.pyi,sha256=7HAleViLBwCxlFA_pieREvEhlVkEYJscxTK_ETLFi1M,1586 +jedi/third_party/typeshed/stdlib/2and3/bdb.pyi,sha256=RmN9gwwKzdLjCpjtCWdAioRegBlj61ivJk1gBjHDYBc,4474 +jedi/third_party/typeshed/stdlib/2and3/binascii.pyi,sha256=E0HBxwgPVYKiP6tDGzn0A5utbj7SI_xXQerNQlfNkmk,1458 +jedi/third_party/typeshed/stdlib/2and3/binhex.pyi,sha256=RdIA0UO1pN5uTqZlDNX24ye1C-HcJqS8gVKVdGGNxTU,1169 +jedi/third_party/typeshed/stdlib/2and3/bisect.pyi,sha256=vq6eCduWXo9jvChpDTSSVh_vqEeXFhCp_7sX7n5buAM,606 +jedi/third_party/typeshed/stdlib/2and3/builtins.pyi,sha256=bpOiyzZwfbnMPqo8RtBLmOFOzecZgI53YCjxP39SXdc,70641 +jedi/third_party/typeshed/stdlib/2and3/bz2.pyi,sha256=jgxR5jG7-tFCLTmb_i4pcGjeND6m0-xBRWDUhZUTzYY,1592 +jedi/third_party/typeshed/stdlib/2and3/cProfile.pyi,sha256=SFnHiIY3blPl5sO-lFoT13BRAIvfvmXEchGLYDKiiNw,1284 +jedi/third_party/typeshed/stdlib/2and3/calendar.pyi,sha256=rFOCDD2wDoJZUp6rXGsM2SLGe751yufVgO4rUaera1Q,5772 +jedi/third_party/typeshed/stdlib/2and3/cgi.pyi,sha256=C-b0xl_caAV5Pql_61nMKlHTXleMPxzovmoTxBWWTjI,4998 +jedi/third_party/typeshed/stdlib/2and3/cgitb.pyi,sha256=B8gorWp9OEuFVBvGOQW_YT2440cL2MH-2Mq_93n2iFo,1536 +jedi/third_party/typeshed/stdlib/2and3/chunk.pyi,sha256=jowWsUq9mcMGDdmTHlaLlukvEQihCsuqVTVUev7KkIg,755 +jedi/third_party/typeshed/stdlib/2and3/cmath.pyi,sha256=3bxbB0njaWDDhYkiEsk8zcQdPccR1uawXMcXO7a8sUE,1207 +jedi/third_party/typeshed/stdlib/2and3/cmd.pyi,sha256=FnDWxJimCNt352UrvvoTxEPuWbkcbcpAQbrnpChqi_I,1694 +jedi/third_party/typeshed/stdlib/2and3/code.pyi,sha256=PAczIl94ovoD81xCyBiJvMFAK4vK5nxakMKr7TfaSn8,1646 +jedi/third_party/typeshed/stdlib/2and3/codecs.pyi,sha256=rsyJewHn_AxQuKX8BvOYLPUv8UOfq0Otbcr-kt9VeQM,11071 +jedi/third_party/typeshed/stdlib/2and3/codeop.pyi,sha256=2Ewyo9P3RURy-L9JIjD93vf7tmLu2-rKBkkb780T8_8,633 +jedi/third_party/typeshed/stdlib/2and3/colorsys.pyi,sha256=gycPfF1f7H4--FWW-EcrA1xkFbWorJN6GH_Nlp2dK5c,600 +jedi/third_party/typeshed/stdlib/2and3/contextlib.pyi,sha256=hP04ak0ehl7qYm-mJGQQXEN3A9NFdTlMnH-06VVbjew,4806 +jedi/third_party/typeshed/stdlib/2and3/copy.pyi,sha256=Vn1-_joBr-pkOjjCau3LDjHYnD7bcYWAxkYqNLEx4YY,343 +jedi/third_party/typeshed/stdlib/2and3/crypt.pyi,sha256=j5hzsqJ9ZuejqS1NP9QIzaC6N25m_wHpPaLVJlNRfKQ,648 +jedi/third_party/typeshed/stdlib/2and3/csv.pyi,sha256=hfu53Q8iA_oZ_Avxkn_Ro8ZE3WJRi-eSp6j_pTycgD4,2813 +jedi/third_party/typeshed/stdlib/2and3/ctypes/__init__.pyi,sha256=E7OKoeI6Xpya8jtZLMUKo8tqkcvb0xeYH194hSkS1_M,11761 +jedi/third_party/typeshed/stdlib/2and3/ctypes/util.pyi,sha256=ScneHbPrwdZ3qbY_LD_kDjStl9dMFrmy1NQVtHrjmOs,187 +jedi/third_party/typeshed/stdlib/2and3/ctypes/wintypes.pyi,sha256=iFiDsgc33hv7Qh2fnSPH6ZrATxo852KmoGCLRN03f0s,4566 +jedi/third_party/typeshed/stdlib/2and3/curses/__init__.pyi,sha256=v96-FPTwy5Jtwv62naVP7g3JO1d4MPh5uh8SQ49BSPU,368 +jedi/third_party/typeshed/stdlib/2and3/curses/ascii.pyi,sha256=N7W-GodjpobQNyftBWTcdbPJDa50sRve2KRo_-jnYZM,1222 +jedi/third_party/typeshed/stdlib/2and3/curses/panel.pyi,sha256=eGqc0LXKuJIRtuItFpbuu4VikP5e6ckXZzQRo3R8hiM,799 +jedi/third_party/typeshed/stdlib/2and3/curses/textpad.pyi,sha256=NuLw6xTgQcbssPvAlh-QZ9OtI_cltNmZnapsEAXpIYY,429 +jedi/third_party/typeshed/stdlib/2and3/datetime.pyi,sha256=cXqCUhIzVUMcbFcFwD_5uTTLewDEO9oaWU1M8oiuSmc,12006 +jedi/third_party/typeshed/stdlib/2and3/decimal.pyi,sha256=ohNd7rHc6JNo-LQeLUsWABFs4u0Ilh2OeTPxvLjhQgQ,16037 +jedi/third_party/typeshed/stdlib/2and3/difflib.pyi,sha256=InSaNR6X2okgWtUBDAwgrZvponcrkbwCEYipuEoVTno,3853 +jedi/third_party/typeshed/stdlib/2and3/dis.pyi,sha256=DIoKGGsKgVPB47U9jQ_Q0AtxU7-CXTRuFZFwUHLOL8M,2894 +jedi/third_party/typeshed/stdlib/2and3/distutils/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/distutils/archive_util.pyi,sha256=Cb2sF0yvhbPtCxdz6j_dEF3-9PlXKXPLrHsUiDBKjs4,525 +jedi/third_party/typeshed/stdlib/2and3/distutils/bcppcompiler.pyi,sha256=hbYMdSNGfHOUf9_f2vSeFUpg76hFgt71MCBp4ynppwA,115 +jedi/third_party/typeshed/stdlib/2and3/distutils/ccompiler.pyi,sha256=mHAZvAYNPWx1ftD5_Amn4Lcz0p5HSnenXQK_56JB-zU,6961 +jedi/third_party/typeshed/stdlib/2and3/distutils/cmd.pyi,sha256=UMkdbxMoA2fsxSmb9rZFw7LzmP1-Ye-pi_NY_HJFkY8,2590 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_dumb.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_msi.pyi,sha256=sDSqH7TRcOiXC5S4VXxJ_YHB-WFPpa1fo8F8g5XeV3Y,182 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_packager.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_rpm.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_wininst.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/build.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_clib.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_ext.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_py.pyi,sha256=d8u3XWYYW-TCNOWUqOy3y322trpVj00EUe-9Qmk6VoY,277 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_scripts.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/check.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/clean.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/config.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/install.pyi,sha256=9zAI1cDdVfOAA_ZD5SQTRJUbznKwNaGjF_JK8Vom2Ng,340 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_data.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_headers.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_lib.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_scripts.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/register.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/distutils/command/sdist.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/distutils/core.pyi,sha256=GT0chd4lprDKat7u29p5x5nU5mrW1Swrl3x3GOztjuw,1959 +jedi/third_party/typeshed/stdlib/2and3/distutils/cygwinccompiler.pyi,sha256=ckHKszxakRQfSAsfxtlwYQOYzbUt5sYCCJ-U3mV2hyw,178 +jedi/third_party/typeshed/stdlib/2and3/distutils/debug.pyi,sha256=UTaP07MC1pSK2C1Ku4w_fPVnHoS72N18TmSaZA4Yo2M,41 +jedi/third_party/typeshed/stdlib/2and3/distutils/dep_util.pyi,sha256=bXprG0MdGygOD5dR_TMHepwl_8NNnZ8ky5Zk5lpxc8g,303 +jedi/third_party/typeshed/stdlib/2and3/distutils/dir_util.pyi,sha256=8pAEw1RcokPtwea8HOct8c7-dRtJ3uWqUecWD8v-UZo,638 +jedi/third_party/typeshed/stdlib/2and3/distutils/dist.pyi,sha256=pFSa4ZMjW3lVZWnHACpQHa_jvCMDtFsZIagTD0M9xDk,492 +jedi/third_party/typeshed/stdlib/2and3/distutils/errors.pyi,sha256=l1W_FgoP9L-D-hEPFA2BzZuybjN0lV4WBXl0VJ-k7J8,852 +jedi/third_party/typeshed/stdlib/2and3/distutils/extension.pyi,sha256=T1PgXNiEtlXMt2IJdwjDAYkCz_wQWh6w_egTRFm2D8Y,1713 +jedi/third_party/typeshed/stdlib/2and3/distutils/fancy_getopt.pyi,sha256=a4ii8u9VKd7RHfbL7OAH8Qq5A4TuO4PHaDLy0eifZlg,962 +jedi/third_party/typeshed/stdlib/2and3/distutils/file_util.pyi,sha256=PkDa6hW8S6oXedW-VdFHtkc8VfTKq6pxiHmzkxY22M4,494 +jedi/third_party/typeshed/stdlib/2and3/distutils/filelist.pyi,sha256=lPEMKrnk-y7jIfMpTgJEkf9wgt6UJ8rM5ER0I-uWJHs,52 +jedi/third_party/typeshed/stdlib/2and3/distutils/log.pyi,sha256=8W5K1F9OHVk8rQx6NrI6eBUcZ510Cst7ethbRxUYMS4,776 +jedi/third_party/typeshed/stdlib/2and3/distutils/msvccompiler.pyi,sha256=XSn5lSllRGmo0x1MAWZfi64t7bLiup7Ic_Aht1PXEQM,115 +jedi/third_party/typeshed/stdlib/2and3/distutils/spawn.pyi,sha256=Lx3dQ5YxHa6dMBouciPrZdLZp3a0Mb96zlC6bkR9AWg,286 +jedi/third_party/typeshed/stdlib/2and3/distutils/sysconfig.pyi,sha256=nCXDeJFmj1mh0s2zaUApwyARYA7f4lUoS1acJaoQjEY,692 +jedi/third_party/typeshed/stdlib/2and3/distutils/text_file.pyi,sha256=y2b0du-gmjUE5wdZGRn9CDM_JlhJ_D-cuCuCpJR8IgE,760 +jedi/third_party/typeshed/stdlib/2and3/distutils/unixccompiler.pyi,sha256=Ak9WQSMgsoU-8N03ncUJRTa2hKmaWxVzPGOY61FMcks,117 +jedi/third_party/typeshed/stdlib/2and3/distutils/util.pyi,sha256=GxjDiLfzjyBucyKt4rZdjRX_wcvwSMEGaUAUI1VFzo0,892 +jedi/third_party/typeshed/stdlib/2and3/distutils/version.pyi,sha256=IdT_89jTuB9bxfgIZE_L9RG9WXP4VAOtl42SoxjFAVM,1884 +jedi/third_party/typeshed/stdlib/2and3/doctest.pyi,sha256=mBNFN1gzmSFELSyCQi_EPlg8vfhZ8-fvOU0-9bWWbMI,6852 +jedi/third_party/typeshed/stdlib/2and3/ensurepip/__init__.pyi,sha256=jtJ8SnDqMaDHvU_dJ__E0-J7pBJFp36dEDxvUbE6a74,444 +jedi/third_party/typeshed/stdlib/2and3/errno.pyi,sha256=6dsaKvRQODirtoYdz0wmSMhW-M0ibxf6RoPa2ibdoIw,2041 +jedi/third_party/typeshed/stdlib/2and3/filecmp.pyi,sha256=JSkZw4FzOBBMRTbi1yQF_HE60LxD-34-9Z9pUhF61tk,1621 +jedi/third_party/typeshed/stdlib/2and3/fileinput.pyi,sha256=Qxycw6jY7dspDmdRZ1eQi9O4Uxm7n3WeT_U3q4kg5is,2672 +jedi/third_party/typeshed/stdlib/2and3/formatter.pyi,sha256=A520A3vxlCfJL6Khu22spAlgfGFbjqPxH2-etXGDR9w,4655 +jedi/third_party/typeshed/stdlib/2and3/fractions.pyi,sha256=uS_jkXcIEoPoYgQaQLC9qKgGN868YQL0zozjVg9uhi0,3276 +jedi/third_party/typeshed/stdlib/2and3/ftplib.pyi,sha256=v_ZfXER2DeuqWyjUFwNhmKnPsiDu8r3Ja1C8CLE3sKM,5985 +jedi/third_party/typeshed/stdlib/2and3/genericpath.pyi,sha256=VNOzbzq_cwK7m4H__5v7cl8i0Z3ywCHG-WbhdG8ZF1E,653 +jedi/third_party/typeshed/stdlib/2and3/grp.pyi,sha256=fm0JOwvJ8CGCXSVWyqQuXFBPBfoVC8b5CyWTq-5fcvs,295 +jedi/third_party/typeshed/stdlib/2and3/hmac.pyi,sha256=LDOblpTV6wgbdj9Egy0_5q69MA_bqFLbM7HLq5Sl_do,1075 +jedi/third_party/typeshed/stdlib/2and3/imaplib.pyi,sha256=j7MZguvxDPpAlwhquttS114QTB3Ax9GwalBNtq_iHGw,6407 +jedi/third_party/typeshed/stdlib/2and3/imghdr.pyi,sha256=qq0yn_jEFKMIJSDwdmmd3SSy0olSQe5jLaqWpIvcsHY,403 +jedi/third_party/typeshed/stdlib/2and3/keyword.pyi,sha256=GHJis_Ztsrt-hX1HP8g3cu1DXR0oNfhbb8OnZawtIwE,135 +jedi/third_party/typeshed/stdlib/2and3/lib2to3/__init__.pyi,sha256=0ggYR5uuGf5bPw2MfRjOV-SlNLTFqvAQI2xyd9d1n5s,33 +jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/__init__.pyi,sha256=GCKIgFDXUS4t9oWDYB3TY1U8utGs2GRN7i_Bv4hAo8Y,184 +jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/driver.pyi,sha256=I6t6a8rD2kYxTTfPGWQcV7NYmO6hNQdAHOYzh553-T8,1050 +jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/grammar.pyi,sha256=T5ogRjiiL8iyCxSqJHPKf4XxgQaH64P6EEJE-7W_6jk,785 +jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/literals.pyi,sha256=wOFWATRmrAZ-Epxm6c67kphsmU-Z5REvb3RSynIUUmg,221 +jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/parse.pyi,sha256=vHNzZoOdBveIwc4jjDHVaGyM_MLERTWVzEeC1FH0rfU,1160 +jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/pgen.pyi,sha256=ktroynzH2GlVHC-OWl7LOBwYGE8nyj0tJnpIzCTyn5A,2165 +jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/token.pyi,sha256=rTl8bJ2stp05jnK8xuK-ydeM3fcZzTWFzccTU1UHxlM,1111 +jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/tokenize.pyi,sha256=HHAAij2sz6QMDM0tk7IkHf0VFQcV5qCYa1VhMuzXblA,988 +jedi/third_party/typeshed/stdlib/2and3/lib2to3/pygram.pyi,sha256=evWU9m1mfMk7l0xWWGpWOygGGAcp0whXRugDyfmZFxA,2272 +jedi/third_party/typeshed/stdlib/2and3/lib2to3/pytree.pyi,sha256=ZJxW3lDbZf6TDqb2c95Dx3e8YFKzNA4PqmIl9upXjHU,3254 +jedi/third_party/typeshed/stdlib/2and3/linecache.pyi,sha256=Mn3wvI9otFnkJX0ejPEg-QJ-YYNjfVuAulJvf5SBSMw,590 +jedi/third_party/typeshed/stdlib/2and3/locale.pyi,sha256=2UzJIz3lxAmf4Fk4-5oDDj28v6XM6K3ckFct0pTs0nE,2596 +jedi/third_party/typeshed/stdlib/2and3/logging/__init__.pyi,sha256=yGah1odB9aR0WjSFwG6cO_OdAu0pD8n7rggNhgejJlY,18443 +jedi/third_party/typeshed/stdlib/2and3/logging/config.pyi,sha256=eOtTCSARYosr0CWKLy1B-MUdwHvNkZzJEqa60TaCYsk,1163 +jedi/third_party/typeshed/stdlib/2and3/logging/handlers.pyi,sha256=JBzOOG0a2Ostc0CERlWXu68sRgAR9fK81_z0lTtIJWo,8031 +jedi/third_party/typeshed/stdlib/2and3/macpath.pyi,sha256=euC6zYAoOHDqUIjAy8fh024O-PILOj6tBii9Algr074,6631 +jedi/third_party/typeshed/stdlib/2and3/mailbox.pyi,sha256=O78rVbaO1QFr9cUlWOS_MdqMLbqv1kFNMBV-yd7bXk0,7862 +jedi/third_party/typeshed/stdlib/2and3/mailcap.pyi,sha256=tAu_XLnDp7kbJT8epZ1JfFAL8DayNC9VCQ1HpU-Yi74,325 +jedi/third_party/typeshed/stdlib/2and3/marshal.pyi,sha256=7sKJVylApLz4MBoY1oX8OSac12ha8o2-e44ST84iDO8,240 +jedi/third_party/typeshed/stdlib/2and3/math.pyi,sha256=EWssdfDvqNPZgdUzROFwoI-0iqpmZD1GMDhogIb56oY,3272 +jedi/third_party/typeshed/stdlib/2and3/mimetypes.pyi,sha256=du0MpCTRjGO_3Hj_UYEn2BmB32SQehMceTXTSmo9h_0,1575 +jedi/third_party/typeshed/stdlib/2and3/mmap.pyi,sha256=LrTMofamSCYuM-txK9MjKiJ66EuSUvxDSX7APVb1ZoE,3686 +jedi/third_party/typeshed/stdlib/2and3/modulefinder.pyi,sha256=LIWn1pi-HveDYhaVkycelySe04VT8IUR-WdEaKsNWqo,2950 +jedi/third_party/typeshed/stdlib/2and3/netrc.pyi,sha256=b-5spr7aL_aO4r3x87Gt2DVPzWUX5DzVQjRRO-ctlLc,466 +jedi/third_party/typeshed/stdlib/2and3/nis.pyi,sha256=pkA8pWBwqIP_NKf0chQ-iLvlPayJEFVg5bauHoiOEgg,323 +jedi/third_party/typeshed/stdlib/2and3/ntpath.pyi,sha256=KHXAq47ML8XXphkrwvNaUWEZPnR4JeEIHvM_mxClRZw,6228 +jedi/third_party/typeshed/stdlib/2and3/numbers.pyi,sha256=GLYOksSFBTyJvuaqADa2Zpt6BCaorlK-tI5zZjSEH_c,4065 +jedi/third_party/typeshed/stdlib/2and3/opcode.pyi,sha256=O1Dee7H1EnOxXYPxTvo0qIDVKBUvS1_m8QyqAWqdjeI,463 +jedi/third_party/typeshed/stdlib/2and3/operator.pyi,sha256=nfNRbcSimaZlYbczhfvTsQ4oSWdGphLmkzpAyrlue4w,6519 +jedi/third_party/typeshed/stdlib/2and3/optparse.pyi,sha256=0oULm8OAeP3c3pvgMvYLWFAa8zVzLGTJi9BmlAiHBCo,10016 +jedi/third_party/typeshed/stdlib/2and3/pdb.pyi,sha256=9pSJ0rK_7jSFcPcL345_T-ShskIZaO34-2kT1IkOlu0,2383 +jedi/third_party/typeshed/stdlib/2and3/pickle.pyi,sha256=WdVvogkvE93kN0oYuCYM63RsOGa77_PTBrY9BtznK0I,3697 +jedi/third_party/typeshed/stdlib/2and3/pickletools.pyi,sha256=9vcrF9ha3uuyJrbZOznxvIA04N99nSCXP1MgttLhCh0,4395 +jedi/third_party/typeshed/stdlib/2and3/pkgutil.pyi,sha256=co860uP6jr-cITm5wZvIeqsASwy4MAKXABvhOMKT_So,1369 +jedi/third_party/typeshed/stdlib/2and3/plistlib.pyi,sha256=sTM-j8i6LRXfm66p1XwQpZ5S4VEGfJn08rVIrU4w81o,2459 +jedi/third_party/typeshed/stdlib/2and3/poplib.pyi,sha256=8hzOYh0vEt5Icq75jMqYzEq_eOiWSxl8jXWYMjH_6Ig,2492 +jedi/third_party/typeshed/stdlib/2and3/posixpath.pyi,sha256=KHXAq47ML8XXphkrwvNaUWEZPnR4JeEIHvM_mxClRZw,6228 +jedi/third_party/typeshed/stdlib/2and3/pprint.pyi,sha256=fL862tKVJJ_UG1_u6gDOsQ55iBzlbcSmJrnSs-b6dCA,1699 +jedi/third_party/typeshed/stdlib/2and3/profile.pyi,sha256=5nCnL_wdprKHDDPDB4Y0VIEFiwxbjTPsS-4IFMFyBs4,1289 +jedi/third_party/typeshed/stdlib/2and3/pstats.pyi,sha256=IeAiUpaEC5V3vgAE0yONTJm-dOiqHIGazZ42uw9aseQ,1964 +jedi/third_party/typeshed/stdlib/2and3/pty.pyi,sha256=ZdJ4D2e0W3mk2I7kg-niYldKAgMAV-GX66oQx2X6yZE,623 +jedi/third_party/typeshed/stdlib/2and3/pwd.pyi,sha256=s48Hp0pbMoMBpWg6glXl1ABEcLU4zLj_wV-PloenVI0,350 +jedi/third_party/typeshed/stdlib/2and3/py_compile.pyi,sha256=upPz4PmBbPlRlMpzWSEktz-mOwtXhwXDk0khBt3jA4c,1236 +jedi/third_party/typeshed/stdlib/2and3/pyclbr.pyi,sha256=ZwRpOEyIRE4h3NY3gImWV8DIeAYOKVlbDLdI9JblKcU,931 +jedi/third_party/typeshed/stdlib/2and3/pydoc.pyi,sha256=0WYtqB9N5aS3k2QKFA_qCEP_CLZKf8hfRhthpgxOykY,9786 +jedi/third_party/typeshed/stdlib/2and3/pyexpat/__init__.pyi,sha256=8SLctWH5qRYZ3IGAAy9nLhO7MmtEufmV5-7ZeZjYlvQ,3315 +jedi/third_party/typeshed/stdlib/2and3/pyexpat/errors.pyi,sha256=TVdXkdX10ZCjPuBYAy3yNQzUJMo5lCjsl8bv4VJ8PU0,1275 +jedi/third_party/typeshed/stdlib/2and3/pyexpat/model.pyi,sha256=LlBMaLvt3TBD1JQSAQTYUrHKAfKNEeQYaDw5GsJA--g,205 +jedi/third_party/typeshed/stdlib/2and3/quopri.pyi,sha256=7PML6bBx3UqKF1pHBUxkmo9Q4kh-UYdmQ4SwdQizkgA,380 +jedi/third_party/typeshed/stdlib/2and3/readline.pyi,sha256=ayEVs3rdNRotUGelvU7IJ0D6aQtFru5tb0FI7r2YIAU,1525 +jedi/third_party/typeshed/stdlib/2and3/rlcompleter.pyi,sha256=uKxlYpHPjzXoce9dIHQH7vg53rn7mKb9m4x0Yx_yjx8,334 +jedi/third_party/typeshed/stdlib/2and3/sched.pyi,sha256=RgJRmcHjdTx-DUDWjX0b2EsdiEKvbJhVCKec8QVQe-E,1332 +jedi/third_party/typeshed/stdlib/2and3/select.pyi,sha256=LQ9g0o8VBrhmdrljtmHAxThp9UszSiaMBLimY-U5FK4,3936 +jedi/third_party/typeshed/stdlib/2and3/shutil.pyi,sha256=8dB29wS2_TY9KYWLRW1Hyk5j42wFryfMgDzCwtcu3xQ,6195 +jedi/third_party/typeshed/stdlib/2and3/site.pyi,sha256=jIbFW1pDqUze5Td1FOOFFkF9-KU_5RtT-5R58eVqkQw,482 +jedi/third_party/typeshed/stdlib/2and3/smtpd.pyi,sha256=HrEx9a0iON3Xz95TWg0y17zEX25w9eoBjSV5BOUtl2Q,2856 +jedi/third_party/typeshed/stdlib/2and3/sndhdr.pyi,sha256=98gAwwLN2qVXRZ-Fz5fpK75WOEsikMMIhQiIsPr1n58,635 +jedi/third_party/typeshed/stdlib/2and3/socket.pyi,sha256=vpStRxKG380yAvAtsxXZOJTgadaBfROdVJyoiswYUZk,21695 +jedi/third_party/typeshed/stdlib/2and3/sqlite3/__init__.pyi,sha256=aJu9MCNl8y9HCykdUpo1Z-LSiP3mxRSxrWkCsMxemYI,43 +jedi/third_party/typeshed/stdlib/2and3/sqlite3/dbapi2.pyi,sha256=1N9RwaFMCHh2fM3E16HUrmVmE7I8su7qrj4ravckMAg,10760 +jedi/third_party/typeshed/stdlib/2and3/sre_compile.pyi,sha256=Ab61wAZxIintArRZdq1PW_RDhb3HIfG8QAb3QO4VBjg,635 +jedi/third_party/typeshed/stdlib/2and3/ssl.pyi,sha256=wWfO9YGo2yJ8VfXQHSV3RmxqBtcMQMTxZr0vKW1vGBg,11682 +jedi/third_party/typeshed/stdlib/2and3/stringprep.pyi,sha256=aEQorjm1j79Czrsv5Sroc2UOlw1GW6mlx8M0raDASS4,858 +jedi/third_party/typeshed/stdlib/2and3/struct.pyi,sha256=qWo9J4eFvilOPg3FD_6m6xiRjA-WUvE8EBRXAJDcFAg,1676 +jedi/third_party/typeshed/stdlib/2and3/sunau.pyi,sha256=AJN73CkJIPrgsgrPH4sTu49sBxYW24o-KPozM3rG3Ss,3086 +jedi/third_party/typeshed/stdlib/2and3/symtable.pyi,sha256=P_OBxtiTKgCXgdc6__elUMlO4ambO7LCYd4x0uBiNuo,1645 +jedi/third_party/typeshed/stdlib/2and3/sysconfig.pyi,sha256=E6dMDDKqJUYBFZ-kIoEcNOMH_m_pUMwK-YdYNFMEy80,873 +jedi/third_party/typeshed/stdlib/2and3/syslog.pyi,sha256=bEQi8JxzO7mGssGe-QrfBPZt0jLOrmp76odixNhxfHw,822 +jedi/third_party/typeshed/stdlib/2and3/tabnanny.pyi,sha256=JC-r81-1nac5wCgEBmhdBNriPaVan4jQF0af-5m699U,593 +jedi/third_party/typeshed/stdlib/2and3/tarfile.pyi,sha256=gFhPc4cKApCwFllaNa2tPDw3tjwH3lCQbzpox4-XanE,6835 +jedi/third_party/typeshed/stdlib/2and3/telnetlib.pyi,sha256=bzFdnfOV3rSWVuxXtItqi5x8vf00essbXBLAD6x71rY,2723 +jedi/third_party/typeshed/stdlib/2and3/termios.pyi,sha256=kfRDjzSXXxUGI4alIjJgAaz60LzDuACK9ZeOS6znTZU,3403 +jedi/third_party/typeshed/stdlib/2and3/threading.pyi,sha256=li6y1-V8Gwb7nGhuRDlNzsc4GAI-ok37PR-L2UmZsn0,6829 +jedi/third_party/typeshed/stdlib/2and3/time.pyi,sha256=w5__uflRUMbuYBcEQpxAFrlmrss5yKB40KwB8MFWa2U,3889 +jedi/third_party/typeshed/stdlib/2and3/timeit.pyi,sha256=6r_rYvSdn5Y-oOEQL5Fcn8eqjoh8ftfDcVIevF_w9io,1634 +jedi/third_party/typeshed/stdlib/2and3/token.pyi,sha256=ym4kykoyqLuEkGsCwR3MWfpQwkxwmJzAnwtURTljUkQ,1161 +jedi/third_party/typeshed/stdlib/2and3/trace.pyi,sha256=PFKnnYS9-v6K0CaDBmiUSNNxbcbMH2ipeqG6TxqpOWo,2048 +jedi/third_party/typeshed/stdlib/2and3/traceback.pyi,sha256=5azGN_UMAmPB2Exw8jUWcWmx2Pk4dIVRV4peo2zCoNo,5852 +jedi/third_party/typeshed/stdlib/2and3/tty.pyi,sha256=19RemvpbjAwcd4lC2bUPrtWzAgqPBPEeW11rUzC0jf4,305 +jedi/third_party/typeshed/stdlib/2and3/turtle.pyi,sha256=gCuFe7lBQTmjbDs4T4JEAN6uPR8U-lca6q-Pf4_9InM,18320 +jedi/third_party/typeshed/stdlib/2and3/unicodedata.pyi,sha256=agOIGVwcxG8qK9zzUb3zK57v23WemcejDKcdjAtD74g,1900 +jedi/third_party/typeshed/stdlib/2and3/uu.pyi,sha256=OoU_7qM_n_89xGr-vz1L-Nkr7OsNjNwY4lET0BX3hso,562 +jedi/third_party/typeshed/stdlib/2and3/uuid.pyi,sha256=6xQkGMz4Bwshw8mZ9exQ6MkZJraf7fyg_XVqd07hgkc,2830 +jedi/third_party/typeshed/stdlib/2and3/warnings.pyi,sha256=NOijb6FgLmKoTwYyfUZzWovT8NAQdiX7iTCIkNUR0vc,1786 +jedi/third_party/typeshed/stdlib/2and3/wave.pyi,sha256=DZwEKKB3Kt4Z2veskeLzde6d5Qn6Gkp7ONe-Zb1SyKg,2654 +jedi/third_party/typeshed/stdlib/2and3/weakref.pyi,sha256=a7APR87XeauDS9OYux558cSmWaNZAZSt6-_yz8sPQ4U,4288 +jedi/third_party/typeshed/stdlib/2and3/webbrowser.pyi,sha256=A8R-0I5R5zW7MPvstLUI6w-EHfdDL2DPLRDDIgy1cGI,3158 +jedi/third_party/typeshed/stdlib/2and3/wsgiref/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/wsgiref/handlers.pyi,sha256=l0A6fhIcMFXTABDRawRTYzr3j068FgWBYbNy8MtN9pE,3100 +jedi/third_party/typeshed/stdlib/2and3/wsgiref/headers.pyi,sha256=eDrVTuY32OcH89OxOrEaW2IFVu4f6-5K5TCR86FKuHA,1250 +jedi/third_party/typeshed/stdlib/2and3/wsgiref/simple_server.pyi,sha256=uqXNuh-pntkPVTutUSKdCT9nCmdBQxsCwtu-gjpRVj4,1523 +jedi/third_party/typeshed/stdlib/2and3/wsgiref/types.pyi,sha256=ZFIK0Lidrc_3N9E9XUFwAskcpmejtSnjKjbSDmmp1W4,1742 +jedi/third_party/typeshed/stdlib/2and3/wsgiref/util.pyi,sha256=9ssIjy_7yKdPjdHO6emPKCzHRcTvoiyPI4KlHfxXlfA,886 +jedi/third_party/typeshed/stdlib/2and3/wsgiref/validate.pyi,sha256=4LfN9O2sxYoap7vzm9Nyz59usGRnjs3SX-SgUrSG3V8,1861 +jedi/third_party/typeshed/stdlib/2and3/xdrlib.pyi,sha256=fVlQwIUUmlgknTh3Tvsc5VaVEpRcSf-vV31l47kldlA,2353 +jedi/third_party/typeshed/stdlib/2and3/xml/__init__.pyi,sha256=BqMXnsXiYPoalMzEakn6mYDxgyW5N2UPF0Ao7xPuGVY,30 +jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementInclude.pyi,sha256=sIvz9WYug0yPU9mcYoHmu79A7M9ByHJsnvt6KuR4a8s,665 +jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementPath.pyi,sha256=dJVKR-ynJ-WwlNzDuKa7pzlwgU80RdBCPsb2b4l8WY8,1603 +jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementTree.pyi,sha256=Hy-G30D5O6_-44cvYZRoA-okOETqvbQSqnBFnP2tEB4,12589 +jedi/third_party/typeshed/stdlib/2and3/xml/etree/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/2and3/xml/etree/cElementTree.pyi,sha256=ifHKVHIVZ_xrUmLINR6pD596HPTOoTjRIJ1FxAlDBiQ,99 +jedi/third_party/typeshed/stdlib/2and3/xml/parsers/__init__.pyi,sha256=FHZYB9bXDrj4RiKUgrctpkuf7_Rms9PqQrGyjkn0EE4,34 +jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/__init__.pyi,sha256=qmz8tuPGbZ2rBfRrfYANxDZNxn9BTQXdd9AugF5wDW0,22 +jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/errors.pyi,sha256=mH9YRZuV4quzksDMLEmxiisAFgNhMOhl8p07ZzlS2XE,29 +jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/model.pyi,sha256=M7GVdd-AxOh6oGw6zfONEATLMsxAIYW2y9kROXnn-Zg,28 +jedi/third_party/typeshed/stdlib/2and3/xml/sax/__init__.pyi,sha256=z73Z5qgnEu7IPBBT6sRZvZBRlswnwkYENFQ9Ek-oKBg,1389 +jedi/third_party/typeshed/stdlib/2and3/xml/sax/handler.pyi,sha256=lzRvfmcsC4Px11th3C-OB53OJgrSxHHTkgWKkFnYYII,1391 +jedi/third_party/typeshed/stdlib/2and3/xml/sax/saxutils.pyi,sha256=hjNjv-gPFhZC5E8aLmdjl_EVLwyABucbQpdBLKNWjHo,2357 +jedi/third_party/typeshed/stdlib/2and3/xml/sax/xmlreader.pyi,sha256=I-NHyFWOZ4AzPdf3IzvTqhA3hvS_bM2ywSCRCwfKYHQ,2327 +jedi/third_party/typeshed/stdlib/2and3/zipfile.pyi,sha256=0YthOIZ3uJkPZ2niBL6pCrnf6mSFp7Pk7YBeSbz37Xc,4874 +jedi/third_party/typeshed/stdlib/2and3/zipimport.pyi,sha256=3lB8btjsH-5rLh_bvIPtd-pqR445zqcgrS0X-acw1to,689 +jedi/third_party/typeshed/stdlib/2and3/zlib.pyi,sha256=3rMZu9slSgVb-sZdIJZVd7ui7kHMONy22UeIZtkpuaM,1654 +jedi/third_party/typeshed/stdlib/3.6/secrets.pyi,sha256=q-xshPkX_1lb3hmaf4PocheAhSPBFo39IaafSr46x1s,501 +jedi/third_party/typeshed/stdlib/3.7/contextvars.pyi,sha256=pB3s9rSQNfwqsPqxzsibNl7X0urHvfbXBuP5Cx-3614,1123 +jedi/third_party/typeshed/stdlib/3.7/dataclasses.pyi,sha256=3PoC0Dy1Fj1XD5L4lC99OS28lAVXeYS8F-ZLgHpvjJ8,2371 +jedi/third_party/typeshed/stdlib/3/_ast.pyi,sha256=x41etWzf-IKJt-HGYubAAVPe78drORVhpbDfZJzGAW8,8124 +jedi/third_party/typeshed/stdlib/3/_compression.pyi,sha256=ZXBNnPgBQI_3OgWX9m8Rwcemj7r2Hoc21Ww4GnaQ0PA,436 +jedi/third_party/typeshed/stdlib/3/_dummy_thread.pyi,sha256=eurqRwuKXCugsXKBB_45dhYwMfGsEOI3JM36MU0_38c,800 +jedi/third_party/typeshed/stdlib/3/_imp.pyi,sha256=0MPDRDHGy2ouLyuDld55h2L7-Qn1fARYhOse2F7kOUA,717 +jedi/third_party/typeshed/stdlib/3/_importlib_modulespec.pyi,sha256=rwHCcZq_YPTzkGuMT1DmexStrex3EY_21-p3jPEmDVE,1557 +jedi/third_party/typeshed/stdlib/3/_json.pyi,sha256=L-S6Lxn7Upj1pSrmIMW74tqzlCdjb-5ynM4BO-Zm7io,932 +jedi/third_party/typeshed/stdlib/3/_markupbase.pyi,sha256=_U0_k8QBbLZfh7SWSoKwFzGIcM87JSINbQ8xpc003us,257 +jedi/third_party/typeshed/stdlib/3/_operator.pyi,sha256=8KJGh-OC_26pbOju5D1jfeg8AoOlELd3qKKajyKTunY,1343 +jedi/third_party/typeshed/stdlib/3/_posixsubprocess.pyi,sha256=MF9OFcdbTVeggcxZAhpgu9es-ABRTTdNl4Vhgh-OySc,600 +jedi/third_party/typeshed/stdlib/3/_stat.pyi,sha256=TN1v47l-n5g6KYdAZEoxisqhqGhPUnMUGACM4M2hOxI,1222 +jedi/third_party/typeshed/stdlib/3/_subprocess.pyi,sha256=uqVbboeWLiZSR4jrNlSPMOqtwOkT9Ye-v2E3GKjah3c,1279 +jedi/third_party/typeshed/stdlib/3/_thread.pyi,sha256=WwxO4O6HfK-NYwwsj-54kpJt2QSgKnr4a5keMA0DYsw,1335 +jedi/third_party/typeshed/stdlib/3/_threading_local.pyi,sha256=OTIwB9dVrg_cmS0Wqf25DOAlo8Vq1b9EIohc7pmjkCE,570 +jedi/third_party/typeshed/stdlib/3/_tracemalloc.pyi,sha256=c_1Fr_96JVx5kDJ6X78o9hrfZNCSGCtEB5X-6WCpbOc,609 +jedi/third_party/typeshed/stdlib/3/_winapi.pyi,sha256=lQJpTa59jIbOA7KzgqFFGC06qrCPbleiU_UK9xhWLG8,4106 +jedi/third_party/typeshed/stdlib/3/abc.pyi,sha256=nlQT-4gAz5QCKtxIHb2l_N2EinIRNGPD_PNkY94XNW4,613 +jedi/third_party/typeshed/stdlib/3/ast.pyi,sha256=jbDOekfcRnNXu2n4BxKFiPQVVe3qKhp6vNg-RrOxdYU,2333 +jedi/third_party/typeshed/stdlib/3/asyncio/__init__.pyi,sha256=YYnxp6-J5NUl3IstBxKe9RPxNL6yb_rzVBlTWLq_1F4,4157 +jedi/third_party/typeshed/stdlib/3/asyncio/base_events.pyi,sha256=jMqZyDTRbQmXSaXrWBBxpAnJUZFZdOT1J1GK_YiTQ7E,13208 +jedi/third_party/typeshed/stdlib/3/asyncio/constants.pyi,sha256=nIes79KdvHJZYkWBcKddYLsy9JvqlN_PEAmo1lxX6LM,278 +jedi/third_party/typeshed/stdlib/3/asyncio/coroutines.pyi,sha256=sUo7_LdL-0tyiCwTjNjyaPbFRlADqzF389CbTM1nJpk,226 +jedi/third_party/typeshed/stdlib/3/asyncio/events.pyi,sha256=nGCIhwZ9BmHcMUDgnKu_yd1t98BWMbfmX_7OD_SXnc4,17785 +jedi/third_party/typeshed/stdlib/3/asyncio/exceptions.pyi,sha256=dROhdLRjCGhqH7bI3_yUbPBr7aIKBM1Ks_iWi-7HOq0,562 +jedi/third_party/typeshed/stdlib/3/asyncio/futures.pyi,sha256=Z9r9bltjCc1WyFedtdttKNlhridTqwW_tWxCszy_43A,2403 +jedi/third_party/typeshed/stdlib/3/asyncio/locks.pyi,sha256=MQQH4OJCxyQF19UrTQkLCuLFZXWCiNMDwmdI1QTYgh0,2067 +jedi/third_party/typeshed/stdlib/3/asyncio/proactor_events.pyi,sha256=gjkE7e7S6WJlekzGIW3nD07XnRdTXTKqSxACutqkH94,4210 +jedi/third_party/typeshed/stdlib/3/asyncio/protocols.pyi,sha256=PGyAf7zfdzRUsoARxwuy9PIuAQ7HKe0Ybroc1hWfboc,1053 +jedi/third_party/typeshed/stdlib/3/asyncio/queues.pyi,sha256=t7mQ8wtksM2lXmcEdlvjMmPVqfLGD7OLKTaZ67iHpko,1082 +jedi/third_party/typeshed/stdlib/3/asyncio/runners.pyi,sha256=F8x4Ck2ExF6a-0x6iVno1JBkvfh56wYQ5eH24jMv9HI,177 +jedi/third_party/typeshed/stdlib/3/asyncio/selector_events.pyi,sha256=IH4g7KGmJpQEY8x5I8RaciU_Do87FE4Dw8wa5V5xKu8,1759 +jedi/third_party/typeshed/stdlib/3/asyncio/streams.pyi,sha256=pd2_43OttCswNH7POUuVXb8p-p74NkjSSP7BL9TxE2w,3899 +jedi/third_party/typeshed/stdlib/3/asyncio/subprocess.pyi,sha256=jqeiT-60UiXtMZ17u0D9hcBehCTCHWrFRbckWVKDtjo,2198 +jedi/third_party/typeshed/stdlib/3/asyncio/tasks.pyi,sha256=oVT2RCHiYyBNAkhmLXhEujSRbBaDxKY8m05wm3w6kOI,6877 +jedi/third_party/typeshed/stdlib/3/asyncio/transports.pyi,sha256=9dNFjOqI2EQ2OvpZgEfJm-WEbdS4naONxmSQC-mCFh0,1872 +jedi/third_party/typeshed/stdlib/3/asyncio/windows_events.pyi,sha256=cq9TjsTM3jxCQjonooOLwh4aI5JPmXH9Dsb9bPByaKM,2804 +jedi/third_party/typeshed/stdlib/3/asyncio/windows_utils.pyi,sha256=WqkVC7o0FeJCN-SUzlJcqXxCHMT5A3krM2-QP4jy9s4,680 +jedi/third_party/typeshed/stdlib/3/atexit.pyi,sha256=o1Mr2qp3jBDvHFG0uFRVvNoFUKxPA1LdKJ75BAAuMhE,313 +jedi/third_party/typeshed/stdlib/3/collections/__init__.pyi,sha256=i2Ld9ngLZ7WcUrZuDY8nCvh0r-BmSfykHLfBrCYd-C0,14431 +jedi/third_party/typeshed/stdlib/3/collections/abc.pyi,sha256=sOPDwaNtsb9MSOGrPXF8kEXezw292skChTdS84xbBwg,945 +jedi/third_party/typeshed/stdlib/3/compileall.pyi,sha256=7x1O8qguaGoNivvjGsgjRwfE9jYelyjygpYd5zIUNZA,2237 +jedi/third_party/typeshed/stdlib/3/concurrent/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/3/concurrent/futures/__init__.pyi,sha256=Mo63FTaJSSUTOoqI6QqPzSs-5Zsqu1IbpBqs-kPlsI8,108 +jedi/third_party/typeshed/stdlib/3/concurrent/futures/_base.pyi,sha256=521_mk-Go1AaD1B3Ul1XDF_rAdqNPD2399dwMmzPCG8,3923 +jedi/third_party/typeshed/stdlib/3/concurrent/futures/process.pyi,sha256=mm-XGMynAtkOmTTNMIpxZhrQQZGPlKTrb9jKZ-wkARc,699 +jedi/third_party/typeshed/stdlib/3/concurrent/futures/thread.pyi,sha256=-9Rr7NHNi5rqHq3aJ3LIdZHWQ0HAkYsWrAhNpdzOJq4,1162 +jedi/third_party/typeshed/stdlib/3/configparser.pyi,sha256=FSj8clhmdyfm1IJUF1Ay5HxDqh7sLu5kxIDs4Qg3yi0,8375 +jedi/third_party/typeshed/stdlib/3/copyreg.pyi,sha256=BsqFQ_hSsV_oqeJFO_GZ2J1tFl4EpnGZgx-NYmt_ZN0,726 +jedi/third_party/typeshed/stdlib/3/email/__init__.pyi,sha256=Xo_lp7ixhhAwFvtgnPEXPmIERZ3op3Ti0uof--_6oOY,789 +jedi/third_party/typeshed/stdlib/3/email/charset.pyi,sha256=7xr1qNw_tZCNKyXcqQUlI7pB4rPJBb_OmvNEpFcXSQc,1156 +jedi/third_party/typeshed/stdlib/3/email/contentmanager.pyi,sha256=M_3Fikh96bTv0zlSHxWBd4okSCHLBiC1tGWbIZ0vINQ,580 +jedi/third_party/typeshed/stdlib/3/email/encoders.pyi,sha256=H9sVxzOu1oJhhXXaJKeQ7xKLhdGhpLhpfGS5q9oYG9g,255 +jedi/third_party/typeshed/stdlib/3/email/errors.pyi,sha256=kIPe0D-yO5A1EVjti8VK1OWs-YQsYVGxSFI-S7cMqNU,863 +jedi/third_party/typeshed/stdlib/3/email/feedparser.pyi,sha256=Aawwaa0y2LWskLb5HVo8Y20V7HtOtuFwp9YkHnjniNw,572 +jedi/third_party/typeshed/stdlib/3/email/generator.pyi,sha256=8cWDdVOlgsCeEFXEugyfFhe0fcjjdKYt3yQMVgYrGOA,1126 +jedi/third_party/typeshed/stdlib/3/email/header.pyi,sha256=hhVBaR7C9X37lLczfVP_s92NRmyfS43RZi4vrmx6uWU,1143 +jedi/third_party/typeshed/stdlib/3/email/headerregistry.pyi,sha256=m0uAXcR22FBoB3u4WBnK5BUHTf4EIyOeUUwNY-kLpJY,2977 +jedi/third_party/typeshed/stdlib/3/email/iterators.pyi,sha256=lMAAWZXQdBXMcDNa491poQk8gr7RGK8xC-juMvSl93M,335 +jedi/third_party/typeshed/stdlib/3/email/message.pyi,sha256=eylsIb9ejdVYVxcSm101ntyLqDH4uIyKMdnhLNZ-J4w,5084 +jedi/third_party/typeshed/stdlib/3/email/mime/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/3/email/mime/application.pyi,sha256=J4XyvXK8_zKIDFTA5Dl8IHj_O3OphltZeQwBONWnSPY,452 +jedi/third_party/typeshed/stdlib/3/email/mime/audio.pyi,sha256=ey8Du9BzSOxcSfXI2ABUc_iugsbfBDUsYFahycEpB8k,449 +jedi/third_party/typeshed/stdlib/3/email/mime/base.pyi,sha256=IAmThaMkKFKFt1ul8UF6FGi2FM9DreDWxtpggVr59Ko,317 +jedi/third_party/typeshed/stdlib/3/email/mime/image.pyi,sha256=sw4h052DgXrS2ZV3GU9XAy_CH7VHtRoLixrCAMkao6s,449 +jedi/third_party/typeshed/stdlib/3/email/mime/message.pyi,sha256=w39GccrS4m3noQyVqQbbS4Jk-r3GVXDw8wGc_Yc6X0g,242 +jedi/third_party/typeshed/stdlib/3/email/mime/multipart.pyi,sha256=3SJ2r5b3kquH1GQKBx_fjCNstBiW-n2yIUKVNs3LiS4,458 +jedi/third_party/typeshed/stdlib/3/email/mime/nonmultipart.pyi,sha256=mov35SsLNY80sOlSPdEne6qbL7ZXLMHIRYqd16hVJ_Q,126 +jedi/third_party/typeshed/stdlib/3/email/mime/text.pyi,sha256=psGAv0ij65Ok9oJGak23boIqAav6Yxhlqo3W5nEIjro,275 +jedi/third_party/typeshed/stdlib/3/email/parser.pyi,sha256=XfKs52r2VQm4rX00u-Xc_6EDGI27hDjsHvvMdqQTbus,1435 +jedi/third_party/typeshed/stdlib/3/email/policy.pyi,sha256=UKQ2m1qZGCREgJDqSgGtjW4zZOa29j3R-CoVKnreG3o,2316 +jedi/third_party/typeshed/stdlib/3/email/utils.pyi,sha256=IFnz0Y7AFu7d4OAjBs6z8sQKez1hpDtJv1c5ZLdxUIc,1630 +jedi/third_party/typeshed/stdlib/3/encodings/__init__.pyi,sha256=Yw7sZPoNkgzrr5bUZJLvLr2QPdWSHiPXnMNaUaEljtA,75 +jedi/third_party/typeshed/stdlib/3/encodings/utf_8.pyi,sha256=tgCdNX8etJQWYWmOYAIZhK8lcYm_Kn67kylKJp0SgUo,573 +jedi/third_party/typeshed/stdlib/3/enum.pyi,sha256=NhM5Fg3TO5vkdYxRx3UHmny1ntdMsQNBoKJ3kQsNAhs,2867 +jedi/third_party/typeshed/stdlib/3/faulthandler.pyi,sha256=RtQp_LgBVno3qAyEZX4Xl8y3N44y4msK557-Jz9eJ0s,679 +jedi/third_party/typeshed/stdlib/3/fcntl.pyi,sha256=yL92ebxAejBWD-4HfyRpksrPcWeImt5AwEJoZPA75Ro,1788 +jedi/third_party/typeshed/stdlib/3/fnmatch.pyi,sha256=Ln-5P7VzP4o9hsxGqoj46sUM53RTiMeC_CNP2lVTf_I,366 +jedi/third_party/typeshed/stdlib/3/functools.pyi,sha256=ZNOYt8Omeomrx3WNfc9smD69Pa8QpJk0F8qCzw3O0c8,3560 +jedi/third_party/typeshed/stdlib/3/gc.pyi,sha256=70mpa5BwZvAcVftOXAnIv8SpoOHEGjZVuNZvDFwrEEc,952 +jedi/third_party/typeshed/stdlib/3/getopt.pyi,sha256=AcIuaBf6F9jiBKpgm1bDOqC1jZamW-ylbcTOKU3VZyQ,431 +jedi/third_party/typeshed/stdlib/3/getpass.pyi,sha256=s81upYZ38jmRD5q6dCSCCupnROWOT0VWEnwDdwj57S8,203 +jedi/third_party/typeshed/stdlib/3/gettext.pyi,sha256=4p7VZ_nugOlU7IzXS5W-6piKDJLTnOlFTcHvmaQxz8M,3067 +jedi/third_party/typeshed/stdlib/3/glob.pyi,sha256=pnwHkg2RH5a_zHEKSMOc7vQf0tP3SD-8uO6z0ELg5BU,640 +jedi/third_party/typeshed/stdlib/3/gzip.pyi,sha256=AN9zrmfKdt_J6oXOe5j2mxkT0pUEtamkFUfl-LulhrQ,2052 +jedi/third_party/typeshed/stdlib/3/hashlib.pyi,sha256=DmHlEirRWwVUiqjQCpZZW7IncRgo8rFuT2H5hDS9H2E,2353 +jedi/third_party/typeshed/stdlib/3/heapq.pyi,sha256=CDfUEVeVxNKZy3z5lpK_wNfBilFC4cvOGVesHI2uTZc,737 +jedi/third_party/typeshed/stdlib/3/html/__init__.pyi,sha256=qKsbjN2OJn_AoUr9a4zdFC8juUG9ii6rqYp3EQTSG-Q,122 +jedi/third_party/typeshed/stdlib/3/html/entities.pyi,sha256=ap6jI6Fw355WC0vSd-WGc957p_KpAJDGONUeAlItYzI,136 +jedi/third_party/typeshed/stdlib/3/html/parser.pyi,sha256=TdQPkBuvp-Fh_Yy6iU8Urzh3HOD8vh6kZWit6ESBW-o,1036 +jedi/third_party/typeshed/stdlib/3/http/__init__.pyi,sha256=2w8AePhrVLZ0BUQsI2Aewg5cBjpqqZ6AblHMTkVTs28,1689 +jedi/third_party/typeshed/stdlib/3/http/client.pyi,sha256=_8PTIIGQG0uoXjTAW9F9efHqh1RLkgZAIuQKCkRhCiQ,6269 +jedi/third_party/typeshed/stdlib/3/http/cookiejar.pyi,sha256=B_3jnt8jjnPzLcLQJxpoTCgPv9ZvxRe12ehzntsa4ew,4888 +jedi/third_party/typeshed/stdlib/3/http/cookies.pyi,sha256=CeZ9eyKLj6iON5PNf5_reyK7VZ4ARW7mW8RTBxVKOnQ,1280 +jedi/third_party/typeshed/stdlib/3/http/server.pyi,sha256=HlcjtG8t4szYpyIbVdnS2jevwU6mWOB6KAQRFghFtVs,3176 +jedi/third_party/typeshed/stdlib/3/imp.pyi,sha256=afomvRTfKCmVYpgaXPDmlU9VpL3cykp9RfUzA3V3F98,2138 +jedi/third_party/typeshed/stdlib/3/importlib/__init__.pyi,sha256=pBPYg6Efnw7acEBh85gu8hHTewc65QfQeXPPPJhthL8,597 +jedi/third_party/typeshed/stdlib/3/importlib/abc.pyi,sha256=XCoHncv6qlrF2Egmw9--dstAwdu9gr9mBNrnq9OShlI,3522 +jedi/third_party/typeshed/stdlib/3/importlib/machinery.pyi,sha256=w65O5JaFi7GFVcUYucR_Yd4y6fYwylA7MvHl_GBgI8E,3936 +jedi/third_party/typeshed/stdlib/3/importlib/metadata.pyi,sha256=F0swDuTMqX6wC09-yaSEcwTka_0jt_j6XM-R0pxedAA,3767 +jedi/third_party/typeshed/stdlib/3/importlib/resources.pyi,sha256=i5PzvUdz_keDjFVGCv87VASWmPm5_tHPy1hx3xin3jQ,1009 +jedi/third_party/typeshed/stdlib/3/importlib/util.pyi,sha256=GIWsvb7GYbQCEQIOhyfW11vtKQyeGFIFDq-M-l1UL-s,1871 +jedi/third_party/typeshed/stdlib/3/inspect.pyi,sha256=_Nn7Rj01clPrSwqLCYaTIAUKQvfotVCpYqgV8xCp8FI,10022 +jedi/third_party/typeshed/stdlib/3/io.pyi,sha256=RYGCjjSRyf-YQzWnyCK0rewhZ29kiB-OZ8UkDNZ4FrU,8466 +jedi/third_party/typeshed/stdlib/3/ipaddress.pyi,sha256=4quo1X7N6PQG4NVgeR9Y-thbsBBtpfnpZOCTv5Pnoh4,5119 +jedi/third_party/typeshed/stdlib/3/itertools.pyi,sha256=ohYZLsVOpv9VjiDCTUITKY1wY0K7xFQA6Bg00S8lU7A,4366 +jedi/third_party/typeshed/stdlib/3/json/__init__.pyi,sha256=47LQOx-dLM_KE61vFd0T8lLi4zyZV-XE-H8rk5ubxcY,2266 +jedi/third_party/typeshed/stdlib/3/json/decoder.pyi,sha256=TduT5m3LTRhcevZwrhQ-fAucy-b-15eW9qxVL1y5Wp8,1052 +jedi/third_party/typeshed/stdlib/3/json/encoder.pyi,sha256=YanOwEwL2tYxR6mPAq3erLsdlio_ByjvufU_4EvvkKs,742 +jedi/third_party/typeshed/stdlib/3/lzma.pyi,sha256=VJ0RWmhVqpUUGFYli4I4IlYjQVL7GDzKSo2OLMKk8Wk,3273 +jedi/third_party/typeshed/stdlib/3/msvcrt.pyi,sha256=CkQcESS0QT8f3fGwNrL0oV7RW6GXaPjGBKkskBKjKJg,148 +jedi/third_party/typeshed/stdlib/3/multiprocessing/__init__.pyi,sha256=jdL7Ak96mZRzWmgWCpj2Gn3qxG64f0anuVMkc880R9Y,3576 +jedi/third_party/typeshed/stdlib/3/multiprocessing/connection.pyi,sha256=hcvgVjEwBdXWCy8oLjCszrju-NQqdwpRFKX9eoCMnBw,2093 +jedi/third_party/typeshed/stdlib/3/multiprocessing/context.pyi,sha256=mQUiufmmr88Sb5kNInRUU21W4bDenexp4n1iTJ-YvyQ,6385 +jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/__init__.pyi,sha256=p1cuOM_HB1QqijgTdT0hSfgR5CYc1MzBXmJ3nVs1Nik,1165 +jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/connection.pyi,sha256=QS9PgiQv0pJnI7nwIDdgyN62Ee_Ls3C7aVOQcjsN_RY,1097 +jedi/third_party/typeshed/stdlib/3/multiprocessing/managers.pyi,sha256=4igjP9jqKPJTsEQnKwlpddzxBwyMQobS9g8g6cs4ojM,2905 +jedi/third_party/typeshed/stdlib/3/multiprocessing/pool.pyi,sha256=Pn61xU1MG9Oh0nQ0kUH6iNE_23ygvYDGD4Pw8rHY_4g,3452 +jedi/third_party/typeshed/stdlib/3/multiprocessing/process.pyi,sha256=xgr63P0b4blFVTbP7ykriwyobBorYk9Ityc-CEKMvTY,1142 +jedi/third_party/typeshed/stdlib/3/multiprocessing/queues.pyi,sha256=52WIBRL6l01X-T1AwIwNXOkccN7EhfV2AVtCiWStXPw,1109 +jedi/third_party/typeshed/stdlib/3/multiprocessing/shared_memory.pyi,sha256=fCHuNppwEErwyGziuVwur1MuwLMwizkmWOx4Pk9HvPQ,1121 +jedi/third_party/typeshed/stdlib/3/multiprocessing/spawn.pyi,sha256=uy0-49duOwkv58ijeWCk1s36EgljQIuqvOdYlnnHHZ8,687 +jedi/third_party/typeshed/stdlib/3/multiprocessing/synchronize.pyi,sha256=YOlndD_kan5uhROrJL0mpAO4Dt96VDazKVSIYmQstIg,2072 +jedi/third_party/typeshed/stdlib/3/nntplib.pyi,sha256=cFohLmM-WvsBLhr0Cqsy3ZpcqKj-s9WQ5V9-UPNaayA,4232 +jedi/third_party/typeshed/stdlib/3/nturl2path.pyi,sha256=E4_g6cF1KbaY3WxuH-K0-fdoY_Awea4D2Q0hQCFf3pQ,76 +jedi/third_party/typeshed/stdlib/3/os/__init__.pyi,sha256=uJriP-j0XYm-1HmV-Ql7TWNPo_W9mcBNGOUv8qAWK2U,26117 +jedi/third_party/typeshed/stdlib/3/os/path.pyi,sha256=KHXAq47ML8XXphkrwvNaUWEZPnR4JeEIHvM_mxClRZw,6228 +jedi/third_party/typeshed/stdlib/3/pathlib.pyi,sha256=k57uwa725OfKqoBVHdvXWt2Uuc_AFWyiiSK_SXBtnq4,5508 +jedi/third_party/typeshed/stdlib/3/pipes.pyi,sha256=D1sF3sIscYyvbhc_PKpM2WvIrmtc7L-MefgDHoNlmlI,595 +jedi/third_party/typeshed/stdlib/3/platform.pyi,sha256=ttdJXmy-5k3-tq7M81IHoetp8n99As0EDHMHeGyfiVQ,1845 +jedi/third_party/typeshed/stdlib/3/posix.pyi,sha256=RE2b2rBLm46j8jnXKuHGXFV5ychUMCh30gF8HKCw07c,2234 +jedi/third_party/typeshed/stdlib/3/queue.pyi,sha256=GX69EDS0Emb9H8BUMvZdunhHeT5P41E5Jlmjnd4h_JA,1670 +jedi/third_party/typeshed/stdlib/3/random.pyi,sha256=OJUQM6blTAru-BXC6LmYd31DgsfAjH0DGHH7o9guTNg,3483 +jedi/third_party/typeshed/stdlib/3/re.pyi,sha256=kXjNcJVwjsBheuhj6wEdbb1wozZkiYySblXfXmhPoqI,5126 +jedi/third_party/typeshed/stdlib/3/reprlib.pyi,sha256=pbEZSwWDo29vTb6s1dLTOp44KDzj45f9wvfyDNAyDb0,1259 +jedi/third_party/typeshed/stdlib/3/resource.pyi,sha256=XteVYHR0NUzbdx4K5408Q5ShnEx_fSFsbTYyHeL1lo0,1168 +jedi/third_party/typeshed/stdlib/3/runpy.pyi,sha256=JeImZ6lLwXaVkjIHS1DbD_kUk1edxu4hNAUfxeRN5Tw,694 +jedi/third_party/typeshed/stdlib/3/selectors.pyi,sha256=XVuUf207_y-lXmUFdwzzef6RqdK0Nb3ldUrhhEFC4_Y,3614 +jedi/third_party/typeshed/stdlib/3/shelve.pyi,sha256=36Bo_Ohg-kQnwI6Ysd3D_T1Tc_5AKgEvRkGiK3iPv5U,1578 +jedi/third_party/typeshed/stdlib/3/shlex.pyi,sha256=G2SVpArVj8eOkdcbH2ah6CBG30wArYN6ZAsoqC_4INk,1552 +jedi/third_party/typeshed/stdlib/3/signal.pyi,sha256=a2j4yLpAcOu1XTajomobCYgqyhNQFQF-ZojsXoZw1f8,3369 +jedi/third_party/typeshed/stdlib/3/smtplib.pyi,sha256=UPifdCgI7NhD-OK9nRkrVreWUXQjywLzclc9nQFEg0E,5604 +jedi/third_party/typeshed/stdlib/3/socketserver.pyi,sha256=gSrcQtIyOY1ov9ys8s4P_CnN3bx5GjZRPC8kQb0g9SA,3950 +jedi/third_party/typeshed/stdlib/3/spwd.pyi,sha256=aAmkS56-90q7hfKMkpAmUifbEQy32e2c-gW_KVHTEn8,310 +jedi/third_party/typeshed/stdlib/3/sre_constants.pyi,sha256=qfzf_zGNuLXow74nncPYAgd6Kv8nt_GKHcmPKB26Mxc,3406 +jedi/third_party/typeshed/stdlib/3/sre_parse.pyi,sha256=mUG3QQZari9nxeEtItZcaed4hdYZYRY_--bjd3aFyCs,3419 +jedi/third_party/typeshed/stdlib/3/stat.pyi,sha256=gF7bA3x50cH0bspmkUah1KqlXvWddcS_SBKCKCszaHk,1885 +jedi/third_party/typeshed/stdlib/3/statistics.pyi,sha256=Pvpnvyg6x-4V0JGEWdZ4ucZ_XVP0jo0CSrsY5RZMKYk,2890 +jedi/third_party/typeshed/stdlib/3/string.pyi,sha256=qEYTRnXUzlNFAQKxdNVCRJoQSwrmXLARasscEc-qRYU,1571 +jedi/third_party/typeshed/stdlib/3/subprocess.pyi,sha256=hupnjKaUmdcubDX8jtpZE9X5Ea2gS2-TTnrMm2aZ4dY,46402 +jedi/third_party/typeshed/stdlib/3/symbol.pyi,sha256=8qlz7ijaYuwRgx7Thyobse_R0jHdXp3H1V3yLpplQmk,1460 +jedi/third_party/typeshed/stdlib/3/sys.pyi,sha256=r59aicveJb8_qQqXp6-JUMZUP47j0alhapaysR7AfLw,5949 +jedi/third_party/typeshed/stdlib/3/tempfile.pyi,sha256=YTxAUYBHWXBeRebtBLl88xfDRfZFGlexlpf8tmXiI_4,6339 +jedi/third_party/typeshed/stdlib/3/textwrap.pyi,sha256=K8M1vjQKX8BB9-TfmgtugEtfwSK5vWZpy3K-bVo7NGY,3457 +jedi/third_party/typeshed/stdlib/3/tkinter/__init__.pyi,sha256=tXaAcPyfApVyg0qkBQ1Y1aFxsYCOEAJxxmBi1JlfIVU,25710 +jedi/third_party/typeshed/stdlib/3/tkinter/commondialog.pyi,sha256=GXUxL-Y2G2Y3DgfMNMNpCUzuRnZ746Iij-R56ZXCu6E,277 +jedi/third_party/typeshed/stdlib/3/tkinter/constants.pyi,sha256=nEpwKcTYIZWguP1vAzLXfcrUnG6IbCKrUdu3C08JWB8,880 +jedi/third_party/typeshed/stdlib/3/tkinter/dialog.pyi,sha256=nfHISRyWWZ1vA7sHLW1AjOPeTMq_H09SXOnf7ryWB14,291 +jedi/third_party/typeshed/stdlib/3/tkinter/filedialog.pyi,sha256=6_6Zuq-pC24IdnGatIyf1Kyu_bu6a5myFeTe_1h_a7U,2233 +jedi/third_party/typeshed/stdlib/3/tkinter/messagebox.pyi,sha256=Q0-rK5wXBbbzvx4Mpf92dITPgL7Lwjw8t4CLfpYV0hw,1150 +jedi/third_party/typeshed/stdlib/3/tkinter/ttk.pyi,sha256=AOZj8wd3NyxKg6t6raQbqWC-zSiz5mTJlWNOdBAXIy0,6355 +jedi/third_party/typeshed/stdlib/3/tokenize.pyi,sha256=oKiVKNONV-yCTYfcFxayTEFVHVjRX1lhqud0g4kiDw4,2439 +jedi/third_party/typeshed/stdlib/3/tracemalloc.pyi,sha256=i2eZJJQzhImw61Rek2K3C6SFPbDg_eoOysavIO4QG0E,2144 +jedi/third_party/typeshed/stdlib/3/types.pyi,sha256=KqCDjYN7mAZ18FModvJ_C_8Yix9fIh1eF8Jexqi0CGk,10083 +jedi/third_party/typeshed/stdlib/3/typing.pyi,sha256=fxZNRC8V1OeA9pgzU6v_3jTr9FFXmW_3EMdBsBP3zyw,22471 +jedi/third_party/typeshed/stdlib/3/unittest/__init__.pyi,sha256=-c1qPZ9JUpZ86uj-lLZNRc0PiSZFAsUlRhk042umGMg,1034 +jedi/third_party/typeshed/stdlib/3/unittest/async_case.pyi,sha256=q_NoN53bOPfBS4wDcA6nwqXRQ8L-wjT9N4l5yPul7Js,371 +jedi/third_party/typeshed/stdlib/3/unittest/case.pyi,sha256=L78qIMTogSK6STY5AOxrsXimL4Hl0MxyvTw84OtqCBM,13002 +jedi/third_party/typeshed/stdlib/3/unittest/loader.pyi,sha256=VuSbtNEBaVKStX15-B3W5T9OelHno_DEudNC7AFNYVc,1222 +jedi/third_party/typeshed/stdlib/3/unittest/mock.pyi,sha256=OBoLzvrtkPrs9IxQtt_gBsw3akvmZ8-7CJN5uftwM48,5304 +jedi/third_party/typeshed/stdlib/3/unittest/result.pyi,sha256=tZSqdLbAOmSwNi6jTzmSfQ9hncV1qdD-Z8EQ4FgxUlc,1617 +jedi/third_party/typeshed/stdlib/3/unittest/runner.pyi,sha256=s8MWlVfk6oJDDlYgFWAcwaiIXoR0FtwTKwZsCV1KGbk,1210 +jedi/third_party/typeshed/stdlib/3/unittest/signals.pyi,sha256=A3-SvVwavp_iZRc3Ibiegd6ZmvnfkpEigGIRkbdc07E,388 +jedi/third_party/typeshed/stdlib/3/unittest/suite.pyi,sha256=--mzq9jrdkyd_GIvh9-lxkUlpXuq-U0GtDYx77mRcP4,791 +jedi/third_party/typeshed/stdlib/3/unittest/util.pyi,sha256=Uq5zG5zmTjLxd9A9j3BKX5K08z28VtNVNMmPOoAKbyE,921 +jedi/third_party/typeshed/stdlib/3/urllib/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/stdlib/3/urllib/error.pyi,sha256=w9_xafGchG3KKvyc-SiPw5OGX9u7YWPInY35h0f_8wg,317 +jedi/third_party/typeshed/stdlib/3/urllib/parse.pyi,sha256=3bye3kyooYmsHYv7VeZ3rEUwBab75A9u37d1RmL7WOM,4651 +jedi/third_party/typeshed/stdlib/3/urllib/request.pyi,sha256=XIJ12Kp4qyhzgSPMFQf9G2QshYkJjZJGuCMGS-7w4I0,10004 +jedi/third_party/typeshed/stdlib/3/urllib/response.pyi,sha256=n2tffJxxDD2I84lj69TBozAnUCq5FhDO7gdibbZR5VU,1682 +jedi/third_party/typeshed/stdlib/3/urllib/robotparser.pyi,sha256=_8Np93XxaIviWGM0xjrzzAY9wBU3ciUBNJaBCh0g230,695 +jedi/third_party/typeshed/stdlib/3/zipapp.pyi,sha256=H5HZjKik0haVfQxkE9yeFmuagoPYvV4eqFRcosHxSTs,663 +jedi/third_party/typeshed/third_party/2/OpenSSL/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2/OpenSSL/crypto.pyi,sha256=ap-fqiGpCMjTyMMQQW9tKQ7QmTEK38_mr1urwX4T0Zs,7644 +jedi/third_party/typeshed/third_party/2/concurrent/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2/concurrent/futures/__init__.pyi,sha256=Mo63FTaJSSUTOoqI6QqPzSs-5Zsqu1IbpBqs-kPlsI8,108 +jedi/third_party/typeshed/third_party/2/concurrent/futures/_base.pyi,sha256=521_mk-Go1AaD1B3Ul1XDF_rAdqNPD2399dwMmzPCG8,3923 +jedi/third_party/typeshed/third_party/2/concurrent/futures/process.pyi,sha256=mm-XGMynAtkOmTTNMIpxZhrQQZGPlKTrb9jKZ-wkARc,699 +jedi/third_party/typeshed/third_party/2/concurrent/futures/thread.pyi,sha256=-9Rr7NHNi5rqHq3aJ3LIdZHWQ0HAkYsWrAhNpdzOJq4,1162 +jedi/third_party/typeshed/third_party/2/enum.pyi,sha256=NhM5Fg3TO5vkdYxRx3UHmny1ntdMsQNBoKJ3kQsNAhs,2867 +jedi/third_party/typeshed/third_party/2/fb303/FacebookService.pyi,sha256=vR9GgxjOjaSmAqQSr4szk0WzmPrEG72sH7Hg6GG25B0,8675 +jedi/third_party/typeshed/third_party/2/fb303/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2/gflags.pyi,sha256=uiB-2WU0th_gaNG_UEfWh7R94vym5eVTBmaCAU4L6Ws,10569 +jedi/third_party/typeshed/third_party/2/ipaddress.pyi,sha256=4quo1X7N6PQG4NVgeR9Y-thbsBBtpfnpZOCTv5Pnoh4,5119 +jedi/third_party/typeshed/third_party/2/kazoo/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2/kazoo/client.pyi,sha256=Y1V3wfUp0eiTP3zQ0B-pEahZas9lqUBODu9IYjlVtWM,3310 +jedi/third_party/typeshed/third_party/2/kazoo/exceptions.pyi,sha256=7DhQ3xMt63lVinoWQv0vwI6VmG2IfNPlMpLRGu_gq-s,2054 +jedi/third_party/typeshed/third_party/2/kazoo/recipe/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2/kazoo/recipe/watchers.pyi,sha256=Pxdwrx10R_orsLVINsoCsy-TL6a96EumRsENf2G11BE,551 +jedi/third_party/typeshed/third_party/2/pathlib2.pyi,sha256=k57uwa725OfKqoBVHdvXWt2Uuc_AFWyiiSK_SXBtnq4,5508 +jedi/third_party/typeshed/third_party/2/pymssql.pyi,sha256=WhikYOS5kK7POYcelOOkDMaLZLEMQOLB2yZZtZ43xfw,1876 +jedi/third_party/typeshed/third_party/2/routes/__init__.pyi,sha256=G9OldbNFqOLKbDGv0kLJQGDpmWkeXtacGmA5pT7lRpk,377 +jedi/third_party/typeshed/third_party/2/routes/mapper.pyi,sha256=YFVazTh_FfeitJBAncVwWzDN25Vj8i6U85r_rTL-8fE,2294 +jedi/third_party/typeshed/third_party/2/routes/util.pyi,sha256=U9AvEa_p8Q1eq1zmIMKpGMjYqFbd9YSvTbv7W1Ez49Y,576 +jedi/third_party/typeshed/third_party/2/scribe/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2/scribe/scribe.pyi,sha256=qJx-l5udxCRwizDaOJMFxI0w9YolQCt6pOA44Qh_UoQ,1199 +jedi/third_party/typeshed/third_party/2/scribe/ttypes.pyi,sha256=Ub8_sHFFbDuMouo-wUU4bkr-WhUpSOVLBJ6zb9amqBs,383 +jedi/third_party/typeshed/third_party/2/six/__init__.pyi,sha256=gNOLvFwxEBwgT-W2HZhWFvVW06pDP57ioX-836OBivQ,3722 +jedi/third_party/typeshed/third_party/2/six/moves/BaseHTTPServer.pyi,sha256=tGipj5ccgHt3EnzbxpPyQGUVnvu7RltrUOqgqWNGwpw,29 +jedi/third_party/typeshed/third_party/2/six/moves/CGIHTTPServer.pyi,sha256=omAocPqXteLJkGtdobdZjdzXynzCtn0jCFwBBlc3LUc,28 +jedi/third_party/typeshed/third_party/2/six/moves/SimpleHTTPServer.pyi,sha256=nC0fjp9wrhSnJMI8N2QD7ovWp1CW-dJWLyaV4K_Ql54,31 +jedi/third_party/typeshed/third_party/2/six/moves/__init__.pyi,sha256=VCGQ9wX9M4r3KqOwBRwGJgC3Xs2MZr_Al32oZyepLdI,2383 +jedi/third_party/typeshed/third_party/2/six/moves/_dummy_thread.pyi,sha256=Va4LPdV5kK4luB-1NlkmycnVpXD4kKeYFD5QmmNqE8U,27 +jedi/third_party/typeshed/third_party/2/six/moves/_thread.pyi,sha256=9194lgQXs2W3sR00kP7Zn9gx9WWl0C49GEsbvzshDy0,21 +jedi/third_party/typeshed/third_party/2/six/moves/cPickle.pyi,sha256=hS7yIew9WYdHI_b6XwIlHAfRFRpUTKj7IokSZcpJ4PY,22 +jedi/third_party/typeshed/third_party/2/six/moves/configparser.pyi,sha256=r3G3JXE9Yo34AASn9AoNcielq9KuyQ3xrtElpnhRJYc,27 +jedi/third_party/typeshed/third_party/2/six/moves/email_mime_base.pyi,sha256=WcWEleCKHROrfdXpRuKABrT_Va1hx90NY_kxYeul3Sk,30 +jedi/third_party/typeshed/third_party/2/six/moves/email_mime_multipart.pyi,sha256=HRKWFU9qh95-mEE22_2NzEKL6lx7ynvhcfHjUcYWuZ8,35 +jedi/third_party/typeshed/third_party/2/six/moves/email_mime_nonmultipart.pyi,sha256=n5hD7R_rktJj3hiHYzEqr3CJCHSW4ikfObKHmUrXBw0,38 +jedi/third_party/typeshed/third_party/2/six/moves/email_mime_text.pyi,sha256=55VzBSQimrZf6UgotoXMiJDvqbKXly6-E_IXo6Ix22c,29 +jedi/third_party/typeshed/third_party/2/six/moves/html_entities.pyi,sha256=I0BI00vvC21L_BgnCbpjio-s1jqF4ARTt-qaol7mGig,29 +jedi/third_party/typeshed/third_party/2/six/moves/html_parser.pyi,sha256=hivJeBkqiAIZ6mvO1v4tOC9Mg6MzMR08P9tzsODdul4,25 +jedi/third_party/typeshed/third_party/2/six/moves/http_client.pyi,sha256=P8tgtt5Icp-ksHij6yPb_zuKk7ckcAHt_HM3aO0WrSM,22 +jedi/third_party/typeshed/third_party/2/six/moves/http_cookiejar.pyi,sha256=HUlF3MydQRX2Vv5G6KtN_Q6iCS48LBDggoDuPbEQUCc,24 +jedi/third_party/typeshed/third_party/2/six/moves/http_cookies.pyi,sha256=itzb5D5Mp66bx7hjyI3u-hri4h9jgqVzZyMfz4xNu2k,21 +jedi/third_party/typeshed/third_party/2/six/moves/queue.pyi,sha256=6Llng-UlZW_9HSWFgmIgW2q9YhaZ-Nzh2zJ8hkqoaZA,20 +jedi/third_party/typeshed/third_party/2/six/moves/reprlib.pyi,sha256=SWZYhGRU6moFAVBo5dUFUB9kyY6TO_kgrIqxzqDQ3C0,19 +jedi/third_party/typeshed/third_party/2/six/moves/socketserver.pyi,sha256=oeRnmecMYQfMmwRFVydatyCfs_HLrJYZvf5p7nm_ryE,27 +jedi/third_party/typeshed/third_party/2/six/moves/urllib/__init__.pyi,sha256=F_1V8NcR4jGkws85IUurYLi4JnGh7_HttdVHvj8cQZM,217 +jedi/third_party/typeshed/third_party/2/six/moves/urllib/error.pyi,sha256=zssV6Test1CzUPpuq9yzsf9pndbhrb2eC1aqNSbY1_8,148 +jedi/third_party/typeshed/third_party/2/six/moves/urllib/parse.pyi,sha256=MFRSOFgWPp5-My6T9xbY736TQX0bqKmJVr2TgZHcIdk,1055 +jedi/third_party/typeshed/third_party/2/six/moves/urllib/request.pyi,sha256=EmFJ7eWBbRlgAsm7HaKSZxX55lpoo5ozOFVjEfI0Xos,1960 +jedi/third_party/typeshed/third_party/2/six/moves/urllib/response.pyi,sha256=vlC9X8P4ry421TmzI06mdtx5vGDxEyFfbpXp3R6IblE,206 +jedi/third_party/typeshed/third_party/2/six/moves/urllib/robotparser.pyi,sha256=C8_E9lApZyMQpHflnHpYeyAgvQ_vFSuKon9Gl5DM3Q0,59 +jedi/third_party/typeshed/third_party/2/six/moves/urllib_error.pyi,sha256=7RTGNFpeUX5KEap9vyjA1Xc3Twfkut431Nu5290po1U,28 +jedi/third_party/typeshed/third_party/2/six/moves/urllib_parse.pyi,sha256=Q3BVGITL1UwlTmBsFD9iLf2pggJgTE5bG32QANdkMvo,28 +jedi/third_party/typeshed/third_party/2/six/moves/urllib_request.pyi,sha256=8WFe7ycArSuM6wJfgcXWLDRKNsymd0UlxWlflszb2yk,30 +jedi/third_party/typeshed/third_party/2/six/moves/urllib_response.pyi,sha256=dokFMleMVEVFVxBgSkrcn4f4yM7RhR3zkk0iDQGOC_U,31 +jedi/third_party/typeshed/third_party/2/six/moves/urllib_robotparser.pyi,sha256=8c26GW8MTI6cxDTD65N_18NRQcqWY4P9v8mrQm8c-oI,26 +jedi/third_party/typeshed/third_party/2/six/moves/xmlrpc_client.pyi,sha256=hL_FNiBles8aoJq0XQLbEHvWX1AedYbQopgRVQlbCEI,24 +jedi/third_party/typeshed/third_party/2/tornado/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2/tornado/concurrent.pyi,sha256=THaUUH9XW_opc-G528IhDDrf-cOBVx9ZJAQKAgoqr34,1016 +jedi/third_party/typeshed/third_party/2/tornado/gen.pyi,sha256=WPudybrtny-geS69g62Hkv-NApwTukIA8BrPCn5QzVg,2785 +jedi/third_party/typeshed/third_party/2/tornado/httpclient.pyi,sha256=QDNt98_mJN_NAhoSMc8D1pwnWpetON45Uio1RGuchdM,3033 +jedi/third_party/typeshed/third_party/2/tornado/httpserver.pyi,sha256=ysryZ2jqWX1DT5Q1KgdDH6o8AJRYHReYl3OHUaqG56Y,1535 +jedi/third_party/typeshed/third_party/2/tornado/httputil.pyi,sha256=HrjRcOpg1auAB0fxEYnxIrzp8Oro-SQO27cQxJdmR2w,2681 +jedi/third_party/typeshed/third_party/2/tornado/ioloop.pyi,sha256=0TA4AI6glp8s6iw66lu2IiEJjAn1_PzjkcEaMmynshM,2797 +jedi/third_party/typeshed/third_party/2/tornado/locks.pyi,sha256=6LDrW8nuBZLsAe90h1UYs92k_41UjcxE8vpEhc_LBzM,1279 +jedi/third_party/typeshed/third_party/2/tornado/netutil.pyi,sha256=yhT00BrDQgVukDfek6GB2JfOSfT0Gn8Xm45TKM2ut6I,1349 +jedi/third_party/typeshed/third_party/2/tornado/process.pyi,sha256=NsnEzaGJtchXD3_1d5-cZ-C2q-h9ocucfLvT575cbrg,662 +jedi/third_party/typeshed/third_party/2/tornado/tcpserver.pyi,sha256=1N0cm3HUZlN3dfsgzrdYTNMEN3nvGu7r2UsE7WuJQ9Y,556 +jedi/third_party/typeshed/third_party/2/tornado/testing.pyi,sha256=EFFQ1ZzKA6dq2rfHes_bkkE8gBo3SyEGJvXST4boPlQ,1865 +jedi/third_party/typeshed/third_party/2/tornado/util.pyi,sha256=8eT1IqgZQAG2ffDTCdkAufpPxgtarCEPwbDua2Nuuqg,1072 +jedi/third_party/typeshed/third_party/2/tornado/web.pyi,sha256=mLw7a1oQk2vEHMzwoO_WSrhLVIAJvpEVnM_dqZDoJ6k,8709 +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/AES.pyi,sha256=iCmveVmaj7qRIKsyuMnAcIy6JVHf9r8hv-AfkmGQ-EY,397 +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC2.pyi,sha256=onALw-kGR8GP9Z-CCf_Df2ChYg_ootEoQD_ggkPxX44,397 +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC4.pyi,sha256=4f_6BZx4pw37UoULNQTW9J0jAJFpq_26SEwReXffH6Y,368 +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/Blowfish.pyi,sha256=KPV9dZNuzV6sJlOS8f8JtdFyS-dnY7wkYj-soQDGKOk,407 +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/CAST.pyi,sha256=AD-EnUle8COT29lZSFeZJi4HcWc1JMM2pQhp55Jt2No,405 +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES.pyi,sha256=jBJ9fv4VdSPq8ZyhGHYa8FcrbyCweAC3uHUEXGl-vWA,397 +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES3.pyi,sha256=EjoZZuQu_KTKuXxCkGkgIiATngTGghGplkFty3Sww5s,400 +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_OAEP.pyi,sha256=0k9RQdPQpy--TwahoJ2iMpQcFOf8I5Qgr6jfWpakLuo,504 +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_v1_5.pyi,sha256=RTLnu5HRC5v4a9h_xy7pX_I4X2TkjNFJncIH3P3gv70,414 +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/XOR.pyi,sha256=4ywSjUWy1uMemS5ztupHYN12A9puX67jZBnmYMOyPhQ,412 +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/__init__.pyi,sha256=-RaU1eIo3IolWB3cbL9Q1O7uhGmjuoHT_oNr4D9quSY,142 +jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/blockalgo.pyi,sha256=TlpV_iPQfHQFqXdyyrOxwQ0sq_YIf90n-whlIYvPO18,417 +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/HMAC.pyi,sha256=4aCDQk1kJfTyrj9byUHxYaxRD57XMtu6Pr36bOU_CVs,420 +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD2.pyi,sha256=fMf8AspycjggIfx8KzUxNHRgBNxErvfiabtUJfNKNSo,327 +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD4.pyi,sha256=nL0utx1iyvHNP0jMtZ0Bj6L8lKKQfpW6IB4QrnvfRGw,327 +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD5.pyi,sha256=N5g_skXab7nw-FreklwfCFFFNJryOBBU9AB0BFp6UBs,327 +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/RIPEMD.pyi,sha256=g1lpaNqudb16T6r9vgLBIj3muBUJo0537JrdiaMQUeQ,333 +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA.pyi,sha256=ywEEh9h798xKrrQ3PTG1DJL2jBOVqAZ2CuM73kKBdqQ,328 +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA224.pyi,sha256=qvBjdTc08JNR0W2t2VhoChf5SvZtRcBKjBT1BbB36DE,330 +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA256.pyi,sha256=zoxaUBz3cuIOpZHeIfukDhLEAKVhZKktVRAG18tf1dg,330 +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA384.pyi,sha256=WvhhOrsXPKcYmco74jBAjoQ8riJQdaCunBL8hrQWDP4,330 +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA512.pyi,sha256=gQLOFMP3GZiFvhP4eSpeMjVvJp7pX_F1OCf9YyAjQSE,330 +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/__init__.pyi,sha256=ABwod6wAy2lE4nSyAQTSvDtiLmwPJYYA_Z1TVTg9nfE,135 +jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/hashalgo.pyi,sha256=tcMcipeK3Fwj3qrCBlYgfnDLqSJQqR7DoX6URfQjTj8,328 +jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/AllOrNothing.pyi,sha256=B1R2GRvP3TwcTfM8ALMk0ndgrwBL89-tTuNU-Z-_GH4,262 +jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/Chaffing.pyi,sha256=xkwQipSvTvHDwnJ_9au5rFpG7-7G4uoAe3I3ypghHbY,144 +jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/KDF.pyi,sha256=mL1WnzCsLTGDHW-VobrN5dpgenQljsSVka6mW-gJnYY,271 +jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/__init__.pyi,sha256=i_pjEe_DNHzNgnFn8t86rZsg-qHDjxKD4TD8mEU37VY,77 +jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/DSA.pyi,sha256=U1G1lDDYHBE0bVfGyubQhhWcBpJlMbDwl1EJupPu1xQ,741 +jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/ElGamal.pyi,sha256=RM1JyKY2fejhkunAoRFdH5Flj8XVm34-Z6SpujxmH_E,531 +jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/RSA.pyi,sha256=0C2qT6H9srCsOzQsC68r9XeWVb2iV9UoWQikY6HBSJA,1092 +jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/__init__.pyi,sha256=dt8H8yWS5t1mFC7GQySzf-Ku3OwVSAKuT3Fttkpkmd0,67 +jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/pubkey.pyi,sha256=cyn-llQZXLeq-2eref9FWu5E_O4832tsMWcr5Ob4r3k,611 +jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaAccumulator.pyi,sha256=HD6M8QAwAlgyq17nPBK4biGZXKJpMeZCO-AOShJIpcw,570 +jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaGenerator.pyi,sha256=toNF4nzDDnVvgxt9rdQ2B5N8z8j4pWmYzeABeraAuZY,357 +jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/SHAd256.pyi,sha256=enLv6jIUo1b5i9pv0zOFh_4Bz7njdGK6JCMSS7Fx3LE,314 +jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/__init__.pyi,sha256=jXXBXYvuIE2PDmo7uK-FmI5FFbZC_C9eQ8yzigobKhA,18 +jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/fallback.pyi,sha256=N3XI3BqfcvDxFhUOHuhFBvCkNC6_9khXYEoicykQbNo,116 +jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/posix.pyi,sha256=azk7olXSZObod2vgHmKjhn6ZN-coL0ElsIDBxFFwtHc,174 +jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/rng_base.pyi,sha256=iPv13PRUzWPJMxVa-oh7dVH4LZ7ag6XiWNmp00lJv7Y,259 +jedi/third_party/typeshed/third_party/2and3/Crypto/Random/__init__.pyi,sha256=vLqEuPvh1lx2GQ127UjVnzfcwiT1GUt4Rv2UbqzgUxo,30 +jedi/third_party/typeshed/third_party/2and3/Crypto/Random/random.pyi,sha256=ANwBUgOhF7M9oHjYADN1Jw-4cO6UT1TSHiR5nl4sstA,435 +jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_PSS.pyi,sha256=q_jiqBELyfBKFy_dPCBM0eNoKAVVRCu0UQdXTlBXDpg,286 +jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_v1_5.pyi,sha256=LaNUrDSbT9vtpFVwLMAyWSyejEaj-phuIfcIOFmW0uU,180 +jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/__init__.pyi,sha256=aMnJbvb3z5OYvKdLldQoi58Qiisd1UcSG3ksa29RXik,68 +jedi/third_party/typeshed/third_party/2and3/Crypto/Util/Counter.pyi,sha256=AlnEpoHHdpsXWB0g7DnPK7_N2mBq6CcayqqFoXRA40Y,216 +jedi/third_party/typeshed/third_party/2and3/Crypto/Util/RFC1751.pyi,sha256=i9GtVbf9gM8ZArAevQdIthPLuTI3T7bnzi2RBpd_qwQ,126 +jedi/third_party/typeshed/third_party/2and3/Crypto/Util/__init__.pyi,sha256=fpqy46NnFyKmTDKWTbRYpqybU3mDR7FxhaQw7PA6rjE,95 +jedi/third_party/typeshed/third_party/2and3/Crypto/Util/asn1.pyi,sha256=-q-Vn8ihp0Aomsp-NGaBJBctywykbZvk_JdnrMeHe3k,1412 +jedi/third_party/typeshed/third_party/2and3/Crypto/Util/number.pyi,sha256=fCRXejxvofqCYSlbxaT5ExmJvnkxDQBtjH8Y56N86ek,801 +jedi/third_party/typeshed/third_party/2and3/Crypto/Util/randpool.pyi,sha256=A5tkW9h3qmACTLGBq5hkym9Ha1f-YVJCK126DDC33rM,533 +jedi/third_party/typeshed/third_party/2and3/Crypto/Util/strxor.pyi,sha256=Ntpcyy0sjl27q5xj6aCZRv9SFaLC-OX7G4Ct7Rxjkgc,68 +jedi/third_party/typeshed/third_party/2and3/Crypto/__init__.pyi,sha256=AELMqI9p1hqB-vQuNuSuGNIETs5FKgCpHT3wgaR3iwU,109 +jedi/third_party/typeshed/third_party/2and3/Crypto/pct_warnings.pyi,sha256=s8_64lsflPPLoiObVVicpf_zgc2yPs9BzQXXU_U624k,412 +jedi/third_party/typeshed/third_party/2and3/atomicwrites/__init__.pyi,sha256=ZoZEVbyUhotWePn3bwONNwLAQN22nhy8CzUCmlrVYQs,870 +jedi/third_party/typeshed/third_party/2and3/attr/__init__.pyi,sha256=OON4rNWdgL69frd_WdrxtuQe8CEczl3aFpgifFeESN8,7769 +jedi/third_party/typeshed/third_party/2and3/attr/converters.pyi,sha256=wAhCoOT1MFV8t323rpD87O7bxQ8CYLTPiBQd-29BieI,351 +jedi/third_party/typeshed/third_party/2and3/attr/exceptions.pyi,sha256=sq7TbBEGGSf81uFXScW9_aO62vd0v6LAvqz0a8Hrsxw,257 +jedi/third_party/typeshed/third_party/2and3/attr/filters.pyi,sha256=xDpmKQlFdssgxGa5tsl1ADh_3zwAwAT4vUhd8h-8-Tk,214 +jedi/third_party/typeshed/third_party/2and3/attr/validators.pyi,sha256=p2xr2ob8RaKW3PqlKDrQQVAyl8ZH4pNdlZzWXapGPjk,897 +jedi/third_party/typeshed/third_party/2and3/backports/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2and3/backports/ssl_match_hostname.pyi,sha256=jAdLMMvdxdszZCIdVGxRZw7i5waIBqb4RqwketJqMr4,81 +jedi/third_party/typeshed/third_party/2and3/backports_abc.pyi,sha256=z8KwJUh51HVvBluyv29D8TM7-fSQNZf_WPXGvddzV3M,220 +jedi/third_party/typeshed/third_party/2and3/bleach/__init__.pyi,sha256=qmdri9dnecUBPOej9Rbk9I3fw8B3G-MLoIuPwRrjcjk,877 +jedi/third_party/typeshed/third_party/2and3/bleach/callbacks.pyi,sha256=YKn650zM3mOna2R5f0mgSJZUgqEz0eB_DN_NKGVSRdk,206 +jedi/third_party/typeshed/third_party/2and3/bleach/linkifier.pyi,sha256=vQleEwvJ8ucOi0oyBhRnOXj6dAGZe_2bHRHX8UqRFPA,978 +jedi/third_party/typeshed/third_party/2and3/bleach/sanitizer.pyi,sha256=mfqdfFhtly5zL2q12cCrWUYKW5IiArlul5-g_McX6VI,1154 +jedi/third_party/typeshed/third_party/2and3/bleach/utils.pyi,sha256=Ftxlir0EZOrnI3bon565egk--LDeL_UJmaLeDLdbyRM,286 +jedi/third_party/typeshed/third_party/2and3/boto/__init__.pyi,sha256=FHIXvPqRkO5OxvXaxxsuir5MulXg8RXwxj5udWr_iwk,6986 +jedi/third_party/typeshed/third_party/2and3/boto/auth.pyi,sha256=c-mkaHStcHPANLvKiEv7p3yeSs2mIfPe8tSSWu0o9PQ,4140 +jedi/third_party/typeshed/third_party/2and3/boto/auth_handler.pyi,sha256=3wvvgy2r7upUjbx-Pwqj9PPMpaDucUFL__sqb7QclFE,250 +jedi/third_party/typeshed/third_party/2and3/boto/compat.pyi,sha256=uLctdN0bqOGhkPdymU6H8ROBUaYaZIaminx_ju95yNU,313 +jedi/third_party/typeshed/third_party/2and3/boto/connection.pyi,sha256=6MjMVWW0N9LFJtZzN77IupzK5dhmXTUJLDBFWQ3fjYw,5230 +jedi/third_party/typeshed/third_party/2and3/boto/ec2/__init__.pyi,sha256=gk4VYtcAwX7J8Wv3G1Ec3VkwKbUKCd-cZgqOCxRuJTo,170 +jedi/third_party/typeshed/third_party/2and3/boto/elb/__init__.pyi,sha256=HITLeUBB4LmfGQggnybJgfX9gkLFegAKvjYZ3BXODXk,2479 +jedi/third_party/typeshed/third_party/2and3/boto/exception.pyi,sha256=Me21Rb4OUdrBuQ12Pv_sD_LrMHjA0on7PFw35YZKs3w,4568 +jedi/third_party/typeshed/third_party/2and3/boto/kms/__init__.pyi,sha256=vP3EwRB7SB3wfJTb9tAW-pKOSEUaQnabY9wpDL15DUA,156 +jedi/third_party/typeshed/third_party/2and3/boto/kms/exceptions.pyi,sha256=WKhoeQKeApIczWPJz3vC5A7K03AmbNAM4bnBuVuNVCw,829 +jedi/third_party/typeshed/third_party/2and3/boto/kms/layer1.pyi,sha256=jUb_36aJon7wVJvbfMSSW7RDAj1A7ui403T7woZO1Tk,3629 +jedi/third_party/typeshed/third_party/2and3/boto/plugin.pyi,sha256=rquBCp_gv_wSNNcWYijFPURhXO48ELzf5XItCuPv7nI,235 +jedi/third_party/typeshed/third_party/2and3/boto/regioninfo.pyi,sha256=CGAoGanKLcJZw5dZNvWdNy944NgfjercUeDhHbTYiLI,654 +jedi/third_party/typeshed/third_party/2and3/boto/s3/__init__.pyi,sha256=hzHCleNd-rhKff1HEuncGwpVwRAVJpuAkcY9MBRJotQ,495 +jedi/third_party/typeshed/third_party/2and3/boto/s3/acl.pyi,sha256=6ygxWrnHtKy5t-yGmGu0sRFNq9rY_kHEdzfxb8BNd7Y,1622 +jedi/third_party/typeshed/third_party/2and3/boto/s3/bucket.pyi,sha256=_UvS1PPCY4yL_bUrLjEF6d_Vrr3mbt90IT3rvPLyXVE,8030 +jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlistresultset.pyi,sha256=bBiFHpk2u-8LOO0GBYt6BvpquwP7c61P7Z1pSYAP5z8,1803 +jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlogging.pyi,sha256=3A-6a-73DgObYEzBbcUcknHJQyw4e3ihu0NDL4qRmGQ,400 +jedi/third_party/typeshed/third_party/2and3/boto/s3/connection.pyi,sha256=pEV-wfmCJES1x61OyjFHuqIr_jnkgtPBLP-dxZCzCeU,4354 +jedi/third_party/typeshed/third_party/2and3/boto/s3/cors.pyi,sha256=MWUrqlt-gXUPaEkRcBcnKnQnzyTAGkNA6_G5FO98pjY,962 +jedi/third_party/typeshed/third_party/2and3/boto/s3/deletemarker.pyi,sha256=T6AWOwNnW391UjVpzJ8tfbaOtM_hSaNa2wyJV02f5wQ,366 +jedi/third_party/typeshed/third_party/2and3/boto/s3/key.pyi,sha256=ZBqfaNilLMqcrorZQkc2HWEX5p9m4EDwTZ0HyVZN-xA,8309 +jedi/third_party/typeshed/third_party/2and3/boto/s3/keyfile.pyi,sha256=EcfBooXpPExAghucYEM6sxPVsp32wueqK_-5Kk-66rI,684 +jedi/third_party/typeshed/third_party/2and3/boto/s3/lifecycle.pyi,sha256=RyrE3lLleL-fghPbTPbgQEHS2Bhk7c56CF4hXNjlTUQ,1874 +jedi/third_party/typeshed/third_party/2and3/boto/s3/multidelete.pyi,sha256=QeIn0Sf7WHGYl2PsqaMWk0-p2ZEub5-eOvnfaVr_FAg,1014 +jedi/third_party/typeshed/third_party/2and3/boto/s3/multipart.pyi,sha256=uiV07VlvjmYkafuVbPOrdkitZNWcOT7itrC4mMPdqvc,1833 +jedi/third_party/typeshed/third_party/2and3/boto/s3/prefix.pyi,sha256=UDLPJn1XiSFLXxd0RdeOMzUfzEyYUnCAiGPACntnkkI,324 +jedi/third_party/typeshed/third_party/2and3/boto/s3/tagging.pyi,sha256=JgNFPHTLi7TR0HbeasYlSnbVA-GzNXzYJ9H6sBmLz0c,748 +jedi/third_party/typeshed/third_party/2and3/boto/s3/user.pyi,sha256=nFbH3dOf5SfNoaTyNwkiu2q3ZR82iPYVr-LfXzUGzYg,362 +jedi/third_party/typeshed/third_party/2and3/boto/s3/website.pyi,sha256=9tQ2ckXvJcfcaT2NM_YN19mQwqHhYUWwKlqwoeI4ZJg,2492 +jedi/third_party/typeshed/third_party/2and3/boto/utils.pyi,sha256=IkAe4S88QhOzjQ8pCzfZ75mEtQ2-Q_OU1juZXvKLVEQ,6201 +jedi/third_party/typeshed/third_party/2and3/certifi.pyi,sha256=L-Idpv54Z5MALmou6rENZOu7F_jAFD5CPo1hb5amF2s,24 +jedi/third_party/typeshed/third_party/2and3/characteristic/__init__.pyi,sha256=tTDLA5WcBLHvJdgbcNLqDBY9nnvlO22KSZY3gfWSBME,1323 +jedi/third_party/typeshed/third_party/2and3/click/__init__.pyi,sha256=xO24zrwFPylRwnTrLlnnk6FZ1lP_fWUid_U-JVGKvWU,2872 +jedi/third_party/typeshed/third_party/2and3/click/_termui_impl.pyi,sha256=pJZm5thjg6ANosLsXOu2JbVX1ugzptbzURePwDTazZE,476 +jedi/third_party/typeshed/third_party/2and3/click/core.pyi,sha256=2J5evs9r1RDHkyQJSD3Edb2aouNb1Wp-u6IGoiJ3yz0,11944 +jedi/third_party/typeshed/third_party/2and3/click/decorators.pyi,sha256=WUA8AAQFrDpHgmzZh8ShlXq7lS7iw2kkWXCt_LIys64,9256 +jedi/third_party/typeshed/third_party/2and3/click/exceptions.pyi,sha256=b1pZ6QTM194-1Zu501TGCbWGfrH5WXLjdiJwYcbwwlk,2068 +jedi/third_party/typeshed/third_party/2and3/click/formatting.pyi,sha256=R1n2vJVyjKTSg1NaBcFhsZ29pWX-KD53po-8wT97WQc,1615 +jedi/third_party/typeshed/third_party/2and3/click/globals.pyi,sha256=Gzjjl8GqPGor-_qDGe7Fb2U792EsdzizOsE-Vhv-tmA,296 +jedi/third_party/typeshed/third_party/2and3/click/parser.pyi,sha256=tHDYOkhrupvqvF-DLim09PNT1wZp43fL9uMb4jyRO5E,2141 +jedi/third_party/typeshed/third_party/2and3/click/termui.pyi,sha256=OTFo2qtEhMclfmTCZnYbceFQaYGHEgKnz4tuxJ_mNSo,3501 +jedi/third_party/typeshed/third_party/2and3/click/testing.pyi,sha256=lrConQvTuPK9Tx4X2hk67RuP1emxqi9RTCZnDHVw2Us,2207 +jedi/third_party/typeshed/third_party/2and3/click/types.pyi,sha256=vc9TTLB-B31gMs7cS2n8gka25hUUcluh0dwoXntPtQc,5502 +jedi/third_party/typeshed/third_party/2and3/click/utils.pyi,sha256=-CrBHup5WqRgmk6X3FuLMjHje-W3_FgzmS4LVGhCvaU,1915 +jedi/third_party/typeshed/third_party/2and3/croniter.pyi,sha256=jKrZ6-ury0VrkHQf4dLkmcunDx7F5c8Kl6S5xQARd40,1920 +jedi/third_party/typeshed/third_party/2and3/cryptography/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2and3/cryptography/exceptions.pyi,sha256=CpK5HtZvigk1U7yYLlqYcXGJaOzknyfhUUittXFuKiM,262 +jedi/third_party/typeshed/third_party/2and3/cryptography/fernet.pyi,sha256=I1gCYbtwE75WOBLuNqk8O7KWz5JEJbIdhPUnZx8yXDE,640 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/__init__.pyi,sha256=3fBxcSppJr6EOEcUojvflG3Eegg7lv2Qp0dNQQILrP4,63 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/backends/__init__.pyi,sha256=OJXaSjZ9qxMsCgqtyXu15AN_a4wTqIiWKK-fwIVUWY0,58 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/backends/interfaces.pyi,sha256=B6ll_f3g9smOyhOZR8hRLJcc891y2yr57KPSVQYb1PI,8238 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/bindings/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/bindings/openssl/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/bindings/openssl/binding.pyi,sha256=QHIbjl0Q39fxas4DabuLytXjjBZrfqNkft0H_nWwXr4,148 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/__init__.pyi,sha256=3fBxcSppJr6EOEcUojvflG3Eegg7lv2Qp0dNQQILrP4,63 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/__init__.pyi,sha256=3fBxcSppJr6EOEcUojvflG3Eegg7lv2Qp0dNQQILrP4,63 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/dh.pyi,sha256=J1E0wvF1zKW0QWqC_O9jxecnRA7RLidzwLGYhz6Gbrk,2490 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/dsa.pyi,sha256=mAZqxcJ_6i-_8dyJ26tyVxAZXriIx5tKT7DDJQ_AYo0,2911 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ec.pyi,sha256=Z9eOu5VhvN-NiHeqSg1_Lbtsi9BCMmDiERJxbNKV5JE,7178 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ed25519.pyi,sha256=OiE4CJcNDIaqd_VzdmQGn28WPdT5PBQ5jVKfq_ZRc3k,985 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ed448.pyi,sha256=Mw-p07GDyttBXKaNB5Su5hw01DQXZgjEZe5M1e7PlhE,973 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/padding.pyi,sha256=g1sB5wpH6yoi9LrLUSHOejKdt8xiLmkPvDdUn6Cm1UY,787 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/rsa.pyi,sha256=Y2tB6pFoc6hG-z5tymgrHrWrK1zLLV1iT0Ea96lBBeU,3204 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/utils.pyi,sha256=1rninb_zzf2gSZQ5NxJycvhl91H_nvCuFYN3V6murfg,178 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/x25519.pyi,sha256=JHX8lIJN0j94AsHIS4jQWCrlcOgLdb3Ud2QznMRXOC0,919 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/x448.pyi,sha256=efSTvyRkpVAcxtAwzYymDbnOQPA-dJW7YAliRVA5_cc,905 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/__init__.pyi,sha256=Hvbo3_ksh-UN_yRPHSNBXSj-at4lZYyWTeKNZfDNUEc,1298 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/aead.pyi,sha256=MhkfsUnaMVEi6oRrcfTgp6h1_1QCS8bvxtwoE6bqZS4,1065 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/algorithms.pyi,sha256=3E_RKvaTFCWdZFxtbLX2gVVzhwAMvDZ6K8Z5MzB3cew,2239 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/modes.pyi,sha256=3rIwa-kj4k0wj8YfZeesqX6jEJhHtUZth6-ivi76etE,3089 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/cmac.pyi,sha256=sxR_sEWpez075f7f9QE_iJW7xrl6Jp8Yl_UpvJFJnbI,416 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/constant_time.pyi,sha256=47ogru9j6XG5mLMDsl2iGKxhZjsH_bKhWYBt4c1jQk0,46 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/hashes.pyi,sha256=-DqcJeGNcqJPlwSICyy5Q7Y2XfSOenNr5058wIPt4ZI,1298 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/hmac.pyi,sha256=YzFx7XKdaQhSIDjYyPalMHTCk_WwQfaVbMOEr1P3v2A,412 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/__init__.pyi,sha256=fymJGVYF4JGsuO5IUacyuYb4Xunrps4mFrJ0XFEUdfU,261 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/concatkdf.pyi,sha256=GpWU9N_dvQzFm9ce-Y9EUCPzAuRNYpHCmmGQpvVySeE,864 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/hkdf.pyi,sha256=F15ggnuIHFQE0062q6LG6n8Pli8mOjpb-jtEOvy5E18,829 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/kbkdf.pyi,sha256=AGlbgHZXt9LMnylvlwAAWSJkjsvq8vaL95pKz5MB2ww,851 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/pbkdf2.pyi,sha256=VpadnXqKkWIgf4rDtQXDzanTlvKB3A5peRpUzgoEMDo,502 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/scrypt.pyi,sha256=imUgjixAkgL6HYvysmILAwvIbrSgRBwt8_y73gJ3gqQ,407 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/x963kdf.pyi,sha256=M6zkKxW87Rj5-dNtJXjmscmAPQP5mrTwNoysHT8KbFU,515 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/keywrap.pyi,sha256=zv8HE00Oa_2z__RjkJLOOfk3eNFXafum9XCRPafmi_M,518 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/padding.pyi,sha256=RYc1U9k5Vw4NzpT-JXi_AwRiPXwzu7XLVyG6HtDy_gM,540 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/poly1305.pyi,sha256=PdifWqHODjsrzkqExOetFF5g529I0gF9SvNIoCcozZ4,504 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/serialization/__init__.pyi,sha256=G1HBtYCQdgRLxBBffk6MiR_T3YaOOJoH_2F5dLMvDLY,1006 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/serialization/pkcs12.pyi,sha256=5kXsc7TiX4tUB4zO_aqZuh5bE05KrIkog4_5Pkam6CI,113 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/__init__.pyi,sha256=MV00ZbBi-FKgHi9PYY2ZS7tneV2rghu2eVi1KgxRZzs,35 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/hotp.pyi,sha256=ibl6C1ISmQ5H6nmmT_axuSuhPmPUn7YBx7A4i5PoFbY,540 +jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/totp.pyi,sha256=p2rGTlM-DzrBmqLnYQKklWHjJJbDwQ0yf_J1BfJqf8g,585 +jedi/third_party/typeshed/third_party/2and3/cryptography/x509.pyi,sha256=DO2WXJWvd_hru-WibpiuoPPWo9Gc7aYX4mrgp8W7ZcU,13382 +jedi/third_party/typeshed/third_party/2and3/dateutil/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2and3/dateutil/_common.pyi,sha256=QLZOnmpLNlXPSgrW2LW7lqb50t8jaHqguHflcJjTrEg,345 +jedi/third_party/typeshed/third_party/2and3/dateutil/parser.pyi,sha256=1090xD1CdLm9K6AwthbmrTN3_SQNL25wH23ClhgrC34,1741 +jedi/third_party/typeshed/third_party/2and3/dateutil/relativedelta.pyi,sha256=RsR55UlJYF3y05p_j6H5UBIGtgKVh5VwKqAFDNiHS2M,3328 +jedi/third_party/typeshed/third_party/2and3/dateutil/rrule.pyi,sha256=MDhmPyD-85M9RuyZxtVPHDU_lSjL5cn0p2ZqfwKiELs,3360 +jedi/third_party/typeshed/third_party/2and3/dateutil/tz/__init__.pyi,sha256=9jaCdzJu4Hb_z2vNz7LKV1J4qtQ_cZC4bJQ1flgQDzc,340 +jedi/third_party/typeshed/third_party/2and3/dateutil/tz/_common.pyi,sha256=-sVS4o6Pz2bBRViwyMEk3yZpDVWq9BGahTarrYdOCsA,818 +jedi/third_party/typeshed/third_party/2and3/dateutil/tz/tz.pyi,sha256=4uttciwPJfFzSqQ3T6ICiI1kSPn5XIsBw4xuk1IfP1U,3929 +jedi/third_party/typeshed/third_party/2and3/dateutil/utils.pyi,sha256=lj3N8C7ivm_iFakRu1V7Crwl1VNuLS7O0uEmdNMtkSE,282 +jedi/third_party/typeshed/third_party/2and3/decorator.pyi,sha256=EvtPa9joVMu-PgY0mttNy_1nzucjC1VE58_mEn792gc,2807 +jedi/third_party/typeshed/third_party/2and3/emoji.pyi,sha256=ETMKl8Nf8ruXmmeMddYW7AVKK6waF_NLV8lJnPQfbu4,395 +jedi/third_party/typeshed/third_party/2and3/first.pyi,sha256=pcPE8-5davQ3ElewRYJK8q2Cfpgv-yFwz2jfRQMeTQo,482 +jedi/third_party/typeshed/third_party/2and3/flask/__init__.pyi,sha256=t9Ow_Nw0zmpJDLytn4gFNR5Vw_x5k6-vHdJPwcXQLPg,2217 +jedi/third_party/typeshed/third_party/2and3/flask/app.pyi,sha256=HSBHjlDnaTxR6ewGFgLVmNT1Bul23wDLkIsVBNkPST0,8631 +jedi/third_party/typeshed/third_party/2and3/flask/blueprints.pyi,sha256=iUoVz6p6rMHkmf4XEVLseMQhB4Nduqzr-icQZN0Qw1g,3442 +jedi/third_party/typeshed/third_party/2and3/flask/cli.pyi,sha256=B0pE7XSG663dAGgiinR9uxauzsBkM_DRm4-ITNh_p3Y,2342 +jedi/third_party/typeshed/third_party/2and3/flask/config.pyi,sha256=SKOg0TWDw1gDFgH4IfrJIkNE8NuC_EE9N71XwEbcA0M,988 +jedi/third_party/typeshed/third_party/2and3/flask/ctx.pyi,sha256=EymBtSTL_orlB-hsjZyKcIZfWPPFdyZqm-WcMZ4Mf3g,1563 +jedi/third_party/typeshed/third_party/2and3/flask/debughelpers.pyi,sha256=BhBUhXBTMZGDRK_QUNwZ5cGm2vTqk5MhFcYlBYIuh0Y,727 +jedi/third_party/typeshed/third_party/2and3/flask/globals.pyi,sha256=nZbnEIGEdlpneOIPYkZyt8imn4m5Hb-XaPCNWFPhf1A,438 +jedi/third_party/typeshed/third_party/2and3/flask/helpers.pyi,sha256=ZpUoPYQ7KOC-GYJWIImmxWZyVvgze7tH0Kb1GfcbZiU,2106 +jedi/third_party/typeshed/third_party/2and3/flask/json/__init__.pyi,sha256=eVf12af_0ORzPtYeURN7YWBzLLdRZ4KVOwpQQtW1daA,689 +jedi/third_party/typeshed/third_party/2and3/flask/json/tag.pyi,sha256=jauBEQjkrDDHX4kwhUsKufTI7pe--SC2V4MqvXNzcdE,2037 +jedi/third_party/typeshed/third_party/2and3/flask/logging.pyi,sha256=i2Q5tH2evybUWFQiXnfRAuOudW7u5Cdt5BUwjsyrLN4,297 +jedi/third_party/typeshed/third_party/2and3/flask/sessions.pyi,sha256=uyr05P-fbLXSA5PtKnuhfBySRdlA0rjXx-vQoP3TOwo,2135 +jedi/third_party/typeshed/third_party/2and3/flask/signals.pyi,sha256=HfIh1SQ4ywJ7L8NUtv16yVje4RGb7HB3WX733j2c9ao,836 +jedi/third_party/typeshed/third_party/2and3/flask/templating.pyi,sha256=QzgLyAVY9wMPLZzRfuW7X1baGCJhl5UvxZpZ0aR3RBQ,853 +jedi/third_party/typeshed/third_party/2and3/flask/testing.pyi,sha256=A9f18OUVa7dK59isStKpfCsSEHlHJHBa0rAx-23dhpM,1500 +jedi/third_party/typeshed/third_party/2and3/flask/views.pyi,sha256=toPfnrVkyXOovaUNdlq1TsyHcjWLdKF2TbPVr8DyoB0,675 +jedi/third_party/typeshed/third_party/2and3/flask/wrappers.pyi,sha256=406hvfdyJbN7LHCOyegdvhR2fWm0z8OHnum9HaflgW4,1253 +jedi/third_party/typeshed/third_party/2and3/geoip2/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2and3/geoip2/database.pyi,sha256=OyVxPg_2c0rNEvWKJj4XNgj8QeEWiCjIKYf0ieEahy8,1094 +jedi/third_party/typeshed/third_party/2and3/geoip2/errors.pyi,sha256=cLNX8vwSGpvguuJgpfn1ww5OSP4jIy-XK1hCa_EsYes,498 +jedi/third_party/typeshed/third_party/2and3/geoip2/mixins.pyi,sha256=ZpggdVI7qLOYVHt91mL8uPwWq4E07MxpN_UfAgoPcB8,120 +jedi/third_party/typeshed/third_party/2and3/geoip2/models.pyi,sha256=xB5Co15gOcoT76LTg6CC-is3b1B6iK9kV06eDLByG3c,1870 +jedi/third_party/typeshed/third_party/2and3/geoip2/records.pyi,sha256=3-gke4nBlwnk09iOiT8tRdusFPi6CewrJn9foXKvI_M,2071 +jedi/third_party/typeshed/third_party/2and3/google/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/__init__.pyi,sha256=U54VfsG7-8DG_1f27w_Gmz8NunTjIR0iCWEXUCuKKVA,19 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_pb2.pyi,sha256=BQ4N0a7Bo8tXC549k2Ya56ummWquea5vHZXPH08kTFA,311 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_test_pb2.pyi,sha256=qUl8GPa_BUxtQueFEvH5aQlt1xGAUs7GP8VRMbalk00,557 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/api_pb2.pyi,sha256=XydzdTUxzuoyjzedZ7IveUxGUF8a-cr4wRo7Y77ze1c,1814 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi,sha256=U0puKUI8uP2h4XPWXWfdmTslwOgHBbqwAl2YQqZPog0,1593 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor.pyi,sha256=Y6Q812FNTwN0iaA-8KQbdA57yytUVO6UQnb4_dS1-wg,7157 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pb2.pyi,sha256=IpTksPGmIrIHouoTK0adFYN215JMgREq6H_AvVaCkog,18261 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pool.pyi,sha256=dsqeewyqydUwYE9sNscI2qvYE1h5huXeZQ9igxjQD8I,744 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/duration_pb2.pyi,sha256=nK4WXkRMXqpNRPenTkbh7RhBuAyXM1osM870i6L4VLY,306 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/empty_pb2.pyi,sha256=4_bi63PpIZQ317OVOud88q9NiyKfpiYcGwd7y1tuitU,104 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/field_mask_pb2.pyi,sha256=t2uM1ycxTLZmBGHFgc6nUFrCYuLHB6ZrmeSPlrYEBbU,396 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/containers.pyi,sha256=Rswp1RA5bPNapvXtkXlLMpBmI0RGWyKsSZq5YiUtRiQ,2689 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/decoder.pyi,sha256=roJK89CkgjVKjRJbEnQ5ik1KdfXhwxymSyRIg7c5WW0,860 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/encoder.pyi,sha256=3rRgqC6ceJ7LtL7Qo5YiAK6CwE_HigHMsj9l-oa_5iE,1045 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi,sha256=WW1OsCh5SAMCLplHHNQI9h4ZYYbznFVgQFtIjceGx9M,357 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/message_listener.pyi,sha256=EiRlRR-kzJlKV3NXoYtYrGhMS3lZ2oWwQdq77h1cY8E,148 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/well_known_types.pyi,sha256=OGh7Kg5Mo8TZFytfoZcCI8nm5VwmpdpSybFHz6e_ngo,3696 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/wire_format.pyi,sha256=ncrIlZeBjytfWeG9rQX8VdHO8YvS3EmqBJ4rIbaZVxw,1554 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/json_format.pyi,sha256=c4vQdlP5KGT-ofrdbX-0fzsunf2sMz3zDpQx6MKfJpU,913 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_proto2_unittest_pb2.pyi,sha256=XULZXNlQUxdjsaECuEbQr1QAFTmirHgq0BGzpZRJrG0,8186 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_unittest_pb2.pyi,sha256=KVeeaH4Y1iPk7ua9MUv6wXrsKcVeeA0O4O_3BqAJpTM,16465 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/message.pyi,sha256=St75DGRtrRs0Ilx-7vPpkBQFTAxr5dWIkG5-DsuVAb8,2086 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/message_factory.pyi,sha256=Obh5s9vE_rbWKoEAiMY7NgKKL5c_c0lPuz4TX0OPkv0,515 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/reflection.pyi,sha256=VahfyfCz4LzllaCNcv6qXVMa6sWQZ9PEbM9yTKrC9d0,230 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/service.pyi,sha256=khFSQ7jbdMgCZRnhTDDIXnaDvS_GsjhllVxiJpDu9yg,1371 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/source_context_pb2.pyi,sha256=liRJY3zKYnRNHwN52JRpdpo_YU84hrJkWdRht7CDulM,198 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/struct_pb2.pyi,sha256=Oa_R4PAVxxaxFxVezkLPX8cJpbO9cYgma8ejTnfQGv8,1820 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/symbol_database.pyi,sha256=1ktBl9DdQkOMYYopafAwWmyzcKzAahFwCIRLjiQGqCg,648 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto2_pb2.pyi,sha256=NTHTXCbaGv-F_vH3a1B-L5s7Y4267cgH7iMm94gosKw,15413 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto3_pb2.pyi,sha256=FKxTNMikHXyxWFE4yMrW9c2IUEf9Jb8kOe1rNjt2cjk,19384 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/timestamp_pb2.pyi,sha256=D6z490JXQA2Oxd1S8M7iNQQyTa8NOX8aTd8l_9ftgz4,308 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/type_pb2.pyi,sha256=pUSYUIjWP1o8DzodUxCxWlaOedq7Lx9bAB5yxQ6whHE,4683 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_arena_pb2.pyi,sha256=NGhIR6x_-zig4xSSp7P4NsmFwY4xR0_2uELoEHu6Tn4,835 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_custom_options_pb2.pyi,sha256=oEgaVcI2w-BpkK6gyuvmM5mkm0TA7XSjjdvQf1JabRs,7704 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_pb2.pyi,sha256=bYBmdBsohg0jT_q042cLfZMGyUiGNmanCqZk_4tl6P0,1050 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_public_pb2.pyi,sha256=CIQ0EkEEaHmu6uFMrxrzSIaoK5AKGYQNYJS1d2BZyTs,180 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_pb2.pyi,sha256=-RdoQZXtojAoJZ-UoGF7rSXVQiVEZFAI86WHx9r4yxg,1027 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_wire_format_pb2.pyi,sha256=OMBHvrAOO1c4IBe0Y16U2b555ymhBp7uaz4p6l8iyas,336 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_import_pb2.pyi,sha256=OehFdc6cdhswv8SzJmRzAe_BySaxQbBQ3Wg7gYXPHLA,187 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_pb2.pyi,sha256=_nVolT2sQFjyTN3EsRfwXno9qnB2HTT034TZStb0TNg,9917 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_generic_services_pb2.pyi,sha256=troHCyTDMbKENPmWLeXVkRokIjnP6GphAZm-nAyaQSU,544 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_pb2.pyi,sha256=zLkZGwdscSiCrPkUQYk1BCNTuA2hsqsr_5p5fazbTyM,40921 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_proto3_arena_pb2.pyi,sha256=Qw06SVjUSkDZTfYY4p2LGo18An2TRQevVxk_LQl8beo,11273 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/json_format_proto3_pb2.pyi,sha256=RZAGK5FdUKX0RfE9eGWH9mq1Luv3nYlnAVqZV01En0k,13487 +jedi/third_party/typeshed/third_party/2and3/google/protobuf/wrappers_pb2.pyi,sha256=vDFeMzGD3hF7YXI-2HQ-yCIeY19M-cLxAW6t0KG95sE,1060 +jedi/third_party/typeshed/third_party/2and3/itsdangerous.pyi,sha256=BK1g6F3P4RAYHhE5W3581NGThesgBimW6urttOsZDXQ,8323 +jedi/third_party/typeshed/third_party/2and3/jinja2/__init__.pyi,sha256=_U5yLFi5KkpYNHQLTGGclbBdgosMiHoA8w6Spq9um3c,1371 +jedi/third_party/typeshed/third_party/2and3/jinja2/_compat.pyi,sha256=VnnpKEB1OIUEmrMArkmfEc4P7KGhrlQEMhGaS1UTA2U,644 +jedi/third_party/typeshed/third_party/2and3/jinja2/_stringdefs.pyi,sha256=_gw2yhYfWIlqy06ve5t93z3SIVXX2j5Md3rz58LIKjE,360 +jedi/third_party/typeshed/third_party/2and3/jinja2/bccache.pyi,sha256=ypfXFrP5k-Phe6dJ3jLwn3yhRMzDSYPHTpsJT4Hx56M,1396 +jedi/third_party/typeshed/third_party/2and3/jinja2/compiler.pyi,sha256=JvszhGHn4u4CfrGplkLVGmXaW8ukjYAMTHgZswoDGLk,6362 +jedi/third_party/typeshed/third_party/2and3/jinja2/constants.pyi,sha256=seJNAMX1_sGZ8wi8SB5qbZtSUvYiQMelMpXMyxl-AR4,23 +jedi/third_party/typeshed/third_party/2and3/jinja2/debug.pyi,sha256=6XZeMpZjfFUP-Mh5tEof8P8UANNgJ7lsBq1RUbjL_M4,1018 +jedi/third_party/typeshed/third_party/2and3/jinja2/defaults.pyi,sha256=BK5FNrsIsq7ee26gK1xu5bY0T4KZ3i8cD5-Op-5QyPQ,515 +jedi/third_party/typeshed/third_party/2and3/jinja2/environment.pyi,sha256=I3R1Wro2PoGTXVPuIiVO8Xi24gMBHN6WLOSC4SBFV2M,7978 +jedi/third_party/typeshed/third_party/2and3/jinja2/exceptions.pyi,sha256=P52TnpizVoU2vAeayt4MZlTYMnhJYiMrWxiLMWP1LeQ,1050 +jedi/third_party/typeshed/third_party/2and3/jinja2/ext.pyi,sha256=_LmaAViWI_plPMqg0cvHea4QJbFCmkkGlQcD7ba6W1k,1621 +jedi/third_party/typeshed/third_party/2and3/jinja2/filters.pyi,sha256=OxR24skT1uz7n2J-h3voluptB-l21pQ9KTx0CQnGsVU,2425 +jedi/third_party/typeshed/third_party/2and3/jinja2/lexer.pyi,sha256=evBj10x_89jlfuVacpADTOynp2XF9n8d2vQf5lZg-pE,2764 +jedi/third_party/typeshed/third_party/2and3/jinja2/loaders.pyi,sha256=B4DkxbAy4hGZ9zoFYCEh-to5xlVDH70rK9uhNc1y1-I,2733 +jedi/third_party/typeshed/third_party/2and3/jinja2/meta.pyi,sha256=N37MkSqVyUYoXfktXzJgeQHUz8udiqUDGvt9wlBQHno,338 +jedi/third_party/typeshed/third_party/2and3/jinja2/nodes.pyi,sha256=h9B3HdYj3sm-MKvNEqT6FzbUEWo70ogaZHe0PbCsgqI,5158 +jedi/third_party/typeshed/third_party/2and3/jinja2/optimizer.pyi,sha256=wfBoNO5HMlQci-CKbQoZzrfJSNSIdnEedbyTwz85fFA,660 +jedi/third_party/typeshed/third_party/2and3/jinja2/parser.pyi,sha256=e0iwmMMAzWjYb-NAyZwj3rY6fFS4eGz3MVGrEhX4OrA,2515 +jedi/third_party/typeshed/third_party/2and3/jinja2/runtime.pyi,sha256=sLNmF-6AK6ScAAshdloUJ2F9HZ1FCm65-h-Fv2SBZME,3449 +jedi/third_party/typeshed/third_party/2and3/jinja2/sandbox.pyi,sha256=lShECmYWOh54kmQdqyk-Cq27hBXHVeMjmDzHV3nWzjg,1145 +jedi/third_party/typeshed/third_party/2and3/jinja2/tests.pyi,sha256=dixzMe9BiHnvbL8KyR-KY9LLX-VD1-pgbWXC6Mwc4LA,561 +jedi/third_party/typeshed/third_party/2and3/jinja2/utils.pyi,sha256=NeyxqWfHu_iLsik8vMacNkWAcv2YPyP0HOCJNzJay9M,2027 +jedi/third_party/typeshed/third_party/2and3/jinja2/visitor.pyi,sha256=yeJ6g3RC5bitP3tG-btWLOZn954E_e9RxKPtgsiwcVc,306 +jedi/third_party/typeshed/third_party/2and3/markupsafe/__init__.pyi,sha256=NqkNgINf5Mm0Gm-U_2Uy9vg08zkrl8udryG_mrqQKEM,2825 +jedi/third_party/typeshed/third_party/2and3/markupsafe/_compat.pyi,sha256=Av8j9PxEoDMV9y8RC7NjMryo6PzwduQb6-qzjDk1wHM,440 +jedi/third_party/typeshed/third_party/2and3/markupsafe/_constants.pyi,sha256=rqhicI0bgAim40njcEhbGT6Njas1XNwFxB5bRTz3fjs,67 +jedi/third_party/typeshed/third_party/2and3/markupsafe/_native.pyi,sha256=E4ZKi3H5V--WDC6t5o8PmwH7iLJg9D0n4skTIYOsmDY,255 +jedi/third_party/typeshed/third_party/2and3/markupsafe/_speedups.pyi,sha256=E4ZKi3H5V--WDC6t5o8PmwH7iLJg9D0n4skTIYOsmDY,255 +jedi/third_party/typeshed/third_party/2and3/maxminddb/__init__.pyi,sha256=vbjT_Vx7eN_rVyGUwT4VLQikSVvYbW67whwfFcxjOGM,178 +jedi/third_party/typeshed/third_party/2and3/maxminddb/compat.pyi,sha256=Jo_mka6ORT9NnnmNb8TptvQrXPn23b6QNGLLT600LPs,242 +jedi/third_party/typeshed/third_party/2and3/maxminddb/const.pyi,sha256=c1LWH0XYtbcs9T0mJz5lyj6ZAVBwU2zZJdRk7Dd4Fc0,130 +jedi/third_party/typeshed/third_party/2and3/maxminddb/decoder.pyi,sha256=lZIOBE8OKJGu1fMmiH_n0b46qbmDxnXNsCq2Ed9oxzA,215 +jedi/third_party/typeshed/third_party/2and3/maxminddb/errors.pyi,sha256=ifm1u-yPLyPC5KPPF7F5vswnJ2X-TeGc5EgYXvWvn30,46 +jedi/third_party/typeshed/third_party/2and3/maxminddb/extension.pyi,sha256=k7yLS2l266OjFQfh4zmzOwO-46LpvnT3KM9FnvrZybU,1122 +jedi/third_party/typeshed/third_party/2and3/maxminddb/reader.pyi,sha256=meT6j-__y-R77hPoIOTGslhQwng24sCxYqTp12kzgzE,1231 +jedi/third_party/typeshed/third_party/2and3/mock.pyi,sha256=OBoLzvrtkPrs9IxQtt_gBsw3akvmZ8-7CJN5uftwM48,5304 +jedi/third_party/typeshed/third_party/2and3/mypy_extensions.pyi,sha256=modr42Ashjc-c9uVQjBHED30CMq6LLRJqJ6UfwJRW1g,2051 +jedi/third_party/typeshed/third_party/2and3/pycurl.pyi,sha256=ByM0ezkAqRH55UhwpSAR_JhDK-p6x2OkblrkZ4-S9JU,12697 +jedi/third_party/typeshed/third_party/2and3/pymysql/__init__.pyi,sha256=6dpZ8Et4c7z_-w_X2jbLMQNuZtMPn8MIPKo2_ebbzh4,1630 +jedi/third_party/typeshed/third_party/2and3/pymysql/charset.pyi,sha256=8pQ9uIfBVCKgQE42rgAV8Oc1RAUiR7c8k2z4w64zVso,327 +jedi/third_party/typeshed/third_party/2and3/pymysql/connections.pyi,sha256=THprXj0v33F1B92J_Brwh1Tg7IXZAf3snRiGXZu7nyE,4869 +jedi/third_party/typeshed/third_party/2and3/pymysql/constants/CLIENT.pyi,sha256=vnIE4D-CCZ2-TwRYvficDcBx-luonNhHmsuxq8M0V6U,308 +jedi/third_party/typeshed/third_party/2and3/pymysql/constants/COMMAND.pyi,sha256=SAol0UV6ttKwz1i9DUn_DydO1HByeSodgDC3Qyv1BTA,407 +jedi/third_party/typeshed/third_party/2and3/pymysql/constants/ER.pyi,sha256=0O0FmmEhzeeEUmlkmSNluHuZVhhlTOIEHq1Yc-hXLFY,11280 +jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FIELD_TYPE.pyi,sha256=112f_ZZ3GXSiGv5q3fY04FLq-NMWWh8zDSsneoGKfzE,354 +jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FLAG.pyi,sha256=LJ19iNTKdV_tqShn5GyJbTc3JtGr7IesoCQy058KPx0,226 +jedi/third_party/typeshed/third_party/2and3/pymysql/constants/SERVER_STATUS.pyi,sha256=uoVJx08QJpMZzBiyZXTG1Hr7zcSahGx2zR89eOtYxec,331 +jedi/third_party/typeshed/third_party/2and3/pymysql/constants/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2and3/pymysql/converters.pyi,sha256=zLdUk6ZhznsuXvsKtNA-qTpzUsZFeKa_bQ3YgvSPrSs,1330 +jedi/third_party/typeshed/third_party/2and3/pymysql/cursors.pyi,sha256=PO91HO3k3gtUdnDk1M0V4OP9RjLP8XSjihXLeI_zUZM,1917 +jedi/third_party/typeshed/third_party/2and3/pymysql/err.pyi,sha256=UUCOmIGk6StSwRf9VvINDe-5_rKPK0s6oh0QSJUfBOw,571 +jedi/third_party/typeshed/third_party/2and3/pymysql/times.pyi,sha256=N3iYLkF3MEtwRa8muKj4ViRXS7ON8fcW5XANu2VMxXo,170 +jedi/third_party/typeshed/third_party/2and3/pymysql/util.pyi,sha256=fKG9sTGCjyLG5L-n5K8STqna8XVfKzQ2a-X46ozbk20,66 +jedi/third_party/typeshed/third_party/2and3/pynamodb/__init__.pyi,sha256=qp8cF6TlhBd5820jKiBRcrR-qumnONUUlUKCzf4rib0,17 +jedi/third_party/typeshed/third_party/2and3/pynamodb/attributes.pyi,sha256=B4sA8pkgog-Ei258lHvXhZxHY4MiO6uPHBNFKp-zEdw,4194 +jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/__init__.pyi,sha256=tIcusRqjD5cbw9gURA6V6gJS3kotd6qBxua-WeuUSfg,135 +jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/base.pyi,sha256=sxYoLMeE_H8AnA4h5jg3wk10NTFhjwW26X-5sYAGh0A,5688 +jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/table.pyi,sha256=1x1g_cKw7jsLSyundv4lilx-J9cqbOSZHx5-BAG8ehI,3117 +jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/util.pyi,sha256=VelfJ8xvQieSdjx4hkp5g0W73tyArG2qobRxY2xccWs,67 +jedi/third_party/typeshed/third_party/2and3/pynamodb/constants.pyi,sha256=2DxSY2CwYrKx_uT0QKHorzmekcf6bcKWxQ5lZp6PRco,3038 +jedi/third_party/typeshed/third_party/2and3/pynamodb/exceptions.pyi,sha256=oN2x-x1qyp5WVRK-jF9rVjzQIHiUjNO5RAwfRTQSRdA,887 +jedi/third_party/typeshed/third_party/2and3/pynamodb/indexes.pyi,sha256=mhokZF-5d0rhjRKYeBW-32YKGP__WEI6JH-EaIL04sA,982 +jedi/third_party/typeshed/third_party/2and3/pynamodb/models.pyi,sha256=lBQYUpOzjMyeUE0iwvXAXU_cKSUivSOlD8RJavjIXfc,5315 +jedi/third_party/typeshed/third_party/2and3/pynamodb/settings.pyi,sha256=nfytWdsaKGyoTVPsIi0B-15yecRvNQ61Y3L_sT0qpvo,145 +jedi/third_party/typeshed/third_party/2and3/pynamodb/throttle.pyi,sha256=Xnxx2caEi3AgLinoHSCVZUkuEPV5XxwMw83tpUaUvRk,472 +jedi/third_party/typeshed/third_party/2and3/pynamodb/types.pyi,sha256=BCI-zF5K_mOWPzGVixMvVXqISqSxWokGjR0aVosyvK0,57 +jedi/third_party/typeshed/third_party/2and3/pyre_extensions.pyi,sha256=CJ0jUa1yruR4a_cVqcFRpORBpYGea9C5vQ5lwGfWUZI,267 +jedi/third_party/typeshed/third_party/2and3/pytz/__init__.pyi,sha256=kmVXgRYG38uW2M6cYXejTeREJRtLefdLmepFmeRKBrM,1891 +jedi/third_party/typeshed/third_party/2and3/redis/__init__.pyi,sha256=cQcQyMinLIVsLOGskELjv_Agufbrs2L8MmALlSmIT-o,868 +jedi/third_party/typeshed/third_party/2and3/redis/client.pyi,sha256=1Xo7Csz63ojY651FSM0Ov0Ilr_3qyCS0BJJCYEeiXGM,15211 +jedi/third_party/typeshed/third_party/2and3/redis/connection.pyi,sha256=UP7WarBfiWN6599FjBIf2NV9q3s4BayxXceAlb3G33M,4153 +jedi/third_party/typeshed/third_party/2and3/redis/exceptions.pyi,sha256=d2fmJa9u5GrrAaST8JgdfpFsBxKupvKLb2iH9VgP7Wg,569 +jedi/third_party/typeshed/third_party/2and3/redis/utils.pyi,sha256=a5cyDCASB0E1ZuBKK33dZI7ZBcr2rISkiWU5alhjJbA,136 +jedi/third_party/typeshed/third_party/2and3/requests/__init__.pyi,sha256=TluZd0vnADycHLgZKam6Grc2tFA4e5dz-DQ_mVNaU1o,940 +jedi/third_party/typeshed/third_party/2and3/requests/adapters.pyi,sha256=-s4a4mw1UgHiJKSA8WbYhwoCObMc7gvl8SzPJ6KX7Rw,3123 +jedi/third_party/typeshed/third_party/2and3/requests/api.pyi,sha256=41gP52QREK0ycP7eHwCmIzOD967PEEsWHMMmVG9DEd8,1345 +jedi/third_party/typeshed/third_party/2and3/requests/auth.pyi,sha256=sk4UbsbZ8Wza_Dpe9oqV4Mjj3I2stPIYg6CtAz5N_pY,1223 +jedi/third_party/typeshed/third_party/2and3/requests/compat.pyi,sha256=G6ucuepQZdex0HVSb9sTjwtWX3zb8NqFyOWiPED5HNc,123 +jedi/third_party/typeshed/third_party/2and3/requests/cookies.pyi,sha256=MwbAWME5WUYBFuSG33q_LVqFTRQa3xl59ve1wnwFjVA,2084 +jedi/third_party/typeshed/third_party/2and3/requests/exceptions.pyi,sha256=YozRqkXsLqpB5UmK-NDcAAvy0_Pa4ZU14mjy8YOO1zc,1003 +jedi/third_party/typeshed/third_party/2and3/requests/hooks.pyi,sha256=nlXP0EjXm6kzDw2tNbpR7vMa9lhLJRzQI8ooUOwsjD4,156 +jedi/third_party/typeshed/third_party/2and3/requests/models.pyi,sha256=Gw7JvfHy3rsaDa2_EhMi4Ho2Qe_1Op3WluB8vPQKfBk,4775 +jedi/third_party/typeshed/third_party/2and3/requests/packages/__init__.pyi,sha256=cnNTJT8mNb7zJ8vT6jKdpiWxIYAZMw3Qz6frelGgzbs,158 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/__init__.pyi,sha256=lP97SDuYECOVOETj3ds6o_mkJ3lm1qxeyDuRsHNsfts,914 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/_collections.pyi,sha256=zZTO16DSyaA6eqcEThzClmGNF-64eyq13qW5HW0iRuM,1535 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connection.pyi,sha256=pwGiy0YSD6aS74mh0r1wWNzyzshH-qpiOBgus_krxAg,2056 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connectionpool.pyi,sha256=6uHs5h-j4ZbT4Mer3tW4VwtBXQrB3qxWq1-npazB2JA,2934 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/contrib/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/exceptions.pyi,sha256=TxvMswYXJdgim9frBpmQbC5q_Cu8SM37vW2ZFrfvH20,1413 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/fields.pyi,sha256=1SH-QByYVWYsk8qB4OE1Q69pEF4TNPkyFvQeLz1v9Yo,524 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/filepost.pyi,sha256=1MxypGegFd4ivHA31bKHZ5w59LK1zOUkql9bSbzsZNM,327 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi,sha256=8-WNQ8HsF7JWBeN1n0qoPU84HsAouCrHj4R5qrGKrVQ,88 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi,sha256=jAdLMMvdxdszZCIdVGxRZw7i5waIBqb4RqwketJqMr4,81 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/poolmanager.pyi,sha256=VW-eCOt6qlsNSSumYcyh8o3Dhevdl6bxvsd-Ko1o5ao,1308 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/request.pyi,sha256=CLxsSA6nOdRfFUtMIPMNIKf08cGNG4tavx56ujogr6s,520 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/response.pyi,sha256=jtWTDNoEUiBcXS1o7HJurIzYfdN3a3cxAydumNndRtE,1697 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/__init__.pyi,sha256=gdALWU7cUUfHw66q9C1KuTgv0Zz7Pu18dVbxAt1yAPI,692 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/connection.pyi,sha256=XaFYtI2YyZGnOVivtXsLW6jMSb6FKpfIh3aIQInJLR0,188 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/request.pyi,sha256=FwrIbRsbuRdpckHVaQmhVJk_cIdVUw5_6B_PTdnM6Ys,220 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/response.pyi,sha256=Q0CWgpQG5zMPxwc0LOr5eQOEfmOqglfpydPfBVxiStc,27 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/retry.pyi,sha256=9sIauBI6frxfOykUlxZAMB2kleUEtwqVuoggz1NNoe8,1097 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/ssl_.pyi,sha256=yLzaH5LRfBw1bUIxxUGib64ZYGRcjF2ExHs9p_iPEiA,671 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/timeout.pyi,sha256=65GBiXGM86KUHgU_U1sA-zV2cDmU8B2K2Dn8oRCOGEI,498 +jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/url.pyi,sha256=WEV3oz9Xl0fmcPfmRYC7U728W1KD8xOEfN23aN-Ul-4,491 +jedi/third_party/typeshed/third_party/2and3/requests/sessions.pyi,sha256=1K6vDjCcCkX7mzq8jqFWPfJPW-VCrVxDeHnSPGOSgZU,5020 +jedi/third_party/typeshed/third_party/2and3/requests/status_codes.pyi,sha256=k4doi8u1F4oB1LklkAWib0etH3GU_iXHdaUT6HK8upk,70 +jedi/third_party/typeshed/third_party/2and3/requests/structures.pyi,sha256=CmGKEIE3d8rPuMxPFWdZqBTJpyWksz8Amdq0ZYzVZIw,968 +jedi/third_party/typeshed/third_party/2and3/requests/utils.pyi,sha256=F89NWGhgSpE7SfpouvHhQre1a4h3U6PzRTJZHiBOk8o,1641 +jedi/third_party/typeshed/third_party/2and3/simplejson/__init__.pyi,sha256=FEB2fWn0G_qYvOWJRgimTocRsxmUlyaTv0e6rDVioUw,539 +jedi/third_party/typeshed/third_party/2and3/simplejson/decoder.pyi,sha256=TU5Z2CC1DqO-CIm9ehGmxYl7rTNlnFG98uK2eJsX1yU,234 +jedi/third_party/typeshed/third_party/2and3/simplejson/encoder.pyi,sha256=wYlToo_rgl5vJIZTQBAlBvskSIP-g8JVWqtoNEV1nvE,268 +jedi/third_party/typeshed/third_party/2and3/simplejson/scanner.pyi,sha256=_AUT1GJRNYopQ98J8rRXtig5nCunjXLoiCf5gN9dpXo,262 +jedi/third_party/typeshed/third_party/2and3/singledispatch.pyi,sha256=Afo6MbRNe98wIsDONLYsaqNu62dgo-JvXGO4UFvxlJ8,636 +jedi/third_party/typeshed/third_party/2and3/tabulate.pyi,sha256=0xadduNLKRLBczuzd-yw28ataHy9CHknhYlGgtosUVQ,1455 +jedi/third_party/typeshed/third_party/2and3/termcolor.pyi,sha256=5SEyDxfbA3hHIeFi-2kadnFUFH4zEZF0V8yuHr7yvaE,452 +jedi/third_party/typeshed/third_party/2and3/toml.pyi,sha256=TcGqBh_wJul9FtFNlW7Noq_IY-58LCNTnK6SFOt1TfE,816 +jedi/third_party/typeshed/third_party/2and3/typing_extensions.pyi,sha256=gkJiwppdlXb2wKBoVEehE3MyRqXBALIjCoNRoYcYd_A,2729 +jedi/third_party/typeshed/third_party/2and3/ujson.pyi,sha256=pbov8VSejaAzkjPPTfUXO2zcDP50A7vCNImIQ5lIZB0,1046 +jedi/third_party/typeshed/third_party/2and3/werkzeug/__init__.pyi,sha256=I9BN_q8i2pffnKnhd6Y6riiud3i84JcYaKFMgdJk4nE,5539 +jedi/third_party/typeshed/third_party/2and3/werkzeug/_compat.pyi,sha256=Tn3bH2jOVtwItr1zELMKxSOumjLbGJkrCFwxBMfep-E,1139 +jedi/third_party/typeshed/third_party/2and3/werkzeug/_internal.pyi,sha256=Xq4DnZz9K5VENC8SpioShEBkyRNovJ1fuvW7cokZjL0,598 +jedi/third_party/typeshed/third_party/2and3/werkzeug/_reloader.pyi,sha256=QCQ4dGw3MM4rhwKmKntyLJ7JB-neMbnRuRrm2scpZgE,826 +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/atom.pyi,sha256=LAPRofmeDhSpU418KTzoATp5cB2D9daWgcgP_A2YrDI,1136 +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/cache.pyi,sha256=qgcpW-CL-UYiRhzy4fjDOFCxsNI58V4CoTHIrdbL4MQ,3321 +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/fixers.pyi,sha256=o3bHN0CkC0PHKzXHhU4jADVLNgg7rCDKoYM5p8FC6Go,1660 +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/iterio.pyi,sha256=2yRg8voINYQF23YfRkpGPXaaaX4jpupooKthKwfX4kU,1202 +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/jsrouting.pyi,sha256=4s_tRK57Yu_n1O1Zk85Nty48UaBHu6AsgeHHxLTS0ko,325 +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/limiter.pyi,sha256=qLbYIPMTBsgaYe74m3NerbQ1AkW_57LKwY0iW_zaIXU,192 +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/lint.pyi,sha256=vnPiJs5jXekVZmugPlmkXITga2URy2gh6vngdxkn_Ls,32 +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/profiler.pyi,sha256=vxg-JniWQ1JqncYfCJgoIPTB_q5cDd_QDXBI7Do3wCs,449 +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/securecookie.pyi,sha256=iP2XeB1GU55Yy78HYQ01bGHx1KaoSYeytLp9AbUcQTk,1156 +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/sessions.pyi,sha256=bJGLH1m0c97ZE8lilpCLYpJRcf-yF0-hXk-FQx2NoWM,1974 +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/testtools.pyi,sha256=qkbfF22aou-S4L0zODpwyHgKAtzjBGRFNPCaWQVh8Ac,211 +jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/wrappers.pyi,sha256=AdT0yvz1TaiY0mn6zlt_ET3DKsTywVVjkErC769c6L0,603 +jedi/third_party/typeshed/third_party/2and3/werkzeug/datastructures.pyi,sha256=2poB8iPWctfuycqosbI2sH03CAckB2WOYQXyLegqSyw,15655 +jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/__init__.pyi,sha256=39SwOU3Sbt4KTclv3rvOMAy4YLuUA4YyCQQQDTrVPAw,1330 +jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/console.pyi,sha256=i6SUF4dZiIVncm8-LrP5zDqW9UrdsCHKaaE_apnGXdE,1207 +jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/repr.pyi,sha256=dqtVFNOfcjINAMzaJ-tHiW6SO37ZwVtVT1J7SS7yWh0,846 +jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/tbtools.pyi,sha256=tbrAcENEbWQEOxxSrEKr_5GA3i-OaKn7K5QPA4Sk6TU,1687 +jedi/third_party/typeshed/third_party/2and3/werkzeug/exceptions.pyi,sha256=S42GoyHVRLLlIMi4IJ3z0EH_4EAHVOm1OaCK3CejWLg,4471 +jedi/third_party/typeshed/third_party/2and3/werkzeug/filesystem.pyi,sha256=te3jyfyiDfsnFU0MEYw-wB5jBgWgw4VAbIpQzGAs9Vs,169 +jedi/third_party/typeshed/third_party/2and3/werkzeug/formparser.pyi,sha256=cUYLp379rFe85GpYntbHkQ530s5PJ7H624ZmlvD0_B4,3645 +jedi/third_party/typeshed/third_party/2and3/werkzeug/http.pyi,sha256=NE-9-1RtHCURH3GT6yVAwfA_yVBvr0LFh-AkxRv5y18,5403 +jedi/third_party/typeshed/third_party/2and3/werkzeug/local.pyi,sha256=ZWdRsm--5mtPjtmAH_7-0JBQmvQUfAba_VbReVyAVIg,2315 +jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/dispatcher.pyi,sha256=LPPa3TX_-SAc1LT1fLZrPOKiab20UscrVyB4SEe6Q3w,455 +jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/http_proxy.pyi,sha256=fOHPrA5Xd1fw4lhKzspqsQmu5Ut3WJyKXWBrIOVESsU,684 +jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/lint.pyi,sha256=9htWl9zsn36wWsOuLdhxChhhF2erFNTP87D1MbyvJEQ,2418 +jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/profiler.pyi,sha256=KQLdRGbOCpeCuKx5w8THQrCUrTbKOxqFL9kwgfstW7M,568 +jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/proxy_fix.pyi,sha256=O9gG_aBKl2x_sdr3-pIlOAKt-bxLdjVOQYsSMYLWu9A,711 +jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/shared_data.pyi,sha256=_2cBW8iHxc0uLMIS-Pik84Ef-xdartbB1Ld2evJFFe8,1294 +jedi/third_party/typeshed/third_party/2and3/werkzeug/posixemulation.pyi,sha256=btuSFNg5J9BRiGFeYouO0aEhzYDknmVPvhG_jeLkPRY,198 +jedi/third_party/typeshed/third_party/2and3/werkzeug/routing.pyi,sha256=Evphz-4zRBki86RSjQ3c4BMDvvnVllUb6OANhE5My-o,6549 +jedi/third_party/typeshed/third_party/2and3/werkzeug/script.pyi,sha256=oYohDSwI8nN9OMby_fj490kvJzELXzdUu-bvGxt2b2M,759 +jedi/third_party/typeshed/third_party/2and3/werkzeug/security.pyi,sha256=utyGUghv_u_Rsb4p48VUyXuDJuLo621MJZuafdW4Gd4,524 +jedi/third_party/typeshed/third_party/2and3/werkzeug/serving.pyi,sha256=W2P0h6k-asBEe41ub-wSORym8YpsWD8Lrwmi3QcczA8,3706 +jedi/third_party/typeshed/third_party/2and3/werkzeug/test.pyi,sha256=pSq4ptcQl1fWr1uZfZ4cwrFikHcNgGZT5TVZxlmcBDs,5957 +jedi/third_party/typeshed/third_party/2and3/werkzeug/testapp.pyi,sha256=cscEIXiBYut8yb9dHOzJNsRXY8NqdWfhr4e3skmSVVI,225 +jedi/third_party/typeshed/third_party/2and3/werkzeug/urls.pyi,sha256=O_8nH87_Um6aL9wY2wOrqcm-rCK-HAPK7h3F0mSknYI,2887 +jedi/third_party/typeshed/third_party/2and3/werkzeug/useragents.pyi,sha256=StrHnvNpfRdxMousAfvxyIAvakN1U4f80KPCYHPmxlM,311 +jedi/third_party/typeshed/third_party/2and3/werkzeug/utils.pyi,sha256=74f-taqm60Q8NNsJLY817NCWRfAfdjmlkUONT60esgQ,1942 +jedi/third_party/typeshed/third_party/2and3/werkzeug/wrappers.pyi,sha256=hOYBNoiDFagoD1mcwNvunpg7uFBrdwgVLgSzqVAYNxs,9283 +jedi/third_party/typeshed/third_party/2and3/werkzeug/wsgi.pyi,sha256=N6O9gsVz-6yBc0vUDkiGgTvjGFlLW8-RpkzYu8e_uQE,3082 +jedi/third_party/typeshed/third_party/2and3/yaml/__init__.pyi,sha256=WYD5xqt4LJrJks-fYVL54FvNKl6sesARehN7H4Ay1mI,5576 +jedi/third_party/typeshed/third_party/2and3/yaml/composer.pyi,sha256=ctqdzrSyhbw96dgmXwwstva2sa2eYBwkM8YwgU0EbyQ,595 +jedi/third_party/typeshed/third_party/2and3/yaml/constructor.pyi,sha256=P-ouT_6UPzT-82BTmxWlMa_tCoIfK5COvC5-Hx6-gdE,3654 +jedi/third_party/typeshed/third_party/2and3/yaml/cyaml.pyi,sha256=Ab0qQBwsb_nkkacQdTsxcJ7gQU2fFVcJrOakwv0L4q4,2300 +jedi/third_party/typeshed/third_party/2and3/yaml/dumper.pyi,sha256=ZMJrjJHEZXqit17aKmVJeEfOXiZKJxASIIk2XNTdCJc,1167 +jedi/third_party/typeshed/third_party/2and3/yaml/emitter.pyi,sha256=9TyaKDoT6xQhrY1nldsCE4BAEGM5JMeMVXd6FPLghiw,3787 +jedi/third_party/typeshed/third_party/2and3/yaml/error.pyi,sha256=kYhKOUoSrnEQLvgIvG_qmPKgMQ53ADqFHOPPDTlRTs4,535 +jedi/third_party/typeshed/third_party/2and3/yaml/events.pyi,sha256=IXJuqeHbEQtHZ4mD36QQ1-CAQaLbKua8JEZ-qh7jPKg,1662 +jedi/third_party/typeshed/third_party/2and3/yaml/loader.pyi,sha256=INimmEGx0nrelNWKadpItu9SGDya3bRjxu3f68XU4is,767 +jedi/third_party/typeshed/third_party/2and3/yaml/nodes.pyi,sha256=HXEU6EM5Z7O0WqO8hCQbRXW_BCGYAzK68xKTZC5yDJs,685 +jedi/third_party/typeshed/third_party/2and3/yaml/parser.pyi,sha256=IeuaYcjmpxrfmFJbGhaqNSZWT3znUhIgo1B7AfX-uCM,1663 +jedi/third_party/typeshed/third_party/2and3/yaml/reader.pyi,sha256=mXEQfsWd2gLgND9OEHdjAIj34nATz5ZVpM46hotHzEc,831 +jedi/third_party/typeshed/third_party/2and3/yaml/representer.pyi,sha256=KWGKjye3RYJcLq50SaBAqrBVy4ke0_XsUOioDLs8oMA,2047 +jedi/third_party/typeshed/third_party/2and3/yaml/resolver.pyi,sha256=Do-jJBCJlZ0s0bQ3PVJhHomO37BSKhKirCiSWO3_D14,785 +jedi/third_party/typeshed/third_party/2and3/yaml/scanner.pyi,sha256=C5zS3RgeC27q0jrqXoGdD-a2S3E6jbsYOJGS_bv-o2Q,3572 +jedi/third_party/typeshed/third_party/2and3/yaml/serializer.pyi,sha256=W7c34cgxIFm2Sfu1FKlVlDx1z_7qhFsCyDgL-7xlBFM,665 +jedi/third_party/typeshed/third_party/2and3/yaml/tokens.pyi,sha256=lRuHaCHbPMRTOm3WEhanBssRRnJHUiGh1mjNmE4CND8,1792 +jedi/third_party/typeshed/third_party/3/contextvars.pyi,sha256=pB3s9rSQNfwqsPqxzsibNl7X0urHvfbXBuP5Cx-3614,1123 +jedi/third_party/typeshed/third_party/3/dataclasses.pyi,sha256=3PoC0Dy1Fj1XD5L4lC99OS28lAVXeYS8F-ZLgHpvjJ8,2371 +jedi/third_party/typeshed/third_party/3/docutils/__init__.pyi,sha256=BQVUCzV8lCylnmLCtnN0Yz_ttlqyzcLc-BZx2KPXPzM,58 +jedi/third_party/typeshed/third_party/3/docutils/examples.pyi,sha256=RBIGH7W0f-yOurXh3ZpXGqhFduPpIVoocbIqpJZZWs4,75 +jedi/third_party/typeshed/third_party/3/docutils/nodes.pyi,sha256=pOUg3TzCxxJkcmJ-hsGH_KVreBYXb7Elac53v1zZEto,261 +jedi/third_party/typeshed/third_party/3/docutils/parsers/__init__.pyi,sha256=BQVUCzV8lCylnmLCtnN0Yz_ttlqyzcLc-BZx2KPXPzM,58 +jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/__init__.pyi,sha256=BQVUCzV8lCylnmLCtnN0Yz_ttlqyzcLc-BZx2KPXPzM,58 +jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/nodes.pyi,sha256=BQVUCzV8lCylnmLCtnN0Yz_ttlqyzcLc-BZx2KPXPzM,58 +jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/roles.pyi,sha256=TdLW8iyQsN45UF7uCsAYrBGcGPULB6ryN8GnU0_DLaw,419 +jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/states.pyi,sha256=RmwcJ4RredmyyFezVwZcD4EwFs6tMXN7XcA04ATDptg,132 +jedi/third_party/typeshed/third_party/3/jwt/__init__.pyi,sha256=Gv5iYc-jrWMZ1qCZkZYprHCn16KrFNM516j3rvBny_g,1731 +jedi/third_party/typeshed/third_party/3/jwt/algorithms.pyi,sha256=rUxR3pI7cQCMx7kIWxv413ttGxUHnlDTWEZjQrqgbds,2865 +jedi/third_party/typeshed/third_party/3/jwt/contrib/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/__init__.pyi,sha256=hsCmJQgbRtOrzfpJiSuaGHMOEESmc0gKKaBVMQ_D4Sk,38 +jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/py_ecdsa.pyi,sha256=WrXDR-ZMe4rsKs8INAW4nvEcaQJWXvz1qk98NWDIh4s,239 +jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/pycrypto.pyi,sha256=mXxjdkl2_nbD0h69rPF9Jr4qmNZdYcsjvJs4yfbZ0vo,240 +jedi/third_party/typeshed/third_party/3/orjson.pyi,sha256=U9QjEtfT5eYtiIBnRZJcGEEimWpVR67P4cPdBAqTmYU,490 +jedi/third_party/typeshed/third_party/3/pkg_resources/__init__.pyi,sha256=sLmG-cxl_dOjbc2zauMaedd3LxDrXab1zkPheBNBM6w,11937 +jedi/third_party/typeshed/third_party/3/pkg_resources/py31compat.pyi,sha256=7C0GC70rjSIh0YBWg7rwrflnvOSx_FYZ0YdA4ZKKd2g,91 +jedi/third_party/typeshed/third_party/3/six/__init__.pyi,sha256=HLxDsnAYglH5Snk8s3wmUiRArazvjhyv3gvD2v9BRXo,3535 +jedi/third_party/typeshed/third_party/3/six/moves/BaseHTTPServer.pyi,sha256=vtBUJUabTrIVK97Cn0MhLUhHSlbmHB8QgQlWwadH-6w,26 +jedi/third_party/typeshed/third_party/3/six/moves/CGIHTTPServer.pyi,sha256=vtBUJUabTrIVK97Cn0MhLUhHSlbmHB8QgQlWwadH-6w,26 +jedi/third_party/typeshed/third_party/3/six/moves/SimpleHTTPServer.pyi,sha256=vtBUJUabTrIVK97Cn0MhLUhHSlbmHB8QgQlWwadH-6w,26 +jedi/third_party/typeshed/third_party/3/six/moves/__init__.pyi,sha256=Ny26MEEbEL3itX3L7pTrP10BVYG4axRCa_OvRpmgSbU,2302 +jedi/third_party/typeshed/third_party/3/six/moves/_dummy_thread.pyi,sha256=QcsaN0JxBr9ArwQnzhmN06G8dMTpqIuIbapJvWWr8IQ,28 +jedi/third_party/typeshed/third_party/3/six/moves/_thread.pyi,sha256=An3Es1KPMtE47GK-HKV_WnuG7kfoT5bh-bn_SfOQ5Pc,22 +jedi/third_party/typeshed/third_party/3/six/moves/builtins.pyi,sha256=VVjpGGLJ2CYwC3lYePGY6TLTEhwcdru3YV-nV2ZAzL8,23 +jedi/third_party/typeshed/third_party/3/six/moves/cPickle.pyi,sha256=pezOsQZrW9XS1R09Ote5u1Wtw9FHC0k8Kjp4g44_PgI,21 +jedi/third_party/typeshed/third_party/3/six/moves/configparser.pyi,sha256=Wp5Y7Z134PHLahfawLJDB7WyIBpdLooaGKLQmEr7veQ,27 +jedi/third_party/typeshed/third_party/3/six/moves/email_mime_base.pyi,sha256=WcWEleCKHROrfdXpRuKABrT_Va1hx90NY_kxYeul3Sk,30 +jedi/third_party/typeshed/third_party/3/six/moves/email_mime_multipart.pyi,sha256=HRKWFU9qh95-mEE22_2NzEKL6lx7ynvhcfHjUcYWuZ8,35 +jedi/third_party/typeshed/third_party/3/six/moves/email_mime_nonmultipart.pyi,sha256=n5hD7R_rktJj3hiHYzEqr3CJCHSW4ikfObKHmUrXBw0,38 +jedi/third_party/typeshed/third_party/3/six/moves/email_mime_text.pyi,sha256=M7mb9V3f5JUut8yf8UfL3rG4XPr-Lr692DGjk1OR9d4,30 +jedi/third_party/typeshed/third_party/3/six/moves/html_entities.pyi,sha256=YkFcpA-UjTm7ps8gp1Xs6Ye9eu-fRHUlSrZPc00LZuk,28 +jedi/third_party/typeshed/third_party/3/six/moves/html_parser.pyi,sha256=EhnBFGx0nBd-ZHMy53ihoemWud0xnNYYYzQDrqWZ7SM,26 +jedi/third_party/typeshed/third_party/3/six/moves/http_client.pyi,sha256=a-UAXTgUTrJNFFiQWThbgVvOsqCJXXiFTxjOG4QgbiE,26 +jedi/third_party/typeshed/third_party/3/six/moves/http_cookiejar.pyi,sha256=_qfFwqs5DnvAOqLWCAdCzWjnwVFi2tkRjypRcow1Kgw,29 +jedi/third_party/typeshed/third_party/3/six/moves/http_cookies.pyi,sha256=dKSPvohzW_QPkOUb0gxj3rsshfRDYb9krTqjID3wN68,27 +jedi/third_party/typeshed/third_party/3/six/moves/queue.pyi,sha256=_rNUYjj1lkl5pRaQP4GWCuWEHBSetCgHhvSnWjgBuhk,20 +jedi/third_party/typeshed/third_party/3/six/moves/reprlib.pyi,sha256=gzyGHWv3b10R17IbpgllskSTyulpq6RWGb7I5KAbSh0,22 +jedi/third_party/typeshed/third_party/3/six/moves/socketserver.pyi,sha256=GWp7BzDMpq3JNfA3H3Pn0iyENzAcy5ufcvuvlkEzmFg,27 +jedi/third_party/typeshed/third_party/3/six/moves/tkinter.pyi,sha256=R-kj-ZjyE6cnPhkAhJLQIA2zyggMRHyf4azpH_WtXNo,22 +jedi/third_party/typeshed/third_party/3/six/moves/tkinter_commondialog.pyi,sha256=piW_7DIKFPiFl8awGTKEBkW-toBwMu7ySfSgxT39Qsc,35 +jedi/third_party/typeshed/third_party/3/six/moves/tkinter_constants.pyi,sha256=sB-tEEYJXZlnQEvgUxsHYFp3yyp3F7NtblS3_hRFVFM,32 +jedi/third_party/typeshed/third_party/3/six/moves/tkinter_dialog.pyi,sha256=Lk_TOa4m8kLSRZRs2-zLtgFnpbtkGcs2eu1YgCjNzmM,29 +jedi/third_party/typeshed/third_party/3/six/moves/tkinter_filedialog.pyi,sha256=znHuWqubMwXiONWP1bhNRmAXUVcHdXn9B8AqoJu4EgY,33 +jedi/third_party/typeshed/third_party/3/six/moves/tkinter_tkfiledialog.pyi,sha256=znHuWqubMwXiONWP1bhNRmAXUVcHdXn9B8AqoJu4EgY,33 +jedi/third_party/typeshed/third_party/3/six/moves/tkinter_ttk.pyi,sha256=4JCeiL-sndFy8xykanaUTbW3-ESBr4w8Dd1gOMAvrag,26 +jedi/third_party/typeshed/third_party/3/six/moves/urllib/__init__.pyi,sha256=F_1V8NcR4jGkws85IUurYLi4JnGh7_HttdVHvj8cQZM,217 +jedi/third_party/typeshed/third_party/3/six/moves/urllib/error.pyi,sha256=Z7qLiQr0btCqsOVy3cAgY_IupiTPQbC1l-5Wh4GEHY0,164 +jedi/third_party/typeshed/third_party/3/six/moves/urllib/parse.pyi,sha256=aKLBKufXpDAcEVh2fjisQ2y7PxaYuAzJdfjNAIruQo0,1372 +jedi/third_party/typeshed/third_party/3/six/moves/urllib/request.pyi,sha256=sWtUUa1c1wJ0fsqRNJfPMigUCzHwUi3MnWNmwqhtfrM,2356 +jedi/third_party/typeshed/third_party/3/six/moves/urllib/response.pyi,sha256=MLuhuwcVdryiGU6pB2rkOWjdFnFcm7NsXJxqFt9-YlI,389 +jedi/third_party/typeshed/third_party/3/six/moves/urllib/robotparser.pyi,sha256=WK-Nrt7QFCWmAxfbrK0Mecw9NZur54H8AoYbslX6vSg,66 +jedi/third_party/typeshed/third_party/3/six/moves/urllib_error.pyi,sha256=ZLiDEtiqtoYYbNDYF4LjnxKRd_uFft6Yi5QQyNEkZm8,27 +jedi/third_party/typeshed/third_party/3/six/moves/urllib_parse.pyi,sha256=PQR8avzMMvUSLV96WLv3J4leuJpKEUBoo7vDzP6M848,27 +jedi/third_party/typeshed/third_party/3/six/moves/urllib_request.pyi,sha256=8WFe7ycArSuM6wJfgcXWLDRKNsymd0UlxWlflszb2yk,30 +jedi/third_party/typeshed/third_party/3/six/moves/urllib_response.pyi,sha256=dokFMleMVEVFVxBgSkrcn4f4yM7RhR3zkk0iDQGOC_U,31 +jedi/third_party/typeshed/third_party/3/six/moves/urllib_robotparser.pyi,sha256=BiNO0kuoX9quQRDQsnPLr04VZLHOj57CmrJJN5OuBn4,33 +jedi/third_party/typeshed/third_party/3/typed_ast/__init__.pyi,sha256=HrvIFkUnxFkfLUsfazOwsJcxX79YIiDsZGBb-DhTKhc,124 +jedi/third_party/typeshed/third_party/3/typed_ast/ast27.pyi,sha256=qxorPpe4C0c4AQBH0GDWl-9uI1AXn7qnRaEf9Bz6KOE,6985 +jedi/third_party/typeshed/third_party/3/typed_ast/ast3.pyi,sha256=ZTn_jD8kGkW_h8FFpCGWJhlManpAy1mEZM-h1qrl6_o,8014 +jedi/third_party/typeshed/third_party/3/typed_ast/conversions.pyi,sha256=9kma3lgrje8fPNOjOP-gIHf-rVuyfCdcwD8Jgh4LqWc,84 +jedi/utils.py,sha256=8IE4ZG_2jFBEiuiwHlXmojkrtx5NJQNxop7BFvgXp4E,4727 diff --git a/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/WHEEL b/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/WHEEL new file mode 100644 index 00000000..ef99c6cf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.34.2) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/top_level.txt b/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/top_level.txt new file mode 100644 index 00000000..86c1cb19 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi-0.17.1.dist-info/top_level.txt @@ -0,0 +1 @@ +jedi diff --git a/.venv/lib/python3.8/site-packages/jedi/__init__.py b/.venv/lib/python3.8/site-packages/jedi/__init__.py new file mode 100644 index 00000000..f15ac9f5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/__init__.py @@ -0,0 +1,43 @@ +""" +Jedi is a static analysis tool for Python that is typically used in +IDEs/editors plugins. Jedi has a focus on autocompletion and goto +functionality. Other features include refactoring, code search and finding +references. + +Jedi has a simple API to work with. There is a reference implementation as a +`VIM-Plugin `_. Autocompletion in your +REPL is also possible, IPython uses it natively and for the CPython REPL you +can install it. Jedi is well tested and bugs should be rare. + +Here's a simple example of the autocompletion feature: + +>>> import jedi +>>> source = ''' +... import json +... json.lo''' +>>> script = jedi.Script(source, path='example.py') +>>> script + +>>> completions = script.complete(3, len('json.lo')) +>>> completions +[, ] +>>> print(completions[0].complete) +ad +>>> print(completions[0].name) +load +""" + +__version__ = '0.17.1' + +from jedi.api import Script, Interpreter, set_debug_function, \ + preload_module, names +from jedi import settings +from jedi.api.environment import find_virtualenvs, find_system_environments, \ + get_default_environment, InvalidPythonEnvironment, create_environment, \ + get_system_environment, InterpreterEnvironment +from jedi.api.project import Project, get_default_project +from jedi.api.exceptions import InternalError, RefactoringError + +# Finally load the internal plugins. This is only internal. +from jedi.plugins import registry +del registry diff --git a/.venv/lib/python3.8/site-packages/jedi/__main__.py b/.venv/lib/python3.8/site-packages/jedi/__main__.py new file mode 100644 index 00000000..6b442533 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/__main__.py @@ -0,0 +1,72 @@ +import sys +from os.path import join, dirname, abspath, isdir + + +def _start_linter(): + """ + This is a pre-alpha API. You're not supposed to use it at all, except for + testing. It will very likely change. + """ + import jedi + + if '--debug' in sys.argv: + jedi.set_debug_function() + + for path in sys.argv[2:]: + if path.startswith('--'): + continue + if isdir(path): + import fnmatch + import os + + paths = [] + for root, dirnames, filenames in os.walk(path): + for filename in fnmatch.filter(filenames, '*.py'): + paths.append(os.path.join(root, filename)) + else: + paths = [path] + + try: + for p in paths: + for error in jedi.Script(path=p)._analysis(): + print(error) + except Exception: + if '--pdb' in sys.argv: + import traceback + traceback.print_exc() + import pdb + pdb.post_mortem() + else: + raise + + +def _complete(): + import jedi + import pdb + + if '-d' in sys.argv: + sys.argv.remove('-d') + jedi.set_debug_function() + + try: + completions = jedi.Script(sys.argv[2]).complete() + for c in completions: + c.docstring() + c.type + except Exception as e: + print(repr(e)) + pdb.post_mortem() + else: + print(completions) + + +if len(sys.argv) == 2 and sys.argv[1] == 'repl': + # don't want to use __main__ only for repl yet, maybe we want to use it for + # something else. So just use the keyword ``repl`` for now. + print(join(dirname(abspath(__file__)), 'api', 'replstartup.py')) +elif len(sys.argv) > 1 and sys.argv[1] == '_linter': + _start_linter() +elif len(sys.argv) > 1 and sys.argv[1] == '_complete': + _complete() +else: + print('Command not implemented: %s' % sys.argv[1]) diff --git a/.venv/lib/python3.8/site-packages/jedi/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..6031120e Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/__pycache__/__main__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/__pycache__/__main__.cpython-38.pyc new file mode 100644 index 00000000..75aa0c3c Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/__pycache__/__main__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/__pycache__/_compatibility.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/__pycache__/_compatibility.cpython-38.pyc new file mode 100644 index 00000000..e0bf1df9 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/__pycache__/_compatibility.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/__pycache__/cache.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/__pycache__/cache.cpython-38.pyc new file mode 100644 index 00000000..2e18d011 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/__pycache__/cache.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/__pycache__/common.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/__pycache__/common.cpython-38.pyc new file mode 100644 index 00000000..06b659b4 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/__pycache__/common.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/__pycache__/debug.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/__pycache__/debug.cpython-38.pyc new file mode 100644 index 00000000..9f061d4c Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/__pycache__/debug.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/__pycache__/file_io.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/__pycache__/file_io.cpython-38.pyc new file mode 100644 index 00000000..e81412bb Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/__pycache__/file_io.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/__pycache__/parser_utils.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/__pycache__/parser_utils.cpython-38.pyc new file mode 100644 index 00000000..8d552b6f Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/__pycache__/parser_utils.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/__pycache__/settings.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/__pycache__/settings.cpython-38.pyc new file mode 100644 index 00000000..106b7902 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/__pycache__/settings.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/__pycache__/utils.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/__pycache__/utils.cpython-38.pyc new file mode 100644 index 00000000..c4cc54a4 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/__pycache__/utils.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/_compatibility.py b/.venv/lib/python3.8/site-packages/jedi/_compatibility.py new file mode 100644 index 00000000..13c1975c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/_compatibility.py @@ -0,0 +1,631 @@ +""" +To ensure compatibility from Python ``2.7`` - ``3.x``, a module has been +created. Clearly there is huge need to use conforming syntax. +""" +from __future__ import print_function +import atexit +import errno +import functools +import sys +import os +import re +import pkgutil +import warnings +import subprocess +import weakref +try: + import importlib +except ImportError: + pass +from zipimport import zipimporter + +from jedi.file_io import KnownContentFileIO, ZipFileIO + +is_py3 = sys.version_info[0] >= 3 +is_py35 = is_py3 and sys.version_info[1] >= 5 +py_version = int(str(sys.version_info[0]) + str(sys.version_info[1])) + + +if sys.version_info[:2] < (3, 5): + """ + A super-minimal shim around listdir that behave like + scandir for the information we need. + """ + class _DirEntry: + + def __init__(self, name, basepath): + self.name = name + self.basepath = basepath + + def is_dir(self): + path_for_name = os.path.join(self.basepath, self.name) + return os.path.isdir(path_for_name) + + def scandir(dir): + return [_DirEntry(name, dir) for name in os.listdir(dir)] +else: + from os import scandir + + +class DummyFile(object): + def __init__(self, loader, string): + self.loader = loader + self.string = string + + def read(self): + return self.loader.get_source(self.string) + + def close(self): + del self.loader + + +def find_module_py34(string, path=None, full_name=None, is_global_search=True): + spec = None + loader = None + + for finder in sys.meta_path: + if is_global_search and finder != importlib.machinery.PathFinder: + p = None + else: + p = path + try: + find_spec = finder.find_spec + except AttributeError: + # These are old-school clases that still have a different API, just + # ignore those. + continue + + spec = find_spec(string, p) + if spec is not None: + loader = spec.loader + if loader is None and not spec.has_location: + # This is a namespace package. + full_name = string if not path else full_name + implicit_ns_info = ImplicitNSInfo(full_name, spec.submodule_search_locations._path) + return implicit_ns_info, True + break + + return find_module_py33(string, path, loader) + + +def find_module_py33(string, path=None, loader=None, full_name=None, is_global_search=True): + loader = loader or importlib.machinery.PathFinder.find_module(string, path) + + if loader is None and path is None: # Fallback to find builtins + try: + with warnings.catch_warnings(record=True): + # Mute "DeprecationWarning: Use importlib.util.find_spec() + # instead." While we should replace that in the future, it's + # probably good to wait until we deprecate Python 3.3, since + # it was added in Python 3.4 and find_loader hasn't been + # removed in 3.6. + loader = importlib.find_loader(string) + except ValueError as e: + # See #491. Importlib might raise a ValueError, to avoid this, we + # just raise an ImportError to fix the issue. + raise ImportError("Originally " + repr(e)) + + if loader is None: + raise ImportError("Couldn't find a loader for {}".format(string)) + + return _from_loader(loader, string) + + +def _from_loader(loader, string): + try: + is_package_method = loader.is_package + except AttributeError: + is_package = False + else: + is_package = is_package_method(string) + try: + get_filename = loader.get_filename + except AttributeError: + return None, is_package + else: + module_path = cast_path(get_filename(string)) + + # To avoid unicode and read bytes, "overwrite" loader.get_source if + # possible. + try: + f = type(loader).get_source + except AttributeError: + raise ImportError("get_source was not defined on loader") + + if is_py3 and f is not importlib.machinery.SourceFileLoader.get_source: + # Unfortunately we are reading unicode here, not bytes. + # It seems hard to get bytes, because the zip importer + # logic just unpacks the zip file and returns a file descriptor + # that we cannot as easily access. Therefore we just read it as + # a string in the cases where get_source was overwritten. + code = loader.get_source(string) + else: + code = _get_source(loader, string) + + if code is None: + return None, is_package + if isinstance(loader, zipimporter): + return ZipFileIO(module_path, code, cast_path(loader.archive)), is_package + + return KnownContentFileIO(module_path, code), is_package + + +def _get_source(loader, fullname): + """ + This method is here as a replacement for SourceLoader.get_source. That + method returns unicode, but we prefer bytes. + """ + path = loader.get_filename(fullname) + try: + return loader.get_data(path) + except OSError: + raise ImportError('source not available through get_data()', + name=fullname) + + +def find_module_pre_py3(string, path=None, full_name=None, is_global_search=True): + # This import is here, because in other places it will raise a + # DeprecationWarning. + import imp + try: + module_file, module_path, description = imp.find_module(string, path) + module_type = description[2] + is_package = module_type is imp.PKG_DIRECTORY + if is_package: + # In Python 2 directory package imports are returned as folder + # paths, not __init__.py paths. + p = os.path.join(module_path, '__init__.py') + try: + module_file = open(p) + module_path = p + except FileNotFoundError: + pass + elif module_type != imp.PY_SOURCE: + if module_file is not None: + module_file.close() + module_file = None + + if module_file is None: + return None, is_package + + with module_file: + code = module_file.read() + return KnownContentFileIO(cast_path(module_path), code), is_package + except ImportError: + pass + + if path is None: + path = sys.path + for item in path: + loader = pkgutil.get_importer(item) + if loader: + loader = loader.find_module(string) + if loader is not None: + return _from_loader(loader, string) + raise ImportError("No module named {}".format(string)) + + +find_module = find_module_py34 if is_py3 else find_module_pre_py3 +find_module.__doc__ = """ +Provides information about a module. + +This function isolates the differences in importing libraries introduced with +python 3.3 on; it gets a module name and optionally a path. It will return a +tuple containin an open file for the module (if not builtin), the filename +or the name of the module if it is a builtin one and a boolean indicating +if the module is contained in a package. +""" + + +class ImplicitNSInfo(object): + """Stores information returned from an implicit namespace spec""" + def __init__(self, name, paths): + self.name = name + self.paths = paths + + +if is_py3: + all_suffixes = importlib.machinery.all_suffixes +else: + def all_suffixes(): + # Is deprecated and raises a warning in Python 3.6. + import imp + return [suffix for suffix, _, _ in imp.get_suffixes()] + + +# unicode function +try: + unicode = unicode +except NameError: + unicode = str + + +# re-raise function +if is_py3: + def reraise(exception, traceback): + raise exception.with_traceback(traceback) +else: + eval(compile(""" +def reraise(exception, traceback): + raise exception, None, traceback +""", 'blub', 'exec')) + +reraise.__doc__ = """ +Re-raise `exception` with a `traceback` object. + +Usage:: + + reraise(Exception, sys.exc_info()[2]) + +""" + + +def use_metaclass(meta, *bases): + """ Create a class with a metaclass. """ + if not bases: + bases = (object,) + return meta("Py2CompatibilityMetaClass", bases, {}) + + +try: + encoding = sys.stdout.encoding + if encoding is None: + encoding = 'utf-8' +except AttributeError: + encoding = 'ascii' + + +def u(string, errors='strict'): + """Cast to unicode DAMMIT! + Written because Python2 repr always implicitly casts to a string, so we + have to cast back to a unicode (and we now that we always deal with valid + unicode, because we check that in the beginning). + """ + if isinstance(string, bytes): + return unicode(string, encoding='UTF-8', errors=errors) + return string + + +def cast_path(obj): + """ + Take a bytes or str path and cast it to unicode. + + Apparently it is perfectly fine to pass both byte and unicode objects into + the sys.path. This probably means that byte paths are normal at other + places as well. + + Since this just really complicates everything and Python 2.7 will be EOL + soon anyway, just go with always strings. + """ + return u(obj, errors='replace') + + +def force_unicode(obj): + # Intentionally don't mix those two up, because those two code paths might + # be different in the future (maybe windows?). + return cast_path(obj) + + +try: + import builtins # module name in python 3 +except ImportError: + import __builtin__ as builtins # noqa: F401 + + +import ast # noqa: F401 + + +def literal_eval(string): + return ast.literal_eval(string) + + +try: + from itertools import zip_longest +except ImportError: + from itertools import izip_longest as zip_longest # Python 2 # noqa: F401 + +try: + FileNotFoundError = FileNotFoundError +except NameError: + FileNotFoundError = IOError + +try: + IsADirectoryError = IsADirectoryError +except NameError: + IsADirectoryError = IOError + +try: + PermissionError = PermissionError +except NameError: + PermissionError = IOError + +try: + NotADirectoryError = NotADirectoryError +except NameError: + class NotADirectoryError(Exception): + # Don't implement this for Python 2 anymore. + pass + + +def no_unicode_pprint(dct): + """ + Python 2/3 dict __repr__ may be different, because of unicode differens + (with or without a `u` prefix). Normally in doctests we could use `pprint` + to sort dicts and check for equality, but here we have to write a separate + function to do that. + """ + import pprint + s = pprint.pformat(dct) + print(re.sub("u'", "'", s)) + + +def utf8_repr(func): + """ + ``__repr__`` methods in Python 2 don't allow unicode objects to be + returned. Therefore cast them to utf-8 bytes in this decorator. + """ + def wrapper(self): + result = func(self) + if isinstance(result, unicode): + return result.encode('utf-8') + else: + return result + + if is_py3: + return func + else: + return wrapper + + +if is_py3: + import queue +else: + import Queue as queue # noqa: F401 + +try: + # Attempt to load the C implementation of pickle on Python 2 as it is way + # faster. + import cPickle as pickle +except ImportError: + import pickle + + +def pickle_load(file): + try: + if is_py3: + return pickle.load(file, encoding='bytes') + return pickle.load(file) + # Python on Windows don't throw EOF errors for pipes. So reraise them with + # the correct type, which is caught upwards. + except OSError: + if sys.platform == 'win32': + raise EOFError() + raise + + +def _python2_dct_keys_to_unicode(data): + """ + Python 2 stores object __dict__ entries as bytes, not unicode, correct it + here. Python 2 can deal with both, Python 3 expects unicode. + """ + if isinstance(data, tuple): + return tuple(_python2_dct_keys_to_unicode(x) for x in data) + elif isinstance(data, list): + return list(_python2_dct_keys_to_unicode(x) for x in data) + elif hasattr(data, '__dict__') and type(data.__dict__) == dict: + data.__dict__ = {unicode(k): v for k, v in data.__dict__.items()} + return data + + +def pickle_dump(data, file, protocol): + try: + if not is_py3: + data = _python2_dct_keys_to_unicode(data) + pickle.dump(data, file, protocol) + # On Python 3.3 flush throws sometimes an error even though the writing + # operation should be completed. + file.flush() + # Python on Windows don't throw EPIPE errors for pipes. So reraise them with + # the correct type and error number. + except OSError: + if sys.platform == 'win32': + raise IOError(errno.EPIPE, "Broken pipe") + raise + + +# Determine the highest protocol version compatible for a given list of Python +# versions. +def highest_pickle_protocol(python_versions): + protocol = 4 + for version in python_versions: + if version[0] == 2: + # The minimum protocol version for the versions of Python that we + # support (2.7 and 3.3+) is 2. + return 2 + if version[1] < 4: + protocol = 3 + return protocol + + +try: + from inspect import Parameter +except ImportError: + class Parameter(object): + POSITIONAL_ONLY = object() + POSITIONAL_OR_KEYWORD = object() + VAR_POSITIONAL = object() + KEYWORD_ONLY = object() + VAR_KEYWORD = object() + + +class GeneralizedPopen(subprocess.Popen): + def __init__(self, *args, **kwargs): + if os.name == 'nt': + try: + # Was introduced in Python 3.7. + CREATE_NO_WINDOW = subprocess.CREATE_NO_WINDOW + except AttributeError: + CREATE_NO_WINDOW = 0x08000000 + kwargs['creationflags'] = CREATE_NO_WINDOW + # The child process doesn't need file descriptors except 0, 1, 2. + # This is unix only. + kwargs['close_fds'] = 'posix' in sys.builtin_module_names + super(GeneralizedPopen, self).__init__(*args, **kwargs) + + +# shutil.which is not available on Python 2.7. +def which(cmd, mode=os.F_OK | os.X_OK, path=None): + """Given a command, mode, and a PATH string, return the path which + conforms to the given mode on the PATH, or None if there is no such + file. + + `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result + of os.environ.get("PATH"), or can be overridden with a custom search + path. + + """ + # Check that a given file can be accessed with the correct mode. + # Additionally check that `file` is not a directory, as on Windows + # directories pass the os.access check. + def _access_check(fn, mode): + return (os.path.exists(fn) and os.access(fn, mode) + and not os.path.isdir(fn)) + + # If we're given a path with a directory part, look it up directly rather + # than referring to PATH directories. This includes checking relative to the + # current directory, e.g. ./script + if os.path.dirname(cmd): + if _access_check(cmd, mode): + return cmd + return None + + if path is None: + path = os.environ.get("PATH", os.defpath) + if not path: + return None + path = path.split(os.pathsep) + + if sys.platform == "win32": + # The current directory takes precedence on Windows. + if os.curdir not in path: + path.insert(0, os.curdir) + + # PATHEXT is necessary to check on Windows. + pathext = os.environ.get("PATHEXT", "").split(os.pathsep) + # See if the given file matches any of the expected path extensions. + # This will allow us to short circuit when given "python.exe". + # If it does match, only test that one, otherwise we have to try + # others. + if any(cmd.lower().endswith(ext.lower()) for ext in pathext): + files = [cmd] + else: + files = [cmd + ext for ext in pathext] + else: + # On other platforms you don't have things like PATHEXT to tell you + # what file suffixes are executable, so just pass on cmd as-is. + files = [cmd] + + seen = set() + for dir in path: + normdir = os.path.normcase(dir) + if normdir not in seen: + seen.add(normdir) + for thefile in files: + name = os.path.join(dir, thefile) + if _access_check(name, mode): + return name + return None + + +if not is_py3: + # Simplified backport of Python 3 weakref.finalize: + # https://github.com/python/cpython/blob/ded4737989316653469763230036b04513cb62b3/Lib/weakref.py#L502-L662 + class finalize(object): + """Class for finalization of weakrefable objects. + + finalize(obj, func, *args, **kwargs) returns a callable finalizer + object which will be called when obj is garbage collected. The + first time the finalizer is called it evaluates func(*arg, **kwargs) + and returns the result. After this the finalizer is dead, and + calling it just returns None. + + When the program exits any remaining finalizers will be run. + """ + + # Finalizer objects don't have any state of their own. + # This ensures that they cannot be part of a ref-cycle. + __slots__ = () + _registry = {} + + def __init__(self, obj, func, *args, **kwargs): + info = functools.partial(func, *args, **kwargs) + info.weakref = weakref.ref(obj, self) + self._registry[self] = info + + # To me it's an absolute mystery why in Python 2 we need _=None. It + # makes really no sense since it's never really called. Then again it + # might be called by Python 2.7 itself, but weakref.finalize is not + # documented in Python 2 and therefore shouldn't be randomly called. + # We never call this stuff with a parameter and therefore this + # parameter should not be needed. But it is. ~dave + def __call__(self, _=None): + """Return func(*args, **kwargs) if alive.""" + info = self._registry.pop(self, None) + if info: + return info() + + @classmethod + def _exitfunc(cls): + if not cls._registry: + return + for finalizer in list(cls._registry): + try: + finalizer() + except Exception: + sys.excepthook(*sys.exc_info()) + assert finalizer not in cls._registry + + atexit.register(finalize._exitfunc) + weakref.finalize = finalize + + +if is_py3 and sys.version_info[1] > 5: + from inspect import unwrap +else: + # Only Python >=3.6 does properly limit the amount of unwraps. This is very + # relevant in the case of unittest.mock.patch. + # Below is the implementation of Python 3.7. + def unwrap(func, stop=None): + """Get the object wrapped by *func*. + + Follows the chain of :attr:`__wrapped__` attributes returning the last + object in the chain. + + *stop* is an optional callback accepting an object in the wrapper chain + as its sole argument that allows the unwrapping to be terminated early if + the callback returns a true value. If the callback never returns a true + value, the last object in the chain is returned as usual. For example, + :func:`signature` uses this to stop unwrapping if any object in the + chain has a ``__signature__`` attribute defined. + + :exc:`ValueError` is raised if a cycle is encountered. + + """ + if stop is None: + def _is_wrapper(f): + return hasattr(f, '__wrapped__') + else: + def _is_wrapper(f): + return hasattr(f, '__wrapped__') and not stop(f) + f = func # remember the original func for error reporting + # Memoise by id to tolerate non-hashable objects, but store objects to + # ensure they aren't destroyed, which would allow their IDs to be reused. + memo = {id(f): f} + recursion_limit = sys.getrecursionlimit() + while _is_wrapper(func): + func = func.__wrapped__ + id_func = id(func) + if (id_func in memo) or (len(memo) >= recursion_limit): + raise ValueError('wrapper loop when unwrapping {!r}'.format(f)) + memo[id_func] = func + return func diff --git a/.venv/lib/python3.8/site-packages/jedi/api/__init__.py b/.venv/lib/python3.8/site-packages/jedi/api/__init__.py new file mode 100644 index 00000000..ab069c98 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/api/__init__.py @@ -0,0 +1,917 @@ +""" +The API basically only provides one class. You can create a :class:`Script` and +use its methods. + +Additionally you can add a debug function with :func:`set_debug_function`. +Alternatively, if you don't need a custom function and are happy with printing +debug messages to stdout, simply call :func:`set_debug_function` without +arguments. +""" +import os +import sys +import warnings +from functools import wraps + +import parso +from parso.python import tree + +from jedi._compatibility import force_unicode, cast_path, is_py3 +from jedi.parser_utils import get_executable_nodes +from jedi import debug +from jedi import settings +from jedi import cache +from jedi.file_io import KnownContentFileIO +from jedi.api import classes +from jedi.api import interpreter +from jedi.api import helpers +from jedi.api.helpers import validate_line_column +from jedi.api.completion import Completion, search_in_module +from jedi.api.keywords import KeywordName +from jedi.api.environment import InterpreterEnvironment +from jedi.api.project import get_default_project, Project +from jedi.api.errors import parso_to_jedi_errors +from jedi.api import refactoring +from jedi.api.refactoring.extract import extract_function, extract_variable +from jedi.inference import InferenceState +from jedi.inference import imports +from jedi.inference.references import find_references +from jedi.inference.arguments import try_iter_content +from jedi.inference.helpers import infer_call_of_leaf +from jedi.inference.sys_path import transform_path_to_dotted +from jedi.inference.syntax_tree import tree_name_to_values +from jedi.inference.value import ModuleValue +from jedi.inference.base_value import ValueSet +from jedi.inference.value.iterable import unpack_tuple_to_dict +from jedi.inference.gradual.conversion import convert_names, convert_values +from jedi.inference.gradual.utils import load_proper_stub_module +from jedi.inference.utils import to_list + +# Jedi uses lots and lots of recursion. By setting this a little bit higher, we +# can remove some "maximum recursion depth" errors. +sys.setrecursionlimit(3000) + + +def _no_python2_support(func): + # TODO remove when removing Python 2/3.5 + @wraps(func) + def wrapper(self, *args, **kwargs): + if self._inference_state.grammar.version_info < (3, 6) or sys.version_info < (3, 6): + raise NotImplementedError( + "No support for refactorings/search on Python 2/3.5" + ) + return func(self, *args, **kwargs) + return wrapper + + +class Script(object): + """ + A Script is the base for completions, goto or whatever you want to do with + Jedi. The counter part of this class is :class:`Interpreter`, which works + with actual dictionaries and can work with a REPL. This class + should be used when a user edits code in an editor. + + You can either use the ``code`` parameter or ``path`` to read a file. + Usually you're going to want to use both of them (in an editor). + + The Script's ``sys.path`` is very customizable: + + - If `project` is provided with a ``sys_path``, that is going to be used. + - If `environment` is provided, its ``sys.path`` will be used + (see :func:`Environment.get_sys_path `); + - Otherwise ``sys.path`` will match that of the default environment of + Jedi, which typically matches the sys path that was used at the time + when Jedi was imported. + + Most methods have a ``line`` and a ``column`` parameter. Lines in Jedi are + always 1-based and columns are always zero based. To avoid repetition they + are not always documented. You can omit both line and column. Jedi will + then just do whatever action you are calling at the end of the file. If you + provide only the line, just will complete at the end of that line. + + .. warning:: By default :attr:`jedi.settings.fast_parser` is enabled, which means + that parso reuses modules (i.e. they are not immutable). With this setting + Jedi is **not thread safe** and it is also not safe to use multiple + :class:`.Script` instances and its definitions at the same time. + + If you are a normal plugin developer this should not be an issue. It is + an issue for people that do more complex stuff with Jedi. + + This is purely a performance optimization and works pretty well for all + typical usages, however consider to turn the setting off if it causes + you problems. See also + `this discussion `_. + + :param code: The source code of the current file, separated by newlines. + :type code: str + :param line: Deprecated, please use it directly on e.g. ``.complete`` + :type line: int + :param column: Deprecated, please use it directly on e.g. ``.complete`` + :type column: int + :param path: The path of the file in the file system, or ``''`` if + it hasn't been saved yet. + :type path: str or None + :param encoding: Deprecated, cast to unicode yourself. The encoding of + ``code``, if it is not a ``unicode`` object (default ``'utf-8'``). + :type encoding: str + :param sys_path: Deprecated, use the project parameter. + :type sys_path: typing.List[str] + :param Environment environment: Provide a predefined :ref:`Environment ` + to work with a specific Python version or virtualenv. + :param Project project: Provide a :class:`.Project` to make sure finding + references works well, because the right folder is searched. There are + also ways to modify the sys path and other things. + """ + def __init__(self, code=None, line=None, column=None, path=None, + encoding=None, sys_path=None, environment=None, + project=None, source=None): + self._orig_path = path + # An empty path (also empty string) should always result in no path. + self.path = os.path.abspath(path) if path else None + + if encoding is None: + encoding = 'utf-8' + else: + warnings.warn( + "Deprecated since version 0.17.0. You should cast to valid " + "unicode yourself, especially if you are not using utf-8.", + DeprecationWarning, + stacklevel=2 + ) + if line is not None: + warnings.warn( + "Providing the line is now done in the functions themselves " + "like `Script(...).complete(line, column)`", + DeprecationWarning, + stacklevel=2 + ) + if column is not None: + warnings.warn( + "Providing the column is now done in the functions themselves " + "like `Script(...).complete(line, column)`", + DeprecationWarning, + stacklevel=2 + ) + if source is not None: + code = source + warnings.warn( + "Use the code keyword argument instead.", + DeprecationWarning, + stacklevel=2 + ) + if code is None: + # TODO add a better warning than the traceback! + with open(path, 'rb') as f: + code = f.read() + + if sys_path is not None and not is_py3: + sys_path = list(map(force_unicode, sys_path)) + + if project is None: + # Load the Python grammar of the current interpreter. + project = get_default_project( + os.path.dirname(self.path) if path else None + ) + # TODO deprecate and remove sys_path from the Script API. + if sys_path is not None: + project._sys_path = sys_path + warnings.warn( + "Deprecated since version 0.17.0. Use the project API instead, " + "which means Script(project=Project(dir, sys_path=sys_path)) instead.", + DeprecationWarning, + stacklevel=2 + ) + + self._inference_state = InferenceState( + project, environment=environment, script_path=self.path + ) + debug.speed('init') + self._module_node, code = self._inference_state.parse_and_get_code( + code=code, + path=self.path, + encoding=encoding, + use_latest_grammar=path and path.endswith('.pyi'), + cache=False, # No disk cache, because the current script often changes. + diff_cache=settings.fast_parser, + cache_path=settings.cache_directory, + ) + debug.speed('parsed') + self._code_lines = parso.split_lines(code, keepends=True) + self._code = code + self._pos = line, column + + cache.clear_time_caches() + debug.reset_time() + + # Cache the module, this is mostly useful for testing, since this shouldn't + # be called multiple times. + @cache.memoize_method + def _get_module(self): + names = None + is_package = False + if self.path is not None: + import_names, is_p = transform_path_to_dotted( + self._inference_state.get_sys_path(add_parent_paths=False), + self.path + ) + if import_names is not None: + names = import_names + is_package = is_p + + if self.path is None: + file_io = None + else: + file_io = KnownContentFileIO(cast_path(self.path), self._code) + if self.path is not None and self.path.endswith('.pyi'): + # We are in a stub file. Try to load the stub properly. + stub_module = load_proper_stub_module( + self._inference_state, + file_io, + names, + self._module_node + ) + if stub_module is not None: + return stub_module + + if names is None: + names = ('__main__',) + + module = ModuleValue( + self._inference_state, self._module_node, + file_io=file_io, + string_names=names, + code_lines=self._code_lines, + is_package=is_package, + ) + if names[0] not in ('builtins', '__builtin__', 'typing'): + # These modules are essential for Jedi, so don't overwrite them. + self._inference_state.module_cache.add(names, ValueSet([module])) + return module + + def _get_module_context(self): + return self._get_module().as_context() + + def __repr__(self): + return '<%s: %s %r>' % ( + self.__class__.__name__, + repr(self._orig_path), + self._inference_state.environment, + ) + + @validate_line_column + def complete(self, line=None, column=None, **kwargs): + """ + Completes objects under the cursor. + + Those objects contain information about the completions, more than just + names. + + :param fuzzy: Default False. Will return fuzzy completions, which means + that e.g. ``ooa`` will match ``foobar``. + :return: Completion objects, sorted by name. Normal names appear + before "private" names that start with ``_`` and those appear + before magic methods and name mangled names that start with ``__``. + :rtype: list of :class:`.Completion` + """ + return self._complete(line, column, **kwargs) + + def _complete(self, line, column, fuzzy=False): # Python 2... + with debug.increase_indent_cm('complete'): + completion = Completion( + self._inference_state, self._get_module_context(), self._code_lines, + (line, column), self.get_signatures, fuzzy=fuzzy, + ) + return completion.complete() + + def completions(self, fuzzy=False): + warnings.warn( + "Deprecated since version 0.16.0. Use Script(...).complete instead.", + DeprecationWarning, + stacklevel=2 + ) + return self.complete(*self._pos, fuzzy=fuzzy) + + @validate_line_column + def infer(self, line=None, column=None, **kwargs): + """ + Return the definitions of under the cursor. It is basically a wrapper + around Jedi's type inference. + + This method follows complicated paths and returns the end, not the + first definition. The big difference between :meth:`goto` and + :meth:`infer` is that :meth:`goto` doesn't + follow imports and statements. Multiple objects may be returned, + because depending on an option you can have two different versions of a + function. + + :param only_stubs: Only return stubs for this method. + :param prefer_stubs: Prefer stubs to Python objects for this method. + :rtype: list of :class:`.Name` + """ + with debug.increase_indent_cm('infer'): + return self._infer(line, column, **kwargs) + + def goto_definitions(self, **kwargs): + warnings.warn( + "Deprecated since version 0.16.0. Use Script(...).infer instead.", + DeprecationWarning, + stacklevel=2 + ) + return self.infer(*self._pos, **kwargs) + + def _infer(self, line, column, only_stubs=False, prefer_stubs=False): + pos = line, column + leaf = self._module_node.get_name_of_position(pos) + if leaf is None: + leaf = self._module_node.get_leaf_for_position(pos) + if leaf is None or leaf.type == 'string': + return [] + + context = self._get_module_context().create_context(leaf) + + values = helpers.infer(self._inference_state, context, leaf) + values = convert_values( + values, + only_stubs=only_stubs, + prefer_stubs=prefer_stubs, + ) + + defs = [classes.Name(self._inference_state, c.name) for c in values] + # The additional set here allows the definitions to become unique in an + # API sense. In the internals we want to separate more things than in + # the API. + return helpers.sorted_definitions(set(defs)) + + def goto_assignments(self, follow_imports=False, follow_builtin_imports=False, **kwargs): + warnings.warn( + "Deprecated since version 0.16.0. Use Script(...).goto instead.", + DeprecationWarning, + stacklevel=2 + ) + return self.goto(*self._pos, + follow_imports=follow_imports, + follow_builtin_imports=follow_builtin_imports, + **kwargs) + + @validate_line_column + def goto(self, line=None, column=None, **kwargs): + """ + Goes to the name that defined the object under the cursor. Optionally + you can follow imports. + Multiple objects may be returned, depending on an if you can have two + different versions of a function. + + :param follow_imports: The method will follow imports. + :param follow_builtin_imports: If ``follow_imports`` is True will try + to look up names in builtins (i.e. compiled or extension modules). + :param only_stubs: Only return stubs for this method. + :param prefer_stubs: Prefer stubs to Python objects for this method. + :rtype: list of :class:`.Name` + """ + with debug.increase_indent_cm('goto'): + return self._goto(line, column, **kwargs) + + def _goto(self, line, column, follow_imports=False, follow_builtin_imports=False, + only_stubs=False, prefer_stubs=False): + tree_name = self._module_node.get_name_of_position((line, column)) + if tree_name is None: + # Without a name we really just want to jump to the result e.g. + # executed by `foo()`, if we the cursor is after `)`. + return self.infer(line, column, only_stubs=only_stubs, prefer_stubs=prefer_stubs) + name = self._get_module_context().create_name(tree_name) + + # Make it possible to goto the super class function/attribute + # definitions, when they are overwritten. + names = [] + if name.tree_name.is_definition() and name.parent_context.is_class(): + class_node = name.parent_context.tree_node + class_value = self._get_module_context().create_value(class_node) + mro = class_value.py__mro__() + next(mro) # Ignore the first entry, because it's the class itself. + for cls in mro: + names = cls.goto(tree_name.value) + if names: + break + + if not names: + names = list(name.goto()) + + if follow_imports: + names = helpers.filter_follow_imports(names, follow_builtin_imports) + names = convert_names( + names, + only_stubs=only_stubs, + prefer_stubs=prefer_stubs, + ) + + defs = [classes.Name(self._inference_state, d) for d in set(names)] + # Avoid duplicates + return list(set(helpers.sorted_definitions(defs))) + + @_no_python2_support + def search(self, string, **kwargs): + """ + Searches a name in the current file. For a description of how the + search string should look like, please have a look at + :meth:`.Project.search`. + + :param bool all_scopes: Default False; searches not only for + definitions on the top level of a module level, but also in + functions and classes. + :yields: :class:`.Name` + """ + return self._search(string, **kwargs) # Python 2 ... + + def _search(self, string, all_scopes=False): + return self._search_func(string, all_scopes=all_scopes) + + @to_list + def _search_func(self, string, all_scopes=False, complete=False, fuzzy=False): + names = self._names(all_scopes=all_scopes) + wanted_type, wanted_names = helpers.split_search_string(string) + return search_in_module( + self._inference_state, + self._get_module_context(), + names=names, + wanted_type=wanted_type, + wanted_names=wanted_names, + complete=complete, + fuzzy=fuzzy, + ) + + def complete_search(self, string, **kwargs): + """ + Like :meth:`.Script.search`, but completes that string. If you want to + have all possible definitions in a file you can also provide an empty + string. + + :param bool all_scopes: Default False; searches not only for + definitions on the top level of a module level, but also in + functions and classes. + :param fuzzy: Default False. Will return fuzzy completions, which means + that e.g. ``ooa`` will match ``foobar``. + :yields: :class:`.Completion` + """ + return self._search_func(string, complete=True, **kwargs) + + @validate_line_column + def help(self, line=None, column=None): + """ + Used to display a help window to users. Uses :meth:`.Script.goto` and + returns additional definitions for keywords and operators. + + Typically you will want to display :meth:`.BaseName.docstring` to the + user for all the returned definitions. + + The additional definitions are ``Name(...).type == 'keyword'``. + These definitions do not have a lot of value apart from their docstring + attribute, which contains the output of Python's :func:`help` function. + + :rtype: list of :class:`.Name` + """ + definitions = self.goto(line, column, follow_imports=True) + if definitions: + return definitions + leaf = self._module_node.get_leaf_for_position((line, column)) + if leaf is not None and leaf.type in ('keyword', 'operator', 'error_leaf'): + def need_pydoc(): + if leaf.value in ('(', ')', '[', ']'): + if leaf.parent.type == 'trailer': + return False + if leaf.parent.type == 'atom': + return False + grammar = self._inference_state.grammar + # This parso stuff is not public, but since I control it, this + # is fine :-) ~dave + reserved = grammar._pgen_grammar.reserved_syntax_strings.keys() + return leaf.value in reserved + + if need_pydoc(): + name = KeywordName(self._inference_state, leaf.value) + return [classes.Name(self._inference_state, name)] + return [] + + def usages(self, **kwargs): + warnings.warn( + "Deprecated since version 0.16.0. Use Script(...).get_references instead.", + DeprecationWarning, + stacklevel=2 + ) + return self.get_references(*self._pos, **kwargs) + + @validate_line_column + def get_references(self, line=None, column=None, **kwargs): + """ + Lists all references of a variable in a project. Since this can be + quite hard to do for Jedi, if it is too complicated, Jedi will stop + searching. + + :param include_builtins: Default ``True``. If ``False``, checks if a reference + is a builtin (e.g. ``sys``) and in that case does not return it. + :param scope: Default ``'project'``. If ``'file'``, include references in + the current module only. + :rtype: list of :class:`.Name` + """ + + def _references(include_builtins=True, scope='project'): + if scope not in ('project', 'file'): + raise ValueError('Only the scopes "file" and "project" are allowed') + tree_name = self._module_node.get_name_of_position((line, column)) + if tree_name is None: + # Must be syntax + return [] + + names = find_references(self._get_module_context(), tree_name, scope == 'file') + + definitions = [classes.Name(self._inference_state, n) for n in names] + if not include_builtins or scope == 'file': + definitions = [d for d in definitions if not d.in_builtin_module()] + return helpers.sorted_definitions(definitions) + return _references(**kwargs) + + def call_signatures(self): + warnings.warn( + "Deprecated since version 0.16.0. Use Script(...).get_signatures instead.", + DeprecationWarning, + stacklevel=2 + ) + return self.get_signatures(*self._pos) + + @validate_line_column + def get_signatures(self, line=None, column=None): + """ + Return the function object of the call under the cursor. + + E.g. if the cursor is here:: + + abs(# <-- cursor is here + + This would return the ``abs`` function. On the other hand:: + + abs()# <-- cursor is here + + This would return an empty list.. + + :rtype: list of :class:`.Signature` + """ + pos = line, column + call_details = helpers.get_signature_details(self._module_node, pos) + if call_details is None: + return [] + + context = self._get_module_context().create_context(call_details.bracket_leaf) + definitions = helpers.cache_signatures( + self._inference_state, + context, + call_details.bracket_leaf, + self._code_lines, + pos + ) + debug.speed('func_call followed') + + # TODO here we use stubs instead of the actual values. We should use + # the signatures from stubs, but the actual values, probably?! + return [classes.Signature(self._inference_state, signature, call_details) + for signature in definitions.get_signatures()] + + @validate_line_column + def get_context(self, line=None, column=None): + """ + Returns the scope context under the cursor. This basically means the + function, class or module where the cursor is at. + + :rtype: :class:`.Name` + """ + pos = (line, column) + leaf = self._module_node.get_leaf_for_position(pos, include_prefixes=True) + if leaf.start_pos > pos or leaf.type == 'endmarker': + previous_leaf = leaf.get_previous_leaf() + if previous_leaf is not None: + leaf = previous_leaf + + module_context = self._get_module_context() + + n = tree.search_ancestor(leaf, 'funcdef', 'classdef') + if n is not None and n.start_pos < pos <= n.children[-1].start_pos: + # This is a bit of a special case. The context of a function/class + # name/param/keyword is always it's parent context, not the + # function itself. Catch all the cases here where we are before the + # suite object, but still in the function. + context = module_context.create_value(n).as_context() + else: + context = module_context.create_context(leaf) + + while context.name is None: + context = context.parent_context # comprehensions + + definition = classes.Name(self._inference_state, context.name) + while definition.type != 'module': + name = definition._name # TODO private access + tree_name = name.tree_name + if tree_name is not None: # Happens with lambdas. + scope = tree_name.get_definition() + if scope.start_pos[1] < column: + break + definition = definition.parent() + return definition + + def _analysis(self): + self._inference_state.is_analysis = True + self._inference_state.analysis_modules = [self._module_node] + module = self._get_module_context() + try: + for node in get_executable_nodes(self._module_node): + context = module.create_context(node) + if node.type in ('funcdef', 'classdef'): + # Resolve the decorators. + tree_name_to_values(self._inference_state, context, node.children[1]) + elif isinstance(node, tree.Import): + import_names = set(node.get_defined_names()) + if node.is_nested(): + import_names |= set(path[-1] for path in node.get_paths()) + for n in import_names: + imports.infer_import(context, n) + elif node.type == 'expr_stmt': + types = context.infer_node(node) + for testlist in node.children[:-1:2]: + # Iterate tuples. + unpack_tuple_to_dict(context, types, testlist) + else: + if node.type == 'name': + defs = self._inference_state.infer(context, node) + else: + defs = infer_call_of_leaf(context, node) + try_iter_content(defs) + self._inference_state.reset_recursion_limitations() + + ana = [a for a in self._inference_state.analysis if self.path == a.path] + return sorted(set(ana), key=lambda x: x.line) + finally: + self._inference_state.is_analysis = False + + def get_names(self, **kwargs): + """ + Returns names defined in the current file. + + :param all_scopes: If True lists the names of all scopes instead of + only the module namespace. + :param definitions: If True lists the names that have been defined by a + class, function or a statement (``a = b`` returns ``a``). + :param references: If True lists all the names that are not listed by + ``definitions=True``. E.g. ``a = b`` returns ``b``. + :rtype: list of :class:`.Name` + """ + names = self._names(**kwargs) + return [classes.Name(self._inference_state, n) for n in names] + + def get_syntax_errors(self): + """ + Lists all syntax errors in the current file. + + :rtype: list of :class:`.SyntaxError` + """ + return parso_to_jedi_errors(self._inference_state.grammar, self._module_node) + + def _names(self, all_scopes=False, definitions=True, references=False): + # Set line/column to a random position, because they don't matter. + module_context = self._get_module_context() + defs = [ + module_context.create_name(name) + for name in helpers.get_module_names( + self._module_node, + all_scopes=all_scopes, + definitions=definitions, + references=references, + ) + ] + return sorted(defs, key=lambda x: x.start_pos) + + @_no_python2_support + def rename(self, line=None, column=None, **kwargs): + """ + Renames all references of the variable under the cursor. + + :param new_name: The variable under the cursor will be renamed to this + string. + :raises: :exc:`.RefactoringError` + :rtype: :class:`.Refactoring` + """ + return self._rename(line, column, **kwargs) + + def _rename(self, line, column, new_name): # Python 2... + definitions = self.get_references(line, column, include_builtins=False) + return refactoring.rename(self._inference_state, definitions, new_name) + + @_no_python2_support + def extract_variable(self, line, column, **kwargs): + """ + Moves an expression to a new statemenet. + + For example if you have the cursor on ``foo`` and provide a + ``new_name`` called ``bar``:: + + foo = 3.1 + x = int(foo + 1) + + the code above will become:: + + foo = 3.1 + bar = foo + 1 + x = int(bar) + + :param new_name: The expression under the cursor will be renamed to + this string. + :param int until_line: The the selection range ends at this line, when + omitted, Jedi will be clever and try to define the range itself. + :param int until_column: The the selection range ends at this column, when + omitted, Jedi will be clever and try to define the range itself. + :raises: :exc:`.RefactoringError` + :rtype: :class:`.Refactoring` + """ + return self._extract_variable(line, column, **kwargs) # Python 2... + + @validate_line_column + def _extract_variable(self, line, column, new_name, until_line=None, until_column=None): + if until_line is None and until_column is None: + until_pos = None + else: + if until_line is None: + until_line = line + if until_column is None: + until_column = len(self._code_lines[until_line - 1]) + until_pos = until_line, until_column + return extract_variable( + self._inference_state, self.path, self._module_node, + new_name, (line, column), until_pos + ) + + @_no_python2_support + def extract_function(self, line, column, **kwargs): + """ + Moves an expression to a new function. + + For example if you have the cursor on ``foo`` and provide a + ``new_name`` called ``bar``:: + + global_var = 3 + + def x(): + foo = 3.1 + x = int(foo + 1 + global_var) + + the code above will become:: + + global_var = 3 + + def bar(foo): + return int(foo + 1 + global_var) + + def x(): + foo = 3.1 + x = bar(foo) + + :param new_name: The expression under the cursor will be replaced with + a function with this name. + :param int until_line: The the selection range ends at this line, when + omitted, Jedi will be clever and try to define the range itself. + :param int until_column: The the selection range ends at this column, when + omitted, Jedi will be clever and try to define the range itself. + :raises: :exc:`.RefactoringError` + :rtype: :class:`.Refactoring` + """ + return self._extract_function(line, column, **kwargs) # Python 2... + + @validate_line_column + def _extract_function(self, line, column, new_name, until_line=None, until_column=None): + if until_line is None and until_column is None: + until_pos = None + else: + if until_line is None: + until_line = line + if until_column is None: + until_column = len(self._code_lines[until_line - 1]) + until_pos = until_line, until_column + return extract_function( + self._inference_state, self.path, self._get_module_context(), + new_name, (line, column), until_pos + ) + + @_no_python2_support + def inline(self, line=None, column=None): + """ + Inlines a variable under the cursor. This is basically the opposite of + extracting a variable. For example with the cursor on bar:: + + foo = 3.1 + bar = foo + 1 + x = int(bar) + + the code above will become:: + + foo = 3.1 + x = int(foo + 1) + + :raises: :exc:`.RefactoringError` + :rtype: :class:`.Refactoring` + """ + names = [d._name for d in self.get_references(line, column, include_builtins=True)] + return refactoring.inline(self._inference_state, names) + + +class Interpreter(Script): + """ + Jedi's API for Python REPLs. + + Implements all of the methods that are present in :class:`.Script` as well. + + In addition to completions that normal REPL completion does like + ``str.upper``, Jedi also supports code completion based on static code + analysis. For example Jedi will complete ``str().upper``. + + >>> from os.path import join + >>> namespace = locals() + >>> script = Interpreter('join("").up', [namespace]) + >>> print(script.complete()[0].name) + upper + + All keyword arguments are same as the arguments for :class:`.Script`. + + :param str code: Code to parse. + :type namespaces: typing.List[dict] + :param namespaces: A list of namespace dictionaries such as the one + returned by :func:`globals` and :func:`locals`. + """ + _allow_descriptor_getattr_default = True + + def __init__(self, code, namespaces, **kwds): + try: + namespaces = [dict(n) for n in namespaces] + except Exception: + raise TypeError("namespaces must be a non-empty list of dicts.") + + environment = kwds.get('environment', None) + if environment is None: + environment = InterpreterEnvironment() + else: + if not isinstance(environment, InterpreterEnvironment): + raise TypeError("The environment needs to be an InterpreterEnvironment subclass.") + + super(Interpreter, self).__init__(code, environment=environment, + project=Project(os.getcwd()), **kwds) + self.namespaces = namespaces + self._inference_state.allow_descriptor_getattr = self._allow_descriptor_getattr_default + + @cache.memoize_method + def _get_module_context(self): + tree_module_value = ModuleValue( + self._inference_state, self._module_node, + file_io=KnownContentFileIO(self.path, self._code), + string_names=('__main__',), + code_lines=self._code_lines, + ) + return interpreter.MixedModuleContext( + tree_module_value, + self.namespaces, + ) + + +def names(source=None, path=None, encoding='utf-8', all_scopes=False, + definitions=True, references=False, environment=None): + warnings.warn( + "Deprecated since version 0.16.0. Use Script(...).get_names instead.", + DeprecationWarning, + stacklevel=2 + ) + + return Script(source, path=path, encoding=encoding).get_names( + all_scopes=all_scopes, + definitions=definitions, + references=references, + ) + + +def preload_module(*modules): + """ + Preloading modules tells Jedi to load a module now, instead of lazy parsing + of modules. This can be useful for IDEs, to control which modules to load + on startup. + + :param modules: different module names, list of string. + """ + for m in modules: + s = "import %s as x; x." % m + Script(s, path=None).complete(1, len(s)) + + +def set_debug_function(func_cb=debug.print_to_stdout, warnings=True, + notices=True, speed=True): + """ + Define a callback debug function to get all the debug messages. + + If you don't specify any arguments, debug messages will be printed to stdout. + + :param func_cb: The callback function for debug messages. + """ + debug.debug_function = func_cb + debug.enable_warning = warnings + debug.enable_notice = notices + debug.enable_speed = speed diff --git a/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..7f3c8dc5 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/classes.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/classes.cpython-38.pyc new file mode 100644 index 00000000..e6c1ef97 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/classes.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/completion.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/completion.cpython-38.pyc new file mode 100644 index 00000000..9f9f7d36 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/completion.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/completion_cache.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/completion_cache.cpython-38.pyc new file mode 100644 index 00000000..bb0c0d21 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/completion_cache.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/environment.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/environment.cpython-38.pyc new file mode 100644 index 00000000..ea7c420e Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/environment.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/errors.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/errors.cpython-38.pyc new file mode 100644 index 00000000..dd542bac Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/errors.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/exceptions.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/exceptions.cpython-38.pyc new file mode 100644 index 00000000..fcb0a544 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/exceptions.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/file_name.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/file_name.cpython-38.pyc new file mode 100644 index 00000000..70fcb617 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/file_name.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/helpers.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/helpers.cpython-38.pyc new file mode 100644 index 00000000..774a9e67 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/helpers.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/interpreter.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/interpreter.cpython-38.pyc new file mode 100644 index 00000000..1a36c7c0 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/interpreter.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/keywords.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/keywords.cpython-38.pyc new file mode 100644 index 00000000..fe3165ec Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/keywords.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/project.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/project.cpython-38.pyc new file mode 100644 index 00000000..51ec992a Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/project.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/replstartup.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/replstartup.cpython-38.pyc new file mode 100644 index 00000000..725fadc6 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/replstartup.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/strings.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/strings.cpython-38.pyc new file mode 100644 index 00000000..10a6b2ca Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/api/__pycache__/strings.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/api/classes.py b/.venv/lib/python3.8/site-packages/jedi/api/classes.py new file mode 100644 index 00000000..4e0d2635 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/api/classes.py @@ -0,0 +1,925 @@ +""" +There are a couple of classes documented in here: + +- :class:`.BaseName` as an abstact base class for almost everything. +- :class:`.Name` used in a lot of places +- :class:`.Completion` for completions +- :class:`.BaseSignature` as a base class for signatures +- :class:`.Signature` for :meth:`.Script.get_signatures` only +- :class:`.ParamName` used for parameters of signatures +- :class:`.Refactoring` for refactorings +- :class:`.SyntaxError` for :meth:`.Script.get_syntax_errors` only + +These classes are the much biggest part of the API, because they contain +the interesting information about all operations. +""" +import re +import sys +import warnings + +from parso.python.tree import search_ancestor + +from jedi import settings +from jedi import debug +from jedi.inference.utils import unite +from jedi.cache import memoize_method +from jedi.inference import imports +from jedi.inference.imports import ImportName +from jedi.inference.compiled.mixed import MixedName +from jedi.inference.gradual.typeshed import StubModuleValue +from jedi.inference.gradual.conversion import convert_names, convert_values +from jedi.inference.base_value import ValueSet +from jedi.api.keywords import KeywordName +from jedi.api import completion_cache +from jedi.api.helpers import filter_follow_imports + + +def _sort_names_by_start_pos(names): + return sorted(names, key=lambda s: s.start_pos or (0, 0)) + + +def defined_names(inference_state, context): + """ + List sub-definitions (e.g., methods in class). + + :type scope: Scope + :rtype: list of Name + """ + filter = next(context.get_filters()) + names = [name for name in filter.values()] + return [Name(inference_state, n) for n in _sort_names_by_start_pos(names)] + + +def _values_to_definitions(values): + return [Name(c.inference_state, c.name) for c in values] + + +class BaseName(object): + """ + The base class for all definitions, completions and signatures. + """ + _mapping = { + 'posixpath': 'os.path', + 'riscospath': 'os.path', + 'ntpath': 'os.path', + 'os2emxpath': 'os.path', + 'macpath': 'os.path', + 'genericpath': 'os.path', + 'posix': 'os', + '_io': 'io', + '_functools': 'functools', + '_collections': 'collections', + '_socket': 'socket', + '_sqlite3': 'sqlite3', + '__builtin__': 'builtins', + } + + _tuple_mapping = dict((tuple(k.split('.')), v) for (k, v) in { + 'argparse._ActionsContainer': 'argparse.ArgumentParser', + }.items()) + + def __init__(self, inference_state, name): + self._inference_state = inference_state + self._name = name + """ + An instance of :class:`parso.python.tree.Name` subclass. + """ + self.is_keyword = isinstance(self._name, KeywordName) + + @memoize_method + def _get_module_context(self): + # This can take a while to complete, because in the worst case of + # imports (consider `import a` completions), we need to load all + # modules starting with a first. + return self._name.get_root_context() + + @property + def module_path(self): + """ + Shows the file path of a module. e.g. ``/usr/lib/python2.7/os.py`` + + :rtype: str or None + """ + module = self._get_module_context() + if module.is_stub() or not module.is_compiled(): + # Compiled modules should not return a module path even if they + # have one. + return self._get_module_context().py__file__() + + return None + + @property + def name(self): + """ + Name of variable/function/class/module. + + For example, for ``x = None`` it returns ``'x'``. + + :rtype: str or None + """ + return self._name.get_public_name() + + @property + def type(self): + """ + The type of the definition. + + Here is an example of the value of this attribute. Let's consider + the following source. As what is in ``variable`` is unambiguous + to Jedi, :meth:`jedi.Script.infer` should return a list of + definition for ``sys``, ``f``, ``C`` and ``x``. + + >>> from jedi._compatibility import no_unicode_pprint + >>> from jedi import Script + >>> source = ''' + ... import keyword + ... + ... class C: + ... pass + ... + ... class D: + ... pass + ... + ... x = D() + ... + ... def f(): + ... pass + ... + ... for variable in [keyword, f, C, x]: + ... variable''' + + >>> script = Script(source) + >>> defs = script.infer() + + Before showing what is in ``defs``, let's sort it by :attr:`line` + so that it is easy to relate the result to the source code. + + >>> defs = sorted(defs, key=lambda d: d.line) + >>> no_unicode_pprint(defs) # doctest: +NORMALIZE_WHITESPACE + [, + , + , + ] + + Finally, here is what you can get from :attr:`type`: + + >>> defs = [str(d.type) for d in defs] # It's unicode and in Py2 has u before it. + >>> defs[0] + 'module' + >>> defs[1] + 'class' + >>> defs[2] + 'instance' + >>> defs[3] + 'function' + + Valid values for type are ``module``, ``class``, ``instance``, ``function``, + ``param``, ``path``, ``keyword`` and ``statement``. + + """ + tree_name = self._name.tree_name + resolve = False + if tree_name is not None: + # TODO move this to their respective names. + definition = tree_name.get_definition() + if definition is not None and definition.type == 'import_from' and \ + tree_name.is_definition(): + resolve = True + + if isinstance(self._name, imports.SubModuleName) or resolve: + for value in self._name.infer(): + return value.api_type + return self._name.api_type + + @property + def module_name(self): + """ + The module name, a bit similar to what ``__name__`` is in a random + Python module. + + >>> from jedi import Script + >>> source = 'import json' + >>> script = Script(source, path='example.py') + >>> d = script.infer()[0] + >>> print(d.module_name) # doctest: +ELLIPSIS + json + """ + return self._get_module_context().py__name__() + + def in_builtin_module(self): + """ + Returns True, if this is a builtin module. + """ + value = self._get_module_context().get_value() + if isinstance(value, StubModuleValue): + return any(v.is_compiled() for v in value.non_stub_value_set) + return value.is_compiled() + + @property + def line(self): + """The line where the definition occurs (starting with 1).""" + start_pos = self._name.start_pos + if start_pos is None: + return None + return start_pos[0] + + @property + def column(self): + """The column where the definition occurs (starting with 0).""" + start_pos = self._name.start_pos + if start_pos is None: + return None + return start_pos[1] + + def get_definition_start_position(self): + """ + The (row, column) of the start of the definition range. Rows start with + 1, columns start with 0. + + :rtype: Optional[Tuple[int, int]] + """ + if self._name.tree_name is None: + return None + definition = self._name.tree_name.get_definition() + if definition is None: + return self._name.start_pos + return definition.start_pos + + def get_definition_end_position(self): + """ + The (row, column) of the end of the definition range. Rows start with + 1, columns start with 0. + + :rtype: Optional[Tuple[int, int]] + """ + if self._name.tree_name is None: + return None + definition = self._name.tree_name.get_definition() + if definition is None: + return self._name.tree_name.end_pos + if self.type in ("function", "class"): + last_leaf = definition.get_last_leaf() + if last_leaf.type == "newline": + return last_leaf.get_previous_leaf().end_pos + return last_leaf.end_pos + return definition.end_pos + + def docstring(self, raw=False, fast=True): + r""" + Return a document string for this completion object. + + Example: + + >>> from jedi import Script + >>> source = '''\ + ... def f(a, b=1): + ... "Document for function f." + ... ''' + >>> script = Script(source, path='example.py') + >>> doc = script.infer(1, len('def f'))[0].docstring() + >>> print(doc) + f(a, b=1) + + Document for function f. + + Notice that useful extra information is added to the actual + docstring, e.g. function signatures are prepended to their docstrings. + If you need the actual docstring, use ``raw=True`` instead. + + >>> print(script.infer(1, len('def f'))[0].docstring(raw=True)) + Document for function f. + + :param fast: Don't follow imports that are only one level deep like + ``import foo``, but follow ``from foo import bar``. This makes + sense for speed reasons. Completing `import a` is slow if you use + the ``foo.docstring(fast=False)`` on every object, because it + parses all libraries starting with ``a``. + """ + if isinstance(self._name, ImportName) and fast: + return '' + doc = self._get_docstring() + if raw: + return doc + + signature_text = self._get_docstring_signature() + if signature_text and doc: + return signature_text + '\n\n' + doc + else: + return signature_text + doc + + def _get_docstring(self): + return self._name.py__doc__() + + def _get_docstring_signature(self): + return '\n'.join( + signature.to_string() + for signature in self._get_signatures(for_docstring=True) + ) + + @property + def description(self): + """ + A description of the :class:`.Name` object, which is heavily used + in testing. e.g. for ``isinstance`` it returns ``def isinstance``. + + Example: + + >>> from jedi._compatibility import no_unicode_pprint + >>> from jedi import Script + >>> source = ''' + ... def f(): + ... pass + ... + ... class C: + ... pass + ... + ... variable = f if random.choice([0,1]) else C''' + >>> script = Script(source) # line is maximum by default + >>> defs = script.infer(column=3) + >>> defs = sorted(defs, key=lambda d: d.line) + >>> no_unicode_pprint(defs) # doctest: +NORMALIZE_WHITESPACE + [, + ] + >>> str(defs[0].description) # strip literals in python2 + 'def f' + >>> str(defs[1].description) + 'class C' + + """ + typ = self.type + tree_name = self._name.tree_name + if typ == 'param': + return typ + ' ' + self._name.to_string() + if typ in ('function', 'class', 'module', 'instance') or tree_name is None: + if typ == 'function': + # For the description we want a short and a pythonic way. + typ = 'def' + return typ + ' ' + self._name.get_public_name() + + definition = tree_name.get_definition(include_setitem=True) or tree_name + # Remove the prefix, because that's not what we want for get_code + # here. + txt = definition.get_code(include_prefix=False) + # Delete comments: + txt = re.sub(r'#[^\n]+\n', ' ', txt) + # Delete multi spaces/newlines + txt = re.sub(r'\s+', ' ', txt).strip() + return txt + + @property + def full_name(self): + """ + Dot-separated path of this object. + + It is in the form of ``[.[...]][.]``. + It is useful when you want to look up Python manual of the + object at hand. + + Example: + + >>> from jedi import Script + >>> source = ''' + ... import os + ... os.path.join''' + >>> script = Script(source, path='example.py') + >>> print(script.infer(3, len('os.path.join'))[0].full_name) + os.path.join + + Notice that it returns ``'os.path.join'`` instead of (for example) + ``'posixpath.join'``. This is not correct, since the modules name would + be `````. However most users find the latter + more practical. + """ + if not self._name.is_value_name: + return None + + names = self._name.get_qualified_names(include_module_names=True) + if names is None: + return None + + names = list(names) + try: + names[0] = self._mapping[names[0]] + except KeyError: + pass + + return '.'.join(names) + + def is_stub(self): + """ + Returns True if the current name is defined in a stub file. + """ + if not self._name.is_value_name: + return False + + return self._name.get_root_context().is_stub() + + def is_side_effect(self): + """ + Checks if a name is defined as ``self.foo = 3``. In case of self, this + function would return False, for foo it would return True. + """ + tree_name = self._name.tree_name + if tree_name is None: + return False + return tree_name.is_definition() and tree_name.parent.type == 'trailer' + + def goto(self, **kwargs): + """ + Like :meth:`.Script.goto` (also supports the same params), but does it + for the current name. This is typically useful if you are using + something like :meth:`.Script.get_names()`. + + :param follow_imports: The goto call will follow imports. + :param follow_builtin_imports: If follow_imports is True will try to + look up names in builtins (i.e. compiled or extension modules). + :param only_stubs: Only return stubs for this goto call. + :param prefer_stubs: Prefer stubs to Python objects for this goto call. + :rtype: list of :class:`Name` + """ + with debug.increase_indent_cm('goto for %s' % self._name): + return self._goto(**kwargs) + + def goto_assignments(self, **kwargs): # Python 2... + warnings.warn( + "Deprecated since version 0.16.0. Use .goto.", + DeprecationWarning, + stacklevel=2 + ) + return self.goto(**kwargs) + + def _goto(self, follow_imports=False, follow_builtin_imports=False, + only_stubs=False, prefer_stubs=False): + + if not self._name.is_value_name: + return [] + + names = self._name.goto() + if follow_imports: + names = filter_follow_imports(names, follow_builtin_imports) + names = convert_names( + names, + only_stubs=only_stubs, + prefer_stubs=prefer_stubs, + ) + return [self if n == self._name else Name(self._inference_state, n) + for n in names] + + def infer(self, **kwargs): # Python 2... + """ + Like :meth:`.Script.infer`, it can be useful to understand which type + the current name has. + + Return the actual definitions. I strongly recommend not using it for + your completions, because it might slow down |jedi|. If you want to + read only a few objects (<=20), it might be useful, especially to get + the original docstrings. The basic problem of this function is that it + follows all results. This means with 1000 completions (e.g. numpy), + it's just very, very slow. + + :param only_stubs: Only return stubs for this goto call. + :param prefer_stubs: Prefer stubs to Python objects for this type + inference call. + :rtype: list of :class:`Name` + """ + with debug.increase_indent_cm('infer for %s' % self._name): + return self._infer(**kwargs) + + def _infer(self, only_stubs=False, prefer_stubs=False): + assert not (only_stubs and prefer_stubs) + + if not self._name.is_value_name: + return [] + + # First we need to make sure that we have stub names (if possible) that + # we can follow. If we don't do that, we can end up with the inferred + # results of Python objects instead of stubs. + names = convert_names([self._name], prefer_stubs=True) + values = convert_values( + ValueSet.from_sets(n.infer() for n in names), + only_stubs=only_stubs, + prefer_stubs=prefer_stubs, + ) + resulting_names = [c.name for c in values] + return [self if n == self._name else Name(self._inference_state, n) + for n in resulting_names] + + @property + @memoize_method + def params(self): + warnings.warn( + "Deprecated since version 0.16.0. Use get_signatures()[...].params", + DeprecationWarning, + stacklevel=2 + ) + # Only return the first one. There might be multiple one, especially + # with overloading. + for signature in self._get_signatures(): + return [ + Name(self._inference_state, n) + for n in signature.get_param_names(resolve_stars=True) + ] + + if self.type == 'function' or self.type == 'class': + # Fallback, if no signatures were defined (which is probably by + # itself a bug). + return [] + raise AttributeError('There are no params defined on this.') + + def parent(self): + """ + Returns the parent scope of this identifier. + + :rtype: Name + """ + if not self._name.is_value_name: + return None + + if self.type in ('function', 'class', 'param') and self._name.tree_name is not None: + # Since the parent_context doesn't really match what the user + # thinks of that the parent is here, we do these cases separately. + # The reason for this is the following: + # - class: Nested classes parent_context is always the + # parent_context of the most outer one. + # - function: Functions in classes have the module as + # parent_context. + # - param: The parent_context of a param is not its function but + # e.g. the outer class or module. + cls_or_func_node = self._name.tree_name.get_definition() + parent = search_ancestor(cls_or_func_node, 'funcdef', 'classdef', 'file_input') + context = self._get_module_context().create_value(parent).as_context() + else: + context = self._name.parent_context + + if context is None: + return None + while context.name is None: + # Happens for comprehension contexts + context = context.parent_context + + return Name(self._inference_state, context.name) + + def __repr__(self): + return "<%s %sname=%r, description=%r>" % ( + self.__class__.__name__, + 'full_' if self.full_name else '', + self.full_name or self.name, + self.description, + ) + + def get_line_code(self, before=0, after=0): + """ + Returns the line of code where this object was defined. + + :param before: Add n lines before the current line to the output. + :param after: Add n lines after the current line to the output. + + :return str: Returns the line(s) of code or an empty string if it's a + builtin. + """ + if not self._name.is_value_name: + return '' + + lines = self._name.get_root_context().code_lines + if lines is None: + # Probably a builtin module, just ignore in that case. + return '' + + index = self._name.start_pos[0] - 1 + start_index = max(index - before, 0) + return ''.join(lines[start_index:index + after + 1]) + + def _get_signatures(self, for_docstring=False): + if for_docstring and self._name.api_type == 'statement' and not self.is_stub(): + # For docstrings we don't resolve signatures if they are simple + # statements and not stubs. This is a speed optimization. + return [] + + if isinstance(self._name, MixedName): + # While this would eventually happen anyway, it's basically just a + # shortcut to not infer anything tree related, because it's really + # not necessary. + return self._name.infer_compiled_value().get_signatures() + + names = convert_names([self._name], prefer_stubs=True) + return [sig for name in names for sig in name.infer().get_signatures()] + + def get_signatures(self): + """ + Returns all potential signatures for a function or a class. Multiple + signatures are typical if you use Python stubs with ``@overload``. + + :rtype: list of :class:`BaseSignature` + """ + return [ + BaseSignature(self._inference_state, s) + for s in self._get_signatures() + ] + + def execute(self): + """ + Uses type inference to "execute" this identifier and returns the + executed objects. + + :rtype: list of :class:`Name` + """ + return _values_to_definitions(self._name.infer().execute_with_values()) + + def get_type_hint(self): + """ + Returns type hints like ``Iterable[int]`` or ``Union[int, str]``. + + This method might be quite slow, especially for functions. The problem + is finding executions for those functions to return something like + ``Callable[[int, str], str]``. + + :rtype: str + """ + return self._name.infer().get_type_hint() + + +class Completion(BaseName): + """ + ``Completion`` objects are returned from :meth:`.Script.complete`. They + provide additional information about a completion. + """ + def __init__(self, inference_state, name, stack, like_name_length, + is_fuzzy, cached_name=None): + super(Completion, self).__init__(inference_state, name) + + self._like_name_length = like_name_length + self._stack = stack + self._is_fuzzy = is_fuzzy + self._cached_name = cached_name + + # Completion objects with the same Completion name (which means + # duplicate items in the completion) + self._same_name_completions = [] + + def _complete(self, like_name): + append = '' + if settings.add_bracket_after_function \ + and self.type == 'function': + append = '(' + + name = self._name.get_public_name() + if like_name: + name = name[self._like_name_length:] + return name + append + + @property + def complete(self): + """ + Only works with non-fuzzy completions. Returns None if fuzzy + completions are used. + + Return the rest of the word, e.g. completing ``isinstance``:: + + isinstan# <-- Cursor is here + + would return the string 'ce'. It also adds additional stuff, depending + on your ``settings.py``. + + Assuming the following function definition:: + + def foo(param=0): + pass + + completing ``foo(par`` would give a ``Completion`` which ``complete`` + would be ``am=``. + """ + if self._is_fuzzy: + return None + return self._complete(True) + + @property + def name_with_symbols(self): + """ + Similar to :attr:`.name`, but like :attr:`.name` returns also the + symbols, for example assuming the following function definition:: + + def foo(param=0): + pass + + completing ``foo(`` would give a ``Completion`` which + ``name_with_symbols`` would be "param=". + + """ + return self._complete(False) + + def docstring(self, raw=False, fast=True): + """ + Documented under :meth:`BaseName.docstring`. + """ + if self._like_name_length >= 3: + # In this case we can just resolve the like name, because we + # wouldn't load like > 100 Python modules anymore. + fast = False + + return super(Completion, self).docstring(raw=raw, fast=fast) + + def _get_docstring(self): + if self._cached_name is not None: + return completion_cache.get_docstring( + self._cached_name, + self._name.get_public_name(), + lambda: self._get_cache() + ) + return super(Completion, self)._get_docstring() + + def _get_docstring_signature(self): + if self._cached_name is not None: + return completion_cache.get_docstring_signature( + self._cached_name, + self._name.get_public_name(), + lambda: self._get_cache() + ) + return super(Completion, self)._get_docstring_signature() + + def _get_cache(self): + return ( + super(Completion, self).type, + super(Completion, self)._get_docstring_signature(), + super(Completion, self)._get_docstring(), + ) + + @property + def type(self): + """ + Documented under :meth:`BaseName.type`. + """ + # Purely a speed optimization. + if self._cached_name is not None: + return completion_cache.get_type( + self._cached_name, + self._name.get_public_name(), + lambda: self._get_cache() + ) + + return super(Completion, self).type + + def __repr__(self): + return '<%s: %s>' % (type(self).__name__, self._name.get_public_name()) + + +class Name(BaseName): + """ + *Name* objects are returned from many different APIs including + :meth:`.Script.goto` or :meth:`.Script.infer`. + """ + def __init__(self, inference_state, definition): + super(Name, self).__init__(inference_state, definition) + + @property + def desc_with_module(self): + warnings.warn( + "Deprecated since version 0.17.0. No replacement for now, maybe .full_name helps", + DeprecationWarning, + stacklevel=2 + ) + return "%s:%s" % (self.module_name, self.description) + + @memoize_method + def defined_names(self): + """ + List sub-definitions (e.g., methods in class). + + :rtype: list of :class:`Name` + """ + defs = self._name.infer() + return sorted( + unite(defined_names(self._inference_state, d.as_context()) for d in defs), + key=lambda s: s._name.start_pos or (0, 0) + ) + + def is_definition(self): + """ + Returns True, if defined as a name in a statement, function or class. + Returns False, if it's a reference to such a definition. + """ + if self._name.tree_name is None: + return True + else: + return self._name.tree_name.is_definition() + + def __eq__(self, other): + return self._name.start_pos == other._name.start_pos \ + and self.module_path == other.module_path \ + and self.name == other.name \ + and self._inference_state == other._inference_state + + def __ne__(self, other): + return not self.__eq__(other) + + def __hash__(self): + return hash((self._name.start_pos, self.module_path, self.name, self._inference_state)) + + +class BaseSignature(Name): + """ + These signatures are returned by :meth:`BaseName.get_signatures` + calls. + """ + def __init__(self, inference_state, signature): + super(BaseSignature, self).__init__(inference_state, signature.name) + self._signature = signature + + @property + def params(self): + """ + Returns definitions for all parameters that a signature defines. + This includes stuff like ``*args`` and ``**kwargs``. + + :rtype: list of :class:`.ParamName` + """ + return [ParamName(self._inference_state, n) + for n in self._signature.get_param_names(resolve_stars=True)] + + def to_string(self): + """ + Returns a text representation of the signature. This could for example + look like ``foo(bar, baz: int, **kwargs)``. + + :rtype: str + """ + return self._signature.to_string() + + +class Signature(BaseSignature): + """ + A full signature object is the return value of + :meth:`.Script.get_signatures`. + """ + def __init__(self, inference_state, signature, call_details): + super(Signature, self).__init__(inference_state, signature) + self._call_details = call_details + self._signature = signature + + @property + def index(self): + """ + Returns the param index of the current cursor position. + Returns None if the index cannot be found in the curent call. + + :rtype: int + """ + return self._call_details.calculate_index( + self._signature.get_param_names(resolve_stars=True) + ) + + @property + def bracket_start(self): + """ + Returns a line/column tuple of the bracket that is responsible for the + last function call. The first line is 1 and the first column 0. + + :rtype: int, int + """ + return self._call_details.bracket_leaf.start_pos + + def __repr__(self): + return '<%s: index=%r %s>' % ( + type(self).__name__, + self.index, + self._signature.to_string(), + ) + + +class ParamName(Name): + def infer_default(self): + """ + Returns default values like the ``1`` of ``def foo(x=1):``. + + :rtype: list of :class:`.Name` + """ + return _values_to_definitions(self._name.infer_default()) + + def infer_annotation(self, **kwargs): + """ + :param execute_annotation: Default True; If False, values are not + executed and classes are returned instead of instances. + :rtype: list of :class:`.Name` + """ + return _values_to_definitions(self._name.infer_annotation(ignore_stars=True, **kwargs)) + + def to_string(self): + """ + Returns a simple representation of a param, like + ``f: Callable[..., Any]``. + + :rtype: str + """ + return self._name.to_string() + + @property + def kind(self): + """ + Returns an enum instance of :mod:`inspect`'s ``Parameter`` enum. + + :rtype: :py:attr:`inspect.Parameter.kind` + """ + if sys.version_info < (3, 5): + raise NotImplementedError( + 'Python 2 is end-of-life, the new feature is not available for it' + ) + return self._name.get_kind() diff --git a/.venv/lib/python3.8/site-packages/jedi/api/completion.py b/.venv/lib/python3.8/site-packages/jedi/api/completion.py new file mode 100644 index 00000000..90b03541 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/api/completion.py @@ -0,0 +1,665 @@ +import re +from textwrap import dedent + +from parso.python.token import PythonTokenTypes +from parso.python import tree +from parso.tree import search_ancestor, Leaf +from parso import split_lines + +from jedi._compatibility import Parameter +from jedi import debug +from jedi import settings +from jedi.api import classes +from jedi.api import helpers +from jedi.api import keywords +from jedi.api.strings import complete_dict +from jedi.api.file_name import complete_file_name +from jedi.inference import imports +from jedi.inference.base_value import ValueSet +from jedi.inference.helpers import infer_call_of_leaf, parse_dotted_names +from jedi.inference.context import get_global_filters +from jedi.inference.value import TreeInstance, ModuleValue +from jedi.inference.names import ParamNameWrapper, SubModuleName +from jedi.inference.gradual.conversion import convert_values, convert_names +from jedi.parser_utils import cut_value_at_position +from jedi.plugins import plugin_manager + + +class ParamNameWithEquals(ParamNameWrapper): + def get_public_name(self): + return self.string_name + '=' + + +def _get_signature_param_names(signatures, positional_count, used_kwargs): + # Add named params + for call_sig in signatures: + for i, p in enumerate(call_sig.params): + # Allow protected access, because it's a public API. + # TODO reconsider with Python 2 drop + kind = p._name.get_kind() + if i < positional_count and kind == Parameter.POSITIONAL_OR_KEYWORD: + continue + if kind in (Parameter.POSITIONAL_OR_KEYWORD, Parameter.KEYWORD_ONLY) \ + and p.name not in used_kwargs: + yield ParamNameWithEquals(p._name) + + +def _must_be_kwarg(signatures, positional_count, used_kwargs): + if used_kwargs: + return True + + must_be_kwarg = True + for signature in signatures: + for i, p in enumerate(signature.params): + # TODO reconsider with Python 2 drop + kind = p._name.get_kind() + if kind is Parameter.VAR_POSITIONAL: + # In case there were not already kwargs, the next param can + # always be a normal argument. + return False + + if i >= positional_count and kind in (Parameter.POSITIONAL_OR_KEYWORD, + Parameter.POSITIONAL_ONLY): + must_be_kwarg = False + break + if not must_be_kwarg: + break + return must_be_kwarg + + +def filter_names(inference_state, completion_names, stack, like_name, fuzzy, cached_name): + comp_dct = set() + if settings.case_insensitive_completion: + like_name = like_name.lower() + for name in completion_names: + string = name.string_name + if settings.case_insensitive_completion: + string = string.lower() + if helpers.match(string, like_name, fuzzy=fuzzy): + new = classes.Completion( + inference_state, + name, + stack, + len(like_name), + is_fuzzy=fuzzy, + cached_name=cached_name, + ) + k = (new.name, new.complete) # key + if k not in comp_dct: + comp_dct.add(k) + tree_name = name.tree_name + if tree_name is not None: + definition = tree_name.get_definition() + if definition is not None and definition.type == 'del_stmt': + continue + yield new + + +def _remove_duplicates(completions, other_completions): + names = {d.name for d in other_completions} + return [c for c in completions if c.name not in names] + + +def get_user_context(module_context, position): + """ + Returns the scope in which the user resides. This includes flows. + """ + leaf = module_context.tree_node.get_leaf_for_position(position, include_prefixes=True) + return module_context.create_context(leaf) + + +def get_flow_scope_node(module_node, position): + node = module_node.get_leaf_for_position(position, include_prefixes=True) + while not isinstance(node, (tree.Scope, tree.Flow)): + node = node.parent + + return node + + +@plugin_manager.decorate() +def complete_param_names(context, function_name, decorator_nodes): + # Basically there's no way to do param completion. The plugins are + # responsible for this. + return [] + + +class Completion: + def __init__(self, inference_state, module_context, code_lines, position, + signatures_callback, fuzzy=False): + self._inference_state = inference_state + self._module_context = module_context + self._module_node = module_context.tree_node + self._code_lines = code_lines + + # The first step of completions is to get the name + self._like_name = helpers.get_on_completion_name(self._module_node, code_lines, position) + # The actual cursor position is not what we need to calculate + # everything. We want the start of the name we're on. + self._original_position = position + self._signatures_callback = signatures_callback + + self._fuzzy = fuzzy + + def complete(self): + leaf = self._module_node.get_leaf_for_position( + self._original_position, + include_prefixes=True + ) + string, start_leaf, quote = _extract_string_while_in_string(leaf, self._original_position) + + prefixed_completions = complete_dict( + self._module_context, + self._code_lines, + start_leaf or leaf, + self._original_position, + None if string is None else quote + string, + fuzzy=self._fuzzy, + ) + + if string is not None and not prefixed_completions: + prefixed_completions = list(complete_file_name( + self._inference_state, self._module_context, start_leaf, quote, string, + self._like_name, self._signatures_callback, + self._code_lines, self._original_position, + self._fuzzy + )) + if string is not None: + if not prefixed_completions and '\n' in string: + # Complete only multi line strings + prefixed_completions = self._complete_in_string(start_leaf, string) + return prefixed_completions + + cached_name, completion_names = self._complete_python(leaf) + + completions = list(filter_names(self._inference_state, completion_names, + self.stack, self._like_name, + self._fuzzy, cached_name=cached_name)) + + return ( + # Removing duplicates mostly to remove False/True/None duplicates. + _remove_duplicates(prefixed_completions, completions) + + sorted(completions, key=lambda x: (x.name.startswith('__'), + x.name.startswith('_'), + x.name.lower())) + ) + + def _complete_python(self, leaf): + """ + Analyzes the current context of a completion and decides what to + return. + + Technically this works by generating a parser stack and analysing the + current stack for possible grammar nodes. + + Possible enhancements: + - global/nonlocal search global + - yield from / raise from <- could be only exceptions/generators + - In args: */**: no completion + - In params (also lambda): no completion before = + """ + + grammar = self._inference_state.grammar + self.stack = stack = None + self._position = ( + self._original_position[0], + self._original_position[1] - len(self._like_name) + ) + cached_name = None + + try: + self.stack = stack = helpers.get_stack_at_position( + grammar, self._code_lines, leaf, self._position + ) + except helpers.OnErrorLeaf as e: + value = e.error_leaf.value + if value == '.': + # After ErrorLeaf's that are dots, we will not do any + # completions since this probably just confuses the user. + return cached_name, [] + + # If we don't have a value, just use global completion. + return cached_name, self._complete_global_scope() + + allowed_transitions = \ + list(stack._allowed_transition_names_and_token_types()) + + if 'if' in allowed_transitions: + leaf = self._module_node.get_leaf_for_position(self._position, include_prefixes=True) + previous_leaf = leaf.get_previous_leaf() + + indent = self._position[1] + if not (leaf.start_pos <= self._position <= leaf.end_pos): + indent = leaf.start_pos[1] + + if previous_leaf is not None: + stmt = previous_leaf + while True: + stmt = search_ancestor( + stmt, 'if_stmt', 'for_stmt', 'while_stmt', 'try_stmt', + 'error_node', + ) + if stmt is None: + break + + type_ = stmt.type + if type_ == 'error_node': + first = stmt.children[0] + if isinstance(first, Leaf): + type_ = first.value + '_stmt' + # Compare indents + if stmt.start_pos[1] == indent: + if type_ == 'if_stmt': + allowed_transitions += ['elif', 'else'] + elif type_ == 'try_stmt': + allowed_transitions += ['except', 'finally', 'else'] + elif type_ == 'for_stmt': + allowed_transitions.append('else') + + completion_names = [] + + kwargs_only = False + if any(t in allowed_transitions for t in (PythonTokenTypes.NAME, + PythonTokenTypes.INDENT)): + # This means that we actually have to do type inference. + + nonterminals = [stack_node.nonterminal for stack_node in stack] + + nodes = _gather_nodes(stack) + if nodes and nodes[-1] in ('as', 'def', 'class'): + # No completions for ``with x as foo`` and ``import x as foo``. + # Also true for defining names as a class or function. + return cached_name, list(self._complete_inherited(is_function=True)) + elif "import_stmt" in nonterminals: + level, names = parse_dotted_names(nodes, "import_from" in nonterminals) + + only_modules = not ("import_from" in nonterminals and 'import' in nodes) + completion_names += self._get_importer_names( + names, + level, + only_modules=only_modules, + ) + elif nonterminals[-1] in ('trailer', 'dotted_name') and nodes[-1] == '.': + dot = self._module_node.get_leaf_for_position(self._position) + cached_name, n = self._complete_trailer(dot.get_previous_leaf()) + completion_names += n + elif self._is_parameter_completion(): + completion_names += self._complete_params(leaf) + else: + # Apparently this looks like it's good enough to filter most cases + # so that signature completions don't randomly appear. + # To understand why this works, three things are important: + # 1. trailer with a `,` in it is either a subscript or an arglist. + # 2. If there's no `,`, it's at the start and only signatures start + # with `(`. Other trailers could start with `.` or `[`. + # 3. Decorators are very primitive and have an optional `(` with + # optional arglist in them. + if nodes[-1] in ['(', ','] \ + and nonterminals[-1] in ('trailer', 'arglist', 'decorator'): + signatures = self._signatures_callback(*self._position) + if signatures: + call_details = signatures[0]._call_details + used_kwargs = list(call_details.iter_used_keyword_arguments()) + positional_count = call_details.count_positional_arguments() + + completion_names += _get_signature_param_names( + signatures, + positional_count, + used_kwargs, + ) + + kwargs_only = _must_be_kwarg(signatures, positional_count, used_kwargs) + + if not kwargs_only: + completion_names += self._complete_global_scope() + completion_names += self._complete_inherited(is_function=False) + + if not kwargs_only: + current_line = self._code_lines[self._position[0] - 1][:self._position[1]] + completion_names += self._complete_keywords( + allowed_transitions, + only_values=not (not current_line or current_line[-1] in ' \t.;' + and current_line[-3:] != '...') + ) + + return cached_name, completion_names + + def _is_parameter_completion(self): + tos = self.stack[-1] + if tos.nonterminal == 'lambdef' and len(tos.nodes) == 1: + # We are at the position `lambda `, where basically the next node + # is a param. + return True + if tos.nonterminal in 'parameters': + # Basically we are at the position `foo(`, there's nothing there + # yet, so we have no `typedargslist`. + return True + # var args is for lambdas and typed args for normal functions + return tos.nonterminal in ('typedargslist', 'varargslist') and tos.nodes[-1] == ',' + + def _complete_params(self, leaf): + stack_node = self.stack[-2] + if stack_node.nonterminal == 'parameters': + stack_node = self.stack[-3] + if stack_node.nonterminal == 'funcdef': + context = get_user_context(self._module_context, self._position) + node = search_ancestor(leaf, 'error_node', 'funcdef') + if node is not None: + if node.type == 'error_node': + n = node.children[0] + if n.type == 'decorators': + decorators = n.children + elif n.type == 'decorator': + decorators = [n] + else: + decorators = [] + else: + decorators = node.get_decorators() + function_name = stack_node.nodes[1] + + return complete_param_names(context, function_name.value, decorators) + return [] + + def _complete_keywords(self, allowed_transitions, only_values): + for k in allowed_transitions: + if isinstance(k, str) and k.isalpha(): + if not only_values or k in ('True', 'False', 'None'): + yield keywords.KeywordName(self._inference_state, k) + + def _complete_global_scope(self): + context = get_user_context(self._module_context, self._position) + debug.dbg('global completion scope: %s', context) + flow_scope_node = get_flow_scope_node(self._module_node, self._position) + filters = get_global_filters( + context, + self._position, + flow_scope_node + ) + completion_names = [] + for filter in filters: + completion_names += filter.values() + return completion_names + + def _complete_trailer(self, previous_leaf): + inferred_context = self._module_context.create_context(previous_leaf) + values = infer_call_of_leaf(inferred_context, previous_leaf) + debug.dbg('trailer completion values: %s', values, color='MAGENTA') + + # The cached name simply exists to make speed optimizations for certain + # modules. + cached_name = None + if len(values) == 1: + v, = values + if v.is_module(): + if len(v.string_names) == 1: + module_name = v.string_names[0] + if module_name in ('numpy', 'tensorflow', 'matplotlib', 'pandas'): + cached_name = module_name + + return cached_name, self._complete_trailer_for_values(values) + + def _complete_trailer_for_values(self, values): + user_context = get_user_context(self._module_context, self._position) + + return complete_trailer(user_context, values) + + def _get_importer_names(self, names, level=0, only_modules=True): + names = [n.value for n in names] + i = imports.Importer(self._inference_state, names, self._module_context, level) + return i.completion_names(self._inference_state, only_modules=only_modules) + + def _complete_inherited(self, is_function=True): + """ + Autocomplete inherited methods when overriding in child class. + """ + leaf = self._module_node.get_leaf_for_position(self._position, include_prefixes=True) + cls = tree.search_ancestor(leaf, 'classdef') + if cls is None: + return + + # Complete the methods that are defined in the super classes. + class_value = self._module_context.create_value(cls) + + if cls.start_pos[1] >= leaf.start_pos[1]: + return + + filters = class_value.get_filters(is_instance=True) + # The first dict is the dictionary of class itself. + next(filters) + for filter in filters: + for name in filter.values(): + # TODO we should probably check here for properties + if (name.api_type == 'function') == is_function: + yield name + + def _complete_in_string(self, start_leaf, string): + """ + To make it possible for people to have completions in doctests or + generally in "Python" code in docstrings, we use the following + heuristic: + + - Having an indented block of code + - Having some doctest code that starts with `>>>` + - Having backticks that doesn't have whitespace inside it + """ + def iter_relevant_lines(lines): + include_next_line = False + for l in code_lines: + if include_next_line or l.startswith('>>>') or l.startswith(' '): + yield re.sub(r'^( *>>> ?| +)', '', l) + else: + yield None + + include_next_line = bool(re.match(' *>>>', l)) + + string = dedent(string) + code_lines = split_lines(string, keepends=True) + relevant_code_lines = list(iter_relevant_lines(code_lines)) + if relevant_code_lines[-1] is not None: + # Some code lines might be None, therefore get rid of that. + relevant_code_lines = ['\n' if c is None else c for c in relevant_code_lines] + return self._complete_code_lines(relevant_code_lines) + match = re.search(r'`([^`\s]+)', code_lines[-1]) + if match: + return self._complete_code_lines([match.group(1)]) + return [] + + def _complete_code_lines(self, code_lines): + module_node = self._inference_state.grammar.parse(''.join(code_lines)) + module_value = ModuleValue( + self._inference_state, + module_node, + code_lines=code_lines, + ) + module_value.parent_context = self._module_context + return Completion( + self._inference_state, + module_value.as_context(), + code_lines=code_lines, + position=module_node.end_pos, + signatures_callback=lambda *args, **kwargs: [], + fuzzy=self._fuzzy + ).complete() + + +def _gather_nodes(stack): + nodes = [] + for stack_node in stack: + if stack_node.dfa.from_rule == 'small_stmt': + nodes = [] + else: + nodes += stack_node.nodes + return nodes + + +_string_start = re.compile(r'^\w*(\'{3}|"{3}|\'|")') + + +def _extract_string_while_in_string(leaf, position): + def return_part_of_leaf(leaf): + kwargs = {} + if leaf.line == position[0]: + kwargs['endpos'] = position[1] - leaf.column + match = _string_start.match(leaf.value, **kwargs) + if not match: + return None, None, None + start = match.group(0) + if leaf.line == position[0] and position[1] < leaf.column + match.end(): + return None, None, None + return cut_value_at_position(leaf, position)[match.end():], leaf, start + + if position < leaf.start_pos: + return None, None, None + + if leaf.type == 'string': + return return_part_of_leaf(leaf) + + leaves = [] + while leaf is not None: + if leaf.type == 'error_leaf' and ('"' in leaf.value or "'" in leaf.value): + if len(leaf.value) > 1: + return return_part_of_leaf(leaf) + prefix_leaf = None + if not leaf.prefix: + prefix_leaf = leaf.get_previous_leaf() + if prefix_leaf is None or prefix_leaf.type != 'name' \ + or not all(c in 'rubf' for c in prefix_leaf.value.lower()): + prefix_leaf = None + + return ( + ''.join(cut_value_at_position(l, position) for l in leaves), + prefix_leaf or leaf, + ('' if prefix_leaf is None else prefix_leaf.value) + + cut_value_at_position(leaf, position), + ) + if leaf.line != position[0]: + # Multi line strings are always simple error leaves and contain the + # whole string, single line error leaves are atherefore important + # now and since the line is different, it's not really a single + # line string anymore. + break + leaves.insert(0, leaf) + leaf = leaf.get_previous_leaf() + return None, None, None + + +def complete_trailer(user_context, values): + completion_names = [] + for value in values: + for filter in value.get_filters(origin_scope=user_context.tree_node): + completion_names += filter.values() + + if not value.is_stub() and isinstance(value, TreeInstance): + completion_names += _complete_getattr(user_context, value) + + python_values = convert_values(values) + for c in python_values: + if c not in values: + for filter in c.get_filters(origin_scope=user_context.tree_node): + completion_names += filter.values() + return completion_names + + +def _complete_getattr(user_context, instance): + """ + A heuristic to make completion for proxy objects work. This is not + intended to work in all cases. It works exactly in this case: + + def __getattr__(self, name): + ... + return getattr(any_object, name) + + It is important that the return contains getattr directly, otherwise it + won't work anymore. It's really just a stupid heuristic. It will not + work if you write e.g. `return (getatr(o, name))`, because of the + additional parentheses. It will also not work if you move the getattr + to some other place that is not the return statement itself. + + It is intentional that it doesn't work in all cases. Generally it's + really hard to do even this case (as you can see below). Most people + will write it like this anyway and the other ones, well they are just + out of luck I guess :) ~dave. + """ + names = (instance.get_function_slot_names(u'__getattr__') + or instance.get_function_slot_names(u'__getattribute__')) + functions = ValueSet.from_sets( + name.infer() + for name in names + ) + for func in functions: + tree_node = func.tree_node + if tree_node is None or tree_node.type != 'funcdef': + continue + + for return_stmt in tree_node.iter_return_stmts(): + # Basically until the next comment we just try to find out if a + # return statement looks exactly like `return getattr(x, name)`. + if return_stmt.type != 'return_stmt': + continue + atom_expr = return_stmt.children[1] + if atom_expr.type != 'atom_expr': + continue + atom = atom_expr.children[0] + trailer = atom_expr.children[1] + if len(atom_expr.children) != 2 or atom.type != 'name' \ + or atom.value != 'getattr': + continue + arglist = trailer.children[1] + if arglist.type != 'arglist' or len(arglist.children) < 3: + continue + context = func.as_context() + object_node = arglist.children[0] + + # Make sure it's a param: foo in __getattr__(self, foo) + name_node = arglist.children[2] + name_list = context.goto(name_node, name_node.start_pos) + if not any(n.api_type == 'param' for n in name_list): + continue + + # Now that we know that these are most probably completion + # objects, we just infer the object and return them as + # completions. + objects = context.infer_node(object_node) + return complete_trailer(user_context, objects) + return [] + + +def search_in_module(inference_state, module_context, names, wanted_names, + wanted_type, complete=False, fuzzy=False, + ignore_imports=False, convert=False): + for s in wanted_names[:-1]: + new_names = [] + for n in names: + if s == n.string_name: + if n.tree_name is not None and n.api_type == 'module' \ + and ignore_imports: + continue + new_names += complete_trailer( + module_context, + n.infer() + ) + debug.dbg('dot lookup on search %s from %s', new_names, names[:10]) + names = new_names + + last_name = wanted_names[-1].lower() + for n in names: + string = n.string_name.lower() + if complete and helpers.match(string, last_name, fuzzy=fuzzy) \ + or not complete and string == last_name: + if isinstance(n, SubModuleName): + names = [v.name for v in n.infer()] + else: + names = [n] + if convert: + names = convert_names(names) + for n2 in names: + if complete: + def_ = classes.Completion( + inference_state, n2, + stack=None, + like_name_length=len(last_name), + is_fuzzy=fuzzy, + ) + else: + def_ = classes.Name(inference_state, n2) + if not wanted_type or wanted_type == def_.type: + yield def_ diff --git a/.venv/lib/python3.8/site-packages/jedi/api/completion_cache.py b/.venv/lib/python3.8/site-packages/jedi/api/completion_cache.py new file mode 100644 index 00000000..6dac6a4e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/api/completion_cache.py @@ -0,0 +1,25 @@ +_cache = {} + + +def save_entry(module_name, name, cache): + try: + module_cache = _cache[module_name] + except KeyError: + module_cache = _cache[module_name] = {} + module_cache[name] = cache + + +def _create_get_from_cache(number): + def _get_from_cache(module_name, name, get_cache_values): + try: + return _cache[module_name][name][number] + except KeyError: + v = get_cache_values() + save_entry(module_name, name, v) + return v[number] + return _get_from_cache + + +get_type = _create_get_from_cache(0) +get_docstring_signature = _create_get_from_cache(1) +get_docstring = _create_get_from_cache(2) diff --git a/.venv/lib/python3.8/site-packages/jedi/api/environment.py b/.venv/lib/python3.8/site-packages/jedi/api/environment.py new file mode 100644 index 00000000..3c0339b5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/api/environment.py @@ -0,0 +1,480 @@ +""" +Environments are a way to activate different Python versions or Virtualenvs for +static analysis. The Python binary in that environment is going to be executed. +""" +import os +import sys +import hashlib +import filecmp +from collections import namedtuple + +from jedi._compatibility import highest_pickle_protocol, which +from jedi.cache import memoize_method, time_cache +from jedi.inference.compiled.subprocess import CompiledSubprocess, \ + InferenceStateSameProcess, InferenceStateSubprocess + +import parso + +_VersionInfo = namedtuple('VersionInfo', 'major minor micro') + +_SUPPORTED_PYTHONS = ['3.8', '3.7', '3.6', '3.5', '2.7'] +_SAFE_PATHS = ['/usr/bin', '/usr/local/bin'] +_CONDA_VAR = 'CONDA_PREFIX' +_CURRENT_VERSION = '%s.%s' % (sys.version_info.major, sys.version_info.minor) + + +class InvalidPythonEnvironment(Exception): + """ + If you see this exception, the Python executable or Virtualenv you have + been trying to use is probably not a correct Python version. + """ + + +class _BaseEnvironment(object): + @memoize_method + def get_grammar(self): + version_string = '%s.%s' % (self.version_info.major, self.version_info.minor) + return parso.load_grammar(version=version_string) + + @property + def _sha256(self): + try: + return self._hash + except AttributeError: + self._hash = _calculate_sha256_for_file(self.executable) + return self._hash + + +def _get_info(): + return ( + sys.executable, + sys.prefix, + sys.version_info[:3], + ) + + +class Environment(_BaseEnvironment): + """ + This class is supposed to be created by internal Jedi architecture. You + should not create it directly. Please use create_environment or the other + functions instead. It is then returned by that function. + """ + _subprocess = None + + def __init__(self, executable): + self._start_executable = executable + # Initialize the environment + self._get_subprocess() + + def _get_subprocess(self): + if self._subprocess is not None and not self._subprocess.is_crashed: + return self._subprocess + + try: + self._subprocess = CompiledSubprocess(self._start_executable) + info = self._subprocess._send(None, _get_info) + except Exception as exc: + raise InvalidPythonEnvironment( + "Could not get version information for %r: %r" % ( + self._start_executable, + exc)) + + # Since it could change and might not be the same(?) as the one given, + # set it here. + self.executable = info[0] + """ + The Python executable, matches ``sys.executable``. + """ + self.path = info[1] + """ + The path to an environment, matches ``sys.prefix``. + """ + self.version_info = _VersionInfo(*info[2]) + """ + Like :data:`sys.version_info`: a tuple to show the current + Environment's Python version. + """ + + # py2 sends bytes via pickle apparently?! + if self.version_info.major == 2: + self.executable = self.executable.decode() + self.path = self.path.decode() + + # Adjust pickle protocol according to host and client version. + self._subprocess._pickle_protocol = highest_pickle_protocol([ + sys.version_info, self.version_info]) + + return self._subprocess + + def __repr__(self): + version = '.'.join(str(i) for i in self.version_info) + return '<%s: %s in %s>' % (self.__class__.__name__, version, self.path) + + def get_inference_state_subprocess(self, inference_state): + return InferenceStateSubprocess(inference_state, self._get_subprocess()) + + @memoize_method + def get_sys_path(self): + """ + The sys path for this environment. Does not include potential + modifications from e.g. appending to :data:`sys.path`. + + :returns: list of str + """ + # It's pretty much impossible to generate the sys path without actually + # executing Python. The sys path (when starting with -S) itself depends + # on how the Python version was compiled (ENV variables). + # If you omit -S when starting Python (normal case), additionally + # site.py gets executed. + return self._get_subprocess().get_sys_path() + + +class _SameEnvironmentMixin(object): + def __init__(self): + self._start_executable = self.executable = sys.executable + self.path = sys.prefix + self.version_info = _VersionInfo(*sys.version_info[:3]) + + +class SameEnvironment(_SameEnvironmentMixin, Environment): + pass + + +class InterpreterEnvironment(_SameEnvironmentMixin, _BaseEnvironment): + def get_inference_state_subprocess(self, inference_state): + return InferenceStateSameProcess(inference_state) + + def get_sys_path(self): + return sys.path + + +def _get_virtual_env_from_var(env_var='VIRTUAL_ENV'): + """Get virtualenv environment from VIRTUAL_ENV environment variable. + + It uses `safe=False` with ``create_environment``, because the environment + variable is considered to be safe / controlled by the user solely. + """ + var = os.environ.get(env_var) + if var: + # Under macOS in some cases - notably when using Pipenv - the + # sys.prefix of the virtualenv is /path/to/env/bin/.. instead of + # /path/to/env so we need to fully resolve the paths in order to + # compare them. + if os.path.realpath(var) == os.path.realpath(sys.prefix): + return _try_get_same_env() + + try: + return create_environment(var, safe=False) + except InvalidPythonEnvironment: + pass + + +def _calculate_sha256_for_file(path): + sha256 = hashlib.sha256() + with open(path, 'rb') as f: + for block in iter(lambda: f.read(filecmp.BUFSIZE), b''): + sha256.update(block) + return sha256.hexdigest() + + +def get_default_environment(): + """ + Tries to return an active Virtualenv or conda environment. + If there is no VIRTUAL_ENV variable or no CONDA_PREFIX variable set + set it will return the latest Python version installed on the system. This + makes it possible to use as many new Python features as possible when using + autocompletion and other functionality. + + :returns: :class:`.Environment` + """ + virtual_env = _get_virtual_env_from_var() + if virtual_env is not None: + return virtual_env + + conda_env = _get_virtual_env_from_var(_CONDA_VAR) + if conda_env is not None: + return conda_env + + return _try_get_same_env() + + +def _try_get_same_env(): + env = SameEnvironment() + if not os.path.basename(env.executable).lower().startswith('python'): + # This tries to counter issues with embedding. In some cases (e.g. + # VIM's Python Mac/Windows, sys.executable is /foo/bar/vim. This + # happens, because for Mac a function called `_NSGetExecutablePath` is + # used and for Windows `GetModuleFileNameW`. These are both platform + # specific functions. For all other systems sys.executable should be + # alright. However here we try to generalize: + # + # 1. Check if the executable looks like python (heuristic) + # 2. In case it's not try to find the executable + # 3. In case we don't find it use an interpreter environment. + # + # The last option will always work, but leads to potential crashes of + # Jedi - which is ok, because it happens very rarely and even less, + # because the code below should work for most cases. + if os.name == 'nt': + # The first case would be a virtualenv and the second a normal + # Python installation. + checks = (r'Scripts\python.exe', 'python.exe') + else: + # For unix it looks like Python is always in a bin folder. + checks = ( + 'bin/python%s.%s' % (sys.version_info[0], sys.version[1]), + 'bin/python%s' % (sys.version_info[0]), + 'bin/python', + ) + for check in checks: + guess = os.path.join(sys.exec_prefix, check) + if os.path.isfile(guess): + # Bingo - We think we have our Python. + return Environment(guess) + # It looks like there is no reasonable Python to be found. + return InterpreterEnvironment() + # If no virtualenv is found, use the environment we're already + # using. + return env + + +def get_cached_default_environment(): + var = os.environ.get('VIRTUAL_ENV') or os.environ.get(_CONDA_VAR) + environment = _get_cached_default_environment() + + # Under macOS in some cases - notably when using Pipenv - the + # sys.prefix of the virtualenv is /path/to/env/bin/.. instead of + # /path/to/env so we need to fully resolve the paths in order to + # compare them. + if var and os.path.realpath(var) != os.path.realpath(environment.path): + _get_cached_default_environment.clear_cache() + return _get_cached_default_environment() + return environment + + +@time_cache(seconds=10 * 60) # 10 Minutes +def _get_cached_default_environment(): + try: + return get_default_environment() + except InvalidPythonEnvironment: + # It's possible that `sys.executable` is wrong. Typically happens + # when Jedi is used in an executable that embeds Python. For further + # information, have a look at: + # https://github.com/davidhalter/jedi/issues/1531 + return InterpreterEnvironment() + + +def find_virtualenvs(paths=None, **kwargs): + """ + :param paths: A list of paths in your file system to be scanned for + Virtualenvs. It will search in these paths and potentially execute the + Python binaries. + :param safe: Default True. In case this is False, it will allow this + function to execute potential `python` environments. An attacker might + be able to drop an executable in a path this function is searching by + default. If the executable has not been installed by root, it will not + be executed. + :param use_environment_vars: Default True. If True, the VIRTUAL_ENV + variable will be checked if it contains a valid VirtualEnv. + CONDA_PREFIX will be checked to see if it contains a valid conda + environment. + + :yields: :class:`.Environment` + """ + def py27_comp(paths=None, safe=True, use_environment_vars=True): + if paths is None: + paths = [] + + _used_paths = set() + + if use_environment_vars: + # Using this variable should be safe, because attackers might be + # able to drop files (via git) but not environment variables. + virtual_env = _get_virtual_env_from_var() + if virtual_env is not None: + yield virtual_env + _used_paths.add(virtual_env.path) + + conda_env = _get_virtual_env_from_var(_CONDA_VAR) + if conda_env is not None: + yield conda_env + _used_paths.add(conda_env.path) + + for directory in paths: + if not os.path.isdir(directory): + continue + + directory = os.path.abspath(directory) + for path in os.listdir(directory): + path = os.path.join(directory, path) + if path in _used_paths: + # A path shouldn't be inferred twice. + continue + _used_paths.add(path) + + try: + executable = _get_executable_path(path, safe=safe) + yield Environment(executable) + except InvalidPythonEnvironment: + pass + + return py27_comp(paths, **kwargs) + + +def find_system_environments(): + """ + Ignores virtualenvs and returns the Python versions that were installed on + your system. This might return nothing, if you're running Python e.g. from + a portable version. + + The environments are sorted from latest to oldest Python version. + + :yields: :class:`.Environment` + """ + for version_string in _SUPPORTED_PYTHONS: + try: + yield get_system_environment(version_string) + except InvalidPythonEnvironment: + pass + + +# TODO: this function should probably return a list of environments since +# multiple Python installations can be found on a system for the same version. +def get_system_environment(version): + """ + Return the first Python environment found for a string of the form 'X.Y' + where X and Y are the major and minor versions of Python. + + :raises: :exc:`.InvalidPythonEnvironment` + :returns: :class:`.Environment` + """ + exe = which('python' + version) + if exe: + if exe == sys.executable: + return SameEnvironment() + return Environment(exe) + + if os.name == 'nt': + for exe in _get_executables_from_windows_registry(version): + try: + return Environment(exe) + except InvalidPythonEnvironment: + pass + raise InvalidPythonEnvironment("Cannot find executable python%s." % version) + + +def create_environment(path, safe=True): + """ + Make it possible to manually create an Environment object by specifying a + Virtualenv path or an executable path. + + :raises: :exc:`.InvalidPythonEnvironment` + :returns: :class:`.Environment` + """ + if os.path.isfile(path): + _assert_safe(path, safe) + return Environment(path) + return Environment(_get_executable_path(path, safe=safe)) + + +def _get_executable_path(path, safe=True): + """ + Returns None if it's not actually a virtual env. + """ + + if os.name == 'nt': + python = os.path.join(path, 'Scripts', 'python.exe') + else: + python = os.path.join(path, 'bin', 'python') + if not os.path.exists(python): + raise InvalidPythonEnvironment("%s seems to be missing." % python) + + _assert_safe(python, safe) + return python + + +def _get_executables_from_windows_registry(version): + # The winreg module is named _winreg on Python 2. + try: + import winreg + except ImportError: + import _winreg as winreg + + # TODO: support Python Anaconda. + sub_keys = [ + r'SOFTWARE\Python\PythonCore\{version}\InstallPath', + r'SOFTWARE\Wow6432Node\Python\PythonCore\{version}\InstallPath', + r'SOFTWARE\Python\PythonCore\{version}-32\InstallPath', + r'SOFTWARE\Wow6432Node\Python\PythonCore\{version}-32\InstallPath' + ] + for root_key in [winreg.HKEY_CURRENT_USER, winreg.HKEY_LOCAL_MACHINE]: + for sub_key in sub_keys: + sub_key = sub_key.format(version=version) + try: + with winreg.OpenKey(root_key, sub_key) as key: + prefix = winreg.QueryValueEx(key, '')[0] + exe = os.path.join(prefix, 'python.exe') + if os.path.isfile(exe): + yield exe + except WindowsError: + pass + + +def _assert_safe(executable_path, safe): + if safe and not _is_safe(executable_path): + raise InvalidPythonEnvironment( + "The python binary is potentially unsafe.") + + +def _is_safe(executable_path): + # Resolve sym links. A venv typically is a symlink to a known Python + # binary. Only virtualenvs copy symlinks around. + real_path = os.path.realpath(executable_path) + + if _is_unix_safe_simple(real_path): + return True + + # Just check the list of known Python versions. If it's not in there, + # it's likely an attacker or some Python that was not properly + # installed in the system. + for environment in find_system_environments(): + if environment.executable == real_path: + return True + + # If the versions don't match, just compare the binary files. If we + # don't do that, only venvs will be working and not virtualenvs. + # venvs are symlinks while virtualenvs are actual copies of the + # Python files. + # This still means that if the system Python is updated and the + # virtualenv's Python is not (which is probably never going to get + # upgraded), it will not work with Jedi. IMO that's fine, because + # people should just be using venv. ~ dave + if environment._sha256 == _calculate_sha256_for_file(real_path): + return True + return False + + +def _is_unix_safe_simple(real_path): + if _is_unix_admin(): + # In case we are root, just be conservative and + # only execute known paths. + return any(real_path.startswith(p) for p in _SAFE_PATHS) + + uid = os.stat(real_path).st_uid + # The interpreter needs to be owned by root. This means that it wasn't + # written by a user and therefore attacking Jedi is not as simple. + # The attack could look like the following: + # 1. A user clones a repository. + # 2. The repository has an innocent looking folder called foobar. jedi + # searches for the folder and executes foobar/bin/python --version if + # there's also a foobar/bin/activate. + # 3. The attacker has gained code execution, since he controls + # foobar/bin/python. + return uid == 0 + + +def _is_unix_admin(): + try: + return os.getuid() == 0 + except AttributeError: + return False # Windows diff --git a/.venv/lib/python3.8/site-packages/jedi/api/errors.py b/.venv/lib/python3.8/site-packages/jedi/api/errors.py new file mode 100644 index 00000000..6dc9ae2d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/api/errors.py @@ -0,0 +1,46 @@ +""" +This file is about errors in Python files and not about exception handling in +Jedi. +""" + + +def parso_to_jedi_errors(grammar, module_node): + return [SyntaxError(e) for e in grammar.iter_errors(module_node)] + + +class SyntaxError(object): + """ + Syntax errors are generated by :meth:`.Script.get_syntax_errors`. + """ + def __init__(self, parso_error): + self._parso_error = parso_error + + @property + def line(self): + """The line where the error starts (starting with 1).""" + return self._parso_error.start_pos[0] + + @property + def column(self): + """The column where the error starts (starting with 0).""" + return self._parso_error.start_pos[1] + + @property + def until_line(self): + """The line where the error ends (starting with 1).""" + return self._parso_error.end_pos[0] + + @property + def until_column(self): + """The column where the error ends (starting with 0).""" + return self._parso_error.end_pos[1] + + def get_message(self): + return self._parso_error.message + + def __repr__(self): + return '<%s from=%s to=%s>' % ( + self.__class__.__name__, + self._parso_error.start_pos, + self._parso_error.end_pos, + ) diff --git a/.venv/lib/python3.8/site-packages/jedi/api/exceptions.py b/.venv/lib/python3.8/site-packages/jedi/api/exceptions.py new file mode 100644 index 00000000..db66a5f4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/api/exceptions.py @@ -0,0 +1,31 @@ +class _JediError(Exception): + pass + + +class InternalError(_JediError): + """ + This error might happen a subprocess is crashing. The reason for this is + usually broken C code in third party libraries. This is not a very common + thing and it is safe to use Jedi again. However using the same calls might + result in the same error again. + """ + + +class WrongVersion(_JediError): + """ + This error is reserved for the future, shouldn't really be happening at the + moment. + """ + + +class RefactoringError(_JediError): + """ + Refactorings can fail for various reasons. So if you work with refactorings + like :meth:`.Script.rename`, :meth:`.Script.inline`, + :meth:`.Script.extract_variable` and :meth:`.Script.extract_function`, make + sure to catch these. The descriptions in the errors are ususally valuable + for end users. + + A typical ``RefactoringError`` would tell the user that inlining is not + possible if no name is under the cursor. + """ diff --git a/.venv/lib/python3.8/site-packages/jedi/api/file_name.py b/.venv/lib/python3.8/site-packages/jedi/api/file_name.py new file mode 100644 index 00000000..0a2161a3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/api/file_name.py @@ -0,0 +1,156 @@ +import os + +from jedi._compatibility import FileNotFoundError, force_unicode, scandir +from jedi.api import classes +from jedi.api.strings import StringName, get_quote_ending +from jedi.api.helpers import match +from jedi.inference.helpers import get_str_or_none + + +class PathName(StringName): + api_type = u'path' + + +def complete_file_name(inference_state, module_context, start_leaf, quote, string, + like_name, signatures_callback, code_lines, position, fuzzy): + # First we want to find out what can actually be changed as a name. + like_name_length = len(os.path.basename(string)) + + addition = _get_string_additions(module_context, start_leaf) + if string.startswith('~'): + string = os.path.expanduser(string) + if addition is None: + return + string = addition + string + + # Here we use basename again, because if strings are added like + # `'foo' + 'bar`, it should complete to `foobar/`. + must_start_with = os.path.basename(string) + string = os.path.dirname(string) + + sigs = signatures_callback(*position) + is_in_os_path_join = sigs and all(s.full_name == 'os.path.join' for s in sigs) + if is_in_os_path_join: + to_be_added = _add_os_path_join(module_context, start_leaf, sigs[0].bracket_start) + if to_be_added is None: + is_in_os_path_join = False + else: + string = to_be_added + string + base_path = os.path.join(inference_state.project._path, string) + try: + listed = sorted(scandir(base_path), key=lambda e: e.name) + # OSError: [Errno 36] File name too long: '...' + except (FileNotFoundError, OSError): + return + quote_ending = get_quote_ending(quote, code_lines, position) + for entry in listed: + name = entry.name + if match(name, must_start_with, fuzzy=fuzzy): + if is_in_os_path_join or not entry.is_dir(): + name += quote_ending + else: + name += os.path.sep + + yield classes.Completion( + inference_state, + PathName(inference_state, name[len(must_start_with) - like_name_length:]), + stack=None, + like_name_length=like_name_length, + is_fuzzy=fuzzy, + ) + + +def _get_string_additions(module_context, start_leaf): + def iterate_nodes(): + node = addition.parent + was_addition = True + for child_node in reversed(node.children[:node.children.index(addition)]): + if was_addition: + was_addition = False + yield child_node + continue + + if child_node != '+': + break + was_addition = True + + addition = start_leaf.get_previous_leaf() + if addition != '+': + return '' + context = module_context.create_context(start_leaf) + return _add_strings(context, reversed(list(iterate_nodes()))) + + +def _add_strings(context, nodes, add_slash=False): + string = '' + first = True + for child_node in nodes: + values = context.infer_node(child_node) + if len(values) != 1: + return None + c, = values + s = get_str_or_none(c) + if s is None: + return None + if not first and add_slash: + string += os.path.sep + string += force_unicode(s) + first = False + return string + + +def _add_os_path_join(module_context, start_leaf, bracket_start): + def check(maybe_bracket, nodes): + if maybe_bracket.start_pos != bracket_start: + return None + + if not nodes: + return '' + context = module_context.create_context(nodes[0]) + return _add_strings(context, nodes, add_slash=True) or '' + + if start_leaf.type == 'error_leaf': + # Unfinished string literal, like `join('` + value_node = start_leaf.parent + index = value_node.children.index(start_leaf) + if index > 0: + error_node = value_node.children[index - 1] + if error_node.type == 'error_node' and len(error_node.children) >= 2: + index = -2 + if error_node.children[-1].type == 'arglist': + arglist_nodes = error_node.children[-1].children + index -= 1 + else: + arglist_nodes = [] + + return check(error_node.children[index + 1], arglist_nodes[::2]) + return None + + # Maybe an arglist or some weird error case. Therefore checked below. + searched_node_child = start_leaf + while searched_node_child.parent is not None \ + and searched_node_child.parent.type not in ('arglist', 'trailer', 'error_node'): + searched_node_child = searched_node_child.parent + + if searched_node_child.get_first_leaf() is not start_leaf: + return None + searched_node = searched_node_child.parent + if searched_node is None: + return None + + index = searched_node.children.index(searched_node_child) + arglist_nodes = searched_node.children[:index] + if searched_node.type == 'arglist': + trailer = searched_node.parent + if trailer.type == 'error_node': + trailer_index = trailer.children.index(searched_node) + assert trailer_index >= 2 + assert trailer.children[trailer_index - 1] == '(' + return check(trailer.children[trailer_index - 1], arglist_nodes[::2]) + elif trailer.type == 'trailer': + return check(trailer.children[0], arglist_nodes[::2]) + elif searched_node.type == 'trailer': + return check(searched_node.children[0], []) + elif searched_node.type == 'error_node': + # Stuff like `join(""` + return check(arglist_nodes[-1], []) diff --git a/.venv/lib/python3.8/site-packages/jedi/api/helpers.py b/.venv/lib/python3.8/site-packages/jedi/api/helpers.py new file mode 100644 index 00000000..0463b893 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/api/helpers.py @@ -0,0 +1,522 @@ +""" +Helpers for the API +""" +import re +from collections import namedtuple +from textwrap import dedent +from itertools import chain +from functools import wraps + +from parso.python.parser import Parser +from parso.python import tree + +from jedi._compatibility import u, Parameter +from jedi.inference.base_value import NO_VALUES +from jedi.inference.syntax_tree import infer_atom +from jedi.inference.helpers import infer_call_of_leaf +from jedi.inference.compiled import get_string_value_set +from jedi.cache import signature_time_cache, memoize_method +from jedi.parser_utils import get_parent_scope + + +CompletionParts = namedtuple('CompletionParts', ['path', 'has_dot', 'name']) + + +def _start_match(string, like_name): + return string.startswith(like_name) + + +def _fuzzy_match(string, like_name): + if len(like_name) <= 1: + return like_name in string + pos = string.find(like_name[0]) + if pos >= 0: + return _fuzzy_match(string[pos + 1:], like_name[1:]) + return False + + +def match(string, like_name, fuzzy=False): + if fuzzy: + return _fuzzy_match(string, like_name) + else: + return _start_match(string, like_name) + + +def sorted_definitions(defs): + # Note: `or ''` below is required because `module_path` could be + return sorted(defs, key=lambda x: (x.module_path or '', x.line or 0, x.column or 0, x.name)) + + +def get_on_completion_name(module_node, lines, position): + leaf = module_node.get_leaf_for_position(position) + if leaf is None or leaf.type in ('string', 'error_leaf'): + # Completions inside strings are a bit special, we need to parse the + # string. The same is true for comments and error_leafs. + line = lines[position[0] - 1] + # The first step of completions is to get the name + return re.search(r'(?!\d)\w+$|$', line[:position[1]]).group(0) + elif leaf.type not in ('name', 'keyword'): + return '' + + return leaf.value[:position[1] - leaf.start_pos[1]] + + +def _get_code(code_lines, start_pos, end_pos): + # Get relevant lines. + lines = code_lines[start_pos[0] - 1:end_pos[0]] + # Remove the parts at the end of the line. + lines[-1] = lines[-1][:end_pos[1]] + # Remove first line indentation. + lines[0] = lines[0][start_pos[1]:] + return ''.join(lines) + + +class OnErrorLeaf(Exception): + @property + def error_leaf(self): + return self.args[0] + + +def _get_code_for_stack(code_lines, leaf, position): + # It might happen that we're on whitespace or on a comment. This means + # that we would not get the right leaf. + if leaf.start_pos >= position: + # If we're not on a comment simply get the previous leaf and proceed. + leaf = leaf.get_previous_leaf() + if leaf is None: + return u('') # At the beginning of the file. + + is_after_newline = leaf.type == 'newline' + while leaf.type == 'newline': + leaf = leaf.get_previous_leaf() + if leaf is None: + return u('') + + if leaf.type == 'error_leaf' or leaf.type == 'string': + if leaf.start_pos[0] < position[0]: + # On a different line, we just begin anew. + return u('') + + # Error leafs cannot be parsed, completion in strings is also + # impossible. + raise OnErrorLeaf(leaf) + else: + user_stmt = leaf + while True: + if user_stmt.parent.type in ('file_input', 'suite', 'simple_stmt'): + break + user_stmt = user_stmt.parent + + if is_after_newline: + if user_stmt.start_pos[1] > position[1]: + # This means that it's actually a dedent and that means that we + # start without value (part of a suite). + return u('') + + # This is basically getting the relevant lines. + return _get_code(code_lines, user_stmt.get_start_pos_of_prefix(), position) + + +def get_stack_at_position(grammar, code_lines, leaf, pos): + """ + Returns the possible node names (e.g. import_from, xor_test or yield_stmt). + """ + class EndMarkerReached(Exception): + pass + + def tokenize_without_endmarker(code): + # TODO This is for now not an official parso API that exists purely + # for Jedi. + tokens = grammar._tokenize(code) + for token in tokens: + if token.string == safeword: + raise EndMarkerReached() + elif token.prefix.endswith(safeword): + # This happens with comments. + raise EndMarkerReached() + elif token.string.endswith(safeword): + yield token # Probably an f-string literal that was not finished. + raise EndMarkerReached() + else: + yield token + + # The code might be indedented, just remove it. + code = dedent(_get_code_for_stack(code_lines, leaf, pos)) + # We use a word to tell Jedi when we have reached the start of the + # completion. + # Use Z as a prefix because it's not part of a number suffix. + safeword = 'ZZZ_USER_WANTS_TO_COMPLETE_HERE_WITH_JEDI' + code = code + ' ' + safeword + + p = Parser(grammar._pgen_grammar, error_recovery=True) + try: + p.parse(tokens=tokenize_without_endmarker(code)) + except EndMarkerReached: + return p.stack + raise SystemError( + "This really shouldn't happen. There's a bug in Jedi:\n%s" + % list(tokenize_without_endmarker(code)) + ) + + +def infer(inference_state, context, leaf): + if leaf.type == 'name': + return inference_state.infer(context, leaf) + + parent = leaf.parent + definitions = NO_VALUES + if parent.type == 'atom': + # e.g. `(a + b)` + definitions = context.infer_node(leaf.parent) + elif parent.type == 'trailer': + # e.g. `a()` + definitions = infer_call_of_leaf(context, leaf) + elif isinstance(leaf, tree.Literal): + # e.g. `"foo"` or `1.0` + return infer_atom(context, leaf) + elif leaf.type in ('fstring_string', 'fstring_start', 'fstring_end'): + return get_string_value_set(inference_state) + return definitions + + +def filter_follow_imports(names, follow_builtin_imports=False): + for name in names: + if name.is_import(): + new_names = list(filter_follow_imports( + name.goto(), + follow_builtin_imports=follow_builtin_imports, + )) + found_builtin = False + if follow_builtin_imports: + for new_name in new_names: + if new_name.start_pos is None: + found_builtin = True + + if found_builtin: + yield name + else: + for new_name in new_names: + yield new_name + else: + yield name + + +class CallDetails(object): + def __init__(self, bracket_leaf, children, position): + ['bracket_leaf', 'call_index', 'keyword_name_str'] + self.bracket_leaf = bracket_leaf + self._children = children + self._position = position + + @property + def index(self): + return _get_index_and_key(self._children, self._position)[0] + + @property + def keyword_name_str(self): + return _get_index_and_key(self._children, self._position)[1] + + @memoize_method + def _list_arguments(self): + return list(_iter_arguments(self._children, self._position)) + + def calculate_index(self, param_names): + positional_count = 0 + used_names = set() + star_count = -1 + args = self._list_arguments() + if not args: + if param_names: + return 0 + else: + return None + + is_kwarg = False + for i, (star_count, key_start, had_equal) in enumerate(args): + is_kwarg |= had_equal | (star_count == 2) + if star_count: + pass # For now do nothing, we don't know what's in there here. + else: + if i + 1 != len(args): # Not last + if had_equal: + used_names.add(key_start) + else: + positional_count += 1 + + for i, param_name in enumerate(param_names): + kind = param_name.get_kind() + + if not is_kwarg: + if kind == Parameter.VAR_POSITIONAL: + return i + if kind in (Parameter.POSITIONAL_OR_KEYWORD, Parameter.POSITIONAL_ONLY): + if i == positional_count: + return i + + if key_start is not None and not star_count == 1 or star_count == 2: + if param_name.string_name not in used_names \ + and (kind == Parameter.KEYWORD_ONLY + or kind == Parameter.POSITIONAL_OR_KEYWORD + and positional_count <= i): + if star_count: + return i + if had_equal: + if param_name.string_name == key_start: + return i + else: + if param_name.string_name.startswith(key_start): + return i + + if kind == Parameter.VAR_KEYWORD: + return i + return None + + def iter_used_keyword_arguments(self): + for star_count, key_start, had_equal in list(self._list_arguments()): + if had_equal and key_start: + yield key_start + + def count_positional_arguments(self): + count = 0 + for star_count, key_start, had_equal in self._list_arguments()[:-1]: + if star_count: + break + count += 1 + return count + + +def _iter_arguments(nodes, position): + def remove_after_pos(name): + if name.type != 'name': + return None + return name.value[:position[1] - name.start_pos[1]] + + # Returns Generator[Tuple[star_count, Optional[key_start: str], had_equal]] + nodes_before = [c for c in nodes if c.start_pos < position] + if nodes_before[-1].type == 'arglist': + for x in _iter_arguments(nodes_before[-1].children, position): + yield x # Python 2 :( + return + + previous_node_yielded = False + stars_seen = 0 + for i, node in enumerate(nodes_before): + if node.type == 'argument': + previous_node_yielded = True + first = node.children[0] + second = node.children[1] + if second == '=': + if second.start_pos < position: + yield 0, first.value, True + else: + yield 0, remove_after_pos(first), False + elif first in ('*', '**'): + yield len(first.value), remove_after_pos(second), False + else: + # Must be a Comprehension + first_leaf = node.get_first_leaf() + if first_leaf.type == 'name' and first_leaf.start_pos >= position: + yield 0, remove_after_pos(first_leaf), False + else: + yield 0, None, False + stars_seen = 0 + elif node.type in ('testlist', 'testlist_star_expr'): # testlist is Python 2 + for n in node.children[::2]: + if n.type == 'star_expr': + stars_seen = 1 + n = n.children[1] + yield stars_seen, remove_after_pos(n), False + stars_seen = 0 + # The count of children is even if there's a comma at the end. + previous_node_yielded = bool(len(node.children) % 2) + elif isinstance(node, tree.PythonLeaf) and node.value == ',': + if not previous_node_yielded: + yield stars_seen, '', False + stars_seen = 0 + previous_node_yielded = False + elif isinstance(node, tree.PythonLeaf) and node.value in ('*', '**'): + stars_seen = len(node.value) + elif node == '=' and nodes_before[-1]: + previous_node_yielded = True + before = nodes_before[i - 1] + if before.type == 'name': + yield 0, before.value, True + else: + yield 0, None, False + # Just ignore the star that is probably a syntax error. + stars_seen = 0 + + if not previous_node_yielded: + if nodes_before[-1].type == 'name': + yield stars_seen, remove_after_pos(nodes_before[-1]), False + else: + yield stars_seen, '', False + + +def _get_index_and_key(nodes, position): + """ + Returns the amount of commas and the keyword argument string. + """ + nodes_before = [c for c in nodes if c.start_pos < position] + if nodes_before[-1].type == 'arglist': + return _get_index_and_key(nodes_before[-1].children, position) + + key_str = None + + last = nodes_before[-1] + if last.type == 'argument' and last.children[1] == '=' \ + and last.children[1].end_pos <= position: + # Checked if the argument + key_str = last.children[0].value + elif last == '=': + key_str = nodes_before[-2].value + + return nodes_before.count(','), key_str + + +def _get_signature_details_from_error_node(node, additional_children, position): + for index, element in reversed(list(enumerate(node.children))): + # `index > 0` means that it's a trailer and not an atom. + if element == '(' and element.end_pos <= position and index > 0: + # It's an error node, we don't want to match too much, just + # until the parentheses is enough. + children = node.children[index:] + name = element.get_previous_leaf() + if name is None: + continue + if name.type == 'name' or name.parent.type in ('trailer', 'atom'): + return CallDetails(element, children + additional_children, position) + + +def get_signature_details(module, position): + leaf = module.get_leaf_for_position(position, include_prefixes=True) + # It's easier to deal with the previous token than the next one in this + # case. + if leaf.start_pos >= position: + # Whitespace / comments after the leaf count towards the previous leaf. + leaf = leaf.get_previous_leaf() + if leaf is None: + return None + + # Now that we know where we are in the syntax tree, we start to look at + # parents for possible function definitions. + node = leaf.parent + while node is not None: + if node.type in ('funcdef', 'classdef', 'decorated', 'async_stmt'): + # Don't show signatures if there's stuff before it that just + # makes it feel strange to have a signature. + return None + + additional_children = [] + for n in reversed(node.children): + if n.start_pos < position: + if n.type == 'error_node': + result = _get_signature_details_from_error_node( + n, additional_children, position + ) + if result is not None: + return result + + additional_children[0:0] = n.children + continue + additional_children.insert(0, n) + + # Find a valid trailer + if node.type == 'trailer' and node.children[0] == '(' \ + or node.type == 'decorator' and node.children[2] == '(': + # Additionally we have to check that an ending parenthesis isn't + # interpreted wrong. There are two cases: + # 1. Cursor before paren -> The current signature is good + # 2. Cursor after paren -> We need to skip the current signature + if not (leaf is node.children[-1] and position >= leaf.end_pos): + leaf = node.get_previous_leaf() + if leaf is None: + return None + return CallDetails( + node.children[0] if node.type == 'trailer' else node.children[2], + node.children, + position + ) + + node = node.parent + + return None + + +@signature_time_cache("call_signatures_validity") +def cache_signatures(inference_state, context, bracket_leaf, code_lines, user_pos): + """This function calculates the cache key.""" + line_index = user_pos[0] - 1 + + before_cursor = code_lines[line_index][:user_pos[1]] + other_lines = code_lines[bracket_leaf.start_pos[0]:line_index] + whole = ''.join(other_lines + [before_cursor]) + before_bracket = re.match(r'.*\(', whole, re.DOTALL) + + module_path = context.get_root_context().py__file__() + if module_path is None: + yield None # Don't cache! + else: + yield (module_path, before_bracket, bracket_leaf.start_pos) + yield infer( + inference_state, + context, + bracket_leaf.get_previous_leaf(), + ) + + +def validate_line_column(func): + @wraps(func) + def wrapper(self, line=None, column=None, *args, **kwargs): + line = max(len(self._code_lines), 1) if line is None else line + if not (0 < line <= len(self._code_lines)): + raise ValueError('`line` parameter is not in a valid range.') + + line_string = self._code_lines[line - 1] + line_len = len(line_string) + if line_string.endswith('\r\n'): + line_len -= 2 + elif line_string.endswith('\n'): + line_len -= 1 + + column = line_len if column is None else column + if not (0 <= column <= line_len): + raise ValueError('`column` parameter (%d) is not in a valid range ' + '(0-%d) for line %d (%r).' % ( + column, line_len, line, line_string)) + return func(self, line, column, *args, **kwargs) + return wrapper + + +def get_module_names(module, all_scopes, definitions=True, references=False): + """ + Returns a dictionary with name parts as keys and their call paths as + values. + """ + def def_ref_filter(name): + is_def = name.is_definition() + return definitions and is_def or references and not is_def + + names = list(chain.from_iterable(module.get_used_names().values())) + if not all_scopes: + # We have to filter all the names that don't have the module as a + # parent_scope. There's None as a parent, because nodes in the module + # node have the parent module and not suite as all the others. + # Therefore it's important to catch that case. + + def is_module_scope_name(name): + parent_scope = get_parent_scope(name) + # async functions have an extra wrapper. Strip it. + if parent_scope and parent_scope.type == 'async_stmt': + parent_scope = parent_scope.parent + return parent_scope in (module, None) + + names = [n for n in names if is_module_scope_name(n)] + return filter(def_ref_filter, names) + + +def split_search_string(name): + type, _, dotted_names = name.rpartition(' ') + if type == 'def': + type = 'function' + return type, dotted_names.split('.') diff --git a/.venv/lib/python3.8/site-packages/jedi/api/interpreter.py b/.venv/lib/python3.8/site-packages/jedi/api/interpreter.py new file mode 100644 index 00000000..bb7268a7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/api/interpreter.py @@ -0,0 +1,41 @@ +""" +TODO Some parts of this module are still not well documented. +""" + +from jedi.inference import compiled +from jedi.inference.compiled import mixed +from jedi.inference.compiled.access import create_access_path +from jedi.inference.context import ModuleContext + + +def _create(inference_state, obj): + return compiled.create_from_access_path( + inference_state, create_access_path(inference_state, obj) + ) + + +class NamespaceObject(object): + def __init__(self, dct): + self.__dict__ = dct + + +class MixedModuleContext(ModuleContext): + def __init__(self, tree_module_value, namespaces): + super(MixedModuleContext, self).__init__(tree_module_value) + self._namespace_objects = [NamespaceObject(n) for n in namespaces] + + def _get_mixed_object(self, compiled_value): + return mixed.MixedObject( + compiled_value=compiled_value, + tree_value=self._value + ) + + def get_filters(self, *args, **kwargs): + for filter in self._value.as_context().get_filters(*args, **kwargs): + yield filter + + for namespace_obj in self._namespace_objects: + compiled_value = _create(self.inference_state, namespace_obj) + mixed_object = self._get_mixed_object(compiled_value) + for filter in mixed_object.get_filters(*args, **kwargs): + yield filter diff --git a/.venv/lib/python3.8/site-packages/jedi/api/keywords.py b/.venv/lib/python3.8/site-packages/jedi/api/keywords.py new file mode 100644 index 00000000..dd57bb85 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/api/keywords.py @@ -0,0 +1,57 @@ +import pydoc + +from jedi.inference.utils import ignored +from jedi.inference.names import AbstractArbitraryName + +try: + from pydoc_data import topics as pydoc_topics +except ImportError: + # Python 2 + try: + import pydoc_topics + except ImportError: + # This is for Python 3 embeddable version, which dont have + # pydoc_data module in its file python3x.zip. + pydoc_topics = None + + +class KeywordName(AbstractArbitraryName): + api_type = u'keyword' + + def py__doc__(self): + return imitate_pydoc(self.string_name) + + +def imitate_pydoc(string): + """ + It's not possible to get the pydoc's without starting the annoying pager + stuff. + """ + if pydoc_topics is None: + return '' + + # str needed because of possible unicode stuff in py2k (pydoc doesn't work + # with unicode strings) + string = str(string) + h = pydoc.help + with ignored(KeyError): + # try to access symbols + string = h.symbols[string] + string, _, related = string.partition(' ') + + def get_target(s): + return h.topics.get(s, h.keywords.get(s)) + + while isinstance(string, str): + string = get_target(string) + + try: + # is a tuple now + label, related = string + except TypeError: + return '' + + try: + return pydoc_topics.topics[label].strip() if pydoc_topics else '' + except KeyError: + return '' diff --git a/.venv/lib/python3.8/site-packages/jedi/api/project.py b/.venv/lib/python3.8/site-packages/jedi/api/project.py new file mode 100644 index 00000000..a2b7c4c1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/api/project.py @@ -0,0 +1,420 @@ +""" +Projects are a way to handle Python projects within Jedi. For simpler plugins +you might not want to deal with projects, but if you want to give the user more +flexibility to define sys paths and Python interpreters for a project, +:class:`.Project` is the perfect way to allow for that. + +Projects can be saved to disk and loaded again, to allow project definitions to +be used across repositories. +""" +import os +import errno +import json +import sys + +from jedi._compatibility import FileNotFoundError, PermissionError, \ + IsADirectoryError, NotADirectoryError +from jedi import debug +from jedi.api.environment import get_cached_default_environment, create_environment +from jedi.api.exceptions import WrongVersion +from jedi.api.completion import search_in_module +from jedi.api.helpers import split_search_string, get_module_names +from jedi._compatibility import force_unicode +from jedi.inference.imports import load_module_from_path, \ + load_namespace_from_path, iter_module_names +from jedi.inference.sys_path import discover_buildout_paths +from jedi.inference.cache import inference_state_as_method_param_cache +from jedi.inference.references import recurse_find_python_folders_and_files, search_in_file_ios +from jedi.file_io import FolderIO +from jedi.common import traverse_parents + +_CONFIG_FOLDER = '.jedi' +_CONTAINS_POTENTIAL_PROJECT = \ + 'setup.py', '.git', '.hg', 'requirements.txt', 'MANIFEST.in', 'pyproject.toml' + +_SERIALIZER_VERSION = 1 + + +def _try_to_skip_duplicates(func): + def wrapper(*args, **kwargs): + found_tree_nodes = [] + found_modules = [] + for definition in func(*args, **kwargs): + tree_node = definition._name.tree_name + if tree_node is not None and tree_node in found_tree_nodes: + continue + if definition.type == 'module' and definition.module_path is not None: + if definition.module_path in found_modules: + continue + found_modules.append(definition.module_path) + yield definition + found_tree_nodes.append(tree_node) + return wrapper + + +def _remove_duplicates_from_path(path): + used = set() + for p in path: + if p in used: + continue + used.add(p) + yield p + + +def _force_unicode_list(lst): + return list(map(force_unicode, lst)) + + +class Project(object): + """ + Projects are a simple way to manage Python folders and define how Jedi does + import resolution. It is mostly used as a parameter to :class:`.Script`. + Additionally there are functions to search a whole project. + """ + _environment = None + + @staticmethod + def _get_config_folder_path(base_path): + return os.path.join(base_path, _CONFIG_FOLDER) + + @staticmethod + def _get_json_path(base_path): + return os.path.join(Project._get_config_folder_path(base_path), 'project.json') + + @classmethod + def load(cls, path): + """ + Loads a project from a specific path. You should not provide the path + to ``.jedi/project.json``, but rather the path to the project folder. + + :param path: The path of the directory you want to use as a project. + """ + with open(cls._get_json_path(path)) as f: + version, data = json.load(f) + + if version == 1: + return cls(**data) + else: + raise WrongVersion( + "The Jedi version of this project seems newer than what we can handle." + ) + + def save(self): + """ + Saves the project configuration in the project in ``.jedi/project.json``. + """ + data = dict(self.__dict__) + data.pop('_environment', None) + data.pop('_django', None) # TODO make django setting public? + data = {k.lstrip('_'): v for k, v in data.items()} + + # TODO when dropping Python 2 use pathlib.Path.mkdir(parents=True, exist_ok=True) + try: + os.makedirs(self._get_config_folder_path(self._path)) + except OSError as e: + if e.errno != errno.EEXIST: + raise + with open(self._get_json_path(self._path), 'w') as f: + return json.dump((_SERIALIZER_VERSION, data), f) + + def __init__(self, path, **kwargs): + """ + :param path: The base path for this project. + :param environment_path: The Python executable path, typically the path + of a virtual environment. + :param load_unsafe_extensions: Default False, Loads extensions that are not in the + sys path and in the local directories. With this option enabled, + this is potentially unsafe if you clone a git repository and + analyze it's code, because those compiled extensions will be + important and therefore have execution privileges. + :param sys_path: list of str. You can override the sys path if you + want. By default the ``sys.path.`` is generated by the + environment (virtualenvs, etc). + :param added_sys_path: list of str. Adds these paths at the end of the + sys path. + :param smart_sys_path: If this is enabled (default), adds paths from + local directories. Otherwise you will have to rely on your packages + being properly configured on the ``sys.path``. + """ + def py2_comp(path, environment_path=None, load_unsafe_extensions=False, + sys_path=None, added_sys_path=(), smart_sys_path=True): + self._path = os.path.abspath(path) + + self._environment_path = environment_path + self._sys_path = sys_path + self._smart_sys_path = smart_sys_path + self._load_unsafe_extensions = load_unsafe_extensions + self._django = False + self.added_sys_path = list(added_sys_path) + """The sys path that is going to be added at the end of the """ + + py2_comp(path, **kwargs) + + @inference_state_as_method_param_cache() + def _get_base_sys_path(self, inference_state): + # The sys path has not been set explicitly. + sys_path = list(inference_state.environment.get_sys_path()) + try: + sys_path.remove('') + except ValueError: + pass + return sys_path + + @inference_state_as_method_param_cache() + def _get_sys_path(self, inference_state, add_parent_paths=True, add_init_paths=False): + """ + Keep this method private for all users of jedi. However internally this + one is used like a public method. + """ + suffixed = list(self.added_sys_path) + prefixed = [] + + if self._sys_path is None: + sys_path = list(self._get_base_sys_path(inference_state)) + else: + sys_path = list(self._sys_path) + + if self._smart_sys_path: + prefixed.append(self._path) + + if inference_state.script_path is not None: + suffixed += discover_buildout_paths(inference_state, inference_state.script_path) + + if add_parent_paths: + # Collect directories in upward search by: + # 1. Skipping directories with __init__.py + # 2. Stopping immediately when above self._path + traversed = [] + for parent_path in traverse_parents(inference_state.script_path): + if parent_path == self._path or not parent_path.startswith(self._path): + break + if not add_init_paths \ + and os.path.isfile(os.path.join(parent_path, "__init__.py")): + continue + traversed.append(parent_path) + + # AFAIK some libraries have imports like `foo.foo.bar`, which + # leads to the conclusion to by default prefer longer paths + # rather than shorter ones by default. + suffixed += reversed(traversed) + + if self._django: + prefixed.append(self._path) + + path = prefixed + sys_path + suffixed + return list(_force_unicode_list(_remove_duplicates_from_path(path))) + + def get_environment(self): + if self._environment is None: + if self._environment_path is not None: + self._environment = create_environment(self._environment_path, safe=False) + else: + self._environment = get_cached_default_environment() + return self._environment + + def search(self, string, **kwargs): + """ + Searches a name in the whole project. If the project is very big, + at some point Jedi will stop searching. However it's also very much + recommended to not exhaust the generator. Just display the first ten + results to the user. + + There are currently three different search patterns: + + - ``foo`` to search for a definition foo in any file or a file called + ``foo.py`` or ``foo.pyi``. + - ``foo.bar`` to search for the ``foo`` and then an attribute ``bar`` + in it. + - ``class foo.bar.Bar`` or ``def foo.bar.baz`` to search for a specific + API type. + + :param bool all_scopes: Default False; searches not only for + definitions on the top level of a module level, but also in + functions and classes. + :yields: :class:`.Name` + """ + return self._search(string, **kwargs) + + def complete_search(self, string, **kwargs): + """ + Like :meth:`.Script.search`, but completes that string. An empty string + lists all definitions in a project, so be careful with that. + + :param bool all_scopes: Default False; searches not only for + definitions on the top level of a module level, but also in + functions and classes. + :yields: :class:`.Completion` + """ + return self._search_func(string, complete=True, **kwargs) + + def _search(self, string, all_scopes=False): # Python 2.. + return self._search_func(string, all_scopes=all_scopes) + + @_try_to_skip_duplicates + def _search_func(self, string, complete=False, all_scopes=False): + # Using a Script is they easiest way to get an empty module context. + from jedi import Script + s = Script('', project=self) + inference_state = s._inference_state + empty_module_context = s._get_module_context() + + if inference_state.grammar.version_info < (3, 6) or sys.version_info < (3, 6): + raise NotImplementedError( + "No support for refactorings/search on Python 2/3.5" + ) + debug.dbg('Search for string %s, complete=%s', string, complete) + wanted_type, wanted_names = split_search_string(string) + name = wanted_names[0] + stub_folder_name = name + '-stubs' + + ios = recurse_find_python_folders_and_files(FolderIO(self._path)) + file_ios = [] + + # 1. Search for modules in the current project + for folder_io, file_io in ios: + if file_io is None: + file_name = folder_io.get_base_name() + if file_name == name or file_name == stub_folder_name: + f = folder_io.get_file_io('__init__.py') + try: + m = load_module_from_path(inference_state, f).as_context() + except FileNotFoundError: + f = folder_io.get_file_io('__init__.pyi') + try: + m = load_module_from_path(inference_state, f).as_context() + except FileNotFoundError: + m = load_namespace_from_path(inference_state, folder_io).as_context() + else: + continue + else: + file_ios.append(file_io) + file_name = os.path.basename(file_io.path) + if file_name in (name + '.py', name + '.pyi'): + m = load_module_from_path(inference_state, file_io).as_context() + else: + continue + + debug.dbg('Search of a specific module %s', m) + for x in search_in_module( + inference_state, + m, + names=[m.name], + wanted_type=wanted_type, + wanted_names=wanted_names, + complete=complete, + convert=True, + ignore_imports=True, + ): + yield x # Python 2... + + # 2. Search for identifiers in the project. + for module_context in search_in_file_ios(inference_state, file_ios, name): + names = get_module_names(module_context.tree_node, all_scopes=all_scopes) + names = [module_context.create_name(n) for n in names] + names = _remove_imports(names) + for x in search_in_module( + inference_state, + module_context, + names=names, + wanted_type=wanted_type, + wanted_names=wanted_names, + complete=complete, + ignore_imports=True, + ): + yield x # Python 2... + + # 3. Search for modules on sys.path + sys_path = [ + p for p in self._get_sys_path(inference_state) + # Exclude folders that are handled by recursing of the Python + # folders. + if not p.startswith(self._path) + ] + names = list(iter_module_names(inference_state, empty_module_context, sys_path)) + for x in search_in_module( + inference_state, + empty_module_context, + names=names, + wanted_type=wanted_type, + wanted_names=wanted_names, + complete=complete, + convert=True, + ): + yield x # Python 2... + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._path) + + +def _is_potential_project(path): + for name in _CONTAINS_POTENTIAL_PROJECT: + if os.path.exists(os.path.join(path, name)): + return True + return False + + +def _is_django_path(directory): + """ Detects the path of the very well known Django library (if used) """ + try: + with open(os.path.join(directory, 'manage.py'), 'rb') as f: + return b"DJANGO_SETTINGS_MODULE" in f.read() + except (FileNotFoundError, IsADirectoryError, PermissionError): + return False + + +def get_default_project(path=None): + """ + If a project is not defined by the user, Jedi tries to define a project by + itself as well as possible. Jedi traverses folders until it finds one of + the following: + + 1. A ``.jedi/config.json`` + 2. One of the following files: ``setup.py``, ``.git``, ``.hg``, + ``requirements.txt`` and ``MANIFEST.in``. + """ + if path is None: + path = os.getcwd() + + check = os.path.realpath(path) + probable_path = None + first_no_init_file = None + for dir in traverse_parents(check, include_current=True): + try: + return Project.load(dir) + except (FileNotFoundError, IsADirectoryError, PermissionError): + pass + except NotADirectoryError: + continue + + if first_no_init_file is None: + if os.path.exists(os.path.join(dir, '__init__.py')): + # In the case that a __init__.py exists, it's in 99% just a + # Python package and the project sits at least one level above. + continue + else: + first_no_init_file = dir + + if _is_django_path(dir): + project = Project(dir) + project._django = True + return project + + if probable_path is None and _is_potential_project(dir): + probable_path = dir + + if probable_path is not None: + # TODO search for setup.py etc + return Project(probable_path) + + if first_no_init_file is not None: + return Project(first_no_init_file) + + curdir = path if os.path.isdir(path) else os.path.dirname(path) + return Project(curdir) + + +def _remove_imports(names): + return [ + n for n in names + if n.tree_name is None or n.api_type != 'module' + ] diff --git a/.venv/lib/python3.8/site-packages/jedi/api/refactoring/__init__.py b/.venv/lib/python3.8/site-packages/jedi/api/refactoring/__init__.py new file mode 100644 index 00000000..f05517d2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/api/refactoring/__init__.py @@ -0,0 +1,249 @@ +from os.path import dirname, basename, join, relpath +import os +import re +import difflib + +from parso import split_lines + +from jedi.api.exceptions import RefactoringError + +EXPRESSION_PARTS = ( + 'or_test and_test not_test comparison ' + 'expr xor_expr and_expr shift_expr arith_expr term factor power atom_expr' +).split() + + +class ChangedFile(object): + def __init__(self, inference_state, from_path, to_path, + module_node, node_to_str_map): + self._inference_state = inference_state + self._from_path = from_path + self._to_path = to_path + self._module_node = module_node + self._node_to_str_map = node_to_str_map + + def get_diff(self): + old_lines = split_lines(self._module_node.get_code(), keepends=True) + new_lines = split_lines(self.get_new_code(), keepends=True) + + # Add a newline at the end if it's missing. Otherwise the diff will be + # very weird. A `diff -u file1 file2` would show the string: + # + # \ No newline at end of file + # + # This is not necessary IMO, because Jedi does not really play with + # newlines and the ending newline does not really matter in Python + # files. ~dave + if old_lines[-1] != '': + old_lines[-1] += '\n' + if new_lines[-1] != '': + new_lines[-1] += '\n' + + project_path = self._inference_state.project._path + if self._from_path is None: + from_p = '' + else: + from_p = relpath(self._from_path, project_path) + if self._to_path is None: + to_p = '' + else: + to_p = relpath(self._to_path, project_path) + diff = difflib.unified_diff( + old_lines, new_lines, + fromfile=from_p, + tofile=to_p, + ) + # Apparently there's a space at the end of the diff - for whatever + # reason. + return ''.join(diff).rstrip(' ') + + def get_new_code(self): + return self._inference_state.grammar.refactor(self._module_node, self._node_to_str_map) + + def apply(self): + if self._from_path is None: + raise RefactoringError( + 'Cannot apply a refactoring on a Script with path=None' + ) + + with open(self._from_path, 'w', newline='') as f: + f.write(self.get_new_code()) + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._from_path) + + +class Refactoring(object): + def __init__(self, inference_state, file_to_node_changes, renames=()): + self._inference_state = inference_state + self._renames = renames + self._file_to_node_changes = file_to_node_changes + + def get_changed_files(self): + """ + Returns a path to ``ChangedFile`` map. + """ + def calculate_to_path(p): + if p is None: + return p + for from_, to in renames: + if p.startswith(from_): + p = to + p[len(from_):] + return p + + renames = self.get_renames() + return { + path: ChangedFile( + self._inference_state, + from_path=path, + to_path=calculate_to_path(path), + module_node=next(iter(map_)).get_root_node(), + node_to_str_map=map_ + ) for path, map_ in sorted(self._file_to_node_changes.items()) + } + + def get_renames(self): + """ + Files can be renamed in a refactoring. + + Returns ``Iterable[Tuple[str, str]]``. + """ + return sorted(self._renames) + + def get_diff(self): + text = '' + project_path = self._inference_state.project._path + for from_, to in self.get_renames(): + text += 'rename from %s\nrename to %s\n' \ + % (relpath(from_, project_path), relpath(to, project_path)) + + return text + ''.join(f.get_diff() for f in self.get_changed_files().values()) + + def apply(self): + """ + Applies the whole refactoring to the files, which includes renames. + """ + for f in self.get_changed_files().values(): + f.apply() + + for old, new in self.get_renames(): + os.rename(old, new) + + +def _calculate_rename(path, new_name): + name = basename(path) + dir_ = dirname(path) + if name in ('__init__.py', '__init__.pyi'): + parent_dir = dirname(dir_) + return dir_, join(parent_dir, new_name) + ending = re.search(r'\.pyi?$', name).group(0) + return path, join(dir_, new_name + ending) + + +def rename(inference_state, definitions, new_name): + file_renames = set() + file_tree_name_map = {} + + if not definitions: + raise RefactoringError("There is no name under the cursor") + + for d in definitions: + tree_name = d._name.tree_name + if d.type == 'module' and tree_name is None: + file_renames.add(_calculate_rename(d.module_path, new_name)) + else: + # This private access is ok in a way. It's not public to + # protect Jedi users from seeing it. + if tree_name is not None: + fmap = file_tree_name_map.setdefault(d.module_path, {}) + fmap[tree_name] = tree_name.prefix + new_name + return Refactoring(inference_state, file_tree_name_map, file_renames) + + +def inline(inference_state, names): + if not names: + raise RefactoringError("There is no name under the cursor") + if any(n.api_type == 'module' for n in names): + raise RefactoringError("Cannot inline imports or modules") + if any(n.tree_name is None for n in names): + raise RefactoringError("Cannot inline builtins/extensions") + + definitions = [n for n in names if n.tree_name.is_definition()] + if len(definitions) == 0: + raise RefactoringError("No definition found to inline") + if len(definitions) > 1: + raise RefactoringError("Cannot inline a name with multiple definitions") + if len(names) == 1: + raise RefactoringError("There are no references to this name") + + tree_name = definitions[0].tree_name + + expr_stmt = tree_name.get_definition() + if expr_stmt.type != 'expr_stmt': + type_ = dict( + funcdef='function', + classdef='class', + ).get(expr_stmt.type, expr_stmt.type) + raise RefactoringError("Cannot inline a %s" % type_) + + if len(expr_stmt.get_defined_names(include_setitem=True)) > 1: + raise RefactoringError("Cannot inline a statement with multiple definitions") + first_child = expr_stmt.children[1] + if first_child.type == 'annassign' and len(first_child.children) == 4: + first_child = first_child.children[2] + if first_child != '=': + if first_child.type == 'annassign': + raise RefactoringError( + 'Cannot inline a statement that is defined by an annotation' + ) + else: + raise RefactoringError( + 'Cannot inline a statement with "%s"' + % first_child.get_code(include_prefix=False) + ) + + rhs = expr_stmt.get_rhs() + replace_code = rhs.get_code(include_prefix=False) + + references = [n for n in names if not n.tree_name.is_definition()] + file_to_node_changes = {} + for name in references: + tree_name = name.tree_name + path = name.get_root_context().py__file__() + s = replace_code + if rhs.type == 'testlist_star_expr' \ + or tree_name.parent.type in EXPRESSION_PARTS \ + or tree_name.parent.type == 'trailer' \ + and tree_name.parent.get_next_sibling() is not None: + s = '(' + replace_code + ')' + + of_path = file_to_node_changes.setdefault(path, {}) + + n = tree_name + prefix = n.prefix + par = n.parent + if par.type == 'trailer' and par.children[0] == '.': + prefix = par.parent.children[0].prefix + n = par + for some_node in par.parent.children[:par.parent.children.index(par)]: + of_path[some_node] = '' + of_path[n] = prefix + s + + path = definitions[0].get_root_context().py__file__() + changes = file_to_node_changes.setdefault(path, {}) + changes[expr_stmt] = _remove_indent_of_prefix(expr_stmt.get_first_leaf().prefix) + next_leaf = expr_stmt.get_next_leaf() + + # Most of the time we have to remove the newline at the end of the + # statement, but if there's a comment we might not need to. + if next_leaf.prefix.strip(' \t') == '' \ + and (next_leaf.type == 'newline' or next_leaf == ';'): + changes[next_leaf] = '' + return Refactoring(inference_state, file_to_node_changes) + + +def _remove_indent_of_prefix(prefix): + r""" + Removes the last indentation of a prefix, e.g. " \n \n " becomes " \n \n". + """ + return ''.join(split_lines(prefix, keepends=True)[:-1]) diff --git a/.venv/lib/python3.8/site-packages/jedi/api/refactoring/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/api/refactoring/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..09b5bba7 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/api/refactoring/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/api/refactoring/__pycache__/extract.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/api/refactoring/__pycache__/extract.cpython-38.pyc new file mode 100644 index 00000000..4dc8ec79 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/api/refactoring/__pycache__/extract.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/api/refactoring/extract.py b/.venv/lib/python3.8/site-packages/jedi/api/refactoring/extract.py new file mode 100644 index 00000000..ad2ded9c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/api/refactoring/extract.py @@ -0,0 +1,387 @@ +from textwrap import dedent + +from parso import split_lines + +from jedi import debug +from jedi.api.exceptions import RefactoringError +from jedi.api.refactoring import Refactoring, EXPRESSION_PARTS +from jedi.common import indent_block +from jedi.parser_utils import function_is_classmethod, function_is_staticmethod + + +_DEFINITION_SCOPES = ('suite', 'file_input') +_VARIABLE_EXCTRACTABLE = EXPRESSION_PARTS + \ + ('atom testlist_star_expr testlist test lambdef lambdef_nocond ' + 'keyword name number string fstring').split() + + +def extract_variable(inference_state, path, module_node, name, pos, until_pos): + nodes = _find_nodes(module_node, pos, until_pos) + debug.dbg('Extracting nodes: %s', nodes) + + is_expression, message = _is_expression_with_error(nodes) + if not is_expression: + raise RefactoringError(message) + + generated_code = name + ' = ' + _expression_nodes_to_string(nodes) + file_to_node_changes = {path: _replace(nodes, name, generated_code, pos)} + return Refactoring(inference_state, file_to_node_changes) + + +def _is_expression_with_error(nodes): + """ + Returns a tuple (is_expression, error_string). + """ + if any(node.type == 'name' and node.is_definition() for node in nodes): + return False, 'Cannot extract a name that defines something' + + if nodes[0].type not in _VARIABLE_EXCTRACTABLE: + return False, 'Cannot extract a "%s"' % nodes[0].type + return True, '' + + +def _find_nodes(module_node, pos, until_pos): + """ + Looks up a module and tries to find the appropriate amount of nodes that + are in there. + """ + start_node = module_node.get_leaf_for_position(pos, include_prefixes=True) + + if until_pos is None: + if start_node.type == 'operator': + next_leaf = start_node.get_next_leaf() + if next_leaf is not None and next_leaf.start_pos == pos: + start_node = next_leaf + + if _is_not_extractable_syntax(start_node): + start_node = start_node.parent + + if start_node.parent.type == 'trailer': + start_node = start_node.parent.parent + while start_node.parent.type in EXPRESSION_PARTS: + start_node = start_node.parent + + nodes = [start_node] + else: + # Get the next leaf if we are at the end of a leaf + if start_node.end_pos == pos: + next_leaf = start_node.get_next_leaf() + if next_leaf is not None: + start_node = next_leaf + + # Some syntax is not exactable, just use its parent + if _is_not_extractable_syntax(start_node): + start_node = start_node.parent + + # Find the end + end_leaf = module_node.get_leaf_for_position(until_pos, include_prefixes=True) + if end_leaf.start_pos > until_pos: + end_leaf = end_leaf.get_previous_leaf() + if end_leaf is None: + raise RefactoringError('Cannot extract anything from that') + + parent_node = start_node + while parent_node.end_pos < end_leaf.end_pos: + parent_node = parent_node.parent + + nodes = _remove_unwanted_expression_nodes(parent_node, pos, until_pos) + + # If the user marks just a return statement, we return the expression + # instead of the whole statement, because the user obviously wants to + # extract that part. + if len(nodes) == 1 and start_node.type in ('return_stmt', 'yield_expr'): + return [nodes[0].children[1]] + return nodes + + +def _replace(nodes, expression_replacement, extracted, pos, + insert_before_leaf=None, remaining_prefix=None): + # Now try to replace the nodes found with a variable and move the code + # before the current statement. + definition = _get_parent_definition(nodes[0]) + if insert_before_leaf is None: + insert_before_leaf = definition.get_first_leaf() + first_node_leaf = nodes[0].get_first_leaf() + + lines = split_lines(insert_before_leaf.prefix, keepends=True) + if first_node_leaf is insert_before_leaf: + if remaining_prefix is not None: + # The remaining prefix has already been calculated. + lines[:-1] = remaining_prefix + lines[-1:-1] = [indent_block(extracted, lines[-1]) + '\n'] + extracted_prefix = ''.join(lines) + + replacement_dct = {} + if first_node_leaf is insert_before_leaf: + replacement_dct[nodes[0]] = extracted_prefix + expression_replacement + else: + if remaining_prefix is None: + p = first_node_leaf.prefix + else: + p = remaining_prefix + _get_indentation(nodes[0]) + replacement_dct[nodes[0]] = p + expression_replacement + replacement_dct[insert_before_leaf] = extracted_prefix + insert_before_leaf.value + + for node in nodes[1:]: + replacement_dct[node] = '' + return replacement_dct + + +def _expression_nodes_to_string(nodes): + return ''.join(n.get_code(include_prefix=i != 0) for i, n in enumerate(nodes)) + + +def _suite_nodes_to_string(nodes, pos): + n = nodes[0] + prefix, part_of_code = _split_prefix_at(n.get_first_leaf(), pos[0] - 1) + code = part_of_code + n.get_code(include_prefix=False) \ + + ''.join(n.get_code() for n in nodes[1:]) + return prefix, code + + +def _split_prefix_at(leaf, until_line): + """ + Returns a tuple of the leaf's prefix, split at the until_line + position. + """ + # second means the second returned part + second_line_count = leaf.start_pos[0] - until_line + lines = split_lines(leaf.prefix, keepends=True) + return ''.join(lines[:-second_line_count]), ''.join(lines[-second_line_count:]) + + +def _get_indentation(node): + return split_lines(node.get_first_leaf().prefix)[-1] + + +def _get_parent_definition(node): + """ + Returns the statement where a node is defined. + """ + while node is not None: + if node.parent.type in _DEFINITION_SCOPES: + return node + node = node.parent + raise NotImplementedError('We should never even get here') + + +def _remove_unwanted_expression_nodes(parent_node, pos, until_pos): + """ + This function makes it so for `1 * 2 + 3` you can extract `2 + 3`, even + though it is not part of the expression. + """ + typ = parent_node.type + is_suite_part = typ in ('suite', 'file_input') + if typ in EXPRESSION_PARTS or is_suite_part: + nodes = parent_node.children + for i, n in enumerate(nodes): + if n.end_pos > pos: + start_index = i + if n.type == 'operator': + start_index -= 1 + break + for i, n in reversed(list(enumerate(nodes))): + if n.start_pos < until_pos: + end_index = i + if n.type == 'operator': + end_index += 1 + + # Something like `not foo or bar` should not be cut after not + for n2 in nodes[i:]: + if _is_not_extractable_syntax(n2): + end_index += 1 + else: + break + break + nodes = nodes[start_index:end_index + 1] + if not is_suite_part: + nodes[0:1] = _remove_unwanted_expression_nodes(nodes[0], pos, until_pos) + nodes[-1:] = _remove_unwanted_expression_nodes(nodes[-1], pos, until_pos) + return nodes + return [parent_node] + + +def _is_not_extractable_syntax(node): + return node.type == 'operator' \ + or node.type == 'keyword' and node.value not in ('None', 'True', 'False') + + +def extract_function(inference_state, path, module_context, name, pos, until_pos): + nodes = _find_nodes(module_context.tree_node, pos, until_pos) + assert len(nodes) + + is_expression, _ = _is_expression_with_error(nodes) + context = module_context.create_context(nodes[0]) + is_bound_method = context.is_bound_method() + params, return_variables = list(_find_inputs_and_outputs(module_context, context, nodes)) + + # Find variables + # Is a class method / method + if context.is_module(): + insert_before_leaf = None # Leaf will be determined later + else: + node = _get_code_insertion_node(context.tree_node, is_bound_method) + insert_before_leaf = node.get_first_leaf() + if is_expression: + code_block = 'return ' + _expression_nodes_to_string(nodes) + '\n' + remaining_prefix = None + has_ending_return_stmt = False + else: + has_ending_return_stmt = _is_node_ending_return_stmt(nodes[-1]) + if not has_ending_return_stmt: + # Find the actually used variables (of the defined ones). If none are + # used (e.g. if the range covers the whole function), return the last + # defined variable. + return_variables = list(_find_needed_output_variables( + context, + nodes[0].parent, + nodes[-1].end_pos, + return_variables + )) or [return_variables[-1]] if return_variables else [] + + remaining_prefix, code_block = _suite_nodes_to_string(nodes, pos) + after_leaf = nodes[-1].get_next_leaf() + first, second = _split_prefix_at(after_leaf, until_pos[0]) + code_block += first + + code_block = dedent(code_block) + if not has_ending_return_stmt: + output_var_str = ', '.join(return_variables) + code_block += 'return ' + output_var_str + '\n' + + # Check if we have to raise RefactoringError + _check_for_non_extractables(nodes[:-1] if has_ending_return_stmt else nodes) + + decorator = '' + self_param = None + if is_bound_method: + if not function_is_staticmethod(context.tree_node): + function_param_names = context.get_value().get_param_names() + if len(function_param_names): + self_param = function_param_names[0].string_name + params = [p for p in params if p != self_param] + + if function_is_classmethod(context.tree_node): + decorator = '@classmethod\n' + else: + code_block += '\n' + + function_code = '%sdef %s(%s):\n%s' % ( + decorator, + name, + ', '.join(params if self_param is None else [self_param] + params), + indent_block(code_block) + ) + + function_call = '%s(%s)' % ( + ('' if self_param is None else self_param + '.') + name, + ', '.join(params) + ) + if is_expression: + replacement = function_call + else: + if has_ending_return_stmt: + replacement = 'return ' + function_call + '\n' + else: + replacement = output_var_str + ' = ' + function_call + '\n' + + replacement_dct = _replace(nodes, replacement, function_code, pos, + insert_before_leaf, remaining_prefix) + if not is_expression: + replacement_dct[after_leaf] = second + after_leaf.value + file_to_node_changes = {path: replacement_dct} + return Refactoring(inference_state, file_to_node_changes) + + +def _check_for_non_extractables(nodes): + for n in nodes: + try: + children = n.children + except AttributeError: + if n.value == 'return': + raise RefactoringError( + 'Can only extract return statements if they are at the end.') + if n.value == 'yield': + raise RefactoringError('Cannot extract yield statements.') + else: + _check_for_non_extractables(children) + + +def _is_name_input(module_context, names, first, last): + for name in names: + if name.api_type == 'param' or not name.parent_context.is_module(): + if name.get_root_context() is not module_context: + return True + if name.start_pos is None or not (first <= name.start_pos < last): + return True + return False + + +def _find_inputs_and_outputs(module_context, context, nodes): + first = nodes[0].start_pos + last = nodes[-1].end_pos + + inputs = [] + outputs = [] + for name in _find_non_global_names(nodes): + if name.is_definition(): + if name not in outputs: + outputs.append(name.value) + else: + if name.value not in inputs: + name_definitions = context.goto(name, name.start_pos) + if not name_definitions \ + or _is_name_input(module_context, name_definitions, first, last): + inputs.append(name.value) + + # Check if outputs are really needed: + return inputs, outputs + + +def _find_non_global_names(nodes): + for node in nodes: + try: + children = node.children + except AttributeError: + if node.type == 'name': + yield node + else: + # We only want to check foo in foo.bar + if node.type == 'trailer' and node.children[0] == '.': + continue + + for x in _find_non_global_names(children): # Python 2... + yield x + + +def _get_code_insertion_node(node, is_bound_method): + if not is_bound_method or function_is_staticmethod(node): + while node.parent.type != 'file_input': + node = node.parent + + while node.parent.type in ('async_funcdef', 'decorated', 'async_stmt'): + node = node.parent + return node + + +def _find_needed_output_variables(context, search_node, at_least_pos, return_variables): + """ + Searches everything after at_least_pos in a node and checks if any of the + return_variables are used in there and returns those. + """ + for node in search_node.children: + if node.start_pos < at_least_pos: + continue + + return_variables = set(return_variables) + for name in _find_non_global_names([node]): + if not name.is_definition() and name.value in return_variables: + return_variables.remove(name.value) + yield name.value + + +def _is_node_ending_return_stmt(node): + t = node.type + if t == 'simple_stmt': + return _is_node_ending_return_stmt(node.children[0]) + return t == 'return_stmt' diff --git a/.venv/lib/python3.8/site-packages/jedi/api/replstartup.py b/.venv/lib/python3.8/site-packages/jedi/api/replstartup.py new file mode 100644 index 00000000..38aa8e6f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/api/replstartup.py @@ -0,0 +1,29 @@ +""" +To use Jedi completion in Python interpreter, add the following in your shell +setup (e.g., ``.bashrc``). This works only on Linux/Mac, because readline is +not available on Windows. If you still want Jedi autocompletion in your REPL, +just use IPython instead:: + + export PYTHONSTARTUP="$(python -m jedi repl)" + +Then you will be able to use Jedi completer in your Python interpreter:: + + $ python + Python 2.7.2+ (default, Jul 20 2012, 22:15:08) + [GCC 4.6.1] on linux2 + Type "help", "copyright", "credits" or "license" for more information. + >>> import os + >>> os.path.join('a', 'b').split().in # doctest: +SKIP + ..dex ..sert + +""" +import jedi.utils +from jedi import __version__ as __jedi_version__ + +print('REPL completion using Jedi %s' % __jedi_version__) +jedi.utils.setup_readline(fuzzy=False) + +del jedi + +# Note: try not to do many things here, as it will contaminate global +# namespace of the interpreter. diff --git a/.venv/lib/python3.8/site-packages/jedi/api/strings.py b/.venv/lib/python3.8/site-packages/jedi/api/strings.py new file mode 100644 index 00000000..6653671e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/api/strings.py @@ -0,0 +1,109 @@ +""" +This module is here for string completions. This means mostly stuff where +strings are returned, like `foo = dict(bar=3); foo["ba` would complete to +`"bar"]`. + +It however does the same for numbers. The difference between string completions +and other completions is mostly that this module doesn't return defined +names in a module, but pretty much an arbitrary string. +""" +import re + +from jedi._compatibility import unicode +from jedi.inference.names import AbstractArbitraryName +from jedi.inference.helpers import infer_call_of_leaf +from jedi.api.classes import Completion +from jedi.parser_utils import cut_value_at_position + +_sentinel = object() + + +class StringName(AbstractArbitraryName): + api_type = u'string' + is_value_name = False + + +def complete_dict(module_context, code_lines, leaf, position, string, fuzzy): + bracket_leaf = leaf + if bracket_leaf != '[': + bracket_leaf = leaf.get_previous_leaf() + + cut_end_quote = '' + if string: + cut_end_quote = get_quote_ending(string, code_lines, position, invert_result=True) + + if bracket_leaf == '[': + if string is None and leaf is not bracket_leaf: + string = cut_value_at_position(leaf, position) + + context = module_context.create_context(bracket_leaf) + before_bracket_leaf = bracket_leaf.get_previous_leaf() + if before_bracket_leaf.type in ('atom', 'trailer', 'name'): + values = infer_call_of_leaf(context, before_bracket_leaf) + return list(_completions_for_dicts( + module_context.inference_state, + values, + '' if string is None else string, + cut_end_quote, + fuzzy=fuzzy, + )) + return [] + + +def _completions_for_dicts(inference_state, dicts, literal_string, cut_end_quote, fuzzy): + for dict_key in sorted(_get_python_keys(dicts), key=lambda x: repr(x)): + dict_key_str = _create_repr_string(literal_string, dict_key) + if dict_key_str.startswith(literal_string): + name = StringName(inference_state, dict_key_str[:-len(cut_end_quote) or None]) + yield Completion( + inference_state, + name, + stack=None, + like_name_length=len(literal_string), + is_fuzzy=fuzzy + ) + + +def _create_repr_string(literal_string, dict_key): + if not isinstance(dict_key, (unicode, bytes)) or not literal_string: + return repr(dict_key) + + r = repr(dict_key) + prefix, quote = _get_string_prefix_and_quote(literal_string) + if quote is None: + return r + if quote == r[0]: + return prefix + r + return prefix + quote + r[1:-1] + quote + + +def _get_python_keys(dicts): + for dct in dicts: + if dct.array_type == 'dict': + for key in dct.get_key_values(): + dict_key = key.get_safe_value(default=_sentinel) + if dict_key is not _sentinel: + yield dict_key + + +def _get_string_prefix_and_quote(string): + match = re.match(r'(\w*)("""|\'{3}|"|\')', string) + if match is None: + return None, None + return match.group(1), match.group(2) + + +def _matches_quote_at_position(code_lines, quote, position): + string = code_lines[position[0] - 1][position[1]:position[1] + len(quote)] + return string == quote + + +def get_quote_ending(string, code_lines, position, invert_result=False): + _, quote = _get_string_prefix_and_quote(string) + if quote is None: + return '' + + # Add a quote only if it's not already there. + if _matches_quote_at_position(code_lines, quote, position) != invert_result: + return '' + return quote diff --git a/.venv/lib/python3.8/site-packages/jedi/cache.py b/.venv/lib/python3.8/site-packages/jedi/cache.py new file mode 100644 index 00000000..29ed979f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/cache.py @@ -0,0 +1,114 @@ +""" +This caching is very important for speed and memory optimizations. There's +nothing really spectacular, just some decorators. The following cache types are +available: + +- ``time_cache`` can be used to cache something for just a limited time span, + which can be useful if there's user interaction and the user cannot react + faster than a certain time. + +This module is one of the reasons why |jedi| is not thread-safe. As you can see +there are global variables, which are holding the cache information. Some of +these variables are being cleaned after every API usage. +""" +import time +from functools import wraps + +from jedi import settings +from parso.cache import parser_cache + +_time_caches = {} + + +def clear_time_caches(delete_all=False): + """ Jedi caches many things, that should be completed after each completion + finishes. + + :param delete_all: Deletes also the cache that is normally not deleted, + like parser cache, which is important for faster parsing. + """ + global _time_caches + + if delete_all: + for cache in _time_caches.values(): + cache.clear() + parser_cache.clear() + else: + # normally just kill the expired entries, not all + for tc in _time_caches.values(): + # check time_cache for expired entries + for key, (t, value) in list(tc.items()): + if t < time.time(): + # delete expired entries + del tc[key] + + +def signature_time_cache(time_add_setting): + """ + This decorator works as follows: Call it with a setting and after that + use the function with a callable that returns the key. + But: This function is only called if the key is not available. After a + certain amount of time (`time_add_setting`) the cache is invalid. + + If the given key is None, the function will not be cached. + """ + def _temp(key_func): + dct = {} + _time_caches[time_add_setting] = dct + + def wrapper(*args, **kwargs): + generator = key_func(*args, **kwargs) + key = next(generator) + try: + expiry, value = dct[key] + if expiry > time.time(): + return value + except KeyError: + pass + + value = next(generator) + time_add = getattr(settings, time_add_setting) + if key is not None: + dct[key] = time.time() + time_add, value + return value + return wrapper + return _temp + + +def time_cache(seconds): + def decorator(func): + cache = {} + + @wraps(func) + def wrapper(*args, **kwargs): + key = (args, frozenset(kwargs.items())) + try: + created, result = cache[key] + if time.time() < created + seconds: + return result + except KeyError: + pass + result = func(*args, **kwargs) + cache[key] = time.time(), result + return result + + wrapper.clear_cache = lambda: cache.clear() + return wrapper + + return decorator + + +def memoize_method(method): + """A normal memoize function.""" + @wraps(method) + def wrapper(self, *args, **kwargs): + cache_dict = self.__dict__.setdefault('_memoize_method_dct', {}) + dct = cache_dict.setdefault(method, {}) + key = (args, frozenset(kwargs.items())) + try: + return dct[key] + except KeyError: + result = method(self, *args, **kwargs) + dct[key] = result + return result + return wrapper diff --git a/.venv/lib/python3.8/site-packages/jedi/common.py b/.venv/lib/python3.8/site-packages/jedi/common.py new file mode 100644 index 00000000..75b69299 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/common.py @@ -0,0 +1,36 @@ +import os +from contextlib import contextmanager + + +def traverse_parents(path, include_current=False): + if not include_current: + path = os.path.dirname(path) + + previous = None + while previous != path: + yield path + previous = path + path = os.path.dirname(path) + + +@contextmanager +def monkeypatch(obj, attribute_name, new_value): + """ + Like pytest's monkeypatch, but as a value manager. + """ + old_value = getattr(obj, attribute_name) + try: + setattr(obj, attribute_name, new_value) + yield + finally: + setattr(obj, attribute_name, old_value) + + +def indent_block(text, indention=' '): + """This function indents a text block with a default of four spaces.""" + temp = '' + while text and text[-1] == '\n': + temp += text[-1] + text = text[:-1] + lines = text.split('\n') + return '\n'.join(map(lambda s: indention + s, lines)) + temp diff --git a/.venv/lib/python3.8/site-packages/jedi/debug.py b/.venv/lib/python3.8/site-packages/jedi/debug.py new file mode 100644 index 00000000..753930e1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/debug.py @@ -0,0 +1,143 @@ +import os +import time +from contextlib import contextmanager + +from jedi._compatibility import encoding, is_py3, u + +_inited = False + + +def _lazy_colorama_init(): + """ + Lazily init colorama if necessary, not to screw up stdout if debugging is + not enabled. + + This version of the function does nothing. + """ + + +try: + if os.name == 'nt': + # Does not work on Windows, as pyreadline and colorama interfere + raise ImportError + else: + # Use colorama for nicer console output. + from colorama import Fore, init + from colorama import initialise + + def _lazy_colorama_init(): # noqa: F811 + """ + Lazily init colorama if necessary, not to screw up stdout is + debug not enabled. + + This version of the function does init colorama. + """ + global _inited + if not _inited: + # pytest resets the stream at the end - causes troubles. Since + # after every output the stream is reset automatically we don't + # need this. + initialise.atexit_done = True + try: + init(strip=False) + except Exception: + # Colorama fails with initializing under vim and is buggy in + # version 0.3.6. + pass + _inited = True + +except ImportError: + class Fore(object): + RED = '' + GREEN = '' + YELLOW = '' + MAGENTA = '' + RESET = '' + BLUE = '' + +NOTICE = object() +WARNING = object() +SPEED = object() + +enable_speed = False +enable_warning = False +enable_notice = False + +# callback, interface: level, str +debug_function = None +_debug_indent = 0 +_start_time = time.time() + + +def reset_time(): + global _start_time, _debug_indent + _start_time = time.time() + _debug_indent = 0 + + +def increase_indent(func): + """Decorator for makin """ + def wrapper(*args, **kwargs): + with increase_indent_cm(): + return func(*args, **kwargs) + return wrapper + + +@contextmanager +def increase_indent_cm(title=None, color='MAGENTA'): + global _debug_indent + if title: + dbg('Start: ' + title, color=color) + _debug_indent += 1 + try: + yield + finally: + _debug_indent -= 1 + if title: + dbg('End: ' + title, color=color) + + +def dbg(message, *args, **kwargs): + """ Looks at the stack, to see if a debug message should be printed. """ + # Python 2 compatibility, because it doesn't understand default args + color = kwargs.pop('color', 'GREEN') + assert color + + if debug_function and enable_notice: + i = ' ' * _debug_indent + _lazy_colorama_init() + debug_function(color, i + 'dbg: ' + message % tuple(u(repr(a)) for a in args)) + + +def warning(message, *args, **kwargs): + format = kwargs.pop('format', True) + assert not kwargs + + if debug_function and enable_warning: + i = ' ' * _debug_indent + if format: + message = message % tuple(u(repr(a)) for a in args) + debug_function('RED', i + 'warning: ' + message) + + +def speed(name): + if debug_function and enable_speed: + now = time.time() + i = ' ' * _debug_indent + debug_function('YELLOW', i + 'speed: ' + '%s %s' % (name, now - _start_time)) + + +def print_to_stdout(color, str_out): + """ + The default debug function that prints to standard out. + + :param str color: A string that is an attribute of ``colorama.Fore``. + """ + col = getattr(Fore, color) + _lazy_colorama_init() + if not is_py3: + str_out = str_out.encode(encoding, 'replace') + print(col + str_out + Fore.RESET) + + +# debug_function = print_to_stdout diff --git a/.venv/lib/python3.8/site-packages/jedi/file_io.py b/.venv/lib/python3.8/site-packages/jedi/file_io.py new file mode 100644 index 00000000..c4a5d24a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/file_io.py @@ -0,0 +1,83 @@ +import os + +from parso import file_io + + +class AbstractFolderIO(object): + def __init__(self, path): + self.path = path + + def get_base_name(self): + raise NotImplementedError + + def list(self): + raise NotImplementedError + + def get_file_io(self, name): + raise NotImplementedError + + def get_parent_folder(self): + raise NotImplementedError + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.path) + + +class FolderIO(AbstractFolderIO): + def get_base_name(self): + return os.path.basename(self.path) + + def list(self): + return os.listdir(self.path) + + def get_file_io(self, name): + return FileIO(os.path.join(self.path, name)) + + def get_parent_folder(self): + return FolderIO(os.path.dirname(self.path)) + + def walk(self): + for root, dirs, files in os.walk(self.path): + root_folder_io = FolderIO(root) + original_folder_ios = [FolderIO(os.path.join(root, d)) for d in dirs] + modified_folder_ios = list(original_folder_ios) + yield ( + root_folder_io, + modified_folder_ios, + [FileIO(os.path.join(root, f)) for f in files], + ) + modified_iterator = iter(reversed(modified_folder_ios)) + current = next(modified_iterator, None) + i = len(original_folder_ios) + for folder_io in reversed(original_folder_ios): + i -= 1 # Basically enumerate but reversed + if current is folder_io: + current = next(modified_iterator, None) + else: + del dirs[i] + + +class FileIOFolderMixin(object): + def get_parent_folder(self): + return FolderIO(os.path.dirname(self.path)) + + +class ZipFileIO(file_io.KnownContentFileIO, FileIOFolderMixin): + """For .zip and .egg archives""" + def __init__(self, path, code, zip_path): + super(ZipFileIO, self).__init__(path, code) + self._zip_path = zip_path + + def get_last_modified(self): + try: + return os.path.getmtime(self._zip_path) + except OSError: # Python 3 would probably only need FileNotFoundError + return None + + +class FileIO(file_io.FileIO, FileIOFolderMixin): + pass + + +class KnownContentFileIO(file_io.KnownContentFileIO, FileIOFolderMixin): + pass diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__init__.py b/.venv/lib/python3.8/site-packages/jedi/inference/__init__.py new file mode 100644 index 00000000..dbefc52a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/__init__.py @@ -0,0 +1,197 @@ +""" +Type inference of Python code in |jedi| is based on three assumptions: + +* The code uses as least side effects as possible. Jedi understands certain + list/tuple/set modifications, but there's no guarantee that Jedi detects + everything (list.append in different modules for example). +* No magic is being used: + + - metaclasses + - ``setattr()`` / ``__import__()`` + - writing to ``globals()``, ``locals()``, ``object.__dict__`` +* The programmer is not a total dick, e.g. like `this + `_ :-) + +The actual algorithm is based on a principle I call lazy type inference. That +said, the typical entry point for static analysis is calling +``infer_expr_stmt``. There's separate logic for autocompletion in the API, the +inference_state is all about inferring an expression. + +TODO this paragraph is not what jedi does anymore, it's similar, but not the +same. + +Now you need to understand what follows after ``infer_expr_stmt``. Let's +make an example:: + + import datetime + datetime.date.toda# <-- cursor here + +First of all, this module doesn't care about completion. It really just cares +about ``datetime.date``. At the end of the procedure ``infer_expr_stmt`` will +return the ``date`` class. + +To *visualize* this (simplified): + +- ``InferenceState.infer_expr_stmt`` doesn't do much, because there's no assignment. +- ``Context.infer_node`` cares for resolving the dotted path +- ``InferenceState.find_types`` searches for global definitions of datetime, which + it finds in the definition of an import, by scanning the syntax tree. +- Using the import logic, the datetime module is found. +- Now ``find_types`` is called again by ``infer_node`` to find ``date`` + inside the datetime module. + +Now what would happen if we wanted ``datetime.date.foo.bar``? Two more +calls to ``find_types``. However the second call would be ignored, because the +first one would return nothing (there's no foo attribute in ``date``). + +What if the import would contain another ``ExprStmt`` like this:: + + from foo import bar + Date = bar.baz + +Well... You get it. Just another ``infer_expr_stmt`` recursion. It's really +easy. Python can obviously get way more complicated then this. To understand +tuple assignments, list comprehensions and everything else, a lot more code had +to be written. + +Jedi has been tested very well, so you can just start modifying code. It's best +to write your own test first for your "new" feature. Don't be scared of +breaking stuff. As long as the tests pass, you're most likely to be fine. + +I need to mention now that lazy type inference is really good because it +only *inferes* what needs to be *inferred*. All the statements and modules +that are not used are just being ignored. +""" +import parso +from jedi.file_io import FileIO + +from jedi import debug +from jedi import settings +from jedi.inference import imports +from jedi.inference import recursion +from jedi.inference.cache import inference_state_function_cache +from jedi.inference import helpers +from jedi.inference.names import TreeNameDefinition +from jedi.inference.base_value import ContextualizedNode, \ + ValueSet, iterate_values +from jedi.inference.value import ClassValue, FunctionValue +from jedi.inference.syntax_tree import infer_expr_stmt, \ + check_tuple_assignments, tree_name_to_values +from jedi.inference.imports import follow_error_node_imports_if_possible +from jedi.plugins import plugin_manager + + +class InferenceState(object): + def __init__(self, project, environment=None, script_path=None): + if environment is None: + environment = project.get_environment() + self.environment = environment + self.script_path = script_path + self.compiled_subprocess = environment.get_inference_state_subprocess(self) + self.grammar = environment.get_grammar() + + self.latest_grammar = parso.load_grammar(version='3.7') + self.memoize_cache = {} # for memoize decorators + self.module_cache = imports.ModuleCache() # does the job of `sys.modules`. + self.stub_module_cache = {} # Dict[Tuple[str, ...], Optional[ModuleValue]] + self.compiled_cache = {} # see `inference.compiled.create()` + self.inferred_element_counts = {} + self.mixed_cache = {} # see `inference.compiled.mixed._create()` + self.analysis = [] + self.dynamic_params_depth = 0 + self.is_analysis = False + self.project = project + self.access_cache = {} + self.allow_descriptor_getattr = False + self.flow_analysis_enabled = True + + self.reset_recursion_limitations() + + def import_module(self, import_names, sys_path=None, prefer_stubs=True): + return imports.import_module_by_names( + self, import_names, sys_path, prefer_stubs=prefer_stubs) + + @staticmethod + @plugin_manager.decorate() + def execute(value, arguments): + debug.dbg('execute: %s %s', value, arguments) + with debug.increase_indent_cm(): + value_set = value.py__call__(arguments=arguments) + debug.dbg('execute result: %s in %s', value_set, value) + return value_set + + @property + @inference_state_function_cache() + def builtins_module(self): + module_name = u'builtins' + if self.environment.version_info.major == 2: + module_name = u'__builtin__' + builtins_module, = self.import_module((module_name,), sys_path=()) + return builtins_module + + @property + @inference_state_function_cache() + def typing_module(self): + typing_module, = self.import_module((u'typing',)) + return typing_module + + def reset_recursion_limitations(self): + self.recursion_detector = recursion.RecursionDetector() + self.execution_recursion_detector = recursion.ExecutionRecursionDetector(self) + + def get_sys_path(self, **kwargs): + """Convenience function""" + return self.project._get_sys_path(self, **kwargs) + + def infer(self, context, name): + def_ = name.get_definition(import_name_always=True) + if def_ is not None: + type_ = def_.type + is_classdef = type_ == 'classdef' + if is_classdef or type_ == 'funcdef': + if is_classdef: + c = ClassValue(self, context, name.parent) + else: + c = FunctionValue.from_context(context, name.parent) + return ValueSet([c]) + + if type_ == 'expr_stmt': + is_simple_name = name.parent.type not in ('power', 'trailer') + if is_simple_name: + return infer_expr_stmt(context, def_, name) + if type_ == 'for_stmt': + container_types = context.infer_node(def_.children[3]) + cn = ContextualizedNode(context, def_.children[3]) + for_types = iterate_values(container_types, cn) + n = TreeNameDefinition(context, name) + return check_tuple_assignments(n, for_types) + if type_ in ('import_from', 'import_name'): + return imports.infer_import(context, name) + if type_ == 'with_stmt': + return tree_name_to_values(self, context, name) + elif type_ == 'param': + return context.py__getattribute__(name.value, position=name.end_pos) + else: + result = follow_error_node_imports_if_possible(context, name) + if result is not None: + return result + + return helpers.infer_call_of_leaf(context, name) + + def parse_and_get_code(self, code=None, path=None, encoding='utf-8', + use_latest_grammar=False, file_io=None, **kwargs): + if code is None: + if file_io is None: + file_io = FileIO(path) + code = file_io.read() + # We cannot just use parso, because it doesn't use errors='replace'. + code = parso.python_bytes_to_unicode(code, encoding=encoding, errors='replace') + + if len(code) > settings._cropped_file_size: + code = code[:settings._cropped_file_size] + + grammar = self.latest_grammar if use_latest_grammar else self.grammar + return grammar.parse(code=code, path=path, file_io=file_io, **kwargs), code + + def parse(self, *args, **kwargs): + return self.parse_and_get_code(*args, **kwargs)[0] diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..dc3a1ae4 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/analysis.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/analysis.cpython-38.pyc new file mode 100644 index 00000000..97400b26 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/analysis.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/arguments.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/arguments.cpython-38.pyc new file mode 100644 index 00000000..5318d9e7 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/arguments.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/base_value.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/base_value.cpython-38.pyc new file mode 100644 index 00000000..992af3a0 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/base_value.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/cache.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/cache.cpython-38.pyc new file mode 100644 index 00000000..cda5cbd4 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/cache.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/context.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/context.cpython-38.pyc new file mode 100644 index 00000000..607cac7e Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/context.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/docstrings.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/docstrings.cpython-38.pyc new file mode 100644 index 00000000..99c258da Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/docstrings.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/dynamic_params.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/dynamic_params.cpython-38.pyc new file mode 100644 index 00000000..b1f09797 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/dynamic_params.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/filters.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/filters.cpython-38.pyc new file mode 100644 index 00000000..c405bafa Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/filters.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/finder.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/finder.cpython-38.pyc new file mode 100644 index 00000000..32e0ac82 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/finder.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/flow_analysis.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/flow_analysis.cpython-38.pyc new file mode 100644 index 00000000..71576c5c Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/flow_analysis.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/helpers.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/helpers.cpython-38.pyc new file mode 100644 index 00000000..1aae3852 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/helpers.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/imports.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/imports.cpython-38.pyc new file mode 100644 index 00000000..425f31b4 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/imports.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/lazy_value.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/lazy_value.cpython-38.pyc new file mode 100644 index 00000000..e73d61ce Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/lazy_value.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/names.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/names.cpython-38.pyc new file mode 100644 index 00000000..0e864d17 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/names.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/param.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/param.cpython-38.pyc new file mode 100644 index 00000000..c4e5a6dc Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/param.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/parser_cache.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/parser_cache.cpython-38.pyc new file mode 100644 index 00000000..3f9d5e4f Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/parser_cache.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/recursion.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/recursion.cpython-38.pyc new file mode 100644 index 00000000..96c4a598 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/recursion.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/references.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/references.cpython-38.pyc new file mode 100644 index 00000000..79d78d29 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/references.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/signature.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/signature.cpython-38.pyc new file mode 100644 index 00000000..48d4ae87 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/signature.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/star_args.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/star_args.cpython-38.pyc new file mode 100644 index 00000000..a9f1b3dc Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/star_args.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/syntax_tree.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/syntax_tree.cpython-38.pyc new file mode 100644 index 00000000..f35f09c6 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/syntax_tree.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/sys_path.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/sys_path.cpython-38.pyc new file mode 100644 index 00000000..efd46f11 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/sys_path.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/utils.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/utils.cpython-38.pyc new file mode 100644 index 00000000..0d37b4e3 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/__pycache__/utils.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/analysis.py b/.venv/lib/python3.8/site-packages/jedi/inference/analysis.py new file mode 100644 index 00000000..9ce56370 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/analysis.py @@ -0,0 +1,217 @@ +""" +Module for statical analysis. +""" +from parso.python import tree + +from jedi._compatibility import force_unicode +from jedi import debug +from jedi.inference.helpers import is_string + + +CODES = { + 'attribute-error': (1, AttributeError, 'Potential AttributeError.'), + 'name-error': (2, NameError, 'Potential NameError.'), + 'import-error': (3, ImportError, 'Potential ImportError.'), + 'type-error-too-many-arguments': (4, TypeError, None), + 'type-error-too-few-arguments': (5, TypeError, None), + 'type-error-keyword-argument': (6, TypeError, None), + 'type-error-multiple-values': (7, TypeError, None), + 'type-error-star-star': (8, TypeError, None), + 'type-error-star': (9, TypeError, None), + 'type-error-operation': (10, TypeError, None), + 'type-error-not-iterable': (11, TypeError, None), + 'type-error-isinstance': (12, TypeError, None), + 'type-error-not-subscriptable': (13, TypeError, None), + 'value-error-too-many-values': (14, ValueError, None), + 'value-error-too-few-values': (15, ValueError, None), +} + + +class Error(object): + def __init__(self, name, module_path, start_pos, message=None): + self.path = module_path + self._start_pos = start_pos + self.name = name + if message is None: + message = CODES[self.name][2] + self.message = message + + @property + def line(self): + return self._start_pos[0] + + @property + def column(self): + return self._start_pos[1] + + @property + def code(self): + # The class name start + first = self.__class__.__name__[0] + return first + str(CODES[self.name][0]) + + def __unicode__(self): + return '%s:%s:%s: %s %s' % (self.path, self.line, self.column, + self.code, self.message) + + def __str__(self): + return self.__unicode__() + + def __eq__(self, other): + return (self.path == other.path and self.name == other.name + and self._start_pos == other._start_pos) + + def __ne__(self, other): + return not self.__eq__(other) + + def __hash__(self): + return hash((self.path, self._start_pos, self.name)) + + def __repr__(self): + return '<%s %s: %s@%s,%s>' % (self.__class__.__name__, + self.name, self.path, + self._start_pos[0], self._start_pos[1]) + + +class Warning(Error): + pass + + +def add(node_context, error_name, node, message=None, typ=Error, payload=None): + exception = CODES[error_name][1] + if _check_for_exception_catch(node_context, node, exception, payload): + return + + # TODO this path is probably not right + module_context = node_context.get_root_context() + module_path = module_context.py__file__() + issue_instance = typ(error_name, module_path, node.start_pos, message) + debug.warning(str(issue_instance), format=False) + node_context.inference_state.analysis.append(issue_instance) + return issue_instance + + +def _check_for_setattr(instance): + """ + Check if there's any setattr method inside an instance. If so, return True. + """ + module = instance.get_root_context() + node = module.tree_node + if node is None: + # If it's a compiled module or doesn't have a tree_node + return False + + try: + stmt_names = node.get_used_names()['setattr'] + except KeyError: + return False + + return any(node.start_pos < n.start_pos < node.end_pos + # Check if it's a function called setattr. + and not (n.parent.type == 'funcdef' and n.parent.name == n) + for n in stmt_names) + + +def add_attribute_error(name_context, lookup_value, name): + message = ('AttributeError: %s has no attribute %s.' % (lookup_value, name)) + # Check for __getattr__/__getattribute__ existance and issue a warning + # instead of an error, if that happens. + typ = Error + if lookup_value.is_instance() and not lookup_value.is_compiled(): + # TODO maybe make a warning for __getattr__/__getattribute__ + + if _check_for_setattr(lookup_value): + typ = Warning + + payload = lookup_value, name + add(name_context, 'attribute-error', name, message, typ, payload) + + +def _check_for_exception_catch(node_context, jedi_name, exception, payload=None): + """ + Checks if a jedi object (e.g. `Statement`) sits inside a try/catch and + doesn't count as an error (if equal to `exception`). + Also checks `hasattr` for AttributeErrors and uses the `payload` to compare + it. + Returns True if the exception was catched. + """ + def check_match(cls, exception): + if not cls.is_class(): + return False + + for python_cls in exception.mro(): + if cls.py__name__() == python_cls.__name__ \ + and cls.parent_context.is_builtins_module(): + return True + return False + + def check_try_for_except(obj, exception): + # Only nodes in try + iterator = iter(obj.children) + for branch_type in iterator: + next(iterator) # The colon + suite = next(iterator) + if branch_type == 'try' \ + and not (branch_type.start_pos < jedi_name.start_pos <= suite.end_pos): + return False + + for node in obj.get_except_clause_tests(): + if node is None: + return True # An exception block that catches everything. + else: + except_classes = node_context.infer_node(node) + for cls in except_classes: + from jedi.inference.value import iterable + if isinstance(cls, iterable.Sequence) and \ + cls.array_type == 'tuple': + # multiple exceptions + for lazy_value in cls.py__iter__(): + for typ in lazy_value.infer(): + if check_match(typ, exception): + return True + else: + if check_match(cls, exception): + return True + + def check_hasattr(node, suite): + try: + assert suite.start_pos <= jedi_name.start_pos < suite.end_pos + assert node.type in ('power', 'atom_expr') + base = node.children[0] + assert base.type == 'name' and base.value == 'hasattr' + trailer = node.children[1] + assert trailer.type == 'trailer' + arglist = trailer.children[1] + assert arglist.type == 'arglist' + from jedi.inference.arguments import TreeArguments + args = TreeArguments(node_context.inference_state, node_context, arglist) + unpacked_args = list(args.unpack()) + # Arguments should be very simple + assert len(unpacked_args) == 2 + + # Check name + key, lazy_value = unpacked_args[1] + names = list(lazy_value.infer()) + assert len(names) == 1 and is_string(names[0]) + assert force_unicode(names[0].get_safe_value()) == payload[1].value + + # Check objects + key, lazy_value = unpacked_args[0] + objects = lazy_value.infer() + return payload[0] in objects + except AssertionError: + return False + + obj = jedi_name + while obj is not None and not isinstance(obj, (tree.Function, tree.Class)): + if isinstance(obj, tree.Flow): + # try/except catch check + if obj.type == 'try_stmt' and check_try_for_except(obj, exception): + return True + # hasattr check + if exception == AttributeError and obj.type in ('if_stmt', 'while_stmt'): + if check_hasattr(obj.children[1], obj.children[3]): + return True + obj = obj.parent + + return False diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/arguments.py b/.venv/lib/python3.8/site-packages/jedi/inference/arguments.py new file mode 100644 index 00000000..aa200fdb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/arguments.py @@ -0,0 +1,343 @@ +import re + +from parso.python import tree + +from jedi._compatibility import zip_longest +from jedi import debug +from jedi.inference.utils import PushBackIterator +from jedi.inference import analysis +from jedi.inference.lazy_value import LazyKnownValue, LazyKnownValues, \ + LazyTreeValue, get_merged_lazy_value +from jedi.inference.names import ParamName, TreeNameDefinition, AnonymousParamName +from jedi.inference.base_value import NO_VALUES, ValueSet, ContextualizedNode +from jedi.inference.value import iterable +from jedi.inference.cache import inference_state_as_method_param_cache + + +def try_iter_content(types, depth=0): + """Helper method for static analysis.""" + if depth > 10: + # It's possible that a loop has references on itself (especially with + # CompiledValue). Therefore don't loop infinitely. + return + + for typ in types: + try: + f = typ.py__iter__ + except AttributeError: + pass + else: + for lazy_value in f(): + try_iter_content(lazy_value.infer(), depth + 1) + + +class ParamIssue(Exception): + pass + + +def repack_with_argument_clinic(clinic_string): + """ + Transforms a function or method with arguments to the signature that is + given as an argument clinic notation. + + Argument clinic is part of CPython and used for all the functions that are + implemented in C (Python 3.7): + + str.split.__text_signature__ + # Results in: '($self, /, sep=None, maxsplit=-1)' + """ + def decorator(func): + def wrapper(value, arguments): + try: + args = tuple(iterate_argument_clinic( + value.inference_state, + arguments, + clinic_string, + )) + except ParamIssue: + return NO_VALUES + else: + return func(value, *args) + + return wrapper + return decorator + + +def iterate_argument_clinic(inference_state, arguments, clinic_string): + """Uses a list with argument clinic information (see PEP 436).""" + clinic_args = list(_parse_argument_clinic(clinic_string)) + + iterator = PushBackIterator(arguments.unpack()) + for i, (name, optional, allow_kwargs, stars) in enumerate(clinic_args): + if stars == 1: + lazy_values = [] + for key, argument in iterator: + if key is not None: + iterator.push_back((key, argument)) + break + + lazy_values.append(argument) + yield ValueSet([iterable.FakeTuple(inference_state, lazy_values)]) + lazy_values + continue + elif stars == 2: + raise NotImplementedError() + key, argument = next(iterator, (None, None)) + if key is not None: + debug.warning('Keyword arguments in argument clinic are currently not supported.') + raise ParamIssue + if argument is None and not optional: + debug.warning('TypeError: %s expected at least %s arguments, got %s', + name, len(clinic_args), i) + raise ParamIssue + + value_set = NO_VALUES if argument is None else argument.infer() + + if not value_set and not optional: + # For the stdlib we always want values. If we don't get them, + # that's ok, maybe something is too hard to resolve, however, + # we will not proceed with the type inference of that function. + debug.warning('argument_clinic "%s" not resolvable.', name) + raise ParamIssue + yield value_set + + +def _parse_argument_clinic(string): + allow_kwargs = False + optional = False + while string: + # Optional arguments have to begin with a bracket. And should always be + # at the end of the arguments. This is therefore not a proper argument + # clinic implementation. `range()` for exmple allows an optional start + # value at the beginning. + match = re.match(r'(?:(?:(\[),? ?|, ?|)(\**\w+)|, ?/)\]*', string) + string = string[len(match.group(0)):] + if not match.group(2): # A slash -> allow named arguments + allow_kwargs = True + continue + optional = optional or bool(match.group(1)) + word = match.group(2) + stars = word.count('*') + word = word[stars:] + yield (word, optional, allow_kwargs, stars) + if stars: + allow_kwargs = True + + +class _AbstractArgumentsMixin(object): + def unpack(self, funcdef=None): + raise NotImplementedError + + def get_calling_nodes(self): + return [] + + +class AbstractArguments(_AbstractArgumentsMixin): + context = None + argument_node = None + trailer = None + + +def unpack_arglist(arglist): + if arglist is None: + return + + # Allow testlist here as well for Python2's class inheritance + # definitions. + if not (arglist.type in ('arglist', 'testlist') or ( + # in python 3.5 **arg is an argument, not arglist + arglist.type == 'argument' and arglist.children[0] in ('*', '**'))): + yield 0, arglist + return + + iterator = iter(arglist.children) + for child in iterator: + if child == ',': + continue + elif child in ('*', '**'): + c = next(iterator, None) + assert c is not None + yield len(child.value), c + elif child.type == 'argument' and \ + child.children[0] in ('*', '**'): + assert len(child.children) == 2 + yield len(child.children[0].value), child.children[1] + else: + yield 0, child + + +class TreeArguments(AbstractArguments): + def __init__(self, inference_state, context, argument_node, trailer=None): + """ + :param argument_node: May be an argument_node or a list of nodes. + """ + self.argument_node = argument_node + self.context = context + self._inference_state = inference_state + self.trailer = trailer # Can be None, e.g. in a class definition. + + @classmethod + @inference_state_as_method_param_cache() + def create_cached(cls, *args, **kwargs): + return cls(*args, **kwargs) + + def unpack(self, funcdef=None): + named_args = [] + for star_count, el in unpack_arglist(self.argument_node): + if star_count == 1: + arrays = self.context.infer_node(el) + iterators = [_iterate_star_args(self.context, a, el, funcdef) + for a in arrays] + for values in list(zip_longest(*iterators)): + # TODO zip_longest yields None, that means this would raise + # an exception? + yield None, get_merged_lazy_value( + [v for v in values if v is not None] + ) + elif star_count == 2: + arrays = self.context.infer_node(el) + for dct in arrays: + for key, values in _star_star_dict(self.context, dct, el, funcdef): + yield key, values + else: + if el.type == 'argument': + c = el.children + if len(c) == 3: # Keyword argument. + named_args.append((c[0].value, LazyTreeValue(self.context, c[2]),)) + else: # Generator comprehension. + # Include the brackets with the parent. + sync_comp_for = el.children[1] + if sync_comp_for.type == 'comp_for': + sync_comp_for = sync_comp_for.children[1] + comp = iterable.GeneratorComprehension( + self._inference_state, + defining_context=self.context, + sync_comp_for_node=sync_comp_for, + entry_node=el.children[0], + ) + yield None, LazyKnownValue(comp) + else: + yield None, LazyTreeValue(self.context, el) + + # Reordering arguments is necessary, because star args sometimes appear + # after named argument, but in the actual order it's prepended. + for named_arg in named_args: + yield named_arg + + def _as_tree_tuple_objects(self): + for star_count, argument in unpack_arglist(self.argument_node): + default = None + if argument.type == 'argument': + if len(argument.children) == 3: # Keyword argument. + argument, default = argument.children[::2] + yield argument, default, star_count + + def iter_calling_names_with_star(self): + for name, default, star_count in self._as_tree_tuple_objects(): + # TODO this function is a bit strange. probably refactor? + if not star_count or not isinstance(name, tree.Name): + continue + + yield TreeNameDefinition(self.context, name) + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.argument_node) + + def get_calling_nodes(self): + old_arguments_list = [] + arguments = self + + while arguments not in old_arguments_list: + if not isinstance(arguments, TreeArguments): + break + + old_arguments_list.append(arguments) + for calling_name in reversed(list(arguments.iter_calling_names_with_star())): + names = calling_name.goto() + if len(names) != 1: + break + if isinstance(names[0], AnonymousParamName): + # Dynamic parameters should not have calling nodes, because + # they are dynamic and extremely random. + return [] + if not isinstance(names[0], ParamName): + break + executed_param_name = names[0].get_executed_param_name() + arguments = executed_param_name.arguments + break + + if arguments.argument_node is not None: + return [ContextualizedNode(arguments.context, arguments.argument_node)] + if arguments.trailer is not None: + return [ContextualizedNode(arguments.context, arguments.trailer)] + return [] + + +class ValuesArguments(AbstractArguments): + def __init__(self, values_list): + self._values_list = values_list + + def unpack(self, funcdef=None): + for values in self._values_list: + yield None, LazyKnownValues(values) + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._values_list) + + +class TreeArgumentsWrapper(_AbstractArgumentsMixin): + def __init__(self, arguments): + self._wrapped_arguments = arguments + + @property + def context(self): + return self._wrapped_arguments.context + + @property + def argument_node(self): + return self._wrapped_arguments.argument_node + + @property + def trailer(self): + return self._wrapped_arguments.trailer + + def unpack(self, func=None): + raise NotImplementedError + + def get_calling_nodes(self): + return self._wrapped_arguments.get_calling_nodes() + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._wrapped_arguments) + + +def _iterate_star_args(context, array, input_node, funcdef=None): + if not array.py__getattribute__('__iter__'): + if funcdef is not None: + # TODO this funcdef should not be needed. + m = "TypeError: %s() argument after * must be a sequence, not %s" \ + % (funcdef.name.value, array) + analysis.add(context, 'type-error-star', input_node, message=m) + try: + iter_ = array.py__iter__ + except AttributeError: + pass + else: + for lazy_value in iter_(): + yield lazy_value + + +def _star_star_dict(context, array, input_node, funcdef): + from jedi.inference.value.instance import CompiledInstance + if isinstance(array, CompiledInstance) and array.name.string_name == 'dict': + # For now ignore this case. In the future add proper iterators and just + # make one call without crazy isinstance checks. + return {} + elif isinstance(array, iterable.Sequence) and array.array_type == 'dict': + return array.exact_key_items() + else: + if funcdef is not None: + m = "TypeError: %s argument after ** must be a mapping, not %s" \ + % (funcdef.name.value, array) + analysis.add(context, 'type-error-star-star', input_node, message=m) + return {} diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/base_value.py b/.venv/lib/python3.8/site-packages/jedi/inference/base_value.py new file mode 100644 index 00000000..dfc7f46c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/base_value.py @@ -0,0 +1,553 @@ +""" +Values are the "values" that Python would return. However Values are at the +same time also the "values" that a user is currently sitting in. + +A ValueSet is typically used to specify the return of a function or any other +static analysis operation. In jedi there are always multiple returns and not +just one. +""" +from functools import reduce +from operator import add +from parso.python.tree import Name + +from jedi import debug +from jedi._compatibility import zip_longest, unicode +from jedi.parser_utils import clean_scope_docstring +from jedi.inference.helpers import SimpleGetItemNotFound +from jedi.inference.utils import safe_property +from jedi.inference.cache import inference_state_as_method_param_cache +from jedi.cache import memoize_method + +sentinel = object() + + +class HelperValueMixin(object): + def get_root_context(self): + value = self + if value.parent_context is None: + return value.as_context() + + while True: + if value.parent_context is None: + return value + value = value.parent_context + + def execute(self, arguments): + return self.inference_state.execute(self, arguments=arguments) + + def execute_with_values(self, *value_list): + from jedi.inference.arguments import ValuesArguments + arguments = ValuesArguments([ValueSet([value]) for value in value_list]) + return self.inference_state.execute(self, arguments) + + def execute_annotation(self): + return self.execute_with_values() + + def gather_annotation_classes(self): + return ValueSet([self]) + + def merge_types_of_iterate(self, contextualized_node=None, is_async=False): + return ValueSet.from_sets( + lazy_value.infer() + for lazy_value in self.iterate(contextualized_node, is_async) + ) + + def _get_value_filters(self, name_or_str): + origin_scope = name_or_str if isinstance(name_or_str, Name) else None + for f in self.get_filters(origin_scope=origin_scope): + yield f + # This covers the case where a stub files are incomplete. + if self.is_stub(): + from jedi.inference.gradual.conversion import convert_values + for c in convert_values(ValueSet({self})): + for f in c.get_filters(): + yield f + + def goto(self, name_or_str, name_context=None, analysis_errors=True): + from jedi.inference import finder + filters = self._get_value_filters(name_or_str) + names = finder.filter_name(filters, name_or_str) + debug.dbg('context.goto %s in (%s): %s', name_or_str, self, names) + return names + + def py__getattribute__(self, name_or_str, name_context=None, position=None, + analysis_errors=True): + """ + :param position: Position of the last statement -> tuple of line, column + """ + if name_context is None: + name_context = self + names = self.goto(name_or_str, name_context, analysis_errors) + values = ValueSet.from_sets(name.infer() for name in names) + if not values: + n = name_or_str.value if isinstance(name_or_str, Name) else name_or_str + values = self.py__getattribute__alternatives(n) + + if not names and not values and analysis_errors: + if isinstance(name_or_str, Name): + from jedi.inference import analysis + analysis.add_attribute_error( + name_context, self, name_or_str) + debug.dbg('context.names_to_types: %s -> %s', names, values) + return values + + def py__await__(self): + await_value_set = self.py__getattribute__(u"__await__") + if not await_value_set: + debug.warning('Tried to run __await__ on value %s', self) + return await_value_set.execute_with_values() + + def iterate(self, contextualized_node=None, is_async=False): + debug.dbg('iterate %s', self) + if is_async: + from jedi.inference.lazy_value import LazyKnownValues + # TODO if no __aiter__ values are there, error should be: + # TypeError: 'async for' requires an object with __aiter__ method, got int + return iter([ + LazyKnownValues( + self.py__getattribute__('__aiter__').execute_with_values() + .py__getattribute__('__anext__').execute_with_values() + .py__getattribute__('__await__').execute_with_values() + .py__stop_iteration_returns() + ) # noqa + ]) + return self.py__iter__(contextualized_node) + + def is_sub_class_of(self, class_value): + with debug.increase_indent_cm('subclass matching of %s <=> %s' % (self, class_value), + color='BLUE'): + for cls in self.py__mro__(): + if cls.is_same_class(class_value): + debug.dbg('matched subclass True', color='BLUE') + return True + debug.dbg('matched subclass False', color='BLUE') + return False + + def is_same_class(self, class2): + # Class matching should prefer comparisons that are not this function. + if type(class2).is_same_class != HelperValueMixin.is_same_class: + return class2.is_same_class(self) + return self == class2 + + @memoize_method + def as_context(self, *args, **kwargs): + return self._as_context(*args, **kwargs) + + +class Value(HelperValueMixin): + """ + To be implemented by subclasses. + """ + tree_node = None + # Possible values: None, tuple, list, dict and set. Here to deal with these + # very important containers. + array_type = None + api_type = 'not_defined_please_report_bug' + + def __init__(self, inference_state, parent_context=None): + self.inference_state = inference_state + self.parent_context = parent_context + + def py__getitem__(self, index_value_set, contextualized_node): + from jedi.inference import analysis + # TODO this value is probably not right. + analysis.add( + contextualized_node.context, + 'type-error-not-subscriptable', + contextualized_node.node, + message="TypeError: '%s' object is not subscriptable" % self + ) + return NO_VALUES + + def py__simple_getitem__(self, index): + raise SimpleGetItemNotFound + + def py__iter__(self, contextualized_node=None): + if contextualized_node is not None: + from jedi.inference import analysis + analysis.add( + contextualized_node.context, + 'type-error-not-iterable', + contextualized_node.node, + message="TypeError: '%s' object is not iterable" % self) + return iter([]) + + def get_signatures(self): + return [] + + def is_class(self): + return False + + def is_class_mixin(self): + return False + + def is_instance(self): + return False + + def is_function(self): + return False + + def is_module(self): + return False + + def is_namespace(self): + return False + + def is_compiled(self): + return False + + def is_bound_method(self): + return False + + def is_builtins_module(self): + return False + + def py__bool__(self): + """ + Since Wrapper is a super class for classes, functions and modules, + the return value will always be true. + """ + return True + + def py__doc__(self): + try: + self.tree_node.get_doc_node + except AttributeError: + return '' + else: + return clean_scope_docstring(self.tree_node) + + def get_safe_value(self, default=sentinel): + if default is sentinel: + raise ValueError("There exists no safe value for value %s" % self) + return default + + def execute_operation(self, other, operator): + debug.warning("%s not possible between %s and %s", operator, self, other) + return NO_VALUES + + def py__call__(self, arguments): + debug.warning("no execution possible %s", self) + return NO_VALUES + + def py__stop_iteration_returns(self): + debug.warning("Not possible to return the stop iterations of %s", self) + return NO_VALUES + + def py__getattribute__alternatives(self, name_or_str): + """ + For now a way to add values in cases like __getattr__. + """ + return NO_VALUES + + def py__get__(self, instance, class_value): + debug.warning("No __get__ defined on %s", self) + return ValueSet([self]) + + def py__get__on_class(self, calling_instance, instance, class_value): + return NotImplemented + + def get_qualified_names(self): + # Returns Optional[Tuple[str, ...]] + return None + + def is_stub(self): + # The root value knows if it's a stub or not. + return self.parent_context.is_stub() + + def _as_context(self): + raise NotImplementedError('Not all values need to be converted to contexts: %s', self) + + @property + def name(self): + raise NotImplementedError + + def py__name__(self): + return self.name.string_name + + def get_type_hint(self, add_class_info=True): + return None + + def infer_type_vars(self, value_set): + """ + When the current instance represents a type annotation, this method + tries to find information about undefined type vars and returns a dict + from type var name to value set. + + This is for example important to understand what `iter([1])` returns. + According to typeshed, `iter` returns an `Iterator[_T]`: + + def iter(iterable: Iterable[_T]) -> Iterator[_T]: ... + + This functions would generate `int` for `_T` in this case, because it + unpacks the `Iterable`. + + Parameters + ---------- + + `self`: represents the annotation of the current parameter to infer the + value for. In the above example, this would initially be the + `Iterable[_T]` of the `iterable` parameter and then, when recursing, + just the `_T` generic parameter. + + `value_set`: represents the actual argument passed to the parameter + we're inferrined for, or (for recursive calls) their types. In the + above example this would first be the representation of the list + `[1]` and then, when recursing, just of `1`. + """ + return {} + + +def iterate_values(values, contextualized_node=None, is_async=False): + """ + Calls `iterate`, on all values but ignores the ordering and just returns + all values that the iterate functions yield. + """ + return ValueSet.from_sets( + lazy_value.infer() + for lazy_value in values.iterate(contextualized_node, is_async=is_async) + ) + + +class _ValueWrapperBase(HelperValueMixin): + @safe_property + def name(self): + from jedi.inference.names import ValueName + wrapped_name = self._wrapped_value.name + if wrapped_name.tree_name is not None: + return ValueName(self, wrapped_name.tree_name) + else: + from jedi.inference.compiled import CompiledValueName + return CompiledValueName(self, wrapped_name.string_name) + + @classmethod + @inference_state_as_method_param_cache() + def create_cached(cls, inference_state, *args, **kwargs): + return cls(*args, **kwargs) + + def __getattr__(self, name): + assert name != '_wrapped_value', 'Problem with _get_wrapped_value' + return getattr(self._wrapped_value, name) + + +class LazyValueWrapper(_ValueWrapperBase): + @safe_property + @memoize_method + def _wrapped_value(self): + with debug.increase_indent_cm('Resolve lazy value wrapper'): + return self._get_wrapped_value() + + def __repr__(self): + return '<%s>' % (self.__class__.__name__) + + def _get_wrapped_value(self): + raise NotImplementedError + + +class ValueWrapper(_ValueWrapperBase): + def __init__(self, wrapped_value): + self._wrapped_value = wrapped_value + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self._wrapped_value) + + +class TreeValue(Value): + def __init__(self, inference_state, parent_context, tree_node): + super(TreeValue, self).__init__(inference_state, parent_context) + self.tree_node = tree_node + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.tree_node) + + +class ContextualizedNode(object): + def __init__(self, context, node): + self.context = context + self.node = node + + def get_root_context(self): + return self.context.get_root_context() + + def infer(self): + return self.context.infer_node(self.node) + + def __repr__(self): + return '<%s: %s in %s>' % (self.__class__.__name__, self.node, self.context) + + +def _getitem(value, index_values, contextualized_node): + # The actual getitem call. + result = NO_VALUES + unused_values = set() + for index_value in index_values: + index = index_value.get_safe_value(default=None) + if type(index) in (float, int, str, unicode, slice, bytes): + try: + result |= value.py__simple_getitem__(index) + continue + except SimpleGetItemNotFound: + pass + + unused_values.add(index_value) + + # The index was somehow not good enough or simply a wrong type. + # Therefore we now iterate through all the values and just take + # all results. + if unused_values or not index_values: + result |= value.py__getitem__( + ValueSet(unused_values), + contextualized_node + ) + debug.dbg('py__getitem__ result: %s', result) + return result + + +class ValueSet(object): + def __init__(self, iterable): + self._set = frozenset(iterable) + for value in iterable: + assert not isinstance(value, ValueSet) + + @classmethod + def _from_frozen_set(cls, frozenset_): + self = cls.__new__(cls) + self._set = frozenset_ + return self + + @classmethod + def from_sets(cls, sets): + """ + Used to work with an iterable of set. + """ + aggregated = set() + for set_ in sets: + if isinstance(set_, ValueSet): + aggregated |= set_._set + else: + aggregated |= frozenset(set_) + return cls._from_frozen_set(frozenset(aggregated)) + + def __or__(self, other): + return self._from_frozen_set(self._set | other._set) + + def __and__(self, other): + return self._from_frozen_set(self._set & other._set) + + def __iter__(self): + for element in self._set: + yield element + + def __bool__(self): + return bool(self._set) + + def __len__(self): + return len(self._set) + + def __repr__(self): + return 'S{%s}' % (', '.join(str(s) for s in self._set)) + + def filter(self, filter_func): + return self.__class__(filter(filter_func, self._set)) + + def __getattr__(self, name): + def mapper(*args, **kwargs): + return self.from_sets( + getattr(value, name)(*args, **kwargs) + for value in self._set + ) + return mapper + + def __eq__(self, other): + return self._set == other._set + + def __ne__(self, other): + return not self.__eq__(other) + + def __hash__(self): + return hash(self._set) + + def py__class__(self): + return ValueSet(c.py__class__() for c in self._set) + + def iterate(self, contextualized_node=None, is_async=False): + from jedi.inference.lazy_value import get_merged_lazy_value + type_iters = [c.iterate(contextualized_node, is_async=is_async) for c in self._set] + for lazy_values in zip_longest(*type_iters): + yield get_merged_lazy_value( + [l for l in lazy_values if l is not None] + ) + + def execute(self, arguments): + return ValueSet.from_sets(c.inference_state.execute(c, arguments) for c in self._set) + + def execute_with_values(self, *args, **kwargs): + return ValueSet.from_sets(c.execute_with_values(*args, **kwargs) for c in self._set) + + def goto(self, *args, **kwargs): + return reduce(add, [c.goto(*args, **kwargs) for c in self._set], []) + + def py__getattribute__(self, *args, **kwargs): + return ValueSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set) + + def get_item(self, *args, **kwargs): + return ValueSet.from_sets(_getitem(c, *args, **kwargs) for c in self._set) + + def try_merge(self, function_name): + value_set = self.__class__([]) + for c in self._set: + try: + method = getattr(c, function_name) + except AttributeError: + pass + else: + value_set |= method() + return value_set + + def gather_annotation_classes(self): + return ValueSet.from_sets([c.gather_annotation_classes() for c in self._set]) + + def get_signatures(self): + return [sig for c in self._set for sig in c.get_signatures()] + + def get_type_hint(self, add_class_info=True): + t = [v.get_type_hint(add_class_info=add_class_info) for v in self._set] + type_hints = sorted(filter(None, t)) + if len(type_hints) == 1: + return type_hints[0] + + optional = 'None' in type_hints + if optional: + type_hints.remove('None') + + if len(type_hints) == 0: + return None + elif len(type_hints) == 1: + s = type_hints[0] + else: + s = 'Union[%s]' % ', '.join(type_hints) + if optional: + s = 'Optional[%s]' % s + return s + + def infer_type_vars(self, value_set): + # Circular + from jedi.inference.gradual.annotation import merge_type_var_dicts + + type_var_dict = {} + for value in self._set: + merge_type_var_dicts( + type_var_dict, + value.infer_type_vars(value_set), + ) + return type_var_dict + + +NO_VALUES = ValueSet([]) + + +def iterator_to_value_set(func): + def wrapper(*args, **kwargs): + return ValueSet(func(*args, **kwargs)) + + return wrapper diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/cache.py b/.venv/lib/python3.8/site-packages/jedi/inference/cache.py new file mode 100644 index 00000000..45f499b7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/cache.py @@ -0,0 +1,126 @@ +""" +- the popular ``_memoize_default`` works like a typical memoize and returns the + default otherwise. +- ``CachedMetaClass`` uses ``_memoize_default`` to do the same with classes. +""" +from functools import wraps + +from jedi import debug + +_NO_DEFAULT = object() +_RECURSION_SENTINEL = object() + + +def _memoize_default(default=_NO_DEFAULT, inference_state_is_first_arg=False, + second_arg_is_inference_state=False): + """ This is a typical memoization decorator, BUT there is one difference: + To prevent recursion it sets defaults. + + Preventing recursion is in this case the much bigger use than speed. I + don't think, that there is a big speed difference, but there are many cases + where recursion could happen (think about a = b; b = a). + """ + def func(function): + def wrapper(obj, *args, **kwargs): + # TODO These checks are kind of ugly and slow. + if inference_state_is_first_arg: + cache = obj.memoize_cache + elif second_arg_is_inference_state: + cache = args[0].memoize_cache # needed for meta classes + else: + cache = obj.inference_state.memoize_cache + + try: + memo = cache[function] + except KeyError: + cache[function] = memo = {} + + key = (obj, args, frozenset(kwargs.items())) + if key in memo: + return memo[key] + else: + if default is not _NO_DEFAULT: + memo[key] = default + rv = function(obj, *args, **kwargs) + memo[key] = rv + return rv + return wrapper + + return func + + +def inference_state_function_cache(default=_NO_DEFAULT): + def decorator(func): + return _memoize_default(default=default, inference_state_is_first_arg=True)(func) + + return decorator + + +def inference_state_method_cache(default=_NO_DEFAULT): + def decorator(func): + return _memoize_default(default=default)(func) + + return decorator + + +def inference_state_as_method_param_cache(): + def decorator(call): + return _memoize_default(second_arg_is_inference_state=True)(call) + + return decorator + + +class CachedMetaClass(type): + """ + This is basically almost the same than the decorator above, it just caches + class initializations. Either you do it this way or with decorators, but + with decorators you lose class access (isinstance, etc). + """ + @inference_state_as_method_param_cache() + def __call__(self, *args, **kwargs): + return super(CachedMetaClass, self).__call__(*args, **kwargs) + + +def inference_state_method_generator_cache(): + """ + This is a special memoizer. It memoizes generators and also checks for + recursion errors and returns no further iterator elemends in that case. + """ + def func(function): + @wraps(function) + def wrapper(obj, *args, **kwargs): + cache = obj.inference_state.memoize_cache + try: + memo = cache[function] + except KeyError: + cache[function] = memo = {} + + key = (obj, args, frozenset(kwargs.items())) + + if key in memo: + actual_generator, cached_lst = memo[key] + else: + actual_generator = function(obj, *args, **kwargs) + cached_lst = [] + memo[key] = actual_generator, cached_lst + + i = 0 + while True: + try: + next_element = cached_lst[i] + if next_element is _RECURSION_SENTINEL: + debug.warning('Found a generator recursion for %s' % obj) + # This means we have hit a recursion. + return + except IndexError: + cached_lst.append(_RECURSION_SENTINEL) + next_element = next(actual_generator, None) + if next_element is None: + cached_lst.pop() + return + cached_lst[-1] = next_element + yield next_element + i += 1 + return wrapper + + return func diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/compiled/__init__.py b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/__init__.py new file mode 100644 index 00000000..b5d435fc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/__init__.py @@ -0,0 +1,68 @@ +from jedi._compatibility import unicode +from jedi.inference.compiled.value import CompiledValue, CompiledName, \ + CompiledValueFilter, CompiledValueName, create_from_access_path +from jedi.inference.base_value import LazyValueWrapper + + +def builtin_from_name(inference_state, string): + typing_builtins_module = inference_state.builtins_module + if string in ('None', 'True', 'False'): + builtins, = typing_builtins_module.non_stub_value_set + filter_ = next(builtins.get_filters()) + else: + filter_ = next(typing_builtins_module.get_filters()) + name, = filter_.get(string) + value, = name.infer() + return value + + +class ExactValue(LazyValueWrapper): + """ + This class represents exact values, that makes operations like additions + and exact boolean values possible, while still being a "normal" stub. + """ + def __init__(self, compiled_value): + self.inference_state = compiled_value.inference_state + self._compiled_value = compiled_value + + def __getattribute__(self, name): + if name in ('get_safe_value', 'execute_operation', 'access_handle', + 'negate', 'py__bool__', 'is_compiled'): + return getattr(self._compiled_value, name) + return super(ExactValue, self).__getattribute__(name) + + def _get_wrapped_value(self): + instance, = builtin_from_name( + self.inference_state, self._compiled_value.name.string_name).execute_with_values() + return instance + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._compiled_value) + + +def create_simple_object(inference_state, obj): + """ + Only allows creations of objects that are easily picklable across Python + versions. + """ + assert type(obj) in (int, float, str, bytes, unicode, slice, complex, bool), obj + compiled_value = create_from_access_path( + inference_state, + inference_state.compiled_subprocess.create_simple_object(obj) + ) + return ExactValue(compiled_value) + + +def get_string_value_set(inference_state): + return builtin_from_name(inference_state, u'str').execute_with_values() + + +def load_module(inference_state, dotted_name, **kwargs): + # Temporary, some tensorflow builtins cannot be loaded, so it's tried again + # and again and it's really slow. + if dotted_name.startswith('tensorflow.'): + return None + access_path = inference_state.compiled_subprocess.load_module(dotted_name=dotted_name, **kwargs) + if access_path is None: + return None + return create_from_access_path(inference_state, access_path) diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/compiled/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..5f237d44 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/compiled/__pycache__/access.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/__pycache__/access.cpython-38.pyc new file mode 100644 index 00000000..ad70263b Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/__pycache__/access.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/compiled/__pycache__/getattr_static.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/__pycache__/getattr_static.cpython-38.pyc new file mode 100644 index 00000000..532aa0b6 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/__pycache__/getattr_static.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/compiled/__pycache__/mixed.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/__pycache__/mixed.cpython-38.pyc new file mode 100644 index 00000000..bee0cfb6 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/__pycache__/mixed.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/compiled/__pycache__/value.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/__pycache__/value.cpython-38.pyc new file mode 100644 index 00000000..5c6d4197 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/__pycache__/value.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/compiled/access.py b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/access.py new file mode 100644 index 00000000..a02b548b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/access.py @@ -0,0 +1,564 @@ +from __future__ import print_function +import inspect +import types +import sys +import operator as op +from collections import namedtuple +import warnings +import re + +from jedi._compatibility import unicode, is_py3, builtins, \ + py_version, force_unicode +from jedi.inference.compiled.getattr_static import getattr_static + +ALLOWED_GETITEM_TYPES = (str, list, tuple, unicode, bytes, bytearray, dict) + +MethodDescriptorType = type(str.replace) +# These are not considered classes and access is granted even though they have +# a __class__ attribute. +NOT_CLASS_TYPES = ( + types.BuiltinFunctionType, + types.CodeType, + types.FrameType, + types.FunctionType, + types.GeneratorType, + types.GetSetDescriptorType, + types.LambdaType, + types.MemberDescriptorType, + types.MethodType, + types.ModuleType, + types.TracebackType, + MethodDescriptorType +) + +if is_py3: + NOT_CLASS_TYPES += ( + types.MappingProxyType, + types.SimpleNamespace, + types.DynamicClassAttribute, + ) + + +# Those types don't exist in typing. +MethodDescriptorType = type(str.replace) +WrapperDescriptorType = type(set.__iter__) +# `object.__subclasshook__` is an already executed descriptor. +object_class_dict = type.__dict__["__dict__"].__get__(object) +ClassMethodDescriptorType = type(object_class_dict['__subclasshook__']) + +_sentinel = object() + +# Maps Python syntax to the operator module. +COMPARISON_OPERATORS = { + '==': op.eq, + '!=': op.ne, + 'is': op.is_, + 'is not': op.is_not, + '<': op.lt, + '<=': op.le, + '>': op.gt, + '>=': op.ge, +} + +_OPERATORS = { + '+': op.add, + '-': op.sub, +} +_OPERATORS.update(COMPARISON_OPERATORS) + +ALLOWED_DESCRIPTOR_ACCESS = ( + types.FunctionType, + types.GetSetDescriptorType, + types.MemberDescriptorType, + MethodDescriptorType, + WrapperDescriptorType, + ClassMethodDescriptorType, + staticmethod, + classmethod, +) + + +def safe_getattr(obj, name, default=_sentinel): + try: + attr, is_get_descriptor = getattr_static(obj, name) + except AttributeError: + if default is _sentinel: + raise + return default + else: + if isinstance(attr, ALLOWED_DESCRIPTOR_ACCESS): + # In case of descriptors that have get methods we cannot return + # it's value, because that would mean code execution. + # Since it's an isinstance call, code execution is still possible, + # but this is not really a security feature, but much more of a + # safety feature. Code execution is basically always possible when + # a module is imported. This is here so people don't shoot + # themselves in the foot. + return getattr(obj, name) + return attr + + +SignatureParam = namedtuple( + 'SignatureParam', + 'name has_default default default_string has_annotation annotation annotation_string kind_name' +) + + +def shorten_repr(func): + def wrapper(self): + r = func(self) + if len(r) > 50: + r = r[:50] + '..' + return r + return wrapper + + +def create_access(inference_state, obj): + return inference_state.compiled_subprocess.get_or_create_access_handle(obj) + + +def load_module(inference_state, dotted_name, sys_path): + temp, sys.path = sys.path, sys_path + try: + __import__(dotted_name) + except ImportError: + # If a module is "corrupt" or not really a Python module or whatever. + print('Module %s not importable in path %s.' % (dotted_name, sys_path), file=sys.stderr) + return None + except Exception: + # Since __import__ pretty much makes code execution possible, just + # catch any error here and print it. + import traceback + print("Cannot import:\n%s" % traceback.format_exc(), file=sys.stderr) + return None + finally: + sys.path = temp + + # Just access the cache after import, because of #59 as well as the very + # complicated import structure of Python. + module = sys.modules[dotted_name] + return create_access_path(inference_state, module) + + +class AccessPath(object): + def __init__(self, accesses): + self.accesses = accesses + + # Writing both of these methods here looks a bit ridiculous. However with + # the differences of Python 2/3 it's actually necessary, because we will + # otherwise have a accesses attribute that is bytes instead of unicode. + def __getstate__(self): + return self.accesses + + def __setstate__(self, value): + self.accesses = value + + +def create_access_path(inference_state, obj): + access = create_access(inference_state, obj) + return AccessPath(access.get_access_path_tuples()) + + +def _force_unicode_decorator(func): + return lambda *args, **kwargs: force_unicode(func(*args, **kwargs)) + + +def get_api_type(obj): + if inspect.isclass(obj): + return u'class' + elif inspect.ismodule(obj): + return u'module' + elif inspect.isbuiltin(obj) or inspect.ismethod(obj) \ + or inspect.ismethoddescriptor(obj) or inspect.isfunction(obj): + return u'function' + # Everything else... + return u'instance' + + +class DirectObjectAccess(object): + def __init__(self, inference_state, obj): + self._inference_state = inference_state + self._obj = obj + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self.get_repr()) + + def _create_access(self, obj): + return create_access(self._inference_state, obj) + + def _create_access_path(self, obj): + return create_access_path(self._inference_state, obj) + + def py__bool__(self): + return bool(self._obj) + + def py__file__(self): + try: + return self._obj.__file__ + except AttributeError: + return None + + def py__doc__(self): + return force_unicode(inspect.getdoc(self._obj)) or u'' + + def py__name__(self): + if not _is_class_instance(self._obj) or \ + inspect.ismethoddescriptor(self._obj): # slots + cls = self._obj + else: + try: + cls = self._obj.__class__ + except AttributeError: + # happens with numpy.core.umath._UFUNC_API (you get it + # automatically by doing `import numpy`. + return None + + try: + return force_unicode(cls.__name__) + except AttributeError: + return None + + def py__mro__accesses(self): + return tuple(self._create_access_path(cls) for cls in self._obj.__mro__[1:]) + + def py__getitem__all_values(self): + if isinstance(self._obj, dict): + return [self._create_access_path(v) for v in self._obj.values()] + return self.py__iter__list() + + def py__simple_getitem__(self, index): + if type(self._obj) not in ALLOWED_GETITEM_TYPES: + # Get rid of side effects, we won't call custom `__getitem__`s. + return None + + return self._create_access_path(self._obj[index]) + + def py__iter__list(self): + if not hasattr(self._obj, '__getitem__'): + return None + + if type(self._obj) not in ALLOWED_GETITEM_TYPES: + # Get rid of side effects, we won't call custom `__getitem__`s. + return [] + + lst = [] + for i, part in enumerate(self._obj): + if i > 20: + # Should not go crazy with large iterators + break + lst.append(self._create_access_path(part)) + return lst + + def py__class__(self): + return self._create_access_path(self._obj.__class__) + + def py__bases__(self): + return [self._create_access_path(base) for base in self._obj.__bases__] + + def py__path__(self): + paths = getattr(self._obj, '__path__', None) + # Avoid some weird hacks that would just fail, because they cannot be + # used by pickle. + if not isinstance(paths, list) \ + or not all(isinstance(p, (bytes, unicode)) for p in paths): + return None + return paths + + @_force_unicode_decorator + @shorten_repr + def get_repr(self): + builtins = 'builtins', '__builtin__' + + if inspect.ismodule(self._obj): + return repr(self._obj) + # Try to avoid execution of the property. + if safe_getattr(self._obj, '__module__', default='') in builtins: + return repr(self._obj) + + type_ = type(self._obj) + if type_ == type: + return type.__repr__(self._obj) + + if safe_getattr(type_, '__module__', default='') in builtins: + # Allow direct execution of repr for builtins. + return repr(self._obj) + return object.__repr__(self._obj) + + def is_class(self): + return inspect.isclass(self._obj) + + def is_function(self): + return inspect.isfunction(self._obj) or inspect.ismethod(self._obj) + + def is_module(self): + return inspect.ismodule(self._obj) + + def is_instance(self): + return _is_class_instance(self._obj) + + def ismethoddescriptor(self): + return inspect.ismethoddescriptor(self._obj) + + def get_qualified_names(self): + def try_to_get_name(obj): + return getattr(obj, '__qualname__', getattr(obj, '__name__', None)) + + if self.is_module(): + return () + name = try_to_get_name(self._obj) + if name is None: + name = try_to_get_name(type(self._obj)) + if name is None: + return () + return tuple(force_unicode(n) for n in name.split('.')) + + def dir(self): + return list(map(force_unicode, dir(self._obj))) + + def has_iter(self): + try: + iter(self._obj) + return True + except TypeError: + return False + + def is_allowed_getattr(self, name, unsafe=False): + # TODO this API is ugly. + if unsafe: + # Unsafe is mostly used to check for __getattr__/__getattribute__. + # getattr_static works for properties, but the underscore methods + # are just ignored (because it's safer and avoids more code + # execution). See also GH #1378. + + # Avoid warnings, see comment in the next function. + with warnings.catch_warnings(record=True): + warnings.simplefilter("always") + try: + return hasattr(self._obj, name), False + except Exception: + # Obviously has an attribute (propably a property) that + # gets executed, so just avoid all exceptions here. + return False, False + try: + attr, is_get_descriptor = getattr_static(self._obj, name) + except AttributeError: + return False, False + else: + if is_get_descriptor and type(attr) not in ALLOWED_DESCRIPTOR_ACCESS: + # In case of descriptors that have get methods we cannot return + # it's value, because that would mean code execution. + return True, True + return True, False + + def getattr_paths(self, name, default=_sentinel): + try: + # Make sure no warnings are printed here, this is autocompletion, + # warnings should not be shown. See also GH #1383. + with warnings.catch_warnings(record=True): + warnings.simplefilter("always") + return_obj = getattr(self._obj, name) + except Exception as e: + if default is _sentinel: + if isinstance(e, AttributeError): + # Happens e.g. in properties of + # PyQt4.QtGui.QStyleOptionComboBox.currentText + # -> just set it to None + raise + # Just in case anything happens, return an AttributeError. It + # should not crash. + raise AttributeError + return_obj = default + access = self._create_access(return_obj) + if inspect.ismodule(return_obj): + return [access] + + try: + module = return_obj.__module__ + except AttributeError: + pass + else: + if module is not None: + try: + __import__(module) + # For some modules like _sqlite3, the __module__ for classes is + # different, in this case it's sqlite3. So we have to try to + # load that "original" module, because it's not loaded yet. If + # we don't do that, we don't really have a "parent" module and + # we would fall back to builtins. + except ImportError: + pass + + module = inspect.getmodule(return_obj) + if module is None: + module = inspect.getmodule(type(return_obj)) + if module is None: + module = builtins + return [self._create_access(module), access] + + def get_safe_value(self): + if type(self._obj) in (bool, bytes, float, int, str, unicode, slice) or self._obj is None: + return self._obj + raise ValueError("Object is type %s and not simple" % type(self._obj)) + + def get_api_type(self): + return get_api_type(self._obj) + + def get_array_type(self): + if isinstance(self._obj, dict): + return 'dict' + return None + + def get_key_paths(self): + def iter_partial_keys(): + # We could use list(keys()), but that might take a lot more memory. + for (i, k) in enumerate(self._obj.keys()): + # Limit key listing at some point. This is artificial, but this + # way we don't get stalled because of slow completions + if i > 50: + break + yield k + + return [self._create_access_path(k) for k in iter_partial_keys()] + + def get_access_path_tuples(self): + accesses = [create_access(self._inference_state, o) for o in self._get_objects_path()] + return [(access.py__name__(), access) for access in accesses] + + def _get_objects_path(self): + def get(): + obj = self._obj + yield obj + try: + obj = obj.__objclass__ + except AttributeError: + pass + else: + yield obj + + try: + # Returns a dotted string path. + imp_plz = obj.__module__ + except AttributeError: + # Unfortunately in some cases like `int` there's no __module__ + if not inspect.ismodule(obj): + yield builtins + else: + if imp_plz is None: + # Happens for example in `(_ for _ in []).send.__module__`. + yield builtins + else: + try: + yield sys.modules[imp_plz] + except KeyError: + # __module__ can be something arbitrary that doesn't exist. + yield builtins + + return list(reversed(list(get()))) + + def execute_operation(self, other_access_handle, operator): + other_access = other_access_handle.access + op = _OPERATORS[operator] + return self._create_access_path(op(self._obj, other_access._obj)) + + def get_annotation_name_and_args(self): + """ + Returns Tuple[Optional[str], Tuple[AccessPath, ...]] + """ + if sys.version_info < (3, 5): + return None, () + + name = None + args = () + if safe_getattr(self._obj, '__module__', default='') == 'typing': + m = re.match(r'typing.(\w+)\[', repr(self._obj)) + if m is not None: + name = m.group(1) + + import typing + if sys.version_info >= (3, 8): + args = typing.get_args(self._obj) + else: + args = safe_getattr(self._obj, '__args__', default=None) + return name, tuple(self._create_access_path(arg) for arg in args) + + def needs_type_completions(self): + return inspect.isclass(self._obj) and self._obj != type + + def _annotation_to_str(self, annotation): + if py_version < 30: + return '' + return inspect.formatannotation(annotation) + + def get_signature_params(self): + return [ + SignatureParam( + name=p.name, + has_default=p.default is not p.empty, + default=self._create_access_path(p.default), + default_string=repr(p.default), + has_annotation=p.annotation is not p.empty, + annotation=self._create_access_path(p.annotation), + annotation_string=self._annotation_to_str(p.annotation), + kind_name=str(p.kind) + ) for p in self._get_signature().parameters.values() + ] + + def _get_signature(self): + obj = self._obj + if py_version < 33: + raise ValueError("inspect.signature was introduced in 3.3") + try: + return inspect.signature(obj) + except (RuntimeError, TypeError): + # Reading the code of the function in Python 3.6 implies there are + # at least these errors that might occur if something is wrong with + # the signature. In that case we just want a simple escape for now. + raise ValueError + + def get_return_annotation(self): + try: + o = self._obj.__annotations__.get('return') + except AttributeError: + return None + + if o is None: + return None + + try: + # Python 2 doesn't have typing. + import typing + except ImportError: + pass + else: + try: + o = typing.get_type_hints(self._obj).get('return') + except Exception: + pass + + return self._create_access_path(o) + + def negate(self): + return self._create_access_path(-self._obj) + + def get_dir_infos(self): + """ + Used to return a couple of infos that are needed when accessing the sub + objects of an objects + """ + tuples = dict( + (force_unicode(name), self.is_allowed_getattr(name)) + for name in self.dir() + ) + return self.needs_type_completions(), tuples + + +def _is_class_instance(obj): + """Like inspect.* methods.""" + try: + cls = obj.__class__ + except AttributeError: + return False + else: + # The isinstance check for cls is just there so issubclass doesn't + # raise an exception. + return cls != type and isinstance(cls, type) and not issubclass(cls, NOT_CLASS_TYPES) diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/compiled/getattr_static.py b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/getattr_static.py new file mode 100644 index 00000000..7225aabd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/getattr_static.py @@ -0,0 +1,184 @@ +""" +A static version of getattr. +This is a backport of the Python 3 code with a little bit of additional +information returned to enable Jedi to make decisions. +""" + +import types + +from jedi import debug +from jedi._compatibility import py_version + +_sentinel = object() + + +def _check_instance(obj, attr): + instance_dict = {} + try: + instance_dict = object.__getattribute__(obj, "__dict__") + except AttributeError: + pass + return dict.get(instance_dict, attr, _sentinel) + + +def _check_class(klass, attr): + for entry in _static_getmro(klass): + if _shadowed_dict(type(entry)) is _sentinel: + try: + return entry.__dict__[attr] + except KeyError: + pass + return _sentinel + + +def _is_type(obj): + try: + _static_getmro(obj) + except TypeError: + return False + return True + + +def _shadowed_dict_newstyle(klass): + dict_attr = type.__dict__["__dict__"] + for entry in _static_getmro(klass): + try: + class_dict = dict_attr.__get__(entry)["__dict__"] + except KeyError: + pass + else: + if not (type(class_dict) is types.GetSetDescriptorType + and class_dict.__name__ == "__dict__" + and class_dict.__objclass__ is entry): + return class_dict + return _sentinel + + +def _static_getmro_newstyle(klass): + mro = type.__dict__['__mro__'].__get__(klass) + if not isinstance(mro, (tuple, list)): + # There are unfortunately no tests for this, I was not able to + # reproduce this in pure Python. However should still solve the issue + # raised in GH #1517. + debug.warning('mro of %s returned %s, should be a tuple' % (klass, mro)) + return () + return mro + + +if py_version >= 30: + _shadowed_dict = _shadowed_dict_newstyle + _get_type = type + _static_getmro = _static_getmro_newstyle +else: + def _shadowed_dict(klass): + """ + In Python 2 __dict__ is not overwritable: + + class Foo(object): pass + setattr(Foo, '__dict__', 4) + + Traceback (most recent call last): + File "", line 1, in + TypeError: __dict__ must be a dictionary object + + It applies to both newstyle and oldstyle classes: + + class Foo(object): pass + setattr(Foo, '__dict__', 4) + Traceback (most recent call last): + File "", line 1, in + AttributeError: attribute '__dict__' of 'type' objects is not writable + + It also applies to instances of those objects. However to keep things + straight forward, newstyle classes always use the complicated way of + accessing it while oldstyle classes just use getattr. + """ + if type(klass) is _oldstyle_class_type: + return getattr(klass, '__dict__', _sentinel) + return _shadowed_dict_newstyle(klass) + + class _OldStyleClass: + pass + + _oldstyle_instance_type = type(_OldStyleClass()) + _oldstyle_class_type = type(_OldStyleClass) + + def _get_type(obj): + type_ = object.__getattribute__(obj, '__class__') + if type_ is _oldstyle_instance_type: + # Somehow for old style classes we need to access it directly. + return obj.__class__ + return type_ + + def _static_getmro(klass): + if type(klass) is _oldstyle_class_type: + def oldstyle_mro(klass): + """ + Oldstyle mro is a really simplistic way of look up mro: + https://stackoverflow.com/questions/54867/what-is-the-difference-between-old-style-and-new-style-classes-in-python + """ + yield klass + for base in klass.__bases__: + for yield_from in oldstyle_mro(base): + yield yield_from + + return oldstyle_mro(klass) + + return _static_getmro_newstyle(klass) + + +def _safe_hasattr(obj, name): + return _check_class(_get_type(obj), name) is not _sentinel + + +def _safe_is_data_descriptor(obj): + return _safe_hasattr(obj, '__set__') or _safe_hasattr(obj, '__delete__') + + +def getattr_static(obj, attr, default=_sentinel): + """Retrieve attributes without triggering dynamic lookup via the + descriptor protocol, __getattr__ or __getattribute__. + + Note: this function may not be able to retrieve all attributes + that getattr can fetch (like dynamically created attributes) + and may find attributes that getattr can't (like descriptors + that raise AttributeError). It can also return descriptor objects + instead of instance members in some cases. See the + documentation for details. + + Returns a tuple `(attr, is_get_descriptor)`. is_get_descripter means that + the attribute is a descriptor that has a `__get__` attribute. + """ + instance_result = _sentinel + if not _is_type(obj): + klass = _get_type(obj) + dict_attr = _shadowed_dict(klass) + if (dict_attr is _sentinel or type(dict_attr) is types.MemberDescriptorType): + instance_result = _check_instance(obj, attr) + else: + klass = obj + + klass_result = _check_class(klass, attr) + + if instance_result is not _sentinel and klass_result is not _sentinel: + if _safe_hasattr(klass_result, '__get__') \ + and _safe_is_data_descriptor(klass_result): + # A get/set descriptor has priority over everything. + return klass_result, True + + if instance_result is not _sentinel: + return instance_result, False + if klass_result is not _sentinel: + return klass_result, _safe_hasattr(klass_result, '__get__') + + if obj is klass: + # for types we check the metaclass too + for entry in _static_getmro(type(klass)): + if _shadowed_dict(type(entry)) is _sentinel: + try: + return entry.__dict__[attr], False + except KeyError: + pass + if default is not _sentinel: + return default, False + raise AttributeError(attr) diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/compiled/mixed.py b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/mixed.py new file mode 100644 index 00000000..98959fd8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/mixed.py @@ -0,0 +1,294 @@ +""" +Used only for REPL Completion. +""" + +import inspect +import os +import sys + +from jedi.parser_utils import get_cached_code_lines + +from jedi._compatibility import unwrap +from jedi import settings +from jedi.cache import memoize_method +from jedi.inference import compiled +from jedi.file_io import FileIO +from jedi.inference.names import NameWrapper +from jedi.inference.base_value import ValueSet, ValueWrapper, NO_VALUES +from jedi.inference.value import ModuleValue +from jedi.inference.cache import inference_state_function_cache, \ + inference_state_method_cache +from jedi.inference.compiled.access import ALLOWED_GETITEM_TYPES, get_api_type +from jedi.inference.gradual.conversion import to_stub +from jedi.inference.context import CompiledContext, CompiledModuleContext, \ + TreeContextMixin + +_sentinel = object() + + +class MixedObject(ValueWrapper): + """ + A ``MixedObject`` is used in two ways: + + 1. It uses the default logic of ``parser.python.tree`` objects, + 2. except for getattr calls and signatures. The names dicts are generated + in a fashion like ``CompiledValue``. + + This combined logic makes it possible to provide more powerful REPL + completion. It allows side effects that are not noticable with the default + parser structure to still be completeable. + + The biggest difference from CompiledValue to MixedObject is that we are + generally dealing with Python code and not with C code. This will generate + fewer special cases, because we in Python you don't have the same freedoms + to modify the runtime. + """ + def __init__(self, compiled_value, tree_value): + super(MixedObject, self).__init__(tree_value) + self.compiled_value = compiled_value + self.access_handle = compiled_value.access_handle + + def get_filters(self, *args, **kwargs): + yield MixedObjectFilter( + self.inference_state, self.compiled_value, self._wrapped_value) + + def get_signatures(self): + # Prefer `inspect.signature` over somehow analyzing Python code. It + # should be very precise, especially for stuff like `partial`. + return self.compiled_value.get_signatures() + + @inference_state_method_cache(default=NO_VALUES) + def py__call__(self, arguments): + # Fallback to the wrapped value if to stub returns no values. + values = to_stub(self._wrapped_value) + if not values: + values = self._wrapped_value + return values.py__call__(arguments) + + def get_safe_value(self, default=_sentinel): + if default is _sentinel: + return self.compiled_value.get_safe_value() + else: + return self.compiled_value.get_safe_value(default) + + def py__simple_getitem__(self, index): + python_object = self.compiled_value.access_handle.access._obj + if type(python_object) in ALLOWED_GETITEM_TYPES: + return self.compiled_value.py__simple_getitem__(index) + return self._wrapped_value.py__simple_getitem__(index) + + def _as_context(self): + if self.parent_context is None: + return MixedModuleContext(self) + return MixedContext(self) + + def __repr__(self): + return '<%s: %s; %s>' % ( + type(self).__name__, + self.access_handle.get_repr(), + self._wrapped_value, + ) + + +class MixedContext(CompiledContext, TreeContextMixin): + @property + def compiled_value(self): + return self._value.compiled_value + + +class MixedModuleContext(CompiledModuleContext, MixedContext): + pass + + +class MixedName(NameWrapper): + """ + The ``CompiledName._compiled_value`` is our MixedObject. + """ + def __init__(self, wrapped_name, parent_tree_value): + super(MixedName, self).__init__(wrapped_name) + self._parent_tree_value = parent_tree_value + + @property + def start_pos(self): + values = list(self.infer()) + if not values: + # This means a start_pos that doesn't exist (compiled objects). + return 0, 0 + return values[0].name.start_pos + + @memoize_method + def infer(self): + compiled_value = self._wrapped_name.infer_compiled_value() + tree_value = self._parent_tree_value + if tree_value.is_instance() or tree_value.is_class(): + tree_values = tree_value.py__getattribute__(self.string_name) + if compiled_value.is_function(): + return ValueSet({MixedObject(compiled_value, v) for v in tree_values}) + + module_context = tree_value.get_root_context() + return _create(self._inference_state, compiled_value, module_context) + + +class MixedObjectFilter(compiled.CompiledValueFilter): + def __init__(self, inference_state, compiled_value, tree_value): + super(MixedObjectFilter, self).__init__(inference_state, compiled_value) + self._tree_value = tree_value + + def _create_name(self, name): + return MixedName( + super(MixedObjectFilter, self)._create_name(name), + self._tree_value, + ) + + +@inference_state_function_cache() +def _load_module(inference_state, path): + return inference_state.parse( + path=path, + cache=True, + diff_cache=settings.fast_parser, + cache_path=settings.cache_directory + ).get_root_node() + + +def _get_object_to_check(python_object): + """Check if inspect.getfile has a chance to find the source.""" + if sys.version_info[0] > 2: + try: + python_object = unwrap(python_object) + except ValueError: + # Can return a ValueError when it wraps around + pass + + if (inspect.ismodule(python_object) + or inspect.isclass(python_object) + or inspect.ismethod(python_object) + or inspect.isfunction(python_object) + or inspect.istraceback(python_object) + or inspect.isframe(python_object) + or inspect.iscode(python_object)): + return python_object + + try: + return python_object.__class__ + except AttributeError: + raise TypeError # Prevents computation of `repr` within inspect. + + +def _find_syntax_node_name(inference_state, python_object): + original_object = python_object + try: + python_object = _get_object_to_check(python_object) + path = inspect.getsourcefile(python_object) + except TypeError: + # The type might not be known (e.g. class_with_dict.__weakref__) + return None + if path is None or not os.path.exists(path): + # The path might not exist or be e.g. . + return None + + file_io = FileIO(path) + module_node = _load_module(inference_state, path) + + if inspect.ismodule(python_object): + # We don't need to check names for modules, because there's not really + # a way to write a module in a module in Python (and also __name__ can + # be something like ``email.utils``). + code_lines = get_cached_code_lines(inference_state.grammar, path) + return module_node, module_node, file_io, code_lines + + try: + name_str = python_object.__name__ + except AttributeError: + # Stuff like python_function.__code__. + return None + + if name_str == '': + return None # It's too hard to find lambdas. + + # Doesn't always work (e.g. os.stat_result) + names = module_node.get_used_names().get(name_str, []) + # Only functions and classes are relevant. If a name e.g. points to an + # import, it's probably a builtin (like collections.deque) and needs to be + # ignored. + names = [ + n for n in names + if n.parent.type in ('funcdef', 'classdef') and n.parent.name == n + ] + if not names: + return None + + try: + code = python_object.__code__ + # By using the line number of a code object we make the lookup in a + # file pretty easy. There's still a possibility of people defining + # stuff like ``a = 3; foo(a); a = 4`` on the same line, but if people + # do so we just don't care. + line_nr = code.co_firstlineno + except AttributeError: + pass + else: + line_names = [name for name in names if name.start_pos[0] == line_nr] + # There's a chance that the object is not available anymore, because + # the code has changed in the background. + if line_names: + names = line_names + + code_lines = get_cached_code_lines(inference_state.grammar, path) + # It's really hard to actually get the right definition, here as a last + # resort we just return the last one. This chance might lead to odd + # completions at some points but will lead to mostly correct type + # inference, because people tend to define a public name in a module only + # once. + tree_node = names[-1].parent + if tree_node.type == 'funcdef' and get_api_type(original_object) == 'instance': + # If an instance is given and we're landing on a function (e.g. + # partial in 3.5), something is completely wrong and we should not + # return that. + return None + return module_node, tree_node, file_io, code_lines + + +@inference_state_function_cache() +def _create(inference_state, compiled_value, module_context): + # TODO accessing this is bad, but it probably doesn't matter that much, + # because we're working with interpreteters only here. + python_object = compiled_value.access_handle.access._obj + result = _find_syntax_node_name(inference_state, python_object) + if result is None: + # TODO Care about generics from stuff like `[1]` and don't return like this. + if type(python_object) in (dict, list, tuple): + return ValueSet({compiled_value}) + + tree_values = to_stub(compiled_value) + if not tree_values: + return ValueSet({compiled_value}) + else: + module_node, tree_node, file_io, code_lines = result + + if module_context is None or module_context.tree_node != module_node: + root_compiled_value = compiled_value.get_root_context().get_value() + # TODO this __name__ might be wrong. + name = root_compiled_value.py__name__() + string_names = tuple(name.split('.')) + module_value = ModuleValue( + inference_state, module_node, + file_io=file_io, + string_names=string_names, + code_lines=code_lines, + is_package=root_compiled_value.is_package(), + ) + if name is not None: + inference_state.module_cache.add(string_names, ValueSet([module_value])) + module_context = module_value.as_context() + + tree_values = ValueSet({module_context.create_value(tree_node)}) + if tree_node.type == 'classdef': + if not compiled_value.is_class(): + # Is an instance, not a class. + tree_values = tree_values.execute_with_values() + + return ValueSet( + MixedObject(compiled_value, tree_value=tree_value) + for tree_value in tree_values + ) diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/compiled/subprocess/__init__.py b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/subprocess/__init__.py new file mode 100644 index 00000000..d921e1bd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/subprocess/__init__.py @@ -0,0 +1,412 @@ +""" +Makes it possible to do the compiled analysis in a subprocess. This has two +goals: + +1. Making it safer - Segfaults and RuntimeErrors as well as stdout/stderr can + be ignored and dealt with. +2. Make it possible to handle different Python versions as well as virtualenvs. +""" + +import os +import sys +import subprocess +import socket +import errno +import traceback +from functools import partial +from threading import Thread +try: + from queue import Queue, Empty +except ImportError: + from Queue import Queue, Empty # python 2.7 + +from jedi._compatibility import queue, is_py3, force_unicode, \ + pickle_dump, pickle_load, GeneralizedPopen, weakref +from jedi import debug +from jedi.cache import memoize_method +from jedi.inference.compiled.subprocess import functions +from jedi.inference.compiled.access import DirectObjectAccess, AccessPath, \ + SignatureParam +from jedi.api.exceptions import InternalError + + +_MAIN_PATH = os.path.join(os.path.dirname(__file__), '__main__.py') + + +def _enqueue_output(out, queue): + for line in iter(out.readline, b''): + queue.put(line) + + +def _add_stderr_to_debug(stderr_queue): + while True: + # Try to do some error reporting from the subprocess and print its + # stderr contents. + try: + line = stderr_queue.get_nowait() + line = line.decode('utf-8', 'replace') + debug.warning('stderr output: %s' % line.rstrip('\n')) + except Empty: + break + + +def _get_function(name): + return getattr(functions, name) + + +def _cleanup_process(process, thread): + try: + process.kill() + process.wait() + except OSError: + # Raised if the process is already killed. + pass + thread.join() + for stream in [process.stdin, process.stdout, process.stderr]: + try: + stream.close() + except OSError: + # Raised if the stream is broken. + pass + + +class _InferenceStateProcess(object): + def __init__(self, inference_state): + self._inference_state_weakref = weakref.ref(inference_state) + self._inference_state_id = id(inference_state) + self._handles = {} + + def get_or_create_access_handle(self, obj): + id_ = id(obj) + try: + return self.get_access_handle(id_) + except KeyError: + access = DirectObjectAccess(self._inference_state_weakref(), obj) + handle = AccessHandle(self, access, id_) + self.set_access_handle(handle) + return handle + + def get_access_handle(self, id_): + return self._handles[id_] + + def set_access_handle(self, handle): + self._handles[handle.id] = handle + + +class InferenceStateSameProcess(_InferenceStateProcess): + """ + Basically just an easy access to functions.py. It has the same API + as InferenceStateSubprocess and does the same thing without using a subprocess. + This is necessary for the Interpreter process. + """ + def __getattr__(self, name): + return partial(_get_function(name), self._inference_state_weakref()) + + +class InferenceStateSubprocess(_InferenceStateProcess): + def __init__(self, inference_state, compiled_subprocess): + super(InferenceStateSubprocess, self).__init__(inference_state) + self._used = False + self._compiled_subprocess = compiled_subprocess + + def __getattr__(self, name): + func = _get_function(name) + + def wrapper(*args, **kwargs): + self._used = True + + result = self._compiled_subprocess.run( + self._inference_state_weakref(), + func, + args=args, + kwargs=kwargs, + ) + # IMO it should be possible to create a hook in pickle.load to + # mess with the loaded objects. However it's extremely complicated + # to work around this so just do it with this call. ~ dave + return self._convert_access_handles(result) + + return wrapper + + def _convert_access_handles(self, obj): + if isinstance(obj, SignatureParam): + return SignatureParam(*self._convert_access_handles(tuple(obj))) + elif isinstance(obj, tuple): + return tuple(self._convert_access_handles(o) for o in obj) + elif isinstance(obj, list): + return [self._convert_access_handles(o) for o in obj] + elif isinstance(obj, AccessHandle): + try: + # Rewrite the access handle to one we're already having. + obj = self.get_access_handle(obj.id) + except KeyError: + obj.add_subprocess(self) + self.set_access_handle(obj) + elif isinstance(obj, AccessPath): + return AccessPath(self._convert_access_handles(obj.accesses)) + return obj + + def __del__(self): + if self._used and not self._compiled_subprocess.is_crashed: + self._compiled_subprocess.delete_inference_state(self._inference_state_id) + + +class CompiledSubprocess(object): + is_crashed = False + # Start with 2, gets set after _get_info. + _pickle_protocol = 2 + + def __init__(self, executable): + self._executable = executable + self._inference_state_deletion_queue = queue.deque() + self._cleanup_callable = lambda: None + + def __repr__(self): + pid = os.getpid() + return '<%s _executable=%r, _pickle_protocol=%r, is_crashed=%r, pid=%r>' % ( + self.__class__.__name__, + self._executable, + self._pickle_protocol, + self.is_crashed, + pid, + ) + + @memoize_method + def _get_process(self): + debug.dbg('Start environment subprocess %s', self._executable) + parso_path = sys.modules['parso'].__file__ + args = ( + self._executable, + _MAIN_PATH, + os.path.dirname(os.path.dirname(parso_path)), + '.'.join(str(x) for x in sys.version_info[:3]), + ) + # Use explicit envionment to ensure reliable results (#1540) + env = {} + if os.name == 'nt': + # if SYSTEMROOT (or case variant) exists in environment, + # ensure it goes to subprocess + for k, v in os.environ.items(): + if 'SYSTEMROOT' == k.upper(): + env.update({k: os.environ[k]}) + break # don't risk multiple entries + process = GeneralizedPopen( + args, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + # Use system default buffering on Python 2 to improve performance + # (this is already the case on Python 3). + bufsize=-1, + env=env + ) + self._stderr_queue = Queue() + self._stderr_thread = t = Thread( + target=_enqueue_output, + args=(process.stderr, self._stderr_queue) + ) + t.daemon = True + t.start() + # Ensure the subprocess is properly cleaned up when the object + # is garbage collected. + self._cleanup_callable = weakref.finalize(self, + _cleanup_process, + process, + t) + return process + + def run(self, inference_state, function, args=(), kwargs={}): + # Delete old inference_states. + while True: + try: + inference_state_id = self._inference_state_deletion_queue.pop() + except IndexError: + break + else: + self._send(inference_state_id, None) + + assert callable(function) + return self._send(id(inference_state), function, args, kwargs) + + def get_sys_path(self): + return self._send(None, functions.get_sys_path, (), {}) + + def _kill(self): + self.is_crashed = True + self._cleanup_callable() + + def _send(self, inference_state_id, function, args=(), kwargs={}): + if self.is_crashed: + raise InternalError("The subprocess %s has crashed." % self._executable) + + if not is_py3: + # Python 2 compatibility + kwargs = {force_unicode(key): value for key, value in kwargs.items()} + + data = inference_state_id, function, args, kwargs + try: + pickle_dump(data, self._get_process().stdin, self._pickle_protocol) + except (socket.error, IOError) as e: + # Once Python2 will be removed we can just use `BrokenPipeError`. + # Also, somehow in windows it returns EINVAL instead of EPIPE if + # the subprocess dies. + if e.errno not in (errno.EPIPE, errno.EINVAL): + # Not a broken pipe + raise + self._kill() + raise InternalError("The subprocess %s was killed. Maybe out of memory?" + % self._executable) + + try: + is_exception, traceback, result = pickle_load(self._get_process().stdout) + except EOFError as eof_error: + try: + stderr = self._get_process().stderr.read().decode('utf-8', 'replace') + except Exception as exc: + stderr = '' % exc + self._kill() + _add_stderr_to_debug(self._stderr_queue) + raise InternalError( + "The subprocess %s has crashed (%r, stderr=%s)." % ( + self._executable, + eof_error, + stderr, + )) + + _add_stderr_to_debug(self._stderr_queue) + + if is_exception: + # Replace the attribute error message with a the traceback. It's + # way more informative. + result.args = (traceback,) + raise result + return result + + def delete_inference_state(self, inference_state_id): + """ + Currently we are not deleting inference_state instantly. They only get + deleted once the subprocess is used again. It would probably a better + solution to move all of this into a thread. However, the memory usage + of a single inference_state shouldn't be that high. + """ + # With an argument - the inference_state gets deleted. + self._inference_state_deletion_queue.append(inference_state_id) + + +class Listener(object): + def __init__(self, pickle_protocol): + self._inference_states = {} + # TODO refactor so we don't need to process anymore just handle + # controlling. + self._process = _InferenceStateProcess(Listener) + self._pickle_protocol = pickle_protocol + + def _get_inference_state(self, function, inference_state_id): + from jedi.inference import InferenceState + + try: + inference_state = self._inference_states[inference_state_id] + except KeyError: + from jedi import InterpreterEnvironment + inference_state = InferenceState( + # The project is not actually needed. Nothing should need to + # access it. + project=None, + environment=InterpreterEnvironment() + ) + self._inference_states[inference_state_id] = inference_state + return inference_state + + def _run(self, inference_state_id, function, args, kwargs): + if inference_state_id is None: + return function(*args, **kwargs) + elif function is None: + del self._inference_states[inference_state_id] + else: + inference_state = self._get_inference_state(function, inference_state_id) + + # Exchange all handles + args = list(args) + for i, arg in enumerate(args): + if isinstance(arg, AccessHandle): + args[i] = inference_state.compiled_subprocess.get_access_handle(arg.id) + for key, value in kwargs.items(): + if isinstance(value, AccessHandle): + kwargs[key] = inference_state.compiled_subprocess.get_access_handle(value.id) + + return function(inference_state, *args, **kwargs) + + def listen(self): + stdout = sys.stdout + # Mute stdout. Nobody should actually be able to write to it, + # because stdout is used for IPC. + sys.stdout = open(os.devnull, 'w') + stdin = sys.stdin + if sys.version_info[0] > 2: + stdout = stdout.buffer + stdin = stdin.buffer + # Python 2 opens streams in text mode on Windows. Set stdout and stdin + # to binary mode. + elif sys.platform == 'win32': + import msvcrt + msvcrt.setmode(stdout.fileno(), os.O_BINARY) + msvcrt.setmode(stdin.fileno(), os.O_BINARY) + + while True: + try: + payload = pickle_load(stdin) + except EOFError: + # It looks like the parent process closed. + # Don't make a big fuss here and just exit. + exit(0) + try: + result = False, None, self._run(*payload) + except Exception as e: + result = True, traceback.format_exc(), e + + pickle_dump(result, stdout, self._pickle_protocol) + + +class AccessHandle(object): + def __init__(self, subprocess, access, id_): + self.access = access + self._subprocess = subprocess + self.id = id_ + + def add_subprocess(self, subprocess): + self._subprocess = subprocess + + def __repr__(self): + try: + detail = self.access + except AttributeError: + detail = '#' + str(self.id) + return '<%s of %s>' % (self.__class__.__name__, detail) + + def __getstate__(self): + return self.id + + def __setstate__(self, state): + self.id = state + + def __getattr__(self, name): + if name in ('id', 'access') or name.startswith('_'): + raise AttributeError("Something went wrong with unpickling") + + # if not is_py3: print >> sys.stderr, name + # print('getattr', name, file=sys.stderr) + return partial(self._workaround, force_unicode(name)) + + def _workaround(self, name, *args, **kwargs): + """ + TODO Currently we're passing slice objects around. This should not + happen. They are also the only unhashable objects that we're passing + around. + """ + if args and isinstance(args[0], slice): + return self._subprocess.get_compiled_method_return(self.id, name, *args, **kwargs) + return self._cached_results(name, *args, **kwargs) + + @memoize_method + def _cached_results(self, name, *args, **kwargs): + return self._subprocess.get_compiled_method_return(self.id, name, *args, **kwargs) diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/compiled/subprocess/__main__.py b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/subprocess/__main__.py new file mode 100644 index 00000000..5e92229f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/subprocess/__main__.py @@ -0,0 +1,55 @@ +import os +import sys + + +def _get_paths(): + # Get the path to jedi. + _d = os.path.dirname + _jedi_path = _d(_d(_d(_d(_d(__file__))))) + _parso_path = sys.argv[1] + # The paths are the directory that jedi and parso lie in. + return {'jedi': _jedi_path, 'parso': _parso_path} + + +# Remove the first entry, because it's simply a directory entry that equals +# this directory. +del sys.path[0] + +if sys.version_info > (3, 4): + from importlib.machinery import PathFinder + + class _ExactImporter(object): + def __init__(self, path_dct): + self._path_dct = path_dct + + def find_module(self, fullname, path=None): + if path is None and fullname in self._path_dct: + p = self._path_dct[fullname] + loader = PathFinder.find_module(fullname, path=[p]) + return loader + return None + + # Try to import jedi/parso. + sys.meta_path.insert(0, _ExactImporter(_get_paths())) + from jedi.inference.compiled import subprocess # NOQA + sys.meta_path.pop(0) +else: + import imp + + def load(name): + paths = list(_get_paths().values()) + fp, pathname, description = imp.find_module(name, paths) + return imp.load_module(name, fp, pathname, description) + + load('parso') + load('jedi') + from jedi.inference.compiled import subprocess # NOQA + +from jedi._compatibility import highest_pickle_protocol # noqa: E402 + + +# Retrieve the pickle protocol. +host_sys_version = [int(x) for x in sys.argv[2].split('.')] +pickle_protocol = highest_pickle_protocol([sys.version_info, host_sys_version]) +# And finally start the client. +subprocess.Listener(pickle_protocol=pickle_protocol).listen() diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/compiled/subprocess/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/subprocess/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..cbb1276d Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/subprocess/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/compiled/subprocess/__pycache__/__main__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/subprocess/__pycache__/__main__.cpython-38.pyc new file mode 100644 index 00000000..ac4cd8dd Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/subprocess/__pycache__/__main__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/compiled/subprocess/__pycache__/functions.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/subprocess/__pycache__/functions.cpython-38.pyc new file mode 100644 index 00000000..652c5923 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/subprocess/__pycache__/functions.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/compiled/subprocess/functions.py b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/subprocess/functions.py new file mode 100644 index 00000000..86b5287b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/subprocess/functions.py @@ -0,0 +1,115 @@ +from __future__ import print_function +import sys +import os +import re +import inspect + +from jedi._compatibility import find_module, cast_path, force_unicode, \ + all_suffixes, scandir +from jedi.inference.compiled import access +from jedi import debug +from jedi import parser_utils + + +def get_sys_path(): + return list(map(cast_path, sys.path)) + + +def load_module(inference_state, **kwargs): + return access.load_module(inference_state, **kwargs) + + +def get_compiled_method_return(inference_state, id, attribute, *args, **kwargs): + handle = inference_state.compiled_subprocess.get_access_handle(id) + return getattr(handle.access, attribute)(*args, **kwargs) + + +def create_simple_object(inference_state, obj): + return access.create_access_path(inference_state, obj) + + +def get_module_info(inference_state, sys_path=None, full_name=None, **kwargs): + """ + Returns Tuple[Union[NamespaceInfo, FileIO, None], Optional[bool]] + """ + if sys_path is not None: + sys.path, temp = sys_path, sys.path + try: + return find_module(full_name=full_name, **kwargs) + except ImportError: + return None, None + finally: + if sys_path is not None: + sys.path = temp + + +def get_builtin_module_names(inference_state): + return list(map(force_unicode, sys.builtin_module_names)) + + +def _test_raise_error(inference_state, exception_type): + """ + Raise an error to simulate certain problems for unit tests. + """ + raise exception_type + + +def _test_print(inference_state, stderr=None, stdout=None): + """ + Force some prints in the subprocesses. This exists for unit tests. + """ + if stderr is not None: + print(stderr, file=sys.stderr) + sys.stderr.flush() + if stdout is not None: + print(stdout) + sys.stdout.flush() + + +def _get_init_path(directory_path): + """ + The __init__ file can be searched in a directory. If found return it, else + None. + """ + for suffix in all_suffixes(): + path = os.path.join(directory_path, '__init__' + suffix) + if os.path.exists(path): + return path + return None + + +def safe_literal_eval(inference_state, value): + return parser_utils.safe_literal_eval(value) + + +def iter_module_names(*args, **kwargs): + return list(_iter_module_names(*args, **kwargs)) + + +def _iter_module_names(inference_state, paths): + # Python modules/packages + for path in paths: + try: + dirs = scandir(path) + except OSError: + # The file might not exist or reading it might lead to an error. + debug.warning("Not possible to list directory: %s", path) + continue + for dir_entry in dirs: + name = dir_entry.name + # First Namespaces then modules/stubs + if dir_entry.is_dir(): + # pycache is obviously not an interestin namespace. Also the + # name must be a valid identifier. + # TODO use str.isidentifier, once Python 2 is removed + if name != '__pycache__' and not re.search(r'\W|^\d', name): + yield name + else: + if name.endswith('.pyi'): # Stub files + modname = name[:-4] + else: + modname = inspect.getmodulename(name) + + if modname and '.' not in modname: + if modname != '__init__': + yield modname diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/compiled/value.py b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/value.py new file mode 100644 index 00000000..61b134ad --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/compiled/value.py @@ -0,0 +1,629 @@ +""" +Imitate the parser representation. +""" +import re +from functools import partial + +from jedi import debug +from jedi.inference.utils import to_list +from jedi._compatibility import force_unicode, Parameter, cast_path +from jedi.cache import memoize_method +from jedi.inference.filters import AbstractFilter +from jedi.inference.names import AbstractNameDefinition, ValueNameMixin, \ + ParamNameInterface +from jedi.inference.base_value import Value, ValueSet, NO_VALUES +from jedi.inference.lazy_value import LazyKnownValue +from jedi.inference.compiled.access import _sentinel +from jedi.inference.cache import inference_state_function_cache +from jedi.inference.helpers import reraise_getitem_errors +from jedi.inference.signature import BuiltinSignature +from jedi.inference.context import CompiledContext, CompiledModuleContext + + +class CheckAttribute(object): + """Raises :exc:`AttributeError` if the attribute X is not available.""" + def __init__(self, check_name=None): + # Remove the py in front of e.g. py__call__. + self.check_name = check_name + + def __call__(self, func): + self.func = func + if self.check_name is None: + self.check_name = force_unicode(func.__name__[2:]) + return self + + def __get__(self, instance, owner): + if instance is None: + return self + + # This might raise an AttributeError. That's wanted. + instance.access_handle.getattr_paths(self.check_name) + return partial(self.func, instance) + + +class CompiledValue(Value): + def __init__(self, inference_state, access_handle, parent_context=None): + super(CompiledValue, self).__init__(inference_state, parent_context) + self.access_handle = access_handle + + def py__call__(self, arguments): + return_annotation = self.access_handle.get_return_annotation() + if return_annotation is not None: + # TODO the return annotation may also be a string. + return create_from_access_path( + self.inference_state, + return_annotation + ).execute_annotation() + + try: + self.access_handle.getattr_paths(u'__call__') + except AttributeError: + return super(CompiledValue, self).py__call__(arguments) + else: + if self.access_handle.is_class(): + from jedi.inference.value import CompiledInstance + return ValueSet([ + CompiledInstance(self.inference_state, self.parent_context, self, arguments) + ]) + else: + return ValueSet(self._execute_function(arguments)) + + @CheckAttribute() + def py__class__(self): + return create_from_access_path(self.inference_state, self.access_handle.py__class__()) + + @CheckAttribute() + def py__mro__(self): + return (self,) + tuple( + create_from_access_path(self.inference_state, access) + for access in self.access_handle.py__mro__accesses() + ) + + @CheckAttribute() + def py__bases__(self): + return tuple( + create_from_access_path(self.inference_state, access) + for access in self.access_handle.py__bases__() + ) + + def get_qualified_names(self): + return self.access_handle.get_qualified_names() + + def py__bool__(self): + return self.access_handle.py__bool__() + + def is_class(self): + return self.access_handle.is_class() + + def is_function(self): + return self.access_handle.is_function() + + def is_module(self): + return self.access_handle.is_module() + + def is_compiled(self): + return True + + def is_stub(self): + return False + + def is_instance(self): + return self.access_handle.is_instance() + + def py__doc__(self): + return self.access_handle.py__doc__() + + @to_list + def get_param_names(self): + try: + signature_params = self.access_handle.get_signature_params() + except ValueError: # Has no signature + params_str, ret = self._parse_function_doc() + if not params_str: + tokens = [] + else: + tokens = params_str.split(',') + if self.access_handle.ismethoddescriptor(): + tokens.insert(0, 'self') + for p in tokens: + name, _, default = p.strip().partition('=') + yield UnresolvableParamName(self, name, default) + else: + for signature_param in signature_params: + yield SignatureParamName(self, signature_param) + + def get_signatures(self): + _, return_string = self._parse_function_doc() + return [BuiltinSignature(self, return_string)] + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.access_handle.get_repr()) + + @memoize_method + def _parse_function_doc(self): + doc = self.py__doc__() + if doc is None: + return '', '' + + return _parse_function_doc(doc) + + @property + def api_type(self): + return self.access_handle.get_api_type() + + def get_filters(self, is_instance=False, origin_scope=None): + yield self._ensure_one_filter(is_instance) + + @memoize_method + def _ensure_one_filter(self, is_instance): + return CompiledValueFilter(self.inference_state, self, is_instance) + + def py__simple_getitem__(self, index): + with reraise_getitem_errors(IndexError, KeyError, TypeError): + try: + access = self.access_handle.py__simple_getitem__(index) + except AttributeError: + return super(CompiledValue, self).py__simple_getitem__(index) + if access is None: + return NO_VALUES + + return ValueSet([create_from_access_path(self.inference_state, access)]) + + def py__getitem__(self, index_value_set, contextualized_node): + all_access_paths = self.access_handle.py__getitem__all_values() + if all_access_paths is None: + # This means basically that no __getitem__ has been defined on this + # object. + return super(CompiledValue, self).py__getitem__(index_value_set, contextualized_node) + return ValueSet( + create_from_access_path(self.inference_state, access) + for access in all_access_paths + ) + + def py__iter__(self, contextualized_node=None): + # Python iterators are a bit strange, because there's no need for + # the __iter__ function as long as __getitem__ is defined (it will + # just start with __getitem__(0). This is especially true for + # Python 2 strings, where `str.__iter__` is not even defined. + if not self.access_handle.has_iter(): + for x in super(CompiledValue, self).py__iter__(contextualized_node): + yield x + + access_path_list = self.access_handle.py__iter__list() + if access_path_list is None: + # There is no __iter__ method on this object. + return + + for access in access_path_list: + yield LazyKnownValue(create_from_access_path(self.inference_state, access)) + + def py__name__(self): + return self.access_handle.py__name__() + + @property + def name(self): + name = self.py__name__() + if name is None: + name = self.access_handle.get_repr() + return CompiledValueName(self, name) + + def _execute_function(self, params): + from jedi.inference import docstrings + from jedi.inference.compiled import builtin_from_name + if self.api_type != 'function': + return + + for name in self._parse_function_doc()[1].split(): + try: + # TODO wtf is this? this is exactly the same as the thing + # below. It uses getattr as well. + self.inference_state.builtins_module.access_handle.getattr_paths(name) + except AttributeError: + continue + else: + bltn_obj = builtin_from_name(self.inference_state, name) + for result in self.inference_state.execute(bltn_obj, params): + yield result + for type_ in docstrings.infer_return_types(self): + yield type_ + + def get_safe_value(self, default=_sentinel): + try: + return self.access_handle.get_safe_value() + except ValueError: + if default == _sentinel: + raise + return default + + def execute_operation(self, other, operator): + try: + return ValueSet([create_from_access_path( + self.inference_state, + self.access_handle.execute_operation(other.access_handle, operator) + )]) + except TypeError: + return NO_VALUES + + def execute_annotation(self): + if self.access_handle.get_repr() == 'None': + # None as an annotation doesn't need to be executed. + return ValueSet([self]) + + name, args = self.access_handle.get_annotation_name_and_args() + arguments = [ + ValueSet([create_from_access_path(self.inference_state, path)]) + for path in args + ] + if name == 'Union': + return ValueSet.from_sets(arg.execute_annotation() for arg in arguments) + elif name: + # While with_generics only exists on very specific objects, we + # should probably be fine, because we control all the typing + # objects. + return ValueSet([ + v.with_generics(arguments) + for v in self.inference_state.typing_module.py__getattribute__(name) + ]).execute_annotation() + return super(CompiledValue, self).execute_annotation() + + def negate(self): + return create_from_access_path(self.inference_state, self.access_handle.negate()) + + def get_metaclasses(self): + return NO_VALUES + + def _as_context(self): + return CompiledContext(self) + + @property + def array_type(self): + return self.access_handle.get_array_type() + + def get_key_values(self): + return [ + create_from_access_path(self.inference_state, k) + for k in self.access_handle.get_key_paths() + ] + + def get_type_hint(self, add_class_info=True): + if self.access_handle.get_repr() in ('None', ""): + return 'None' + return None + + +class CompiledModule(CompiledValue): + file_io = None # For modules + + def _as_context(self): + return CompiledModuleContext(self) + + def py__path__(self): + paths = self.access_handle.py__path__() + if paths is None: + return None + return map(cast_path, paths) + + def is_package(self): + return self.py__path__() is not None + + @property + def string_names(self): + # For modules + name = self.py__name__() + if name is None: + return () + return tuple(name.split('.')) + + def py__file__(self): + return cast_path(self.access_handle.py__file__()) + + +class CompiledName(AbstractNameDefinition): + def __init__(self, inference_state, parent_value, name): + self._inference_state = inference_state + self.parent_context = parent_value.as_context() + self._parent_value = parent_value + self.string_name = name + + def py__doc__(self): + value, = self.infer() + return value.py__doc__() + + def _get_qualified_names(self): + parent_qualified_names = self.parent_context.get_qualified_names() + if parent_qualified_names is None: + return None + return parent_qualified_names + (self.string_name,) + + def get_defining_qualified_value(self): + context = self.parent_context + if context.is_module() or context.is_class(): + return self.parent_context.get_value() # Might be None + + return None + + def __repr__(self): + try: + name = self.parent_context.name # __name__ is not defined all the time + except AttributeError: + name = None + return '<%s: (%s).%s>' % (self.__class__.__name__, name, self.string_name) + + @property + def api_type(self): + api = self.infer() + # If we can't find the type, assume it is an instance variable + if not api: + return "instance" + return next(iter(api)).api_type + + @memoize_method + def infer(self): + return ValueSet([self.infer_compiled_value()]) + + def infer_compiled_value(self): + return create_from_name(self._inference_state, self._parent_value, self.string_name) + + +class SignatureParamName(ParamNameInterface, AbstractNameDefinition): + def __init__(self, compiled_value, signature_param): + self.parent_context = compiled_value.parent_context + self._signature_param = signature_param + + @property + def string_name(self): + return self._signature_param.name + + def to_string(self): + s = self._kind_string() + self.string_name + if self._signature_param.has_annotation: + s += ': ' + self._signature_param.annotation_string + if self._signature_param.has_default: + s += '=' + self._signature_param.default_string + return s + + def get_kind(self): + return getattr(Parameter, self._signature_param.kind_name) + + def infer(self): + p = self._signature_param + inference_state = self.parent_context.inference_state + values = NO_VALUES + if p.has_default: + values = ValueSet([create_from_access_path(inference_state, p.default)]) + if p.has_annotation: + annotation = create_from_access_path(inference_state, p.annotation) + values |= annotation.execute_with_values() + return values + + +class UnresolvableParamName(ParamNameInterface, AbstractNameDefinition): + def __init__(self, compiled_value, name, default): + self.parent_context = compiled_value.parent_context + self.string_name = name + self._default = default + + def get_kind(self): + return Parameter.POSITIONAL_ONLY + + def to_string(self): + string = self.string_name + if self._default: + string += '=' + self._default + return string + + def infer(self): + return NO_VALUES + + +class CompiledValueName(ValueNameMixin, AbstractNameDefinition): + def __init__(self, value, name): + self.string_name = name + self._value = value + self.parent_context = value.parent_context + + +class EmptyCompiledName(AbstractNameDefinition): + """ + Accessing some names will raise an exception. To avoid not having any + completions, just give Jedi the option to return this object. It infers to + nothing. + """ + def __init__(self, inference_state, name): + self.parent_context = inference_state.builtins_module + self.string_name = name + + def infer(self): + return NO_VALUES + + +class CompiledValueFilter(AbstractFilter): + def __init__(self, inference_state, compiled_value, is_instance=False): + self._inference_state = inference_state + self.compiled_value = compiled_value + self.is_instance = is_instance + + def get(self, name): + access_handle = self.compiled_value.access_handle + return self._get( + name, + lambda name, unsafe: access_handle.is_allowed_getattr(name, unsafe), + lambda name: name in access_handle.dir(), + check_has_attribute=True + ) + + def _get(self, name, allowed_getattr_callback, in_dir_callback, check_has_attribute=False): + """ + To remove quite a few access calls we introduced the callback here. + """ + # Always use unicode objects in Python 2 from here. + name = force_unicode(name) + + if self._inference_state.allow_descriptor_getattr: + pass + + has_attribute, is_descriptor = allowed_getattr_callback( + name, + unsafe=self._inference_state.allow_descriptor_getattr + ) + if check_has_attribute and not has_attribute: + return [] + + if (is_descriptor or not has_attribute) \ + and not self._inference_state.allow_descriptor_getattr: + return [self._get_cached_name(name, is_empty=True)] + + if self.is_instance and not in_dir_callback(name): + return [] + return [self._get_cached_name(name)] + + @memoize_method + def _get_cached_name(self, name, is_empty=False): + if is_empty: + return EmptyCompiledName(self._inference_state, name) + else: + return self._create_name(name) + + def values(self): + from jedi.inference.compiled import builtin_from_name + names = [] + needs_type_completions, dir_infos = self.compiled_value.access_handle.get_dir_infos() + # We could use `unsafe` here as well, especially as a parameter to + # get_dir_infos. But this would lead to a lot of property executions + # that are probably not wanted. The drawback for this is that we + # have a different name for `get` and `values`. For `get` we always + # execute. + for name in dir_infos: + names += self._get( + name, + lambda name, unsafe: dir_infos[name], + lambda name: name in dir_infos, + ) + + # ``dir`` doesn't include the type names. + if not self.is_instance and needs_type_completions: + for filter in builtin_from_name(self._inference_state, u'type').get_filters(): + names += filter.values() + return names + + def _create_name(self, name): + return CompiledName( + self._inference_state, + self.compiled_value, + name + ) + + def __repr__(self): + return "<%s: %s>" % (self.__class__.__name__, self.compiled_value) + + +docstr_defaults = { + 'floating point number': u'float', + 'character': u'str', + 'integer': u'int', + 'dictionary': u'dict', + 'string': u'str', +} + + +def _parse_function_doc(doc): + """ + Takes a function and returns the params and return value as a tuple. + This is nothing more than a docstring parser. + + TODO docstrings like utime(path, (atime, mtime)) and a(b [, b]) -> None + TODO docstrings like 'tuple of integers' + """ + doc = force_unicode(doc) + # parse round parentheses: def func(a, (b,c)) + try: + count = 0 + start = doc.index('(') + for i, s in enumerate(doc[start:]): + if s == '(': + count += 1 + elif s == ')': + count -= 1 + if count == 0: + end = start + i + break + param_str = doc[start + 1:end] + except (ValueError, UnboundLocalError): + # ValueError for doc.index + # UnboundLocalError for undefined end in last line + debug.dbg('no brackets found - no param') + end = 0 + param_str = u'' + else: + # remove square brackets, that show an optional param ( = None) + def change_options(m): + args = m.group(1).split(',') + for i, a in enumerate(args): + if a and '=' not in a: + args[i] += '=None' + return ','.join(args) + + while True: + param_str, changes = re.subn(r' ?\[([^\[\]]+)\]', + change_options, param_str) + if changes == 0: + break + param_str = param_str.replace('-', '_') # see: isinstance.__doc__ + + # parse return value + r = re.search(u'-[>-]* ', doc[end:end + 7]) + if r is None: + ret = u'' + else: + index = end + r.end() + # get result type, which can contain newlines + pattern = re.compile(r'(,\n|[^\n-])+') + ret_str = pattern.match(doc, index).group(0).strip() + # New object -> object() + ret_str = re.sub(r'[nN]ew (.*)', r'\1()', ret_str) + + ret = docstr_defaults.get(ret_str, ret_str) + + return param_str, ret + + +def create_from_name(inference_state, compiled_value, name): + access_paths = compiled_value.access_handle.getattr_paths(name, default=None) + + value = None + for access_path in access_paths: + value = create_cached_compiled_value( + inference_state, + access_path, + parent_context=None if value is None else value.as_context(), + ) + return value + + +def _normalize_create_args(func): + """The cache doesn't care about keyword vs. normal args.""" + def wrapper(inference_state, obj, parent_context=None): + return func(inference_state, obj, parent_context) + return wrapper + + +def create_from_access_path(inference_state, access_path): + value = None + for name, access in access_path.accesses: + value = create_cached_compiled_value( + inference_state, + access, + parent_context=None if value is None else value.as_context() + ) + return value + + +@_normalize_create_args +@inference_state_function_cache() +def create_cached_compiled_value(inference_state, access_handle, parent_context): + assert not isinstance(parent_context, CompiledValue) + if parent_context is None: + cls = CompiledModule + else: + cls = CompiledValue + return cls(inference_state, access_handle, parent_context) diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/context.py b/.venv/lib/python3.8/site-packages/jedi/inference/context.py new file mode 100644 index 00000000..60034db6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/context.py @@ -0,0 +1,500 @@ +from abc import abstractmethod +from contextlib import contextmanager + +from parso.tree import search_ancestor +from parso.python.tree import Name + +from jedi.inference.filters import ParserTreeFilter, MergedFilter, \ + GlobalNameFilter +from jedi.inference.names import AnonymousParamName, TreeNameDefinition +from jedi.inference.base_value import NO_VALUES, ValueSet +from jedi.parser_utils import get_parent_scope +from jedi import debug +from jedi import parser_utils + + +class AbstractContext(object): + # Must be defined: inference_state and tree_node and parent_context as an attribute/property + + def __init__(self, inference_state): + self.inference_state = inference_state + self.predefined_names = {} + + @abstractmethod + def get_filters(self, until_position=None, origin_scope=None): + raise NotImplementedError + + def goto(self, name_or_str, position): + from jedi.inference import finder + filters = _get_global_filters_for_name( + self, name_or_str if isinstance(name_or_str, Name) else None, position, + ) + names = finder.filter_name(filters, name_or_str) + debug.dbg('context.goto %s in (%s): %s', name_or_str, self, names) + return names + + def py__getattribute__(self, name_or_str, name_context=None, position=None, + analysis_errors=True): + """ + :param position: Position of the last statement -> tuple of line, column + """ + if name_context is None: + name_context = self + names = self.goto(name_or_str, position) + + string_name = name_or_str.value if isinstance(name_or_str, Name) else name_or_str + + # This paragraph is currently needed for proper branch type inference + # (static analysis). + found_predefined_types = None + if self.predefined_names and isinstance(name_or_str, Name): + node = name_or_str + while node is not None and not parser_utils.is_scope(node): + node = node.parent + if node.type in ("if_stmt", "for_stmt", "comp_for", 'sync_comp_for'): + try: + name_dict = self.predefined_names[node] + types = name_dict[string_name] + except KeyError: + continue + else: + found_predefined_types = types + break + if found_predefined_types is not None and names: + from jedi.inference import flow_analysis + check = flow_analysis.reachability_check( + context=self, + value_scope=self.tree_node, + node=name_or_str, + ) + if check is flow_analysis.UNREACHABLE: + values = NO_VALUES + else: + values = found_predefined_types + else: + values = ValueSet.from_sets(name.infer() for name in names) + + if not names and not values and analysis_errors: + if isinstance(name_or_str, Name): + from jedi.inference import analysis + message = ("NameError: name '%s' is not defined." % string_name) + analysis.add(name_context, 'name-error', name_or_str, message) + + debug.dbg('context.names_to_types: %s -> %s', names, values) + if values: + return values + return self._check_for_additional_knowledge(name_or_str, name_context, position) + + def _check_for_additional_knowledge(self, name_or_str, name_context, position): + name_context = name_context or self + # Add isinstance and other if/assert knowledge. + if isinstance(name_or_str, Name) and not name_context.is_instance(): + flow_scope = name_or_str + base_nodes = [name_context.tree_node] + + if any(b.type in ('comp_for', 'sync_comp_for') for b in base_nodes): + return NO_VALUES + from jedi.inference.finder import check_flow_information + while True: + flow_scope = get_parent_scope(flow_scope, include_flows=True) + n = check_flow_information(name_context, flow_scope, + name_or_str, position) + if n is not None: + return n + if flow_scope in base_nodes: + break + return NO_VALUES + + def get_root_context(self): + parent_context = self.parent_context + if parent_context is None: + return self + return parent_context.get_root_context() + + def is_module(self): + return False + + def is_builtins_module(self): + return False + + def is_class(self): + return False + + def is_stub(self): + return False + + def is_instance(self): + return False + + def is_compiled(self): + return False + + def is_bound_method(self): + return False + + @abstractmethod + def py__name__(self): + raise NotImplementedError + + def get_value(self): + raise NotImplementedError + + @property + def name(self): + return None + + def get_qualified_names(self): + return () + + def py__doc__(self): + return '' + + @contextmanager + def predefine_names(self, flow_scope, dct): + predefined = self.predefined_names + predefined[flow_scope] = dct + try: + yield + finally: + del predefined[flow_scope] + + +class ValueContext(AbstractContext): + """ + Should be defined, otherwise the API returns empty types. + """ + def __init__(self, value): + super(ValueContext, self).__init__(value.inference_state) + self._value = value + + @property + def tree_node(self): + return self._value.tree_node + + @property + def parent_context(self): + return self._value.parent_context + + def is_module(self): + return self._value.is_module() + + def is_builtins_module(self): + return self._value == self.inference_state.builtins_module + + def is_class(self): + return self._value.is_class() + + def is_stub(self): + return self._value.is_stub() + + def is_instance(self): + return self._value.is_instance() + + def is_compiled(self): + return self._value.is_compiled() + + def is_bound_method(self): + return self._value.is_bound_method() + + def py__name__(self): + return self._value.py__name__() + + @property + def name(self): + return self._value.name + + def get_qualified_names(self): + return self._value.get_qualified_names() + + def py__doc__(self): + return self._value.py__doc__() + + def get_value(self): + return self._value + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self._value) + + +class TreeContextMixin(object): + def infer_node(self, node): + from jedi.inference.syntax_tree import infer_node + return infer_node(self, node) + + def create_value(self, node): + from jedi.inference import value + + if node == self.tree_node: + assert self.is_module() + return self.get_value() + + parent_context = self.create_context(node) + + if node.type in ('funcdef', 'lambdef'): + func = value.FunctionValue.from_context(parent_context, node) + if parent_context.is_class(): + class_value = parent_context.parent_context.create_value(parent_context.tree_node) + instance = value.AnonymousInstance( + self.inference_state, parent_context.parent_context, class_value) + func = value.BoundMethod( + instance=instance, + class_context=class_value.as_context(), + function=func + ) + return func + elif node.type == 'classdef': + return value.ClassValue(self.inference_state, parent_context, node) + else: + raise NotImplementedError("Probably shouldn't happen: %s" % node) + + def create_context(self, node): + def from_scope_node(scope_node, is_nested=True): + if scope_node == self.tree_node: + return self + + if scope_node.type in ('funcdef', 'lambdef', 'classdef'): + return self.create_value(scope_node).as_context() + elif scope_node.type in ('comp_for', 'sync_comp_for'): + parent_scope = parser_utils.get_parent_scope(scope_node) + parent_context = from_scope_node(parent_scope) + if node.start_pos >= scope_node.children[-1].start_pos: + return parent_context + return CompForContext(parent_context, scope_node) + raise Exception("There's a scope that was not managed: %s" % scope_node) + + def parent_scope(node): + while True: + node = node.parent + + if parser_utils.is_scope(node): + return node + elif node.type in ('argument', 'testlist_comp'): + if node.children[1].type in ('comp_for', 'sync_comp_for'): + return node.children[1] + elif node.type == 'dictorsetmaker': + for n in node.children[1:4]: + # In dictionaries it can be pretty much anything. + if n.type in ('comp_for', 'sync_comp_for'): + return n + + scope_node = parent_scope(node) + if scope_node.type in ('funcdef', 'classdef'): + colon = scope_node.children[scope_node.children.index(':')] + if node.start_pos < colon.start_pos: + parent = node.parent + if not (parent.type == 'param' and parent.name == node): + scope_node = parent_scope(scope_node) + return from_scope_node(scope_node, is_nested=True) + + def create_name(self, tree_name): + definition = tree_name.get_definition() + if definition and definition.type == 'param' and definition.name == tree_name: + funcdef = search_ancestor(definition, 'funcdef', 'lambdef') + func = self.create_value(funcdef) + return AnonymousParamName(func, tree_name) + else: + context = self.create_context(tree_name) + return TreeNameDefinition(context, tree_name) + + +class FunctionContext(TreeContextMixin, ValueContext): + def get_filters(self, until_position=None, origin_scope=None): + yield ParserTreeFilter( + self.inference_state, + parent_context=self, + until_position=until_position, + origin_scope=origin_scope + ) + + +class ModuleContext(TreeContextMixin, ValueContext): + def py__file__(self): + return self._value.py__file__() + + def get_filters(self, until_position=None, origin_scope=None): + filters = self._value.get_filters(origin_scope) + # Skip the first filter and replace it. + next(filters, None) + yield MergedFilter( + ParserTreeFilter( + parent_context=self, + until_position=until_position, + origin_scope=origin_scope + ), + self.get_global_filter(), + ) + for f in filters: # Python 2... + yield f + + def get_global_filter(self): + return GlobalNameFilter(self, self.tree_node) + + @property + def string_names(self): + return self._value.string_names + + @property + def code_lines(self): + return self._value.code_lines + + def get_value(self): + """ + This is the only function that converts a context back to a value. + This is necessary for stub -> python conversion and vice versa. However + this method shouldn't be moved to AbstractContext. + """ + return self._value + + +class NamespaceContext(TreeContextMixin, ValueContext): + def get_filters(self, until_position=None, origin_scope=None): + return self._value.get_filters() + + def get_value(self): + return self._value + + @property + def string_names(self): + return self._value.string_names + + def py__file__(self): + return self._value.py__file__() + + +class ClassContext(TreeContextMixin, ValueContext): + def get_filters(self, until_position=None, origin_scope=None): + yield self.get_global_filter(until_position, origin_scope) + + def get_global_filter(self, until_position=None, origin_scope=None): + return ParserTreeFilter( + parent_context=self, + until_position=until_position, + origin_scope=origin_scope + ) + + +class CompForContext(TreeContextMixin, AbstractContext): + def __init__(self, parent_context, comp_for): + super(CompForContext, self).__init__(parent_context.inference_state) + self.tree_node = comp_for + self.parent_context = parent_context + + def get_filters(self, until_position=None, origin_scope=None): + yield ParserTreeFilter(self) + + def get_value(self): + return None + + def py__name__(self): + return '' + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self.tree_node) + + +class CompiledContext(ValueContext): + def get_filters(self, until_position=None, origin_scope=None): + return self._value.get_filters() + + +class CompiledModuleContext(CompiledContext): + code_lines = None + + def get_value(self): + return self._value + + @property + def string_names(self): + return self._value.string_names + + def py__file__(self): + return self._value.py__file__() + + +def _get_global_filters_for_name(context, name_or_none, position): + # For functions and classes the defaults don't belong to the + # function and get inferred in the value before the function. So + # make sure to exclude the function/class name. + if name_or_none is not None: + ancestor = search_ancestor(name_or_none, 'funcdef', 'classdef', 'lambdef') + lambdef = None + if ancestor == 'lambdef': + # For lambdas it's even more complicated since parts will + # be inferred later. + lambdef = ancestor + ancestor = search_ancestor(name_or_none, 'funcdef', 'classdef') + if ancestor is not None: + colon = ancestor.children[-2] + if position is not None and position < colon.start_pos: + if lambdef is None or position < lambdef.children[-2].start_pos: + position = ancestor.start_pos + + return get_global_filters(context, position, name_or_none) + + +def get_global_filters(context, until_position, origin_scope): + """ + Returns all filters in order of priority for name resolution. + + For global name lookups. The filters will handle name resolution + themselves, but here we gather possible filters downwards. + + >>> from jedi._compatibility import u, no_unicode_pprint + >>> from jedi import Script + >>> script = Script(u(''' + ... x = ['a', 'b', 'c'] + ... def func(): + ... y = None + ... ''')) + >>> module_node = script._module_node + >>> scope = next(module_node.iter_funcdefs()) + >>> scope + + >>> context = script._get_module_context().create_context(scope) + >>> filters = list(get_global_filters(context, (4, 0), None)) + + First we get the names from the function scope. + + >>> no_unicode_pprint(filters[0]) # doctest: +ELLIPSIS + MergedFilter(, ) + >>> sorted(str(n) for n in filters[0].values()) # doctest: +NORMALIZE_WHITESPACE + ['', + ''] + >>> filters[0]._filters[0]._until_position + (4, 0) + >>> filters[0]._filters[1]._until_position + + Then it yields the names from one level "lower". In this example, this is + the module scope (including globals). + As a side note, you can see, that the position in the filter is None on the + globals filter, because there the whole module is searched. + + >>> list(filters[1].values()) # package modules -> Also empty. + [] + >>> sorted(name.string_name for name in filters[2].values()) # Module attributes + ['__doc__', '__name__', '__package__'] + + Finally, it yields the builtin filter, if `include_builtin` is + true (default). + + >>> list(filters[3].values()) # doctest: +ELLIPSIS + [...] + """ + base_context = context + from jedi.inference.value.function import BaseFunctionExecutionContext + while context is not None: + # Names in methods cannot be resolved within the class. + for filter in context.get_filters( + until_position=until_position, + origin_scope=origin_scope): + yield filter + if isinstance(context, (BaseFunctionExecutionContext, ModuleContext)): + # The position should be reset if the current scope is a function. + until_position = None + + context = context.parent_context + + b = next(base_context.inference_state.builtins_module.get_filters(), None) + assert b is not None + # Add builtins to the global scope. + yield b diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/docstrings.py b/.venv/lib/python3.8/site-packages/jedi/inference/docstrings.py new file mode 100644 index 00000000..ab34cf93 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/docstrings.py @@ -0,0 +1,307 @@ +""" +Docstrings are another source of information for functions and classes. +:mod:`jedi.inference.dynamic_params` tries to find all executions of functions, +while the docstring parsing is much easier. There are three different types of +docstrings that |jedi| understands: + +- `Sphinx `_ +- `Epydoc `_ +- `Numpydoc `_ + +For example, the sphinx annotation ``:type foo: str`` clearly states that the +type of ``foo`` is ``str``. + +As an addition to parameter searching, this module also provides return +annotations. +""" + +import re +import warnings +from textwrap import dedent + +from parso import parse, ParserSyntaxError + +from jedi._compatibility import u +from jedi import debug +from jedi.common import indent_block +from jedi.inference.cache import inference_state_method_cache +from jedi.inference.base_value import iterator_to_value_set, ValueSet, \ + NO_VALUES +from jedi.inference.lazy_value import LazyKnownValues + + +DOCSTRING_PARAM_PATTERNS = [ + r'\s*:type\s+%s:\s*([^\n]+)', # Sphinx + r'\s*:param\s+(\w+)\s+%s:[^\n]*', # Sphinx param with type + r'\s*@type\s+%s:\s*([^\n]+)', # Epydoc +] + +DOCSTRING_RETURN_PATTERNS = [ + re.compile(r'\s*:rtype:\s*([^\n]+)', re.M), # Sphinx + re.compile(r'\s*@rtype:\s*([^\n]+)', re.M), # Epydoc +] + +REST_ROLE_PATTERN = re.compile(r':[^`]+:`([^`]+)`') + + +_numpy_doc_string_cache = None + + +def _get_numpy_doc_string_cls(): + global _numpy_doc_string_cache + if isinstance(_numpy_doc_string_cache, (ImportError, SyntaxError)): + raise _numpy_doc_string_cache + from numpydoc.docscrape import NumpyDocString + _numpy_doc_string_cache = NumpyDocString + return _numpy_doc_string_cache + + +def _search_param_in_numpydocstr(docstr, param_str): + """Search `docstr` (in numpydoc format) for type(-s) of `param_str`.""" + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + try: + # This is a non-public API. If it ever changes we should be + # prepared and return gracefully. + params = _get_numpy_doc_string_cls()(docstr)._parsed_data['Parameters'] + except Exception: + return [] + for p_name, p_type, p_descr in params: + if p_name == param_str: + m = re.match(r'([^,]+(,[^,]+)*?)(,[ ]*optional)?$', p_type) + if m: + p_type = m.group(1) + return list(_expand_typestr(p_type)) + return [] + + +def _search_return_in_numpydocstr(docstr): + """ + Search `docstr` (in numpydoc format) for type(-s) of function returns. + """ + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + try: + doc = _get_numpy_doc_string_cls()(docstr) + except Exception: + return + try: + # This is a non-public API. If it ever changes we should be + # prepared and return gracefully. + returns = doc._parsed_data['Returns'] + returns += doc._parsed_data['Yields'] + except Exception: + return + for r_name, r_type, r_descr in returns: + # Return names are optional and if so the type is in the name + if not r_type: + r_type = r_name + for type_ in _expand_typestr(r_type): + yield type_ + + +def _expand_typestr(type_str): + """ + Attempts to interpret the possible types in `type_str` + """ + # Check if alternative types are specified with 'or' + if re.search(r'\bor\b', type_str): + for t in type_str.split('or'): + yield t.split('of')[0].strip() + # Check if like "list of `type`" and set type to list + elif re.search(r'\bof\b', type_str): + yield type_str.split('of')[0] + # Check if type has is a set of valid literal values eg: {'C', 'F', 'A'} + elif type_str.startswith('{'): + node = parse(type_str, version='3.7').children[0] + if node.type == 'atom': + for leaf in node.children[1].children: + if leaf.type == 'number': + if '.' in leaf.value: + yield 'float' + else: + yield 'int' + elif leaf.type == 'string': + if 'b' in leaf.string_prefix.lower(): + yield 'bytes' + else: + yield 'str' + # Ignore everything else. + + # Otherwise just work with what we have. + else: + yield type_str + + +def _search_param_in_docstr(docstr, param_str): + """ + Search `docstr` for type(-s) of `param_str`. + + >>> _search_param_in_docstr(':type param: int', 'param') + ['int'] + >>> _search_param_in_docstr('@type param: int', 'param') + ['int'] + >>> _search_param_in_docstr( + ... ':type param: :class:`threading.Thread`', 'param') + ['threading.Thread'] + >>> bool(_search_param_in_docstr('no document', 'param')) + False + >>> _search_param_in_docstr(':param int param: some description', 'param') + ['int'] + + """ + # look at #40 to see definitions of those params + patterns = [re.compile(p % re.escape(param_str)) + for p in DOCSTRING_PARAM_PATTERNS] + for pattern in patterns: + match = pattern.search(docstr) + if match: + return [_strip_rst_role(match.group(1))] + + return _search_param_in_numpydocstr(docstr, param_str) + + +def _strip_rst_role(type_str): + """ + Strip off the part looks like a ReST role in `type_str`. + + >>> _strip_rst_role(':class:`ClassName`') # strip off :class: + 'ClassName' + >>> _strip_rst_role(':py:obj:`module.Object`') # works with domain + 'module.Object' + >>> _strip_rst_role('ClassName') # do nothing when not ReST role + 'ClassName' + + See also: + http://sphinx-doc.org/domains.html#cross-referencing-python-objects + + """ + match = REST_ROLE_PATTERN.match(type_str) + if match: + return match.group(1) + else: + return type_str + + +def _infer_for_statement_string(module_context, string): + code = dedent(u(""" + def pseudo_docstring_stuff(): + ''' + Create a pseudo function for docstring statements. + Need this docstring so that if the below part is not valid Python this + is still a function. + ''' + {} + """)) + if string is None: + return [] + + for element in re.findall(r'((?:\w+\.)*\w+)\.', string): + # Try to import module part in dotted name. + # (e.g., 'threading' in 'threading.Thread'). + string = 'import %s\n' % element + string + + # Take the default grammar here, if we load the Python 2.7 grammar here, it + # will be impossible to use `...` (Ellipsis) as a token. Docstring types + # don't need to conform with the current grammar. + debug.dbg('Parse docstring code %s', string, color='BLUE') + grammar = module_context.inference_state.latest_grammar + try: + module = grammar.parse(code.format(indent_block(string)), error_recovery=False) + except ParserSyntaxError: + return [] + try: + funcdef = next(module.iter_funcdefs()) + # First pick suite, then simple_stmt and then the node, + # which is also not the last item, because there's a newline. + stmt = funcdef.children[-1].children[-1].children[-2] + except (AttributeError, IndexError): + return [] + + if stmt.type not in ('name', 'atom', 'atom_expr'): + return [] + + from jedi.inference.value import FunctionValue + function_value = FunctionValue( + module_context.inference_state, + module_context, + funcdef + ) + func_execution_context = function_value.as_context() + # Use the module of the param. + # TODO this module is not the module of the param in case of a function + # call. In that case it's the module of the function call. + # stuffed with content from a function call. + return list(_execute_types_in_stmt(func_execution_context, stmt)) + + +def _execute_types_in_stmt(module_context, stmt): + """ + Executing all types or general elements that we find in a statement. This + doesn't include tuple, list and dict literals, because the stuff they + contain is executed. (Used as type information). + """ + definitions = module_context.infer_node(stmt) + return ValueSet.from_sets( + _execute_array_values(module_context.inference_state, d) + for d in definitions + ) + + +def _execute_array_values(inference_state, array): + """ + Tuples indicate that there's not just one return value, but the listed + ones. `(str, int)` means that it returns a tuple with both types. + """ + from jedi.inference.value.iterable import SequenceLiteralValue, FakeTuple, FakeList + if isinstance(array, SequenceLiteralValue) and array.array_type in ('tuple', 'list'): + values = [] + for lazy_value in array.py__iter__(): + objects = ValueSet.from_sets( + _execute_array_values(inference_state, typ) + for typ in lazy_value.infer() + ) + values.append(LazyKnownValues(objects)) + cls = FakeTuple if array.array_type == 'tuple' else FakeList + return {cls(inference_state, values)} + else: + return array.execute_annotation() + + +@inference_state_method_cache() +def infer_param(function_value, param): + def infer_docstring(docstring): + return ValueSet( + p + for param_str in _search_param_in_docstr(docstring, param.name.value) + for p in _infer_for_statement_string(module_context, param_str) + ) + module_context = function_value.get_root_context() + func = param.get_parent_function() + if func.type == 'lambdef': + return NO_VALUES + + types = infer_docstring(function_value.py__doc__()) + if function_value.is_bound_method() \ + and function_value.py__name__() == '__init__': + types |= infer_docstring(function_value.class_context.py__doc__()) + + debug.dbg('Found param types for docstring: %s', types, color='BLUE') + return types + + +@inference_state_method_cache() +@iterator_to_value_set +def infer_return_types(function_value): + def search_return_in_docstr(code): + for p in DOCSTRING_RETURN_PATTERNS: + match = p.search(code) + if match: + yield _strip_rst_role(match.group(1)) + # Check for numpy style return hint + for type_ in _search_return_in_numpydocstr(code): + yield type_ + + for type_str in search_return_in_docstr(function_value.py__doc__()): + for value in _infer_for_statement_string(function_value.get_root_context(), type_str): + yield value diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/dynamic_params.py b/.venv/lib/python3.8/site-packages/jedi/inference/dynamic_params.py new file mode 100644 index 00000000..0a79bac2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/dynamic_params.py @@ -0,0 +1,226 @@ +""" +One of the really important features of |jedi| is to have an option to +understand code like this:: + + def foo(bar): + bar. # completion here + foo(1) + +There's no doubt wheter bar is an ``int`` or not, but if there's also a call +like ``foo('str')``, what would happen? Well, we'll just show both. Because +that's what a human would expect. + +It works as follows: + +- |Jedi| sees a param +- search for function calls named ``foo`` +- execute these calls and check the input. +""" + +from jedi import settings +from jedi import debug +from jedi.parser_utils import get_parent_scope +from jedi.inference.cache import inference_state_method_cache +from jedi.inference.arguments import TreeArguments +from jedi.inference.param import get_executed_param_names +from jedi.inference.helpers import is_stdlib_path +from jedi.inference.utils import to_list +from jedi.inference.value import instance +from jedi.inference.base_value import ValueSet, NO_VALUES +from jedi.inference.references import get_module_contexts_containing_name +from jedi.inference import recursion + + +MAX_PARAM_SEARCHES = 20 + + +def _avoid_recursions(func): + def wrapper(function_value, param_index): + inf = function_value.inference_state + with recursion.execution_allowed(inf, function_value.tree_node) as allowed: + # We need to catch recursions that may occur, because an + # anonymous functions can create an anonymous parameter that is + # more or less self referencing. + if allowed: + inf.dynamic_params_depth += 1 + try: + return func(function_value, param_index) + finally: + inf.dynamic_params_depth -= 1 + return NO_VALUES + return wrapper + + +@debug.increase_indent +@_avoid_recursions +def dynamic_param_lookup(function_value, param_index): + """ + A dynamic search for param values. If you try to complete a type: + + >>> def func(foo): + ... foo + >>> func(1) + >>> func("") + + It is not known what the type ``foo`` without analysing the whole code. You + have to look for all calls to ``func`` to find out what ``foo`` possibly + is. + """ + funcdef = function_value.tree_node + + if not settings.dynamic_params: + return NO_VALUES + + path = function_value.get_root_context().py__file__() + if path is not None and is_stdlib_path(path): + # We don't want to search for references in the stdlib. Usually people + # don't work with it (except if you are a core maintainer, sorry). + # This makes everything slower. Just disable it and run the tests, + # you will see the slowdown, especially in 3.6. + return NO_VALUES + + if funcdef.type == 'lambdef': + string_name = _get_lambda_name(funcdef) + if string_name is None: + return NO_VALUES + else: + string_name = funcdef.name.value + debug.dbg('Dynamic param search in %s.', string_name, color='MAGENTA') + + module_context = function_value.get_root_context() + arguments_list = _search_function_arguments(module_context, funcdef, string_name) + values = ValueSet.from_sets( + get_executed_param_names( + function_value, arguments + )[param_index].infer() + for arguments in arguments_list + ) + debug.dbg('Dynamic param result finished', color='MAGENTA') + return values + + +@inference_state_method_cache(default=None) +@to_list +def _search_function_arguments(module_context, funcdef, string_name): + """ + Returns a list of param names. + """ + compare_node = funcdef + if string_name == '__init__': + cls = get_parent_scope(funcdef) + if cls.type == 'classdef': + string_name = cls.name.value + compare_node = cls + + found_arguments = False + i = 0 + inference_state = module_context.inference_state + + if settings.dynamic_params_for_other_modules: + module_contexts = get_module_contexts_containing_name( + inference_state, [module_context], string_name, + # Limit the amounts of files to be opened massively. + limit_reduction=5, + ) + else: + module_contexts = [module_context] + + for for_mod_context in module_contexts: + for name, trailer in _get_potential_nodes(for_mod_context, string_name): + i += 1 + + # This is a simple way to stop Jedi's dynamic param recursion + # from going wild: The deeper Jedi's in the recursion, the less + # code should be inferred. + if i * inference_state.dynamic_params_depth > MAX_PARAM_SEARCHES: + return + + random_context = for_mod_context.create_context(name) + for arguments in _check_name_for_execution( + inference_state, random_context, compare_node, name, trailer): + found_arguments = True + yield arguments + + # If there are results after processing a module, we're probably + # good to process. This is a speed optimization. + if found_arguments: + return + + +def _get_lambda_name(node): + stmt = node.parent + if stmt.type == 'expr_stmt': + first_operator = next(stmt.yield_operators(), None) + if first_operator == '=': + first = stmt.children[0] + if first.type == 'name': + return first.value + + return None + + +def _get_potential_nodes(module_value, func_string_name): + try: + names = module_value.tree_node.get_used_names()[func_string_name] + except KeyError: + return + + for name in names: + bracket = name.get_next_leaf() + trailer = bracket.parent + if trailer.type == 'trailer' and bracket == '(': + yield name, trailer + + +def _check_name_for_execution(inference_state, context, compare_node, name, trailer): + from jedi.inference.value.function import BaseFunctionExecutionContext + + def create_args(value): + arglist = trailer.children[1] + if arglist == ')': + arglist = None + args = TreeArguments(inference_state, context, arglist, trailer) + from jedi.inference.value.instance import InstanceArguments + if value.tree_node.type == 'classdef': + created_instance = instance.TreeInstance( + inference_state, + value.parent_context, + value, + args + ) + return InstanceArguments(created_instance, args) + else: + if value.is_bound_method(): + args = InstanceArguments(value.instance, args) + return args + + for value in inference_state.infer(context, name): + value_node = value.tree_node + if compare_node == value_node: + yield create_args(value) + elif isinstance(value.parent_context, BaseFunctionExecutionContext) \ + and compare_node.type == 'funcdef': + # Here we're trying to find decorators by checking the first + # parameter. It's not very generic though. Should find a better + # solution that also applies to nested decorators. + param_names = value.parent_context.get_param_names() + if len(param_names) != 1: + continue + values = param_names[0].infer() + if [v.tree_node for v in values] == [compare_node]: + # Found a decorator. + module_context = context.get_root_context() + execution_context = value.as_context(create_args(value)) + potential_nodes = _get_potential_nodes(module_context, param_names[0].string_name) + for name, trailer in potential_nodes: + if value_node.start_pos < name.start_pos < value_node.end_pos: + random_context = execution_context.create_context(name) + iterator = _check_name_for_execution( + inference_state, + random_context, + compare_node, + name, + trailer + ) + for arguments in iterator: + yield arguments diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/filters.py b/.venv/lib/python3.8/site-packages/jedi/inference/filters.py new file mode 100644 index 00000000..00e594f7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/filters.py @@ -0,0 +1,353 @@ +""" +Filters are objects that you can use to filter names in different scopes. They +are needed for name resolution. +""" +from abc import abstractmethod +import weakref + +from parso.tree import search_ancestor + +from jedi._compatibility import use_metaclass +from jedi.inference import flow_analysis +from jedi.inference.base_value import ValueSet, ValueWrapper, \ + LazyValueWrapper +from jedi.parser_utils import get_cached_parent_scope +from jedi.inference.utils import to_list +from jedi.inference.names import TreeNameDefinition, ParamName, \ + AnonymousParamName, AbstractNameDefinition + +_definition_name_cache = weakref.WeakKeyDictionary() + + +class AbstractFilter(object): + _until_position = None + + def _filter(self, names): + if self._until_position is not None: + return [n for n in names if n.start_pos < self._until_position] + return names + + @abstractmethod + def get(self, name): + raise NotImplementedError + + @abstractmethod + def values(self): + raise NotImplementedError + + +class FilterWrapper(object): + name_wrapper_class = None + + def __init__(self, wrapped_filter): + self._wrapped_filter = wrapped_filter + + def wrap_names(self, names): + return [self.name_wrapper_class(name) for name in names] + + def get(self, name): + return self.wrap_names(self._wrapped_filter.get(name)) + + def values(self): + return self.wrap_names(self._wrapped_filter.values()) + + +def _get_definition_names(used_names, name_key): + try: + for_module = _definition_name_cache[used_names] + except KeyError: + for_module = _definition_name_cache[used_names] = {} + + try: + return for_module[name_key] + except KeyError: + names = used_names.get(name_key, ()) + result = for_module[name_key] = tuple( + name for name in names if name.is_definition(include_setitem=True) + ) + return result + + +class AbstractUsedNamesFilter(AbstractFilter): + name_class = TreeNameDefinition + + def __init__(self, parent_context, parser_scope): + self._parser_scope = parser_scope + self._module_node = self._parser_scope.get_root_node() + self._used_names = self._module_node.get_used_names() + self.parent_context = parent_context + + def get(self, name): + return self._convert_names(self._filter( + _get_definition_names(self._used_names, name), + )) + + def _convert_names(self, names): + return [self.name_class(self.parent_context, name) for name in names] + + def values(self): + return self._convert_names( + name + for name_key in self._used_names + for name in self._filter( + _get_definition_names(self._used_names, name_key), + ) + ) + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.parent_context) + + +class ParserTreeFilter(AbstractUsedNamesFilter): + def __init__(self, parent_context, node_context=None, until_position=None, + origin_scope=None): + """ + node_context is an option to specify a second value for use cases + like the class mro where the parent class of a new name would be the + value, but for some type inference it's important to have a local + value of the other classes. + """ + if node_context is None: + node_context = parent_context + super(ParserTreeFilter, self).__init__(parent_context, node_context.tree_node) + self._node_context = node_context + self._origin_scope = origin_scope + self._until_position = until_position + + def _filter(self, names): + names = super(ParserTreeFilter, self)._filter(names) + names = [n for n in names if self._is_name_reachable(n)] + return list(self._check_flows(names)) + + def _is_name_reachable(self, name): + parent = name.parent + if parent.type == 'trailer': + return False + base_node = parent if parent.type in ('classdef', 'funcdef') else name + return get_cached_parent_scope(self._used_names, base_node) == self._parser_scope + + def _check_flows(self, names): + for name in sorted(names, key=lambda name: name.start_pos, reverse=True): + check = flow_analysis.reachability_check( + context=self._node_context, + value_scope=self._parser_scope, + node=name, + origin_scope=self._origin_scope + ) + if check is not flow_analysis.UNREACHABLE: + yield name + + if check is flow_analysis.REACHABLE: + break + + +class _FunctionExecutionFilter(ParserTreeFilter): + def __init__(self, parent_context, function_value, until_position, origin_scope): + super(_FunctionExecutionFilter, self).__init__( + parent_context, + until_position=until_position, + origin_scope=origin_scope, + ) + self._function_value = function_value + + def _convert_param(self, param, name): + raise NotImplementedError + + @to_list + def _convert_names(self, names): + for name in names: + param = search_ancestor(name, 'param') + # Here we don't need to check if the param is a default/annotation, + # because those are not definitions and never make it to this + # point. + if param: + yield self._convert_param(param, name) + else: + yield TreeNameDefinition(self.parent_context, name) + + +class FunctionExecutionFilter(_FunctionExecutionFilter): + def __init__(self, *args, **kwargs): + self._arguments = kwargs.pop('arguments') # Python 2 + super(FunctionExecutionFilter, self).__init__(*args, **kwargs) + + def _convert_param(self, param, name): + return ParamName(self._function_value, name, self._arguments) + + +class AnonymousFunctionExecutionFilter(_FunctionExecutionFilter): + def _convert_param(self, param, name): + return AnonymousParamName(self._function_value, name) + + +class GlobalNameFilter(AbstractUsedNamesFilter): + def get(self, name): + try: + names = self._used_names[name] + except KeyError: + return [] + return self._convert_names(self._filter(names)) + + @to_list + def _filter(self, names): + for name in names: + if name.parent.type == 'global_stmt': + yield name + + def values(self): + return self._convert_names( + name for name_list in self._used_names.values() + for name in self._filter(name_list) + ) + + +class DictFilter(AbstractFilter): + def __init__(self, dct): + self._dct = dct + + def get(self, name): + try: + value = self._convert(name, self._dct[name]) + except KeyError: + return [] + else: + return list(self._filter([value])) + + def values(self): + def yielder(): + for item in self._dct.items(): + try: + yield self._convert(*item) + except KeyError: + pass + return self._filter(yielder()) + + def _convert(self, name, value): + return value + + def __repr__(self): + keys = ', '.join(self._dct.keys()) + return '<%s: for {%s}>' % (self.__class__.__name__, keys) + + +class MergedFilter(object): + def __init__(self, *filters): + self._filters = filters + + def get(self, name): + return [n for filter in self._filters for n in filter.get(name)] + + def values(self): + return [n for filter in self._filters for n in filter.values()] + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, ', '.join(str(f) for f in self._filters)) + + +class _BuiltinMappedMethod(ValueWrapper): + """``Generator.__next__`` ``dict.values`` methods and so on.""" + api_type = u'function' + + def __init__(self, value, method, builtin_func): + super(_BuiltinMappedMethod, self).__init__(builtin_func) + self._value = value + self._method = method + + def py__call__(self, arguments): + # TODO add TypeError if params are given/or not correct. + return self._method(self._value, arguments) + + +class SpecialMethodFilter(DictFilter): + """ + A filter for methods that are defined in this module on the corresponding + classes like Generator (for __next__, etc). + """ + class SpecialMethodName(AbstractNameDefinition): + api_type = u'function' + + def __init__(self, parent_context, string_name, value, builtin_value): + callable_, python_version = value + if python_version is not None and \ + python_version != parent_context.inference_state.environment.version_info.major: + raise KeyError + + self.parent_context = parent_context + self.string_name = string_name + self._callable = callable_ + self._builtin_value = builtin_value + + def infer(self): + for filter in self._builtin_value.get_filters(): + # We can take the first index, because on builtin methods there's + # always only going to be one name. The same is true for the + # inferred values. + for name in filter.get(self.string_name): + builtin_func = next(iter(name.infer())) + break + else: + continue + break + return ValueSet([ + _BuiltinMappedMethod(self.parent_context, self._callable, builtin_func) + ]) + + def __init__(self, value, dct, builtin_value): + super(SpecialMethodFilter, self).__init__(dct) + self.value = value + self._builtin_value = builtin_value + """ + This value is what will be used to introspect the name, where as the + other value will be used to execute the function. + + We distinguish, because we have to. + """ + + def _convert(self, name, value): + return self.SpecialMethodName(self.value, name, value, self._builtin_value) + + +class _OverwriteMeta(type): + def __init__(cls, name, bases, dct): + super(_OverwriteMeta, cls).__init__(name, bases, dct) + + base_dct = {} + for base_cls in reversed(cls.__bases__): + try: + base_dct.update(base_cls.overwritten_methods) + except AttributeError: + pass + + for func in cls.__dict__.values(): + try: + base_dct.update(func.registered_overwritten_methods) + except AttributeError: + pass + cls.overwritten_methods = base_dct + + +class _AttributeOverwriteMixin(object): + def get_filters(self, *args, **kwargs): + yield SpecialMethodFilter(self, self.overwritten_methods, self._wrapped_value) + + for filter in self._wrapped_value.get_filters(*args, **kwargs): + yield filter + + +class LazyAttributeOverwrite(use_metaclass(_OverwriteMeta, _AttributeOverwriteMixin, + LazyValueWrapper)): + def __init__(self, inference_state): + self.inference_state = inference_state + + +class AttributeOverwrite(use_metaclass(_OverwriteMeta, _AttributeOverwriteMixin, + ValueWrapper)): + pass + + +def publish_method(method_name, python_version_match=None): + def decorator(func): + dct = func.__dict__.setdefault('registered_overwritten_methods', {}) + dct[method_name] = func, python_version_match + return func + return decorator diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/finder.py b/.venv/lib/python3.8/site-packages/jedi/inference/finder.py new file mode 100644 index 00000000..aac58732 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/finder.py @@ -0,0 +1,146 @@ +""" +Searching for names with given scope and name. This is very central in Jedi and +Python. The name resolution is quite complicated with descripter, +``__getattribute__``, ``__getattr__``, ``global``, etc. + +If you want to understand name resolution, please read the first few chapters +in http://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/. + +Flow checks ++++++++++++ + +Flow checks are not really mature. There's only a check for ``isinstance``. It +would check whether a flow has the form of ``if isinstance(a, type_or_tuple)``. +Unfortunately every other thing is being ignored (e.g. a == '' would be easy to +check for -> a is a string). There's big potential in these checks. +""" + +from parso.tree import search_ancestor +from parso.python.tree import Name + +from jedi import settings +from jedi.inference.arguments import TreeArguments +from jedi.inference.value import iterable +from jedi.inference.base_value import NO_VALUES +from jedi.parser_utils import is_scope + + +def filter_name(filters, name_or_str): + """ + Searches names that are defined in a scope (the different + ``filters``), until a name fits. + """ + string_name = name_or_str.value if isinstance(name_or_str, Name) else name_or_str + names = [] + for filter in filters: + names = filter.get(string_name) + if names: + break + + return list(_remove_del_stmt(names)) + + +def _remove_del_stmt(names): + # Catch del statements and remove them from results. + for name in names: + if name.tree_name is not None: + definition = name.tree_name.get_definition() + if definition is not None and definition.type == 'del_stmt': + continue + yield name + + +def check_flow_information(value, flow, search_name, pos): + """ Try to find out the type of a variable just with the information that + is given by the flows: e.g. It is also responsible for assert checks.:: + + if isinstance(k, str): + k. # <- completion here + + ensures that `k` is a string. + """ + if not settings.dynamic_flow_information: + return None + + result = None + if is_scope(flow): + # Check for asserts. + module_node = flow.get_root_node() + try: + names = module_node.get_used_names()[search_name.value] + except KeyError: + return None + names = reversed([ + n for n in names + if flow.start_pos <= n.start_pos < (pos or flow.end_pos) + ]) + + for name in names: + ass = search_ancestor(name, 'assert_stmt') + if ass is not None: + result = _check_isinstance_type(value, ass.assertion, search_name) + if result is not None: + return result + + if flow.type in ('if_stmt', 'while_stmt'): + potential_ifs = [c for c in flow.children[1::4] if c != ':'] + for if_test in reversed(potential_ifs): + if search_name.start_pos > if_test.end_pos: + return _check_isinstance_type(value, if_test, search_name) + return result + + +def _get_isinstance_trailer_arglist(node): + if node.type in ('power', 'atom_expr') and len(node.children) == 2: + # This might be removed if we analyze and, etc + first, trailer = node.children + if first.type == 'name' and first.value == 'isinstance' \ + and trailer.type == 'trailer' and trailer.children[0] == '(': + return trailer + return None + + +def _check_isinstance_type(value, node, search_name): + lazy_cls = None + trailer = _get_isinstance_trailer_arglist(node) + if trailer is not None and len(trailer.children) == 3: + arglist = trailer.children[1] + args = TreeArguments(value.inference_state, value, arglist, trailer) + param_list = list(args.unpack()) + # Disallow keyword arguments + if len(param_list) == 2 and len(arglist.children) == 3: + (key1, _), (key2, lazy_value_cls) = param_list + if key1 is None and key2 is None: + call = _get_call_string(search_name) + is_instance_call = _get_call_string(arglist.children[0]) + # Do a simple get_code comparison of the strings . They should + # just have the same code, and everything will be all right. + # There are ways that this is not correct, if some stuff is + # redefined in between. However here we don't care, because + # it's a heuristic that works pretty well. + if call == is_instance_call: + lazy_cls = lazy_value_cls + if lazy_cls is None: + return None + + value_set = NO_VALUES + for cls_or_tup in lazy_cls.infer(): + if isinstance(cls_or_tup, iterable.Sequence) and cls_or_tup.array_type == 'tuple': + for lazy_value in cls_or_tup.py__iter__(): + value_set |= lazy_value.infer().execute_with_values() + else: + value_set |= cls_or_tup.execute_with_values() + return value_set + + +def _get_call_string(node): + if node.parent.type == 'atom_expr': + return _get_call_string(node.parent) + + code = '' + leaf = node.get_first_leaf() + end = node.get_last_leaf().end_pos + while leaf.start_pos < end: + code += leaf.value + leaf = leaf.get_next_leaf() + return code diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/flow_analysis.py b/.venv/lib/python3.8/site-packages/jedi/inference/flow_analysis.py new file mode 100644 index 00000000..184f367f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/flow_analysis.py @@ -0,0 +1,123 @@ +from jedi.parser_utils import get_flow_branch_keyword, is_scope, get_parent_scope +from jedi.inference.recursion import execution_allowed +from jedi.inference.helpers import is_big_annoying_library + + +class Status(object): + lookup_table = {} + + def __init__(self, value, name): + self._value = value + self._name = name + Status.lookup_table[value] = self + + def invert(self): + if self is REACHABLE: + return UNREACHABLE + elif self is UNREACHABLE: + return REACHABLE + else: + return UNSURE + + def __and__(self, other): + if UNSURE in (self, other): + return UNSURE + else: + return REACHABLE if self._value and other._value else UNREACHABLE + + def __repr__(self): + return '<%s: %s>' % (type(self).__name__, self._name) + + +REACHABLE = Status(True, 'reachable') +UNREACHABLE = Status(False, 'unreachable') +UNSURE = Status(None, 'unsure') + + +def _get_flow_scopes(node): + while True: + node = get_parent_scope(node, include_flows=True) + if node is None or is_scope(node): + return + yield node + + +def reachability_check(context, value_scope, node, origin_scope=None): + if is_big_annoying_library(context) \ + or not context.inference_state.flow_analysis_enabled: + return UNSURE + + first_flow_scope = get_parent_scope(node, include_flows=True) + if origin_scope is not None: + origin_flow_scopes = list(_get_flow_scopes(origin_scope)) + node_flow_scopes = list(_get_flow_scopes(node)) + + branch_matches = True + for flow_scope in origin_flow_scopes: + if flow_scope in node_flow_scopes: + node_keyword = get_flow_branch_keyword(flow_scope, node) + origin_keyword = get_flow_branch_keyword(flow_scope, origin_scope) + branch_matches = node_keyword == origin_keyword + if flow_scope.type == 'if_stmt': + if not branch_matches: + return UNREACHABLE + elif flow_scope.type == 'try_stmt': + if not branch_matches and origin_keyword == 'else' \ + and node_keyword == 'except': + return UNREACHABLE + if branch_matches: + break + + # Direct parents get resolved, we filter scopes that are separate + # branches. This makes sense for autocompletion and static analysis. + # For actual Python it doesn't matter, because we're talking about + # potentially unreachable code. + # e.g. `if 0:` would cause all name lookup within the flow make + # unaccessible. This is not a "problem" in Python, because the code is + # never called. In Jedi though, we still want to infer types. + while origin_scope is not None: + if first_flow_scope == origin_scope and branch_matches: + return REACHABLE + origin_scope = origin_scope.parent + + return _break_check(context, value_scope, first_flow_scope, node) + + +def _break_check(context, value_scope, flow_scope, node): + reachable = REACHABLE + if flow_scope.type == 'if_stmt': + if flow_scope.is_node_after_else(node): + for check_node in flow_scope.get_test_nodes(): + reachable = _check_if(context, check_node) + if reachable in (REACHABLE, UNSURE): + break + reachable = reachable.invert() + else: + flow_node = flow_scope.get_corresponding_test_node(node) + if flow_node is not None: + reachable = _check_if(context, flow_node) + elif flow_scope.type in ('try_stmt', 'while_stmt'): + return UNSURE + + # Only reachable branches need to be examined further. + if reachable in (UNREACHABLE, UNSURE): + return reachable + + if value_scope != flow_scope and value_scope != flow_scope.parent: + flow_scope = get_parent_scope(flow_scope, include_flows=True) + return reachable & _break_check(context, value_scope, flow_scope, node) + else: + return reachable + + +def _check_if(context, node): + with execution_allowed(context.inference_state, node) as allowed: + if not allowed: + return UNSURE + + types = context.infer_node(node) + values = set(x.py__bool__() for x in types) + if len(values) == 1: + return Status.lookup_table[values.pop()] + else: + return UNSURE diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__init__.py b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__init__.py new file mode 100644 index 00000000..5c86b7b3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__init__.py @@ -0,0 +1,4 @@ +""" +It is unfortunately not well documented how stubs and annotations work in Jedi. +If somebody needs an introduction, please let me know. +""" diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..79ff5e5d Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/annotation.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/annotation.cpython-38.pyc new file mode 100644 index 00000000..23ad2d36 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/annotation.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/base.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/base.cpython-38.pyc new file mode 100644 index 00000000..eeca1ae3 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/base.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/conversion.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/conversion.cpython-38.pyc new file mode 100644 index 00000000..06988d6c Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/conversion.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/generics.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/generics.cpython-38.pyc new file mode 100644 index 00000000..e199600e Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/generics.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/stub_value.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/stub_value.cpython-38.pyc new file mode 100644 index 00000000..79365478 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/stub_value.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/type_var.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/type_var.cpython-38.pyc new file mode 100644 index 00000000..6cc9f96b Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/type_var.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/typeshed.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/typeshed.cpython-38.pyc new file mode 100644 index 00000000..e889b73c Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/typeshed.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/typing.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/typing.cpython-38.pyc new file mode 100644 index 00000000..7d0a120d Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/typing.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/utils.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/utils.cpython-38.pyc new file mode 100644 index 00000000..793183bb Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/__pycache__/utils.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/gradual/annotation.py b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/annotation.py new file mode 100644 index 00000000..7311bfb5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/annotation.py @@ -0,0 +1,438 @@ +""" +PEP 0484 ( https://www.python.org/dev/peps/pep-0484/ ) describes type hints +through function annotations. There is a strong suggestion in this document +that only the type of type hinting defined in PEP0484 should be allowed +as annotations in future python versions. +""" + +import re + +from parso import ParserSyntaxError, parse + +from jedi._compatibility import force_unicode, Parameter +from jedi.inference.cache import inference_state_method_cache +from jedi.inference.base_value import ValueSet, NO_VALUES +from jedi.inference.gradual.base import DefineGenericBaseClass, GenericClass +from jedi.inference.gradual.generics import TupleGenericManager +from jedi.inference.gradual.type_var import TypeVar +from jedi.inference.helpers import is_string +from jedi.inference.compiled import builtin_from_name +from jedi.inference.param import get_executed_param_names +from jedi import debug +from jedi import parser_utils + + +def infer_annotation(context, annotation): + """ + Inferes an annotation node. This means that it inferes the part of + `int` here: + + foo: int = 3 + + Also checks for forward references (strings) + """ + value_set = context.infer_node(annotation) + if len(value_set) != 1: + debug.warning("Inferred typing index %s should lead to 1 object, " + " not %s" % (annotation, value_set)) + return value_set + + inferred_value = list(value_set)[0] + if is_string(inferred_value): + result = _get_forward_reference_node(context, inferred_value.get_safe_value()) + if result is not None: + return context.infer_node(result) + return value_set + + +def _infer_annotation_string(context, string, index=None): + node = _get_forward_reference_node(context, string) + if node is None: + return NO_VALUES + + value_set = context.infer_node(node) + if index is not None: + value_set = value_set.filter( + lambda value: value.array_type == u'tuple' # noqa + and len(list(value.py__iter__())) >= index + ).py__simple_getitem__(index) + return value_set + + +def _get_forward_reference_node(context, string): + try: + new_node = context.inference_state.grammar.parse( + force_unicode(string), + start_symbol='eval_input', + error_recovery=False + ) + except ParserSyntaxError: + debug.warning('Annotation not parsed: %s' % string) + return None + else: + module = context.tree_node.get_root_node() + parser_utils.move(new_node, module.end_pos[0]) + new_node.parent = context.tree_node + return new_node + + +def _split_comment_param_declaration(decl_text): + """ + Split decl_text on commas, but group generic expressions + together. + + For example, given "foo, Bar[baz, biz]" we return + ['foo', 'Bar[baz, biz]']. + + """ + try: + node = parse(decl_text, error_recovery=False).children[0] + except ParserSyntaxError: + debug.warning('Comment annotation is not valid Python: %s' % decl_text) + return [] + + if node.type in ['name', 'atom_expr', 'power']: + return [node.get_code().strip()] + + params = [] + try: + children = node.children + except AttributeError: + return [] + else: + for child in children: + if child.type in ['name', 'atom_expr', 'power']: + params.append(child.get_code().strip()) + + return params + + +@inference_state_method_cache() +def infer_param(function_value, param, ignore_stars=False): + values = _infer_param(function_value, param) + if ignore_stars or not values: + return values + inference_state = function_value.inference_state + if param.star_count == 1: + tuple_ = builtin_from_name(inference_state, 'tuple') + return ValueSet([GenericClass( + tuple_, + TupleGenericManager((values,)), + )]) + elif param.star_count == 2: + dct = builtin_from_name(inference_state, 'dict') + generics = ( + ValueSet([builtin_from_name(inference_state, 'str')]), + values + ) + return ValueSet([GenericClass( + dct, + TupleGenericManager(generics), + )]) + return values + + +def _infer_param(function_value, param): + """ + Infers the type of a function parameter, using type annotations. + """ + annotation = param.annotation + if annotation is None: + # If no Python 3-style annotation, look for a Python 2-style comment + # annotation. + # Identify parameters to function in the same sequence as they would + # appear in a type comment. + all_params = [child for child in param.parent.children + if child.type == 'param'] + + node = param.parent.parent + comment = parser_utils.get_following_comment_same_line(node) + if comment is None: + return NO_VALUES + + match = re.match(r"^#\s*type:\s*\(([^#]*)\)\s*->", comment) + if not match: + return NO_VALUES + params_comments = _split_comment_param_declaration(match.group(1)) + + # Find the specific param being investigated + index = all_params.index(param) + # If the number of parameters doesn't match length of type comment, + # ignore first parameter (assume it's self). + if len(params_comments) != len(all_params): + debug.warning( + "Comments length != Params length %s %s", + params_comments, all_params + ) + if function_value.is_bound_method(): + if index == 0: + # Assume it's self, which is already handled + return NO_VALUES + index -= 1 + if index >= len(params_comments): + return NO_VALUES + + param_comment = params_comments[index] + return _infer_annotation_string( + function_value.get_default_param_context(), + param_comment + ) + # Annotations are like default params and resolve in the same way. + context = function_value.get_default_param_context() + return infer_annotation(context, annotation) + + +def py__annotations__(funcdef): + dct = {} + for function_param in funcdef.get_params(): + param_annotation = function_param.annotation + if param_annotation is not None: + dct[function_param.name.value] = param_annotation + + return_annotation = funcdef.annotation + if return_annotation: + dct['return'] = return_annotation + return dct + + +@inference_state_method_cache() +def infer_return_types(function, arguments): + """ + Infers the type of a function's return value, + according to type annotations. + """ + all_annotations = py__annotations__(function.tree_node) + annotation = all_annotations.get("return", None) + if annotation is None: + # If there is no Python 3-type annotation, look for a Python 2-type annotation + node = function.tree_node + comment = parser_utils.get_following_comment_same_line(node) + if comment is None: + return NO_VALUES + + match = re.match(r"^#\s*type:\s*\([^#]*\)\s*->\s*([^#]*)", comment) + if not match: + return NO_VALUES + + return _infer_annotation_string( + function.get_default_param_context(), + match.group(1).strip() + ).execute_annotation() + + context = function.get_default_param_context() + unknown_type_vars = find_unknown_type_vars(context, annotation) + annotation_values = infer_annotation(context, annotation) + if not unknown_type_vars: + return annotation_values.execute_annotation() + + type_var_dict = infer_type_vars_for_execution(function, arguments, all_annotations) + + return ValueSet.from_sets( + ann.define_generics(type_var_dict) + if isinstance(ann, (DefineGenericBaseClass, TypeVar)) else ValueSet({ann}) + for ann in annotation_values + ).execute_annotation() + + +def infer_type_vars_for_execution(function, arguments, annotation_dict): + """ + Some functions use type vars that are not defined by the class, but rather + only defined in the function. See for example `iter`. In those cases we + want to: + + 1. Search for undefined type vars. + 2. Infer type vars with the execution state we have. + 3. Return the union of all type vars that have been found. + """ + context = function.get_default_param_context() + + annotation_variable_results = {} + executed_param_names = get_executed_param_names(function, arguments) + for executed_param_name in executed_param_names: + try: + annotation_node = annotation_dict[executed_param_name.string_name] + except KeyError: + continue + + annotation_variables = find_unknown_type_vars(context, annotation_node) + if annotation_variables: + # Infer unknown type var + annotation_value_set = context.infer_node(annotation_node) + kind = executed_param_name.get_kind() + actual_value_set = executed_param_name.infer() + if kind is Parameter.VAR_POSITIONAL: + actual_value_set = actual_value_set.merge_types_of_iterate() + elif kind is Parameter.VAR_KEYWORD: + # TODO _dict_values is not public. + actual_value_set = actual_value_set.try_merge('_dict_values') + merge_type_var_dicts( + annotation_variable_results, + annotation_value_set.infer_type_vars(actual_value_set), + ) + return annotation_variable_results + + +def infer_return_for_callable(arguments, param_values, result_values): + all_type_vars = {} + for pv in param_values: + if pv.array_type == 'list': + type_var_dict = _infer_type_vars_for_callable(arguments, pv.py__iter__()) + all_type_vars.update(type_var_dict) + + return ValueSet.from_sets( + v.define_generics(all_type_vars) + if isinstance(v, (DefineGenericBaseClass, TypeVar)) else ValueSet({v}) + for v in result_values + ).execute_annotation() + + +def _infer_type_vars_for_callable(arguments, lazy_params): + """ + Infers type vars for the Calllable class: + + def x() -> Callable[[Callable[..., _T]], _T]: ... + """ + annotation_variable_results = {} + for (_, lazy_value), lazy_callable_param in zip(arguments.unpack(), lazy_params): + callable_param_values = lazy_callable_param.infer() + # Infer unknown type var + actual_value_set = lazy_value.infer() + merge_type_var_dicts( + annotation_variable_results, + callable_param_values.infer_type_vars(actual_value_set), + ) + return annotation_variable_results + + +def merge_type_var_dicts(base_dict, new_dict): + for type_var_name, values in new_dict.items(): + if values: + try: + base_dict[type_var_name] |= values + except KeyError: + base_dict[type_var_name] = values + + +def merge_pairwise_generics(annotation_value, annotated_argument_class): + """ + Match up the generic parameters from the given argument class to the + target annotation. + + This walks the generic parameters immediately within the annotation and + argument's type, in order to determine the concrete values of the + annotation's parameters for the current case. + + For example, given the following code: + + def values(mapping: Mapping[K, V]) -> List[V]: ... + + for val in values({1: 'a'}): + val + + Then this function should be given representations of `Mapping[K, V]` + and `Mapping[int, str]`, so that it can determine that `K` is `int and + `V` is `str`. + + Note that it is responsibility of the caller to traverse the MRO of the + argument type as needed in order to find the type matching the + annotation (in this case finding `Mapping[int, str]` as a parent of + `Dict[int, str]`). + + Parameters + ---------- + + `annotation_value`: represents the annotation to infer the concrete + parameter types of. + + `annotated_argument_class`: represents the annotated class of the + argument being passed to the object annotated by `annotation_value`. + """ + + type_var_dict = {} + + if not isinstance(annotated_argument_class, DefineGenericBaseClass): + return type_var_dict + + annotation_generics = annotation_value.get_generics() + actual_generics = annotated_argument_class.get_generics() + + for annotation_generics_set, actual_generic_set in zip(annotation_generics, actual_generics): + merge_type_var_dicts( + type_var_dict, + annotation_generics_set.infer_type_vars(actual_generic_set.execute_annotation()), + ) + + return type_var_dict + + +def find_type_from_comment_hint_for(context, node, name): + return _find_type_from_comment_hint(context, node, node.children[1], name) + + +def find_type_from_comment_hint_with(context, node, name): + assert len(node.children[1].children) == 3, \ + "Can only be here when children[1] is 'foo() as f'" + varlist = node.children[1].children[2] + return _find_type_from_comment_hint(context, node, varlist, name) + + +def find_type_from_comment_hint_assign(context, node, name): + return _find_type_from_comment_hint(context, node, node.children[0], name) + + +def _find_type_from_comment_hint(context, node, varlist, name): + index = None + if varlist.type in ("testlist_star_expr", "exprlist", "testlist"): + # something like "a, b = 1, 2" + index = 0 + for child in varlist.children: + if child == name: + break + if child.type == "operator": + continue + index += 1 + else: + return [] + + comment = parser_utils.get_following_comment_same_line(node) + if comment is None: + return [] + match = re.match(r"^#\s*type:\s*([^#]*)", comment) + if match is None: + return [] + return _infer_annotation_string( + context, match.group(1).strip(), index + ).execute_annotation() + + +def find_unknown_type_vars(context, node): + def check_node(node): + if node.type in ('atom_expr', 'power'): + trailer = node.children[-1] + if trailer.type == 'trailer' and trailer.children[0] == '[': + for subscript_node in _unpack_subscriptlist(trailer.children[1]): + check_node(subscript_node) + else: + found[:] = _filter_type_vars(context.infer_node(node), found) + + found = [] # We're not using a set, because the order matters. + check_node(node) + return found + + +def _filter_type_vars(value_set, found=()): + new_found = list(found) + for type_var in value_set: + if isinstance(type_var, TypeVar) and type_var not in found: + new_found.append(type_var) + return new_found + + +def _unpack_subscriptlist(subscriptlist): + if subscriptlist.type == 'subscriptlist': + for subscript in subscriptlist.children[::2]: + if subscript.type != 'subscript': + yield subscript + else: + if subscriptlist.type != 'subscript': + yield subscriptlist diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/gradual/base.py b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/base.py new file mode 100644 index 00000000..2b5511f8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/base.py @@ -0,0 +1,427 @@ +from jedi.inference.cache import inference_state_method_cache +from jedi.inference.base_value import ValueSet, NO_VALUES, Value, \ + iterator_to_value_set, LazyValueWrapper, ValueWrapper +from jedi.inference.compiled import builtin_from_name +from jedi.inference.value.klass import ClassFilter +from jedi.inference.value.klass import ClassMixin +from jedi.inference.utils import to_list +from jedi.inference.names import AbstractNameDefinition, ValueName +from jedi.inference.context import ClassContext +from jedi.inference.gradual.generics import TupleGenericManager + + +class _BoundTypeVarName(AbstractNameDefinition): + """ + This type var was bound to a certain type, e.g. int. + """ + def __init__(self, type_var, value_set): + self._type_var = type_var + self.parent_context = type_var.parent_context + self._value_set = value_set + + def infer(self): + def iter_(): + for value in self._value_set: + # Replace any with the constraints if they are there. + from jedi.inference.gradual.typing import AnyClass + if isinstance(value, AnyClass): + for constraint in self._type_var.constraints: + yield constraint + else: + yield value + return ValueSet(iter_()) + + def py__name__(self): + return self._type_var.py__name__() + + def __repr__(self): + return '<%s %s -> %s>' % (self.__class__.__name__, self.py__name__(), self._value_set) + + +class _TypeVarFilter(object): + """ + A filter for all given variables in a class. + + A = TypeVar('A') + B = TypeVar('B') + class Foo(Mapping[A, B]): + ... + + In this example we would have two type vars given: A and B + """ + def __init__(self, generics, type_vars): + self._generics = generics + self._type_vars = type_vars + + def get(self, name): + for i, type_var in enumerate(self._type_vars): + if type_var.py__name__() == name: + try: + return [_BoundTypeVarName(type_var, self._generics[i])] + except IndexError: + return [type_var.name] + return [] + + def values(self): + # The values are not relevant. If it's not searched exactly, the type + # vars are just global and should be looked up as that. + return [] + + +class _AnnotatedClassContext(ClassContext): + def get_filters(self, *args, **kwargs): + filters = super(_AnnotatedClassContext, self).get_filters( + *args, **kwargs + ) + for f in filters: + yield f + + # The type vars can only be looked up if it's a global search and + # not a direct lookup on the class. + yield self._value.get_type_var_filter() + + +class DefineGenericBaseClass(LazyValueWrapper): + def __init__(self, generics_manager): + self._generics_manager = generics_manager + + def _create_instance_with_generics(self, generics_manager): + raise NotImplementedError + + @inference_state_method_cache() + def get_generics(self): + return self._generics_manager.to_tuple() + + def define_generics(self, type_var_dict): + from jedi.inference.gradual.type_var import TypeVar + changed = False + new_generics = [] + for generic_set in self.get_generics(): + values = NO_VALUES + for generic in generic_set: + if isinstance(generic, (DefineGenericBaseClass, TypeVar)): + result = generic.define_generics(type_var_dict) + values |= result + if result != ValueSet({generic}): + changed = True + else: + values |= ValueSet([generic]) + new_generics.append(values) + + if not changed: + # There might not be any type vars that change. In that case just + # return itself, because it does not make sense to potentially lose + # cached results. + return ValueSet([self]) + + return ValueSet([self._create_instance_with_generics( + TupleGenericManager(tuple(new_generics)) + )]) + + def is_same_class(self, other): + if not isinstance(other, DefineGenericBaseClass): + return False + + if self.tree_node != other.tree_node: + # TODO not sure if this is nice. + return False + given_params1 = self.get_generics() + given_params2 = other.get_generics() + + if len(given_params1) != len(given_params2): + # If the amount of type vars doesn't match, the class doesn't + # match. + return False + + # Now compare generics + return all( + any( + # TODO why is this ordering the correct one? + cls2.is_same_class(cls1) + # TODO I'm still not sure gather_annotation_classes is a good + # idea. They are essentially here to avoid comparing Tuple <=> + # tuple and instead compare tuple <=> tuple, but at the moment + # the whole `is_same_class` and `is_sub_class` matching is just + # not in the best shape. + for cls1 in class_set1.gather_annotation_classes() + for cls2 in class_set2.gather_annotation_classes() + ) for class_set1, class_set2 in zip(given_params1, given_params2) + ) + + def __repr__(self): + return '<%s: %s%s>' % ( + self.__class__.__name__, + self._wrapped_value, + list(self.get_generics()), + ) + + +class GenericClass(DefineGenericBaseClass, ClassMixin): + """ + A class that is defined with generics, might be something simple like: + + class Foo(Generic[T]): ... + my_foo_int_cls = Foo[int] + """ + def __init__(self, class_value, generics_manager): + super(GenericClass, self).__init__(generics_manager) + self._class_value = class_value + + def _get_wrapped_value(self): + return self._class_value + + def get_type_hint(self, add_class_info=True): + n = self.py__name__() + # Not sure if this is the best way to do this, but all of these types + # are a bit special in that they have type aliases and other ways to + # become lower case. It's probably better to make them upper case, + # because that's what you can use in annotations. + n = dict(list="List", dict="Dict", set="Set", tuple="Tuple").get(n, n) + s = n + self._generics_manager.get_type_hint() + if add_class_info: + return 'Type[%s]' % s + return s + + def get_type_var_filter(self): + return _TypeVarFilter(self.get_generics(), self.list_type_vars()) + + def py__call__(self, arguments): + instance, = super(GenericClass, self).py__call__(arguments) + return ValueSet([_GenericInstanceWrapper(instance)]) + + def _as_context(self): + return _AnnotatedClassContext(self) + + @to_list + def py__bases__(self): + for base in self._wrapped_value.py__bases__(): + yield _LazyGenericBaseClass(self, base, self._generics_manager) + + def _create_instance_with_generics(self, generics_manager): + return GenericClass(self._class_value, generics_manager) + + def is_sub_class_of(self, class_value): + if super(GenericClass, self).is_sub_class_of(class_value): + return True + return self._class_value.is_sub_class_of(class_value) + + def with_generics(self, generics_tuple): + return self._class_value.with_generics(generics_tuple) + + def infer_type_vars(self, value_set): + # Circular + from jedi.inference.gradual.annotation import merge_pairwise_generics, merge_type_var_dicts + + annotation_name = self.py__name__() + type_var_dict = {} + if annotation_name == 'Iterable': + annotation_generics = self.get_generics() + if annotation_generics: + return annotation_generics[0].infer_type_vars( + value_set.merge_types_of_iterate(), + ) + else: + # Note: we need to handle the MRO _in order_, so we need to extract + # the elements from the set first, then handle them, even if we put + # them back in a set afterwards. + for py_class in value_set: + if py_class.is_instance() and not py_class.is_compiled(): + py_class = py_class.get_annotated_class_object() + else: + continue + + if py_class.api_type != u'class': + # Functions & modules don't have an MRO and we're not + # expecting a Callable (those are handled separately within + # TypingClassValueWithIndex). + continue + + for parent_class in py_class.py__mro__(): + class_name = parent_class.py__name__() + if annotation_name == class_name: + merge_type_var_dicts( + type_var_dict, + merge_pairwise_generics(self, parent_class), + ) + break + + return type_var_dict + + +class _LazyGenericBaseClass(object): + def __init__(self, class_value, lazy_base_class, generics_manager): + self._class_value = class_value + self._lazy_base_class = lazy_base_class + self._generics_manager = generics_manager + + @iterator_to_value_set + def infer(self): + for base in self._lazy_base_class.infer(): + if isinstance(base, GenericClass): + # Here we have to recalculate the given types. + yield GenericClass.create_cached( + base.inference_state, + base._wrapped_value, + TupleGenericManager(tuple(self._remap_type_vars(base))), + ) + else: + if base.is_class_mixin(): + # This case basically allows classes like `class Foo(List)` + # to be used like `Foo[int]`. The generics are not + # necessary and can be used later. + yield GenericClass.create_cached( + base.inference_state, + base, + self._generics_manager, + ) + else: + yield base + + def _remap_type_vars(self, base): + from jedi.inference.gradual.type_var import TypeVar + filter = self._class_value.get_type_var_filter() + for type_var_set in base.get_generics(): + new = NO_VALUES + for type_var in type_var_set: + if isinstance(type_var, TypeVar): + names = filter.get(type_var.py__name__()) + new |= ValueSet.from_sets( + name.infer() for name in names + ) + else: + # Mostly will be type vars, except if in some cases + # a concrete type will already be there. In that + # case just add it to the value set. + new |= ValueSet([type_var]) + yield new + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._lazy_base_class) + + +class _GenericInstanceWrapper(ValueWrapper): + def py__stop_iteration_returns(self): + for cls in self._wrapped_value.class_value.py__mro__(): + if cls.py__name__() == 'Generator': + generics = cls.get_generics() + try: + return generics[2].execute_annotation() + except IndexError: + pass + elif cls.py__name__() == 'Iterator': + return ValueSet([builtin_from_name(self.inference_state, u'None')]) + return self._wrapped_value.py__stop_iteration_returns() + + def get_type_hint(self, add_class_info=True): + return self._wrapped_value.class_value.get_type_hint(add_class_info=False) + + +class _PseudoTreeNameClass(Value): + """ + In typeshed, some classes are defined like this: + + Tuple: _SpecialForm = ... + + Now this is not a real class, therefore we have to do some workarounds like + this class. Essentially this class makes it possible to goto that `Tuple` + name, without affecting anything else negatively. + """ + api_type = u'class' + + def __init__(self, parent_context, tree_name): + super(_PseudoTreeNameClass, self).__init__( + parent_context.inference_state, + parent_context + ) + self._tree_name = tree_name + + @property + def tree_node(self): + return self._tree_name + + def get_filters(self, *args, **kwargs): + # TODO this is obviously wrong. Is it though? + class EmptyFilter(ClassFilter): + def __init__(self): + pass + + def get(self, name, **kwargs): + return [] + + def values(self, **kwargs): + return [] + + yield EmptyFilter() + + def py__class__(self): + # This might not be 100% correct, but it is good enough. The details of + # the typing library are not really an issue for Jedi. + return builtin_from_name(self.inference_state, u'type') + + @property + def name(self): + return ValueName(self, self._tree_name) + + def get_qualified_names(self): + return (self._tree_name.value,) + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self._tree_name.value) + + +class BaseTypingValue(LazyValueWrapper): + def __init__(self, parent_context, tree_name): + self.inference_state = parent_context.inference_state + self.parent_context = parent_context + self._tree_name = tree_name + + @property + def name(self): + return ValueName(self, self._tree_name) + + def _get_wrapped_value(self): + return _PseudoTreeNameClass(self.parent_context, self._tree_name) + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self._tree_name.value) + + +class BaseTypingClassWithGenerics(DefineGenericBaseClass): + def __init__(self, parent_context, tree_name, generics_manager): + super(BaseTypingClassWithGenerics, self).__init__(generics_manager) + self.inference_state = parent_context.inference_state + self.parent_context = parent_context + self._tree_name = tree_name + + def _get_wrapped_value(self): + return _PseudoTreeNameClass(self.parent_context, self._tree_name) + + def __repr__(self): + return '%s(%s%s)' % (self.__class__.__name__, self._tree_name.value, + self._generics_manager) + + +class BaseTypingInstance(LazyValueWrapper): + def __init__(self, parent_context, class_value, tree_name, generics_manager): + self.inference_state = class_value.inference_state + self.parent_context = parent_context + self._class_value = class_value + self._tree_name = tree_name + self._generics_manager = generics_manager + + def py__class__(self): + return self._class_value + + def get_annotated_class_object(self): + return self._class_value + + @property + def name(self): + return ValueName(self, self._tree_name) + + def _get_wrapped_value(self): + object_, = builtin_from_name(self.inference_state, u'object').execute_annotation() + return object_ + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._generics_manager) diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/gradual/conversion.py b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/conversion.py new file mode 100644 index 00000000..0700716d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/conversion.py @@ -0,0 +1,208 @@ +from jedi import debug +from jedi.inference.base_value import ValueSet, \ + NO_VALUES +from jedi.inference.utils import to_list +from jedi.inference.gradual.stub_value import StubModuleValue +from jedi.inference.gradual.typeshed import try_to_load_stub_cached +from jedi.inference.value.decorator import Decoratee + + +def _stub_to_python_value_set(stub_value, ignore_compiled=False): + stub_module_context = stub_value.get_root_context() + if not stub_module_context.is_stub(): + return ValueSet([stub_value]) + + decorates = None + if isinstance(stub_value, Decoratee): + decorates = stub_value._original_value + + was_instance = stub_value.is_instance() + if was_instance: + stub_value = stub_value.py__class__() + + qualified_names = stub_value.get_qualified_names() + if qualified_names is None: + return NO_VALUES + + was_bound_method = stub_value.is_bound_method() + if was_bound_method: + # Infer the object first. We can infer the method later. + method_name = qualified_names[-1] + qualified_names = qualified_names[:-1] + was_instance = True + + values = _infer_from_stub(stub_module_context, qualified_names, ignore_compiled) + if was_instance: + values = ValueSet.from_sets( + c.execute_with_values() + for c in values + if c.is_class() + ) + if was_bound_method: + # Now that the instance has been properly created, we can simply get + # the method. + values = values.py__getattribute__(method_name) + if decorates is not None: + values = ValueSet(Decoratee(v, decorates) for v in values) + return values + + +def _infer_from_stub(stub_module_context, qualified_names, ignore_compiled): + from jedi.inference.compiled.mixed import MixedObject + stub_module = stub_module_context.get_value() + assert isinstance(stub_module, (StubModuleValue, MixedObject)), stub_module_context + non_stubs = stub_module.non_stub_value_set + if ignore_compiled: + non_stubs = non_stubs.filter(lambda c: not c.is_compiled()) + for name in qualified_names: + non_stubs = non_stubs.py__getattribute__(name) + return non_stubs + + +@to_list +def _try_stub_to_python_names(names, prefer_stub_to_compiled=False): + for name in names: + module_context = name.get_root_context() + if not module_context.is_stub(): + yield name + continue + + if name.api_type == 'module': + values = convert_values(name.infer(), ignore_compiled=prefer_stub_to_compiled) + if values: + for v in values: + yield v.name + continue + else: + v = name.get_defining_qualified_value() + if v is not None: + converted = _stub_to_python_value_set(v, ignore_compiled=prefer_stub_to_compiled) + if converted: + converted_names = converted.goto(name.get_public_name()) + if converted_names: + for n in converted_names: + if n.get_root_context().is_stub(): + # If it's a stub again, it means we're going in + # a circle. Probably some imports make it a + # stub again. + yield name + else: + yield n + continue + yield name + + +def _load_stub_module(module): + if module.is_stub(): + return module + return try_to_load_stub_cached( + module.inference_state, + import_names=module.string_names, + python_value_set=ValueSet([module]), + parent_module_value=None, + sys_path=module.inference_state.get_sys_path(), + ) + + +@to_list +def _python_to_stub_names(names, fallback_to_python=False): + for name in names: + module_context = name.get_root_context() + if module_context.is_stub(): + yield name + continue + + if name.api_type == 'module': + found_name = False + for n in name.goto(): + if n.api_type == 'module': + values = convert_values(n.infer(), only_stubs=True) + for v in values: + yield v.name + found_name = True + else: + for x in _python_to_stub_names([n], fallback_to_python=fallback_to_python): + yield x + found_name = True + if found_name: + continue + else: + v = name.get_defining_qualified_value() + if v is not None: + converted = to_stub(v) + if converted: + converted_names = converted.goto(name.get_public_name()) + if converted_names: + for n in converted_names: + yield n + continue + if fallback_to_python: + # This is the part where if we haven't found anything, just return + # the stub name. + yield name + + +def convert_names(names, only_stubs=False, prefer_stubs=False, prefer_stub_to_compiled=True): + if only_stubs and prefer_stubs: + raise ValueError("You cannot use both of only_stubs and prefer_stubs.") + + with debug.increase_indent_cm('convert names'): + if only_stubs or prefer_stubs: + return _python_to_stub_names(names, fallback_to_python=prefer_stubs) + else: + return _try_stub_to_python_names( + names, prefer_stub_to_compiled=prefer_stub_to_compiled) + + +def convert_values(values, only_stubs=False, prefer_stubs=False, ignore_compiled=True): + assert not (only_stubs and prefer_stubs) + with debug.increase_indent_cm('convert values'): + if only_stubs or prefer_stubs: + return ValueSet.from_sets( + to_stub(value) + or (ValueSet({value}) if prefer_stubs else NO_VALUES) + for value in values + ) + else: + return ValueSet.from_sets( + _stub_to_python_value_set(stub_value, ignore_compiled=ignore_compiled) + or ValueSet({stub_value}) + for stub_value in values + ) + + +def to_stub(value): + if value.is_stub(): + return ValueSet([value]) + + was_instance = value.is_instance() + if was_instance: + value = value.py__class__() + + qualified_names = value.get_qualified_names() + stub_module = _load_stub_module(value.get_root_context().get_value()) + if stub_module is None or qualified_names is None: + return NO_VALUES + + was_bound_method = value.is_bound_method() + if was_bound_method: + # Infer the object first. We can infer the method later. + method_name = qualified_names[-1] + qualified_names = qualified_names[:-1] + was_instance = True + + stub_values = ValueSet([stub_module]) + for name in qualified_names: + stub_values = stub_values.py__getattribute__(name) + + if was_instance: + stub_values = ValueSet.from_sets( + c.execute_with_values() + for c in stub_values + if c.is_class() + ) + if was_bound_method: + # Now that the instance has been properly created, we can simply get + # the method. + stub_values = stub_values.py__getattribute__(method_name) + return stub_values diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/gradual/generics.py b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/generics.py new file mode 100644 index 00000000..6bd6aa63 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/generics.py @@ -0,0 +1,101 @@ +""" +This module is about generics, like the `int` in `List[int]`. It's not about +the Generic class. +""" + +from jedi import debug +from jedi.cache import memoize_method +from jedi.inference.utils import to_tuple +from jedi.inference.base_value import ValueSet, NO_VALUES +from jedi.inference.value.iterable import SequenceLiteralValue +from jedi.inference.helpers import is_string + + +def _resolve_forward_references(context, value_set): + for value in value_set: + if is_string(value): + from jedi.inference.gradual.annotation import _get_forward_reference_node + node = _get_forward_reference_node(context, value.get_safe_value()) + if node is not None: + for c in context.infer_node(node): + yield c + else: + yield value + + +class _AbstractGenericManager(object): + def get_index_and_execute(self, index): + try: + return self[index].execute_annotation() + except IndexError: + debug.warning('No param #%s found for annotation %s', index, self) + return NO_VALUES + + def get_type_hint(self): + return '[%s]' % ', '.join(t.get_type_hint(add_class_info=False) for t in self.to_tuple()) + + +class LazyGenericManager(_AbstractGenericManager): + def __init__(self, context_of_index, index_value): + self._context_of_index = context_of_index + self._index_value = index_value + + @memoize_method + def __getitem__(self, index): + return self._tuple()[index]() + + def __len__(self): + return len(self._tuple()) + + @memoize_method + @to_tuple + def _tuple(self): + def lambda_scoping_in_for_loop_sucks(lazy_value): + return lambda: ValueSet(_resolve_forward_references( + self._context_of_index, + lazy_value.infer() + )) + + if isinstance(self._index_value, SequenceLiteralValue): + for lazy_value in self._index_value.py__iter__(contextualized_node=None): + yield lambda_scoping_in_for_loop_sucks(lazy_value) + else: + yield lambda: ValueSet(_resolve_forward_references( + self._context_of_index, + ValueSet([self._index_value]) + )) + + @to_tuple + def to_tuple(self): + for callable_ in self._tuple(): + yield callable_() + + def is_homogenous_tuple(self): + if isinstance(self._index_value, SequenceLiteralValue): + entries = self._index_value.get_tree_entries() + if len(entries) == 2 and entries[1] == '...': + return True + return False + + def __repr__(self): + return '[%s]' % (', '.join(repr(x) for x in self.to_tuple())) + + +class TupleGenericManager(_AbstractGenericManager): + def __init__(self, tup): + self._tuple = tup + + def __getitem__(self, index): + return self._tuple[index] + + def __len__(self): + return len(self._tuple) + + def to_tuple(self): + return self._tuple + + def is_homogenous_tuple(self): + return False + + def __repr__(self): + return '[%s]' % (', '.join(repr(x) for x in self.to_tuple())) diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/gradual/stub_value.py b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/stub_value.py new file mode 100644 index 00000000..badfff35 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/stub_value.py @@ -0,0 +1,105 @@ +from jedi.inference.base_value import ValueWrapper +from jedi.inference.value.module import ModuleValue +from jedi.inference.filters import ParserTreeFilter +from jedi.inference.names import StubName, StubModuleName +from jedi.inference.gradual.typing import TypingModuleFilterWrapper +from jedi.inference.context import ModuleContext + + +class StubModuleValue(ModuleValue): + _module_name_class = StubModuleName + + def __init__(self, non_stub_value_set, *args, **kwargs): + super(StubModuleValue, self).__init__(*args, **kwargs) + self.non_stub_value_set = non_stub_value_set + + def is_stub(self): + return True + + def sub_modules_dict(self): + """ + We have to overwrite this, because it's possible to have stubs that + don't have code for all the child modules. At the time of writing this + there are for example no stubs for `json.tool`. + """ + names = {} + for value in self.non_stub_value_set: + try: + method = value.sub_modules_dict + except AttributeError: + pass + else: + names.update(method()) + names.update(super(StubModuleValue, self).sub_modules_dict()) + return names + + def _get_stub_filters(self, origin_scope): + return [StubFilter( + parent_context=self.as_context(), + origin_scope=origin_scope + )] + list(self.iter_star_filters()) + + def get_filters(self, origin_scope=None): + filters = super(StubModuleValue, self).get_filters(origin_scope) + next(filters, None) # Ignore the first filter and replace it with our own + stub_filters = self._get_stub_filters(origin_scope=origin_scope) + for f in stub_filters: + yield f + + for f in filters: + yield f + + def _as_context(self): + return StubModuleContext(self) + + +class StubModuleContext(ModuleContext): + def get_filters(self, until_position=None, origin_scope=None): + # Make sure to ignore the position, because positions are not relevant + # for stubs. + return super(StubModuleContext, self).get_filters(origin_scope=origin_scope) + + +class TypingModuleWrapper(StubModuleValue): + def get_filters(self, *args, **kwargs): + filters = super(TypingModuleWrapper, self).get_filters(*args, **kwargs) + f = next(filters, None) + assert f is not None + yield TypingModuleFilterWrapper(f) + for f in filters: + yield f + + def _as_context(self): + return TypingModuleContext(self) + + +class TypingModuleContext(ModuleContext): + def get_filters(self, *args, **kwargs): + filters = super(TypingModuleContext, self).get_filters(*args, **kwargs) + yield TypingModuleFilterWrapper(next(filters, None)) + for f in filters: + yield f + + +class StubFilter(ParserTreeFilter): + name_class = StubName + + def _is_name_reachable(self, name): + if not super(StubFilter, self)._is_name_reachable(name): + return False + + # Imports in stub files are only public if they have an "as" + # export. + definition = name.get_definition() + if definition.type in ('import_from', 'import_name'): + if name.parent.type not in ('import_as_name', 'dotted_as_name'): + return False + n = name.value + # TODO rewrite direct return + if n.startswith('_') and not (n.startswith('__') and n.endswith('__')): + return False + return True + + +class VersionInfo(ValueWrapper): + pass diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/gradual/type_var.py b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/type_var.py new file mode 100644 index 00000000..502eaf1f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/type_var.py @@ -0,0 +1,131 @@ +from jedi._compatibility import unicode, force_unicode +from jedi import debug +from jedi.inference.base_value import ValueSet, NO_VALUES, ValueWrapper +from jedi.inference.gradual.base import BaseTypingValue + + +class TypeVarClass(BaseTypingValue): + def py__call__(self, arguments): + unpacked = arguments.unpack() + + key, lazy_value = next(unpacked, (None, None)) + var_name = self._find_string_name(lazy_value) + # The name must be given, otherwise it's useless. + if var_name is None or key is not None: + debug.warning('Found a variable without a name %s', arguments) + return NO_VALUES + + return ValueSet([TypeVar.create_cached( + self.inference_state, + self.parent_context, + self._tree_name, + var_name, + unpacked + )]) + + def _find_string_name(self, lazy_value): + if lazy_value is None: + return None + + value_set = lazy_value.infer() + if not value_set: + return None + if len(value_set) > 1: + debug.warning('Found multiple values for a type variable: %s', value_set) + + name_value = next(iter(value_set)) + try: + method = name_value.get_safe_value + except AttributeError: + return None + else: + safe_value = method(default=None) + if self.inference_state.environment.version_info.major == 2: + if isinstance(safe_value, bytes): + return force_unicode(safe_value) + if isinstance(safe_value, (str, unicode)): + return safe_value + return None + + +class TypeVar(BaseTypingValue): + def __init__(self, parent_context, tree_name, var_name, unpacked_args): + super(TypeVar, self).__init__(parent_context, tree_name) + self._var_name = var_name + + self._constraints_lazy_values = [] + self._bound_lazy_value = None + self._covariant_lazy_value = None + self._contravariant_lazy_value = None + for key, lazy_value in unpacked_args: + if key is None: + self._constraints_lazy_values.append(lazy_value) + else: + if key == 'bound': + self._bound_lazy_value = lazy_value + elif key == 'covariant': + self._covariant_lazy_value = lazy_value + elif key == 'contravariant': + self._contra_variant_lazy_value = lazy_value + else: + debug.warning('Invalid TypeVar param name %s', key) + + def py__name__(self): + return self._var_name + + def get_filters(self, *args, **kwargs): + return iter([]) + + def _get_classes(self): + if self._bound_lazy_value is not None: + return self._bound_lazy_value.infer() + if self._constraints_lazy_values: + return self.constraints + debug.warning('Tried to infer the TypeVar %s without a given type', self._var_name) + return NO_VALUES + + def is_same_class(self, other): + # Everything can match an undefined type var. + return True + + @property + def constraints(self): + return ValueSet.from_sets( + lazy.infer() for lazy in self._constraints_lazy_values + ) + + def define_generics(self, type_var_dict): + try: + found = type_var_dict[self.py__name__()] + except KeyError: + pass + else: + if found: + return found + return self._get_classes() or ValueSet({self}) + + def execute_annotation(self): + return self._get_classes().execute_annotation() + + def infer_type_vars(self, value_set): + def iterate(): + for v in value_set: + cls = v.py__class__() + if v.is_function() or v.is_class(): + cls = TypeWrapper(cls, v) + yield cls + + annotation_name = self.py__name__() + return {annotation_name: ValueSet(iterate())} + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.py__name__()) + + +class TypeWrapper(ValueWrapper): + def __init__(self, wrapped_value, original_value): + super(TypeWrapper, self).__init__(wrapped_value) + self._original_value = original_value + + def execute_annotation(self): + return ValueSet({self._original_value}) diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/gradual/typeshed.py b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/typeshed.py new file mode 100644 index 00000000..bcf839a0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/typeshed.py @@ -0,0 +1,304 @@ +import os +import re +from functools import wraps + +from jedi import settings +from jedi.file_io import FileIO +from jedi._compatibility import FileNotFoundError, cast_path +from jedi.parser_utils import get_cached_code_lines +from jedi.inference.base_value import ValueSet, NO_VALUES +from jedi.inference.gradual.stub_value import TypingModuleWrapper, StubModuleValue +from jedi.inference.value import ModuleValue + +_jedi_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +TYPESHED_PATH = os.path.join(_jedi_path, 'third_party', 'typeshed') +DJANGO_INIT_PATH = os.path.join(_jedi_path, 'third_party', 'django-stubs', + 'django-stubs', '__init__.pyi') + +_IMPORT_MAP = dict( + _collections='collections', + _socket='socket', +) + + +def _merge_create_stub_map(directories): + map_ = {} + for directory in directories: + map_.update(_create_stub_map(directory)) + return map_ + + +def _create_stub_map(directory): + """ + Create a mapping of an importable name in Python to a stub file. + """ + def generate(): + try: + listed = os.listdir(directory) + except (FileNotFoundError, OSError): + # OSError is Python 2 + return + + for entry in listed: + entry = cast_path(entry) + path = os.path.join(directory, entry) + if os.path.isdir(path): + init = os.path.join(path, '__init__.pyi') + if os.path.isfile(init): + yield entry, init + elif entry.endswith('.pyi') and os.path.isfile(path): + name = entry[:-4] + if name != '__init__': + yield name, path + + # Create a dictionary from the tuple generator. + return dict(generate()) + + +def _get_typeshed_directories(version_info): + check_version_list = ['2and3', str(version_info.major)] + for base in ['stdlib', 'third_party']: + base = os.path.join(TYPESHED_PATH, base) + base_list = os.listdir(base) + for base_list_entry in base_list: + match = re.match(r'(\d+)\.(\d+)$', base_list_entry) + if match is not None: + if int(match.group(1)) == version_info.major \ + and int(match.group(2)) <= version_info.minor: + check_version_list.append(base_list_entry) + + for check_version in check_version_list: + yield os.path.join(base, check_version) + + +_version_cache = {} + + +def _cache_stub_file_map(version_info): + """ + Returns a map of an importable name in Python to a stub file. + """ + # TODO this caches the stub files indefinitely, maybe use a time cache + # for that? + version = version_info[:2] + try: + return _version_cache[version] + except KeyError: + pass + + _version_cache[version] = file_set = \ + _merge_create_stub_map(_get_typeshed_directories(version_info)) + return file_set + + +def import_module_decorator(func): + @wraps(func) + def wrapper(inference_state, import_names, parent_module_value, sys_path, prefer_stubs): + python_value_set = inference_state.module_cache.get(import_names) + if python_value_set is None: + if parent_module_value is not None and parent_module_value.is_stub(): + parent_module_values = parent_module_value.non_stub_value_set + else: + parent_module_values = [parent_module_value] + if import_names == ('os', 'path'): + # This is a huge exception, we follow a nested import + # ``os.path``, because it's a very important one in Python + # that is being achieved by messing with ``sys.modules`` in + # ``os``. + python_value_set = ValueSet.from_sets( + func(inference_state, (n,), None, sys_path,) + for n in [u'posixpath', u'ntpath', u'macpath', u'os2emxpath'] + ) + else: + python_value_set = ValueSet.from_sets( + func(inference_state, import_names, p, sys_path,) + for p in parent_module_values + ) + inference_state.module_cache.add(import_names, python_value_set) + + if not prefer_stubs: + return python_value_set + + stub = try_to_load_stub_cached(inference_state, import_names, python_value_set, + parent_module_value, sys_path) + if stub is not None: + return ValueSet([stub]) + return python_value_set + + return wrapper + + +def try_to_load_stub_cached(inference_state, import_names, *args, **kwargs): + if import_names is None: + return None + + try: + return inference_state.stub_module_cache[import_names] + except KeyError: + pass + + # TODO is this needed? where are the exceptions coming from that make this + # necessary? Just remove this line. + inference_state.stub_module_cache[import_names] = None + inference_state.stub_module_cache[import_names] = result = \ + _try_to_load_stub(inference_state, import_names, *args, **kwargs) + return result + + +def _try_to_load_stub(inference_state, import_names, python_value_set, + parent_module_value, sys_path): + """ + Trying to load a stub for a set of import_names. + + This is modelled to work like "PEP 561 -- Distributing and Packaging Type + Information", see https://www.python.org/dev/peps/pep-0561. + """ + if parent_module_value is None and len(import_names) > 1: + try: + parent_module_value = try_to_load_stub_cached( + inference_state, import_names[:-1], NO_VALUES, + parent_module_value=None, sys_path=sys_path) + except KeyError: + pass + + # 1. Try to load foo-stubs folders on path for import name foo. + if len(import_names) == 1: + # foo-stubs + for p in sys_path: + p = cast_path(p) + init = os.path.join(p, *import_names) + '-stubs' + os.path.sep + '__init__.pyi' + m = _try_to_load_stub_from_file( + inference_state, + python_value_set, + file_io=FileIO(init), + import_names=import_names, + ) + if m is not None: + return m + if import_names[0] == 'django': + return _try_to_load_stub_from_file( + inference_state, + python_value_set, + file_io=FileIO(DJANGO_INIT_PATH), + import_names=import_names, + ) + + # 2. Try to load pyi files next to py files. + for c in python_value_set: + try: + method = c.py__file__ + except AttributeError: + pass + else: + file_path = method() + file_paths = [] + if c.is_namespace(): + file_paths = [os.path.join(p, '__init__.pyi') for p in c.py__path__()] + elif file_path is not None and file_path.endswith('.py'): + file_paths = [file_path + 'i'] + + for file_path in file_paths: + m = _try_to_load_stub_from_file( + inference_state, + python_value_set, + # The file path should end with .pyi + file_io=FileIO(file_path), + import_names=import_names, + ) + if m is not None: + return m + + # 3. Try to load typeshed + m = _load_from_typeshed(inference_state, python_value_set, parent_module_value, import_names) + if m is not None: + return m + + # 4. Try to load pyi file somewhere if python_value_set was not defined. + if not python_value_set: + if parent_module_value is not None: + check_path = parent_module_value.py__path__() or [] + # In case import_names + names_for_path = (import_names[-1],) + else: + check_path = sys_path + names_for_path = import_names + + for p in check_path: + m = _try_to_load_stub_from_file( + inference_state, + python_value_set, + file_io=FileIO(os.path.join(p, *names_for_path) + '.pyi'), + import_names=import_names, + ) + if m is not None: + return m + + # If no stub is found, that's fine, the calling function has to deal with + # it. + return None + + +def _load_from_typeshed(inference_state, python_value_set, parent_module_value, import_names): + import_name = import_names[-1] + map_ = None + if len(import_names) == 1: + map_ = _cache_stub_file_map(inference_state.grammar.version_info) + import_name = _IMPORT_MAP.get(import_name, import_name) + elif isinstance(parent_module_value, ModuleValue): + if not parent_module_value.is_package(): + # Only if it's a package (= a folder) something can be + # imported. + return None + path = parent_module_value.py__path__() + map_ = _merge_create_stub_map(path) + + if map_ is not None: + path = map_.get(import_name) + if path is not None: + return _try_to_load_stub_from_file( + inference_state, + python_value_set, + file_io=FileIO(path), + import_names=import_names, + ) + + +def _try_to_load_stub_from_file(inference_state, python_value_set, file_io, import_names): + try: + stub_module_node = parse_stub_module(inference_state, file_io) + except (OSError, IOError): # IOError is Python 2 only + # The file that you're looking for doesn't exist (anymore). + return None + else: + return create_stub_module( + inference_state, python_value_set, stub_module_node, file_io, + import_names + ) + + +def parse_stub_module(inference_state, file_io): + return inference_state.parse( + file_io=file_io, + cache=True, + diff_cache=settings.fast_parser, + cache_path=settings.cache_directory, + use_latest_grammar=True + ) + + +def create_stub_module(inference_state, python_value_set, stub_module_node, file_io, import_names): + if import_names == ('typing',): + module_cls = TypingModuleWrapper + else: + module_cls = StubModuleValue + file_name = os.path.basename(file_io.path) + stub_module_value = module_cls( + python_value_set, inference_state, stub_module_node, + file_io=file_io, + string_names=import_names, + # The code was loaded with latest_grammar, so use + # that. + code_lines=get_cached_code_lines(inference_state.latest_grammar, file_io.path), + is_package=file_name == '__init__.pyi', + ) + return stub_module_value diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/gradual/typing.py b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/typing.py new file mode 100644 index 00000000..e3a95009 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/typing.py @@ -0,0 +1,485 @@ +""" +We need to somehow work with the typing objects. Since the typing objects are +pretty bare we need to add all the Jedi customizations to make them work as +values. + +This file deals with all the typing.py cases. +""" +import itertools + +from jedi._compatibility import unicode +from jedi import debug +from jedi.inference.compiled import builtin_from_name, create_simple_object +from jedi.inference.base_value import ValueSet, NO_VALUES, Value, \ + LazyValueWrapper +from jedi.inference.lazy_value import LazyKnownValues +from jedi.inference.arguments import repack_with_argument_clinic +from jedi.inference.filters import FilterWrapper +from jedi.inference.names import NameWrapper, ValueName +from jedi.inference.value.klass import ClassMixin +from jedi.inference.gradual.base import BaseTypingValue, \ + BaseTypingClassWithGenerics, BaseTypingInstance +from jedi.inference.gradual.type_var import TypeVarClass +from jedi.inference.gradual.generics import LazyGenericManager, TupleGenericManager + +_PROXY_CLASS_TYPES = 'Tuple Generic Protocol Callable Type'.split() +_TYPE_ALIAS_TYPES = { + 'List': 'builtins.list', + 'Dict': 'builtins.dict', + 'Set': 'builtins.set', + 'FrozenSet': 'builtins.frozenset', + 'ChainMap': 'collections.ChainMap', + 'Counter': 'collections.Counter', + 'DefaultDict': 'collections.defaultdict', + 'Deque': 'collections.deque', +} +_PROXY_TYPES = 'Optional Union ClassVar'.split() + + +class TypingModuleName(NameWrapper): + def infer(self): + return ValueSet(self._remap()) + + def _remap(self): + name = self.string_name + inference_state = self.parent_context.inference_state + try: + actual = _TYPE_ALIAS_TYPES[name] + except KeyError: + pass + else: + yield TypeAlias.create_cached( + inference_state, self.parent_context, self.tree_name, actual) + return + + if name in _PROXY_CLASS_TYPES: + yield ProxyTypingClassValue.create_cached( + inference_state, self.parent_context, self.tree_name) + elif name in _PROXY_TYPES: + yield ProxyTypingValue.create_cached( + inference_state, self.parent_context, self.tree_name) + elif name == 'runtime': + # We don't want anything here, not sure what this function is + # supposed to do, since it just appears in the stubs and shouldn't + # have any effects there (because it's never executed). + return + elif name == 'TypeVar': + yield TypeVarClass.create_cached( + inference_state, self.parent_context, self.tree_name) + elif name == 'Any': + yield AnyClass.create_cached( + inference_state, self.parent_context, self.tree_name) + elif name == 'TYPE_CHECKING': + # This is needed for e.g. imports that are only available for type + # checking or are in cycles. The user can then check this variable. + yield builtin_from_name(inference_state, u'True') + elif name == 'overload': + yield OverloadFunction.create_cached( + inference_state, self.parent_context, self.tree_name) + elif name == 'NewType': + yield NewTypeFunction.create_cached( + inference_state, self.parent_context, self.tree_name) + elif name == 'cast': + yield CastFunction.create_cached( + inference_state, self.parent_context, self.tree_name) + elif name == 'TypedDict': + # TODO doesn't even exist in typeshed/typing.py, yet. But will be + # added soon. + yield TypedDictClass.create_cached( + inference_state, self.parent_context, self.tree_name) + elif name in ('no_type_check', 'no_type_check_decorator'): + # This is not necessary, as long as we are not doing type checking. + for c in self._wrapped_name.infer(): # Fuck my life Python 2 + yield c + else: + # Everything else shouldn't be relevant for type checking. + for c in self._wrapped_name.infer(): # Fuck my life Python 2 + yield c + + +class TypingModuleFilterWrapper(FilterWrapper): + name_wrapper_class = TypingModuleName + + +class ProxyWithGenerics(BaseTypingClassWithGenerics): + def execute_annotation(self): + string_name = self._tree_name.value + + if string_name == 'Union': + # This is kind of a special case, because we have Unions (in Jedi + # ValueSets). + return self.gather_annotation_classes().execute_annotation() + elif string_name == 'Optional': + # Optional is basically just saying it's either None or the actual + # type. + return self.gather_annotation_classes().execute_annotation() \ + | ValueSet([builtin_from_name(self.inference_state, u'None')]) + elif string_name == 'Type': + # The type is actually already given in the index_value + return self._generics_manager[0] + elif string_name == 'ClassVar': + # For now don't do anything here, ClassVars are always used. + return self._generics_manager[0].execute_annotation() + + mapped = { + 'Tuple': Tuple, + 'Generic': Generic, + 'Protocol': Protocol, + 'Callable': Callable, + } + cls = mapped[string_name] + return ValueSet([cls( + self.parent_context, + self, + self._tree_name, + generics_manager=self._generics_manager, + )]) + + def gather_annotation_classes(self): + return ValueSet.from_sets(self._generics_manager.to_tuple()) + + def _create_instance_with_generics(self, generics_manager): + return ProxyWithGenerics( + self.parent_context, + self._tree_name, + generics_manager + ) + + def infer_type_vars(self, value_set): + annotation_generics = self.get_generics() + + if not annotation_generics: + return {} + + annotation_name = self.py__name__() + if annotation_name == 'Optional': + # Optional[T] is equivalent to Union[T, None]. In Jedi unions + # are represented by members within a ValueSet, so we extract + # the T from the Optional[T] by removing the None value. + none = builtin_from_name(self.inference_state, u'None') + return annotation_generics[0].infer_type_vars( + value_set.filter(lambda x: x != none), + ) + + return {} + + +class ProxyTypingValue(BaseTypingValue): + index_class = ProxyWithGenerics + + def with_generics(self, generics_tuple): + return self.index_class.create_cached( + self.inference_state, + self.parent_context, + self._tree_name, + generics_manager=TupleGenericManager(generics_tuple) + ) + + def py__getitem__(self, index_value_set, contextualized_node): + return ValueSet( + self.index_class.create_cached( + self.inference_state, + self.parent_context, + self._tree_name, + generics_manager=LazyGenericManager( + context_of_index=contextualized_node.context, + index_value=index_value, + ) + ) for index_value in index_value_set + ) + + +class _TypingClassMixin(ClassMixin): + def py__bases__(self): + return [LazyKnownValues( + self.inference_state.builtins_module.py__getattribute__('object') + )] + + def get_metaclasses(self): + return [] + + @property + def name(self): + return ValueName(self, self._tree_name) + + +class TypingClassWithGenerics(ProxyWithGenerics, _TypingClassMixin): + def infer_type_vars(self, value_set): + type_var_dict = {} + annotation_generics = self.get_generics() + + if not annotation_generics: + return type_var_dict + + annotation_name = self.py__name__() + if annotation_name == 'Type': + return annotation_generics[0].infer_type_vars( + # This is basically a trick to avoid extra code: We execute the + # incoming classes to be able to use the normal code for type + # var inference. + value_set.execute_annotation(), + ) + + elif annotation_name == 'Callable': + if len(annotation_generics) == 2: + return annotation_generics[1].infer_type_vars( + value_set.execute_annotation(), + ) + + elif annotation_name == 'Tuple': + tuple_annotation, = self.execute_annotation() + return tuple_annotation.infer_type_vars(value_set) + + return type_var_dict + + def _create_instance_with_generics(self, generics_manager): + return TypingClassWithGenerics( + self.parent_context, + self._tree_name, + generics_manager + ) + + +class ProxyTypingClassValue(ProxyTypingValue, _TypingClassMixin): + index_class = TypingClassWithGenerics + + +class TypeAlias(LazyValueWrapper): + def __init__(self, parent_context, origin_tree_name, actual): + self.inference_state = parent_context.inference_state + self.parent_context = parent_context + self._origin_tree_name = origin_tree_name + self._actual = actual # e.g. builtins.list + + @property + def name(self): + return ValueName(self, self._origin_tree_name) + + def py__name__(self): + return self.name.string_name + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._actual) + + def _get_wrapped_value(self): + module_name, class_name = self._actual.split('.') + if self.inference_state.environment.version_info.major == 2 and module_name == 'builtins': + module_name = '__builtin__' + + # TODO use inference_state.import_module? + from jedi.inference.imports import Importer + module, = Importer( + self.inference_state, [module_name], self.inference_state.builtins_module + ).follow() + classes = module.py__getattribute__(class_name) + # There should only be one, because it's code that we control. + assert len(classes) == 1, classes + cls = next(iter(classes)) + return cls + + def gather_annotation_classes(self): + return ValueSet([self._get_wrapped_value()]) + + +class Callable(BaseTypingInstance): + def py__call__(self, arguments): + """ + def x() -> Callable[[Callable[..., _T]], _T]: ... + """ + # The 0th index are the arguments. + try: + param_values = self._generics_manager[0] + result_values = self._generics_manager[1] + except IndexError: + debug.warning('Callable[...] defined without two arguments') + return NO_VALUES + else: + from jedi.inference.gradual.annotation import infer_return_for_callable + return infer_return_for_callable(arguments, param_values, result_values) + + +class Tuple(BaseTypingInstance): + def _is_homogenous(self): + # To specify a variable-length tuple of homogeneous type, Tuple[T, ...] + # is used. + return self._generics_manager.is_homogenous_tuple() + + def py__simple_getitem__(self, index): + if self._is_homogenous(): + return self._generics_manager.get_index_and_execute(0) + else: + if isinstance(index, int): + return self._generics_manager.get_index_and_execute(index) + + debug.dbg('The getitem type on Tuple was %s' % index) + return NO_VALUES + + def py__iter__(self, contextualized_node=None): + if self._is_homogenous(): + yield LazyKnownValues(self._generics_manager.get_index_and_execute(0)) + else: + for v in self._generics_manager.to_tuple(): + yield LazyKnownValues(v.execute_annotation()) + + def py__getitem__(self, index_value_set, contextualized_node): + if self._is_homogenous(): + return self._generics_manager.get_index_and_execute(0) + + return ValueSet.from_sets( + self._generics_manager.to_tuple() + ).execute_annotation() + + def _get_wrapped_value(self): + tuple_, = self.inference_state.builtins_module \ + .py__getattribute__('tuple').execute_annotation() + return tuple_ + + @property + def name(self): + return self._wrapped_value.name + + def infer_type_vars(self, value_set): + # Circular + from jedi.inference.gradual.annotation import merge_pairwise_generics, merge_type_var_dicts + + value_set = value_set.filter( + lambda x: x.py__name__().lower() == 'tuple', + ) + + if self._is_homogenous(): + # The parameter annotation is of the form `Tuple[T, ...]`, + # so we treat the incoming tuple like a iterable sequence + # rather than a positional container of elements. + return self._class_value.get_generics()[0].infer_type_vars( + value_set.merge_types_of_iterate(), + ) + + else: + # The parameter annotation has only explicit type parameters + # (e.g: `Tuple[T]`, `Tuple[T, U]`, `Tuple[T, U, V]`, etc.) so we + # treat the incoming values as needing to match the annotation + # exactly, just as we would for non-tuple annotations. + + type_var_dict = {} + for element in value_set: + try: + method = element.get_annotated_class_object + except AttributeError: + # This might still happen, because the tuple name matching + # above is not 100% correct, so just catch the remaining + # cases here. + continue + + py_class = method() + merge_type_var_dicts( + type_var_dict, + merge_pairwise_generics(self._class_value, py_class), + ) + + return type_var_dict + + +class Generic(BaseTypingInstance): + pass + + +class Protocol(BaseTypingInstance): + pass + + +class AnyClass(BaseTypingValue): + def execute_annotation(self): + debug.warning('Used Any - returned no results') + return NO_VALUES + + +class OverloadFunction(BaseTypingValue): + @repack_with_argument_clinic('func, /') + def py__call__(self, func_value_set): + # Just pass arguments through. + return func_value_set + + +class NewTypeFunction(BaseTypingValue): + def py__call__(self, arguments): + ordered_args = arguments.unpack() + next(ordered_args, (None, None)) + _, second_arg = next(ordered_args, (None, None)) + if second_arg is None: + return NO_VALUES + return ValueSet( + NewType( + self.inference_state, + contextualized_node.context, + contextualized_node.node, + second_arg.infer(), + ) for contextualized_node in arguments.get_calling_nodes()) + + +class NewType(Value): + def __init__(self, inference_state, parent_context, tree_node, type_value_set): + super(NewType, self).__init__(inference_state, parent_context) + self._type_value_set = type_value_set + self.tree_node = tree_node + + def py__class__(self): + c, = self._type_value_set.py__class__() + return c + + def py__call__(self, arguments): + return self._type_value_set.execute_annotation() + + @property + def name(self): + from jedi.inference.compiled.value import CompiledValueName + return CompiledValueName(self, 'NewType') + + +class CastFunction(BaseTypingValue): + @repack_with_argument_clinic('type, object, /') + def py__call__(self, type_value_set, object_value_set): + return type_value_set.execute_annotation() + + +class TypedDictClass(BaseTypingValue): + """ + This class has no responsibilities and is just here to make sure that typed + dicts can be identified. + """ + + +class TypedDict(LazyValueWrapper): + """Represents the instance version of ``TypedDictClass``.""" + def __init__(self, definition_class): + self.inference_state = definition_class.inference_state + self.parent_context = definition_class.parent_context + self.tree_node = definition_class.tree_node + self._definition_class = definition_class + + @property + def name(self): + return ValueName(self, self.tree_node.name) + + def py__simple_getitem__(self, index): + if isinstance(index, unicode): + return ValueSet.from_sets( + name.infer() + for filter in self._definition_class.get_filters(is_instance=True) + for name in filter.get(index) + ) + return NO_VALUES + + def get_key_values(self): + filtered_values = itertools.chain.from_iterable(( + f.values() + for f in self._definition_class.get_filters(is_instance=True) + )) + return ValueSet({ + create_simple_object(self.inference_state, v.string_name) + for v in filtered_values + }) + + def _get_wrapped_value(self): + d, = self.inference_state.builtins_module.py__getattribute__('dict') + result, = d.execute_with_values() + return result diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/gradual/utils.py b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/utils.py new file mode 100644 index 00000000..f77b5d77 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/gradual/utils.py @@ -0,0 +1,30 @@ +import os + +from jedi.inference.gradual.typeshed import TYPESHED_PATH, create_stub_module + + +def load_proper_stub_module(inference_state, file_io, import_names, module_node): + """ + This function is given a random .pyi file and should return the proper + module. + """ + path = file_io.path + assert path.endswith('.pyi') + if path.startswith(TYPESHED_PATH): + # /foo/stdlib/3/os/__init__.pyi -> stdlib/3/os/__init__ + rest = path[len(TYPESHED_PATH) + 1: -4] + split_paths = tuple(rest.split(os.path.sep)) + # Remove the stdlib/3 or third_party/3.5 part + import_names = split_paths[2:] + if import_names[-1] == '__init__': + import_names = import_names[:-1] + + if import_names is not None: + actual_value_set = inference_state.import_module(import_names, prefer_stubs=False) + + stub = create_stub_module( + inference_state, actual_value_set, module_node, file_io, import_names + ) + inference_state.stub_module_cache[import_names] = stub + return stub + return None diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/helpers.py b/.venv/lib/python3.8/site-packages/jedi/inference/helpers.py new file mode 100644 index 00000000..3e4d3952 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/helpers.py @@ -0,0 +1,207 @@ +import copy +import sys +import re +import os +from itertools import chain +from contextlib import contextmanager + +from parso.python import tree + +from jedi._compatibility import unicode + + +def is_stdlib_path(path): + # Python standard library paths look like this: + # /usr/lib/python3.5/... + # TODO The implementation below is probably incorrect and not complete. + if 'dist-packages' in path or 'site-packages' in path: + return False + + base_path = os.path.join(sys.prefix, 'lib', 'python') + return bool(re.match(re.escape(base_path) + r'\d.\d', path)) + + +def deep_ast_copy(obj): + """ + Much, much faster than copy.deepcopy, but just for parser tree nodes. + """ + # If it's already in the cache, just return it. + new_obj = copy.copy(obj) + + # Copy children + new_children = [] + for child in obj.children: + if isinstance(child, tree.Leaf): + new_child = copy.copy(child) + new_child.parent = new_obj + else: + new_child = deep_ast_copy(child) + new_child.parent = new_obj + new_children.append(new_child) + new_obj.children = new_children + + return new_obj + + +def infer_call_of_leaf(context, leaf, cut_own_trailer=False): + """ + Creates a "call" node that consist of all ``trailer`` and ``power`` + objects. E.g. if you call it with ``append``:: + + list([]).append(3) or None + + You would get a node with the content ``list([]).append`` back. + + This generates a copy of the original ast node. + + If you're using the leaf, e.g. the bracket `)` it will return ``list([])``. + + We use this function for two purposes. Given an expression ``bar.foo``, + we may want to + - infer the type of ``foo`` to offer completions after foo + - infer the type of ``bar`` to be able to jump to the definition of foo + The option ``cut_own_trailer`` must be set to true for the second purpose. + """ + trailer = leaf.parent + if trailer.type == 'fstring': + from jedi.inference import compiled + return compiled.get_string_value_set(context.inference_state) + + # The leaf may not be the last or first child, because there exist three + # different trailers: `( x )`, `[ x ]` and `.x`. In the first two examples + # we should not match anything more than x. + if trailer.type != 'trailer' or leaf not in (trailer.children[0], trailer.children[-1]): + if leaf == ':': + # Basically happens with foo[:] when the cursor is on the colon + from jedi.inference.base_value import NO_VALUES + return NO_VALUES + if trailer.type == 'atom': + return context.infer_node(trailer) + return context.infer_node(leaf) + + power = trailer.parent + index = power.children.index(trailer) + if cut_own_trailer: + cut = index + else: + cut = index + 1 + + if power.type == 'error_node': + start = index + while True: + start -= 1 + base = power.children[start] + if base.type != 'trailer': + break + trailers = power.children[start + 1:cut] + else: + base = power.children[0] + trailers = power.children[1:cut] + + if base == 'await': + base = trailers[0] + trailers = trailers[1:] + + values = context.infer_node(base) + from jedi.inference.syntax_tree import infer_trailer + for trailer in trailers: + values = infer_trailer(context, values, trailer) + return values + + +def get_names_of_node(node): + try: + children = node.children + except AttributeError: + if node.type == 'name': + return [node] + else: + return [] + else: + return list(chain.from_iterable(get_names_of_node(c) for c in children)) + + +def is_string(value): + if value.inference_state.environment.version_info.major == 2: + str_classes = (unicode, bytes) + else: + str_classes = (unicode,) + return value.is_compiled() and isinstance(value.get_safe_value(default=None), str_classes) + + +def is_literal(value): + return is_number(value) or is_string(value) + + +def _get_safe_value_or_none(value, accept): + value = value.get_safe_value(default=None) + if isinstance(value, accept): + return value + + +def get_int_or_none(value): + return _get_safe_value_or_none(value, int) + + +def get_str_or_none(value): + return _get_safe_value_or_none(value, (bytes, unicode)) + + +def is_number(value): + return _get_safe_value_or_none(value, (int, float)) is not None + + +class SimpleGetItemNotFound(Exception): + pass + + +@contextmanager +def reraise_getitem_errors(*exception_classes): + try: + yield + except exception_classes as e: + raise SimpleGetItemNotFound(e) + + +def parse_dotted_names(nodes, is_import_from, until_node=None): + level = 0 + names = [] + for node in nodes[1:]: + if node in ('.', '...'): + if not names: + level += len(node.value) + elif node.type == 'dotted_name': + for n in node.children[::2]: + names.append(n) + if n is until_node: + break + else: + continue + break + elif node.type == 'name': + names.append(node) + if node is until_node: + break + elif node == ',': + if not is_import_from: + names = [] + else: + # Here if the keyword `import` comes along it stops checking + # for names. + break + return level, names + + +def values_from_qualified_names(inference_state, *names): + return inference_state.import_module(names[:-1]).py__getattribute__(names[-1]) + + +def is_big_annoying_library(context): + string_names = context.get_root_context().string_names + if string_names is None: + return False + + # Especially pandas and tensorflow are huge complicated Python libraries + # that get even slower than they already are when Jedi tries to undrstand + # dynamic features like decorators, ifs and other stuff. + return string_names[0] in ('pandas', 'numpy', 'tensorflow', 'matplotlib') diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/imports.py b/.venv/lib/python3.8/site-packages/jedi/inference/imports.py new file mode 100644 index 00000000..926d05ef --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/imports.py @@ -0,0 +1,563 @@ +""" +:mod:`jedi.inference.imports` is here to resolve import statements and return +the modules/classes/functions/whatever, which they stand for. However there's +not any actual importing done. This module is about finding modules in the +filesystem. This can be quite tricky sometimes, because Python imports are not +always that simple. + +This module uses imp for python up to 3.2 and importlib for python 3.3 on; the +correct implementation is delegated to _compatibility. + +This module also supports import autocompletion, which means to complete +statements like ``from datetim`` (cursor at the end would return ``datetime``). +""" +import os + +from parso.python import tree +from parso.tree import search_ancestor + +from jedi._compatibility import ImplicitNSInfo, force_unicode, FileNotFoundError +from jedi import debug +from jedi import settings +from jedi.file_io import FolderIO +from jedi.parser_utils import get_cached_code_lines +from jedi.inference import sys_path +from jedi.inference import helpers +from jedi.inference import compiled +from jedi.inference import analysis +from jedi.inference.utils import unite +from jedi.inference.cache import inference_state_method_cache +from jedi.inference.names import ImportName, SubModuleName +from jedi.inference.base_value import ValueSet, NO_VALUES +from jedi.inference.gradual.typeshed import import_module_decorator, \ + create_stub_module, parse_stub_module +from jedi.plugins import plugin_manager + + +class ModuleCache(object): + def __init__(self): + self._name_cache = {} + + def add(self, string_names, value_set): + if string_names is not None: + self._name_cache[string_names] = value_set + + def get(self, string_names): + return self._name_cache.get(string_names) + + +# This memoization is needed, because otherwise we will infinitely loop on +# certain imports. +@inference_state_method_cache(default=NO_VALUES) +def infer_import(context, tree_name): + module_context = context.get_root_context() + from_import_name, import_path, level, values = \ + _prepare_infer_import(module_context, tree_name) + if values: + + if from_import_name is not None: + values = values.py__getattribute__( + from_import_name, + name_context=context, + analysis_errors=False + ) + + if not values: + path = import_path + (from_import_name,) + importer = Importer(context.inference_state, path, module_context, level) + values = importer.follow() + debug.dbg('after import: %s', values) + return values + + +@inference_state_method_cache(default=[]) +def goto_import(context, tree_name): + module_context = context.get_root_context() + from_import_name, import_path, level, values = \ + _prepare_infer_import(module_context, tree_name) + if not values: + return [] + + if from_import_name is not None: + names = unite([ + c.goto( + from_import_name, + name_context=context, + analysis_errors=False + ) for c in values + ]) + # Avoid recursion on the same names. + if names and not any(n.tree_name is tree_name for n in names): + return names + + path = import_path + (from_import_name,) + importer = Importer(context.inference_state, path, module_context, level) + values = importer.follow() + return set(s.name for s in values) + + +def _prepare_infer_import(module_context, tree_name): + import_node = search_ancestor(tree_name, 'import_name', 'import_from') + import_path = import_node.get_path_for_name(tree_name) + from_import_name = None + try: + from_names = import_node.get_from_names() + except AttributeError: + # Is an import_name + pass + else: + if len(from_names) + 1 == len(import_path): + # We have to fetch the from_names part first and then check + # if from_names exists in the modules. + from_import_name = import_path[-1] + import_path = from_names + + importer = Importer(module_context.inference_state, tuple(import_path), + module_context, import_node.level) + + return from_import_name, tuple(import_path), import_node.level, importer.follow() + + +def _add_error(value, name, message): + if hasattr(name, 'parent') and value is not None: + analysis.add(value, 'import-error', name, message) + else: + debug.warning('ImportError without origin: ' + message) + + +def _level_to_base_import_path(project_path, directory, level): + """ + In case the level is outside of the currently known package (something like + import .....foo), we can still try our best to help the user for + completions. + """ + for i in range(level - 1): + old = directory + directory = os.path.dirname(directory) + if old == directory: + return None, None + + d = directory + level_import_paths = [] + # Now that we are on the level that the user wants to be, calculate the + # import path for it. + while True: + if d == project_path: + return level_import_paths, d + dir_name = os.path.basename(d) + if dir_name: + level_import_paths.insert(0, dir_name) + d = os.path.dirname(d) + else: + return None, directory + + +class Importer(object): + def __init__(self, inference_state, import_path, module_context, level=0): + """ + An implementation similar to ``__import__``. Use `follow` + to actually follow the imports. + + *level* specifies whether to use absolute or relative imports. 0 (the + default) means only perform absolute imports. Positive values for level + indicate the number of parent directories to search relative to the + directory of the module calling ``__import__()`` (see PEP 328 for the + details). + + :param import_path: List of namespaces (strings or Names). + """ + debug.speed('import %s %s' % (import_path, module_context)) + self._inference_state = inference_state + self.level = level + self._module_context = module_context + + self._fixed_sys_path = None + self._infer_possible = True + if level: + base = module_context.get_value().py__package__() + # We need to care for two cases, the first one is if it's a valid + # Python import. This import has a properly defined module name + # chain like `foo.bar.baz` and an import in baz is made for + # `..lala.` It can then resolve to `foo.bar.lala`. + # The else here is a heuristic for all other cases, if for example + # in `foo` you search for `...bar`, it's obviously out of scope. + # However since Jedi tries to just do it's best, we help the user + # here, because he might have specified something wrong in his + # project. + if level <= len(base): + # Here we basically rewrite the level to 0. + base = tuple(base) + if level > 1: + base = base[:-level + 1] + import_path = base + tuple(import_path) + else: + path = module_context.py__file__() + project_path = self._inference_state.project._path + import_path = list(import_path) + if path is None: + # If no path is defined, our best guess is that the current + # file is edited by a user on the current working + # directory. We need to add an initial path, because it + # will get removed as the name of the current file. + directory = project_path + else: + directory = os.path.dirname(path) + + base_import_path, base_directory = _level_to_base_import_path( + project_path, directory, level, + ) + if base_directory is None: + # Everything is lost, the relative import does point + # somewhere out of the filesystem. + self._infer_possible = False + else: + self._fixed_sys_path = [force_unicode(base_directory)] + + if base_import_path is None: + if import_path: + _add_error( + module_context, import_path[0], + message='Attempted relative import beyond top-level package.' + ) + else: + import_path = base_import_path + import_path + self.import_path = import_path + + @property + def _str_import_path(self): + """Returns the import path as pure strings instead of `Name`.""" + return tuple( + name.value if isinstance(name, tree.Name) else name + for name in self.import_path + ) + + def _sys_path_with_modifications(self, is_completion): + if self._fixed_sys_path is not None: + return self._fixed_sys_path + + return ( + # For import completions we don't want to see init paths, but for + # inference we want to show the user as much as possible. + # See GH #1446. + self._inference_state.get_sys_path(add_init_paths=not is_completion) + + sys_path.check_sys_path_modifications(self._module_context) + ) + + def follow(self): + if not self.import_path or not self._infer_possible: + return NO_VALUES + + # Check caches first + from_cache = self._inference_state.stub_module_cache.get(self._str_import_path) + if from_cache is not None: + return ValueSet({from_cache}) + from_cache = self._inference_state.module_cache.get(self._str_import_path) + if from_cache is not None: + return from_cache + + sys_path = self._sys_path_with_modifications(is_completion=False) + + return import_module_by_names( + self._inference_state, self.import_path, sys_path, self._module_context + ) + + def _get_module_names(self, search_path=None, in_module=None): + """ + Get the names of all modules in the search_path. This means file names + and not names defined in the files. + """ + if search_path is None: + sys_path = self._sys_path_with_modifications(is_completion=True) + else: + sys_path = search_path + return list(iter_module_names( + self._inference_state, self._module_context, sys_path, + module_cls=ImportName if in_module is None else SubModuleName, + add_builtin_modules=search_path is None and in_module is None, + )) + + def completion_names(self, inference_state, only_modules=False): + """ + :param only_modules: Indicates wheter it's possible to import a + definition that is not defined in a module. + """ + if not self._infer_possible: + return [] + + names = [] + if self.import_path: + # flask + if self._str_import_path == ('flask', 'ext'): + # List Flask extensions like ``flask_foo`` + for mod in self._get_module_names(): + modname = mod.string_name + if modname.startswith('flask_'): + extname = modname[len('flask_'):] + names.append(ImportName(self._module_context, extname)) + # Now the old style: ``flaskext.foo`` + for dir in self._sys_path_with_modifications(is_completion=True): + flaskext = os.path.join(dir, 'flaskext') + if os.path.isdir(flaskext): + names += self._get_module_names([flaskext]) + + values = self.follow() + for value in values: + # Non-modules are not completable. + if value.api_type != 'module': # not a module + continue + if not value.is_compiled(): + # sub_modules_dict is not implemented for compiled modules. + names += value.sub_modules_dict().values() + + if not only_modules: + from jedi.inference.gradual.conversion import convert_values + + both_values = values | convert_values(values) + for c in both_values: + for filter in c.get_filters(): + names += filter.values() + else: + if self.level: + # We only get here if the level cannot be properly calculated. + names += self._get_module_names(self._fixed_sys_path) + else: + # This is just the list of global imports. + names += self._get_module_names() + return names + + +def import_module_by_names(inference_state, import_names, sys_path=None, + module_context=None, prefer_stubs=True): + if sys_path is None: + sys_path = inference_state.get_sys_path() + + str_import_names = tuple( + force_unicode(i.value if isinstance(i, tree.Name) else i) + for i in import_names + ) + value_set = [None] + for i, name in enumerate(import_names): + value_set = ValueSet.from_sets([ + import_module( + inference_state, + str_import_names[:i+1], + parent_module_value, + sys_path, + prefer_stubs=prefer_stubs, + ) for parent_module_value in value_set + ]) + if not value_set: + message = 'No module named ' + '.'.join(str_import_names) + if module_context is not None: + _add_error(module_context, name, message) + else: + debug.warning(message) + return NO_VALUES + return value_set + + +@plugin_manager.decorate() +@import_module_decorator +def import_module(inference_state, import_names, parent_module_value, sys_path): + """ + This method is very similar to importlib's `_gcd_import`. + """ + if import_names[0] in settings.auto_import_modules: + module = _load_builtin_module(inference_state, import_names, sys_path) + if module is None: + return NO_VALUES + return ValueSet([module]) + + module_name = '.'.join(import_names) + if parent_module_value is None: + # Override the sys.path. It works only good that way. + # Injecting the path directly into `find_module` did not work. + file_io_or_ns, is_pkg = inference_state.compiled_subprocess.get_module_info( + string=import_names[-1], + full_name=module_name, + sys_path=sys_path, + is_global_search=True, + ) + if is_pkg is None: + return NO_VALUES + else: + paths = parent_module_value.py__path__() + if paths is None: + # The module might not be a package. + return NO_VALUES + + for path in paths: + # At the moment we are only using one path. So this is + # not important to be correct. + if not isinstance(path, list): + path = [path] + file_io_or_ns, is_pkg = inference_state.compiled_subprocess.get_module_info( + string=import_names[-1], + path=path, + full_name=module_name, + is_global_search=False, + ) + if is_pkg is not None: + break + else: + return NO_VALUES + + if isinstance(file_io_or_ns, ImplicitNSInfo): + from jedi.inference.value.namespace import ImplicitNamespaceValue + module = ImplicitNamespaceValue( + inference_state, + string_names=tuple(file_io_or_ns.name.split('.')), + paths=file_io_or_ns.paths, + ) + elif file_io_or_ns is None: + module = _load_builtin_module(inference_state, import_names, sys_path) + if module is None: + return NO_VALUES + else: + module = _load_python_module( + inference_state, file_io_or_ns, + import_names=import_names, + is_package=is_pkg, + ) + + if parent_module_value is None: + debug.dbg('global search_module %s: %s', import_names[-1], module) + else: + debug.dbg('search_module %s in paths %s: %s', module_name, paths, module) + return ValueSet([module]) + + +def _load_python_module(inference_state, file_io, + import_names=None, is_package=False): + module_node = inference_state.parse( + file_io=file_io, + cache=True, + diff_cache=settings.fast_parser, + cache_path=settings.cache_directory, + ) + + from jedi.inference.value import ModuleValue + return ModuleValue( + inference_state, module_node, + file_io=file_io, + string_names=import_names, + code_lines=get_cached_code_lines(inference_state.grammar, file_io.path), + is_package=is_package, + ) + + +def _load_builtin_module(inference_state, import_names=None, sys_path=None): + project = inference_state.project + if sys_path is None: + sys_path = inference_state.get_sys_path() + if not project._load_unsafe_extensions: + safe_paths = project._get_base_sys_path(inference_state) + sys_path = [p for p in sys_path if p in safe_paths] + + dotted_name = '.'.join(import_names) + assert dotted_name is not None + module = compiled.load_module(inference_state, dotted_name=dotted_name, sys_path=sys_path) + if module is None: + # The file might raise an ImportError e.g. and therefore not be + # importable. + return None + return module + + +def load_module_from_path(inference_state, file_io, import_names=None, is_package=None): + """ + This should pretty much only be used for get_modules_containing_name. It's + here to ensure that a random path is still properly loaded into the Jedi + module structure. + """ + path = file_io.path + if import_names is None: + e_sys_path = inference_state.get_sys_path() + import_names, is_package = sys_path.transform_path_to_dotted(e_sys_path, path) + else: + assert isinstance(is_package, bool) + + is_stub = file_io.path.endswith('.pyi') + if is_stub: + folder_io = file_io.get_parent_folder() + if folder_io.path.endswith('-stubs'): + folder_io = FolderIO(folder_io.path[:-6]) + if file_io.path.endswith('__init__.pyi'): + python_file_io = folder_io.get_file_io('__init__.py') + else: + python_file_io = folder_io.get_file_io(import_names[-1] + '.py') + + try: + v = load_module_from_path( + inference_state, python_file_io, + import_names, is_package=is_package + ) + values = ValueSet([v]) + except FileNotFoundError: + values = NO_VALUES + + return create_stub_module( + inference_state, values, parse_stub_module(inference_state, file_io), + file_io, import_names + ) + else: + module = _load_python_module( + inference_state, file_io, + import_names=import_names, + is_package=is_package, + ) + inference_state.module_cache.add(import_names, ValueSet([module])) + return module + + +def load_namespace_from_path(inference_state, folder_io): + import_names, is_package = sys_path.transform_path_to_dotted( + inference_state.get_sys_path(), + folder_io.path + ) + from jedi.inference.value.namespace import ImplicitNamespaceValue + return ImplicitNamespaceValue(inference_state, import_names, [folder_io.path]) + + +def follow_error_node_imports_if_possible(context, name): + error_node = tree.search_ancestor(name, 'error_node') + if error_node is not None: + # Get the first command start of a started simple_stmt. The error + # node is sometimes a small_stmt and sometimes a simple_stmt. Check + # for ; leaves that start a new statements. + start_index = 0 + for index, n in enumerate(error_node.children): + if n.start_pos > name.start_pos: + break + if n == ';': + start_index = index + 1 + nodes = error_node.children[start_index:] + first_name = nodes[0].get_first_leaf().value + + # Make it possible to infer stuff like `import foo.` or + # `from foo.bar`. + if first_name in ('from', 'import'): + is_import_from = first_name == 'from' + level, names = helpers.parse_dotted_names( + nodes, + is_import_from=is_import_from, + until_node=name, + ) + return Importer( + context.inference_state, names, context.get_root_context(), level).follow() + return None + + +def iter_module_names(inference_state, module_context, search_path, + module_cls=ImportName, add_builtin_modules=True): + """ + Get the names of all modules in the search_path. This means file names + and not names defined in the files. + """ + # add builtin module names + if add_builtin_modules: + for name in inference_state.compiled_subprocess.get_builtin_module_names(): + yield module_cls(module_context, name) + + for name in inference_state.compiled_subprocess.iter_module_names(search_path): + yield module_cls(module_context, name) diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/lazy_value.py b/.venv/lib/python3.8/site-packages/jedi/inference/lazy_value.py new file mode 100644 index 00000000..c7c22a91 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/lazy_value.py @@ -0,0 +1,61 @@ +from jedi.inference.base_value import ValueSet, NO_VALUES +from jedi.common import monkeypatch + + +class AbstractLazyValue(object): + def __init__(self, data, min=1, max=1): + self.data = data + self.min = min + self.max = max + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.data) + + def infer(self): + raise NotImplementedError + + +class LazyKnownValue(AbstractLazyValue): + """data is a Value.""" + def infer(self): + return ValueSet([self.data]) + + +class LazyKnownValues(AbstractLazyValue): + """data is a ValueSet.""" + def infer(self): + return self.data + + +class LazyUnknownValue(AbstractLazyValue): + def __init__(self, min=1, max=1): + super(LazyUnknownValue, self).__init__(None, min, max) + + def infer(self): + return NO_VALUES + + +class LazyTreeValue(AbstractLazyValue): + def __init__(self, context, node, min=1, max=1): + super(LazyTreeValue, self).__init__(node, min, max) + self.context = context + # We need to save the predefined names. It's an unfortunate side effect + # that needs to be tracked otherwise results will be wrong. + self._predefined_names = dict(context.predefined_names) + + def infer(self): + with monkeypatch(self.context, 'predefined_names', self._predefined_names): + return self.context.infer_node(self.data) + + +def get_merged_lazy_value(lazy_values): + if len(lazy_values) > 1: + return MergedLazyValues(lazy_values) + else: + return lazy_values[0] + + +class MergedLazyValues(AbstractLazyValue): + """data is a list of lazy values.""" + def infer(self): + return ValueSet.from_sets(l.infer() for l in self.data) diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/names.py b/.venv/lib/python3.8/site-packages/jedi/inference/names.py new file mode 100644 index 00000000..ccf42d4c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/names.py @@ -0,0 +1,660 @@ +from abc import abstractmethod + +from parso.tree import search_ancestor + +from jedi._compatibility import Parameter +from jedi.parser_utils import find_statement_documentation, clean_scope_docstring +from jedi.inference.utils import unite +from jedi.inference.base_value import ValueSet, NO_VALUES +from jedi.inference import docstrings +from jedi.cache import memoize_method +from jedi.inference.helpers import deep_ast_copy, infer_call_of_leaf +from jedi.plugins import plugin_manager + + +def _merge_name_docs(names): + doc = '' + for name in names: + if doc: + # In case we have multiple values, just return all of them + # separated by a few dashes. + doc += '\n' + '-' * 30 + '\n' + doc += name.py__doc__() + return doc + + +class AbstractNameDefinition(object): + start_pos = None + string_name = None + parent_context = None + tree_name = None + is_value_name = True + """ + Used for the Jedi API to know if it's a keyword or an actual name. + """ + + @abstractmethod + def infer(self): + raise NotImplementedError + + @abstractmethod + def goto(self): + # Typically names are already definitions and therefore a goto on that + # name will always result on itself. + return {self} + + def get_qualified_names(self, include_module_names=False): + qualified_names = self._get_qualified_names() + if qualified_names is None or not include_module_names: + return qualified_names + + module_names = self.get_root_context().string_names + if module_names is None: + return None + return module_names + qualified_names + + def _get_qualified_names(self): + # By default, a name has no qualified names. + return None + + def get_root_context(self): + return self.parent_context.get_root_context() + + def get_public_name(self): + return self.string_name + + def __repr__(self): + if self.start_pos is None: + return '<%s: string_name=%s>' % (self.__class__.__name__, self.string_name) + return '<%s: string_name=%s start_pos=%s>' % (self.__class__.__name__, + self.string_name, self.start_pos) + + def is_import(self): + return False + + def py__doc__(self): + return '' + + @property + def api_type(self): + return self.parent_context.api_type + + def get_defining_qualified_value(self): + """ + Returns either None or the value that is public and qualified. Won't + return a function, because a name in a function is never public. + """ + return None + + +class AbstractArbitraryName(AbstractNameDefinition): + """ + When you e.g. want to complete dicts keys, you probably want to complete + string literals, which is not really a name, but for Jedi we use this + concept of Name for completions as well. + """ + is_value_name = False + + def __init__(self, inference_state, string): + self.inference_state = inference_state + self.string_name = string + self.parent_context = inference_state.builtins_module + + def infer(self): + return NO_VALUES + + +class AbstractTreeName(AbstractNameDefinition): + def __init__(self, parent_context, tree_name): + self.parent_context = parent_context + self.tree_name = tree_name + + def get_qualified_names(self, include_module_names=False): + import_node = search_ancestor(self.tree_name, 'import_name', 'import_from') + # For import nodes we cannot just have names, because it's very unclear + # how they would look like. For now we just ignore them in most cases. + # In case of level == 1, it works always, because it's like a submodule + # lookup. + if import_node is not None and not (import_node.level == 1 + and self.get_root_context().get_value().is_package()): + # TODO improve the situation for when level is present. + if include_module_names and not import_node.level: + return tuple(n.value for n in import_node.get_path_for_name(self.tree_name)) + else: + return None + + return super(AbstractTreeName, self).get_qualified_names(include_module_names) + + def _get_qualified_names(self): + parent_names = self.parent_context.get_qualified_names() + if parent_names is None: + return None + return parent_names + (self.tree_name.value,) + + def get_defining_qualified_value(self): + if self.is_import(): + raise NotImplementedError("Shouldn't really happen, please report") + elif self.parent_context: + return self.parent_context.get_value() # Might be None + return None + + def goto(self): + context = self.parent_context + name = self.tree_name + definition = name.get_definition(import_name_always=True) + if definition is not None: + type_ = definition.type + if type_ == 'expr_stmt': + # Only take the parent, because if it's more complicated than just + # a name it's something you can "goto" again. + is_simple_name = name.parent.type not in ('power', 'trailer') + if is_simple_name: + return [self] + elif type_ in ('import_from', 'import_name'): + from jedi.inference.imports import goto_import + module_names = goto_import(context, name) + return module_names + else: + return [self] + else: + from jedi.inference.imports import follow_error_node_imports_if_possible + values = follow_error_node_imports_if_possible(context, name) + if values is not None: + return [value.name for value in values] + + par = name.parent + node_type = par.type + if node_type == 'argument' and par.children[1] == '=' and par.children[0] == name: + # Named param goto. + trailer = par.parent + if trailer.type == 'arglist': + trailer = trailer.parent + if trailer.type != 'classdef': + if trailer.type == 'decorator': + value_set = context.infer_node(trailer.children[1]) + else: + i = trailer.parent.children.index(trailer) + to_infer = trailer.parent.children[:i] + if to_infer[0] == 'await': + to_infer.pop(0) + value_set = context.infer_node(to_infer[0]) + from jedi.inference.syntax_tree import infer_trailer + for trailer in to_infer[1:]: + value_set = infer_trailer(context, value_set, trailer) + param_names = [] + for value in value_set: + for signature in value.get_signatures(): + for param_name in signature.get_param_names(): + if param_name.string_name == name.value: + param_names.append(param_name) + return param_names + elif node_type == 'dotted_name': # Is a decorator. + index = par.children.index(name) + if index > 0: + new_dotted = deep_ast_copy(par) + new_dotted.children[index - 1:] = [] + values = context.infer_node(new_dotted) + return unite( + value.goto(name, name_context=context) + for value in values + ) + + if node_type == 'trailer' and par.children[0] == '.': + values = infer_call_of_leaf(context, name, cut_own_trailer=True) + return values.goto(name, name_context=context) + else: + stmt = search_ancestor( + name, 'expr_stmt', 'lambdef' + ) or name + if stmt.type == 'lambdef': + stmt = name + return context.goto(name, position=stmt.start_pos) + + def is_import(self): + imp = search_ancestor(self.tree_name, 'import_from', 'import_name') + return imp is not None + + @property + def string_name(self): + return self.tree_name.value + + @property + def start_pos(self): + return self.tree_name.start_pos + + +class ValueNameMixin(object): + def infer(self): + return ValueSet([self._value]) + + def py__doc__(self): + doc = self._value.py__doc__() + if not doc and self._value.is_stub(): + from jedi.inference.gradual.conversion import convert_names + names = convert_names([self], prefer_stub_to_compiled=False) + if self not in names: + return _merge_name_docs(names) + return doc + + def _get_qualified_names(self): + return self._value.get_qualified_names() + + def get_root_context(self): + if self.parent_context is None: # A module + return self._value.as_context() + return super(ValueNameMixin, self).get_root_context() + + def get_defining_qualified_value(self): + context = self.parent_context + if context.is_module() or context.is_class(): + return self.parent_context.get_value() # Might be None + return None + + @property + def api_type(self): + return self._value.api_type + + +class ValueName(ValueNameMixin, AbstractTreeName): + def __init__(self, value, tree_name): + super(ValueName, self).__init__(value.parent_context, tree_name) + self._value = value + + def goto(self): + return ValueSet([self._value.name]) + + +class TreeNameDefinition(AbstractTreeName): + _API_TYPES = dict( + import_name='module', + import_from='module', + funcdef='function', + param='param', + classdef='class', + ) + + def infer(self): + # Refactor this, should probably be here. + from jedi.inference.syntax_tree import tree_name_to_values + return tree_name_to_values( + self.parent_context.inference_state, + self.parent_context, + self.tree_name + ) + + @property + def api_type(self): + definition = self.tree_name.get_definition(import_name_always=True) + if definition is None: + return 'statement' + return self._API_TYPES.get(definition.type, 'statement') + + def assignment_indexes(self): + """ + Returns an array of tuple(int, node) of the indexes that are used in + tuple assignments. + + For example if the name is ``y`` in the following code:: + + x, (y, z) = 2, '' + + would result in ``[(1, xyz_node), (0, yz_node)]``. + + When searching for b in the case ``a, *b, c = [...]`` it will return:: + + [(slice(1, -1), abc_node)] + """ + indexes = [] + is_star_expr = False + node = self.tree_name.parent + compare = self.tree_name + while node is not None: + if node.type in ('testlist', 'testlist_comp', 'testlist_star_expr', 'exprlist'): + for i, child in enumerate(node.children): + if child == compare: + index = int(i / 2) + if is_star_expr: + from_end = int((len(node.children) - i) / 2) + index = slice(index, -from_end) + indexes.insert(0, (index, node)) + break + else: + raise LookupError("Couldn't find the assignment.") + is_star_expr = False + elif node.type == 'star_expr': + is_star_expr = True + elif node.type in ('expr_stmt', 'sync_comp_for'): + break + + compare = node + node = node.parent + return indexes + + def py__doc__(self): + api_type = self.api_type + if api_type in ('function', 'class'): + # Make sure the names are not TreeNameDefinitions anymore. + return clean_scope_docstring(self.tree_name.get_definition()) + + if api_type == 'module': + names = self.goto() + if self not in names: + return _merge_name_docs(names) + + if api_type == 'statement' and self.tree_name.is_definition(): + return find_statement_documentation(self.tree_name.get_definition()) + return '' + + +class _ParamMixin(object): + def maybe_positional_argument(self, include_star=True): + options = [Parameter.POSITIONAL_ONLY, Parameter.POSITIONAL_OR_KEYWORD] + if include_star: + options.append(Parameter.VAR_POSITIONAL) + return self.get_kind() in options + + def maybe_keyword_argument(self, include_stars=True): + options = [Parameter.KEYWORD_ONLY, Parameter.POSITIONAL_OR_KEYWORD] + if include_stars: + options.append(Parameter.VAR_KEYWORD) + return self.get_kind() in options + + def _kind_string(self): + kind = self.get_kind() + if kind == Parameter.VAR_POSITIONAL: # *args + return '*' + if kind == Parameter.VAR_KEYWORD: # **kwargs + return '**' + return '' + + def get_qualified_names(self, include_module_names=False): + return None + + +class ParamNameInterface(_ParamMixin): + api_type = u'param' + + def get_kind(self): + raise NotImplementedError + + def to_string(self): + raise NotImplementedError + + def get_executed_param_name(self): + """ + For dealing with type inference and working around the graph, we + sometimes want to have the param name of the execution. This feels a + bit strange and we might have to refactor at some point. + + For now however it exists to avoid infering params when we don't really + need them (e.g. when we can just instead use annotations. + """ + return None + + @property + def star_count(self): + kind = self.get_kind() + if kind == Parameter.VAR_POSITIONAL: + return 1 + if kind == Parameter.VAR_KEYWORD: + return 2 + return 0 + + +class BaseTreeParamName(ParamNameInterface, AbstractTreeName): + annotation_node = None + default_node = None + + def to_string(self): + output = self._kind_string() + self.get_public_name() + annotation = self.annotation_node + default = self.default_node + if annotation is not None: + output += ': ' + annotation.get_code(include_prefix=False) + if default is not None: + output += '=' + default.get_code(include_prefix=False) + return output + + def get_public_name(self): + name = self.string_name + if name.startswith('__'): + # Params starting with __ are an equivalent to positional only + # variables in typeshed. + name = name[2:] + return name + + def goto(self, **kwargs): + return [self] + + +class _ActualTreeParamName(BaseTreeParamName): + def __init__(self, function_value, tree_name): + super(_ActualTreeParamName, self).__init__( + function_value.get_default_param_context(), tree_name) + self.function_value = function_value + + def _get_param_node(self): + return search_ancestor(self.tree_name, 'param') + + @property + def annotation_node(self): + return self._get_param_node().annotation + + def infer_annotation(self, execute_annotation=True, ignore_stars=False): + from jedi.inference.gradual.annotation import infer_param + values = infer_param( + self.function_value, self._get_param_node(), + ignore_stars=ignore_stars) + if execute_annotation: + values = values.execute_annotation() + return values + + def infer_default(self): + node = self.default_node + if node is None: + return NO_VALUES + return self.parent_context.infer_node(node) + + @property + def default_node(self): + return self._get_param_node().default + + def get_kind(self): + tree_param = self._get_param_node() + if tree_param.star_count == 1: # *args + return Parameter.VAR_POSITIONAL + if tree_param.star_count == 2: # **kwargs + return Parameter.VAR_KEYWORD + + # Params starting with __ are an equivalent to positional only + # variables in typeshed. + if tree_param.name.value.startswith('__'): + return Parameter.POSITIONAL_ONLY + + parent = tree_param.parent + param_appeared = False + for p in parent.children: + if param_appeared: + if p == '/': + return Parameter.POSITIONAL_ONLY + else: + if p == '*': + return Parameter.KEYWORD_ONLY + if p.type == 'param': + if p.star_count: + return Parameter.KEYWORD_ONLY + if p == tree_param: + param_appeared = True + return Parameter.POSITIONAL_OR_KEYWORD + + def infer(self): + values = self.infer_annotation() + if values: + return values + + doc_params = docstrings.infer_param(self.function_value, self._get_param_node()) + return doc_params + + +class AnonymousParamName(_ActualTreeParamName): + @plugin_manager.decorate(name='goto_anonymous_param') + def goto(self): + return super(AnonymousParamName, self).goto() + + @plugin_manager.decorate(name='infer_anonymous_param') + def infer(self): + values = super(AnonymousParamName, self).infer() + if values: + return values + from jedi.inference.dynamic_params import dynamic_param_lookup + param = self._get_param_node() + values = dynamic_param_lookup(self.function_value, param.position_index) + if values: + return values + + if param.star_count == 1: + from jedi.inference.value.iterable import FakeTuple + value = FakeTuple(self.function_value.inference_state, []) + elif param.star_count == 2: + from jedi.inference.value.iterable import FakeDict + value = FakeDict(self.function_value.inference_state, {}) + elif param.default is None: + return NO_VALUES + else: + return self.function_value.parent_context.infer_node(param.default) + return ValueSet({value}) + + +class ParamName(_ActualTreeParamName): + def __init__(self, function_value, tree_name, arguments): + super(ParamName, self).__init__(function_value, tree_name) + self.arguments = arguments + + def infer(self): + values = super(ParamName, self).infer() + if values: + return values + + return self.get_executed_param_name().infer() + + def get_executed_param_name(self): + from jedi.inference.param import get_executed_param_names + params_names = get_executed_param_names(self.function_value, self.arguments) + return params_names[self._get_param_node().position_index] + + +class ParamNameWrapper(_ParamMixin): + def __init__(self, param_name): + self._wrapped_param_name = param_name + + def __getattr__(self, name): + return getattr(self._wrapped_param_name, name) + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._wrapped_param_name) + + +class ImportName(AbstractNameDefinition): + start_pos = (1, 0) + _level = 0 + + def __init__(self, parent_context, string_name): + self._from_module_context = parent_context + self.string_name = string_name + + def get_qualified_names(self, include_module_names=False): + if include_module_names: + if self._level: + assert self._level == 1, "Everything else is not supported for now" + module_names = self._from_module_context.string_names + if module_names is None: + return module_names + return module_names + (self.string_name,) + return (self.string_name,) + return () + + @property + def parent_context(self): + m = self._from_module_context + import_values = self.infer() + if not import_values: + return m + # It's almost always possible to find the import or to not find it. The + # importing returns only one value, pretty much always. + return next(iter(import_values)).as_context() + + @memoize_method + def infer(self): + from jedi.inference.imports import Importer + m = self._from_module_context + return Importer(m.inference_state, [self.string_name], m, level=self._level).follow() + + def goto(self): + return [m.name for m in self.infer()] + + @property + def api_type(self): + return 'module' + + def py__doc__(self): + return _merge_name_docs(self.goto()) + + +class SubModuleName(ImportName): + _level = 1 + + +class NameWrapper(object): + def __init__(self, wrapped_name): + self._wrapped_name = wrapped_name + + def __getattr__(self, name): + return getattr(self._wrapped_name, name) + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self._wrapped_name) + + +class StubNameMixin(object): + def py__doc__(self): + from jedi.inference.gradual.conversion import convert_names + # Stubs are not complicated and we can just follow simple statements + # that have an equals in them, because they typically make something + # else public. See e.g. stubs for `requests`. + names = [self] + if self.api_type == 'statement' and '=' in self.tree_name.get_definition().children: + names = [v.name for v in self.infer()] + + names = convert_names(names, prefer_stub_to_compiled=False) + if self in names: + return super(StubNameMixin, self).py__doc__() + else: + # We have signatures ourselves in stubs, so don't use signatures + # from the implementation. + return _merge_name_docs(names) + + +# From here on down we make looking up the sys.version_info fast. +class StubName(StubNameMixin, TreeNameDefinition): + def infer(self): + inferred = super(StubName, self).infer() + if self.string_name == 'version_info' and self.get_root_context().py__name__() == 'sys': + from jedi.inference.gradual.stub_value import VersionInfo + return ValueSet(VersionInfo(c) for c in inferred) + return inferred + + +class ModuleName(ValueNameMixin, AbstractNameDefinition): + start_pos = 1, 0 + + def __init__(self, value, name): + self._value = value + self._name = name + + @property + def string_name(self): + return self._name + + +class StubModuleName(StubNameMixin, ModuleName): + pass diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/param.py b/.venv/lib/python3.8/site-packages/jedi/inference/param.py new file mode 100644 index 00000000..c1ce541a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/param.py @@ -0,0 +1,258 @@ +from collections import defaultdict + +from jedi import debug +from jedi.inference.utils import PushBackIterator +from jedi.inference import analysis +from jedi.inference.lazy_value import LazyKnownValue, \ + LazyTreeValue, LazyUnknownValue +from jedi.inference.value import iterable +from jedi._compatibility import Parameter +from jedi.inference.names import ParamName + + +def _add_argument_issue(error_name, lazy_value, message): + if isinstance(lazy_value, LazyTreeValue): + node = lazy_value.data + if node.parent.type == 'argument': + node = node.parent + return analysis.add(lazy_value.context, error_name, node, message) + + +class ExecutedParamName(ParamName): + def __init__(self, function_value, arguments, param_node, lazy_value, is_default=False): + super(ExecutedParamName, self).__init__( + function_value, param_node.name, arguments=arguments) + self._lazy_value = lazy_value + self._is_default = is_default + + def infer(self): + return self._lazy_value.infer() + + def matches_signature(self): + if self._is_default: + return True + argument_values = self.infer().py__class__() + if self.get_kind() in (Parameter.VAR_POSITIONAL, Parameter.VAR_KEYWORD): + return True + annotations = self.infer_annotation(execute_annotation=False) + if not annotations: + # If we cannot infer annotations - or there aren't any - pretend + # that the signature matches. + return True + matches = any(c1.is_sub_class_of(c2) + for c1 in argument_values + for c2 in annotations.gather_annotation_classes()) + debug.dbg("param compare %s: %s <=> %s", + matches, argument_values, annotations, color='BLUE') + return matches + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.string_name) + + +def get_executed_param_names_and_issues(function_value, arguments): + """ + Return a tuple of: + - a list of `ExecutedParamName`s corresponding to the arguments of the + function execution `function_value`, containing the inferred value of + those arguments (whether explicit or default) + - a list of the issues encountered while building that list + + For example, given: + ``` + def foo(a, b, c=None, d='d'): ... + + foo(42, c='c') + ``` + + Then for the execution of `foo`, this will return a tuple containing: + - a list with entries for each parameter a, b, c & d; the entries for a, + c, & d will have their values (42, 'c' and 'd' respectively) included. + - a list with a single entry about the lack of a value for `b` + """ + def too_many_args(argument): + m = _error_argument_count(funcdef, len(unpacked_va)) + # Just report an error for the first param that is not needed (like + # cPython). + if arguments.get_calling_nodes(): + # There might not be a valid calling node so check for that first. + issues.append( + _add_argument_issue( + 'type-error-too-many-arguments', + argument, + message=m + ) + ) + else: + issues.append(None) + debug.warning('non-public warning: %s', m) + + issues = [] # List[Optional[analysis issue]] + result_params = [] + param_dict = {} + funcdef = function_value.tree_node + # Default params are part of the value where the function was defined. + # This means that they might have access on class variables that the + # function itself doesn't have. + default_param_context = function_value.get_default_param_context() + + for param in funcdef.get_params(): + param_dict[param.name.value] = param + unpacked_va = list(arguments.unpack(funcdef)) + var_arg_iterator = PushBackIterator(iter(unpacked_va)) + + non_matching_keys = defaultdict(lambda: []) + keys_used = {} + keys_only = False + had_multiple_value_error = False + for param in funcdef.get_params(): + # The value and key can both be null. There, the defaults apply. + # args / kwargs will just be empty arrays / dicts, respectively. + # Wrong value count is just ignored. If you try to test cases that are + # not allowed in Python, Jedi will maybe not show any completions. + is_default = False + key, argument = next(var_arg_iterator, (None, None)) + while key is not None: + keys_only = True + try: + key_param = param_dict[key] + except KeyError: + non_matching_keys[key] = argument + else: + if key in keys_used: + had_multiple_value_error = True + m = ("TypeError: %s() got multiple values for keyword argument '%s'." + % (funcdef.name, key)) + for contextualized_node in arguments.get_calling_nodes(): + issues.append( + analysis.add(contextualized_node.context, + 'type-error-multiple-values', + contextualized_node.node, message=m) + ) + else: + keys_used[key] = ExecutedParamName( + function_value, arguments, key_param, argument) + key, argument = next(var_arg_iterator, (None, None)) + + try: + result_params.append(keys_used[param.name.value]) + continue + except KeyError: + pass + + if param.star_count == 1: + # *args param + lazy_value_list = [] + if argument is not None: + lazy_value_list.append(argument) + for key, argument in var_arg_iterator: + # Iterate until a key argument is found. + if key: + var_arg_iterator.push_back((key, argument)) + break + lazy_value_list.append(argument) + seq = iterable.FakeTuple(function_value.inference_state, lazy_value_list) + result_arg = LazyKnownValue(seq) + elif param.star_count == 2: + if argument is not None: + too_many_args(argument) + # **kwargs param + dct = iterable.FakeDict(function_value.inference_state, dict(non_matching_keys)) + result_arg = LazyKnownValue(dct) + non_matching_keys = {} + else: + # normal param + if argument is None: + # No value: Return an empty container + if param.default is None: + result_arg = LazyUnknownValue() + if not keys_only: + for contextualized_node in arguments.get_calling_nodes(): + m = _error_argument_count(funcdef, len(unpacked_va)) + issues.append( + analysis.add( + contextualized_node.context, + 'type-error-too-few-arguments', + contextualized_node.node, + message=m, + ) + ) + else: + result_arg = LazyTreeValue(default_param_context, param.default) + is_default = True + else: + result_arg = argument + + result_params.append(ExecutedParamName( + function_value, arguments, param, result_arg, is_default=is_default + )) + if not isinstance(result_arg, LazyUnknownValue): + keys_used[param.name.value] = result_params[-1] + + if keys_only: + # All arguments should be handed over to the next function. It's not + # about the values inside, it's about the names. Jedi needs to now that + # there's nothing to find for certain names. + for k in set(param_dict) - set(keys_used): + param = param_dict[k] + + if not (non_matching_keys or had_multiple_value_error + or param.star_count or param.default): + # add a warning only if there's not another one. + for contextualized_node in arguments.get_calling_nodes(): + m = _error_argument_count(funcdef, len(unpacked_va)) + issues.append( + analysis.add(contextualized_node.context, + 'type-error-too-few-arguments', + contextualized_node.node, message=m) + ) + + for key, lazy_value in non_matching_keys.items(): + m = "TypeError: %s() got an unexpected keyword argument '%s'." \ + % (funcdef.name, key) + issues.append( + _add_argument_issue( + 'type-error-keyword-argument', + lazy_value, + message=m + ) + ) + + remaining_arguments = list(var_arg_iterator) + if remaining_arguments: + first_key, lazy_value = remaining_arguments[0] + too_many_args(lazy_value) + return result_params, issues + + +def get_executed_param_names(function_value, arguments): + """ + Return a list of `ExecutedParamName`s corresponding to the arguments of the + function execution `function_value`, containing the inferred value of those + arguments (whether explicit or default). Any issues building this list (for + example required arguments which are missing in the invocation) are ignored. + + For example, given: + ``` + def foo(a, b, c=None, d='d'): ... + + foo(42, c='c') + ``` + + Then for the execution of `foo`, this will return a list containing entries + for each parameter a, b, c & d; the entries for a, c, & d will have their + values (42, 'c' and 'd' respectively) included. + """ + return get_executed_param_names_and_issues(function_value, arguments)[0] + + +def _error_argument_count(funcdef, actual_count): + params = funcdef.get_params() + default_arguments = sum(1 for p in params if p.default or p.star_count) + + if default_arguments == 0: + before = 'exactly ' + else: + before = 'from %s to ' % (len(params) - default_arguments) + return ('TypeError: %s() takes %s%s arguments (%s given).' + % (funcdef.name, before, len(params), actual_count)) diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/parser_cache.py b/.venv/lib/python3.8/site-packages/jedi/inference/parser_cache.py new file mode 100644 index 00000000..c9b9b2bd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/parser_cache.py @@ -0,0 +1,6 @@ +from jedi.inference.cache import inference_state_function_cache + + +@inference_state_function_cache() +def get_yield_exprs(inference_state, funcdef): + return list(funcdef.iter_yield_exprs()) diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/recursion.py b/.venv/lib/python3.8/site-packages/jedi/inference/recursion.py new file mode 100644 index 00000000..a0897fa8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/recursion.py @@ -0,0 +1,153 @@ +""" +Recursions are the recipe of |jedi| to conquer Python code. However, someone +must stop recursions going mad. Some settings are here to make |jedi| stop at +the right time. You can read more about them :ref:`here `. + +Next to the internal ``jedi.inference.cache`` this module also makes |jedi| not +thread-safe, because ``execution_recursion_decorator`` uses class variables to +count the function calls. + +.. _settings-recursion: + +Settings +~~~~~~~~~~ + +Recursion settings are important if you don't want extremly +recursive python code to go absolutely crazy. + +The default values are based on experiments while completing the |jedi| library +itself (inception!). But I don't think there's any other Python library that +uses recursion in a similarly extreme way. Completion should also be fast and +therefore the quality might not always be maximal. + +.. autodata:: recursion_limit +.. autodata:: total_function_execution_limit +.. autodata:: per_function_execution_limit +.. autodata:: per_function_recursion_limit +""" + +from contextlib import contextmanager + +from jedi import debug +from jedi.inference.base_value import NO_VALUES + + +recursion_limit = 15 +""" +Like :func:`sys.getrecursionlimit()`, just for |jedi|. +""" +total_function_execution_limit = 200 +""" +This is a hard limit of how many non-builtin functions can be executed. +""" +per_function_execution_limit = 6 +""" +The maximal amount of times a specific function may be executed. +""" +per_function_recursion_limit = 2 +""" +A function may not be executed more than this number of times recursively. +""" + + +class RecursionDetector(object): + def __init__(self): + self.pushed_nodes = [] + + +@contextmanager +def execution_allowed(inference_state, node): + """ + A decorator to detect recursions in statements. In a recursion a statement + at the same place, in the same module may not be executed two times. + """ + pushed_nodes = inference_state.recursion_detector.pushed_nodes + + if node in pushed_nodes: + debug.warning('catched stmt recursion: %s @%s', node, + getattr(node, 'start_pos', None)) + yield False + else: + try: + pushed_nodes.append(node) + yield True + finally: + pushed_nodes.pop() + + +def execution_recursion_decorator(default=NO_VALUES): + def decorator(func): + def wrapper(self, **kwargs): + detector = self.inference_state.execution_recursion_detector + limit_reached = detector.push_execution(self) + try: + if limit_reached: + result = default + else: + result = func(self, **kwargs) + finally: + detector.pop_execution() + return result + return wrapper + return decorator + + +class ExecutionRecursionDetector(object): + """ + Catches recursions of executions. + """ + def __init__(self, inference_state): + self._inference_state = inference_state + + self._recursion_level = 0 + self._parent_execution_funcs = [] + self._funcdef_execution_counts = {} + self._execution_count = 0 + + def pop_execution(self): + self._parent_execution_funcs.pop() + self._recursion_level -= 1 + + def push_execution(self, execution): + funcdef = execution.tree_node + + # These two will be undone in pop_execution. + self._recursion_level += 1 + self._parent_execution_funcs.append(funcdef) + + module_context = execution.get_root_context() + + if module_context.is_builtins_module(): + # We have control over builtins so we know they are not recursing + # like crazy. Therefore we just let them execute always, because + # they usually just help a lot with getting good results. + return False + + if self._recursion_level > recursion_limit: + debug.warning('Recursion limit (%s) reached', recursion_limit) + return True + + if self._execution_count >= total_function_execution_limit: + debug.warning('Function execution limit (%s) reached', total_function_execution_limit) + return True + self._execution_count += 1 + + if self._funcdef_execution_counts.setdefault(funcdef, 0) >= per_function_execution_limit: + if module_context.py__name__() == 'typing': + return False + debug.warning( + 'Per function execution limit (%s) reached: %s', + per_function_execution_limit, + funcdef + ) + return True + self._funcdef_execution_counts[funcdef] += 1 + + if self._parent_execution_funcs.count(funcdef) > per_function_recursion_limit: + debug.warning( + 'Per function recursion limit (%s) reached: %s', + per_function_recursion_limit, + funcdef + ) + return True + return False diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/references.py b/.venv/lib/python3.8/site-packages/jedi/inference/references.py new file mode 100644 index 00000000..4a1321ed --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/references.py @@ -0,0 +1,299 @@ +import os +import re + +from parso import python_bytes_to_unicode + +from jedi._compatibility import FileNotFoundError +from jedi.debug import dbg +from jedi.file_io import KnownContentFileIO +from jedi.inference.imports import SubModuleName, load_module_from_path +from jedi.inference.filters import ParserTreeFilter +from jedi.inference.gradual.conversion import convert_names + +_IGNORE_FOLDERS = ('.tox', '.venv', 'venv', '__pycache__') + +_OPENED_FILE_LIMIT = 2000 +""" +Stats from a 2016 Lenovo Notebook running Linux: +With os.walk, it takes about 10s to scan 11'000 files (without filesystem +caching). Once cached it only takes 5s. So it is expected that reading all +those files might take a few seconds, but not a lot more. +""" +_PARSED_FILE_LIMIT = 30 +""" +For now we keep the amount of parsed files really low, since parsing might take +easily 100ms for bigger files. +""" + + +def _resolve_names(definition_names, avoid_names=()): + for name in definition_names: + if name in avoid_names: + # Avoiding recursions here, because goto on a module name lands + # on the same module. + continue + + if not isinstance(name, SubModuleName): + # SubModuleNames are not actually existing names but created + # names when importing something like `import foo.bar.baz`. + yield name + + if name.api_type == 'module': + for n in _resolve_names(name.goto(), definition_names): + yield n + + +def _dictionarize(names): + return dict( + (n if n.tree_name is None else n.tree_name, n) + for n in names + ) + + +def _find_defining_names(module_context, tree_name): + found_names = _find_names(module_context, tree_name) + + for name in list(found_names): + # Convert from/to stubs, because those might also be usages. + found_names |= set(convert_names( + [name], + only_stubs=not name.get_root_context().is_stub(), + prefer_stub_to_compiled=False + )) + + found_names |= set(_find_global_variables(found_names, tree_name.value)) + for name in list(found_names): + if name.api_type == 'param' or name.tree_name is None \ + or name.tree_name.parent.type == 'trailer': + continue + found_names |= set(_add_names_in_same_context(name.parent_context, name.string_name)) + return set(_resolve_names(found_names)) + + +def _find_names(module_context, tree_name): + name = module_context.create_name(tree_name) + found_names = set(name.goto()) + found_names.add(name) + + return set(_resolve_names(found_names)) + + +def _add_names_in_same_context(context, string_name): + if context.tree_node is None: + return + + until_position = None + while True: + filter_ = ParserTreeFilter( + parent_context=context, + until_position=until_position, + ) + names = set(filter_.get(string_name)) + if not names: + break + for name in names: + yield name + ordered = sorted(names, key=lambda x: x.start_pos) + until_position = ordered[0].start_pos + + +def _find_global_variables(names, search_name): + for name in names: + if name.tree_name is None: + continue + module_context = name.get_root_context() + try: + method = module_context.get_global_filter + except AttributeError: + continue + else: + for global_name in method().get(search_name): + yield global_name + c = module_context.create_context(global_name.tree_name) + for n in _add_names_in_same_context(c, global_name.string_name): + yield n + + +def find_references(module_context, tree_name, only_in_module=False): + inf = module_context.inference_state + search_name = tree_name.value + + # We disable flow analysis, because if we have ifs that are only true in + # certain cases, we want both sides. + try: + inf.flow_analysis_enabled = False + found_names = _find_defining_names(module_context, tree_name) + finally: + inf.flow_analysis_enabled = True + + found_names_dct = _dictionarize(found_names) + + module_contexts = [module_context] + if not only_in_module: + module_contexts.extend( + m for m in set(d.get_root_context() for d in found_names) + if m != module_context and m.tree_node is not None + ) + # For param no search for other modules is necessary. + if only_in_module or any(n.api_type == 'param' for n in found_names): + potential_modules = module_contexts + else: + potential_modules = get_module_contexts_containing_name( + inf, + module_contexts, + search_name, + ) + + non_matching_reference_maps = {} + for module_context in potential_modules: + for name_leaf in module_context.tree_node.get_used_names().get(search_name, []): + new = _dictionarize(_find_names(module_context, name_leaf)) + if any(tree_name in found_names_dct for tree_name in new): + found_names_dct.update(new) + for tree_name in new: + for dct in non_matching_reference_maps.get(tree_name, []): + # A reference that was previously searched for matches + # with a now found name. Merge. + found_names_dct.update(dct) + try: + del non_matching_reference_maps[tree_name] + except KeyError: + pass + else: + for name in new: + non_matching_reference_maps.setdefault(name, []).append(new) + result = found_names_dct.values() + if only_in_module: + return [n for n in result if n.get_root_context() == module_context] + return result + + +def _check_fs(inference_state, file_io, regex): + try: + code = file_io.read() + except FileNotFoundError: + return None + code = python_bytes_to_unicode(code, errors='replace') + if not regex.search(code): + return None + new_file_io = KnownContentFileIO(file_io.path, code) + m = load_module_from_path(inference_state, new_file_io) + if m.is_compiled(): + return None + return m.as_context() + + +def gitignored_lines(folder_io, file_io): + ignored_paths = set() + ignored_names = set() + for l in file_io.read().splitlines(): + if not l or l.startswith(b'#'): + continue + + p = l.decode('utf-8', 'ignore') + if p.startswith('/'): + name = p[1:] + if name.endswith(os.path.sep): + name = name[:-1] + ignored_paths.add(os.path.join(folder_io.path, name)) + else: + ignored_names.add(p) + return ignored_paths, ignored_names + + +def recurse_find_python_folders_and_files(folder_io, except_paths=()): + except_paths = set(except_paths) + for root_folder_io, folder_ios, file_ios in folder_io.walk(): + # Delete folders that we don't want to iterate over. + for file_io in file_ios: + path = file_io.path + if path.endswith('.py') or path.endswith('.pyi'): + if path not in except_paths: + yield None, file_io + + if path.endswith('.gitignore'): + ignored_paths, ignored_names = \ + gitignored_lines(root_folder_io, file_io) + except_paths |= ignored_paths + + folder_ios[:] = [ + folder_io + for folder_io in folder_ios + if folder_io.path not in except_paths + and folder_io.get_base_name() not in _IGNORE_FOLDERS + ] + for folder_io in folder_ios: + yield folder_io, None + + +def recurse_find_python_files(folder_io, except_paths=()): + for folder_io, file_io in recurse_find_python_folders_and_files(folder_io, except_paths): + if file_io is not None: + yield file_io + + +def _find_python_files_in_sys_path(inference_state, module_contexts): + sys_path = inference_state.get_sys_path() + except_paths = set() + yielded_paths = [m.py__file__() for m in module_contexts] + for module_context in module_contexts: + file_io = module_context.get_value().file_io + if file_io is None: + continue + + folder_io = file_io.get_parent_folder() + while True: + path = folder_io.path + if not any(path.startswith(p) for p in sys_path) or path in except_paths: + break + for file_io in recurse_find_python_files(folder_io, except_paths): + if file_io.path not in yielded_paths: + yield file_io + except_paths.add(path) + folder_io = folder_io.get_parent_folder() + + +def get_module_contexts_containing_name(inference_state, module_contexts, name, + limit_reduction=1): + """ + Search a name in the directories of modules. + + :param limit_reduction: Divides the limits on opening/parsing files by this + factor. + """ + # Skip non python modules + for module_context in module_contexts: + if module_context.is_compiled(): + continue + yield module_context + + # Very short names are not searched in other modules for now to avoid lots + # of file lookups. + if len(name) <= 2: + return + + file_io_iterator = _find_python_files_in_sys_path(inference_state, module_contexts) + for x in search_in_file_ios(inference_state, file_io_iterator, name, + limit_reduction=limit_reduction): + yield x # Python 2... + + +def search_in_file_ios(inference_state, file_io_iterator, name, limit_reduction=1): + parse_limit = _PARSED_FILE_LIMIT / limit_reduction + open_limit = _OPENED_FILE_LIMIT / limit_reduction + file_io_count = 0 + parsed_file_count = 0 + regex = re.compile(r'\b' + re.escape(name) + r'\b') + for file_io in file_io_iterator: + file_io_count += 1 + m = _check_fs(inference_state, file_io, regex) + if m is not None: + parsed_file_count += 1 + yield m + if parsed_file_count >= parse_limit: + dbg('Hit limit of parsed files: %s', parse_limit) + break + + if file_io_count >= open_limit: + dbg('Hit limit of opened files: %s', open_limit) + break diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/signature.py b/.venv/lib/python3.8/site-packages/jedi/inference/signature.py new file mode 100644 index 00000000..c6aa75e6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/signature.py @@ -0,0 +1,149 @@ +from jedi._compatibility import Parameter +from jedi.cache import memoize_method +from jedi import debug +from jedi import parser_utils + + +class _SignatureMixin(object): + def to_string(self): + def param_strings(): + is_positional = False + is_kw_only = False + for n in self.get_param_names(resolve_stars=True): + kind = n.get_kind() + is_positional |= kind == Parameter.POSITIONAL_ONLY + if is_positional and kind != Parameter.POSITIONAL_ONLY: + yield '/' + is_positional = False + + if kind == Parameter.VAR_POSITIONAL: + is_kw_only = True + elif kind == Parameter.KEYWORD_ONLY and not is_kw_only: + yield '*' + is_kw_only = True + + yield n.to_string() + + if is_positional: + yield '/' + + s = self.name.string_name + '(' + ', '.join(param_strings()) + ')' + annotation = self.annotation_string + if annotation: + s += ' -> ' + annotation + return s + + +class AbstractSignature(_SignatureMixin): + def __init__(self, value, is_bound=False): + self.value = value + self.is_bound = is_bound + + @property + def name(self): + return self.value.name + + @property + def annotation_string(self): + return '' + + def get_param_names(self, resolve_stars=False): + param_names = self._function_value.get_param_names() + if self.is_bound: + return param_names[1:] + return param_names + + def bind(self, value): + raise NotImplementedError + + def matches_signature(self, arguments): + return True + + def __repr__(self): + if self.value is self._function_value: + return '<%s: %s>' % (self.__class__.__name__, self.value) + return '<%s: %s, %s>' % (self.__class__.__name__, self.value, self._function_value) + + +class TreeSignature(AbstractSignature): + def __init__(self, value, function_value=None, is_bound=False): + super(TreeSignature, self).__init__(value, is_bound) + self._function_value = function_value or value + + def bind(self, value): + return TreeSignature(value, self._function_value, is_bound=True) + + @property + def _annotation(self): + # Classes don't need annotations, even if __init__ has one. They always + # return themselves. + if self.value.is_class(): + return None + return self._function_value.tree_node.annotation + + @property + def annotation_string(self): + a = self._annotation + if a is None: + return '' + return a.get_code(include_prefix=False) + + @memoize_method + def get_param_names(self, resolve_stars=False): + params = super(TreeSignature, self).get_param_names(resolve_stars=False) + if resolve_stars: + from jedi.inference.star_args import process_params + params = process_params(params) + return params + + def matches_signature(self, arguments): + from jedi.inference.param import get_executed_param_names_and_issues + executed_param_names, issues = \ + get_executed_param_names_and_issues(self._function_value, arguments) + if issues: + return False + + matches = all(executed_param_name.matches_signature() + for executed_param_name in executed_param_names) + if debug.enable_notice: + tree_node = self._function_value.tree_node + signature = parser_utils.get_signature(tree_node) + if matches: + debug.dbg("Overloading match: %s@%s (%s)", + signature, tree_node.start_pos[0], arguments, color='BLUE') + else: + debug.dbg("Overloading no match: %s@%s (%s)", + signature, tree_node.start_pos[0], arguments, color='BLUE') + return matches + + +class BuiltinSignature(AbstractSignature): + def __init__(self, value, return_string, function_value=None, is_bound=False): + super(BuiltinSignature, self).__init__(value, is_bound) + self._return_string = return_string + self.__function_value = function_value + + @property + def annotation_string(self): + return self._return_string + + @property + def _function_value(self): + if self.__function_value is None: + return self.value + return self.__function_value + + def bind(self, value): + return BuiltinSignature( + value, self._return_string, + function_value=self.value, + is_bound=True + ) + + +class SignatureWrapper(_SignatureMixin): + def __init__(self, wrapped_signature): + self._wrapped_signature = wrapped_signature + + def __getattr__(self, name): + return getattr(self._wrapped_signature, name) diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/star_args.py b/.venv/lib/python3.8/site-packages/jedi/inference/star_args.py new file mode 100644 index 00000000..0cda3839 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/star_args.py @@ -0,0 +1,217 @@ +""" +This module is responsible for inferring *args and **kwargs for signatures. + +This means for example in this case:: + + def foo(a, b, c): ... + + def bar(*args): + return foo(1, *args) + +The signature here for bar should be `bar(b, c)` instead of bar(*args). +""" + +from jedi._compatibility import Parameter +from jedi.inference.utils import to_list +from jedi.inference.names import ParamNameWrapper +from jedi.inference.helpers import is_big_annoying_library + + +def _iter_nodes_for_param(param_name): + from parso.python.tree import search_ancestor + from jedi.inference.arguments import TreeArguments + + execution_context = param_name.parent_context + function_node = execution_context.tree_node + module_node = function_node.get_root_node() + start = function_node.children[-1].start_pos + end = function_node.children[-1].end_pos + for name in module_node.get_used_names().get(param_name.string_name): + if start <= name.start_pos < end: + # Is used in the function + argument = name.parent + if argument.type == 'argument' \ + and argument.children[0] == '*' * param_name.star_count: + # No support for Python 2.7 here, but they are end-of-life + # anyway + trailer = search_ancestor(argument, 'trailer') + if trailer is not None: # Make sure we're in a function + context = execution_context.create_context(trailer) + if _goes_to_param_name(param_name, context, name): + values = _to_callables(context, trailer) + + args = TreeArguments.create_cached( + execution_context.inference_state, + context=context, + argument_node=trailer.children[1], + trailer=trailer, + ) + for c in values: + yield c, args + + +def _goes_to_param_name(param_name, context, potential_name): + if potential_name.type != 'name': + return False + from jedi.inference.names import TreeNameDefinition + found = TreeNameDefinition(context, potential_name).goto() + return any(param_name.parent_context == p.parent_context + and param_name.start_pos == p.start_pos + for p in found) + + +def _to_callables(context, trailer): + from jedi.inference.syntax_tree import infer_trailer + + atom_expr = trailer.parent + index = atom_expr.children[0] == 'await' + # Infer atom first + values = context.infer_node(atom_expr.children[index]) + for trailer2 in atom_expr.children[index + 1:]: + if trailer == trailer2: + break + values = infer_trailer(context, values, trailer2) + return values + + +def _remove_given_params(arguments, param_names): + count = 0 + used_keys = set() + for key, _ in arguments.unpack(): + if key is None: + count += 1 + else: + used_keys.add(key) + + for p in param_names: + if count and p.maybe_positional_argument(): + count -= 1 + continue + if p.string_name in used_keys and p.maybe_keyword_argument(): + continue + yield p + + +@to_list +def process_params(param_names, star_count=3): # default means both * and ** + if param_names: + if is_big_annoying_library(param_names[0].parent_context): + # At first this feature can look innocent, but it does a lot of + # type inference in some cases, so we just ditch it. + for p in param_names: + yield p + return + + used_names = set() + arg_callables = [] + kwarg_callables = [] + + kw_only_names = [] + kwarg_names = [] + arg_names = [] + original_arg_name = None + original_kwarg_name = None + for p in param_names: + kind = p.get_kind() + if kind == Parameter.VAR_POSITIONAL: + if star_count & 1: + arg_callables = _iter_nodes_for_param(p) + original_arg_name = p + elif p.get_kind() == Parameter.VAR_KEYWORD: + if star_count & 2: + kwarg_callables = list(_iter_nodes_for_param(p)) + original_kwarg_name = p + elif kind == Parameter.KEYWORD_ONLY: + if star_count & 2: + kw_only_names.append(p) + elif kind == Parameter.POSITIONAL_ONLY: + if star_count & 1: + yield p + else: + if star_count == 1: + yield ParamNameFixedKind(p, Parameter.POSITIONAL_ONLY) + elif star_count == 2: + kw_only_names.append(ParamNameFixedKind(p, Parameter.KEYWORD_ONLY)) + else: + used_names.add(p.string_name) + yield p + + # First process *args + longest_param_names = () + found_arg_signature = False + found_kwarg_signature = False + for func_and_argument in arg_callables: + func, arguments = func_and_argument + new_star_count = star_count + if func_and_argument in kwarg_callables: + kwarg_callables.remove(func_and_argument) + else: + new_star_count = 1 + + for signature in func.get_signatures(): + found_arg_signature = True + if new_star_count == 3: + found_kwarg_signature = True + args_for_this_func = [] + for p in process_params( + list(_remove_given_params( + arguments, + signature.get_param_names(resolve_stars=False) + )), new_star_count): + if p.get_kind() == Parameter.VAR_KEYWORD: + kwarg_names.append(p) + elif p.get_kind() == Parameter.VAR_POSITIONAL: + arg_names.append(p) + elif p.get_kind() == Parameter.KEYWORD_ONLY: + kw_only_names.append(p) + else: + args_for_this_func.append(p) + if len(args_for_this_func) > len(longest_param_names): + longest_param_names = args_for_this_func + + for p in longest_param_names: + if star_count == 1 and p.get_kind() != Parameter.VAR_POSITIONAL: + yield ParamNameFixedKind(p, Parameter.POSITIONAL_ONLY) + else: + if p.get_kind() == Parameter.POSITIONAL_OR_KEYWORD: + used_names.add(p.string_name) + yield p + + if not found_arg_signature and original_arg_name is not None: + yield original_arg_name + elif arg_names: + yield arg_names[0] + + # Then process **kwargs + for func, arguments in kwarg_callables: + for signature in func.get_signatures(): + found_kwarg_signature = True + for p in process_params( + list(_remove_given_params( + arguments, + signature.get_param_names(resolve_stars=False) + )), star_count=2): + if p.get_kind() == Parameter.VAR_KEYWORD: + kwarg_names.append(p) + elif p.get_kind() == Parameter.KEYWORD_ONLY: + kw_only_names.append(p) + + for p in kw_only_names: + if p.string_name in used_names: + continue + yield p + used_names.add(p.string_name) + + if not found_kwarg_signature and original_kwarg_name is not None: + yield original_kwarg_name + elif kwarg_names: + yield kwarg_names[0] + + +class ParamNameFixedKind(ParamNameWrapper): + def __init__(self, param_name, new_kind): + super(ParamNameFixedKind, self).__init__(param_name) + self._new_kind = new_kind + + def get_kind(self): + return self._new_kind diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/syntax_tree.py b/.venv/lib/python3.8/site-packages/jedi/inference/syntax_tree.py new file mode 100644 index 00000000..2be19d1b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/syntax_tree.py @@ -0,0 +1,883 @@ +""" +Functions inferring the syntax tree. +""" +import copy + +from parso.python import tree + +from jedi._compatibility import force_unicode, unicode +from jedi import debug +from jedi import parser_utils +from jedi.inference.base_value import ValueSet, NO_VALUES, ContextualizedNode, \ + iterator_to_value_set, iterate_values +from jedi.inference.lazy_value import LazyTreeValue +from jedi.inference import compiled +from jedi.inference import recursion +from jedi.inference import analysis +from jedi.inference import imports +from jedi.inference import arguments +from jedi.inference.value import ClassValue, FunctionValue +from jedi.inference.value import iterable +from jedi.inference.value.dynamic_arrays import ListModification, DictModification +from jedi.inference.value import TreeInstance +from jedi.inference.helpers import is_string, is_literal, is_number, \ + get_names_of_node, is_big_annoying_library +from jedi.inference.compiled.access import COMPARISON_OPERATORS +from jedi.inference.cache import inference_state_method_cache +from jedi.inference.gradual.stub_value import VersionInfo +from jedi.inference.gradual import annotation +from jedi.inference.names import TreeNameDefinition +from jedi.inference.context import CompForContext +from jedi.inference.value.decorator import Decoratee +from jedi.plugins import plugin_manager + +operator_to_magic_method = { + '+': '__add__', + '-': '__sub__', + '*': '__mul__', + '/': '__truediv__', + '//': '__floordiv__', + '%': '__mod__', + '**': '__pow__', + '<<': '__lshift__', + '>>': '__rshift__', + '&': '__and__', + '|': '__or__', + '^': '__xor__', +} + +reverse_operator_to_magic_method = { + k: '__r' + v[2:] for k, v in operator_to_magic_method.items() +} + + +def _limit_value_infers(func): + """ + This is for now the way how we limit type inference going wild. There are + other ways to ensure recursion limits as well. This is mostly necessary + because of instance (self) access that can be quite tricky to limit. + + I'm still not sure this is the way to go, but it looks okay for now and we + can still go anther way in the future. Tests are there. ~ dave + """ + def wrapper(context, *args, **kwargs): + n = context.tree_node + inference_state = context.inference_state + try: + inference_state.inferred_element_counts[n] += 1 + maximum = 300 + if context.parent_context is None \ + and context.get_value() is inference_state.builtins_module: + # Builtins should have a more generous inference limit. + # It is important that builtins can be executed, otherwise some + # functions that depend on certain builtins features would be + # broken, see e.g. GH #1432 + maximum *= 100 + + if inference_state.inferred_element_counts[n] > maximum: + debug.warning('In value %s there were too many inferences.', n) + return NO_VALUES + except KeyError: + inference_state.inferred_element_counts[n] = 1 + return func(context, *args, **kwargs) + + return wrapper + + +def infer_node(context, element): + if isinstance(context, CompForContext): + return _infer_node(context, element) + + if_stmt = element + while if_stmt is not None: + if_stmt = if_stmt.parent + if if_stmt.type in ('if_stmt', 'for_stmt'): + break + if parser_utils.is_scope(if_stmt): + if_stmt = None + break + predefined_if_name_dict = context.predefined_names.get(if_stmt) + # TODO there's a lot of issues with this one. We actually should do + # this in a different way. Caching should only be active in certain + # cases and this all sucks. + if predefined_if_name_dict is None and if_stmt \ + and if_stmt.type == 'if_stmt' and context.inference_state.is_analysis: + if_stmt_test = if_stmt.children[1] + name_dicts = [{}] + # If we already did a check, we don't want to do it again -> If + # value.predefined_names is filled, we stop. + # We don't want to check the if stmt itself, it's just about + # the content. + if element.start_pos > if_stmt_test.end_pos: + # Now we need to check if the names in the if_stmt match the + # names in the suite. + if_names = get_names_of_node(if_stmt_test) + element_names = get_names_of_node(element) + str_element_names = [e.value for e in element_names] + if any(i.value in str_element_names for i in if_names): + for if_name in if_names: + definitions = context.inference_state.infer(context, if_name) + # Every name that has multiple different definitions + # causes the complexity to rise. The complexity should + # never fall below 1. + if len(definitions) > 1: + if len(name_dicts) * len(definitions) > 16: + debug.dbg('Too many options for if branch inference %s.', if_stmt) + # There's only a certain amount of branches + # Jedi can infer, otherwise it will take to + # long. + name_dicts = [{}] + break + + original_name_dicts = list(name_dicts) + name_dicts = [] + for definition in definitions: + new_name_dicts = list(original_name_dicts) + for i, name_dict in enumerate(new_name_dicts): + new_name_dicts[i] = name_dict.copy() + new_name_dicts[i][if_name.value] = ValueSet([definition]) + + name_dicts += new_name_dicts + else: + for name_dict in name_dicts: + name_dict[if_name.value] = definitions + if len(name_dicts) > 1: + result = NO_VALUES + for name_dict in name_dicts: + with context.predefine_names(if_stmt, name_dict): + result |= _infer_node(context, element) + return result + else: + return _infer_node_if_inferred(context, element) + else: + if predefined_if_name_dict: + return _infer_node(context, element) + else: + return _infer_node_if_inferred(context, element) + + +def _infer_node_if_inferred(context, element): + """ + TODO This function is temporary: Merge with infer_node. + """ + parent = element + while parent is not None: + parent = parent.parent + predefined_if_name_dict = context.predefined_names.get(parent) + if predefined_if_name_dict is not None: + return _infer_node(context, element) + return _infer_node_cached(context, element) + + +@inference_state_method_cache(default=NO_VALUES) +def _infer_node_cached(context, element): + return _infer_node(context, element) + + +@debug.increase_indent +@_limit_value_infers +def _infer_node(context, element): + debug.dbg('infer_node %s@%s in %s', element, element.start_pos, context) + inference_state = context.inference_state + typ = element.type + if typ in ('name', 'number', 'string', 'atom', 'strings', 'keyword', 'fstring'): + return infer_atom(context, element) + elif typ == 'lambdef': + return ValueSet([FunctionValue.from_context(context, element)]) + elif typ == 'expr_stmt': + return infer_expr_stmt(context, element) + elif typ in ('power', 'atom_expr'): + first_child = element.children[0] + children = element.children[1:] + had_await = False + if first_child.type == 'keyword' and first_child.value == 'await': + had_await = True + first_child = children.pop(0) + + value_set = context.infer_node(first_child) + for (i, trailer) in enumerate(children): + if trailer == '**': # has a power operation. + right = context.infer_node(children[i + 1]) + value_set = _infer_comparison( + context, + value_set, + trailer, + right + ) + break + value_set = infer_trailer(context, value_set, trailer) + + if had_await: + return value_set.py__await__().py__stop_iteration_returns() + return value_set + elif typ in ('testlist_star_expr', 'testlist',): + # The implicit tuple in statements. + return ValueSet([iterable.SequenceLiteralValue(inference_state, context, element)]) + elif typ in ('not_test', 'factor'): + value_set = context.infer_node(element.children[-1]) + for operator in element.children[:-1]: + value_set = infer_factor(value_set, operator) + return value_set + elif typ == 'test': + # `x if foo else y` case. + return (context.infer_node(element.children[0]) + | context.infer_node(element.children[-1])) + elif typ == 'operator': + # Must be an ellipsis, other operators are not inferred. + # In Python 2 ellipsis is coded as three single dot tokens, not + # as one token 3 dot token. + if element.value not in ('.', '...'): + origin = element.parent + raise AssertionError("unhandled operator %s in %s " % (repr(element.value), origin)) + return ValueSet([compiled.builtin_from_name(inference_state, u'Ellipsis')]) + elif typ == 'dotted_name': + value_set = infer_atom(context, element.children[0]) + for next_name in element.children[2::2]: + value_set = value_set.py__getattribute__(next_name, name_context=context) + return value_set + elif typ == 'eval_input': + return context.infer_node(element.children[0]) + elif typ == 'annassign': + return annotation.infer_annotation(context, element.children[1]) \ + .execute_annotation() + elif typ == 'yield_expr': + if len(element.children) and element.children[1].type == 'yield_arg': + # Implies that it's a yield from. + element = element.children[1].children[1] + generators = context.infer_node(element) \ + .py__getattribute__('__iter__').execute_with_values() + return generators.py__stop_iteration_returns() + + # Generator.send() is not implemented. + return NO_VALUES + elif typ == 'namedexpr_test': + return context.infer_node(element.children[2]) + else: + return infer_or_test(context, element) + + +def infer_trailer(context, atom_values, trailer): + trailer_op, node = trailer.children[:2] + if node == ')': # `arglist` is optional. + node = None + + if trailer_op == '[': + trailer_op, node, _ = trailer.children + return atom_values.get_item( + _infer_subscript_list(context, node), + ContextualizedNode(context, trailer) + ) + else: + debug.dbg('infer_trailer: %s in %s', trailer, atom_values) + if trailer_op == '.': + return atom_values.py__getattribute__( + name_context=context, + name_or_str=node + ) + else: + assert trailer_op == '(', 'trailer_op is actually %s' % trailer_op + args = arguments.TreeArguments(context.inference_state, context, node, trailer) + return atom_values.execute(args) + + +def infer_atom(context, atom): + """ + Basically to process ``atom`` nodes. The parser sometimes doesn't + generate the node (because it has just one child). In that case an atom + might be a name or a literal as well. + """ + state = context.inference_state + if atom.type == 'name': + if atom.value in ('True', 'False', 'None'): + # Python 2... + return ValueSet([compiled.builtin_from_name(state, atom.value)]) + + # This is the first global lookup. + stmt = tree.search_ancestor( + atom, 'expr_stmt', 'lambdef' + ) or atom + if stmt.type == 'lambdef': + stmt = atom + position = stmt.start_pos + if _is_annotation_name(atom): + # Since Python 3.7 (with from __future__ import annotations), + # annotations are essentially strings and can reference objects + # that are defined further down in code. Therefore just set the + # position to None, so the finder will not try to stop at a certain + # position in the module. + position = None + return context.py__getattribute__(atom, position=position) + elif atom.type == 'keyword': + # For False/True/None + if atom.value in ('False', 'True', 'None'): + return ValueSet([compiled.builtin_from_name(state, atom.value)]) + elif atom.value == 'print': + # print e.g. could be inferred like this in Python 2.7 + return NO_VALUES + elif atom.value == 'yield': + # Contrary to yield from, yield can just appear alone to return a + # value when used with `.send()`. + return NO_VALUES + assert False, 'Cannot infer the keyword %s' % atom + + elif isinstance(atom, tree.Literal): + string = state.compiled_subprocess.safe_literal_eval(atom.value) + return ValueSet([compiled.create_simple_object(state, string)]) + elif atom.type == 'strings': + # Will be multiple string. + value_set = infer_atom(context, atom.children[0]) + for string in atom.children[1:]: + right = infer_atom(context, string) + value_set = _infer_comparison(context, value_set, u'+', right) + return value_set + elif atom.type == 'fstring': + return compiled.get_string_value_set(state) + else: + c = atom.children + # Parentheses without commas are not tuples. + if c[0] == '(' and not len(c) == 2 \ + and not(c[1].type == 'testlist_comp' + and len(c[1].children) > 1): + return context.infer_node(c[1]) + + try: + comp_for = c[1].children[1] + except (IndexError, AttributeError): + pass + else: + if comp_for == ':': + # Dict comprehensions have a colon at the 3rd index. + try: + comp_for = c[1].children[3] + except IndexError: + pass + + if comp_for.type in ('comp_for', 'sync_comp_for'): + return ValueSet([iterable.comprehension_from_atom( + state, context, atom + )]) + + # It's a dict/list/tuple literal. + array_node = c[1] + try: + array_node_c = array_node.children + except AttributeError: + array_node_c = [] + if c[0] == '{' and (array_node == '}' or ':' in array_node_c + or '**' in array_node_c): + new_value = iterable.DictLiteralValue(state, context, atom) + else: + new_value = iterable.SequenceLiteralValue(state, context, atom) + return ValueSet([new_value]) + + +@_limit_value_infers +def infer_expr_stmt(context, stmt, seek_name=None): + with recursion.execution_allowed(context.inference_state, stmt) as allowed: + if allowed: + if seek_name is not None: + pep0484_values = \ + annotation.find_type_from_comment_hint_assign(context, stmt, seek_name) + if pep0484_values: + return pep0484_values + + return _infer_expr_stmt(context, stmt, seek_name) + return NO_VALUES + + +@debug.increase_indent +def _infer_expr_stmt(context, stmt, seek_name=None): + """ + The starting point of the completion. A statement always owns a call + list, which are the calls, that a statement does. In case multiple + names are defined in the statement, `seek_name` returns the result for + this name. + + expr_stmt: testlist_star_expr (annassign | augassign (yield_expr|testlist) | + ('=' (yield_expr|testlist_star_expr))*) + annassign: ':' test ['=' test] + augassign: ('+=' | '-=' | '*=' | '@=' | '/=' | '%=' | '&=' | '|=' | '^=' | + '<<=' | '>>=' | '**=' | '//=') + + :param stmt: A `tree.ExprStmt`. + """ + def check_setitem(stmt): + atom_expr = stmt.children[0] + if atom_expr.type not in ('atom_expr', 'power'): + return False, None + name = atom_expr.children[0] + if name.type != 'name' or len(atom_expr.children) != 2: + return False, None + trailer = atom_expr.children[-1] + return trailer.children[0] == '[', trailer.children[1] + + debug.dbg('infer_expr_stmt %s (%s)', stmt, seek_name) + rhs = stmt.get_rhs() + + value_set = context.infer_node(rhs) + + if seek_name: + n = TreeNameDefinition(context, seek_name) + value_set = check_tuple_assignments(n, value_set) + + first_operator = next(stmt.yield_operators(), None) + is_setitem, subscriptlist = check_setitem(stmt) + is_annassign = first_operator not in ('=', None) and first_operator.type == 'operator' + if is_annassign or is_setitem: + # `=` is always the last character in aug assignments -> -1 + name = stmt.get_defined_names(include_setitem=True)[0].value + left_values = context.py__getattribute__(name, position=stmt.start_pos) + + if is_setitem: + def to_mod(v): + c = ContextualizedSubscriptListNode(context, subscriptlist) + if v.array_type == 'dict': + return DictModification(v, value_set, c) + elif v.array_type == 'list': + return ListModification(v, value_set, c) + return v + + value_set = ValueSet(to_mod(v) for v in left_values) + else: + operator = copy.copy(first_operator) + operator.value = operator.value[:-1] + for_stmt = tree.search_ancestor(stmt, 'for_stmt') + if for_stmt is not None and for_stmt.type == 'for_stmt' and value_set \ + and parser_utils.for_stmt_defines_one_name(for_stmt): + # Iterate through result and add the values, that's possible + # only in for loops without clutter, because they are + # predictable. Also only do it, if the variable is not a tuple. + node = for_stmt.get_testlist() + cn = ContextualizedNode(context, node) + ordered = list(cn.infer().iterate(cn)) + + for lazy_value in ordered: + dct = {for_stmt.children[1].value: lazy_value.infer()} + with context.predefine_names(for_stmt, dct): + t = context.infer_node(rhs) + left_values = _infer_comparison(context, left_values, operator, t) + value_set = left_values + else: + value_set = _infer_comparison(context, left_values, operator, value_set) + debug.dbg('infer_expr_stmt result %s', value_set) + return value_set + + +def infer_or_test(context, or_test): + iterator = iter(or_test.children) + types = context.infer_node(next(iterator)) + for operator in iterator: + right = next(iterator) + if operator.type == 'comp_op': # not in / is not + operator = ' '.join(c.value for c in operator.children) + + # handle type inference of and/or here. + if operator in ('and', 'or'): + left_bools = set(left.py__bool__() for left in types) + if left_bools == {True}: + if operator == 'and': + types = context.infer_node(right) + elif left_bools == {False}: + if operator != 'and': + types = context.infer_node(right) + # Otherwise continue, because of uncertainty. + else: + types = _infer_comparison(context, types, operator, + context.infer_node(right)) + debug.dbg('infer_or_test types %s', types) + return types + + +@iterator_to_value_set +def infer_factor(value_set, operator): + """ + Calculates `+`, `-`, `~` and `not` prefixes. + """ + for value in value_set: + if operator == '-': + if is_number(value): + yield value.negate() + elif operator == 'not': + b = value.py__bool__() + if b is None: # Uncertainty. + return + yield compiled.create_simple_object(value.inference_state, not b) + else: + yield value + + +def _literals_to_types(inference_state, result): + # Changes literals ('a', 1, 1.0, etc) to its type instances (str(), + # int(), float(), etc). + new_result = NO_VALUES + for typ in result: + if is_literal(typ): + # Literals are only valid as long as the operations are + # correct. Otherwise add a value-free instance. + cls = compiled.builtin_from_name(inference_state, typ.name.string_name) + new_result |= cls.execute_with_values() + else: + new_result |= ValueSet([typ]) + return new_result + + +def _infer_comparison(context, left_values, operator, right_values): + state = context.inference_state + if not left_values or not right_values: + # illegal slices e.g. cause left/right_result to be None + result = (left_values or NO_VALUES) | (right_values or NO_VALUES) + return _literals_to_types(state, result) + else: + # I don't think there's a reasonable chance that a string + # operation is still correct, once we pass something like six + # objects. + if len(left_values) * len(right_values) > 6: + return _literals_to_types(state, left_values | right_values) + else: + return ValueSet.from_sets( + _infer_comparison_part(state, context, left, operator, right) + for left in left_values + for right in right_values + ) + + +def _is_annotation_name(name): + ancestor = tree.search_ancestor(name, 'param', 'funcdef', 'expr_stmt') + if ancestor is None: + return False + + if ancestor.type in ('param', 'funcdef'): + ann = ancestor.annotation + if ann is not None: + return ann.start_pos <= name.start_pos < ann.end_pos + elif ancestor.type == 'expr_stmt': + c = ancestor.children + if len(c) > 1 and c[1].type == 'annassign': + return c[1].start_pos <= name.start_pos < c[1].end_pos + return False + + +def _is_list(value): + return value.array_type == 'list' + + +def _is_tuple(value): + return value.array_type == 'tuple' + + +def _bool_to_value(inference_state, bool_): + return compiled.builtin_from_name(inference_state, force_unicode(str(bool_))) + + +def _get_tuple_ints(value): + if not isinstance(value, iterable.SequenceLiteralValue): + return None + numbers = [] + for lazy_value in value.py__iter__(): + if not isinstance(lazy_value, LazyTreeValue): + return None + node = lazy_value.data + if node.type != 'number': + return None + try: + numbers.append(int(node.value)) + except ValueError: + return None + return numbers + + +def _infer_comparison_part(inference_state, context, left, operator, right): + l_is_num = is_number(left) + r_is_num = is_number(right) + if isinstance(operator, unicode): + str_operator = operator + else: + str_operator = force_unicode(str(operator.value)) + + if str_operator == '*': + # for iterables, ignore * operations + if isinstance(left, iterable.Sequence) or is_string(left): + return ValueSet([left]) + elif isinstance(right, iterable.Sequence) or is_string(right): + return ValueSet([right]) + elif str_operator == '+': + if l_is_num and r_is_num or is_string(left) and is_string(right): + return left.execute_operation(right, str_operator) + elif _is_list(left) and _is_list(right) or _is_tuple(left) and _is_tuple(right): + return ValueSet([iterable.MergedArray(inference_state, (left, right))]) + elif str_operator == '-': + if l_is_num and r_is_num: + return left.execute_operation(right, str_operator) + elif str_operator == '%': + # With strings and numbers the left type typically remains. Except for + # `int() % float()`. + return ValueSet([left]) + elif str_operator in COMPARISON_OPERATORS: + if left.is_compiled() and right.is_compiled(): + # Possible, because the return is not an option. Just compare. + result = left.execute_operation(right, str_operator) + if result: + return result + else: + if str_operator in ('is', '!=', '==', 'is not'): + operation = COMPARISON_OPERATORS[str_operator] + bool_ = operation(left, right) + # Only if == returns True or != returns False, we can continue. + # There's no guarantee that they are not equal. This can help + # in some cases, but does not cover everything. + if (str_operator in ('is', '==')) == bool_: + return ValueSet([_bool_to_value(inference_state, bool_)]) + + if isinstance(left, VersionInfo): + version_info = _get_tuple_ints(right) + if version_info is not None: + bool_result = compiled.access.COMPARISON_OPERATORS[operator]( + inference_state.environment.version_info, + tuple(version_info) + ) + return ValueSet([_bool_to_value(inference_state, bool_result)]) + + return ValueSet([ + _bool_to_value(inference_state, True), + _bool_to_value(inference_state, False) + ]) + elif str_operator in ('in', 'not in'): + return NO_VALUES + + def check(obj): + """Checks if a Jedi object is either a float or an int.""" + return isinstance(obj, TreeInstance) and \ + obj.name.string_name in ('int', 'float') + + # Static analysis, one is a number, the other one is not. + if str_operator in ('+', '-') and l_is_num != r_is_num \ + and not (check(left) or check(right)): + message = "TypeError: unsupported operand type(s) for +: %s and %s" + analysis.add(context, 'type-error-operation', operator, + message % (left, right)) + + if left.is_class() or right.is_class(): + return NO_VALUES + + method_name = operator_to_magic_method[str_operator] + magic_methods = left.py__getattribute__(method_name) + if magic_methods: + result = magic_methods.execute_with_values(right) + if result: + return result + + if not magic_methods: + reverse_method_name = reverse_operator_to_magic_method[str_operator] + magic_methods = right.py__getattribute__(reverse_method_name) + + result = magic_methods.execute_with_values(left) + if result: + return result + + result = ValueSet([left, right]) + debug.dbg('Used operator %s resulting in %s', operator, result) + return result + + +@plugin_manager.decorate() +def tree_name_to_values(inference_state, context, tree_name): + value_set = NO_VALUES + module_node = context.get_root_context().tree_node + # First check for annotations, like: `foo: int = 3` + if module_node is not None: + names = module_node.get_used_names().get(tree_name.value, []) + found_annotation = False + for name in names: + expr_stmt = name.parent + + if expr_stmt.type == "expr_stmt" and expr_stmt.children[1].type == "annassign": + correct_scope = parser_utils.get_parent_scope(name) == context.tree_node + if correct_scope: + found_annotation = True + value_set |= annotation.infer_annotation( + context, expr_stmt.children[1].children[1] + ).execute_annotation() + if found_annotation: + return value_set + + types = [] + node = tree_name.get_definition(import_name_always=True, include_setitem=True) + if node is None: + node = tree_name.parent + if node.type == 'global_stmt': + c = context.create_context(tree_name) + if c.is_module(): + # In case we are already part of the module, there is no point + # in looking up the global statement anymore, because it's not + # valid at that point anyway. + return NO_VALUES + # For global_stmt lookups, we only need the first possible scope, + # which means the function itself. + filter = next(c.get_filters()) + names = filter.get(tree_name.value) + return ValueSet.from_sets(name.infer() for name in names) + elif node.type not in ('import_from', 'import_name'): + c = context.create_context(tree_name) + return infer_atom(c, tree_name) + + typ = node.type + if typ == 'for_stmt': + types = annotation.find_type_from_comment_hint_for(context, node, tree_name) + if types: + return types + if typ == 'with_stmt': + types = annotation.find_type_from_comment_hint_with(context, node, tree_name) + if types: + return types + + if typ in ('for_stmt', 'comp_for', 'sync_comp_for'): + try: + types = context.predefined_names[node][tree_name.value] + except KeyError: + cn = ContextualizedNode(context, node.children[3]) + for_types = iterate_values( + cn.infer(), + contextualized_node=cn, + is_async=node.parent.type == 'async_stmt', + ) + n = TreeNameDefinition(context, tree_name) + types = check_tuple_assignments(n, for_types) + elif typ == 'expr_stmt': + types = infer_expr_stmt(context, node, tree_name) + elif typ == 'with_stmt': + value_managers = context.infer_node(node.get_test_node_from_name(tree_name)) + enter_methods = value_managers.py__getattribute__(u'__enter__') + return enter_methods.execute_with_values() + elif typ in ('import_from', 'import_name'): + types = imports.infer_import(context, tree_name) + elif typ in ('funcdef', 'classdef'): + types = _apply_decorators(context, node) + elif typ == 'try_stmt': + # TODO an exception can also be a tuple. Check for those. + # TODO check for types that are not classes and add it to + # the static analysis report. + exceptions = context.infer_node(tree_name.get_previous_sibling().get_previous_sibling()) + types = exceptions.execute_with_values() + elif typ == 'param': + types = NO_VALUES + elif typ == 'del_stmt': + types = NO_VALUES + else: + raise ValueError("Should not happen. type: %s" % typ) + return types + + +# We don't want to have functions/classes that are created by the same +# tree_node. +@inference_state_method_cache() +def _apply_decorators(context, node): + """ + Returns the function, that should to be executed in the end. + This is also the places where the decorators are processed. + """ + if node.type == 'classdef': + decoratee_value = ClassValue( + context.inference_state, + parent_context=context, + tree_node=node + ) + else: + decoratee_value = FunctionValue.from_context(context, node) + initial = values = ValueSet([decoratee_value]) + + if is_big_annoying_library(context): + return values + + for dec in reversed(node.get_decorators()): + debug.dbg('decorator: %s %s', dec, values, color="MAGENTA") + with debug.increase_indent_cm(): + dec_values = context.infer_node(dec.children[1]) + trailer_nodes = dec.children[2:-1] + if trailer_nodes: + # Create a trailer and infer it. + trailer = tree.PythonNode('trailer', trailer_nodes) + trailer.parent = dec + dec_values = infer_trailer(context, dec_values, trailer) + + if not len(dec_values): + code = dec.get_code(include_prefix=False) + # For the short future, we don't want to hear about the runtime + # decorator in typing that was intentionally omitted. This is not + # "correct", but helps with debugging. + if code != '@runtime\n': + debug.warning('decorator not found: %s on %s', dec, node) + return initial + + values = dec_values.execute(arguments.ValuesArguments([values])) + if not len(values): + debug.warning('not possible to resolve wrappers found %s', node) + return initial + + debug.dbg('decorator end %s', values, color="MAGENTA") + if values != initial: + return ValueSet([Decoratee(c, decoratee_value) for c in values]) + return values + + +def check_tuple_assignments(name, value_set): + """ + Checks if tuples are assigned. + """ + lazy_value = None + for index, node in name.assignment_indexes(): + cn = ContextualizedNode(name.parent_context, node) + iterated = value_set.iterate(cn) + if isinstance(index, slice): + # For no star unpacking is not possible. + return NO_VALUES + i = 0 + while i <= index: + try: + lazy_value = next(iterated) + except StopIteration: + # We could do this with the default param in next. But this + # would allow this loop to run for a very long time if the + # index number is high. Therefore break if the loop is + # finished. + return NO_VALUES + else: + i += lazy_value.max + value_set = lazy_value.infer() + return value_set + + +class ContextualizedSubscriptListNode(ContextualizedNode): + def infer(self): + return _infer_subscript_list(self.context, self.node) + + +def _infer_subscript_list(context, index): + """ + Handles slices in subscript nodes. + """ + if index == ':': + # Like array[:] + return ValueSet([iterable.Slice(context, None, None, None)]) + + elif index.type == 'subscript' and not index.children[0] == '.': + # subscript basically implies a slice operation, except for Python 2's + # Ellipsis. + # e.g. array[:3] + result = [] + for el in index.children: + if el == ':': + if not result: + result.append(None) + elif el.type == 'sliceop': + if len(el.children) == 2: + result.append(el.children[1]) + else: + result.append(el) + result += [None] * (3 - len(result)) + + return ValueSet([iterable.Slice(context, *result)]) + elif index.type == 'subscriptlist': + return ValueSet([iterable.SequenceLiteralValue(context.inference_state, context, index)]) + + # No slices + return context.infer_node(index) diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/sys_path.py b/.venv/lib/python3.8/site-packages/jedi/inference/sys_path.py new file mode 100644 index 00000000..5b82ec15 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/sys_path.py @@ -0,0 +1,271 @@ +import os +import re + +from jedi._compatibility import unicode, force_unicode, all_suffixes +from jedi.inference.cache import inference_state_method_cache +from jedi.inference.base_value import ContextualizedNode +from jedi.inference.helpers import is_string, get_str_or_none +from jedi.common import traverse_parents +from jedi.parser_utils import get_cached_code_lines +from jedi.file_io import FileIO +from jedi import settings +from jedi import debug + +_BUILDOUT_PATH_INSERTION_LIMIT = 10 + + +def _abs_path(module_context, path): + if os.path.isabs(path): + return path + + module_path = module_context.py__file__() + if module_path is None: + # In this case we have no idea where we actually are in the file + # system. + return None + + base_dir = os.path.dirname(module_path) + path = force_unicode(path) + return os.path.abspath(os.path.join(base_dir, path)) + + +def _paths_from_assignment(module_context, expr_stmt): + """ + Extracts the assigned strings from an assignment that looks as follows:: + + sys.path[0:0] = ['module/path', 'another/module/path'] + + This function is in general pretty tolerant (and therefore 'buggy'). + However, it's not a big issue usually to add more paths to Jedi's sys_path, + because it will only affect Jedi in very random situations and by adding + more paths than necessary, it usually benefits the general user. + """ + for assignee, operator in zip(expr_stmt.children[::2], expr_stmt.children[1::2]): + try: + assert operator in ['=', '+='] + assert assignee.type in ('power', 'atom_expr') and \ + len(assignee.children) > 1 + c = assignee.children + assert c[0].type == 'name' and c[0].value == 'sys' + trailer = c[1] + assert trailer.children[0] == '.' and trailer.children[1].value == 'path' + # TODO Essentially we're not checking details on sys.path + # manipulation. Both assigment of the sys.path and changing/adding + # parts of the sys.path are the same: They get added to the end of + # the current sys.path. + """ + execution = c[2] + assert execution.children[0] == '[' + subscript = execution.children[1] + assert subscript.type == 'subscript' + assert ':' in subscript.children + """ + except AssertionError: + continue + + cn = ContextualizedNode(module_context.create_context(expr_stmt), expr_stmt) + for lazy_value in cn.infer().iterate(cn): + for value in lazy_value.infer(): + if is_string(value): + abs_path = _abs_path(module_context, value.get_safe_value()) + if abs_path is not None: + yield abs_path + + +def _paths_from_list_modifications(module_context, trailer1, trailer2): + """ extract the path from either "sys.path.append" or "sys.path.insert" """ + # Guarantee that both are trailers, the first one a name and the second one + # a function execution with at least one param. + if not (trailer1.type == 'trailer' and trailer1.children[0] == '.' + and trailer2.type == 'trailer' and trailer2.children[0] == '(' + and len(trailer2.children) == 3): + return + + name = trailer1.children[1].value + if name not in ['insert', 'append']: + return + arg = trailer2.children[1] + if name == 'insert' and len(arg.children) in (3, 4): # Possible trailing comma. + arg = arg.children[2] + + for value in module_context.create_context(arg).infer_node(arg): + p = get_str_or_none(value) + if p is None: + continue + abs_path = _abs_path(module_context, p) + if abs_path is not None: + yield abs_path + + +@inference_state_method_cache(default=[]) +def check_sys_path_modifications(module_context): + """ + Detect sys.path modifications within module. + """ + def get_sys_path_powers(names): + for name in names: + power = name.parent.parent + if power is not None and power.type in ('power', 'atom_expr'): + c = power.children + if c[0].type == 'name' and c[0].value == 'sys' \ + and c[1].type == 'trailer': + n = c[1].children[1] + if n.type == 'name' and n.value == 'path': + yield name, power + + if module_context.tree_node is None: + return [] + + added = [] + try: + possible_names = module_context.tree_node.get_used_names()['path'] + except KeyError: + pass + else: + for name, power in get_sys_path_powers(possible_names): + expr_stmt = power.parent + if len(power.children) >= 4: + added.extend( + _paths_from_list_modifications( + module_context, *power.children[2:4] + ) + ) + elif expr_stmt is not None and expr_stmt.type == 'expr_stmt': + added.extend(_paths_from_assignment(module_context, expr_stmt)) + return added + + +def discover_buildout_paths(inference_state, script_path): + buildout_script_paths = set() + + for buildout_script_path in _get_buildout_script_paths(script_path): + for path in _get_paths_from_buildout_script(inference_state, buildout_script_path): + buildout_script_paths.add(path) + if len(buildout_script_paths) >= _BUILDOUT_PATH_INSERTION_LIMIT: + break + + return buildout_script_paths + + +def _get_paths_from_buildout_script(inference_state, buildout_script_path): + file_io = FileIO(buildout_script_path) + try: + module_node = inference_state.parse( + file_io=file_io, + cache=True, + cache_path=settings.cache_directory + ) + except IOError: + debug.warning('Error trying to read buildout_script: %s', buildout_script_path) + return + + from jedi.inference.value import ModuleValue + module_context = ModuleValue( + inference_state, module_node, + file_io=file_io, + string_names=None, + code_lines=get_cached_code_lines(inference_state.grammar, buildout_script_path), + ).as_context() + for path in check_sys_path_modifications(module_context): + yield path + + +def _get_parent_dir_with_file(path, filename): + for parent in traverse_parents(path): + if os.path.isfile(os.path.join(parent, filename)): + return parent + return None + + +def _get_buildout_script_paths(search_path): + """ + if there is a 'buildout.cfg' file in one of the parent directories of the + given module it will return a list of all files in the buildout bin + directory that look like python files. + + :param search_path: absolute path to the module. + :type search_path: str + """ + project_root = _get_parent_dir_with_file(search_path, 'buildout.cfg') + if not project_root: + return + bin_path = os.path.join(project_root, 'bin') + if not os.path.exists(bin_path): + return + + for filename in os.listdir(bin_path): + try: + filepath = os.path.join(bin_path, filename) + with open(filepath, 'r') as f: + firstline = f.readline() + if firstline.startswith('#!') and 'python' in firstline: + yield filepath + except (UnicodeDecodeError, IOError) as e: + # Probably a binary file; permission error or race cond. because + # file got deleted. Ignore it. + debug.warning(unicode(e)) + continue + + +def remove_python_path_suffix(path): + for suffix in all_suffixes() + ['.pyi']: + if path.endswith(suffix): + path = path[:-len(suffix)] + break + return path + + +def transform_path_to_dotted(sys_path, module_path): + """ + Returns the dotted path inside a sys.path as a list of names. e.g. + + >>> from os.path import abspath + >>> transform_path_to_dotted([abspath("/foo")], abspath('/foo/bar/baz.py')) + (('bar', 'baz'), False) + + Returns (None, False) if the path doesn't really resolve to anything. + The second return part is if it is a package. + """ + # First remove the suffix. + module_path = remove_python_path_suffix(module_path) + + # Once the suffix was removed we are using the files as we know them. This + # means that if someone uses an ending like .vim for a Python file, .vim + # will be part of the returned dotted part. + + is_package = module_path.endswith(os.path.sep + '__init__') + if is_package: + # -1 to remove the separator + module_path = module_path[:-len('__init__') - 1] + + def iter_potential_solutions(): + for p in sys_path: + if module_path.startswith(p): + # Strip the trailing slash/backslash + rest = module_path[len(p):] + # On Windows a path can also use a slash. + if rest.startswith(os.path.sep) or rest.startswith('/'): + # Remove a slash in cases it's still there. + rest = rest[1:] + + if rest: + split = rest.split(os.path.sep) + if not all(split): + # This means that part of the file path was empty, this + # is very strange and is probably a file that is called + # `.py`. + return + # Stub folders for foo can end with foo-stubs. Just remove + # it. + yield tuple(re.sub(r'-stubs$', '', s) for s in split) + + potential_solutions = tuple(iter_potential_solutions()) + if not potential_solutions: + return None, False + # Try to find the shortest path, this makes more sense usually, because the + # user usually has venvs somewhere. This means that a path like + # .tox/py37/lib/python3.7/os.py can be normal for a file. However in that + # case we definitely want to return ['os'] as a path and not a crazy + # ['.tox', 'py37', 'lib', 'python3.7', 'os']. Keep in mind that this is a + # heuristic and there's now ay to "always" do it right. + return sorted(potential_solutions, key=lambda p: len(p))[0], is_package diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/utils.py b/.venv/lib/python3.8/site-packages/jedi/inference/utils.py new file mode 100644 index 00000000..422e17e7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/utils.py @@ -0,0 +1,115 @@ +""" A universal module with functions / classes without dependencies. """ +import sys +import contextlib +import functools +import re +import os + +from jedi._compatibility import reraise + + +_sep = os.path.sep +if os.path.altsep is not None: + _sep += os.path.altsep +_path_re = re.compile(r'(?:\.[^{0}]+|[{0}]__init__\.py)$'.format(re.escape(_sep))) +del _sep + + +def to_list(func): + def wrapper(*args, **kwargs): + return list(func(*args, **kwargs)) + return wrapper + + +def to_tuple(func): + def wrapper(*args, **kwargs): + return tuple(func(*args, **kwargs)) + return wrapper + + +def unite(iterable): + """Turns a two dimensional array into a one dimensional.""" + return set(typ for types in iterable for typ in types) + + +class UncaughtAttributeError(Exception): + """ + Important, because `__getattr__` and `hasattr` catch AttributeErrors + implicitly. This is really evil (mainly because of `__getattr__`). + `hasattr` in Python 2 is even more evil, because it catches ALL exceptions. + Therefore this class originally had to be derived from `BaseException` + instead of `Exception`. But because I removed relevant `hasattr` from + the code base, we can now switch back to `Exception`. + + :param base: return values of sys.exc_info(). + """ + + +def safe_property(func): + return property(reraise_uncaught(func)) + + +def reraise_uncaught(func): + """ + Re-throw uncaught `AttributeError`. + + Usage: Put ``@rethrow_uncaught`` in front of the function + which does **not** suppose to raise `AttributeError`. + + AttributeError is easily get caught by `hasattr` and another + ``except AttributeError`` clause. This becomes problem when you use + a lot of "dynamic" attributes (e.g., using ``@property``) because you + can't distinguish if the property does not exist for real or some code + inside of the "dynamic" attribute through that error. In a well + written code, such error should not exist but getting there is very + difficult. This decorator is to help us getting there by changing + `AttributeError` to `UncaughtAttributeError` to avoid unexpected catch. + This helps us noticing bugs earlier and facilitates debugging. + + .. note:: Treating StopIteration here is easy. + Add that feature when needed. + """ + @functools.wraps(func) + def wrapper(*args, **kwds): + try: + return func(*args, **kwds) + except AttributeError: + exc_info = sys.exc_info() + reraise(UncaughtAttributeError(exc_info[1]), exc_info[2]) + return wrapper + + +class PushBackIterator(object): + def __init__(self, iterator): + self.pushes = [] + self.iterator = iterator + self.current = None + + def push_back(self, value): + self.pushes.append(value) + + def __iter__(self): + return self + + def next(self): + """ Python 2 Compatibility """ + return self.__next__() + + def __next__(self): + if self.pushes: + self.current = self.pushes.pop() + else: + self.current = next(self.iterator) + return self.current + + +@contextlib.contextmanager +def ignored(*exceptions): + """ + Value manager that ignores all of the specified exceptions. This will + be in the standard library starting with Python 3.5. + """ + try: + yield + except exceptions: + pass diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/value/__init__.py b/.venv/lib/python3.8/site-packages/jedi/inference/value/__init__.py new file mode 100644 index 00000000..2e17ba26 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/value/__init__.py @@ -0,0 +1,6 @@ +from jedi.inference.value.module import ModuleValue +from jedi.inference.value.klass import ClassValue +from jedi.inference.value.function import FunctionValue, \ + MethodValue +from jedi.inference.value.instance import AnonymousInstance, BoundMethod, \ + CompiledInstance, AbstractInstanceValue, TreeInstance diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..8296da0b Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/decorator.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/decorator.cpython-38.pyc new file mode 100644 index 00000000..c875a475 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/decorator.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/dynamic_arrays.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/dynamic_arrays.cpython-38.pyc new file mode 100644 index 00000000..50c2f1aa Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/dynamic_arrays.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/function.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/function.cpython-38.pyc new file mode 100644 index 00000000..5e83a3fa Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/function.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/instance.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/instance.cpython-38.pyc new file mode 100644 index 00000000..0ff91543 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/instance.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/iterable.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/iterable.cpython-38.pyc new file mode 100644 index 00000000..8a53b37d Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/iterable.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/klass.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/klass.cpython-38.pyc new file mode 100644 index 00000000..499cae55 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/klass.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/module.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/module.cpython-38.pyc new file mode 100644 index 00000000..5ac3e409 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/module.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/namespace.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/namespace.cpython-38.pyc new file mode 100644 index 00000000..e0c7bb3d Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/inference/value/__pycache__/namespace.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/value/decorator.py b/.venv/lib/python3.8/site-packages/jedi/inference/value/decorator.py new file mode 100644 index 00000000..3fe4be40 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/value/decorator.py @@ -0,0 +1,15 @@ +''' +Decorators are not really values, however we need some wrappers to improve +docstrings and other things around decorators. +''' + +from jedi.inference.base_value import ValueWrapper + + +class Decoratee(ValueWrapper): + def __init__(self, wrapped_value, original_value): + super(Decoratee, self).__init__(wrapped_value) + self._original_value = original_value + + def py__doc__(self): + return self._original_value.py__doc__() diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/value/dynamic_arrays.py b/.venv/lib/python3.8/site-packages/jedi/inference/value/dynamic_arrays.py new file mode 100644 index 00000000..e0b38f54 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/value/dynamic_arrays.py @@ -0,0 +1,204 @@ +""" +A module to deal with stuff like `list.append` and `set.add`. + +Array modifications +******************* + +If the content of an array (``set``/``list``) is requested somewhere, the +current module will be checked for appearances of ``arr.append``, +``arr.insert``, etc. If the ``arr`` name points to an actual array, the +content will be added + +This can be really cpu intensive, as you can imagine. Because |jedi| has to +follow **every** ``append`` and check whether it's the right array. However this +works pretty good, because in *slow* cases, the recursion detector and other +settings will stop this process. + +It is important to note that: + +1. Array modfications work only in the current module. +2. Jedi only checks Array additions; ``list.pop``, etc are ignored. +""" +from jedi import debug +from jedi import settings +from jedi.inference import recursion +from jedi.inference.base_value import ValueSet, NO_VALUES, HelperValueMixin, \ + ValueWrapper +from jedi.inference.lazy_value import LazyKnownValues +from jedi.inference.helpers import infer_call_of_leaf +from jedi.inference.cache import inference_state_method_cache + +_sentinel = object() + + +def check_array_additions(context, sequence): + """ Just a mapper function for the internal _internal_check_array_additions """ + if sequence.array_type not in ('list', 'set'): + # TODO also check for dict updates + return NO_VALUES + + return _internal_check_array_additions(context, sequence) + + +@inference_state_method_cache(default=NO_VALUES) +@debug.increase_indent +def _internal_check_array_additions(context, sequence): + """ + Checks if a `Array` has "add" (append, insert, extend) statements: + + >>> a = [""] + >>> a.append(1) + """ + from jedi.inference import arguments + + debug.dbg('Dynamic array search for %s' % sequence, color='MAGENTA') + module_context = context.get_root_context() + if not settings.dynamic_array_additions or module_context.is_compiled(): + debug.dbg('Dynamic array search aborted.', color='MAGENTA') + return NO_VALUES + + def find_additions(context, arglist, add_name): + params = list(arguments.TreeArguments(context.inference_state, context, arglist).unpack()) + result = set() + if add_name in ['insert']: + params = params[1:] + if add_name in ['append', 'add', 'insert']: + for key, lazy_value in params: + result.add(lazy_value) + elif add_name in ['extend', 'update']: + for key, lazy_value in params: + result |= set(lazy_value.infer().iterate()) + return result + + temp_param_add, settings.dynamic_params_for_other_modules = \ + settings.dynamic_params_for_other_modules, False + + is_list = sequence.name.string_name == 'list' + search_names = (['append', 'extend', 'insert'] if is_list else ['add', 'update']) + + added_types = set() + for add_name in search_names: + try: + possible_names = module_context.tree_node.get_used_names()[add_name] + except KeyError: + continue + else: + for name in possible_names: + value_node = context.tree_node + if not (value_node.start_pos < name.start_pos < value_node.end_pos): + continue + trailer = name.parent + power = trailer.parent + trailer_pos = power.children.index(trailer) + try: + execution_trailer = power.children[trailer_pos + 1] + except IndexError: + continue + else: + if execution_trailer.type != 'trailer' \ + or execution_trailer.children[0] != '(' \ + or execution_trailer.children[1] == ')': + continue + + random_context = context.create_context(name) + + with recursion.execution_allowed(context.inference_state, power) as allowed: + if allowed: + found = infer_call_of_leaf( + random_context, + name, + cut_own_trailer=True + ) + if sequence in found: + # The arrays match. Now add the results + added_types |= find_additions( + random_context, + execution_trailer.children[1], + add_name + ) + + # reset settings + settings.dynamic_params_for_other_modules = temp_param_add + debug.dbg('Dynamic array result %s', added_types, color='MAGENTA') + return added_types + + +def get_dynamic_array_instance(instance, arguments): + """Used for set() and list() instances.""" + ai = _DynamicArrayAdditions(instance, arguments) + from jedi.inference import arguments + return arguments.ValuesArguments([ValueSet([ai])]) + + +class _DynamicArrayAdditions(HelperValueMixin): + """ + Used for the usage of set() and list(). + This is definitely a hack, but a good one :-) + It makes it possible to use set/list conversions. + + This is not a proper context, because it doesn't have to be. It's not used + in the wild, it's just used within typeshed as an argument to `__init__` + for set/list and never used in any other place. + """ + def __init__(self, instance, arguments): + self._instance = instance + self._arguments = arguments + + def py__class__(self): + tuple_, = self._instance.inference_state.builtins_module.py__getattribute__('tuple') + return tuple_ + + def py__iter__(self, contextualized_node=None): + arguments = self._arguments + try: + _, lazy_value = next(arguments.unpack()) + except StopIteration: + pass + else: + for lazy in lazy_value.infer().iterate(): + yield lazy + + from jedi.inference.arguments import TreeArguments + if isinstance(arguments, TreeArguments): + additions = _internal_check_array_additions(arguments.context, self._instance) + for addition in additions: + yield addition + + def iterate(self, contextualized_node=None, is_async=False): + return self.py__iter__(contextualized_node) + + +class _Modification(ValueWrapper): + def __init__(self, wrapped_value, assigned_values, contextualized_key): + super(_Modification, self).__init__(wrapped_value) + self._assigned_values = assigned_values + self._contextualized_key = contextualized_key + + def py__getitem__(self, *args, **kwargs): + return self._wrapped_value.py__getitem__(*args, **kwargs) | self._assigned_values + + def py__simple_getitem__(self, index): + actual = [ + v.get_safe_value(_sentinel) + for v in self._contextualized_key.infer() + ] + if index in actual: + return self._assigned_values + return self._wrapped_value.py__simple_getitem__(index) + + +class DictModification(_Modification): + def py__iter__(self, contextualized_node=None): + for lazy_context in self._wrapped_value.py__iter__(contextualized_node): + yield lazy_context + yield self._contextualized_key + + def get_key_values(self): + return self._wrapped_value.get_key_values() | self._contextualized_key.infer() + + +class ListModification(_Modification): + def py__iter__(self, contextualized_node=None): + for lazy_context in self._wrapped_value.py__iter__(contextualized_node): + yield lazy_context + yield LazyKnownValues(self._assigned_values) diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/value/function.py b/.venv/lib/python3.8/site-packages/jedi/inference/value/function.py new file mode 100644 index 00000000..7513c6a9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/value/function.py @@ -0,0 +1,470 @@ +from parso.python import tree + +from jedi._compatibility import use_metaclass +from jedi import debug +from jedi.inference.cache import inference_state_method_cache, CachedMetaClass +from jedi.inference import compiled +from jedi.inference import recursion +from jedi.inference import docstrings +from jedi.inference import flow_analysis +from jedi.inference.signature import TreeSignature +from jedi.inference.filters import ParserTreeFilter, FunctionExecutionFilter, \ + AnonymousFunctionExecutionFilter +from jedi.inference.names import ValueName, AbstractNameDefinition, \ + AnonymousParamName, ParamName, NameWrapper +from jedi.inference.base_value import ContextualizedNode, NO_VALUES, \ + ValueSet, TreeValue, ValueWrapper +from jedi.inference.lazy_value import LazyKnownValues, LazyKnownValue, \ + LazyTreeValue +from jedi.inference.context import ValueContext, TreeContextMixin +from jedi.inference.value import iterable +from jedi import parser_utils +from jedi.inference.parser_cache import get_yield_exprs +from jedi.inference.helpers import values_from_qualified_names +from jedi.inference.gradual.generics import TupleGenericManager + + +class LambdaName(AbstractNameDefinition): + string_name = '' + api_type = u'function' + + def __init__(self, lambda_value): + self._lambda_value = lambda_value + self.parent_context = lambda_value.parent_context + + @property + def start_pos(self): + return self._lambda_value.tree_node.start_pos + + def infer(self): + return ValueSet([self._lambda_value]) + + +class FunctionAndClassBase(TreeValue): + def get_qualified_names(self): + if self.parent_context.is_class(): + n = self.parent_context.get_qualified_names() + if n is None: + # This means that the parent class lives within a function. + return None + return n + (self.py__name__(),) + elif self.parent_context.is_module(): + return (self.py__name__(),) + else: + return None + + +class FunctionMixin(object): + api_type = u'function' + + def get_filters(self, origin_scope=None): + cls = self.py__class__() + for instance in cls.execute_with_values(): + for filter in instance.get_filters(origin_scope=origin_scope): + yield filter + + def py__get__(self, instance, class_value): + from jedi.inference.value.instance import BoundMethod + if instance is None: + # Calling the Foo.bar results in the original bar function. + return ValueSet([self]) + return ValueSet([BoundMethod(instance, class_value.as_context(), self)]) + + def get_param_names(self): + return [AnonymousParamName(self, param.name) + for param in self.tree_node.get_params()] + + @property + def name(self): + if self.tree_node.type == 'lambdef': + return LambdaName(self) + return ValueName(self, self.tree_node.name) + + def is_function(self): + return True + + def py__name__(self): + return self.name.string_name + + def get_type_hint(self, add_class_info=True): + return_annotation = self.tree_node.annotation + if return_annotation is None: + def param_name_to_str(n): + s = n.string_name + annotation = n.infer().get_type_hint() + if annotation is not None: + s += ': ' + annotation + if n.default_node is not None: + s += '=' + n.default_node.get_code(include_prefix=False) + return s + + function_execution = self.as_context() + result = function_execution.infer() + return_hint = result.get_type_hint() + body = self.py__name__() + '(%s)' % ', '.join([ + param_name_to_str(n) + for n in function_execution.get_param_names() + ]) + if return_hint is None: + return body + else: + return_hint = return_annotation.get_code(include_prefix=False) + body = self.py__name__() + self.tree_node.children[2].get_code(include_prefix=False) + + return body + ' -> ' + return_hint + + def py__call__(self, arguments): + function_execution = self.as_context(arguments) + return function_execution.infer() + + def _as_context(self, arguments=None): + if arguments is None: + return AnonymousFunctionExecution(self) + return FunctionExecutionContext(self, arguments) + + def get_signatures(self): + return [TreeSignature(f) for f in self.get_signature_functions()] + + +class FunctionValue(use_metaclass(CachedMetaClass, FunctionMixin, FunctionAndClassBase)): + @classmethod + def from_context(cls, context, tree_node): + def create(tree_node): + if context.is_class(): + return MethodValue( + context.inference_state, + context, + parent_context=parent_context, + tree_node=tree_node + ) + else: + return cls( + context.inference_state, + parent_context=parent_context, + tree_node=tree_node + ) + + overloaded_funcs = list(_find_overload_functions(context, tree_node)) + + parent_context = context + while parent_context.is_class() or parent_context.is_instance(): + parent_context = parent_context.parent_context + + function = create(tree_node) + + if overloaded_funcs: + return OverloadedFunctionValue( + function, + # Get them into the correct order: lower line first. + list(reversed([create(f) for f in overloaded_funcs])) + ) + return function + + def py__class__(self): + c, = values_from_qualified_names(self.inference_state, u'types', u'FunctionType') + return c + + def get_default_param_context(self): + return self.parent_context + + def get_signature_functions(self): + return [self] + + +class FunctionNameInClass(NameWrapper): + def __init__(self, class_context, name): + super(FunctionNameInClass, self).__init__(name) + self._class_context = class_context + + def get_defining_qualified_value(self): + return self._class_context.get_value() # Might be None. + + +class MethodValue(FunctionValue): + def __init__(self, inference_state, class_context, *args, **kwargs): + super(MethodValue, self).__init__(inference_state, *args, **kwargs) + self.class_context = class_context + + def get_default_param_context(self): + return self.class_context + + def get_qualified_names(self): + # Need to implement this, because the parent value of a method + # value is not the class value but the module. + names = self.class_context.get_qualified_names() + if names is None: + return None + return names + (self.py__name__(),) + + @property + def name(self): + return FunctionNameInClass(self.class_context, super(MethodValue, self).name) + + +class BaseFunctionExecutionContext(ValueContext, TreeContextMixin): + def _infer_annotations(self): + raise NotImplementedError + + @inference_state_method_cache(default=NO_VALUES) + @recursion.execution_recursion_decorator() + def get_return_values(self, check_yields=False): + funcdef = self.tree_node + if funcdef.type == 'lambdef': + return self.infer_node(funcdef.children[-1]) + + if check_yields: + value_set = NO_VALUES + returns = get_yield_exprs(self.inference_state, funcdef) + else: + value_set = self._infer_annotations() + if value_set: + # If there are annotations, prefer them over anything else. + # This will make it faster. + return value_set + value_set |= docstrings.infer_return_types(self._value) + returns = funcdef.iter_return_stmts() + + for r in returns: + if check_yields: + value_set |= ValueSet.from_sets( + lazy_value.infer() + for lazy_value in self._get_yield_lazy_value(r) + ) + else: + check = flow_analysis.reachability_check(self, funcdef, r) + if check is flow_analysis.UNREACHABLE: + debug.dbg('Return unreachable: %s', r) + else: + try: + children = r.children + except AttributeError: + ctx = compiled.builtin_from_name(self.inference_state, u'None') + value_set |= ValueSet([ctx]) + else: + value_set |= self.infer_node(children[1]) + if check is flow_analysis.REACHABLE: + debug.dbg('Return reachable: %s', r) + break + return value_set + + def _get_yield_lazy_value(self, yield_expr): + if yield_expr.type == 'keyword': + # `yield` just yields None. + ctx = compiled.builtin_from_name(self.inference_state, u'None') + yield LazyKnownValue(ctx) + return + + node = yield_expr.children[1] + if node.type == 'yield_arg': # It must be a yield from. + cn = ContextualizedNode(self, node.children[1]) + for lazy_value in cn.infer().iterate(cn): + yield lazy_value + else: + yield LazyTreeValue(self, node) + + @recursion.execution_recursion_decorator(default=iter([])) + def get_yield_lazy_values(self, is_async=False): + # TODO: if is_async, wrap yield statements in Awaitable/async_generator_asend + for_parents = [(y, tree.search_ancestor(y, 'for_stmt', 'funcdef', + 'while_stmt', 'if_stmt')) + for y in get_yield_exprs(self.inference_state, self.tree_node)] + + # Calculate if the yields are placed within the same for loop. + yields_order = [] + last_for_stmt = None + for yield_, for_stmt in for_parents: + # For really simple for loops we can predict the order. Otherwise + # we just ignore it. + parent = for_stmt.parent + if parent.type == 'suite': + parent = parent.parent + if for_stmt.type == 'for_stmt' and parent == self.tree_node \ + and parser_utils.for_stmt_defines_one_name(for_stmt): # Simplicity for now. + if for_stmt == last_for_stmt: + yields_order[-1][1].append(yield_) + else: + yields_order.append((for_stmt, [yield_])) + elif for_stmt == self.tree_node: + yields_order.append((None, [yield_])) + else: + types = self.get_return_values(check_yields=True) + if types: + yield LazyKnownValues(types, min=0, max=float('inf')) + return + last_for_stmt = for_stmt + + for for_stmt, yields in yields_order: + if for_stmt is None: + # No for_stmt, just normal yields. + for yield_ in yields: + for result in self._get_yield_lazy_value(yield_): + yield result + else: + input_node = for_stmt.get_testlist() + cn = ContextualizedNode(self, input_node) + ordered = cn.infer().iterate(cn) + ordered = list(ordered) + for lazy_value in ordered: + dct = {str(for_stmt.children[1].value): lazy_value.infer()} + with self.predefine_names(for_stmt, dct): + for yield_in_same_for_stmt in yields: + for result in self._get_yield_lazy_value(yield_in_same_for_stmt): + yield result + + def merge_yield_values(self, is_async=False): + return ValueSet.from_sets( + lazy_value.infer() + for lazy_value in self.get_yield_lazy_values() + ) + + def is_generator(self): + return bool(get_yield_exprs(self.inference_state, self.tree_node)) + + def infer(self): + """ + Created to be used by inheritance. + """ + inference_state = self.inference_state + is_coroutine = self.tree_node.parent.type in ('async_stmt', 'async_funcdef') + from jedi.inference.gradual.base import GenericClass + + if is_coroutine: + if self.is_generator(): + if inference_state.environment.version_info < (3, 6): + return NO_VALUES + async_generator_classes = inference_state.typing_module \ + .py__getattribute__('AsyncGenerator') + + yield_values = self.merge_yield_values(is_async=True) + # The contravariant doesn't seem to be defined. + generics = (yield_values.py__class__(), NO_VALUES) + return ValueSet( + # In Python 3.6 AsyncGenerator is still a class. + GenericClass(c, TupleGenericManager(generics)) + for c in async_generator_classes + ).execute_annotation() + else: + if inference_state.environment.version_info < (3, 5): + return NO_VALUES + async_classes = inference_state.typing_module.py__getattribute__('Coroutine') + return_values = self.get_return_values() + # Only the first generic is relevant. + generics = (return_values.py__class__(), NO_VALUES, NO_VALUES) + return ValueSet( + GenericClass(c, TupleGenericManager(generics)) for c in async_classes + ).execute_annotation() + else: + if self.is_generator(): + return ValueSet([iterable.Generator(inference_state, self)]) + else: + return self.get_return_values() + + +class FunctionExecutionContext(BaseFunctionExecutionContext): + def __init__(self, function_value, arguments): + super(FunctionExecutionContext, self).__init__(function_value) + self._arguments = arguments + + def get_filters(self, until_position=None, origin_scope=None): + yield FunctionExecutionFilter( + self, self._value, + until_position=until_position, + origin_scope=origin_scope, + arguments=self._arguments + ) + + def _infer_annotations(self): + from jedi.inference.gradual.annotation import infer_return_types + return infer_return_types(self._value, self._arguments) + + def get_param_names(self): + return [ + ParamName(self._value, param.name, self._arguments) + for param in self._value.tree_node.get_params() + ] + + +class AnonymousFunctionExecution(BaseFunctionExecutionContext): + def _infer_annotations(self): + # I don't think inferring anonymous executions is a big thing. + # Anonymous contexts are mostly there for the user to work in. ~ dave + return NO_VALUES + + def get_filters(self, until_position=None, origin_scope=None): + yield AnonymousFunctionExecutionFilter( + self, self._value, + until_position=until_position, + origin_scope=origin_scope, + ) + + def get_param_names(self): + return self._value.get_param_names() + + +class OverloadedFunctionValue(FunctionMixin, ValueWrapper): + def __init__(self, function, overloaded_functions): + super(OverloadedFunctionValue, self).__init__(function) + self._overloaded_functions = overloaded_functions + + def py__call__(self, arguments): + debug.dbg("Execute overloaded function %s", self._wrapped_value, color='BLUE') + function_executions = [] + for signature in self.get_signatures(): + function_execution = signature.value.as_context(arguments) + function_executions.append(function_execution) + if signature.matches_signature(arguments): + return function_execution.infer() + + if self.inference_state.is_analysis: + # In this case we want precision. + return NO_VALUES + return ValueSet.from_sets(fe.infer() for fe in function_executions) + + def get_signature_functions(self): + return self._overloaded_functions + + def get_type_hint(self, add_class_info=True): + return 'Union[%s]' % ', '.join(f.get_type_hint() for f in self._overloaded_functions) + + +def _find_overload_functions(context, tree_node): + def _is_overload_decorated(funcdef): + if funcdef.parent.type == 'decorated': + decorators = funcdef.parent.children[0] + if decorators.type == 'decorator': + decorators = [decorators] + else: + decorators = decorators.children + for decorator in decorators: + dotted_name = decorator.children[1] + if dotted_name.type == 'name' and dotted_name.value == 'overload': + # TODO check with values if it's the right overload + return True + return False + + if tree_node.type == 'lambdef': + return + + if _is_overload_decorated(tree_node): + yield tree_node + + while True: + filter = ParserTreeFilter( + context, + until_position=tree_node.start_pos + ) + names = filter.get(tree_node.name.value) + assert isinstance(names, list) + if not names: + break + + found = False + for name in names: + funcdef = name.tree_name.parent + if funcdef.type == 'funcdef' and _is_overload_decorated(funcdef): + tree_node = funcdef + found = True + yield funcdef + + if not found: + break diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/value/instance.py b/.venv/lib/python3.8/site-packages/jedi/inference/value/instance.py new file mode 100644 index 00000000..5435c791 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/value/instance.py @@ -0,0 +1,625 @@ +from abc import abstractproperty + +from parso.python.tree import search_ancestor + +from jedi import debug +from jedi import settings +from jedi.inference import compiled +from jedi.inference.compiled.value import CompiledValueFilter +from jedi.inference.helpers import values_from_qualified_names, is_big_annoying_library +from jedi.inference.filters import AbstractFilter, AnonymousFunctionExecutionFilter +from jedi.inference.names import ValueName, TreeNameDefinition, ParamName, \ + NameWrapper +from jedi.inference.base_value import Value, NO_VALUES, ValueSet, \ + iterator_to_value_set, ValueWrapper +from jedi.inference.lazy_value import LazyKnownValue, LazyKnownValues +from jedi.inference.cache import inference_state_method_cache +from jedi.inference.arguments import ValuesArguments, TreeArgumentsWrapper +from jedi.inference.value.function import \ + FunctionValue, FunctionMixin, OverloadedFunctionValue, \ + BaseFunctionExecutionContext, FunctionExecutionContext, FunctionNameInClass +from jedi.inference.value.klass import ClassFilter +from jedi.inference.value.dynamic_arrays import get_dynamic_array_instance +from jedi.parser_utils import function_is_staticmethod, function_is_classmethod + + +class InstanceExecutedParamName(ParamName): + def __init__(self, instance, function_value, tree_name): + super(InstanceExecutedParamName, self).__init__( + function_value, tree_name, arguments=None) + self._instance = instance + + def infer(self): + return ValueSet([self._instance]) + + def matches_signature(self): + return True + + +class AnonymousMethodExecutionFilter(AnonymousFunctionExecutionFilter): + def __init__(self, instance, *args, **kwargs): + super(AnonymousMethodExecutionFilter, self).__init__(*args, **kwargs) + self._instance = instance + + def _convert_param(self, param, name): + if param.position_index == 0: + if function_is_classmethod(self._function_value.tree_node): + return InstanceExecutedParamName( + self._instance.py__class__(), + self._function_value, + name + ) + elif not function_is_staticmethod(self._function_value.tree_node): + return InstanceExecutedParamName( + self._instance, + self._function_value, + name + ) + return super(AnonymousMethodExecutionFilter, self)._convert_param(param, name) + + +class AnonymousMethodExecutionContext(BaseFunctionExecutionContext): + def __init__(self, instance, value): + super(AnonymousMethodExecutionContext, self).__init__(value) + self.instance = instance + + def get_filters(self, until_position=None, origin_scope=None): + yield AnonymousMethodExecutionFilter( + self.instance, self, self._value, + until_position=until_position, + origin_scope=origin_scope, + ) + + def get_param_names(self): + param_names = list(self._value.get_param_names()) + # set the self name + param_names[0] = InstanceExecutedParamName( + self.instance, + self._value, + param_names[0].tree_name + ) + return param_names + + +class MethodExecutionContext(FunctionExecutionContext): + def __init__(self, instance, *args, **kwargs): + super(MethodExecutionContext, self).__init__(*args, **kwargs) + self.instance = instance + + +class AbstractInstanceValue(Value): + api_type = u'instance' + + def __init__(self, inference_state, parent_context, class_value): + super(AbstractInstanceValue, self).__init__(inference_state, parent_context) + # Generated instances are classes that are just generated by self + # (No arguments) used. + self.class_value = class_value + + def is_instance(self): + return True + + def get_qualified_names(self): + return self.class_value.get_qualified_names() + + def get_annotated_class_object(self): + return self.class_value # This is the default. + + def py__class__(self): + return self.class_value + + def py__bool__(self): + # Signalize that we don't know about the bool type. + return None + + @abstractproperty + def name(self): + raise NotImplementedError + + def get_signatures(self): + call_funcs = self.py__getattribute__('__call__').py__get__(self, self.class_value) + return [s.bind(self) for s in call_funcs.get_signatures()] + + def get_function_slot_names(self, name): + # Searches for Python functions in classes. + return [] + + def execute_function_slots(self, names, *inferred_args): + return ValueSet.from_sets( + name.infer().execute_with_values(*inferred_args) + for name in names + ) + + def get_type_hint(self, add_class_info=True): + return self.py__name__() + + def __repr__(self): + return "<%s of %s>" % (self.__class__.__name__, self.class_value) + + +class CompiledInstance(AbstractInstanceValue): + # This is not really a compiled class, it's just an instance from a + # compiled class. + def __init__(self, inference_state, parent_context, class_value, arguments): + super(CompiledInstance, self).__init__(inference_state, parent_context, + class_value) + self._arguments = arguments + + def get_filters(self, origin_scope=None, include_self_names=True): + class_value = self.get_annotated_class_object() + class_filters = class_value.get_filters( + origin_scope=origin_scope, + is_instance=True, + ) + for f in class_filters: + yield CompiledInstanceClassFilter(self, f) + + @property + def name(self): + return compiled.CompiledValueName(self, self.class_value.name.string_name) + + def is_stub(self): + return False + + +class _BaseTreeInstance(AbstractInstanceValue): + @property + def array_type(self): + name = self.class_value.py__name__() + if name in ['list', 'set', 'dict'] \ + and self.parent_context.get_root_context().is_builtins_module(): + return name + return None + + @property + def name(self): + return ValueName(self, self.class_value.name.tree_name) + + def get_filters(self, origin_scope=None, include_self_names=True): + class_value = self.get_annotated_class_object() + if include_self_names: + for cls in class_value.py__mro__(): + if not cls.is_compiled(): + # In this case we're excluding compiled objects that are + # not fake objects. It doesn't make sense for normal + # compiled objects to search for self variables. + yield SelfAttributeFilter(self, class_value, cls.as_context(), origin_scope) + + class_filters = class_value.get_filters( + origin_scope=origin_scope, + is_instance=True, + ) + for f in class_filters: + if isinstance(f, ClassFilter): + yield InstanceClassFilter(self, f) + elif isinstance(f, CompiledValueFilter): + yield CompiledInstanceClassFilter(self, f) + else: + # Propably from the metaclass. + yield f + + @inference_state_method_cache() + def create_instance_context(self, class_context, node): + new = node + while True: + func_node = new + new = search_ancestor(new, 'funcdef', 'classdef') + if class_context.tree_node is new: + func = FunctionValue.from_context(class_context, func_node) + bound_method = BoundMethod(self, class_context, func) + if func_node.name.value == '__init__': + context = bound_method.as_context(self._arguments) + else: + context = bound_method.as_context() + break + return context.create_context(node) + + def py__getattribute__alternatives(self, string_name): + ''' + Since nothing was inferred, now check the __getattr__ and + __getattribute__ methods. Stubs don't need to be checked, because + they don't contain any logic. + ''' + if self.is_stub(): + return NO_VALUES + + name = compiled.create_simple_object(self.inference_state, string_name) + + # This is a little bit special. `__getattribute__` is in Python + # executed before `__getattr__`. But: I know no use case, where + # this could be practical and where Jedi would return wrong types. + # If you ever find something, let me know! + # We are inversing this, because a hand-crafted `__getattribute__` + # could still call another hand-crafted `__getattr__`, but not the + # other way around. + if is_big_annoying_library(self.parent_context): + return NO_VALUES + names = (self.get_function_slot_names(u'__getattr__') + or self.get_function_slot_names(u'__getattribute__')) + return self.execute_function_slots(names, name) + + def py__getitem__(self, index_value_set, contextualized_node): + names = self.get_function_slot_names(u'__getitem__') + if not names: + return super(_BaseTreeInstance, self).py__getitem__( + index_value_set, + contextualized_node, + ) + + args = ValuesArguments([index_value_set]) + return ValueSet.from_sets(name.infer().execute(args) for name in names) + + def py__iter__(self, contextualized_node=None): + iter_slot_names = self.get_function_slot_names(u'__iter__') + if not iter_slot_names: + return super(_BaseTreeInstance, self).py__iter__(contextualized_node) + + def iterate(): + for generator in self.execute_function_slots(iter_slot_names): + if generator.is_instance() and not generator.is_compiled(): + # `__next__` logic. + if self.inference_state.environment.version_info.major == 2: + name = u'next' + else: + name = u'__next__' + next_slot_names = generator.get_function_slot_names(name) + if next_slot_names: + yield LazyKnownValues( + generator.execute_function_slots(next_slot_names) + ) + else: + debug.warning('Instance has no __next__ function in %s.', generator) + else: + for lazy_value in generator.py__iter__(): + yield lazy_value + return iterate() + + def py__call__(self, arguments): + names = self.get_function_slot_names(u'__call__') + if not names: + # Means the Instance is not callable. + return super(_BaseTreeInstance, self).py__call__(arguments) + + return ValueSet.from_sets(name.infer().execute(arguments) for name in names) + + def py__get__(self, instance, class_value): + """ + obj may be None. + """ + # Arguments in __get__ descriptors are obj, class. + # `method` is the new parent of the array, don't know if that's good. + for cls in self.class_value.py__mro__(): + result = cls.py__get__on_class(self, instance, class_value) + if result is not NotImplemented: + return result + + names = self.get_function_slot_names(u'__get__') + if names: + if instance is None: + instance = compiled.builtin_from_name(self.inference_state, u'None') + return self.execute_function_slots(names, instance, class_value) + else: + return ValueSet([self]) + + def get_function_slot_names(self, name): + # Python classes don't look at the dictionary of the instance when + # looking up `__call__`. This is something that has to do with Python's + # internal slot system (note: not __slots__, but C slots). + for filter in self.get_filters(include_self_names=False): + names = filter.get(name) + if names: + return names + return [] + + +class TreeInstance(_BaseTreeInstance): + def __init__(self, inference_state, parent_context, class_value, arguments): + # I don't think that dynamic append lookups should happen here. That + # sounds more like something that should go to py__iter__. + if class_value.py__name__() in ['list', 'set'] \ + and parent_context.get_root_context().is_builtins_module(): + # compare the module path with the builtin name. + if settings.dynamic_array_additions: + arguments = get_dynamic_array_instance(self, arguments) + + super(TreeInstance, self).__init__(inference_state, parent_context, class_value) + self._arguments = arguments + self.tree_node = class_value.tree_node + + # This can recurse, if the initialization of the class includes a reference + # to itself. + @inference_state_method_cache(default=None) + def _get_annotated_class_object(self): + from jedi.inference.gradual.annotation import py__annotations__, \ + infer_type_vars_for_execution + + args = InstanceArguments(self, self._arguments) + for signature in self.class_value.py__getattribute__('__init__').get_signatures(): + # Just take the first result, it should always be one, because we + # control the typeshed code. + funcdef = signature.value.tree_node + if funcdef is None or funcdef.type != 'funcdef' \ + or not signature.matches_signature(args): + # First check if the signature even matches, if not we don't + # need to infer anything. + continue + bound_method = BoundMethod(self, self.class_value.as_context(), signature.value) + all_annotations = py__annotations__(funcdef) + type_var_dict = infer_type_vars_for_execution(bound_method, args, all_annotations) + if type_var_dict: + defined, = self.class_value.define_generics( + infer_type_vars_for_execution(signature.value, args, all_annotations), + ) + debug.dbg('Inferred instance value as %s', defined, color='BLUE') + return defined + return None + + def get_annotated_class_object(self): + return self._get_annotated_class_object() or self.class_value + + def get_key_values(self): + values = NO_VALUES + if self.array_type == 'dict': + for i, (key, instance) in enumerate(self._arguments.unpack()): + if key is None and i == 0: + values |= ValueSet.from_sets( + v.get_key_values() + for v in instance.infer() + if v.array_type == 'dict' + ) + if key: + values |= ValueSet([compiled.create_simple_object( + self.inference_state, + key, + )]) + + return values + + def py__simple_getitem__(self, index): + if self.array_type == 'dict': + # Logic for dict({'foo': bar}) and dict(foo=bar) + # reversed, because: + # >>> dict({'a': 1}, a=3) + # {'a': 3} + # TODO tuple initializations + # >>> dict([('a', 4)]) + # {'a': 4} + for key, lazy_context in reversed(list(self._arguments.unpack())): + if key is None: + values = ValueSet.from_sets( + dct_value.py__simple_getitem__(index) + for dct_value in lazy_context.infer() + if dct_value.array_type == 'dict' + ) + if values: + return values + else: + if key == index: + return lazy_context.infer() + return super(TreeInstance, self).py__simple_getitem__(index) + + def __repr__(self): + return "<%s of %s(%s)>" % (self.__class__.__name__, self.class_value, + self._arguments) + + +class AnonymousInstance(_BaseTreeInstance): + _arguments = None + + +class CompiledInstanceName(compiled.CompiledName): + def __init__(self, inference_state, instance, klass, name): + parent_value = klass.parent_context.get_value() + assert parent_value is not None, "How? Please reproduce and report" + super(CompiledInstanceName, self).__init__( + inference_state, + parent_value, + name.string_name + ) + self._instance = instance + self._class_member_name = name + + @iterator_to_value_set + def infer(self): + for result_value in self._class_member_name.infer(): + if result_value.api_type == 'function': + yield CompiledBoundMethod(result_value) + else: + yield result_value + + +class CompiledInstanceClassFilter(AbstractFilter): + def __init__(self, instance, f): + self._instance = instance + self._class_filter = f + + def get(self, name): + return self._convert(self._class_filter.get(name)) + + def values(self): + return self._convert(self._class_filter.values()) + + def _convert(self, names): + klass = self._class_filter.compiled_value + return [ + CompiledInstanceName(self._instance.inference_state, self._instance, klass, n) + for n in names + ] + + +class BoundMethod(FunctionMixin, ValueWrapper): + def __init__(self, instance, class_context, function): + super(BoundMethod, self).__init__(function) + self.instance = instance + self._class_context = class_context + + def is_bound_method(self): + return True + + @property + def name(self): + return FunctionNameInClass( + self._class_context, + super(BoundMethod, self).name + ) + + def py__class__(self): + c, = values_from_qualified_names(self.inference_state, u'types', u'MethodType') + return c + + def _get_arguments(self, arguments): + assert arguments is not None + return InstanceArguments(self.instance, arguments) + + def _as_context(self, arguments=None): + if arguments is None: + return AnonymousMethodExecutionContext(self.instance, self) + + arguments = self._get_arguments(arguments) + return MethodExecutionContext(self.instance, self, arguments) + + def py__call__(self, arguments): + if isinstance(self._wrapped_value, OverloadedFunctionValue): + return self._wrapped_value.py__call__(self._get_arguments(arguments)) + + function_execution = self.as_context(arguments) + return function_execution.infer() + + def get_signature_functions(self): + return [ + BoundMethod(self.instance, self._class_context, f) + for f in self._wrapped_value.get_signature_functions() + ] + + def get_signatures(self): + return [sig.bind(self) for sig in super(BoundMethod, self).get_signatures()] + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._wrapped_value) + + +class CompiledBoundMethod(ValueWrapper): + def is_bound_method(self): + return True + + def get_signatures(self): + return [sig.bind(self) for sig in self._wrapped_value.get_signatures()] + + +class SelfName(TreeNameDefinition): + """ + This name calculates the parent_context lazily. + """ + def __init__(self, instance, class_context, tree_name): + self._instance = instance + self.class_context = class_context + self.tree_name = tree_name + + @property + def parent_context(self): + return self._instance.create_instance_context(self.class_context, self.tree_name) + + def get_defining_qualified_value(self): + return self._instance + + +class LazyInstanceClassName(NameWrapper): + def __init__(self, instance, class_member_name): + super(LazyInstanceClassName, self).__init__(class_member_name) + self._instance = instance + + @iterator_to_value_set + def infer(self): + for result_value in self._wrapped_name.infer(): + for c in result_value.py__get__(self._instance, self._instance.py__class__()): + yield c + + def get_signatures(self): + return self.infer().get_signatures() + + def get_defining_qualified_value(self): + return self._instance + + +class InstanceClassFilter(AbstractFilter): + """ + This filter is special in that it uses the class filter and wraps the + resulting names in LazyInstanceClassName. The idea is that the class name + filtering can be very flexible and always be reflected in instances. + """ + def __init__(self, instance, class_filter): + self._instance = instance + self._class_filter = class_filter + + def get(self, name): + return self._convert(self._class_filter.get(name)) + + def values(self): + return self._convert(self._class_filter.values()) + + def _convert(self, names): + return [ + LazyInstanceClassName(self._instance, n) + for n in names + ] + + def __repr__(self): + return '<%s for %s>' % (self.__class__.__name__, self._class_filter) + + +class SelfAttributeFilter(ClassFilter): + """ + This class basically filters all the use cases where `self.*` was assigned. + """ + def __init__(self, instance, instance_class, node_context, origin_scope): + super(SelfAttributeFilter, self).__init__( + class_value=instance_class, + node_context=node_context, + origin_scope=origin_scope, + is_instance=True, + ) + self._instance = instance + + def _filter(self, names): + start, end = self._parser_scope.start_pos, self._parser_scope.end_pos + names = [n for n in names if start < n.start_pos < end] + return self._filter_self_names(names) + + def _filter_self_names(self, names): + for name in names: + trailer = name.parent + if trailer.type == 'trailer' \ + and len(trailer.parent.children) == 2 \ + and trailer.children[0] == '.': + if name.is_definition() and self._access_possible(name): + # TODO filter non-self assignments instead of this bad + # filter. + if self._is_in_right_scope(trailer.parent.children[0], name): + yield name + + def _is_in_right_scope(self, self_name, name): + self_context = self._node_context.create_context(self_name) + names = self_context.goto(self_name, position=self_name.start_pos) + return any( + n.api_type == 'param' + and n.tree_name.get_definition().position_index == 0 + and n.parent_context.tree_node is self._parser_scope + for n in names + ) + + def _convert_names(self, names): + return [SelfName(self._instance, self._node_context, name) for name in names] + + def _check_flows(self, names): + return names + + +class InstanceArguments(TreeArgumentsWrapper): + def __init__(self, instance, arguments): + super(InstanceArguments, self).__init__(arguments) + self.instance = instance + + def unpack(self, func=None): + yield None, LazyKnownValue(self.instance) + for values in self._wrapped_arguments.unpack(func): + yield values diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/value/iterable.py b/.venv/lib/python3.8/site-packages/jedi/inference/value/iterable.py new file mode 100644 index 00000000..43692c57 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/value/iterable.py @@ -0,0 +1,662 @@ +""" +Contains all classes and functions to deal with lists, dicts, generators and +iterators in general. +""" +import sys + +from jedi._compatibility import force_unicode, is_py3 +from jedi.inference import compiled +from jedi.inference import analysis +from jedi.inference.lazy_value import LazyKnownValue, LazyKnownValues, \ + LazyTreeValue +from jedi.inference.helpers import get_int_or_none, is_string, \ + reraise_getitem_errors, SimpleGetItemNotFound +from jedi.inference.utils import safe_property, to_list +from jedi.inference.cache import inference_state_method_cache +from jedi.inference.filters import LazyAttributeOverwrite, publish_method +from jedi.inference.base_value import ValueSet, Value, NO_VALUES, \ + ContextualizedNode, iterate_values, sentinel, \ + LazyValueWrapper +from jedi.parser_utils import get_sync_comp_fors +from jedi.inference.context import CompForContext +from jedi.inference.value.dynamic_arrays import check_array_additions + + +class IterableMixin(object): + def py__stop_iteration_returns(self): + return ValueSet([compiled.builtin_from_name(self.inference_state, u'None')]) + + # At the moment, safe values are simple values like "foo", 1 and not + # lists/dicts. Therefore as a small speed optimization we can just do the + # default instead of resolving the lazy wrapped values, that are just + # doing this in the end as well. + # This mostly speeds up patterns like `sys.version_info >= (3, 0)` in + # typeshed. + if sys.version_info[0] == 2: + # Python 2........... + def get_safe_value(self, default=sentinel): + if default is sentinel: + raise ValueError("There exists no safe value for value %s" % self) + return default + else: + get_safe_value = Value.get_safe_value + + +class GeneratorBase(LazyAttributeOverwrite, IterableMixin): + array_type = None + + def _get_wrapped_value(self): + generator, = self.inference_state.typing_module \ + .py__getattribute__('Generator') \ + .execute_annotation() + return generator + + def is_instance(self): + return False + + def py__bool__(self): + return True + + @publish_method('__iter__') + def _iter(self, arguments): + return ValueSet([self]) + + @publish_method('send') + @publish_method('next', python_version_match=2) + @publish_method('__next__', python_version_match=3) + def py__next__(self, arguments): + return ValueSet.from_sets(lazy_value.infer() for lazy_value in self.py__iter__()) + + def py__stop_iteration_returns(self): + return ValueSet([compiled.builtin_from_name(self.inference_state, u'None')]) + + @property + def name(self): + return compiled.CompiledValueName(self, 'Generator') + + +class Generator(GeneratorBase): + """Handling of `yield` functions.""" + def __init__(self, inference_state, func_execution_context): + super(Generator, self).__init__(inference_state) + self._func_execution_context = func_execution_context + + def py__iter__(self, contextualized_node=None): + return self._func_execution_context.get_yield_lazy_values() + + def py__stop_iteration_returns(self): + return self._func_execution_context.get_return_values() + + def __repr__(self): + return "<%s of %s>" % (type(self).__name__, self._func_execution_context) + + +def comprehension_from_atom(inference_state, value, atom): + bracket = atom.children[0] + test_list_comp = atom.children[1] + + if bracket == '{': + if atom.children[1].children[1] == ':': + sync_comp_for = test_list_comp.children[3] + if sync_comp_for.type == 'comp_for': + sync_comp_for = sync_comp_for.children[1] + + return DictComprehension( + inference_state, + value, + sync_comp_for_node=sync_comp_for, + key_node=test_list_comp.children[0], + value_node=test_list_comp.children[2], + ) + else: + cls = SetComprehension + elif bracket == '(': + cls = GeneratorComprehension + elif bracket == '[': + cls = ListComprehension + + sync_comp_for = test_list_comp.children[1] + if sync_comp_for.type == 'comp_for': + sync_comp_for = sync_comp_for.children[1] + + return cls( + inference_state, + defining_context=value, + sync_comp_for_node=sync_comp_for, + entry_node=test_list_comp.children[0], + ) + + +class ComprehensionMixin(object): + @inference_state_method_cache() + def _get_comp_for_context(self, parent_context, comp_for): + return CompForContext(parent_context, comp_for) + + def _nested(self, comp_fors, parent_context=None): + comp_for = comp_fors[0] + + is_async = comp_for.parent.type == 'comp_for' + + input_node = comp_for.children[3] + parent_context = parent_context or self._defining_context + input_types = parent_context.infer_node(input_node) + + cn = ContextualizedNode(parent_context, input_node) + iterated = input_types.iterate(cn, is_async=is_async) + exprlist = comp_for.children[1] + for i, lazy_value in enumerate(iterated): + types = lazy_value.infer() + dct = unpack_tuple_to_dict(parent_context, types, exprlist) + context = self._get_comp_for_context( + parent_context, + comp_for, + ) + with context.predefine_names(comp_for, dct): + try: + for result in self._nested(comp_fors[1:], context): + yield result + except IndexError: + iterated = context.infer_node(self._entry_node) + if self.array_type == 'dict': + yield iterated, context.infer_node(self._value_node) + else: + yield iterated + + @inference_state_method_cache(default=[]) + @to_list + def _iterate(self): + comp_fors = tuple(get_sync_comp_fors(self._sync_comp_for_node)) + for result in self._nested(comp_fors): + yield result + + def py__iter__(self, contextualized_node=None): + for set_ in self._iterate(): + yield LazyKnownValues(set_) + + def __repr__(self): + return "<%s of %s>" % (type(self).__name__, self._sync_comp_for_node) + + +class _DictMixin(object): + def _get_generics(self): + return tuple(c_set.py__class__() for c_set in self.get_mapping_item_values()) + + +class Sequence(LazyAttributeOverwrite, IterableMixin): + api_type = u'instance' + + @property + def name(self): + return compiled.CompiledValueName(self, self.array_type) + + def _get_generics(self): + return (self.merge_types_of_iterate().py__class__(),) + + @inference_state_method_cache(default=()) + def _cached_generics(self): + return self._get_generics() + + def _get_wrapped_value(self): + from jedi.inference.gradual.base import GenericClass + from jedi.inference.gradual.generics import TupleGenericManager + klass = compiled.builtin_from_name(self.inference_state, self.array_type) + c, = GenericClass( + klass, + TupleGenericManager(self._cached_generics()) + ).execute_annotation() + return c + + def py__bool__(self): + return None # We don't know the length, because of appends. + + @safe_property + def parent(self): + return self.inference_state.builtins_module + + def py__getitem__(self, index_value_set, contextualized_node): + if self.array_type == 'dict': + return self._dict_values() + return iterate_values(ValueSet([self])) + + +class _BaseComprehension(ComprehensionMixin): + def __init__(self, inference_state, defining_context, sync_comp_for_node, entry_node): + assert sync_comp_for_node.type == 'sync_comp_for' + super(_BaseComprehension, self).__init__(inference_state) + self._defining_context = defining_context + self._sync_comp_for_node = sync_comp_for_node + self._entry_node = entry_node + + +class ListComprehension(_BaseComprehension, Sequence): + array_type = u'list' + + def py__simple_getitem__(self, index): + if isinstance(index, slice): + return ValueSet([self]) + + all_types = list(self.py__iter__()) + with reraise_getitem_errors(IndexError, TypeError): + lazy_value = all_types[index] + return lazy_value.infer() + + +class SetComprehension(_BaseComprehension, Sequence): + array_type = u'set' + + +class GeneratorComprehension(_BaseComprehension, GeneratorBase): + pass + + +class _DictKeyMixin(object): + # TODO merge with _DictMixin? + def get_mapping_item_values(self): + return self._dict_keys(), self._dict_values() + + def get_key_values(self): + # TODO merge with _dict_keys? + return self._dict_keys() + + +class DictComprehension(ComprehensionMixin, Sequence, _DictKeyMixin): + array_type = u'dict' + + def __init__(self, inference_state, defining_context, sync_comp_for_node, key_node, value_node): + assert sync_comp_for_node.type == 'sync_comp_for' + super(DictComprehension, self).__init__(inference_state) + self._defining_context = defining_context + self._sync_comp_for_node = sync_comp_for_node + self._entry_node = key_node + self._value_node = value_node + + def py__iter__(self, contextualized_node=None): + for keys, values in self._iterate(): + yield LazyKnownValues(keys) + + def py__simple_getitem__(self, index): + for keys, values in self._iterate(): + for k in keys: + # Be careful in the future if refactoring, index could be a + # slice object. + if k.get_safe_value(default=object()) == index: + return values + raise SimpleGetItemNotFound() + + def _dict_keys(self): + return ValueSet.from_sets(keys for keys, values in self._iterate()) + + def _dict_values(self): + return ValueSet.from_sets(values for keys, values in self._iterate()) + + @publish_method('values') + def _imitate_values(self, arguments): + lazy_value = LazyKnownValues(self._dict_values()) + return ValueSet([FakeList(self.inference_state, [lazy_value])]) + + @publish_method('items') + def _imitate_items(self, arguments): + lazy_values = [ + LazyKnownValue( + FakeTuple( + self.inference_state, + [LazyKnownValues(key), + LazyKnownValues(value)] + ) + ) + for key, value in self._iterate() + ] + + return ValueSet([FakeList(self.inference_state, lazy_values)]) + + def exact_key_items(self): + # NOTE: A smarter thing can probably done here to achieve better + # completions, but at least like this jedi doesn't crash + return [] + + +class SequenceLiteralValue(Sequence): + _TUPLE_LIKE = 'testlist_star_expr', 'testlist', 'subscriptlist' + mapping = {'(': u'tuple', + '[': u'list', + '{': u'set'} + + def __init__(self, inference_state, defining_context, atom): + super(SequenceLiteralValue, self).__init__(inference_state) + self.atom = atom + self._defining_context = defining_context + + if self.atom.type in self._TUPLE_LIKE: + self.array_type = u'tuple' + else: + self.array_type = SequenceLiteralValue.mapping[atom.children[0]] + """The builtin name of the array (list, set, tuple or dict).""" + + def _get_generics(self): + if self.array_type == u'tuple': + return tuple(x.infer().py__class__() for x in self.py__iter__()) + return super(SequenceLiteralValue, self)._get_generics() + + def py__simple_getitem__(self, index): + """Here the index is an int/str. Raises IndexError/KeyError.""" + if isinstance(index, slice): + return ValueSet([self]) + else: + with reraise_getitem_errors(TypeError, KeyError, IndexError): + node = self.get_tree_entries()[index] + return self._defining_context.infer_node(node) + + def py__iter__(self, contextualized_node=None): + """ + While values returns the possible values for any array field, this + function returns the value for a certain index. + """ + for node in self.get_tree_entries(): + if node == ':' or node.type == 'subscript': + # TODO this should probably use at least part of the code + # of infer_subscript_list. + yield LazyKnownValue(Slice(self._defining_context, None, None, None)) + else: + yield LazyTreeValue(self._defining_context, node) + for addition in check_array_additions(self._defining_context, self): + yield addition + + def py__len__(self): + # This function is not really used often. It's more of a try. + return len(self.get_tree_entries()) + + def get_tree_entries(self): + c = self.atom.children + + if self.atom.type in self._TUPLE_LIKE: + return c[::2] + + array_node = c[1] + if array_node in (']', '}', ')'): + return [] # Direct closing bracket, doesn't contain items. + + if array_node.type == 'testlist_comp': + # filter out (for now) pep 448 single-star unpacking + return [value for value in array_node.children[::2] + if value.type != "star_expr"] + elif array_node.type == 'dictorsetmaker': + kv = [] + iterator = iter(array_node.children) + for key in iterator: + if key == "**": + # dict with pep 448 double-star unpacking + # for now ignoring the values imported by ** + next(iterator) + next(iterator, None) # Possible comma. + else: + op = next(iterator, None) + if op is None or op == ',': + if key.type == "star_expr": + # pep 448 single-star unpacking + # for now ignoring values imported by * + pass + else: + kv.append(key) # A set. + else: + assert op == ':' # A dict. + kv.append((key, next(iterator))) + next(iterator, None) # Possible comma. + return kv + else: + if array_node.type == "star_expr": + # pep 448 single-star unpacking + # for now ignoring values imported by * + return [] + else: + return [array_node] + + def exact_key_items(self): + """ + Returns a generator of tuples like dict.items(), where the key is + resolved (as a string) and the values are still lazy values. + """ + for key_node, value in self.get_tree_entries(): + for key in self._defining_context.infer_node(key_node): + if is_string(key): + yield key.get_safe_value(), LazyTreeValue(self._defining_context, value) + + def __repr__(self): + return "<%s of %s>" % (self.__class__.__name__, self.atom) + + +class DictLiteralValue(_DictMixin, SequenceLiteralValue, _DictKeyMixin): + array_type = u'dict' + + def __init__(self, inference_state, defining_context, atom): + super(SequenceLiteralValue, self).__init__(inference_state) + self._defining_context = defining_context + self.atom = atom + + def py__simple_getitem__(self, index): + """Here the index is an int/str. Raises IndexError/KeyError.""" + compiled_value_index = compiled.create_simple_object(self.inference_state, index) + for key, value in self.get_tree_entries(): + for k in self._defining_context.infer_node(key): + for key_v in k.execute_operation(compiled_value_index, u'=='): + if key_v.get_safe_value(): + return self._defining_context.infer_node(value) + raise SimpleGetItemNotFound('No key found in dictionary %s.' % self) + + def py__iter__(self, contextualized_node=None): + """ + While values returns the possible values for any array field, this + function returns the value for a certain index. + """ + # Get keys. + types = NO_VALUES + for k, _ in self.get_tree_entries(): + types |= self._defining_context.infer_node(k) + # We don't know which dict index comes first, therefore always + # yield all the types. + for _ in types: + yield LazyKnownValues(types) + + @publish_method('values') + def _imitate_values(self, arguments): + lazy_value = LazyKnownValues(self._dict_values()) + return ValueSet([FakeList(self.inference_state, [lazy_value])]) + + @publish_method('items') + def _imitate_items(self, arguments): + lazy_values = [ + LazyKnownValue(FakeTuple( + self.inference_state, + (LazyTreeValue(self._defining_context, key_node), + LazyTreeValue(self._defining_context, value_node)) + )) for key_node, value_node in self.get_tree_entries() + ] + + return ValueSet([FakeList(self.inference_state, lazy_values)]) + + def _dict_values(self): + return ValueSet.from_sets( + self._defining_context.infer_node(v) + for k, v in self.get_tree_entries() + ) + + def _dict_keys(self): + return ValueSet.from_sets( + self._defining_context.infer_node(k) + for k, v in self.get_tree_entries() + ) + + +class _FakeSequence(Sequence): + def __init__(self, inference_state, lazy_value_list): + """ + type should be one of "tuple", "list" + """ + super(_FakeSequence, self).__init__(inference_state) + self._lazy_value_list = lazy_value_list + + def py__simple_getitem__(self, index): + if isinstance(index, slice): + return ValueSet([self]) + + with reraise_getitem_errors(IndexError, TypeError): + lazy_value = self._lazy_value_list[index] + return lazy_value.infer() + + def py__iter__(self, contextualized_node=None): + return self._lazy_value_list + + def py__bool__(self): + return bool(len(self._lazy_value_list)) + + def __repr__(self): + return "<%s of %s>" % (type(self).__name__, self._lazy_value_list) + + +class FakeTuple(_FakeSequence): + array_type = u'tuple' + + +class FakeList(_FakeSequence): + array_type = u'tuple' + + +class FakeDict(_DictMixin, Sequence, _DictKeyMixin): + array_type = u'dict' + + def __init__(self, inference_state, dct): + super(FakeDict, self).__init__(inference_state) + self._dct = dct + + def py__iter__(self, contextualized_node=None): + for key in self._dct: + yield LazyKnownValue(compiled.create_simple_object(self.inference_state, key)) + + def py__simple_getitem__(self, index): + if is_py3 and self.inference_state.environment.version_info.major == 2: + # In Python 2 bytes and unicode compare. + if isinstance(index, bytes): + index_unicode = force_unicode(index) + try: + return self._dct[index_unicode].infer() + except KeyError: + pass + elif isinstance(index, str): + index_bytes = index.encode('utf-8') + try: + return self._dct[index_bytes].infer() + except KeyError: + pass + + with reraise_getitem_errors(KeyError, TypeError): + lazy_value = self._dct[index] + return lazy_value.infer() + + @publish_method('values') + def _values(self, arguments): + return ValueSet([FakeTuple( + self.inference_state, + [LazyKnownValues(self._dict_values())] + )]) + + def _dict_values(self): + return ValueSet.from_sets(lazy_value.infer() for lazy_value in self._dct.values()) + + def _dict_keys(self): + return ValueSet.from_sets(lazy_value.infer() for lazy_value in self.py__iter__()) + + def exact_key_items(self): + return self._dct.items() + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self._dct) + + +class MergedArray(Sequence): + def __init__(self, inference_state, arrays): + super(MergedArray, self).__init__(inference_state) + self.array_type = arrays[-1].array_type + self._arrays = arrays + + def py__iter__(self, contextualized_node=None): + for array in self._arrays: + for lazy_value in array.py__iter__(): + yield lazy_value + + def py__simple_getitem__(self, index): + return ValueSet.from_sets(lazy_value.infer() for lazy_value in self.py__iter__()) + + +def unpack_tuple_to_dict(context, types, exprlist): + """ + Unpacking tuple assignments in for statements and expr_stmts. + """ + if exprlist.type == 'name': + return {exprlist.value: types} + elif exprlist.type == 'atom' and exprlist.children[0] in ('(', '['): + return unpack_tuple_to_dict(context, types, exprlist.children[1]) + elif exprlist.type in ('testlist', 'testlist_comp', 'exprlist', + 'testlist_star_expr'): + dct = {} + parts = iter(exprlist.children[::2]) + n = 0 + for lazy_value in types.iterate(ContextualizedNode(context, exprlist)): + n += 1 + try: + part = next(parts) + except StopIteration: + analysis.add(context, 'value-error-too-many-values', part, + message="ValueError: too many values to unpack (expected %s)" % n) + else: + dct.update(unpack_tuple_to_dict(context, lazy_value.infer(), part)) + has_parts = next(parts, None) + if types and has_parts is not None: + analysis.add(context, 'value-error-too-few-values', has_parts, + message="ValueError: need more than %s values to unpack" % n) + return dct + elif exprlist.type == 'power' or exprlist.type == 'atom_expr': + # Something like ``arr[x], var = ...``. + # This is something that is not yet supported, would also be difficult + # to write into a dict. + return {} + elif exprlist.type == 'star_expr': # `a, *b, c = x` type unpackings + # Currently we're not supporting them. + return {} + raise NotImplementedError + + +class Slice(LazyValueWrapper): + def __init__(self, python_context, start, stop, step): + self.inference_state = python_context.inference_state + self._context = python_context + # All of them are either a Precedence or None. + self._start = start + self._stop = stop + self._step = step + + def _get_wrapped_value(self): + value = compiled.builtin_from_name(self._context.inference_state, 'slice') + slice_value, = value.execute_with_values() + return slice_value + + def get_safe_value(self, default=sentinel): + """ + Imitate CompiledValue.obj behavior and return a ``builtin.slice()`` + object. + """ + def get(element): + if element is None: + return None + + result = self._context.infer_node(element) + if len(result) != 1: + # For simplicity, we want slices to be clear defined with just + # one type. Otherwise we will return an empty slice object. + raise IndexError + + value, = result + return get_int_or_none(value) + + try: + return slice(get(self._start), get(self._stop), get(self._step)) + except IndexError: + return slice(None, None, None) diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/value/klass.py b/.venv/lib/python3.8/site-packages/jedi/inference/value/klass.py new file mode 100644 index 00000000..33510445 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/value/klass.py @@ -0,0 +1,392 @@ +""" +Like described in the :mod:`parso.python.tree` module, +there's a need for an ast like module to represent the states of parsed +modules. + +But now there are also structures in Python that need a little bit more than +that. An ``Instance`` for example is only a ``Class`` before it is +instantiated. This class represents these cases. + +So, why is there also a ``Class`` class here? Well, there are decorators and +they change classes in Python 3. + +Representation modules also define "magic methods". Those methods look like +``py__foo__`` and are typically mappable to the Python equivalents ``__call__`` +and others. Here's a list: + +====================================== ======================================== +**Method** **Description** +-------------------------------------- ---------------------------------------- +py__call__(arguments: Array) On callable objects, returns types. +py__bool__() Returns True/False/None; None means that + there's no certainty. +py__bases__() Returns a list of base classes. +py__iter__() Returns a generator of a set of types. +py__class__() Returns the class of an instance. +py__simple_getitem__(index: int/str) Returns a a set of types of the index. + Can raise an IndexError/KeyError. +py__getitem__(indexes: ValueSet) Returns a a set of types of the index. +py__file__() Only on modules. Returns None if does + not exist. +py__package__() -> List[str] Only on modules. For the import system. +py__path__() Only on modules. For the import system. +py__get__(call_object) Only on instances. Simulates + descriptors. +py__doc__() Returns the docstring for a value. +====================================== ======================================== + +""" +from jedi import debug +from jedi._compatibility import use_metaclass +from jedi.parser_utils import get_cached_parent_scope, expr_is_dotted +from jedi.inference.cache import inference_state_method_cache, CachedMetaClass, \ + inference_state_method_generator_cache +from jedi.inference import compiled +from jedi.inference.lazy_value import LazyKnownValues, LazyTreeValue +from jedi.inference.filters import ParserTreeFilter +from jedi.inference.names import TreeNameDefinition, ValueName +from jedi.inference.arguments import unpack_arglist, ValuesArguments +from jedi.inference.base_value import ValueSet, iterator_to_value_set, \ + NO_VALUES +from jedi.inference.context import ClassContext +from jedi.inference.value.function import FunctionAndClassBase +from jedi.inference.gradual.generics import LazyGenericManager, TupleGenericManager +from jedi.plugins import plugin_manager + + +class ClassName(TreeNameDefinition): + def __init__(self, class_value, tree_name, name_context, apply_decorators): + super(ClassName, self).__init__(name_context, tree_name) + self._apply_decorators = apply_decorators + self._class_value = class_value + + @iterator_to_value_set + def infer(self): + # We're using a different value to infer, so we cannot call super(). + from jedi.inference.syntax_tree import tree_name_to_values + inferred = tree_name_to_values( + self.parent_context.inference_state, self.parent_context, self.tree_name) + + for result_value in inferred: + if self._apply_decorators: + for c in result_value.py__get__(instance=None, class_value=self._class_value): + yield c + else: + yield result_value + + +class ClassFilter(ParserTreeFilter): + def __init__(self, class_value, node_context=None, until_position=None, + origin_scope=None, is_instance=False): + super(ClassFilter, self).__init__( + class_value.as_context(), node_context, + until_position=until_position, + origin_scope=origin_scope, + ) + self._class_value = class_value + self._is_instance = is_instance + + def _convert_names(self, names): + return [ + ClassName( + class_value=self._class_value, + tree_name=name, + name_context=self._node_context, + apply_decorators=not self._is_instance, + ) for name in names + ] + + def _equals_origin_scope(self): + node = self._origin_scope + while node is not None: + if node == self._parser_scope or node == self.parent_context: + return True + node = get_cached_parent_scope(self._used_names, node) + return False + + def _access_possible(self, name): + # Filter for ClassVar variables + # TODO this is not properly done, yet. It just checks for the string + # ClassVar in the annotation, which can be quite imprecise. If we + # wanted to do this correct, we would have to infer the ClassVar. + if not self._is_instance: + expr_stmt = name.get_definition() + if expr_stmt is not None and expr_stmt.type == 'expr_stmt': + annassign = expr_stmt.children[1] + if annassign.type == 'annassign': + # If there is an =, the variable is obviously also + # defined on the class. + if 'ClassVar' not in annassign.children[1].get_code() \ + and '=' not in annassign.children: + return False + + # Filter for name mangling of private variables like __foo + return not name.value.startswith('__') or name.value.endswith('__') \ + or self._equals_origin_scope() + + def _filter(self, names): + names = super(ClassFilter, self)._filter(names) + return [name for name in names if self._access_possible(name)] + + +class ClassMixin(object): + def is_class(self): + return True + + def is_class_mixin(self): + return True + + def py__call__(self, arguments): + from jedi.inference.value import TreeInstance + + from jedi.inference.gradual.typing import TypedDict + if self.is_typeddict(): + return ValueSet([TypedDict(self)]) + return ValueSet([TreeInstance(self.inference_state, self.parent_context, self, arguments)]) + + def py__class__(self): + return compiled.builtin_from_name(self.inference_state, u'type') + + @property + def name(self): + return ValueName(self, self.tree_node.name) + + def py__name__(self): + return self.name.string_name + + @inference_state_method_generator_cache() + def py__mro__(self): + mro = [self] + yield self + # TODO Do a proper mro resolution. Currently we are just listing + # classes. However, it's a complicated algorithm. + for lazy_cls in self.py__bases__(): + # TODO there's multiple different mro paths possible if this yields + # multiple possibilities. Could be changed to be more correct. + for cls in lazy_cls.infer(): + # TODO detect for TypeError: duplicate base class str, + # e.g. `class X(str, str): pass` + try: + mro_method = cls.py__mro__ + except AttributeError: + # TODO add a TypeError like: + """ + >>> class Y(lambda: test): pass + Traceback (most recent call last): + File "", line 1, in + TypeError: function() argument 1 must be code, not str + >>> class Y(1): pass + Traceback (most recent call last): + File "", line 1, in + TypeError: int() takes at most 2 arguments (3 given) + """ + debug.warning('Super class of %s is not a class: %s', self, cls) + else: + for cls_new in mro_method(): + if cls_new not in mro: + mro.append(cls_new) + yield cls_new + + def get_filters(self, origin_scope=None, is_instance=False, + include_metaclasses=True, include_type_when_class=True): + if include_metaclasses: + metaclasses = self.get_metaclasses() + if metaclasses: + for f in self.get_metaclass_filters(metaclasses, is_instance): + yield f # Python 2.. + + for cls in self.py__mro__(): + if cls.is_compiled(): + for filter in cls.get_filters(is_instance=is_instance): + yield filter + else: + yield ClassFilter( + self, node_context=cls.as_context(), + origin_scope=origin_scope, + is_instance=is_instance + ) + if not is_instance and include_type_when_class: + from jedi.inference.compiled import builtin_from_name + type_ = builtin_from_name(self.inference_state, u'type') + assert isinstance(type_, ClassValue) + if type_ != self: + # We are not using execute_with_values here, because the + # plugin function for type would get executed instead of an + # instance creation. + args = ValuesArguments([]) + for instance in type_.py__call__(args): + instance_filters = instance.get_filters() + # Filter out self filters + next(instance_filters, None) + next(instance_filters, None) + x = next(instance_filters, None) + assert x is not None + yield x + + def get_signatures(self): + # Since calling staticmethod without a function is illegal, the Jedi + # plugin doesn't return anything. Therefore call directly and get what + # we want: An instance of staticmethod. + metaclasses = self.get_metaclasses() + if metaclasses: + sigs = self.get_metaclass_signatures(metaclasses) + if sigs: + return sigs + args = ValuesArguments([]) + init_funcs = self.py__call__(args).py__getattribute__('__init__') + return [sig.bind(self) for sig in init_funcs.get_signatures()] + + def _as_context(self): + return ClassContext(self) + + def get_type_hint(self, add_class_info=True): + if add_class_info: + return 'Type[%s]' % self.py__name__() + return self.py__name__() + + @inference_state_method_cache(default=False) + def is_typeddict(self): + # TODO Do a proper mro resolution. Currently we are just listing + # classes. However, it's a complicated algorithm. + from jedi.inference.gradual.typing import TypedDictClass + for lazy_cls in self.py__bases__(): + if not isinstance(lazy_cls, LazyTreeValue): + return False + tree_node = lazy_cls.data + # Only resolve simple classes, stuff like Iterable[str] are more + # intensive to resolve and if generics are involved, we know it's + # not a TypedDict. + if not expr_is_dotted(tree_node): + return False + + for cls in lazy_cls.infer(): + if isinstance(cls, TypedDictClass): + return True + try: + method = cls.is_typeddict + except AttributeError: + # We're only dealing with simple classes, so just returning + # here should be fine. This only happens with e.g. compiled + # classes. + return False + else: + if method(): + return True + return False + + def py__getitem__(self, index_value_set, contextualized_node): + from jedi.inference.gradual.base import GenericClass + if not index_value_set: + debug.warning('Class indexes inferred to nothing. Returning class instead') + return ValueSet([self]) + return ValueSet( + GenericClass( + self, + LazyGenericManager( + context_of_index=contextualized_node.context, + index_value=index_value, + ) + ) + for index_value in index_value_set + ) + + def with_generics(self, generics_tuple): + from jedi.inference.gradual.base import GenericClass + return GenericClass( + self, + TupleGenericManager(generics_tuple) + ) + + def define_generics(self, type_var_dict): + from jedi.inference.gradual.base import GenericClass + + def remap_type_vars(): + """ + The TypeVars in the resulting classes have sometimes different names + and we need to check for that, e.g. a signature can be: + + def iter(iterable: Iterable[_T]) -> Iterator[_T]: ... + + However, the iterator is defined as Iterator[_T_co], which means it has + a different type var name. + """ + for type_var in self.list_type_vars(): + yield type_var_dict.get(type_var.py__name__(), NO_VALUES) + + if type_var_dict: + return ValueSet([GenericClass( + self, + TupleGenericManager(tuple(remap_type_vars())) + )]) + return ValueSet({self}) + + +class ClassValue(use_metaclass(CachedMetaClass, ClassMixin, FunctionAndClassBase)): + api_type = u'class' + + @inference_state_method_cache() + def list_type_vars(self): + found = [] + arglist = self.tree_node.get_super_arglist() + if arglist is None: + return [] + + for stars, node in unpack_arglist(arglist): + if stars: + continue # These are not relevant for this search. + + from jedi.inference.gradual.annotation import find_unknown_type_vars + for type_var in find_unknown_type_vars(self.parent_context, node): + if type_var not in found: + # The order matters and it's therefore a list. + found.append(type_var) + return found + + def _get_bases_arguments(self): + arglist = self.tree_node.get_super_arglist() + if arglist: + from jedi.inference import arguments + return arguments.TreeArguments(self.inference_state, self.parent_context, arglist) + return None + + @inference_state_method_cache(default=()) + def py__bases__(self): + args = self._get_bases_arguments() + if args is not None: + lst = [value for key, value in args.unpack() if key is None] + if lst: + return lst + + if self.py__name__() == 'object' \ + and self.parent_context.is_builtins_module(): + return [] + return [LazyKnownValues( + self.inference_state.builtins_module.py__getattribute__('object') + )] + + @plugin_manager.decorate() + def get_metaclass_filters(self, metaclasses, is_instance): + debug.warning('Unprocessed metaclass %s', metaclasses) + return [] + + @inference_state_method_cache(default=NO_VALUES) + def get_metaclasses(self): + args = self._get_bases_arguments() + if args is not None: + m = [value for key, value in args.unpack() if key == 'metaclass'] + metaclasses = ValueSet.from_sets(lazy_value.infer() for lazy_value in m) + metaclasses = ValueSet(m for m in metaclasses if m.is_class()) + if metaclasses: + return metaclasses + + for lazy_base in self.py__bases__(): + for value in lazy_base.infer(): + if value.is_class(): + values = value.get_metaclasses() + if values: + return values + return NO_VALUES + + @plugin_manager.decorate() + def get_metaclass_signatures(self, metaclasses): + return [] diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/value/module.py b/.venv/lib/python3.8/site-packages/jedi/inference/value/module.py new file mode 100644 index 00000000..12d2bfcf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/value/module.py @@ -0,0 +1,229 @@ +import os + +from jedi.inference.cache import inference_state_method_cache +from jedi.inference.names import AbstractNameDefinition, ModuleName +from jedi.inference.filters import GlobalNameFilter, ParserTreeFilter, DictFilter, MergedFilter +from jedi.inference import compiled +from jedi.inference.base_value import TreeValue +from jedi.inference.names import SubModuleName +from jedi.inference.helpers import values_from_qualified_names +from jedi.inference.compiled import create_simple_object +from jedi.inference.base_value import ValueSet +from jedi.inference.context import ModuleContext + + +class _ModuleAttributeName(AbstractNameDefinition): + """ + For module attributes like __file__, __str__ and so on. + """ + api_type = u'instance' + + def __init__(self, parent_module, string_name, string_value=None): + self.parent_context = parent_module + self.string_name = string_name + self._string_value = string_value + + def infer(self): + if self._string_value is not None: + s = self._string_value + if self.parent_context.inference_state.environment.version_info.major == 2 \ + and not isinstance(s, bytes): + s = s.encode('utf-8') + return ValueSet([ + create_simple_object(self.parent_context.inference_state, s) + ]) + return compiled.get_string_value_set(self.parent_context.inference_state) + + +class SubModuleDictMixin(object): + @inference_state_method_cache() + def sub_modules_dict(self): + """ + Lists modules in the directory of this module (if this module is a + package). + """ + names = {} + if self.is_package(): + mods = self.inference_state.compiled_subprocess.iter_module_names( + self.py__path__() + ) + for name in mods: + # It's obviously a relative import to the current module. + names[name] = SubModuleName(self.as_context(), name) + + # In the case of an import like `from x.` we don't need to + # add all the variables, this is only about submodules. + return names + + +class ModuleMixin(SubModuleDictMixin): + _module_name_class = ModuleName + + def get_filters(self, origin_scope=None): + yield MergedFilter( + ParserTreeFilter( + parent_context=self.as_context(), + origin_scope=origin_scope + ), + GlobalNameFilter(self.as_context(), self.tree_node), + ) + yield DictFilter(self.sub_modules_dict()) + yield DictFilter(self._module_attributes_dict()) + for star_filter in self.iter_star_filters(): + yield star_filter + + def py__class__(self): + c, = values_from_qualified_names(self.inference_state, u'types', u'ModuleType') + return c + + def is_module(self): + return True + + def is_stub(self): + return False + + @property + @inference_state_method_cache() + def name(self): + return self._module_name_class(self, self.string_names[-1]) + + @inference_state_method_cache() + def _module_attributes_dict(self): + names = ['__package__', '__doc__', '__name__'] + # All the additional module attributes are strings. + dct = dict((n, _ModuleAttributeName(self, n)) for n in names) + file = self.py__file__() + if file is not None: + dct['__file__'] = _ModuleAttributeName(self, '__file__', file) + return dct + + def iter_star_filters(self): + for star_module in self.star_imports(): + f = next(star_module.get_filters(), None) + assert f is not None + yield f + + # I'm not sure if the star import cache is really that effective anymore + # with all the other really fast import caches. Recheck. Also we would need + # to push the star imports into InferenceState.module_cache, if we reenable this. + @inference_state_method_cache([]) + def star_imports(self): + from jedi.inference.imports import Importer + + modules = [] + module_context = self.as_context() + for i in self.tree_node.iter_imports(): + if i.is_star_import(): + new = Importer( + self.inference_state, + import_path=i.get_paths()[-1], + module_context=module_context, + level=i.level + ).follow() + + for module in new: + if isinstance(module, ModuleValue): + modules += module.star_imports() + modules += new + return modules + + def get_qualified_names(self): + """ + A module doesn't have a qualified name, but it's important to note that + it's reachable and not `None`. With this information we can add + qualified names on top for all value children. + """ + return () + + +class ModuleValue(ModuleMixin, TreeValue): + api_type = u'module' + + def __init__(self, inference_state, module_node, code_lines, file_io=None, + string_names=None, is_package=False): + super(ModuleValue, self).__init__( + inference_state, + parent_context=None, + tree_node=module_node + ) + self.file_io = file_io + if file_io is None: + self._path = None + else: + self._path = file_io.path + self.string_names = string_names # Optional[Tuple[str, ...]] + self.code_lines = code_lines + self._is_package = is_package + + def is_stub(self): + if self._path is not None and self._path.endswith('.pyi'): + # Currently this is the way how we identify stubs when e.g. goto is + # used in them. This could be changed if stubs would be identified + # sooner and used as StubModuleValue. + return True + return super(ModuleValue, self).is_stub() + + def py__name__(self): + if self.string_names is None: + return None + return '.'.join(self.string_names) + + def py__file__(self): + """ + In contrast to Python's __file__ can be None. + """ + if self._path is None: + return None + + return os.path.abspath(self._path) + + def is_package(self): + return self._is_package + + def py__package__(self): + if self._is_package: + return self.string_names + return self.string_names[:-1] + + def py__path__(self): + """ + In case of a package, this returns Python's __path__ attribute, which + is a list of paths (strings). + Returns None if the module is not a package. + """ + if not self._is_package: + return None + + # A namespace package is typically auto generated and ~10 lines long. + first_few_lines = ''.join(self.code_lines[:50]) + # these are strings that need to be used for namespace packages, + # the first one is ``pkgutil``, the second ``pkg_resources``. + options = ('declare_namespace(__name__)', 'extend_path(__path__') + if options[0] in first_few_lines or options[1] in first_few_lines: + # It is a namespace, now try to find the rest of the + # modules on sys_path or whatever the search_path is. + paths = set() + for s in self.inference_state.get_sys_path(): + other = os.path.join(s, self.name.string_name) + if os.path.isdir(other): + paths.add(other) + if paths: + return list(paths) + # Nested namespace packages will not be supported. Nobody ever + # asked for it and in Python 3 they are there without using all the + # crap above. + + # Default to the of this file. + file = self.py__file__() + assert file is not None # Shouldn't be a package in the first place. + return [os.path.dirname(file)] + + def _as_context(self): + return ModuleContext(self) + + def __repr__(self): + return "<%s: %s@%s-%s is_stub=%s>" % ( + self.__class__.__name__, self.py__name__(), + self.tree_node.start_pos[0], self.tree_node.end_pos[0], + self.is_stub() + ) diff --git a/.venv/lib/python3.8/site-packages/jedi/inference/value/namespace.py b/.venv/lib/python3.8/site-packages/jedi/inference/value/namespace.py new file mode 100644 index 00000000..48a09e4a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/inference/value/namespace.py @@ -0,0 +1,74 @@ +from jedi.inference.cache import inference_state_method_cache +from jedi.inference.filters import DictFilter +from jedi.inference.names import ValueNameMixin, AbstractNameDefinition +from jedi.inference.base_value import Value +from jedi.inference.value.module import SubModuleDictMixin +from jedi.inference.context import NamespaceContext + + +class ImplicitNSName(ValueNameMixin, AbstractNameDefinition): + """ + Accessing names for implicit namespace packages should infer to nothing. + This object will prevent Jedi from raising exceptions + """ + def __init__(self, implicit_ns_value, string_name): + self._value = implicit_ns_value + self.string_name = string_name + + +class ImplicitNamespaceValue(Value, SubModuleDictMixin): + """ + Provides support for implicit namespace packages + """ + # Is a module like every other module, because if you import an empty + # folder foobar it will be available as an object: + # . + api_type = u'module' + parent_context = None + + def __init__(self, inference_state, string_names, paths): + super(ImplicitNamespaceValue, self).__init__(inference_state, parent_context=None) + self.inference_state = inference_state + self.string_names = string_names + self._paths = paths + + def get_filters(self, origin_scope=None): + yield DictFilter(self.sub_modules_dict()) + + def get_qualified_names(self): + return () + + @property + @inference_state_method_cache() + def name(self): + string_name = self.py__package__()[-1] + return ImplicitNSName(self, string_name) + + def py__file__(self): + return None + + def py__package__(self): + """Return the fullname + """ + return self.string_names + + def py__path__(self): + return self._paths + + def py__name__(self): + return '.'.join(self.string_names) + + def is_namespace(self): + return True + + def is_stub(self): + return False + + def is_package(self): + return True + + def as_context(self): + return NamespaceContext(self) + + def __repr__(self): + return '<%s: %s>' % (self.__class__.__name__, self.py__name__()) diff --git a/.venv/lib/python3.8/site-packages/jedi/parser_utils.py b/.venv/lib/python3.8/site-packages/jedi/parser_utils.py new file mode 100644 index 00000000..ff412e13 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/parser_utils.py @@ -0,0 +1,333 @@ +import re +import textwrap +from inspect import cleandoc +from weakref import WeakKeyDictionary + +from parso.python import tree +from parso.cache import parser_cache +from parso import split_lines + +from jedi._compatibility import literal_eval, force_unicode + +_EXECUTE_NODES = {'funcdef', 'classdef', 'import_from', 'import_name', 'test', + 'or_test', 'and_test', 'not_test', 'comparison', 'expr', + 'xor_expr', 'and_expr', 'shift_expr', 'arith_expr', + 'atom_expr', 'term', 'factor', 'power', 'atom'} + +_FLOW_KEYWORDS = ( + 'try', 'except', 'finally', 'else', 'if', 'elif', 'with', 'for', 'while' +) + + +def get_executable_nodes(node, last_added=False): + """ + For static analysis. + """ + result = [] + typ = node.type + if typ == 'name': + next_leaf = node.get_next_leaf() + if last_added is False and node.parent.type != 'param' and next_leaf != '=': + result.append(node) + elif typ == 'expr_stmt': + # I think inferring the statement (and possibly returned arrays), + # should be enough for static analysis. + result.append(node) + for child in node.children: + result += get_executable_nodes(child, last_added=True) + elif typ == 'decorator': + # decorator + if node.children[-2] == ')': + node = node.children[-3] + if node != '(': + result += get_executable_nodes(node) + else: + try: + children = node.children + except AttributeError: + pass + else: + if node.type in _EXECUTE_NODES and not last_added: + result.append(node) + + for child in children: + result += get_executable_nodes(child, last_added) + + return result + + +def get_sync_comp_fors(comp_for): + yield comp_for + last = comp_for.children[-1] + while True: + if last.type == 'comp_for': + yield last.children[1] # Ignore the async. + elif last.type == 'sync_comp_for': + yield last + elif not last.type == 'comp_if': + break + last = last.children[-1] + + +def for_stmt_defines_one_name(for_stmt): + """ + Returns True if only one name is returned: ``for x in y``. + Returns False if the for loop is more complicated: ``for x, z in y``. + + :returns: bool + """ + return for_stmt.children[1].type == 'name' + + +def get_flow_branch_keyword(flow_node, node): + start_pos = node.start_pos + if not (flow_node.start_pos < start_pos <= flow_node.end_pos): + raise ValueError('The node is not part of the flow.') + + keyword = None + for i, child in enumerate(flow_node.children): + if start_pos < child.start_pos: + return keyword + first_leaf = child.get_first_leaf() + if first_leaf in _FLOW_KEYWORDS: + keyword = first_leaf + return 0 + + +def clean_scope_docstring(scope_node): + """ Returns a cleaned version of the docstring token. """ + node = scope_node.get_doc_node() + if node is not None: + # TODO We have to check next leaves until there are no new + # leaves anymore that might be part of the docstring. A + # docstring can also look like this: ``'foo' 'bar' + # Returns a literal cleaned version of the ``Token``. + cleaned = cleandoc(safe_literal_eval(node.value)) + # Since we want the docstr output to be always unicode, just + # force it. + return force_unicode(cleaned) + return '' + + +def find_statement_documentation(tree_node): + if tree_node.type == 'expr_stmt': + tree_node = tree_node.parent # simple_stmt + maybe_string = tree_node.get_next_sibling() + if maybe_string is not None: + if maybe_string.type == 'simple_stmt': + maybe_string = maybe_string.children[0] + if maybe_string.type == 'string': + cleaned = cleandoc(safe_literal_eval(maybe_string.value)) + # Since we want the docstr output to be always unicode, just + # force it. + return force_unicode(cleaned) + return '' + + +def safe_literal_eval(value): + first_two = value[:2].lower() + if first_two[0] == 'f' or first_two in ('fr', 'rf'): + # literal_eval is not able to resovle f literals. We have to do that + # manually, but that's right now not implemented. + return '' + + try: + return literal_eval(value) + except SyntaxError: + # It's possible to create syntax errors with literals like rb'' in + # Python 2. This should not be possible and in that case just return an + # empty string. + # Before Python 3.3 there was a more strict definition in which order + # you could define literals. + return '' + + +def get_signature(funcdef, width=72, call_string=None, + omit_first_param=False, omit_return_annotation=False): + """ + Generate a string signature of a function. + + :param width: Fold lines if a line is longer than this value. + :type width: int + :arg func_name: Override function name when given. + :type func_name: str + + :rtype: str + """ + # Lambdas have no name. + if call_string is None: + if funcdef.type == 'lambdef': + call_string = '' + else: + call_string = funcdef.name.value + params = funcdef.get_params() + if omit_first_param: + params = params[1:] + p = '(' + ''.join(param.get_code() for param in params).strip() + ')' + # TODO this is pretty bad, we should probably just normalize. + p = re.sub(r'\s+', ' ', p) + if funcdef.annotation and not omit_return_annotation: + rtype = " ->" + funcdef.annotation.get_code() + else: + rtype = "" + code = call_string + p + rtype + + return '\n'.join(textwrap.wrap(code, width)) + + +def move(node, line_offset): + """ + Move the `Node` start_pos. + """ + try: + children = node.children + except AttributeError: + node.line += line_offset + else: + for c in children: + move(c, line_offset) + + +def get_following_comment_same_line(node): + """ + returns (as string) any comment that appears on the same line, + after the node, including the # + """ + try: + if node.type == 'for_stmt': + whitespace = node.children[5].get_first_leaf().prefix + elif node.type == 'with_stmt': + whitespace = node.children[3].get_first_leaf().prefix + elif node.type == 'funcdef': + # actually on the next line + whitespace = node.children[4].get_first_leaf().get_next_leaf().prefix + else: + whitespace = node.get_last_leaf().get_next_leaf().prefix + except AttributeError: + return None + except ValueError: + # TODO in some particular cases, the tree doesn't seem to be linked + # correctly + return None + if "#" not in whitespace: + return None + comment = whitespace[whitespace.index("#"):] + if "\r" in comment: + comment = comment[:comment.index("\r")] + if "\n" in comment: + comment = comment[:comment.index("\n")] + return comment + + +def is_scope(node): + t = node.type + if t == 'comp_for': + # Starting with Python 3.8, async is outside of the statement. + return node.children[1].type != 'sync_comp_for' + + return t in ('file_input', 'classdef', 'funcdef', 'lambdef', 'sync_comp_for') + + +def _get_parent_scope_cache(func): + cache = WeakKeyDictionary() + + def wrapper(used_names, node, include_flows=False): + try: + for_module = cache[used_names] + except KeyError: + for_module = cache[used_names] = {} + + try: + return for_module[node] + except KeyError: + result = for_module[node] = func(node, include_flows) + return result + return wrapper + + +def get_parent_scope(node, include_flows=False): + """ + Returns the underlying scope. + """ + scope = node.parent + if scope is None: + return None # It's a module already. + + while True: + if is_scope(scope) or include_flows and isinstance(scope, tree.Flow): + if scope.type in ('classdef', 'funcdef', 'lambdef'): + index = scope.children.index(':') + if scope.children[index].start_pos >= node.start_pos: + if node.parent.type == 'param' and node.parent.name == node: + pass + elif node.parent.type == 'tfpdef' and node.parent.children[0] == node: + pass + else: + scope = scope.parent + continue + return scope + scope = scope.parent + + +get_cached_parent_scope = _get_parent_scope_cache(get_parent_scope) + + +def get_cached_code_lines(grammar, path): + """ + Basically access the cached code lines in parso. This is not the nicest way + to do this, but we avoid splitting all the lines again. + """ + return parser_cache[grammar._hashed][path].lines + + +def cut_value_at_position(leaf, position): + """ + Cuts of the value of the leaf at position + """ + lines = split_lines(leaf.value, keepends=True)[:position[0] - leaf.line + 1] + column = position[1] + if leaf.line == position[0]: + column -= leaf.column + if not lines: + return '' + lines[-1] = lines[-1][:column] + return ''.join(lines) + + +def expr_is_dotted(node): + """ + Checks if a path looks like `name` or `name.foo.bar` and not `name()`. + """ + if node.type == 'atom': + if len(node.children) == 3 and node.children[0] == '(': + return expr_is_dotted(node.children[1]) + return False + if node.type == 'atom_expr': + children = node.children + if children[0] == 'await': + return False + if not expr_is_dotted(children[0]): + return False + # Check trailers + return all(c.children[0] == '.' for c in children[1:]) + return node.type == 'name' + + +def _function_is_x_method(method_name): + def wrapper(function_node): + """ + This is a heuristic. It will not hold ALL the times, but it will be + correct pretty much for anyone that doesn't try to beat it. + staticmethod/classmethod are builtins and unless overwritten, this will + be correct. + """ + for decorator in function_node.get_decorators(): + dotted_name = decorator.children[1] + if dotted_name.get_code() == method_name: + return True + return False + return wrapper + + +function_is_staticmethod = _function_is_x_method('staticmethod') +function_is_classmethod = _function_is_x_method('classmethod') diff --git a/.venv/lib/python3.8/site-packages/jedi/plugins/__init__.py b/.venv/lib/python3.8/site-packages/jedi/plugins/__init__.py new file mode 100644 index 00000000..23588bd4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/plugins/__init__.py @@ -0,0 +1,47 @@ +from functools import wraps + + +class _PluginManager(object): + def __init__(self): + self._registered_plugins = [] + self._cached_base_callbacks = {} + self._built_functions = {} + + def register(self, *plugins): + """ + Makes it possible to register your plugin. + """ + self._registered_plugins.extend(plugins) + self._build_functions() + + def decorate(self, name=None): + def decorator(callback): + @wraps(callback) + def wrapper(*args, **kwargs): + return built_functions[public_name](*args, **kwargs) + + public_name = name or callback.__name__ + + assert public_name not in self._built_functions + built_functions = self._built_functions + built_functions[public_name] = callback + self._cached_base_callbacks[public_name] = callback + + return wrapper + + return decorator + + def _build_functions(self): + for name, callback in self._cached_base_callbacks.items(): + for plugin in reversed(self._registered_plugins): + # Need to reverse so the first plugin is run first. + try: + func = getattr(plugin, name) + except AttributeError: + pass + else: + callback = func(callback) + self._built_functions[name] = callback + + +plugin_manager = _PluginManager() diff --git a/.venv/lib/python3.8/site-packages/jedi/plugins/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/plugins/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..53a52f28 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/plugins/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/plugins/__pycache__/django.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/plugins/__pycache__/django.cpython-38.pyc new file mode 100644 index 00000000..febed172 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/plugins/__pycache__/django.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/plugins/__pycache__/flask.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/plugins/__pycache__/flask.cpython-38.pyc new file mode 100644 index 00000000..6c1ca26e Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/plugins/__pycache__/flask.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/plugins/__pycache__/pytest.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/plugins/__pycache__/pytest.cpython-38.pyc new file mode 100644 index 00000000..eb647c55 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/plugins/__pycache__/pytest.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/plugins/__pycache__/registry.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/plugins/__pycache__/registry.cpython-38.pyc new file mode 100644 index 00000000..6f83df8c Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/plugins/__pycache__/registry.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/plugins/__pycache__/stdlib.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jedi/plugins/__pycache__/stdlib.cpython-38.pyc new file mode 100644 index 00000000..11d58aa5 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jedi/plugins/__pycache__/stdlib.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jedi/plugins/django.py b/.venv/lib/python3.8/site-packages/jedi/plugins/django.py new file mode 100644 index 00000000..88a3bfae --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/plugins/django.py @@ -0,0 +1,295 @@ +""" +Module is used to infer Django model fields. +""" +from jedi._compatibility import Parameter +from jedi import debug +from jedi.inference.cache import inference_state_function_cache +from jedi.inference.base_value import ValueSet, iterator_to_value_set, ValueWrapper +from jedi.inference.filters import DictFilter, AttributeOverwrite +from jedi.inference.names import NameWrapper, BaseTreeParamName +from jedi.inference.compiled.value import EmptyCompiledName +from jedi.inference.value.instance import TreeInstance +from jedi.inference.value.klass import ClassMixin +from jedi.inference.gradual.base import GenericClass +from jedi.inference.gradual.generics import TupleGenericManager +from jedi.inference.signature import AbstractSignature + + +mapping = { + 'IntegerField': (None, 'int'), + 'BigIntegerField': (None, 'int'), + 'PositiveIntegerField': (None, 'int'), + 'SmallIntegerField': (None, 'int'), + 'CharField': (None, 'str'), + 'TextField': (None, 'str'), + 'EmailField': (None, 'str'), + 'GenericIPAddressField': (None, 'str'), + 'URLField': (None, 'str'), + 'FloatField': (None, 'float'), + 'BinaryField': (None, 'bytes'), + 'BooleanField': (None, 'bool'), + 'DecimalField': ('decimal', 'Decimal'), + 'TimeField': ('datetime', 'time'), + 'DurationField': ('datetime', 'timedelta'), + 'DateField': ('datetime', 'date'), + 'DateTimeField': ('datetime', 'datetime'), + 'UUIDField': ('uuid', 'UUID'), +} + +_FILTER_LIKE_METHODS = ('create', 'filter', 'exclude', 'update', 'get', + 'get_or_create', 'update_or_create') + + +@inference_state_function_cache() +def _get_deferred_attributes(inference_state): + return inference_state.import_module( + ('django', 'db', 'models', 'query_utils') + ).py__getattribute__('DeferredAttribute').execute_annotation() + + +def _infer_scalar_field(inference_state, field_name, field_tree_instance, is_instance): + try: + module_name, attribute_name = mapping[field_tree_instance.py__name__()] + except KeyError: + return None + + if not is_instance: + return _get_deferred_attributes(inference_state) + + if module_name is None: + module = inference_state.builtins_module + else: + module = inference_state.import_module((module_name,)) + + for attribute in module.py__getattribute__(attribute_name): + return attribute.execute_with_values() + + +@iterator_to_value_set +def _get_foreign_key_values(cls, field_tree_instance): + if isinstance(field_tree_instance, TreeInstance): + # TODO private access.. + argument_iterator = field_tree_instance._arguments.unpack() + key, lazy_values = next(argument_iterator, (None, None)) + if key is None and lazy_values is not None: + for value in lazy_values.infer(): + if value.py__name__() == 'str': + foreign_key_class_name = value.get_safe_value() + module = cls.get_root_context() + for v in module.py__getattribute__(foreign_key_class_name): + if v.is_class(): + yield v + elif value.is_class(): + yield value + + +def _infer_field(cls, field_name, is_instance): + inference_state = cls.inference_state + result = field_name.infer() + for field_tree_instance in result: + scalar_field = _infer_scalar_field( + inference_state, field_name, field_tree_instance, is_instance) + if scalar_field is not None: + return scalar_field + + name = field_tree_instance.py__name__() + is_many_to_many = name == 'ManyToManyField' + if name in ('ForeignKey', 'OneToOneField') or is_many_to_many: + if not is_instance: + return _get_deferred_attributes(inference_state) + + values = _get_foreign_key_values(cls, field_tree_instance) + if is_many_to_many: + return ValueSet(filter(None, [ + _create_manager_for(v, 'RelatedManager') for v in values + ])) + else: + return values.execute_with_values() + + debug.dbg('django plugin: fail to infer `%s` from class `%s`', + field_name.string_name, cls.py__name__()) + return result + + +class DjangoModelName(NameWrapper): + def __init__(self, cls, name, is_instance): + super(DjangoModelName, self).__init__(name) + self._cls = cls + self._is_instance = is_instance + + def infer(self): + return _infer_field(self._cls, self._wrapped_name, self._is_instance) + + +def _create_manager_for(cls, manager_cls='BaseManager'): + managers = cls.inference_state.import_module( + ('django', 'db', 'models', 'manager') + ).py__getattribute__(manager_cls) + for m in managers: + if m.is_class_mixin(): + generics_manager = TupleGenericManager((ValueSet([cls]),)) + for c in GenericClass(m, generics_manager).execute_annotation(): + return c + return None + + +def _new_dict_filter(cls, is_instance): + filters = list(cls.get_filters( + is_instance=is_instance, + include_metaclasses=False, + include_type_when_class=False) + ) + dct = { + name.string_name: DjangoModelName(cls, name, is_instance) + for filter_ in reversed(filters) + for name in filter_.values() + } + if is_instance: + # Replace the objects with a name that amounts to nothing when accessed + # in an instance. This is not perfect and still completes "objects" in + # that case, but it at least not inferes stuff like `.objects.filter`. + # It would be nicer to do that in a better way, so that it also doesn't + # show up in completions, but it's probably just not worth doing that + # for the extra amount of work. + dct['objects'] = EmptyCompiledName(cls.inference_state, 'objects') + + return DictFilter(dct) + + +def is_django_model_base(value): + return value.py__name__() == 'ModelBase' \ + and value.get_root_context().py__name__() == 'django.db.models.base' + + +def get_metaclass_filters(func): + def wrapper(cls, metaclasses, is_instance): + for metaclass in metaclasses: + if is_django_model_base(metaclass): + return [_new_dict_filter(cls, is_instance)] + + return func(cls, metaclasses, is_instance) + return wrapper + + +def tree_name_to_values(func): + def wrapper(inference_state, context, tree_name): + result = func(inference_state, context, tree_name) + if tree_name.value in _FILTER_LIKE_METHODS: + # Here we try to overwrite stuff like User.objects.filter. We need + # this to make sure that keyword param completion works on these + # kind of methods. + for v in result: + if v.get_qualified_names() == ('_BaseQuerySet', tree_name.value) \ + and v.parent_context.is_module() \ + and v.parent_context.py__name__() == 'django.db.models.query': + qs = context.get_value() + generics = qs.get_generics() + if len(generics) >= 1: + return ValueSet(QuerySetMethodWrapper(v, model) + for model in generics[0]) + + elif tree_name.value == 'BaseManager' and context.is_module() \ + and context.py__name__() == 'django.db.models.manager': + return ValueSet(ManagerWrapper(r) for r in result) + + elif tree_name.value == 'Field' and context.is_module() \ + and context.py__name__() == 'django.db.models.fields': + return ValueSet(FieldWrapper(r) for r in result) + return result + return wrapper + + +def _find_fields(cls): + for name in _new_dict_filter(cls, is_instance=False).values(): + for value in name.infer(): + if value.name.get_qualified_names(include_module_names=True) \ + == ('django', 'db', 'models', 'query_utils', 'DeferredAttribute'): + yield name + + +def _get_signatures(cls): + return [DjangoModelSignature(cls, field_names=list(_find_fields(cls)))] + + +def get_metaclass_signatures(func): + def wrapper(cls, metaclasses): + for metaclass in metaclasses: + if is_django_model_base(metaclass): + return _get_signatures(cls) + return func(cls, metaclass) + return wrapper + + +class ManagerWrapper(ValueWrapper): + def py__getitem__(self, index_value_set, contextualized_node): + return ValueSet( + GenericManagerWrapper(generic) + for generic in self._wrapped_value.py__getitem__( + index_value_set, contextualized_node) + ) + + +class GenericManagerWrapper(AttributeOverwrite, ClassMixin): + def py__get__on_class(self, calling_instance, instance, class_value): + return calling_instance.class_value.with_generics( + (ValueSet({class_value}),) + ).py__call__(calling_instance._arguments) + + def with_generics(self, generics_tuple): + return self._wrapped_value.with_generics(generics_tuple) + + +class FieldWrapper(ValueWrapper): + def py__getitem__(self, index_value_set, contextualized_node): + return ValueSet( + GenericFieldWrapper(generic) + for generic in self._wrapped_value.py__getitem__( + index_value_set, contextualized_node) + ) + + +class GenericFieldWrapper(AttributeOverwrite, ClassMixin): + def py__get__on_class(self, calling_instance, instance, class_value): + # This is mostly an optimization to avoid Jedi aborting inference, + # because of too many function executions of Field.__get__. + return ValueSet({calling_instance}) + + +class DjangoModelSignature(AbstractSignature): + def __init__(self, value, field_names): + super(DjangoModelSignature, self).__init__(value) + self._field_names = field_names + + def get_param_names(self, resolve_stars=False): + return [DjangoParamName(name) for name in self._field_names] + + +class DjangoParamName(BaseTreeParamName): + def __init__(self, field_name): + super(DjangoParamName, self).__init__(field_name.parent_context, field_name.tree_name) + self._field_name = field_name + + def get_kind(self): + return Parameter.KEYWORD_ONLY + + def infer(self): + return self._field_name.infer() + + +class QuerySetMethodWrapper(ValueWrapper): + def __init__(self, method, model_cls): + super(QuerySetMethodWrapper, self).__init__(method) + self._model_cls = model_cls + + def py__get__(self, instance, class_value): + return ValueSet({QuerySetBoundMethodWrapper(v, self._model_cls) + for v in self._wrapped_value.py__get__(instance, class_value)}) + + +class QuerySetBoundMethodWrapper(ValueWrapper): + def __init__(self, method, model_cls): + super(QuerySetBoundMethodWrapper, self).__init__(method) + self._model_cls = model_cls + + def get_signatures(self): + return _get_signatures(self._model_cls) diff --git a/.venv/lib/python3.8/site-packages/jedi/plugins/flask.py b/.venv/lib/python3.8/site-packages/jedi/plugins/flask.py new file mode 100644 index 00000000..693c3ae7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/plugins/flask.py @@ -0,0 +1,21 @@ +def import_module(callback): + """ + Handle "magic" Flask extension imports: + ``flask.ext.foo`` is really ``flask_foo`` or ``flaskext.foo``. + """ + def wrapper(inference_state, import_names, module_context, *args, **kwargs): + if len(import_names) == 3 and import_names[:2] == ('flask', 'ext'): + # New style. + ipath = (u'flask_' + import_names[2]), + value_set = callback(inference_state, ipath, None, *args, **kwargs) + if value_set: + return value_set + value_set = callback(inference_state, (u'flaskext',), None, *args, **kwargs) + return callback( + inference_state, + (u'flaskext', import_names[2]), + next(iter(value_set)), + *args, **kwargs + ) + return callback(inference_state, import_names, module_context, *args, **kwargs) + return wrapper diff --git a/.venv/lib/python3.8/site-packages/jedi/plugins/pytest.py b/.venv/lib/python3.8/site-packages/jedi/plugins/pytest.py new file mode 100644 index 00000000..f9b04284 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/plugins/pytest.py @@ -0,0 +1,164 @@ +from parso.python.tree import search_ancestor +from jedi._compatibility import FileNotFoundError +from jedi.inference.cache import inference_state_method_cache +from jedi.inference.imports import load_module_from_path +from jedi.inference.filters import ParserTreeFilter +from jedi.inference.base_value import NO_VALUES, ValueSet + +_PYTEST_FIXTURE_MODULES = [ + ('_pytest', 'monkeypatch'), + ('_pytest', 'capture'), + ('_pytest', 'logging'), + ('_pytest', 'tmpdir'), + ('_pytest', 'pytester'), +] + + +def execute(callback): + def wrapper(value, arguments): + # This might not be necessary anymore in pytest 4/5, definitely needed + # for pytest 3. + if value.py__name__() == 'fixture' \ + and value.parent_context.py__name__() == '_pytest.fixtures': + return NO_VALUES + + return callback(value, arguments) + return wrapper + + +def infer_anonymous_param(func): + def get_returns(value): + if value.tree_node.annotation is not None: + return value.execute_with_values() + + # In pytest we need to differentiate between generators and normal + # returns. + # Parameters still need to be anonymous, .as_context() ensures that. + function_context = value.as_context() + if function_context.is_generator(): + return function_context.merge_yield_values() + else: + return function_context.get_return_values() + + def wrapper(param_name): + is_pytest_param, param_name_is_function_name = \ + _is_a_pytest_param_and_inherited(param_name) + if is_pytest_param: + module = param_name.get_root_context() + fixtures = _goto_pytest_fixture( + module, + param_name.string_name, + # This skips the current module, because we are basically + # inheriting a fixture from somewhere else. + skip_own_module=param_name_is_function_name, + ) + if fixtures: + return ValueSet.from_sets( + get_returns(value) + for fixture in fixtures + for value in fixture.infer() + ) + return func(param_name) + return wrapper + + +def goto_anonymous_param(func): + def wrapper(param_name): + is_pytest_param, param_name_is_function_name = \ + _is_a_pytest_param_and_inherited(param_name) + if is_pytest_param: + names = _goto_pytest_fixture( + param_name.get_root_context(), + param_name.string_name, + skip_own_module=param_name_is_function_name, + ) + if names: + return names + return func(param_name) + return wrapper + + +def complete_param_names(func): + def wrapper(context, func_name, decorator_nodes): + module_context = context.get_root_context() + if _is_pytest_func(func_name, decorator_nodes): + names = [] + for module_context in _iter_pytest_modules(module_context): + names += FixtureFilter(module_context).values() + if names: + return names + return func(context, func_name, decorator_nodes) + return wrapper + + +def _goto_pytest_fixture(module_context, name, skip_own_module): + for module_context in _iter_pytest_modules(module_context, skip_own_module=skip_own_module): + names = FixtureFilter(module_context).get(name) + if names: + return names + + +def _is_a_pytest_param_and_inherited(param_name): + """ + Pytest params are either in a `test_*` function or have a pytest fixture + with the decorator @pytest.fixture. + + This is a heuristic and will work in most cases. + """ + funcdef = search_ancestor(param_name.tree_name, 'funcdef') + if funcdef is None: # A lambda + return False, False + decorators = funcdef.get_decorators() + return _is_pytest_func(funcdef.name.value, decorators), \ + funcdef.name.value == param_name.string_name + + +def _is_pytest_func(func_name, decorator_nodes): + return func_name.startswith('test') \ + or any('fixture' in n.get_code() for n in decorator_nodes) + + +@inference_state_method_cache() +def _iter_pytest_modules(module_context, skip_own_module=False): + if not skip_own_module: + yield module_context + + file_io = module_context.get_value().file_io + if file_io is not None: + folder = file_io.get_parent_folder() + sys_path = module_context.inference_state.get_sys_path() + while any(folder.path.startswith(p) for p in sys_path): + file_io = folder.get_file_io('conftest.py') + if file_io.path != module_context.py__file__(): + try: + m = load_module_from_path(module_context.inference_state, file_io) + yield m.as_context() + except FileNotFoundError: + pass + folder = folder.get_parent_folder() + + for names in _PYTEST_FIXTURE_MODULES: + for module_value in module_context.inference_state.import_module(names): + yield module_value.as_context() + + +class FixtureFilter(ParserTreeFilter): + def _filter(self, names): + for name in super(FixtureFilter, self)._filter(names): + funcdef = name.parent + if funcdef.type == 'funcdef': + # Class fixtures are not supported + decorated = funcdef.parent + if decorated.type == 'decorated' and self._is_fixture(decorated): + yield name + + def _is_fixture(self, decorated): + for decorator in decorated.children: + dotted_name = decorator.children[1] + # A heuristic, this makes it faster. + if 'fixture' in dotted_name.get_code(): + for value in self.parent_context.infer_node(dotted_name): + if value.name.get_qualified_names(include_module_names=True) \ + == ('_pytest', 'fixtures', 'fixture'): + return True + return False diff --git a/.venv/lib/python3.8/site-packages/jedi/plugins/registry.py b/.venv/lib/python3.8/site-packages/jedi/plugins/registry.py new file mode 100644 index 00000000..c1a0b749 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/plugins/registry.py @@ -0,0 +1,12 @@ +""" +This is not a plugin, this is just the place were plugins are registered. +""" + +from jedi.plugins import stdlib +from jedi.plugins import flask +from jedi.plugins import pytest +from jedi.plugins import django +from jedi.plugins import plugin_manager + + +plugin_manager.register(stdlib, flask, pytest, django) diff --git a/.venv/lib/python3.8/site-packages/jedi/plugins/stdlib.py b/.venv/lib/python3.8/site-packages/jedi/plugins/stdlib.py new file mode 100644 index 00000000..382b8ced --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/plugins/stdlib.py @@ -0,0 +1,849 @@ +""" +Implementations of standard library functions, because it's not possible to +understand them with Jedi. + +To add a new implementation, create a function and add it to the +``_implemented`` dict at the bottom of this module. + +Note that this module exists only to implement very specific functionality in +the standard library. The usual way to understand the standard library is the +compiled module that returns the types for C-builtins. +""" +import parso +import os + +from jedi._compatibility import force_unicode, Parameter +from jedi import debug +from jedi.inference.utils import safe_property +from jedi.inference.helpers import get_str_or_none +from jedi.inference.arguments import iterate_argument_clinic, ParamIssue, \ + repack_with_argument_clinic, AbstractArguments, TreeArgumentsWrapper +from jedi.inference import analysis +from jedi.inference import compiled +from jedi.inference.value.instance import \ + AnonymousMethodExecutionContext, MethodExecutionContext +from jedi.inference.base_value import ContextualizedNode, \ + NO_VALUES, ValueSet, ValueWrapper, LazyValueWrapper +from jedi.inference.value import ClassValue, ModuleValue +from jedi.inference.value.klass import ClassMixin +from jedi.inference.value.function import FunctionMixin +from jedi.inference.value import iterable +from jedi.inference.lazy_value import LazyTreeValue, LazyKnownValue, \ + LazyKnownValues +from jedi.inference.names import ValueName, BaseTreeParamName +from jedi.inference.filters import AttributeOverwrite, publish_method, \ + ParserTreeFilter, DictFilter +from jedi.inference.signature import AbstractSignature, SignatureWrapper + + +# Copied from Python 3.6's stdlib. +_NAMEDTUPLE_CLASS_TEMPLATE = """\ +_property = property +_tuple = tuple +from operator import itemgetter as _itemgetter +from collections import OrderedDict + +class {typename}(tuple): + __slots__ = () + + _fields = {field_names!r} + + def __new__(_cls, {arg_list}): + 'Create new instance of {typename}({arg_list})' + return _tuple.__new__(_cls, ({arg_list})) + + @classmethod + def _make(cls, iterable, new=tuple.__new__, len=len): + 'Make a new {typename} object from a sequence or iterable' + result = new(cls, iterable) + if len(result) != {num_fields:d}: + raise TypeError('Expected {num_fields:d} arguments, got %d' % len(result)) + return result + + def _replace(_self, **kwds): + 'Return a new {typename} object replacing specified fields with new values' + result = _self._make(map(kwds.pop, {field_names!r}, _self)) + if kwds: + raise ValueError('Got unexpected field names: %r' % list(kwds)) + return result + + def __repr__(self): + 'Return a nicely formatted representation string' + return self.__class__.__name__ + '({repr_fmt})' % self + + def _asdict(self): + 'Return a new OrderedDict which maps field names to their values.' + return OrderedDict(zip(self._fields, self)) + + def __getnewargs__(self): + 'Return self as a plain tuple. Used by copy and pickle.' + return tuple(self) + + # These methods were added by Jedi. + # __new__ doesn't really work with Jedi. So adding this to nametuples seems + # like the easiest way. + def __init__(self, {arg_list}): + 'A helper function for namedtuple.' + self.__iterable = ({arg_list}) + + def __iter__(self): + for i in self.__iterable: + yield i + + def __getitem__(self, y): + return self.__iterable[y] + +{field_defs} +""" + +_NAMEDTUPLE_FIELD_TEMPLATE = '''\ + {name} = _property(_itemgetter({index:d}), doc='Alias for field number {index:d}') +''' + + +def execute(callback): + def wrapper(value, arguments): + def call(): + return callback(value, arguments=arguments) + + try: + obj_name = value.name.string_name + except AttributeError: + pass + else: + p = value.parent_context + if p is not None and p.is_builtins_module(): + module_name = 'builtins' + elif p is not None and p.is_module(): + module_name = p.py__name__() + else: + return call() + + if value.is_bound_method(): + return call() + + # for now we just support builtin functions. + try: + func = _implemented[module_name][obj_name] + except KeyError: + pass + else: + return func(value, arguments=arguments, callback=call) + return call() + + return wrapper + + +def _follow_param(inference_state, arguments, index): + try: + key, lazy_value = list(arguments.unpack())[index] + except IndexError: + return NO_VALUES + else: + return lazy_value.infer() + + +def argument_clinic(clinic_string, want_value=False, want_context=False, + want_arguments=False, want_inference_state=False, + want_callback=False): + """ + Works like Argument Clinic (PEP 436), to validate function params. + """ + + def f(func): + def wrapper(value, arguments, callback): + try: + args = tuple(iterate_argument_clinic( + value.inference_state, arguments, clinic_string)) + except ParamIssue: + return NO_VALUES + + debug.dbg('builtin start %s' % value, color='MAGENTA') + kwargs = {} + if want_context: + kwargs['context'] = arguments.context + if want_value: + kwargs['value'] = value + if want_inference_state: + kwargs['inference_state'] = value.inference_state + if want_arguments: + kwargs['arguments'] = arguments + if want_callback: + kwargs['callback'] = callback + result = func(*args, **kwargs) + debug.dbg('builtin end: %s', result, color='MAGENTA') + return result + + return wrapper + return f + + +@argument_clinic('iterator[, default], /', want_inference_state=True) +def builtins_next(iterators, defaults, inference_state): + if inference_state.environment.version_info.major == 2: + name = 'next' + else: + name = '__next__' + + # TODO theoretically we have to check here if something is an iterator. + # That is probably done by checking if it's not a class. + return defaults | iterators.py__getattribute__(name).execute_with_values() + + +@argument_clinic('iterator[, default], /') +def builtins_iter(iterators_or_callables, defaults): + # TODO implement this if it's a callable. + return iterators_or_callables.py__getattribute__('__iter__').execute_with_values() + + +@argument_clinic('object, name[, default], /') +def builtins_getattr(objects, names, defaults=None): + # follow the first param + for value in objects: + for name in names: + string = get_str_or_none(name) + if string is None: + debug.warning('getattr called without str') + continue + else: + return value.py__getattribute__(force_unicode(string)) + return NO_VALUES + + +@argument_clinic('object[, bases, dict], /') +def builtins_type(objects, bases, dicts): + if bases or dicts: + # It's a type creation... maybe someday... + return NO_VALUES + else: + return objects.py__class__() + + +class SuperInstance(LazyValueWrapper): + """To be used like the object ``super`` returns.""" + def __init__(self, inference_state, instance): + self.inference_state = inference_state + self._instance = instance # Corresponds to super().__self__ + + def _get_bases(self): + return self._instance.py__class__().py__bases__() + + def _get_wrapped_value(self): + objs = self._get_bases()[0].infer().execute_with_values() + if not objs: + # This is just a fallback and will only be used, if it's not + # possible to find a class + return self._instance + return next(iter(objs)) + + def get_filters(self, origin_scope=None): + for b in self._get_bases(): + for value in b.infer().execute_with_values(): + for f in value.get_filters(): + yield f + + +@argument_clinic('[type[, value]], /', want_context=True) +def builtins_super(types, objects, context): + instance = None + if isinstance(context, AnonymousMethodExecutionContext): + instance = context.instance + elif isinstance(context, MethodExecutionContext): + instance = context.instance + if instance is None: + return NO_VALUES + return ValueSet({SuperInstance(instance.inference_state, instance)}) + + +class ReversedObject(AttributeOverwrite): + def __init__(self, reversed_obj, iter_list): + super(ReversedObject, self).__init__(reversed_obj) + self._iter_list = iter_list + + def py__iter__(self, contextualized_node): + return self._iter_list + + @publish_method('next', python_version_match=2) + @publish_method('__next__', python_version_match=3) + def py__next__(self, arguments): + return ValueSet.from_sets( + lazy_value.infer() for lazy_value in self._iter_list + ) + + +@argument_clinic('sequence, /', want_value=True, want_arguments=True) +def builtins_reversed(sequences, value, arguments): + # While we could do without this variable (just by using sequences), we + # want static analysis to work well. Therefore we need to generated the + # values again. + key, lazy_value = next(arguments.unpack()) + cn = None + if isinstance(lazy_value, LazyTreeValue): + cn = ContextualizedNode(lazy_value.context, lazy_value.data) + ordered = list(sequences.iterate(cn)) + + # Repack iterator values and then run it the normal way. This is + # necessary, because `reversed` is a function and autocompletion + # would fail in certain cases like `reversed(x).__iter__` if we + # just returned the result directly. + seq, = value.inference_state.typing_module.py__getattribute__('Iterator').execute_with_values() + return ValueSet([ReversedObject(seq, list(reversed(ordered)))]) + + +@argument_clinic('value, type, /', want_arguments=True, want_inference_state=True) +def builtins_isinstance(objects, types, arguments, inference_state): + bool_results = set() + for o in objects: + cls = o.py__class__() + try: + cls.py__bases__ + except AttributeError: + # This is temporary. Everything should have a class attribute in + # Python?! Maybe we'll leave it here, because some numpy objects or + # whatever might not. + bool_results = set([True, False]) + break + + mro = list(cls.py__mro__()) + + for cls_or_tup in types: + if cls_or_tup.is_class(): + bool_results.add(cls_or_tup in mro) + elif cls_or_tup.name.string_name == 'tuple' \ + and cls_or_tup.get_root_context().is_builtins_module(): + # Check for tuples. + classes = ValueSet.from_sets( + lazy_value.infer() + for lazy_value in cls_or_tup.iterate() + ) + bool_results.add(any(cls in mro for cls in classes)) + else: + _, lazy_value = list(arguments.unpack())[1] + if isinstance(lazy_value, LazyTreeValue): + node = lazy_value.data + message = 'TypeError: isinstance() arg 2 must be a ' \ + 'class, type, or tuple of classes and types, ' \ + 'not %s.' % cls_or_tup + analysis.add(lazy_value.context, 'type-error-isinstance', node, message) + + return ValueSet( + compiled.builtin_from_name(inference_state, force_unicode(str(b))) + for b in bool_results + ) + + +class StaticMethodObject(ValueWrapper): + def py__get__(self, instance, class_value): + return ValueSet([self._wrapped_value]) + + +@argument_clinic('sequence, /') +def builtins_staticmethod(functions): + return ValueSet(StaticMethodObject(f) for f in functions) + + +class ClassMethodObject(ValueWrapper): + def __init__(self, class_method_obj, function): + super(ClassMethodObject, self).__init__(class_method_obj) + self._function = function + + def py__get__(self, instance, class_value): + return ValueSet([ + ClassMethodGet(__get__, class_value, self._function) + for __get__ in self._wrapped_value.py__getattribute__('__get__') + ]) + + +class ClassMethodGet(ValueWrapper): + def __init__(self, get_method, klass, function): + super(ClassMethodGet, self).__init__(get_method) + self._class = klass + self._function = function + + def get_signatures(self): + return [sig.bind(self._function) for sig in self._function.get_signatures()] + + def py__call__(self, arguments): + return self._function.execute(ClassMethodArguments(self._class, arguments)) + + +class ClassMethodArguments(TreeArgumentsWrapper): + def __init__(self, klass, arguments): + super(ClassMethodArguments, self).__init__(arguments) + self._class = klass + + def unpack(self, func=None): + yield None, LazyKnownValue(self._class) + for values in self._wrapped_arguments.unpack(func): + yield values + + +@argument_clinic('sequence, /', want_value=True, want_arguments=True) +def builtins_classmethod(functions, value, arguments): + return ValueSet( + ClassMethodObject(class_method_object, function) + for class_method_object in value.py__call__(arguments=arguments) + for function in functions + ) + + +class PropertyObject(AttributeOverwrite, ValueWrapper): + def __init__(self, property_obj, function): + super(PropertyObject, self).__init__(property_obj) + self._function = function + + def py__get__(self, instance, class_value): + if instance is None: + return ValueSet([self]) + return self._function.execute_with_values(instance) + + @publish_method('deleter') + @publish_method('getter') + @publish_method('setter') + def _return_self(self, arguments): + return ValueSet({self}) + + +@argument_clinic('func, /', want_callback=True) +def builtins_property(functions, callback): + return ValueSet( + PropertyObject(property_value, function) + for property_value in callback() + for function in functions + ) + + +def collections_namedtuple(value, arguments, callback): + """ + Implementation of the namedtuple function. + + This has to be done by processing the namedtuple class template and + inferring the result. + + """ + inference_state = value.inference_state + + # Process arguments + name = u'jedi_unknown_namedtuple' + for c in _follow_param(inference_state, arguments, 0): + x = get_str_or_none(c) + if x is not None: + name = force_unicode(x) + break + + # TODO here we only use one of the types, we should use all. + param_values = _follow_param(inference_state, arguments, 1) + if not param_values: + return NO_VALUES + _fields = list(param_values)[0] + string = get_str_or_none(_fields) + if string is not None: + fields = force_unicode(string).replace(',', ' ').split() + elif isinstance(_fields, iterable.Sequence): + fields = [ + force_unicode(get_str_or_none(v)) + for lazy_value in _fields.py__iter__() + for v in lazy_value.infer() + ] + fields = [f for f in fields if f is not None] + else: + return NO_VALUES + + # Build source code + code = _NAMEDTUPLE_CLASS_TEMPLATE.format( + typename=name, + field_names=tuple(fields), + num_fields=len(fields), + arg_list=repr(tuple(fields)).replace("u'", "").replace("'", "")[1:-1], + repr_fmt='', + field_defs='\n'.join(_NAMEDTUPLE_FIELD_TEMPLATE.format(index=index, name=name) + for index, name in enumerate(fields)) + ) + + # Parse source code + module = inference_state.grammar.parse(code) + generated_class = next(module.iter_classdefs()) + parent_context = ModuleValue( + inference_state, module, + code_lines=parso.split_lines(code, keepends=True), + ).as_context() + + return ValueSet([ClassValue(inference_state, parent_context, generated_class)]) + + +class PartialObject(ValueWrapper): + def __init__(self, actual_value, arguments, instance=None): + super(PartialObject, self).__init__(actual_value) + self._actual_value = actual_value + self._arguments = arguments + self._instance = instance + + def _get_function(self, unpacked_arguments): + key, lazy_value = next(unpacked_arguments, (None, None)) + if key is not None or lazy_value is None: + debug.warning("Partial should have a proper function %s", self._arguments) + return None + return lazy_value.infer() + + def get_signatures(self): + unpacked_arguments = self._arguments.unpack() + func = self._get_function(unpacked_arguments) + if func is None: + return [] + + arg_count = 0 + if self._instance is not None: + arg_count = 1 + keys = set() + for key, _ in unpacked_arguments: + if key is None: + arg_count += 1 + else: + keys.add(key) + return [PartialSignature(s, arg_count, keys) for s in func.get_signatures()] + + def py__call__(self, arguments): + func = self._get_function(self._arguments.unpack()) + if func is None: + return NO_VALUES + + return func.execute( + MergedPartialArguments(self._arguments, arguments, self._instance) + ) + + def py__get__(self, instance, class_value): + return ValueSet([self]) + + +class PartialMethodObject(PartialObject): + def py__get__(self, instance, class_value): + if instance is None: + return ValueSet([self]) + return ValueSet([PartialObject(self._actual_value, self._arguments, instance)]) + + +class PartialSignature(SignatureWrapper): + def __init__(self, wrapped_signature, skipped_arg_count, skipped_arg_set): + super(PartialSignature, self).__init__(wrapped_signature) + self._skipped_arg_count = skipped_arg_count + self._skipped_arg_set = skipped_arg_set + + def get_param_names(self, resolve_stars=False): + names = self._wrapped_signature.get_param_names()[self._skipped_arg_count:] + return [n for n in names if n.string_name not in self._skipped_arg_set] + + +class MergedPartialArguments(AbstractArguments): + def __init__(self, partial_arguments, call_arguments, instance=None): + self._partial_arguments = partial_arguments + self._call_arguments = call_arguments + self._instance = instance + + def unpack(self, funcdef=None): + unpacked = self._partial_arguments.unpack(funcdef) + # Ignore this one, it's the function. It was checked before that it's + # there. + next(unpacked, None) + if self._instance is not None: + yield None, LazyKnownValue(self._instance) + for key_lazy_value in unpacked: + yield key_lazy_value + for key_lazy_value in self._call_arguments.unpack(funcdef): + yield key_lazy_value + + +def functools_partial(value, arguments, callback): + return ValueSet( + PartialObject(instance, arguments) + for instance in value.py__call__(arguments) + ) + + +def functools_partialmethod(value, arguments, callback): + return ValueSet( + PartialMethodObject(instance, arguments) + for instance in value.py__call__(arguments) + ) + + +@argument_clinic('first, /') +def _return_first_param(firsts): + return firsts + + +@argument_clinic('seq') +def _random_choice(sequences): + return ValueSet.from_sets( + lazy_value.infer() + for sequence in sequences + for lazy_value in sequence.py__iter__() + ) + + +def _dataclass(value, arguments, callback): + for c in _follow_param(value.inference_state, arguments, 0): + if c.is_class(): + return ValueSet([DataclassWrapper(c)]) + else: + return ValueSet([value]) + return NO_VALUES + + +class DataclassWrapper(ValueWrapper, ClassMixin): + def get_signatures(self): + param_names = [] + for cls in reversed(list(self.py__mro__())): + if isinstance(cls, DataclassWrapper): + filter_ = cls.as_context().get_global_filter() + # .values ordering is not guaranteed, at least not in + # Python < 3.6, when dicts where not ordered, which is an + # implementation detail anyway. + for name in sorted(filter_.values(), key=lambda name: name.start_pos): + d = name.tree_name.get_definition() + annassign = d.children[1] + if d.type == 'expr_stmt' and annassign.type == 'annassign': + if len(annassign.children) < 4: + default = None + else: + default = annassign.children[3] + param_names.append(DataclassParamName( + parent_context=cls.parent_context, + tree_name=name.tree_name, + annotation_node=annassign.children[1], + default_node=default, + )) + return [DataclassSignature(cls, param_names)] + + +class DataclassSignature(AbstractSignature): + def __init__(self, value, param_names): + super(DataclassSignature, self).__init__(value) + self._param_names = param_names + + def get_param_names(self, resolve_stars=False): + return self._param_names + + +class DataclassParamName(BaseTreeParamName): + def __init__(self, parent_context, tree_name, annotation_node, default_node): + super(DataclassParamName, self).__init__(parent_context, tree_name) + self.annotation_node = annotation_node + self.default_node = default_node + + def get_kind(self): + return Parameter.POSITIONAL_OR_KEYWORD + + def infer(self): + if self.annotation_node is None: + return NO_VALUES + else: + return self.parent_context.infer_node(self.annotation_node) + + +class ItemGetterCallable(ValueWrapper): + def __init__(self, instance, args_value_set): + super(ItemGetterCallable, self).__init__(instance) + self._args_value_set = args_value_set + + @repack_with_argument_clinic('item, /') + def py__call__(self, item_value_set): + value_set = NO_VALUES + for args_value in self._args_value_set: + lazy_values = list(args_value.py__iter__()) + if len(lazy_values) == 1: + # TODO we need to add the contextualized value. + value_set |= item_value_set.get_item(lazy_values[0].infer(), None) + else: + value_set |= ValueSet([iterable.FakeList( + self._wrapped_value.inference_state, + [ + LazyKnownValues(item_value_set.get_item(lazy_value.infer(), None)) + for lazy_value in lazy_values + ], + )]) + return value_set + + +@argument_clinic('func, /') +def _functools_wraps(funcs): + return ValueSet(WrapsCallable(func) for func in funcs) + + +class WrapsCallable(ValueWrapper): + # XXX this is not the correct wrapped value, it should be a weird + # partials object, but it doesn't matter, because it's always used as a + # decorator anyway. + @repack_with_argument_clinic('func, /') + def py__call__(self, funcs): + return ValueSet({Wrapped(func, self._wrapped_value) for func in funcs}) + + +class Wrapped(ValueWrapper, FunctionMixin): + def __init__(self, func, original_function): + super(Wrapped, self).__init__(func) + self._original_function = original_function + + @property + def name(self): + return self._original_function.name + + def get_signature_functions(self): + return [self] + + +@argument_clinic('*args, /', want_value=True, want_arguments=True) +def _operator_itemgetter(args_value_set, value, arguments): + return ValueSet([ + ItemGetterCallable(instance, args_value_set) + for instance in value.py__call__(arguments) + ]) + + +def _create_string_input_function(func): + @argument_clinic('string, /', want_value=True, want_arguments=True) + def wrapper(strings, value, arguments): + def iterate(): + for value in strings: + s = get_str_or_none(value) + if s is not None: + s = func(s) + yield compiled.create_simple_object(value.inference_state, s) + values = ValueSet(iterate()) + if values: + return values + return value.py__call__(arguments) + return wrapper + + +@argument_clinic('*args, /', want_callback=True) +def _os_path_join(args_set, callback): + if len(args_set) == 1: + string = u'' + sequence, = args_set + is_first = True + for lazy_value in sequence.py__iter__(): + string_values = lazy_value.infer() + if len(string_values) != 1: + break + s = get_str_or_none(next(iter(string_values))) + if s is None: + break + if not is_first: + string += os.path.sep + string += force_unicode(s) + is_first = False + else: + return ValueSet([compiled.create_simple_object(sequence.inference_state, string)]) + return callback() + + +_implemented = { + 'builtins': { + 'getattr': builtins_getattr, + 'type': builtins_type, + 'super': builtins_super, + 'reversed': builtins_reversed, + 'isinstance': builtins_isinstance, + 'next': builtins_next, + 'iter': builtins_iter, + 'staticmethod': builtins_staticmethod, + 'classmethod': builtins_classmethod, + 'property': builtins_property, + }, + 'copy': { + 'copy': _return_first_param, + 'deepcopy': _return_first_param, + }, + 'json': { + 'load': lambda value, arguments, callback: NO_VALUES, + 'loads': lambda value, arguments, callback: NO_VALUES, + }, + 'collections': { + 'namedtuple': collections_namedtuple, + }, + 'functools': { + 'partial': functools_partial, + 'partialmethod': functools_partialmethod, + 'wraps': _functools_wraps, + }, + '_weakref': { + 'proxy': _return_first_param, + }, + 'random': { + 'choice': _random_choice, + }, + 'operator': { + 'itemgetter': _operator_itemgetter, + }, + 'abc': { + # Not sure if this is necessary, but it's used a lot in typeshed and + # it's for now easier to just pass the function. + 'abstractmethod': _return_first_param, + }, + 'typing': { + # The _alias function just leads to some annoying type inference. + # Therefore, just make it return nothing, which leads to the stubs + # being used instead. This only matters for 3.7+. + '_alias': lambda value, arguments, callback: NO_VALUES, + # runtime_checkable doesn't really change anything and is just + # adding logs for infering stuff, so we can safely ignore it. + 'runtime_checkable': lambda value, arguments, callback: NO_VALUES, + }, + 'dataclasses': { + # For now this works at least better than Jedi trying to understand it. + 'dataclass': _dataclass + }, + 'os.path': { + 'dirname': _create_string_input_function(os.path.dirname), + 'abspath': _create_string_input_function(os.path.abspath), + 'relpath': _create_string_input_function(os.path.relpath), + 'join': _os_path_join, + } +} + + +def get_metaclass_filters(func): + def wrapper(cls, metaclasses, is_instance): + for metaclass in metaclasses: + if metaclass.py__name__() == 'EnumMeta' \ + and metaclass.get_root_context().py__name__() == 'enum': + filter_ = ParserTreeFilter(parent_context=cls.as_context()) + return [DictFilter({ + name.string_name: EnumInstance(cls, name).name for name in filter_.values() + })] + return func(cls, metaclasses, is_instance) + return wrapper + + +class EnumInstance(LazyValueWrapper): + def __init__(self, cls, name): + self.inference_state = cls.inference_state + self._cls = cls # Corresponds to super().__self__ + self._name = name + self.tree_node = self._name.tree_name + + @safe_property + def name(self): + return ValueName(self, self._name.tree_name) + + def _get_wrapped_value(self): + value, = self._cls.execute_with_values() + return value + + def get_filters(self, origin_scope=None): + yield DictFilter(dict( + name=compiled.create_simple_object(self.inference_state, self._name.string_name).name, + value=self._name, + )) + for f in self._get_wrapped_value().get_filters(): + yield f + + +def tree_name_to_values(func): + def wrapper(inference_state, context, tree_name): + if tree_name.value == 'sep' and context.is_module() and context.py__name__() == 'os.path': + return ValueSet({ + compiled.create_simple_object(inference_state, os.path.sep), + }) + return func(inference_state, context, tree_name) + return wrapper diff --git a/.venv/lib/python3.8/site-packages/jedi/settings.py b/.venv/lib/python3.8/site-packages/jedi/settings.py new file mode 100644 index 00000000..6764a3e5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/settings.py @@ -0,0 +1,151 @@ +""" +This module contains variables with global |jedi| settings. To change the +behavior of |jedi|, change the variables defined in :mod:`jedi.settings`. + +Plugins should expose an interface so that the user can adjust the +configuration. + + +Example usage:: + + from jedi import settings + settings.case_insensitive_completion = True + + +Completion output +~~~~~~~~~~~~~~~~~ + +.. autodata:: case_insensitive_completion +.. autodata:: add_bracket_after_function + + +Filesystem cache +~~~~~~~~~~~~~~~~ + +.. autodata:: cache_directory + + +Parser +~~~~~~ + +.. autodata:: fast_parser + + +Dynamic stuff +~~~~~~~~~~~~~ + +.. autodata:: dynamic_array_additions +.. autodata:: dynamic_params +.. autodata:: dynamic_params_for_other_modules +.. autodata:: auto_import_modules + + +Caching +~~~~~~~ + +.. autodata:: call_signatures_validity + + +""" +import os +import platform + +# ---------------- +# Completion Output Settings +# ---------------- + +case_insensitive_completion = True +""" +Completions are by default case insensitive. +""" + +add_bracket_after_function = False +""" +Adds an opening bracket after a function for completions. +""" + +# ---------------- +# Filesystem Cache +# ---------------- + +if platform.system().lower() == 'windows': + _cache_directory = os.path.join(os.getenv('LOCALAPPDATA') or + os.path.expanduser('~'), 'Jedi', 'Jedi') +elif platform.system().lower() == 'darwin': + _cache_directory = os.path.join('~', 'Library', 'Caches', 'Jedi') +else: + _cache_directory = os.path.join(os.getenv('XDG_CACHE_HOME') or '~/.cache', + 'jedi') +cache_directory = os.path.expanduser(_cache_directory) +""" +The path where the cache is stored. + +On Linux, this defaults to ``~/.cache/jedi/``, on OS X to +``~/Library/Caches/Jedi/`` and on Windows to ``%LOCALAPPDATA%\\Jedi\\Jedi\\``. +On Linux, if the environment variable ``$XDG_CACHE_HOME`` is set, +``$XDG_CACHE_HOME/jedi`` is used instead of the default one. +""" + +# ---------------- +# Parser +# ---------------- + +fast_parser = True +""" +Uses Parso's diff parser. If it is enabled, this might cause issues, please +read the warning on :class:`.Script`. This feature makes it possible to only +parse the parts again that have changed, while reusing the rest of the syntax +tree. +""" + +_cropped_file_size = 10e6 # 1 Megabyte +""" +Jedi gets extremely slow if the file size exceed a few thousand lines. +To avoid getting stuck completely Jedi crops the file at some point. + +One megabyte of typical Python code equals about 20'000 lines of code. +""" + +# ---------------- +# Dynamic Stuff +# ---------------- + +dynamic_array_additions = True +""" +check for `append`, etc. on arrays: [], {}, () as well as list/set calls. +""" + +dynamic_params = True +""" +A dynamic param completion, finds the callees of the function, which define +the params of a function. +""" + +dynamic_params_for_other_modules = True +""" +Do the same for other modules. +""" + +dynamic_flow_information = True +""" +Check for `isinstance` and other information to infer a type. +""" + +auto_import_modules = [ + 'gi', # This third-party repository (GTK stuff) doesn't really work with jedi +] +""" +Modules that will not be analyzed but imported, if they contain Python code. +This improves autocompletion for libraries that use ``setattr`` or +``globals()`` modifications a lot. +""" + +# ---------------- +# Caching Validity +# ---------------- + +call_signatures_validity = 3.0 +""" +Finding function calls might be slow (0.1-0.5s). This is not acceptible for +normal writing. Therefore cache it for a short time. +""" diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/LICENSE.txt b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/LICENSE.txt new file mode 100644 index 00000000..3ebfb517 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/LICENSE.txt @@ -0,0 +1,8 @@ +Copyright (c) Maxim Kurnikov. +All rights reserved. + +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: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +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. diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/__init__.pyi new file mode 100644 index 00000000..83b267d1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/__init__.pyi @@ -0,0 +1,12 @@ +from typing import Any, NamedTuple +from .utils.version import get_version as get_version + +VERSION: Any +__version__: str + +def setup(set_prefix: bool = ...) -> None: ... + +# Used by mypy_django_plugin when returning a QuerySet row that is a NamedTuple where the field names are unknown +class _NamedTupleAnyAttr(NamedTuple): + def __getattr__(self, item: str) -> Any: ... + def __setattr__(self, item: str, value: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/apps/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/apps/__init__.pyi new file mode 100644 index 00000000..4a783cca --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/apps/__init__.pyi @@ -0,0 +1,3 @@ +from .config import AppConfig as AppConfig + +from .registry import apps as apps diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/apps/config.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/apps/config.pyi new file mode 100644 index 00000000..aa3fb803 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/apps/config.pyi @@ -0,0 +1,23 @@ +from typing import Any, Iterator, Type, Optional, Dict + +from django.apps.registry import Apps +from django.db.models.base import Model + +MODELS_MODULE_NAME: str + +class AppConfig: + name: str = ... + module: Optional[Any] = ... + apps: Optional[Apps] = ... + label: str = ... + verbose_name: str = ... + path: str = ... + models_module: Optional[str] = ... + models: Dict[str, Type[Model]] = ... + def __init__(self, app_name: str, app_module: Optional[Any]) -> None: ... + @classmethod + def create(cls, entry: str) -> AppConfig: ... + def get_model(self, model_name: str, require_ready: bool = ...) -> Type[Model]: ... + def get_models(self, include_auto_created: bool = ..., include_swapped: bool = ...) -> Iterator[Type[Model]]: ... + def import_models(self) -> None: ... + def ready(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/apps/registry.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/apps/registry.pyi new file mode 100644 index 00000000..9cf5ed1b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/apps/registry.pyi @@ -0,0 +1,40 @@ +import threading +from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Type, Union + +from django.db.models.base import Model + +from .config import AppConfig + +class Apps: + all_models: Dict[str, Dict[str, Type[Model]]] = ... + app_configs: Dict[str, AppConfig] = ... + stored_app_configs: List[Any] = ... + apps_ready: bool = ... + ready_event: threading.Event = ... + loading: bool = ... + _pending_operations: Dict[Tuple[str, str], List] + models_ready: bool = ... + ready: bool = ... + def __init__(self, installed_apps: Optional[Iterable[Union[AppConfig, str]]] = ...) -> None: ... + def populate(self, installed_apps: Iterable[Union[AppConfig, str]] = ...) -> None: ... + def check_apps_ready(self) -> None: ... + def check_models_ready(self) -> None: ... + def get_app_configs(self) -> Iterable[AppConfig]: ... + def get_app_config(self, app_label: str) -> AppConfig: ... + # it's not possible to support it in plugin properly now + def get_models(self, include_auto_created: bool = ..., include_swapped: bool = ...) -> List[Type[Model]]: ... + def get_model(self, app_label: str, model_name: Optional[str] = ..., require_ready: bool = ...) -> Type[Any]: ... + def register_model(self, app_label: str, model: Type[Model]) -> None: ... + def is_installed(self, app_name: str) -> bool: ... + def get_containing_app_config(self, object_name: str) -> Optional[AppConfig]: ... + def get_registered_model(self, app_label: str, model_name: str) -> Type[Model]: ... + def get_swappable_settings_name(self, to_string: str) -> Optional[str]: ... + def set_available_apps(self, available: Iterable[str]) -> None: ... + def unset_available_apps(self) -> None: ... + def set_installed_apps(self, installed: Iterable[str]) -> None: ... + def unset_installed_apps(self) -> None: ... + def clear_cache(self) -> None: ... + def lazy_model_operation(self, function: Callable, *model_keys: Any) -> None: ... + def do_pending_operations(self, model: Type[Model]) -> None: ... + +apps: Apps diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/conf/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/conf/__init__.pyi new file mode 100644 index 00000000..f36e61af --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/conf/__init__.pyi @@ -0,0 +1,29 @@ +from typing import Any + +from django.utils.functional import LazyObject + +# explicit dependency on standard settings to make it loaded +from . import global_settings + +ENVIRONMENT_VARIABLE: str = ... +DEFAULT_CONTENT_TYPE_DEPRECATED_MSG: str = ... +FILE_CHARSET_DEPRECATED_MSG: str = ... + +# required for plugin to be able to distinguish this specific instance of LazySettings from others +class _DjangoConfLazyObject(LazyObject): + def __getattr__(self, item: Any) -> Any: ... + +class LazySettings(_DjangoConfLazyObject): + configured: bool + def configure(self, default_settings: Any = ..., **options: Any) -> Any: ... + +settings: LazySettings = ... + +class Settings: + def __init__(self, settings_module: str): ... + def is_overridden(self, setting: str) -> bool: ... + +class UserSettingsHolder: ... + +class SettingsReference(str): + def __init__(self, value: str, setting_name: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/conf/global_settings.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/conf/global_settings.pyi new file mode 100644 index 00000000..6704ccb0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/conf/global_settings.pyi @@ -0,0 +1,504 @@ +""" +Default Django settings. Override these with settings in the module pointed to +by the DJANGO_SETTINGS_MODULE environment variable. +""" + +# This is defined here as a do-nothing function because we can't import +# django.utils.translation -- that module depends on the settings. +from typing import Any, Dict, List, Optional, Pattern, Protocol, Sequence, Tuple, Union + +#################### +# CORE # +#################### +DEBUG: bool = ... + +# Whether the framework should propagate raw exceptions rather than catching +# them. This is useful under some testing situations and should never be used +# on a live site. +DEBUG_PROPAGATE_EXCEPTIONS: bool = ... + +# People who get code error notifications. +# In the format [('Full Name', 'email@example.com'), ('Full Name', 'anotheremail@example.com')] +ADMINS: List[Tuple[str, str]] = ... + +# List of IP addresses, as strings, that: +# * See debug comments, when DEBUG is true +# * Receive x-headers +INTERNAL_IPS: List[str] = ... + +# Hosts/domain names that are valid for this site. +# "*" matches anything, ".example.com" matches example.com and all subdomains +ALLOWED_HOSTS: List[str] = ... + +# Local time zone for this installation. All choices can be found here: +# https://en.wikipedia.org/wiki/List_of_tz_zones_by_name (although not all +# systems may support all possibilities). When USE_TZ is True, this is +# interpreted as the default user time zone. +TIME_ZONE: str = ... + +# If you set this to True, Django will use timezone-aware datetimes. +USE_TZ: bool = ... + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE: str = ... + +# Languages we provide translations for, out of the box. +LANGUAGES: List[Tuple[str, str]] = ... + +# Languages using BiDi (right-to-left) layout +LANGUAGES_BIDI: List[str] = ... + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N: bool = ... +LOCALE_PATHS: List[str] = ... + +# Settings for language cookie +LANGUAGE_COOKIE_NAME: str = ... +LANGUAGE_COOKIE_AGE: Optional[int] = ... +LANGUAGE_COOKIE_DOMAIN: Optional[str] = ... +LANGUAGE_COOKIE_PATH: str = ... + +# If you set this to True, Django will format dates, numbers and calendars +# according to user current locale. +USE_L10N: bool = ... + +# Not-necessarily-technical managers of the site. They get broken link +# notifications and other various emails. +MANAGERS = ADMINS + +# Default content type and charset to use for all HttpResponse objects, if a +# MIME type isn't manually specified. These are used to construct the +# Content-Type header. +DEFAULT_CONTENT_TYPE: str = ... +DEFAULT_CHARSET: str = ... + +# Encoding of files read from disk (template and initial SQL files). +FILE_CHARSET: str = ... + +# Email address that error messages come from. +SERVER_EMAIL: str = ... + +# Database connection info. If left empty, will default to the dummy backend. +DATABASES: Dict[str, Dict[str, Any]] = ... + +# Classes used to implement DB routing behavior. +class Router(Protocol): + def allow_migrate(self, db, app_label, **hints): ... + +DATABASE_ROUTERS: List[Union[str, Router]] = ... + +# The email backend to use. For possible shortcuts see django.core.mail. +# The default is to use the SMTP backend. +# Third-party backends can be specified by providing a Python path +# to a module that defines an EmailBackend class. +EMAIL_BACKEND: str = ... + +# Host for sending email. +EMAIL_HOST: str = ... + +# Port for sending email. +EMAIL_PORT: int = ... + +# Whether to send SMTP 'Date' header in the local time zone or in UTC. +EMAIL_USE_LOCALTIME: bool = ... + +# Optional SMTP authentication information for EMAIL_HOST. +EMAIL_HOST_USER: str = ... +EMAIL_HOST_PASSWORD: str = ... +EMAIL_USE_TLS: bool = ... +EMAIL_USE_SSL: bool = ... +EMAIL_SSL_CERTFILE: Optional[str] = ... +EMAIL_SSL_KEYFILE: Optional[str] = ... +EMAIL_TIMEOUT: Optional[int] = ... + +# List of strings representing installed apps. +INSTALLED_APPS: List[str] = ... + +TEMPLATES: List[Dict[str, Any]] = ... + +# Default form rendering class. +FORM_RENDERER: str = ... + +# Default email address to use for various automated correspondence from +# the site managers. +DEFAULT_FROM_EMAIL: str = ... + +# Subject-line prefix for email messages send with django.core.mail.mail_admins +# or ...mail_managers. Make sure to include the trailing space. +EMAIL_SUBJECT_PREFIX: str = ... + +# Whether to append trailing slashes to URLs. +APPEND_SLASH: bool = ... + +# Whether to prepend the "www." subdomain to URLs that don't have it. +PREPEND_WWW: bool = ... + +# Override the server-derived value of SCRIPT_NAME +FORCE_SCRIPT_NAME = None + +# List of compiled regular expression objects representing User-Agent strings +# that are not allowed to visit any page, systemwide. Use this for bad +# robots/crawlers. Here are a few examples: +# import re +# DISALLOWED_USER_AGENTS = [ +# re.compile(r'^NaverBot.*'), +# re.compile(r'^EmailSiphon.*'), +# re.compile(r'^SiteSucker.*'), +# re.compile(r'^sohu-search'), +# ] +DISALLOWED_USER_AGENTS: List[Pattern] = ... + +ABSOLUTE_URL_OVERRIDES: Dict[str, Any] = ... + +# List of compiled regular expression objects representing URLs that need not +# be reported by BrokenLinkEmailsMiddleware. Here are a few examples: +# import re +# IGNORABLE_404_URLS = [ +# re.compile(r'^/apple-touch-icon.*\.png$'), +# re.compile(r'^/favicon.ico$'), +# re.compile(r'^/robots.txt$'), +# re.compile(r'^/phpmyadmin/'), +# re.compile(r'\.(cgi|php|pl)$'), +# ] +IGNORABLE_404_URLS: List[Pattern] = ... + +# A secret key for this particular Django installation. Used in secret-key +# hashing algorithms. Set this in your settings, or Django will complain +# loudly. +SECRET_KEY: str = ... + +# Default file storage mechanism that holds media. +DEFAULT_FILE_STORAGE: str = ... + +# Absolute filesystem path to the directory that will hold user-uploaded files. +# Example: "/var/www/example.com/media/" +MEDIA_ROOT: str = ... + +# URL that handles the media served from MEDIA_ROOT. +# Examples: "http://example.com/media/", "http://media.example.com/" +MEDIA_URL: str = ... + +# Absolute path to the directory static files should be collected to. +# Example: "/var/www/example.com/static/" +STATIC_ROOT: Optional[str] = ... + +# URL that handles the static files served from STATIC_ROOT. +# Example: "http://example.com/static/", "http://static.example.com/" +STATIC_URL: Optional[str] = ... + +# List of upload handler classes to be applied in order. +FILE_UPLOAD_HANDLERS: List[str] = ... + +# Maximum size, in bytes, of a request before it will be streamed to the +# file system instead of into memory. +FILE_UPLOAD_MAX_MEMORY_SIZE: int = ... # i.e. 2.5 MB + +# Maximum size in bytes of request data (excluding file uploads) that will be +# read before a SuspiciousOperation (RequestDataTooBig) is raised. +DATA_UPLOAD_MAX_MEMORY_SIZE: int = ... # i.e. 2.5 MB + +# Maximum number of GET/POST parameters that will be read before a +# SuspiciousOperation (TooManyFieldsSent) is raised. +DATA_UPLOAD_MAX_NUMBER_FIELDS: int = ... + +# Directory in which upload streamed files will be temporarily saved. A value of +# `None` will make Django use the operating system's default temporary directory +# (i.e. "/tmp" on *nix systems). +FILE_UPLOAD_TEMP_DIR: Optional[str] = ... + +# The numeric mode to set newly-uploaded files to. The value should be a mode +# you'd pass directly to os.chmod; see https://docs.python.org/library/os.html#files-and-directories. +FILE_UPLOAD_PERMISSIONS = None + +# The numeric mode to assign to newly-created directories, when uploading files. +# The value should be a mode as you'd pass to os.chmod; +# see https://docs.python.org/library/os.html#files-and-directories. +FILE_UPLOAD_DIRECTORY_PERMISSIONS = None + +# Python module path where user will place custom format definition. +# The directory where this setting is pointing should contain subdirectories +# named as the locales, containing a formats.py file +# (i.e. "myproject.locale" for myproject/locale/en/formats.py etc. use) +FORMAT_MODULE_PATH: Optional[str] = ... + +# Default formatting for date objects. See all available format strings here: +# https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date +DATE_FORMAT: str = ... + +# Default formatting for datetime objects. See all available format strings here: +# https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date +DATETIME_FORMAT: str = ... + +# Default formatting for time objects. See all available format strings here: +# https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date +TIME_FORMAT: str = ... + +# Default formatting for date objects when only the year and month are relevant. +# See all available format strings here: +# https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date +YEAR_MONTH_FORMAT: str = ... + +# Default formatting for date objects when only the month and day are relevant. +# See all available format strings here: +# https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date +MONTH_DAY_FORMAT: str = ... + +# Default short formatting for date objects. See all available format strings here: +# https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date +SHORT_DATE_FORMAT: str = ... + +# Default short formatting for datetime objects. +# See all available format strings here: +# https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date +SHORT_DATETIME_FORMAT: str = ... + +# Default formats to be used when parsing dates from input boxes, in order +# See all available format string here: +# https://docs.python.org/library/datetime.html#strftime-behavior +# * Note that these format strings are different from the ones to display dates +DATE_INPUT_FORMATS: List[str] = ... + +# Default formats to be used when parsing times from input boxes, in order +# See all available format string here: +# https://docs.python.org/library/datetime.html#strftime-behavior +# * Note that these format strings are different from the ones to display dates +TIME_INPUT_FORMATS: List[str] = ... # '14:30:59' # '14:30:59.000200' # '14:30' + +# Default formats to be used when parsing dates and times from input boxes, +# in order +# See all available format string here: +# https://docs.python.org/library/datetime.html#strftime-behavior +# * Note that these format strings are different from the ones to display dates +DATETIME_INPUT_FORMATS: List[str] = ... + +# First day of week, to be used on calendars +# 0 means Sunday, 1 means Monday... +FIRST_DAY_OF_WEEK: int = ... + +# Decimal separator symbol +DECIMAL_SEPARATOR: str = ... + +# Boolean that sets whether to add thousand separator when formatting numbers +USE_THOUSAND_SEPARATOR: bool = ... + +# Number of digits that will be together, when splitting them by +# THOUSAND_SEPARATOR. 0 means no grouping, 3 means splitting by thousands... +NUMBER_GROUPING: int = ... + +# Thousand separator symbol +THOUSAND_SEPARATOR: str = ... + +# The tablespaces to use for each model when not specified otherwise. +DEFAULT_TABLESPACE: str = ... +DEFAULT_INDEX_TABLESPACE: str = ... + +# Default X-Frame-Options header value +X_FRAME_OPTIONS: str = ... + +USE_X_FORWARDED_HOST: bool = ... +USE_X_FORWARDED_PORT: bool = ... + +# The Python dotted path to the WSGI application that Django's internal server +# (runserver) will use. If `None`, the return value of +# 'django.core.wsgi.get_wsgi_application' is used, thus preserving the same +# behavior as previous versions of Django. Otherwise this should point to an +# actual WSGI application object. +WSGI_APPLICATION: Optional[str] = ... + +# If your Django app is behind a proxy that sets a header to specify secure +# connections, AND that proxy ensures that user-submitted headers with the +# same name are ignored (so that people can't spoof it), set this value to +# a tuple of (header_name, header_value). For any requests that come in with +# that header/value, request.is_secure() will return True. +# WARNING! Only set this if you fully understand what you're doing. Otherwise, +# you may be opening yourself up to a security risk. +SECURE_PROXY_SSL_HEADER: Optional[Tuple[str, str]] = ... + +############## +# MIDDLEWARE # +############## + +# List of middleware to use. Order is important; in the request phase, these +# middleware will be applied in the order given, and in the response +# phase the middleware will be applied in reverse order. +MIDDLEWARE: List[str] = ... + +############ +# SESSIONS # +############ + +# Cache to store session data if using the cache session backend. +SESSION_CACHE_ALIAS = "default" +# Cookie name. This can be whatever you want. +SESSION_COOKIE_NAME = "sessionid" +# Age of cookie, in seconds (default: 2 weeks). +SESSION_COOKIE_AGE = 60 * 60 * 24 * 7 * 2 +# A string like "example.com", or None for standard domain cookie. +SESSION_COOKIE_DOMAIN: Optional[str] = ... +# Whether the session cookie should be secure (https:// only). +SESSION_COOKIE_SECURE = False +# The path of the session cookie. +SESSION_COOKIE_PATH = "/" +# Whether to use the non-RFC standard httpOnly flag (IE, FF3+, others) +SESSION_COOKIE_HTTPONLY = True +# Whether to set the flag restricting cookie leaks on cross-site requests. +# This can be 'Lax', 'Strict', or None to disable the flag. +SESSION_COOKIE_SAMESITE: Optional[str] = ... +# Whether to save the session data on every request. +SESSION_SAVE_EVERY_REQUEST = False +# Whether a user's session cookie expires when the Web browser is closed. +SESSION_EXPIRE_AT_BROWSER_CLOSE = False +# The module to store session data +SESSION_ENGINE = "django.contrib.sessions.backends.db" +# Directory to store session files if using the file session module. If None, +# the backend will use a sensible default. +SESSION_FILE_PATH: Optional[str] = ... +# class to serialize session data +SESSION_SERIALIZER = "django.contrib.sessions.serializers.JSONSerializer" + +######### +# CACHE # +######### + +# The cache backends to use. +CACHES: Dict[str, Dict[str, Any]] = ... +CACHE_MIDDLEWARE_KEY_PREFIX = "" +CACHE_MIDDLEWARE_SECONDS = 600 +CACHE_MIDDLEWARE_ALIAS = "default" + +################## +# AUTHENTICATION # +################## + +AUTH_USER_MODEL: str = ... + +AUTHENTICATION_BACKENDS: Sequence[str] = ... + +LOGIN_URL = "/accounts/login/" + +LOGIN_REDIRECT_URL: str = ... + +LOGOUT_REDIRECT_URL: Optional[str] = ... + +# The number of days a password reset link is valid for +PASSWORD_RESET_TIMEOUT_DAYS = 3 + +# the first hasher in this list is the preferred algorithm. any +# password using different algorithms will be converted automatically +# upon login +PASSWORD_HASHERS: List[str] = ... + +AUTH_PASSWORD_VALIDATORS: List[Dict[str, str]] = ... + +########### +# SIGNING # +########### + +SIGNING_BACKEND = "django.core.signing.TimestampSigner" + +######## +# CSRF # +######## + +# Dotted path to callable to be used as view when a request is +# rejected by the CSRF middleware. +CSRF_FAILURE_VIEW = "django.views.csrf.csrf_failure" + +# Settings for CSRF cookie. +CSRF_COOKIE_NAME = "csrftoken" +CSRF_COOKIE_AGE = 60 * 60 * 24 * 7 * 52 +CSRF_COOKIE_DOMAIN = None +CSRF_COOKIE_PATH = "/" +CSRF_COOKIE_SECURE = False +CSRF_COOKIE_HTTPONLY = False +CSRF_COOKIE_SAMESITE: Optional[str] = ... +CSRF_HEADER_NAME = "HTTP_X_CSRFTOKEN" +CSRF_TRUSTED_ORIGINS: List[str] = ... +CSRF_USE_SESSIONS = False + +############ +# MESSAGES # +############ + +# Class to use as messages backend +MESSAGE_STORAGE = "django.contrib.messages.storage.fallback.FallbackStorage" + +# Default values of MESSAGE_LEVEL and MESSAGE_TAGS are defined within +# django.contrib.messages to avoid imports in this settings file. + +########### +# LOGGING # +########### + +# The callable to use to configure logging +LOGGING_CONFIG = "logging.config.dictConfig" + +# Custom logging configuration. +LOGGING: Dict[str, Any] = ... + +# Default exception reporter filter class used in case none has been +# specifically assigned to the HttpRequest instance. +DEFAULT_EXCEPTION_REPORTER_FILTER = "django.views.debug.SafeExceptionReporterFilter" + +########### +# TESTING # +########### + +# The name of the class to use to run the test suite +TEST_RUNNER = "django.test.runner.DiscoverRunner" + +# Apps that don't need to be serialized at test database creation time +# (only apps with migrations are to start with) +TEST_NON_SERIALIZED_APPS: List[str] = ... + +############ +# FIXTURES # +############ + +# The list of directories to search for fixtures +FIXTURE_DIRS: List[str] = ... + +############### +# STATICFILES # +############### + +# A list of locations of additional static files +STATICFILES_DIRS: List[str] = ... + +# The default file storage backend used during the build process +STATICFILES_STORAGE: str = ... + +# List of finder classes that know how to find static files in +# various locations. +STATICFILES_FINDERS: List[str] = ... + +############## +# MIGRATIONS # +############## + +# Migration module overrides for apps, by app label. +MIGRATION_MODULES: Dict[str, str] = ... + +################# +# SYSTEM CHECKS # +################# + +# List of all issues generated by system checks that should be silenced. Light +# issues like warnings, infos or debugs will not generate a message. Silencing +# serious issues like errors and criticals does not result in hiding the +# message, but Django will not stop you from e.g. running server. +SILENCED_SYSTEM_CHECKS: List[str] = ... + +####################### +# SECURITY MIDDLEWARE # +####################### +SECURE_BROWSER_XSS_FILTER = False +SECURE_CONTENT_TYPE_NOSNIFF = False +SECURE_HSTS_INCLUDE_SUBDOMAINS = False +SECURE_HSTS_PRELOAD = False +SECURE_HSTS_SECONDS = 0 +SECURE_REDIRECT_EXEMPT: List[str] = ... +SECURE_SSL_HOST = None +SECURE_SSL_REDIRECT = False diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/conf/locale/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/conf/locale/__init__.pyi new file mode 100644 index 00000000..4bd5cdf7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/conf/locale/__init__.pyi @@ -0,0 +1,3 @@ +from typing import Dict, Any + +LANG_INFO: Dict[str, Any] = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/conf/urls/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/conf/urls/__init__.pyi new file mode 100644 index 00000000..71d290b2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/conf/urls/__init__.pyi @@ -0,0 +1,25 @@ +# Stubs for django.conf.urls (Python 3.5) +from typing import Any, Callable, Dict, List, Optional, overload, Tuple, Union + +from django.http.response import HttpResponse, HttpResponseBase + +from django.urls import URLResolver, URLPattern + +handler400: Union[str, Callable[..., HttpResponse]] = ... +handler403: Union[str, Callable[..., HttpResponse]] = ... +handler404: Union[str, Callable[..., HttpResponse]] = ... +handler500: Union[str, Callable[..., HttpResponse]] = ... + +IncludedURLConf = Tuple[List[URLResolver], Optional[str], Optional[str]] + +def include(arg: Any, namespace: str = ..., app_name: str = ...) -> IncludedURLConf: ... +@overload +def url( + regex: str, view: Callable[..., HttpResponseBase], kwargs: Dict[str, Any] = ..., name: str = ... +) -> URLPattern: ... +@overload +def url(regex: str, view: IncludedURLConf, kwargs: Dict[str, Any] = ..., name: str = ...) -> URLResolver: ... +@overload +def url( + regex: str, view: List[Union[URLResolver, str]], kwargs: Dict[str, Any] = ..., name: str = ... +) -> URLResolver: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/conf/urls/i18n.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/conf/urls/i18n.pyi new file mode 100644 index 00000000..532cb7df --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/conf/urls/i18n.pyi @@ -0,0 +1,8 @@ +from typing import Any, List, Tuple, Callable + +from django.urls.resolvers import URLPattern + +def i18n_patterns(*urls: Any, prefix_default_language: bool = ...) -> List[List[URLPattern]]: ... +def is_language_prefix_patterns_used(urlconf: str) -> Tuple[bool, bool]: ... + +urlpatterns: List[Callable] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/conf/urls/static.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/conf/urls/static.pyi new file mode 100644 index 00000000..bcad0db7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/conf/urls/static.pyi @@ -0,0 +1,5 @@ +from typing import Any, Callable, List + +from django.urls.resolvers import URLPattern + +def static(prefix: str, view: Callable = ..., **kwargs: Any) -> List[URLPattern]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/__init__.pyi new file mode 100644 index 00000000..5737e424 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/__init__.pyi @@ -0,0 +1,24 @@ +from .decorators import register as register +from .filters import ( + AllValuesFieldListFilter as AllValuesFieldListFilter, + BooleanFieldListFilter as BooleanFieldListFilter, + ChoicesFieldListFilter as ChoicesFieldListFilter, + DateFieldListFilter as DateFieldListFilter, + FieldListFilter as FieldListFilter, + ListFilter as ListFilter, + RelatedFieldListFilter as RelatedFieldListFilter, + RelatedOnlyFieldListFilter as RelatedOnlyFieldListFilter, + SimpleListFilter as SimpleListFilter, +) +from .helpers import ACTION_CHECKBOX_NAME as ACTION_CHECKBOX_NAME +from .options import ( + HORIZONTAL as HORIZONTAL, + VERTICAL as VERTICAL, + ModelAdmin as ModelAdmin, + StackedInline as StackedInline, + TabularInline as TabularInline, +) +from .sites import AdminSite as AdminSite, site as site +from . import checks as checks + +def autodiscover() -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/actions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/actions.pyi new file mode 100644 index 00000000..30a41e83 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/actions.pyi @@ -0,0 +1,8 @@ +from typing import Optional + +from django.contrib.admin.options import ModelAdmin +from django.core.handlers.wsgi import WSGIRequest +from django.db.models.query import QuerySet +from django.template.response import TemplateResponse + +def delete_selected(modeladmin: ModelAdmin, request: WSGIRequest, queryset: QuerySet) -> Optional[TemplateResponse]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/apps.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/apps.pyi new file mode 100644 index 00000000..0fa9e21e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/apps.pyi @@ -0,0 +1,6 @@ +from django.apps import AppConfig + +class SimpleAdminConfig(AppConfig): + default_site: str = ... + +class AdminConfig(SimpleAdminConfig): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/checks.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/checks.pyi new file mode 100644 index 00000000..ba57692f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/checks.pyi @@ -0,0 +1,21 @@ +from typing import Any, List, Union, Iterable, Optional + +from django.contrib.admin.options import BaseModelAdmin +from django.core.checks.messages import Error + +from django.apps.config import AppConfig + +_CheckError = Union[str, Error] + +def check_admin_app(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[_CheckError]: ... +def check_dependencies(**kwargs: Any) -> List[_CheckError]: ... + +class BaseModelAdminChecks: + def check(self, admin_obj: BaseModelAdmin, **kwargs: Any) -> List[_CheckError]: ... + +class ModelAdminChecks(BaseModelAdminChecks): ... +class InlineModelAdminChecks(BaseModelAdminChecks): ... + +def must_be(type: Any, option: Any, obj: Any, id: Any): ... +def must_inherit_from(parent: Any, option: Any, obj: Any, id: Any): ... +def refer_to_missing_field(field: Any, option: Any, model: Any, obj: Any, id: Any): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/decorators.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/decorators.pyi new file mode 100644 index 00000000..e26b2655 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/decorators.pyi @@ -0,0 +1,5 @@ +from typing import Any, Callable, Optional, Type + +from django.db.models.base import Model + +def register(*models: Type[Model], site: Optional[Any] = ...) -> Callable: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/filters.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/filters.pyi new file mode 100644 index 00000000..3cba3adb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/filters.pyi @@ -0,0 +1,110 @@ +from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Iterator + +from django.contrib.admin.options import ModelAdmin +from django.core.handlers.wsgi import WSGIRequest +from django.db.models.base import Model +from django.db.models.fields.related import RelatedField +from django.db.models.query import QuerySet + +from django.db.models.fields import Field + +class ListFilter: + title: Any = ... + template: str = ... + used_parameters: Any = ... + def __init__( + self, request: WSGIRequest, params: Dict[str, str], model: Type[Model], model_admin: ModelAdmin + ) -> None: ... + def has_output(self) -> bool: ... + def choices(self, changelist: Any) -> Optional[Iterator[Dict[str, Any]]]: ... + def queryset(self, request: Any, queryset: QuerySet) -> Optional[QuerySet]: ... + def expected_parameters(self) -> Optional[List[str]]: ... + +class SimpleListFilter(ListFilter): + parameter_name: Any = ... + lookup_choices: Any = ... + def value(self) -> Optional[str]: ... + def lookups(self, request: Any, model_admin: Any) -> List[Tuple[Any, str]]: ... + +class FieldListFilter(ListFilter): + field: Field = ... + field_path: Any = ... + title: Any = ... + def __init__( + self, + field: Field, + request: WSGIRequest, + params: Dict[str, str], + model: Type[Model], + model_admin: ModelAdmin, + field_path: str, + ) -> None: ... + @classmethod + def register(cls, test: Callable, list_filter_class: Type[FieldListFilter], take_priority: bool = ...) -> None: ... + @classmethod + def create( + cls, + field: Field, + request: WSGIRequest, + params: Dict[str, str], + model: Type[Model], + model_admin: ModelAdmin, + field_path: str, + ) -> FieldListFilter: ... + +class RelatedFieldListFilter(FieldListFilter): + used_parameters: Dict[Any, Any] + lookup_kwarg: str = ... + lookup_kwarg_isnull: str = ... + lookup_val: None = ... + lookup_val_isnull: None = ... + lookup_choices: Any = ... + lookup_title: Any = ... + title: str = ... + empty_value_display: Any = ... + @property + def include_empty_choice(self) -> bool: ... + def field_choices( + self, field: RelatedField, request: WSGIRequest, model_admin: ModelAdmin + ) -> List[Tuple[str, str]]: ... + +class BooleanFieldListFilter(FieldListFilter): + lookup_kwarg: Any = ... + lookup_kwarg2: Any = ... + lookup_val: Any = ... + lookup_val2: Any = ... + def choices(self, changelist: Any) -> None: ... + +class ChoicesFieldListFilter(FieldListFilter): + title: str + used_parameters: Dict[Any, Any] + lookup_kwarg: str = ... + lookup_kwarg_isnull: str = ... + lookup_val: None = ... + lookup_val_isnull: None = ... + +class DateFieldListFilter(FieldListFilter): + field_generic: Any = ... + date_params: Any = ... + lookup_kwarg_since: Any = ... + lookup_kwarg_until: Any = ... + links: Any = ... + lookup_kwarg_isnull: Any = ... + +class AllValuesFieldListFilter(FieldListFilter): + title: str + used_parameters: Dict[Any, Any] + lookup_kwarg: str = ... + lookup_kwarg_isnull: str = ... + lookup_val: None = ... + lookup_val_isnull: None = ... + empty_value_display: str = ... + lookup_choices: QuerySet = ... + +class RelatedOnlyFieldListFilter(RelatedFieldListFilter): + lookup_kwarg: str + lookup_kwarg_isnull: str + lookup_val: None + lookup_val_isnull: None + title: str + used_parameters: Dict[Any, Any] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/forms.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/forms.pyi new file mode 100644 index 00000000..fdfe7d91 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/forms.pyi @@ -0,0 +1,7 @@ +from django.contrib.auth.forms import AuthenticationForm, PasswordChangeForm + +class AdminAuthenticationForm(AuthenticationForm): + required_css_class: str = ... + +class AdminPasswordChangeForm(PasswordChangeForm): + required_css_class: str = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/helpers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/helpers.pyi new file mode 100644 index 00000000..32d14338 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/helpers.pyi @@ -0,0 +1,155 @@ +from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union, Iterable + +from django.forms.boundfield import BoundField +from django.forms.forms import BaseForm +from django.forms.utils import ErrorDict +from django.forms.widgets import Media, Widget +from django.utils.safestring import SafeText + +from django import forms +from django.db.models.fields import AutoField + +ACTION_CHECKBOX_NAME: str + +class ActionForm(forms.Form): + action: Any = ... + select_across: Any = ... + +checkbox: Any + +class AdminForm: + prepopulated_fields: Any = ... + model_admin: Any = ... + readonly_fields: Any = ... + def __init__( + self, + form: BaseForm, + fieldsets: List[Tuple[None, Dict[str, List[str]]]], + prepopulated_fields: Dict[Any, Any], + readonly_fields: Optional[Iterable[Any]] = ..., + model_admin: Any = ..., + ) -> None: ... + def __iter__(self) -> Iterator[Fieldset]: ... + @property + def errors(self) -> ErrorDict: ... + @property + def non_field_errors(self) -> Callable: ... + @property + def media(self) -> Media: ... + +class Fieldset: + form: Any = ... + classes: Any = ... + description: Any = ... + model_admin: Any = ... + readonly_fields: Any = ... + def __init__( + self, + form: Any, + name: Optional[Any] = ..., + readonly_fields: Optional[Iterable[Any]] = ..., + fields: Any = ..., + classes: Any = ..., + description: Optional[Any] = ..., + model_admin: Optional[Any] = ..., + ) -> None: ... + @property + def media(self) -> Media: ... + def __iter__(self) -> Iterator[Fieldline]: ... + +class Fieldline: + form: Any = ... + fields: Any = ... + has_visible_field: Any = ... + model_admin: Any = ... + readonly_fields: Any = ... + def __init__( + self, form: Any, field: Any, readonly_fields: Optional[Iterable[Any]] = ..., model_admin: Optional[Any] = ... + ) -> None: ... + def __iter__(self) -> Iterator[Union[AdminField, AdminReadonlyField]]: ... + def errors(self) -> SafeText: ... + +class AdminField: + field: BoundField = ... + is_first: bool = ... + is_checkbox: bool = ... + is_readonly: bool = ... + def __init__(self, form: Any, field: Any, is_first: Any) -> None: ... + def label_tag(self) -> SafeText: ... + def errors(self) -> SafeText: ... + +class AdminReadonlyField: + field: Any = ... + form: Any = ... + model_admin: Any = ... + is_first: Any = ... + is_checkbox: bool = ... + is_readonly: bool = ... + empty_value_display: Any = ... + def __init__(self, form: Any, field: Any, is_first: Any, model_admin: Optional[Any] = ...) -> None: ... + def label_tag(self) -> SafeText: ... + def contents(self) -> SafeText: ... + +class InlineAdminFormSet: + opts: Any = ... + formset: Any = ... + fieldsets: Any = ... + model_admin: Any = ... + readonly_fields: Any = ... + prepopulated_fields: Any = ... + classes: Any = ... + has_add_permission: Any = ... + has_change_permission: Any = ... + has_delete_permission: Any = ... + has_view_permission: Any = ... + def __init__( + self, + inline: Any, + formset: Any, + fieldsets: Any, + prepopulated_fields: Optional[Any] = ..., + readonly_fields: Optional[Any] = ..., + model_admin: Optional[Any] = ..., + has_add_permission: bool = ..., + has_change_permission: bool = ..., + has_delete_permission: bool = ..., + has_view_permission: bool = ..., + ) -> None: ... + def __iter__(self) -> Iterator[InlineAdminForm]: ... + def fields(self) -> Iterator[Dict[str, Union[Dict[str, bool], bool, Widget, str]]]: ... + def inline_formset_data(self) -> str: ... + @property + def forms(self): ... + @property + def non_form_errors(self) -> Callable: ... + @property + def media(self) -> Media: ... + +class InlineAdminForm(AdminForm): + formset: Any = ... + original: Any = ... + show_url: Any = ... + absolute_url: Any = ... + def __init__( + self, + formset: Any, + form: Any, + fieldsets: Any, + prepopulated_fields: Any, + original: Any, + readonly_fields: Optional[Any] = ..., + model_admin: Optional[Any] = ..., + view_on_site_url: Optional[Any] = ..., + ) -> None: ... + def needs_explicit_pk_field(self) -> Union[bool, AutoField]: ... + def pk_field(self) -> AdminField: ... + def fk_field(self) -> AdminField: ... + def deletion_field(self) -> AdminField: ... + def ordering_field(self): ... + +class InlineFieldset(Fieldset): + formset: Any = ... + def __init__(self, formset: Any, *args: Any, **kwargs: Any) -> None: ... + +class AdminErrorList(forms.utils.ErrorList): + def __init__(self, form: Any, inline_formsets: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/models.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/models.pyi new file mode 100644 index 00000000..05c033ad --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/models.pyi @@ -0,0 +1,39 @@ +from typing import Any, Optional, Union +from uuid import UUID + +from django.contrib.contenttypes.models import ContentType +from django.db.models.base import Model + +from django.db import models + +ADDITION: int +CHANGE: int +DELETION: int +ACTION_FLAG_CHOICES: Any + +class LogEntryManager(models.Manager["LogEntry"]): + def log_action( + self, + user_id: int, + content_type_id: int, + object_id: Union[int, str, UUID], + object_repr: str, + action_flag: int, + change_message: Any = ..., + ) -> LogEntry: ... + +class LogEntry(models.Model): + action_time: models.DateTimeField = ... + user: models.ForeignKey = ... + content_type: models.ForeignKey = models.ForeignKey(ContentType, on_delete=models.CASCADE) + object_id: models.TextField = ... + object_repr: models.CharField = ... + action_flag: models.PositiveSmallIntegerField = ... + change_message: models.TextField = ... + objects: LogEntryManager = ... + def is_addition(self) -> bool: ... + def is_change(self) -> bool: ... + def is_deletion(self) -> bool: ... + def get_change_message(self) -> str: ... + def get_edited_object(self) -> Model: ... + def get_admin_url(self) -> Optional[str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/options.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/options.pyi new file mode 100644 index 00000000..63928972 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/options.pyi @@ -0,0 +1,275 @@ +from collections import OrderedDict +from typing import Any, Callable, Dict, Iterator, List, Optional, Sequence, Set, Tuple, Type, Union, Mapping, TypeVar + +from django.forms.forms import BaseForm +from django.forms.formsets import BaseFormSet +from typing_extensions import Literal, TypedDict + +from django.contrib.admin.filters import ListFilter +from django.contrib.admin.models import LogEntry +from django.contrib.admin.sites import AdminSite +from django.contrib.admin.views.main import ChangeList +from django.contrib.auth.forms import AdminPasswordChangeForm +from django.contrib.contenttypes.models import ContentType +from django.core.checks.messages import Error +from django.core.paginator import Paginator +from django.db.models.base import Model +from django.db.models.fields.related import ForeignKey, ManyToManyField, RelatedField +from django.db.models.options import Options +from django.db.models.query import QuerySet +from django.forms.fields import TypedChoiceField +from django.forms.models import ModelChoiceField, ModelMultipleChoiceField +from django.forms.widgets import Media +from django.http.request import HttpRequest +from django.http.response import HttpResponse, HttpResponseBase, HttpResponseRedirect, JsonResponse +from django.template.response import TemplateResponse +from django.urls.resolvers import URLPattern +from django.utils.safestring import SafeText + +from django.db.models.fields import Field + +IS_POPUP_VAR: str +TO_FIELD_VAR: str +HORIZONTAL: Literal[1] = ... +VERTICAL: Literal[2] = ... + +_Direction = Union[Literal[1], Literal[2]] + +def get_content_type_for_model(obj: Union[Type[Model], Model]) -> ContentType: ... +def get_ul_class(radio_style: int) -> str: ... + +class IncorrectLookupParameters(Exception): ... + +FORMFIELD_FOR_DBFIELD_DEFAULTS: Any +csrf_protect_m: Any + +class _OptionalFieldOpts(TypedDict, total=False): + classes: Sequence[str] + description: str + +class _FieldOpts(_OptionalFieldOpts, total=True): + fields: Sequence[Union[str, Sequence[str]]] + +# Workaround for mypy issue, a Sequence type should be preferred here. +# https://github.com/python/mypy/issues/8921 +# _FieldsetSpec = Sequence[Tuple[Optional[str], _FieldOpts]] +_T = TypeVar("_T") +_ListOrTuple = Union[Tuple[_T, ...], List[_T]] +_FieldsetSpec = _ListOrTuple[Tuple[Optional[str], _FieldOpts]] + +class BaseModelAdmin: + autocomplete_fields: Sequence[str] = ... + raw_id_fields: Sequence[str] = ... + fields: Sequence[Union[str, Sequence[str]]] = ... + exclude: Sequence[str] = ... + fieldsets: _FieldsetSpec = ... + form: Type[BaseForm] = ... + filter_vertical: Sequence[str] = ... + filter_horizontal: Sequence[str] = ... + radio_fields: Mapping[str, _Direction] = ... + prepopulated_fields: Mapping[str, Sequence[str]] = ... + formfield_overrides: Mapping[Type[Field], Mapping[str, Any]] = ... + readonly_fields: Sequence[Union[str, Callable[[Model], Any]]] = ... + ordering: Sequence[str] = ... + sortable_by: Sequence[str] = ... + view_on_site: bool = ... + show_full_result_count: bool = ... + checks_class: Any = ... + def check(self, **kwargs: Any) -> List[Union[str, Error]]: ... + def formfield_for_dbfield( + self, db_field: Field, request: Optional[HttpRequest], **kwargs: Any + ) -> Optional[Field]: ... + def formfield_for_choice_field( + self, db_field: Field, request: Optional[HttpRequest], **kwargs: Any + ) -> TypedChoiceField: ... + def get_field_queryset( + self, db: None, db_field: RelatedField, request: Optional[HttpRequest] + ) -> Optional[QuerySet]: ... + def formfield_for_foreignkey( + self, db_field: ForeignKey, request: Optional[HttpRequest], **kwargs: Any + ) -> Optional[ModelChoiceField]: ... + def formfield_for_manytomany( + self, db_field: ManyToManyField, request: Optional[HttpRequest], **kwargs: Any + ) -> ModelMultipleChoiceField: ... + def get_autocomplete_fields(self, request: HttpRequest) -> Tuple: ... + def get_view_on_site_url(self, obj: Optional[Model] = ...) -> Optional[str]: ... + def get_empty_value_display(self) -> SafeText: ... + def get_exclude(self, request: HttpRequest, obj: Optional[Model] = ...) -> Any: ... + def get_fields(self, request: HttpRequest, obj: Optional[Model] = ...) -> Sequence[Union[Callable, str]]: ... + def get_fieldsets( + self, request: HttpRequest, obj: Optional[Model] = ... + ) -> List[Tuple[Optional[str], Dict[str, Any]]]: ... + def get_ordering(self, request: HttpRequest) -> Union[List[str], Tuple]: ... + def get_readonly_fields(self, request: HttpRequest, obj: Optional[Model] = ...) -> Union[List[str], Tuple]: ... + def get_prepopulated_fields(self, request: HttpRequest, obj: Optional[Model] = ...) -> Dict[str, Tuple[str]]: ... + def get_queryset(self, request: HttpRequest) -> QuerySet: ... + def get_sortable_by(self, request: HttpRequest) -> Union[List[Callable], List[str], Tuple]: ... + def lookup_allowed(self, lookup: str, value: str) -> bool: ... + def to_field_allowed(self, request: HttpRequest, to_field: str) -> bool: ... + def has_add_permission(self, request: HttpRequest) -> bool: ... + def has_change_permission(self, request: HttpRequest, obj: Optional[Model] = ...) -> bool: ... + def has_delete_permission(self, request: HttpRequest, obj: Optional[Model] = ...) -> bool: ... + def has_view_permission(self, request: HttpRequest, obj: Optional[Model] = ...) -> bool: ... + def has_module_permission(self, request: HttpRequest) -> bool: ... + +class ModelAdmin(BaseModelAdmin): + list_display: Sequence[Union[str, Callable[[Model], Any]]] = ... + list_display_links: Optional[Sequence[Union[str, Callable]]] = ... + list_filter: Sequence[Union[str, Type[ListFilter], Tuple[str, Type[ListFilter]]]] = ... + list_select_related: Union[bool, Sequence[str]] = ... + list_per_page: int = ... + list_max_show_all: int = ... + list_editable: Sequence[str] = ... + search_fields: Sequence[str] = ... + date_hierarchy: Optional[str] = ... + save_as: bool = ... + save_as_continue: bool = ... + save_on_top: bool = ... + paginator: Type = ... + preserve_filters: bool = ... + inlines: Sequence[Type[InlineModelAdmin]] = ... + add_form_template: str = ... + change_form_template: str = ... + change_list_template: str = ... + delete_confirmation_template: str = ... + delete_selected_confirmation_template: str = ... + object_history_template: str = ... + popup_response_template: str = ... + actions: Sequence[Callable[[ModelAdmin, HttpRequest, QuerySet], None]] = ... + action_form: Any = ... + actions_on_top: bool = ... + actions_on_bottom: bool = ... + actions_selection_counter: bool = ... + model: Type[Model] = ... + opts: Options = ... + admin_site: AdminSite = ... + def __init__(self, model: Type[Model], admin_site: Optional[AdminSite]) -> None: ... + def get_inline_instances(self, request: HttpRequest, obj: Optional[Model] = ...) -> List[InlineModelAdmin]: ... + def get_urls(self) -> List[URLPattern]: ... + @property + def urls(self) -> List[URLPattern]: ... + @property + def media(self) -> Media: ... + def get_model_perms(self, request: HttpRequest) -> Dict[str, bool]: ... + def get_form(self, request: Any, obj: Optional[Any] = ..., change: bool = ..., **kwargs: Any): ... + def get_changelist(self, request: HttpRequest, **kwargs: Any) -> Type[ChangeList]: ... + def get_changelist_instance(self, request: HttpRequest) -> ChangeList: ... + def get_object(self, request: HttpRequest, object_id: str, from_field: None = ...) -> Optional[Model]: ... + def get_changelist_form(self, request: Any, **kwargs: Any): ... + def get_changelist_formset(self, request: Any, **kwargs: Any): ... + def get_formsets_with_inlines(self, request: HttpRequest, obj: Optional[Model] = ...) -> Iterator[Any]: ... + def get_paginator( + self, + request: HttpRequest, + queryset: QuerySet, + per_page: int, + orphans: int = ..., + allow_empty_first_page: bool = ..., + ) -> Paginator: ... + def log_addition(self, request: HttpRequest, object: Model, message: Any) -> LogEntry: ... + def log_change(self, request: HttpRequest, object: Model, message: Any) -> LogEntry: ... + def log_deletion(self, request: HttpRequest, object: Model, object_repr: str) -> LogEntry: ... + def action_checkbox(self, obj: Model) -> SafeText: ... + def get_actions(self, request: HttpRequest) -> OrderedDict: ... + def get_action_choices( + self, request: HttpRequest, default_choices: List[Tuple[str, str]] = ... + ) -> List[Tuple[str, str]]: ... + def get_action(self, action: Union[Callable, str]) -> Tuple[Callable, str, str]: ... + def get_list_display(self, request: HttpRequest) -> Sequence[str]: ... + def get_list_display_links(self, request: HttpRequest, list_display: Sequence[str]) -> Optional[Sequence[str]]: ... + def get_list_filter(self, request: HttpRequest) -> Sequence[str]: ... + def get_list_select_related(self, request: HttpRequest) -> Sequence[str]: ... + def get_search_fields(self, request: HttpRequest) -> List[str]: ... + def get_search_results( + self, request: HttpRequest, queryset: QuerySet, search_term: str + ) -> Tuple[QuerySet, bool]: ... + def get_preserved_filters(self, request: HttpRequest) -> str: ... + def _get_edited_object_pks(self, request: HttpRequest, prefix: str) -> List[str]: ... + def _get_list_editable_queryset(self, request: HttpRequest, prefix: str) -> QuerySet: ... + def construct_change_message( + self, request: HttpRequest, form: AdminPasswordChangeForm, formsets: None, add: bool = ... + ) -> List[Dict[str, Dict[str, List[str]]]]: ... + def message_user( + self, + request: HttpRequest, + message: str, + level: Union[int, str] = ..., + extra_tags: str = ..., + fail_silently: bool = ..., + ) -> None: ... + def save_form(self, request: Any, form: Any, change: Any): ... + def save_model(self, request: Any, obj: Any, form: Any, change: Any) -> None: ... + def delete_model(self, request: HttpRequest, obj: Model) -> None: ... + def delete_queryset(self, request: HttpRequest, queryset: QuerySet) -> None: ... + def save_formset(self, request: Any, form: Any, formset: Any, change: Any) -> None: ... + def save_related(self, request: Any, form: Any, formsets: Any, change: Any) -> None: ... + def render_change_form( + self, + request: Any, + context: Any, + add: bool = ..., + change: bool = ..., + form_url: str = ..., + obj: Optional[Any] = ..., + ): ... + def response_add( + self, request: HttpRequest, obj: Model, post_url_continue: Optional[str] = ... + ) -> HttpResponse: ... + def response_change(self, request: HttpRequest, obj: Model) -> HttpResponse: ... + def response_post_save_add(self, request: HttpRequest, obj: Model) -> HttpResponseRedirect: ... + def response_post_save_change(self, request: HttpRequest, obj: Model) -> HttpResponseRedirect: ... + def response_action(self, request: HttpRequest, queryset: QuerySet) -> Optional[HttpResponseBase]: ... + def response_delete(self, request: HttpRequest, obj_display: str, obj_id: int) -> HttpResponse: ... + def render_delete_form(self, request: Any, context: Any): ... + def get_inline_formsets( + self, request: HttpRequest, formsets: List[Any], inline_instances: List[Any], obj: Optional[Model] = ... + ) -> List[Any]: ... + def get_changeform_initial_data(self, request: HttpRequest) -> Dict[str, str]: ... + def changeform_view( + self, + request: HttpRequest, + object_id: Optional[str] = ..., + form_url: str = ..., + extra_context: Optional[Dict[str, bool]] = ..., + ) -> Any: ... + def autocomplete_view(self, request: HttpRequest) -> JsonResponse: ... + def add_view(self, request: HttpRequest, form_url: str = ..., extra_context: None = ...) -> HttpResponse: ... + def change_view( + self, request: HttpRequest, object_id: str, form_url: str = ..., extra_context: Optional[Dict[str, bool]] = ... + ) -> HttpResponse: ... + def changelist_view( + self, request: HttpRequest, extra_context: Optional[Dict[str, str]] = ... + ) -> TemplateResponse: ... + def get_deleted_objects( + self, objs: QuerySet, request: HttpRequest + ) -> Tuple[List[Any], Dict[Any, Any], Set[Any], List[Any]]: ... + def delete_view(self, request: HttpRequest, object_id: str, extra_context: None = ...) -> Any: ... + def history_view(self, request: HttpRequest, object_id: str, extra_context: None = ...) -> HttpResponse: ... + +class InlineModelAdmin(BaseModelAdmin): + model: Type[Model] = ... + fk_name: str = ... + formset: BaseFormSet = ... + extra: int = ... + min_num: Optional[int] = ... + max_num: Optional[int] = ... + template: str = ... + verbose_name: Optional[str] = ... + verbose_name_plural: Optional[str] = ... + can_delete: bool = ... + show_change_link: bool = ... + classes: Optional[Sequence[str]] = ... + admin_site: AdminSite = ... + parent_model: Any = ... + opts: Any = ... + has_registered_model: Any = ... + def __init__(self, parent_model: Union[Type[Model], Model], admin_site: AdminSite) -> None: ... + @property + def media(self) -> Media: ... + def get_extra(self, request: HttpRequest, obj: Optional[Model] = ..., **kwargs: Any) -> int: ... + def get_min_num(self, request: HttpRequest, obj: Optional[Model] = ..., **kwargs: Any) -> Optional[int]: ... + def get_max_num(self, request: HttpRequest, obj: Optional[Model] = ..., **kwargs: Any) -> Optional[int]: ... + def get_formset(self, request: Any, obj: Optional[Any] = ..., **kwargs: Any): ... + +class StackedInline(InlineModelAdmin): ... +class TabularInline(InlineModelAdmin): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/sites.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/sites.pyi new file mode 100644 index 00000000..2227f87b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/sites.pyi @@ -0,0 +1,75 @@ +from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Type, Union + +from django.contrib.admin.options import ModelAdmin +from django.core.handlers.wsgi import WSGIRequest +from django.db.models.base import Model +from django.http.response import HttpResponse +from django.template.response import TemplateResponse +from django.urls.resolvers import URLResolver +from django.utils.functional import LazyObject + +from django.apps.config import AppConfig + +all_sites: Any + +class AlreadyRegistered(Exception): ... +class NotRegistered(Exception): ... + +class AdminSite: + site_title: Any = ... + site_header: Any = ... + index_title: Any = ... + site_url: str = ... + login_form: Any = ... + index_template: Any = ... + app_index_template: Any = ... + login_template: Any = ... + logout_template: Any = ... + password_change_template: Any = ... + password_change_done_template: Any = ... + name: str = ... + _registry: Dict[Type[Model], ModelAdmin] + def __init__(self, name: str = ...) -> None: ... + def check(self, app_configs: Optional[Iterable[AppConfig]]) -> List[Any]: ... + def register( + self, + model_or_iterable: Union[Type[Model], Iterable[Type[Model]]], + admin_class: Optional[Type[ModelAdmin]] = ..., + **options: Any + ) -> None: ... + def unregister(self, model_or_iterable: Union[Type[Model], Iterable[Type[Model]]]) -> None: ... + def is_registered(self, model: Type[Model]) -> bool: ... + def add_action(self, action: Callable, name: Optional[str] = ...) -> None: ... + def disable_action(self, name: str) -> None: ... + def get_action(self, name: str) -> Callable: ... + @property + def actions(self): ... + @property + def empty_value_display(self): ... + @empty_value_display.setter + def empty_value_display(self, empty_value_display: Any) -> None: ... + def has_permission(self, request: WSGIRequest) -> bool: ... + def admin_view(self, view: Callable, cacheable: bool = ...) -> Callable: ... + def get_urls(self) -> List[URLResolver]: ... + @property + def urls(self) -> Tuple[List[URLResolver], str, str]: ... + def each_context(self, request: Any): ... + def password_change( + self, request: WSGIRequest, extra_context: Optional[Dict[str, Any]] = ... + ) -> TemplateResponse: ... + def password_change_done( + self, request: WSGIRequest, extra_context: Optional[Dict[str, Any]] = ... + ) -> TemplateResponse: ... + def i18n_javascript(self, request: WSGIRequest, extra_context: Optional[Dict[Any, Any]] = ...) -> HttpResponse: ... + def logout(self, request: WSGIRequest, extra_context: Optional[Dict[str, Any]] = ...) -> TemplateResponse: ... + def login(self, request: WSGIRequest, extra_context: Optional[Dict[str, Any]] = ...) -> HttpResponse: ... + def _build_app_dict(self, request: WSGIRequest, label: Optional[str] = ...) -> Dict[str, Any]: ... + def get_app_list(self, request: WSGIRequest) -> List[Any]: ... + def index(self, request: WSGIRequest, extra_context: Optional[Dict[str, Any]] = ...) -> TemplateResponse: ... + def app_index( + self, request: WSGIRequest, app_label: str, extra_context: Optional[Dict[str, Any]] = ... + ) -> TemplateResponse: ... + +class DefaultAdminSite(LazyObject): ... + +site: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_list.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_list.pyi new file mode 100644 index 00000000..8218f37e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_list.pyi @@ -0,0 +1,42 @@ +from typing import Any, Dict, Iterator, List, Optional, Union, Iterable + +from django.contrib.admin.filters import FieldListFilter +from django.contrib.admin.templatetags.base import InclusionAdminNode +from django.contrib.admin.views.main import ChangeList +from django.db.models.base import Model +from django.forms.boundfield import BoundField +from django.template.base import Parser, Token +from django.template.context import RequestContext +from django.utils.safestring import SafeText + +from .base import InclusionAdminNode + +register: Any +DOT: str + +def paginator_number(cl: ChangeList, i: int) -> SafeText: ... +def pagination(cl: ChangeList) -> Dict[str, Iterable[Any]]: ... +def pagination_tag(parser: Parser, token: Token) -> InclusionAdminNode: ... +def result_headers(cl: ChangeList) -> Iterator[Dict[str, Optional[Union[int, str]]]]: ... +def items_for_result(cl: ChangeList, result: Model, form: None) -> Iterator[SafeText]: ... + +class ResultList(list): + form: None = ... + def __init__(self, form: None, *items: Any) -> None: ... + +def results(cl: ChangeList) -> Iterator[ResultList]: ... +def result_hidden_fields(cl: ChangeList) -> Iterator[BoundField]: ... +def result_list( + cl: ChangeList, +) -> Dict[ + str, Union[List[Dict[str, Optional[Union[int, str]]]], List[ResultList], List[BoundField], ChangeList, int] +]: ... +def result_list_tag(parser: Parser, token: Token) -> InclusionAdminNode: ... +def date_hierarchy(cl: ChangeList) -> Optional[Dict[str, Any]]: ... +def date_hierarchy_tag(parser: Parser, token: Token) -> InclusionAdminNode: ... +def search_form(cl: ChangeList) -> Dict[str, Union[bool, ChangeList, str]]: ... +def search_form_tag(parser: Parser, token: Token) -> InclusionAdminNode: ... +def admin_list_filter(cl: ChangeList, spec: FieldListFilter) -> SafeText: ... +def admin_actions(context: RequestContext) -> RequestContext: ... +def admin_actions_tag(parser: Parser, token: Token) -> InclusionAdminNode: ... +def change_list_object_tools_tag(parser: Parser, token: Token) -> InclusionAdminNode: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_modify.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_modify.pyi new file mode 100644 index 00000000..67ee4c67 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_modify.pyi @@ -0,0 +1,16 @@ +from typing import Any + +from django.contrib.admin.helpers import InlineAdminForm +from django.template.base import Parser, Token +from django.template.context import Context, RequestContext + +from .base import InclusionAdminNode + +register: Any + +def prepopulated_fields_js(context: RequestContext) -> RequestContext: ... +def prepopulated_fields_js_tag(parser: Parser, token: Token) -> InclusionAdminNode: ... +def submit_row(context: RequestContext) -> Context: ... +def submit_row_tag(parser: Parser, token: Token) -> InclusionAdminNode: ... +def change_form_object_tools_tag(parser: Parser, token: Token) -> InclusionAdminNode: ... +def cell_count(inline_admin_form: InlineAdminForm) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_static.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_static.pyi new file mode 100644 index 00000000..1dbe9428 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_static.pyi @@ -0,0 +1,5 @@ +from typing import Any + +register: Any + +def static(path: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_urls.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_urls.pyi new file mode 100644 index 00000000..020c2ca6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/admin_urls.pyi @@ -0,0 +1,17 @@ +from typing import Any, Dict, Optional, Union +from uuid import UUID + +from django.db.models.options import Options +from django.template.context import RequestContext +from django.utils.safestring import SafeText + +register: Any + +def admin_urlname(value: Options, arg: SafeText) -> str: ... +def admin_urlquote(value: Union[int, str, UUID]) -> Union[int, str, UUID]: ... +def add_preserved_filters( + context: Union[Dict[str, Union[Options, str]], RequestContext], + url: str, + popup: bool = ..., + to_field: Optional[str] = ..., +) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/base.pyi new file mode 100644 index 00000000..37750075 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/base.pyi @@ -0,0 +1,17 @@ +from typing import Any, Callable, Dict, List + +from django.template.base import Parser, Token +from django.template.context import Context +from django.template.library import InclusionNode +from django.utils.safestring import SafeText + +class InclusionAdminNode(InclusionNode): + args: List[Any] + func: Callable + kwargs: Dict[Any, Any] + takes_context: bool + template_name: str = ... + def __init__( + self, parser: Parser, token: Token, func: Callable, template_name: str, takes_context: bool = ... + ) -> None: ... + def render(self, context: Context) -> SafeText: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/log.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/log.pyi new file mode 100644 index 00000000..9dd4ee46 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/templatetags/log.pyi @@ -0,0 +1,16 @@ +from typing import Any, Optional + +from django import template +from django.template.base import Parser, Token +from django.template.context import Context + +register: Any + +class AdminLogNode(template.Node): + limit: str + user: str + varname: str + def __init__(self, limit: str, varname: str, user: Optional[str]) -> None: ... + def render(self, context: Context) -> str: ... + +def get_admin_log(parser: Parser, token: Token) -> AdminLogNode: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/tests.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/tests.pyi new file mode 100644 index 00000000..96059d8b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/tests.pyi @@ -0,0 +1,23 @@ +from typing import Any, Callable + +from django.contrib.staticfiles.testing import StaticLiveServerTestCase +from django.test.selenium import SeleniumTestCase +from django.utils.deprecation import MiddlewareMixin + +class CSPMiddleware(MiddlewareMixin): ... + +class AdminSeleniumTestCase(SeleniumTestCase, StaticLiveServerTestCase): + def wait_until(self, callback: Callable, timeout: int = ...) -> None: ... + def wait_for_popup(self, num_windows: int = ..., timeout: int = ...) -> None: ... + def wait_for(self, css_selector: str, timeout: int = ...) -> None: ... + def wait_for_text(self, css_selector: str, text: str, timeout: int = ...) -> None: ... + def wait_for_value(self, css_selector: str, text: str, timeout: int = ...) -> None: ... + def wait_until_visible(self, css_selector: str, timeout: int = ...) -> None: ... + def wait_until_invisible(self, css_selector: str, timeout: int = ...) -> None: ... + def wait_page_loaded(self) -> None: ... + def admin_login(self, username: str, password: str, login_url: str = ...) -> None: ... + def get_css_value(self, selector: str, attribute: str) -> Any: ... + def get_select_option(self, selector: str, value: Any) -> Any: ... + def assertSelectOptions(self, selector: str, values: Any) -> None: ... + def assertSelectedOptions(self, selector: str, values: Any) -> None: ... + def has_css_class(self, selector: str, klass: str) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/utils.pyi new file mode 100644 index 00000000..b127166b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/utils.pyi @@ -0,0 +1,68 @@ +import collections +from datetime import datetime +from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Tuple, Type, Union +from uuid import UUID + +from django.contrib.admin.options import BaseModelAdmin +from django.contrib.admin.sites import AdminSite +from django.contrib.auth.forms import AdminPasswordChangeForm +from django.core.handlers.wsgi import WSGIRequest +from django.db.models.base import Model +from django.db.models.deletion import Collector +from django.db.models.fields.reverse_related import ManyToOneRel +from django.db.models.options import Options +from django.db.models.query import QuerySet +from django.forms.forms import BaseForm + +from django.db.models.fields import Field, reverse_related + +class FieldIsAForeignKeyColumnName(Exception): ... + +def lookup_needs_distinct(opts: Options, lookup_path: str) -> bool: ... +def prepare_lookup_value(key: str, value: Union[datetime, str]) -> Union[bool, datetime, str]: ... +def quote(s: Union[int, str, UUID]) -> str: ... +def unquote(s: str) -> str: ... +def flatten(fields: Any) -> List[Union[Callable, str]]: ... +def flatten_fieldsets(fieldsets: Any) -> List[Union[Callable, str]]: ... +def get_deleted_objects( + objs: Sequence[Optional[Model]], request: WSGIRequest, admin_site: AdminSite +) -> Tuple[List[Any], Dict[Any, Any], Set[Any], List[Any]]: ... + +class NestedObjects(Collector): + data: collections.OrderedDict + dependencies: Dict[Any, Any] + fast_deletes: List[Any] + field_updates: Dict[Any, Any] + using: str + edges: Any = ... + protected: Any = ... + model_objs: Any = ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def add_edge(self, source: Optional[Model], target: Model) -> None: ... + def related_objects(self, related: ManyToOneRel, objs: Sequence[Optional[Model]]) -> QuerySet: ... + def nested(self, format_callback: Callable = ...) -> List[Any]: ... + +def model_format_dict(obj: Any): ... +def model_ngettext(obj: Union[Options, QuerySet], n: Optional[int] = ...) -> str: ... +def lookup_field( + name: Union[Callable, str], obj: Model, model_admin: BaseModelAdmin = ... +) -> Tuple[Optional[Field], Any, Any]: ... +def label_for_field( + name: Union[Callable, str], + model: Type[Model], + model_admin: Optional[BaseModelAdmin] = ..., + return_attr: bool = ..., + form: Optional[BaseForm] = ..., +) -> Union[Tuple[Optional[str], Union[Callable, Type[str]]], str]: ... +def help_text_for_field(name: str, model: Type[Model]) -> str: ... +def display_for_field(value: Any, field: Field, empty_value_display: str) -> str: ... +def display_for_value(value: Any, empty_value_display: str, boolean: bool = ...) -> str: ... + +class NotRelationField(Exception): ... + +def get_model_from_relation(field: Union[Field, reverse_related.ForeignObjectRel]) -> Type[Model]: ... +def reverse_field_path(model: Type[Model], path: str) -> Tuple[Type[Model], str]: ... +def get_fields_from_path(model: Type[Model], path: str) -> List[Field]: ... +def construct_change_message( + form: AdminPasswordChangeForm, formsets: None, add: bool +) -> List[Dict[str, Dict[str, List[str]]]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/views/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/views/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/views/autocomplete.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/views/autocomplete.pyi new file mode 100644 index 00000000..e7f2675f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/views/autocomplete.pyi @@ -0,0 +1,10 @@ +from typing import Any + +from django.contrib.admin.options import ModelAdmin +from django.core.handlers.wsgi import WSGIRequest +from django.views.generic.list import BaseListView + +class AutocompleteJsonView(BaseListView): + model_admin: ModelAdmin = ... + term: Any = ... + def has_perm(self, request: WSGIRequest, obj: None = ...) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/views/decorators.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/views/decorators.pyi new file mode 100644 index 00000000..f5b73ef4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/views/decorators.pyi @@ -0,0 +1,7 @@ +from typing import Callable, TypeVar, overload + +_C = TypeVar("_C", bound=Callable) +@overload +def staff_member_required(view_func: _C = ..., redirect_field_name: str = ..., login_url: str = ...) -> _C: ... +@overload +def staff_member_required(view_func: None = ..., redirect_field_name: str = ..., login_url: str = ...) -> Callable: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/views/main.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/views/main.pyi new file mode 100644 index 00000000..ad2deebb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/views/main.pyi @@ -0,0 +1,89 @@ +from collections import OrderedDict +from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union + +from django.contrib.admin.filters import ListFilter, SimpleListFilter +from django.contrib.admin.options import ( # noqa: F401 + ModelAdmin, + IS_POPUP_VAR as IS_POPUP_VAR, + TO_FIELD_VAR as TO_FIELD_VAR, +) +from django.core.handlers.wsgi import WSGIRequest +from django.db.models.base import Model +from django.db.models.expressions import Combinable, CombinedExpression, OrderBy +from django.db.models.query import QuerySet + +from django.db.models.options import Options +from django.forms.formsets import BaseFormSet + +ALL_VAR: str +ORDER_VAR: str +ORDER_TYPE_VAR: str +PAGE_VAR: str +SEARCH_VAR: str +ERROR_FLAG: str +IGNORED_PARAMS: Any + +class ChangeList: + model: Type[Model] = ... + opts: Options = ... + lookup_opts: Options = ... + root_queryset: QuerySet = ... + list_display: List[str] = ... + list_display_links: List[str] = ... + list_filter: Tuple = ... + date_hierarchy: None = ... + search_fields: Tuple = ... + list_select_related: bool = ... + list_per_page: int = ... + list_max_show_all: int = ... + model_admin: ModelAdmin = ... + preserved_filters: str = ... + sortable_by: Tuple[str] = ... + page_num: int = ... + show_all: bool = ... + is_popup: bool = ... + to_field: None = ... + params: Dict[Any, Any] = ... + list_editable: Tuple = ... + query: str = ... + queryset: Any = ... + title: Any = ... + pk_attname: Any = ... + formset: Optional[BaseFormSet] + def __init__( + self, + request: WSGIRequest, + model: Type[Model], + list_display: Union[List[Union[Callable, str]], Tuple[str]], + list_display_links: Optional[Union[List[Callable], List[str], Tuple[str]]], + list_filter: Union[List[Type[SimpleListFilter]], List[str], Tuple], + date_hierarchy: Optional[str], + search_fields: Union[List[str], Tuple], + list_select_related: Union[Tuple, bool], + list_per_page: int, + list_max_show_all: int, + list_editable: Union[List[str], Tuple], + model_admin: ModelAdmin, + sortable_by: Union[List[Callable], List[str], Tuple], + ) -> None: ... + def get_filters_params(self, params: None = ...) -> Dict[str, str]: ... + def get_filters(self, request: WSGIRequest) -> Tuple[List[ListFilter], bool, Dict[str, Union[bool, str]], bool]: ... + def get_query_string( + self, new_params: Optional[Dict[str, None]] = ..., remove: Optional[List[str]] = ... + ) -> str: ... + result_count: Any = ... + show_full_result_count: Any = ... + show_admin_actions: Any = ... + full_result_count: Any = ... + result_list: Any = ... + can_show_all: Any = ... + multi_page: Any = ... + paginator: Any = ... + def get_results(self, request: WSGIRequest) -> None: ... + def get_ordering_field(self, field_name: Union[Callable, str]) -> Optional[Union[CombinedExpression, str]]: ... + def get_ordering(self, request: WSGIRequest, queryset: QuerySet) -> List[Union[OrderBy, Combinable, str]]: ... + def get_ordering_field_columns(self) -> OrderedDict: ... + def get_queryset(self, request: WSGIRequest) -> QuerySet: ... + def apply_select_related(self, qs: QuerySet) -> QuerySet: ... + def has_related_field_in_list_display(self) -> bool: ... + def url_for_result(self, result: Model) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/widgets.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/widgets.pyi new file mode 100644 index 00000000..7d7fe397 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admin/widgets.pyi @@ -0,0 +1,102 @@ +from typing import Any, Dict, Optional, Tuple, Union +from uuid import UUID + +from django.contrib.admin.sites import AdminSite +from django.db.models.fields.reverse_related import ForeignObjectRel, ManyToOneRel +from django.forms.models import ModelChoiceIterator +from django.forms.widgets import Media + +from django import forms + +class FilteredSelectMultiple(forms.SelectMultiple): + @property + def media(self) -> Media: ... + verbose_name: Any = ... + is_stacked: Any = ... + def __init__(self, verbose_name: str, is_stacked: bool, attrs: None = ..., choices: Tuple = ...) -> None: ... + +class AdminDateWidget(forms.DateInput): + @property + def media(self) -> Media: ... + +class AdminTimeWidget(forms.TimeInput): + @property + def media(self) -> Media: ... + +class AdminSplitDateTime(forms.SplitDateTimeWidget): ... +class AdminRadioSelect(forms.RadioSelect): ... +class AdminFileWidget(forms.ClearableFileInput): ... + +def url_params_from_lookup_dict(lookups: Any) -> Dict[str, str]: ... + +class ForeignKeyRawIdWidget(forms.TextInput): + rel: ManyToOneRel = ... + admin_site: AdminSite = ... + db: None = ... + def __init__(self, rel: ForeignObjectRel, admin_site: AdminSite, attrs: None = ..., using: None = ...) -> None: ... + def base_url_parameters(self) -> Dict[str, str]: ... + def url_parameters(self) -> Dict[str, str]: ... + def label_and_url_for_value(self, value: Union[int, str, UUID]) -> Tuple[str, str]: ... + +class ManyToManyRawIdWidget(ForeignKeyRawIdWidget): ... + +class RelatedFieldWidgetWrapper(forms.Widget): + template_name: str = ... + choices: ModelChoiceIterator = ... + widget: forms.Widget = ... + rel: ManyToOneRel = ... + can_add_related: bool = ... + can_change_related: bool = ... + can_delete_related: bool = ... + can_view_related: bool = ... + admin_site: AdminSite = ... + def __init__( + self, + widget: forms.Widget, + rel: ForeignObjectRel, + admin_site: AdminSite, + can_add_related: Optional[bool] = ..., + can_change_related: bool = ..., + can_delete_related: bool = ..., + can_view_related: bool = ..., + ) -> None: ... + @property + def media(self) -> Media: ... + def get_related_url(self, info: Tuple[str, str], action: str, *args: Any) -> str: ... + +class AdminTextareaWidget(forms.Textarea): ... +class AdminTextInputWidget(forms.TextInput): ... +class AdminEmailInputWidget(forms.EmailInput): ... +class AdminURLFieldWidget(forms.URLInput): ... + +class AdminIntegerFieldWidget(forms.NumberInput): + class_name: str = ... + +class AdminBigIntegerFieldWidget(AdminIntegerFieldWidget): ... + +class AdminUUIDInputWidget(forms.TextInput): + def __init__(self, attrs: Optional[Dict[str, str]] = ...) -> None: ... + +SELECT2_TRANSLATIONS: Any + +class AutocompleteMixin: + url_name: str = ... + rel: Any = ... + admin_site: Any = ... + db: Any = ... + choices: Any = ... + attrs: Any = ... + def __init__( + self, + rel: ForeignObjectRel, + admin_site: AdminSite, + attrs: Optional[Dict[str, str]] = ..., + choices: Tuple = ..., + using: None = ..., + ) -> None: ... + def get_url(self) -> str: ... + @property + def media(self) -> Media: ... + +class AutocompleteSelect(AutocompleteMixin, forms.Select): ... +class AutocompleteSelectMultiple(AutocompleteMixin, forms.SelectMultiple): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/middleware.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/middleware.pyi new file mode 100644 index 00000000..fc697253 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/middleware.pyi @@ -0,0 +1,10 @@ +from typing import Any, Callable, Dict, Optional, Tuple + +from django.core.handlers.wsgi import WSGIRequest +from django.http.response import HttpResponse +from django.utils.deprecation import MiddlewareMixin + +class XViewMiddleware(MiddlewareMixin): + def process_view( + self, request: WSGIRequest, view_func: Callable, view_args: Tuple, view_kwargs: Dict[Any, Any] + ) -> Optional[HttpResponse]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/urls.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/urls.pyi new file mode 100644 index 00000000..99cbb7c4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/urls.pyi @@ -0,0 +1,3 @@ +from typing import Any, List + +urlpatterns: List[Any] = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/utils.pyi new file mode 100644 index 00000000..e96e469b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/utils.pyi @@ -0,0 +1,27 @@ +from typing import Any, Callable, Optional + +docutils_is_available: bool + +def get_view_name(view_func: Callable) -> str: ... +def trim_docstring(docstring: Any): ... +def parse_docstring(docstring: Any): ... +def parse_rst(text: Any, default_reference_context: Any, thing_being_parsed: Optional[Any] = ...): ... + +ROLES: Any + +def create_reference_role(rolename: Any, urlbase: Any): ... +def default_reference_role( + name: Any, + rawtext: Any, + text: Any, + lineno: Any, + inliner: Any, + options: Optional[Any] = ..., + content: Optional[Any] = ..., +): ... + +named_group_matcher: Any +unnamed_group_matcher: Any + +def replace_named_groups(pattern: str) -> str: ... +def replace_unnamed_groups(pattern: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/views.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/views.pyi new file mode 100644 index 00000000..48ef49bc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/admindocs/views.pyi @@ -0,0 +1,21 @@ +from typing import Any, Optional, Union + +from django.db.models.fields import Field +from django.views.generic import TemplateView + +MODEL_METHODS_EXCLUDE: Any + +class BaseAdminDocsView(TemplateView): ... +class BookmarkletsView(BaseAdminDocsView): ... +class TemplateTagIndexView(BaseAdminDocsView): ... +class TemplateFilterIndexView(BaseAdminDocsView): ... +class ViewIndexView(BaseAdminDocsView): ... +class ViewDetailView(BaseAdminDocsView): ... +class ModelIndexView(BaseAdminDocsView): ... +class ModelDetailView(BaseAdminDocsView): ... +class TemplateDetailView(BaseAdminDocsView): ... + +def get_return_data_type(func_name: Any): ... +def get_readable_field_data_type(field: Union[Field, str]) -> str: ... +def extract_views_from_urlpatterns(urlpatterns: Any, base: str = ..., namespace: Optional[Any] = ...): ... +def simplify_regex(pattern: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/__init__.pyi new file mode 100644 index 00000000..270680ae --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/__init__.pyi @@ -0,0 +1,34 @@ +from typing import Any, List, Optional, Type, Union + +from django.contrib.auth.backends import ModelBackend +from django.contrib.auth.base_user import AbstractBaseUser +from django.contrib.auth.models import AbstractUser, AnonymousUser +from django.core.handlers.wsgi import WSGIRequest +from django.db.models.base import Model +from django.db.models.options import Options +from django.http.request import HttpRequest + +from .signals import ( + user_logged_in as user_logged_in, + user_logged_out as user_logged_out, + user_login_failed as user_login_failed, +) + +SESSION_KEY: str +BACKEND_SESSION_KEY: str +HASH_SESSION_KEY: str +REDIRECT_FIELD_NAME: str + +def load_backend(path: str) -> ModelBackend: ... +def get_backends() -> List[ModelBackend]: ... +def authenticate(request: Any = ..., **credentials: Any) -> Optional[AbstractBaseUser]: ... +def login( + request: HttpRequest, user: AbstractBaseUser, backend: Optional[Union[Type[ModelBackend], str]] = ... +) -> None: ... +def logout(request: HttpRequest) -> None: ... +def get_user_model() -> Type[Model]: ... +def get_user(request: HttpRequest) -> Union[AbstractBaseUser, AnonymousUser]: ... +def get_permission_codename(action: str, opts: Options) -> str: ... +def update_session_auth_hash(request: WSGIRequest, user: AbstractUser) -> None: ... + +default_app_config: str diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/admin.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/admin.pyi new file mode 100644 index 00000000..69060d43 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/admin.pyi @@ -0,0 +1,18 @@ +from typing import Any + +from django.core.handlers.wsgi import WSGIRequest +from django.http.response import HttpResponse + +from django.contrib import admin + +csrf_protect_m: Any +sensitive_post_parameters_m: Any + +class GroupAdmin(admin.ModelAdmin): ... + +class UserAdmin(admin.ModelAdmin): + change_user_password_template: Any = ... + add_fieldsets: Any = ... + add_form: Any = ... + change_password_form: Any = ... + def user_change_password(self, request: WSGIRequest, id: str, form_url: str = ...) -> HttpResponse: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/apps.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/apps.pyi new file mode 100644 index 00000000..7764c9ff --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/apps.pyi @@ -0,0 +1,3 @@ +from django.apps import AppConfig + +class AuthConfig(AppConfig): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/backends.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/backends.pyi new file mode 100644 index 00000000..3dbd88d1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/backends.pyi @@ -0,0 +1,40 @@ +from typing import Any, Optional, Set, Union + +from django.contrib.auth.base_user import AbstractBaseUser +from django.contrib.auth.models import AnonymousUser, User, Permission + +from django.db.models.base import Model + +_AnyUser = Union[Model, AnonymousUser] + +UserModel: Any + +class BaseBackend: + def authenticate( + self, request: Any, username: Optional[str] = ..., password: Optional[str] = ..., **kwargs: Any + ) -> Optional[AbstractBaseUser]: ... + def get_user(self, user_id: int) -> Optional[AbstractBaseUser]: ... + def get_user_permissions(self, user_obj: _AnyUser, obj: Optional[Model] = ...) -> Set[str]: ... + def get_group_permissions(self, user_obj: _AnyUser, obj: Optional[Model] = ...) -> Set[str]: ... + def get_all_permissions(self, user_obj: _AnyUser, obj: Optional[Model] = ...) -> Set[str]: ... + def has_perm(self, user_obj: _AnyUser, perm: str, obj: Optional[Model] = ...) -> bool: ... + +class ModelBackend(BaseBackend): + def has_module_perms(self, user_obj: _AnyUser, app_label: str) -> bool: ... + def user_can_authenticate(self, user: Optional[_AnyUser]) -> bool: ... + def with_perm( + self, + perm: Union[str, Permission], + is_active: bool = ..., + include_superusers: bool = ..., + obj: Optional[Model] = ..., + ): ... + +class AllowAllUsersModelBackend(ModelBackend): ... + +class RemoteUserBackend(ModelBackend): + create_unknown_user: bool = ... + def clean_username(self, username: str) -> str: ... + def configure_user(self, user: User) -> User: ... + +class AllowAllUsersRemoteUserBackend(RemoteUserBackend): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/base_user.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/base_user.pyi new file mode 100644 index 00000000..1cbcac16 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/base_user.pyi @@ -0,0 +1,44 @@ +import sys +from typing import Any, Optional, Tuple, List, overload, TypeVar + +from django.db.models.base import Model + +from django.db import models + +if sys.version_info < (3, 8): + from typing_extensions import Literal +else: + from typing import Literal + +_T = TypeVar("_T", bound=Model) + +class BaseUserManager(models.Manager[_T]): + @classmethod + def normalize_email(cls, email: Optional[str]) -> str: ... + def make_random_password(self, length: int = ..., allowed_chars: str = ...) -> str: ... + def get_by_natural_key(self, username: Optional[str]) -> _T: ... + +class AbstractBaseUser(models.Model): + REQUIRED_FIELDS: List[str] = ... + + password = models.CharField(max_length=128) + last_login = models.DateTimeField(blank=True, null=True) + def get_username(self) -> str: ... + def natural_key(self) -> Tuple[str]: ... + @property + def is_anonymous(self) -> Literal[False]: ... + @property + def is_authenticated(self) -> Literal[True]: ... + def set_password(self, raw_password: Optional[str]) -> None: ... + def check_password(self, raw_password: str) -> bool: ... + def set_unusable_password(self) -> None: ... + def has_usable_password(self) -> bool: ... + def get_session_auth_hash(self) -> str: ... + @classmethod + def get_email_field_name(cls) -> str: ... + @classmethod + @overload + def normalize_username(cls, username: str) -> str: ... + @classmethod + @overload + def normalize_username(cls, username: Any) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/checks.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/checks.pyi new file mode 100644 index 00000000..f2c53320 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/checks.pyi @@ -0,0 +1,8 @@ +from typing import Any, List, Iterable, Optional + +from django.core.checks.messages import CheckMessage + +from django.apps.config import AppConfig + +def check_user_model(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[CheckMessage]: ... +def check_models_permissions(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[Any]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/context_processors.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/context_processors.pyi new file mode 100644 index 00000000..51a063ca --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/context_processors.pyi @@ -0,0 +1,20 @@ +from typing import Any, Dict + +from django.http.request import HttpRequest + +class PermLookupDict: + app_label: str + user: Any + def __init__(self, user: Any, app_label: str) -> None: ... + def __getitem__(self, perm_name: str) -> bool: ... + def __iter__(self) -> Any: ... + def __bool__(self) -> bool: ... + +class PermWrapper: + user: Any = ... + def __init__(self, user: Any) -> None: ... + def __getitem__(self, app_label: str) -> PermLookupDict: ... + def __iter__(self) -> Any: ... + def __contains__(self, perm_name: Any) -> bool: ... + +def auth(request: HttpRequest) -> Dict[str, Any]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/decorators.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/decorators.pyi new file mode 100644 index 00000000..3ecebe72 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/decorators.pyi @@ -0,0 +1,21 @@ +from typing import Callable, List, Optional, Set, Union, TypeVar, overload + +from django.contrib.auth import REDIRECT_FIELD_NAME as REDIRECT_FIELD_NAME # noqa: F401 +from django.http.response import HttpResponseBase + +from django.contrib.auth.models import AbstractUser + +_VIEW = TypeVar("_VIEW", bound=Callable[..., HttpResponseBase]) + +def user_passes_test( + test_func: Callable[[AbstractUser], bool], login_url: Optional[str] = ..., redirect_field_name: str = ... +) -> Callable[[_VIEW], _VIEW]: ... + +# There are two ways of calling @login_required: @with(arguments) and @bare +@overload +def login_required(redirect_field_name: str = ..., login_url: Optional[str] = ...) -> Callable[[_VIEW], _VIEW]: ... +@overload +def login_required(function: _VIEW, redirect_field_name: str = ..., login_url: Optional[str] = ...) -> _VIEW: ... +def permission_required( + perm: Union[List[str], Set[str], str], login_url: None = ..., raise_exception: bool = ... +) -> Callable[[_VIEW], _VIEW]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/forms.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/forms.pyi new file mode 100644 index 00000000..e6584292 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/forms.pyi @@ -0,0 +1,91 @@ +from typing import Any, Dict, Iterator, Optional + +from django.contrib.auth.base_user import AbstractBaseUser +from django.contrib.auth.models import AbstractUser, User +from django.contrib.auth.tokens import PasswordResetTokenGenerator +from django.core.exceptions import ValidationError +from django.core.handlers.wsgi import WSGIRequest + +from django import forms + +UserModel: Any + +class ReadOnlyPasswordHashWidget(forms.Widget): + template_name: str = ... + +class ReadOnlyPasswordHashField(forms.Field): + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + +class UsernameField(forms.CharField): ... + +class UserCreationForm(forms.ModelForm): + error_messages: Any = ... + password1: Any = ... + password2: Any = ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def clean_password2(self) -> str: ... + +class UserChangeForm(forms.ModelForm): + password: Any = ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def clean_password(self) -> str: ... + +class AuthenticationForm(forms.Form): + username: Any = ... + password: Any = ... + error_messages: Any = ... + request: WSGIRequest = ... + user_cache: None = ... + username_field: Any = ... + def __init__(self, request: Any = ..., *args: Any, **kwargs: Any) -> None: ... + def confirm_login_allowed(self, user: AbstractBaseUser) -> None: ... + def get_user(self) -> User: ... + def get_invalid_login_error(self) -> ValidationError: ... + +class PasswordResetForm(forms.Form): + email: Any = ... + def send_mail( + self, + subject_template_name: str, + email_template_name: str, + context: Dict[str, Any], + from_email: Optional[str], + to_email: str, + html_email_template_name: Optional[str] = ..., + ) -> None: ... + def get_users(self, email: str) -> Iterator[Any]: ... + def save( + self, + domain_override: Optional[str] = ..., + subject_template_name: str = ..., + email_template_name: str = ..., + use_https: bool = ..., + token_generator: PasswordResetTokenGenerator = ..., + from_email: Optional[str] = ..., + request: Optional[WSGIRequest] = ..., + html_email_template_name: Optional[str] = ..., + extra_email_context: Optional[Dict[str, str]] = ..., + ) -> None: ... + +class SetPasswordForm(forms.Form): + error_messages: Any = ... + new_password1: Any = ... + new_password2: Any = ... + user: User = ... + def __init__(self, user: Optional[AbstractBaseUser], *args: Any, **kwargs: Any) -> None: ... + def clean_new_password2(self) -> str: ... + def save(self, commit: bool = ...) -> AbstractBaseUser: ... + +class PasswordChangeForm(SetPasswordForm): + old_password: Any = ... + def clean_old_password(self) -> str: ... + +class AdminPasswordChangeForm(forms.Form): + error_messages: Any = ... + required_css_class: str = ... + password1: Any = ... + password2: Any = ... + user: User = ... + def __init__(self, user: AbstractUser, *args: Any, **kwargs: Any) -> None: ... + def clean_password2(self) -> str: ... + def save(self, commit: bool = ...) -> AbstractUser: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/handlers/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/handlers/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/handlers/modwsgi.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/handlers/modwsgi.pyi new file mode 100644 index 00000000..47be491f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/handlers/modwsgi.pyi @@ -0,0 +1,6 @@ +from typing import Any, Dict + +UserModel: Any + +def check_password(environ: Dict[Any, Any], username: str, password: str) -> Any: ... +def groups_for_user(environ: Dict[Any, Any], username: str) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/hashers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/hashers.pyi new file mode 100644 index 00000000..4998dfe6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/hashers.pyi @@ -0,0 +1,45 @@ +from typing import Any, Callable, Dict, List, Optional + +UNUSABLE_PASSWORD_PREFIX: str +UNUSABLE_PASSWORD_SUFFIX_LENGTH: int + +def is_password_usable(encoded: Optional[str]) -> bool: ... +def check_password( + password: Optional[str], encoded: str, setter: Optional[Callable] = ..., preferred: str = ... +) -> bool: ... +def make_password(password: Optional[str], salt: Optional[str] = ..., hasher: str = ...) -> str: ... +def get_hashers() -> List[BasePasswordHasher]: ... +def get_hashers_by_algorithm() -> Dict[str, BasePasswordHasher]: ... +def reset_hashers(**kwargs: Any) -> None: ... +def get_hasher(algorithm: str = ...) -> BasePasswordHasher: ... +def identify_hasher(encoded: str) -> BasePasswordHasher: ... +def mask_hash(hash: str, show: int = ..., char: str = ...) -> str: ... + +class BasePasswordHasher: + algorithm: str = ... + library: str = ... + rounds: int = ... + time_cost: int = ... + memory_cost: int = ... + parallelism: int = ... + digest: Any = ... + iterations: int = ... + def salt(self) -> str: ... + def verify(self, password: str, encoded: str) -> bool: ... + def encode(self, password: str, salt: str) -> Any: ... + def safe_summary(self, encoded: str) -> Any: ... + def must_update(self, encoded: str) -> bool: ... + def harden_runtime(self, password: str, encoded: str) -> None: ... + +class PBKDF2PasswordHasher(BasePasswordHasher): + def encode(self, password: str, salt: str, iterations: Optional[int] = ...) -> str: ... + +class PBKDF2SHA1PasswordHasher(PBKDF2PasswordHasher): ... +class Argon2PasswordHasher(BasePasswordHasher): ... +class BCryptSHA256PasswordHasher(BasePasswordHasher): ... +class BCryptPasswordHasher(BCryptSHA256PasswordHasher): ... +class SHA1PasswordHasher(BasePasswordHasher): ... +class MD5PasswordHasher(BasePasswordHasher): ... +class UnsaltedSHA1PasswordHasher(BasePasswordHasher): ... +class UnsaltedMD5PasswordHasher(BasePasswordHasher): ... +class CryptPasswordHasher(BasePasswordHasher): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/management/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/management/__init__.pyi new file mode 100644 index 00000000..681a10ae --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/management/__init__.pyi @@ -0,0 +1,15 @@ +from typing import Any + +from django.apps.config import AppConfig +from django.apps.registry import Apps + +def create_permissions( + app_config: AppConfig, + verbosity: int = ..., + interactive: bool = ..., + using: str = ..., + apps: Apps = ..., + **kwargs: Any +) -> None: ... +def get_system_username() -> str: ... +def get_default_username(check_db: bool = ...) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/management/commands/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/management/commands/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/management/commands/changepassword.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/management/commands/changepassword.pyi new file mode 100644 index 00000000..0998c2dd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/management/commands/changepassword.pyi @@ -0,0 +1,7 @@ +from typing import Any + +from django.core.management.base import BaseCommand + +UserModel: Any + +class Command(BaseCommand): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/management/commands/createsuperuser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/management/commands/createsuperuser.pyi new file mode 100644 index 00000000..efc0752a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/management/commands/createsuperuser.pyi @@ -0,0 +1,9 @@ +import getpass as getpass # noqa: F401 +from typing import Any + +from django.core.management.base import BaseCommand + +class NotRunningInTTYException(Exception): ... + +class Command(BaseCommand): + stdin: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/middleware.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/middleware.pyi new file mode 100644 index 00000000..aae3981e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/middleware.pyi @@ -0,0 +1,20 @@ +from typing import Union + +from django.contrib.auth.models import AnonymousUser, User +from django.core.handlers.wsgi import WSGIRequest +from django.http.request import HttpRequest +from django.utils.deprecation import MiddlewareMixin + +def get_user(request: WSGIRequest) -> Union[AnonymousUser, User]: ... + +class AuthenticationMiddleware(MiddlewareMixin): + def process_request(self, request: HttpRequest) -> None: ... + +class RemoteUserMiddleware(MiddlewareMixin): + header: str = ... + force_logout_if_no_header: bool = ... + def process_request(self, request: HttpRequest) -> None: ... + def clean_username(self, username: str, request: HttpRequest) -> str: ... + +class PersistentRemoteUserMiddleware(RemoteUserMiddleware): + force_logout_if_no_header: bool = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/mixins.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/mixins.pyi new file mode 100644 index 00000000..50b72636 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/mixins.pyi @@ -0,0 +1,28 @@ +from typing import Any, Callable, List, Optional + +from django import http +from django.http.response import HttpResponse, HttpResponseRedirect + +class AccessMixin: + login_url: Any = ... + permission_denied_message: str = ... + raise_exception: bool = ... + redirect_field_name: Any = ... + def get_login_url(self) -> str: ... + def get_permission_denied_message(self) -> str: ... + def get_redirect_field_name(self) -> str: ... + def handle_no_permission(self) -> HttpResponseRedirect: ... + +class LoginRequiredMixin(AccessMixin): + def dispatch(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ... + +class PermissionRequiredMixin(AccessMixin): + permission_required: Any = ... + def get_permission_required(self) -> List[str]: ... + def has_permission(self) -> bool: ... + def dispatch(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ... + +class UserPassesTestMixin(AccessMixin): + def test_func(self) -> Optional[bool]: ... + def get_test_func(self) -> Callable: ... + def dispatch(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/models.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/models.pyi new file mode 100644 index 00000000..921841ea --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/models.pyi @@ -0,0 +1,117 @@ +import sys +from typing import Any, Collection, Optional, Set, Tuple, Type, TypeVar, Union + +from django.contrib.auth.backends import ModelBackend +from django.contrib.auth.base_user import AbstractBaseUser as AbstractBaseUser, BaseUserManager as BaseUserManager +from django.contrib.auth.validators import UnicodeUsernameValidator +from django.contrib.contenttypes.models import ContentType +from django.db.models.base import Model +from django.db.models.manager import EmptyManager + +from django.db import models + +if sys.version_info < (3, 8): + from typing_extensions import Literal +else: + from typing import Literal + +_AnyUser = Union[Model, "AnonymousUser"] + +def update_last_login(sender: Type[AbstractBaseUser], user: AbstractBaseUser, **kwargs: Any) -> None: ... + +class PermissionManager(models.Manager["Permission"]): + def get_by_natural_key(self, codename: str, app_label: str, model: str) -> Permission: ... + +class Permission(models.Model): + content_type_id: int + objects: PermissionManager + + name = models.CharField(max_length=255) + content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) + codename = models.CharField(max_length=100) + def natural_key(self) -> Tuple[str, str, str]: ... + +class GroupManager(models.Manager["Group"]): + def get_by_natural_key(self, name: str) -> Group: ... + +class Group(models.Model): + objects: GroupManager + + name = models.CharField(max_length=150) + permissions = models.ManyToManyField(Permission) + def natural_key(self): ... + +_T = TypeVar("_T", bound=Model) + +class UserManager(BaseUserManager[_T]): + def create_user( + self, username: str, email: Optional[str] = ..., password: Optional[str] = ..., **extra_fields: Any + ) -> _T: ... + def create_superuser( + self, username: str, email: Optional[str], password: Optional[str], **extra_fields: Any + ) -> _T: ... + def with_perm( + self, + perm: Union[str, Permission], + is_active: bool = ..., + include_superusers: bool = ..., + backend: Optional[Union[Type[ModelBackend], str]] = ..., + obj: Optional[Model] = ..., + ): ... + +class PermissionsMixin(models.Model): + is_superuser = models.BooleanField() + groups = models.ManyToManyField(Group) + user_permissions = models.ManyToManyField(Permission) + def get_user_permissions(self, obj: Optional[_AnyUser] = ...) -> Set[str]: ... + def get_group_permissions(self, obj: Optional[_AnyUser] = ...) -> Set[str]: ... + def get_all_permissions(self, obj: Optional[_AnyUser] = ...) -> Set[str]: ... + def has_perm(self, perm: str, obj: Optional[_AnyUser] = ...) -> bool: ... + def has_perms(self, perm_list: Collection[str], obj: Optional[_AnyUser] = ...) -> bool: ... + def has_module_perms(self, app_label: str) -> bool: ... + +class AbstractUser(AbstractBaseUser, PermissionsMixin): # type: ignore + username_validator: UnicodeUsernameValidator = ... + + username = models.CharField(max_length=150) + first_name = models.CharField(max_length=30, blank=True) + last_name = models.CharField(max_length=150, blank=True) + email = models.EmailField(blank=True) + is_staff = models.BooleanField() + is_active = models.BooleanField() + date_joined = models.DateTimeField() + + EMAIL_FIELD: str = ... + USERNAME_FIELD: str = ... + def get_full_name(self) -> str: ... + def get_short_name(self) -> str: ... + def email_user(self, subject: str, message: str, from_email: str = ..., **kwargs: Any) -> None: ... + +class User(AbstractUser): ... + +class AnonymousUser: + id: Any = ... + pk: Any = ... + username: str = ... + is_staff: bool = ... + is_active: bool = ... + is_superuser: bool = ... + def save(self) -> Any: ... + def delete(self) -> Any: ... + def set_password(self, raw_password: str) -> Any: ... + def check_password(self, raw_password: str) -> Any: ... + @property + def groups(self) -> EmptyManager: ... + @property + def user_permissions(self) -> EmptyManager: ... + def get_user_permissions(self, obj: Optional[_AnyUser] = ...) -> Set[str]: ... + def get_group_permissions(self, obj: Optional[_AnyUser] = ...) -> Set[Any]: ... + def get_all_permissions(self, obj: Optional[_AnyUser] = ...) -> Set[str]: ... + def has_perm(self, perm: str, obj: Optional[_AnyUser] = ...) -> bool: ... + def has_perms(self, perm_list: Collection[str], obj: Optional[_AnyUser] = ...) -> bool: ... + def has_module_perms(self, module: str) -> bool: ... + @property + def is_anonymous(self) -> Literal[True]: ... + @property + def is_authenticated(self) -> Literal[False]: ... + def get_username(self) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/password_validation.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/password_validation.pyi new file mode 100644 index 00000000..95c07cda --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/password_validation.pyi @@ -0,0 +1,46 @@ +from pathlib import Path, PosixPath +from typing import Any, List, Mapping, Optional, Protocol, Sequence, Set, Union + +from django.db.models.base import Model + +_UserModel = Model + +class PasswordValidator(Protocol): + def password_changed(self, password: str, user: Optional[_UserModel] = ...): ... + +def get_default_password_validators() -> List[PasswordValidator]: ... +def get_password_validators(validator_config: Sequence[Mapping[str, Any]]) -> List[PasswordValidator]: ... +def validate_password( + password: str, user: Optional[_UserModel] = ..., password_validators: Optional[Sequence[PasswordValidator]] = ... +) -> None: ... +def password_changed( + password: str, user: Optional[_UserModel] = ..., password_validators: Optional[Sequence[PasswordValidator]] = ... +) -> None: ... +def password_validators_help_texts(password_validators: Optional[Sequence[PasswordValidator]] = ...) -> List[str]: ... + +password_validators_help_text_html: Any + +class MinimumLengthValidator: + min_length: int = ... + def __init__(self, min_length: int = ...) -> None: ... + def validate(self, password: str, user: Optional[_UserModel] = ...) -> None: ... + def get_help_text(self) -> str: ... + +class UserAttributeSimilarityValidator: + DEFAULT_USER_ATTRIBUTES: Sequence[str] = ... + user_attributes: Sequence[str] = ... + max_similarity: float = ... + def __init__(self, user_attributes: Sequence[str] = ..., max_similarity: float = ...) -> None: ... + def validate(self, password: str, user: Optional[_UserModel] = ...) -> None: ... + def get_help_text(self) -> str: ... + +class CommonPasswordValidator: + DEFAULT_PASSWORD_LIST_PATH: Path = ... + passwords: Set[str] = ... + def __init__(self, password_list_path: Union[PosixPath, str] = ...) -> None: ... + def validate(self, password: str, user: Optional[_UserModel] = ...) -> None: ... + def get_help_text(self) -> str: ... + +class NumericPasswordValidator: + def validate(self, password: str, user: Optional[_UserModel] = ...) -> None: ... + def get_help_text(self) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/signals.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/signals.pyi new file mode 100644 index 00000000..d50af434 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/signals.pyi @@ -0,0 +1,5 @@ +from django.dispatch.dispatcher import Signal + +user_logged_in: Signal +user_login_failed: Signal +user_logged_out: Signal diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/tokens.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/tokens.pyi new file mode 100644 index 00000000..b97d91da --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/tokens.pyi @@ -0,0 +1,11 @@ +from typing import Any, Optional + +from django.contrib.auth.base_user import AbstractBaseUser + +class PasswordResetTokenGenerator: + key_salt: str = ... + secret: Any = ... + def make_token(self, user: AbstractBaseUser) -> str: ... + def check_token(self, user: Optional[AbstractBaseUser], token: Optional[str]) -> bool: ... + +default_token_generator: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/urls.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/urls.pyi new file mode 100644 index 00000000..99cbb7c4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/urls.pyi @@ -0,0 +1,3 @@ +from typing import Any, List + +urlpatterns: List[Any] = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/validators.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/validators.pyi new file mode 100644 index 00000000..bbb530f3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/validators.pyi @@ -0,0 +1,4 @@ +from django.core import validators + +class ASCIIUsernameValidator(validators.RegexValidator): ... +class UnicodeUsernameValidator(validators.RegexValidator): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/views.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/views.pyi new file mode 100644 index 00000000..124c01c5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/auth/views.pyi @@ -0,0 +1,72 @@ +from typing import Any, Optional, Set + +from django.contrib.auth.base_user import AbstractBaseUser +from django.core.handlers.wsgi import WSGIRequest +from django.http.request import HttpRequest +from django.http.response import HttpResponseRedirect +from django.template.response import TemplateResponse +from django.views.generic.base import TemplateView +from django.views.generic.edit import FormView + +UserModel: Any + +class SuccessURLAllowedHostsMixin: + success_url_allowed_hosts: Any = ... + def get_success_url_allowed_hosts(self) -> Set[str]: ... + +class LoginView(SuccessURLAllowedHostsMixin, FormView): + authentication_form: Any = ... + redirect_field_name: Any = ... + redirect_authenticated_user: bool = ... + extra_context: Any = ... + def get_redirect_url(self) -> str: ... + +class LogoutView(SuccessURLAllowedHostsMixin, TemplateView): + next_page: Any = ... + redirect_field_name: Any = ... + extra_context: Any = ... + def post(self, request: WSGIRequest, *args: Any, **kwargs: Any) -> TemplateResponse: ... + def get_next_page(self) -> Optional[str]: ... + +def logout_then_login(request: HttpRequest, login_url: Optional[str] = ...) -> HttpResponseRedirect: ... +def redirect_to_login( + next: str, login_url: Optional[str] = ..., redirect_field_name: Optional[str] = ... +) -> HttpResponseRedirect: ... + +class PasswordContextMixin: + extra_context: Any = ... + def get_context_data(self, **kwargs: Any): ... + +class PasswordResetView(PasswordContextMixin, FormView): + email_template_name: str = ... + extra_email_context: Any = ... + from_email: Any = ... + html_email_template_name: Any = ... + subject_template_name: str = ... + title: Any = ... + token_generator: Any = ... + +INTERNAL_RESET_URL_TOKEN: str +INTERNAL_RESET_SESSION_TOKEN: str + +class PasswordResetDoneView(PasswordContextMixin, TemplateView): + title: Any = ... + +class PasswordResetConfirmView(PasswordContextMixin, FormView): + post_reset_login: bool = ... + post_reset_login_backend: Any = ... + reset_url_token: str = ... + title: Any = ... + token_generator: Any = ... + validlink: bool = ... + user: Any = ... + def get_user(self, uidb64: str) -> Optional[AbstractBaseUser]: ... + +class PasswordResetCompleteView(PasswordContextMixin, TemplateView): + title: Any = ... + +class PasswordChangeView(PasswordContextMixin, FormView): + title: Any = ... + +class PasswordChangeDoneView(PasswordContextMixin, TemplateView): + title: Any = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/admin.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/admin.pyi new file mode 100644 index 00000000..b4ca5621 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/admin.pyi @@ -0,0 +1,14 @@ +from typing import Any, List, Type + +from django.contrib.admin.options import InlineModelAdmin +from django.db.models.base import Model + +class GenericInlineModelAdminChecks: + def _check_exclude_of_parent_model(self, obj: GenericInlineModelAdmin, parent_model: Type[Model]) -> List[Any]: ... + def _check_relation(self, obj: GenericInlineModelAdmin, parent_model: Type[Model]) -> List[Any]: ... + +class GenericInlineModelAdmin(InlineModelAdmin): + template: str = ... + +class GenericStackedInline(GenericInlineModelAdmin): ... +class GenericTabularInline(GenericInlineModelAdmin): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/apps.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/apps.pyi new file mode 100644 index 00000000..cff43d9e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/apps.pyi @@ -0,0 +1,3 @@ +from django.apps import AppConfig + +class ContentTypesConfig(AppConfig): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/checks.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/checks.pyi new file mode 100644 index 00000000..97c17fa1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/checks.pyi @@ -0,0 +1,6 @@ +from typing import Any, List, Iterable, Optional + +from django.apps.config import AppConfig + +def check_generic_foreign_keys(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[Any]: ... +def check_model_name_lengths(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[Any]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/fields.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/fields.pyi new file mode 100644 index 00000000..d8586ed9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/fields.pyi @@ -0,0 +1,95 @@ +from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union + +from django.contrib.contenttypes.models import ContentType +from django.core.checks.messages import Error +from django.db.models.base import Model +from django.db.models.expressions import Combinable +from django.db.models.fields.mixins import FieldCacheMixin +from django.db.models.fields.related import ForeignObject +from django.db.models.fields.related_descriptors import ReverseManyToOneDescriptor +from django.db.models.fields.reverse_related import ForeignObjectRel +from django.db.models.query import QuerySet +from django.db.models.query_utils import FilteredRelation, PathInfo +from django.db.models.sql.where import WhereNode + +from django.db.models.fields import Field, PositiveIntegerField + +class GenericForeignKey(FieldCacheMixin): + # django-stubs implementation only fields + _pyi_private_set_type: Union[Any, Combinable] + _pyi_private_get_type: Any + # attributes + auto_created: bool = ... + concrete: bool = ... + editable: bool = ... + hidden: bool = ... + is_relation: bool = ... + many_to_many: bool = ... + many_to_one: bool = ... + one_to_many: bool = ... + one_to_one: bool = ... + related_model: Any = ... + remote_field: Any = ... + ct_field: str = ... + fk_field: str = ... + for_concrete_model: bool = ... + rel: None = ... + column: None = ... + def __init__(self, ct_field: str = ..., fk_field: str = ..., for_concrete_model: bool = ...) -> None: ... + name: Any = ... + model: Any = ... + def contribute_to_class(self, cls: Type[Model], name: str, **kwargs: Any) -> None: ... + def get_filter_kwargs_for_object(self, obj: Model) -> Dict[str, Optional[ContentType]]: ... + def get_forward_related_filter(self, obj: Model) -> Dict[str, int]: ... + def check(self, **kwargs: Any) -> List[Error]: ... + def get_cache_name(self) -> str: ... + def get_content_type( + self, obj: Optional[Model] = ..., id: Optional[int] = ..., using: Optional[str] = ... + ) -> ContentType: ... + def get_prefetch_queryset( + self, instances: Union[List[Model], QuerySet], queryset: Optional[QuerySet] = ... + ) -> Tuple[List[Model], Callable, Callable, bool, str, bool]: ... + def __get__(self, instance: Optional[Model], cls: Type[Model] = ...) -> Optional[Any]: ... + def __set__(self, instance: Model, value: Optional[Any]) -> None: ... + +class GenericRel(ForeignObjectRel): + field: GenericRelation + def __init__( + self, + field: GenericRelation, + to: Union[Type[Model], str], + related_name: Optional[str] = ..., + related_query_name: Optional[str] = ..., + limit_choices_to: Optional[Union[Dict[str, Any], Callable[[], Any]]] = ..., + ) -> None: ... + +class GenericRelation(ForeignObject): + rel_class: Any = ... + mti_inherited: bool = ... + object_id_field_name: Any = ... + content_type_field_name: Any = ... + for_concrete_model: Any = ... + to_fields: Any = ... + def __init__( + self, + to: Union[Type[Model], str], + object_id_field: str = ..., + content_type_field: str = ..., + for_concrete_model: bool = ..., + related_query_name: Optional[str] = ..., + limit_choices_to: Optional[Union[Dict[str, Any], Callable[[], Any]]] = ..., + **kwargs: Any + ) -> None: ... + def resolve_related_fields(self) -> List[Tuple[PositiveIntegerField, Field]]: ... + def get_path_info(self, filtered_relation: Optional[FilteredRelation] = ...) -> List[PathInfo]: ... + def get_reverse_path_info(self, filtered_relation: None = ...) -> List[PathInfo]: ... + def value_to_string(self, obj: Model) -> str: ... + def get_content_type(self) -> ContentType: ... + def get_extra_restriction( + self, where_class: Type[WhereNode], alias: Optional[str], remote_alias: str + ) -> WhereNode: ... + def bulk_related_objects(self, objs: List[Model], using: str = ...) -> QuerySet: ... + +class ReverseGenericManyToOneDescriptor(ReverseManyToOneDescriptor): ... + +def create_generic_related_manager(superclass: Any, rel: Any): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/forms.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/forms.pyi new file mode 100644 index 00000000..e27d7022 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/forms.pyi @@ -0,0 +1,41 @@ +from typing import Any, Optional + +from django.forms.models import BaseModelFormSet + +class BaseGenericInlineFormSet(BaseModelFormSet): + instance: Any = ... + rel_name: Any = ... + save_as_new: Any = ... + def __init__( + self, + data: Optional[Any] = ..., + files: Optional[Any] = ..., + instance: Optional[Any] = ..., + save_as_new: bool = ..., + prefix: Optional[Any] = ..., + queryset: Optional[Any] = ..., + **kwargs: Any + ) -> None: ... + def initial_form_count(self): ... + @classmethod + def get_default_prefix(cls): ... + def save_new(self, form: Any, commit: bool = ...): ... + +def generic_inlineformset_factory( + model: Any, + form: Any = ..., + formset: Any = ..., + ct_field: str = ..., + fk_field: str = ..., + fields: Optional[Any] = ..., + exclude: Optional[Any] = ..., + extra: int = ..., + can_order: bool = ..., + can_delete: bool = ..., + max_num: Optional[Any] = ..., + formfield_callback: Optional[Any] = ..., + validate_max: bool = ..., + for_concrete_model: bool = ..., + min_num: Optional[Any] = ..., + validate_min: bool = ..., +): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/management/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/management/__init__.pyi new file mode 100644 index 00000000..768883b3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/management/__init__.pyi @@ -0,0 +1,33 @@ +from typing import Any, Dict, List, Optional, Tuple, Type + +from django.apps.config import AppConfig +from django.apps.registry import Apps +from django.contrib.contenttypes.models import ContentType +from django.db import migrations +from django.db.backends.sqlite3.schema import DatabaseSchemaEditor +from django.db.migrations.migration import Migration +from django.db.migrations.state import StateApps +from django.db.models.base import Model + +class RenameContentType(migrations.RunPython): + app_label: Any = ... + old_model: Any = ... + new_model: Any = ... + def __init__(self, app_label: str, old_model: str, new_model: str) -> None: ... + def rename_forward(self, apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None: ... + def rename_backward(self, apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None: ... + +def inject_rename_contenttypes_operations( + plan: List[Tuple[Migration, bool]] = ..., apps: StateApps = ..., using: str = ..., **kwargs: Any +) -> None: ... +def get_contenttypes_and_models( + app_config: AppConfig, using: str, ContentType: Type[ContentType] +) -> Tuple[Dict[str, ContentType], Dict[str, Type[Model]]]: ... +def create_contenttypes( + app_config: AppConfig, + verbosity: int = ..., + interactive: bool = ..., + using: str = ..., + apps: Apps = ..., + **kwargs: Any +) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/management/commands/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/management/commands/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/management/commands/remove_stale_contenttypes.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/management/commands/remove_stale_contenttypes.pyi new file mode 100644 index 00000000..d432030e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/management/commands/remove_stale_contenttypes.pyi @@ -0,0 +1,15 @@ +from typing import Any, Dict, List + +from django.db.models.deletion import Collector + +from django.core.management import BaseCommand + +class Command(BaseCommand): ... + +class NoFastDeleteCollector(Collector): + data: Dict[str, Any] + dependencies: Dict[Any, Any] + fast_deletes: List[Any] + field_updates: Dict[Any, Any] + using: str + def can_fast_delete(self, *args: Any, **kwargs: Any) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/models.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/models.pyi new file mode 100644 index 00000000..e9f5e7cb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/models.pyi @@ -0,0 +1,24 @@ +from typing import Any, Dict, Optional, Tuple, Type, Union + +from django.db import models +from django.db.models.base import Model +from django.db.models.query import QuerySet + +class ContentTypeManager(models.Manager["ContentType"]): + def get_by_natural_key(self, app_label: str, model: str) -> ContentType: ... + def get_for_model(self, model: Union[Type[Model], Model], for_concrete_model: bool = ...) -> ContentType: ... + def get_for_models(self, *models: Any, for_concrete_models: bool = ...) -> Dict[Type[Model], ContentType]: ... + def get_for_id(self, id: int) -> ContentType: ... + def clear_cache(self) -> None: ... + +class ContentType(models.Model): + id: int + app_label: models.CharField = ... + model: models.CharField = ... + objects: ContentTypeManager = ... + @property + def name(self) -> str: ... + def model_class(self) -> Optional[Type[Model]]: ... + def get_object_for_this_type(self, **kwargs: Any) -> Model: ... + def get_all_objects_for_this_type(self, **kwargs: Any) -> QuerySet: ... + def natural_key(self) -> Tuple[str, str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/views.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/views.pyi new file mode 100644 index 00000000..05f70412 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/contenttypes/views.pyi @@ -0,0 +1,8 @@ +from typing import Union + +from django.http.request import HttpRequest +from django.http.response import HttpResponseRedirect + +def shortcut( + request: HttpRequest, content_type_id: Union[int, str], object_id: Union[int, str] +) -> HttpResponseRedirect: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/forms.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/forms.pyi new file mode 100644 index 00000000..5146154d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/forms.pyi @@ -0,0 +1,7 @@ +from typing import Any + +from django import forms + +class FlatpageForm(forms.ModelForm): + url: Any = ... + def clean_url(self) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/middleware.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/middleware.pyi new file mode 100644 index 00000000..abb18f24 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/middleware.pyi @@ -0,0 +1,6 @@ +from django.core.handlers.wsgi import WSGIRequest +from django.http.response import HttpResponse +from django.utils.deprecation import MiddlewareMixin + +class FlatpageFallbackMiddleware(MiddlewareMixin): + def process_response(self, request: WSGIRequest, response: HttpResponse) -> HttpResponse: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/models.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/models.pyi new file mode 100644 index 00000000..330f3c77 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/models.pyi @@ -0,0 +1,13 @@ +from django.contrib.sites.models import Site + +from django.db import models + +class FlatPage(models.Model): + url: models.CharField = ... + title: models.CharField = ... + content: models.TextField = ... + enable_comments: models.BooleanField = ... + template_name: models.CharField = ... + registration_required: models.BooleanField = ... + sites: models.ManyToManyField[Site, Site] = ... + def get_absolute_url(self) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/sitemaps.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/sitemaps.pyi new file mode 100644 index 00000000..e6740837 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/sitemaps.pyi @@ -0,0 +1,3 @@ +from django.contrib.sitemaps import Sitemap + +class FlatPageSitemap(Sitemap): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/templatetags/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/templatetags/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/templatetags/flatpages.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/templatetags/flatpages.pyi new file mode 100644 index 00000000..e9be47e8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/templatetags/flatpages.pyi @@ -0,0 +1,16 @@ +from typing import Any, Optional + +from django import template +from django.template.base import Parser, Token +from django.template.context import Context + +register: Any + +class FlatpageNode(template.Node): + context_name: str = ... + starts_with: None = ... + user: None = ... + def __init__(self, context_name: str, starts_with: Optional[str] = ..., user: Optional[str] = ...) -> None: ... + def render(self, context: Context) -> str: ... + +def get_flatpages(parser: Parser, token: Token) -> FlatpageNode: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/urls.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/urls.pyi new file mode 100644 index 00000000..99cbb7c4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/urls.pyi @@ -0,0 +1,3 @@ +from typing import Any, List + +urlpatterns: List[Any] = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/views.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/views.pyi new file mode 100644 index 00000000..1d7e2b82 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/flatpages/views.pyi @@ -0,0 +1,8 @@ +from django.contrib.flatpages.models import FlatPage +from django.core.handlers.wsgi import WSGIRequest +from django.http.response import HttpResponse + +DEFAULT_TEMPLATE: str + +def flatpage(request: WSGIRequest, url: str) -> HttpResponse: ... +def render_flatpage(request: WSGIRequest, f: FlatPage) -> HttpResponse: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/gis/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/gis/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/gis/db/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/gis/db/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/gis/db/models/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/gis/db/models/__init__.pyi new file mode 100644 index 00000000..c930715f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/gis/db/models/__init__.pyi @@ -0,0 +1,13 @@ +from django.db.models import * + +from .fields import ( + GeometryField as GeometryField, + LineStringField as LineStringField, + MultiLineStringField as MultiLineStringField, + MultiPointField as MultiPointField, + MultiPolygonField as MultiPolygonField, + PointField as PointField, + PolygonField as PolygonField, + GeometryCollectionField as GeometryCollectionField, + RasterField as RasterField, +) diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/gis/db/models/fields.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/gis/db/models/fields.pyi new file mode 100644 index 00000000..ed2a6f43 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/gis/db/models/fields.pyi @@ -0,0 +1,91 @@ +from typing import Any, Iterable, NamedTuple, Optional, TypeVar, Union, Tuple + +from django.db.models.fields import Field, _ErrorMessagesToOverride, _FieldChoices, _ValidatorCallable + +_Connection = Any + +# __set__ value type +_ST = TypeVar("_ST") +# __get__ return type +_GT = TypeVar("_GT") + +class SRIDCacheEntry(NamedTuple): + units: Any + units_name: str + geodetic: bool + spheroid: str + +def get_srid_info(srid: int, connection: _Connection) -> SRIDCacheEntry: ... + +class BaseSpatialField(Field[_ST, _GT]): + def __init__( + self, + verbose_name: Optional[Union[str, bytes]] = ..., + srid: int = ..., + spatial_index: bool = ..., + name: Optional[str] = ..., + primary_key: bool = ..., + max_length: Optional[int] = ..., + unique: bool = ..., + blank: bool = ..., + null: bool = ..., + db_index: bool = ..., + default: Any = ..., + editable: bool = ..., + auto_created: bool = ..., + serialize: bool = ..., + unique_for_date: Optional[str] = ..., + unique_for_month: Optional[str] = ..., + unique_for_year: Optional[str] = ..., + choices: Optional[_FieldChoices] = ..., + help_text: str = ..., + db_column: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + validators: Iterable[_ValidatorCallable] = ..., + error_messages: Optional[_ErrorMessagesToOverride] = ..., + ): ... + def spheroid(self, connection: _Connection) -> str: ... + def units(self, connection: _Connection) -> Any: ... + def units_name(self, connection: _Connection) -> str: ... + def geodetic(self, connection: _Connection) -> bool: ... + +class GeometryField(BaseSpatialField): + def __init__( + self, + verbose_name: Optional[Union[str, bytes]] = ..., + dim: int = ..., + geography: bool = ..., + extent: Tuple[float, float, float, float] = ..., + tolerance: float = ..., + srid: int = ..., + spatial_index: bool = ..., + name: Optional[str] = ..., + primary_key: bool = ..., + max_length: Optional[int] = ..., + unique: bool = ..., + blank: bool = ..., + null: bool = ..., + db_index: bool = ..., + default: Any = ..., + editable: bool = ..., + auto_created: bool = ..., + serialize: bool = ..., + unique_for_date: Optional[str] = ..., + unique_for_month: Optional[str] = ..., + unique_for_year: Optional[str] = ..., + choices: Optional[_FieldChoices] = ..., + help_text: str = ..., + db_column: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + validators: Iterable[_ValidatorCallable] = ..., + error_messages: Optional[_ErrorMessagesToOverride] = ..., + ): ... + +class PointField(GeometryField): ... +class LineStringField(GeometryField): ... +class PolygonField(GeometryField): ... +class MultiPointField(GeometryField): ... +class MultiLineStringField(GeometryField): ... +class MultiPolygonField(GeometryField): ... +class GeometryCollectionField(GeometryField): ... +class RasterField(BaseSpatialField): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/humanize/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/humanize/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/humanize/templatetags/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/humanize/templatetags/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/humanize/templatetags/humanize.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/humanize/templatetags/humanize.pyi new file mode 100644 index 00000000..46bf6fc4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/humanize/templatetags/humanize.pyi @@ -0,0 +1,14 @@ +from datetime import date, datetime as datetime +from typing import Any, Optional, SupportsInt, Union + +register: Any + +def ordinal(value: Optional[Union[str, SupportsInt]]) -> Optional[str]: ... +def intcomma(value: Optional[Union[str, SupportsInt]], use_l10n: bool = ...) -> str: ... + +intword_converters: Any + +def intword(value: Optional[Union[str, SupportsInt]]) -> Optional[Union[int, str]]: ... +def apnumber(value: Optional[Union[str, SupportsInt]]) -> Optional[Union[int, str]]: ... +def naturalday(value: Optional[Union[date, str]], arg: None = ...) -> Optional[str]: ... +def naturaltime(value: datetime) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/__init__.pyi new file mode 100644 index 00000000..1ff9c7d0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/__init__.pyi @@ -0,0 +1,24 @@ +from .api import ( + get_level as get_level, + set_level as set_level, + add_message as add_message, + debug as debug, + error as error, + success as success, + get_messages as get_messages, + MessageFailure as MessageFailure, + info as info, + warning as warning, +) + +from .constants import ( + DEBUG as DEBUG, + DEFAULT_LEVELS as DEFAULT_LEVELS, + DEFAULT_TAGS as DEFAULT_TAGS, + ERROR as ERROR, + INFO as INFO, + SUCCESS as SUCCESS, + WARNING as WARNING, +) + +default_app_config: str = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/api.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/api.pyi new file mode 100644 index 00000000..7ad6d597 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/api.pyi @@ -0,0 +1,26 @@ +from typing import Any, List, Optional, Union + +from django.contrib.messages.storage.base import BaseStorage +from django.http.request import HttpRequest + +class MessageFailure(Exception): ... + +def add_message( + request: Optional[HttpRequest], + level: int, + message: str, + extra_tags: str = ..., + fail_silently: Union[bool, str] = ..., +) -> None: ... +def get_messages(request: HttpRequest) -> Union[List[Any], BaseStorage]: ... +def get_level(request: HttpRequest) -> int: ... +def set_level(request: HttpRequest, level: int) -> bool: ... +def debug(request: HttpRequest, message: str, extra_tags: str = ..., fail_silently: Union[bool, str] = ...) -> None: ... +def info(request: HttpRequest, message: str, extra_tags: str = ..., fail_silently: Union[bool, str] = ...) -> None: ... +def success( + request: HttpRequest, message: str, extra_tags: str = ..., fail_silently: Union[bool, str] = ... +) -> None: ... +def warning( + request: HttpRequest, message: str, extra_tags: str = ..., fail_silently: Union[bool, str] = ... +) -> None: ... +def error(request: HttpRequest, message: str, extra_tags: str = ..., fail_silently: Union[bool, str] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/constants.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/constants.pyi new file mode 100644 index 00000000..c0246de5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/constants.pyi @@ -0,0 +1,11 @@ +from typing import Dict + +DEBUG: int = ... +INFO: int = ... +SUCCESS: int = ... +WARNING: int = ... +ERROR: int = ... + +DEFAULT_TAGS: Dict[int, str] = ... + +DEFAULT_LEVELS: Dict[str, int] = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/context_processors.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/context_processors.pyi new file mode 100644 index 00000000..86528482 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/context_processors.pyi @@ -0,0 +1,6 @@ +from typing import Any, Dict, List, Union + +from django.contrib.messages.storage.base import BaseStorage +from django.http.request import HttpRequest + +def messages(request: HttpRequest) -> Dict[str, Union[Dict[str, int], List[Any], BaseStorage]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/middleware.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/middleware.pyi new file mode 100644 index 00000000..427f8d0a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/middleware.pyi @@ -0,0 +1,7 @@ +from django.http.request import HttpRequest +from django.http.response import HttpResponse +from django.utils.deprecation import MiddlewareMixin + +class MessageMiddleware(MiddlewareMixin): + def process_request(self, request: HttpRequest) -> None: ... + def process_response(self, request: HttpRequest, response: HttpResponse) -> HttpResponse: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/__init__.pyi new file mode 100644 index 00000000..a98ba21b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/__init__.pyi @@ -0,0 +1,6 @@ +from typing import Any, Optional + +from django.contrib.messages.storage.base import BaseStorage +from django.http.request import HttpRequest + +def default_storage(request: HttpRequest) -> BaseStorage: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/base.pyi new file mode 100644 index 00000000..d6a7163e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/base.pyi @@ -0,0 +1,28 @@ +from typing import Any, List, Optional + +from django.http.request import HttpRequest +from django.http.response import HttpResponseBase + +LEVEL_TAGS: Any + +class Message: + level: int = ... + message: str = ... + extra_tags: str = ... + def __init__(self, level: int, message: str, extra_tags: Optional[str] = ...) -> None: ... + @property + def tags(self) -> str: ... + @property + def level_tag(self) -> str: ... + +class BaseStorage: + request: HttpRequest = ... + used: bool = ... + added_new: bool = ... + def __init__(self, request: HttpRequest, *args: Any, **kwargs: Any) -> None: ... + def __len__(self) -> int: ... + def __iter__(self): ... + def __contains__(self, item: Any): ... + def update(self, response: HttpResponseBase) -> Optional[List[Message]]: ... + def add(self, level: int, message: str, extra_tags: Optional[str] = ...) -> None: ... + level: Any = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/cookie.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/cookie.pyi new file mode 100644 index 00000000..8f267389 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/cookie.pyi @@ -0,0 +1,20 @@ +import json +from typing import Any + +from django.contrib.messages.storage.base import BaseStorage + +class MessageEncoder(json.JSONEncoder): + allow_nan: bool + check_circular: bool + ensure_ascii: bool + skipkeys: bool + sort_keys: bool + message_key: str = ... + +class MessageDecoder(json.JSONDecoder): + def process_messages(self, obj: Any) -> Any: ... + +class CookieStorage(BaseStorage): + cookie_name: str = ... + max_cookie_size: int = ... + not_finished: str = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/fallback.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/fallback.pyi new file mode 100644 index 00000000..b6e0d49b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/fallback.pyi @@ -0,0 +1,8 @@ +from typing import Any + +from django.contrib.messages.storage.base import BaseStorage + +class FallbackStorage(BaseStorage): + storage_classes: Any = ... + storages: Any = ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/session.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/session.pyi new file mode 100644 index 00000000..8ba62819 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/storage/session.pyi @@ -0,0 +1,10 @@ +from typing import Any, List, Optional, Sequence, Union + +from django.contrib.messages.storage.base import BaseStorage +from django.http.request import HttpRequest + +class SessionStorage(BaseStorage): + session_key: str = ... + def __init__(self, request: HttpRequest, *args: Any, **kwargs: Any) -> None: ... + def serialize_messages(self, messages: Sequence[Any]) -> str: ... + def deserialize_messages(self, data: Optional[Union[List[Any], str]]) -> Optional[List[Any]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/utils.pyi new file mode 100644 index 00000000..1f29b13a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/utils.pyi @@ -0,0 +1,3 @@ +from typing import Dict + +def get_level_tags() -> Dict[int, str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/views.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/views.pyi new file mode 100644 index 00000000..344a9654 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/messages/views.pyi @@ -0,0 +1,9 @@ +from typing import Dict + +from django.forms.forms import BaseForm +from django.http.response import HttpResponse + +class SuccessMessageMixin: + success_message: str = ... + def form_valid(self, form: BaseForm) -> HttpResponse: ... + def get_success_message(self, cleaned_data: Dict[str, str]) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/__init__.pyi new file mode 100644 index 00000000..8fad9ee6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/__init__.pyi @@ -0,0 +1,24 @@ +from .general import ( + ArrayAgg as ArrayAgg, + BitAnd as BitAnd, + BitOr as BitOr, + BoolAnd as BoolAnd, + BoolOr as BoolOr, + JSONBAgg as JSONBAgg, + StringAgg as StringAgg, +) + +from .statistics import ( + Corr as Corr, + CovarPop as CovarPop, + RegrAvgX as RegrAvgX, + RegrAvgY as RegrAvgY, + RegrCount as RegrCount, + RegrIntercept as RegrIntercept, + RegrR2 as RegrR2, + RegrSlope as RegrSlope, + RegrSXX as RegrSXX, + RegrSXY as RegrSXY, + RegrSYY as RegrSYY, + StatAggregate as StatAggregate, +) diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/general.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/general.pyi new file mode 100644 index 00000000..ebbda3eb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/general.pyi @@ -0,0 +1,11 @@ +from django.db.models.aggregates import Aggregate + +from .mixins import OrderableAggMixin + +class ArrayAgg(OrderableAggMixin, Aggregate): ... +class BitAnd(Aggregate): ... +class BitOr(Aggregate): ... +class BoolAnd(Aggregate): ... +class BoolOr(Aggregate): ... +class JSONBAgg(Aggregate): ... +class StringAgg(OrderableAggMixin, Aggregate): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/mixins.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/mixins.pyi new file mode 100644 index 00000000..538ba87c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/mixins.pyi @@ -0,0 +1 @@ +class OrderableAggMixin: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/statistics.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/statistics.pyi new file mode 100644 index 00000000..9e7d1380 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/aggregates/statistics.pyi @@ -0,0 +1,14 @@ +from django.db.models.aggregates import Aggregate + +class StatAggregate(Aggregate): ... +class Corr(StatAggregate): ... +class CovarPop(StatAggregate): ... +class RegrAvgX(StatAggregate): ... +class RegrAvgY(StatAggregate): ... +class RegrCount(StatAggregate): ... +class RegrIntercept(StatAggregate): ... +class RegrR2(StatAggregate): ... +class RegrSlope(StatAggregate): ... +class RegrSXX(StatAggregate): ... +class RegrSXY(StatAggregate): ... +class RegrSYY(StatAggregate): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/constraints.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/constraints.pyi new file mode 100644 index 00000000..b2e96050 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/constraints.pyi @@ -0,0 +1,18 @@ +from typing import Optional, Sequence, Tuple, Union + +from django.db.models.constraints import BaseConstraint +from django.db.models.expressions import Combinable +from django.db.models.query_utils import Q + +class ExclusionConstraint(BaseConstraint): + expressions: Sequence[Tuple[Union[str, Combinable], str]] + index_type: str + condition: Optional[Q] + def __init__( + self, + *, + name: str, + expressions: Sequence[Tuple[Union[str, Combinable], str]], + condition: Optional[Q] = ..., + index_type: Optional[str] = ..., + ): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/__init__.pyi new file mode 100644 index 00000000..6ad3e200 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/__init__.pyi @@ -0,0 +1,20 @@ +from .array import ArrayField as ArrayField +from .jsonb import JSONField as JSONField, JsonAdapter as JsonAdapter +from .ranges import ( + RangeField as RangeField, + IntegerRangeField as IntegerRangeField, + BigIntegerRangeField as BigIntegerRangeField, + DecimalRangeField as DecimalRangeField, + FloatRangeField as FloatRangeField, + DateRangeField as DateRangeField, + DateTimeRangeField as DateTimeRangeField, + RangeOperators as RangeOperators, + RangeBoundary as RangeBoundary, +) +from .hstore import HStoreField as HStoreField +from .citext import ( + CICharField as CICharField, + CIEmailField as CIEmailField, + CIText as CIText, + CITextField as CITextField, +) diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/array.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/array.pyi new file mode 100644 index 00000000..a69b0918 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/array.pyi @@ -0,0 +1,51 @@ +from typing import Any, Iterable, List, Optional, Sequence, TypeVar, Union + +from django.db.models.expressions import Combinable +from django.db.models.fields import Field, _ErrorMessagesToOverride, _FieldChoices, _ValidatorCallable + +from .mixins import CheckFieldDefaultMixin + +# __set__ value type +_ST = TypeVar("_ST") +# __get__ return type +_GT = TypeVar("_GT") + +class ArrayField(CheckFieldDefaultMixin, Field[_ST, _GT]): + _pyi_private_set_type: Union[Sequence[Any], Combinable] + _pyi_private_get_type: List[Any] + + empty_strings_allowed: bool = ... + default_error_messages: Any = ... + base_field: Any = ... + size: Any = ... + default_validators: Any = ... + from_db_value: Any = ... + def __init__( + self, + base_field: Field, + size: Optional[int] = ..., + verbose_name: Optional[Union[str, bytes]] = ..., + name: Optional[str] = ..., + primary_key: bool = ..., + max_length: Optional[int] = ..., + unique: bool = ..., + blank: bool = ..., + null: bool = ..., + db_index: bool = ..., + default: Any = ..., + editable: bool = ..., + auto_created: bool = ..., + serialize: bool = ..., + unique_for_date: Optional[str] = ..., + unique_for_month: Optional[str] = ..., + unique_for_year: Optional[str] = ..., + choices: Optional[_FieldChoices] = ..., + help_text: str = ..., + db_column: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + validators: Iterable[_ValidatorCallable] = ..., + error_messages: Optional[_ErrorMessagesToOverride] = ..., + ) -> None: ... + @property + def description(self): ... + def get_transform(self, name: Any): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/citext.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/citext.pyi new file mode 100644 index 00000000..e0fbfcb5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/citext.pyi @@ -0,0 +1,6 @@ +from django.db.models.fields import CharField, EmailField, TextField + +class CIText: ... +class CICharField(CIText, CharField): ... +class CIEmailField(CIText, EmailField): ... +class CITextField(CIText, TextField): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/hstore.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/hstore.pyi new file mode 100644 index 00000000..e94ea6a4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/hstore.pyi @@ -0,0 +1,17 @@ +from typing import Any + +from django.db.models import Field, Transform +from .mixins import CheckFieldDefaultMixin + +class HStoreField(CheckFieldDefaultMixin, Field): + def get_transform(self, name) -> Any: ... + +class KeyTransform(Transform): + def __init__(self, key_name: str, *args: Any, **kwargs: Any): ... + +class KeyTransformFactory: + def __init__(self, key_name: str): ... + def __call__(self, *args, **kwargs) -> KeyTransform: ... + +class KeysTransform(Transform): ... +class ValuesTransform(Transform): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/jsonb.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/jsonb.pyi new file mode 100644 index 00000000..48f00984 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/jsonb.pyi @@ -0,0 +1,32 @@ +from json import JSONEncoder +from typing import Any, Optional, Type + +from django.db.models import Field +from django.db.models.lookups import Transform +from .mixins import CheckFieldDefaultMixin + +class JsonAdapter: + encoder: Any = ... + def __init__(self, adapted: Any, dumps: Optional[Any] = ..., encoder: Optional[Any] = ...) -> None: ... + def dumps(self, obj: Any): ... + +class JSONField(CheckFieldDefaultMixin, Field): + empty_strings_allowed: bool = ... + description: Any = ... + default_error_messages: Any = ... + encoder: Any = ... + def __init__( + self, + verbose_name: Optional[str] = ..., + name: Optional[str] = ..., + encoder: Optional[Type[JSONEncoder]] = ..., + **kwargs: Any + ) -> None: ... + def value_to_string(self, obj: Any): ... + +class KeyTransform(Transform): + operator: str = ... + nested_operator: str = ... + def __init__(self, key_name: str, *args: Any, **kwargs: Any) -> None: ... + +class KeyTextTransform(KeyTransform): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/mixins.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/mixins.pyi new file mode 100644 index 00000000..c6e77c68 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/mixins.pyi @@ -0,0 +1,4 @@ +from typing import Any, List + +class CheckFieldDefaultMixin: + def check(self, **kwargs: Any) -> List[Any]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/ranges.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/ranges.pyi new file mode 100644 index 00000000..eb8eeb09 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/fields/ranges.pyi @@ -0,0 +1,48 @@ +from typing import Any + +from django.db import models + +from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange # type: ignore + +class RangeField(models.Field): + empty_strings_allowed: bool = ... + base_field: Any = ... + range_type: Any = ... + def get_prep_value(self, value: Any): ... + def to_python(self, value: Any): ... + def value_to_string(self, obj: Any): ... + +class IntegerRangeField(RangeField): + def __get__(self, instance, owner) -> NumericRange: ... + +class BigIntegerRangeField(RangeField): + def __get__(self, instance, owner) -> NumericRange: ... + +class DecimalRangeField(RangeField): + def __get__(self, instance, owner) -> NumericRange: ... + +class FloatRangeField(RangeField): + def __get__(self, instance, owner) -> NumericRange: ... + +class DateTimeRangeField(RangeField): + def __get__(self, instance, owner) -> DateTimeTZRange: ... + +class DateRangeField(RangeField): + def __get__(self, instance, owner) -> DateRange: ... + +class RangeOperators: + EQUAL: str + NOT_EQUAL: str + CONTAINS: str + CONTAINED_BY: str + OVERLAPS: str + FULLY_LT: str + FULLY_GT: str + NOT_LT: str + NOT_GT: str + ADJACENT_TO: str + +class RangeBoundary(models.Expression): + lower: str + upper: str + def __init__(self, inclusive_lower: bool = ..., inclusive_upper: bool = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/functions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/functions.pyi new file mode 100644 index 00000000..414a0998 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/functions.pyi @@ -0,0 +1,4 @@ +from django.db.models import Func + +class RandomUUID(Func): ... +class TransactionNow(Func): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/indexes.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/indexes.pyi new file mode 100644 index 00000000..c2410e0b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/indexes.pyi @@ -0,0 +1,82 @@ +from typing import Optional, Sequence + +from django.db.models.query_utils import Q + +from django.db.models import Index + +class PostgresIndex(Index): ... + +class BrinIndex(PostgresIndex): + def __init__( + self, + *, + autosummarize: Optional[bool] = ..., + pages_per_range: Optional[int] = ..., + fields: Sequence[str] = ..., + name: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + opclasses: Sequence[str] = ..., + condition: Optional[Q] = ... + ) -> None: ... + +class BTreeIndex(PostgresIndex): + def __init__( + self, + *, + fillfactor: Optional[int] = ..., + fields: Sequence[str] = ..., + name: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + opclasses: Sequence[str] = ..., + condition: Optional[Q] = ... + ) -> None: ... + +class GinIndex(PostgresIndex): + def __init__( + self, + *, + fastupdate: Optional[bool] = ..., + gin_pending_list_limit: Optional[int] = ..., + fields: Sequence[str] = ..., + name: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + opclasses: Sequence[str] = ..., + condition: Optional[Q] = ... + ) -> None: ... + +class GistIndex(PostgresIndex): + def __init__( + self, + *, + buffering: Optional[bool] = ..., + fillfactor: Optional[int] = ..., + fields: Sequence[str] = ..., + name: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + opclasses: Sequence[str] = ..., + condition: Optional[Q] = ... + ) -> None: ... + +class HashIndex(PostgresIndex): + def __init__( + self, + *, + fillfactor: Optional[int] = ..., + fields: Sequence[str] = ..., + name: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + opclasses: Sequence[str] = ..., + condition: Optional[Q] = ... + ) -> None: ... + +class SpGistIndex(PostgresIndex): + def __init__( + self, + *, + fillfactor: Optional[int] = ..., + fields: Sequence[str] = ..., + name: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + opclasses: Sequence[str] = ..., + condition: Optional[Q] = ... + ) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/lookups.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/lookups.pyi new file mode 100644 index 00000000..79c0a1bc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/lookups.pyi @@ -0,0 +1,18 @@ +from django.db.models.lookups import Exact + +from django.db.models import Lookup, Transform +from .search import SearchVectorExact + +class PostgresSimpleLookup(Lookup): + operator: str + +class DataContains(PostgresSimpleLookup): ... +class ContainedBy(PostgresSimpleLookup): ... +class Overlap(PostgresSimpleLookup): ... +class HasKey(PostgresSimpleLookup): ... +class HasKeys(PostgresSimpleLookup): ... +class HasAnyKeys(HasKeys): ... +class Unaccent(Transform): ... +class SearchLookup(SearchVectorExact): ... +class TrigramSimilar(PostgresSimpleLookup): ... +class JSONExact(Exact): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/operations.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/operations.pyi new file mode 100644 index 00000000..94fb10a8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/operations.pyi @@ -0,0 +1,27 @@ +from django.db.migrations.operations.base import Operation + +class CreateExtension(Operation): + reversible: bool = ... + name: str = ... + def __init__(self, name: str) -> None: ... + +class BtreeGinExtension(CreateExtension): + def __init__(self) -> None: ... + +class BtreeGistExtension(CreateExtension): + def __init__(self) -> None: ... + +class CITextExtension(CreateExtension): + def __init__(self) -> None: ... + +class CryptoExtension(CreateExtension): + def __init__(self) -> None: ... + +class HStoreExtension(CreateExtension): + def __init__(self) -> None: ... + +class TrigramExtension(CreateExtension): + def __init__(self) -> None: ... + +class UnaccentExtension(CreateExtension): + def __init__(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/search.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/search.pyi new file mode 100644 index 00000000..69f522af --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/search.pyi @@ -0,0 +1,63 @@ +from typing import Any, Dict, Optional, TypeVar, Union + +from django.db.models.expressions import Combinable, CombinedExpression, Func, Value, _OutputField +from django.db.models.lookups import Lookup + +from django.db.models import Field + +_Expression = Union[str, Combinable, "SearchQueryCombinable"] + +class SearchVectorExact(Lookup): ... +class SearchVectorField(Field): ... +class SearchQueryField(Field): ... + +class SearchVectorCombinable: + ADD: str = ... + +class SearchVector(SearchVectorCombinable, Func): + config: Optional[Any] = ... + def __init__(self, *expressions: _Expression, **extra: Any): ... + +class CombinedSearchVector(SearchVectorCombinable, CombinedExpression): + def __init__( + self, lhs, connector, rhs, config: Optional[_Expression] = ..., output_field: Optional[_OutputField] = ... + ): ... + +_T = TypeVar("_T", bound="SearchQueryCombinable") + +class SearchQueryCombinable: + BITAND: str = ... + BITOR: str = ... + def __or__(self: _T, other: SearchQueryCombinable) -> _T: ... + def __ror__(self: _T, other: SearchQueryCombinable) -> _T: ... + def __and__(self: _T, other: SearchQueryCombinable) -> _T: ... + def __rand__(self: _T, other: SearchQueryCombinable) -> _T: ... + +class SearchQuery(SearchQueryCombinable, Value): # type: ignore + SEARCH_TYPES: Dict[str, str] = ... + def __init__( + self, + value: str, + output_field: Optional[_OutputField] = ..., + *, + config: Optional[_Expression] = ..., + invert: bool = ..., + search_type: str = ... + ): ... + def __invert__(self: _T) -> _T: ... + +class CombinedSearchQuery(SearchQueryCombinable, CombinedExpression): # type: ignore + def __init__( + self, lhs, connector, rhs, config: Optional[_Expression] = ..., output_field: Optional[_OutputField] = ... + ) -> None: ... + +class SearchRank(Func): + def __init__( + self, vector: Union[SearchVector, _Expression], query: Union[SearchQuery, _Expression], **extra: Any + ) -> None: ... + +class TrigramBase(Func): + def __init__(self, expression: _Expression, string, **extra: Any) -> None: ... + +class TrigramSimilarity(TrigramBase): ... +class TrigramDistance(TrigramBase): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/signals.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/signals.pyi new file mode 100644 index 00000000..e3475a90 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/signals.pyi @@ -0,0 +1,5 @@ +from typing import Any, Tuple + +def get_hstore_oids(connection_alias: str) -> Tuple[Any, ...]: ... +def get_citext_oids(connection_alias: str) -> Tuple[Any, ...]: ... +def register_type_handlers(connection: Any, **kwargs: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/validators.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/validators.pyi new file mode 100644 index 00000000..00ad4ff7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/postgres/validators.pyi @@ -0,0 +1,17 @@ +from typing import Any, Dict, Iterable, Mapping, Optional + +from django.core.validators import MaxLengthValidator, MaxValueValidator, MinLengthValidator, MinValueValidator + +class ArrayMaxLengthValidator(MaxLengthValidator): ... +class ArrayMinLengthValidator(MinLengthValidator): ... + +class KeysValidator: + messages: Dict[str, str] = ... + strict: bool = ... + def __init__( + self, keys: Iterable[str], strict: bool = ..., messages: Optional[Mapping[str, str]] = ... + ) -> None: ... + def __call__(self, value: Any) -> None: ... + +class RangeMaxValueValidator(MaxValueValidator): ... +class RangeMinValueValidator(MinValueValidator): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/redirects/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/redirects/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/redirects/middleware.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/redirects/middleware.pyi new file mode 100644 index 00000000..10b83047 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/redirects/middleware.pyi @@ -0,0 +1,10 @@ +from typing import Any + +from django.http.request import HttpRequest +from django.http.response import HttpResponse +from django.utils.deprecation import MiddlewareMixin + +class RedirectFallbackMiddleware(MiddlewareMixin): + response_gone_class: Any = ... + response_redirect_class: Any = ... + def process_response(self, request: HttpRequest, response: HttpResponse) -> HttpResponse: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/redirects/models.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/redirects/models.pyi new file mode 100644 index 00000000..b732632d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/redirects/models.pyi @@ -0,0 +1,6 @@ +from django.db import models + +class Redirect(models.Model): + site: models.ForeignKey = ... + old_path: models.CharField = ... + new_path: models.CharField = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/base.pyi new file mode 100644 index 00000000..5fcb05e8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/base.pyi @@ -0,0 +1,40 @@ +from datetime import datetime +from typing import Any, Dict, Optional, Union + +VALID_KEY_CHARS: Any + +class CreateError(Exception): ... +class UpdateError(Exception): ... + +class SessionBase(Dict[str, Any]): + TEST_COOKIE_NAME: str = ... + TEST_COOKIE_VALUE: str = ... + accessed: bool = ... + modified: bool = ... + serializer: Any = ... + def __init__(self, session_key: Optional[str] = ...) -> None: ... + def set_test_cookie(self) -> None: ... + def test_cookie_worked(self) -> bool: ... + def delete_test_cookie(self) -> None: ... + def encode(self, session_dict: Dict[str, Any]) -> str: ... + def decode(self, session_data: Union[bytes, str]) -> Dict[str, Any]: ... + def has_key(self, key: Any): ... + def keys(self): ... + def values(self): ... + def items(self): ... + def clear(self) -> None: ... + def is_empty(self) -> bool: ... + session_key: Any = ... + def get_expiry_age(self, **kwargs: Any) -> int: ... + def get_expiry_date(self, **kwargs: Any) -> datetime: ... + def set_expiry(self, value: Optional[Union[datetime, int]]) -> None: ... + def get_expire_at_browser_close(self) -> bool: ... + def flush(self) -> None: ... + def cycle_key(self) -> None: ... + def exists(self, session_key: str) -> bool: ... + def create(self) -> None: ... + def save(self, must_create: bool = ...) -> None: ... + def delete(self, session_key: Optional[Any] = ...) -> None: ... + def load(self) -> Dict[str, Any]: ... + @classmethod + def clear_expired(cls) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/cache.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/cache.pyi new file mode 100644 index 00000000..865393b1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/cache.pyi @@ -0,0 +1,11 @@ +from typing import Any, Optional + +from django.contrib.sessions.backends.base import SessionBase + +KEY_PREFIX: str + +class SessionStore(SessionBase): + cache_key_prefix: Any = ... + def __init__(self, session_key: Optional[str] = ...) -> None: ... + @property + def cache_key(self) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/cached_db.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/cached_db.pyi new file mode 100644 index 00000000..b49ef906 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/cached_db.pyi @@ -0,0 +1,11 @@ +from typing import Any, Optional + +from django.contrib.sessions.backends.db import SessionStore as DBStore + +KEY_PREFIX: str + +class SessionStore(DBStore): + cache_key_prefix: Any = ... + def __init__(self, session_key: Optional[str] = ...) -> None: ... + @property + def cache_key(self) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/db.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/db.pyi new file mode 100644 index 00000000..ff53e434 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/db.pyi @@ -0,0 +1,13 @@ +from typing import Dict, Optional, Type + +from django.contrib.sessions.backends.base import SessionBase +from django.contrib.sessions.base_session import AbstractBaseSession +from django.contrib.sessions.models import Session +from django.db.models.base import Model + +class SessionStore(SessionBase): + def __init__(self, session_key: Optional[str] = ...) -> None: ... + @classmethod + def get_model_class(cls) -> Type[Session]: ... + def model(self) -> Type[AbstractBaseSession]: ... + def create_model_instance(self, data: Dict[str, Model]) -> AbstractBaseSession: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/file.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/file.pyi new file mode 100644 index 00000000..96e20463 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/file.pyi @@ -0,0 +1,9 @@ +from typing import Optional + +from django.contrib.sessions.backends.base import SessionBase + +class SessionStore(SessionBase): + storage_path: str = ... + file_prefix: str = ... + def __init__(self, session_key: Optional[str] = ...) -> None: ... + def clean(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/signed_cookies.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/signed_cookies.pyi new file mode 100644 index 00000000..f82ead57 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/backends/signed_cookies.pyi @@ -0,0 +1,3 @@ +from django.contrib.sessions.backends.base import SessionBase + +class SessionStore(SessionBase): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/base_session.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/base_session.pyi new file mode 100644 index 00000000..1578fa7e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/base_session.pyi @@ -0,0 +1,19 @@ +from datetime import datetime +from typing import Any, Dict, Optional, Type + +from django.contrib.sessions.backends.base import SessionBase + +from django.db import models + +class BaseSessionManager(models.Manager): + def encode(self, session_dict: Dict[str, int]) -> str: ... + def save(self, session_key: str, session_dict: Dict[str, int], expire_date: datetime) -> AbstractBaseSession: ... + +class AbstractBaseSession(models.Model): + expire_date: datetime + session_data: str + session_key: str + objects: Any = ... + @classmethod + def get_session_store_class(cls) -> Optional[Type[SessionBase]]: ... + def get_decoded(self) -> Dict[str, int]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/exceptions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/exceptions.pyi new file mode 100644 index 00000000..9ec91907 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/exceptions.pyi @@ -0,0 +1,4 @@ +from django.core.exceptions import SuspiciousOperation + +class InvalidSessionKey(SuspiciousOperation): ... +class SuspiciousSession(SuspiciousOperation): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/management/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/management/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/management/commands/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/management/commands/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/management/commands/clearsessions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/management/commands/clearsessions.pyi new file mode 100644 index 00000000..8d75fb4d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/management/commands/clearsessions.pyi @@ -0,0 +1,3 @@ +from django.core.management.base import BaseCommand + +class Command(BaseCommand): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/middleware.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/middleware.pyi new file mode 100644 index 00000000..0e29b8d2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/middleware.pyi @@ -0,0 +1,11 @@ +from typing import Type + +from django.contrib.sessions.backends.base import SessionBase +from django.http.request import HttpRequest +from django.http.response import HttpResponse +from django.utils.deprecation import MiddlewareMixin + +class SessionMiddleware(MiddlewareMixin): + SessionStore: Type[SessionBase] = ... + def process_request(self, request: HttpRequest) -> None: ... + def process_response(self, request: HttpRequest, response: HttpResponse) -> HttpResponse: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/models.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/models.pyi new file mode 100644 index 00000000..08b30ef6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/models.pyi @@ -0,0 +1,4 @@ +from django.contrib.sessions.base_session import AbstractBaseSession, BaseSessionManager + +class SessionManager(BaseSessionManager): ... +class Session(AbstractBaseSession): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/serializers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/serializers.pyi new file mode 100644 index 00000000..5c0eb15a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sessions/serializers.pyi @@ -0,0 +1,10 @@ +from typing import Dict + +from django.core.signing import JSONSerializer as BaseJSONSerializer +from django.db.models.base import Model + +class PickleSerializer: + def dumps(self, obj: Dict[str, Model]) -> bytes: ... + def loads(self, data: bytes) -> Dict[str, Model]: ... + +JSONSerializer = BaseJSONSerializer diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/__init__.pyi new file mode 100644 index 00000000..3ffc9533 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/__init__.pyi @@ -0,0 +1,50 @@ +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Protocol + +from django.contrib.sites.models import Site +from django.contrib.sites.requests import RequestSite +from django.core.paginator import Paginator +from django.db.models.base import Model +from django.db.models.query import QuerySet + +PING_URL: str + +class SitemapNotFound(Exception): ... + +def ping_google(sitemap_url: Optional[str] = ..., ping_url: str = ...) -> None: ... + +class _SupportsLen(Protocol): + def __len__(self) -> int: ... + +class _SupportsCount(Protocol): + def count(self) -> int: ... + +class _SupportsOrdered(Protocol): + ordered: bool = ... + +class Sitemap: + limit: int = ... + protocol: Optional[str] = ... + def items(self) -> Union[_SupportsLen, _SupportsCount, _SupportsOrdered]: ... + def location(self, obj: Model) -> str: ... + @property + def paginator(self) -> Paginator: ... + def get_urls( + self, page: Union[int, str] = ..., site: Optional[Union[Site, RequestSite]] = ..., protocol: Optional[str] = ... + ) -> List[Dict[str, Any]]: ... + +class GenericSitemap(Sitemap): + priority: Optional[float] = ... + changefreq: Optional[str] = ... + queryset: QuerySet = ... + date_field: None = ... + def __init__( + self, + info_dict: Dict[str, Union[datetime, QuerySet, str]], + priority: Optional[float] = ..., + changefreq: Optional[str] = ..., + protocol: Optional[str] = ..., + ) -> None: ... + def lastmod(self, item: Model) -> Optional[datetime]: ... + +default_app_config: str diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/management/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/management/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/management/commands/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/management/commands/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/management/commands/ping_google.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/management/commands/ping_google.pyi new file mode 100644 index 00000000..8d75fb4d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/management/commands/ping_google.pyi @@ -0,0 +1,3 @@ +from django.core.management.base import BaseCommand + +class Command(BaseCommand): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/views.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/views.pyi new file mode 100644 index 00000000..fb7a639c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sitemaps/views.pyi @@ -0,0 +1,23 @@ +from collections import OrderedDict +from typing import Callable, Dict, Optional, Type, Union + +from django.http.request import HttpRequest +from django.template.response import TemplateResponse + +from django.contrib.sitemaps import GenericSitemap, Sitemap + +def x_robots_tag(func: Callable) -> Callable: ... +def index( + request: HttpRequest, + sitemaps: Dict[str, Union[Type[Sitemap], Sitemap]], + template_name: str = ..., + content_type: str = ..., + sitemap_url_name: str = ..., +) -> TemplateResponse: ... +def sitemap( + request: HttpRequest, + sitemaps: Union[Dict[str, Type[Sitemap]], Dict[str, GenericSitemap], OrderedDict], + section: Optional[str] = ..., + template_name: str = ..., + content_type: str = ..., +) -> TemplateResponse: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/apps.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/apps.pyi new file mode 100644 index 00000000..75db9afd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/apps.pyi @@ -0,0 +1,3 @@ +from django.apps import AppConfig + +class SitesConfig(AppConfig): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/management.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/management.pyi new file mode 100644 index 00000000..822f4793 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/management.pyi @@ -0,0 +1,13 @@ +from typing import Any + +from django.apps.config import AppConfig +from django.apps.registry import Apps + +def create_default_site( + app_config: AppConfig, + verbosity: int = ..., + interactive: bool = ..., + using: str = ..., + apps: Apps = ..., + **kwargs: Any +) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/managers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/managers.pyi new file mode 100644 index 00000000..45ae26d4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/managers.pyi @@ -0,0 +1,6 @@ +from typing import Optional + +from django.db import models + +class CurrentSiteManager(models.Manager): + def __init__(self, field_name: Optional[str] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/middleware.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/middleware.pyi new file mode 100644 index 00000000..018bd5f7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/middleware.pyi @@ -0,0 +1,5 @@ +from django.http.request import HttpRequest +from django.utils.deprecation import MiddlewareMixin + +class CurrentSiteMiddleware(MiddlewareMixin): + def process_request(self, request: HttpRequest) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/models.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/models.pyi new file mode 100644 index 00000000..385c35d7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/models.pyi @@ -0,0 +1,21 @@ +from typing import Any, Optional, Tuple, Type + +from django.http.request import HttpRequest + +from django.db import models + +SITE_CACHE: Any + +class SiteManager(models.Manager["Site"]): + def get_current(self, request: Optional[HttpRequest] = ...) -> Site: ... + def clear_cache(self) -> None: ... + def get_by_natural_key(self, domain: str) -> Site: ... + +class Site(models.Model): + objects: SiteManager + + domain = models.CharField(max_length=100) + name = models.CharField(max_length=50) + def natural_key(self) -> Tuple[str]: ... + +def clear_site_cache(sender: Type[Site], **kwargs: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/requests.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/requests.pyi new file mode 100644 index 00000000..6a638b60 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/requests.pyi @@ -0,0 +1,10 @@ +from typing import Any + +from django.http.request import HttpRequest + +class RequestSite: + name: str + domain: str = ... + def __init__(self, request: HttpRequest) -> None: ... + def save(self, force_insert: bool = ..., force_update: bool = ...) -> Any: ... + def delete(self) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/shortcuts.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/shortcuts.pyi new file mode 100644 index 00000000..6938e6f9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/sites/shortcuts.pyi @@ -0,0 +1,7 @@ +from typing import Optional, Union + +from django.contrib.sites.models import Site +from django.contrib.sites.requests import RequestSite +from django.http.request import HttpRequest + +def get_current_site(request: Optional[HttpRequest]) -> Union[Site, RequestSite]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/apps.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/apps.pyi new file mode 100644 index 00000000..e2787b84 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/apps.pyi @@ -0,0 +1,6 @@ +from typing import Any + +from django.apps import AppConfig + +class StaticFilesConfig(AppConfig): + ignore_patterns: Any = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/checks.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/checks.pyi new file mode 100644 index 00000000..dccf572f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/checks.pyi @@ -0,0 +1,7 @@ +from typing import Any, List, Iterable, Optional + +from django.core.checks.messages import Error + +from django.apps.config import AppConfig + +def check_finders(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[Error]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/finders.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/finders.pyi new file mode 100644 index 00000000..8645a29e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/finders.pyi @@ -0,0 +1,43 @@ +from typing import Any, Iterable, Iterator, List, Mapping, Optional, Union, overload + +from django.core.checks.messages import Error +from django.core.files.storage import Storage +from typing_extensions import Literal + +searched_locations: Any + +class BaseFinder: + def check(self, **kwargs: Any) -> List[Error]: ... + def find(self, path: str, all: bool = ...) -> Optional[Any]: ... + def list(self, ignore_patterns: Any) -> Iterable[Any]: ... + +class FileSystemFinder(BaseFinder): + locations: List[Any] = ... + storages: Mapping[str, Any] = ... + def __init__(self, app_names: None = ..., *args: Any, **kwargs: Any) -> None: ... + def find_location(self, root: str, path: str, prefix: str = ...) -> Optional[str]: ... + +class AppDirectoriesFinder(BaseFinder): + storage_class: Any = ... + source_dir: str = ... + apps: List[str] = ... + storages: Mapping[str, Any] = ... + def __init__(self, app_names: None = ..., *args: Any, **kwargs: Any) -> None: ... + def find_in_app(self, app: str, path: str) -> Optional[str]: ... + +class BaseStorageFinder(BaseFinder): + storage: Storage = ... + def __init__(self, storage: Optional[Storage] = ..., *args: Any, **kwargs: Any) -> None: ... + +class DefaultStorageFinder(BaseStorageFinder): ... + +def find(path: str, all: bool = ...) -> Optional[Union[List[str], str]]: ... +def get_finders() -> Iterator[BaseFinder]: ... +@overload +def get_finder(import_path: Literal["django.contrib.staticfiles.finders.FileSystemFinder"]) -> FileSystemFinder: ... +@overload +def get_finder( + import_path: Literal["django.contrib.staticfiles.finders.AppDirectoriesFinder"], +) -> AppDirectoriesFinder: ... +@overload +def get_finder(import_path: str) -> BaseFinder: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/handlers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/handlers.pyi new file mode 100644 index 00000000..11c6b9cc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/handlers.pyi @@ -0,0 +1,12 @@ +from typing import Any + +from django.core.handlers.wsgi import WSGIHandler, WSGIRequest + +class StaticFilesHandler(WSGIHandler): + handles_files: bool = ... + application: WSGIHandler = ... + base_url: Any = ... + def __init__(self, application: WSGIHandler) -> None: ... + def get_base_url(self) -> str: ... + def file_path(self, url: str) -> str: ... + def serve(self, request: WSGIRequest) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/collectstatic.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/collectstatic.pyi new file mode 100644 index 00000000..cfad24bf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/collectstatic.pyi @@ -0,0 +1,28 @@ +from typing import Any, Dict, List + +from django.core.files.storage import Storage +from django.core.management.base import BaseCommand + +class Command(BaseCommand): + copied_files: Any = ... + symlinked_files: Any = ... + unmodified_files: Any = ... + post_processed_files: Any = ... + storage: Any = ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def local(self) -> bool: ... + interactive: Any = ... + verbosity: Any = ... + symlink: Any = ... + clear: Any = ... + dry_run: Any = ... + ignore_patterns: Any = ... + post_process: Any = ... + def set_options(self, **options: Any) -> None: ... + def collect(self) -> Dict[str, List[str]]: ... + def log(self, msg: str, level: int = ...) -> None: ... + def is_local_storage(self) -> bool: ... + def clear_dir(self, path: str) -> None: ... + def delete_file(self, path: str, prefixed_path: str, source_storage: Storage) -> bool: ... + def link_file(self, path: str, prefixed_path: str, source_storage: Storage) -> None: ... + def copy_file(self, path: str, prefixed_path: str, source_storage: Storage) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/findstatic.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/findstatic.pyi new file mode 100644 index 00000000..be61bcbc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/findstatic.pyi @@ -0,0 +1,3 @@ +from django.core.management.base import LabelCommand + +class Command(LabelCommand): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/runserver.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/runserver.pyi new file mode 100644 index 00000000..20cfd79d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/management/commands/runserver.pyi @@ -0,0 +1,3 @@ +from django.core.management.commands.runserver import Command as RunserverCommand # type: ignore + +class Command(RunserverCommand): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/storage.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/storage.pyi new file mode 100644 index 00000000..da67f2a4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/storage.pyi @@ -0,0 +1,55 @@ +from collections import OrderedDict +from typing import Any, Callable, Iterator, Optional, Tuple + +from django.core.files.base import File +from django.core.files.storage import FileSystemStorage +from django.utils.functional import LazyObject + +class StaticFilesStorage(FileSystemStorage): + base_location: Any = ... + location: Any = ... + def __init__(self, location: Optional[str] = ..., base_url: None = ..., *args: Any, **kwargs: Any) -> None: ... + def path(self, name: str) -> str: ... + +class HashedFilesMixin: + default_template: str = ... + max_post_process_passes: int = ... + patterns: Any = ... + hashed_files: Any = ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def file_hash(self, name: str, content: File = ...) -> str: ... + def hashed_name(self, name: str, content: Optional[File] = ..., filename: Optional[str] = ...) -> str: ... + def url_converter(self, name: str, hashed_files: OrderedDict, template: str = ...) -> Callable: ... + def post_process( + self, paths: OrderedDict, dry_run: bool = ..., **options: Any + ) -> Iterator[Tuple[str, str, bool]]: ... + def clean_name(self, name: str) -> str: ... + def hash_key(self, name: str) -> str: ... + def stored_name(self, name: str) -> str: ... + +class ManifestFilesMixin(HashedFilesMixin): + manifest_version: str = ... + manifest_name: str = ... + manifest_strict: bool = ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def read_manifest(self) -> Any: ... + def load_manifest(self) -> OrderedDict: ... + def save_manifest(self) -> None: ... + +class _MappingCache: + cache: Any = ... + def __init__(self, cache: Any) -> None: ... + def __setitem__(self, key: Any, value: Any) -> None: ... + def __getitem__(self, key: Any): ... + def clear(self) -> None: ... + def update(self, data: Any) -> None: ... + def get(self, key: Any, default: Optional[Any] = ...): ... + +class CachedFilesMixin(HashedFilesMixin): + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + +class CachedStaticFilesStorage(CachedFilesMixin, StaticFilesStorage): ... +class ManifestStaticFilesStorage(ManifestFilesMixin, StaticFilesStorage): ... +class ConfiguredStorage(LazyObject): ... + +staticfiles_storage: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/templatetags/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/templatetags/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/templatetags/staticfiles.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/templatetags/staticfiles.pyi new file mode 100644 index 00000000..b2fdda39 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/templatetags/staticfiles.pyi @@ -0,0 +1,9 @@ +from typing import Any + +from django.template.base import Parser, Token +from django.templatetags.static import StaticNode + +register: Any + +def static(path: str) -> str: ... +def do_static(parser: Parser, token: Token) -> StaticNode: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/testing.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/testing.pyi new file mode 100644 index 00000000..a4048200 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/testing.pyi @@ -0,0 +1,3 @@ +from django.test import LiveServerTestCase + +class StaticLiveServerTestCase(LiveServerTestCase): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/urls.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/urls.pyi new file mode 100644 index 00000000..3070976c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/urls.pyi @@ -0,0 +1,7 @@ +from typing import Any, List, Optional + +from django.urls.resolvers import URLPattern + +urlpatterns: List[Any] = ... + +def staticfiles_urlpatterns(prefix: Optional[str] = ...) -> List[URLPattern]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/utils.pyi new file mode 100644 index 00000000..8d98d5f1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/utils.pyi @@ -0,0 +1,8 @@ +from collections import OrderedDict +from typing import Iterator, List, Optional, Tuple, Union + +from django.core.files.storage import FileSystemStorage + +def matches_patterns(path: str, patterns: Union[List[str], Tuple[str], OrderedDict] = ...) -> bool: ... +def get_files(storage: FileSystemStorage, ignore_patterns: List[str] = ..., location: str = ...) -> Iterator[str]: ... +def check_settings(base_url: Optional[str] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/views.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/views.pyi new file mode 100644 index 00000000..8d1ef04d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/staticfiles/views.pyi @@ -0,0 +1,6 @@ +from typing import Any + +from django.core.handlers.wsgi import WSGIRequest +from django.http.response import FileResponse + +def serve(request: WSGIRequest, path: str, insecure: bool = ..., **kwargs: Any) -> FileResponse: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/syndication/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/syndication/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/syndication/views.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/syndication/views.pyi new file mode 100644 index 00000000..bf2b1b31 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/contrib/syndication/views.pyi @@ -0,0 +1,27 @@ +from typing import Any, Dict, List + +from django.core.exceptions import ObjectDoesNotExist +from django.core.handlers.wsgi import WSGIRequest +from django.db.models.base import Model +from django.http.response import HttpResponse +from django.utils.feedgenerator import Enclosure, SyndicationFeed +from django.utils.safestring import SafeText + +def add_domain(domain: str, url: str, secure: bool = ...) -> str: ... + +class FeedDoesNotExist(ObjectDoesNotExist): ... + +class Feed: + feed_type: Any = ... + title_template: Any = ... + description_template: Any = ... + def __call__(self, request: WSGIRequest, *args: Any, **kwargs: Any) -> HttpResponse: ... + def item_title(self, item: Model) -> SafeText: ... + def item_description(self, item: Model) -> str: ... + def item_link(self, item: Model) -> str: ... + def item_enclosures(self, item: Model) -> List[Enclosure]: ... + def feed_extra_kwargs(self, obj: None) -> Dict[Any, Any]: ... + def item_extra_kwargs(self, item: Model) -> Dict[Any, Any]: ... + def get_object(self, request: WSGIRequest, *args: Any, **kwargs: Any) -> None: ... + def get_context_data(self, **kwargs: Any) -> Dict[str, Any]: ... + def get_feed(self, obj: None, request: WSGIRequest) -> SyndicationFeed: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/__init__.pyi new file mode 100644 index 00000000..7652696c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/__init__.pyi @@ -0,0 +1,24 @@ +from collections import OrderedDict +from typing import Any, Callable, Dict, Union + +from .backends.base import ( + BaseCache as BaseCache, + CacheKeyWarning as CacheKeyWarning, + InvalidCacheBackendError as InvalidCacheBackendError, +) + +DEFAULT_CACHE_ALIAS: str + +class CacheHandler: + def __init__(self) -> None: ... + def __getitem__(self, alias: str) -> BaseCache: ... + def all(self): ... + +class DefaultCacheProxy: + def __getattr__(self, name: str) -> Union[Callable, Dict[str, float], OrderedDict, int]: ... + def __setattr__(self, name: str, value: Callable) -> None: ... + def __delattr__(self, name: Any): ... + def __contains__(self, key: str) -> bool: ... + +cache: Any +caches: CacheHandler diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/backends/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/backends/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/backends/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/backends/base.pyi new file mode 100644 index 00000000..75f4f51b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/backends/base.pyi @@ -0,0 +1,41 @@ +from typing import Any, Callable, Dict, Iterable, List, Optional, Union + +from django.core.exceptions import ImproperlyConfigured + +class InvalidCacheBackendError(ImproperlyConfigured): ... +class CacheKeyWarning(RuntimeWarning): ... + +DEFAULT_TIMEOUT: Any +MEMCACHE_MAX_KEY_LENGTH: int + +def default_key_func(key: Any, key_prefix: str, version: Any) -> str: ... +def get_key_func(key_func: Optional[Union[Callable, str]]) -> Callable: ... + +class BaseCache: + default_timeout: int = ... + key_prefix: str = ... + version: int = ... + key_func: Callable = ... + def __init__(self, params: Dict[str, Any]) -> None: ... + def get_backend_timeout(self, timeout: Any = ...) -> Optional[float]: ... + def make_key(self, key: Any, version: Optional[Any] = ...) -> str: ... + def add(self, key: Any, value: Any, timeout: Any = ..., version: Optional[Any] = ...) -> bool: ... + def get(self, key: Any, default: Optional[Any] = ..., version: Optional[Any] = ...) -> Any: ... + def set(self, key: Any, value: Any, timeout: Any = ..., version: Optional[Any] = ...) -> None: ... + def touch(self, key: Any, timeout: Any = ..., version: Optional[Any] = ...) -> bool: ... + def delete(self, key: Any, version: Optional[Any] = ...) -> None: ... + def get_many(self, keys: List[str], version: Optional[int] = ...) -> Dict[str, Union[int, str]]: ... + def get_or_set( + self, key: Any, default: Optional[Any], timeout: Any = ..., version: Optional[int] = ... + ) -> Optional[Any]: ... + def has_key(self, key: Any, version: Optional[Any] = ...) -> bool: ... + def incr(self, key: str, delta: int = ..., version: Optional[int] = ...) -> int: ... + def decr(self, key: str, delta: int = ..., version: Optional[int] = ...) -> int: ... + def __contains__(self, key: str) -> bool: ... + def set_many(self, data: Dict[str, Any], timeout: Any = ..., version: Optional[Any] = ...) -> List[Any]: ... + def delete_many(self, keys: Iterable[Any], version: Optional[Any] = ...) -> None: ... + def clear(self) -> None: ... + def validate_key(self, key: str) -> None: ... + def incr_version(self, key: str, delta: int = ..., version: Optional[int] = ...) -> int: ... + def decr_version(self, key: str, delta: int = ..., version: Optional[int] = ...) -> int: ... + def close(self, **kwargs: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/backends/db.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/backends/db.pyi new file mode 100644 index 00000000..82fb34a7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/backends/db.pyi @@ -0,0 +1,22 @@ +from typing import Any, Dict + +from django.core.cache.backends.base import BaseCache + +class Options: + db_table: str = ... + app_label: str = ... + model_name: str = ... + verbose_name: str = ... + verbose_name_plural: str = ... + object_name: str = ... + abstract: bool = ... + managed: bool = ... + proxy: bool = ... + swapped: bool = ... + def __init__(self, table: str) -> None: ... + +class BaseDatabaseCache(BaseCache): + cache_model_class: Any = ... + def __init__(self, table: str, params: Dict[str, Any]) -> None: ... + +class DatabaseCache(BaseDatabaseCache): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/backends/dummy.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/backends/dummy.pyi new file mode 100644 index 00000000..8984faad --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/backends/dummy.pyi @@ -0,0 +1,6 @@ +from typing import Any + +from django.core.cache.backends.base import BaseCache + +class DummyCache(BaseCache): + def __init__(self, host: str, *args: Any, **kwargs: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/backends/filebased.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/backends/filebased.pyi new file mode 100644 index 00000000..f8e0e156 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/backends/filebased.pyi @@ -0,0 +1,7 @@ +from typing import Any, Dict + +from django.core.cache.backends.base import BaseCache + +class FileBasedCache(BaseCache): + cache_suffix: str = ... + def __init__(self, dir: str, params: Dict[str, Any]) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/backends/locmem.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/backends/locmem.pyi new file mode 100644 index 00000000..ee9d3686 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/backends/locmem.pyi @@ -0,0 +1,6 @@ +from typing import Any, Dict + +from django.core.cache.backends.base import BaseCache + +class LocMemCache(BaseCache): + def __init__(self, name: str, params: Dict[str, Any]) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/backends/memcached.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/backends/memcached.pyi new file mode 100644 index 00000000..ef875a26 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/backends/memcached.pyi @@ -0,0 +1,10 @@ +from django.core.cache.backends.base import BaseCache + +class BaseMemcachedCache(BaseCache): + def __init__(self, server, params, library, value_not_found_exception) -> None: ... + +class MemcachedCache(BaseMemcachedCache): + def __init__(self, server, params): ... + +class PyLibMCCache(BaseMemcachedCache): + def __init__(self, server, params): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/utils.pyi new file mode 100644 index 00000000..76df1195 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/cache/utils.pyi @@ -0,0 +1,5 @@ +from typing import Any, Iterable, Optional + +TEMPLATE_FRAGMENT_KEY_TEMPLATE: str + +def make_template_fragment_key(fragment_name: str, vary_on: Optional[Iterable[Any]] = ...) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/__init__.pyi new file mode 100644 index 00000000..a41eed9b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/__init__.pyi @@ -0,0 +1,17 @@ +from .messages import ( + CheckMessage as CheckMessage, + Debug as Debug, + Info as Info, + Warning as Warning, + Error as Error, + Critical as Critical, + DEBUG as DEBUG, + INFO as INFO, + WARNING as WARNING, + ERROR as ERROR, + CRITICAL as CRITICAL, +) + +from .registry import register as register, run_checks as run_checks, tag_exists as tag_exists, Tags as Tags + +from . import model_checks as model_checks diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/caches.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/caches.pyi new file mode 100644 index 00000000..94c89946 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/caches.pyi @@ -0,0 +1,9 @@ +from typing import Any, List, Iterable, Optional + +from django.core.checks.messages import Error + +from django.apps.config import AppConfig + +E001: Any + +def check_default_cache_is_configured(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Error]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/database.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/database.pyi new file mode 100644 index 00000000..b4f6b05f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/database.pyi @@ -0,0 +1,3 @@ +from typing import Any, List + +def check_database_backends(*args: Any, **kwargs: Any) -> List[Any]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/messages.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/messages.pyi new file mode 100644 index 00000000..f7aec386 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/messages.pyi @@ -0,0 +1,34 @@ +from typing import Any, Optional + +DEBUG: int +INFO: int +WARNING: int +ERROR: int +CRITICAL: int + +class CheckMessage: + level: int = ... + msg: str = ... + hint: Optional[str] = ... + obj: Any = ... + id: Optional[str] = ... + def __init__( + self, level: int, msg: str, hint: Optional[str] = ..., obj: Any = ..., id: Optional[str] = ... + ) -> None: ... + def is_serious(self, level: int = ...) -> bool: ... + def is_silenced(self) -> bool: ... + +class Debug(CheckMessage): + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + +class Info(CheckMessage): + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + +class Warning(CheckMessage): + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + +class Error(CheckMessage): + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + +class Critical(CheckMessage): + def __init__(self, *args: Any, **kwargs: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/model_checks.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/model_checks.pyi new file mode 100644 index 00000000..ec877ce9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/model_checks.pyi @@ -0,0 +1,8 @@ +from typing import Any, List, Iterable, Optional + +from django.core.checks.messages import Warning + +from django.apps.config import AppConfig + +def check_all_models(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[Warning]: ... +def check_lazy_references(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[Any]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/registry.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/registry.pyi new file mode 100644 index 00000000..12c560e6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/registry.pyi @@ -0,0 +1,36 @@ +from typing import Any, Callable, List, Optional, Set, Union + +from django.apps.config import AppConfig +from django.core.checks.messages import CheckMessage + +class Tags: + admin: str = ... + caches: str = ... + compatibility: str = ... + database: str = ... + models: str = ... + security: str = ... + signals: str = ... + templates: str = ... + translation: str = ... + urls: str = ... + +class CheckRegistry: + registered_checks: Set[Callable] = ... + deployment_checks: Set[Callable] = ... + def __init__(self) -> None: ... + def register(self, check: Optional[Union[Callable, str]] = ..., *tags: Any, **kwargs: Any) -> Callable: ... + def run_checks( + self, + app_configs: Optional[List[AppConfig]] = ..., + tags: Optional[List[str]] = ..., + include_deployment_checks: bool = ..., + ) -> Union[List[CheckMessage], List[int], List[str]]: ... + def tag_exists(self, tag: str, include_deployment_checks: bool = ...) -> bool: ... + def tags_available(self, deployment_checks: bool = ...) -> Set[str]: ... + def get_checks(self, include_deployment_checks: bool = ...) -> List[Callable]: ... + +registry: Any +register: Any +run_checks: Any +tag_exists: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/security/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/security/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/security/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/security/base.pyi new file mode 100644 index 00000000..7b670754 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/security/base.pyi @@ -0,0 +1,33 @@ +from typing import Any, List, Iterable, Optional + +from django.core.checks.messages import Warning + +from django.apps.config import AppConfig + +SECRET_KEY_MIN_LENGTH: int +SECRET_KEY_MIN_UNIQUE_CHARACTERS: int +W001: Any +W002: Any +W004: Any +W005: Any +W006: Any +W007: Any +W008: Any +W009: Any +W018: Any +W019: Any +W020: Any +W021: Any + +def check_security_middleware(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ... +def check_xframe_options_middleware(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ... +def check_sts(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ... +def check_sts_include_subdomains(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ... +def check_sts_preload(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ... +def check_content_type_nosniff(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ... +def check_xss_filter(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ... +def check_ssl_redirect(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ... +def check_secret_key(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ... +def check_debug(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ... +def check_xframe_deny(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ... +def check_allowed_hosts(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/security/csrf.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/security/csrf.pyi new file mode 100644 index 00000000..94ca777e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/security/csrf.pyi @@ -0,0 +1,11 @@ +from typing import Any, List, Iterable, Optional + +from django.core.checks.messages import Warning + +from django.apps.config import AppConfig + +W003: Any +W016: Any + +def check_csrf_middleware(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ... +def check_csrf_cookie_secure(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/security/sessions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/security/sessions.pyi new file mode 100644 index 00000000..c5f424fe --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/security/sessions.pyi @@ -0,0 +1,20 @@ +from typing import Any, List, Iterable, Optional + +from django.core.checks.messages import Warning + +from django.apps.config import AppConfig + +def add_session_cookie_message(message: Any): ... + +W010: Any +W011: Any +W012: Any + +def add_httponly_message(message: Any): ... + +W013: Any +W014: Any +W015: Any + +def check_session_cookie_secure(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ... +def check_session_cookie_httponly(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/templates.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/templates.pyi new file mode 100644 index 00000000..200db76e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/templates.pyi @@ -0,0 +1,11 @@ +from typing import Any, List, Iterable, Optional + +from django.core.checks.messages import Error + +from django.apps.config import AppConfig + +E001: Any +E002: Any + +def check_setting_app_dirs_loaders(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Error]: ... +def check_string_if_invalid_is_string(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Error]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/translation.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/translation.pyi new file mode 100644 index 00000000..a8a3c9f9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/translation.pyi @@ -0,0 +1,7 @@ +from typing import Any, List + +from . import Error + +E001: Error = ... + +def check_setting_language_code(app_configs: Any, **kwargs: Any) -> List[Error]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/urls.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/urls.pyi new file mode 100644 index 00000000..c9c43eea --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/checks/urls.pyi @@ -0,0 +1,13 @@ +from typing import Any, Callable, List, Tuple, Union, Iterable, Optional + +from django.core.checks.messages import CheckMessage, Error, Warning +from django.urls.resolvers import URLPattern, URLResolver + +from django.apps.config import AppConfig + +def check_url_config(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[CheckMessage]: ... +def check_resolver(resolver: Union[Tuple[str, Callable], URLPattern, URLResolver]) -> List[CheckMessage]: ... +def check_url_namespaces_unique(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ... +def get_warning_for_invalid_pattern(pattern: Any) -> List[Error]: ... +def check_url_settings(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Error]: ... +def E006(name: str) -> Error: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/exceptions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/exceptions.pyi new file mode 100644 index 00000000..44a904b3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/exceptions.pyi @@ -0,0 +1,43 @@ +from typing import Any, Dict, Iterator, List, Mapping, Optional, Tuple, Union + +from django.forms.utils import ErrorDict + +class FieldDoesNotExist(Exception): ... +class AppRegistryNotReady(Exception): ... + +class ObjectDoesNotExist(Exception): + silent_variable_failure: bool = ... + +class MultipleObjectsReturned(Exception): ... +class SuspiciousOperation(Exception): ... +class SuspiciousMultipartForm(SuspiciousOperation): ... +class SuspiciousFileOperation(SuspiciousOperation): ... +class DisallowedHost(SuspiciousOperation): ... +class DisallowedRedirect(SuspiciousOperation): ... +class TooManyFieldsSent(SuspiciousOperation): ... +class RequestDataTooBig(SuspiciousOperation): ... +class PermissionDenied(Exception): ... +class ViewDoesNotExist(Exception): ... +class MiddlewareNotUsed(Exception): ... +class ImproperlyConfigured(Exception): ... +class FieldError(Exception): ... + +NON_FIELD_ERRORS: str + +class ValidationError(Exception): + error_dict: Any = ... + error_list: Any = ... + message: Any = ... + code: Any = ... + params: Any = ... + def __init__(self, message: Any, code: Optional[str] = ..., params: Optional[Mapping[str, Any]] = ...) -> None: ... + @property + def message_dict(self) -> Dict[str, List[str]]: ... + @property + def messages(self) -> List[str]: ... + def update_error_dict( + self, error_dict: Mapping[str, Any] + ) -> Union[Dict[str, List[ValidationError]], ErrorDict]: ... + def __iter__(self) -> Iterator[Union[Tuple[str, List[str]], str]]: ... + +class EmptyResultSet(Exception): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/__init__.pyi new file mode 100644 index 00000000..af01506f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/__init__.pyi @@ -0,0 +1,3 @@ +from django.core.files.base import File as File + +__all__ = ["File"] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/base.pyi new file mode 100644 index 00000000..96226857 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/base.pyi @@ -0,0 +1,41 @@ +import types +from io import StringIO +from typing import Any, IO, Iterator, Optional, Type, TypeVar, Union + +from django.core.files.utils import FileProxyMixin + +_T = TypeVar("_T", bound="File") + +class File(FileProxyMixin, IO[Any]): + DEFAULT_CHUNK_SIZE: Any = ... + file: IO[Any] = ... + name: str = ... + mode: str = ... + def __init__(self, file: Any, name: Optional[str] = ...) -> None: ... + def __bool__(self) -> bool: ... + def __len__(self) -> int: ... + @property + def size(self) -> int: ... + def chunks(self, chunk_size: Optional[int] = ...) -> Iterator[bytes]: ... + def multiple_chunks(self, chunk_size: Optional[int] = ...) -> bool: ... + def __iter__(self) -> Iterator[Union[bytes, str]]: ... + def __next__(self) -> Union[bytes, str]: ... + def __enter__(self: _T) -> _T: ... + def __exit__( + self, + exc_type: Optional[Type[BaseException]], + exc_value: Optional[BaseException], + tb: Optional[types.TracebackType], + ) -> bool: ... + def open(self: _T, mode: Optional[str] = ...) -> _T: ... + def close(self) -> None: ... + +class ContentFile(File): + file: StringIO + size: Any = ... + def __init__(self, content: Union[bytes, str], name: Optional[str] = ...) -> None: ... + def write(self, data: str) -> int: ... + +def endswith_cr(line: bytes) -> bool: ... +def endswith_lf(line: Union[bytes, str]) -> bool: ... +def equals_lf(line: bytes) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/images.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/images.pyi new file mode 100644 index 00000000..31956983 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/images.pyi @@ -0,0 +1,13 @@ +from typing import Any, IO, Union + +from django.core.files import File + +class ImageFile(File): + mode: str + name: str + @property + def width(self) -> int: ... + @property + def height(self) -> int: ... + +def get_image_dimensions(file_or_path: Union[str, IO[bytes]], close: bool = ...) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/locks.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/locks.pyi new file mode 100644 index 00000000..768114f5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/locks.pyi @@ -0,0 +1,15 @@ +from ctypes import Structure, Union +from typing import Any + +LOCK_SH: int +LOCK_NB: int +LOCK_EX: int +ULONG_PTR: Any = ... +PVOID: Any = ... + +class _OFFSET(Structure): ... +class _OFFSET_UNION(Union): ... +class OVERLAPPED(Structure): ... + +def lock(f: Any, flags: int) -> bool: ... +def unlock(f: Any) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/move.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/move.pyi new file mode 100644 index 00000000..bdbfd17f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/move.pyi @@ -0,0 +1,3 @@ +def file_move_safe( + old_file_name: str, new_file_name: str, chunk_size: int = ..., allow_overwrite: bool = ... +) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/storage.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/storage.pyi new file mode 100644 index 00000000..32dac5bc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/storage.pyi @@ -0,0 +1,47 @@ +from datetime import datetime +from typing import Any, IO, List, Optional, Tuple, Type + +from django.core.files.base import File +from django.utils.functional import LazyObject + +class Storage: + def open(self, name: str, mode: str = ...) -> File: ... + def save(self, name: Optional[str], content: IO[Any], max_length: Optional[int] = ...) -> str: ... + def get_valid_name(self, name: str) -> str: ... + def get_available_name(self, name: str, max_length: Optional[int] = ...) -> str: ... + def generate_filename(self, filename: str) -> str: ... + def path(self, name: str) -> str: ... + def delete(self, name: str) -> None: ... + def exists(self, name: str) -> bool: ... + def listdir(self, path: str) -> Tuple[List[str], List[str]]: ... + def size(self, name: str) -> int: ... + def url(self, name: Optional[str]) -> str: ... + def get_accessed_time(self, name: str) -> datetime: ... + def get_created_time(self, name: str) -> datetime: ... + def get_modified_time(self, name: str) -> datetime: ... + +class FileSystemStorage(Storage): + OS_OPEN_FLAGS: int = ... + def __init__( + self, + location: Optional[str] = ..., + base_url: Optional[str] = ..., + file_permissions_mode: Optional[int] = ..., + directory_permissions_mode: Optional[int] = ..., + ) -> None: ... + @property + def base_location(self) -> str: ... + @property + def location(self) -> str: ... + @property + def base_url(self) -> str: ... + @property + def file_permissions_mode(self) -> Optional[int]: ... + @property + def directory_permissions_mode(self) -> Optional[int]: ... + +class DefaultStorage(LazyObject): ... + +default_storage: Any + +def get_storage_class(import_path: Optional[str] = ...) -> Type[Storage]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/temp.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/temp.pyi new file mode 100644 index 00000000..9439e13a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/temp.pyi @@ -0,0 +1,5 @@ +import tempfile + +NamedTemporaryFile = tempfile.NamedTemporaryFile + +gettempdir = tempfile.gettempdir diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/uploadedfile.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/uploadedfile.pyi new file mode 100644 index 00000000..7ef73432 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/uploadedfile.pyi @@ -0,0 +1,46 @@ +from typing import Any, Dict, IO, Optional, Union + +from django.core.files.base import File + +class UploadedFile(File): + content_type: Optional[str] = ... + charset: Optional[str] = ... + content_type_extra: Optional[Dict[str, str]] = ... + def __init__( + self, + file: Optional[IO] = ..., + name: Optional[str] = ..., + content_type: Optional[str] = ..., + size: Optional[int] = ..., + charset: Optional[str] = ..., + content_type_extra: Optional[Dict[str, str]] = ..., + ) -> None: ... + +class TemporaryUploadedFile(UploadedFile): + def __init__( + self, + name: Optional[str], + content_type: Optional[str], + size: Optional[int], + charset: Optional[str], + content_type_extra: Optional[Dict[str, str]] = ..., + ) -> None: ... + def temporary_file_path(self) -> str: ... + +class InMemoryUploadedFile(UploadedFile): + field_name: Optional[str] = ... + def __init__( + self, + file: IO, + field_name: Optional[str], + name: Optional[str], + content_type: Optional[str], + size: Optional[int], + charset: Optional[str], + content_type_extra: Dict[str, str] = ..., + ) -> None: ... + +class SimpleUploadedFile(InMemoryUploadedFile): + def __init__(self, name: str, content: Optional[Union[bytes, str]], content_type: str = ...) -> None: ... + @classmethod + def from_dict(cls: Any, file_dict: Dict[str, Union[str, bytes]]) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/uploadhandler.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/uploadhandler.pyi new file mode 100644 index 00000000..1dfe8630 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/uploadhandler.pyi @@ -0,0 +1,86 @@ +# Stubs for django.core.files.uploadhandler (Python 3.5) + +from typing import Any, Dict, IO, Optional, Tuple +from django.core.files.uploadedfile import UploadedFile, TemporaryUploadedFile +from django.http.request import HttpRequest, QueryDict +from django.utils.datastructures import MultiValueDict + +class UploadFileException(Exception): ... + +class StopUpload(UploadFileException): + connection_reset: bool = ... + def __init__(self, connection_reset: bool = ...) -> None: ... + +class SkipFile(UploadFileException): ... +class StopFutureHandlers(UploadFileException): ... + +class FileUploadHandler: + chunk_size: int = ... + file_name: Optional[str] = ... + content_type: Optional[str] = ... + content_length: Optional[int] = ... + charset: Optional[str] = ... + content_type_extra: Optional[Dict[str, str]] = ... + request: Optional[HttpRequest] = ... + field_name: str = ... + def __init__(self, request: Optional[HttpRequest] = ...) -> None: ... + def handle_raw_input( + self, + input_data: IO[bytes], + META: Dict[str, str], + content_length: int, + boundary: str, + encoding: Optional[str] = ..., + ) -> Optional[Tuple[QueryDict, MultiValueDict[str, UploadedFile]]]: ... + def new_file( + self, + field_name: str, + file_name: str, + content_type: str, + content_length: Optional[int], + charset: Optional[str] = ..., + content_type_extra: Optional[Dict[str, str]] = ..., + ) -> None: ... + def receive_data_chunk(self, raw_data: bytes, start: int) -> Optional[bytes]: ... + def file_complete(self, file_size: int) -> Optional[UploadedFile]: ... + def upload_complete(self) -> None: ... + +class TemporaryFileUploadHandler(FileUploadHandler): + def __init__(self, request: Optional[HttpRequest] = ...) -> None: ... + file = ... # type: TemporaryUploadedFile + def new_file( + self, + field_name: str, + file_name: str, + content_type: str, + content_length: Optional[int], + charset: Optional[str] = ..., + content_type_extra: Optional[Dict[str, str]] = ..., + ) -> None: ... + def receive_data_chunk(self, raw_data: bytes, start: int) -> Optional[bytes]: ... + def file_complete(self, file_size: int) -> Optional[UploadedFile]: ... + +class MemoryFileUploadHandler(FileUploadHandler): + activated = ... # type: bool + file = ... # type: IO[bytes] + def handle_raw_input( + self, + input_data: IO[bytes], + META: Dict[str, str], + content_length: int, + boundary: str, + encoding: Optional[str] = ..., + ) -> Optional[Tuple[QueryDict, MultiValueDict[str, UploadedFile]]]: ... + def new_file( + self, + field_name: str, + file_name: str, + content_type: str, + content_length: Optional[int], + charset: Optional[str] = ..., + content_type_extra: Optional[Dict[str, str]] = ..., + ) -> None: ... + def receive_data_chunk(self, raw_data: bytes, start: int) -> Optional[bytes]: ... + def file_complete(self, file_size: int) -> Optional[UploadedFile]: ... + +def load_handler(path: str, *args: Any, **kwargs: Any) -> FileUploadHandler: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/utils.pyi new file mode 100644 index 00000000..c25e9526 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/files/utils.pyi @@ -0,0 +1,23 @@ +from typing import Any + +class FileProxyMixin: + encoding: Any = ... + fileno: Any = ... + flush: Any = ... + isatty: Any = ... + newlines: Any = ... + read: Any = ... + readinto: Any = ... + readline: Any = ... + readlines: Any = ... + seek: Any = ... + tell: Any = ... + truncate: Any = ... + write: Any = ... + writelines: Any = ... + @property + def closed(self) -> bool: ... + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def seekable(self) -> bool: ... + def __iter__(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/handlers/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/handlers/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/handlers/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/handlers/base.pyi new file mode 100644 index 00000000..93461d15 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/handlers/base.pyi @@ -0,0 +1,13 @@ +from typing import Any, Callable + +from django.http.request import HttpRequest +from django.http.response import HttpResponse, HttpResponseBase + +logger: Any + +class BaseHandler: + def load_middleware(self) -> None: ... + def make_view_atomic(self, view: Callable) -> Callable: ... + def get_exception_response(self, request: Any, resolver: Any, status_code: Any, exception: Any): ... + def get_response(self, request: HttpRequest) -> HttpResponseBase: ... + def process_exception_by_middleware(self, exception: Exception, request: HttpRequest) -> HttpResponse: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/handlers/exception.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/handlers/exception.pyi new file mode 100644 index 00000000..ef4de5f7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/handlers/exception.pyi @@ -0,0 +1,12 @@ +from typing import Any, Callable + +from django.http.request import HttpRequest +from django.http.response import HttpResponse +from django.urls.resolvers import URLResolver + +def convert_exception_to_response(get_response: Callable) -> Callable: ... +def response_for_exception(request: HttpRequest, exc: Exception) -> HttpResponse: ... +def get_exception_response( + request: HttpRequest, resolver: URLResolver, status_code: int, exception: Exception, sender: None = ... +) -> HttpResponse: ... +def handle_uncaught_exception(request: Any, resolver: Any, exc_info: Any): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/handlers/wsgi.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/handlers/wsgi.pyi new file mode 100644 index 00000000..4ea28d98 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/handlers/wsgi.pyi @@ -0,0 +1,35 @@ +from io import BytesIO +from typing import Any, Callable, Dict, Optional, Union + +from django.contrib.sessions.backends.base import SessionBase +from django.core.handlers import base +from django.http import HttpRequest +from django.http.response import HttpResponse + +_Stream = Union[BytesIO, str] +_WSGIEnviron = Dict[str, Any] + +class LimitedStream: + stream: _Stream = ... + remaining: int = ... + buffer: bytes = ... + buf_size: int = ... + def __init__(self, stream: _Stream, limit: int, buf_size: int = ...) -> None: ... + def read(self, size: Optional[int] = ...) -> bytes: ... + def readline(self, size: Optional[int] = ...) -> bytes: ... + +class WSGIRequest(HttpRequest): + environ: _WSGIEnviron = ... + session: SessionBase + encoding: Any = ... + def __init__(self, environ: _WSGIEnviron) -> None: ... + +class WSGIHandler(base.BaseHandler): + request_class: Any = ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def __call__(self, environ: _WSGIEnviron, start_response: Callable) -> HttpResponse: ... + +def get_path_info(environ: _WSGIEnviron) -> str: ... +def get_script_name(environ: _WSGIEnviron) -> str: ... +def get_bytes_from_wsgi(environ: _WSGIEnviron, key: str, default: str) -> bytes: ... +def get_str_from_wsgi(environ: _WSGIEnviron, key: str, default: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/__init__.pyi new file mode 100644 index 00000000..02e762ed --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/__init__.pyi @@ -0,0 +1,48 @@ +from typing import Any, List, Optional, Tuple + +from .message import ( + BadHeaderError as BadHeaderError, + DEFAULT_ATTACHMENT_MIME_TYPE as DEFAULT_ATTACHMENT_MIME_TYPE, + EmailMessage as EmailMessage, + EmailMultiAlternatives as EmailMultiAlternatives, + SafeMIMEMultipart as SafeMIMEMultipart, + SafeMIMEText as SafeMIMEText, + forbid_multi_line_headers as forbid_multi_line_headers, +) +from .utils import CachedDnsName as CachedDnsName, DNS_NAME as DNS_NAME + +def get_connection(backend: Optional[str] = ..., fail_silently: bool = ..., **kwds: Any) -> Any: ... +def send_mail( + subject: str, + message: str, + from_email: Optional[str], + recipient_list: List[str], + fail_silently: bool = ..., + auth_user: Optional[str] = ..., + auth_password: Optional[str] = ..., + connection: Optional[Any] = ..., + html_message: Optional[str] = ..., +) -> int: ... +def send_mass_mail( + datatuple: List[Tuple[str, str, str, List[str]]], + fail_silently: bool = ..., + auth_user: Optional[str] = ..., + auth_password: Optional[str] = ..., + connection: Optional[Any] = ..., +) -> int: ... +def mail_admins( + subject: str, + message: str, + fail_silently: bool = ..., + connection: Optional[Any] = ..., + html_message: Optional[str] = ..., +) -> None: ... +def mail_managers( + subject: str, + message: str, + fail_silently: bool = ..., + connection: Optional[Any] = ..., + html_message: Optional[str] = ..., +) -> None: ... + +outbox: List[EmailMessage] = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/backends/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/backends/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/backends/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/backends/base.pyi new file mode 100644 index 00000000..2e3fd0f2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/backends/base.pyi @@ -0,0 +1,16 @@ +import types +from typing import Any, TypeVar, Type, Iterable, Optional + +from django.core.mail.message import EmailMessage + +_T = TypeVar("_T", bound="BaseEmailBackend") + +class BaseEmailBackend: + def __init__(self, fail_silently: bool = ..., **kwargs: Any) -> None: ... + def open(self) -> Optional[bool]: ... + def close(self) -> None: ... + def __enter__(self: _T) -> _T: ... + def __exit__( + self, exc_type: Type[BaseException], exc_value: BaseException, traceback: types.TracebackType + ) -> None: ... + def send_messages(self, email_messages: Iterable[EmailMessage]) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/backends/console.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/backends/console.pyi new file mode 100644 index 00000000..80ba2615 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/backends/console.pyi @@ -0,0 +1,3 @@ +from django.core.mail.backends.base import BaseEmailBackend + +class EmailBackend(BaseEmailBackend): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/backends/dummy.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/backends/dummy.pyi new file mode 100644 index 00000000..80ba2615 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/backends/dummy.pyi @@ -0,0 +1,3 @@ +from django.core.mail.backends.base import BaseEmailBackend + +class EmailBackend(BaseEmailBackend): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/backends/filebased.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/backends/filebased.pyi new file mode 100644 index 00000000..80ba2615 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/backends/filebased.pyi @@ -0,0 +1,3 @@ +from django.core.mail.backends.base import BaseEmailBackend + +class EmailBackend(BaseEmailBackend): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/backends/locmem.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/backends/locmem.pyi new file mode 100644 index 00000000..80ba2615 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/backends/locmem.pyi @@ -0,0 +1,3 @@ +from django.core.mail.backends.base import BaseEmailBackend + +class EmailBackend(BaseEmailBackend): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/backends/smtp.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/backends/smtp.pyi new file mode 100644 index 00000000..cce17706 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/backends/smtp.pyi @@ -0,0 +1,18 @@ +import smtplib +import threading +from typing import Optional, Union + +from django.core.mail.backends.base import BaseEmailBackend + +class EmailBackend(BaseEmailBackend): + host: str = ... + port: int = ... + username: str = ... + password: str = ... + use_tls: bool = ... + use_ssl: bool = ... + timeout: Optional[int] = ... + ssl_keyfile: Optional[str] = ... + ssl_certfile: Optional[str] = ... + connection: Union[smtplib.SMTP_SSL, smtplib.SMTP, None] = ... + _lock: threading.RLock = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/message.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/message.pyi new file mode 100644 index 00000000..ef98c9c8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/message.pyi @@ -0,0 +1,110 @@ +from email._policybase import Policy # type: ignore +from email.message import Message +from email.mime.base import MIMEBase +from email.mime.message import MIMEMessage +from email.mime.multipart import MIMEMultipart +from email.mime.text import MIMEText +from typing import Any, Dict, List, Optional, Sequence, Tuple, Union, overload + +utf8_charset: Any +utf8_charset_qp: Any +DEFAULT_ATTACHMENT_MIME_TYPE: str +RFC5322_EMAIL_LINE_LENGTH_LIMIT: int + +class BadHeaderError(ValueError): ... + +ADDRESS_HEADERS: Any + +def forbid_multi_line_headers(name: str, val: str, encoding: str) -> Tuple[str, str]: ... +def split_addr(addr: str, encoding: str) -> Tuple[str, str]: ... +def sanitize_address(addr: Union[Tuple[str, str], str], encoding: str) -> str: ... + +class MIMEMixin: ... + +class SafeMIMEMessage(MIMEMixin, MIMEMessage): + defects: List[Any] + epilogue: None + policy: Policy + preamble: None + +class SafeMIMEText(MIMEMixin, MIMEText): + defects: List[Any] + epilogue: None + policy: Policy + preamble: None + encoding: str = ... + def __init__(self, _text: str, _subtype: str = ..., _charset: str = ...) -> None: ... + +class SafeMIMEMultipart(MIMEMixin, MIMEMultipart): + defects: List[Any] + epilogue: None + policy: Policy + preamble: None + encoding: str = ... + def __init__( + self, _subtype: str = ..., boundary: None = ..., _subparts: None = ..., encoding: str = ..., **_params: Any + ) -> None: ... + +_AttachmentContent = Union[bytes, EmailMessage, Message, SafeMIMEText, str] +_AttachmentTuple = Union[ + Tuple[str, _AttachmentContent], Tuple[Optional[str], _AttachmentContent, str], Tuple[str, _AttachmentContent, None] +] + +class EmailMessage: + content_subtype: str = ... + mixed_subtype: str = ... + encoding: Any = ... + to: List[str] = ... + cc: List[Any] = ... + bcc: List[Any] = ... + reply_to: List[Any] = ... + from_email: str = ... + subject: str = ... + body: str = ... + attachments: List[Any] = ... + extra_headers: Dict[Any, Any] = ... + connection: Any = ... + def __init__( + self, + subject: str = ..., + body: Optional[str] = ..., + from_email: Optional[str] = ..., + to: Optional[Sequence[str]] = ..., + bcc: Optional[Sequence[str]] = ..., + connection: Optional[Any] = ..., + attachments: Optional[Sequence[Union[MIMEBase, _AttachmentTuple]]] = ..., + headers: Optional[Dict[str, str]] = ..., + cc: Optional[Sequence[str]] = ..., + reply_to: Optional[Sequence[str]] = ..., + ) -> None: ... + def get_connection(self, fail_silently: bool = ...) -> Any: ... + # TODO: when typeshed gets more types for email.Message, move it to MIMEMessage, now it has too many false-positives + def message(self) -> Any: ... + def recipients(self) -> List[str]: ... + def send(self, fail_silently: bool = ...) -> int: ... + @overload + def attach(self, filename: MIMEText = ...) -> None: ... + @overload + def attach(self, filename: None = ..., content: _AttachmentContent = ..., mimetype: str = ...) -> None: ... + @overload + def attach(self, filename: str = ..., content: _AttachmentContent = ..., mimetype: Optional[str] = ...) -> None: ... + def attach_file(self, path: str, mimetype: Optional[str] = ...) -> None: ... + +class EmailMultiAlternatives(EmailMessage): + alternative_subtype: str = ... + alternatives: Sequence[Tuple[_AttachmentContent, str]] = ... + def __init__( + self, + subject: str = ..., + body: str = ..., + from_email: Optional[str] = ..., + to: Optional[Sequence[str]] = ..., + bcc: Optional[Sequence[str]] = ..., + connection: Optional[Any] = ..., + attachments: Optional[Sequence[Union[MIMEBase, _AttachmentTuple]]] = ..., + headers: Optional[Dict[str, str]] = ..., + alternatives: Optional[Sequence[Tuple[_AttachmentContent, str]]] = ..., + cc: Optional[Sequence[str]] = ..., + reply_to: Optional[Sequence[str]] = ..., + ) -> None: ... + def attach_alternative(self, content: _AttachmentContent, mimetype: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/utils.pyi new file mode 100644 index 00000000..68b3a64f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/mail/utils.pyi @@ -0,0 +1,6 @@ +from typing import Any + +class CachedDnsName: + def get_fqdn(self) -> str: ... + +DNS_NAME: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/__init__.pyi new file mode 100644 index 00000000..2b5bef27 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/__init__.pyi @@ -0,0 +1,20 @@ +from typing import Any, Dict, List, Tuple, Union + +from .base import BaseCommand as BaseCommand, CommandError as CommandError + +def find_commands(management_dir: str) -> List[str]: ... +def load_command_class(app_name: str, name: str) -> BaseCommand: ... +def get_commands() -> Dict[str, str]: ... +def call_command(command_name: Union[Tuple[str], BaseCommand, str], *args: Any, **options: Any) -> str: ... + +class ManagementUtility: + argv: List[str] = ... + prog_name: str = ... + settings_exception: None = ... + def __init__(self, argv: List[str] = ...) -> None: ... + def main_help_text(self, commands_only: bool = ...): ... + def fetch_command(self, subcommand: str) -> BaseCommand: ... + def autocomplete(self) -> None: ... + def execute(self) -> None: ... + +def execute_from_command_line(argv: List[str] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/base.pyi new file mode 100644 index 00000000..ec5896f0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/base.pyi @@ -0,0 +1,78 @@ +from argparse import ArgumentParser, HelpFormatter, Namespace +from io import StringIO, TextIOBase, TextIOWrapper +from typing import Any, Callable, List, Optional, Union, Tuple + +from django.apps.config import AppConfig +from django.core.management.color import Style + +class CommandError(Exception): ... +class SystemCheckError(CommandError): ... + +class CommandParser(ArgumentParser): + missing_args_message: None = ... + called_from_command_line: bool = ... + def __init__(self, **kwargs: Any) -> None: ... + def error(self, message: str) -> Any: ... + +def handle_default_options(options: Namespace) -> None: ... +def no_translations(handle_func: Callable) -> Callable: ... + +class DjangoHelpFormatter(HelpFormatter): ... + +class OutputWrapper(TextIOBase): + @property + def style_func(self): ... + @style_func.setter + def style_func(self, style_func: Callable[[str], str]): ... + ending: str = ... + def __init__( + self, out: Union[StringIO, TextIOWrapper], style_func: Optional[Callable[[str], str]] = ..., ending: str = ... + ) -> None: ... + def __getattr__(self, name: str) -> Callable: ... + def isatty(self) -> bool: ... + def write( # type: ignore[override] + self, msg: str, style_func: Optional[Callable[[str], str]] = ..., ending: Optional[str] = ... + ) -> None: ... + +class BaseCommand: + help: str = ... + output_transaction: bool = ... + requires_migrations_checks: bool = ... + requires_system_checks: bool = ... + base_stealth_options: Tuple[str, ...] = ... + stealth_options: Tuple[str, ...] = ... + stdout: OutputWrapper = ... + stderr: OutputWrapper = ... + style: Style = ... + def __init__( + self, + stdout: Optional[StringIO] = ..., + stderr: Optional[StringIO] = ..., + no_color: bool = ..., + force_color: bool = ..., + ) -> None: ... + def get_version(self) -> str: ... + def create_parser(self, prog_name: str, subcommand: str, **kwargs: Any) -> CommandParser: ... + def add_arguments(self, parser: CommandParser) -> None: ... + def print_help(self, prog_name: str, subcommand: str) -> None: ... + def run_from_argv(self, argv: List[str]) -> None: ... + def execute(self, *args: Any, **options: Any) -> Any: ... + def check( + self, + app_configs: Optional[List[AppConfig]] = ..., + tags: Optional[List[str]] = ..., + display_num_errors: bool = ..., + include_deployment_checks: bool = ..., + fail_level: int = ..., + ) -> None: ... + def check_migrations(self) -> None: ... + def handle(self, *args: Any, **options: Any) -> Optional[str]: ... + +class AppCommand(BaseCommand): + missing_args_message: str = ... + def handle_app_config(self, app_config: Any, **options: Any) -> None: ... + +class LabelCommand(BaseCommand): + label: str = ... + missing_args_message: Any = ... + def handle_label(self, label: Any, **options: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/color.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/color.pyi new file mode 100644 index 00000000..0fc0d6a8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/color.pyi @@ -0,0 +1,25 @@ +def supports_color() -> bool: ... + +class Style: + def ERROR(self, text: str) -> str: ... + def SUCCESS(self, text: str) -> str: ... + def WARNING(self, text: str) -> str: ... + def NOTICE(self, text: str) -> str: ... + def SQL_FIELD(self, text: str) -> str: ... + def SQL_COLTYPE(self, text: str) -> str: ... + def SQL_KEYWORD(self, text: str) -> str: ... + def SQL_TABLE(self, text: str) -> str: ... + def HTTP_INFO(self, text: str) -> str: ... + def HTTP_SUCCESS(self, text: str) -> str: ... + def HTTP_REDIRECT(self, text: str) -> str: ... + def HTTP_NOT_MODIFIED(self, text: str) -> str: ... + def HTTP_BAD_REQUEST(self, text: str) -> str: ... + def HTTP_NOT_FOUND(self, text: str) -> str: ... + def HTTP_SERVER_ERROR(self, text: str) -> str: ... + def MIGRATE_HEADING(self, text: str) -> str: ... + def MIGRATE_LABEL(self, text: str) -> str: ... + def ERROR_OUTPUT(self, text: str) -> str: ... + +def make_style(config_string: str = ...) -> Style: ... +def no_style() -> Style: ... +def color_style() -> Style: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/commands/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/commands/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/commands/dumpdata.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/commands/dumpdata.pyi new file mode 100644 index 00000000..bc3c4ce8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/commands/dumpdata.pyi @@ -0,0 +1,4 @@ +from django.core.management.base import BaseCommand + +class ProxyModelWarning(Warning): ... +class Command(BaseCommand): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/commands/loaddata.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/commands/loaddata.pyi new file mode 100644 index 00000000..7ca630ab --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/commands/loaddata.pyi @@ -0,0 +1,19 @@ +import zipfile +from typing import Iterable, List, Optional, Tuple + +from django.core.management.base import BaseCommand + +READ_STDIN: str = ... + +class Command(BaseCommand): + missing_args_message: str = ... + def loaddata(self, fixture_labels: Iterable[str]) -> None: ... + def load_label(self, fixture_label: str) -> None: ... + def find_fixtures(self, fixture_label: str) -> List[Optional[str]]: ... + @property + def fixture_dirs(self) -> List[str]: ... + def parse_name(self, fixture_name: str) -> Tuple[str, str, str]: ... + +class SingleZipReader(zipfile.ZipFile): ... + +def humanize(dirname: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/commands/makemessages.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/commands/makemessages.pyi new file mode 100644 index 00000000..8f8e5fdd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/commands/makemessages.pyi @@ -0,0 +1,38 @@ +from typing import Any, Optional, Pattern, Type + +from django.core.management.base import BaseCommand + +plural_forms_re: Pattern = ... +STATUS_OK: int = ... +NO_LOCALE_DIR: Any = ... + +def check_programs(*programs: str) -> None: ... + +class TranslatableFile: + dirpath: str + file_name: str + locale_dir: str + def __init__(self, dirpath: str, file_name: str, locale_dir: Optional[str]) -> None: ... + +class BuildFile: + """ + Represent the state of a translatable file during the build process. + """ + + def __init__(self, command: BaseCommand, domain: str, translatable: TranslatableFile) -> None: ... + @property + def is_templatized(self) -> bool: ... + @property + def path(self) -> str: ... + @property + def work_path(self) -> str: ... + def preprocess(self) -> None: ... + def postprocess_messages(self, msgs: str) -> str: ... + def cleanup(self) -> None: ... + +def normalize_eols(raw_contents: str) -> str: ... +def write_pot_file(potfile: str, msgs: str) -> None: ... + +class Command(BaseCommand): + translatable_file_class: Type[TranslatableFile] = ... + build_file_class: Type[BuildFile] = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/commands/runserver.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/commands/runserver.pyi new file mode 100644 index 00000000..57dcf9b0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/commands/runserver.pyi @@ -0,0 +1,7 @@ +from django.core.management.base import BaseCommand + +class Command(BaseCommand): + default_addr: str = ... + default_addr_ipv6: str = ... + default_port: int = ... + protocol: str = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/commands/testserver.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/commands/testserver.pyi new file mode 100644 index 00000000..8d75fb4d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/commands/testserver.pyi @@ -0,0 +1,3 @@ +from django.core.management.base import BaseCommand + +class Command(BaseCommand): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/sql.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/sql.pyi new file mode 100644 index 00000000..8798e12b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/sql.pyi @@ -0,0 +1,9 @@ +from typing import Any, List + +from django.core.management.color import Style + +def sql_flush( + style: Style, connection: Any, only_django: bool = ..., reset_sequences: bool = ..., allow_cascade: bool = ... +) -> List[str]: ... +def emit_pre_migrate_signal(verbosity: int, interactive: bool, db: str, **kwargs: Any) -> None: ... +def emit_post_migrate_signal(verbosity: int, interactive: bool, db: str, **kwargs: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/templates.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/templates.pyi new file mode 100644 index 00000000..f3df51d7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/templates.pyi @@ -0,0 +1,17 @@ +from typing import Any + +from django.core.management.base import BaseCommand + +class TemplateCommand(BaseCommand): + url_schemes: Any = ... + rewrite_template_suffixes: Any = ... + app_or_project: Any = ... + paths_to_remove: Any = ... + verbosity: Any = ... + def handle_template(self, template: Any, subdir: Any): ... + def validate_name(self, name: Any, app_or_project: Any) -> None: ... + def download(self, url: Any): ... + def splitext(self, the_path: Any): ... + def extract(self, filename: Any): ... + def is_url(self, template: Any): ... + def make_writeable(self, filename: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/utils.pyi new file mode 100644 index 00000000..23b5696f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/management/utils.pyi @@ -0,0 +1,10 @@ +from typing import List, Optional, Set, Tuple, Type + +from django.apps.config import AppConfig +from django.db.models.base import Model + +def popen_wrapper(args: List[str], stdout_encoding: str = ...) -> Tuple[str, str, int]: ... +def handle_extensions(extensions: List[str]) -> Set[str]: ... +def find_command(cmd: str, path: Optional[str] = ..., pathext: Optional[str] = ...) -> Optional[str]: ... +def get_random_secret_key(): ... +def parse_apps_and_model_labels(labels: List[str]) -> Tuple[Set[Type[Model]], Set[AppConfig]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/paginator.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/paginator.pyi new file mode 100644 index 00000000..d838cb47 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/paginator.pyi @@ -0,0 +1,62 @@ +from typing import Dict, List, Optional, Protocol, Sequence, Union + +from django.db.models.base import Model +from django.db.models.query import QuerySet + +class UnorderedObjectListWarning(RuntimeWarning): ... +class InvalidPage(Exception): ... +class PageNotAnInteger(InvalidPage): ... +class EmptyPage(InvalidPage): ... + +class _SupportsLen(Protocol): + def __len__(self) -> int: ... + +class _SupportsCount(Protocol): + def count(self) -> int: ... + +class _SupportsOrdered(Protocol): + ordered: bool = ... + +class Paginator: + object_list: QuerySet = ... + per_page: int = ... + orphans: int = ... + allow_empty_first_page: bool = ... + def __init__( + self, + object_list: Union[_SupportsLen, _SupportsCount, _SupportsOrdered], + per_page: Union[int, str], + orphans: int = ..., + allow_empty_first_page: bool = ..., + ) -> None: ... + def validate_number(self, number: Optional[Union[float, str]]) -> int: ... + def get_page(self, number: Optional[int]) -> Page: ... + def page(self, number: Union[int, str]) -> Page: ... + @property + def count(self) -> int: ... + @property + def num_pages(self) -> int: ... + @property + def page_range(self) -> range: ... + +QuerySetPaginator = Paginator + +class Page(Sequence): + object_list: QuerySet = ... + number: int = ... + paginator: Paginator = ... + def __init__( + self, + object_list: Union[List[Dict[str, str]], List[Model], List[int], QuerySet, str], + number: int, + paginator: Paginator, + ) -> None: ... + def __getitem__(self, item): ... + def __len__(self): ... + def has_next(self) -> bool: ... + def has_previous(self) -> bool: ... + def has_other_pages(self) -> bool: ... + def next_page_number(self) -> int: ... + def previous_page_number(self) -> int: ... + def start_index(self) -> int: ... + def end_index(self) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/serializers/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/serializers/__init__.pyi new file mode 100644 index 00000000..35305be2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/serializers/__init__.pyi @@ -0,0 +1,31 @@ +from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Type, Union + +from django.db.models.base import Model + +from .base import ( + DeserializationError as DeserializationError, + DeserializedObject, + Deserializer as Deserializer, + M2MDeserializationError as M2MDeserializationError, + SerializationError as SerializationError, + Serializer as Serializer, + SerializerDoesNotExist as SerializerDoesNotExist, +) + +BUILTIN_SERIALIZERS: Any + +class BadSerializer: + internal_use_only: bool = ... + exception: BaseException = ... + def __init__(self, exception: BaseException) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + +def register_serializer(format: str, serializer_module: str, serializers: Optional[Dict[str, Any]] = ...) -> None: ... +def unregister_serializer(format: str) -> None: ... +def get_serializer(format: str) -> Union[Type[Serializer], BadSerializer]: ... +def get_serializer_formats() -> List[str]: ... +def get_public_serializer_formats() -> List[str]: ... +def get_deserializer(format: str) -> Union[Callable, Type[Deserializer]]: ... +def serialize(format: str, queryset: Iterable[Model], **options: Any) -> Any: ... +def deserialize(format: str, stream_or_string: Any, **options: Any) -> Iterator[DeserializedObject]: ... +def sort_dependencies(app_list: Iterable[Any]) -> List[Type[Model]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/serializers/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/serializers/base.pyi new file mode 100644 index 00000000..a910132f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/serializers/base.pyi @@ -0,0 +1,87 @@ +from datetime import date +from io import BufferedReader, StringIO, TextIOWrapper +from typing import Any, Dict, Iterable, List, Mapping, Optional, Type, Union, Collection +from uuid import UUID + +from django.core.management.base import OutputWrapper +from django.db.models.base import Model +from django.db.models.fields.related import ForeignKey, ManyToManyField + +from django.db.models.fields import Field + +class SerializerDoesNotExist(KeyError): ... +class SerializationError(Exception): ... + +class DeserializationError(Exception): + @classmethod + def WithData( + cls, original_exc: Exception, model: str, fk: Union[int, str], field_value: Optional[Union[List[str], str]] + ) -> DeserializationError: ... + +class M2MDeserializationError(Exception): + original_exc: Exception = ... + pk: List[str] = ... + def __init__(self, original_exc: Exception, pk: Union[List[str], str]) -> None: ... + +class ProgressBar: + progress_width: int = ... + output: None = ... + total_count: int = ... + prev_done: int = ... + def __init__(self, output: Optional[Union[StringIO, OutputWrapper]], total_count: int) -> None: ... + def update(self, count: int) -> None: ... + +class Serializer: + internal_use_only: bool = ... + progress_class: Any = ... + stream_class: Any = ... + options: Dict[str, Any] = ... + stream: Any = ... + selected_fields: Optional[Collection[str]] = ... + use_natural_foreign_keys: bool = ... + use_natural_primary_keys: bool = ... + first: bool = ... + def serialize( + self, + queryset: Iterable[Model], + *, + stream: Optional[Any] = ..., + fields: Optional[Collection[str]] = ..., + use_natural_foreign_keys: bool = ..., + use_natural_primary_keys: bool = ..., + progress_output: Optional[Any] = ..., + object_count: int = ..., + **options: Any + ) -> Any: ... + def start_serialization(self) -> None: ... + def end_serialization(self) -> None: ... + def start_object(self, obj: Any) -> None: ... + def end_object(self, obj: Any) -> None: ... + def handle_field(self, obj: Any, field: Any) -> None: ... + def handle_fk_field(self, obj: Any, field: Any) -> None: ... + def handle_m2m_field(self, obj: Any, field: Any) -> None: ... + def getvalue(self) -> Optional[Union[bytes, str]]: ... + +class Deserializer: + options: Dict[str, Any] = ... + stream: Any = ... + def __init__(self, stream_or_string: Union[BufferedReader, TextIOWrapper, str], **options: Any) -> None: ... + def __iter__(self) -> Deserializer: ... + def __next__(self) -> None: ... + +class DeserializedObject: + object: Any = ... + m2m_data: Dict[str, List[int]] = ... + deferred_fields: Mapping[Field, Any] + def __init__( + self, + obj: Model, + m2m_data: Optional[Dict[str, List[int]]] = ..., + deferred_fields: Optional[Mapping[Field, Any]] = ..., + ) -> None: ... + def save(self, save_m2m: bool = ..., using: Optional[str] = ..., **kwargs: Any) -> None: ... + def save_deferred_fields(self, using: Optional[str] = ...) -> None: ... + +def build_instance(Model: Type[Model], data: Dict[str, Optional[Union[date, int, str, UUID]]], db: str) -> Model: ... +def deserialize_m2m_values(field: ManyToManyField, field_value: Any, using: str) -> List[Any]: ... +def deserialize_fk_value(field: ForeignKey, field_value: Any, using: str) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/serializers/json.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/serializers/json.pyi new file mode 100644 index 00000000..06c4769a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/serializers/json.pyi @@ -0,0 +1,17 @@ +import json +from typing import Any, Dict + +from django.core.serializers.python import Serializer as PythonSerializer + +class Serializer(PythonSerializer): + json_kwargs: Dict[str, Any] + +def Deserializer(stream_or_string: Any, **options: Any) -> None: ... + +class DjangoJSONEncoder(json.JSONEncoder): + allow_nan: bool + check_circular: bool + ensure_ascii: bool + indent: int + skipkeys: bool + sort_keys: bool diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/serializers/python.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/serializers/python.pyi new file mode 100644 index 00000000..a348e49a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/serializers/python.pyi @@ -0,0 +1,15 @@ +from collections import OrderedDict +from typing import Any, Dict, Iterator, List, Optional + +from django.core.serializers.base import DeserializedObject +from django.db.models.base import Model + +from django.core.serializers import base + +class Serializer(base.Serializer): + objects: List[Any] = ... + def get_dump_object(self, obj: Model) -> OrderedDict: ... + +def Deserializer( + object_list: List[Dict[str, Any]], *, using: Optional[str] = ..., ignorenonexistent: bool = ..., **options: Any +) -> Iterator[DeserializedObject]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/servers/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/servers/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/servers/basehttp.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/servers/basehttp.pyi new file mode 100644 index 00000000..e16d5b85 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/servers/basehttp.pyi @@ -0,0 +1,36 @@ +import socketserver +from io import BytesIO +from typing import Any, Dict +from wsgiref import simple_server + +from django.core.handlers.wsgi import WSGIRequest, WSGIHandler +from django.core.wsgi import get_wsgi_application as get_wsgi_application # noqa: F401 + +class WSGIServer(simple_server.WSGIServer): + request_queue_size: int = ... + address_family: Any = ... + allow_reuse_address: Any = ... + def __init__(self, *args: Any, ipv6: bool = ..., allow_reuse_address: bool = ..., **kwargs: Any) -> None: ... + def handle_error(self, request: Any, client_address: Any) -> None: ... + +class ThreadedWSGIServer(socketserver.ThreadingMixIn, WSGIServer): ... + +class ServerHandler(simple_server.ServerHandler): + def handle_error(self) -> None: ... + +class WSGIRequestHandler(simple_server.WSGIRequestHandler): + close_connection: bool + connection: WSGIRequest + request: WSGIRequest + rfile: BytesIO + wfile: BytesIO + protocol_version: str = ... + def address_string(self) -> str: ... + def log_message(self, format: str, *args: Any) -> None: ... + def get_environ(self) -> Dict[str, str]: ... + raw_requestline: bytes = ... + requestline: str = ... + request_version: str = ... + def handle(self) -> None: ... + +def get_internal_wsgi_application() -> WSGIHandler: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/signals.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/signals.pyi new file mode 100644 index 00000000..edd2b308 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/signals.pyi @@ -0,0 +1,6 @@ +from django.dispatch import Signal + +request_started: Signal = ... +request_finished: Signal = ... +got_request_exception: Signal = ... +setting_changed: Signal = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/signing.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/signing.pyi new file mode 100644 index 00000000..16d64c04 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/signing.pyi @@ -0,0 +1,42 @@ +from datetime import timedelta +from typing import Any, Dict, Optional, Protocol, Type, Union + +class BadSignature(Exception): ... +class SignatureExpired(BadSignature): ... + +def b64_encode(s: bytes) -> bytes: ... +def b64_decode(s: bytes) -> bytes: ... +def base64_hmac(salt: str, value: Union[bytes, str], key: Union[bytes, str]) -> str: ... +def get_cookie_signer(salt: str = ...) -> TimestampSigner: ... + +class Serializer(Protocol): + def dumps(self, obj: Any) -> bytes: ... + def loads(self, data: bytes) -> Any: ... + +class JSONSerializer: + def dumps(self, obj: Any) -> bytes: ... + def loads(self, data: bytes) -> Dict[str, Union[int, str]]: ... + +def dumps( + obj: Any, key: None = ..., salt: str = ..., serializer: Type[Serializer] = ..., compress: bool = ... +) -> str: ... +def loads( + s: str, + key: None = ..., + salt: str = ..., + serializer: Type[Serializer] = ..., + max_age: Optional[Union[int, timedelta]] = ..., +) -> Any: ... + +class Signer: + key: str = ... + sep: str = ... + salt: str = ... + def __init__(self, key: Optional[Union[bytes, str]] = ..., sep: str = ..., salt: Optional[str] = ...) -> None: ... + def signature(self, value: Union[bytes, str]) -> str: ... + def sign(self, value: str) -> str: ... + def unsign(self, signed_value: str) -> str: ... + +class TimestampSigner(Signer): + def timestamp(self) -> str: ... + def unsign(self, value: str, max_age: Optional[Union[int, timedelta]] = ...) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/validators.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/validators.pyi new file mode 100644 index 00000000..1868ac18 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/validators.pyi @@ -0,0 +1,121 @@ +from decimal import Decimal +from re import RegexFlag +from typing import Any, Callable, Collection, Dict, List, Optional, Pattern, Tuple, Union + +from django.core.files.base import File + +EMPTY_VALUES: Any + +_Regex = Union[str, Pattern[str]] +_ErrorMessage = Union[str, Any] + +def _lazy_re_compile(regex: _Regex, flags: int = ...): ... + +class RegexValidator: + regex: _Regex = ... + message: str = ... + code: str = ... + inverse_match: bool = ... + flags: int = ... + def __init__( + self, + regex: Optional[_Regex] = ..., + message: Optional[_ErrorMessage] = ..., + code: Optional[str] = ..., + inverse_match: Optional[bool] = ..., + flags: Optional[RegexFlag] = ..., + ) -> None: ... + def __call__(self, value: Optional[str]) -> None: ... + +class URLValidator(RegexValidator): + ul: str = ... + ipv4_re: str = ... + ipv6_re: str = ... + hostname_re: str = ... + domain_re: str = ... + tld_re: str = ... + host_re: str = ... + schemes: List[str] = ... + def __init__(self, schemes: Optional[Collection[str]] = ..., **kwargs: Any) -> None: ... + +integer_validator: RegexValidator = ... + +def validate_integer(value: Optional[Union[float, str]]) -> None: ... + +class EmailValidator: + message: str = ... + code: str = ... + user_regex: Pattern = ... + domain_regex: Pattern = ... + literal_regex: Pattern = ... + domain_whitelist: List[str] = ... + def __init__( + self, + message: Optional[_ErrorMessage] = ..., + code: Optional[str] = ..., + whitelist: Optional[Collection[str]] = ..., + ) -> None: ... + def __call__(self, value: Optional[str]) -> None: ... + def validate_domain_part(self, domain_part: str) -> bool: ... + +validate_email: EmailValidator = ... +slug_re: Pattern = ... +validate_slug: RegexValidator = ... +slug_unicode_re: Pattern = ... +validate_unicode_slug: RegexValidator = ... + +def validate_ipv4_address(value: str) -> None: ... +def validate_ipv6_address(value: str) -> None: ... +def validate_ipv46_address(value: str) -> None: ... + +_IPValidator = Tuple[Callable[[Any], None], str] +ip_address_validator_map: Dict[str, _IPValidator] + +def ip_address_validators(protocol: str, unpack_ipv4: bool) -> _IPValidator: ... +def int_list_validator( + sep: str = ..., message: Optional[_ErrorMessage] = ..., code: str = ..., allow_negative: bool = ... +) -> RegexValidator: ... + +validate_comma_separated_integer_list: Any + +class BaseValidator: + message: str = ... + code: str = ... + limit_value: Any = ... + def __init__(self, limit_value: Any, message: Optional[_ErrorMessage] = ...) -> None: ... + def __call__(self, value: Any) -> None: ... + def compare(self, a: Any, b: Any) -> bool: ... + def clean(self, x: Any) -> Any: ... + +class MaxValueValidator(BaseValidator): ... +class MinValueValidator(BaseValidator): ... +class MinLengthValidator(BaseValidator): ... +class MaxLengthValidator(BaseValidator): ... + +class DecimalValidator: + messages: Dict[str, str] = ... + max_digits: int = ... + decimal_places: int = ... + def __init__(self, max_digits: Optional[Union[int, str]], decimal_places: Optional[Union[int, str]]) -> None: ... + def __call__(self, value: Decimal) -> None: ... + +class FileExtensionValidator: + message: str = ... + code: str = ... + allowed_extensions: List[str] = ... + def __init__( + self, + allowed_extensions: Optional[Collection[str]] = ..., + message: Optional[_ErrorMessage] = ..., + code: Optional[str] = ..., + ) -> None: ... + def __call__(self, value: File) -> None: ... + +def get_available_image_extensions() -> List[str]: ... +def validate_image_file_extension(value: File) -> None: ... + +class ProhibitNullCharactersValidator: + message: str = ... + code: str = ... + def __init__(self, message: Optional[_ErrorMessage] = ..., code: Optional[str] = ...) -> None: ... + def __call__(self, value: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/wsgi.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/wsgi.pyi new file mode 100644 index 00000000..ac5938a5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/core/wsgi.pyi @@ -0,0 +1,3 @@ +from django.core.handlers.wsgi import WSGIHandler + +def get_wsgi_application() -> WSGIHandler: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/__init__.pyi new file mode 100644 index 00000000..5211356a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/__init__.pyi @@ -0,0 +1,31 @@ +from typing import Any + +from .utils import ( + DEFAULT_DB_ALIAS as DEFAULT_DB_ALIAS, + DJANGO_VERSION_PICKLE_KEY as DJANGO_VERSION_PICKLE_KEY, + ProgrammingError as ProgrammingError, + IntegrityError as IntegrityError, + OperationalError as OperationalError, + DatabaseError as DatabaseError, + DataError as DataError, + NotSupportedError as NotSupportedError, + InternalError as InternalError, + InterfaceError as InterfaceError, + ConnectionHandler as ConnectionHandler, + Error as Error, + ConnectionDoesNotExist as ConnectionDoesNotExist, +) + +from . import migrations + +connections: Any +router: Any +connection: Any + +class DefaultConnectionProxy: + def __getattr__(self, item: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __delattr__(self, name: str) -> None: ... + +def close_old_connections(**kwargs: Any) -> None: ... +def reset_queries(**kwargs: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/base.pyi new file mode 100644 index 00000000..eafdad55 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/base.pyi @@ -0,0 +1,102 @@ +from typing import Any, Callable, Dict, Iterator, List, Optional + +from django.db.backends.base.client import BaseDatabaseClient +from django.db.backends.base.creation import BaseDatabaseCreation +from django.db.backends.base.validation import BaseDatabaseValidation +from django.db.backends.utils import CursorDebugWrapper, CursorWrapper + +from django.db.backends.base.schema import BaseDatabaseSchemaEditor + +from django.db.backends.base.features import BaseDatabaseFeatures + +from django.db.backends.base.introspection import BaseDatabaseIntrospection + +NO_DB_ALIAS: str + +class BaseDatabaseWrapper: + data_types: Any = ... + data_types_suffix: Any = ... + data_type_check_constraints: Any = ... + ops: Any = ... + vendor: str = ... + display_name: str = ... + SchemaEditorClass: Optional[BaseDatabaseSchemaEditor] = ... + client_class: Any = ... + creation_class: Any = ... + features_class: Any = ... + introspection_class: Any = ... + ops_class: Any = ... + validation_class: Any = ... + queries_limit: int = ... + connection: Any = ... + settings_dict: Any = ... + alias: str = ... + queries_log: Any = ... + force_debug_cursor: bool = ... + autocommit: bool = ... + in_atomic_block: bool = ... + savepoint_state: int = ... + savepoint_ids: Any = ... + commit_on_exit: bool = ... + needs_rollback: bool = ... + close_at: Optional[Any] = ... + closed_in_transaction: bool = ... + errors_occurred: bool = ... + allow_thread_sharing: bool = ... + run_on_commit: List[Any] = ... + run_commit_hooks_on_set_autocommit_on: bool = ... + execute_wrappers: List[Any] = ... + client: BaseDatabaseClient = ... + creation: BaseDatabaseCreation = ... + features: BaseDatabaseFeatures = ... + introspection: BaseDatabaseIntrospection = ... + validation: BaseDatabaseValidation = ... + def __init__( + self, settings_dict: Dict[str, Dict[str, str]], alias: str = ..., allow_thread_sharing: bool = ... + ) -> None: ... + def ensure_timezone(self) -> bool: ... + def timezone(self): ... + def timezone_name(self): ... + @property + def queries_logged(self) -> bool: ... + @property + def queries(self) -> List[Dict[str, str]]: ... + def get_connection_params(self) -> None: ... + def get_new_connection(self, conn_params: Any) -> None: ... + def init_connection_state(self) -> None: ... + def create_cursor(self, name: Optional[Any] = ...) -> None: ... + def connect(self) -> None: ... + def check_settings(self) -> None: ... + def ensure_connection(self) -> None: ... + def cursor(self) -> CursorWrapper: ... + def commit(self) -> None: ... + def rollback(self) -> None: ... + def close(self) -> None: ... + def savepoint(self) -> str: ... + def savepoint_rollback(self, sid: str) -> None: ... + def savepoint_commit(self, sid: str) -> None: ... + def clean_savepoints(self) -> None: ... + def get_autocommit(self) -> bool: ... + def set_autocommit(self, autocommit: bool, force_begin_transaction_with_broken_autocommit: bool = ...) -> None: ... + def get_rollback(self) -> bool: ... + def set_rollback(self, rollback: bool) -> None: ... + def validate_no_atomic_block(self) -> None: ... + def validate_no_broken_transaction(self) -> None: ... + def constraint_checks_disabled(self) -> Iterator[None]: ... + def disable_constraint_checking(self): ... + def enable_constraint_checking(self) -> None: ... + def check_constraints(self, table_names: Optional[Any] = ...) -> None: ... + def is_usable(self) -> None: ... + def close_if_unusable_or_obsolete(self) -> None: ... + def validate_thread_sharing(self) -> None: ... + def prepare_database(self) -> None: ... + def wrap_database_errors(self) -> Any: ... + def chunked_cursor(self) -> CursorWrapper: ... + def make_debug_cursor(self, cursor: CursorWrapper) -> CursorDebugWrapper: ... + def make_cursor(self, cursor: CursorWrapper) -> CursorWrapper: ... + def temporary_connection(self) -> None: ... + def schema_editor(self, *args: Any, **kwargs: Any) -> BaseDatabaseSchemaEditor: ... + def on_commit(self, func: Callable) -> None: ... + def run_and_clear_commit_hooks(self) -> None: ... + def execute_wrapper(self, wrapper: Callable) -> Iterator[None]: ... + def copy(self, alias: None = ..., allow_thread_sharing: None = ...) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/client.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/client.pyi new file mode 100644 index 00000000..6fdf5cea --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/client.pyi @@ -0,0 +1,9 @@ +from typing import Any + +from django.db.backends.base.base import BaseDatabaseWrapper + +class BaseDatabaseClient: + executable_name: Any = ... + connection: Any = ... + def __init__(self, connection: BaseDatabaseWrapper) -> None: ... + def runshell(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/creation.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/creation.pyi new file mode 100644 index 00000000..8904232f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/creation.pyi @@ -0,0 +1,24 @@ +from typing import Any, Dict, Optional, Tuple, Union + +from django.db.backends.base.base import BaseDatabaseWrapper + +TEST_DATABASE_PREFIX: str + +class BaseDatabaseCreation: + connection: Any = ... + def __init__(self, connection: BaseDatabaseWrapper) -> None: ... + def create_test_db( + self, verbosity: int = ..., autoclobber: bool = ..., serialize: bool = ..., keepdb: bool = ... + ) -> str: ... + def set_as_test_mirror( + self, primary_settings_dict: Dict[str, Optional[Union[Dict[str, None], int, str]]] + ) -> None: ... + def serialize_db_to_string(self) -> str: ... + def deserialize_db_from_string(self, data: str) -> None: ... + def clone_test_db(self, suffix: Any, verbosity: int = ..., autoclobber: bool = ..., keepdb: bool = ...) -> None: ... + def get_test_db_clone_settings(self, suffix: Any): ... + def destroy_test_db( + self, old_database_name: str = ..., verbosity: int = ..., keepdb: bool = ..., suffix: None = ... + ) -> None: ... + def sql_table_creation_suffix(self): ... + def test_db_signature(self) -> Tuple[str, str, str, str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/features.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/features.pyi new file mode 100644 index 00000000..8d24f2a5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/features.pyi @@ -0,0 +1,100 @@ +from typing import Any + +from django.db.backends.base.base import BaseDatabaseWrapper + +class BaseDatabaseFeatures: + gis_enabled: bool = ... + allows_group_by_pk: bool = ... + allows_group_by_selected_pks: bool = ... + empty_fetchmany_value: Any = ... + update_can_self_select: bool = ... + interprets_empty_strings_as_nulls: bool = ... + supports_nullable_unique_constraints: bool = ... + supports_partially_nullable_unique_constraints: bool = ... + can_use_chunked_reads: bool = ... + can_return_id_from_insert: bool = ... + can_return_ids_from_bulk_insert: bool = ... + has_bulk_insert: bool = ... + uses_savepoints: bool = ... + can_release_savepoints: bool = ... + related_fields_match_type: bool = ... + allow_sliced_subqueries_with_in: bool = ... + has_select_for_update: bool = ... + has_select_for_update_nowait: bool = ... + has_select_for_update_skip_locked: bool = ... + has_select_for_update_of: bool = ... + select_for_update_of_column: bool = ... + test_db_allows_multiple_connections: bool = ... + supports_unspecified_pk: bool = ... + supports_forward_references: bool = ... + truncates_names: bool = ... + has_real_datatype: bool = ... + supports_subqueries_in_group_by: bool = ... + has_native_uuid_field: bool = ... + has_native_duration_field: bool = ... + supports_temporal_subtraction: bool = ... + supports_regex_backreferencing: bool = ... + supports_date_lookup_using_string: bool = ... + supports_timezones: bool = ... + has_zoneinfo_database: bool = ... + requires_explicit_null_ordering_when_grouping: bool = ... + nulls_order_largest: bool = ... + max_query_params: Any = ... + allows_auto_pk_0: bool = ... + can_defer_constraint_checks: bool = ... + supports_mixed_date_datetime_comparisons: bool = ... + supports_tablespaces: bool = ... + supports_sequence_reset: bool = ... + can_introspect_default: bool = ... + can_introspect_foreign_keys: bool = ... + can_introspect_autofield: bool = ... + can_introspect_big_integer_field: bool = ... + can_introspect_binary_field: bool = ... + can_introspect_decimal_field: bool = ... + can_introspect_ip_address_field: bool = ... + can_introspect_positive_integer_field: bool = ... + can_introspect_small_integer_field: bool = ... + can_introspect_time_field: bool = ... + introspected_boolean_field_type: str = ... + supports_index_column_ordering: bool = ... + can_distinct_on_fields: bool = ... + autocommits_when_autocommit_is_off: bool = ... + atomic_transactions: bool = ... + can_rollback_ddl: bool = ... + supports_atomic_references_rename: bool = ... + supports_combined_alters: bool = ... + supports_foreign_keys: bool = ... + supports_column_check_constraints: bool = ... + supports_paramstyle_pyformat: bool = ... + requires_literal_defaults: bool = ... + connection_persists_old_columns: bool = ... + closed_cursor_error_class: Any = ... + has_case_insensitive_like: bool = ... + requires_sqlparse_for_splitting: bool = ... + bare_select_suffix: str = ... + implied_column_null: bool = ... + uppercases_column_names: bool = ... + supports_select_for_update_with_limit: bool = ... + greatest_least_ignores_nulls: bool = ... + can_clone_databases: bool = ... + ignores_table_name_case: bool = ... + for_update_after_from: bool = ... + supports_select_union: bool = ... + supports_select_intersection: bool = ... + supports_select_difference: bool = ... + supports_slicing_ordering_in_compound: bool = ... + supports_aggregate_filter_clause: bool = ... + supports_index_on_text_field: bool = ... + supports_over_clause: bool = ... + supports_cast_with_precision: bool = ... + create_test_procedure_without_params_sql: Any = ... + create_test_procedure_with_int_param_sql: Any = ... + supports_callproc_kwargs: bool = ... + db_functions_convert_bytes_to_str: bool = ... + supported_explain_formats: Any = ... + validates_explain_options: bool = ... + connection: Any = ... + def __init__(self, connection: BaseDatabaseWrapper) -> None: ... + def supports_explaining_query_execution(self) -> bool: ... + def supports_transactions(self): ... + def supports_stddev(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/introspection.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/introspection.pyi new file mode 100644 index 00000000..33d128fe --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/introspection.pyi @@ -0,0 +1,27 @@ +from collections import namedtuple +from typing import Any, Dict, List, Optional, Set, Type + +from django.db.backends.base.base import BaseDatabaseWrapper +from django.db.backends.utils import CursorWrapper +from django.db.models.base import Model + +TableInfo = namedtuple("TableInfo", ["name", "type"]) + +FieldInfo = namedtuple("FieldInfo", "name type_code display_size internal_size precision scale null_ok default") + +class BaseDatabaseIntrospection: + data_types_reverse: Any = ... + connection: Any = ... + def __init__(self, connection: BaseDatabaseWrapper) -> None: ... + def get_field_type(self, data_type: str, description: FieldInfo) -> str: ... + def table_name_converter(self, name: str) -> str: ... + def column_name_converter(self, name: str) -> str: ... + def table_names(self, cursor: Optional[CursorWrapper] = ..., include_views: bool = ...) -> List[str]: ... + def get_table_list(self, cursor: Any) -> None: ... + def django_table_names(self, only_existing: bool = ..., include_views: bool = ...) -> List[str]: ... + def installed_models(self, tables: List[str]) -> Set[Type[Model]]: ... + def sequence_list(self) -> List[Dict[str, str]]: ... + def get_sequences(self, cursor: Any, table_name: Any, table_fields: Any = ...) -> None: ... + def get_key_columns(self, cursor: Any, table_name: Any) -> None: ... + def get_primary_key_column(self, cursor: Any, table_name: Any): ... + def get_constraints(self, cursor: Any, table_name: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/operations.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/operations.pyi new file mode 100644 index 00000000..fa9905c4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/operations.pyi @@ -0,0 +1,104 @@ +from datetime import date, datetime, timedelta, time +from decimal import Decimal +from typing import Any, List, Optional, Sequence, Tuple, Type, Union + +from django.core.management.color import Style +from django.db.backends.base.base import BaseDatabaseWrapper +from django.db.backends.utils import CursorWrapper +from django.db.models.base import Model +from django.db.models.expressions import Case, Expression +from django.db.models.sql.compiler import SQLCompiler + +from django.db import DefaultConnectionProxy +from django.db.models.fields import Field + +_Connection = Union[DefaultConnectionProxy, BaseDatabaseWrapper] + +class BaseDatabaseOperations: + compiler_module: str = ... + integer_field_ranges: Any = ... + set_operators: Any = ... + cast_data_types: Any = ... + cast_char_field_without_max_length: Any = ... + PRECEDING: str = ... + FOLLOWING: str = ... + UNBOUNDED_PRECEDING: Any = ... + UNBOUNDED_FOLLOWING: Any = ... + CURRENT_ROW: str = ... + explain_prefix: Any = ... + connection: _Connection = ... + def __init__(self, connection: Optional[_Connection]) -> None: ... + def autoinc_sql(self, table: str, column: str) -> None: ... + def bulk_batch_size(self, fields: Any, objs: Any): ... + def cache_key_culling_sql(self) -> str: ... + def unification_cast_sql(self, output_field: Field) -> str: ... + def date_extract_sql(self, lookup_type: None, field_name: None) -> Any: ... + def date_interval_sql(self, timedelta: None) -> Any: ... + def date_trunc_sql(self, lookup_type: None, field_name: None) -> Any: ... + def datetime_cast_date_sql(self, field_name: None, tzname: None) -> Any: ... + def datetime_cast_time_sql(self, field_name: None, tzname: None) -> Any: ... + def datetime_extract_sql(self, lookup_type: None, field_name: None, tzname: None) -> Any: ... + def datetime_trunc_sql(self, lookup_type: None, field_name: None, tzname: None) -> Any: ... + def time_trunc_sql(self, lookup_type: None, field_name: None) -> Any: ... + def time_extract_sql(self, lookup_type: None, field_name: None) -> Any: ... + def deferrable_sql(self) -> str: ... + def distinct_sql(self, fields: List[str], params: Optional[List[Any]]) -> Tuple[List[str], List[Any]]: ... + def fetch_returned_insert_id(self, cursor: Any): ... + def field_cast_sql(self, db_type: Optional[str], internal_type: str) -> str: ... + def force_no_ordering(self) -> List[Any]: ... + def for_update_sql(self, nowait: bool = ..., skip_locked: bool = ..., of: Any = ...): ... + def limit_offset_sql(self, low_mark: int, high_mark: Optional[int]) -> str: ... + def last_executed_query(self, cursor: Any, sql: Any, params: Any): ... + def last_insert_id(self, cursor: CursorWrapper, table_name: str, pk_name: str) -> int: ... + def lookup_cast(self, lookup_type: str, internal_type: str = ...) -> str: ... + def max_in_list_size(self) -> None: ... + def max_name_length(self) -> None: ... + def no_limit_value(self) -> Any: ... + def pk_default_value(self) -> str: ... + def prepare_sql_script(self, sql: Any): ... + def process_clob(self, value: str) -> str: ... + def return_insert_id(self) -> None: ... + def compiler(self, compiler_name: str) -> Type[SQLCompiler]: ... + def quote_name(self, name: str) -> Any: ... + def random_function_sql(self): ... + def regex_lookup(self, lookup_type: str) -> Any: ... + def savepoint_create_sql(self, sid: str) -> str: ... + def savepoint_commit_sql(self, sid: str) -> str: ... + def savepoint_rollback_sql(self, sid: str) -> str: ... + def set_time_zone_sql(self) -> str: ... + def sql_flush(self, style: None, tables: None, sequences: None, allow_cascade: bool = ...) -> Any: ... + def execute_sql_flush(self, using: str, sql_list: List[str]) -> None: ... + def sequence_reset_by_name_sql(self, style: None, sequences: List[Any]) -> List[Any]: ... + def sequence_reset_sql(self, style: Style, model_list: Sequence[Type[Model]]) -> List[Any]: ... + def start_transaction_sql(self) -> str: ... + def end_transaction_sql(self, success: bool = ...) -> str: ... + def tablespace_sql(self, tablespace: Optional[str], inline: bool = ...) -> str: ... + def prep_for_like_query(self, x: str) -> str: ... + prep_for_iexact_query: Any = ... + def validate_autopk_value(self, value: int) -> int: ... + def adapt_unknown_value(self, value: Any) -> Any: ... + def adapt_datefield_value(self, value: Optional[date]) -> Optional[str]: ... + def adapt_datetimefield_value(self, value: Optional[datetime]) -> Optional[str]: ... + def adapt_timefield_value(self, value: Optional[Union[datetime, time]]) -> Optional[str]: ... + def adapt_decimalfield_value( + self, value: Optional[Decimal], max_digits: Optional[int] = ..., decimal_places: Optional[int] = ... + ) -> Optional[str]: ... + def adapt_ipaddressfield_value(self, value: Optional[str]) -> Optional[str]: ... + def year_lookup_bounds_for_date_field(self, value: int) -> List[str]: ... + def year_lookup_bounds_for_datetime_field(self, value: int) -> List[str]: ... + def get_db_converters(self, expression: Expression) -> List[Any]: ... + def convert_durationfield_value( + self, value: Optional[float], expression: Expression, connection: _Connection + ) -> Optional[timedelta]: ... + def check_expression_support(self, expression: Any) -> None: ... + def combine_expression(self, connector: str, sub_expressions: List[str]) -> str: ... + def combine_duration_expression(self, connector: Any, sub_expressions: Any): ... + def binary_placeholder_sql(self, value: Optional[Case]) -> str: ... + def modify_insert_params(self, placeholder: str, params: Any) -> Any: ... + def integer_field_range(self, internal_type: Any): ... + def subtract_temporals(self, internal_type: Any, lhs: Any, rhs: Any): ... + def window_frame_start(self, start: Any): ... + def window_frame_end(self, end: Any): ... + def window_frame_rows_start_end(self, start: Optional[int] = ..., end: Optional[int] = ...) -> Any: ... + def window_frame_range_start_end(self, start: Optional[int] = ..., end: Optional[int] = ...) -> Any: ... + def explain_query_prefix(self, format: Optional[str] = ..., **options: Any) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/schema.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/schema.pyi new file mode 100644 index 00000000..4da42484 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/schema.pyi @@ -0,0 +1,77 @@ +from typing import Any, ContextManager, List, Optional, Sequence, Tuple, Type, Union + +from django.db.backends.ddl_references import Statement +from django.db.models.base import Model +from django.db.models.indexes import Index + +from django.db.models.fields import Field + +logger: Any + +class BaseDatabaseSchemaEditor(ContextManager[Any]): + sql_create_table: str = ... + sql_rename_table: str = ... + sql_retablespace_table: str = ... + sql_delete_table: str = ... + sql_create_column: str = ... + sql_alter_column: str = ... + sql_alter_column_type: str = ... + sql_alter_column_null: str = ... + sql_alter_column_not_null: str = ... + sql_alter_column_default: str = ... + sql_alter_column_no_default: str = ... + sql_delete_column: str = ... + sql_rename_column: str = ... + sql_update_with_default: str = ... + sql_create_check: str = ... + sql_delete_check: str = ... + sql_create_unique: str = ... + sql_delete_unique: str = ... + sql_create_fk: str = ... + sql_create_inline_fk: str = ... + sql_delete_fk: str = ... + sql_create_index: str = ... + sql_delete_index: str = ... + sql_create_pk: str = ... + sql_delete_pk: str = ... + sql_delete_procedure: str = ... + connection: Any = ... + collect_sql: bool = ... + collected_sql: Any = ... + atomic_migration: Any = ... + def __init__(self, connection: Any, collect_sql: bool = ..., atomic: bool = ...) -> None: ... + deferred_sql: Any = ... + atomic: Any = ... + def __enter__(self) -> BaseDatabaseSchemaEditor: ... + def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None: ... + def execute(self, sql: Union[Statement, str], params: Optional[Union[List[int], Tuple]] = ...) -> None: ... + def quote_name(self, name: str) -> str: ... + def column_sql( + self, model: Type[Model], field: Field, include_default: bool = ... + ) -> Tuple[Optional[str], Optional[List[Any]]]: ... + def skip_default(self, field: Any): ... + def prepare_default(self, value: Any) -> None: ... + def effective_default(self, field: Field) -> Optional[Union[int, str]]: ... + def quote_value(self, value: Any) -> None: ... + def create_model(self, model: Type[Model]) -> None: ... + def delete_model(self, model: Type[Model]) -> None: ... + def add_index(self, model: Type[Model], index: Index) -> None: ... + def remove_index(self, model: Type[Model], index: Index) -> None: ... + def alter_unique_together( + self, + model: Type[Model], + old_unique_together: Sequence[Sequence[str]], + new_unique_together: Sequence[Sequence[str]], + ) -> None: ... + def alter_index_together( + self, + model: Type[Model], + old_index_together: Sequence[Sequence[str]], + new_index_together: Sequence[Sequence[str]], + ) -> None: ... + def alter_db_table(self, model: Type[Model], old_db_table: str, new_db_table: str) -> None: ... + def alter_db_tablespace(self, model: Any, old_db_tablespace: Any, new_db_tablespace: Any) -> None: ... + def add_field(self, model: Any, field: Any): ... + def remove_field(self, model: Any, field: Any): ... + def alter_field(self, model: Type[Model], old_field: Field, new_field: Field, strict: bool = ...) -> None: ... + def remove_procedure(self, procedure_name: Any, param_types: Any = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/validation.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/validation.pyi new file mode 100644 index 00000000..382f4c1a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/base/validation.pyi @@ -0,0 +1,11 @@ +from typing import Any, List + +from django.db.backends.base.base import BaseDatabaseWrapper + +from django.db.models.fields import Field + +class BaseDatabaseValidation: + connection: Any = ... + def __init__(self, connection: BaseDatabaseWrapper) -> None: ... + def check(self, **kwargs: Any) -> List[Any]: ... + def check_field(self, field: Field, **kwargs: Any) -> List[Any]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/ddl_references.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/ddl_references.pyi new file mode 100644 index 00000000..dd59ccac --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/ddl_references.pyi @@ -0,0 +1,66 @@ +from typing import Any, Callable, List, Tuple, Union, Dict + +class Reference: + def references_table(self, table: Any): ... + def references_column(self, table: Any, column: Any): ... + def rename_table_references(self, old_table: Any, new_table: Any) -> None: ... + def rename_column_references(self, table: Any, old_column: Any, new_column: Any) -> None: ... + +class Table(Reference): + table: str = ... + quote_name: Callable = ... + def __init__(self, table: str, quote_name: Callable) -> None: ... + def references_table(self, table: str) -> bool: ... + def rename_table_references(self, old_table: str, new_table: str) -> None: ... + +class TableColumns(Table): + table: str = ... + columns: List[str] = ... + def __init__(self, table: str, columns: List[str]) -> None: ... + def references_column(self, table: str, column: str) -> bool: ... + def rename_column_references(self, table: str, old_column: str, new_column: str) -> None: ... + +class Columns(TableColumns): + columns: List[str] + table: str + quote_name: Callable = ... + col_suffixes: Tuple = ... + def __init__( + self, table: str, columns: List[str], quote_name: Callable, col_suffixes: Union[List[str], Tuple] = ... + ) -> None: ... + +class IndexName(TableColumns): + columns: List[str] + table: str + suffix: str = ... + create_index_name: Callable = ... + def __init__(self, table: str, columns: List[str], suffix: str, create_index_name: Callable) -> None: ... + +class ForeignKeyName(TableColumns): + columns: List[str] + table: str + to_reference: TableColumns = ... + suffix_template: str = ... + create_fk_name: Callable = ... + def __init__( + self, + from_table: str, + from_columns: List[str], + to_table: str, + to_columns: List[str], + suffix_template: str, + create_fk_name: Callable, + ) -> None: ... + def references_table(self, table: str) -> bool: ... + def references_column(self, table: str, column: str) -> bool: ... + def rename_table_references(self, old_table: str, new_table: str) -> None: ... + def rename_column_references(self, table: str, old_column: str, new_column: str) -> None: ... + +class Statement(Reference): + template: str = ... + parts: Dict[str, Table] = ... + def __init__(self, template: str, **parts: Any) -> None: ... + def references_table(self, table: str) -> bool: ... + def references_column(self, table: str, column: str) -> bool: ... + def rename_table_references(self, old_table: str, new_table: str) -> None: ... + def rename_column_references(self, table: str, old_column: str, new_column: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/dummy/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/dummy/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/dummy/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/dummy/base.pyi new file mode 100644 index 00000000..93dd1624 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/dummy/base.pyi @@ -0,0 +1,31 @@ +from typing import Any + +from django.db.backends.base.base import BaseDatabaseWrapper +from django.db.backends.base.client import BaseDatabaseClient +from django.db.backends.base.creation import BaseDatabaseCreation +from django.db.backends.base.introspection import BaseDatabaseIntrospection +from django.db.backends.base.operations import BaseDatabaseOperations + +def complain(*args: Any, **kwargs: Any) -> Any: ... +def ignore(*args: Any, **kwargs: Any) -> None: ... + +class DatabaseOperations(BaseDatabaseOperations): + quote_name: Any = ... + +class DatabaseClient(BaseDatabaseClient): + runshell: Any = ... + +class DatabaseCreation(BaseDatabaseCreation): + create_test_db: Any = ... + destroy_test_db: Any = ... + +class DatabaseIntrospection(BaseDatabaseIntrospection): + get_table_list: Any = ... + get_table_description: Any = ... + get_relations: Any = ... + get_indexes: Any = ... + get_key_columns: Any = ... + +class DatabaseWrapper(BaseDatabaseWrapper): + operators: Any = ... + ensure_connection: Any = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/mysql/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/mysql/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/mysql/client.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/mysql/client.pyi new file mode 100644 index 00000000..212f15de --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/mysql/client.pyi @@ -0,0 +1,11 @@ +from typing import Dict, List, Optional, Union + +from django.db.backends.base.client import BaseDatabaseClient + +class DatabaseClient(BaseDatabaseClient): + executable_name: str = ... + @classmethod + def settings_to_cmd_args( + cls, settings_dict: Dict[str, Optional[Union[Dict[str, Dict[str, str]], int, str]]] + ) -> List[str]: ... + def runshell(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/base.pyi new file mode 100644 index 00000000..91674f3c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/base.pyi @@ -0,0 +1,17 @@ +from typing import Dict, Tuple + +from django.db.backends.base.base import BaseDatabaseWrapper + +def psycopg2_version() -> Tuple[int, ...]: ... + +PSYCOPG2_VERSION: Tuple[int, ...] = ... + +class DatabaseWrapper(BaseDatabaseWrapper): + operators: Dict[str, str] = ... + pattern_esc: str = ... + pattern_ops: Dict[str, str] = ... + + # PostgreSQL backend-specific attributes. + _named_cursor_idx: int = ... + @property + def pg_version(self) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/client.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/client.pyi new file mode 100644 index 00000000..ab8f4407 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/client.pyi @@ -0,0 +1,9 @@ +from typing import Dict + +from django.db.backends.base.client import BaseDatabaseClient + +class DatabaseClient(BaseDatabaseClient): + executable_name: str = ... + @classmethod + def runshell_db(cls, conn_params: Dict[str, str]) -> None: ... + def runshell(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/creation.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/creation.pyi new file mode 100644 index 00000000..07e23130 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/creation.pyi @@ -0,0 +1,3 @@ +from django.db.backends.base.creation import BaseDatabaseCreation + +class DatabaseCreation(BaseDatabaseCreation): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/operations.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/operations.pyi new file mode 100644 index 00000000..359719cf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/postgresql/operations.pyi @@ -0,0 +1,3 @@ +from django.db.backends.base.operations import BaseDatabaseOperations + +class DatabaseOperations(BaseDatabaseOperations): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/signals.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/signals.pyi new file mode 100644 index 00000000..3586e131 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/signals.pyi @@ -0,0 +1,3 @@ +from django.dispatch import Signal + +connection_created: Signal = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/base.pyi new file mode 100644 index 00000000..a468c3e6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/base.pyi @@ -0,0 +1,14 @@ +from sqlite3 import dbapi2 as Database +from typing import Any, Callable + +from django.db.backends.base.base import BaseDatabaseWrapper + +def decoder(conv_func: Callable) -> Callable: ... + +class DatabaseWrapper(BaseDatabaseWrapper): ... + +FORMAT_QMARK_REGEX: Any + +class SQLiteCursorWrapper(Database.Cursor): ... + +def check_sqlite_version() -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/creation.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/creation.pyi new file mode 100644 index 00000000..07e23130 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/creation.pyi @@ -0,0 +1,3 @@ +from django.db.backends.base.creation import BaseDatabaseCreation + +class DatabaseCreation(BaseDatabaseCreation): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/features.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/features.pyi new file mode 100644 index 00000000..bb773635 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/features.pyi @@ -0,0 +1,3 @@ +from django.db.backends.base.features import BaseDatabaseFeatures + +class DatabaseFeatures(BaseDatabaseFeatures): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/introspection.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/introspection.pyi new file mode 100644 index 00000000..f6282161 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/introspection.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional + +from django.db.backends.base.introspection import BaseDatabaseIntrospection + +field_size_re: Any + +def get_field_size(name: str) -> Optional[int]: ... + +class FlexibleFieldLookupDict: + base_data_types_reverse: Any = ... + def __getitem__(self, key: str) -> Any: ... + +class DatabaseIntrospection(BaseDatabaseIntrospection): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/operations.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/operations.pyi new file mode 100644 index 00000000..359719cf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/operations.pyi @@ -0,0 +1,3 @@ +from django.db.backends.base.operations import BaseDatabaseOperations + +class DatabaseOperations(BaseDatabaseOperations): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/schema.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/schema.pyi new file mode 100644 index 00000000..5c239c06 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/sqlite3/schema.pyi @@ -0,0 +1,3 @@ +from django.db.backends.base.schema import BaseDatabaseSchemaEditor + +class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/utils.pyi new file mode 100644 index 00000000..a867b517 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/backends/utils.pyi @@ -0,0 +1,47 @@ +import types +from datetime import date, datetime, time +from decimal import Decimal +from typing import Any, Dict, List, Mapping, Optional, Sequence, Tuple, Type, Union +from uuid import UUID + +logger: Any + +# Python types that can be adapted to SQL. +_SQLType = Union[None, bool, int, float, Decimal, str, bytes, datetime, UUID] + +class CursorWrapper: + cursor: Any = ... + db: Any = ... + def __init__(self, cursor: Any, db: Any) -> None: ... + WRAP_ERROR_ATTRS: Any = ... + def __getattr__(self, attr: str) -> Any: ... + def __iter__(self) -> None: ... + def __enter__(self) -> CursorWrapper: ... + def __exit__( + self, + exc_type: Optional[Type[BaseException]], + exc_value: Optional[BaseException], + tb: Optional[types.TracebackType], + ) -> None: ... + def callproc(self, procname: str, params: List[Any] = ..., kparams: Dict[str, int] = ...) -> Any: ... + def execute( + self, sql: str, params: Optional[Union[Sequence[_SQLType], Mapping[str, _SQLType]]] = ... + ) -> Optional[Any]: ... + def executemany( + self, sql: str, param_list: Sequence[Optional[Union[Sequence[_SQLType], Mapping[str, _SQLType]]]] + ) -> Optional[Any]: ... + +class CursorDebugWrapper(CursorWrapper): + cursor: Any + db: Any + +def typecast_date(s: Optional[str]) -> Optional[date]: ... +def typecast_time(s: Optional[str]) -> Optional[time]: ... +def typecast_timestamp(s: Optional[str]) -> Optional[date]: ... +def rev_typecast_decimal(d: Decimal) -> str: ... +def split_identifier(identifier: str) -> Tuple[str, str]: ... +def truncate_name(identifier: str, length: Optional[int] = ..., hash_len: int = ...) -> str: ... +def format_number( + value: Optional[Decimal], max_digits: Optional[int], decimal_places: Optional[int] +) -> Optional[str]: ... +def strip_quotes(table_name: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/__init__.pyi new file mode 100644 index 00000000..bf1bdcdd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/__init__.pyi @@ -0,0 +1,6 @@ +# Stubs for django.db.migrations (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .migration import Migration as Migration, swappable_dependency as swappable_dependency +from .operations import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/autodetector.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/autodetector.pyi new file mode 100644 index 00000000..0f86225d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/autodetector.pyi @@ -0,0 +1,67 @@ +from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union + +from django.db.migrations.graph import MigrationGraph +from django.db.migrations.migration import Migration +from django.db.migrations.operations.base import Operation +from django.db.migrations.questioner import MigrationQuestioner +from django.db.migrations.state import ProjectState +from django.db.models.fields import Field + +class MigrationAutodetector: + from_state: ProjectState = ... + to_state: ProjectState = ... + questioner: MigrationQuestioner = ... + existing_apps: Set[Any] = ... + def __init__( + self, from_state: ProjectState, to_state: ProjectState, questioner: Optional[MigrationQuestioner] = ... + ) -> None: ... + def changes( + self, + graph: MigrationGraph, + trim_to_apps: Optional[Set[str]] = ..., + convert_apps: Optional[Set[str]] = ..., + migration_name: Optional[str] = ..., + ) -> Dict[str, List[Migration]]: ... + def deep_deconstruct(self, obj: Any) -> Any: ... + def only_relation_agnostic_fields( + self, fields: List[Tuple[str, Field]] + ) -> List[Tuple[str, List[Any], Dict[str, Union[Callable, int, str]]]]: ... + def check_dependency( + self, operation: Operation, dependency: Tuple[str, str, Optional[str], Union[bool, str]] + ) -> bool: ... + def add_operation( + self, + app_label: str, + operation: Operation, + dependencies: Optional[List[Tuple[str, str, Optional[str], Union[bool, str]]]] = ..., + beginning: bool = ..., + ) -> None: ... + def swappable_first_key(self, item: Tuple[str, str]) -> Tuple[str, str]: ... + renamed_models: Any = ... + renamed_models_rel: Any = ... + def generate_renamed_models(self) -> None: ... + def generate_created_models(self) -> None: ... + def generate_created_proxies(self) -> None: ... + def generate_deleted_models(self) -> None: ... + def generate_deleted_proxies(self) -> None: ... + renamed_fields: Any = ... + def generate_renamed_fields(self) -> None: ... + def generate_added_fields(self) -> None: ... + def generate_removed_fields(self) -> None: ... + def generate_altered_fields(self) -> None: ... + def create_altered_indexes(self) -> None: ... + def generate_added_indexes(self) -> None: ... + def generate_removed_indexes(self) -> None: ... + def generate_altered_unique_together(self) -> None: ... + def generate_altered_index_together(self) -> None: ... + def generate_altered_db_table(self) -> None: ... + def generate_altered_options(self) -> None: ... + def generate_altered_order_with_respect_to(self) -> None: ... + def generate_altered_managers(self) -> None: ... + def arrange_for_graph( + self, changes: Dict[str, List[Migration]], graph: MigrationGraph, migration_name: Optional[str] = ... + ) -> Dict[str, List[Migration]]: ... + @classmethod + def suggest_name(cls, ops: List[Operation]) -> str: ... + @classmethod + def parse_number(cls, name: str) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/exceptions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/exceptions.pyi new file mode 100644 index 00000000..88941ead --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/exceptions.pyi @@ -0,0 +1,20 @@ +from typing import Optional, Tuple + +from django.db.migrations.migration import Migration +from django.db.utils import DatabaseError + +class AmbiguityError(Exception): ... +class BadMigrationError(Exception): ... +class CircularDependencyError(Exception): ... +class InconsistentMigrationHistory(Exception): ... +class InvalidBasesError(ValueError): ... +class IrreversibleError(RuntimeError): ... + +class NodeNotFoundError(LookupError): + message: str = ... + origin: None = ... + node: Tuple[str, str] = ... + def __init__(self, message: str, node: Tuple[str, str], origin: Optional[Migration] = ...) -> None: ... + +class MigrationSchemaMissing(DatabaseError): ... +class InvalidMigrationPlan(ValueError): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/executor.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/executor.pyi new file mode 100644 index 00000000..dc759d97 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/executor.pyi @@ -0,0 +1,40 @@ +from typing import Any, Callable, List, Optional, Set, Tuple, Union + +from django.db import DefaultConnectionProxy +from django.db.backends.base.base import BaseDatabaseWrapper +from django.db.migrations.migration import Migration + +from .loader import MigrationLoader +from .recorder import MigrationRecorder +from .state import ProjectState + +class MigrationExecutor: + connection: Any = ... + loader: MigrationLoader = ... + recorder: MigrationRecorder = ... + progress_callback: Callable = ... + def __init__( + self, + connection: Optional[Union[DefaultConnectionProxy, BaseDatabaseWrapper]], + progress_callback: Optional[Callable] = ..., + ) -> None: ... + def migration_plan( + self, targets: Union[List[Tuple[str, Optional[str]]], Set[Tuple[str, str]]], clean_start: bool = ... + ) -> List[Tuple[Migration, bool]]: ... + def migrate( + self, + targets: Optional[List[Tuple[str, Optional[str]]]], + plan: Optional[List[Tuple[Migration, bool]]] = ..., + state: Optional[ProjectState] = ..., + fake: bool = ..., + fake_initial: bool = ..., + ) -> ProjectState: ... + def collect_sql(self, plan: List[Tuple[Migration, bool]]) -> List[str]: ... + def apply_migration( + self, state: ProjectState, migration: Migration, fake: bool = ..., fake_initial: bool = ... + ) -> ProjectState: ... + def unapply_migration(self, state: ProjectState, migration: Migration, fake: bool = ...) -> ProjectState: ... + def check_replacements(self) -> None: ... + def detect_soft_applied( + self, project_state: Optional[ProjectState], migration: Migration + ) -> Tuple[bool, ProjectState]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/graph.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/graph.pyi new file mode 100644 index 00000000..acee1f7d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/graph.pyi @@ -0,0 +1,54 @@ +from typing import Any, Dict, List, Optional, Set, Tuple, Union + +from django.db.migrations.migration import Migration, SwappableTuple +from django.db.migrations.state import ProjectState + +RECURSION_DEPTH_WARNING: str + +class Node: + key: Tuple[str, str] = ... + children: Set[Any] = ... + parents: Set[Any] = ... + def __init__(self, key: Tuple[str, str]) -> None: ... + def __lt__(self, other: Union[Tuple[str, str], Node]) -> bool: ... + def __getitem__(self, item: int) -> str: ... + def add_child(self, child: Node) -> None: ... + def add_parent(self, parent: Node) -> None: ... + def ancestors(self) -> List[Tuple[str, str]]: ... + def descendants(self) -> List[Tuple[str, str]]: ... + +class DummyNode(Node): + origin: Any = ... + error_message: Any = ... + def __init__(self, key: Tuple[str, str], origin: Union[Migration, str], error_message: str) -> None: ... + def promote(self) -> None: ... + def raise_error(self) -> None: ... + +class MigrationGraph: + node_map: Dict[Any, Any] = ... + nodes: Dict[Any, Any] = ... + cached: bool = ... + def __init__(self) -> None: ... + def add_node(self, key: Tuple[str, str], migration: Optional[Migration]) -> None: ... + def add_dummy_node(self, key: Tuple[str, str], origin: Union[Migration, str], error_message: str) -> None: ... + def add_dependency( + self, + migration: Optional[Union[Migration, str]], + child: Tuple[str, str], + parent: Tuple[str, str], + skip_validation: bool = ..., + ) -> None: ... + def remove_replaced_nodes(self, replacement: Tuple[str, str], replaced: List[Tuple[str, str]]) -> None: ... + def remove_replacement_node(self, replacement: Tuple[str, str], replaced: List[Tuple[str, str]]) -> None: ... + def validate_consistency(self) -> None: ... + def clear_cache(self) -> None: ... + def forwards_plan(self, target: Tuple[str, str]) -> List[Tuple[str, str]]: ... + def backwards_plan(self, target: Union[Tuple[str, str], Node]) -> List[Tuple[str, str]]: ... + def iterative_dfs(self, start: Any, forwards: bool = ...): ... + def root_nodes(self, app: Optional[str] = ...) -> List[Tuple[str, str]]: ... + def leaf_nodes(self, app: Optional[str] = ...) -> List[Tuple[str, str]]: ... + def ensure_not_cyclic(self) -> None: ... + def make_state( + self, nodes: Optional[Tuple[str, str]] = ..., at_end: bool = ..., real_apps: List[str] = ... + ) -> ProjectState: ... + def __contains__(self, node: Union[Tuple[str, str], SwappableTuple]) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/loader.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/loader.pyi new file mode 100644 index 00000000..bd475aa2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/loader.pyi @@ -0,0 +1,31 @@ +from typing import Any, Dict, Optional, Sequence, Set, Tuple, Union + +from django.db.migrations.migration import Migration +from django.db.migrations.state import ProjectState + +MIGRATIONS_MODULE_NAME: str + +class MigrationLoader: + connection: Any = ... + disk_migrations: Dict[Tuple[str, str], Migration] = ... + applied_migrations: Set[Tuple[str, str]] = ... + ignore_no_migrations: bool = ... + def __init__(self, connection: Any, load: bool = ..., ignore_no_migrations: bool = ...) -> None: ... + @classmethod + def migrations_module(cls, app_label: str) -> Tuple[Optional[str], bool]: ... + unmigrated_apps: Set[str] = ... + migrated_apps: Set[str] = ... + def load_disk(self) -> None: ... + def get_migration(self, app_label: str, name_prefix: str) -> Migration: ... + def get_migration_by_prefix(self, app_label: str, name_prefix: str) -> Migration: ... + def check_key(self, key: Tuple[str, str], current_app: str) -> Optional[Tuple[str, str]]: ... + def add_internal_dependencies(self, key: Tuple[str, str], migration: Migration) -> None: ... + def add_external_dependencies(self, key: Tuple[str, str], migration: Migration) -> None: ... + graph: Any = ... + replacements: Any = ... + def build_graph(self) -> None: ... + def check_consistent_history(self, connection: Any) -> None: ... + def detect_conflicts(self) -> Dict[str, Set[str]]: ... + def project_state( + self, nodes: Optional[Union[Tuple[str, str], Sequence[Tuple[str, str]]]] = ..., at_end: bool = ... + ) -> ProjectState: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/migration.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/migration.pyi new file mode 100644 index 00000000..d13f4946 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/migration.pyi @@ -0,0 +1,28 @@ +from typing import Any, List, Tuple + +from django.db.backends.base.schema import BaseDatabaseSchemaEditor +from django.db.migrations.state import ProjectState + +class Migration: + operations: List[Any] = ... + dependencies: List[Any] = ... + run_before: List[Any] = ... + replaces: List[Any] = ... + initial: Any = ... + atomic: bool = ... + name: str = ... + app_label: str = ... + def __init__(self, name: str, app_label: str) -> None: ... + def mutate_state(self, project_state: ProjectState, preserve: bool = ...) -> ProjectState: ... + def apply( + self, project_state: ProjectState, schema_editor: BaseDatabaseSchemaEditor, collect_sql: bool = ... + ) -> ProjectState: ... + def unapply( + self, project_state: ProjectState, schema_editor: BaseDatabaseSchemaEditor, collect_sql: bool = ... + ) -> ProjectState: ... + +class SwappableTuple(Tuple[str, str]): + setting: str = ... + def __new__(cls, value: Tuple[str, str], setting: str) -> SwappableTuple: ... + +def swappable_dependency(value: str) -> SwappableTuple: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/__init__.pyi new file mode 100644 index 00000000..6a520feb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/__init__.pyi @@ -0,0 +1,22 @@ +from .fields import ( + AddField as AddField, + AlterField as AlterField, + RemoveField as RemoveField, + RenameField as RenameField, +) +from .models import ( + AddIndex as AddIndex, + AlterIndexTogether as AlterIndexTogether, + AlterModelManagers as AlterModelManagers, + AlterModelOptions as AlterModelOptions, + AlterModelTable as AlterModelTable, + AlterOrderWithRespectTo as AlterOrderWithRespectTo, + AlterUniqueTogether as AlterUniqueTogether, + CreateModel as CreateModel, + DeleteModel as DeleteModel, + RemoveIndex as RemoveIndex, + RenameModel as RenameModel, + AddConstraint as AddConstraint, + RemoveConstraint as RemoveConstraint, +) +from .special import RunPython as RunPython, RunSQL as RunSQL, SeparateDatabaseAndState as SeparateDatabaseAndState diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/base.pyi new file mode 100644 index 00000000..601aeb78 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/base.pyi @@ -0,0 +1,17 @@ +from typing import Any, List + +class Operation: + reversible: bool = ... + reduces_to_sql: bool = ... + atomic: bool = ... + elidable: bool = ... + serialization_expand_args: Any = ... + def deconstruct(self): ... + def state_forwards(self, app_label: Any, state: Any) -> None: ... + def database_forwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ... + def database_backwards(self, app_label: Any, schema_editor: Any, from_state: Any, to_state: Any) -> None: ... + def describe(self): ... + def references_model(self, name: str, app_label: str = ...) -> bool: ... + def references_field(self, model_name: str, name: str, app_label: str = ...) -> bool: ... + def allow_migrate_model(self, connection_alias: Any, model: Any): ... + def reduce(self, operation: Operation, in_between: List[Operation], app_label: str = ...) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/fields.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/fields.pyi new file mode 100644 index 00000000..1909aa38 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/fields.pyi @@ -0,0 +1,32 @@ +from typing import Any, Optional + +from django.db.models.fields import Field +from .base import Operation + +class FieldOperation(Operation): + model_name: str = ... + model_name_lower: str + name: str = ... + def __init__(self, model_name: str, name: str, field: Optional[Field] = ...) -> None: ... + def name_lower(self) -> str: ... + def is_same_model_operation(self, operation: FieldOperation) -> bool: ... + def is_same_field_operation(self, operation: AddField) -> bool: ... + +class AddField(FieldOperation): + field: Field = ... + preserve_default: bool = ... + def __init__(self, model_name: str, name: str, field: Field, preserve_default: bool = ...) -> None: ... + +class RemoveField(FieldOperation): ... + +class AlterField(FieldOperation): + field: Any = ... + preserve_default: Any = ... + def __init__(self, model_name: str, name: str, field: Field, preserve_default: bool = ...) -> None: ... + +class RenameField(FieldOperation): + old_name: Any = ... + new_name: Any = ... + def __init__(self, model_name: str, old_name: str, new_name: str) -> None: ... + def old_name_lower(self): ... + def new_name_lower(self) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/models.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/models.pyi new file mode 100644 index 00000000..b6cccf73 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/models.pyi @@ -0,0 +1,87 @@ +from typing import Any, Collection, Dict, List, Optional, Sequence, Tuple, Union + +from django.db.migrations.operations.base import Operation +from django.db.models.indexes import Index +from django.db.models.manager import Manager + +from django.db.models.constraints import BaseConstraint +from django.db.models.fields import Field + +class ModelOperation(Operation): + name: str = ... + def __init__(self, name: str) -> None: ... + def name_lower(self) -> str: ... + +class CreateModel(ModelOperation): + fields: Sequence[Tuple[str, Field]] = ... + options: Any = ... + bases: Optional[Sequence[Union[type, str]]] = ... + managers: Optional[Sequence[Tuple[str, Manager]]] = ... + def __init__( + self, + name: str, + fields: Sequence[Tuple[str, Field]], + options: Optional[Dict[str, Any]] = ..., + bases: Optional[Sequence[Union[type, str]]] = ..., + managers: Optional[Sequence[Tuple[str, Manager]]] = ..., + ) -> None: ... + def model_to_key(self, model: str) -> List[str]: ... + +class DeleteModel(ModelOperation): ... + +class RenameModel(ModelOperation): + old_name: Any = ... + new_name: Any = ... + def __init__(self, old_name: str, new_name: str) -> None: ... + def old_name_lower(self) -> str: ... + def new_name_lower(self) -> str: ... + +class AlterModelTable(ModelOperation): + table: Optional[str] = ... + def __init__(self, name: str, table: Optional[str]) -> None: ... + +class ModelOptionOperation(ModelOperation): ... +class FieldRelatedOptionOperation(ModelOptionOperation): ... + +class AlterUniqueTogether(FieldRelatedOptionOperation): + option_name: str = ... + unique_together: Collection[Sequence[str]] = ... + def __init__(self, name: str, unique_together: Optional[Collection[Sequence[str]]]) -> None: ... + +class AlterIndexTogether(FieldRelatedOptionOperation): + option_name: str = ... + index_together: Collection[Sequence[str]] = ... + def __init__(self, name: str, index_together: Optional[Collection[Sequence[str]]]) -> None: ... + +class AlterOrderWithRespectTo(FieldRelatedOptionOperation): + order_with_respect_to: str = ... + def __init__(self, name: str, order_with_respect_to: str) -> None: ... + +class AlterModelOptions(ModelOptionOperation): + ALTER_OPTION_KEYS: Any = ... + options: Dict[str, str] = ... + def __init__(self, name: str, options: Dict[str, Any]) -> None: ... + +class AlterModelManagers(ModelOptionOperation): + managers: Any = ... + def __init__(self, name: Any, managers: Any) -> None: ... + +class IndexOperation(Operation): + option_name: str = ... + def model_name_lower(self): ... + +class AddIndex(IndexOperation): + model_name: str = ... + index: Index = ... + def __init__(self, model_name: str, index: Union[str, Index]) -> None: ... + +class RemoveIndex(IndexOperation): + model_name: str = ... + name: str = ... + def __init__(self, model_name: str, name: Union[str, Index]) -> None: ... + +class AddConstraint(IndexOperation): + def __init__(self, model_name: str, constraint: BaseConstraint): ... + +class RemoveConstraint(IndexOperation): + def __init__(self, model_name: str, name: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/special.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/special.pyi new file mode 100644 index 00000000..323a32c5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/special.pyi @@ -0,0 +1,43 @@ +from typing import Any, Callable, Dict, Optional, Sequence + +from django.db.backends.base.schema import BaseDatabaseSchemaEditor +from django.db.migrations.state import StateApps + +from .base import Operation + +class SeparateDatabaseAndState(Operation): + database_operations: Sequence[Operation] = ... + state_operations: Sequence[Operation] = ... + def __init__( + self, database_operations: Sequence[Operation] = ..., state_operations: Sequence[Operation] = ... + ) -> None: ... + +class RunSQL(Operation): + noop: str = ... + sql: Any = ... + reverse_sql: Any = ... + state_operations: Any = ... + hints: Any = ... + def __init__( + self, + sql: Any, + reverse_sql: Optional[Any] = ..., + state_operations: Optional[Any] = ..., + hints: Optional[Any] = ..., + elidable: bool = ..., + ) -> None: ... + +class RunPython(Operation): + code: Callable = ... + reverse_code: Optional[Callable] = ... + hints: Optional[Dict[str, Any]] = ... + def __init__( + self, + code: Callable, + reverse_code: Optional[Callable] = ..., + atomic: Optional[bool] = ..., + hints: Optional[Dict[str, Any]] = ..., + elidable: bool = ..., + ) -> None: ... + @staticmethod + def noop(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/utils.pyi new file mode 100644 index 00000000..58c49d89 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/operations/utils.pyi @@ -0,0 +1,5 @@ +from django.db.migrations.state import ProjectState + +from django.db.models.fields import Field + +def is_referenced_by_foreign_key(state: ProjectState, model_name_lower: str, field: Field, field_name: str) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/optimizer.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/optimizer.pyi new file mode 100644 index 00000000..0a43cfc5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/optimizer.pyi @@ -0,0 +1,7 @@ +from typing import List, Optional + +from django.db.migrations.operations.base import Operation + +class MigrationOptimizer: + def optimize(self, operations: List[Operation], app_label: Optional[str] = ...) -> List[Operation]: ... + def optimize_inner(self, operations: List[Operation], app_label: Optional[str] = ...) -> List[Operation]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/questioner.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/questioner.pyi new file mode 100644 index 00000000..2a2ff1c5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/questioner.pyi @@ -0,0 +1,26 @@ +from typing import Any, Dict, Optional, Set + +from django.db.migrations.state import ModelState + +from django.db.models.fields import Field + +class MigrationQuestioner: + defaults: Dict[str, Any] = ... + specified_apps: Set[str] = ... + dry_run: Optional[bool] = ... + def __init__( + self, + defaults: Optional[Dict[str, bool]] = ..., + specified_apps: Optional[Set[str]] = ..., + dry_run: Optional[bool] = ..., + ) -> None: ... + def ask_initial(self, app_label: str) -> bool: ... + def ask_not_null_addition(self, field_name: str, model_name: str) -> None: ... + def ask_not_null_alteration(self, field_name: Any, model_name: Any): ... + def ask_rename(self, model_name: str, old_name: str, new_name: str, field_instance: Field) -> bool: ... + def ask_rename_model(self, old_model_state: ModelState, new_model_state: ModelState) -> bool: ... + def ask_merge(self, app_label: str) -> bool: ... + def ask_auto_now_add_addition(self, field_name: str, model_name: str) -> None: ... + +class InteractiveMigrationQuestioner(MigrationQuestioner): ... +class NonInteractiveMigrationQuestioner(MigrationQuestioner): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/recorder.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/recorder.pyi new file mode 100644 index 00000000..e2918e45 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/recorder.pyi @@ -0,0 +1,22 @@ +from typing import Any, Optional, Set, Tuple + +from django.db.backends.base.base import BaseDatabaseWrapper +from django.db.models.query import QuerySet + +from django.db import models + +class MigrationRecorder: + class Migration(models.Model): + app: Any = ... + name: Any = ... + applied: Any = ... + connection: Optional[BaseDatabaseWrapper] = ... + def __init__(self, connection: Optional[BaseDatabaseWrapper]) -> None: ... + @property + def migration_qs(self) -> QuerySet: ... + def has_table(self) -> bool: ... + def ensure_schema(self) -> None: ... + def applied_migrations(self) -> Set[Tuple[str, str]]: ... + def record_applied(self, app: str, name: str) -> None: ... + def record_unapplied(self, app: str, name: str) -> None: ... + def flush(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/serializer.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/serializer.pyi new file mode 100644 index 00000000..8a84bd3d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/serializer.pyi @@ -0,0 +1,46 @@ +from typing import Any, Callable, Dict, List, Set, Tuple, Union, Type + +class BaseSerializer: + value: Any = ... + def __init__(self, value: Any) -> None: ... + def serialize(self) -> Any: ... + +class BaseSequenceSerializer(BaseSerializer): ... +class BaseSimpleSerializer(BaseSerializer): ... +class DatetimeSerializer(BaseSerializer): ... +class DateSerializer(BaseSerializer): ... +class DecimalSerializer(BaseSerializer): ... + +class DeconstructableSerializer(BaseSerializer): + @staticmethod + def serialize_deconstructed( + path: str, args: List[Any], kwargs: Dict[str, Union[Callable, int, str]] + ) -> Tuple[str, Set[str]]: ... + +class DictionarySerializer(BaseSerializer): ... +class EnumSerializer(BaseSerializer): ... +class FloatSerializer(BaseSimpleSerializer): ... +class FrozensetSerializer(BaseSequenceSerializer): ... +class FunctionTypeSerializer(BaseSerializer): ... +class FunctoolsPartialSerializer(BaseSerializer): ... +class IterableSerializer(BaseSerializer): ... +class ModelFieldSerializer(DeconstructableSerializer): ... +class ModelManagerSerializer(DeconstructableSerializer): ... +class OperationSerializer(BaseSerializer): ... +class RegexSerializer(BaseSerializer): ... +class SequenceSerializer(BaseSequenceSerializer): ... +class SetSerializer(BaseSequenceSerializer): ... +class SettingsReferenceSerializer(BaseSerializer): ... +class TimedeltaSerializer(BaseSerializer): ... +class TimeSerializer(BaseSerializer): ... +class TupleSerializer(BaseSequenceSerializer): ... +class TypeSerializer(BaseSerializer): ... +class UUIDSerializer(BaseSerializer): ... + +def serializer_factory(value: Any) -> BaseSerializer: ... + +class Serializer: + @classmethod + def register(cls, type_: type, serializer: Type[BaseSerializer]) -> None: ... + @classmethod + def unregister(cls, type_: type) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/state.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/state.pyi new file mode 100644 index 00000000..bc1e8f29 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/state.pyi @@ -0,0 +1,68 @@ +from typing import Any, Dict, Iterator, List, Optional, Sequence, Tuple, Type, Union, Set + +from django.apps import AppConfig +from django.apps.registry import Apps +from django.db.models.base import Model +from django.db.models.manager import Manager + +from django.db.models.fields import Field + +class AppConfigStub(AppConfig): ... + +class ModelState: + name: str + app_label: str + fields: List[Tuple[str, Field]] + options: Dict[str, Any] = ... + bases: Tuple[Type[Model]] = ... + managers: List[Tuple[str, Manager]] = ... + def __init__( + self, + app_label: str, + name: str, + fields: List[Tuple[str, Field]], + options: Optional[Dict[str, Any]] = ..., + bases: Optional[Sequence[Union[Type[Model], str]]] = ..., + managers: Optional[List[Tuple[str, Manager]]] = ..., + ) -> None: ... + def clone(self) -> ModelState: ... + def construct_managers(self) -> Iterator[Tuple[str, Manager]]: ... + @classmethod + def from_model(cls, model: Type[Model], exclude_rels: bool = ...) -> ModelState: ... + def get_field_by_name(self, name: str) -> Field: ... + @property + def name_lower(self) -> str: ... + def render(self, apps: Apps) -> Any: ... + +def get_related_models_tuples(model: Type[Model]) -> Set[Tuple[str, str]]: ... +def get_related_models_recursive(model: Type[Model]) -> Set[Tuple[str, str]]: ... + +class ProjectState: + is_delayed: bool + models: Dict[Any, Any] + real_apps: List[str] + def __init__( + self, models: Optional[Dict[Tuple[str, str], ModelState]] = ..., real_apps: Optional[List[str]] = ... + ) -> None: ... + def add_model(self, model_state: ModelState) -> None: ... + @property + def apps(self) -> StateApps: ... + def clear_delayed_apps_cache(self) -> None: ... + def clone(self) -> ProjectState: ... + @property + def concrete_apps(self) -> StateApps: ... + @classmethod + def from_apps(cls, apps: Apps) -> ProjectState: ... + def reload_model(self, app_label: str, model_name: str, delay: bool = ...) -> None: ... + def reload_models(self, models: List[Any], delay: bool = ...) -> None: ... + def remove_model(self, app_label: str, model_name: str) -> None: ... + +class StateApps(Apps): + real_models: List[ModelState] + def __init__( + self, real_apps: List[str], models: Dict[Tuple[str, str], ModelState], ignore_swappable: bool = ... + ) -> None: ... + def bulk_update(self) -> Iterator[None]: ... + def clone(self) -> StateApps: ... + def render_multiple(self, model_states: List[ModelState]) -> None: ... + def unregister_model(self, app_label: str, model_name: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/topological_sort.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/topological_sort.pyi new file mode 100644 index 00000000..87e9bc31 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/topological_sort.pyi @@ -0,0 +1,8 @@ +from typing import Dict, Iterator, List, Set + +from django.db.migrations.operations.base import Operation + +def topological_sort_as_sets(dependency_graph: Dict[Operation, Set[Operation]]) -> Iterator[Set[Operation]]: ... +def stable_topological_sort( + l: List[Operation], dependency_graph: Dict[Operation, Set[Operation]] +) -> List[Operation]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/utils.pyi new file mode 100644 index 00000000..fb98a1e3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/utils.pyi @@ -0,0 +1,10 @@ +from typing import Any + +COMPILED_REGEX_TYPE: Any + +class RegexObject: + pattern: str = ... + flags: int = ... + def __init__(self, obj: Any) -> None: ... + +def get_migration_name_timestamp() -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/writer.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/writer.pyi new file mode 100644 index 00000000..751d8a91 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/migrations/writer.pyi @@ -0,0 +1,40 @@ +from typing import Any, List, Set, Tuple, Union, Type + +from django.db.migrations.migration import Migration +from django.db.migrations.operations.base import Operation +from django.db.migrations.operations.models import CreateModel +from django.db.migrations.serializer import BaseSerializer + +class SettingsReference(str): + def __init__(self, value: str, setting_name: str) -> None: ... + +class OperationWriter: + operation: CreateModel = ... + buff: List[Any] = ... + indentation: int = ... + def __init__(self, operation: Operation, indentation: int = ...) -> None: ... + def serialize(self) -> Tuple[str, Set[str]]: ... + def indent(self) -> None: ... + def unindent(self) -> None: ... + def feed(self, line: str) -> None: ... + def render(self) -> str: ... + +class MigrationWriter: + migration: Migration = ... + needs_manual_porting: bool = ... + def __init__(self, migration: Union[type, Migration], include_header: bool = ...) -> None: ... + def as_string(self) -> str: ... + @property + def basedir(self) -> str: ... + @property + def filename(self) -> str: ... + @property + def path(self) -> str: ... + @classmethod + def serialize(cls, value: Any) -> Tuple[str, Set[str]]: ... + @classmethod + def register_serializer(cls, type_: type, serializer: Type[BaseSerializer]) -> None: ... + @classmethod + def unregister_serializer(cls, type_: type) -> None: ... + +MIGRATION_TEMPLATE: str diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/__init__.pyi new file mode 100644 index 00000000..1e101264 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/__init__.pyi @@ -0,0 +1,136 @@ +from .base import Model as Model + +from .aggregates import ( + Aggregate as Aggregate, + Avg as Avg, + Count as Count, + Max as Max, + Min as Min, + StdDev as StdDev, + Sum as Sum, + Variance as Variance, +) + +from .fields import ( + FieldDoesNotExist as FieldDoesNotExist, + AutoField as AutoField, + IntegerField as IntegerField, + PositiveIntegerField as PositiveIntegerField, + PositiveSmallIntegerField as PositiveSmallIntegerField, + SmallIntegerField as SmallIntegerField, + BigIntegerField as BigIntegerField, + FloatField as FloatField, + CharField as CharField, + EmailField as EmailField, + URLField as URLField, + Field as Field, + SlugField as SlugField, + TextField as TextField, + BooleanField as BooleanField, + NullBooleanField as NullBooleanField, + DateField as DateField, + TimeField as TimeField, + DateTimeField as DateTimeField, + IPAddressField as IPAddressField, + GenericIPAddressField as GenericIPAddressField, + UUIDField as UUIDField, + DecimalField as DecimalField, + FilePathField as FilePathField, + BinaryField as BinaryField, + DurationField as DurationField, + BigAutoField as BigAutoField, + CommaSeparatedIntegerField as CommaSeparatedIntegerField, + NOT_PROVIDED as NOT_PROVIDED, +) + +from .fields.related import ( + ForeignKey as ForeignKey, + OneToOneField as OneToOneField, + ManyToManyField as ManyToManyField, + ForeignObject as ForeignObject, + ManyToManyRel as ManyToManyRel, + ManyToOneRel as ManyToOneRel, + OneToOneRel as OneToOneRel, + ForeignObjectRel as ForeignObjectRel, +) +from .fields.files import ( + ImageField as ImageField, + FileField as FileField, + FieldFile as FieldFile, + FileDescriptor as FileDescriptor, +) +from .fields.proxy import OrderWrt as OrderWrt + +from .deletion import ( + CASCADE as CASCADE, + SET_DEFAULT as SET_DEFAULT, + SET_NULL as SET_NULL, + DO_NOTHING as DO_NOTHING, + PROTECT as PROTECT, + SET as SET, + RESTRICT as RESTRICT, + ProtectedError as ProtectedError, + RestrictedError as RestrictedError, +) + +from .query import ( + Prefetch as Prefetch, + QuerySet as QuerySet, + RawQuerySet as RawQuerySet, + prefetch_related_objects as prefetch_related_objects, +) + +from .query_utils import Q as Q, FilteredRelation as FilteredRelation + +from .lookups import Lookup as Lookup, Transform as Transform + +from .expressions import ( + F as F, + Expression as Expression, + Subquery as Subquery, + Exists as Exists, + OrderBy as OrderBy, + OuterRef as OuterRef, + Case as Case, + When as When, + RawSQL as RawSQL, + Value as Value, + Func as Func, + ExpressionWrapper as ExpressionWrapper, + Combinable as Combinable, + Col as Col, + CombinedExpression as CombinedExpression, + ExpressionList as ExpressionList, + Random as Random, + Ref as Ref, + Window as Window, + WindowFrame as WindowFrame, + RowRange as RowRange, + ValueRange as ValueRange, +) + +from .manager import BaseManager as BaseManager, Manager as Manager + +from . import lookups as lookups + +from .aggregates import ( + Avg as Avg, + Min as Min, + Max as Max, + Variance as Variance, + StdDev as StdDev, + Sum as Sum, + Aggregate as Aggregate, +) + +from .indexes import Index as Index + +from . import signals as signals + +from .constraints import ( + BaseConstraint as BaseConstraint, + CheckConstraint as CheckConstraint, + UniqueConstraint as UniqueConstraint, +) + +from .enums import Choices as Choices, IntegerChoices as IntegerChoices, TextChoices as TextChoices diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/aggregates.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/aggregates.pyi new file mode 100644 index 00000000..1522d34b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/aggregates.pyi @@ -0,0 +1,17 @@ +from typing import Any, Optional + +from django.db.models.expressions import Func + +class Aggregate(Func): + filter_template: str = ... + filter: Any = ... + allow_distinct: bool = ... + def __init__(self, *expressions: Any, distinct: bool = ..., filter: Optional[Any] = ..., **extra: Any) -> None: ... + +class Avg(Aggregate): ... +class Count(Aggregate): ... +class Max(Aggregate): ... +class Min(Aggregate): ... +class StdDev(Aggregate): ... +class Sum(Aggregate): ... +class Variance(Aggregate): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/base.pyi new file mode 100644 index 00000000..5851803a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/base.pyi @@ -0,0 +1,60 @@ +from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Tuple, Type, TypeVar, Union, Collection, ClassVar + +from django.core.checks.messages import CheckMessage +from django.core.exceptions import ValidationError +from django.db.models.manager import BaseManager +from django.db.models.options import Options + +_Self = TypeVar("_Self", bound="Model") + +class ModelStateFieldsCacheDescriptor: ... + +class ModelState: + db: Optional[str] = ... + adding: bool = ... + fields_cache: ModelStateFieldsCacheDescriptor = ... + +class ModelBase(type): ... + +class Model(metaclass=ModelBase): + class DoesNotExist(Exception): ... + class MultipleObjectsReturned(Exception): ... + class Meta: ... + _meta: Options[Any] + _default_manager: BaseManager[Model] + objects: ClassVar[BaseManager[Any]] + pk: Any = ... + _state: ModelState + def __init__(self: _Self, *args, **kwargs) -> None: ... + @classmethod + def add_to_class(cls, name: str, value: Any): ... + @classmethod + def from_db(cls, db: Optional[str], field_names: Collection[str], values: Collection[Any]) -> _Self: ... + def delete(self, using: Any = ..., keep_parents: bool = ...) -> Tuple[int, Dict[str, int]]: ... + def full_clean(self, exclude: Optional[Collection[str]] = ..., validate_unique: bool = ...) -> None: ... + def clean(self) -> None: ... + def clean_fields(self, exclude: Optional[Collection[str]] = ...) -> None: ... + def validate_unique(self, exclude: Optional[Collection[str]] = ...) -> None: ... + def unique_error_message( + self, model_class: Type[_Self], unique_check: Collection[Union[Callable, str]] + ) -> ValidationError: ... + def save( + self, + force_insert: bool = ..., + force_update: bool = ..., + using: Optional[str] = ..., + update_fields: Optional[Union[Sequence[str], str]] = ..., + ) -> None: ... + def save_base( + self, + raw: bool = ..., + force_insert: bool = ..., + force_update: bool = ..., + using: Optional[str] = ..., + update_fields: Optional[Union[Sequence[str], str]] = ..., + ): ... + def refresh_from_db(self: _Self, using: Optional[str] = ..., fields: Optional[List[str]] = ...) -> None: ... + def get_deferred_fields(self) -> Set[str]: ... + @classmethod + def check(cls, **kwargs: Any) -> List[CheckMessage]: ... + def __getstate__(self) -> dict: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/constraints.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/constraints.pyi new file mode 100644 index 00000000..dc163ab3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/constraints.pyi @@ -0,0 +1,27 @@ +from typing import Any, Optional, Sequence, Tuple, Type, TypeVar + +from django.db.backends.base.schema import BaseDatabaseSchemaEditor +from django.db.models.base import Model +from django.db.models.query_utils import Q + +_T = TypeVar("_T", bound="BaseConstraint") + +class BaseConstraint: + name: str + def __init__(self, name: str) -> None: ... + def constraint_sql( + self, model: Optional[Type[Model]], schema_editor: Optional[BaseDatabaseSchemaEditor] + ) -> str: ... + def create_sql(self, model: Optional[Type[Model]], schema_editor: Optional[BaseDatabaseSchemaEditor]) -> str: ... + def remove_sql(self, model: Optional[Type[Model]], schema_editor: Optional[BaseDatabaseSchemaEditor]) -> str: ... + def deconstruct(self) -> Any: ... + def clone(self: _T) -> _T: ... + +class CheckConstraint(BaseConstraint): + check: Q + def __init__(self, *, check: Q, name: str) -> None: ... + +class UniqueConstraint(BaseConstraint): + fields: Tuple[str] + condition: Optional[Q] + def __init__(self, *, fields: Sequence[str], name: str, condition: Optional[Q] = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/deletion.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/deletion.pyi new file mode 100644 index 00000000..061e5b7a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/deletion.pyi @@ -0,0 +1,30 @@ +from typing import Any, Callable, Iterable, Optional, Union, Collection, Type + +from django.db.models.base import Model + +from django.db import IntegrityError +from django.db.models.fields import Field +from django.db.models.options import Options + +def CASCADE(collector, field, sub_objs, using): ... +def SET_NULL(collector, field, sub_objs, using): ... +def SET_DEFAULT(collector, field, sub_objs, using): ... +def DO_NOTHING(collector, field, sub_objs, using): ... +def PROTECT(collector, field, sub_objs, using): ... +def RESTRICT(collector, field, sub_objs, using): ... +def SET(value: Any) -> Callable: ... +def get_candidate_relations_to_delete(opts: Options) -> Iterable[Field]: ... + +class ProtectedError(IntegrityError): ... +class RestrictedError(IntegrityError): ... + +class Collector: + def __init__(self, using: str) -> None: ... + def collect( + self, + objs: Collection[Optional[Model]], + source: Optional[Type[Model]] = ..., + source_attr: Optional[str] = ..., + **kwargs: Any + ) -> None: ... + def can_fast_delete(self, objs: Union[Model, Iterable[Model]], from_field: Optional[Field] = ...) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/enums.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/enums.pyi new file mode 100644 index 00000000..ddfe5489 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/enums.pyi @@ -0,0 +1,30 @@ +import enum +from typing import Any, List, Tuple + +class ChoicesMeta(enum.EnumMeta): + names: List[str] = ... + choices: List[Tuple[Any, str]] = ... + labels: List[str] = ... + values: List[Any] = ... + def __contains__(self, item: Any) -> bool: ... + +class Choices(enum.Enum, metaclass=ChoicesMeta): + def __str__(self): ... + +# fake +class _IntegerChoicesMeta(ChoicesMeta): + names: List[str] = ... + choices: List[Tuple[int, str]] = ... + labels: List[str] = ... + values: List[int] = ... + +class IntegerChoices(int, Choices, metaclass=_IntegerChoicesMeta): ... + +# fake +class _TextChoicesMeta(ChoicesMeta): + names: List[str] = ... + choices: List[Tuple[str, str]] = ... + labels: List[str] = ... + values: List[str] = ... + +class TextChoices(str, Choices, metaclass=_TextChoicesMeta): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/expressions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/expressions.pyi new file mode 100644 index 00000000..086aaaea --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/expressions.pyi @@ -0,0 +1,219 @@ +from datetime import datetime, timedelta +from typing import Any, Callable, Dict, Iterator, List, Optional, Sequence, Set, Tuple, Type, TypeVar, Union, Iterable + +from django.db.models.lookups import Lookup +from django.db.models.sql.compiler import SQLCompiler + +from django.db.models import Q, QuerySet +from django.db.models.fields import Field +from django.db.models.query import _BaseQuerySet + +_OutputField = Union[Field, str] + +class SQLiteNumericMixin: + def as_sqlite(self, compiler: SQLCompiler, connection: Any, **extra_context: Any) -> Tuple[str, List[float]]: ... + +_Self = TypeVar("_Self") + +class Combinable: + ADD: str = ... + SUB: str = ... + MUL: str = ... + DIV: str = ... + POW: str = ... + MOD: str = ... + BITAND: str = ... + BITOR: str = ... + BITLEFTSHIFT: str = ... + BITRIGHTSHIFT: str = ... + def __neg__(self: _Self) -> _Self: ... + def __add__(self: _Self, other: Optional[Union[timedelta, Combinable, float, str]]) -> _Self: ... + def __sub__(self: _Self, other: Union[timedelta, Combinable, float]) -> _Self: ... + def __mul__(self: _Self, other: Union[timedelta, Combinable, float]) -> _Self: ... + def __truediv__(self: _Self, other: Union[Combinable, float]) -> _Self: ... + def __itruediv__(self: _Self, other: Union[Combinable, float]) -> _Self: ... + def __mod__(self: _Self, other: Union[int, Combinable]) -> _Self: ... + def __pow__(self: _Self, other: Union[float, Combinable]) -> _Self: ... + def __and__(self: _Self, other: Combinable) -> _Self: ... + def bitand(self: _Self, other: int) -> _Self: ... + def bitleftshift(self: _Self, other: int) -> _Self: ... + def bitrightshift(self: _Self, other: int) -> _Self: ... + def __or__(self: _Self, other: Combinable) -> _Self: ... + def bitor(self: _Self, other: int) -> _Self: ... + def __radd__(self, other: Optional[Union[datetime, float, Combinable]]) -> Combinable: ... + def __rsub__(self, other: Union[float, Combinable]) -> Combinable: ... + def __rmul__(self, other: Union[float, Combinable]) -> Combinable: ... + def __rtruediv__(self, other: Union[float, Combinable]) -> Combinable: ... + def __rmod__(self, other: Union[int, Combinable]) -> Combinable: ... + def __rpow__(self, other: Union[float, Combinable]) -> Combinable: ... + def __rand__(self, other: Any) -> Combinable: ... + def __ror__(self, other: Any) -> Combinable: ... + +class BaseExpression: + is_summary: bool = ... + filterable: bool = ... + window_compatible: bool = ... + def __init__(self, output_field: Optional[_OutputField] = ...) -> None: ... + def get_db_converters(self, connection: Any) -> List[Callable]: ... + def get_source_expressions(self) -> List[Any]: ... + def set_source_expressions(self, exprs: Sequence[Combinable]) -> None: ... + @property + def contains_aggregate(self) -> bool: ... + @property + def contains_over_clause(self) -> bool: ... + @property + def contains_column_references(self) -> bool: ... + def resolve_expression( + self: _Self, + query: Any = ..., + allow_joins: bool = ..., + reuse: Optional[Set[str]] = ..., + summarize: bool = ..., + for_save: bool = ..., + ) -> _Self: ... + @property + def field(self) -> Field: ... + @property + def output_field(self) -> Field: ... + @property + def convert_value(self) -> Callable: ... + def get_lookup(self, lookup: str) -> Optional[Type[Lookup]]: ... + def get_transform(self, name: str) -> Optional[Type[Expression]]: ... + def relabeled_clone(self, change_map: Dict[Optional[str], str]) -> Expression: ... + def copy(self) -> BaseExpression: ... + def get_group_by_cols(self: _Self) -> List[_Self]: ... + def get_source_fields(self) -> List[Optional[Field]]: ... + def asc(self, **kwargs: Any) -> Expression: ... + def desc(self, **kwargs: Any) -> Expression: ... + def reverse_ordering(self): ... + def flatten(self) -> Iterator[Expression]: ... + def deconstruct(self) -> Any: ... + def as_sqlite(self, compiler: SQLCompiler, connection: Any) -> Any: ... + def as_sql(self, compiler: SQLCompiler, connection: Any, **extra_context: Any) -> Any: ... + def as_mysql(self, compiler: Any, connection: Any) -> Any: ... + def as_postgresql(self, compiler: Any, connection: Any) -> Any: ... + def as_oracle(self, compiler: Any, connection: Any): ... + +class Expression(BaseExpression, Combinable): ... + +class CombinedExpression(SQLiteNumericMixin, Expression): + connector: Any = ... + lhs: Any = ... + rhs: Any = ... + def __init__( + self, lhs: Combinable, connector: str, rhs: Combinable, output_field: Optional[_OutputField] = ... + ) -> None: ... + +class F(Combinable): + name: str + def __init__(self, name: str): ... + def resolve_expression( + self: _Self, + query: Any = ..., + allow_joins: bool = ..., + reuse: Optional[Set[str]] = ..., + summarize: bool = ..., + for_save: bool = ..., + ) -> _Self: ... + def asc(self, **kwargs) -> OrderBy: ... + def desc(self, **kwargs) -> OrderBy: ... + def deconstruct(self) -> Any: ... + +class OuterRef(F): + def __init__(self, name: Union[str, OuterRef]): ... + +class Subquery(Expression): + template: str = ... + queryset: QuerySet = ... + extra: Dict[Any, Any] = ... + def __init__(self, queryset: _BaseQuerySet, output_field: Optional[_OutputField] = ..., **extra: Any) -> None: ... + +class Exists(Subquery): + negated: bool = ... + def __init__(self, *args: Any, negated: bool = ..., **kwargs: Any) -> None: ... + def __invert__(self) -> Exists: ... + +class OrderBy(BaseExpression): + template: str = ... + nulls_first: bool = ... + nulls_last: bool = ... + descending: bool = ... + expression: Expression = ... + def __init__( + self, expression: Combinable, descending: bool = ..., nulls_first: bool = ..., nulls_last: bool = ... + ) -> None: ... + +class Value(Expression): + value: Any = ... + def __init__(self, value: Any, output_field: Optional[_OutputField] = ...) -> None: ... + +class RawSQL(Expression): + params: List[Any] + sql: str + def __init__(self, sql: str, params: Sequence[Any], output_field: Optional[_OutputField] = ...) -> None: ... + +class Func(SQLiteNumericMixin, Expression): + function: str = ... + name: str = ... + template: str = ... + arg_joiner: str = ... + arity: int = ... + source_expressions: List[Combinable] = ... + extra: Dict[Any, Any] = ... + def __init__(self, *expressions: Any, output_field: Optional[_OutputField] = ..., **extra: Any) -> None: ... + +class When(Expression): + template: str = ... + condition: Any = ... + result: Any = ... + def __init__(self, condition: Any = ..., then: Any = ..., **lookups: Any) -> None: ... + +class Case(Expression): + template: str = ... + case_joiner: str = ... + cases: Any = ... + default: Any = ... + extra: Any = ... + def __init__( + self, *cases: Any, default: Optional[Any] = ..., output_field: Optional[_OutputField] = ..., **extra: Any + ) -> None: ... + +class ExpressionWrapper(Expression): + def __init__(self, expression: Union[Q, Combinable], output_field: _OutputField): ... + +class Col(Expression): + def __init__(self, alias: str, target: str, output_field: Optional[_OutputField] = ...): ... + +class SimpleCol(Expression): + contains_column_references: bool = ... + def __init__(self, target: Field, output_field: Optional[_OutputField] = ...): ... + +class Ref(Expression): + def __init__(self, refs: str, source: Expression): ... + +class ExpressionList(Func): + def __init__(self, *expressions: Union[BaseExpression, Combinable], **extra: Any) -> None: ... + +class Random(Expression): ... + +class Window(Expression): + template: str = ... + contains_aggregate: bool = ... + contains_over_clause: bool = ... + def __init__( + self, + expression: BaseExpression, + partition_by: Optional[Union[str, Iterable[Union[BaseExpression, F]], F, BaseExpression]] = ..., + order_by: Optional[Union[Sequence[Union[BaseExpression, F]], Union[BaseExpression, F]]] = ..., + frame: Optional[WindowFrame] = ..., + output_field: Optional[_OutputField] = ..., + ) -> None: ... + +class WindowFrame(Expression): + template: str = ... + frame_type: str = ... + def __init__(self, start: Optional[int] = ..., end: Optional[int] = ...) -> None: ... + def window_frame_start_end(self, connection: Any, start: Optional[int], end: Optional[int]) -> Tuple[int, int]: ... + +class RowRange(WindowFrame): ... +class ValueRange(WindowFrame): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/__init__.pyi new file mode 100644 index 00000000..6add1186 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/__init__.pyi @@ -0,0 +1,409 @@ +import decimal +import uuid +from datetime import date, datetime, time, timedelta +from typing import ( + Any, + Callable, + Dict, + Generic, + Iterable, + Optional, + Tuple, + Type, + TypeVar, + Union, + Sequence, + List, + overload, +) + +from django.core import checks + +from django.db.models import Model +from django.core.exceptions import FieldDoesNotExist as FieldDoesNotExist +from django.db.models.expressions import Combinable, Col +from django.db.models.query_utils import RegisterLookupMixin +from django.forms import Field as FormField, Widget + +class NOT_PROVIDED: ... + +BLANK_CHOICE_DASH: List[Tuple[str, str]] = ... + +_Choice = Tuple[Any, Any] +_ChoiceNamedGroup = Tuple[str, Iterable[_Choice]] +_FieldChoices = Iterable[Union[_Choice, _ChoiceNamedGroup]] + +_ValidatorCallable = Callable[..., None] +_ErrorMessagesToOverride = Dict[str, Any] + +_T = TypeVar("_T", bound="Field") +# __set__ value type +_ST = TypeVar("_ST") +# __get__ return type +_GT = TypeVar("_GT") + +class Field(RegisterLookupMixin, Generic[_ST, _GT]): + _pyi_private_set_type: Any + _pyi_private_get_type: Any + _pyi_lookup_exact_type: Any + + widget: Widget + help_text: str + db_table: str + attname: str + auto_created: bool + primary_key: bool + remote_field: Field + is_relation: bool + related_model: Optional[Type[Model]] + max_length: int + model: Type[Model] + name: str + verbose_name: str + description: str + blank: bool = ... + null: bool = ... + editable: bool = ... + empty_strings_allowed: bool = ... + choices: _FieldChoices = ... + db_column: Optional[str] + column: str + default: Any + error_messages: _ErrorMessagesToOverride + def __init__( + self, + verbose_name: Optional[Union[str, bytes]] = ..., + name: Optional[str] = ..., + primary_key: bool = ..., + max_length: Optional[int] = ..., + unique: bool = ..., + blank: bool = ..., + null: bool = ..., + db_index: bool = ..., + default: Any = ..., + editable: bool = ..., + auto_created: bool = ..., + serialize: bool = ..., + unique_for_date: Optional[str] = ..., + unique_for_month: Optional[str] = ..., + unique_for_year: Optional[str] = ..., + choices: Optional[_FieldChoices] = ..., + help_text: str = ..., + db_column: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + validators: Iterable[_ValidatorCallable] = ..., + error_messages: Optional[_ErrorMessagesToOverride] = ..., + ): ... + def __set__(self, instance, value: _ST) -> None: ... + # class access + @overload + def __get__(self: _T, instance: None, owner) -> _T: ... + # Model instance access + @overload + def __get__(self, instance: Model, owner) -> _GT: ... + # non-Model instances + @overload + def __get__(self: _T, instance, owner) -> _T: ... + def deconstruct(self) -> Any: ... + def set_attributes_from_name(self, name: str) -> None: ... + def db_type(self, connection: Any) -> str: ... + def db_parameters(self, connection: Any) -> Dict[str, str]: ... + def pre_save(self, model_instance: Model, add: bool) -> Any: ... + def get_prep_value(self, value: Any) -> Any: ... + def get_db_prep_value(self, value: Any, connection: Any, prepared: bool) -> Any: ... + def get_db_prep_save(self, value: Any, connection: Any) -> Any: ... + def get_internal_type(self) -> str: ... + # TODO: plugin support + def formfield(self, **kwargs) -> Any: ... + def save_form_data(self, instance: Model, data: Any) -> None: ... + def contribute_to_class(self, cls: Type[Model], name: str, private_only: bool = ...) -> None: ... + def to_python(self, value: Any) -> Any: ... + def clean(self, value: Any, model_instance: Optional[Model]) -> Any: ... + def get_choices( + self, + include_blank: bool = ..., + blank_choice: _Choice = ..., + limit_choices_to: Optional[Any] = ..., + ordering: Sequence[str] = ..., + ) -> Sequence[Union[_Choice, _ChoiceNamedGroup]]: ... + def has_default(self) -> bool: ... + def get_default(self) -> Any: ... + def check(self, **kwargs: Any) -> List[checks.Error]: ... + @property + def validators(self) -> List[_ValidatorCallable]: ... + def validate(self, value: Any, model_instance: Model) -> None: ... + def run_validators(self, value: Any) -> None: ... + def get_col(self, alias: str, output_field: Optional[Field] = ...) -> Col: ... + @property + def cached_col(self) -> Col: ... + def value_from_object(self, obj: Model) -> _GT: ... + def get_attname(self) -> str: ... + +class IntegerField(Field[_ST, _GT]): + _pyi_private_set_type: Union[float, int, str, Combinable] + _pyi_private_get_type: int + _pyi_lookup_exact_type: Union[str, int] + +class PositiveIntegerRelDbTypeMixin: + def rel_db_type(self, connection: Any): ... + +class PositiveIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField[_ST, _GT]): ... +class PositiveSmallIntegerField(PositiveIntegerRelDbTypeMixin, IntegerField[_ST, _GT]): ... +class SmallIntegerField(IntegerField[_ST, _GT]): ... +class BigIntegerField(IntegerField[_ST, _GT]): ... + +class FloatField(Field[_ST, _GT]): + _pyi_private_set_type: Union[float, int, str, Combinable] + _pyi_private_get_type: float + _pyi_lookup_exact_type: float + +class DecimalField(Field[_ST, _GT]): + _pyi_private_set_type: Union[str, float, decimal.Decimal, Combinable] + _pyi_private_get_type: decimal.Decimal + _pyi_lookup_exact_type: Union[str, decimal.Decimal] + # attributes + max_digits: int = ... + decimal_places: int = ... + def __init__( + self, + verbose_name: Optional[Union[str, bytes]] = ..., + name: Optional[str] = ..., + max_digits: Optional[int] = ..., + decimal_places: Optional[int] = ..., + primary_key: bool = ..., + unique: bool = ..., + blank: bool = ..., + null: bool = ..., + db_index: bool = ..., + default: Any = ..., + editable: bool = ..., + auto_created: bool = ..., + serialize: bool = ..., + choices: Optional[_FieldChoices] = ..., + help_text: str = ..., + db_column: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + validators: Iterable[_ValidatorCallable] = ..., + error_messages: Optional[_ErrorMessagesToOverride] = ..., + ): ... + +class AutoField(Field[_ST, _GT]): + _pyi_private_set_type: Union[Combinable, int, str] + _pyi_private_get_type: int + _pyi_lookup_exact_type: Union[str, int] + +class CharField(Field[_ST, _GT]): + _pyi_private_set_type: Union[str, int, Combinable] + _pyi_private_get_type: str + # objects are converted to string before comparison + _pyi_lookup_exact_type: Any + def __init__( + self, + verbose_name: Optional[Union[str, bytes]] = ..., + name: Optional[str] = ..., + primary_key: bool = ..., + max_length: Optional[int] = ..., + unique: bool = ..., + blank: bool = ..., + null: bool = ..., + db_index: bool = ..., + default: Any = ..., + editable: bool = ..., + auto_created: bool = ..., + serialize: bool = ..., + unique_for_date: Optional[str] = ..., + unique_for_month: Optional[str] = ..., + unique_for_year: Optional[str] = ..., + choices: Optional[_FieldChoices] = ..., + help_text: str = ..., + db_column: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + validators: Iterable[_ValidatorCallable] = ..., + error_messages: Optional[_ErrorMessagesToOverride] = ..., + ): ... + +class SlugField(CharField[_ST, _GT]): + def __init__( + self, + verbose_name: Optional[Union[str, bytes]] = ..., + name: Optional[str] = ..., + primary_key: bool = ..., + max_length: Optional[int] = ..., + allow_unicode: bool = ..., + unique: bool = ..., + blank: bool = ..., + null: bool = ..., + db_index: bool = ..., + default: Any = ..., + editable: bool = ..., + auto_created: bool = ..., + serialize: bool = ..., + unique_for_date: Optional[str] = ..., + unique_for_month: Optional[str] = ..., + unique_for_year: Optional[str] = ..., + choices: Optional[_FieldChoices] = ..., + help_text: str = ..., + db_column: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + validators: Iterable[_ValidatorCallable] = ..., + error_messages: Optional[_ErrorMessagesToOverride] = ..., + ): ... + +class EmailField(CharField[_ST, _GT]): ... +class URLField(CharField[_ST, _GT]): ... + +class TextField(Field[_ST, _GT]): + _pyi_private_set_type: Union[str, Combinable] + _pyi_private_get_type: str + # objects are converted to string before comparison + _pyi_lookup_exact_type: Any + +class BooleanField(Field[_ST, _GT]): + _pyi_private_set_type: Union[bool, Combinable] + _pyi_private_get_type: bool + _pyi_lookup_exact_type: bool + +class NullBooleanField(Field[_ST, _GT]): + _pyi_private_set_type: Optional[Union[bool, Combinable]] + _pyi_private_get_type: Optional[bool] + _pyi_lookup_exact_type: Optional[bool] + +class IPAddressField(Field[_ST, _GT]): + _pyi_private_set_type: Union[str, Combinable] + _pyi_private_get_type: str + +class GenericIPAddressField(Field[_ST, _GT]): + _pyi_private_set_type: Union[str, int, Callable[..., Any], Combinable] + _pyi_private_get_type: str + + default_error_messages: Any = ... + unpack_ipv4: Any = ... + protocol: Any = ... + def __init__( + self, + verbose_name: Optional[Any] = ..., + name: Optional[Any] = ..., + protocol: str = ..., + unpack_ipv4: bool = ..., + primary_key: bool = ..., + unique: bool = ..., + blank: bool = ..., + null: bool = ..., + db_index: bool = ..., + default: Any = ..., + editable: bool = ..., + auto_created: bool = ..., + serialize: bool = ..., + choices: Optional[_FieldChoices] = ..., + help_text: str = ..., + db_column: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + validators: Iterable[_ValidatorCallable] = ..., + error_messages: Optional[_ErrorMessagesToOverride] = ..., + ) -> None: ... + +class DateTimeCheckMixin: ... + +class DateField(DateTimeCheckMixin, Field[_ST, _GT]): + _pyi_private_set_type: Union[str, date, Combinable] + _pyi_private_get_type: date + _pyi_lookup_exact_type: Union[str, date] + def __init__( + self, + verbose_name: Optional[Union[str, bytes]] = ..., + name: Optional[str] = ..., + auto_now: bool = ..., + auto_now_add: bool = ..., + primary_key: bool = ..., + max_length: Optional[int] = ..., + unique: bool = ..., + blank: bool = ..., + null: bool = ..., + db_index: bool = ..., + default: Any = ..., + editable: bool = ..., + auto_created: bool = ..., + serialize: bool = ..., + choices: Optional[_FieldChoices] = ..., + help_text: str = ..., + db_column: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + validators: Iterable[_ValidatorCallable] = ..., + error_messages: Optional[_ErrorMessagesToOverride] = ..., + ): ... + +class TimeField(DateTimeCheckMixin, Field[_ST, _GT]): + _pyi_private_set_type: Union[str, time, datetime, Combinable] + _pyi_private_get_type: time + def __init__( + self, + verbose_name: Optional[Union[str, bytes]] = ..., + name: Optional[str] = ..., + auto_now: bool = ..., + auto_now_add: bool = ..., + primary_key: bool = ..., + unique: bool = ..., + blank: bool = ..., + null: bool = ..., + db_index: bool = ..., + default: Any = ..., + editable: bool = ..., + auto_created: bool = ..., + serialize: bool = ..., + choices: Optional[_FieldChoices] = ..., + help_text: str = ..., + db_column: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + validators: Iterable[_ValidatorCallable] = ..., + error_messages: Optional[_ErrorMessagesToOverride] = ..., + ): ... + +class DateTimeField(DateField[_ST, _GT]): + _pyi_private_get_type: datetime + _pyi_lookup_exact_type: Union[str, datetime] + +class UUIDField(Field[_ST, _GT]): + _pyi_private_set_type: Union[str, uuid.UUID] + _pyi_private_get_type: uuid.UUID + +class FilePathField(Field[_ST, _GT]): + path: Any = ... + match: Optional[str] = ... + recursive: bool = ... + allow_files: bool = ... + allow_folders: bool = ... + def __init__( + self, + path: Union[str, Callable[..., str]] = ..., + match: Optional[str] = ..., + recursive: bool = ..., + allow_files: bool = ..., + allow_folders: bool = ..., + verbose_name: Optional[str] = ..., + name: Optional[str] = ..., + primary_key: bool = ..., + max_length: int = ..., + unique: bool = ..., + blank: bool = ..., + null: bool = ..., + db_index: bool = ..., + default: Any = ..., + editable: bool = ..., + auto_created: bool = ..., + serialize: bool = ..., + choices: Optional[_FieldChoices] = ..., + help_text: str = ..., + db_column: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + validators: Iterable[_ValidatorCallable] = ..., + error_messages: Optional[_ErrorMessagesToOverride] = ..., + ): ... + +class BinaryField(Field[_ST, _GT]): + _pyi_private_get_type: bytes + +class DurationField(Field[_ST, _GT]): + _pyi_private_get_type: timedelta + +class BigAutoField(AutoField[_ST, _GT]): ... +class CommaSeparatedIntegerField(CharField[_ST, _GT]): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/files.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/files.pyi new file mode 100644 index 00000000..225d8fd1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/files.pyi @@ -0,0 +1,101 @@ +from pathlib import Path +from typing import Any, Callable, Iterable, Optional, Type, TypeVar, Union, overload + +from django.core.files.base import File +from django.core.files.images import ImageFile +from django.core.files.storage import FileSystemStorage, Storage +from django.db.models.base import Model + +from django.db.models.fields import Field, _FieldChoices, _ValidatorCallable, _ErrorMessagesToOverride + +class FieldFile(File): + instance: Model = ... + field: FileField = ... + storage: FileSystemStorage = ... + def __init__(self, instance: Model, field: FileField, name: Optional[str]) -> None: ... + file: Any = ... + @property + def path(self) -> str: ... + @property + def url(self) -> str: ... + @property + def size(self) -> int: ... + def save(self, name: str, content: File, save: bool = ...) -> None: ... + def delete(self, save: bool = ...) -> None: ... + @property + def closed(self) -> bool: ... + +class FileDescriptor: + field: FileField = ... + def __init__(self, field: FileField) -> None: ... + def __set__(self, instance: Model, value: Optional[Any]) -> None: ... + def __get__(self, instance: Optional[Model], cls: Type[Model] = ...) -> Union[FieldFile, FileDescriptor]: ... + +_T = TypeVar("_T", bound="Field") + +class FileField(Field): + storage: Any = ... + upload_to: Union[str, Callable] = ... + def __init__( + self, + upload_to: Union[str, Callable, Path] = ..., + storage: Optional[Storage] = ..., + verbose_name: Optional[Union[str, bytes]] = ..., + name: Optional[str] = ..., + max_length: Optional[int] = ..., + unique: bool = ..., + blank: bool = ..., + null: bool = ..., + db_index: bool = ..., + default: Any = ..., + editable: bool = ..., + auto_created: bool = ..., + serialize: bool = ..., + unique_for_date: Optional[str] = ..., + unique_for_month: Optional[str] = ..., + unique_for_year: Optional[str] = ..., + choices: Optional[_FieldChoices] = ..., + help_text: str = ..., + db_column: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + validators: Iterable[_ValidatorCallable] = ..., + error_messages: Optional[_ErrorMessagesToOverride] = ..., + ): ... + # class access + @overload # type: ignore + def __get__(self, instance: None, owner) -> FileDescriptor: ... + # Model instance access + @overload + def __get__(self, instance: Model, owner) -> Any: ... + # non-Model instances + @overload + def __get__(self: _T, instance, owner) -> _T: ... + def generate_filename(self, instance: Optional[Model], filename: str) -> str: ... + +class ImageFileDescriptor(FileDescriptor): + field: ImageField + def __set__(self, instance: Model, value: Optional[str]) -> None: ... + +class ImageFieldFile(ImageFile, FieldFile): + field: ImageField + def delete(self, save: bool = ...) -> None: ... + +class ImageField(FileField): + def __init__( + self, + verbose_name: Optional[str] = ..., + name: Optional[str] = ..., + width_field: Optional[str] = ..., + height_field: Optional[str] = ..., + **kwargs: Any + ) -> None: ... + # class access + @overload # type: ignore + def __get__(self, instance: None, owner) -> ImageFileDescriptor: ... + # Model instance access + @overload + def __get__(self, instance: Model, owner) -> Any: ... + # non-Model instances + @overload + def __get__(self: _T, instance, owner) -> _T: ... + def update_dimension_fields(self, instance: Model, force: bool = ..., *args: Any, **kwargs: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/mixins.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/mixins.pyi new file mode 100644 index 00000000..be262b34 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/mixins.pyi @@ -0,0 +1,12 @@ +from typing import Any, Optional + +from django.db.models.base import Model + +NOT_PROVIDED: Any + +class FieldCacheMixin: + def get_cache_name(self) -> str: ... + def get_cached_value(self, instance: Model, default: Any = ...) -> Optional[Model]: ... + def is_cached(self, instance: Model) -> bool: ... + def set_cached_value(self, instance: Model, value: Optional[Model]) -> None: ... + def delete_cached_value(self, instance: Model) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/proxy.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/proxy.pyi new file mode 100644 index 00000000..ef647530 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/proxy.pyi @@ -0,0 +1,6 @@ +from typing import Any + +from django.db.models import fields + +class OrderWrt(fields.IntegerField): + def __init__(self, *args: Any, **kwargs: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/related.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/related.pyi new file mode 100644 index 00000000..ae03ea71 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/related.pyi @@ -0,0 +1,243 @@ +from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence, Tuple, Type, TypeVar, Union, overload +from uuid import UUID + +from django.db import models +from django.db.models.base import Model +from django.db.models.fields import Field +from django.db.models.query_utils import Q, PathInfo +from django.db.models.manager import RelatedManager +from django.db.models.expressions import Combinable +from django.db.models.fields.mixins import FieldCacheMixin +from django.db.models.fields.related_descriptors import ( # noqa: F401 + ForwardOneToOneDescriptor as ForwardOneToOneDescriptor, + ForwardManyToOneDescriptor as ForwardManyToOneDescriptor, + ManyToManyDescriptor as ManyToManyDescriptor, + ReverseOneToOneDescriptor as ReverseOneToOneDescriptor, + ReverseManyToOneDescriptor as ReverseManyToOneDescriptor, +) +from django.db.models.fields.reverse_related import ( # noqa: F401 + ForeignObjectRel as ForeignObjectRel, + OneToOneRel as OneToOneRel, + ManyToOneRel as ManyToOneRel, + ManyToManyRel as ManyToManyRel, +) + +_T = TypeVar("_T", bound=models.Model) +_F = TypeVar("_F", bound=models.Field) +_Choice = Tuple[Any, str] +_ChoiceNamedGroup = Tuple[str, Iterable[_Choice]] +_FieldChoices = Iterable[Union[_Choice, _ChoiceNamedGroup]] + +_ValidatorCallable = Callable[..., None] +_ErrorMessagesToOverride = Dict[str, Any] + +RECURSIVE_RELATIONSHIP_CONSTANT: str = ... + +# __set__ value type +_ST = TypeVar("_ST") +# __get__ return type +_GT = TypeVar("_GT") + +class RelatedField(FieldCacheMixin, Field[_ST, _GT]): + one_to_many: bool = ... + one_to_one: bool = ... + many_to_many: bool = ... + many_to_one: bool = ... + related_model: Type[Model] + opts: Any = ... + def get_forward_related_filter(self, obj: Model) -> Dict[str, Union[int, UUID]]: ... + def get_reverse_related_filter(self, obj: Model) -> Q: ... + @property + def swappable_setting(self) -> Optional[str]: ... + def set_attributes_from_rel(self) -> None: ... + def do_related_class(self, other: Type[Model], cls: Type[Model]) -> None: ... + def get_limit_choices_to(self) -> Dict[str, int]: ... + def related_query_name(self) -> str: ... + @property + def target_field(self) -> Field: ... + +class ForeignObject(RelatedField[_ST, _GT]): + def __init__( + self, + to: Union[Type[Model], str], + on_delete: Callable[..., None], + from_fields: Sequence[str], + to_fields: Sequence[str], + rel: Optional[ForeignObjectRel] = ..., + related_name: Optional[str] = ..., + related_query_name: Optional[str] = ..., + limit_choices_to: Optional[Union[Dict[str, Any], Callable[[], Any]]] = ..., + parent_link: bool = ..., + db_constraint: bool = ..., + swappable: bool = ..., + verbose_name: Optional[str] = ..., + name: Optional[str] = ..., + primary_key: bool = ..., + unique: bool = ..., + blank: bool = ..., + null: bool = ..., + db_index: bool = ..., + default: Any = ..., + editable: bool = ..., + auto_created: bool = ..., + serialize: bool = ..., + choices: Optional[_FieldChoices] = ..., + help_text: str = ..., + db_column: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + validators: Iterable[_ValidatorCallable] = ..., + error_messages: Optional[_ErrorMessagesToOverride] = ..., + ): ... + +class ForeignKey(ForeignObject[_ST, _GT]): + _pyi_private_set_type: Union[Any, Combinable] + _pyi_private_get_type: Any + def __init__( + self, + to: Union[Type[Model], str], + on_delete: Callable[..., None], + to_field: Optional[str] = ..., + related_name: Optional[str] = ..., + related_query_name: Optional[str] = ..., + limit_choices_to: Optional[Union[Dict[str, Any], Callable[[], Any], Q]] = ..., + parent_link: bool = ..., + db_constraint: bool = ..., + verbose_name: Optional[Union[str, bytes]] = ..., + name: Optional[str] = ..., + primary_key: bool = ..., + max_length: Optional[int] = ..., + unique: bool = ..., + blank: bool = ..., + null: bool = ..., + db_index: bool = ..., + default: Any = ..., + editable: bool = ..., + auto_created: bool = ..., + serialize: bool = ..., + unique_for_date: Optional[str] = ..., + unique_for_month: Optional[str] = ..., + unique_for_year: Optional[str] = ..., + choices: Optional[_FieldChoices] = ..., + help_text: str = ..., + db_column: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + validators: Iterable[_ValidatorCallable] = ..., + error_messages: Optional[_ErrorMessagesToOverride] = ..., + ): ... + # class access + @overload # type: ignore + def __get__(self, instance: None, owner) -> ForwardManyToOneDescriptor: ... + # Model instance access + @overload + def __get__(self, instance: Model, owner) -> _GT: ... + # non-Model instances + @overload + def __get__(self: _F, instance, owner) -> _F: ... + +class OneToOneField(RelatedField[_ST, _GT]): + _pyi_private_set_type: Union[Any, Combinable] + _pyi_private_get_type: Any + def __init__( + self, + to: Union[Type[Model], str], + on_delete: Any, + to_field: Optional[str] = ..., + related_name: Optional[str] = ..., + related_query_name: Optional[str] = ..., + limit_choices_to: Optional[Union[Dict[str, Any], Callable[[], Any], Q]] = ..., + parent_link: bool = ..., + db_constraint: bool = ..., + verbose_name: Optional[Union[str, bytes]] = ..., + name: Optional[str] = ..., + primary_key: bool = ..., + max_length: Optional[int] = ..., + unique: bool = ..., + blank: bool = ..., + null: bool = ..., + db_index: bool = ..., + default: Any = ..., + editable: bool = ..., + auto_created: bool = ..., + serialize: bool = ..., + unique_for_date: Optional[str] = ..., + unique_for_month: Optional[str] = ..., + unique_for_year: Optional[str] = ..., + choices: Optional[_FieldChoices] = ..., + help_text: str = ..., + db_column: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + validators: Iterable[_ValidatorCallable] = ..., + error_messages: Optional[_ErrorMessagesToOverride] = ..., + ): ... + # class access + @overload # type: ignore + def __get__(self, instance: None, owner) -> ForwardOneToOneDescriptor: ... + # Model instance access + @overload + def __get__(self, instance: Model, owner) -> _GT: ... + # non-Model instances + @overload + def __get__(self: _F, instance, owner) -> _F: ... + +class ManyToManyField(RelatedField[_ST, _GT]): + _pyi_private_set_type: Sequence[Any] + _pyi_private_get_type: RelatedManager[Any] + + rel_class: Any = ... + description: Any = ... + has_null_arg: Any = ... + swappable: bool = ... + def __init__( + self, + to: Union[Type[_T], str], + related_name: Optional[str] = ..., + related_query_name: Optional[str] = ..., + limit_choices_to: Optional[Union[Dict[str, Any], Callable[[], Any], Q]] = ..., + symmetrical: Optional[bool] = ..., + through: Optional[Union[str, Type[Model]]] = ..., + through_fields: Optional[Tuple[str, str]] = ..., + db_constraint: bool = ..., + db_table: Optional[str] = ..., + swappable: bool = ..., + verbose_name: Optional[Union[str, bytes]] = ..., + name: Optional[str] = ..., + primary_key: bool = ..., + max_length: Optional[int] = ..., + unique: bool = ..., + blank: bool = ..., + null: bool = ..., + db_index: bool = ..., + default: Any = ..., + editable: bool = ..., + auto_created: bool = ..., + serialize: bool = ..., + unique_for_date: Optional[str] = ..., + unique_for_month: Optional[str] = ..., + unique_for_year: Optional[str] = ..., + choices: Optional[_FieldChoices] = ..., + help_text: str = ..., + db_column: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + validators: Iterable[_ValidatorCallable] = ..., + error_messages: Optional[_ErrorMessagesToOverride] = ..., + ) -> None: ... + # class access + @overload # type: ignore + def __get__(self, instance: None, owner) -> ManyToManyDescriptor: ... + # Model instance access + @overload + def __get__(self, instance: Model, owner) -> _GT: ... + # non-Model instances + @overload + def __get__(self: _F, instance, owner) -> _F: ... + def get_path_info(self, filtered_relation: None = ...) -> List[PathInfo]: ... + def get_reverse_path_info(self, filtered_relation: None = ...) -> List[PathInfo]: ... + def contribute_to_related_class(self, cls: Type[Model], related: RelatedField) -> None: ... + def m2m_db_table(self) -> str: ... + def m2m_column_name(self) -> str: ... + def m2m_reverse_name(self) -> str: ... + def m2m_reverse_field_name(self) -> str: ... + def m2m_target_field_name(self) -> str: ... + def m2m_reverse_target_field_name(self) -> str: ... + +def create_many_to_many_intermediary_model(field: Type[Field], klass: Type[Model]) -> Type[Model]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/related_descriptors.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/related_descriptors.pyi new file mode 100644 index 00000000..ef53788a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/related_descriptors.pyi @@ -0,0 +1,70 @@ +from typing import Any, Callable, List, Optional, Tuple, Type, Union, Generic, TypeVar + +from django.core.exceptions import ObjectDoesNotExist +from django.db.models.base import Model +from django.db.models.fields.mixins import FieldCacheMixin +from django.db.models.fields.related import RelatedField, OneToOneField +from django.db.models.fields.reverse_related import ManyToManyRel, OneToOneRel +from django.db.models.query import QuerySet + +from django.db.models.fields import Field + +_T = TypeVar("_T") + +class ForwardManyToOneDescriptor: + RelatedObjectDoesNotExist: Type[ObjectDoesNotExist] + field: Field = ... + def __init__(self, field_with_rel: Field) -> None: ... + def is_cached(self, instance: Model) -> bool: ... + def get_queryset(self, **hints: Any) -> QuerySet: ... + def get_prefetch_queryset( + self, instances: List[Model], queryset: Optional[QuerySet] = ... + ) -> Tuple[QuerySet, Callable, Callable, bool, str, bool]: ... + def get_object(self, instance: Model) -> Model: ... + def __get__( + self, instance: Optional[Model], cls: Type[Model] = ... + ) -> Optional[Union[Model, ForwardManyToOneDescriptor]]: ... + def __set__(self, instance: Model, value: Optional[Model]) -> None: ... + def __reduce__(self) -> Tuple[Callable, Tuple[Type[Model], str]]: ... + +class ForwardOneToOneDescriptor(ForwardManyToOneDescriptor): + RelatedObjectDoesNotExist: Type[ObjectDoesNotExist] + field: OneToOneField + def get_object(self, instance: Model) -> Model: ... + +class ReverseOneToOneDescriptor: + RelatedObjectDoesNotExist: Type[ObjectDoesNotExist] + related: OneToOneRel = ... + def __init__(self, related: OneToOneRel) -> None: ... + def is_cached(self, instance: Model) -> bool: ... + def get_queryset(self, **hints: Any) -> QuerySet: ... + def get_prefetch_queryset( + self, instances: List[Model], queryset: Optional[QuerySet] = ... + ) -> Tuple[QuerySet, Callable, Callable, bool, str, bool]: ... + def __get__(self, instance: Optional[Model], cls: Type[Model] = ...) -> Union[Model, ReverseOneToOneDescriptor]: ... + def __set__(self, instance: Model, value: Optional[Model]) -> None: ... + def __reduce__(self) -> Tuple[Callable, Tuple[Type[Model], str]]: ... + +class ReverseManyToOneDescriptor: + rel: FieldCacheMixin = ... + field: FieldCacheMixin = ... + def __init__(self, rel: FieldCacheMixin) -> None: ... + def related_manager_cls(self): ... + def __get__(self, instance: Optional[Model], cls: Type[Model] = ...) -> ReverseManyToOneDescriptor: ... + def __set__(self, instance: Model, value: List[Model]) -> Any: ... + +def create_reverse_many_to_one_manager(superclass: Any, rel: Any): ... + +class ManyToManyDescriptor(ReverseManyToOneDescriptor): + field: RelatedField + rel: ManyToManyRel + reverse: bool = ... + def __init__(self, rel: ManyToManyRel, reverse: bool = ...) -> None: ... + @property + def through(self) -> Type[Model]: ... + def related_manager_cls(self): ... + +class _ForwardManyToManyManager(Generic[_T]): + def all(self) -> QuerySet: ... + +def create_forward_many_to_many_manager(superclass: Any, rel: Any, reverse: Any) -> _ForwardManyToManyManager: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/related_lookups.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/related_lookups.pyi new file mode 100644 index 00000000..c667edcb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/related_lookups.pyi @@ -0,0 +1,48 @@ +from collections import OrderedDict +from typing import Any, List, Tuple, Type, Iterable + +from django.db.models.expressions import Expression +from django.db.models.lookups import ( + BuiltinLookup, + Exact, + GreaterThan, + GreaterThanOrEqual, + In, + IsNull, + LessThan, + LessThanOrEqual, +) + +from django.db.models.fields import Field + +class MultiColSource: + alias: str + field: Field + sources: Tuple[Field, Field] + targets: Tuple[Field, Field] + contains_aggregate: bool = ... + output_field: Field = ... + def __init__( + self, alias: str, targets: Tuple[Field, Field], sources: Tuple[Field, Field], field: Field + ) -> None: ... + def relabeled_clone(self, relabels: OrderedDict) -> MultiColSource: ... + def get_lookup(self, lookup: str) -> Type[BuiltinLookup]: ... + +def get_normalized_value(value: Any, lhs: Expression) -> Tuple[None]: ... + +class RelatedIn(In): + bilateral_transforms: List[Any] + lhs: Expression + rhs: Any = ... + def get_prep_lookup(self) -> Iterable[Any]: ... + +class RelatedLookupMixin: + rhs: Any = ... + def get_prep_lookup(self) -> Any: ... + +class RelatedExact(RelatedLookupMixin, Exact): ... +class RelatedLessThan(RelatedLookupMixin, LessThan): ... +class RelatedGreaterThan(RelatedLookupMixin, GreaterThan): ... +class RelatedGreaterThanOrEqual(RelatedLookupMixin, GreaterThanOrEqual): ... +class RelatedLessThanOrEqual(RelatedLookupMixin, LessThanOrEqual): ... +class RelatedIsNull(RelatedLookupMixin, IsNull): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/reverse_related.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/reverse_related.pyi new file mode 100644 index 00000000..c2a43dd9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/fields/reverse_related.pyi @@ -0,0 +1,110 @@ +from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union + +from django.db.models.base import Model +from django.db.models.fields.related import ForeignKey, OneToOneField, RelatedField +from django.db.models.lookups import BuiltinLookup, StartsWith +from django.db.models.query_utils import FilteredRelation, PathInfo +from django.db.models.sql.where import WhereNode + +from django.db.models.fields import AutoField, Field +from .mixins import FieldCacheMixin + +class ForeignObjectRel(FieldCacheMixin): + many_to_many: bool + many_to_one: bool + one_to_many: bool + one_to_one: bool + auto_created: bool = ... + concrete: bool = ... + editable: bool = ... + is_relation: bool = ... + related_model: Type[Model] + null: bool = ... + field: RelatedField = ... + model: Union[Type[Model], str] = ... + related_name: Optional[str] = ... + related_query_name: Optional[str] = ... + limit_choices_to: Optional[Union[Dict[str, Any], Callable[[], Any]]] = ... + parent_link: bool = ... + on_delete: Callable = ... + symmetrical: bool = ... + multiple: bool = ... + field_name: Optional[str] = ... + def __init__( + self, + field: RelatedField, + to: Union[Type[Model], str], + related_name: Optional[str] = ..., + related_query_name: Optional[str] = ..., + limit_choices_to: Optional[Union[Dict[str, Any], Callable[[], Any]]] = ..., + parent_link: bool = ..., + on_delete: Optional[Callable] = ..., + ) -> None: ... + @property + def hidden(self) -> bool: ... + @property + def name(self) -> str: ... + @property + def remote_field(self) -> RelatedField: ... + @property + def target_field(self) -> AutoField: ... + def get_lookup(self, lookup_name: str) -> Type[BuiltinLookup]: ... + def get_internal_type(self) -> str: ... + @property + def db_type(self) -> Callable: ... + def get_choices( + self, include_blank: bool = ..., blank_choice: List[Tuple[str, str]] = ... + ) -> List[Tuple[int, str]]: ... + def is_hidden(self) -> bool: ... + def get_joining_columns(self) -> Tuple: ... + def get_extra_restriction( + self, where_class: Type[WhereNode], alias: str, related_alias: str + ) -> Optional[Union[StartsWith, WhereNode]]: ... + def set_field_name(self) -> None: ... + def get_accessor_name(self, model: Optional[Type[Model]] = ...) -> Optional[str]: ... + def get_path_info(self, filtered_relation: Optional[FilteredRelation] = ...) -> List[PathInfo]: ... + +class ManyToOneRel(ForeignObjectRel): + def __init__( + self, + field: ForeignKey, + to: Union[Type[Model], str], + field_name: Optional[str], + related_name: Optional[str] = ..., + related_query_name: Optional[str] = ..., + limit_choices_to: Optional[Union[Dict[str, Any], Callable[[], Any]]] = ..., + parent_link: bool = ..., + on_delete: Callable = ..., + ) -> None: ... + def get_related_field(self) -> Field: ... + +class OneToOneRel(ManyToOneRel): + def __init__( + self, + field: OneToOneField, + to: Union[Type[Model], str], + field_name: Optional[str], + related_name: Optional[str] = ..., + related_query_name: Optional[str] = ..., + limit_choices_to: Optional[Dict[str, str]] = ..., + parent_link: bool = ..., + on_delete: Callable = ..., + ) -> None: ... + +class ManyToManyRel(ForeignObjectRel): + through: Optional[Union[Type[Model], str]] = ... + through_fields: Optional[Tuple[str, str]] = ... + db_constraint: bool = ... + def __init__( + self, + field: RelatedField, + to: Union[Type[Model], str], + related_name: Optional[str] = ..., + related_query_name: Optional[str] = ..., + limit_choices_to: Any = ..., + symmetrical: bool = ..., + through: Optional[Union[Type[Model], str]] = ..., + through_fields: Optional[Tuple[str, str]] = ..., + db_constraint: bool = ..., + ) -> None: ... + def get_related_field(self) -> Field: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/__init__.pyi new file mode 100644 index 00000000..e95196af --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/__init__.pyi @@ -0,0 +1,93 @@ +from .text import ( + Lower as Lower, + Upper as Upper, + Length as Length, + Chr as Chr, + Concat as Concat, + ConcatPair as ConcatPair, + Left as Left, + Right as Right, + LPad as LPad, + RPad as RPad, + LTrim as LTrim, + RTrim as RTrim, + Trim as Trim, + Ord as Ord, + Repeat as Repeat, + SHA1 as SHA1, + SHA224 as SHA224, + SHA256 as SHA256, + SHA384 as SHA384, + SHA512 as SHA512, + StrIndex as StrIndex, + Substr as Substr, + Replace as Replace, + Reverse as Reverse, +) + +from .window import ( + CumeDist as CumeDist, + DenseRank as DenseRank, + FirstValue as FirstValue, + Lag as Lag, + LastValue as LastValue, + Lead as Lead, + NthValue as NthValue, + Ntile as Ntile, + PercentRank as PercentRank, + Rank as Rank, + RowNumber as RowNumber, +) + +from .datetime import ( + Extract as Extract, + ExtractDay as ExtractDay, + ExtractHour as ExtractHour, + ExtractMinute as ExtractMinute, + ExtractSecond as ExtractSecond, + ExtractMonth as ExtractMonth, + ExtractQuarter as ExtractQuarter, + ExtractWeek as ExtractWeek, + ExtractWeekDay as ExtractWeekDay, + ExtractYear as ExtractYear, + ExtractIsoYear as ExtractIsoYear, + Trunc as Trunc, + TruncDate as TruncDate, + TruncDay as TruncDay, + TruncHour as TruncHour, + TruncMinute as TruncMinute, + TruncQuarter as TruncQuarter, + TruncMonth as TruncMonth, + TruncSecond as TruncSecond, + TruncTime as TruncTime, + TruncWeek as TruncWeek, + TruncYear as TruncYear, + Now as Now, +) + +from .comparison import Coalesce as Coalesce, Greatest as Greatest, Least as Least, Cast as Cast, NullIf as NullIf + +from .math import ( + Abs as Abs, + ACos as ACos, + ASin as ASin, + ATan as ATan, + ATan2 as ATan2, + Ceil as Ceil, + Cos as Cos, + Cot as Cot, + Degrees as Degrees, + Floor as Floor, + Exp as Exp, + Ln as Ln, + Log as Log, + Mod as Mod, + Pi as Pi, + Power as Power, + Radians as Radians, + Round as Round, + Sign as Sign, + Sin as Sin, + Sqrt as Sqrt, + Tan as Tan, +) diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/comparison.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/comparison.pyi new file mode 100644 index 00000000..e2a61aae --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/comparison.pyi @@ -0,0 +1,12 @@ +from typing import Any, Union + +from django.db.models import Func +from django.db.models.fields import Field + +class Cast(Func): + def __init__(self, expression: Any, output_field: Union[str, Field]) -> None: ... + +class Coalesce(Func): ... +class Greatest(Func): ... +class Least(Func): ... +class NullIf(Func): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/datetime.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/datetime.pyi new file mode 100644 index 00000000..b319dacf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/datetime.pyi @@ -0,0 +1,32 @@ +from typing import Any, Optional + +from django.db.models import Func, Transform + +class TimezoneMixin: + tzinfo: Any = ... + def get_tzname(self) -> Optional[str]: ... + +class Extract(TimezoneMixin, Transform): ... +class ExtractYear(Extract): ... +class ExtractIsoYear(Extract): ... +class ExtractMonth(Extract): ... +class ExtractDay(Extract): ... +class ExtractWeek(Extract): ... +class ExtractWeekDay(Extract): ... +class ExtractQuarter(Extract): ... +class ExtractHour(Extract): ... +class ExtractMinute(Extract): ... +class ExtractSecond(Extract): ... +class Now(Func): ... +class TruncBase(TimezoneMixin, Transform): ... +class Trunc(TruncBase): ... +class TruncYear(TruncBase): ... +class TruncQuarter(TruncBase): ... +class TruncMonth(TruncBase): ... +class TruncWeek(TruncBase): ... +class TruncDay(TruncBase): ... +class TruncDate(TruncBase): ... +class TruncTime(TruncBase): ... +class TruncHour(TruncBase): ... +class TruncMinute(TruncBase): ... +class TruncSecond(TruncBase): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/math.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/math.pyi new file mode 100644 index 00000000..36adeb0d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/math.pyi @@ -0,0 +1,26 @@ +from django.db.models.expressions import Func +from django.db.models.functions.mixins import FixDecimalInputMixin, NumericOutputFieldMixin +from django.db.models.lookups import Transform + +class Abs(Transform): ... +class ACos(NumericOutputFieldMixin, Transform): ... +class ASin(NumericOutputFieldMixin, Transform): ... +class ATan(NumericOutputFieldMixin, Transform): ... +class ATan2(NumericOutputFieldMixin, Func): ... +class Ceil(Transform): ... +class Cos(NumericOutputFieldMixin, Transform): ... +class Cot(NumericOutputFieldMixin, Transform): ... +class Degrees(NumericOutputFieldMixin, Transform): ... +class Exp(NumericOutputFieldMixin, Transform): ... +class Floor(Transform): ... +class Ln(NumericOutputFieldMixin, Transform): ... +class Log(FixDecimalInputMixin, NumericOutputFieldMixin, Func): ... +class Mod(FixDecimalInputMixin, NumericOutputFieldMixin, Func): ... +class Pi(NumericOutputFieldMixin, Func): ... +class Power(NumericOutputFieldMixin, Func): ... +class Radians(NumericOutputFieldMixin, Transform): ... +class Round(Transform): ... +class Sin(NumericOutputFieldMixin, Transform): ... +class Sqrt(NumericOutputFieldMixin, Transform): ... +class Tan(NumericOutputFieldMixin, Transform): ... +class Sign(Transform): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/mixins.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/mixins.pyi new file mode 100644 index 00000000..2f6388be --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/mixins.pyi @@ -0,0 +1,3 @@ +class FixDecimalInputMixin: ... +class FixDurationInputMixin: ... +class NumericOutputFieldMixin: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/text.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/text.pyi new file mode 100644 index 00000000..fc120a48 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/text.pyi @@ -0,0 +1,65 @@ +from typing import Any, List, Optional, Tuple, Union + +from django.db.backends.sqlite3.base import DatabaseWrapper +from django.db.models.expressions import Combinable, Expression, Value +from django.db.models.sql.compiler import SQLCompiler + +from django.db.models import Func, Transform + +class BytesToCharFieldConversionMixin: ... +class Chr(Transform): ... + +class ConcatPair(Func): + def coalesce(self) -> ConcatPair: ... + +class Concat(Func): ... + +class Left(Func): + def __init__(self, expression: str, length: Union[Value, int], **extra: Any) -> None: ... + def get_substr(self) -> Substr: ... + def use_substr( + self, compiler: SQLCompiler, connection: DatabaseWrapper, **extra_context: Any + ) -> Tuple[str, List[int]]: ... + +class Length(Transform): ... +class Lower(Transform): ... + +class LPad(BytesToCharFieldConversionMixin, Func): + def __init__( + self, expression: str, length: Optional[Union[Length, int]], fill_text: Value = ..., **extra: Any + ) -> None: ... + +class LTrim(Transform): ... +class Ord(Transform): ... + +class Repeat(BytesToCharFieldConversionMixin, Func): + def __init__(self, expression: Union[Value, str], number: Optional[Union[Length, int]], **extra: Any) -> None: ... + +class Replace(Func): + def __init__(self, expression: Combinable, text: Value, replacement: Value = ..., **extra: Any) -> None: ... + +class Right(Left): ... +class RPad(LPad): ... +class RTrim(Transform): ... +class StrIndex(Func): ... + +class Substr(Func): + def __init__( + self, + expression: Union[Expression, str], + pos: Union[Expression, int], + length: Optional[Union[Value, int]] = ..., + **extra: Any + ) -> None: ... + +class Trim(Transform): ... +class Upper(Transform): ... +class Reverse(Transform): ... +class MySQLSHA2Mixin: ... +class OracleHashMixin: ... +class PostgreSQLSHAMixin: ... +class SHA1(OracleHashMixin, PostgreSQLSHAMixin, Transform): ... +class SHA224(MySQLSHA2Mixin, PostgreSQLSHAMixin, Transform): ... +class SHA256(MySQLSHA2Mixin, OracleHashMixin, PostgreSQLSHAMixin, Transform): ... +class SHA384(MySQLSHA2Mixin, OracleHashMixin, PostgreSQLSHAMixin, Transform): ... +class SHA512(MySQLSHA2Mixin, OracleHashMixin, PostgreSQLSHAMixin, Transform): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/window.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/window.pyi new file mode 100644 index 00000000..789a4fd7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/functions/window.pyi @@ -0,0 +1,26 @@ +from typing import Any, Optional + +from django.db.models import Func + +class CumeDist(Func): ... +class DenseRank(Func): ... +class FirstValue(Func): ... + +class LagLeadFunction(Func): + def __init__( + self, expression: Optional[str], offset: int = ..., default: Optional[int] = ..., **extra: Any + ) -> None: ... + +class Lag(LagLeadFunction): ... +class LastValue(Func): ... +class Lead(LagLeadFunction): ... + +class NthValue(Func): + def __init__(self, expression: Optional[str], nth: int = ..., **extra: Any) -> None: ... + +class Ntile(Func): + def __init__(self, num_buckets: int = ..., **extra: Any) -> None: ... + +class PercentRank(Func): ... +class Rank(Func): ... +class RowNumber(Func): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/indexes.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/indexes.pyi new file mode 100644 index 00000000..cb33b493 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/indexes.pyi @@ -0,0 +1,34 @@ +from typing import Any, List, Optional, Sequence, Tuple, Type + +from django.db.backends.base.schema import BaseDatabaseSchemaEditor +from django.db.backends.ddl_references import Statement +from django.db.models.base import Model +from django.db.models.query_utils import Q + +class Index: + model: Type[Model] + suffix: str = ... + max_name_length: int = ... + fields: Sequence[str] = ... + fields_orders: Sequence[Tuple[str, str]] = ... + name: str = ... + db_tablespace: Optional[str] = ... + opclasses: Sequence[str] = ... + condition: Optional[Q] = ... + def __init__( + self, + *, + fields: Sequence[str] = ..., + name: Optional[str] = ..., + db_tablespace: Optional[str] = ..., + opclasses: Sequence[str] = ..., + condition: Optional[Q] = ... + ) -> None: ... + def check_name(self) -> List[str]: ... + def create_sql( + self, model: Type[Model], schema_editor: BaseDatabaseSchemaEditor, using: str = ... + ) -> Statement: ... + def remove_sql(self, model: Type[Model], schema_editor: BaseDatabaseSchemaEditor) -> str: ... + def deconstruct(self) -> Any: ... + def clone(self) -> Index: ... + def set_name_with_model(self, model: Type[Model]) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/lookups.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/lookups.pyi new file mode 100644 index 00000000..6bdf9d9d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/lookups.pyi @@ -0,0 +1,104 @@ +from datetime import datetime +from typing import Any, Iterable, List, Optional, Tuple, Type, Union, Mapping, TypeVar, Generic + +from django.db.backends.sqlite3.base import DatabaseWrapper +from django.db.models.expressions import Expression, Func +from django.db.models.query_utils import RegisterLookupMixin +from django.db.models.sql.compiler import SQLCompiler +from django.utils.datastructures import OrderedSet +from django.utils.safestring import SafeText + +from django.db.models.fields import TextField, related_lookups + +_T = TypeVar("_T") + +class Lookup(Generic[_T]): + lookup_name: str = ... + prepare_rhs: bool = ... + can_use_none_as_rhs: bool = ... + lhs: Any = ... + rhs: Any = ... + bilateral_transforms: List[Type[Transform]] = ... + def __init__(self, lhs: Union[Expression, TextField, related_lookups.MultiColSource], rhs: Any) -> None: ... + def apply_bilateral_transforms(self, value: Expression) -> Transform: ... + def batch_process_rhs( + self, compiler: SQLCompiler, connection: DatabaseWrapper, rhs: Optional[OrderedSet] = ... + ) -> Tuple[List[str], List[str]]: ... + def get_source_expressions(self) -> List[Expression]: ... + def set_source_expressions(self, new_exprs: List[Expression]) -> None: ... + def get_prep_lookup(self) -> Any: ... + def get_db_prep_lookup(self, value: Union[int, str], connection: DatabaseWrapper) -> Tuple[str, List[SafeText]]: ... + def process_lhs( + self, compiler: SQLCompiler, connection: DatabaseWrapper, lhs: Optional[Expression] = ... + ) -> Tuple[str, List[Union[int, str]]]: ... + def process_rhs(self, compiler: SQLCompiler, connection: DatabaseWrapper) -> Tuple[str, List[Union[int, str]]]: ... + def rhs_is_direct_value(self) -> bool: ... + def relabeled_clone(self: _T, relabels: Mapping[str, str]) -> _T: ... + def get_group_by_cols(self) -> List[Expression]: ... + def as_sql(self, compiler: Any, connection: Any) -> Any: ... + def contains_aggregate(self) -> bool: ... + def contains_over_clause(self) -> bool: ... + @property + def is_summary(self) -> bool: ... + +class Transform(RegisterLookupMixin, Func): + bilateral: bool = ... + @property + def lhs(self) -> Expression: ... + def get_bilateral_transforms(self) -> List[Type[Transform]]: ... + +class BuiltinLookup(Lookup[_T]): + def get_rhs_op(self, connection: DatabaseWrapper, rhs: str) -> str: ... + +class FieldGetDbPrepValueMixin: + get_db_prep_lookup_value_is_iterable: bool = ... + +class FieldGetDbPrepValueIterableMixin(FieldGetDbPrepValueMixin): + def get_prep_lookup(self) -> Iterable[Any]: ... + def resolve_expression_parameter( + self, compiler: SQLCompiler, connection: DatabaseWrapper, sql: str, param: Any + ) -> Any: ... + +class Exact(FieldGetDbPrepValueMixin, BuiltinLookup): ... +class IExact(BuiltinLookup): ... +class GreaterThan(FieldGetDbPrepValueMixin, BuiltinLookup): ... +class GreaterThanOrEqual(FieldGetDbPrepValueMixin, BuiltinLookup[_T]): ... +class LessThan(FieldGetDbPrepValueMixin, BuiltinLookup[_T]): ... +class LessThanOrEqual(FieldGetDbPrepValueMixin, BuiltinLookup): ... + +class IntegerFieldFloatRounding: + rhs: Any = ... + def get_prep_lookup(self) -> Any: ... + +class IntegerGreaterThanOrEqual(IntegerFieldFloatRounding, GreaterThanOrEqual[Union[int, float]]): ... +class IntegerLessThan(IntegerFieldFloatRounding, LessThan[Union[int, float]]): ... + +class In(FieldGetDbPrepValueIterableMixin, BuiltinLookup): + def split_parameter_list_as_sql(self, compiler: Any, connection: Any): ... + +class PatternLookup(BuiltinLookup[str]): + param_pattern: str = ... + +class Contains(PatternLookup): ... +class IContains(Contains): ... +class StartsWith(PatternLookup): ... +class IStartsWith(StartsWith): ... +class EndsWith(PatternLookup): ... +class IEndsWith(EndsWith): ... +class Range(FieldGetDbPrepValueIterableMixin, BuiltinLookup): ... +class IsNull(BuiltinLookup[bool]): ... +class Regex(BuiltinLookup[str]): ... +class IRegex(Regex): ... + +class YearLookup(Lookup): + def year_lookup_bounds(self, connection: DatabaseWrapper, year: int) -> List[str]: ... + +class YearComparisonLookup(YearLookup): + def get_rhs_op(self, connection: DatabaseWrapper, rhs: str) -> str: ... + def get_bound(self, start: datetime, finish: datetime) -> Any: ... + +class YearExact(YearLookup, Exact): ... +class YearGt(YearComparisonLookup): ... +class YearGte(YearComparisonLookup): ... +class YearLt(YearComparisonLookup): ... +class YearLte(YearComparisonLookup): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/manager.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/manager.pyi new file mode 100644 index 00000000..50bef8da --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/manager.pyi @@ -0,0 +1,45 @@ +from typing import Any, Dict, List, Optional, Tuple, Type, TypeVar, Iterable, Union + +from django.db.models.base import Model +from django.db.models.query import QuerySet + +_T = TypeVar("_T", bound=Model, covariant=True) +_M = TypeVar("_M", bound="BaseManager") + +class BaseManager(QuerySet[_T]): + creation_counter: int = ... + auto_created: bool = ... + use_in_migrations: bool = ... + name: str = ... + model: Type[_T] = ... + db: str + _db: Optional[str] + def __init__(self) -> None: ... + def deconstruct(self) -> Tuple[bool, str, None, Tuple, Dict[str, int]]: ... + def check(self, **kwargs: Any) -> List[Any]: ... + @classmethod + def from_queryset(cls, queryset_class: Type[QuerySet], class_name: Optional[str] = ...) -> Any: ... + @classmethod + def _get_queryset_methods(cls, queryset_class: type) -> Dict[str, Any]: ... + def contribute_to_class(self, model: Type[Model], name: str) -> None: ... + def db_manager(self: _M, using: Optional[str] = ..., hints: Optional[Dict[str, Model]] = ...) -> _M: ... + def get_queryset(self) -> QuerySet[_T]: ... + +class Manager(BaseManager[_T]): ... + +class RelatedManager(Manager[_T]): + related_val: Tuple[int, ...] + def add(self, *objs: Union[_T, int], bulk: bool = ...) -> None: ... + def remove(self, *objs: Union[_T, int], bulk: bool = ...) -> None: ... + def set( + self, objs: Union[QuerySet[_T], Iterable[Union[_T, int]]], *, bulk: bool = ..., clear: bool = ... + ) -> None: ... + def clear(self) -> None: ... + +class ManagerDescriptor: + manager: Manager = ... + def __init__(self, manager: Manager) -> None: ... + def __get__(self, instance: Optional[Model], cls: Type[Model] = ...) -> Manager: ... + +class EmptyManager(Manager): + def __init__(self, model: Type[Model]) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/options.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/options.pyi new file mode 100644 index 00000000..d7fee813 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/options.pyi @@ -0,0 +1,123 @@ +import collections +from typing import Any, Callable, Dict, Generic, Iterator, List, Optional, Sequence, Tuple, Type, TypeVar, Union + +from django.apps.config import AppConfig +from django.apps.registry import Apps +from django.contrib.contenttypes.fields import GenericForeignKey +from django.contrib.postgres.fields.array import ArrayField +from django.contrib.postgres.fields.citext import CIText +from django.db.backends.sqlite3.base import DatabaseWrapper +from django.db.models.base import Model +from django.db.models.constraints import BaseConstraint +from django.db.models.fields.mixins import FieldCacheMixin +from django.db.models.fields.related import ManyToManyField, OneToOneField +from django.db.models.fields.reverse_related import ForeignObjectRel +from django.db.models.manager import Manager +from django.db.models.query_utils import PathInfo +from django.utils.datastructures import ImmutableList + +from django.db.models.fields import AutoField, Field + +PROXY_PARENTS: Any +EMPTY_RELATION_TREE: Any +IMMUTABLE_WARNING: str +DEFAULT_NAMES: Tuple[str, ...] + +def normalize_together( + option_together: Union[Sequence[Tuple[str, str]], Tuple[str, str]] +) -> Tuple[Tuple[str, str], ...]: ... +def make_immutable_fields_list( + name: str, data: Union[Iterator[Any], List[Union[ArrayField, CIText]], List[Union[Field, FieldCacheMixin]]] +) -> ImmutableList: ... + +_M = TypeVar("_M", bound=Model) + +class Options(Generic[_M]): + base_manager: Manager + concrete_fields: ImmutableList + constraints: List[BaseConstraint] + default_manager: Manager + fields: ImmutableList + local_concrete_fields: ImmutableList + related_objects: ImmutableList + FORWARD_PROPERTIES: Any = ... + REVERSE_PROPERTIES: Any = ... + default_apps: Any = ... + local_fields: List[Field] = ... + local_many_to_many: List[ManyToManyField] = ... + private_fields: List[Any] = ... + local_managers: List[Manager] = ... + base_manager_name: Optional[str] = ... + default_manager_name: Optional[str] = ... + model_name: Optional[str] = ... + verbose_name: Optional[str] = ... + verbose_name_plural: Optional[str] = ... + db_table: str = ... + ordering: Optional[Sequence[str]] = ... + indexes: List[Any] = ... + unique_together: Union[List[Any], Tuple] = ... + index_together: Union[List[Any], Tuple] = ... + select_on_save: bool = ... + default_permissions: Sequence[str] = ... + permissions: List[Any] = ... + object_name: Optional[str] = ... + app_label: str = ... + get_latest_by: Optional[Sequence[str]] = ... + order_with_respect_to: None = ... + db_tablespace: str = ... + required_db_features: List[Any] = ... + required_db_vendor: None = ... + meta: Optional[type] = ... + pk: Optional[Field] = ... + auto_field: Optional[AutoField] = ... + abstract: bool = ... + managed: bool = ... + proxy: bool = ... + proxy_for_model: Optional[Type[Model]] = ... + concrete_model: Optional[Type[Model]] = ... + swappable: None = ... + parents: collections.OrderedDict = ... + auto_created: bool = ... + related_fkey_lookups: List[Any] = ... + apps: Apps = ... + default_related_name: Optional[str] = ... + model: Type[Model] = ... + original_attrs: Dict[str, Any] = ... + def __init__(self, meta: Optional[type], app_label: Optional[str] = ...) -> None: ... + @property + def label(self) -> str: ... + @property + def label_lower(self) -> str: ... + @property + def app_config(self) -> AppConfig: ... + @property + def installed(self): ... + def contribute_to_class(self, cls: Type[Model], name: str) -> None: ... + def add_manager(self, manager: Manager) -> None: ... + def add_field(self, field: Union[GenericForeignKey, Field], private: bool = ...) -> None: ... + def setup_pk(self, field: Field) -> None: ... + def setup_proxy(self, target: Type[Model]) -> None: ... + def can_migrate(self, connection: Union[DatabaseWrapper, str]) -> bool: ... + @property + def verbose_name_raw(self) -> str: ... + @property + def swapped(self) -> Optional[str]: ... + @property + def many_to_many(self) -> List[ManyToManyField]: ... + @property + def fields_map(self) -> Dict[str, Union[Field, ForeignObjectRel]]: ... + @property + def managers(self) -> List[Manager]: ... + @property + def managers_map(self) -> Dict[str, Manager]: ... + @property + def db_returning_fields(self) -> List[Field]: ... + def get_field(self, field_name: Union[Callable, str]) -> Field: ... + def get_base_chain(self, model: Type[Model]) -> List[Type[Model]]: ... + def get_parent_list(self) -> List[Type[Model]]: ... + def get_ancestor_link(self, ancestor: Type[Model]) -> Optional[OneToOneField]: ... + def get_path_to_parent(self, parent: Type[Model]) -> List[PathInfo]: ... + def get_path_from_parent(self, parent: Type[Model]) -> List[PathInfo]: ... + def get_fields( + self, include_parents: bool = ..., include_hidden: bool = ... + ) -> List[Union[Field, ForeignObjectRel]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/query.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/query.pyi new file mode 100644 index 00000000..53224145 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/query.pyi @@ -0,0 +1,213 @@ +import datetime +from typing import ( + Any, + Collection, + Dict, + Generic, + Iterable, + Iterator, + List, + MutableMapping, + Optional, + Sequence, + Sized, + Tuple, + Type, + TypeVar, + Union, + overload, + Reversible, +) + +from django.db.models.base import Model +from django.db.models.expressions import Combinable as Combinable, F as F # noqa: F401 +from django.db.models.sql.query import Query, RawQuery + +from django.db import models +from django.db.models import Manager +from django.db.models.query_utils import Q as Q # noqa: F401 + +_T = TypeVar("_T", bound=models.Model, covariant=True) +_QS = TypeVar("_QS", bound="_BaseQuerySet") + +class _BaseQuerySet(Generic[_T], Sized): + model: Type[_T] + query: Query + def __init__( + self, + model: Optional[Type[models.Model]] = ..., + query: Optional[Query] = ..., + using: Optional[str] = ..., + hints: Optional[Dict[str, models.Model]] = ..., + ) -> None: ... + @classmethod + def as_manager(cls) -> Manager[Any]: ... + def __len__(self) -> int: ... + def __bool__(self) -> bool: ... + def __class_getitem__(cls, item: Type[_T]): ... + def __getstate__(self) -> Dict[str, Any]: ... + # Technically, the other QuerySet must be of the same type _T, but _T is covariant + def __and__(self: _QS, other: _BaseQuerySet[_T]) -> _QS: ... + def __or__(self: _QS, other: _BaseQuerySet[_T]) -> _QS: ... + def iterator(self, chunk_size: int = ...) -> Iterator[_T]: ... + def aggregate(self, *args: Any, **kwargs: Any) -> Dict[str, Any]: ... + def get(self, *args: Any, **kwargs: Any) -> _T: ... + def create(self, *args: Any, **kwargs: Any) -> _T: ... + def bulk_create( + self, objs: Iterable[_T], batch_size: Optional[int] = ..., ignore_conflicts: bool = ... + ) -> List[_T]: ... + def bulk_update(self, objs: Iterable[_T], fields: Sequence[str], batch_size: Optional[int] = ...) -> None: ... + def get_or_create(self, defaults: Optional[MutableMapping[str, Any]] = ..., **kwargs: Any) -> Tuple[_T, bool]: ... + def update_or_create( + self, defaults: Optional[MutableMapping[str, Any]] = ..., **kwargs: Any + ) -> Tuple[_T, bool]: ... + def earliest(self, *fields: Any, field_name: Optional[Any] = ...) -> _T: ... + def latest(self, *fields: Any, field_name: Optional[Any] = ...) -> _T: ... + def first(self) -> Optional[_T]: ... + def last(self) -> Optional[_T]: ... + def in_bulk(self, id_list: Iterable[Any] = ..., *, field_name: str = ...) -> Dict[Any, _T]: ... + def delete(self) -> Tuple[int, Dict[str, int]]: ... + def update(self, **kwargs: Any) -> int: ... + def exists(self) -> bool: ... + def explain(self, *, format: Optional[Any] = ..., **options: Any) -> str: ... + def raw( + self, + raw_query: str, + params: Any = ..., + translations: Optional[Dict[str, str]] = ..., + using: Optional[str] = ..., + ) -> RawQuerySet: ... + # The type of values may be overridden to be more specific in the mypy plugin, depending on the fields param + def values(self, *fields: Union[str, Combinable], **expressions: Any) -> ValuesQuerySet[_T, Dict[str, Any]]: ... + # The type of values_list may be overridden to be more specific in the mypy plugin, depending on the fields param + def values_list( + self, *fields: Union[str, Combinable], flat: bool = ..., named: bool = ... + ) -> ValuesQuerySet[_T, Any]: ... + def dates(self, field_name: str, kind: str, order: str = ...) -> ValuesQuerySet[_T, datetime.date]: ... + def datetimes( + self, field_name: str, kind: str, order: str = ..., tzinfo: Optional[datetime.tzinfo] = ... + ) -> ValuesQuerySet[_T, datetime.datetime]: ... + def none(self: _QS) -> _QS: ... + def all(self: _QS) -> _QS: ... + def filter(self: _QS, *args: Any, **kwargs: Any) -> _QS: ... + def exclude(self: _QS, *args: Any, **kwargs: Any) -> _QS: ... + def complex_filter(self, filter_obj: Any) -> _QS: ... + def count(self) -> int: ... + def union(self: _QS, *other_qs: Any, all: bool = ...) -> _QS: ... + def intersection(self: _QS, *other_qs: Any) -> _QS: ... + def difference(self: _QS, *other_qs: Any) -> _QS: ... + def select_for_update(self: _QS, nowait: bool = ..., skip_locked: bool = ..., of: Tuple = ...) -> _QS: ... + def select_related(self: _QS, *fields: Any) -> _QS: ... + def prefetch_related(self: _QS, *lookups: Any) -> _QS: ... + # TODO: return type + def annotate(self, *args: Any, **kwargs: Any) -> QuerySet[Any]: ... + def order_by(self: _QS, *field_names: Any) -> _QS: ... + def distinct(self: _QS, *field_names: Any) -> _QS: ... + # extra() return type won't be supported any time soon + def extra( + self, + select: Optional[Dict[str, Any]] = ..., + where: Optional[List[str]] = ..., + params: Optional[List[Any]] = ..., + tables: Optional[List[str]] = ..., + order_by: Optional[Sequence[str]] = ..., + select_params: Optional[Sequence[Any]] = ..., + ) -> QuerySet[Any]: ... + def reverse(self: _QS) -> _QS: ... + def defer(self: _QS, *fields: Any) -> _QS: ... + def only(self: _QS, *fields: Any) -> _QS: ... + def using(self: _QS, alias: Optional[str]) -> _QS: ... + @property + def ordered(self) -> bool: ... + @property + def db(self) -> str: ... + def resolve_expression(self, *args: Any, **kwargs: Any) -> Any: ... + +class QuerySet(_BaseQuerySet[_T], Collection[_T], Reversible[_T], Sized): + def __iter__(self) -> Iterator[_T]: ... + def __contains__(self, x: object) -> bool: ... + @overload + def __getitem__(self, i: int) -> _T: ... + @overload + def __getitem__(self: _QS, s: slice) -> _QS: ... + def __reversed__(self) -> Iterator[_T]: ... + +_Row = TypeVar("_Row", covariant=True) + +class BaseIterable(Sequence[_Row]): + def __init__(self, queryset: _BaseQuerySet, chunked_fetch: bool = ..., chunk_size: int = ...): ... + def __iter__(self) -> Iterator[_Row]: ... + def __contains__(self, x: object) -> bool: ... + def __len__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> _Row: ... + @overload + def __getitem__(self, s: slice) -> Sequence[_Row]: ... + +class ModelIterable(BaseIterable[Model]): ... +class ValuesIterable(BaseIterable[Dict[str, Any]]): ... +class ValuesListIterable(BaseIterable[Tuple]): ... +class NamedValuesListIterable(ValuesListIterable): ... + +class FlatValuesListIterable(BaseIterable): + def __iter__(self) -> Iterator[Any]: ... + +class ValuesQuerySet(_BaseQuerySet[_T], Collection[_Row], Sized): + def __contains__(self, x: object) -> bool: ... + def __iter__(self) -> Iterator[_Row]: ... # type: ignore + @overload # type: ignore + def __getitem__(self, i: int) -> _Row: ... + @overload + def __getitem__(self: _QS, s: slice) -> _QS: ... + def iterator(self, chunk_size: int = ...) -> Iterator[_Row]: ... # type: ignore + def get(self, *args: Any, **kwargs: Any) -> _Row: ... # type: ignore + def earliest(self, *fields: Any, field_name: Optional[Any] = ...) -> _Row: ... # type: ignore + def latest(self, *fields: Any, field_name: Optional[Any] = ...) -> _Row: ... # type: ignore + def first(self) -> Optional[_Row]: ... # type: ignore + def last(self) -> Optional[_Row]: ... # type: ignore + +class RawQuerySet(Iterable[_T], Sized): + query: RawQuery + def __init__( + self, + raw_query: Union[RawQuery, str], + model: Optional[Type[models.Model]] = ..., + query: Optional[Query] = ..., + params: Tuple[Any] = ..., + translations: Optional[Dict[str, str]] = ..., + using: str = ..., + hints: Optional[Dict[str, models.Model]] = ..., + ) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T]: ... + def __bool__(self) -> bool: ... + @overload + def __getitem__(self, k: int) -> _T: ... + @overload + def __getitem__(self, k: str) -> Any: ... + @overload + def __getitem__(self, k: slice) -> RawQuerySet[_T]: ... + @property + def columns(self) -> List[str]: ... + @property + def db(self) -> str: ... + def iterator(self) -> Iterator[_T]: ... + @property + def model_fields(self) -> Dict[str, str]: ... + def prefetch_related(self, *lookups: Any) -> RawQuerySet[_T]: ... + def resolve_model_init_order(self) -> Tuple[List[str], List[int], List[Tuple[str, int]]]: ... + def using(self, alias: Optional[str]) -> RawQuerySet[_T]: ... + +class Prefetch(object): + def __init__(self, lookup: str, queryset: Optional[QuerySet] = ..., to_attr: Optional[str] = ...) -> None: ... + def __getstate__(self) -> Dict[str, Any]: ... + def add_prefix(self, prefix: str) -> None: ... + def get_current_prefetch_to(self, level: int) -> str: ... + def get_current_to_attr(self, level: int) -> Tuple[str, str]: ... + def get_current_queryset(self, level) -> Optional[QuerySet]: ... + +def prefetch_related_objects(model_instances: Iterable[_T], *related_lookups: Union[str, Prefetch]) -> None: ... +def get_prefetcher(instance: Model, through_attr: str, to_attr: str) -> Tuple[Any, Any, bool, bool]: ... + +class InstanceCheckMeta(type): ... +class EmptyQuerySet(metaclass=InstanceCheckMeta): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/query_utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/query_utils.pyi new file mode 100644 index 00000000..7ee77bcd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/query_utils.pyi @@ -0,0 +1,79 @@ +from collections import namedtuple +from typing import Any, Collection, Dict, Iterator, List, Mapping, Optional, Sequence, Set, Tuple, Type + +from django.db.models.base import Model +from django.db.models.fields.mixins import FieldCacheMixin +from django.db.models.sql.compiler import SQLCompiler +from django.db.models.sql.query import Query +from django.db.models.sql.where import WhereNode + +from django.db.models.fields import Field +from django.utils import tree + +PathInfo = namedtuple("PathInfo", "from_opts to_opts target_fields join_field m2m direct filtered_relation") + +class InvalidQuery(Exception): ... + +def subclasses(cls: Type[RegisterLookupMixin]) -> Iterator[Type[RegisterLookupMixin]]: ... + +class QueryWrapper: + contains_aggregate: bool = ... + data: Tuple[str, List[Any]] = ... + def __init__(self, sql: str, params: List[Any]) -> None: ... + def as_sql(self, compiler: SQLCompiler = ..., connection: Any = ...) -> Any: ... + +class Q(tree.Node): + AND: str = ... + OR: str = ... + conditional: bool = ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def __or__(self, other: Any) -> Q: ... + def __and__(self, other: Any) -> Q: ... + def __invert__(self) -> Q: ... + def resolve_expression( + self, + query: Query = ..., + allow_joins: bool = ..., + reuse: Optional[Set[str]] = ..., + summarize: bool = ..., + for_save: bool = ..., + ) -> WhereNode: ... + def deconstruct(self) -> Tuple[str, Tuple, Dict[str, str]]: ... + +class DeferredAttribute: + field_name: str = ... + field: Field + def __init__(self, field_name: str) -> None: ... + +class RegisterLookupMixin: + lookup_name: str + @classmethod + def get_lookups(cls) -> Dict[str, Any]: ... + def get_lookup(self, lookup_name: str) -> Optional[Any]: ... + def get_transform(self, lookup_name: str) -> Optional[Any]: ... + @staticmethod + def merge_dicts(dicts: List[Dict[str, Any]]) -> Dict[str, Any]: ... + @classmethod + def register_lookup(cls, lookup: Any, lookup_name: Optional[str] = ...) -> Type[Any]: ... + @classmethod + def _unregister_lookup(cls, lookup: Any, lookup_name: Optional[str] = ...): ... + +def select_related_descend( + field: Field, + restricted: bool, + requested: Optional[Mapping[str, Any]], + load_fields: Optional[Collection[str]], + reverse: bool = ..., +) -> bool: ... +def refs_expression(lookup_parts: Sequence[str], annotations: Mapping[str, bool]) -> Tuple[bool, Sequence[str]]: ... +def check_rel_lookup_compatibility(model: Type[Model], target_opts: Any, field: FieldCacheMixin) -> bool: ... + +class FilteredRelation: + relation_name: str = ... + alias: Optional[str] = ... + condition: Q = ... + path: List[str] = ... + def __init__(self, relation_name: str, *, condition: Any = ...) -> None: ... + def clone(self) -> FilteredRelation: ... + def resolve_expression(self, *args: Any, **kwargs: Any) -> None: ... + def as_sql(self, compiler: SQLCompiler, connection: Any) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/signals.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/signals.pyi new file mode 100644 index 00000000..bd8da952 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/signals.pyi @@ -0,0 +1,34 @@ +from typing import Any, Callable, Optional, Type, Union + +from django.apps.registry import Apps +from django.db.models.base import Model +from django.dispatch import Signal + +class_prepared: Any + +class ModelSignal(Signal): + def connect( # type: ignore + self, + receiver: Callable, + sender: Optional[Union[Type[Model], str]] = ..., + weak: bool = ..., + dispatch_uid: None = ..., + apps: Optional[Apps] = ..., + ) -> None: ... + def disconnect( # type: ignore + self, + receiver: Callable = ..., + sender: Optional[Union[Type[Model], str]] = ..., + dispatch_uid: None = ..., + apps: Optional[Apps] = ..., + ) -> Optional[bool]: ... + +pre_init: Any +post_init: Any +pre_save: Any +post_save: Any +pre_delete: Any +post_delete: Any +m2m_changed: Any +pre_migrate: Any +post_migrate: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/__init__.pyi new file mode 100644 index 00000000..f5faddaf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/__init__.pyi @@ -0,0 +1,8 @@ +from .query import Query as Query, RawQuery as RawQuery + +from .subqueries import ( + InsertQuery as InsertQuery, + AggregateQuery as AggregateQuery, + DeleteQuery as DeleteQuery, + UpdateQuery as UpdateQuery, +) diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/compiler.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/compiler.pyi new file mode 100644 index 00000000..c5aa4751 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/compiler.pyi @@ -0,0 +1,109 @@ +from datetime import date, datetime +from decimal import Decimal +from itertools import chain +from typing import Any, Callable, Dict, Iterator, List, Optional, Set, Tuple, Type, Union +from uuid import UUID + +from django.db.models.base import Model +from django.db.models.expressions import BaseExpression, Expression + +from django.db.models.sql.query import Query, RawQuery + +FORCE: Any + +class SQLCompiler: + query: Any = ... + connection: Any = ... + using: Any = ... + quote_cache: Any = ... + select: Any = ... + annotation_col_map: Any = ... + klass_info: Any = ... + ordering_parts: Any = ... + def __init__(self, query: Union[Query, RawQuery], connection: Any, using: Optional[str]) -> None: ... + col_count: Any = ... + def setup_query(self) -> None: ... + has_extra_select: Any = ... + def pre_sql_setup( + self, + ) -> Tuple[ + List[Tuple[Expression, Tuple[str, Union[List[Any], Tuple[str, str]]], None]], + List[Tuple[Expression, Tuple[str, List[Union[int, str]], bool]]], + List[Tuple[str, List[float]]], + ]: ... + def get_group_by( + self, + select: List[Tuple[BaseExpression, Tuple[str, List[float]], Optional[str]]], + order_by: List[Tuple[Expression, Tuple[str, List[Union[int, str]], bool]]], + ) -> List[Tuple[str, List[float]]]: ... + def collapse_group_by( + self, expressions: List[Expression], having: Union[List[Expression], Tuple] + ) -> List[Expression]: ... + def get_select( + self, + ) -> Tuple[ + List[Tuple[Expression, Tuple[str, List[Union[int, str]]], Optional[str]]], + Optional[Dict[str, Any]], + Dict[str, int], + ]: ... + def get_order_by(self) -> List[Tuple[Expression, Tuple[str, List[Any], bool]]]: ... + def get_extra_select( + self, + order_by: List[Tuple[Expression, Tuple[str, List[Any], bool]]], + select: List[Tuple[Expression, Tuple[str, List[float]], Optional[str]]], + ) -> List[Tuple[Expression, Tuple[str, List[Any]], None]]: ... + def quote_name_unless_alias(self, name: str) -> str: ... + def compile( + self, node: Any, select_format: Any = ... + ) -> Tuple[str, Union[List[Optional[int]], Tuple[int, int]]]: ... + def get_combinator_sql(self, combinator: str, all: bool) -> Tuple[List[str], Union[List[int], List[str]]]: ... + def as_sql(self, with_limits: bool = ..., with_col_aliases: bool = ...) -> Any: ... + def get_default_columns( + self, start_alias: Optional[str] = ..., opts: Optional[Any] = ..., from_parent: Optional[Type[Model]] = ... + ) -> List[Expression]: ... + def get_distinct(self) -> Tuple[List[Any], List[Any]]: ... + def find_ordering_name( + self, + name: str, + opts: Any, + alias: Optional[str] = ..., + default_order: str = ..., + already_seen: Optional[Set[Tuple[Optional[Tuple[Tuple[str, str]]], Tuple[Tuple[str, str]]]]] = ..., + ) -> List[Tuple[Expression, bool]]: ... + def get_from_clause(self) -> Tuple[List[str], List[Union[int, str]]]: ... + def get_related_selections( + self, + select: List[Tuple[Expression, Optional[str]]], + opts: Optional[Any] = ..., + root_alias: Optional[str] = ..., + cur_depth: int = ..., + requested: Optional[Union[Dict[str, Dict[str, Dict[str, Dict[Any, Any]]]], bool]] = ..., + restricted: Optional[bool] = ..., + ) -> List[Dict[str, Any]]: ... + def get_select_for_update_of_arguments(self): ... + def deferred_to_columns(self) -> Dict[Type[Model], Set[str]]: ... + def get_converters(self, expressions: List[Expression]) -> Dict[int, Tuple[List[Callable], Expression]]: ... + def apply_converters( + self, rows: chain, converters: Dict[int, Tuple[List[Callable], Expression]] + ) -> Iterator[ + Union[ + List[Optional[Union[bytes, datetime, int, str]]], + List[Optional[Union[date, Decimal, float, str]]], + List[Optional[Union[datetime, float, str, UUID]]], + ] + ]: ... + def results_iter( + self, + results: Optional[Union[Iterator[Any], List[List[Tuple[Union[int, str]]]]]] = ..., + tuple_expected: bool = ..., + chunked_fetch: bool = ..., + chunk_size: int = ..., + ) -> Iterator[Any]: ... + def has_results(self) -> bool: ... + def execute_sql( + self, result_type: str = ..., chunked_fetch: bool = ..., chunk_size: int = ... + ) -> Optional[Any]: ... + def as_subquery_condition(self, alias: str, columns: List[str], compiler: SQLCompiler) -> Tuple[str, Tuple]: ... + def explain_query(self) -> Iterator[str]: ... + +def cursor_iter(cursor: Any, sentinel: Any, col_count: Optional[int], itersize: int) -> Iterator[Any]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/constants.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/constants.pyi new file mode 100644 index 00000000..70be2be6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/constants.pyi @@ -0,0 +1,14 @@ +from typing import Dict, Pattern, Tuple + +GET_ITERATOR_CHUNK_SIZE: int = ... + +MULTI: str = ... +SINGLE: str = ... +CURSOR: str = ... +NO_RESULTS: str = ... + +ORDER_PATTERN: Pattern = ... +ORDER_DIR: Dict[str, Tuple[str, str]] = ... + +INNER: str = ... +LOUTER: str = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/datastructures.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/datastructures.pyi new file mode 100644 index 00000000..8ef7656e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/datastructures.pyi @@ -0,0 +1,49 @@ +from collections import OrderedDict +from typing import Any, Dict, List, Optional, Tuple, Union + +from django.db.models.fields.mixins import FieldCacheMixin +from django.db.models.query_utils import FilteredRelation, PathInfo +from django.db.models.sql.compiler import SQLCompiler + +class MultiJoin(Exception): + level: int = ... + names_with_path: List[Tuple[str, List[PathInfo]]] = ... + def __init__(self, names_pos: int, path_with_names: List[Tuple[str, List[PathInfo]]]) -> None: ... + +class Empty: ... + +class Join: + table_name: str = ... + parent_alias: str = ... + table_alias: Optional[str] = ... + join_type: str = ... + join_cols: Tuple = ... + join_field: FieldCacheMixin = ... + nullable: bool = ... + filtered_relation: Optional[FilteredRelation] = ... + def __init__( + self, + table_name: str, + parent_alias: str, + table_alias: Optional[str], + join_type: str, + join_field: FieldCacheMixin, + nullable: bool, + filtered_relation: Optional[FilteredRelation] = ..., + ) -> None: ... + def as_sql(self, compiler: SQLCompiler, connection: Any) -> Tuple[str, List[Union[int, str]]]: ... + def relabeled_clone(self, change_map: Union[Dict[str, str], OrderedDict]) -> Join: ... + def equals(self, other: Union[BaseTable, Join], with_filtered_relation: bool) -> bool: ... + def demote(self) -> Join: ... + def promote(self) -> Join: ... + +class BaseTable: + join_type: Any = ... + parent_alias: Any = ... + filtered_relation: Any = ... + table_name: str = ... + table_alias: Optional[str] = ... + def __init__(self, table_name: str, alias: Optional[str]) -> None: ... + def as_sql(self, compiler: SQLCompiler, connection: Any) -> Tuple[str, List[Any]]: ... + def relabeled_clone(self, change_map: OrderedDict) -> BaseTable: ... + def equals(self, other: Join, with_filtered_relation: bool) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/query.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/query.pyi new file mode 100644 index 00000000..2ed5c651 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/query.pyi @@ -0,0 +1,194 @@ +import collections +from collections import OrderedDict, namedtuple +from typing import Any, Callable, Dict, Iterator, List, Optional, Sequence, Set, Tuple, Type, Union, Iterable + +from django.db.models.lookups import Lookup, Transform +from django.db.models.query_utils import PathInfo, RegisterLookupMixin +from django.db.models.sql.compiler import SQLCompiler +from django.db.models.sql.datastructures import BaseTable +from django.db.models.sql.where import WhereNode + +from django.db.models import Expression, Field, FilteredRelation, Model, Q, QuerySet +from django.db.models.expressions import Combinable + +JoinInfo = namedtuple("JoinInfo", ["final_field", "targets", "opts", "joins", "path", "transform_function"]) + +class RawQuery: + high_mark: Optional[int] + low_mark: Optional[int] + params: Union[Any] = ... + sql: str = ... + using: str = ... + extra_select: Dict[Any, Any] = ... + annotation_select: Dict[Any, Any] = ... + cursor: object = ... + def __init__(self, sql: str, using: str, params: Any = ...) -> None: ... + def chain(self, using: str) -> RawQuery: ... + def clone(self, using: str) -> RawQuery: ... + def get_columns(self) -> List[str]: ... + def __iter__(self): ... + +class Query: + base_table: str + related_ids: Optional[List[int]] + related_updates: Dict[Type[Model], List[Tuple[Field, None, Union[int, str]]]] + values: List[Any] + alias_prefix: str = ... + subq_aliases: frozenset = ... + compiler: str = ... + model: Optional[Type[Model]] = ... + alias_refcount: Dict[str, int] = ... + alias_map: Dict[str, BaseTable] = ... + external_aliases: Set[str] = ... + table_map: Dict[str, List[str]] = ... + default_cols: bool = ... + default_ordering: bool = ... + standard_ordering: bool = ... + used_aliases: Set[str] = ... + filter_is_sticky: bool = ... + subquery: bool = ... + group_by: Optional[Union[Sequence[Combinable], Sequence[str], bool]] = ... + order_by: Tuple = ... + distinct: bool = ... + distinct_fields: Tuple = ... + select_for_update: bool = ... + select_for_update_nowait: bool = ... + select_for_update_skip_locked: bool = ... + select_for_update_of: Tuple = ... + select_related: Union[Dict[str, Any], bool] = ... + max_depth: int = ... + values_select: Tuple = ... + annotation_select_mask: Optional[Set[str]] = ... + combinator: Optional[str] = ... + combinator_all: bool = ... + combined_queries: Tuple = ... + extra_select_mask: Optional[Set[str]] = ... + extra_tables: Tuple = ... + extra_order_by: Union[List[str], Tuple] = ... + deferred_loading: Tuple[Union[Set[str], frozenset], bool] = ... + explain_query: bool = ... + explain_format: Optional[str] = ... + explain_options: Dict[str, int] = ... + high_mark: Optional[int] = ... + low_mark: int = ... + def __init__(self, model: Optional[Type[Model]], where: Type[WhereNode] = ...) -> None: ... + @property + def extra(self) -> OrderedDict: ... + @property + def annotations(self) -> OrderedDict: ... + @property + def has_select_fields(self) -> bool: ... + def sql_with_params(self) -> Tuple[str, Tuple]: ... + def __deepcopy__(self, memo: Dict[str, Any]) -> Query: ... + def get_compiler(self, using: Optional[str] = ..., connection: Any = ...) -> SQLCompiler: ... + def clone(self) -> Query: ... + def chain(self, klass: Optional[Type[Query]] = ...) -> Query: ... + def relabeled_clone(self, change_map: Union[Dict[Any, Any], OrderedDict]) -> Query: ... + def get_count(self, using: str) -> int: ... + def has_filters(self) -> WhereNode: ... + def has_results(self, using: str) -> bool: ... + def explain(self, using: str, format: Optional[str] = ..., **options: Any) -> str: ... + def combine(self, rhs: Query, connector: str) -> None: ... + def deferred_to_data(self, target: Dict[Any, Any], callback: Callable) -> None: ... + def ref_alias(self, alias: str) -> None: ... + def unref_alias(self, alias: str, amount: int = ...) -> None: ... + def promote_joins(self, aliases: Set[str]) -> None: ... + def demote_joins(self, aliases: Set[str]) -> None: ... + def reset_refcounts(self, to_counts: Dict[str, int]) -> None: ... + def change_aliases(self, change_map: Union[Dict[Any, Any], OrderedDict]) -> None: ... + def bump_prefix(self, outer_query: Query) -> None: ... + def get_initial_alias(self) -> str: ... + def count_active_tables(self) -> int: ... + def resolve_expression(self, query: Query, *args: Any, **kwargs: Any) -> Query: ... + def as_sql(self, compiler: SQLCompiler, connection: Any) -> Any: ... + def resolve_lookup_value(self, value: Any, can_reuse: Optional[Set[str]], allow_joins: bool) -> Any: ... + def solve_lookup_type(self, lookup: str) -> Tuple[Sequence[str], Sequence[str], bool]: ... + def build_filter( + self, + filter_expr: Union[Dict[str, str], Tuple[str, Tuple[int, int]]], + branch_negated: bool = ..., + current_negated: bool = ..., + can_reuse: Optional[Set[str]] = ..., + allow_joins: bool = ..., + split_subq: bool = ..., + reuse_with_filtered_relation: bool = ..., + ) -> Tuple[WhereNode, List[Any]]: ... + def add_filter(self, filter_clause: Tuple[str, Union[List[int], List[str]]]) -> None: ... + def add_q(self, q_object: Q) -> None: ... + def build_where(self, q_object: Q) -> Any: ... + def build_filtered_relation_q( + self, q_object: Q, reuse: Set[str], branch_negated: bool = ..., current_negated: bool = ... + ) -> WhereNode: ... + def add_filtered_relation(self, filtered_relation: FilteredRelation, alias: str) -> None: ... + def setup_joins( + self, + names: List[str], + opts: Any, + alias: str, + can_reuse: Optional[Set[str]] = ..., + allow_many: bool = ..., + reuse_with_filtered_relation: bool = ..., + ) -> JoinInfo: ... + def trim_joins( + self, targets: Tuple[Field], joins: List[str], path: List[PathInfo] + ) -> Tuple[Tuple[Field], str, List[str]]: ... + def resolve_ref( + self, name: str, allow_joins: bool = ..., reuse: Optional[Set[str]] = ..., summarize: bool = ... + ) -> Expression: ... + def split_exclude( + self, + filter_expr: Tuple[str, Union[QuerySet, int]], + can_reuse: Set[str], + names_with_path: List[Tuple[str, List[PathInfo]]], + ) -> Tuple[WhereNode, Tuple]: ... + def set_empty(self) -> None: ... + def is_empty(self) -> bool: ... + def set_limits(self, low: Optional[int] = ..., high: Optional[int] = ...) -> None: ... + def clear_limits(self) -> None: ... + def has_limit_one(self) -> bool: ... + def can_filter(self) -> bool: ... + def clear_select_clause(self) -> None: ... + def clear_select_fields(self) -> None: ... + def set_select(self, cols: List[Expression]) -> None: ... + def add_distinct_fields(self, *field_names: Any) -> None: ... + def add_fields(self, field_names: Union[Iterator[Any], List[str]], allow_m2m: bool = ...) -> None: ... + def add_ordering(self, *ordering: Any) -> None: ... + def clear_ordering(self, force_empty: bool) -> None: ... + def set_group_by(self) -> None: ... + def add_select_related(self, fields: Iterable[str]) -> None: ... + def add_extra( + self, + select: Optional[Dict[str, Any]], + select_params: Optional[Iterable[Any]], + where: Optional[Sequence[str]], + params: Optional[Sequence[str]], + tables: Optional[Sequence[str]], + order_by: Optional[Sequence[str]], + ) -> None: ... + def clear_deferred_loading(self) -> None: ... + def add_deferred_loading(self, field_names: Iterable[str]) -> None: ... + def add_immediate_loading(self, field_names: Iterable[str]) -> None: ... + def get_loaded_field_names(self) -> Dict[Type[Model], Set[str]]: ... + def get_loaded_field_names_cb( + self, target: Dict[Type[Model], Set[str]], model: Type[Model], fields: Set[Field] + ) -> None: ... + def set_annotation_mask(self, names: Optional[Union[List[str], Set[str], Tuple]]) -> None: ... + def append_annotation_mask(self, names: List[str]) -> None: ... + def set_extra_mask(self, names: Union[List[str], Tuple]) -> None: ... + def set_values(self, fields: Union[List[str], Tuple]) -> None: ... + def trim_start(self, names_with_path: List[Tuple[str, List[PathInfo]]]) -> Tuple[str, bool]: ... + def is_nullable(self, field: Field) -> bool: ... + def build_lookup( + self, lookups: Sequence[str], lhs: Union[RegisterLookupMixin, Query], rhs: Optional[Query] + ) -> Lookup: ... + def try_transform(self, lhs: Union[RegisterLookupMixin, Query], name: str) -> Transform: ... + +class JoinPromoter: + connector: str = ... + negated: bool = ... + effective_connector: str = ... + num_children: int = ... + votes: collections.Counter = ... + def __init__(self, connector: str, num_children: int, negated: bool) -> None: ... + def add_votes(self, votes: Union[Iterator[Any], List[Any], Set[str], Tuple]) -> None: ... + def update_join_types(self, query: Query) -> Set[str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/subqueries.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/subqueries.pyi new file mode 100644 index 00000000..ba3d7e82 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/subqueries.pyi @@ -0,0 +1,45 @@ +from typing import Any, Dict, Iterable, List, Optional, Tuple, Type, Union + +from django.db.models.base import Model +from django.db.models.expressions import Case +from django.db.models.query import QuerySet +from django.db.models.sql.query import Query +from django.db.models.sql.where import WhereNode + +from django.db.models.fields import Field + +class DeleteQuery(Query): + select: Tuple + where_class: Type[WhereNode] + where: WhereNode = ... + def do_query(self, table: str, where: WhereNode, using: str) -> int: ... + def delete_batch(self, pk_list: Union[List[int], List[str]], using: str) -> int: ... + def delete_qs(self, query: QuerySet, using: str) -> int: ... + +class UpdateQuery(Query): + select: Tuple + where_class: Type[WhereNode] + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + where: WhereNode = ... + def update_batch(self, pk_list: List[int], values: Dict[str, Optional[int]], using: str) -> None: ... + def add_update_values(self, values: Dict[str, Any]) -> None: ... + def add_update_fields(self, values_seq: List[Tuple[Field, Optional[Type[Model]], Case]]) -> None: ... + def add_related_update(self, model: Type[Model], field: Field, value: Union[int, str]) -> None: ... + def get_related_updates(self) -> List[UpdateQuery]: ... + +class InsertQuery(Query): + select: Tuple + where: WhereNode + where_class: Type[WhereNode] + fields: Iterable[Field] = ... + objs: List[Model] = ... + raw: bool = ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def insert_values(self, fields: Iterable[Field], objs: List[Model], raw: bool = ...) -> None: ... + +class AggregateQuery(Query): + select: Tuple + sub_params: Tuple + where: WhereNode + where_class: Type[WhereNode] + def add_subquery(self, query: Query, using: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/where.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/where.pyi new file mode 100644 index 00000000..dfab304d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/sql/where.pyi @@ -0,0 +1,46 @@ +from collections import OrderedDict +from typing import Any, Dict, List, Optional, Tuple, Union + +from django.db.models.expressions import Expression +from django.db.models.sql.compiler import SQLCompiler +from django.db.models.sql.query import Query +from django.utils import tree + +AND: str +OR: str + +class WhereNode(tree.Node): + connector: str + contains_aggregate: bool + contains_over_clause: bool + negated: bool + default: Any = ... + resolved: bool = ... + conditional: bool = ... + def split_having(self, negated: bool = ...) -> Tuple[Optional[WhereNode], Optional[WhereNode]]: ... + def as_sql(self, compiler: SQLCompiler, connection: Any) -> Any: ... + def get_group_by_cols(self) -> List[Expression]: ... + def relabel_aliases(self, change_map: Union[Dict[Optional[str], str], OrderedDict]) -> None: ... + def clone(self) -> WhereNode: ... + def relabeled_clone(self, change_map: Union[Dict[Optional[str], str], OrderedDict]) -> WhereNode: ... + def resolve_expression(self, *args: Any, **kwargs: Any) -> WhereNode: ... + +class NothingNode: + contains_aggregate: bool = ... + def as_sql(self, compiler: SQLCompiler = ..., connection: Any = ...) -> Any: ... + +class ExtraWhere: + contains_aggregate: bool = ... + sqls: List[str] = ... + params: Optional[Union[List[int], List[str]]] = ... + def __init__(self, sqls: List[str], params: Optional[Union[List[int], List[str]]]) -> None: ... + def as_sql(self, compiler: SQLCompiler = ..., connection: Any = ...) -> Tuple[str, Union[List[int], List[str]]]: ... + +class SubqueryConstraint: + contains_aggregate: bool = ... + alias: str = ... + columns: List[str] = ... + targets: List[str] = ... + query_object: Query = ... + def __init__(self, alias: str, columns: List[str], targets: List[str], query_object: Query) -> None: ... + def as_sql(self, compiler: SQLCompiler, connection: Any) -> Tuple[str, Tuple]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/utils.pyi new file mode 100644 index 00000000..a1af6988 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/models/utils.pyi @@ -0,0 +1,5 @@ +from typing import Tuple, Type, Union + +from django.db.models.base import Model + +def make_model_tuple(model: Union[Type[Model], str]) -> Tuple[str, str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/transaction.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/transaction.pyi new file mode 100644 index 00000000..959479b5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/transaction.pyi @@ -0,0 +1,49 @@ +from contextlib import contextmanager +from typing import Any, Callable, Optional, overload, TypeVar, Iterator + +from django.db import ProgrammingError + +class TransactionManagementError(ProgrammingError): ... + +def get_connection(using: Optional[str] = ...) -> Any: ... +def get_autocommit(using: Optional[str] = ...) -> bool: ... +def set_autocommit(autocommit: bool, using: Optional[str] = ...) -> Any: ... +def commit(using: Optional[str] = ...) -> Any: ... +def rollback(using: Optional[str] = ...) -> Any: ... +def savepoint(using: Optional[str] = ...) -> str: ... +def savepoint_rollback(sid: str, using: Optional[str] = ...) -> None: ... +def savepoint_commit(sid: Any, using: Optional[Any] = ...) -> None: ... +def clean_savepoints(using: Optional[Any] = ...) -> None: ... +def get_rollback(using: Optional[str] = ...) -> bool: ... +def set_rollback(rollback: bool, using: Optional[str] = ...) -> None: ... +@contextmanager +def mark_for_rollback_on_error(using: Optional[str] = ...) -> Iterator[None]: ... +def on_commit(func: Callable, using: Optional[str] = ...) -> None: ... + +_C = TypeVar("_C", bound=Callable) # Any callable + +# Don't inherit from ContextDecorator, so we can provide a more specific signature for __call__ +class Atomic: + using: Optional[str] = ... + savepoint: bool = ... + def __init__(self, using: Optional[str], savepoint: bool) -> None: ... + # When decorating, return the decorated function as-is, rather than clobbering it as ContextDecorator does. + def __call__(self, func: _C) -> _C: ... + def __enter__(self) -> None: ... + def __exit__(self, exc_type: None, exc_value: None, traceback: None) -> None: ... + +# Bare decorator +@overload +def atomic(using: _C) -> _C: ... + +# Decorator or context-manager with parameters +@overload +def atomic(using: Optional[str] = ..., savepoint: bool = ...) -> Atomic: ... + +# Bare decorator +@overload +def non_atomic_requests(using: _C) -> _C: ... + +# Decorator with arguments +@overload +def non_atomic_requests(using: Optional[str] = ...) -> Callable[[_C], _C]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/utils.pyi new file mode 100644 index 00000000..998bbf8e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/db/utils.pyi @@ -0,0 +1,35 @@ +from typing import Any, Dict, Iterable, List, Optional + +DEFAULT_DB_ALIAS: str +DJANGO_VERSION_PICKLE_KEY: str + +class Error(Exception): ... +class InterfaceError(Error): ... +class DatabaseError(Error): ... +class DataError(DatabaseError): ... +class OperationalError(DatabaseError): ... +class IntegrityError(DatabaseError): ... +class InternalError(DatabaseError): ... +class ProgrammingError(DatabaseError): ... +class NotSupportedError(DatabaseError): ... + +def load_backend(backend_name: str) -> Any: ... + +class ConnectionDoesNotExist(Exception): ... + +class ConnectionHandler: + databases: Dict[str, Dict[str, Optional[Any]]] + def __init__(self, databases: Dict[str, Dict[str, Optional[Any]]] = ...) -> None: ... + def ensure_defaults(self, alias: str) -> None: ... + def prepare_test_settings(self, alias: str) -> None: ... + def __getitem__(self, alias: str) -> Any: ... + def __setitem__(self, key: Any, value: Any) -> None: ... + def __delitem__(self, key: Any) -> None: ... + def __iter__(self): ... + def all(self) -> List[Any]: ... + def close_all(self) -> None: ... + +class ConnectionRouter: + def __init__(self, routers: Optional[Iterable[Any]] = ...) -> None: ... + @property + def routers(self) -> List[Any]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/dispatch/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/dispatch/__init__.pyi new file mode 100644 index 00000000..97080cd7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/dispatch/__init__.pyi @@ -0,0 +1 @@ +from django.dispatch.dispatcher import Signal as Signal, receiver as receiver diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/dispatch/dispatcher.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/dispatch/dispatcher.pyi new file mode 100644 index 00000000..8ae53ce5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/dispatch/dispatcher.pyi @@ -0,0 +1,23 @@ +from typing import Any, Callable, List, Optional, Tuple, Union + +NONE_ID: Any +NO_RECEIVERS: Any + +class Signal: + receivers: Any = ... + providing_args: Any = ... + lock: Any = ... + use_caching: Any = ... + sender_receivers_cache: Any = ... + def __init__(self, providing_args: List[str] = ..., use_caching: bool = ...) -> None: ... + def connect( + self, receiver: Callable, sender: Optional[object] = ..., weak: bool = ..., dispatch_uid: Optional[str] = ... + ) -> None: ... + def disconnect( + self, receiver: Optional[Callable] = ..., sender: Optional[object] = ..., dispatch_uid: Optional[str] = ... + ) -> bool: ... + def has_listeners(self, sender: Any = ...) -> bool: ... + def send(self, sender: Any, **named: Any) -> List[Tuple[Callable, Optional[str]]]: ... + def send_robust(self, sender: Any, **named: Any) -> List[Tuple[Callable, Union[ValueError, str]]]: ... + +def receiver(signal: Union[List[Signal], Signal], **kwargs: Any) -> Callable: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/__init__.pyi new file mode 100644 index 00000000..c0e992bc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/__init__.pyi @@ -0,0 +1,86 @@ +from django.core.exceptions import ValidationError as ValidationError + +from .forms import Form as Form, BaseForm as BaseForm + +from .formsets import BaseFormSet as BaseFormSet, all_valid as all_valid, formset_factory as formset_factory + +from .models import ( + ModelForm as ModelForm, + ModelChoiceField as ModelChoiceField, + ModelMultipleChoiceField as ModelMultipleChoiceField, + model_to_dict as model_to_dict, + BaseModelForm as BaseModelForm, + BaseInlineFormSet as BaseInlineFormSet, + BaseModelFormSet as BaseModelFormSet, + fields_for_model as fields_for_model, + inlineformset_factory as inlineformset_factory, + modelform_factory as modelform_factory, + InlineForeignKeyField as InlineForeignKeyField, + ModelChoiceIterator as ModelChoiceIterator, + ModelFormMetaclass as ModelFormMetaclass, + ModelFormOptions as ModelFormOptions, + modelformset_factory as modelformset_factory, +) + +from .widgets import ( + Widget as Widget, + ChoiceWidget as ChoiceWidget, + NumberInput as NumberInput, + Select as Select, + CheckboxInput as CheckboxInput, + CheckboxSelectMultiple as CheckboxSelectMultiple, + Media as Media, + MultiWidget as MultiWidget, + TextInput as TextInput, + Textarea as Textarea, + Input as Input, + ClearableFileInput as ClearableFileInput, + DateInput as DateInput, + DateTimeBaseInput as DateTimeBaseInput, + DateTimeInput as DateTimeInput, + EmailInput as EmailInput, + FileInput as FileInput, + HiddenInput as HiddenInput, + MultipleHiddenInput as MultipleHiddenInput, + NullBooleanSelect as NullBooleanSelect, + PasswordInput as PasswordInput, + RadioSelect as RadioSelect, + SelectMultiple as SelectMultiple, + TimeInput as TimeInput, + URLInput as URLInput, + SelectDateWidget as SelectDateWidget, + SplitHiddenDateTimeWidget as SplitHiddenDateTimeWidget, + SplitDateTimeWidget as SplitDateTimeWidget, +) + +from .fields import ( + Field as Field, + CharField as CharField, + ChoiceField as ChoiceField, + DurationField as DurationField, + FileField as FileField, + ImageField as ImageField, + DateTimeField as DateTimeField, + DateField as DateField, + BooleanField as BooleanField, + EmailField as EmailField, + FloatField as FloatField, + MultiValueField as MultiValueField, + MultipleChoiceField as MultipleChoiceField, + NullBooleanField as NullBooleanField, + SplitDateTimeField as SplitDateTimeField, + TimeField as TimeField, + IntegerField as IntegerField, + FilePathField as FilePathField, + DecimalField as DecimalField, + UUIDField as UUIDField, + URLField as URLField, + ComboField as ComboField, + GenericIPAddressField as GenericIPAddressField, + RegexField as RegexField, + SlugField as SlugField, + TypedChoiceField as TypedChoiceField, + TypedMultipleChoiceField as TypedMultipleChoiceField, +) + +from .boundfield import BoundField as BoundField, BoundWidget as BoundWidget diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/boundfield.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/boundfield.pyi new file mode 100644 index 00000000..ae293b50 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/boundfield.pyi @@ -0,0 +1,60 @@ +from typing import Any, Dict, List, Optional, Union + +from django.forms.fields import Field +from django.forms.forms import BaseForm +from django.forms.renderers import DjangoTemplates +from django.forms.utils import ErrorList +from django.forms.widgets import Widget +from django.utils.safestring import SafeText + +class BoundField: + initial: Any + form: BaseForm = ... + field: Field = ... + name: str = ... + html_name: str = ... + html_initial_name: str = ... + html_initial_id: str = ... + label: str = ... + help_text: str = ... + def __init__(self, form: BaseForm, field: Field, name: str) -> None: ... + def subwidgets(self) -> List[BoundWidget]: ... + def __bool__(self) -> bool: ... + def __iter__(self): ... + def __len__(self) -> int: ... + def __getitem__(self, idx: Union[int, slice, str]) -> Union[List[BoundWidget], BoundWidget]: ... + @property + def errors(self) -> ErrorList: ... + def as_widget(self, widget: Optional[Widget] = ..., attrs: None = ..., only_initial: bool = ...) -> SafeText: ... + def as_text(self, attrs: None = ..., **kwargs: Any) -> SafeText: ... + def as_textarea(self, attrs: None = ..., **kwargs: Any) -> SafeText: ... + def as_hidden(self, attrs: None = ..., **kwargs: Any) -> SafeText: ... + @property + def data(self) -> Any: ... + def value(self) -> Any: ... + def label_tag( + self, contents: Optional[str] = ..., attrs: Optional[Dict[str, str]] = ..., label_suffix: Optional[str] = ... + ) -> SafeText: ... + def css_classes(self, extra_classes: None = ...) -> str: ... + @property + def is_hidden(self) -> bool: ... + @property + def auto_id(self) -> str: ... + @property + def id_for_label(self) -> str: ... + def build_widget_attrs( + self, attrs: Dict[str, str], widget: Optional[Widget] = ... + ) -> Dict[str, Union[bool, str]]: ... + +class BoundWidget: + parent_widget: Widget = ... + data: Dict[str, Any] = ... + renderer: DjangoTemplates = ... + def __init__(self, parent_widget: Widget, data: Dict[str, Any], renderer: DjangoTemplates) -> None: ... + def tag(self, wrap_label: bool = ...) -> SafeText: ... + @property + def template_name(self) -> str: ... + @property + def id_for_label(self) -> str: ... + @property + def choice_label(self) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/fields.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/fields.pyi new file mode 100644 index 00000000..5a563201 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/fields.pyi @@ -0,0 +1,394 @@ +from datetime import datetime, timedelta +from typing import Any, Callable, Iterable, List, Optional, Pattern, Sequence, Tuple, Type, Union + +from django.core.validators import BaseValidator +from django.forms.boundfield import BoundField +from django.forms.forms import BaseForm +from django.forms.widgets import Widget + +_Choice = Tuple[Any, str] +_ChoiceNamedGroup = Tuple[str, Iterable[_Choice]] +_FieldChoices = Iterable[Union[_Choice, _ChoiceNamedGroup]] + +class Field: + initial: Any + label: Optional[str] + required: bool + widget: Type[Widget] = ... + hidden_widget: Any = ... + default_validators: Any = ... + default_error_messages: Any = ... + empty_values: Any = ... + show_hidden_initial: bool = ... + help_text: str = ... + disabled: bool = ... + label_suffix: Optional[Any] = ... + localize: bool = ... + error_messages: Any = ... + validators: List[BaseValidator] = ... + max_length: Optional[Union[int, str]] = ... + choices: _FieldChoices = ... + base_field: Field + def __init__( + self, + *, + required: bool = ..., + widget: Optional[Union[Widget, Type[Widget]]] = ..., + label: Optional[Any] = ..., + initial: Optional[Any] = ..., + help_text: str = ..., + error_messages: Optional[Any] = ..., + show_hidden_initial: bool = ..., + validators: Sequence[Any] = ..., + localize: bool = ..., + disabled: bool = ..., + label_suffix: Optional[Any] = ..., + ) -> None: ... + def prepare_value(self, value: Any) -> Any: ... + def to_python(self, value: Optional[Any]) -> Optional[Any]: ... + def validate(self, value: Any) -> None: ... + def run_validators(self, value: Any) -> None: ... + def clean(self, value: Any) -> Any: ... + def bound_data(self, data: Any, initial: Any) -> Any: ... + def widget_attrs(self, widget: Widget) -> Any: ... + def has_changed(self, initial: Any, data: Any) -> bool: ... + def get_bound_field(self, form: BaseForm, field_name: str) -> BoundField: ... + def deconstruct(self) -> Any: ... + +class CharField(Field): + min_length: Optional[Union[int, str]] = ... + strip: bool = ... + empty_value: Optional[str] = ... + def __init__( + self, + max_length: Optional[Any] = ..., + min_length: Optional[Any] = ..., + strip: bool = ..., + empty_value: Optional[str] = ..., + required: bool = ..., + widget: Optional[Union[Widget, Type[Widget]]] = ..., + label: Optional[Any] = ..., + initial: Optional[Any] = ..., + help_text: str = ..., + error_messages: Optional[Any] = ..., + show_hidden_initial: bool = ..., + validators: Sequence[Any] = ..., + localize: bool = ..., + disabled: bool = ..., + label_suffix: Optional[Any] = ..., + ) -> None: ... + +class IntegerField(Field): + max_value: Optional[Any] + min_value: Optional[Any] + re_decimal: Any = ... + def __init__( + self, + max_value: Optional[Any] = ..., + min_value: Optional[Any] = ..., + required: bool = ..., + widget: Optional[Union[Widget, Type[Widget]]] = ..., + label: Optional[Any] = ..., + initial: Optional[Any] = ..., + help_text: str = ..., + error_messages: Optional[Any] = ..., + show_hidden_initial: bool = ..., + validators: Sequence[Any] = ..., + localize: bool = ..., + disabled: bool = ..., + label_suffix: Optional[Any] = ..., + ) -> None: ... + +class FloatField(IntegerField): ... + +class DecimalField(IntegerField): + decimal_places: Optional[int] + max_digits: Optional[int] + def __init__( + self, + *, + max_value: Optional[Any] = ..., + min_value: Optional[Any] = ..., + max_digits: Optional[Any] = ..., + decimal_places: Optional[Any] = ..., + required: bool = ..., + widget: Optional[Union[Widget, Type[Widget]]] = ..., + label: Optional[Any] = ..., + initial: Optional[Any] = ..., + help_text: str = ..., + error_messages: Optional[Any] = ..., + show_hidden_initial: bool = ..., + validators: Sequence[Any] = ..., + localize: bool = ..., + disabled: bool = ..., + label_suffix: Optional[Any] = ..., + ) -> None: ... + +class BaseTemporalField(Field): + input_formats: Any = ... + def __init__( + self, + input_formats: Optional[Any] = ..., + required: bool = ..., + widget: Optional[Union[Widget, Type[Widget]]] = ..., + label: Optional[Any] = ..., + initial: Optional[Any] = ..., + help_text: str = ..., + error_messages: Optional[Any] = ..., + show_hidden_initial: bool = ..., + validators: Sequence[Any] = ..., + localize: bool = ..., + disabled: bool = ..., + label_suffix: Optional[Any] = ..., + ) -> None: ... + def strptime(self, value: Any, format: str) -> Any: ... + +class DateField(BaseTemporalField): ... +class TimeField(BaseTemporalField): ... +class DateTimeField(BaseTemporalField): ... + +class DurationField(Field): + def prepare_value(self, value: Optional[Union[timedelta, str]]) -> Optional[str]: ... + +class RegexField(CharField): + regex: str = ... + def __init__( + self, + regex: Union[str, Pattern], + max_length: Optional[Any] = ..., + min_length: Optional[Any] = ..., + strip: bool = ..., + empty_value: Optional[str] = ..., + required: bool = ..., + widget: Optional[Union[Widget, Type[Widget]]] = ..., + label: Optional[Any] = ..., + initial: Optional[Any] = ..., + help_text: str = ..., + error_messages: Optional[Any] = ..., + show_hidden_initial: bool = ..., + validators: Sequence[Any] = ..., + localize: bool = ..., + disabled: bool = ..., + label_suffix: Optional[Any] = ..., + ) -> None: ... + +class EmailField(CharField): ... + +class FileField(Field): + allow_empty_file: bool = ... + def __init__( + self, + max_length: Optional[Any] = ..., + allow_empty_file: bool = ..., + required: bool = ..., + widget: Optional[Union[Widget, Type[Widget]]] = ..., + label: Optional[Any] = ..., + initial: Optional[Any] = ..., + help_text: str = ..., + error_messages: Optional[Any] = ..., + show_hidden_initial: bool = ..., + validators: Sequence[Any] = ..., + localize: bool = ..., + disabled: bool = ..., + label_suffix: Optional[Any] = ..., + ) -> None: ... + def clean(self, data: Any, initial: Optional[Any] = ...): ... + +class ImageField(FileField): ... +class URLField(CharField): ... +class BooleanField(Field): ... +class NullBooleanField(BooleanField): ... + +class CallableChoiceIterator: + choices_func: Callable = ... + def __init__(self, choices_func: Callable) -> None: ... + def __iter__(self) -> None: ... + +class ChoiceField(Field): + def __init__( + self, + choices: Union[_FieldChoices, Callable[[], _FieldChoices]] = ..., + required: bool = ..., + widget: Optional[Union[Widget, Type[Widget]]] = ..., + label: Optional[Any] = ..., + initial: Optional[Any] = ..., + help_text: str = ..., + error_messages: Optional[Any] = ..., + show_hidden_initial: bool = ..., + validators: Sequence[Any] = ..., + localize: bool = ..., + disabled: bool = ..., + label_suffix: Optional[Any] = ..., + ) -> None: ... + def valid_value(self, value: str) -> bool: ... + +class TypedChoiceField(ChoiceField): + coerce: Union[Callable, Type[Any]] = ... + empty_value: Optional[str] = ... + def __init__( + self, + coerce: Any = ..., + empty_value: Optional[str] = ..., + choices: Any = ..., + required: bool = ..., + widget: Optional[Union[Widget, Type[Widget]]] = ..., + label: Optional[Any] = ..., + initial: Optional[Any] = ..., + help_text: str = ..., + error_messages: Optional[Any] = ..., + show_hidden_initial: bool = ..., + validators: Sequence[Any] = ..., + localize: bool = ..., + disabled: bool = ..., + label_suffix: Optional[Any] = ..., + ) -> None: ... + +class MultipleChoiceField(ChoiceField): ... + +class TypedMultipleChoiceField(MultipleChoiceField): + coerce: Union[Callable, Type[float]] = ... + empty_value: Optional[List[Any]] = ... + def __init__( + self, + coerce: Any = ..., + empty_value: Optional[str] = ..., + choices: Any = ..., + required: bool = ..., + widget: Optional[Union[Widget, Type[Widget]]] = ..., + label: Optional[Any] = ..., + initial: Optional[Any] = ..., + help_text: str = ..., + error_messages: Optional[Any] = ..., + show_hidden_initial: bool = ..., + validators: Sequence[Any] = ..., + localize: bool = ..., + disabled: bool = ..., + label_suffix: Optional[Any] = ..., + ) -> None: ... + +class ComboField(Field): + fields: Any = ... + def __init__( + self, + fields: Sequence[Field], + required: bool = ..., + widget: Optional[Union[Widget, Type[Widget]]] = ..., + label: Optional[Any] = ..., + initial: Optional[Any] = ..., + help_text: str = ..., + error_messages: Optional[Any] = ..., + show_hidden_initial: bool = ..., + validators: Sequence[Any] = ..., + localize: bool = ..., + disabled: bool = ..., + label_suffix: Optional[Any] = ..., + ) -> None: ... + +class MultiValueField(Field): + require_all_fields: bool = ... + fields: Any = ... + def __init__( + self, + fields: Sequence[Field], + require_all_fields: bool = ..., + required: bool = ..., + widget: Optional[Union[Widget, Type[Widget]]] = ..., + label: Optional[Any] = ..., + initial: Optional[Any] = ..., + help_text: str = ..., + error_messages: Optional[Any] = ..., + show_hidden_initial: bool = ..., + validators: Sequence[Any] = ..., + localize: bool = ..., + disabled: bool = ..., + label_suffix: Optional[Any] = ..., + ) -> None: ... + def compress(self, data_list: Any) -> Any: ... + +class FilePathField(ChoiceField): + allow_files: bool + allow_folders: bool + match: Optional[str] + path: str + recursive: bool + match_re: Any = ... + def __init__( + self, + path: str, + match: Optional[Any] = ..., + recursive: bool = ..., + allow_files: bool = ..., + allow_folders: bool = ..., + choices: Any = ..., + required: bool = ..., + widget: Optional[Union[Widget, Type[Widget]]] = ..., + label: Optional[Any] = ..., + initial: Optional[Any] = ..., + help_text: str = ..., + error_messages: Optional[Any] = ..., + show_hidden_initial: bool = ..., + validators: Sequence[Any] = ..., + localize: bool = ..., + disabled: bool = ..., + label_suffix: Optional[Any] = ..., + ) -> None: ... + +class SplitDateTimeField(MultiValueField): + def __init__( + self, + input_date_formats: Optional[Any] = ..., + input_time_formats: Optional[Any] = ..., + fields: Sequence[Field] = ..., + require_all_fields: bool = ..., + required: bool = ..., + widget: Optional[Union[Widget, Type[Widget]]] = ..., + label: Optional[Any] = ..., + initial: Optional[Any] = ..., + help_text: str = ..., + error_messages: Optional[Any] = ..., + show_hidden_initial: bool = ..., + validators: Sequence[Any] = ..., + localize: bool = ..., + disabled: bool = ..., + label_suffix: Optional[Any] = ..., + ) -> None: ... + def compress(self, data_list: List[Optional[datetime]]) -> Optional[datetime]: ... + +class GenericIPAddressField(CharField): + unpack_ipv4: bool = ... + def __init__( + self, + protocol: str = ..., + unpack_ipv4: bool = ..., + required: bool = ..., + widget: Optional[Union[Widget, Type[Widget]]] = ..., + label: Optional[Any] = ..., + initial: Optional[Any] = ..., + help_text: str = ..., + error_messages: Optional[Any] = ..., + show_hidden_initial: bool = ..., + validators: Sequence[Any] = ..., + localize: bool = ..., + disabled: bool = ..., + label_suffix: Optional[Any] = ..., + ) -> None: ... + +class SlugField(CharField): + allow_unicode: bool = ... + def __init__( + self, + allow_unicode: bool = ..., + required: bool = ..., + widget: Optional[Union[Widget, Type[Widget]]] = ..., + label: Optional[Any] = ..., + initial: Optional[Any] = ..., + help_text: str = ..., + error_messages: Optional[Any] = ..., + show_hidden_initial: bool = ..., + validators: Sequence[Any] = ..., + localize: bool = ..., + disabled: bool = ..., + label_suffix: Optional[Any] = ..., + ) -> None: ... + +class UUIDField(CharField): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/forms.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/forms.pyi new file mode 100644 index 00000000..bb7be6ba --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/forms.pyi @@ -0,0 +1,78 @@ +from typing import Any, Dict, Iterator, List, Mapping, Optional, Sequence, Type, Union + +from django.core.exceptions import ValidationError as ValidationError +from django.core.files import uploadedfile +from django.forms.boundfield import BoundField +from django.forms.fields import Field +from django.forms.renderers import BaseRenderer +from django.forms.utils import ErrorDict, ErrorList +from django.forms.widgets import Media, MediaDefiningClass +from django.utils.datastructures import MultiValueDict +from django.utils.safestring import SafeText + +class DeclarativeFieldsMetaclass(MediaDefiningClass): ... + +class BaseForm: + class Meta: + fields: Sequence[str] = ... + default_renderer: Any = ... + field_order: Any = ... + use_required_attribute: bool = ... + is_bound: bool = ... + data: Dict[str, Any] = ... + files: MultiValueDict[str, uploadedfile.UploadedFile] = ... + auto_id: Union[bool, str] = ... + initial: Dict[str, Any] = ... + error_class: Type[ErrorList] = ... + prefix: Optional[str] = ... + label_suffix: str = ... + empty_permitted: bool = ... + fields: Dict[str, Any] = ... + renderer: BaseRenderer = ... + cleaned_data: Any = ... + def __init__( + self, + data: Optional[Mapping[str, Any]] = ..., + files: Optional[Mapping[str, Any]] = ..., + auto_id: Optional[Union[bool, str]] = ..., + prefix: Optional[str] = ..., + initial: Optional[Mapping[str, Any]] = ..., + error_class: Type[ErrorList] = ..., + label_suffix: Optional[str] = ..., + empty_permitted: bool = ..., + field_order: Optional[Any] = ..., + use_required_attribute: Optional[bool] = ..., + renderer: Any = ..., + ) -> None: ... + def order_fields(self, field_order: Optional[List[str]]) -> None: ... + def __iter__(self) -> Iterator[BoundField]: ... + def __getitem__(self, name: str) -> BoundField: ... + @property + def errors(self) -> ErrorDict: ... + def is_valid(self) -> bool: ... + def add_prefix(self, field_name: str) -> str: ... + def add_initial_prefix(self, field_name: str) -> str: ... + def as_table(self) -> SafeText: ... + def as_ul(self) -> SafeText: ... + def as_p(self) -> SafeText: ... + def non_field_errors(self) -> ErrorList: ... + def add_error(self, field: Optional[str], error: Union[ValidationError, str]) -> None: ... + def has_error(self, field: Any, code: Optional[Any] = ...): ... + def full_clean(self) -> None: ... + def clean(self) -> Dict[str, Any]: ... + def has_changed(self) -> bool: ... + @property + def changed_data(self) -> List[str]: ... + @property + def media(self) -> Media: ... + def is_multipart(self): ... + def hidden_fields(self): ... + def visible_fields(self): ... + def get_initial_for_field(self, field: Field, field_name: str) -> Any: ... + def _html_output( + self, normal_row: str, error_row: str, row_ender: str, help_text_html: str, errors_on_separate_row: bool, + ) -> SafeText: ... + +class Form(BaseForm): + base_fields: Dict[str, Field] + declared_fields: Dict[str, Field] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/formsets.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/formsets.pyi new file mode 100644 index 00000000..dab81a99 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/formsets.pyi @@ -0,0 +1,89 @@ +from typing import Any, Dict, Mapping, Optional, Sequence, Sized + +from django.forms import Form + +TOTAL_FORM_COUNT: str = ... +INITIAL_FORM_COUNT: str = ... +MIN_NUM_FORM_COUNT: str = ... +MAX_NUM_FORM_COUNT: str = ... +ORDERING_FIELD_NAME: str = ... +DELETION_FIELD_NAME: str = ... + +DEFAULT_MIN_NUM: int = ... +DEFAULT_MAX_NUM: int = ... + +class ManagementForm(Form): + cleaned_data: Dict[str, Optional[int]] + +class BaseFormSet(Sized, Mapping[str, Any]): + is_bound: Any = ... + prefix: Any = ... + auto_id: Any = ... + data: Any = ... + files: Any = ... + initial: Any = ... + form_kwargs: Any = ... + error_class: Any = ... + def __init__( + self, + data: Optional[Any] = ..., + files: Optional[Any] = ..., + auto_id: str = ..., + prefix: Optional[Any] = ..., + initial: Optional[Any] = ..., + error_class: Any = ..., + form_kwargs: Optional[Any] = ..., + ) -> None: ... + def __iter__(self): ... + def __getitem__(self, index: Any): ... + def __len__(self): ... + def __bool__(self): ... + def management_form(self): ... + def total_form_count(self): ... + def initial_form_count(self): ... + @property + def forms(self): ... + def get_form_kwargs(self, index: Any): ... + @property + def initial_forms(self): ... + @property + def extra_forms(self): ... + @property + def empty_form(self): ... + @property + def cleaned_data(self): ... + @property + def deleted_forms(self): ... + @property + def ordered_forms(self): ... + @classmethod + def get_default_prefix(cls): ... + def non_form_errors(self): ... + @property + def errors(self): ... + def total_error_count(self): ... + def is_valid(self): ... + def full_clean(self): ... + def clean(self) -> None: ... + def has_changed(self): ... + def add_fields(self, form: Any, index: Any) -> None: ... + def add_prefix(self, index: Any): ... + def is_multipart(self): ... + @property + def media(self): ... + def as_table(self): ... + def as_p(self): ... + def as_ul(self): ... + +def formset_factory( + form: Any, + formset: Any = ..., + extra: int = ..., + can_order: bool = ..., + can_delete: bool = ..., + max_num: Optional[Any] = ..., + validate_max: bool = ..., + min_num: Optional[Any] = ..., + validate_min: bool = ..., +): ... +def all_valid(formsets: Sequence[Any]) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/models.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/models.pyi new file mode 100644 index 00000000..549db200 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/models.pyi @@ -0,0 +1,289 @@ +from datetime import datetime +from typing import ( + Any, + Callable, + Dict, + Iterator, + List, + Mapping, + MutableMapping, + Optional, + Sequence, + Tuple, + Type, + Union, + ClassVar, + Container, + TypeVar, +) +from unittest.mock import MagicMock +from uuid import UUID + +from django.core.files.base import File +from django.db.models.base import Model +from django.db.models.manager import Manager +from django.db.models.query import QuerySet, _BaseQuerySet +from django.db.models.query_utils import Q +from django.forms.fields import CharField, ChoiceField, Field +from django.forms.forms import BaseForm, DeclarativeFieldsMetaclass +from django.forms.formsets import BaseFormSet +from django.forms.utils import ErrorList +from django.forms.widgets import Input, Widget +from typing_extensions import Literal + +from django.db import models +from django.db.models import ForeignKey + +ALL_FIELDS: str + +_Fields = Union[List[Union[Callable, str]], Sequence[str], Literal["__all__"]] +_Labels = Dict[str, str] +_ErrorMessages = Dict[str, Dict[str, str]] + +_M = TypeVar("_M", bound=Model) + +def construct_instance( + form: BaseForm, instance: _M, fields: Optional[Container[str]] = ..., exclude: Optional[Container[str]] = ... +) -> _M: ... +def model_to_dict( + instance: Model, fields: Optional[_Fields] = ..., exclude: Optional[_Fields] = ... +) -> Dict[str, Any]: ... +def fields_for_model( + model: Type[Model], + fields: Optional[_Fields] = ..., + exclude: Optional[_Fields] = ..., + widgets: Optional[Union[Dict[str, Type[Input]], Dict[str, Widget]]] = ..., + formfield_callback: Optional[Union[Callable, str]] = ..., + localized_fields: Optional[Union[Tuple[str], str]] = ..., + labels: Optional[_Labels] = ..., + help_texts: Optional[Dict[str, str]] = ..., + error_messages: Optional[_ErrorMessages] = ..., + field_classes: Optional[Dict[str, Type[CharField]]] = ..., + *, + apply_limit_choices_to: bool = ... +) -> Dict[str, Any]: ... + +class ModelFormOptions: + model: Optional[Type[Model]] = ... + fields: Optional[_Fields] = ... + exclude: Optional[_Fields] = ... + widgets: Optional[Dict[str, Union[Widget, Input]]] = ... + localized_fields: Optional[Union[Tuple[str], str]] = ... + labels: Optional[_Labels] = ... + help_texts: Optional[Dict[str, str]] = ... + error_messages: Optional[_ErrorMessages] = ... + field_classes: Optional[Dict[str, Type[Field]]] = ... + def __init__(self, options: Optional[type] = ...) -> None: ... + +class ModelFormMetaclass(DeclarativeFieldsMetaclass): ... + +class BaseModelForm(BaseForm): + instance: Any = ... + def __init__( + self, + data: Optional[Mapping[str, Any]] = ..., + files: Optional[Mapping[str, File]] = ..., + auto_id: Union[bool, str] = ..., + prefix: Optional[str] = ..., + initial: Optional[Dict[str, Any]] = ..., + error_class: Type[ErrorList] = ..., + label_suffix: Optional[str] = ..., + empty_permitted: bool = ..., + instance: Optional[Model] = ..., + use_required_attribute: Optional[bool] = ..., + renderer: Any = ..., + ) -> None: ... + def validate_unique(self) -> None: ... + save_m2m: Any = ... + def save(self, commit: bool = ...) -> Any: ... + +class ModelForm(BaseModelForm, metaclass=ModelFormMetaclass): + base_fields: ClassVar[Dict[str, Field]] = ... + +def modelform_factory( + model: Type[Model], + form: Type[ModelForm] = ..., + fields: Optional[_Fields] = ..., + exclude: Optional[_Fields] = ..., + formfield_callback: Optional[Union[str, Callable[[models.Field], Field]]] = ..., + widgets: Optional[MutableMapping[str, Widget]] = ..., + localized_fields: Optional[Sequence[str]] = ..., + labels: Optional[MutableMapping[str, str]] = ..., + help_texts: Optional[MutableMapping[str, str]] = ..., + error_messages: Optional[MutableMapping[str, Dict[str, Any]]] = ..., + field_classes: Optional[MutableMapping[str, Type[Field]]] = ..., +) -> Type[ModelForm]: ... + +class BaseModelFormSet(BaseFormSet): + model: Any = ... + unique_fields: Any = ... + queryset: Any = ... + initial_extra: Any = ... + def __init__( + self, + data: Optional[Any] = ..., + files: Optional[Any] = ..., + auto_id: str = ..., + prefix: Optional[Any] = ..., + queryset: Optional[Any] = ..., + *, + initial: Optional[Any] = ..., + **kwargs: Any + ) -> None: ... + def initial_form_count(self): ... + def get_queryset(self): ... + def save_new(self, form: Any, commit: bool = ...): ... + def save_existing(self, form: Any, instance: Any, commit: bool = ...): ... + def delete_existing(self, obj: Any, commit: bool = ...) -> None: ... + saved_forms: Any = ... + save_m2m: Any = ... + def save(self, commit: bool = ...): ... + def clean(self) -> None: ... + def validate_unique(self) -> None: ... + def get_unique_error_message(self, unique_check: Any): ... + def get_date_error_message(self, date_check: Any): ... + def get_form_error(self): ... + changed_objects: Any = ... + deleted_objects: Any = ... + def save_existing_objects(self, commit: bool = ...): ... + new_objects: Any = ... + def save_new_objects(self, commit: bool = ...): ... + def add_fields(self, form: Any, index: Any): ... + +def modelformset_factory( + model: Type[Model], + form: Type[ModelForm] = ..., + formfield_callback: Optional[Callable] = ..., + formset: Type[BaseModelFormSet] = ..., + extra: int = ..., + can_delete: bool = ..., + can_order: bool = ..., + min_num: Optional[int] = ..., + max_num: Optional[int] = ..., + fields: Optional[_Fields] = ..., + exclude: Optional[_Fields] = ..., + widgets: Optional[Dict[str, Any]] = ..., + validate_max: bool = ..., + localized_fields: Optional[Sequence[str]] = ..., + labels: Optional[Dict[str, str]] = ..., + help_texts: Optional[Dict[str, str]] = ..., + error_messages: Optional[Dict[str, Dict[str, str]]] = ..., + validate_min: bool = ..., + field_classes: Optional[Dict[str, Type[Field]]] = ..., +) -> Type[BaseModelFormSet]: ... + +class BaseInlineFormSet(BaseModelFormSet): + instance: Any = ... + save_as_new: Any = ... + unique_fields: Any = ... + def __init__( + self, + data: Optional[Any] = ..., + files: Optional[Any] = ..., + instance: Optional[Any] = ..., + save_as_new: bool = ..., + prefix: Optional[Any] = ..., + queryset: Optional[Any] = ..., + **kwargs: Any + ) -> None: ... + def initial_form_count(self): ... + @classmethod + def get_default_prefix(cls): ... + def save_new(self, form: Any, commit: bool = ...): ... + def add_fields(self, form: Any, index: Any) -> None: ... + def get_unique_error_message(self, unique_check: Any): ... + +def inlineformset_factory( + parent_model: Type[Model], + model: Type[Model], + form: Type[ModelForm] = ..., + formset: Type[BaseInlineFormSet] = ..., + fk_name: Optional[str] = ..., + fields: Optional[_Fields] = ..., + exclude: Optional[_Fields] = ..., + extra: int = ..., + can_order: bool = ..., + can_delete: bool = ..., + max_num: Optional[int] = ..., + formfield_callback: Optional[Callable] = ..., + widgets: Optional[Dict[str, Any]] = ..., + validate_max: bool = ..., + localized_fields: Optional[Sequence[str]] = ..., + labels: Optional[Dict[str, str]] = ..., + help_texts: Optional[Dict[str, str]] = ..., + error_messages: Optional[Dict[str, Dict[str, str]]] = ..., + min_num: Optional[int] = ..., + validate_min: bool = ..., + field_classes: Optional[Dict[str, Any]] = ..., +) -> Type[BaseInlineFormSet]: ... + +class InlineForeignKeyField(Field): + disabled: bool + help_text: str + required: bool + show_hidden_initial: bool + widget: Any = ... + default_error_messages: Any = ... + parent_instance: Model = ... + pk_field: bool = ... + to_field: Optional[str] = ... + def __init__( + self, parent_instance: Model, *args: Any, pk_field: bool = ..., to_field: Optional[Any] = ..., **kwargs: Any + ) -> None: ... + +class ModelChoiceIterator: + field: ModelChoiceField = ... + queryset: Optional[QuerySet] = ... + def __init__(self, field: ModelChoiceField) -> None: ... + def __iter__(self) -> Iterator[Tuple[Union[int, str], str]]: ... + def __len__(self) -> int: ... + def __bool__(self) -> bool: ... + def choice(self, obj: Model) -> Tuple[int, str]: ... + +class ModelChoiceField(ChoiceField): + disabled: bool + error_messages: Dict[str, str] + help_text: str + required: bool + show_hidden_initial: bool + validators: List[Any] + default_error_messages: Any = ... + iterator: Any = ... + empty_label: Optional[str] = ... + queryset: Any = ... + limit_choices_to: Optional[Union[Dict[str, Any], Callable[[], Any]]] = ... + to_field_name: None = ... + def __init__( + self, + queryset: Optional[Union[Manager, QuerySet]], + *, + empty_label: Optional[str] = ..., + required: bool = ..., + widget: Optional[Any] = ..., + label: Optional[Any] = ..., + initial: Optional[Any] = ..., + help_text: str = ..., + to_field_name: Optional[Any] = ..., + limit_choices_to: Optional[Union[Dict[str, Any], Callable[[], Any]]] = ..., + **kwargs: Any + ) -> None: ... + def get_limit_choices_to(self) -> Optional[Union[Dict[str, datetime], Q, MagicMock]]: ... + def label_from_instance(self, obj: Model) -> str: ... + choices: Any = ... + def validate(self, value: Optional[Model]) -> None: ... + def has_changed(self, initial: Optional[Union[Model, int, str, UUID]], data: Optional[Union[int, str]]) -> bool: ... + +class ModelMultipleChoiceField(ModelChoiceField): + disabled: bool + empty_label: None + help_text: str + required: bool + show_hidden_initial: bool + widget: Any = ... + hidden_widget: Any = ... + default_error_messages: Any = ... + def __init__(self, queryset: _BaseQuerySet, **kwargs: Any) -> None: ... + +def _get_foreign_key( + parent_model: Type[Model], model: Type[Model], fk_name: Optional[str] = ..., can_fail: bool = ... +) -> ForeignKey: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/renderers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/renderers.pyi new file mode 100644 index 00000000..ffdf34f6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/renderers.pyi @@ -0,0 +1,26 @@ +from typing import Any, Dict + +from django.template.backends.base import BaseEngine + +from django.template import Template + +ROOT: Any + +def get_default_renderer() -> DjangoTemplates: ... + +class BaseRenderer: + def get_template(self, template_name: str) -> Any: ... + def render(self, template_name: str, context: Dict[str, Any], request: None = ...) -> str: ... + +class EngineMixin: + def get_template(self, template_name: str) -> Any: ... + def engine(self) -> BaseEngine: ... + +class DjangoTemplates(EngineMixin, BaseRenderer): + backend: Any = ... + +class Jinja2(EngineMixin, BaseRenderer): + backend: Any = ... + +class TemplatesSetting(BaseRenderer): + def get_template(self, template_name: str) -> Template: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/utils.pyi new file mode 100644 index 00000000..92fc2115 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/utils.pyi @@ -0,0 +1,33 @@ +from collections import UserList +from datetime import datetime +from typing import Any, Dict, List, Optional, Sequence, Union + +from django.core.exceptions import ValidationError +from django.utils.safestring import SafeText + +def pretty_name(name: str) -> str: ... +def flatatt(attrs: Dict[str, Any]) -> SafeText: ... + +class ErrorDict(dict): + def as_data(self) -> Dict[str, List[ValidationError]]: ... + def get_json_data(self, escape_html: bool = ...) -> Dict[str, Any]: ... + def as_json(self, escape_html: bool = ...) -> str: ... + def as_ul(self) -> str: ... + def as_text(self) -> str: ... + +class ErrorList(UserList): + data: List[Union[ValidationError, str]] + error_class: str = ... + def __init__( + self, + initlist: Optional[Union[ErrorList, Sequence[Union[str, Exception]]]] = ..., + error_class: Optional[str] = ..., + ) -> None: ... + def as_data(self) -> List[ValidationError]: ... + def get_json_data(self, escape_html: bool = ...) -> List[Dict[str, str]]: ... + def as_json(self, escape_html: bool = ...) -> str: ... + def as_ul(self) -> str: ... + def as_text(self) -> str: ... + +def from_current_timezone(value: datetime) -> datetime: ... +def to_current_timezone(value: datetime) -> datetime: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/widgets.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/widgets.pyi new file mode 100644 index 00000000..0aeafe7b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/forms/widgets.pyi @@ -0,0 +1,172 @@ +from decimal import Decimal +from itertools import chain +from typing import Any, Callable, Dict, Iterable, Iterator, List, Mapping, Optional, Sequence, Set, Tuple, Type, Union + +from django.core.files.base import File +from django.forms.renderers import EngineMixin +from django.utils.safestring import SafeText + +_OptAttrs = Dict[str, Any] + +class MediaOrderConflictWarning(RuntimeWarning): ... + +class Media: + _js: str + def __init__( + self, + media: Optional[type] = ..., + css: Optional[Dict[str, Iterable[str]]] = ..., + js: Optional[Iterable[str]] = ..., + ) -> None: ... + def render(self) -> str: ... + def render_js(self) -> List[str]: ... + def render_css(self) -> chain: ... + def absolute_path(self, path: str) -> str: ... + def __getitem__(self, name: str) -> Media: ... + @staticmethod + def merge(list_1: Iterable[Any], list_2: Iterable[Any]) -> Iterable[Any]: ... + def __add__(self, other: Media) -> Media: ... + +class MediaDefiningClass(type): ... + +class Widget: + needs_multipart_form: bool = ... + is_localized: bool = ... + is_required: bool = ... + supports_microseconds: bool = ... + attrs: _OptAttrs = ... + def __init__(self, attrs: Optional[_OptAttrs] = ...) -> None: ... + @property + def is_hidden(self) -> bool: ... + def subwidgets(self, name: str, value: Optional[List[str]], attrs: _OptAttrs = ...) -> Iterator[Dict[str, Any]]: ... + def format_value(self, value: Any) -> Optional[str]: ... + def get_context(self, name: str, value: Any, attrs: Optional[_OptAttrs]) -> Dict[str, Any]: ... + def render( + self, name: str, value: Any, attrs: Optional[_OptAttrs] = ..., renderer: Optional[EngineMixin] = ... + ) -> SafeText: ... + def build_attrs( + self, base_attrs: _OptAttrs, extra_attrs: Optional[_OptAttrs] = ... + ) -> Dict[str, Union[Decimal, float, str]]: ... + def value_from_datadict(self, data: Dict[str, Any], files: Mapping[str, Iterable[Any]], name: str) -> Any: ... + def value_omitted_from_data(self, data: Dict[str, Any], files: Mapping[str, Iterable[Any]], name: str) -> bool: ... + def id_for_label(self, id_: str) -> str: ... + def use_required_attribute(self, initial: Any) -> bool: ... + +class Input(Widget): + input_type: str = ... + template_name: str = ... + +class TextInput(Input): ... +class NumberInput(Input): ... +class EmailInput(Input): ... +class URLInput(Input): ... + +class PasswordInput(Input): + render_value: bool = ... + def __init__(self, attrs: Optional[_OptAttrs] = ..., render_value: bool = ...): ... + +class HiddenInput(Input): + choices: Iterable[Tuple[str, str]] + +class MultipleHiddenInput(HiddenInput): ... +class FileInput(Input): ... + +class ClearableFileInput(FileInput): + clear_checkbox_label: Any = ... + initial_text: Any = ... + input_text: Any = ... + def clear_checkbox_name(self, name: str) -> str: ... + def clear_checkbox_id(self, name: str) -> str: ... + def is_initial(self, value: Optional[Union[File, str]]) -> bool: ... + +class Textarea(Widget): + template_name: str = ... + +class DateTimeBaseInput(TextInput): + format_key: str = ... + format: Optional[str] = ... + def __init__(self, attrs: Optional[_OptAttrs] = ..., format: Optional[str] = ...): ... + +class DateInput(DateTimeBaseInput): ... +class DateTimeInput(DateTimeBaseInput): ... +class TimeInput(DateTimeBaseInput): ... + +class CheckboxInput(Input): + check_test: Callable = ... + def __init__(self, attrs: Optional[_OptAttrs] = ..., check_test: Optional[Callable] = ...) -> None: ... + +class ChoiceWidget(Widget): + allow_multiple_selected: bool = ... + input_type: Optional[str] = ... + template_name: Optional[str] = ... + option_template_name: str = ... + add_id_index: bool = ... + checked_attribute: Any = ... + option_inherits_attrs: bool = ... + choices: List[List[Union[int, str]]] = ... + def __init__(self, attrs: Optional[_OptAttrs] = ..., choices: Sequence[Tuple[Any, Any]] = ...) -> None: ... + def options(self, name: str, value: List[str], attrs: Optional[_OptAttrs] = ...) -> None: ... + def optgroups(self, name: str, value: List[str], attrs: Optional[_OptAttrs] = ...) -> Any: ... + def create_option( + self, + name: str, + value: Any, + label: Union[int, str], + selected: Union[Set[str], bool], + index: int, + subindex: Optional[int] = ..., + attrs: Optional[_OptAttrs] = ..., + ) -> Dict[str, Any]: ... + def id_for_label(self, id_: str, index: str = ...) -> str: ... + +class Select(ChoiceWidget): ... +class NullBooleanSelect(Select): ... + +class SelectMultiple(Select): + allow_multiple_selected: bool = ... + +class RadioSelect(ChoiceWidget): + can_add_related: bool + +class CheckboxSelectMultiple(ChoiceWidget): ... + +class MultiWidget(Widget): + template_name: str = ... + widgets: List[Widget] = ... + def __init__(self, widgets: Sequence[Union[Widget, Type[Widget]]], attrs: Optional[_OptAttrs] = ...) -> None: ... + def decompress(self, value: Any) -> Optional[Any]: ... + media: Any = ... + +class SplitDateTimeWidget(MultiWidget): + def __init__( + self, + attrs: Optional[_OptAttrs] = ..., + date_format: Optional[str] = ..., + time_format: Optional[str] = ..., + date_attrs: Optional[Dict[str, str]] = ..., + time_attrs: Optional[Dict[str, str]] = ..., + ) -> None: ... + +class SplitHiddenDateTimeWidget(SplitDateTimeWidget): ... + +class SelectDateWidget(Widget): + none_value: Any = ... + month_field: str = ... + day_field: str = ... + year_field: str = ... + template_name: str = ... + input_type: str = ... + select_widget: Any = ... + date_re: Any = ... + years: Any = ... + months: Any = ... + year_none_value: Any = ... + month_none_value: Any = ... + day_none_value: Any = ... + def __init__( + self, + attrs: Optional[_OptAttrs] = ..., + years: Optional[Iterable[Union[int, str]]] = ..., + months: Optional[Dict[int, str]] = ..., + empty_label: Optional[Union[str, Sequence[str]]] = ..., + ) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/http/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/http/__init__.pyi new file mode 100644 index 00000000..a8e4c86d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/http/__init__.pyi @@ -0,0 +1,26 @@ +from .request import ( + HttpRequest as HttpRequest, + QueryDict as QueryDict, + RawPostDataException as RawPostDataException, + UnreadablePostError as UnreadablePostError, +) + +from .response import ( + BadHeaderError as BadHeaderError, + FileResponse as FileResponse, + Http404 as Http404, + HttpResponse as HttpResponse, + HttpResponseBadRequest as HttpResponseBadRequest, + HttpResponseForbidden as HttpResponseForbidden, + HttpResponseGone as HttpResponseGone, + HttpResponseNotAllowed as HttpResponseNotAllowed, + HttpResponseNotFound as HttpResponseNotFound, + HttpResponseNotModified as HttpResponseNotModified, + HttpResponsePermanentRedirect as HttpResponsePermanentRedirect, + HttpResponseRedirect as HttpResponseRedirect, + HttpResponseServerError as HttpResponseServerError, + JsonResponse as JsonResponse, + StreamingHttpResponse as StreamingHttpResponse, +) + +from .cookie import SimpleCookie as SimpleCookie, parse_cookie as parse_cookie diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/http/cookie.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/http/cookie.pyi new file mode 100644 index 00000000..e2dc91dd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/http/cookie.pyi @@ -0,0 +1,5 @@ +from typing import Any, Dict + +SimpleCookie: Any + +def parse_cookie(cookie: str) -> Dict[str, str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/http/multipartparser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/http/multipartparser.pyi new file mode 100644 index 00000000..c8843a69 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/http/multipartparser.pyi @@ -0,0 +1,54 @@ +from io import BytesIO, StringIO +from typing import Any, Dict, Iterator, List, Optional, Tuple, Union + +from django.http.request import QueryDict +from django.utils.datastructures import ImmutableList, MultiValueDict + +class MultiPartParserError(Exception): ... +class InputStreamExhausted(Exception): ... + +class MultiPartParser: + def __init__( + self, + META: Dict[str, Any], + input_data: Union[StringIO, BytesIO], + upload_handlers: Union[List[Any], ImmutableList], + encoding: Optional[str] = ..., + ) -> None: ... + def parse(self) -> Tuple[QueryDict, MultiValueDict]: ... + def handle_file_complete(self, old_field_name: str, counters: List[int]) -> None: ... + def IE_sanitize(self, filename: str) -> str: ... + +class LazyStream: + length: None = ... + position: int = ... + def __init__(self, producer: Union[BoundaryIter, ChunkIter], length: None = ...) -> None: ... + def tell(self): ... + def read(self, size: Optional[int] = ...) -> bytes: ... + def __next__(self) -> bytes: ... + def close(self) -> None: ... + def __iter__(self) -> LazyStream: ... + def unget(self, bytes: bytes) -> None: ... + +class ChunkIter: + flo: BytesIO = ... + chunk_size: int = ... + def __init__(self, flo: BytesIO, chunk_size: int = ...) -> None: ... + def __next__(self) -> bytes: ... + def __iter__(self): ... + +class InterBoundaryIter: + def __init__(self, stream: LazyStream, boundary: bytes) -> None: ... + def __iter__(self) -> InterBoundaryIter: ... + def __next__(self) -> LazyStream: ... + +class BoundaryIter: + def __init__(self, stream: LazyStream, boundary: bytes) -> None: ... + def __iter__(self): ... + def __next__(self) -> bytes: ... + +class Parser: + def __init__(self, stream: LazyStream, boundary: bytes) -> None: ... + def __iter__(self) -> Iterator[Tuple[str, Dict[str, Tuple[str, Dict[str, Union[bytes, str]]]], LazyStream]]: ... + +def parse_header(line: bytes) -> Tuple[str, Dict[str, Any]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/http/request.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/http/request.pyi new file mode 100644 index 00000000..821e6900 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/http/request.pyi @@ -0,0 +1,111 @@ +from io import BytesIO +from typing import ( + Any, + BinaryIO, + Dict, + Iterable, + List, + Mapping, + Optional, + Pattern, + Set, + Tuple, + Type, + TypeVar, + Union, + overload, +) + +from django.contrib.auth.base_user import AbstractBaseUser +from django.contrib.auth.models import AnonymousUser +from django.contrib.sessions.backends.base import SessionBase +from django.contrib.sites.models import Site +from django.utils.datastructures import CaseInsensitiveMapping, ImmutableList, MultiValueDict + +from django.core.files import uploadedfile, uploadhandler +from django.urls import ResolverMatch + +RAISE_ERROR: object = ... +host_validation_re: Pattern = ... + +class UnreadablePostError(IOError): ... +class RawPostDataException(Exception): ... + +UploadHandlerList = Union[List[uploadhandler.FileUploadHandler], ImmutableList[uploadhandler.FileUploadHandler]] + +class HttpHeaders(CaseInsensitiveMapping): + HTTP_PREFIX: str = ... + UNPREFIXED_HEADERS: Set[str] = ... + def __init__(self, environ: Mapping[str, Any]) -> None: ... + @classmethod + def parse_header_name(cls, header: str) -> Optional[str]: ... + +class HttpRequest(BytesIO): + GET: QueryDict = ... + POST: QueryDict = ... + COOKIES: Dict[str, str] = ... + META: Dict[str, Any] = ... + FILES: MultiValueDict[str, uploadedfile.UploadedFile] = ... + path: str = ... + path_info: str = ... + method: Optional[str] = ... + resolver_match: ResolverMatch = ... + content_type: Optional[str] = ... + content_params: Optional[Dict[str, str]] = ... + user: Union[AbstractBaseUser, AnonymousUser] + site: Site + session: SessionBase + encoding: Optional[str] = ... + upload_handlers: UploadHandlerList = ... + def __init__(self) -> None: ... + def get_host(self) -> str: ... + def get_port(self) -> str: ... + def get_full_path(self, force_append_slash: bool = ...) -> str: ... + def get_full_path_info(self, force_append_slash: bool = ...) -> str: ... + def get_signed_cookie( + self, key: str, default: Any = ..., salt: str = ..., max_age: Optional[int] = ... + ) -> Optional[str]: ... + def get_raw_uri(self) -> str: ... + def build_absolute_uri(self, location: Optional[str] = ...) -> str: ... + @property + def scheme(self) -> Optional[str]: ... + def is_secure(self) -> bool: ... + def is_ajax(self) -> bool: ... + def parse_file_upload( + self, META: Mapping[str, Any], post_data: BinaryIO + ) -> Tuple[QueryDict, MultiValueDict[str, uploadedfile.UploadedFile]]: ... + @property + def headers(self) -> HttpHeaders: ... + @property + def body(self) -> bytes: ... + def _load_post_and_files(self) -> None: ... + +_Q = TypeVar("_Q", bound="QueryDict") + +class QueryDict(MultiValueDict[str, str]): + encoding: str = ... + _mutable: bool = ... + def __init__( + self, query_string: Optional[Union[str, bytes]] = ..., mutable: bool = ..., encoding: Optional[str] = ... + ) -> None: ... + def setlist(self, key: str, list_: List[str]) -> None: ... + def setlistdefault(self, key: str, default_list: Optional[List[str]] = ...) -> List[str]: ... + def appendlist(self, key: str, value: str) -> None: ... + def urlencode(self, safe: Optional[str] = ...) -> str: ... + @classmethod + def fromkeys( + cls: Type[_Q], + iterable: Iterable[Union[bytes, str]], + value: Any = ..., + mutable: bool = ..., + encoding: Optional[str] = ..., + ) -> _Q: ... + +@overload +def bytes_to_text(s: bytes, encoding: str) -> str: ... +@overload +def bytes_to_text(s: str, encoding: str) -> str: ... +@overload +def bytes_to_text(s: None, encoding: str) -> None: ... +def split_domain_port(host: str) -> Tuple[str, str]: ... +def validate_host(host: str, allowed_hosts: Iterable[str]) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/http/response.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/http/response.pyi new file mode 100644 index 00000000..29ffa90a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/http/response.pyi @@ -0,0 +1,137 @@ +import datetime +from io import BytesIO +from json import JSONEncoder +from typing import Any, Dict, Iterable, Iterator, List, Optional, Tuple, Type, Union, overload + +from django.core.handlers.wsgi import WSGIRequest +from django.http.cookie import SimpleCookie +from django.test.client import Client + +from django.template import Context, Template +from django.urls import ResolverMatch + +class BadHeaderError(ValueError): ... + +class HttpResponseBase(Iterable[Any]): + status_code: int = ... + cookies: SimpleCookie = ... + reason_phrase: str = ... + charset: str = ... + closed: bool = ... + def __init__( + self, + content_type: Optional[str] = ..., + status: Optional[int] = ..., + reason: Optional[str] = ..., + charset: Optional[str] = ..., + ) -> None: ... + def serialize_headers(self) -> bytes: ... + def __setitem__(self, header: Union[str, bytes], value: Union[str, bytes, int]) -> None: ... + def __delitem__(self, header: Union[str, bytes]) -> None: ... + def __getitem__(self, header: Union[str, bytes]) -> str: ... + def has_header(self, header: str) -> bool: ... + def items(self) -> Iterable[Tuple[str, str]]: ... + @overload + def get(self, header: Union[str, bytes], alternate: Optional[str]) -> str: ... + @overload + def get(self, header: Union[str, bytes]) -> Optional[str]: ... + def set_cookie( + self, + key: str, + value: str = ..., + max_age: Optional[int] = ..., + expires: Optional[Union[str, datetime.datetime]] = ..., + path: str = ..., + domain: Optional[str] = ..., + secure: bool = ..., + httponly: bool = ..., + samesite: str = ..., + ) -> None: ... + def setdefault(self, key: str, value: str) -> None: ... + def set_signed_cookie(self, key: str, value: str, salt: str = ..., **kwargs: Any) -> None: ... + def delete_cookie(self, key: str, path: str = ..., domain: Optional[str] = ...) -> None: ... + def make_bytes(self, value: object) -> bytes: ... + def close(self) -> None: ... + def write(self, content: Union[str, bytes]) -> None: ... + def flush(self) -> None: ... + def tell(self) -> int: ... + def readable(self) -> bool: ... + def seekable(self) -> bool: ... + def writable(self) -> bool: ... + def writelines(self, lines: Iterable[object]): ... + def __iter__(self) -> Iterator[Any]: ... + +class HttpResponse(HttpResponseBase): + content: Any + csrf_cookie_set: bool + redirect_chain: List[Tuple[str, int]] + sameorigin: bool + test_server_port: str + test_was_secure_request: bool + xframe_options_exempt: bool + streaming: bool = ... + def __init__(self, content: object = ..., *args: Any, **kwargs: Any) -> None: ... + def serialize(self) -> bytes: ... + @property + def url(self) -> str: ... + # Attributes assigned by monkey-patching in test client ClientHandler.__call__() + wsgi_request: WSGIRequest + # Attributes assigned by monkey-patching in test client Client.request() + client: Client + request: Dict[str, Any] + templates: List[Template] + context: Context + resolver_match: ResolverMatch + def json(self) -> Any: ... + +class StreamingHttpResponse(HttpResponseBase): + content: Any + streaming_content: Iterator[Any] + def __init__(self, streaming_content: Iterable[Any] = ..., *args: Any, **kwargs: Any) -> None: ... + def getvalue(self) -> Any: ... + +class FileResponse(StreamingHttpResponse): + client: Client + context: None + file_to_stream: Optional[BytesIO] + request: Dict[str, str] + resolver_match: ResolverMatch + templates: List[Any] + wsgi_request: WSGIRequest + block_size: int = ... + as_attachment: bool = ... + filename: str = ... + def __init__(self, *args: Any, as_attachment: bool = ..., filename: str = ..., **kwargs: Any) -> None: ... + def set_headers(self, filelike: BytesIO) -> None: ... + def json(self) -> Dict[str, Any]: ... + +class HttpResponseRedirectBase(HttpResponse): + allowed_schemes: List[str] = ... + def __init__(self, redirect_to: str, *args: Any, **kwargs: Any) -> None: ... + +class HttpResponseRedirect(HttpResponseRedirectBase): ... +class HttpResponsePermanentRedirect(HttpResponseRedirectBase): ... + +class HttpResponseNotModified(HttpResponse): + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + +class HttpResponseBadRequest(HttpResponse): ... +class HttpResponseNotFound(HttpResponse): ... +class HttpResponseForbidden(HttpResponse): ... + +class HttpResponseNotAllowed(HttpResponse): + def __init__(self, permitted_methods: Iterable[str], *args: Any, **kwargs: Any) -> None: ... + +class HttpResponseGone(HttpResponse): ... +class HttpResponseServerError(HttpResponse): ... +class Http404(Exception): ... + +class JsonResponse(HttpResponse): + def __init__( + self, + data: Any, + encoder: Type[JSONEncoder] = ..., + safe: bool = ..., + json_dumps_params: Optional[Dict[str, Any]] = ..., + **kwargs: Any + ) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/cache.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/cache.pyi new file mode 100644 index 00000000..04c7eb20 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/cache.pyi @@ -0,0 +1,31 @@ +from typing import Any, Optional, Union, Callable + +from django.http.request import HttpRequest +from django.http.response import HttpResponse, HttpResponseBase +from django.utils.deprecation import MiddlewareMixin + +from django.core.cache import BaseCache + +class UpdateCacheMiddleware(MiddlewareMixin): + cache_timeout: float = ... + key_prefix: str = ... + cache_alias: str = ... + cache: BaseCache = ... + def process_response( + self, request: HttpRequest, response: Union[HttpResponseBase, str] + ) -> Union[HttpResponseBase, str]: ... + +class FetchFromCacheMiddleware(MiddlewareMixin): + key_prefix: str = ... + cache_alias: str = ... + cache: BaseCache = ... + def process_request(self, request: HttpRequest) -> Optional[HttpResponse]: ... + +class CacheMiddleware(UpdateCacheMiddleware, FetchFromCacheMiddleware): + key_prefix: str = ... + cache_alias: str = ... + cache_timeout: float = ... + cache: BaseCache = ... + def __init__( + self, get_response: Optional[Callable] = ..., cache_timeout: Optional[float] = ..., **kwargs: Any + ) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/clickjacking.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/clickjacking.pyi new file mode 100644 index 00000000..08f4e181 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/clickjacking.pyi @@ -0,0 +1,7 @@ +from django.http.request import HttpRequest +from django.http.response import HttpResponse +from django.utils.deprecation import MiddlewareMixin + +class XFrameOptionsMiddleware(MiddlewareMixin): + def process_response(self, request: HttpRequest, response: HttpResponse) -> HttpResponse: ... + def get_xframe_options_value(self, request: HttpRequest, response: HttpResponse) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/common.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/common.pyi new file mode 100644 index 00000000..a5aa8f91 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/common.pyi @@ -0,0 +1,17 @@ +from typing import Any, Optional + +from django.http.request import HttpRequest +from django.http.response import HttpResponseBase, HttpResponsePermanentRedirect +from django.utils.deprecation import MiddlewareMixin + +class CommonMiddleware(MiddlewareMixin): + response_redirect_class: Any = ... + def process_request(self, request: HttpRequest) -> Optional[HttpResponsePermanentRedirect]: ... + def should_redirect_with_slash(self, request: HttpRequest) -> bool: ... + def get_full_path_with_slash(self, request: HttpRequest) -> str: ... + def process_response(self, request: HttpRequest, response: HttpResponseBase) -> HttpResponseBase: ... + +class BrokenLinkEmailsMiddleware(MiddlewareMixin): + def process_response(self, request: HttpRequest, response: HttpResponseBase) -> HttpResponseBase: ... + def is_internal_request(self, domain: str, referer: str) -> bool: ... + def is_ignorable_request(self, request: HttpRequest, uri: str, domain: str, referer: str) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/csrf.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/csrf.pyi new file mode 100644 index 00000000..98193211 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/csrf.pyi @@ -0,0 +1,33 @@ +from typing import Any, Callable, Dict, Optional, Tuple + +from django.http.request import HttpRequest +from django.http.response import HttpResponseBase, HttpResponseForbidden +from django.utils.deprecation import MiddlewareMixin + +logger: Any +REASON_NO_REFERER: str +REASON_BAD_REFERER: str +REASON_NO_CSRF_COOKIE: str +REASON_BAD_TOKEN: str +REASON_MALFORMED_REFERER: str +REASON_INSECURE_REFERER: str +CSRF_SECRET_LENGTH: int +CSRF_TOKEN_LENGTH: Any +CSRF_ALLOWED_CHARS: Any +CSRF_SESSION_KEY: str + +def get_token(request: HttpRequest) -> str: ... +def rotate_token(request: HttpRequest) -> None: ... + +class CsrfViewMiddleware(MiddlewareMixin): + def process_request(self, request: HttpRequest) -> None: ... + def process_view( + self, request: HttpRequest, callback: Optional[Callable], callback_args: Tuple, callback_kwargs: Dict[str, Any] + ) -> Optional[HttpResponseForbidden]: ... + def process_response(self, request: HttpRequest, response: HttpResponseBase) -> HttpResponseBase: ... + +def _compare_salted_tokens(request_csrf_token: str, csrf_token: str) -> bool: ... +def _get_new_csrf_string() -> str: ... +def _salt_cipher_secret(secret: str) -> str: ... +def _unsalt_cipher_token(token: str) -> str: ... +def _get_new_csrf_token() -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/gzip.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/gzip.pyi new file mode 100644 index 00000000..e25dca8b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/gzip.pyi @@ -0,0 +1,10 @@ +from typing import Any + +from django.http.request import HttpRequest +from django.http.response import HttpResponseBase +from django.utils.deprecation import MiddlewareMixin + +re_accepts_gzip: Any + +class GZipMiddleware(MiddlewareMixin): + def process_response(self, request: HttpRequest, response: HttpResponseBase) -> HttpResponseBase: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/http.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/http.pyi new file mode 100644 index 00000000..c0981b7d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/http.pyi @@ -0,0 +1,7 @@ +from django.http.request import HttpRequest +from django.http.response import HttpResponseBase +from django.utils.deprecation import MiddlewareMixin + +class ConditionalGetMiddleware(MiddlewareMixin): + def process_response(self, request: HttpRequest, response: HttpResponseBase) -> HttpResponseBase: ... + def needs_etag(self, response: HttpResponseBase) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/locale.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/locale.pyi new file mode 100644 index 00000000..ed247679 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/locale.pyi @@ -0,0 +1,10 @@ +from typing import Any + +from django.http.request import HttpRequest +from django.http.response import HttpResponseBase +from django.utils.deprecation import MiddlewareMixin + +class LocaleMiddleware(MiddlewareMixin): + response_redirect_class: Any = ... + def process_request(self, request: HttpRequest) -> None: ... + def process_response(self, request: HttpRequest, response: HttpResponseBase) -> HttpResponseBase: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/security.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/security.pyi new file mode 100644 index 00000000..1a449335 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/middleware/security.pyi @@ -0,0 +1,17 @@ +from typing import Any, List, Optional + +from django.http.request import HttpRequest +from django.http.response import HttpResponse, HttpResponsePermanentRedirect +from django.utils.deprecation import MiddlewareMixin + +class SecurityMiddleware(MiddlewareMixin): + sts_seconds: int = ... + sts_include_subdomains: bool = ... + sts_preload: bool = ... + content_type_nosniff: bool = ... + xss_filter: bool = ... + redirect: bool = ... + redirect_host: Optional[str] = ... + redirect_exempt: List[Any] = ... + def process_request(self, request: HttpRequest) -> Optional[HttpResponsePermanentRedirect]: ... + def process_response(self, request: HttpRequest, response: HttpResponse) -> HttpResponse: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/shortcuts.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/shortcuts.pyi new file mode 100644 index 00000000..736ee26b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/shortcuts.pyi @@ -0,0 +1,54 @@ +import sys +from typing import Any, Callable, List, Mapping, Optional, overload, Protocol, Sequence, Type, TypeVar, Union + +from django.db.models.base import Model +from django.http.response import ( + HttpResponse as HttpResponse, + HttpResponseRedirect as HttpResponseRedirect, + HttpResponsePermanentRedirect as HttpResponsePermanentRedirect, +) + +from django.db.models import Manager, QuerySet +from django.http import HttpRequest + +if sys.version_info < (3, 8): + from typing_extensions import Literal +else: + from typing import Literal + +def render_to_response( + template_name: Union[str, Sequence[str]], + context: Optional[Mapping[str, Any]] = ..., + content_type: Optional[str] = ..., + status: Optional[int] = ..., + using: Optional[str] = ..., +) -> HttpResponse: ... +def render( + request: HttpRequest, + template_name: Union[str, Sequence[str]], + context: Optional[Mapping[str, Any]] = ..., + content_type: Optional[str] = ..., + status: Optional[int] = ..., + using: Optional[str] = ..., +) -> HttpResponse: ... + +class SupportsGetAbsoluteUrl(Protocol): ... + +@overload +def redirect( + to: Union[Callable, str, SupportsGetAbsoluteUrl], *args: Any, permanent: Literal[True], **kwargs: Any +) -> HttpResponsePermanentRedirect: ... +@overload +def redirect( + to: Union[Callable, str, SupportsGetAbsoluteUrl], *args: Any, permanent: Literal[False], **kwargs: Any +) -> HttpResponseRedirect: ... +@overload +def redirect( + to: Union[Callable, str, SupportsGetAbsoluteUrl], *args: Any, permanent: bool = ..., **kwargs: Any +) -> Union[HttpResponseRedirect, HttpResponsePermanentRedirect]: ... + +_T = TypeVar("_T", bound=Model) + +def get_object_or_404(klass: Union[Type[_T], Manager[_T], QuerySet[_T]], *args: Any, **kwargs: Any) -> _T: ... +def get_list_or_404(klass: Union[Type[_T], Manager[_T], QuerySet[_T]], *args: Any, **kwargs: Any) -> List[_T]: ... +def resolve_url(to: Union[Callable, Model, str], *args: Any, **kwargs: Any) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/__init__.pyi new file mode 100644 index 00000000..02a0ada9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/__init__.pyi @@ -0,0 +1,16 @@ +from .engine import Engine as Engine +from .utils import EngineHandler as EngineHandler + +engines: EngineHandler + +from .base import VariableDoesNotExist as VariableDoesNotExist +from .context import ContextPopException as ContextPopException +from .exceptions import TemplateDoesNotExist as TemplateDoesNotExist, TemplateSyntaxError as TemplateSyntaxError + +# Template parts +from .base import Node as Node, NodeList as NodeList, Origin as Origin, Template as Template, Variable as Variable +from .context import Context as Context, RequestContext as RequestContext + +from .library import Library as Library + +from . import defaultfilters as defaultfilters diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/backends/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/backends/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/backends/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/backends/base.pyi new file mode 100644 index 00000000..5f48ad78 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/backends/base.pyi @@ -0,0 +1,16 @@ +from typing import Any, Iterator, List, Mapping, Optional, Tuple + +from django.template.base import Template + +class BaseEngine: + name: str = ... + dirs: List[str] = ... + app_dirs: bool = ... + def __init__(self, params: Mapping[str, Any]) -> None: ... + @property + def app_dirname(self) -> Optional[str]: ... + def from_string(self, template_code: str) -> Template: ... + def get_template(self, template_name: str) -> Optional[Template]: ... + @property + def template_dirs(self) -> Tuple[str]: ... + def iter_template_filenames(self, template_name: str) -> Iterator[str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/backends/django.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/backends/django.pyi new file mode 100644 index 00000000..fa2c7e19 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/backends/django.pyi @@ -0,0 +1,16 @@ +from typing import Any, Dict, Iterator, Optional + +from django.template.engine import Engine +from django.template.exceptions import TemplateDoesNotExist + +from .base import BaseEngine + +class DjangoTemplates(BaseEngine): + engine: Engine = ... + def __init__(self, params: Dict[str, Any]) -> None: ... + def get_templatetag_libraries(self, custom_libraries: Dict[str, str]) -> Dict[str, str]: ... + +def copy_exception(exc: TemplateDoesNotExist, backend: Optional[DjangoTemplates] = ...) -> TemplateDoesNotExist: ... +def reraise(exc: TemplateDoesNotExist, backend: DjangoTemplates) -> Any: ... +def get_installed_libraries() -> Dict[str, str]: ... +def get_package_libraries(pkg: Any) -> Iterator[str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/backends/dummy.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/backends/dummy.pyi new file mode 100644 index 00000000..6a8a759d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/backends/dummy.pyi @@ -0,0 +1,14 @@ +import string +from typing import Any, Dict, List, Optional, Tuple, Union + +from django.http.request import HttpRequest + +from .base import BaseEngine + +class TemplateStrings(BaseEngine): + template_dirs: Tuple[str] + def __init__(self, params: Dict[str, Union[Dict[Any, Any], List[Any], bool, str]]) -> None: ... + +class Template(string.Template): + template: str + def render(self, context: Optional[Dict[str, str]] = ..., request: Optional[HttpRequest] = ...) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/backends/jinja2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/backends/jinja2.pyi new file mode 100644 index 00000000..623bd409 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/backends/jinja2.pyi @@ -0,0 +1,18 @@ +from typing import Any, Callable, Dict, List, Optional + +from django.template.exceptions import TemplateSyntaxError + +from .base import BaseEngine + +class Jinja2(BaseEngine): + context_processors: List[str] = ... + def __init__(self, params: Dict[str, Any]) -> None: ... + @property + def template_context_processors(self) -> List[Callable]: ... + +class Origin: + name: str = ... + template_name: Optional[str] = ... + def __init__(self, name: str, template_name: Optional[str]) -> None: ... + +def get_exception_info(exception: TemplateSyntaxError) -> Dict[str, Any]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/backends/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/backends/utils.pyi new file mode 100644 index 00000000..c7152786 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/backends/utils.pyi @@ -0,0 +1,9 @@ +from typing import Any + +from django.http.request import HttpRequest +from django.utils.safestring import SafeText + +def csrf_input(request: HttpRequest) -> SafeText: ... + +csrf_input_lazy: Any +csrf_token_lazy: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/base.pyi new file mode 100644 index 00000000..a6015e4e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/base.pyi @@ -0,0 +1,174 @@ +from enum import Enum +from typing import Any, Callable, Dict, Iterator, List, Mapping, Optional, Sequence, Tuple, Type, Union + +from django.http.request import HttpRequest +from django.template.context import Context as Context +from django.template.engine import Engine +from django.template.library import Library +from django.template.loaders.base import Loader +from django.utils.safestring import SafeText + +FILTER_SEPARATOR: str +FILTER_ARGUMENT_SEPARATOR: str +VARIABLE_ATTRIBUTE_SEPARATOR: str +BLOCK_TAG_START: str +BLOCK_TAG_END: str +VARIABLE_TAG_START: str +VARIABLE_TAG_END: str +COMMENT_TAG_START: str +COMMENT_TAG_END: str +TRANSLATOR_COMMENT_MARK: str +SINGLE_BRACE_START: str +SINGLE_BRACE_END: str +UNKNOWN_SOURCE: str +tag_re: Any +logger: Any + +class TokenType(Enum): + TEXT: int = ... + VAR: int = ... + BLOCK: int = ... + COMMENT: int = ... + +class VariableDoesNotExist(Exception): + msg: str = ... + params: Tuple[Union[Dict[str, str], str]] = ... + def __init__(self, msg: str, params: Tuple[Union[Dict[str, str], str]] = ...) -> None: ... + +class Origin: + name: str = ... + template_name: Optional[Union[bytes, str]] = ... + loader: Optional[Loader] = ... + def __init__( + self, name: str, template_name: Optional[Union[bytes, str]] = ..., loader: Optional[Loader] = ... + ) -> None: ... + @property + def loader_name(self) -> Optional[str]: ... + +class Template: + name: Optional[str] = ... + origin: Origin = ... + engine: Engine = ... + source: str = ... + nodelist: NodeList = ... + def __init__( + self, + template_string: Union[Template, str], + origin: Optional[Origin] = ..., + name: Optional[str] = ..., + engine: Optional[Engine] = ..., + ) -> None: ... + def __iter__(self) -> None: ... + def render( + self, context: Optional[Union[Context, Dict[str, Any]]] = ..., request: Optional[HttpRequest] = ... + ) -> Any: ... + def compile_nodelist(self) -> NodeList: ... + def get_exception_info(self, exception: Exception, token: Token) -> Dict[str, Any]: ... + +def linebreak_iter(template_source: str) -> Iterator[int]: ... + +class Token: + contents: str + token_type: TokenType + lineno: Optional[int] = ... + position: Optional[Tuple[int, int]] = ... + def __init__( + self, + token_type: TokenType, + contents: str, + position: Optional[Tuple[int, int]] = ..., + lineno: Optional[int] = ..., + ) -> None: ... + def split_contents(self) -> List[str]: ... + +class Lexer: + template_string: str = ... + verbatim: Union[bool, str] = ... + def __init__(self, template_string: str) -> None: ... + def tokenize(self) -> List[Token]: ... + def create_token( + self, token_string: str, position: Optional[Tuple[int, int]], lineno: int, in_tag: bool + ) -> Token: ... + +class DebugLexer(Lexer): + template_string: str + verbatim: Union[bool, str] + def tokenize(self) -> List[Token]: ... + +class Parser: + tokens: Union[List[Token], str] = ... + tags: Dict[str, Callable] = ... + filters: Dict[str, Callable] = ... + command_stack: List[Tuple[str, Token]] = ... + libraries: Dict[str, Library] = ... + origin: Optional[Origin] = ... + def __init__( + self, + tokens: Union[List[Token], str], + libraries: Optional[Dict[str, Library]] = ..., + builtins: Optional[List[Library]] = ..., + origin: Optional[Origin] = ..., + ) -> None: ... + def parse(self, parse_until: Optional[Tuple[str]] = ...) -> NodeList: ... + def skip_past(self, endtag: str) -> None: ... + def extend_nodelist(self, nodelist: NodeList, node: Node, token: Token) -> None: ... + def error(self, token: Token, e: Union[Exception, str]) -> Exception: ... + def invalid_block_tag(self, token: Token, command: str, parse_until: Union[List[Any], Tuple[str]] = ...) -> Any: ... + def unclosed_block_tag(self, parse_until: Tuple[str]) -> Any: ... + def next_token(self) -> Token: ... + def prepend_token(self, token: Token) -> None: ... + def delete_first_token(self) -> None: ... + def add_library(self, lib: Library) -> None: ... + def compile_filter(self, token: str) -> FilterExpression: ... + def find_filter(self, filter_name: str) -> Callable: ... + +constant_string: Any +filter_raw_string: Any +filter_re: Any + +class FilterExpression: + token: str = ... + filters: List[Any] = ... + var: Any = ... + def __init__(self, token: str, parser: Parser) -> None: ... + def resolve(self, context: Mapping[str, Any], ignore_failures: bool = ...) -> Any: ... + @staticmethod + def args_check(name: str, func: Callable, provided: List[Tuple[bool, Any]]) -> bool: ... + +class Variable: + var: Union[Dict[Any, Any], str] = ... + literal: Optional[Union[SafeText, float]] = ... + lookups: Optional[Tuple[str]] = ... + translate: bool = ... + message_context: Optional[str] = ... + def __init__(self, var: Union[Dict[Any, Any], str]) -> None: ... + def resolve(self, context: Union[Mapping[str, Mapping[str, Any]], Context, int, str]) -> Any: ... + +class Node: + must_be_first: bool = ... + child_nodelists: Any = ... + origin: Origin + token: Token = ... + def render(self, context: Context) -> str: ... + def render_annotated(self, context: Context) -> Union[int, str]: ... + def __iter__(self) -> None: ... + def get_nodes_by_type(self, nodetype: Type[Node]) -> List[Node]: ... + +class NodeList(List[Node]): + contains_nontext: bool = ... + def render(self, context: Context) -> SafeText: ... + def get_nodes_by_type(self, nodetype: Type[Node]) -> List[Node]: ... + +class TextNode(Node): + s: str = ... + def __init__(self, s: str) -> None: ... + +def render_value_in_context(value: Any, context: Context) -> str: ... + +class VariableNode(Node): + filter_expression: FilterExpression = ... + def __init__(self, filter_expression: FilterExpression) -> None: ... + +kwarg_re: Any + +def token_kwargs(bits: Sequence[str], parser: Parser, support_legacy: bool = ...) -> Dict[str, FilterExpression]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/context.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/context.pyi new file mode 100644 index 00000000..1e95d6b2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/context.pyi @@ -0,0 +1,76 @@ +from typing import Any, Callable, Dict, Iterator, List, Optional, Type, Union, Iterable + +from django.http.request import HttpRequest +from django.template.base import Node, Origin, Template +from django.template.defaulttags import IfChangedNode +from django.template.loader_tags import IncludeNode + +_ContextValues = Union[Dict[str, Any], "Context"] + +class ContextPopException(Exception): ... + +class ContextDict(dict): + context: BaseContext = ... + def __init__(self, context: BaseContext, *args: Any, **kwargs: Any) -> None: ... + def __enter__(self) -> ContextDict: ... + def __exit__(self, *args: Any, **kwargs: Any) -> None: ... + +class BaseContext(Iterable[Any]): + def __init__(self, dict_: Any = ...) -> None: ... + def __copy__(self) -> BaseContext: ... + def __iter__(self) -> Iterator[Any]: ... + def push(self, *args: Any, **kwargs: Any) -> ContextDict: ... + def pop(self) -> ContextDict: ... + def __setitem__(self, key: Union[Node, str], value: Any) -> None: ... + def set_upward(self, key: str, value: Union[int, str]) -> None: ... + def __getitem__(self, key: Union[int, str]) -> Any: ... + def __delitem__(self, key: Any) -> None: ... + def __contains__(self, key: str) -> bool: ... + def get(self, key: str, otherwise: Optional[Any] = ...) -> Optional[Any]: ... + def setdefault( + self, key: Union[IfChangedNode, str], default: Optional[Union[List[Origin], int]] = ... + ) -> Optional[Union[List[Origin], int]]: ... + def new(self, values: Optional[_ContextValues] = ...) -> Context: ... + def flatten(self) -> Dict[str, Optional[Union[Dict[str, Union[Type[Any], str]], int, str]]]: ... + +class Context(BaseContext): + dicts: Any + autoescape: bool = ... + use_l10n: Optional[bool] = ... + use_tz: Optional[bool] = ... + template_name: Optional[str] = ... + render_context: RenderContext = ... + template: Optional[Template] = ... + def __init__( + self, dict_: Any = ..., autoescape: bool = ..., use_l10n: Optional[bool] = ..., use_tz: None = ... + ) -> None: ... + def bind_template(self, template: Template) -> Iterator[None]: ... + def update(self, other_dict: Union[Dict[str, Any], Context]) -> ContextDict: ... + +class RenderContext(BaseContext): + dicts: List[Dict[Union[IncludeNode, str], str]] + template: Optional[Template] = ... + def push_state(self, template: Template, isolated_context: bool = ...) -> Iterator[None]: ... + +class RequestContext(Context): + autoescape: bool + dicts: List[Dict[str, str]] + render_context: RenderContext + template_name: Optional[str] + use_l10n: None + use_tz: None + request: HttpRequest = ... + def __init__( + self, + request: HttpRequest, + dict_: Optional[Dict[str, Any]] = ..., + processors: Optional[List[Callable]] = ..., + use_l10n: None = ..., + use_tz: None = ..., + autoescape: bool = ..., + ) -> None: ... + template: Optional[Template] = ... + def bind_template(self, template: Template) -> Iterator[None]: ... + def new(self, values: Optional[_ContextValues] = ...) -> RequestContext: ... + +def make_context(context: Any, request: Optional[HttpRequest] = ..., **kwargs: Any) -> Context: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/context_processors.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/context_processors.pyi new file mode 100644 index 00000000..c831a979 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/context_processors.pyi @@ -0,0 +1,13 @@ +from typing import Any, Callable, Dict, List, Tuple, Union + +from django.core.handlers.wsgi import WSGIRequest +from django.http.request import HttpRequest +from django.utils.functional import SimpleLazyObject + +def csrf(request: HttpRequest) -> Dict[str, SimpleLazyObject]: ... +def debug(request: HttpRequest) -> Dict[str, Union[Callable, bool]]: ... +def i18n(request: WSGIRequest) -> Dict[str, Union[List[Tuple[str, str]], bool, str]]: ... +def tz(request: HttpRequest) -> Dict[str, str]: ... +def static(request: HttpRequest) -> Dict[str, str]: ... +def media(request: Any): ... +def request(request: HttpRequest) -> Dict[str, HttpRequest]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/defaultfilters.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/defaultfilters.pyi new file mode 100644 index 00000000..a66e1dea --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/defaultfilters.pyi @@ -0,0 +1,66 @@ +from datetime import date as _date, datetime, time as _time +from typing import Any, Callable, Dict, List, Optional, Union + +from django.utils.safestring import SafeText +from django.utils.html import escape as escape # noqa: F401 + +register: Any + +def stringfilter(func: Callable) -> Callable: ... +def addslashes(value: str) -> str: ... +def capfirst(value: str) -> str: ... +def escapejs_filter(value: str) -> SafeText: ... +def json_script(value: Dict[str, str], element_id: SafeText) -> SafeText: ... +def floatformat(text: Optional[Any], arg: Union[int, str] = ...) -> str: ... +def iriencode(value: str) -> str: ... +def linenumbers(value: str, autoescape: bool = ...) -> SafeText: ... +def lower(value: str) -> str: ... +def make_list(value: str) -> List[str]: ... +def slugify(value: str) -> SafeText: ... +def stringformat(value: Any, arg: str) -> str: ... +def title(value: str) -> str: ... +def truncatechars(value: str, arg: Union[SafeText, int]) -> str: ... +def truncatechars_html(value: str, arg: Union[int, str]) -> str: ... +def truncatewords(value: str, arg: Union[int, str]) -> str: ... +def truncatewords_html(value: str, arg: Union[int, str]) -> str: ... +def upper(value: str) -> str: ... +def urlencode(value: str, safe: Optional[SafeText] = ...) -> str: ... +def urlize(value: str, autoescape: bool = ...) -> SafeText: ... +def urlizetrunc(value: str, limit: Union[SafeText, int], autoescape: bool = ...) -> SafeText: ... +def wordcount(value: str) -> int: ... +def wordwrap(value: str, arg: Union[SafeText, int]) -> str: ... +def ljust(value: str, arg: Union[SafeText, int]) -> str: ... +def rjust(value: str, arg: Union[SafeText, int]) -> str: ... +def center(value: str, arg: Union[SafeText, int]) -> str: ... +def cut(value: str, arg: str) -> str: ... +def escape_filter(value: str) -> SafeText: ... +def force_escape(value: str) -> SafeText: ... +def linebreaks_filter(value: str, autoescape: bool = ...) -> SafeText: ... +def linebreaksbr(value: str, autoescape: bool = ...) -> SafeText: ... +def safe(value: str) -> SafeText: ... +def safeseq(value: List[str]) -> List[SafeText]: ... +def striptags(value: str) -> str: ... +def dictsort(value: Any, arg: Union[int, str]) -> Any: ... +def dictsortreversed(value: Any, arg: Union[int, str]) -> Any: ... +def first(value: Any) -> Any: ... +def join(value: Any, arg: str, autoescape: bool = ...) -> Any: ... +def last(value: List[str]) -> str: ... +def length(value: Any) -> int: ... +def length_is(value: Optional[Any], arg: Union[SafeText, int]) -> Union[bool, str]: ... +def random(value: List[str]) -> str: ... +def slice_filter(value: Any, arg: Union[str, int]) -> Any: ... +def unordered_list(value: Any, autoescape: bool = ...) -> Any: ... +def add(value: Any, arg: Any) -> Any: ... +def get_digit(value: Any, arg: int) -> Any: ... +def date(value: Optional[Union[_date, datetime, str]], arg: Optional[str] = ...) -> str: ... +def time(value: Optional[Union[datetime, _time, str]], arg: Optional[str] = ...) -> str: ... +def timesince_filter(value: Optional[_date], arg: Optional[_date] = ...) -> str: ... +def timeuntil_filter(value: Optional[_date], arg: Optional[_date] = ...) -> str: ... +def default(value: Optional[Union[int, str]], arg: Union[int, str]) -> Union[int, str]: ... +def default_if_none(value: Optional[str], arg: Union[int, str]) -> Union[int, str]: ... +def divisibleby(value: int, arg: int) -> bool: ... +def yesno(value: Optional[int], arg: Optional[str] = ...) -> Optional[Union[bool, str]]: ... +def filesizeformat(bytes_: Union[complex, int, str]) -> str: ... +def pluralize(value: Any, arg: str = ...) -> str: ... +def phone2numeric_filter(value: str) -> str: ... +def pprint(value: Any) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/defaulttags.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/defaulttags.pyi new file mode 100644 index 00000000..6faac5dd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/defaulttags.pyi @@ -0,0 +1,204 @@ +from collections import namedtuple +from datetime import date +from typing import Any, Dict, List, Optional, Sequence, Tuple, Union + +from django.template.base import FilterExpression, Parser, Token +from django.template.context import Context +from django.utils.safestring import SafeText + +from .base import Node, NodeList +from .library import Library +from .smartif import IfParser, Literal + +register: Any + +class AutoEscapeControlNode(Node): + nodelist: NodeList + setting: bool + def __init__(self, setting: bool, nodelist: NodeList) -> None: ... + +class CommentNode(Node): ... +class CsrfTokenNode(Node): ... + +class CycleNode(Node): + cyclevars: List[FilterExpression] = ... + variable_name: Optional[str] = ... + silent: bool = ... + def __init__( + self, cyclevars: List[FilterExpression], variable_name: Optional[str] = ..., silent: bool = ... + ) -> None: ... + def reset(self, context: Context) -> None: ... + +class DebugNode(Node): ... + +class FilterNode(Node): + filter_expr: FilterExpression + nodelist: NodeList + def __init__(self, filter_expr: FilterExpression, nodelist: NodeList) -> None: ... + +class FirstOfNode(Node): + vars: List[FilterExpression] = ... + asvar: Optional[str] = ... + def __init__(self, variables: List[FilterExpression], asvar: Optional[str] = ...) -> None: ... + +class ForNode(Node): + loopvars: Union[List[str], str] + sequence: Union[FilterExpression, str] + child_nodelists: Any = ... + is_reversed: bool = ... + nodelist_loop: Union[List[str], NodeList] = ... + nodelist_empty: Union[List[str], NodeList] = ... + def __init__( + self, + loopvars: Union[List[str], str], + sequence: Union[FilterExpression, str], + is_reversed: bool, + nodelist_loop: Union[List[str], NodeList], + nodelist_empty: Optional[Union[List[str], NodeList]] = ..., + ) -> None: ... + +class IfChangedNode(Node): + nodelist_false: NodeList + nodelist_true: NodeList + child_nodelists: Any = ... + def __init__(self, nodelist_true: NodeList, nodelist_false: NodeList, *varlist: Any) -> None: ... + +class IfEqualNode(Node): + nodelist_false: Union[List[Any], NodeList] + nodelist_true: Union[List[Any], NodeList] + var1: Union[FilterExpression, str] + var2: Union[FilterExpression, str] + child_nodelists: Any = ... + negate: bool = ... + def __init__( + self, + var1: Union[FilterExpression, str], + var2: Union[FilterExpression, str], + nodelist_true: Union[List[Any], NodeList], + nodelist_false: Union[List[Any], NodeList], + negate: bool, + ) -> None: ... + +class IfNode(Node): + conditions_nodelists: List[Tuple[Optional[TemplateLiteral], NodeList]] = ... + def __init__(self, conditions_nodelists: List[Tuple[Optional[TemplateLiteral], NodeList]]) -> None: ... + def __iter__(self) -> None: ... + @property + def nodelist(self) -> NodeList: ... + +class LoremNode(Node): + common: bool + count: FilterExpression + method: str + def __init__(self, count: FilterExpression, method: str, common: bool) -> None: ... + +GroupedResult = namedtuple("GroupedResult", ["grouper", "list"]) + +class RegroupNode(Node): + expression: FilterExpression + target: FilterExpression + var_name: str = ... + def __init__(self, target: FilterExpression, expression: FilterExpression, var_name: str) -> None: ... + def resolve_expression(self, obj: Dict[str, date], context: Context) -> Union[int, str]: ... + +class LoadNode(Node): ... + +class NowNode(Node): + format_string: str = ... + asvar: Optional[str] = ... + def __init__(self, format_string: str, asvar: Optional[str] = ...) -> None: ... + +class ResetCycleNode(Node): + node: CycleNode = ... + def __init__(self, node: CycleNode) -> None: ... + +class SpacelessNode(Node): + nodelist: NodeList = ... + def __init__(self, nodelist: NodeList) -> None: ... + +class TemplateTagNode(Node): + mapping: Any = ... + tagtype: str = ... + def __init__(self, tagtype: str) -> None: ... + +class URLNode(Node): + view_name: FilterExpression = ... + args: List[FilterExpression] = ... + kwargs: Dict[str, FilterExpression] = ... + asvar: Optional[str] = ... + def __init__( + self, + view_name: FilterExpression, + args: List[FilterExpression], + kwargs: Dict[str, FilterExpression], + asvar: Optional[str], + ) -> None: ... + +class VerbatimNode(Node): + content: SafeText = ... + def __init__(self, content: SafeText) -> None: ... + +class WidthRatioNode(Node): + val_expr: FilterExpression = ... + max_expr: FilterExpression = ... + max_width: FilterExpression = ... + asvar: Optional[str] = ... + def __init__( + self, + val_expr: FilterExpression, + max_expr: FilterExpression, + max_width: FilterExpression, + asvar: Optional[str] = ..., + ) -> None: ... + +class WithNode(Node): + nodelist: NodeList = ... + extra_context: Dict[str, Any] = ... + def __init__( + self, + var: Optional[str], + name: Optional[str], + nodelist: Union[NodeList, Sequence[Node]], + extra_context: Optional[Dict[str, Any]] = ..., + ) -> None: ... + +def autoescape(parser: Parser, token: Token) -> AutoEscapeControlNode: ... +def comment(parser: Parser, token: Token) -> CommentNode: ... +def cycle(parser: Parser, token: Token) -> CycleNode: ... +def csrf_token(parser: Parser, token: Token) -> CsrfTokenNode: ... +def debug(parser: Parser, token: Token) -> DebugNode: ... +def do_filter(parser: Parser, token: Token) -> FilterNode: ... +def firstof(parser: Parser, token: Token) -> FirstOfNode: ... +def do_for(parser: Parser, token: Token) -> ForNode: ... +def do_ifequal(parser: Parser, token: Token, negate: bool) -> IfEqualNode: ... +def ifequal(parser: Parser, token: Token) -> IfEqualNode: ... +def ifnotequal(parser: Parser, token: Token) -> IfEqualNode: ... + +class TemplateLiteral(Literal): + text: str = ... + def __init__(self, value: FilterExpression, text: str) -> None: ... + def display(self) -> str: ... + +class TemplateIfParser(IfParser): + current_token: TemplateLiteral + pos: int + tokens: List[TemplateLiteral] + error_class: Any = ... + template_parser: Parser = ... + def __init__(self, parser: Parser, *args: Any, **kwargs: Any) -> None: ... + +def do_if(parser: Parser, token: Token) -> IfNode: ... +def ifchanged(parser: Parser, token: Token) -> IfChangedNode: ... +def find_library(parser: Parser, name: str) -> Library: ... +def load_from_library(library: Library, label: str, names: List[str]) -> Library: ... +def load(parser: Parser, token: Token) -> LoadNode: ... +def lorem(parser: Parser, token: Token) -> LoremNode: ... +def now(parser: Parser, token: Token) -> NowNode: ... +def regroup(parser: Parser, token: Token) -> RegroupNode: ... +def resetcycle(parser: Parser, token: Token) -> ResetCycleNode: ... +def spaceless(parser: Parser, token: Token) -> SpacelessNode: ... +def templatetag(parser: Parser, token: Token) -> TemplateTagNode: ... +def url(parser: Parser, token: Token) -> URLNode: ... +def verbatim(parser: Parser, token: Token) -> VerbatimNode: ... +def widthratio(parser: Parser, token: Token) -> WidthRatioNode: ... +def do_with(parser: Parser, token: Token) -> WithNode: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/engine.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/engine.pyi new file mode 100644 index 00000000..edd8c9a2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/engine.pyi @@ -0,0 +1,53 @@ +from typing import Any, Callable, Dict, List, Optional, Tuple, Union, Sequence + +from django.template.base import Origin +from django.template.library import Library +from django.template.loaders.base import Loader +from django.utils.safestring import SafeText + +from .base import Template + +_Loader = Any + +class Engine: + template_context_processors: Tuple[Callable] + template_loaders: List[Loader] + default_builtins: Any = ... + dirs: List[str] = ... + app_dirs: bool = ... + autoescape: bool = ... + context_processors: Union[List[str], Tuple[str]] = ... + debug: bool = ... + loaders: Sequence[_Loader] = ... + string_if_invalid: str = ... + file_charset: str = ... + libraries: Dict[str, str] = ... + template_libraries: Dict[str, Library] = ... + builtins: List[str] = ... + template_builtins: List[Library] = ... + def __init__( + self, + dirs: Optional[List[str]] = ..., + app_dirs: bool = ..., + context_processors: Optional[Union[List[str], Tuple[str]]] = ..., + debug: bool = ..., + loaders: Optional[Sequence[_Loader]] = ..., + string_if_invalid: str = ..., + file_charset: str = ..., + libraries: Optional[Dict[str, str]] = ..., + builtins: Optional[List[str]] = ..., + autoescape: bool = ..., + ) -> None: ... + @staticmethod + def get_default() -> Engine: ... + def get_template_builtins(self, builtins: List[str]) -> List[Library]: ... + def get_template_libraries(self, libraries: Dict[str, str]) -> Dict[str, Library]: ... + def get_template_loaders(self, template_loaders: Sequence[_Loader]) -> List[Loader]: ... + def find_template_loader(self, loader: _Loader) -> Loader: ... + def find_template( + self, name: str, dirs: None = ..., skip: Optional[List[Origin]] = ... + ) -> Tuple[Template, Origin]: ... + def from_string(self, template_code: str) -> Template: ... + def get_template(self, template_name: str) -> Template: ... + def render_to_string(self, template_name: str, context: Optional[Dict[str, Any]] = ...) -> SafeText: ... + def select_template(self, template_name_list: List[str]) -> Template: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/exceptions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/exceptions.pyi new file mode 100644 index 00000000..c16758a1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/exceptions.pyi @@ -0,0 +1,18 @@ +from typing import List, Optional, Tuple, Union + +from django.template.backends.base import BaseEngine +from django.template.base import Origin + +class TemplateDoesNotExist(Exception): + backend: Optional[BaseEngine] = ... + tried: List[Tuple[Origin, str]] = ... + chain: List[TemplateDoesNotExist] = ... + def __init__( + self, + msg: Union[Origin, str], + tried: Optional[List[Tuple[Origin, str]]] = ..., + backend: Optional[BaseEngine] = ..., + chain: Optional[List[TemplateDoesNotExist]] = ..., + ) -> None: ... + +class TemplateSyntaxError(Exception): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/library.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/library.pyi new file mode 100644 index 00000000..dca59e27 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/library.pyi @@ -0,0 +1,97 @@ +from typing import Any, Callable, Dict, List, Optional, Tuple, Union + +from django.template.base import FilterExpression, Parser, Origin, Token +from django.template.context import Context +from django.utils.safestring import SafeText + +from .base import Node, Template + +class InvalidTemplateLibrary(Exception): ... + +class Library: + filters: Dict[str, Callable] = ... + tags: Dict[str, Callable] = ... + def __init__(self) -> None: ... + def tag( + self, name: Optional[Union[Callable, str]] = ..., compile_function: Optional[Union[Callable, str]] = ... + ) -> Callable: ... + def tag_function(self, func: Callable) -> Callable: ... + def filter( + self, + name: Optional[Union[Callable, str]] = ..., + filter_func: Optional[Union[Callable, str]] = ..., + **flags: Any + ) -> Callable: ... + def filter_function(self, func: Callable, **flags: Any) -> Callable: ... + def simple_tag( + self, func: Optional[Union[Callable, str]] = ..., takes_context: Optional[bool] = ..., name: Optional[str] = ... + ) -> Callable: ... + def inclusion_tag( + self, + filename: Union[Template, str], + func: None = ..., + takes_context: Optional[bool] = ..., + name: Optional[str] = ..., + ) -> Callable: ... + +class TagHelperNode(Node): + func: Any = ... + takes_context: Any = ... + args: Any = ... + kwargs: Any = ... + def __init__( + self, + func: Callable, + takes_context: Optional[bool], + args: List[FilterExpression], + kwargs: Dict[str, FilterExpression], + ) -> None: ... + def get_resolved_arguments(self, context: Context) -> Tuple[List[int], Dict[str, Union[SafeText, int]]]: ... + +class SimpleNode(TagHelperNode): + args: List[FilterExpression] + func: Callable + kwargs: Dict[str, FilterExpression] + origin: Origin + takes_context: Optional[bool] + token: Token + target_var: Optional[str] = ... + def __init__( + self, + func: Callable, + takes_context: Optional[bool], + args: List[FilterExpression], + kwargs: Dict[str, FilterExpression], + target_var: Optional[str], + ) -> None: ... + +class InclusionNode(TagHelperNode): + args: List[FilterExpression] + func: Callable + kwargs: Dict[str, FilterExpression] + origin: Origin + takes_context: Optional[bool] + token: Token + filename: Union[Template, str] = ... + def __init__( + self, + func: Callable, + takes_context: Optional[bool], + args: List[FilterExpression], + kwargs: Dict[str, FilterExpression], + filename: Optional[Union[Template, str]], + ) -> None: ... + +def parse_bits( + parser: Parser, + bits: List[str], + params: List[str], + varargs: Optional[str], + varkw: Optional[str], + defaults: Optional[Tuple[Union[bool, str]]], + kwonly: List[str], + kwonly_defaults: Optional[Dict[str, int]], + takes_context: Optional[bool], + name: str, +) -> Tuple[List[FilterExpression], Dict[str, FilterExpression]]: ... +def import_library(name: str) -> Library: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loader.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loader.pyi new file mode 100644 index 00000000..0cd3214a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loader.pyi @@ -0,0 +1,14 @@ +from typing import Any, Dict, List, Optional, Union +from . import engines as engines # noqa: F401 + +from django.http.request import HttpRequest +from django.template.exceptions import TemplateDoesNotExist as TemplateDoesNotExist # noqa: F401 + +def get_template(template_name: str, using: Optional[str] = ...) -> Any: ... +def select_template(template_name_list: Union[List[str], str], using: Optional[str] = ...) -> Any: ... +def render_to_string( + template_name: Union[List[str], str], + context: Optional[Dict[str, Any]] = ..., + request: Optional[HttpRequest] = ..., + using: Optional[str] = ..., +) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loader_tags.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loader_tags.pyi new file mode 100644 index 00000000..3a359363 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loader_tags.pyi @@ -0,0 +1,68 @@ +import collections +from typing import Any, Dict, List, Optional, Union + +from django.template.base import FilterExpression, NodeList, Parser, Token, Origin +from django.template.context import Context +from django.utils.safestring import SafeText + +from .base import Node, Template + +register: Any +BLOCK_CONTEXT_KEY: str + +class BlockContext: + blocks: collections.defaultdict = ... + def __init__(self) -> None: ... + def add_blocks(self, blocks: Dict[str, BlockNode]) -> None: ... + def pop(self, name: str) -> BlockNode: ... + def push(self, name: str, block: BlockNode) -> None: ... + def get_block(self, name: str) -> BlockNode: ... + +class BlockNode(Node): + context: Context + name: str + nodelist: NodeList + origin: Origin + parent: None + token: Token + def __init__(self, name: str, nodelist: NodeList, parent: None = ...) -> None: ... + def render(self, context: Context) -> SafeText: ... + def super(self) -> SafeText: ... + +class ExtendsNode(Node): + origin: Origin + token: Token + must_be_first: bool = ... + context_key: str = ... + nodelist: NodeList = ... + parent_name: Union[FilterExpression, Node] = ... + template_dirs: Optional[List[Any]] = ... + blocks: Dict[str, BlockNode] = ... + def __init__( + self, nodelist: NodeList, parent_name: Union[FilterExpression, Node], template_dirs: Optional[List[Any]] = ... + ) -> None: ... + def find_template(self, template_name: str, context: Context) -> Template: ... + def get_parent(self, context: Context) -> Template: ... + def render(self, context: Context) -> Any: ... + +class IncludeNode(Node): + origin: Origin + token: Token + context_key: str = ... + template: FilterExpression = ... + extra_context: Dict[str, FilterExpression] = ... + isolated_context: bool = ... + def __init__( + self, + template: FilterExpression, + *args: Any, + extra_context: Optional[Any] = ..., + isolated_context: bool = ..., + **kwargs: Any + ) -> None: ... + def render(self, context: Context) -> SafeText: ... + +def do_block(parser: Parser, token: Token) -> BlockNode: ... +def construct_relative_path(current_template_name: Optional[str], relative_name: str) -> str: ... +def do_extends(parser: Parser, token: Token) -> ExtendsNode: ... +def do_include(parser: Parser, token: Token) -> IncludeNode: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loaders/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loaders/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loaders/app_directories.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loaders/app_directories.pyi new file mode 100644 index 00000000..a1c59b92 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loaders/app_directories.pyi @@ -0,0 +1,3 @@ +from .filesystem import Loader as FilesystemLoader + +class Loader(FilesystemLoader): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loaders/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loaders/base.pyi new file mode 100644 index 00000000..817b4560 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loaders/base.pyi @@ -0,0 +1,12 @@ +from typing import Any, List, Optional, Dict + +from django.template.base import Origin, Template +from django.template.engine import Engine + +class Loader: + engine: Engine = ... + get_template_cache: Dict[str, Any] = ... + def __init__(self, engine: Engine) -> None: ... + def get_template(self, template_name: str, skip: Optional[List[Origin]] = ...) -> Template: ... + def get_template_sources(self, template_name: str) -> None: ... + def reset(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loaders/cached.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loaders/cached.pyi new file mode 100644 index 00000000..956e9dc0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loaders/cached.pyi @@ -0,0 +1,14 @@ +from typing import Any, Dict, List, Optional, Sequence + +from django.template.base import Origin +from django.template.engine import Engine + +from .base import Loader as BaseLoader + +class Loader(BaseLoader): + template_cache: Dict[str, Any] = ... + loaders: List[BaseLoader] = ... + def __init__(self, engine: Engine, loaders: Sequence[Any]) -> None: ... + def get_contents(self, origin: Origin) -> str: ... + def cache_key(self, template_name: str, skip: Optional[List[Origin]] = ...) -> str: ... + def generate_hash(self, values: List[str]) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loaders/filesystem.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loaders/filesystem.pyi new file mode 100644 index 00000000..4334186d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loaders/filesystem.pyi @@ -0,0 +1,12 @@ +from typing import Any, List, Optional, Union + +from django.template.base import Origin +from django.template.engine import Engine + +from .base import Loader as BaseLoader + +class Loader(BaseLoader): + dirs: Optional[List[str]] = ... + def __init__(self, engine: Engine, dirs: Optional[List[str]] = ...) -> None: ... + def get_dirs(self) -> Union[List[bytes], List[str]]: ... + def get_contents(self, origin: Origin) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loaders/locmem.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loaders/locmem.pyi new file mode 100644 index 00000000..ddeb87af --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/loaders/locmem.pyi @@ -0,0 +1,11 @@ +from typing import Dict + +from django.template.base import Origin +from django.template.engine import Engine + +from .base import Loader as BaseLoader + +class Loader(BaseLoader): + templates_dict: Dict[str, str] = ... + def __init__(self, engine: Engine, templates_dict: Dict[str, str]) -> None: ... + def get_contents(self, origin: Origin) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/response.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/response.pyi new file mode 100644 index 00000000..02005a0b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/response.pyi @@ -0,0 +1,68 @@ +import functools +from http.cookies import SimpleCookie +from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union + +from django.core.handlers.wsgi import WSGIRequest +from django.http.request import HttpRequest +from django.template.base import Template +from django.template.context import RequestContext +from django.test.client import Client + +from django.http import HttpResponse + +class ContentNotRenderedError(Exception): ... + +class SimpleTemplateResponse(HttpResponse): + content: Any = ... + closed: bool + cookies: SimpleCookie + status_code: int + rendering_attrs: Any = ... + template_name: Union[List[str], Template, str] = ... + context_data: Optional[Dict[str, Any]] = ... + using: Optional[str] = ... + def __init__( + self, + template: Union[List[str], Template, str], + context: Optional[Dict[str, Any]] = ..., + content_type: Optional[str] = ..., + status: Optional[int] = ..., + charset: Optional[str] = ..., + using: Optional[str] = ..., + ) -> None: ... + def resolve_template(self, template: Union[Sequence[str], Template, str]) -> Template: ... + def resolve_context(self, context: Optional[Dict[str, Any]]) -> Optional[Dict[str, Any]]: ... + @property + def rendered_content(self) -> str: ... + def add_post_render_callback(self, callback: Callable) -> None: ... + def render(self) -> SimpleTemplateResponse: ... + @property + def is_rendered(self) -> bool: ... + def __iter__(self) -> Any: ... + +class TemplateResponse(SimpleTemplateResponse): + client: Client + closed: bool + context: RequestContext + context_data: Optional[Dict[str, Any]] + cookies: SimpleCookie + csrf_cookie_set: bool + json: functools.partial + redirect_chain: List[Tuple[str, int]] + request: Dict[str, Union[int, str]] + status_code: int + template_name: Union[List[str], Template, str] + templates: List[Template] + using: Optional[str] + wsgi_request: WSGIRequest + rendering_attrs: Any = ... + def __init__( + self, + request: HttpRequest, + template: Union[List[str], Template, str], + context: Optional[Dict[str, Any]] = ..., + content_type: Optional[str] = ..., + status: Optional[int] = ..., + charset: None = ..., + using: Optional[str] = ..., + ) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/smartif.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/smartif.pyi new file mode 100644 index 00000000..a60d2fa3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/smartif.pyi @@ -0,0 +1,43 @@ +from typing import Any, Dict, List, Optional, Union + +from django.template.defaulttags import TemplateLiteral + +_Token = Union[List[int], int, str] + +class TokenBase: + id: Any = ... + value: Any = ... + first: Any = ... + second: Any = ... + def nud(self, parser: Any) -> None: ... + def led(self, left: Any, parser: Any) -> None: ... + def display(self): ... + +def infix(bp: Any, func: Any): ... +def prefix(bp: Any, func: Any): ... + +OPERATORS: Any + +class Literal(TokenBase): + id: str = ... + lbp: int = ... + value: Optional[_Token] = ... + def __init__(self, value: Optional[_Token]) -> None: ... + def display(self): ... + def eval(self, context: Dict[Any, Any]) -> Optional[_Token]: ... + +class EndToken(TokenBase): + lbp: int = ... + def nud(self, parser: Any) -> None: ... + +class IfParser: + error_class: Any = ... + tokens: Any = ... + pos: int = ... + current_token: Any = ... + def __init__(self, tokens: List[Optional[_Token]]) -> None: ... + def translate_token(self, token: Optional[_Token]) -> Literal: ... + def next_token(self) -> Literal: ... + def parse(self) -> TemplateLiteral: ... + def expression(self, rbp: int = ...) -> Literal: ... + def create_var(self, value: Optional[_Token]) -> Literal: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/utils.pyi new file mode 100644 index 00000000..f7e456a2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/template/utils.pyi @@ -0,0 +1,16 @@ +import collections +from typing import Any, Dict, List, Tuple + +from django.core.exceptions import ImproperlyConfigured +from django.template.backends.base import BaseEngine + +class InvalidTemplateEngineError(ImproperlyConfigured): ... + +class EngineHandler: + templates: collections.OrderedDict + def __init__(self, templates: List[Dict[str, Any]] = ...) -> None: ... + def __getitem__(self, alias: str) -> BaseEngine: ... + def __iter__(self) -> Any: ... + def all(self) -> List[BaseEngine]: ... + +def get_app_template_dirs(dirname: str) -> Tuple: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/templatetags/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/templatetags/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/templatetags/cache.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/templatetags/cache.pyi new file mode 100644 index 00000000..2f8d1f6d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/templatetags/cache.pyi @@ -0,0 +1,24 @@ +from typing import Any, List, Optional + +from django.template.base import FilterExpression, NodeList, Parser, Token + +from django.template import Node + +register: Any + +class CacheNode(Node): + nodelist: NodeList = ... + expire_time_var: FilterExpression = ... + fragment_name: str = ... + vary_on: List[FilterExpression] = ... + cache_name: Optional[FilterExpression] = ... + def __init__( + self, + nodelist: NodeList, + expire_time_var: FilterExpression, + fragment_name: str, + vary_on: List[FilterExpression], + cache_name: Optional[FilterExpression], + ) -> None: ... + +def do_cache(parser: Parser, token: Token) -> CacheNode: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/templatetags/i18n.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/templatetags/i18n.pyi new file mode 100644 index 00000000..a32fd8fb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/templatetags/i18n.pyi @@ -0,0 +1,83 @@ +from typing import Any, Dict, List, Optional, Tuple + +from django.template.base import FilterExpression, NodeList, Parser, Token + +from django.template import Node + +register: Any + +class GetAvailableLanguagesNode(Node): + variable: str = ... + def __init__(self, variable: str) -> None: ... + +class GetLanguageInfoNode(Node): + lang_code: FilterExpression = ... + variable: str = ... + def __init__(self, lang_code: FilterExpression, variable: str) -> None: ... + +class GetLanguageInfoListNode(Node): + languages: FilterExpression = ... + variable: str = ... + def __init__(self, languages: FilterExpression, variable: str) -> None: ... + def get_language_info(self, language: Any): ... + +class GetCurrentLanguageNode(Node): + variable: str = ... + def __init__(self, variable: str) -> None: ... + +class GetCurrentLanguageBidiNode(Node): + variable: str = ... + def __init__(self, variable: str) -> None: ... + +class TranslateNode(Node): + noop: bool = ... + asvar: Optional[str] = ... + message_context: Optional[FilterExpression] = ... + filter_expression: FilterExpression = ... + def __init__( + self, + filter_expression: FilterExpression, + noop: bool, + asvar: Optional[str] = ..., + message_context: Optional[FilterExpression] = ..., + ) -> None: ... + +class BlockTranslateNode(Node): + extra_context: Dict[str, FilterExpression] = ... + singular: List[Token] = ... + plural: List[Token] = ... + countervar: Optional[str] = ... + counter: Optional[FilterExpression] = ... + message_context: Optional[FilterExpression] = ... + trimmed: bool = ... + asvar: Optional[str] = ... + def __init__( + self, + extra_context: Dict[str, FilterExpression], + singular: List[Token], + plural: List[Token] = ..., + countervar: Optional[str] = ..., + counter: Optional[FilterExpression] = ..., + message_context: Optional[FilterExpression] = ..., + trimmed: bool = ..., + asvar: Optional[str] = ..., + ) -> None: ... + def render_token_list(self, tokens: List[Token]) -> Tuple[str, List[str]]: ... + +class LanguageNode(Node): + nodelist: NodeList = ... + language: FilterExpression = ... + def __init__(self, nodelist: NodeList, language: FilterExpression) -> None: ... + +def do_get_available_languages(parser: Parser, token: Token) -> GetAvailableLanguagesNode: ... +def do_get_language_info(parser: Parser, token: Token) -> GetLanguageInfoNode: ... +def do_get_language_info_list(parser: Parser, token: Token) -> GetLanguageInfoListNode: ... +def language_name(lang_code: str) -> str: ... +def language_name_translated(lang_code: str) -> str: ... +def language_name_local(lang_code: str) -> str: ... +def language_bidi(lang_code: str) -> bool: ... +def do_get_current_language(parser: Parser, token: Token) -> GetCurrentLanguageNode: ... +def do_get_current_language_bidi(parser: Parser, token: Token) -> GetCurrentLanguageBidiNode: ... +def do_translate(parser: Parser, token: Token) -> TranslateNode: ... +def do_block_translate(parser: Parser, token: Token) -> BlockTranslateNode: ... +def language(parser: Parser, token: Token) -> LanguageNode: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/templatetags/l10n.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/templatetags/l10n.pyi new file mode 100644 index 00000000..03c45bb6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/templatetags/l10n.pyi @@ -0,0 +1,17 @@ +from typing import Any, List + +from django.template.base import Parser, Token + +from django.template import Node + +register: Any + +def localize(value: Any) -> str: ... +def unlocalize(value: Any) -> str: ... + +class LocalizeNode(Node): + nodelist: List[Node] = ... + use_l10n: bool = ... + def __init__(self, nodelist: List[Node], use_l10n: bool) -> None: ... + +def localize_tag(parser: Parser, token: Token) -> LocalizeNode: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/templatetags/static.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/templatetags/static.pyi new file mode 100644 index 00000000..db254c7a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/templatetags/static.pyi @@ -0,0 +1,33 @@ +from typing import Any, Optional + +from django.template.base import FilterExpression, Parser, Token +from django.template.context import Context + +from django import template + +register: Any + +class PrefixNode(template.Node): + varname: Optional[str] = ... + name: str = ... + def __init__(self, varname: Optional[str] = ..., name: str = ...) -> None: ... + @classmethod + def handle_token(cls, parser: Parser, token: Token, name: str) -> PrefixNode: ... + @classmethod + def handle_simple(cls, name: str) -> str: ... + +def get_static_prefix(parser: Parser, token: Token) -> PrefixNode: ... +def get_media_prefix(parser: Parser, token: Token) -> PrefixNode: ... + +class StaticNode(template.Node): + path: FilterExpression = ... + varname: Optional[str] = ... + def __init__(self, varname: Optional[str] = ..., path: FilterExpression = ...) -> None: ... + def url(self, context: Context) -> str: ... + @classmethod + def handle_simple(cls, path: str) -> str: ... + @classmethod + def handle_token(cls, parser: Parser, token: Token) -> StaticNode: ... + +def do_static(parser: Parser, token: Token) -> StaticNode: ... +def static(path: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/templatetags/tz.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/templatetags/tz.pyi new file mode 100644 index 00000000..7719adb1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/templatetags/tz.pyi @@ -0,0 +1,33 @@ +from datetime import datetime +from typing import Any, Optional, Union + +from django.template.base import FilterExpression, NodeList, Parser, Token +from django.utils.timezone import FixedOffset + +from django.template import Node + +register: Any + +class datetimeobject(datetime): ... + +def localtime(value: Optional[Union[datetime, str]]) -> Any: ... +def utc(value: Optional[Union[datetime, str]]) -> Any: ... +def do_timezone(value: Optional[Union[datetime, str]], arg: Optional[Union[FixedOffset, str]]) -> Any: ... + +class LocalTimeNode(Node): + nodelist: NodeList = ... + use_tz: bool = ... + def __init__(self, nodelist: NodeList, use_tz: bool) -> None: ... + +class TimezoneNode(Node): + nodelist: NodeList = ... + tz: FilterExpression = ... + def __init__(self, nodelist: NodeList, tz: FilterExpression) -> None: ... + +class GetCurrentTimezoneNode(Node): + variable: str = ... + def __init__(self, variable: str) -> None: ... + +def localtime_tag(parser: Parser, token: Token) -> LocalTimeNode: ... +def timezone_tag(parser: Parser, token: Token) -> TimezoneNode: ... +def get_current_timezone_tag(parser: Parser, token: Token) -> GetCurrentTimezoneNode: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/__init__.pyi new file mode 100644 index 00000000..e2f43713 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/__init__.pyi @@ -0,0 +1,20 @@ +from .testcases import ( + TestCase as TestCase, + TransactionTestCase as TransactionTestCase, + SimpleTestCase as SimpleTestCase, + LiveServerTestCase as LiveServerTestCase, + skipIfDBFeature as skipIfDBFeature, + skipUnlessDBFeature as skipUnlessDBFeature, + skipUnlessAnyDBFeature as skipUnlessAnyDBFeature, +) + +from .utils import ( + override_settings as override_settings, + modify_settings as modify_settings, + override_script_prefix as override_script_prefix, + override_system_checks as override_system_checks, + ignore_warnings as ignore_warnings, + tag as tag, +) + +from .client import Client as Client, RequestFactory as RequestFactory diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/client.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/client.pyi new file mode 100644 index 00000000..ece73fed --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/client.pyi @@ -0,0 +1,132 @@ +from io import BytesIO +from types import TracebackType +from typing import Any, Dict, List, Optional, Pattern, Tuple, Type, Union + +from django.contrib.auth.models import AbstractUser +from django.contrib.sessions.backends.base import SessionBase +from django.core.handlers.base import BaseHandler +from django.http.cookie import SimpleCookie +from django.http.request import HttpRequest +from django.http.response import HttpResponse, HttpResponseBase + +from django.core.handlers.wsgi import WSGIRequest +from json import JSONEncoder + +BOUNDARY: str = ... +MULTIPART_CONTENT: str = ... +CONTENT_TYPE_RE: Pattern = ... +JSON_CONTENT_TYPE_RE: Pattern = ... + +class RedirectCycleError(Exception): + last_response: HttpResponseBase = ... + redirect_chain: List[Tuple[str, int]] = ... + def __init__(self, message: str, last_response: HttpResponseBase) -> None: ... + +class FakePayload: + read_started: bool = ... + def __init__(self, content: Optional[Union[bytes, str]] = ...) -> None: ... + def __len__(self) -> int: ... + def read(self, num_bytes: int = ...) -> bytes: ... + def write(self, content: Union[bytes, str]) -> None: ... + +class ClientHandler(BaseHandler): + enforce_csrf_checks: bool = ... + def __init__(self, enforce_csrf_checks: bool = ..., *args: Any, **kwargs: Any) -> None: ... + def __call__(self, environ: Dict[str, Any]) -> HttpResponseBase: ... + +def encode_multipart(boundary: str, data: Dict[str, Any]) -> bytes: ... +def encode_file(boundary: str, key: str, file: Any) -> List[bytes]: ... + +class RequestFactory: + json_encoder: Type[JSONEncoder] + defaults: Dict[str, str] + cookies: SimpleCookie + errors: BytesIO + def __init__(self, *, json_encoder: Type[JSONEncoder] = ..., **defaults: Any) -> None: ... + def request(self, **request: Any) -> WSGIRequest: ... + def get(self, path: str, data: Any = ..., secure: bool = ..., **extra: Any) -> WSGIRequest: ... + def post( + self, path: str, data: Any = ..., content_type: str = ..., secure: bool = ..., **extra: Any + ) -> WSGIRequest: ... + def head(self, path: str, data: Any = ..., secure: bool = ..., **extra: Any) -> WSGIRequest: ... + def trace(self, path: str, secure: bool = ..., **extra: Any) -> WSGIRequest: ... + def options( + self, + path: str, + data: Union[Dict[str, str], str] = ..., + content_type: str = ..., + follow: bool = ..., + secure: bool = ..., + **extra: Any + ) -> WSGIRequest: ... + def put( + self, path: str, data: Any = ..., content_type: str = ..., secure: bool = ..., **extra: Any + ) -> WSGIRequest: ... + def patch( + self, path: str, data: Any = ..., content_type: str = ..., secure: bool = ..., **extra: Any + ) -> WSGIRequest: ... + def delete( + self, path: str, data: Any = ..., content_type: str = ..., secure: bool = ..., **extra: Any + ) -> WSGIRequest: ... + def generic( + self, + method: str, + path: str, + data: Any = ..., + content_type: Optional[str] = ..., + secure: bool = ..., + **extra: Any + ) -> WSGIRequest: ... + +class Client(RequestFactory): + handler: ClientHandler + raise_request_exception: bool + exc_info: Optional[Tuple[Type[BaseException], BaseException, TracebackType]] + def __init__( + self, + enforce_csrf_checks: bool = ..., + raise_request_exception: bool = ..., + *, + json_encoder: Type[JSONEncoder] = ..., + **defaults: Any + ) -> None: ... + # Silence type warnings, since this class overrides arguments and return types in an unsafe manner. + def request(self, **request: Any) -> HttpResponse: ... # type: ignore + def get( # type: ignore + self, path: str, data: Any = ..., follow: bool = ..., secure: bool = ..., **extra: Any + ) -> HttpResponse: ... # type: ignore + def post( # type: ignore + self, path: str, data: Any = ..., content_type: str = ..., follow: bool = ..., secure: bool = ..., **extra: Any + ) -> HttpResponse: ... # type: ignore + def head( # type: ignore + self, path: str, data: Any = ..., follow: bool = ..., secure: bool = ..., **extra: Any + ) -> HttpResponse: ... # type: ignore + def trace( # type: ignore + self, path: str, follow: bool = ..., secure: bool = ..., **extra: Any + ) -> HttpResponse: ... # type: ignore + def options( # type: ignore + self, + path: str, + data: Union[Dict[str, str], str] = ..., + content_type: str = ..., + follow: bool = ..., + secure: bool = ..., + **extra: Any + ) -> HttpResponse: ... # type: ignore + def put( # type: ignore + self, path: str, data: Any = ..., content_type: str = ..., follow: bool = ..., secure: bool = ..., **extra: Any + ) -> HttpResponse: ... # type: ignore + def patch( # type: ignore + self, path: str, data: Any = ..., content_type: str = ..., follow: bool = ..., secure: bool = ..., **extra: Any + ) -> HttpResponse: ... # type: ignore + def delete( # type: ignore + self, path: str, data: Any = ..., content_type: str = ..., follow: bool = ..., secure: bool = ..., **extra: Any + ) -> HttpResponse: ... # type: ignore + def store_exc_info(self, **kwargs: Any) -> None: ... + @property + def session(self) -> SessionBase: ... + def login(self, **credentials: Any) -> bool: ... + def force_login(self, user: AbstractUser, backend: Optional[str] = ...) -> None: ... + def logout(self) -> None: ... + +def conditional_content_removal(request: HttpRequest, response: HttpResponseBase) -> HttpResponse: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/html.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/html.pyi new file mode 100644 index 00000000..67d69f85 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/html.pyi @@ -0,0 +1,38 @@ +from html.parser import HTMLParser +from typing import Any, List, Optional, Sequence, Tuple, TypeVar, Union + +_Self = TypeVar("_Self") + +WHITESPACE: Any + +def normalize_whitespace(string: str) -> str: ... + +_ElementAttribute = Tuple[str, Optional[str]] + +class Element: + name: Optional[str] = ... + attributes: List[_ElementAttribute] = ... + children: List[Any] = ... + def __init__(self, name: Optional[str], attributes: Sequence[_ElementAttribute]) -> None: ... + def append(self, element: Union[Element, str]) -> None: ... + def finalize(self) -> None: ... + def __contains__(self, element: Union[Element, str]) -> bool: ... + def count(self, element: Union[Element, str]) -> int: ... + def __getitem__(self, key: int) -> Any: ... + +class RootElement(Element): + def __init__(self) -> None: ... + +class HTMLParseError(Exception): ... + +class Parser(HTMLParser): + SELF_CLOSING_TAGS: Any = ... + root: Any = ... + open_tags: Any = ... + element_positions: Any = ... + def __init__(self) -> None: ... + def format_position(self, position: Any = ..., element: Any = ...) -> str: ... + @property + def current(self) -> Element: ... + +def parse_html(html: str) -> Element: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/runner.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/runner.pyi new file mode 100644 index 00000000..2d6042ad --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/runner.pyi @@ -0,0 +1,133 @@ +import logging +from argparse import ArgumentParser +from io import StringIO +from typing import Any, Dict, List, Optional, Sequence, Set, Tuple, Type +from unittest import TestCase, TestSuite, TextTestResult + +from django.db.backends.base.base import BaseDatabaseWrapper +from django.test.testcases import SimpleTestCase, TestCase +from django.utils.datastructures import OrderedSet + +class DebugSQLTextTestResult(TextTestResult): + buffer: bool + descriptions: bool + dots: bool + expectedFailures: List[Any] + failfast: bool + shouldStop: bool + showAll: bool + skipped: List[Any] + tb_locals: bool + testsRun: int + unexpectedSuccesses: List[Any] + logger: logging.Logger = ... + def __init__(self, stream: Any, descriptions: bool, verbosity: int) -> None: ... + debug_sql_stream: StringIO = ... + handler: logging.StreamHandler = ... + def startTest(self, test: TestCase) -> None: ... + def stopTest(self, test: TestCase) -> None: ... + def addError(self, test: Any, err: Any) -> None: ... + def addFailure(self, test: Any, err: Any) -> None: ... + +class RemoteTestResult: + events: List[Any] = ... + failfast: bool = ... + shouldStop: bool = ... + testsRun: int = ... + def __init__(self) -> None: ... + @property + def test_index(self): ... + def check_picklable(self, test: Any, err: Any) -> None: ... + def _confirm_picklable(self, obj: Any) -> None: ... + def check_subtest_picklable(self, test: Any, subtest: Any) -> None: ... + def stop_if_failfast(self) -> None: ... + def stop(self) -> None: ... + def startTestRun(self) -> None: ... + def stopTestRun(self) -> None: ... + def startTest(self, test: Any) -> None: ... + def stopTest(self, test: Any) -> None: ... + def addError(self, test: Any, err: Any) -> None: ... + def addFailure(self, test: Any, err: Any) -> None: ... + def addSubTest(self, test: Any, subtest: Any, err: Any) -> None: ... + def addSuccess(self, test: Any) -> None: ... + def addSkip(self, test: Any, reason: Any) -> None: ... + def addExpectedFailure(self, test: Any, err: Any) -> None: ... + def addUnexpectedSuccess(self, test: Any) -> None: ... + +class RemoteTestRunner: + resultclass: Any = ... + failfast: Any = ... + def __init__(self, failfast: bool = ..., resultclass: Optional[Any] = ...) -> None: ... + def run(self, test: Any): ... + +def default_test_processes() -> int: ... + +class ParallelTestSuite(TestSuite): + init_worker: Any = ... + run_subsuite: Any = ... + runner_class: Any = ... + subsuites: Any = ... + processes: Any = ... + failfast: Any = ... + def __init__(self, suite: Any, processes: Any, failfast: bool = ...) -> None: ... + def run(self, result: Any): ... + +class DiscoverRunner: + test_suite: Any = ... + parallel_test_suite: Any = ... + test_runner: Any = ... + test_loader: Any = ... + reorder_by: Any = ... + pattern: Optional[str] = ... + top_level: None = ... + verbosity: int = ... + interactive: bool = ... + failfast: bool = ... + keepdb: bool = ... + reverse: bool = ... + debug_mode: bool = ... + debug_sql: bool = ... + parallel: int = ... + tags: Set[str] = ... + exclude_tags: Set[str] = ... + def __init__( + self, + pattern: Optional[str] = ..., + top_level: None = ..., + verbosity: int = ..., + interactive: bool = ..., + failfast: bool = ..., + keepdb: bool = ..., + reverse: bool = ..., + debug_mode: bool = ..., + debug_sql: bool = ..., + parallel: int = ..., + tags: Optional[List[str]] = ..., + exclude_tags: Optional[List[str]] = ..., + **kwargs: Any + ) -> None: ... + @classmethod + def add_arguments(cls, parser: ArgumentParser) -> None: ... + def setup_test_environment(self, **kwargs: Any) -> None: ... + def build_suite( + self, test_labels: Sequence[str] = ..., extra_tests: Optional[List[Any]] = ..., **kwargs: Any + ) -> TestSuite: ... + def setup_databases(self, **kwargs: Any) -> List[Tuple[BaseDatabaseWrapper, str, bool]]: ... + def get_resultclass(self) -> Optional[Type[DebugSQLTextTestResult]]: ... + def get_test_runner_kwargs(self) -> Dict[str, Optional[int]]: ... + def run_checks(self) -> None: ... + def run_suite(self, suite: TestSuite, **kwargs: Any) -> TextTestResult: ... + def teardown_databases(self, old_config: List[Tuple[BaseDatabaseWrapper, str, bool]], **kwargs: Any) -> None: ... + def teardown_test_environment(self, **kwargs: Any) -> None: ... + def suite_result(self, suite: TestSuite, result: TextTestResult, **kwargs: Any) -> int: ... + def run_tests(self, test_labels: List[str], extra_tests: List[Any] = ..., **kwargs: Any) -> int: ... + +def is_discoverable(label: str) -> bool: ... +def reorder_suite( + suite: TestSuite, classes: Tuple[Type[TestCase], Type[SimpleTestCase]], reverse: bool = ... +) -> TestSuite: ... +def partition_suite_by_type( + suite: TestSuite, classes: Tuple[Type[TestCase], Type[SimpleTestCase]], bins: List[OrderedSet], reverse: bool = ... +) -> None: ... +def partition_suite_by_case(suite: Any): ... +def filter_tests_by_tags(suite: TestSuite, tags: Set[str], exclude_tags: Set[str]) -> TestSuite: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/selenium.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/selenium.pyi new file mode 100644 index 00000000..bc5f4691 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/selenium.pyi @@ -0,0 +1,14 @@ +from typing import Any + +from django.test import LiveServerTestCase + +class SeleniumTestCaseBase: + browsers: Any = ... + browser: Any = ... + @classmethod + def import_webdriver(cls, browser: Any): ... + def create_webdriver(self): ... + +class SeleniumTestCase(LiveServerTestCase): + implicit_wait: int = ... + def disable_implicit_wait(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/signals.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/signals.pyi new file mode 100644 index 00000000..72c02df5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/signals.pyi @@ -0,0 +1,21 @@ +from typing import Any +from django.core.signals import setting_changed as setting_changed # noqa: F401 + +template_rendered: Any +COMPLEX_OVERRIDE_SETTINGS: Any + +def clear_cache_handlers(**kwargs: Any) -> None: ... +def update_installed_apps(**kwargs: Any) -> None: ... +def update_connections_time_zone(**kwargs: Any) -> None: ... +def clear_routers_cache(**kwargs: Any) -> None: ... +def reset_template_engines(**kwargs: Any) -> None: ... +def clear_serializers_cache(**kwargs: Any) -> None: ... +def language_changed(**kwargs: Any) -> None: ... +def localize_settings_changed(**kwargs: Any) -> None: ... +def file_storage_changed(**kwargs: Any) -> None: ... +def complex_setting_changed(**kwargs: Any) -> None: ... +def root_urlconf_changed(**kwargs: Any) -> None: ... +def static_storage_changed(**kwargs: Any) -> None: ... +def static_finders_changed(**kwargs: Any) -> None: ... +def auth_password_validators_changed(**kwargs: Any) -> None: ... +def user_model_swapped(**kwargs: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/testcases.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/testcases.pyi new file mode 100644 index 00000000..67a565cf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/testcases.pyi @@ -0,0 +1,229 @@ +import threading +import unittest +from datetime import date +from typing import Any, Callable, Dict, Iterator, List, Optional, Set, Tuple, Type, Union, ClassVar, overload + +from django.core.exceptions import ImproperlyConfigured +from django.core.handlers.wsgi import WSGIHandler +from django.core.servers.basehttp import ThreadedWSGIServer, WSGIRequestHandler +from django.db.backends.sqlite3.base import DatabaseWrapper +from django.db.models.base import Model +from django.db.models.query import QuerySet, RawQuerySet +from django.forms.fields import EmailField +from django.http.response import HttpResponse, HttpResponseBase +from django.template.base import Template +from django.test.client import Client +from django.test.utils import CaptureQueriesContext, ContextList +from django.utils.safestring import SafeText +from django.db import connections as connections # noqa: F401 + +class _AssertNumQueriesContext(CaptureQueriesContext): + test_case: SimpleTestCase = ... + num: int = ... + def __init__(self, test_case: Any, num: Any, connection: Any) -> None: ... + +class _AssertTemplateUsedContext: + test_case: SimpleTestCase = ... + template_name: str = ... + rendered_templates: List[Template] = ... + rendered_template_names: List[str] = ... + context: ContextList = ... + def __init__(self, test_case: Any, template_name: Any) -> None: ... + def on_template_render(self, sender: Any, signal: Any, template: Any, context: Any, **kwargs: Any) -> None: ... + def test(self): ... + def message(self): ... + def __enter__(self): ... + def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any): ... + +class _AssertTemplateNotUsedContext(_AssertTemplateUsedContext): ... + +class _CursorFailure: + cls_name: str = ... + wrapped: Callable = ... + def __init__(self, cls_name: Any, wrapped: Any) -> None: ... + def __call__(self) -> None: ... + +class SimpleTestCase(unittest.TestCase): + client_class: Any = ... + client: Client + allow_database_queries: bool = ... + # TODO: str -> Literal['__all__'] + databases: Union[Set[str], str] = ... + def __call__(self, result: Optional[unittest.TestResult] = ...) -> None: ... + def settings(self, **kwargs: Any) -> Any: ... + def modify_settings(self, **kwargs: Any) -> Any: ... + def assertRedirects( + self, + response: HttpResponse, + expected_url: str, + status_code: int = ..., + target_status_code: int = ..., + msg_prefix: str = ..., + fetch_redirect_response: bool = ..., + ) -> None: ... + def assertContains( + self, + response: HttpResponseBase, + text: Union[bytes, int, str], + count: Optional[int] = ..., + status_code: int = ..., + msg_prefix: str = ..., + html: bool = ..., + ) -> None: ... + def assertNotContains( + self, + response: HttpResponse, + text: Union[bytes, str], + status_code: int = ..., + msg_prefix: str = ..., + html: bool = ..., + ) -> None: ... + def assertFormError( + self, + response: HttpResponse, + form: str, + field: Optional[str], + errors: Union[List[str], str], + msg_prefix: str = ..., + ) -> None: ... + def assertFormsetError( + self, + response: HttpResponse, + formset: str, + form_index: Optional[int], + field: Optional[str], + errors: Union[List[str], str], + msg_prefix: str = ..., + ) -> None: ... + def assertTemplateUsed( + self, + response: Optional[Union[HttpResponse, str]] = ..., + template_name: Optional[str] = ..., + msg_prefix: str = ..., + count: Optional[int] = ..., + ) -> Optional[_AssertTemplateUsedContext]: ... + def assertTemplateNotUsed( + self, response: Union[HttpResponse, str] = ..., template_name: Optional[str] = ..., msg_prefix: str = ... + ) -> Optional[_AssertTemplateNotUsedContext]: ... + def assertRaisesMessage( + self, expected_exception: Type[Exception], expected_message: str, *args: Any, **kwargs: Any + ) -> Any: ... + def assertWarnsMessage( + self, expected_warning: Type[Exception], expected_message: str, *args: Any, **kwargs: Any + ) -> Any: ... + def assertFieldOutput( + self, + fieldclass: Type[EmailField], + valid: Dict[str, str], + invalid: Dict[str, List[str]], + field_args: None = ..., + field_kwargs: None = ..., + empty_value: str = ..., + ) -> Any: ... + def assertHTMLEqual(self, html1: str, html2: str, msg: Optional[str] = ...) -> None: ... + def assertHTMLNotEqual(self, html1: str, html2: str, msg: Optional[str] = ...) -> None: ... + def assertInHTML( + self, needle: str, haystack: SafeText, count: Optional[int] = ..., msg_prefix: str = ... + ) -> None: ... + def assertJSONEqual( + self, + raw: str, + expected_data: Union[Dict[str, Any], List[Any], str, int, float, bool, None], + msg: Optional[str] = ..., + ) -> None: ... + def assertJSONNotEqual( + self, + raw: str, + expected_data: Union[Dict[str, Any], List[Any], str, int, float, bool, None], + msg: Optional[str] = ..., + ) -> None: ... + def assertXMLEqual(self, xml1: str, xml2: str, msg: Optional[str] = ...) -> None: ... + def assertXMLNotEqual(self, xml1: str, xml2: str, msg: Optional[str] = ...) -> None: ... + +class TransactionTestCase(SimpleTestCase): + reset_sequences: bool = ... + available_apps: Any = ... + fixtures: Any = ... + multi_db: bool = ... + serialized_rollback: bool = ... + def assertQuerysetEqual( + self, + qs: Union[Iterator[Any], List[Model], QuerySet, RawQuerySet], + values: Union[List[None], List[Tuple[str, str]], List[date], List[int], List[str], Set[str], QuerySet], + transform: Union[Callable, Type[str]] = ..., + ordered: bool = ..., + msg: Optional[str] = ..., + ) -> None: ... + @overload + def assertNumQueries( + self, num: int, func: Callable[..., Any], *args: Any, using: str = ..., **kwargs: Any + ) -> None: ... + @overload + def assertNumQueries( + self, num: int, func: None = ..., *args: Any, using: str = ..., **kwargs: Any + ) -> _AssertNumQueriesContext: ... + +class TestCase(TransactionTestCase): + @classmethod + def setUpTestData(cls) -> None: ... + +class CheckCondition: + conditions: Tuple[Tuple[Callable, str]] = ... + def __init__(self, *conditions: Any) -> None: ... + def add_condition(self, condition: Callable, reason: str) -> CheckCondition: ... + def __get__(self, instance: None, cls: Type[TransactionTestCase] = ...) -> bool: ... + +def skipIfDBFeature(*features: Any) -> Callable: ... +def skipUnlessDBFeature(*features: Any) -> Callable: ... +def skipUnlessAnyDBFeature(*features: Any) -> Callable: ... + +class QuietWSGIRequestHandler(WSGIRequestHandler): ... + +class FSFilesHandler(WSGIHandler): + application: Any = ... + base_url: Any = ... + def __init__(self, application: Any) -> None: ... + def file_path(self, url: Any): ... + def serve(self, request: Any): ... + +class _StaticFilesHandler(FSFilesHandler): + def get_base_dir(self): ... + def get_base_url(self): ... + +class _MediaFilesHandler(FSFilesHandler): + def get_base_dir(self): ... + def get_base_url(self): ... + +class LiveServerThread(threading.Thread): + host: str = ... + port: int = ... + is_ready: threading.Event = ... + error: Optional[ImproperlyConfigured] = ... + static_handler: Type[WSGIHandler] = ... + connections_override: Dict[str, Any] = ... + def __init__( + self, + host: str, + static_handler: Type[WSGIHandler], + connections_override: Dict[str, DatabaseWrapper] = ..., + port: int = ..., + ) -> None: ... + httpd: ThreadedWSGIServer = ... + def terminate(self) -> None: ... + +class LiveServerTestCase(TransactionTestCase): + live_server_url: ClassVar[str] + host: str = ... + port: int = ... + server_thread_class: Type[Any] = ... + server_thread: Any + static_handler: Any = ... + +class SerializeMixin: + lockfile: Any = ... + @classmethod + def setUpClass(cls) -> None: ... + @classmethod + def tearDownClass(cls) -> None: ... + +def connections_support_transactions() -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/utils.pyi new file mode 100644 index 00000000..03d4da1b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/test/utils.pyi @@ -0,0 +1,155 @@ +import decimal +from contextlib import contextmanager +from decimal import Decimal +from io import StringIO +from typing import ( + Any, + Callable, + Dict, + Iterable, + Iterator, + List, + Mapping, + Optional, + Set, + Tuple, + Type, + Union, + ContextManager, + TypeVar, +) + +from django.apps.registry import Apps +from django.core.checks.registry import CheckRegistry +from django.db.models.lookups import Lookup, Transform +from django.db.models.query_utils import RegisterLookupMixin +from django.test.runner import DiscoverRunner +from django.test.testcases import SimpleTestCase + +from django.conf import LazySettings, Settings + +_TestClass = Type[SimpleTestCase] +_DecoratedTest = Union[Callable, _TestClass] +_C = TypeVar("_C", bound=Callable) # Any callable + +TZ_SUPPORT: bool = ... + +class Approximate: + val: Union[decimal.Decimal, float] = ... + places: int = ... + def __init__(self, val: Union[Decimal, float], places: int = ...) -> None: ... + +class ContextList(list): + def get(self, key: str, default: Optional[str] = ...) -> str: ... + def keys(self) -> Set[str]: ... + +class _TestState: ... + +def setup_test_environment(debug: Optional[bool] = ...) -> None: ... +def teardown_test_environment() -> None: ... +def get_runner(settings: LazySettings, test_runner_class: Optional[str] = ...) -> Type[DiscoverRunner]: ... + +class TestContextDecorator: + attr_name: Optional[str] = ... + kwarg_name: Optional[str] = ... + def __init__(self, attr_name: Optional[str] = ..., kwarg_name: Optional[str] = ...) -> None: ... + def enable(self) -> Any: ... + def disable(self) -> None: ... + def __enter__(self) -> Optional[Apps]: ... + def __exit__(self, exc_type: None, exc_value: None, traceback: None) -> None: ... + def decorate_class(self, cls: _TestClass) -> _TestClass: ... + def decorate_callable(self, func: _C) -> _C: ... + def __call__(self, decorated: _DecoratedTest) -> Any: ... + +class override_settings(TestContextDecorator): + options: Dict[str, Any] = ... + def __init__(self, **kwargs: Any) -> None: ... + wrapped: Settings = ... + def save_options(self, test_func: _DecoratedTest) -> None: ... + def decorate_class(self, cls: type) -> type: ... + +class modify_settings(override_settings): + wrapped: Settings + operations: List[Tuple[str, Dict[str, Union[List[str], str]]]] = ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def save_options(self, test_func: _DecoratedTest) -> None: ... + options: Dict[str, List[Union[Tuple[str, str], str]]] = ... + +class override_system_checks(TestContextDecorator): + registry: CheckRegistry = ... + new_checks: List[Callable] = ... + deployment_checks: Optional[List[Callable]] = ... + def __init__(self, new_checks: List[Callable], deployment_checks: Optional[List[Callable]] = ...) -> None: ... + old_checks: Set[Callable] = ... + old_deployment_checks: Set[Callable] = ... + +class CaptureQueriesContext: + connection: Any = ... + force_debug_cursor: bool = ... + initial_queries: int = ... + final_queries: Optional[int] = ... + def __init__(self, connection: Any) -> None: ... + def __iter__(self): ... + def __getitem__(self, index: int) -> Dict[str, str]: ... + def __len__(self) -> int: ... + @property + def captured_queries(self) -> List[Dict[str, str]]: ... + def __enter__(self) -> CaptureQueriesContext: ... + def __exit__(self, exc_type: None, exc_value: None, traceback: None) -> None: ... + +class ignore_warnings(TestContextDecorator): + ignore_kwargs: Dict[str, Any] = ... + filter_func: Callable = ... + def __init__(self, **kwargs: Any) -> None: ... + catch_warnings: ContextManager[Optional[list]] = ... + +requires_tz_support: Any + +def isolate_lru_cache(lru_cache_object: Callable) -> Iterator[None]: ... + +class override_script_prefix(TestContextDecorator): + prefix: str = ... + def __init__(self, prefix: str) -> None: ... + old_prefix: str = ... + +class LoggingCaptureMixin: + logger: Any = ... + old_stream: Any = ... + logger_output: Any = ... + def setUp(self) -> None: ... + def tearDown(self) -> None: ... + +class isolate_apps(TestContextDecorator): + installed_apps: Tuple[str] = ... + def __init__(self, *installed_apps: Any, **kwargs: Any) -> None: ... + old_apps: Apps = ... + +@contextmanager +def extend_sys_path(*paths: str) -> Iterator[None]: ... +@contextmanager +def captured_output(stream_name) -> Iterator[StringIO]: ... +@contextmanager +def captured_stdin() -> Iterator[StringIO]: ... +@contextmanager +def captured_stdout() -> Iterator[StringIO]: ... +@contextmanager +def captured_stderr() -> Iterator[StringIO]: ... +@contextmanager +def freeze_time(t: float) -> Iterator[None]: ... +def tag(*tags: str): ... + +_Signature = str +_TestDatabase = Tuple[str, List[str]] + +def dependency_ordered( + test_databases: Iterable[Tuple[_Signature, _TestDatabase]], dependencies: Mapping[str, List[str]] +) -> List[Tuple[_Signature, _TestDatabase]]: ... +def get_unique_databases_and_mirrors() -> Tuple[Dict[_Signature, _TestDatabase], Dict[str, Any]]: ... +def teardown_databases( + old_config: Iterable[Tuple[Any, str, bool]], verbosity: int, parallel: int = ..., keepdb: bool = ... +) -> None: ... +def require_jinja2(test_func: _C) -> _C: ... +@contextmanager +def register_lookup( + field: Type[RegisterLookupMixin], *lookups: Type[Union[Lookup, Transform]], lookup_name: Optional[str] = ... +) -> Iterator[None]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/__init__.pyi new file mode 100644 index 00000000..3742aa4f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/__init__.pyi @@ -0,0 +1,36 @@ +# noinspection PyUnresolvedReferences +from .base import ( + clear_script_prefix as clear_script_prefix, + clear_url_caches as clear_url_caches, + get_script_prefix as get_script_prefix, + get_urlconf as get_urlconf, + is_valid_path as is_valid_path, + resolve as resolve, + reverse as reverse, + reverse_lazy as reverse_lazy, + set_script_prefix as set_script_prefix, + set_urlconf as set_urlconf, + translate_url as translate_url, +) + +# noinspection PyUnresolvedReferences +from .conf import include as include, path as path, re_path as re_path + +# noinspection PyUnresolvedReferences +from .converters import register_converter as register_converter + +# noinspection PyUnresolvedReferences +from .exceptions import NoReverseMatch as NoReverseMatch, Resolver404 as Resolver404 + +# noinspection PyUnresolvedReferences +from .resolvers import ( + LocalePrefixPattern as LocalePrefixPattern, + ResolverMatch as ResolverMatch, + URLPattern as URLPattern, + URLResolver as URLResolver, + get_ns_resolver as get_ns_resolver, + get_resolver as get_resolver, +) + +# noinspection PyUnresolvedReferences +from .utils import get_callable as get_callable, get_mod_func as get_mod_func diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/base.pyi new file mode 100644 index 00000000..d0e233d6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/base.pyi @@ -0,0 +1,23 @@ +from typing import Any, Callable, Dict, Optional, Type, Union, Sequence + +from django.urls.resolvers import ResolverMatch + +def resolve(path: str, urlconf: Optional[str] = ...) -> ResolverMatch: ... +def reverse( + viewname: Optional[Union[Callable, str]], + urlconf: Optional[str] = ..., + args: Optional[Sequence[Any]] = ..., + kwargs: Optional[Dict[str, Any]] = ..., + current_app: Optional[str] = ..., +) -> str: ... + +reverse_lazy: Any + +def clear_url_caches() -> None: ... +def set_script_prefix(prefix: str) -> None: ... +def get_script_prefix() -> str: ... +def clear_script_prefix() -> None: ... +def set_urlconf(urlconf_name: Optional[Union[Type[Any], str]]) -> None: ... +def get_urlconf(default: None = ...) -> Optional[Union[Type[Any], str]]: ... +def is_valid_path(path: str, urlconf: Optional[str] = ...) -> bool: ... +def translate_url(url: str, lang_code: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/conf.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/conf.pyi new file mode 100644 index 00000000..9f8f6e64 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/conf.pyi @@ -0,0 +1,8 @@ +from typing import Any, List, Optional, Tuple + +from .resolvers import URLResolver + +def include(arg: Any, namespace: Optional[str] = ...) -> Tuple[List[URLResolver], Optional[str], Optional[str]]: ... + +path: Any +re_path: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/converters.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/converters.pyi new file mode 100644 index 00000000..fd5d6e1f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/converters.pyi @@ -0,0 +1,27 @@ +from typing import Any, Dict, Type, Union +from uuid import UUID + +class IntConverter: + regex: str = ... + def to_python(self, value: str) -> int: ... + def to_url(self, value: Union[str, int]) -> str: ... + +class StringConverter: + regex: str = ... + def to_python(self, value: str) -> str: ... + def to_url(self, value: str) -> str: ... + +class UUIDConverter: + regex: str = ... + def to_python(self, value: str) -> UUID: ... + def to_url(self, value: Union[str, UUID]) -> str: ... + +class SlugConverter(StringConverter): ... +class PathConverter(StringConverter): ... + +DEFAULT_CONVERTERS: Dict[str, Any] +REGISTERED_CONVERTERS: Dict[str, Any] + +def register_converter(converter: Type[Any], type_name: str) -> None: ... +def get_converters() -> Dict[str, Any]: ... +def get_converter(raw_converter: str) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/exceptions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/exceptions.pyi new file mode 100644 index 00000000..f3ad4c62 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/exceptions.pyi @@ -0,0 +1,4 @@ +from django.http import Http404 + +class Resolver404(Http404): ... +class NoReverseMatch(Exception): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/resolvers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/resolvers.pyi new file mode 100644 index 00000000..4370cf57 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/resolvers.pyi @@ -0,0 +1,110 @@ +from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union + +from django.urls.converters import UUIDConverter +from django.utils.datastructures import MultiValueDict + +class ResolverMatch: + func: Callable = ... + args: Tuple = ... + kwargs: Dict[str, Any] = ... + url_name: Optional[str] = ... + app_names: List[str] = ... + app_name: str = ... + namespaces: List[str] = ... + namespace: str = ... + view_name: str = ... + route: str = ... + def __init__( + self, + func: Callable, + args: Tuple, + kwargs: Dict[str, Any], + url_name: Optional[str] = ..., + app_names: Optional[List[Optional[str]]] = ..., + namespaces: Optional[List[Optional[str]]] = ..., + ) -> None: ... + def __getitem__(self, index: int) -> Any: ... + # for tuple unpacking + def __iter__(self) -> Any: ... + +def get_resolver(urlconf: Optional[str] = ...) -> URLResolver: ... +def get_ns_resolver(ns_pattern: str, resolver: URLResolver, converters: Tuple) -> URLResolver: ... + +class LocaleRegexDescriptor: + attr: str = ... + def __init__(self, attr: Any) -> None: ... + def __get__(self, instance: Optional[RegexPattern], cls: Type[RegexPattern] = ...) -> LocaleRegexDescriptor: ... + +class CheckURLMixin: + def describe(self) -> str: ... + +class RegexPattern(CheckURLMixin): + regex: Any = ... + name: Optional[str] = ... + converters: Dict[Any, Any] = ... + def __init__(self, regex: str, name: Optional[str] = ..., is_endpoint: bool = ...) -> None: ... + def match(self, path: str) -> Optional[Tuple[str, Tuple, Dict[str, str]]]: ... + def check(self) -> List[Warning]: ... + +class RoutePattern(CheckURLMixin): + regex: Any = ... + name: Optional[str] = ... + converters: Dict[str, UUIDConverter] = ... + def __init__(self, route: str, name: Optional[str] = ..., is_endpoint: bool = ...) -> None: ... + def match(self, path: str) -> Optional[Tuple[str, Tuple, Dict[str, Union[int, str]]]]: ... + def check(self) -> List[Warning]: ... + +class LocalePrefixPattern: + prefix_default_language: bool = ... + converters: Dict[Any, Any] = ... + def __init__(self, prefix_default_language: bool = ...) -> None: ... + @property + def regex(self): ... + @property + def language_prefix(self) -> str: ... + def match(self, path: str) -> Optional[Tuple[str, Tuple, Dict[str, Any]]]: ... + def check(self) -> List[Any]: ... + def describe(self) -> str: ... + +class URLPattern: + lookup_str: str + pattern: Any = ... + callback: Callable = ... + default_args: Optional[Dict[str, str]] = ... + name: Optional[str] = ... + def __init__( + self, pattern: Any, callback: Callable, default_args: Optional[Dict[str, str]] = ..., name: Optional[str] = ... + ) -> None: ... + def check(self) -> List[Warning]: ... + def resolve(self, path: str) -> Optional[ResolverMatch]: ... + +class URLResolver: + url_patterns: List[Tuple[str, Callable]] + urlconf_module: Optional[List[Tuple[str, Callable]]] + pattern: Any = ... + urlconf_name: Optional[str] = ... + callback: None = ... + default_kwargs: Dict[str, Any] = ... + namespace: Optional[str] = ... + app_name: Optional[str] = ... + _local: Any + _reverse_dict: MultiValueDict + def __init__( + self, + pattern: Any, + urlconf_name: Optional[str], + default_kwargs: Optional[Dict[str, Any]] = ..., + app_name: Optional[str] = ..., + namespace: Optional[str] = ..., + ) -> None: ... + @property + def reverse_dict(self) -> MultiValueDict: ... + @property + def namespace_dict(self) -> Dict[str, Tuple[str, URLResolver]]: ... + @property + def app_dict(self) -> Dict[str, List[str]]: ... + def resolve(self, path: str) -> ResolverMatch: ... + def resolve_error_handler(self, view_type: int) -> Tuple[Callable, Dict[str, Any]]: ... + def reverse(self, lookup_view: str, *args: Any, **kwargs: Any) -> str: ... + def _is_callback(self, name: str) -> bool: ... + def _populate(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/utils.pyi new file mode 100644 index 00000000..79349df6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/urls/utils.pyi @@ -0,0 +1,4 @@ +from typing import Callable, Tuple, Union + +def get_callable(lookup_view: Union[Callable, str]) -> Callable: ... +def get_mod_func(callback: str) -> Tuple[str, str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/_os.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/_os.pyi new file mode 100644 index 00000000..a609fa52 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/_os.pyi @@ -0,0 +1,11 @@ +from os.path import abspath +from pathlib import Path +from typing import Any, Union + +abspathu = abspath + +def upath(path: Any): ... +def npath(path: Any): ... +def safe_join(base: Union[bytes, str], *paths: Any) -> str: ... +def symlinks_supported() -> Any: ... +def to_path(value: Union[Path, str]) -> Path: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/archive.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/archive.pyi new file mode 100644 index 00000000..b9a80156 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/archive.pyi @@ -0,0 +1,30 @@ +from typing import Any, Dict, Iterable, Sequence, Type + +class ArchiveException(Exception): ... +class UnrecognizedArchiveFormat(ArchiveException): ... + +def extract(path: str, to_path: str = ...) -> None: ... + +class Archive: + def __init__(self, file: str) -> None: ... + def __enter__(self) -> Archive: ... + def __exit__(self, exc_type: None, exc_value: None, traceback: None) -> None: ... + def extract(self, to_path: str = ...) -> None: ... + def list(self) -> None: ... + def close(self) -> None: ... + +class BaseArchive: + def split_leading_dir(self, path: str) -> Sequence[str]: ... + def has_leading_dir(self, paths: Iterable[str]) -> bool: ... + def extract(self, to_path: str) -> None: ... + def list(self, *args: Any, **kwargs: Any) -> None: ... + +class TarArchive(BaseArchive): + def __init__(self, file: str) -> None: ... + def close(self) -> None: ... + +class ZipArchive(BaseArchive): + def __init__(self, file: str) -> None: ... + def close(self) -> None: ... + +extension_map: Dict[str, Type[BaseArchive]] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/autoreload.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/autoreload.pyi new file mode 100644 index 00000000..edb68416 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/autoreload.pyi @@ -0,0 +1,67 @@ +import threading +import types +from pathlib import Path +from typing import Any, Callable, List, Optional, Set, Dict, Union, Iterator, Tuple, Iterable + +from django.apps.registry import Apps + +USE_INOTIFY: bool +fd: Any +RUN_RELOADER: bool +FILE_MODIFIED: int +I18N_MODIFIED: int + +def gen_filenames(only_new: bool = ...) -> List[str]: ... +def clean_files(filelist: List[Optional[str]]) -> List[str]: ... +def reset_translations() -> None: ... +def inotify_code_changed(): ... +def code_changed(): ... +def check_errors(fn: Callable) -> Callable: ... +def raise_last_exception() -> None: ... +def ensure_echo_on() -> None: ... +def reloader_thread() -> None: ... +def restart_with_reloader() -> int: ... +def python_reloader(main_func: Any, args: Any, kwargs: Any) -> None: ... +def main(main_func: Any, args: Optional[Any] = ..., kwargs: Optional[Any] = ...) -> None: ... +def iter_all_python_module_files() -> Set[Path]: ... +def iter_modules_and_files( + modules: Iterable[types.ModuleType], extra_files: Iterable[Union[str, Path]] +) -> Set[Path]: ... +def common_roots(paths: Iterable[Path]) -> Iterator[Path]: ... +def sys_path_directories() -> Iterator[Path]: ... + +class BaseReloader: + extra_files: Set[Path] + directory_globs: Dict[Path, Set[str]] + def __init__(self) -> None: ... + def watch_dir(self, path: Union[str, Path], glob: str) -> None: ... + def watch_file(self, path: Union[str, Path]) -> None: ... + def watched_files(self, include_globs: bool = ...) -> Iterator[Path]: ... + def wait_for_apps_ready(self, app_reg: Apps, django_main_thread: threading.Thread) -> bool: ... + def run(self, django_main_thread: threading.Thread) -> None: ... + def run_loop(self) -> None: ... + def tick(self) -> Iterator[None]: ... + @classmethod + def check_availability(cls) -> bool: ... + def notify_file_changed(self, path: Union[str, Path]) -> None: ... + @property + def should_stop(self) -> bool: ... + def stop(self) -> None: ... + +class StatReloader(BaseReloader): + SLEEP_TIME: int = ... + def snapshot_files(self) -> Iterator[Tuple[Path, int]]: ... + +class WatchmanUnavailable(RuntimeError): ... + +class WatchmanReloader(BaseReloader): + @property + def client(self) -> Any: ... + def watched_roots(self, watched_files: Iterable[Path]) -> Set[Path]: ... + def update_watches(self) -> None: ... + def request_processed(self, **kwargs: Any) -> None: ... + def check_server_status(self, inner_ex: Optional[BaseException] = ...) -> bool: ... + +def get_reloader() -> BaseReloader: ... +def start_django(reloader: BaseReloader, main_func: Callable, *args: Any, **kwargs: Any) -> None: ... +def run_with_reloader(main_func: Callable, *args: Any, **kwargs: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/baseconv.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/baseconv.pyi new file mode 100644 index 00000000..20f65556 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/baseconv.pyi @@ -0,0 +1,24 @@ +from typing import Any, Tuple, Union + +BASE2_ALPHABET: str +BASE16_ALPHABET: str +BASE56_ALPHABET: str +BASE36_ALPHABET: str +BASE62_ALPHABET: str +BASE64_ALPHABET: Any + +class BaseConverter: + decimal_digits: str = ... + sign: str = ... + digits: str = ... + def __init__(self, digits: str, sign: str = ...) -> None: ... + def encode(self, i: int) -> str: ... + def decode(self, s: str) -> int: ... + def convert(self, number: Union[int, str], from_digits: str, to_digits: str, sign: str) -> Tuple[int, str]: ... + +base2: Any +base16: Any +base36: Any +base56: Any +base62: Any +base64: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/cache.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/cache.pyi new file mode 100644 index 00000000..f47d929d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/cache.pyi @@ -0,0 +1,31 @@ +from typing import Any, Optional, Tuple + +from django.core.cache.backends.base import BaseCache +from django.core.handlers.wsgi import WSGIRequest +from django.http.response import HttpResponse, HttpResponseBase + +cc_delim_re: Any + +def patch_cache_control(response: HttpResponseBase, **kwargs: Any) -> None: ... +def get_max_age(response: HttpResponse) -> Optional[int]: ... +def set_response_etag(response: HttpResponseBase) -> HttpResponseBase: ... +def get_conditional_response( + request: WSGIRequest, + etag: Optional[str] = ..., + last_modified: Optional[int] = ..., + response: Optional[HttpResponse] = ..., +) -> Optional[HttpResponse]: ... +def patch_response_headers(response: HttpResponseBase, cache_timeout: float = ...) -> None: ... +def add_never_cache_headers(response: HttpResponseBase) -> None: ... +def patch_vary_headers(response: HttpResponseBase, newheaders: Tuple[str]) -> None: ... +def has_vary_header(response: HttpResponse, header_query: str) -> bool: ... +def get_cache_key( + request: WSGIRequest, key_prefix: Optional[str] = ..., method: str = ..., cache: Optional[BaseCache] = ... +) -> Optional[str]: ... +def learn_cache_key( + request: WSGIRequest, + response: HttpResponse, + cache_timeout: Optional[float] = ..., + key_prefix: Optional[str] = ..., + cache: Optional[BaseCache] = ..., +) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/crypto.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/crypto.pyi new file mode 100644 index 00000000..9b41ab78 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/crypto.pyi @@ -0,0 +1,15 @@ +from hmac import HMAC +from typing import Callable, Optional, Union + +using_sysrandom: bool + +def salted_hmac(key_salt: str, value: Union[bytes, str], secret: Optional[Union[bytes, str]] = ...) -> HMAC: ... +def get_random_string(length: int = ..., allowed_chars: str = ...) -> str: ... +def constant_time_compare(val1: Union[bytes, str], val2: Union[bytes, str]) -> bool: ... +def pbkdf2( + password: Union[bytes, str], + salt: Union[bytes, str], + iterations: int, + dklen: int = ..., + digest: Optional[Callable] = ..., +) -> bytes: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/datastructures.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/datastructures.pyi new file mode 100644 index 00000000..7b5f7b2d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/datastructures.pyi @@ -0,0 +1,75 @@ +from typing import ( + Any, + Callable, + Dict, + Iterable, + List, + Mapping, + MutableMapping, + MutableSet, + Tuple, + TypeVar, + Union, + overload, + Iterator, + Optional, +) + +from typing_extensions import Literal + +_K = TypeVar("_K") +_V = TypeVar("_V") + +class OrderedSet(MutableSet[_K]): + dict: Dict[_K, None] = ... + def __init__(self, iterable: Optional[Iterable[_K]] = ...) -> None: ... + def __contains__(self, item: object) -> bool: ... + def __iter__(self) -> Iterator[_K]: ... + def __len__(self) -> int: ... + def add(self, x: _K) -> None: ... + def discard(self, item: _K) -> None: ... + +class MultiValueDictKeyError(KeyError): ... + +_D = TypeVar("_D", bound="MultiValueDict") + +class MultiValueDict(MutableMapping[_K, _V]): + @overload + def __init__(self, key_to_list_mapping: Mapping[_K, Optional[List[_V]]] = ...) -> None: ... + @overload + def __init__(self, key_to_list_mapping: Iterable[Tuple[_K, List[_V]]] = ...) -> None: ... + def getlist(self, key: _K, default: Any = ...) -> List[_V]: ... + def setlist(self, key: _K, list_: List[_V]) -> None: ... + def setlistdefault(self, key: _K, default_list: Optional[List[_V]] = ...) -> List[_V]: ... + def appendlist(self, key: _K, value: _V) -> None: ... + def lists(self) -> Iterable[Tuple[_K, List[_V]]]: ... + def dict(self) -> Dict[_K, Union[_V, List[_V]]]: ... + def copy(self: _D) -> _D: ... + # These overrides are needed to convince mypy that this isn't an abstract class + def __delitem__(self, item: _K) -> None: ... + def __getitem__(self, item: _K) -> Union[_V, Literal[[]]]: ... # type: ignore + def __setitem__(self, k: _K, v: Union[_V, List[_V]]) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_K]: ... + +class ImmutableList(Tuple[_V, ...]): + warning: str = ... + def __init__(self, *args: Any, warning: str = ..., **kwargs: Any) -> None: ... + def complain(self, *wargs: Any, **kwargs: Any) -> None: ... + +class DictWrapper(Dict[str, _V]): + func: Callable[[_V], _V] = ... + prefix: str = ... + @overload + def __init__(self, data: Mapping[str, _V], func: Callable[[_V], _V], prefix: str) -> None: ... + @overload + def __init__(self, data: Iterable[Tuple[str, _V]], func: Callable[[_V], _V], prefix: str) -> None: ... + +_T = TypeVar("_T", bound="CaseInsensitiveMapping") + +class CaseInsensitiveMapping(Mapping): + def __init__(self, data: Any) -> None: ... + def __getitem__(self, key: str) -> Any: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[str]: ... + def copy(self: _T) -> _T: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/dateformat.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/dateformat.pyi new file mode 100644 index 00000000..e9246e4d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/dateformat.pyi @@ -0,0 +1,63 @@ +from datetime import datetime, date +from typing import Any, Optional, Union + +from django.utils.timezone import FixedOffset + +re_formatchars: Any +re_escaped: Any + +class Formatter: + def format(self, formatstr: str) -> str: ... + +class TimeFormat(Formatter): + data: Union[datetime, str] = ... + timezone: Optional[FixedOffset] = ... + def __init__(self, obj: Union[datetime, str]) -> None: ... + def a(self) -> str: ... + def A(self) -> str: ... + def B(self) -> None: ... + def e(self) -> str: ... + def f(self) -> Union[int, str]: ... + def g(self) -> int: ... + def G(self) -> int: ... + def h(self) -> str: ... + def H(self) -> str: ... + def i(self) -> str: ... + def O(self) -> str: ... + def P(self) -> str: ... + def s(self) -> str: ... + def T(self) -> str: ... + def u(self) -> str: ... + def Z(self) -> Union[int, str]: ... + +class DateFormat(TimeFormat): + data: Union[datetime, str] + timezone: Optional[FixedOffset] + year_days: Any = ... + def b(self): ... + def c(self) -> str: ... + def d(self) -> str: ... + def D(self): ... + def E(self): ... + def F(self): ... + def I(self) -> str: ... + def j(self) -> int: ... + def l(self): ... + def L(self) -> bool: ... + def m(self) -> str: ... + def M(self) -> str: ... + def n(self) -> int: ... + def N(self): ... + def o(self) -> int: ... + def r(self) -> str: ... + def S(self) -> str: ... + def t(self) -> str: ... + def U(self) -> int: ... + def w(self) -> int: ... + def W(self) -> int: ... + def y(self) -> str: ... + def Y(self) -> int: ... + def z(self) -> int: ... + +def format(value: Union[datetime, str, date], format_string: str) -> str: ... +def time_format(value: Union[datetime, str], format_string: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/dateparse.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/dateparse.pyi new file mode 100644 index 00000000..3645a67e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/dateparse.pyi @@ -0,0 +1,14 @@ +from datetime import date, datetime, time, timedelta +from typing import Any, Optional + +date_re: Any +time_re: Any +datetime_re: Any +standard_duration_re: Any +iso8601_duration_re: Any +postgres_interval_re: Any + +def parse_date(value: str) -> Optional[date]: ... +def parse_time(value: str) -> Optional[time]: ... +def parse_datetime(value: str) -> Optional[datetime]: ... +def parse_duration(value: str) -> Optional[timedelta]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/dates.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/dates.pyi new file mode 100644 index 00000000..2e46b926 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/dates.pyi @@ -0,0 +1,8 @@ +from typing import Dict + +WEEKDAYS: Dict[int, str] +WEEKDAYS_ABBR: Dict[int, str] +MONTHS: Dict[int, str] +MONTHS_3: Dict[int, str] +MONTHS_AP: Dict[int, str] +MONTHS_ALT: Dict[int, str] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/datetime_safe.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/datetime_safe.pyi new file mode 100644 index 00000000..8dbfc710 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/datetime_safe.pyi @@ -0,0 +1,10 @@ +from datetime import date as real_date, datetime as real_datetime, time as real_time +from typing import Union + +class date(real_date): ... +class datetime(real_datetime): ... +class time(real_time): ... + +def new_date(d: date) -> date: ... +def new_datetime(d: date) -> datetime: ... +def strftime(dt: Union[date, datetime], fmt: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/deconstruct.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/deconstruct.pyi new file mode 100644 index 00000000..99f4b4ae --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/deconstruct.pyi @@ -0,0 +1,3 @@ +from typing import Any, Optional + +def deconstructible(*args: Any, path: Optional[Any] = ...) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/decorators.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/decorators.pyi new file mode 100644 index 00000000..3badf23e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/decorators.pyi @@ -0,0 +1,20 @@ +from typing import Any, Callable, Iterable, Optional, Type, Union, TypeVar + +from django.utils.deprecation import MiddlewareMixin +from django.views.generic.base import View + +_T = TypeVar("_T", bound=Union[View, Callable]) # Any callable + +class classonlymethod(classmethod): ... + +def method_decorator(decorator: Union[Callable, Iterable[Callable]], name: str = ...) -> Callable[[_T], _T]: ... +def decorator_from_middleware_with_args(middleware_class: type) -> Callable: ... +def decorator_from_middleware(middleware_class: type) -> Callable: ... +def available_attrs(fn: Callable): ... +def make_middleware_decorator(middleware_class: Type[MiddlewareMixin]) -> Callable: ... + +class classproperty: + fget: Optional[Callable] = ... + def __init__(self, method: Optional[Callable] = ...) -> None: ... + def __get__(self, instance: Any, cls: Optional[type] = ...) -> Any: ... + def getter(self, method: Callable) -> classproperty: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/deprecation.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/deprecation.pyi new file mode 100644 index 00000000..096513aa --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/deprecation.pyi @@ -0,0 +1,35 @@ +from typing import Any, Callable, Optional, Type + +from django.http.request import HttpRequest +from django.http.response import HttpResponse + +class RemovedInDjango30Warning(PendingDeprecationWarning): ... +class RemovedInDjango31Warning(PendingDeprecationWarning): ... +class RemovedInDjango40Warning(PendingDeprecationWarning): ... +class RemovedInNextVersionWarning(DeprecationWarning): ... + +class warn_about_renamed_method: + class_name: str = ... + old_method_name: str = ... + new_method_name: str = ... + deprecation_warning: Type[DeprecationWarning] = ... + def __init__( + self, class_name: str, old_method_name: str, new_method_name: str, deprecation_warning: Type[DeprecationWarning] + ) -> None: ... + def __call__(self, f: Callable) -> Callable: ... + +class RenameMethodsBase(type): + renamed_methods: Any = ... + def __new__(cls, name: Any, bases: Any, attrs: Any): ... + +class DeprecationInstanceCheck(type): + alternative: str + deprecation_warning: Type[Warning] + def __instancecheck__(self, instance: Any): ... + +GetResponseCallable = Callable[[HttpRequest], HttpResponse] + +class MiddlewareMixin: + get_response: Optional[GetResponseCallable] = ... + def __init__(self, get_response: Optional[GetResponseCallable] = ...) -> None: ... + def __call__(self, request: HttpRequest) -> HttpResponse: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/duration.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/duration.pyi new file mode 100644 index 00000000..4d49555a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/duration.pyi @@ -0,0 +1,5 @@ +from datetime import timedelta + +def duration_string(duration: timedelta) -> str: ... +def duration_iso_string(duration: timedelta) -> str: ... +def duration_microseconds(delta: timedelta) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/encoding.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/encoding.pyi new file mode 100644 index 00000000..11fd059b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/encoding.pyi @@ -0,0 +1,59 @@ +import datetime +from decimal import Decimal +from typing import Any, TypeVar, overload, Union + +from django.utils.functional import Promise +from typing_extensions import Literal + +class DjangoUnicodeDecodeError(UnicodeDecodeError): + obj: bytes = ... + def __init__(self, obj: bytes, *args: Any) -> None: ... + +_P = TypeVar("_P", bound=Promise) +_S = TypeVar("_S", bound=str) +_PT = TypeVar("_PT", None, int, float, Decimal, datetime.datetime, datetime.date, datetime.time) +@overload +def smart_text(s: _P, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> _P: ... +@overload +def smart_text(s: _PT, encoding: str = ..., strings_only: Literal[True] = ..., errors: str = ...) -> _PT: ... +@overload +def smart_text(s: _S, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> _S: ... +@overload +def smart_text(s: Any, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> str: ... +def is_protected_type(obj: Any) -> bool: ... +@overload +def force_text(s: _PT, encoding: str = ..., strings_only: Literal[True] = ..., errors: str = ...) -> _PT: ... +@overload +def force_text(s: _S, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> _S: ... +@overload +def force_text(s: Any, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> str: ... +@overload +def smart_bytes(s: _P, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> _P: ... +@overload +def smart_bytes(s: _PT, encoding: str = ..., strings_only: Literal[True] = ..., errors: str = ...) -> _PT: ... +@overload +def smart_bytes(s: Any, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> bytes: ... +@overload +def force_bytes(s: _PT, encoding: str = ..., strings_only: Literal[True] = ..., errors: str = ...) -> _PT: ... +@overload +def force_bytes(s: Any, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> bytes: ... + +smart_str = smart_text +force_str = force_text +@overload +def iri_to_uri(iri: None) -> None: ... +@overload +def iri_to_uri(iri: Union[str, Promise]) -> str: ... +@overload +def uri_to_iri(iri: None) -> None: ... +@overload +def uri_to_iri(iri: str) -> str: ... +def escape_uri_path(path: str) -> str: ... +def repercent_broken_unicode(path: bytes) -> bytes: ... +@overload +def filepath_to_uri(path: None) -> None: ... +@overload +def filepath_to_uri(path: str) -> str: ... +def get_system_encoding() -> str: ... + +DEFAULT_LOCALE_ENCODING: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/feedgenerator.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/feedgenerator.pyi new file mode 100644 index 00000000..ce0cb43d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/feedgenerator.pyi @@ -0,0 +1,76 @@ +from datetime import date, datetime +from typing import Any, Dict, List, Optional, Tuple, Union +from xml.sax import ContentHandler # type: ignore + +def rfc2822_date(date: date) -> str: ... +def rfc3339_date(date: date) -> str: ... +def get_tag_uri(url: str, date: Optional[date]) -> str: ... + +class SyndicationFeed: + feed: Dict[str, Any] = ... + items: List[Dict[str, Any]] = ... + def __init__( + self, + title: str, + link: str, + description: Optional[str], + language: Optional[str] = ..., + author_email: Optional[str] = ..., + author_name: Optional[str] = ..., + author_link: Optional[str] = ..., + subtitle: Optional[str] = ..., + categories: Optional[Tuple[str, str]] = ..., + feed_url: Optional[str] = ..., + feed_copyright: Optional[str] = ..., + feed_guid: Optional[str] = ..., + ttl: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + def add_item( + self, + title: str, + link: str, + description: str, + author_email: Optional[str] = ..., + author_name: Optional[str] = ..., + author_link: Optional[str] = ..., + pubdate: Optional[datetime] = ..., + comments: None = ..., + unique_id: Optional[str] = ..., + unique_id_is_permalink: Optional[bool] = ..., + categories: Optional[Tuple] = ..., + item_copyright: Optional[str] = ..., + ttl: None = ..., + updateddate: Optional[datetime] = ..., + enclosures: Optional[List[Enclosure]] = ..., + **kwargs: Any + ) -> None: ... + def num_items(self): ... + def root_attributes(self) -> Dict[Any, Any]: ... + def add_root_elements(self, handler: ContentHandler) -> None: ... + def item_attributes(self, item: Dict[str, Any]) -> Dict[Any, Any]: ... + def add_item_elements(self, handler: ContentHandler, item: Dict[str, Any]) -> None: ... + def write(self, outfile: Any, encoding: Any) -> None: ... + def writeString(self, encoding: str) -> str: ... + def latest_post_date(self) -> datetime: ... + +class Enclosure: + length: Any + mime_type: str + url: str = ... + def __init__(self, url: str, length: Union[int, str], mime_type: str) -> None: ... + +class RssFeed(SyndicationFeed): + content_type: str = ... + def write_items(self, handler: ContentHandler) -> None: ... + def endChannelElement(self, handler: ContentHandler) -> None: ... + +class RssUserland091Feed(RssFeed): ... +class Rss201rev2Feed(RssFeed): ... + +class Atom1Feed(SyndicationFeed): + content_type: str = ... + ns: str = ... + def write_items(self, handler: ContentHandler) -> None: ... + +DefaultFeed = Rss201rev2Feed diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/formats.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/formats.pyi new file mode 100644 index 00000000..7bf76d0a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/formats.pyi @@ -0,0 +1,31 @@ +from datetime import datetime, date, time +from decimal import Decimal +from typing import Any, Iterator, List, Optional, Union + +ISO_INPUT_FORMATS: Any +FORMAT_SETTINGS: Any + +def reset_format_cache() -> None: ... +def iter_format_modules(lang: str, format_module_path: Optional[Union[List[str], str]] = ...) -> Iterator[Any]: ... +def get_format_modules(lang: Optional[str] = ..., reverse: bool = ...) -> List[Any]: ... +def get_format(format_type: str, lang: Optional[str] = ..., use_l10n: Optional[bool] = ...) -> str: ... + +get_format_lazy: Any + +def date_format( + value: Union[date, datetime, str], format: Optional[str] = ..., use_l10n: Optional[bool] = ... +) -> str: ... +def time_format( + value: Union[time, datetime, str], format: Optional[str] = ..., use_l10n: Optional[bool] = ... +) -> str: ... +def number_format( + value: Union[Decimal, float, str], + decimal_pos: Optional[int] = ..., + use_l10n: Optional[bool] = ..., + force_grouping: bool = ..., +) -> str: ... +def localize(value: Any, use_l10n: Optional[bool] = ...) -> Any: ... +def localize_input( + value: Optional[Union[datetime, Decimal, float, str]], default: Optional[str] = ... +) -> Optional[str]: ... +def sanitize_separators(value: Union[Decimal, int, str]) -> Union[Decimal, int, str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/functional.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/functional.pyi new file mode 100644 index 00000000..40e415ac --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/functional.pyi @@ -0,0 +1,59 @@ +from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union, TypeVar, Generic, overload +from functools import wraps as wraps # noqa: F401 + +from django.db.models.base import Model + +def curry(_curried_func: Any, *args: Any, **kwargs: Any): ... + +_T = TypeVar("_T") + +class cached_property(Generic[_T]): + func: Callable[..., _T] = ... + __doc__: Any = ... + name: str = ... + def __init__(self, func: Callable[..., _T], name: Optional[str] = ...): ... + @overload + def __get__(self, instance: None, cls: Type[Any] = ...) -> "cached_property[_T]": ... + @overload + def __get__(self, instance: object, cls: Type[Any] = ...) -> _T: ... + +class Promise: ... + +def lazy(func: Union[Callable, Type[str]], *resultclasses: Any) -> Callable: ... +def lazystr(text: Any): ... +def keep_lazy(*resultclasses: Any) -> Callable: ... +def keep_lazy_text(func: Callable) -> Callable: ... + +empty: Any + +def new_method_proxy(func: Any): ... + +class LazyObject: + def __init__(self) -> None: ... + __getattr__: Any = ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __delattr__(self, name: str) -> None: ... + def __reduce__(self) -> Tuple[Callable, Tuple[Model]]: ... + def __copy__(self): ... + def __deepcopy__(self, memo: Any): ... + __bytes__: Any = ... + __bool__: Any = ... + __dir__: Any = ... + __class__: Any = ... + __ne__: Any = ... + __hash__: Any = ... + __getitem__: Any = ... + __setitem__: Any = ... + __delitem__: Any = ... + __iter__: Any = ... + __len__: Any = ... + __contains__: Any = ... + +def unpickle_lazyobject(wrapped: Model) -> Model: ... + +class SimpleLazyObject(LazyObject): + def __init__(self, func: Callable) -> None: ... + def __copy__(self) -> List[int]: ... + def __deepcopy__(self, memo: Dict[Any, Any]) -> List[int]: ... + +def partition(predicate: Callable, values: List[Model]) -> Tuple[List[Model], List[Model]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/hashable.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/hashable.pyi new file mode 100644 index 00000000..a049be97 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/hashable.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def make_hashable(value: Any) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/html.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/html.pyi new file mode 100644 index 00000000..314dcaa5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/html.pyi @@ -0,0 +1,37 @@ +from html.parser import HTMLParser +from typing import Any, Iterator, List, Optional, Tuple, Union + +from django.utils.safestring import SafeText + +TRAILING_PUNCTUATION_CHARS: str +WRAPPING_PUNCTUATION: Any +DOTS: Any +unencoded_ampersands_re: Any +word_split_re: Any +simple_url_re: Any +simple_url_2_re: Any + +def escape(text: Any) -> SafeText: ... +def escapejs(value: Any) -> SafeText: ... +def json_script(value: Any, element_id: str) -> SafeText: ... +def conditional_escape(text: Any) -> str: ... +def format_html(format_string: str, *args: Any, **kwargs: Any) -> SafeText: ... +def format_html_join( + sep: str, format_string: str, args_generator: Union[Iterator[Any], List[Tuple[str]]] +) -> SafeText: ... +def linebreaks(value: Any, autoescape: bool = ...) -> str: ... + +class MLStripper(HTMLParser): + fed: Any = ... + def __init__(self) -> None: ... + def handle_data(self, d: str) -> None: ... + def handle_entityref(self, name: str) -> None: ... + def handle_charref(self, name: str) -> None: ... + def get_data(self) -> str: ... + +def strip_tags(value: str) -> str: ... +def strip_spaces_between_tags(value: str) -> str: ... +def smart_urlquote(url: str) -> str: ... +def urlize(text: str, trim_url_limit: Optional[int] = ..., nofollow: bool = ..., autoescape: bool = ...) -> str: ... +def avoid_wrapping(value: str) -> str: ... +def html_safe(klass: Any): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/http.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/http.pyi new file mode 100644 index 00000000..5ba5da61 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/http.pyi @@ -0,0 +1,37 @@ +from typing import Any, Iterable, List, Optional, Tuple, Union + +ETAG_MATCH: Any +MONTHS: Any +RFC1123_DATE: Any +RFC850_DATE: Any +ASCTIME_DATE: Any +RFC3986_GENDELIMS: str +RFC3986_SUBDELIMS: str +FIELDS_MATCH: Any + +def urlquote(url: str, safe: str = ...) -> str: ... +def urlquote_plus(url: str, safe: str = ...) -> str: ... +def urlunquote(quoted_url: str) -> str: ... +def urlunquote_plus(quoted_url: str) -> str: ... +def urlencode(query: Any, doseq: bool = ...) -> str: ... +def cookie_date(epoch_seconds: Optional[float] = ...) -> str: ... +def http_date(epoch_seconds: Optional[float] = ...) -> str: ... +def parse_http_date(date: str) -> int: ... +def parse_http_date_safe(date: str) -> Optional[int]: ... +def base36_to_int(s: str) -> int: ... +def int_to_base36(i: int) -> str: ... +def urlsafe_base64_encode(s: bytes) -> str: ... +def urlsafe_base64_decode(s: Union[bytes, str]) -> bytes: ... +def parse_etags(etag_str: str) -> List[str]: ... +def quote_etag(etag_str: str) -> str: ... +def is_same_domain(host: str, pattern: str) -> bool: ... +def url_has_allowed_host_and_scheme( + url: Optional[str], allowed_hosts: Optional[Union[str, Iterable[str]]], require_https: bool = ... +) -> bool: ... +def is_safe_url( + url: Optional[str], allowed_hosts: Optional[Union[str, Iterable[str]]], require_https: bool = ... +) -> bool: ... +def limited_parse_qsl( + qs: str, keep_blank_values: bool = ..., encoding: str = ..., errors: str = ..., fields_limit: Optional[int] = ... +) -> List[Tuple[str, str]]: ... +def escape_leading_slashes(url: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/inspect.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/inspect.pyi new file mode 100644 index 00000000..9ae4d4f4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/inspect.pyi @@ -0,0 +1,8 @@ +from typing import Callable, List, Tuple + +def get_func_args(func: Callable) -> List[str]: ... +def get_func_full_args(func: Callable) -> List[Tuple[str]]: ... +def func_accepts_kwargs(func: Callable) -> bool: ... +def func_accepts_var_args(func: Callable) -> bool: ... +def method_has_no_args(meth: Callable) -> bool: ... +def func_supports_parameter(func: Callable, parameter: str) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/ipv6.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/ipv6.pyi new file mode 100644 index 00000000..e3669c57 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/ipv6.pyi @@ -0,0 +1,4 @@ +from typing import Any + +def clean_ipv6_address(ip_str: Any, unpack_ipv4: bool = ..., error_message: Any = ...): ... +def is_valid_ipv6_address(ip_str: str) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/itercompat.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/itercompat.pyi new file mode 100644 index 00000000..5c15fee5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/itercompat.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def is_iterable(x: Any) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/jslex.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/jslex.pyi new file mode 100644 index 00000000..8eedb830 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/jslex.pyi @@ -0,0 +1,26 @@ +from typing import Any, Dict, Iterator, List, Optional, Tuple + +class Tok: + num: int = ... + id: int = ... + name: str = ... + regex: str = ... + next: Optional[str] = ... + def __init__(self, name: str, regex: str, next: Optional[str] = ...) -> None: ... + +def literals(choices: str, prefix: str = ..., suffix: str = ...) -> str: ... + +class Lexer: + regexes: Any = ... + toks: Any = ... + state: Any = ... + def __init__(self, states: Dict[str, List[Tok]], first: str) -> None: ... + def lex(self, text: str) -> Iterator[Tuple[str, str]]: ... + +class JsLexer(Lexer): + both_before: Any = ... + both_after: Any = ... + states: Any = ... + def __init__(self) -> None: ... + +def prepare_js_for_gettext(js: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/log.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/log.pyi new file mode 100644 index 00000000..a9cd1274 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/log.pyi @@ -0,0 +1,45 @@ +import logging.config +from logging import LogRecord +from typing import Any, Callable, Dict, Optional, Union + +from django.core.management.color import Style + +request_logger: Any +DEFAULT_LOGGING: Any + +def configure_logging(logging_config: str, logging_settings: Dict[str, Any]) -> None: ... + +class AdminEmailHandler(logging.Handler): + include_html: bool = ... + email_backend: Optional[str] = ... + def __init__(self, include_html: bool = ..., email_backend: Optional[str] = ...) -> None: ... + def send_mail(self, subject: str, message: str, *args: Any, **kwargs: Any) -> None: ... + def connection(self) -> Any: ... + def format_subject(self, subject: str) -> str: ... + +class CallbackFilter(logging.Filter): + callback: Callable = ... + def __init__(self, callback: Callable) -> None: ... + def filter(self, record: Union[str, LogRecord]) -> bool: ... + +class RequireDebugFalse(logging.Filter): + def filter(self, record: Union[str, LogRecord]) -> bool: ... + +class RequireDebugTrue(logging.Filter): + def filter(self, record: Union[str, LogRecord]) -> bool: ... + +class ServerFormatter(logging.Formatter): + datefmt: None + style: Style = ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def uses_server_time(self) -> bool: ... + +def log_response( + message: str, + *args: Any, + response: Optional[Any] = ..., + request: Optional[Any] = ..., + logger: Any = ..., + level: Optional[Any] = ..., + exc_info: Optional[Any] = ... +) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/lorem_ipsum.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/lorem_ipsum.pyi new file mode 100644 index 00000000..1f9d9b32 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/lorem_ipsum.pyi @@ -0,0 +1,10 @@ +from typing import Any, List + +COMMON_P: str +WORDS: Any +COMMON_WORDS: Any + +def sentence() -> str: ... +def paragraph() -> str: ... +def paragraphs(count: int, common: bool = ...) -> List[str]: ... +def words(count: int, common: bool = ...) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/module_loading.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/module_loading.pyi new file mode 100644 index 00000000..2a2138dc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/module_loading.pyi @@ -0,0 +1,6 @@ +from typing import Any + +def import_string(dotted_path: str) -> Any: ... +def autodiscover_modules(*args: Any, **kwargs: Any) -> None: ... +def module_has_submodule(package: Any, module_name: str) -> bool: ... +def module_dir(module: Any) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/numberformat.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/numberformat.pyi new file mode 100644 index 00000000..c4c2122f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/numberformat.pyi @@ -0,0 +1,12 @@ +from decimal import Decimal +from typing import Optional, Sequence, Union + +def format( + number: Union[Decimal, float, str], + decimal_sep: str, + decimal_pos: Optional[int] = ..., + grouping: Union[int, Sequence[int]] = ..., + thousand_sep: str = ..., + force_grouping: bool = ..., + use_l10n: Optional[bool] = ..., +) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/regex_helper.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/regex_helper.pyi new file mode 100644 index 00000000..7f94850e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/regex_helper.pyi @@ -0,0 +1,16 @@ +from typing import Any, Iterator, List, Optional, Tuple, Type, Union + +ESCAPE_MAPPINGS: Any + +class Choice(list): ... +class Group(list): ... +class NonCapture(list): ... + +def normalize(pattern: str) -> List[Tuple[str, List[str]]]: ... +def next_char(input_iter: Any) -> None: ... +def walk_to_end(ch: str, input_iter: Iterator[Any]) -> None: ... +def get_quantifier(ch: str, input_iter: Iterator[Any]) -> Tuple[int, Optional[str]]: ... +def contains(source: Union[Group, NonCapture, str], inst: Type[Group]) -> bool: ... +def flatten_result( + source: Optional[Union[List[Union[Choice, Group, str]], Group, NonCapture]] +) -> Tuple[List[str], List[List[str]]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/safestring.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/safestring.pyi new file mode 100644 index 00000000..ac52284a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/safestring.pyi @@ -0,0 +1,26 @@ +from typing import TypeVar, overload, Callable, Any + +_SD = TypeVar("_SD", bound="SafeData") + +class SafeData: + def __html__(self: _SD) -> _SD: ... + +class SafeText(str, SafeData): + @overload + def __add__(self, rhs: SafeText) -> SafeText: ... + @overload + def __add__(self, rhs: str) -> str: ... + @overload + def __iadd__(self, rhs: SafeText) -> SafeText: ... + @overload + def __iadd__(self, rhs: str) -> str: ... + +SafeString = SafeText + +_C = TypeVar("_C", bound=Callable) +@overload +def mark_safe(s: _SD) -> _SD: ... +@overload +def mark_safe(s: _C) -> _C: ... +@overload +def mark_safe(s: Any) -> SafeText: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/six.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/six.pyi new file mode 100644 index 00000000..2dad9d97 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/six.pyi @@ -0,0 +1,106 @@ +from __future__ import print_function + +import types +import typing +import unittest +from typing import ( + Any, + AnyStr, + Callable, + Dict, + ItemsView, + Iterable, + KeysView, + Mapping, + NoReturn, + Optional, + Pattern, + Text, + Tuple, + Type, + TypeVar, + Union, + ValuesView, + overload, +) + +# Exports + +_T = TypeVar("_T") +_K = TypeVar("_K") +_V = TypeVar("_V") + +# TODO make constant, then move this stub to 2and3 +# https://github.com/python/typeshed/issues/17 +PY2 = False +PY3 = True +PY34 = ... # type: bool + +string_types = (str,) +integer_types = (int,) +class_types = (type,) +text_type = str +binary_type = bytes + +MAXSIZE = ... # type: int + +# def add_move +# def remove_move + +def callable(obj: object) -> bool: ... +def get_unbound_function(unbound: types.FunctionType) -> types.FunctionType: ... +def create_bound_method(func: types.FunctionType, obj: object) -> types.MethodType: ... +def create_unbound_method(func: types.FunctionType, cls: type) -> types.FunctionType: ... + +Iterator = object + +def get_method_function(meth: types.MethodType) -> types.FunctionType: ... +def get_method_self(meth: types.MethodType) -> Optional[object]: ... +def get_function_closure(fun: types.FunctionType) -> Optional[Tuple[types._Cell, ...]]: ... +def get_function_code(fun: types.FunctionType) -> types.CodeType: ... +def get_function_defaults(fun: types.FunctionType) -> Optional[Tuple[Any, ...]]: ... +def get_function_globals(fun: types.FunctionType) -> Dict[str, Any]: ... +def iterkeys(d: Mapping[_K, _V]) -> typing.Iterator[_K]: ... +def itervalues(d: Mapping[_K, _V]) -> typing.Iterator[_V]: ... +def iteritems(d: Mapping[_K, _V]) -> typing.Iterator[Tuple[_K, _V]]: ... + +# def iterlists + +def viewkeys(d: Mapping[_K, _V]) -> KeysView[_K]: ... +def viewvalues(d: Mapping[_K, _V]) -> ValuesView[_V]: ... +def viewitems(d: Mapping[_K, _V]) -> ItemsView[_K, _V]: ... +def b(s: str) -> binary_type: ... +def u(s: str) -> text_type: ... + +unichr = chr + +def int2byte(i: int) -> bytes: ... +def byte2int(bs: binary_type) -> int: ... +def indexbytes(buf: binary_type, i: int) -> int: ... +def iterbytes(buf: binary_type) -> typing.Iterator[int]: ... +def assertCountEqual( + self: unittest.TestCase, first: Iterable[_T], second: Iterable[_T], msg: Optional[str] = ... +) -> None: ... +@overload +def assertRaisesRegex(self: unittest.TestCase, msg: Optional[str] = ...) -> Any: ... +@overload +def assertRaisesRegex(self: unittest.TestCase, callable_obj: Callable[..., Any], *args: Any, **kwargs: Any) -> Any: ... +def assertRegex( + self: unittest.TestCase, text: AnyStr, expected_regex: Union[AnyStr, Pattern[AnyStr]], msg: Optional[str] = ... +) -> None: ... + +exec_ = exec + +def reraise( + tp: Optional[Type[BaseException]], value: Optional[BaseException], tb: Optional[types.TracebackType] = ... +) -> NoReturn: ... +def raise_from(value: Union[BaseException, Type[BaseException]], from_value: Optional[BaseException]) -> NoReturn: ... + +print_ = print + +def with_metaclass(meta: type, *bases: type) -> type: ... +def add_metaclass(metaclass: type) -> Callable[[_T], _T]: ... +def ensure_binary(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> bytes: ... +def ensure_str(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> str: ... +def ensure_text(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> Text: ... +def python_2_unicode_compatible(klass: _T) -> _T: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/termcolors.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/termcolors.pyi new file mode 100644 index 00000000..2065a51b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/termcolors.pyi @@ -0,0 +1,18 @@ +from typing import Any, Callable, Dict, Optional, Tuple, Union, Sequence + +color_names: Any +foreground: Any +background: Any +RESET: str +opt_dict: Any + +def colorize(text: Optional[str] = ..., opts: Sequence[str] = ..., **kwargs: Any) -> str: ... +def make_style(opts: Tuple = ..., **kwargs: Any) -> Callable: ... + +NOCOLOR_PALETTE: str +DARK_PALETTE: str +LIGHT_PALETTE: str +PALETTES: Any +DEFAULT_PALETTE: str = ... + +def parse_color_setting(config_string: str) -> Optional[Dict[str, Dict[str, Union[Tuple[str], str]]]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/text.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/text.pyi new file mode 100644 index 00000000..927e5144 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/text.pyi @@ -0,0 +1,47 @@ +from typing import Any, Iterable, Iterator, List, Optional, Union + +from django.db.models.base import Model +from django.utils.functional import SimpleLazyObject +from django.utils.safestring import SafeText + +def capfirst(x: Optional[str]) -> Optional[str]: ... + +re_words: Any +re_chars: Any +re_tag: Any +re_newlines: Any +re_camel_case: Any + +def wrap(text: str, width: int) -> str: ... + +class Truncator(SimpleLazyObject): + def __init__(self, text: Union[Model, str]) -> None: ... + def add_truncation_text(self, text: str, truncate: Optional[str] = ...) -> str: ... + def chars(self, num: int, truncate: Optional[str] = ..., html: bool = ...) -> str: ... + def words(self, num: int, truncate: Optional[str] = ..., html: bool = ...) -> str: ... + +def get_valid_filename(s: str) -> str: ... +def get_text_list(list_: List[str], last_word: str = ...) -> str: ... +def normalize_newlines(text: str) -> str: ... +def phone2numeric(phone: str) -> str: ... +def compress_string(s: bytes) -> bytes: ... + +class StreamingBuffer: + vals: List[bytes] = ... + def __init__(self) -> None: ... + def write(self, val: bytes) -> None: ... + def read(self) -> bytes: ... + def flush(self): ... + def close(self): ... + +def compress_sequence(sequence: Iterable[bytes]) -> Iterator[bytes]: ... + +smart_split_re: Any + +def smart_split(text: str) -> Iterator[str]: ... +def unescape_entities(text: str) -> str: ... +def unescape_string_literal(s: str) -> str: ... +def slugify(value: str, allow_unicode: bool = ...) -> SafeText: ... +def camel_case_to_spaces(value: str) -> str: ... + +format_lazy: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/timesince.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/timesince.pyi new file mode 100644 index 00000000..04e5b6a3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/timesince.pyi @@ -0,0 +1,10 @@ +from datetime import date +from typing import Any, Optional, Dict + +TIME_STRINGS: Dict[str, str] +TIMESINCE_CHUNKS: Any + +def timesince( + d: date, now: Optional[date] = ..., reversed: bool = ..., time_strings: Optional[Dict[str, str]] = ... +) -> str: ... +def timeuntil(d: date, now: Optional[date] = ..., time_strings: Optional[Dict[str, str]] = ...) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/timezone.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/timezone.pyi new file mode 100644 index 00000000..c61d4a5c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/timezone.pyi @@ -0,0 +1,62 @@ +import types +from contextlib import ContextDecorator +from datetime import date, datetime as datetime, time, timedelta as timedelta, tzinfo as tzinfo, timezone +from typing import Optional, Union, Type + +from pytz import BaseTzInfo + +_AnyTime = Union[time, datetime] + +class UTC(tzinfo): + def utcoffset(self, dt: Optional[datetime]) -> Optional[timedelta]: ... + def tzname(self, dt: Optional[datetime]) -> str: ... + def dst(self, dt: Optional[datetime]) -> Optional[timedelta]: ... + +class FixedOffset(tzinfo): + def __init__(self, offset: Optional[int] = ..., name: Optional[str] = ...) -> None: ... + def utcoffset(self, dt: Optional[datetime]) -> Optional[timedelta]: ... + def tzname(self, dt: Optional[datetime]) -> str: ... + def dst(self, dt: Optional[Union[datetime, timedelta]]) -> Optional[timedelta]: ... + +class ReferenceLocalTimezone(tzinfo): + STDOFFSET: timedelta = ... + DSTOFFSET: timedelta = ... + DSTDIFF: timedelta = ... + def __init__(self) -> None: ... + def utcoffset(self, dt: Optional[datetime]) -> Optional[timedelta]: ... + def dst(self, dt: Optional[datetime]) -> Optional[timedelta]: ... + def tzname(self, dt: Optional[datetime]) -> str: ... + +class LocalTimezone(ReferenceLocalTimezone): + def tzname(self, dt: Optional[datetime]) -> str: ... + +utc: UTC = ... + +def get_fixed_timezone(offset: Union[timedelta, int]) -> timezone: ... +def get_default_timezone() -> BaseTzInfo: ... +def get_default_timezone_name() -> str: ... + +# Strictly speaking, it is possible to activate() a non-pytz timezone, +# in which case BaseTzInfo is incorrect. However, this is unlikely, +# so we use it anyway, to keep things ergonomic for most users. +def get_current_timezone() -> BaseTzInfo: ... +def get_current_timezone_name() -> str: ... +def activate(timezone: Union[tzinfo, str]) -> None: ... +def deactivate() -> None: ... + +class override(ContextDecorator): + timezone: tzinfo = ... + old_timezone: Optional[tzinfo] = ... + def __init__(self, timezone: Optional[Union[str, tzinfo]]) -> None: ... + def __enter__(self) -> None: ... + def __exit__( + self, exc_type: Type[BaseException], exc_value: BaseException, traceback: types.TracebackType + ) -> None: ... + +def localtime(value: Optional[_AnyTime] = ..., timezone: Optional[tzinfo] = ...) -> datetime: ... +def localdate(value: Optional[_AnyTime] = ..., timezone: Optional[tzinfo] = ...) -> date: ... +def now() -> datetime: ... +def is_aware(value: _AnyTime) -> bool: ... +def is_naive(value: _AnyTime) -> bool: ... +def make_aware(value: _AnyTime, timezone: Optional[tzinfo] = ..., is_dst: Optional[bool] = ...) -> datetime: ... +def make_naive(value: _AnyTime, timezone: Optional[tzinfo] = ...) -> datetime: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/topological_sort.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/topological_sort.pyi new file mode 100644 index 00000000..0a537a55 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/topological_sort.pyi @@ -0,0 +1,6 @@ +from typing import Any, Dict, Iterator, Set, Container, List + +class CyclicDependencyError(ValueError): ... + +def topological_sort_as_sets(dependency_graph: Dict[Any, Any]) -> Iterator[Set[Any]]: ... +def stable_topological_sort(l: Container[Any], dependency_graph: Dict[Any, Any]) -> List[Any]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/translation/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/translation/__init__.pyi new file mode 100644 index 00000000..9aec2123 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/translation/__init__.pyi @@ -0,0 +1,72 @@ +import functools +from contextlib import ContextDecorator +from typing import Any, Optional, Callable + +from django.core.handlers.wsgi import WSGIRequest + +LANGUAGE_SESSION_KEY: str + +class TranslatorCommentWarning(SyntaxWarning): ... + +class Trans: + activate: Callable + check_for_language: functools._lru_cache_wrapper + deactivate: Callable + deactivate_all: Callable + get_language: Callable + get_language_bidi: Callable + get_language_from_path: Callable + get_language_from_request: Callable + gettext: Callable + gettext_noop: Callable + ngettext: Callable + npgettext: Callable + pgettext: Callable + def __getattr__(self, real_name: Any): ... + +def gettext_noop(message: str) -> str: ... + +ugettext_noop = gettext_noop + +def gettext(message: str) -> str: ... + +ugettext = gettext + +def ngettext(singular: str, plural: str, number: float) -> str: ... + +ungettext = ngettext + +def pgettext(context: str, message: str) -> str: ... +def npgettext(context: str, singular: str, plural: str, number: int) -> str: ... + +gettext_lazy = gettext +ugettext_lazy = ugettext +pgettext_lazy = pgettext +ngettext_lazy = ngettext +ungettext_lazy = ungettext +npgettext_lazy = npgettext + +def activate(language: str) -> None: ... +def deactivate() -> None: ... + +class override(ContextDecorator): + language: Optional[str] = ... + deactivate: bool = ... + def __init__(self, language: Optional[str], deactivate: bool = ...) -> None: ... + old_language: Optional[str] = ... + def __enter__(self) -> None: ... + def __exit__(self, exc_type: None, exc_value: None, traceback: None) -> None: ... + +def get_language() -> Optional[str]: ... +def get_language_from_path(path: str) -> Optional[str]: ... +def get_language_bidi() -> bool: ... +def check_for_language(lang_code: Optional[str]) -> bool: ... +def to_language(locale: str) -> str: ... +def to_locale(language: str) -> str: ... +def get_language_from_request(request: WSGIRequest, check_path: bool = ...) -> str: ... +def templatize(src: str, **kwargs: Any) -> str: ... +def deactivate_all() -> None: ... +def get_supported_language_variant(lang_code: str, strict: bool = ...) -> str: ... +def get_language_info(lang_code: str) -> Any: ... + +from . import trans_real as trans_real diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/translation/reloader.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/translation/reloader.pyi new file mode 100644 index 00000000..f1051528 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/translation/reloader.pyi @@ -0,0 +1,7 @@ +from pathlib import Path +from typing import Any, Optional + +from django.utils.autoreload import BaseReloader + +def watch_for_translation_changes(sender: BaseReloader, **kwargs: Any) -> None: ... +def translation_file_changed(sender: Optional[BaseReloader], file_path: Path, **kwargs: Any) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/translation/template.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/translation/template.pyi new file mode 100644 index 00000000..90588a42 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/translation/template.pyi @@ -0,0 +1,14 @@ +from typing import Any + +dot_re: Any + +def blankout(src: str, char: str) -> str: ... + +context_re: Any +inline_re: Any +block_re: Any +endblock_re: Any +plural_re: Any +constant_re: Any + +def templatize(src: str, origin: str = ...) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/translation/trans_null.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/translation/trans_null.pyi new file mode 100644 index 00000000..3d8418fe --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/translation/trans_null.pyi @@ -0,0 +1,25 @@ +from typing import Any + +def gettext(message: Any): ... + +gettext_noop = gettext +gettext_lazy = gettext +_ = gettext + +def ngettext(singular: str, plural: str, number: int) -> str: ... + +ngettext_lazy = ngettext + +def pgettext(context: Any, message: Any): ... +def npgettext(context: Any, singular: Any, plural: Any, number: Any): ... +def activate(x: Any): ... +def deactivate(): ... + +deactivate_all = deactivate + +def get_language(): ... +def get_language_bidi() -> bool: ... +def check_for_language(x: str) -> bool: ... +def get_language_from_request(request: None, check_path: bool = ...) -> str: ... +def get_language_from_path(request: str) -> None: ... +def get_supported_language_variant(lang_code: str, strict: bool = ...) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/translation/trans_real.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/translation/trans_real.pyi new file mode 100644 index 00000000..f07e1b2d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/translation/trans_real.pyi @@ -0,0 +1,42 @@ +import gettext as gettext_module +from collections import OrderedDict +from gettext import NullTranslations +from typing import Any, List, Optional, Tuple, Callable + +from django.core.handlers.wsgi import WSGIRequest + +CONTEXT_SEPARATOR: str +accept_language_re: Any +language_code_re: Any +language_code_prefix_re: Any + +def reset_cache(**kwargs: Any) -> None: ... + +class DjangoTranslation(gettext_module.GNUTranslations): + domain: str = ... + plural: Callable = ... + def __init__(self, language: str, domain: Optional[str] = ..., localedirs: Optional[List[str]] = ...) -> None: ... + def merge(self, other: NullTranslations) -> None: ... + def language(self): ... + def to_language(self) -> str: ... + +def translation(language: str) -> DjangoTranslation: ... +def activate(language: str) -> None: ... +def deactivate() -> None: ... +def deactivate_all() -> None: ... +def get_language() -> Optional[str]: ... +def get_language_bidi() -> bool: ... +def catalog(): ... +def gettext(message: str) -> str: ... +def pgettext(context: str, message: str) -> str: ... +def gettext_noop(message: str) -> str: ... +def do_ntranslate(singular: str, plural: str, number: float, translation_function: str) -> str: ... +def ngettext(singular: str, plural: str, number: float) -> str: ... +def npgettext(context: str, singular: str, plural: str, number: int) -> str: ... +def all_locale_paths() -> List[str]: ... +def check_for_language(lang_code: Optional[str]) -> bool: ... +def get_languages() -> OrderedDict: ... +def get_supported_language_variant(lang_code: Optional[str], strict: bool = ...) -> str: ... +def get_language_from_path(path: str, strict: bool = ...) -> Optional[str]: ... +def get_language_from_request(request: WSGIRequest, check_path: bool = ...) -> str: ... +def parse_accept_lang_header(lang_string: str) -> Tuple: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/tree.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/tree.pyi new file mode 100644 index 00000000..75a7c7b2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/tree.pyi @@ -0,0 +1,21 @@ +from typing import Any, Dict, Iterable, Optional, Tuple, Union, Sequence, List + +from django.db.models.sql.where import NothingNode + +_NodeChildren = Iterable[Union["Node", NothingNode, Sequence[Any]]] + +class Node: + children: List[Any] + default: Any = ... + connector: str = ... + negated: bool = ... + def __init__( + self, children: Optional[_NodeChildren] = ..., connector: Optional[str] = ..., negated: bool = ... + ) -> None: ... + def __deepcopy__(self, memodict: Dict[Any, Any]) -> Node: ... + def __len__(self) -> int: ... + def __bool__(self) -> bool: ... + def __contains__(self, other: Tuple[str, int]) -> bool: ... + def __hash__(self) -> int: ... + def add(self, data: Any, conn_type: str, squash: bool = ...) -> Any: ... + def negate(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/version.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/version.pyi new file mode 100644 index 00000000..e90b9607 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/version.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional, Tuple + +PY36: Any +PY37: Any +PY38: Any +PY39: Any + +def get_version(version: Optional[Tuple[int, int, int, str, int]] = ...) -> str: ... +def get_main_version(version: Tuple[int, int, int, str, int] = ...) -> str: ... +def get_complete_version(version: Optional[Tuple[int, int, int, str, int]] = ...) -> Tuple[int, int, int, str, int]: ... +def get_docs_version(version: None = ...) -> str: ... +def get_git_changeset(): ... +def get_version_tuple(version: str) -> Tuple[int, int, int]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/xmlutils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/xmlutils.pyi new file mode 100644 index 00000000..45d8c4c3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/utils/xmlutils.pyi @@ -0,0 +1,11 @@ +from typing import Dict, Optional +from xml.sax.saxutils import XMLGenerator + +class UnserializableContentError(ValueError): ... + +class SimplerXMLGenerator(XMLGenerator): + def addQuickElement( + self, name: str, contents: Optional[str] = ..., attrs: Optional[Dict[str, str]] = ... + ) -> None: ... + def characters(self, content: str) -> None: ... + def startElement(self, name: str, attrs: Dict[str, str]) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/__init__.pyi new file mode 100644 index 00000000..cff086f3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/__init__.pyi @@ -0,0 +1 @@ +from .generic.base import View as View diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/csrf.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/csrf.pyi new file mode 100644 index 00000000..7b76e7df --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/csrf.pyi @@ -0,0 +1,7 @@ +from django.http.request import HttpRequest +from django.http.response import HttpResponseForbidden + +CSRF_FAILURE_TEMPLATE: str +CSRF_FAILURE_TEMPLATE_NAME: str + +def csrf_failure(request: HttpRequest, reason: str = ..., template_name: str = ...) -> HttpResponseForbidden: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/debug.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/debug.pyi new file mode 100644 index 00000000..a7e1aad8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/debug.pyi @@ -0,0 +1,66 @@ +from importlib.abc import SourceLoader +from types import TracebackType +from typing import Any, Callable, Dict, List, MutableMapping, Optional, Type, Union + +from django.http.request import HttpRequest, QueryDict +from django.http.response import Http404, HttpResponse +from django.utils.safestring import SafeText + +DEBUG_ENGINE: Any +HIDDEN_SETTINGS: Any +CLEANSED_SUBSTITUTE: str +CURRENT_DIR: Any + +class CallableSettingWrapper: + def __init__(self, callable_setting: Union[Callable, Type[Any]]) -> None: ... + +def cleanse_setting(key: Union[int, str], value: Any) -> Any: ... +def get_safe_settings() -> Dict[str, Any]: ... +def technical_500_response(request: Any, exc_type: Any, exc_value: Any, tb: Any, status_code: int = ...): ... +def get_default_exception_reporter_filter() -> ExceptionReporterFilter: ... +def get_exception_reporter_filter(request: Optional[HttpRequest]) -> ExceptionReporterFilter: ... + +class ExceptionReporterFilter: + def get_post_parameters(self, request: Any): ... + def get_traceback_frame_variables(self, request: Any, tb_frame: Any): ... + +class SafeExceptionReporterFilter(ExceptionReporterFilter): + def is_active(self, request: Optional[HttpRequest]) -> bool: ... + def get_cleansed_multivaluedict(self, request: HttpRequest, multivaluedict: QueryDict) -> QueryDict: ... + def get_post_parameters(self, request: Optional[HttpRequest]) -> MutableMapping[str, Any]: ... + def cleanse_special_types(self, request: Optional[HttpRequest], value: Any) -> Any: ... + def get_traceback_frame_variables(self, request: Any, tb_frame: Any): ... + +class ExceptionReporter: + request: Optional[HttpRequest] = ... + filter: ExceptionReporterFilter = ... + exc_type: Optional[Type[BaseException]] = ... + exc_value: Optional[str] = ... + tb: Optional[TracebackType] = ... + is_email: bool = ... + template_info: None = ... + template_does_not_exist: bool = ... + postmortem: None = ... + def __init__( + self, + request: Optional[HttpRequest], + exc_type: Optional[Type[BaseException]], + exc_value: Optional[Union[str, BaseException]], + tb: Optional[TracebackType], + is_email: bool = ..., + ) -> None: ... + def get_traceback_data(self) -> Dict[str, Any]: ... + def get_traceback_html(self) -> SafeText: ... + def get_traceback_text(self) -> SafeText: ... + def get_traceback_frames(self) -> List[Any]: ... + def _get_lines_from_file( + self, + filename: str, + lineno: int, + context_lines: int, + loader: Optional[SourceLoader] = ..., + module_name: Optional[str] = ..., + ): ... + +def technical_404_response(request: HttpRequest, exception: Http404) -> HttpResponse: ... +def default_urlconf(request: Optional[HttpResponse]) -> HttpResponse: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/cache.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/cache.pyi new file mode 100644 index 00000000..992df85e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/cache.pyi @@ -0,0 +1,7 @@ +from typing import Any, Callable, Optional, TypeVar + +_F = TypeVar("_F", bound=Callable[..., Any]) + +def cache_page(timeout: float, *, cache: Optional[Any] = ..., key_prefix: Optional[Any] = ...) -> Callable: ... +def cache_control(**kwargs: Any) -> Callable: ... +def never_cache(view_func: _F) -> _F: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/clickjacking.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/clickjacking.pyi new file mode 100644 index 00000000..f93f1ff0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/clickjacking.pyi @@ -0,0 +1,7 @@ +from typing import Callable, TypeVar, Any + +_F = TypeVar("_F", bound=Callable[..., Any]) + +def xframe_options_deny(view_func: _F) -> _F: ... +def xframe_options_sameorigin(view_func: _F) -> _F: ... +def xframe_options_exempt(view_func: _F) -> _F: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/csrf.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/csrf.pyi new file mode 100644 index 00000000..a9f9a047 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/csrf.pyi @@ -0,0 +1,19 @@ +from typing import Any, Callable, TypeVar + +from django.middleware.csrf import CsrfViewMiddleware + +csrf_protect: Any + +class _EnsureCsrfToken(CsrfViewMiddleware): ... + +requires_csrf_token: Any + +class _EnsureCsrfCookie(CsrfViewMiddleware): + get_response: None + def process_view(self, request: Any, callback: Any, callback_args: Any, callback_kwargs: Any): ... + +ensure_csrf_cookie: Any + +_F = TypeVar("_F", bound=Callable[..., Any]) + +def csrf_exempt(view_func: _F) -> _F: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/debug.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/debug.pyi new file mode 100644 index 00000000..e437d4e1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/debug.pyi @@ -0,0 +1,4 @@ +from typing import Any, Callable + +def sensitive_variables(*variables: Any) -> Callable: ... +def sensitive_post_parameters(*parameters: Any) -> Callable: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/gzip.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/gzip.pyi new file mode 100644 index 00000000..7b3766c9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/gzip.pyi @@ -0,0 +1,5 @@ +from typing import Callable, TypeVar, Any + +_C = TypeVar("_C", bound=Callable[..., Any]) + +def gzip_page(view_func: _C) -> _C: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/http.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/http.pyi new file mode 100644 index 00000000..1edc5f75 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/http.pyi @@ -0,0 +1,12 @@ +from typing import Any, Callable, List, Optional, TypeVar + +_F = TypeVar("_F", bound=Callable[..., Any]) + +def conditional_page(_F) -> _F: ... +def require_http_methods(request_method_list: List[str]) -> Callable: ... +def require_GET(_F) -> _F: ... +def require_POST(_F) -> _F: ... +def require_safe(_F) -> _F: ... +def condition(etag_func: Optional[Callable] = ..., last_modified_func: Optional[Callable] = ...) -> Callable: ... +def etag(etag_func: Callable[..., Any]) -> Callable[[_F], _F]: ... +def last_modified(last_modified_func: Callable[..., Any]) -> Callable[[_F], _F]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/vary.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/vary.pyi new file mode 100644 index 00000000..0601a4ae --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/decorators/vary.pyi @@ -0,0 +1,6 @@ +from typing import Any, Callable, TypeVar + +_F = TypeVar("_F", bound=Callable[..., Any]) + +def vary_on_headers(*headers: Any) -> Callable: ... +def vary_on_cookie(func: _F) -> _F: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/defaults.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/defaults.pyi new file mode 100644 index 00000000..3241eb8f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/defaults.pyi @@ -0,0 +1,23 @@ +from typing import Optional + +from django.http.request import HttpRequest +from django.http.response import ( + HttpResponseBadRequest, + HttpResponseForbidden, + HttpResponseNotFound, + HttpResponseServerError, +) + +ERROR_404_TEMPLATE_NAME: str +ERROR_403_TEMPLATE_NAME: str +ERROR_400_TEMPLATE_NAME: str +ERROR_500_TEMPLATE_NAME: str + +def page_not_found( + request: HttpRequest, exception: Optional[Exception], template_name: str = ... +) -> HttpResponseNotFound: ... +def server_error(request: HttpRequest, template_name: str = ...) -> HttpResponseServerError: ... +def bad_request(request: HttpRequest, exception: Exception, template_name: str = ...) -> HttpResponseBadRequest: ... +def permission_denied( + request: HttpRequest, exception: Exception, template_name: str = ... +) -> HttpResponseForbidden: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/generic/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/generic/__init__.pyi new file mode 100644 index 00000000..da416059 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/generic/__init__.pyi @@ -0,0 +1,15 @@ +from .base import RedirectView as RedirectView, TemplateView as TemplateView, View as View +from .dates import ( + ArchiveIndexView as ArchiveIndexView, + DateDetailView as DateDetailView, + DayArchiveView as DayArchiveView, + MonthArchiveView as MonthArchiveView, + TodayArchiveView as TodayArchiveView, + WeekArchiveView as WeekArchiveView, + YearArchiveView as YearArchiveView, +) +from .detail import DetailView as DetailView +from .edit import CreateView as CreateView, DeleteView as DeleteView, FormView as FormView, UpdateView as UpdateView +from .list import ListView as ListView + +class GenericViewError(Exception): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/generic/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/generic/base.pyi new file mode 100644 index 00000000..d9eb72e6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/generic/base.pyi @@ -0,0 +1,44 @@ +from typing import Any, Callable, Dict, List, Optional, Type + +from django import http + +class ContextMixin: + def get_context_data(self, **kwargs: Any) -> Dict[str, Any]: ... + +class View: + http_method_names: List[str] = ... + request: http.HttpRequest = ... + args: Any = ... + kwargs: Any = ... + def __init__(self, **kwargs: Any) -> None: ... + @classmethod + def as_view(cls: Any, **initkwargs: Any) -> Callable[..., http.HttpResponse]: ... + def setup(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> None: ... + def dispatch(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> http.HttpResponse: ... + def http_method_not_allowed(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> http.HttpResponse: ... + def options(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> http.HttpResponse: ... + +class TemplateResponseMixin: + template_name: str = ... + template_engine: Optional[str] = ... + response_class: Type[http.HttpResponse] = ... + content_type: Optional[str] = ... + request: http.HttpRequest = ... + def render_to_response(self, context: Dict[str, Any], **response_kwargs: Any) -> http.HttpResponse: ... + def get_template_names(self) -> List[str]: ... + +class TemplateView(TemplateResponseMixin, ContextMixin, View): + def get(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> http.HttpResponse: ... + +class RedirectView(View): + permanent: bool = ... + url: Optional[str] = ... + pattern_name: Optional[str] = ... + query_string: bool = ... + def get_redirect_url(self, *args: Any, **kwargs: Any) -> Optional[str]: ... + def get(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> http.HttpResponse: ... + def head(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> http.HttpResponse: ... + def post(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> http.HttpResponse: ... + def delete(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> http.HttpResponse: ... + def put(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> http.HttpResponse: ... + def patch(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> http.HttpResponse: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/generic/dates.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/generic/dates.pyi new file mode 100644 index 00000000..19549817 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/generic/dates.pyi @@ -0,0 +1,82 @@ +import datetime +from typing import Any, Dict, Optional, Sequence, Tuple + +from django.views.generic.base import View +from django.views.generic.detail import BaseDetailView, SingleObjectTemplateResponseMixin +from django.views.generic.list import MultipleObjectMixin, MultipleObjectTemplateResponseMixin + +from django.db import models +from django.http import HttpRequest, HttpResponse + +class YearMixin: + year_format: str = ... + year: Optional[str] = ... + def get_year_format(self) -> str: ... + def get_year(self) -> str: ... + def get_next_year(self, date: datetime.date) -> Optional[datetime.date]: ... + def get_previous_year(self, date: datetime.date) -> Optional[datetime.date]: ... + +class MonthMixin: + month_format: str = ... + month: Optional[str] = ... + def get_month_format(self) -> str: ... + def get_month(self) -> str: ... + def get_next_month(self, date: datetime.date) -> Optional[datetime.date]: ... + def get_previous_month(self, date: datetime.date) -> Optional[datetime.date]: ... + +class DayMixin: + day_format: str = ... + day: Optional[str] = ... + def get_day_format(self) -> str: ... + def get_day(self) -> str: ... + def get_next_day(self, date: datetime.date) -> Optional[datetime.date]: ... + def get_previous_day(self, date: datetime.date) -> Optional[datetime.date]: ... + +class WeekMixin: + week_format: str = ... + week: Optional[str] = ... + def get_week_format(self) -> str: ... + def get_week(self) -> str: ... + def get_next_week(self, date: datetime.date) -> Optional[datetime.date]: ... + def get_previous_week(self, date: datetime.date) -> Optional[datetime.date]: ... + +class DateMixin: + date_field: Optional[str] = ... + allow_future: bool = ... + def get_date_field(self) -> str: ... + def get_allow_future(self) -> bool: ... + def uses_datetime_field(self) -> bool: ... + +DatedItems = Tuple[Optional[Sequence[datetime.date]], Sequence[object], Dict[str, Any]] + +class BaseDateListView(MultipleObjectMixin, DateMixin, View): + date_list_period: str = ... + def render_to_response(self, context: Dict[str, Any], **response_kwargs: Any) -> HttpResponse: ... + def get(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ... + def get_dated_items(self) -> DatedItems: ... + def get_dated_queryset(self, **lookup: Any) -> models.query.QuerySet: ... + def get_date_list_period(self) -> str: ... + def get_date_list( + self, queryset: models.query.QuerySet, date_type: Optional[str] = ..., ordering: str = ... + ) -> models.query.QuerySet: ... + +class BaseArchiveIndexView(BaseDateListView): ... +class ArchiveIndexView(MultipleObjectTemplateResponseMixin, BaseArchiveIndexView): ... + +class BaseYearArchiveView(YearMixin, BaseDateListView): + make_object_list: bool = ... + def get_make_object_list(self) -> bool: ... + +class YearArchiveView(MultipleObjectTemplateResponseMixin, BaseYearArchiveView): ... +class BaseMonthArchiveView(YearMixin, MonthMixin, BaseDateListView): ... +class MonthArchiveView(MultipleObjectTemplateResponseMixin, BaseMonthArchiveView): ... +class BaseWeekArchiveView(YearMixin, WeekMixin, BaseDateListView): ... +class WeekArchiveView(MultipleObjectTemplateResponseMixin, BaseWeekArchiveView): ... +class BaseDayArchiveView(YearMixin, MonthMixin, DayMixin, BaseDateListView): ... +class DayArchiveView(MultipleObjectTemplateResponseMixin, BaseDayArchiveView): ... +class BaseTodayArchiveView(BaseDayArchiveView): ... +class TodayArchiveView(MultipleObjectTemplateResponseMixin, BaseTodayArchiveView): ... +class BaseDateDetailView(YearMixin, MonthMixin, DayMixin, DateMixin, BaseDetailView): ... +class DateDetailView(SingleObjectTemplateResponseMixin, BaseDateDetailView): ... + +def timezone_today() -> datetime.date: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/generic/detail.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/generic/detail.pyi new file mode 100644 index 00000000..70229eac --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/generic/detail.pyi @@ -0,0 +1,28 @@ +from typing import Any, Optional, Type + +from django.views.generic.base import ContextMixin, TemplateResponseMixin, View + +from django.db import models +from django.http import HttpRequest, HttpResponse + +class SingleObjectMixin(ContextMixin): + model: Type[models.Model] = ... + queryset: models.query.QuerySet = ... + slug_field: str = ... + context_object_name: str = ... + slug_url_kwarg: str = ... + pk_url_kwarg: str = ... + query_pk_and_slug: bool = ... + def get_object(self, queryset: Optional[models.query.QuerySet] = ...) -> models.Model: ... + def get_queryset(self) -> models.query.QuerySet: ... + def get_slug_field(self) -> str: ... + def get_context_object_name(self, obj: Any) -> Optional[str]: ... + +class BaseDetailView(SingleObjectMixin, View): + def get(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ... + +class SingleObjectTemplateResponseMixin(TemplateResponseMixin): + template_name_field: Optional[str] = ... + template_name_suffix: str = ... + +class DetailView(SingleObjectTemplateResponseMixin, BaseDetailView): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/generic/edit.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/generic/edit.pyi new file mode 100644 index 00000000..219ebedb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/generic/edit.pyi @@ -0,0 +1,46 @@ +from typing import Any, Callable, Dict, Optional, Sequence, Type, Union + +from django.forms.forms import BaseForm +from django.views.generic.base import ContextMixin, TemplateResponseMixin, View +from django.views.generic.detail import BaseDetailView, SingleObjectMixin, SingleObjectTemplateResponseMixin +from typing_extensions import Literal + +from django.http import HttpRequest, HttpResponse + +class FormMixin(ContextMixin): + initial: Dict[str, Any] = ... + form_class: Optional[Type[BaseForm]] = ... + success_url: Optional[Union[str, Callable[..., Any]]] = ... + prefix: Optional[str] = ... + def get_initial(self) -> Dict[str, Any]: ... + def get_prefix(self) -> Optional[str]: ... + def get_form_class(self) -> Type[BaseForm]: ... + def get_form(self, form_class: Optional[Type[BaseForm]] = ...) -> BaseForm: ... + def get_form_kwargs(self) -> Dict[str, Any]: ... + def get_success_url(self) -> str: ... + def form_valid(self, form: BaseForm) -> HttpResponse: ... + def form_invalid(self, form: BaseForm) -> HttpResponse: ... + +class ModelFormMixin(FormMixin, SingleObjectMixin): + fields: Optional[Union[Sequence[str], Literal["__all__"]]] = ... + +class ProcessFormView(View): + def get(self, request: HttpRequest, *args: str, **kwargs: Any) -> HttpResponse: ... + def post(self, request: HttpRequest, *args: str, **kwargs: Any) -> HttpResponse: ... + def put(self, *args: str, **kwargs: Any) -> HttpResponse: ... + +class BaseFormView(FormMixin, ProcessFormView): ... +class FormView(TemplateResponseMixin, BaseFormView): ... +class BaseCreateView(ModelFormMixin, ProcessFormView): ... +class CreateView(SingleObjectTemplateResponseMixin, BaseCreateView): ... +class BaseUpdateView(ModelFormMixin, ProcessFormView): ... +class UpdateView(SingleObjectTemplateResponseMixin, BaseUpdateView): ... + +class DeletionMixin: + success_url: Optional[str] = ... + def post(self, request: HttpRequest, *args: str, **kwargs: Any) -> HttpResponse: ... + def delete(self, request: HttpRequest, *args: str, **kwargs: Any) -> HttpResponse: ... + def get_success_url(self) -> str: ... + +class BaseDeleteView(DeletionMixin, BaseDetailView): ... +class DeleteView(SingleObjectTemplateResponseMixin, BaseDeleteView): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/generic/list.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/generic/list.pyi new file mode 100644 index 00000000..c9337978 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/generic/list.pyi @@ -0,0 +1,37 @@ +from typing import Any, Optional, Sequence, Tuple, Type + +from django.core.paginator import Paginator +from django.db.models.query import QuerySet, _BaseQuerySet +from django.views.generic.base import ContextMixin, TemplateResponseMixin, View + +from django.db.models import Model +from django.http import HttpRequest, HttpResponse + +class MultipleObjectMixin(ContextMixin): + allow_empty: bool = ... + queryset: Optional[QuerySet] = ... + model: Optional[Type[Model]] = ... + paginate_by: int = ... + paginate_orphans: int = ... + context_object_name: Optional[str] = ... + paginator_class: Type[Paginator] = ... + page_kwarg: str = ... + ordering: Sequence[str] = ... + def get_queryset(self) -> QuerySet: ... + def get_ordering(self) -> Sequence[str]: ... + def paginate_queryset(self, queryset: _BaseQuerySet, page_size: int) -> Tuple[Paginator, int, QuerySet, bool]: ... + def get_paginate_by(self, queryset: _BaseQuerySet) -> Optional[int]: ... + def get_paginator( + self, queryset: QuerySet, per_page: int, orphans: int = ..., allow_empty_first_page: bool = ..., **kwargs: Any + ) -> Paginator: ... + def get_paginate_orphans(self) -> int: ... + def get_allow_empty(self) -> bool: ... + def get_context_object_name(self, object_list: _BaseQuerySet) -> Optional[str]: ... + +class BaseListView(MultipleObjectMixin, View): + def get(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ... + +class MultipleObjectTemplateResponseMixin(TemplateResponseMixin): + template_name_suffix: str = ... + +class ListView(MultipleObjectTemplateResponseMixin, BaseListView): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/i18n.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/i18n.pyi new file mode 100644 index 00000000..eec1bd95 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/i18n.pyi @@ -0,0 +1,31 @@ +from typing import Any, Callable, Dict, List, Optional, Union + +from django.http.request import HttpRequest +from django.http.response import HttpResponse +from django.utils.translation.trans_real import DjangoTranslation + +from django.views.generic import View + +LANGUAGE_QUERY_PARAMETER: str + +def set_language(request: HttpRequest) -> HttpResponse: ... +def get_formats() -> Dict[str, Union[List[str], int, str]]: ... + +js_catalog_template: str + +def render_javascript_catalog(catalog: Optional[Any] = ..., plural: Optional[Any] = ...): ... +def null_javascript_catalog(request: Any, domain: Optional[Any] = ..., packages: Optional[Any] = ...): ... + +class JavaScriptCatalog(View): + head: Callable + domain: str = ... + packages: List[str] = ... + translation: DjangoTranslation = ... + def get(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ... + def get_paths(self, packages: List[str]) -> List[str]: ... + def get_plural(self) -> None: ... + def get_catalog(self) -> Dict[str, Union[List[str], str]]: ... + def get_context_data(self, **kwargs: Any) -> Dict[str, Any]: ... + def render_to_response(self, context: Dict[str, Any], **response_kwargs: Any) -> HttpResponse: ... + +class JSONCatalog(JavaScriptCatalog): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/static.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/static.pyi new file mode 100644 index 00000000..9c9e04a7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/django-stubs/django-stubs/views/static.pyi @@ -0,0 +1,12 @@ +from typing import Any, Optional + +from django.http.request import HttpRequest +from django.http.response import FileResponse + +def serve(request: HttpRequest, path: str, document_root: str = ..., show_indexes: bool = ...) -> FileResponse: ... + +DEFAULT_DIRECTORY_INDEX_TEMPLATE: str +template_translatable: Any + +def directory_index(path: Any, fullpath: Any): ... +def was_modified_since(header: Optional[str] = ..., mtime: float = ..., size: int = ...) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/LICENSE b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/LICENSE new file mode 100644 index 00000000..e5833ae4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/LICENSE @@ -0,0 +1,238 @@ +The "typeshed" project is licensed under the terms of the Apache license, as +reproduced below. + += = = = = + +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + += = = = = + +Parts of typeshed are licensed under different licenses (like the MIT +license), reproduced below. + += = = = = + +The MIT License + +Copyright (c) 2015 Jukka Lehtosalo and contributors + +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +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. + += = = = = + diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/BaseHTTPServer.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/BaseHTTPServer.pyi new file mode 100644 index 00000000..ad5f24e2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/BaseHTTPServer.pyi @@ -0,0 +1,47 @@ +# Stubs for BaseHTTPServer (Python 2.7) + +from typing import Any, BinaryIO, Callable, Mapping, Optional, Tuple, Union +import SocketServer +import mimetools + +class HTTPServer(SocketServer.TCPServer): + server_name: str + server_port: int + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: Callable[..., BaseHTTPRequestHandler]) -> None: ... + +class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler): + client_address: Tuple[str, int] + server: SocketServer.BaseServer + close_connection: bool + command: str + path: str + request_version: str + headers: mimetools.Message + rfile: BinaryIO + wfile: BinaryIO + server_version: str + sys_version: str + error_message_format: str + error_content_type: str + protocol_version: str + MessageClass: type + responses: Mapping[int, Tuple[str, str]] + def __init__(self, request: bytes, client_address: Tuple[str, int], + server: SocketServer.BaseServer) -> None: ... + def handle(self) -> None: ... + def handle_one_request(self) -> None: ... + def send_error(self, code: int, message: Optional[str] = ...) -> None: ... + def send_response(self, code: int, + message: Optional[str] = ...) -> None: ... + def send_header(self, keyword: str, value: str) -> None: ... + def end_headers(self) -> None: ... + def flush_headers(self) -> None: ... + def log_request(self, code: Union[int, str] = ..., + size: Union[int, str] = ...) -> None: ... + def log_error(self, format: str, *args: Any) -> None: ... + def log_message(self, format: str, *args: Any) -> None: ... + def version_string(self) -> str: ... + def date_time_string(self, timestamp: Optional[int] = ...) -> str: ... + def log_date_time_string(self) -> str: ... + def address_string(self) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/CGIHTTPServer.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/CGIHTTPServer.pyi new file mode 100644 index 00000000..4eae666d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/CGIHTTPServer.pyi @@ -0,0 +1,8 @@ +# Stubs for CGIHTTPServer (Python 2.7) + +from typing import List +import SimpleHTTPServer + +class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): + cgi_directories: List[str] + def do_POST(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/ConfigParser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/ConfigParser.pyi new file mode 100644 index 00000000..fa0e5517 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/ConfigParser.pyi @@ -0,0 +1,99 @@ +from typing import Any, IO, Sequence, Tuple, Union, List, Dict, Protocol, Optional + +DEFAULTSECT: str +MAX_INTERPOLATION_DEPTH: int + +class Error(Exception): + message: Any + def __init__(self, msg: str = ...) -> None: ... + def _get_message(self) -> None: ... + def _set_message(self, value: str) -> None: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + +class NoSectionError(Error): + section: str + def __init__(self, section: str) -> None: ... + +class DuplicateSectionError(Error): + section: str + def __init__(self, section: str) -> None: ... + +class NoOptionError(Error): + section: str + option: str + def __init__(self, option: str, section: str) -> None: ... + +class InterpolationError(Error): + section: str + option: str + msg: str + def __init__(self, option: str, section: str, msg: str) -> None: ... + +class InterpolationMissingOptionError(InterpolationError): + reference: str + def __init__(self, option: str, section: str, rawval: str, reference: str) -> None: ... + +class InterpolationSyntaxError(InterpolationError): ... + +class InterpolationDepthError(InterpolationError): + def __init__(self, option: str, section: str, rawval: str) -> None: ... + +class ParsingError(Error): + filename: str + errors: List[Tuple[Any, Any]] + def __init__(self, filename: str) -> None: ... + def append(self, lineno: Any, line: Any) -> None: ... + +class MissingSectionHeaderError(ParsingError): + lineno: Any + line: Any + def __init__(self, filename: str, lineno: Any, line: Any) -> None: ... + +class _Readable(Protocol): + def readline(self) -> str: ... + +class RawConfigParser: + _dict: Any + _sections: Dict[Any, Any] + _defaults: Dict[Any, Any] + _optcre: Any + SECTCRE: Any + OPTCRE: Any + OPTCRE_NV: Any + def __init__(self, defaults: Dict[Any, Any] = ..., dict_type: Any = ..., allow_no_value: bool = ...) -> None: ... + def defaults(self) -> Dict[Any, Any]: ... + def sections(self) -> List[str]: ... + def add_section(self, section: str) -> None: ... + def has_section(self, section: str) -> bool: ... + def options(self, section: str) -> List[str]: ... + def read(self, filenames: Union[str, Sequence[str]]) -> List[str]: ... + def readfp(self, fp: _Readable, filename: str = ...) -> None: ... + def get(self, section: str, option: str) -> str: ... + def items(self, section: str) -> List[Tuple[Any, Any]]: ... + def _get(self, section: str, conv: type, option: str) -> Any: ... + def getint(self, section: str, option: str) -> int: ... + def getfloat(self, section: str, option: str) -> float: ... + _boolean_states: Dict[str, bool] + def getboolean(self, section: str, option: str) -> bool: ... + def optionxform(self, optionstr: str) -> str: ... + def has_option(self, section: str, option: str) -> bool: ... + def set(self, section: str, option: str, value: Any = ...) -> None: ... + def write(self, fp: IO[str]) -> None: ... + def remove_option(self, section: str, option: Any) -> bool: ... + def remove_section(self, section: str) -> bool: ... + def _read(self, fp: IO[str], fpname: str) -> None: ... + +class ConfigParser(RawConfigParser): + _KEYCRE: Any + def get(self, section: str, option: str, raw: bool = ..., vars: Optional[Dict[Any, Any]] = ...) -> Any: ... + def items(self, section: str, raw: bool = ..., vars: Optional[Dict[Any, Any]] = ...) -> List[Tuple[str, Any]]: ... + def _interpolate(self, section: str, option: str, rawval: Any, vars: Any) -> str: ... + def _interpolation_replace(self, match: Any) -> str: ... + +class SafeConfigParser(ConfigParser): + _interpvar_re: Any + def _interpolate(self, section: str, option: str, rawval: Any, vars: Any) -> str: ... + def _interpolate_some( + self, option: str, accum: List[Any], rest: str, section: str, map: Dict[Any, Any], depth: int, + ) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/Cookie.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/Cookie.pyi new file mode 100644 index 00000000..91dd9322 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/Cookie.pyi @@ -0,0 +1,40 @@ +from typing import Any, Dict, Optional + +class CookieError(Exception): ... + +class Morsel(Dict[Any, Any]): + key: Any + def __init__(self): ... + def __setitem__(self, K, V): ... + def isReservedKey(self, K): ... + value: Any + coded_value: Any + def set(self, key, val, coded_val, LegalChars=..., idmap=..., translate=...): ... + def output(self, attrs: Optional[Any] = ..., header=...): ... + def js_output(self, attrs: Optional[Any] = ...): ... + def OutputString(self, attrs: Optional[Any] = ...): ... + +class BaseCookie(Dict[Any, Any]): + def value_decode(self, val): ... + def value_encode(self, val): ... + def __init__(self, input: Optional[Any] = ...): ... + def __setitem__(self, key, value): ... + def output(self, attrs: Optional[Any] = ..., header=..., sep=...): ... + def js_output(self, attrs: Optional[Any] = ...): ... + def load(self, rawdata): ... + +class SimpleCookie(BaseCookie): + def value_decode(self, val): ... + def value_encode(self, val): ... + +class SerialCookie(BaseCookie): + def __init__(self, input: Optional[Any] = ...): ... + def value_decode(self, val): ... + def value_encode(self, val): ... + +class SmartCookie(BaseCookie): + def __init__(self, input: Optional[Any] = ...): ... + def value_decode(self, val): ... + def value_encode(self, val): ... + +Cookie: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/HTMLParser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/HTMLParser.pyi new file mode 100644 index 00000000..0f6c7e39 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/HTMLParser.pyi @@ -0,0 +1,31 @@ +from typing import List, Tuple, AnyStr +from markupbase import ParserBase + +class HTMLParser(ParserBase): + def __init__(self) -> None: ... + def feed(self, feed: AnyStr) -> None: ... + def close(self) -> None: ... + def reset(self) -> None: ... + + def get_starttag_text(self) -> AnyStr: ... + def set_cdata_mode(self, AnyStr) -> None: ... + def clear_cdata_mode(self) -> None: ... + + def handle_startendtag(self, tag: AnyStr, attrs: List[Tuple[AnyStr, AnyStr]]): ... + def handle_starttag(self, tag: AnyStr, attrs: List[Tuple[AnyStr, AnyStr]]): ... + def handle_endtag(self, tag: AnyStr): ... + def handle_charref(self, name: AnyStr): ... + def handle_entityref(self, name: AnyStr): ... + def handle_data(self, data: AnyStr): ... + def handle_comment(self, data: AnyStr): ... + def handle_decl(self, decl: AnyStr): ... + def handle_pi(self, data: AnyStr): ... + + def unknown_decl(self, data: AnyStr): ... + + def unescape(self, s: AnyStr) -> AnyStr: ... + +class HTMLParseError(Exception): + msg: str + lineno: int + offset: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/Queue.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/Queue.pyi new file mode 100644 index 00000000..76e3dcb5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/Queue.pyi @@ -0,0 +1,31 @@ +# Stubs for Queue (Python 2) + +from collections import deque +from typing import Any, Deque, TypeVar, Generic, Optional + +_T = TypeVar('_T') + +class Empty(Exception): ... +class Full(Exception): ... + +class Queue(Generic[_T]): + maxsize: Any + mutex: Any + not_empty: Any + not_full: Any + all_tasks_done: Any + unfinished_tasks: Any + queue: Deque[Any] # undocumented + def __init__(self, maxsize: int = ...) -> None: ... + def task_done(self) -> None: ... + def join(self) -> None: ... + def qsize(self) -> int: ... + def empty(self) -> bool: ... + def full(self) -> bool: ... + def put(self, item: _T, block: bool = ..., timeout: Optional[float] = ...) -> None: ... + def put_nowait(self, item: _T) -> None: ... + def get(self, block: bool = ..., timeout: Optional[float] = ...) -> _T: ... + def get_nowait(self) -> _T: ... + +class PriorityQueue(Queue[_T]): ... +class LifoQueue(Queue[_T]): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/SimpleHTTPServer.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/SimpleHTTPServer.pyi new file mode 100644 index 00000000..4a36cc5b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/SimpleHTTPServer.pyi @@ -0,0 +1,16 @@ +# Stubs for SimpleHTTPServer (Python 2) + +from typing import Any, AnyStr, IO, Mapping, Optional, Union +import BaseHTTPServer +from StringIO import StringIO + +class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): + server_version: str + def do_GET(self) -> None: ... + def do_HEAD(self) -> None: ... + def send_head(self) -> Optional[IO[str]]: ... + def list_directory(self, path: Union[str, unicode]) -> Optional[StringIO[Any]]: ... + def translate_path(self, path: AnyStr) -> AnyStr: ... + def copyfile(self, source: IO[AnyStr], outputfile: IO[AnyStr]): ... + def guess_type(self, path: Union[str, unicode]) -> str: ... + extensions_map: Mapping[str, str] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/SocketServer.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/SocketServer.pyi new file mode 100644 index 00000000..0b4d3a27 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/SocketServer.pyi @@ -0,0 +1,99 @@ +# NB: SocketServer.pyi and socketserver.pyi must remain consistent! +# Stubs for socketserver + +from typing import Any, BinaryIO, Callable, Optional, Tuple, Type, Text, Union +from socket import SocketType +import sys +import types + +class BaseServer: + address_family: int + RequestHandlerClass: Callable[..., BaseRequestHandler] + server_address: Tuple[str, int] + socket: SocketType + allow_reuse_address: bool + request_queue_size: int + socket_type: int + timeout: Optional[float] + def __init__(self, server_address: Any, + RequestHandlerClass: Callable[..., BaseRequestHandler]) -> None: ... + def fileno(self) -> int: ... + def handle_request(self) -> None: ... + def serve_forever(self, poll_interval: float = ...) -> None: ... + def shutdown(self) -> None: ... + def server_close(self) -> None: ... + def finish_request(self, request: bytes, + client_address: Tuple[str, int]) -> None: ... + def get_request(self) -> None: ... + def handle_error(self, request: bytes, + client_address: Tuple[str, int]) -> None: ... + def handle_timeout(self) -> None: ... + def process_request(self, request: bytes, + client_address: Tuple[str, int]) -> None: ... + def server_activate(self) -> None: ... + def server_bind(self) -> None: ... + def verify_request(self, request: bytes, + client_address: Tuple[str, int]) -> bool: ... + if sys.version_info >= (3, 6): + def __enter__(self) -> BaseServer: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[types.TracebackType]) -> None: ... + if sys.version_info >= (3, 3): + def service_actions(self) -> None: ... + +class TCPServer(BaseServer): + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: Callable[..., BaseRequestHandler], + bind_and_activate: bool = ...) -> None: ... + +class UDPServer(BaseServer): + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: Callable[..., BaseRequestHandler], + bind_and_activate: bool = ...) -> None: ... + +if sys.platform != 'win32': + class UnixStreamServer(BaseServer): + def __init__(self, server_address: Union[Text, bytes], + RequestHandlerClass: Callable[..., BaseRequestHandler], + bind_and_activate: bool = ...) -> None: ... + + class UnixDatagramServer(BaseServer): + def __init__(self, server_address: Union[Text, bytes], + RequestHandlerClass: Callable[..., BaseRequestHandler], + bind_and_activate: bool = ...) -> None: ... + +class ForkingMixIn: ... +class ThreadingMixIn: ... + +class ForkingTCPServer(ForkingMixIn, TCPServer): ... +class ForkingUDPServer(ForkingMixIn, UDPServer): ... +class ThreadingTCPServer(ThreadingMixIn, TCPServer): ... +class ThreadingUDPServer(ThreadingMixIn, UDPServer): ... +if sys.platform != 'win32': + class ThreadingUnixStreamServer(ThreadingMixIn, UnixStreamServer): ... + class ThreadingUnixDatagramServer(ThreadingMixIn, UnixDatagramServer): ... + + +class BaseRequestHandler: + # Those are technically of types, respectively: + # * Union[SocketType, Tuple[bytes, SocketType]] + # * Union[Tuple[str, int], str] + # But there are some concerns that having unions here would cause + # too much inconvenience to people using it (see + # https://github.com/python/typeshed/pull/384#issuecomment-234649696) + request: Any + client_address: Any + + server: BaseServer + def setup(self) -> None: ... + def handle(self) -> None: ... + def finish(self) -> None: ... + +class StreamRequestHandler(BaseRequestHandler): + rfile: BinaryIO + wfile: BinaryIO + +class DatagramRequestHandler(BaseRequestHandler): + rfile: BinaryIO + wfile: BinaryIO diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/StringIO.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/StringIO.pyi new file mode 100644 index 00000000..de17f6ab --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/StringIO.pyi @@ -0,0 +1,30 @@ +# Stubs for StringIO (Python 2) + +from typing import Any, IO, AnyStr, Iterator, Iterable, Generic, List, Optional + +class StringIO(IO[AnyStr], Generic[AnyStr]): + closed: bool + softspace: int + len: int + name: str + def __init__(self, buf: AnyStr = ...) -> None: ... + def __iter__(self) -> Iterator[AnyStr]: ... + def next(self) -> AnyStr: ... + def close(self) -> None: ... + def isatty(self) -> bool: ... + def seek(self, pos: int, mode: int = ...) -> int: ... + def tell(self) -> int: ... + def read(self, n: int = ...) -> AnyStr: ... + def readline(self, length: int = ...) -> AnyStr: ... + def readlines(self, sizehint: int = ...) -> List[AnyStr]: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def write(self, s: AnyStr) -> int: ... + def writelines(self, iterable: Iterable[AnyStr]) -> None: ... + def flush(self) -> None: ... + def getvalue(self) -> AnyStr: ... + def __enter__(self) -> Any: ... + def __exit__(self, type: Any, value: Any, traceback: Any) -> Any: ... + def fileno(self) -> int: ... + def readable(self) -> bool: ... + def seekable(self) -> bool: ... + def writable(self) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/UserDict.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/UserDict.pyi new file mode 100644 index 00000000..1d850cfc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/UserDict.pyi @@ -0,0 +1,44 @@ +from typing import (Any, Container, Dict, Generic, Iterable, Iterator, List, + Mapping, Optional, Sized, Tuple, TypeVar, Union, overload) + +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') +_T = TypeVar('_T') + +class UserDict(Dict[_KT, _VT], Generic[_KT, _VT]): + data: Dict[_KT, _VT] + + def __init__(self, initialdata: Mapping[_KT, _VT] = ...) -> None: ... + + # TODO: __iter__ is not available for UserDict + +class IterableUserDict(UserDict[_KT, _VT], Generic[_KT, _VT]): + ... + +class DictMixin(Iterable[_KT], Container[_KT], Sized, Generic[_KT, _VT]): + def has_key(self, key: _KT) -> bool: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_KT]: ... + + # From typing.Mapping[_KT, _VT] + # (can't inherit because of keys()) + @overload + def get(self, k: _KT) -> Optional[_VT]: ... + @overload + def get(self, k: _KT, default: Union[_VT, _T]) -> Union[_VT, _T]: ... + def values(self) -> List[_VT]: ... + def items(self) -> List[Tuple[_KT, _VT]]: ... + def iterkeys(self) -> Iterator[_KT]: ... + def itervalues(self) -> Iterator[_VT]: ... + def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... + def __contains__(self, o: Any) -> bool: ... + + # From typing.MutableMapping[_KT, _VT] + def clear(self) -> None: ... + def pop(self, k: _KT, default: _VT = ...) -> _VT: ... + def popitem(self) -> Tuple[_KT, _VT]: ... + def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ... + @overload + def update(self, m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def update(self, m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/UserList.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/UserList.pyi new file mode 100644 index 00000000..3c71e829 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/UserList.pyi @@ -0,0 +1,19 @@ +from typing import Iterable, MutableSequence, TypeVar, Union, overload, List + +_T = TypeVar("_T") +_S = TypeVar("_S") + +class UserList(MutableSequence[_T]): + data: List[_T] + def insert(self, index: int, object: _T) -> None: ... + @overload + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + def __len__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> _T: ... + @overload + def __getitem__(self: _S, s: slice) -> _S: ... + def sort(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/UserString.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/UserString.pyi new file mode 100644 index 00000000..704a93bc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/UserString.pyi @@ -0,0 +1,75 @@ +import collections +from typing import Any, Iterable, List, MutableSequence, Sequence, Optional, overload, Text, TypeVar, Tuple, Union + +_UST = TypeVar("_UST", bound=UserString) +_MST = TypeVar("_MST", bound=MutableString) + +class UserString(Sequence[UserString]): + data: unicode + def __init__(self, seq: object) -> None: ... + def __int__(self) -> int: ... + def __long__(self) -> long: ... + def __float__(self) -> float: ... + def __complex__(self) -> complex: ... + def __hash__(self) -> int: ... + def __len__(self) -> int: ... + @overload + def __getitem__(self: _UST, i: int) -> _UST: ... + @overload + def __getitem__(self: _UST, s: slice) -> _UST: ... + def __add__(self: _UST, other: Any) -> _UST: ... + def __radd__(self: _UST, other: Any) -> _UST: ... + def __mul__(self: _UST, other: int) -> _UST: ... + def __rmul__(self: _UST, other: int) -> _UST: ... + def __mod__(self: _UST, args: Any) -> _UST: ... + def capitalize(self: _UST) -> _UST: ... + def center(self: _UST, width: int, *args: Any) -> _UST: ... + def count(self, sub: int, start: int = ..., end: int = ...) -> int: ... + def decode(self: _UST, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UST: ... + def encode(self: _UST, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UST: ... + def endswith(self, suffix: Text, start: int = ..., end: int = ...) -> bool: ... + def expandtabs(self: _UST, tabsize: int = ...) -> _UST: ... + def find(self, sub: Text, start: int = ..., end: int = ...) -> int: ... + def index(self, sub: Text, start: int = ..., end: int = ...) -> int: ... + def isalpha(self) -> bool: ... + def isalnum(self) -> bool: ... + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + def islower(self) -> bool: ... + def isnumeric(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, seq: Iterable[Text]) -> Text: ... + def ljust(self: _UST, width: int, *args: Any) -> _UST: ... + def lower(self: _UST) -> _UST: ... + def lstrip(self: _UST, chars: Optional[Text] = ...) -> _UST: ... + def partition(self, sep: Text) -> Tuple[Text, Text, Text]: ... + def replace(self: _UST, old: Text, new: Text, maxsplit: int = ...) -> _UST: ... + def rfind(self, sub: Text, start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: Text, start: int = ..., end: int = ...) -> int: ... + def rjust(self: _UST, width: int, *args: Any) -> _UST: ... + def rpartition(self, sep: Text) -> Tuple[Text, Text, Text]: ... + def rstrip(self: _UST, chars: Optional[Text] = ...) -> _UST: ... + def split(self, sep: Optional[Text] = ..., maxsplit: int = ...) -> List[Text]: ... + def rsplit(self, sep: Optional[Text] = ..., maxsplit: int = ...) -> List[Text]: ... + def splitlines(self, keepends: int = ...) -> List[Text]: ... + def startswith(self, suffix: Text, start: int = ..., end: int = ...) -> bool: ... + def strip(self: _UST, chars: Optional[Text] = ...) -> _UST: ... + def swapcase(self: _UST) -> _UST: ... + def title(self: _UST) -> _UST: ... + def translate(self: _UST, *args: Any) -> _UST: ... + def upper(self: _UST) -> _UST: ... + def zfill(self: _UST, width: int) -> _UST: ... + +class MutableString(UserString, MutableSequence[MutableString]): + @overload + def __getitem__(self: _MST, i: int) -> _MST: ... + @overload + def __getitem__(self: _MST, s: slice) -> _MST: ... + def __setitem__(self, index: Union[int, slice], sub: Any) -> None: ... + def __delitem__(self, index: Union[int, slice]) -> None: ... + def immutable(self) -> UserString: ... + def __iadd__(self: _MST, other: Any) -> _MST: ... + def __imul__(self, n: int) -> _MST: ... + def insert(self, index: int, value: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/__builtin__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/__builtin__.pyi new file mode 100644 index 00000000..249a5cd6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/__builtin__.pyi @@ -0,0 +1,1650 @@ +# True and False are deliberately omitted because they are keywords in +# Python 3, and stub files conform to Python 3 syntax. + +from typing import ( + TypeVar, Iterator, Iterable, NoReturn, overload, Container, + Sequence, MutableSequence, Mapping, MutableMapping, Tuple, List, Any, Dict, Callable, Generic, + Set, AbstractSet, FrozenSet, MutableSet, Sized, Reversible, SupportsInt, SupportsFloat, SupportsAbs, + SupportsComplex, IO, BinaryIO, Union, + ItemsView, KeysView, ValuesView, ByteString, Optional, AnyStr, Type, Text, + Protocol, +) +from abc import abstractmethod, ABCMeta +from ast import mod, AST +from types import TracebackType, CodeType +import sys + +if sys.version_info >= (3,): + from typing import SupportsBytes, SupportsRound + +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + +_T = TypeVar('_T') +_T_co = TypeVar('_T_co', covariant=True) +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') +_S = TypeVar('_S') +_T1 = TypeVar('_T1') +_T2 = TypeVar('_T2') +_T3 = TypeVar('_T3') +_T4 = TypeVar('_T4') +_T5 = TypeVar('_T5') +_TT = TypeVar('_TT', bound='type') + +class _SupportsIndex(Protocol): + def __index__(self) -> int: ... + +class object: + __doc__: Optional[str] + __dict__: Dict[str, Any] + __slots__: Union[Text, Iterable[Text]] + __module__: str + if sys.version_info >= (3, 6): + __annotations__: Dict[str, Any] + + @property + def __class__(self: _T) -> Type[_T]: ... + @__class__.setter + def __class__(self, __type: Type[object]) -> None: ... + def __init__(self) -> None: ... + def __new__(cls) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __eq__(self, o: object) -> bool: ... + def __ne__(self, o: object) -> bool: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __hash__(self) -> int: ... + def __format__(self, format_spec: str) -> str: ... + def __getattribute__(self, name: str) -> Any: ... + def __delattr__(self, name: str) -> None: ... + def __sizeof__(self) -> int: ... + def __reduce__(self) -> Union[str, Tuple[Any, ...]]: ... + def __reduce_ex__(self, protocol: int) -> Union[str, Tuple[Any, ...]]: ... + if sys.version_info >= (3,): + def __dir__(self) -> Iterable[str]: ... + if sys.version_info >= (3, 6): + def __init_subclass__(cls) -> None: ... + +class staticmethod(object): # Special, only valid as a decorator. + __func__: Callable[..., Any] + if sys.version_info >= (3,): + __isabstractmethod__: bool + + def __init__(self, f: Callable[..., Any]) -> None: ... + def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable[..., Any]: ... + +class classmethod(object): # Special, only valid as a decorator. + __func__: Callable[..., Any] + if sys.version_info >= (3,): + __isabstractmethod__: bool + + def __init__(self, f: Callable[..., Any]) -> None: ... + def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable[..., Any]: ... + +class type(object): + __base__: type + __bases__: Tuple[type, ...] + __basicsize__: int + __dict__: Dict[str, Any] + __dictoffset__: int + __flags__: int + __itemsize__: int + __module__: str + __mro__: Tuple[type, ...] + __name__: str + if sys.version_info >= (3,): + __qualname__: str + __text_signature__: Optional[str] + __weakrefoffset__: int + + @overload + def __init__(self, o: object) -> None: ... + @overload + def __init__(self, name: str, bases: Tuple[type, ...], dict: Dict[str, Any]) -> None: ... + @overload + def __new__(cls, o: object) -> type: ... + @overload + def __new__(cls, name: str, bases: Tuple[type, ...], namespace: Dict[str, Any]) -> type: ... + def __call__(self, *args: Any, **kwds: Any) -> Any: ... + def __subclasses__(self: _TT) -> List[_TT]: ... + # Note: the documentation doesnt specify what the return type is, the standard + # implementation seems to be returning a list. + def mro(self) -> List[type]: ... + def __instancecheck__(self, instance: Any) -> bool: ... + def __subclasscheck__(self, subclass: type) -> bool: ... + if sys.version_info >= (3,): + @classmethod + def __prepare__(metacls, __name: str, __bases: Tuple[type, ...], **kwds: Any) -> Mapping[str, Any]: ... + +class super(object): + if sys.version_info >= (3,): + @overload + def __init__(self, t: Any, obj: Any) -> None: ... + @overload + def __init__(self, t: Any) -> None: ... + @overload + def __init__(self) -> None: ... + else: + @overload + def __init__(self, t: Any, obj: Any) -> None: ... + @overload + def __init__(self, t: Any) -> None: ... + +class int: + @overload + def __init__(self, x: Union[Text, bytes, SupportsInt, _SupportsIndex] = ...) -> None: ... + @overload + def __init__(self, x: Union[Text, bytes, bytearray], base: int) -> None: ... + + if sys.version_info >= (3, 8): + def as_integer_ratio(self) -> Tuple[int, Literal[1]]: ... + @property + def real(self) -> int: ... + @property + def imag(self) -> int: ... + @property + def numerator(self) -> int: ... + @property + def denominator(self) -> int: ... + def conjugate(self) -> int: ... + + def bit_length(self) -> int: ... + if sys.version_info >= (3,): + def to_bytes(self, length: int, byteorder: str, *, signed: bool = ...) -> bytes: ... + @classmethod + def from_bytes(cls, bytes: Sequence[int], byteorder: str, *, + signed: bool = ...) -> int: ... # TODO buffer object argument + + def __add__(self, x: int) -> int: ... + def __sub__(self, x: int) -> int: ... + def __mul__(self, x: int) -> int: ... + def __floordiv__(self, x: int) -> int: ... + if sys.version_info < (3,): + def __div__(self, x: int) -> int: ... + def __truediv__(self, x: int) -> float: ... + def __mod__(self, x: int) -> int: ... + def __divmod__(self, x: int) -> Tuple[int, int]: ... + def __radd__(self, x: int) -> int: ... + def __rsub__(self, x: int) -> int: ... + def __rmul__(self, x: int) -> int: ... + def __rfloordiv__(self, x: int) -> int: ... + if sys.version_info < (3,): + def __rdiv__(self, x: int) -> int: ... + def __rtruediv__(self, x: int) -> float: ... + def __rmod__(self, x: int) -> int: ... + def __rdivmod__(self, x: int) -> Tuple[int, int]: ... + def __pow__(self, __x: int, __modulo: Optional[int] = ...) -> Any: ... # Return type can be int or float, depending on x. + def __rpow__(self, x: int) -> Any: ... + def __and__(self, n: int) -> int: ... + def __or__(self, n: int) -> int: ... + def __xor__(self, n: int) -> int: ... + def __lshift__(self, n: int) -> int: ... + def __rshift__(self, n: int) -> int: ... + def __rand__(self, n: int) -> int: ... + def __ror__(self, n: int) -> int: ... + def __rxor__(self, n: int) -> int: ... + def __rlshift__(self, n: int) -> int: ... + def __rrshift__(self, n: int) -> int: ... + def __neg__(self) -> int: ... + def __pos__(self) -> int: ... + def __invert__(self) -> int: ... + def __trunc__(self) -> int: ... + if sys.version_info >= (3,): + def __ceil__(self) -> int: ... + def __floor__(self) -> int: ... + def __round__(self, ndigits: Optional[int] = ...) -> int: ... + def __getnewargs__(self) -> Tuple[int]: ... + + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: int) -> bool: ... + def __le__(self, x: int) -> bool: ... + def __gt__(self, x: int) -> bool: ... + def __ge__(self, x: int) -> bool: ... + + def __str__(self) -> str: ... + def __float__(self) -> float: ... + def __int__(self) -> int: ... + def __abs__(self) -> int: ... + def __hash__(self) -> int: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + def __index__(self) -> int: ... + +class float: + def __init__(self, x: Union[SupportsFloat, _SupportsIndex, Text, bytes, bytearray] = ...) -> None: ... + def as_integer_ratio(self) -> Tuple[int, int]: ... + def hex(self) -> str: ... + def is_integer(self) -> bool: ... + @classmethod + def fromhex(cls, s: str) -> float: ... + + @property + def real(self) -> float: ... + @property + def imag(self) -> float: ... + def conjugate(self) -> float: ... + + def __add__(self, x: float) -> float: ... + def __sub__(self, x: float) -> float: ... + def __mul__(self, x: float) -> float: ... + def __floordiv__(self, x: float) -> float: ... + if sys.version_info < (3,): + def __div__(self, x: float) -> float: ... + def __truediv__(self, x: float) -> float: ... + def __mod__(self, x: float) -> float: ... + def __divmod__(self, x: float) -> Tuple[float, float]: ... + def __pow__(self, x: float) -> float: ... # In Python 3, returns complex if self is negative and x is not whole + def __radd__(self, x: float) -> float: ... + def __rsub__(self, x: float) -> float: ... + def __rmul__(self, x: float) -> float: ... + def __rfloordiv__(self, x: float) -> float: ... + if sys.version_info < (3,): + def __rdiv__(self, x: float) -> float: ... + def __rtruediv__(self, x: float) -> float: ... + def __rmod__(self, x: float) -> float: ... + def __rdivmod__(self, x: float) -> Tuple[float, float]: ... + def __rpow__(self, x: float) -> float: ... + def __getnewargs__(self) -> Tuple[float]: ... + def __trunc__(self) -> int: ... + if sys.version_info >= (3,): + @overload + def __round__(self, ndigits: None = ...) -> int: ... + @overload + def __round__(self, ndigits: int) -> float: ... + + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: float) -> bool: ... + def __le__(self, x: float) -> bool: ... + def __gt__(self, x: float) -> bool: ... + def __ge__(self, x: float) -> bool: ... + def __neg__(self) -> float: ... + def __pos__(self) -> float: ... + + def __str__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __abs__(self) -> float: ... + def __hash__(self) -> int: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + +class complex: + @overload + def __init__(self, real: float = ..., imag: float = ...) -> None: ... + @overload + def __init__(self, real: Union[str, SupportsComplex, _SupportsIndex]) -> None: ... + + @property + def real(self) -> float: ... + @property + def imag(self) -> float: ... + + def conjugate(self) -> complex: ... + + def __add__(self, x: complex) -> complex: ... + def __sub__(self, x: complex) -> complex: ... + def __mul__(self, x: complex) -> complex: ... + def __pow__(self, x: complex) -> complex: ... + if sys.version_info < (3,): + def __div__(self, x: complex) -> complex: ... + def __truediv__(self, x: complex) -> complex: ... + def __radd__(self, x: complex) -> complex: ... + def __rsub__(self, x: complex) -> complex: ... + def __rmul__(self, x: complex) -> complex: ... + def __rpow__(self, x: complex) -> complex: ... + if sys.version_info < (3,): + def __rdiv__(self, x: complex) -> complex: ... + def __rtruediv__(self, x: complex) -> complex: ... + + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __neg__(self) -> complex: ... + def __pos__(self) -> complex: ... + + def __str__(self) -> str: ... + def __complex__(self) -> complex: ... + def __abs__(self) -> float: ... + def __hash__(self) -> int: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + +if sys.version_info >= (3,): + _str_base = object +else: + class basestring(metaclass=ABCMeta): ... + + class unicode(basestring, Sequence[unicode]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, o: object) -> None: ... + @overload + def __init__(self, o: str, encoding: unicode = ..., errors: unicode = ...) -> None: ... + def capitalize(self) -> unicode: ... + def center(self, width: int, fillchar: unicode = ...) -> unicode: ... + def count(self, x: unicode) -> int: ... + def decode(self, encoding: unicode = ..., errors: unicode = ...) -> unicode: ... + def encode(self, encoding: unicode = ..., errors: unicode = ...) -> str: ... + def endswith(self, suffix: Union[unicode, Tuple[unicode, ...]], start: int = ..., + end: int = ...) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> unicode: ... + def find(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def format(self, *args: object, **kwargs: object) -> unicode: ... + def index(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + def isidentifier(self) -> bool: ... + def islower(self) -> bool: ... + def isnumeric(self) -> bool: ... + def isprintable(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, iterable: Iterable[unicode]) -> unicode: ... + def ljust(self, width: int, fillchar: unicode = ...) -> unicode: ... + def lower(self) -> unicode: ... + def lstrip(self, chars: unicode = ...) -> unicode: ... + def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def replace(self, old: unicode, new: unicode, count: int = ...) -> unicode: ... + def rfind(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def rjust(self, width: int, fillchar: unicode = ...) -> unicode: ... + def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def rsplit(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ... + def rstrip(self, chars: unicode = ...) -> unicode: ... + def split(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ... + def splitlines(self, keepends: bool = ...) -> List[unicode]: ... + def startswith(self, prefix: Union[unicode, Tuple[unicode, ...]], start: int = ..., + end: int = ...) -> bool: ... + def strip(self, chars: unicode = ...) -> unicode: ... + def swapcase(self) -> unicode: ... + def title(self) -> unicode: ... + def translate(self, table: Union[Dict[int, Any], unicode]) -> unicode: ... + def upper(self) -> unicode: ... + def zfill(self, width: int) -> unicode: ... + + @overload + def __getitem__(self, i: int) -> unicode: ... + @overload + def __getitem__(self, s: slice) -> unicode: ... + def __getslice__(self, start: int, stop: int) -> unicode: ... + def __add__(self, s: unicode) -> unicode: ... + def __mul__(self, n: int) -> unicode: ... + def __rmul__(self, n: int) -> unicode: ... + def __mod__(self, x: Any) -> unicode: ... + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: unicode) -> bool: ... + def __le__(self, x: unicode) -> bool: ... + def __gt__(self, x: unicode) -> bool: ... + def __ge__(self, x: unicode) -> bool: ... + + def __len__(self) -> int: ... + # The argument type is incompatible with Sequence + def __contains__(self, s: Union[unicode, bytes]) -> bool: ... # type: ignore + def __iter__(self) -> Iterator[unicode]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __hash__(self) -> int: ... + def __getnewargs__(self) -> Tuple[unicode]: ... + + _str_base = basestring + +class str(Sequence[str], _str_base): + if sys.version_info >= (3,): + @overload + def __init__(self, o: object = ...) -> None: ... + @overload + def __init__(self, o: bytes, encoding: str = ..., errors: str = ...) -> None: ... + else: + def __init__(self, o: object = ...) -> None: ... + + def capitalize(self) -> str: ... + if sys.version_info >= (3, 3): + def casefold(self) -> str: ... + def center(self, width: int, fillchar: str = ...) -> str: ... + def count(self, x: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + if sys.version_info < (3,): + def decode(self, encoding: Text = ..., errors: Text = ...) -> unicode: ... + def encode(self, encoding: Text = ..., errors: Text = ...) -> bytes: ... + if sys.version_info >= (3,): + def endswith(self, suffix: Union[Text, Tuple[Text, ...]], start: Optional[int] = ..., + end: Optional[int] = ...) -> bool: ... + else: + def endswith(self, suffix: Union[Text, Tuple[Text, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> str: ... + def find(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def format(self, *args: object, **kwargs: object) -> str: ... + if sys.version_info >= (3,): + def format_map(self, map: Mapping[str, Any]) -> str: ... + def index(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + if sys.version_info >= (3,): + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + if sys.version_info >= (3,): + def isidentifier(self) -> bool: ... + def islower(self) -> bool: ... + if sys.version_info >= (3,): + def isnumeric(self) -> bool: ... + def isprintable(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + if sys.version_info >= (3,): + def join(self, iterable: Iterable[str]) -> str: ... + else: + def join(self, iterable: Iterable[AnyStr]) -> AnyStr: ... + def ljust(self, width: int, fillchar: str = ...) -> str: ... + def lower(self) -> str: ... + if sys.version_info >= (3,): + def lstrip(self, chars: Optional[str] = ...) -> str: ... + def partition(self, sep: str) -> Tuple[str, str, str]: ... + def replace(self, old: str, new: str, count: int = ...) -> str: ... + else: + @overload + def lstrip(self, chars: str = ...) -> str: ... + @overload + def lstrip(self, chars: unicode) -> unicode: ... + @overload + def partition(self, sep: bytearray) -> Tuple[str, bytearray, str]: ... + @overload + def partition(self, sep: str) -> Tuple[str, str, str]: ... + @overload + def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def replace(self, old: AnyStr, new: AnyStr, count: int = ...) -> AnyStr: ... + def rfind(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def rindex(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def rjust(self, width: int, fillchar: str = ...) -> str: ... + if sys.version_info >= (3,): + def rpartition(self, sep: str) -> Tuple[str, str, str]: ... + def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + def rstrip(self, chars: Optional[str] = ...) -> str: ... + def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + else: + @overload + def rpartition(self, sep: bytearray) -> Tuple[str, bytearray, str]: ... + @overload + def rpartition(self, sep: str) -> Tuple[str, str, str]: ... + @overload + def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + @overload + def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + @overload + def rsplit(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ... + @overload + def rstrip(self, chars: str = ...) -> str: ... + @overload + def rstrip(self, chars: unicode) -> unicode: ... + @overload + def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + @overload + def split(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ... + def splitlines(self, keepends: bool = ...) -> List[str]: ... + if sys.version_info >= (3,): + def startswith(self, prefix: Union[Text, Tuple[Text, ...]], start: Optional[int] = ..., + end: Optional[int] = ...) -> bool: ... + def strip(self, chars: Optional[str] = ...) -> str: ... + else: + def startswith(self, prefix: Union[Text, Tuple[Text, ...]]) -> bool: ... + @overload + def strip(self, chars: str = ...) -> str: ... + @overload + def strip(self, chars: unicode) -> unicode: ... + def swapcase(self) -> str: ... + def title(self) -> str: ... + if sys.version_info >= (3,): + def translate(self, table: Union[Mapping[int, Union[int, str, None]], Sequence[Union[int, str, None]]]) -> str: ... + else: + def translate(self, table: Optional[AnyStr], deletechars: AnyStr = ...) -> AnyStr: ... + def upper(self) -> str: ... + def zfill(self, width: int) -> str: ... + if sys.version_info >= (3,): + @staticmethod + @overload + def maketrans(x: Union[Dict[int, _T], Dict[str, _T], Dict[Union[str, int], _T]]) -> Dict[int, _T]: ... + @staticmethod + @overload + def maketrans(x: str, y: str, z: str = ...) -> Dict[int, Union[int, None]]: ... + + if sys.version_info >= (3,): + def __add__(self, s: str) -> str: ... + else: + def __add__(self, s: AnyStr) -> AnyStr: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[str, Text]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ge__(self, x: Text) -> bool: ... + def __getitem__(self, i: Union[int, slice]) -> str: ... + def __gt__(self, x: Text) -> bool: ... + def __hash__(self) -> int: ... + def __iter__(self) -> Iterator[str]: ... + def __le__(self, x: Text) -> bool: ... + def __len__(self) -> int: ... + def __lt__(self, x: Text) -> bool: ... + def __mod__(self, x: Any) -> str: ... + def __mul__(self, n: int) -> str: ... + def __ne__(self, x: object) -> bool: ... + def __repr__(self) -> str: ... + def __rmul__(self, n: int) -> str: ... + def __str__(self) -> str: ... + def __getnewargs__(self) -> Tuple[str]: ... + + if sys.version_info < (3,): + def __getslice__(self, start: int, stop: int) -> str: ... + def __float__(self) -> float: ... + def __int__(self) -> int: ... + +if sys.version_info >= (3,): + class bytes(ByteString): + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: str, encoding: str, + errors: str = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, o: SupportsBytes) -> None: ... + def capitalize(self) -> bytes: ... + def center(self, width: int, fillchar: bytes = ...) -> bytes: ... + def count(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def decode(self, encoding: str = ..., errors: str = ...) -> str: ... + def endswith(self, suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> bytes: ... + def find(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + if sys.version_info >= (3, 5): + def hex(self) -> str: ... + def index(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + def isdigit(self) -> bool: ... + def islower(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, iterable: Iterable[Union[ByteString, memoryview]]) -> bytes: ... + def ljust(self, width: int, fillchar: bytes = ...) -> bytes: ... + def lower(self) -> bytes: ... + def lstrip(self, chars: Optional[bytes] = ...) -> bytes: ... + def partition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ... + def replace(self, old: bytes, new: bytes, count: int = ...) -> bytes: ... + def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def rindex(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def rjust(self, width: int, fillchar: bytes = ...) -> bytes: ... + def rpartition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ... + def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ... + def rstrip(self, chars: Optional[bytes] = ...) -> bytes: ... + def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ... + def splitlines(self, keepends: bool = ...) -> List[bytes]: ... + def startswith( + self, + prefix: Union[bytes, Tuple[bytes, ...]], + start: Optional[int] = ..., + end: Optional[int] = ..., + ) -> bool: ... + def strip(self, chars: Optional[bytes] = ...) -> bytes: ... + def swapcase(self) -> bytes: ... + def title(self) -> bytes: ... + def translate(self, table: Optional[bytes], delete: bytes = ...) -> bytes: ... + def upper(self) -> bytes: ... + def zfill(self, width: int) -> bytes: ... + @classmethod + def fromhex(cls, s: str) -> bytes: ... + @classmethod + def maketrans(cls, frm: bytes, to: bytes) -> bytes: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __hash__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> bytes: ... + def __add__(self, s: bytes) -> bytes: ... + def __mul__(self, n: int) -> bytes: ... + def __rmul__(self, n: int) -> bytes: ... + if sys.version_info >= (3, 5): + def __mod__(self, value: Any) -> bytes: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[int, bytes]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: bytes) -> bool: ... + def __le__(self, x: bytes) -> bool: ... + def __gt__(self, x: bytes) -> bool: ... + def __ge__(self, x: bytes) -> bool: ... + def __getnewargs__(self) -> Tuple[bytes]: ... +else: + bytes = str + +class bytearray(MutableSequence[int], ByteString): + if sys.version_info >= (3,): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: Text, encoding: Text, errors: Text = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... + else: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: str) -> None: ... + @overload + def __init__(self, string: Text, encoding: Text, errors: Text = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... + def capitalize(self) -> bytearray: ... + def center(self, width: int, fillchar: bytes = ...) -> bytearray: ... + if sys.version_info >= (3,): + def count(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def copy(self) -> bytearray: ... + else: + def count(self, x: str) -> int: ... + def decode(self, encoding: Text = ..., errors: Text = ...) -> str: ... + def endswith(self, suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> bytearray: ... + if sys.version_info < (3,): + def extend(self, iterable: Union[str, Iterable[int]]) -> None: ... + if sys.version_info >= (3,): + def find(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + if sys.version_info >= (3, 5): + def hex(self) -> str: ... + def index(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + else: + def find(self, sub: str, start: int = ..., end: int = ...) -> int: ... + def index(self, sub: str, start: int = ..., end: int = ...) -> int: ... + def insert(self, index: int, object: int) -> None: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + def isdigit(self) -> bool: ... + def islower(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + if sys.version_info >= (3,): + def join(self, iterable: Iterable[Union[ByteString, memoryview]]) -> bytearray: ... + def ljust(self, width: int, fillchar: bytes = ...) -> bytearray: ... + else: + def join(self, iterable: Iterable[str]) -> bytearray: ... + def ljust(self, width: int, fillchar: str = ...) -> bytearray: ... + def lower(self) -> bytearray: ... + def lstrip(self, chars: Optional[bytes] = ...) -> bytearray: ... + def partition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... + def replace(self, old: bytes, new: bytes, count: int = ...) -> bytearray: ... + if sys.version_info >= (3,): + def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def rindex(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + else: + def rfind(self, sub: bytes, start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: bytes, start: int = ..., end: int = ...) -> int: ... + def rjust(self, width: int, fillchar: bytes = ...) -> bytearray: ... + def rpartition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... + def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ... + def rstrip(self, chars: Optional[bytes] = ...) -> bytearray: ... + def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ... + def splitlines(self, keepends: bool = ...) -> List[bytearray]: ... + def startswith( + self, + prefix: Union[bytes, Tuple[bytes, ...]], + start: Optional[int] = ..., + end: Optional[int] = ..., + ) -> bool: ... + def strip(self, chars: Optional[bytes] = ...) -> bytearray: ... + def swapcase(self) -> bytearray: ... + def title(self) -> bytearray: ... + if sys.version_info >= (3,): + def translate(self, table: Optional[bytes], delete: bytes = ...) -> bytearray: ... + else: + def translate(self, table: str) -> bytearray: ... + def upper(self) -> bytearray: ... + def zfill(self, width: int) -> bytearray: ... + @staticmethod + def fromhex(s: str) -> bytearray: ... + if sys.version_info >= (3,): + @classmethod + def maketrans(cls, frm: bytes, to: bytes) -> bytes: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + __hash__: None # type: ignore + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> bytearray: ... + @overload + def __setitem__(self, i: int, x: int) -> None: ... + @overload + def __setitem__(self, s: slice, x: Union[Iterable[int], bytes]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + if sys.version_info < (3,): + def __getslice__(self, start: int, stop: int) -> bytearray: ... + def __setslice__(self, start: int, stop: int, x: Union[Sequence[int], str]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... + def __add__(self, s: bytes) -> bytearray: ... + if sys.version_info >= (3,): + def __iadd__(self, s: Iterable[int]) -> bytearray: ... + def __mul__(self, n: int) -> bytearray: ... + if sys.version_info >= (3,): + def __rmul__(self, n: int) -> bytearray: ... + def __imul__(self, n: int) -> bytearray: ... + if sys.version_info >= (3, 5): + def __mod__(self, value: Any) -> bytes: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[int, bytes]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: bytes) -> bool: ... + def __le__(self, x: bytes) -> bool: ... + def __gt__(self, x: bytes) -> bool: ... + def __ge__(self, x: bytes) -> bool: ... + +if sys.version_info >= (3,): + _mv_container_type = int +else: + _mv_container_type = str + +class memoryview(Sized, Container[_mv_container_type]): + format: str + itemsize: int + shape: Optional[Tuple[int, ...]] + strides: Optional[Tuple[int, ...]] + suboffsets: Optional[Tuple[int, ...]] + readonly: bool + ndim: int + + if sys.version_info >= (3,): + c_contiguous: bool + f_contiguous: bool + contiguous: bool + nbytes: int + def __init__(self, obj: Union[bytes, bytearray, memoryview]) -> None: ... + def __enter__(self) -> memoryview: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]) -> None: ... + else: + def __init__(self, obj: Union[bytes, bytearray, buffer, memoryview]) -> None: ... + + @overload + def __getitem__(self, i: int) -> _mv_container_type: ... + @overload + def __getitem__(self, s: slice) -> memoryview: ... + + def __contains__(self, x: object) -> bool: ... + def __iter__(self) -> Iterator[_mv_container_type]: ... + def __len__(self) -> int: ... + + @overload + def __setitem__(self, s: slice, o: memoryview) -> None: ... + @overload + def __setitem__(self, i: int, o: bytes) -> None: ... + @overload + def __setitem__(self, s: slice, o: Sequence[bytes]) -> None: ... + + def tobytes(self) -> bytes: ... + def tolist(self) -> List[int]: ... + + if sys.version_info >= (3, 2): + def release(self) -> None: ... + + if sys.version_info >= (3, 5): + def hex(self) -> str: ... + +class bool(int): + def __init__(self, o: object = ...) -> None: ... + @overload + def __and__(self, x: bool) -> bool: ... + @overload + def __and__(self, x: int) -> int: ... + @overload + def __or__(self, x: bool) -> bool: ... + @overload + def __or__(self, x: int) -> int: ... + @overload + def __xor__(self, x: bool) -> bool: ... + @overload + def __xor__(self, x: int) -> int: ... + @overload + def __rand__(self, x: bool) -> bool: ... + @overload + def __rand__(self, x: int) -> int: ... + @overload + def __ror__(self, x: bool) -> bool: ... + @overload + def __ror__(self, x: int) -> int: ... + @overload + def __rxor__(self, x: bool) -> bool: ... + @overload + def __rxor__(self, x: int) -> int: ... + def __getnewargs__(self) -> Tuple[int]: ... + +class slice(object): + start: Any + step: Any + stop: Any + @overload + def __init__(self, stop: Any) -> None: ... + @overload + def __init__(self, start: Any, stop: Any, step: Any = ...) -> None: ... + __hash__: None # type: ignore + def indices(self, len: int) -> Tuple[int, int, int]: ... + +class tuple(Sequence[_T_co], Generic[_T_co]): + def __new__(cls: Type[_T], iterable: Iterable[_T_co] = ...) -> _T: ... + def __init__(self, iterable: Iterable[_T_co] = ...): ... + def __len__(self) -> int: ... + def __contains__(self, x: object) -> bool: ... + @overload + def __getitem__(self, x: int) -> _T_co: ... + @overload + def __getitem__(self, x: slice) -> Tuple[_T_co, ...]: ... + def __iter__(self) -> Iterator[_T_co]: ... + def __lt__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __le__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __gt__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __ge__(self, x: Tuple[_T_co, ...]) -> bool: ... + @overload + def __add__(self, x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ... + @overload + def __add__(self, x: Tuple[Any, ...]) -> Tuple[Any, ...]: ... + def __mul__(self, n: int) -> Tuple[_T_co, ...]: ... + def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ... + def count(self, x: Any) -> int: ... + if sys.version_info >= (3, 5): + def index(self, x: Any, start: int = ..., end: int = ...) -> int: ... + else: + def index(self, x: Any) -> int: ... + +class list(MutableSequence[_T], Generic[_T]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, iterable: Iterable[_T]) -> None: ... + if sys.version_info >= (3,): + def clear(self) -> None: ... + def copy(self) -> List[_T]: ... + def append(self, object: _T) -> None: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def pop(self, index: int = ...) -> _T: ... + def index(self, object: _T, start: int = ..., stop: int = ...) -> int: ... + def count(self, object: _T) -> int: ... + def insert(self, index: int, object: _T) -> None: ... + def remove(self, object: _T) -> None: ... + def reverse(self) -> None: ... + if sys.version_info >= (3,): + def sort(self, *, key: Optional[Callable[[_T], Any]] = ..., reverse: bool = ...) -> None: ... + else: + def sort(self, cmp: Callable[[_T, _T], Any] = ..., key: Callable[[_T], Any] = ..., reverse: bool = ...) -> None: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + __hash__: None # type: ignore + @overload + def __getitem__(self, i: int) -> _T: ... + @overload + def __getitem__(self, s: slice) -> List[_T]: ... + @overload + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + if sys.version_info < (3,): + def __getslice__(self, start: int, stop: int) -> List[_T]: ... + def __setslice__(self, start: int, stop: int, o: Sequence[_T]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... + def __add__(self, x: List[_T]) -> List[_T]: ... + def __iadd__(self: _S, x: Iterable[_T]) -> _S: ... + def __mul__(self, n: int) -> List[_T]: ... + def __rmul__(self, n: int) -> List[_T]: ... + if sys.version_info >= (3,): + def __imul__(self: _S, n: int) -> _S: ... + def __contains__(self, o: object) -> bool: ... + def __reversed__(self) -> Iterator[_T]: ... + def __gt__(self, x: List[_T]) -> bool: ... + def __ge__(self, x: List[_T]) -> bool: ... + def __lt__(self, x: List[_T]) -> bool: ... + def __le__(self, x: List[_T]) -> bool: ... + +class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): + # NOTE: Keyword arguments are special. If they are used, _KT must include + # str, but we have no way of enforcing it here. + @overload + def __init__(self, **kwargs: _VT) -> None: ... + @overload + def __init__(self, map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def __init__(self, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + + def __new__(cls: Type[_T1], *args: Any, **kwargs: Any) -> _T1: ... + + if sys.version_info < (3,): + def has_key(self, k: _KT) -> bool: ... + def clear(self) -> None: ... + def copy(self) -> Dict[_KT, _VT]: ... + def popitem(self) -> Tuple[_KT, _VT]: ... + def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ... + @overload + def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + @overload + def update(self, **kwargs: _VT) -> None: ... + if sys.version_info >= (3,): + def keys(self) -> KeysView[_KT]: ... + def values(self) -> ValuesView[_VT]: ... + def items(self) -> ItemsView[_KT, _VT]: ... + else: + def iterkeys(self) -> Iterator[_KT]: ... + def itervalues(self) -> Iterator[_VT]: ... + def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... + def viewkeys(self) -> KeysView[_KT]: ... + def viewvalues(self) -> ValuesView[_VT]: ... + def viewitems(self) -> ItemsView[_KT, _VT]: ... + @staticmethod + @overload + def fromkeys(seq: Iterable[_T]) -> Dict[_T, Any]: ... # TODO: Actually a class method (mypy/issues#328) + @staticmethod + @overload + def fromkeys(seq: Iterable[_T], value: _S) -> Dict[_T, _S]: ... + def __len__(self) -> int: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __setitem__(self, k: _KT, v: _VT) -> None: ... + def __delitem__(self, v: _KT) -> None: ... + def __iter__(self) -> Iterator[_KT]: ... + if sys.version_info >= (3, 8): + def __reversed__(self) -> Iterator[_KT]: ... + def __str__(self) -> str: ... + __hash__: None # type: ignore + +class set(MutableSet[_T], Generic[_T]): + def __init__(self, iterable: Iterable[_T] = ...) -> None: ... + def add(self, element: _T) -> None: ... + def clear(self) -> None: ... + def copy(self) -> Set[_T]: ... + def difference(self, *s: Iterable[Any]) -> Set[_T]: ... + def difference_update(self, *s: Iterable[Any]) -> None: ... + def discard(self, element: _T) -> None: ... + def intersection(self, *s: Iterable[Any]) -> Set[_T]: ... + def intersection_update(self, *s: Iterable[Any]) -> None: ... + def isdisjoint(self, s: Iterable[Any]) -> bool: ... + def issubset(self, s: Iterable[Any]) -> bool: ... + def issuperset(self, s: Iterable[Any]) -> bool: ... + def pop(self) -> _T: ... + def remove(self, element: _T) -> None: ... + def symmetric_difference(self, s: Iterable[_T]) -> Set[_T]: ... + def symmetric_difference_update(self, s: Iterable[_T]) -> None: ... + def union(self, *s: Iterable[_T]) -> Set[_T]: ... + def update(self, *s: Iterable[_T]) -> None: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __and__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __iand__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __or__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __ior__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __sub__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __isub__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __xor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __ixor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __le__(self, s: AbstractSet[object]) -> bool: ... + def __lt__(self, s: AbstractSet[object]) -> bool: ... + def __ge__(self, s: AbstractSet[object]) -> bool: ... + def __gt__(self, s: AbstractSet[object]) -> bool: ... + __hash__: None # type: ignore + +class frozenset(AbstractSet[_T], Generic[_T]): + def __init__(self, iterable: Iterable[_T] = ...) -> None: ... + def copy(self) -> FrozenSet[_T]: ... + def difference(self, *s: Iterable[object]) -> FrozenSet[_T]: ... + def intersection(self, *s: Iterable[object]) -> FrozenSet[_T]: ... + def isdisjoint(self, s: Iterable[_T]) -> bool: ... + def issubset(self, s: Iterable[object]) -> bool: ... + def issuperset(self, s: Iterable[object]) -> bool: ... + def symmetric_difference(self, s: Iterable[_T]) -> FrozenSet[_T]: ... + def union(self, *s: Iterable[_T]) -> FrozenSet[_T]: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __and__(self, s: AbstractSet[_T]) -> FrozenSet[_T]: ... + def __or__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T, _S]]: ... + def __sub__(self, s: AbstractSet[_T]) -> FrozenSet[_T]: ... + def __xor__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T, _S]]: ... + def __le__(self, s: AbstractSet[object]) -> bool: ... + def __lt__(self, s: AbstractSet[object]) -> bool: ... + def __ge__(self, s: AbstractSet[object]) -> bool: ... + def __gt__(self, s: AbstractSet[object]) -> bool: ... + +class enumerate(Iterator[Tuple[int, _T]], Generic[_T]): + def __init__(self, iterable: Iterable[_T], start: int = ...) -> None: ... + def __iter__(self) -> Iterator[Tuple[int, _T]]: ... + if sys.version_info >= (3,): + def __next__(self) -> Tuple[int, _T]: ... + else: + def next(self) -> Tuple[int, _T]: ... + +if sys.version_info >= (3,): + class range(Sequence[int]): + start: int + stop: int + step: int + @overload + def __init__(self, stop: int) -> None: ... + @overload + def __init__(self, start: int, stop: int, step: int = ...) -> None: ... + def count(self, value: int) -> int: ... + def index(self, value: int, start: int = ..., stop: Optional[int] = ...) -> int: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[int]: ... + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> range: ... + def __repr__(self) -> str: ... + def __reversed__(self) -> Iterator[int]: ... +else: + class xrange(Sized, Iterable[int], Reversible[int]): + @overload + def __init__(self, stop: int) -> None: ... + @overload + def __init__(self, start: int, stop: int, step: int = ...) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __getitem__(self, i: int) -> int: ... + def __reversed__(self) -> Iterator[int]: ... + +class property(object): + def __init__(self, fget: Optional[Callable[[Any], Any]] = ..., + fset: Optional[Callable[[Any, Any], None]] = ..., + fdel: Optional[Callable[[Any], None]] = ..., + doc: Optional[str] = ...) -> None: ... + def getter(self, fget: Callable[[Any], Any]) -> property: ... + def setter(self, fset: Callable[[Any, Any], None]) -> property: ... + def deleter(self, fdel: Callable[[Any], None]) -> property: ... + def __get__(self, obj: Any, type: Optional[type] = ...) -> Any: ... + def __set__(self, obj: Any, value: Any) -> None: ... + def __delete__(self, obj: Any) -> None: ... + def fget(self) -> Any: ... + def fset(self, value: Any) -> None: ... + def fdel(self) -> None: ... + +if sys.version_info < (3,): + long = int + +NotImplemented: Any + +def abs(__n: SupportsAbs[_T]) -> _T: ... +def all(__i: Iterable[object]) -> bool: ... +def any(__i: Iterable[object]) -> bool: ... +if sys.version_info < (3,): + def apply(__func: Callable[..., _T], __args: Optional[Sequence[Any]] = ..., __kwds: Optional[Mapping[str, Any]] = ...) -> _T: ... +if sys.version_info >= (3,): + def ascii(__o: object) -> str: ... + +def bin(__number: Union[int, _SupportsIndex]) -> str: ... + +if sys.version_info >= (3, 7): + def breakpoint(*args: Any, **kws: Any) -> None: ... +def callable(__o: object) -> bool: ... +def chr(__code: int) -> str: ... +if sys.version_info < (3,): + def cmp(__x: Any, __y: Any) -> int: ... + _N1 = TypeVar('_N1', bool, int, float, complex) + def coerce(__x: _N1, __y: _N1) -> Tuple[_N1, _N1]: ... +if sys.version_info >= (3, 6): + # This class is to be exported as PathLike from os, + # but we define it here as _PathLike to avoid import cycle issues. + # See https://github.com/python/typeshed/pull/991#issuecomment-288160993 + class _PathLike(Generic[AnyStr]): + def __fspath__(self) -> AnyStr: ... + def compile(source: Union[str, bytes, mod, AST], filename: Union[str, bytes, _PathLike[Any]], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ... +elif sys.version_info >= (3,): + def compile(source: Union[str, bytes, mod, AST], filename: Union[str, bytes], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ... +else: + def compile(source: Union[Text, mod], filename: Text, mode: Text, flags: int = ..., dont_inherit: int = ...) -> Any: ... +if sys.version_info >= (3,): + def copyright() -> None: ... + def credits() -> None: ... +def delattr(__o: Any, __name: Text) -> None: ... +def dir(__o: object = ...) -> List[str]: ... +_N2 = TypeVar('_N2', int, float) +def divmod(__a: _N2, __b: _N2) -> Tuple[_N2, _N2]: ... +def eval(__source: Union[Text, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ...) -> Any: ... +if sys.version_info >= (3,): + def exec(__object: Union[str, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ...) -> Any: ... +else: + def execfile(__filename: str, __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Dict[str, Any]] = ...) -> None: ... +def exit(code: object = ...) -> NoReturn: ... +if sys.version_info >= (3,): + @overload + def filter(__function: None, __iterable: Iterable[Optional[_T]]) -> Iterator[_T]: ... + @overload + def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> Iterator[_T]: ... +else: + @overload + def filter(__function: Callable[[AnyStr], Any], __iterable: AnyStr) -> AnyStr: ... # type: ignore + @overload + def filter(__function: None, __iterable: Tuple[Optional[_T], ...]) -> Tuple[_T, ...]: ... # type: ignore + @overload + def filter(__function: Callable[[_T], Any], __iterable: Tuple[_T, ...]) -> Tuple[_T, ...]: ... # type: ignore + @overload + def filter(__function: None, __iterable: Iterable[Optional[_T]]) -> List[_T]: ... + @overload + def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> List[_T]: ... +def format(__o: object, __format_spec: str = ...) -> str: ... # TODO unicode +def getattr(__o: Any, name: Text, __default: Any = ...) -> Any: ... +def globals() -> Dict[str, Any]: ... +def hasattr(__o: Any, __name: Text) -> bool: ... +def hash(__o: object) -> int: ... +if sys.version_info >= (3,): + def help(*args: Any, **kwds: Any) -> None: ... +def hex(__i: Union[int, _SupportsIndex]) -> str: ... +def id(__o: object) -> int: ... +if sys.version_info >= (3,): + def input(__prompt: Any = ...) -> str: ... +else: + def input(__prompt: Any = ...) -> Any: ... + def intern(__string: str) -> str: ... +@overload +def iter(__iterable: Iterable[_T]) -> Iterator[_T]: ... +@overload +def iter(__function: Callable[[], Optional[_T]], __sentinel: None) -> Iterator[_T]: ... +@overload +def iter(__function: Callable[[], _T], __sentinel: Any) -> Iterator[_T]: ... +def isinstance(__o: object, __t: Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]]) -> bool: ... +def issubclass(__cls: type, __classinfo: Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]]) -> bool: ... +def len(__o: Sized) -> int: ... +if sys.version_info >= (3,): + def license() -> None: ... +def locals() -> Dict[str, Any]: ... +if sys.version_info >= (3,): + @overload + def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2], _S], __iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[..., _S], + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> Iterator[_S]: ... +else: + @overload + def map(__func: None, __iter1: Iterable[_T1]) -> List[_T1]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2, _T3, _T4]]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... + @overload + def map(__func: None, + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> List[Tuple[Any, ...]]: ... + @overload + def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5]) -> List[_S]: ... + @overload + def map(__func: Callable[..., _S], + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> List[_S]: ... +if sys.version_info >= (3,): + @overload + def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ..., default: _VT) -> Union[_T, _VT]: ... +else: + @overload + def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... +if sys.version_info >= (3,): + @overload + def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ..., default: _VT) -> Union[_T, _VT]: ... +else: + @overload + def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... +@overload +def next(__i: Iterator[_T]) -> _T: ... +@overload +def next(__i: Iterator[_T], default: _VT) -> Union[_T, _VT]: ... +def oct(__i: Union[int, _SupportsIndex]) -> str: ... + +if sys.version_info >= (3, 6): + def open(file: Union[str, bytes, int, _PathLike[Any]], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., + opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ... +elif sys.version_info >= (3,): + def open(file: Union[str, bytes, int], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., + opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ... +else: + def open(name: Union[unicode, int], mode: unicode = ..., buffering: int = ...) -> BinaryIO: ... + +def ord(__c: Union[Text, bytes]) -> int: ... +if sys.version_info >= (3,): + class _Writer(Protocol): + def write(self, __s: str) -> Any: ... + def print( + *values: object, sep: Optional[Text] = ..., end: Optional[Text] = ..., file: Optional[_Writer] = ..., flush: bool = ... + ) -> None: ... + +else: + class _Writer(Protocol): + def write(self, __s: Any) -> Any: ... + # This is only available after from __future__ import print_function. + def print(*values: object, sep: Optional[Text] = ..., end: Optional[Text] = ..., file: Optional[_Writer] = ...) -> None: ... + +@overload +def pow(__x: int, __y: int) -> Any: ... # The return type can be int or float, depending on y +@overload +def pow(__x: int, __y: int, __z: int) -> Any: ... +@overload +def pow(__x: float, __y: float) -> float: ... +@overload +def pow(__x: float, __y: float, __z: float) -> float: ... +def quit(code: object = ...) -> NoReturn: ... +if sys.version_info < (3,): + def range(__x: int, __y: int = ..., __step: int = ...) -> List[int]: ... + def raw_input(__prompt: Any = ...) -> str: ... + @overload + def reduce(__function: Callable[[_T, _S], _T], __iterable: Iterable[_S], __initializer: _T) -> _T: ... + @overload + def reduce(__function: Callable[[_T, _T], _T], __iterable: Iterable[_T]) -> _T: ... + def reload(__module: Any) -> Any: ... +@overload +def reversed(__object: Sequence[_T]) -> Iterator[_T]: ... +@overload +def reversed(__object: Reversible[_T]) -> Iterator[_T]: ... +def repr(__o: object) -> str: ... +if sys.version_info >= (3,): + @overload + def round(number: float) -> int: ... + @overload + def round(number: float, ndigits: None) -> int: ... + @overload + def round(number: float, ndigits: int) -> float: ... + @overload + def round(number: SupportsRound[_T]) -> int: ... + @overload + def round(number: SupportsRound[_T], ndigits: None) -> int: ... + @overload + def round(number: SupportsRound[_T], ndigits: int) -> _T: ... +else: + @overload + def round(number: float) -> float: ... + @overload + def round(number: float, ndigits: int) -> float: ... + @overload + def round(number: SupportsFloat) -> float: ... + @overload + def round(number: SupportsFloat, ndigits: int) -> float: ... +def setattr(__object: Any, __name: Text, __value: Any) -> None: ... +if sys.version_info >= (3,): + def sorted(__iterable: Iterable[_T], *, + key: Optional[Callable[[_T], Any]] = ..., + reverse: bool = ...) -> List[_T]: ... +else: + def sorted(__iterable: Iterable[_T], *, + cmp: Callable[[_T, _T], int] = ..., + key: Optional[Callable[[_T], Any]] = ..., + reverse: bool = ...) -> List[_T]: ... +@overload +def sum(__iterable: Iterable[_T]) -> Union[_T, int]: ... +@overload +def sum(__iterable: Iterable[_T], __start: _S) -> Union[_T, _S]: ... +if sys.version_info < (3,): + def unichr(__i: int) -> unicode: ... +def vars(__object: Any = ...) -> Dict[str, Any]: ... +if sys.version_info >= (3,): + @overload + def zip(__iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4], __iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... + @overload + def zip(__iter1: Iterable[Any], __iter2: Iterable[Any], __iter3: Iterable[Any], + __iter4: Iterable[Any], __iter5: Iterable[Any], __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... +else: + @overload + def zip(__iter1: Iterable[_T1]) -> List[Tuple[_T1]]: ... + @overload + def zip(__iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2, _T3, _T4]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4], __iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... + @overload + def zip(__iter1: Iterable[Any], __iter2: Iterable[Any], __iter3: Iterable[Any], + __iter4: Iterable[Any], __iter5: Iterable[Any], __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> List[Tuple[Any, ...]]: ... +def __import__(name: Text, globals: Optional[Mapping[str, Any]] = ..., + locals: Optional[Mapping[str, Any]] = ..., + fromlist: Sequence[str] = ..., + level: int = ...) -> Any: ... + +# Actually the type of Ellipsis is , but since it's +# not exposed anywhere under that name, we make it private here. +class ellipsis: ... +Ellipsis: ellipsis + +if sys.version_info < (3,): + # TODO: buffer support is incomplete; e.g. some_string.startswith(some_buffer) doesn't type check. + _AnyBuffer = TypeVar('_AnyBuffer', str, unicode, bytearray, buffer) + + class buffer(Sized): + def __init__(self, object: _AnyBuffer, offset: int = ..., size: int = ...) -> None: ... + def __add__(self, other: _AnyBuffer) -> str: ... + def __cmp__(self, other: _AnyBuffer) -> bool: ... + def __getitem__(self, key: Union[int, slice]) -> str: ... + def __getslice__(self, i: int, j: int) -> str: ... + def __len__(self) -> int: ... + def __mul__(self, x: int) -> str: ... + +class BaseException(object): + args: Tuple[Any, ...] + if sys.version_info < (3,): + message: Any + if sys.version_info >= (3,): + __cause__: Optional[BaseException] + __context__: Optional[BaseException] + __suppress_context__: bool + __traceback__: Optional[TracebackType] + def __init__(self, *args: object) -> None: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + if sys.version_info < (3,): + def __getitem__(self, i: int) -> Any: ... + def __getslice__(self, start: int, stop: int) -> Tuple[Any, ...]: ... + if sys.version_info >= (3,): + def with_traceback(self, tb: Optional[TracebackType]) -> BaseException: ... + +class GeneratorExit(BaseException): ... +class KeyboardInterrupt(BaseException): ... +class SystemExit(BaseException): + code: int +class Exception(BaseException): ... +class StopIteration(Exception): + if sys.version_info >= (3,): + value: Any +if sys.version_info >= (3,): + _StandardError = Exception + class OSError(Exception): + errno: int + strerror: str + # filename, filename2 are actually Union[str, bytes, None] + filename: Any + filename2: Any + EnvironmentError = OSError + IOError = OSError +else: + class StandardError(Exception): ... + _StandardError = StandardError + class EnvironmentError(StandardError): + errno: int + strerror: str + # TODO can this be unicode? + filename: str + class OSError(EnvironmentError): ... + class IOError(EnvironmentError): ... + +class ArithmeticError(_StandardError): ... +class AssertionError(_StandardError): ... +class AttributeError(_StandardError): ... +class BufferError(_StandardError): ... +class EOFError(_StandardError): ... +class ImportError(_StandardError): + if sys.version_info >= (3, 3): + def __init__(self, *args, name: Optional[str] = ..., path: Optional[str] = ...) -> None: ... + name: Optional[str] + path: Optional[str] +class LookupError(_StandardError): ... +class MemoryError(_StandardError): ... +class NameError(_StandardError): ... +class ReferenceError(_StandardError): ... +class RuntimeError(_StandardError): ... +if sys.version_info >= (3, 5): + class StopAsyncIteration(Exception): + value: Any +class SyntaxError(_StandardError): + msg: str + lineno: int + offset: Optional[int] + text: Optional[str] + filename: str +class SystemError(_StandardError): ... +class TypeError(_StandardError): ... +class ValueError(_StandardError): ... + +class FloatingPointError(ArithmeticError): ... +class OverflowError(ArithmeticError): ... +class ZeroDivisionError(ArithmeticError): ... + +if sys.version_info >= (3, 6): + class ModuleNotFoundError(ImportError): ... + +class IndexError(LookupError): ... +class KeyError(LookupError): ... + +class UnboundLocalError(NameError): ... + +class WindowsError(OSError): + winerror: int +if sys.version_info >= (3,): + class BlockingIOError(OSError): + characters_written: int + class ChildProcessError(OSError): ... + class ConnectionError(OSError): ... + class BrokenPipeError(ConnectionError): ... + class ConnectionAbortedError(ConnectionError): ... + class ConnectionRefusedError(ConnectionError): ... + class ConnectionResetError(ConnectionError): ... + class FileExistsError(OSError): ... + class FileNotFoundError(OSError): ... + class InterruptedError(OSError): ... + class IsADirectoryError(OSError): ... + class NotADirectoryError(OSError): ... + class PermissionError(OSError): ... + class ProcessLookupError(OSError): ... + class TimeoutError(OSError): ... + +class NotImplementedError(RuntimeError): ... +if sys.version_info >= (3, 5): + class RecursionError(RuntimeError): ... + +class IndentationError(SyntaxError): ... +class TabError(IndentationError): ... + +class UnicodeError(ValueError): ... +class UnicodeDecodeError(UnicodeError): + encoding: str + object: bytes + start: int + end: int + reason: str + def __init__(self, __encoding: str, __object: bytes, __start: int, __end: int, + __reason: str) -> None: ... +class UnicodeEncodeError(UnicodeError): + encoding: str + object: Text + start: int + end: int + reason: str + def __init__(self, __encoding: str, __object: Text, __start: int, __end: int, + __reason: str) -> None: ... +class UnicodeTranslateError(UnicodeError): ... + +class Warning(Exception): ... +class UserWarning(Warning): ... +class DeprecationWarning(Warning): ... +class SyntaxWarning(Warning): ... +class RuntimeWarning(Warning): ... +class FutureWarning(Warning): ... +class PendingDeprecationWarning(Warning): ... +class ImportWarning(Warning): ... +class UnicodeWarning(Warning): ... +class BytesWarning(Warning): ... +if sys.version_info >= (3, 2): + class ResourceWarning(Warning): ... + +if sys.version_info < (3,): + class file(BinaryIO): + @overload + def __init__(self, file: str, mode: str = ..., buffering: int = ...) -> None: ... + @overload + def __init__(self, file: unicode, mode: str = ..., buffering: int = ...) -> None: ... + @overload + def __init__(self, file: int, mode: str = ..., buffering: int = ...) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def next(self) -> str: ... + def read(self, n: int = ...) -> str: ... + def __enter__(self) -> BinaryIO: ... + def __exit__(self, t: Optional[type] = ..., exc: Optional[BaseException] = ..., tb: Optional[Any] = ...) -> Optional[bool]: ... + def flush(self) -> None: ... + def fileno(self) -> int: ... + def isatty(self) -> bool: ... + def close(self) -> None: ... + + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def seekable(self) -> bool: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + def readline(self, limit: int = ...) -> str: ... + def readlines(self, hint: int = ...) -> List[str]: ... + def write(self, data: str) -> int: ... + def writelines(self, data: Iterable[str]) -> None: ... + def truncate(self, pos: Optional[int] = ...) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_ast.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_ast.pyi new file mode 100644 index 00000000..c461bb41 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_ast.pyi @@ -0,0 +1,330 @@ +import typing +from typing import Optional + +__version__: str +PyCF_ONLY_AST: int +_identifier = str + +class AST: + _attributes: typing.Tuple[str, ...] + _fields: typing.Tuple[str, ...] + def __init__(self, *args, **kwargs) -> None: ... + +class mod(AST): + ... + +class Module(mod): + body: typing.List[stmt] + +class Interactive(mod): + body: typing.List[stmt] + +class Expression(mod): + body: expr + +class Suite(mod): + body: typing.List[stmt] + + +class stmt(AST): + lineno: int + col_offset: int + +class FunctionDef(stmt): + name: _identifier + args: arguments + body: typing.List[stmt] + decorator_list: typing.List[expr] + +class ClassDef(stmt): + name: _identifier + bases: typing.List[expr] + body: typing.List[stmt] + decorator_list: typing.List[expr] + +class Return(stmt): + value: Optional[expr] + +class Delete(stmt): + targets: typing.List[expr] + +class Assign(stmt): + targets: typing.List[expr] + value: expr + +class AugAssign(stmt): + target: expr + op: operator + value: expr + +class Print(stmt): + dest: Optional[expr] + values: typing.List[expr] + nl: bool + +class For(stmt): + target: expr + iter: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class While(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class If(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class With(stmt): + context_expr: expr + optional_vars: Optional[expr] + body: typing.List[stmt] + +class Raise(stmt): + type: Optional[expr] + inst: Optional[expr] + tback: Optional[expr] + +class TryExcept(stmt): + body: typing.List[stmt] + handlers: typing.List[ExceptHandler] + orelse: typing.List[stmt] + +class TryFinally(stmt): + body: typing.List[stmt] + finalbody: typing.List[stmt] + +class Assert(stmt): + test: expr + msg: Optional[expr] + +class Import(stmt): + names: typing.List[alias] + +class ImportFrom(stmt): + module: Optional[_identifier] + names: typing.List[alias] + level: Optional[int] + +class Exec(stmt): + body: expr + globals: Optional[expr] + locals: Optional[expr] + +class Global(stmt): + names: typing.List[_identifier] + +class Expr(stmt): + value: expr + +class Pass(stmt): ... +class Break(stmt): ... +class Continue(stmt): ... + + +class slice(AST): + ... + +_slice = slice # this lets us type the variable named 'slice' below + +class Slice(slice): + lower: Optional[expr] + upper: Optional[expr] + step: Optional[expr] + +class ExtSlice(slice): + dims: typing.List[slice] + +class Index(slice): + value: expr + +class Ellipsis(slice): ... + + +class expr(AST): + lineno: int + col_offset: int + +class BoolOp(expr): + op: boolop + values: typing.List[expr] + +class BinOp(expr): + left: expr + op: operator + right: expr + +class UnaryOp(expr): + op: unaryop + operand: expr + +class Lambda(expr): + args: arguments + body: expr + +class IfExp(expr): + test: expr + body: expr + orelse: expr + +class Dict(expr): + keys: typing.List[expr] + values: typing.List[expr] + +class Set(expr): + elts: typing.List[expr] + +class ListComp(expr): + elt: expr + generators: typing.List[comprehension] + +class SetComp(expr): + elt: expr + generators: typing.List[comprehension] + +class DictComp(expr): + key: expr + value: expr + generators: typing.List[comprehension] + +class GeneratorExp(expr): + elt: expr + generators: typing.List[comprehension] + +class Yield(expr): + value: Optional[expr] + +class Compare(expr): + left: expr + ops: typing.List[cmpop] + comparators: typing.List[expr] + +class Call(expr): + func: expr + args: typing.List[expr] + keywords: typing.List[keyword] + starargs: Optional[expr] + kwargs: Optional[expr] + +class Repr(expr): + value: expr + +class Num(expr): + n: float + +class Str(expr): + s: str + +class Attribute(expr): + value: expr + attr: _identifier + ctx: expr_context + +class Subscript(expr): + value: expr + slice: _slice + ctx: expr_context + +class Name(expr): + id: _identifier + ctx: expr_context + +class List(expr): + elts: typing.List[expr] + ctx: expr_context + +class Tuple(expr): + elts: typing.List[expr] + ctx: expr_context + + +class expr_context(AST): + ... + +class AugLoad(expr_context): ... +class AugStore(expr_context): ... +class Del(expr_context): ... +class Load(expr_context): ... +class Param(expr_context): ... +class Store(expr_context): ... + + +class boolop(AST): + ... + +class And(boolop): ... +class Or(boolop): ... + +class operator(AST): + ... + +class Add(operator): ... +class BitAnd(operator): ... +class BitOr(operator): ... +class BitXor(operator): ... +class Div(operator): ... +class FloorDiv(operator): ... +class LShift(operator): ... +class Mod(operator): ... +class Mult(operator): ... +class Pow(operator): ... +class RShift(operator): ... +class Sub(operator): ... + +class unaryop(AST): + ... + +class Invert(unaryop): ... +class Not(unaryop): ... +class UAdd(unaryop): ... +class USub(unaryop): ... + +class cmpop(AST): + ... + +class Eq(cmpop): ... +class Gt(cmpop): ... +class GtE(cmpop): ... +class In(cmpop): ... +class Is(cmpop): ... +class IsNot(cmpop): ... +class Lt(cmpop): ... +class LtE(cmpop): ... +class NotEq(cmpop): ... +class NotIn(cmpop): ... + + +class comprehension(AST): + target: expr + iter: expr + ifs: typing.List[expr] + + +class excepthandler(AST): + ... + + +class ExceptHandler(excepthandler): + type: Optional[expr] + name: Optional[expr] + body: typing.List[stmt] + lineno: int + col_offset: int + + +class arguments(AST): + args: typing.List[expr] + vararg: Optional[_identifier] + kwarg: Optional[_identifier] + defaults: typing.List[expr] + +class keyword(AST): + arg: _identifier + value: expr + +class alias(AST): + name: _identifier + asname: Optional[_identifier] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_collections.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_collections.pyi new file mode 100644 index 00000000..bee5d67b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_collections.pyi @@ -0,0 +1,38 @@ +"""Stub file for the '_collections' module.""" + +from typing import Any, Callable, Dict, Generic, Iterator, TypeVar, Optional, Union + +_K = TypeVar("_K") +_V = TypeVar("_V") +_T = TypeVar('_T') +_T2 = TypeVar('_T2') + +class defaultdict(Dict[_K, _V]): + default_factory: None + def __init__(self, __default_factory: Callable[[], _V] = ..., init: Any = ...) -> None: ... + def __missing__(self, key: _K) -> _V: ... + def __copy__(self: _T) -> _T: ... + def copy(self: _T) -> _T: ... + +class deque(Generic[_T]): + maxlen: Optional[int] + def __init__(self, iterable: Iterator[_T] = ..., maxlen: int = ...) -> None: ... + def append(self, x: _T) -> None: ... + def appendleft(self, x: _T) -> None: ... + def clear(self) -> None: ... + def count(self, x: Any) -> int: ... + def extend(self, iterable: Iterator[_T]) -> None: ... + def extendleft(self, iterable: Iterator[_T]) -> None: ... + def pop(self) -> _T: ... + def popleft(self) -> _T: ... + def remove(self, value: _T) -> None: ... + def reverse(self) -> None: ... + def rotate(self, n: int = ...) -> None: ... + def __contains__(self, o: Any) -> bool: ... + def __copy__(self) -> deque[_T]: ... + def __getitem__(self, i: int) -> _T: ... + def __iadd__(self, other: deque[_T2]) -> deque[Union[_T, _T2]]: ... + def __iter__(self) -> Iterator[_T]: ... + def __len__(self) -> int: ... + def __reversed__(self) -> Iterator[_T]: ... + def __setitem__(self, i: int, x: _T) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_functools.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_functools.pyi new file mode 100644 index 00000000..876974e4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_functools.pyi @@ -0,0 +1,20 @@ +"""Stub file for the '_functools' module.""" + +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Tuple, overload + +_T = TypeVar("_T") +_S = TypeVar("_S") + +@overload +def reduce(function: Callable[[_T, _T], _T], + sequence: Iterable[_T]) -> _T: ... +@overload +def reduce(function: Callable[[_T, _S], _T], + sequence: Iterable[_S], initial: _T) -> _T: ... + +class partial(object): + func: Callable[..., Any] + args: Tuple[Any, ...] + keywords: Dict[str, Any] + def __init__(self, func: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_hotshot.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_hotshot.pyi new file mode 100644 index 00000000..a4404b0c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_hotshot.pyi @@ -0,0 +1,24 @@ +"""Stub file for the '_hotshot' module.""" +# This is an autogenerated file. It serves as a starting point +# for a more precise manual annotation of this module. +# Feel free to edit the source below, but remove this header when you do. + +from typing import Any, List, Tuple, Dict, Generic + +def coverage(a: str) -> Any: ... +def logreader(a: str) -> LogReaderType: ... +def profiler(a: str, *args, **kwargs) -> Any: ... +def resolution() -> Tuple[Any, ...]: ... + +class LogReaderType(object): + def close(self) -> None: ... + def fileno(self) -> int: ... + +class ProfilerType(object): + def addinfo(self, a: str, b: str) -> None: ... + def close(self) -> None: ... + def fileno(self) -> int: ... + def runcall(self, *args, **kwargs) -> Any: ... + def runcode(self, a, b, *args, **kwargs) -> Any: ... + def start(self) -> None: ... + def stop(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_io.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_io.pyi new file mode 100644 index 00000000..e8e448f2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_io.pyi @@ -0,0 +1,186 @@ +from typing import Any, AnyStr, BinaryIO, IO, Text, TextIO, Iterable, Iterator, List, Optional, Type, Tuple, TypeVar, Union +from mmap import mmap +from types import TracebackType + +_bytearray_like = Union[bytearray, mmap] + +DEFAULT_BUFFER_SIZE: int + +class BlockingIOError(IOError): + characters_written: int + +class UnsupportedOperation(ValueError, IOError): ... + +_T = TypeVar("_T") + +class _IOBase(BinaryIO): + @property + def closed(self) -> bool: ... + def _checkClosed(self, msg: Optional[str] = ...) -> None: ... # undocumented + def _checkReadable(self) -> None: ... + def _checkSeekable(self) -> None: ... + def _checkWritable(self) -> None: ... + # All these methods are concrete here (you can instantiate this) + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def readable(self) -> bool: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + def __enter__(self: _T) -> _T: ... + def __exit__(self, t: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[Any]) -> Optional[bool]: ... + def __iter__(self: _T) -> _T: ... + # The parameter type of writelines[s]() is determined by that of write(): + def writelines(self, lines: Iterable[bytes]) -> None: ... + # The return type of readline[s]() and next() is determined by that of read(): + def readline(self, limit: int = ...) -> bytes: ... + def readlines(self, hint: int = ...) -> List[bytes]: ... + def next(self) -> bytes: ... + # These don't actually exist but we need to pretend that it does + # so that this class is concrete. + def write(self, s: bytes) -> int: ... + def read(self, n: int = ...) -> bytes: ... + +class _BufferedIOBase(_IOBase): + def read1(self, n: int) -> bytes: ... + def read(self, size: int = ...) -> bytes: ... + def readinto(self, buffer: _bytearray_like) -> int: ... + def write(self, s: bytes) -> int: ... + def detach(self) -> _IOBase: ... + +class BufferedRWPair(_BufferedIOBase): + def __init__(self, reader: _RawIOBase, writer: _RawIOBase, + buffer_size: int = ..., max_buffer_size: int = ...) -> None: ... + def peek(self, n: int = ...) -> bytes: ... + def __enter__(self) -> BufferedRWPair: ... + +class BufferedRandom(_BufferedIOBase): + mode: str + name: str + raw: _IOBase + def __init__(self, raw: _IOBase, + buffer_size: int = ..., + max_buffer_size: int = ...) -> None: ... + def peek(self, n: int = ...) -> bytes: ... + +class BufferedReader(_BufferedIOBase): + mode: str + name: str + raw: _IOBase + def __init__(self, raw: _IOBase, buffer_size: int = ...) -> None: ... + def peek(self, n: int = ...) -> bytes: ... + +class BufferedWriter(_BufferedIOBase): + name: str + raw: _IOBase + mode: str + def __init__(self, raw: _IOBase, + buffer_size: int = ..., + max_buffer_size: int = ...) -> None: ... + +class BytesIO(_BufferedIOBase): + def __init__(self, initial_bytes: bytes = ...) -> None: ... + def __setstate__(self, state: Tuple[Any, ...]) -> None: ... + def __getstate__(self) -> Tuple[Any, ...]: ... + # BytesIO does not contain a "name" field. This workaround is necessary + # to allow BytesIO sub-classes to add this field, as it is defined + # as a read-only property on IO[]. + name: Any + def getvalue(self) -> bytes: ... + def write(self, s: bytes) -> int: ... + def writelines(self, lines: Iterable[bytes]) -> None: ... + def read1(self, size: int) -> bytes: ... + def next(self) -> bytes: ... + +class _RawIOBase(_IOBase): + def readall(self) -> str: ... + def read(self, n: int = ...) -> str: ... + +class FileIO(_RawIOBase, BytesIO): + mode: str + closefd: bool + def __init__(self, file: Union[str, int], mode: str = ..., closefd: bool = ...) -> None: ... + def readinto(self, buffer: _bytearray_like) -> int: ... + def write(self, pbuf: str) -> int: ... + +class IncrementalNewlineDecoder(object): + newlines: Union[str, unicode] + def __init__(self, decoder, translate, z=...) -> None: ... + def decode(self, input, final) -> Any: ... + def getstate(self) -> Tuple[Any, int]: ... + def setstate(self, state: Tuple[Any, int]) -> None: ... + def reset(self) -> None: ... + + +# Note: In the actual _io.py, _TextIOBase inherits from _IOBase. +class _TextIOBase(TextIO): + errors: Optional[str] + # TODO: On _TextIOBase, this is always None. But it's unicode/bytes in subclasses. + newlines: Union[None, unicode, bytes] + encoding: str + @property + def closed(self) -> bool: ... + def _checkClosed(self) -> None: ... + def _checkReadable(self) -> None: ... + def _checkSeekable(self) -> None: ... + def _checkWritable(self) -> None: ... + def close(self) -> None: ... + def detach(self) -> IO[Any]: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def next(self) -> unicode: ... + def read(self, size: int = ...) -> unicode: ... + def readable(self) -> bool: ... + def readline(self, limit: int = ...) -> unicode: ... + def readlines(self, hint: int = ...) -> list[unicode]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + def write(self, pbuf: unicode) -> int: ... + def writelines(self, lines: Iterable[unicode]) -> None: ... + def __enter__(self: _T) -> _T: ... + def __exit__(self, t: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[Any]) -> Optional[bool]: ... + def __iter__(self: _T) -> _T: ... + +class StringIO(_TextIOBase): + line_buffering: bool + def __init__(self, + initial_value: Optional[unicode] = ..., + newline: Optional[unicode] = ...) -> None: ... + def __setstate__(self, state: Tuple[Any, ...]) -> None: ... + def __getstate__(self) -> Tuple[Any, ...]: ... + # StringIO does not contain a "name" field. This workaround is necessary + # to allow StringIO sub-classes to add this field, as it is defined + # as a read-only property on IO[]. + name: Any + def getvalue(self) -> unicode: ... + +class TextIOWrapper(_TextIOBase): + name: str + line_buffering: bool + buffer: BinaryIO + _CHUNK_SIZE: int + def __init__( + self, + buffer: IO[Any], + encoding: Optional[Text] = ..., + errors: Optional[Text] = ..., + newline: Optional[Text] = ..., + line_buffering: bool = ..., + write_through: bool = ..., + ) -> None: ... + +def open(file: Union[str, unicode, int], + mode: Text = ..., + buffering: int = ..., + encoding: Optional[Text] = ..., + errors: Optional[Text] = ..., + newline: Optional[Text] = ..., + closefd: bool = ...) -> IO[Any]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_json.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_json.pyi new file mode 100644 index 00000000..f8bd265a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_json.pyi @@ -0,0 +1,7 @@ +from typing import Any, List, Tuple, Dict, Generic, Tuple + +def encode_basestring_ascii(*args, **kwargs) -> str: ... +def scanstring(a, b, *args, **kwargs) -> Tuple[Any, ...]: ... + +class Encoder(object): ... +class Scanner(object): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_md5.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_md5.pyi new file mode 100644 index 00000000..96111b70 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_md5.pyi @@ -0,0 +1,13 @@ +blocksize: int +digest_size: int + +class MD5Type(object): + name: str + block_size: int + digest_size: int + def copy(self) -> MD5Type: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def update(self, arg: str) -> None: ... + +def new(arg: str = ...) -> MD5Type: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_sha.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_sha.pyi new file mode 100644 index 00000000..7c472562 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_sha.pyi @@ -0,0 +1,15 @@ +blocksize: int +block_size: int +digest_size: int + +class sha(object): # not actually exposed + name: str + block_size: int + digest_size: int + digestsize: int + def copy(self) -> sha: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def update(self, arg: str) -> None: ... + +def new(arg: str = ...) -> sha: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_sha256.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_sha256.pyi new file mode 100644 index 00000000..b6eb47d4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_sha256.pyi @@ -0,0 +1,23 @@ +from typing import Optional + +class sha224(object): + name: str + block_size: int + digest_size: int + digestsize: int + def __init__(self, init: Optional[str]) -> None: ... + def copy(self) -> sha224: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def update(self, arg: str) -> None: ... + +class sha256(object): + name: str + block_size: int + digest_size: int + digestsize: int + def __init__(self, init: Optional[str]) -> None: ... + def copy(self) -> sha256: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def update(self, arg: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_sha512.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_sha512.pyi new file mode 100644 index 00000000..b1ca9aee --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_sha512.pyi @@ -0,0 +1,23 @@ +from typing import Optional + +class sha384(object): + name: str + block_size: int + digest_size: int + digestsize: int + def __init__(self, init: Optional[str]) -> None: ... + def copy(self) -> sha384: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def update(self, arg: str) -> None: ... + +class sha512(object): + name: str + block_size: int + digest_size: int + digestsize: int + def __init__(self, init: Optional[str]) -> None: ... + def copy(self) -> sha512: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def update(self, arg: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_socket.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_socket.pyi new file mode 100644 index 00000000..f6a058ac --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_socket.pyi @@ -0,0 +1,283 @@ +from typing import Tuple, Union, IO, Any, Optional, overload + +AF_APPLETALK: int +AF_ASH: int +AF_ATMPVC: int +AF_ATMSVC: int +AF_AX25: int +AF_BLUETOOTH: int +AF_BRIDGE: int +AF_DECnet: int +AF_ECONET: int +AF_INET: int +AF_INET6: int +AF_IPX: int +AF_IRDA: int +AF_KEY: int +AF_LLC: int +AF_NETBEUI: int +AF_NETLINK: int +AF_NETROM: int +AF_PACKET: int +AF_PPPOX: int +AF_ROSE: int +AF_ROUTE: int +AF_SECURITY: int +AF_SNA: int +AF_TIPC: int +AF_UNIX: int +AF_UNSPEC: int +AF_WANPIPE: int +AF_X25: int +AI_ADDRCONFIG: int +AI_ALL: int +AI_CANONNAME: int +AI_NUMERICHOST: int +AI_NUMERICSERV: int +AI_PASSIVE: int +AI_V4MAPPED: int +BDADDR_ANY: str +BDADDR_LOCAL: str +BTPROTO_HCI: int +BTPROTO_L2CAP: int +BTPROTO_RFCOMM: int +BTPROTO_SCO: int +EAI_ADDRFAMILY: int +EAI_AGAIN: int +EAI_BADFLAGS: int +EAI_FAIL: int +EAI_FAMILY: int +EAI_MEMORY: int +EAI_NODATA: int +EAI_NONAME: int +EAI_OVERFLOW: int +EAI_SERVICE: int +EAI_SOCKTYPE: int +EAI_SYSTEM: int +EBADF: int +EINTR: int +HCI_DATA_DIR: int +HCI_FILTER: int +HCI_TIME_STAMP: int +INADDR_ALLHOSTS_GROUP: int +INADDR_ANY: int +INADDR_BROADCAST: int +INADDR_LOOPBACK: int +INADDR_MAX_LOCAL_GROUP: int +INADDR_NONE: int +INADDR_UNSPEC_GROUP: int +IPPORT_RESERVED: int +IPPORT_USERRESERVED: int +IPPROTO_AH: int +IPPROTO_DSTOPTS: int +IPPROTO_EGP: int +IPPROTO_ESP: int +IPPROTO_FRAGMENT: int +IPPROTO_GRE: int +IPPROTO_HOPOPTS: int +IPPROTO_ICMP: int +IPPROTO_ICMPV6: int +IPPROTO_IDP: int +IPPROTO_IGMP: int +IPPROTO_IP: int +IPPROTO_IPIP: int +IPPROTO_IPV6: int +IPPROTO_NONE: int +IPPROTO_PIM: int +IPPROTO_PUP: int +IPPROTO_RAW: int +IPPROTO_ROUTING: int +IPPROTO_RSVP: int +IPPROTO_TCP: int +IPPROTO_TP: int +IPPROTO_UDP: int +IPV6_CHECKSUM: int +IPV6_DSTOPTS: int +IPV6_HOPLIMIT: int +IPV6_HOPOPTS: int +IPV6_JOIN_GROUP: int +IPV6_LEAVE_GROUP: int +IPV6_MULTICAST_HOPS: int +IPV6_MULTICAST_IF: int +IPV6_MULTICAST_LOOP: int +IPV6_NEXTHOP: int +IPV6_PKTINFO: int +IPV6_RECVDSTOPTS: int +IPV6_RECVHOPLIMIT: int +IPV6_RECVHOPOPTS: int +IPV6_RECVPKTINFO: int +IPV6_RECVRTHDR: int +IPV6_RECVTCLASS: int +IPV6_RTHDR: int +IPV6_RTHDRDSTOPTS: int +IPV6_RTHDR_TYPE_0: int +IPV6_TCLASS: int +IPV6_UNICAST_HOPS: int +IPV6_V6ONLY: int +IP_ADD_MEMBERSHIP: int +IP_DEFAULT_MULTICAST_LOOP: int +IP_DEFAULT_MULTICAST_TTL: int +IP_DROP_MEMBERSHIP: int +IP_HDRINCL: int +IP_MAX_MEMBERSHIPS: int +IP_MULTICAST_IF: int +IP_MULTICAST_LOOP: int +IP_MULTICAST_TTL: int +IP_OPTIONS: int +IP_RECVOPTS: int +IP_RECVRETOPTS: int +IP_RETOPTS: int +IP_TOS: int +IP_TTL: int +MSG_CTRUNC: int +MSG_DONTROUTE: int +MSG_DONTWAIT: int +MSG_EOR: int +MSG_OOB: int +MSG_PEEK: int +MSG_TRUNC: int +MSG_WAITALL: int +MethodType: type +NETLINK_DNRTMSG: int +NETLINK_FIREWALL: int +NETLINK_IP6_FW: int +NETLINK_NFLOG: int +NETLINK_ROUTE: int +NETLINK_USERSOCK: int +NETLINK_XFRM: int +NI_DGRAM: int +NI_MAXHOST: int +NI_MAXSERV: int +NI_NAMEREQD: int +NI_NOFQDN: int +NI_NUMERICHOST: int +NI_NUMERICSERV: int +PACKET_BROADCAST: int +PACKET_FASTROUTE: int +PACKET_HOST: int +PACKET_LOOPBACK: int +PACKET_MULTICAST: int +PACKET_OTHERHOST: int +PACKET_OUTGOING: int +PF_PACKET: int +SHUT_RD: int +SHUT_RDWR: int +SHUT_WR: int +SOCK_DGRAM: int +SOCK_RAW: int +SOCK_RDM: int +SOCK_SEQPACKET: int +SOCK_STREAM: int +SOL_HCI: int +SOL_IP: int +SOL_SOCKET: int +SOL_TCP: int +SOL_TIPC: int +SOL_UDP: int +SOMAXCONN: int +SO_ACCEPTCONN: int +SO_BROADCAST: int +SO_DEBUG: int +SO_DONTROUTE: int +SO_ERROR: int +SO_KEEPALIVE: int +SO_LINGER: int +SO_OOBINLINE: int +SO_RCVBUF: int +SO_RCVLOWAT: int +SO_RCVTIMEO: int +SO_REUSEADDR: int +SO_REUSEPORT: int +SO_SNDBUF: int +SO_SNDLOWAT: int +SO_SNDTIMEO: int +SO_TYPE: int +SSL_ERROR_EOF: int +SSL_ERROR_INVALID_ERROR_CODE: int +SSL_ERROR_SSL: int +SSL_ERROR_SYSCALL: int +SSL_ERROR_WANT_CONNECT: int +SSL_ERROR_WANT_READ: int +SSL_ERROR_WANT_WRITE: int +SSL_ERROR_WANT_X509_LOOKUP: int +SSL_ERROR_ZERO_RETURN: int +TCP_CORK: int +TCP_DEFER_ACCEPT: int +TCP_INFO: int +TCP_KEEPCNT: int +TCP_KEEPIDLE: int +TCP_KEEPINTVL: int +TCP_LINGER2: int +TCP_MAXSEG: int +TCP_NODELAY: int +TCP_QUICKACK: int +TCP_SYNCNT: int +TCP_WINDOW_CLAMP: int +TIPC_ADDR_ID: int +TIPC_ADDR_NAME: int +TIPC_ADDR_NAMESEQ: int +TIPC_CFG_SRV: int +TIPC_CLUSTER_SCOPE: int +TIPC_CONN_TIMEOUT: int +TIPC_CRITICAL_IMPORTANCE: int +TIPC_DEST_DROPPABLE: int +TIPC_HIGH_IMPORTANCE: int +TIPC_IMPORTANCE: int +TIPC_LOW_IMPORTANCE: int +TIPC_MEDIUM_IMPORTANCE: int +TIPC_NODE_SCOPE: int +TIPC_PUBLISHED: int +TIPC_SRC_DROPPABLE: int +TIPC_SUBSCR_TIMEOUT: int +TIPC_SUB_CANCEL: int +TIPC_SUB_PORTS: int +TIPC_SUB_SERVICE: int +TIPC_TOP_SRV: int +TIPC_WAIT_FOREVER: int +TIPC_WITHDRAWN: int +TIPC_ZONE_SCOPE: int + +# PyCapsule +CAPI: Any + +has_ipv6: bool + +class error(IOError): ... +class gaierror(error): ... +class timeout(error): ... + +class SocketType(object): + family: int + type: int + proto: int + timeout: float + + def __init__(self, family: int = ..., type: int = ..., proto: int = ...) -> None: ... + def accept(self) -> Tuple[SocketType, Tuple[Any, ...]]: ... + def bind(self, address: Tuple[Any, ...]) -> None: ... + def close(self) -> None: ... + def connect(self, address: Tuple[Any, ...]) -> None: ... + def connect_ex(self, address: Tuple[Any, ...]) -> int: ... + def dup(self) -> SocketType: ... + def fileno(self) -> int: ... + def getpeername(self) -> Tuple[Any, ...]: ... + def getsockname(self) -> Tuple[Any, ...]: ... + def getsockopt(self, level: int, option: int, buffersize: int = ...) -> str: ... + def gettimeout(self) -> float: ... + def listen(self, backlog: int) -> None: ... + def makefile(self, mode: str = ..., buffersize: int = ...) -> IO[Any]: ... + def recv(self, buffersize: int, flags: int = ...) -> str: ... + def recv_into(self, buffer: bytearray, nbytes: int = ..., flags: int = ...) -> int: ... + def recvfrom(self, buffersize: int, flags: int = ...) -> Tuple[Any, ...]: ... + def recvfrom_into(self, buffer: bytearray, nbytes: int = ..., + flags: int = ...) -> int: ... + def send(self, data: str, flags: int = ...) -> int: ... + def sendall(self, data: str, flags: int = ...) -> None: ... + @overload + def sendto(self, data: str, address: Tuple[Any, ...]) -> int: ... + @overload + def sendto(self, data: str, flags: int, address: Tuple[Any, ...]) -> int: ... + def setblocking(self, flag: bool) -> None: ... + def setsockopt(self, level: int, option: int, value: Union[int, str]) -> None: ... + def settimeout(self, value: Optional[float]) -> None: ... + def shutdown(self, flag: int) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_sre.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_sre.pyi new file mode 100644 index 00000000..93300f0f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_sre.pyi @@ -0,0 +1,55 @@ +"""Stub file for the '_sre' module.""" + +from typing import Any, Union, Iterable, Optional, Mapping, Sequence, Dict, List, Tuple, overload + +CODESIZE: int +MAGIC: int +MAXREPEAT: long +copyright: str + +class SRE_Match(object): + def start(self, group: int = ...) -> int: ... + def end(self, group: int = ...) -> int: ... + def expand(self, s: str) -> Any: ... + @overload + def group(self) -> str: ... + @overload + def group(self, group: int = ...) -> Optional[str]: ... + def groupdict(self) -> Dict[int, Optional[str]]: ... + def groups(self) -> Tuple[Optional[str], ...]: ... + def span(self) -> Tuple[int, int]: ... + @property + def regs(self) -> Tuple[Tuple[int, int], ...]: ... # undocumented + +class SRE_Scanner(object): + pattern: str + def match(self) -> SRE_Match: ... + def search(self) -> SRE_Match: ... + +class SRE_Pattern(object): + pattern: str + flags: int + groups: int + groupindex: Mapping[str, int] + indexgroup: Sequence[int] + def findall(self, source: str, pos: int = ..., endpos: int = ...) -> List[Union[Tuple[Any, ...], str]]: ... + def finditer(self, source: str, pos: int = ..., endpos: int = ...) -> Iterable[Union[Tuple[Any, ...], str]]: ... + def match(self, pattern, pos: int = ..., endpos: int = ...) -> SRE_Match: ... + def scanner(self, s: str, start: int = ..., end: int = ...) -> SRE_Scanner: ... + def search(self, pattern, pos: int = ..., endpos: int = ...) -> SRE_Match: ... + def split(self, source: str, maxsplit: int = ...) -> List[Optional[str]]: ... + def sub(self, repl: str, string: str, count: int = ...) -> Tuple[Any, ...]: ... + def subn(self, repl: str, string: str, count: int = ...) -> Tuple[Any, ...]: ... + +def compile( + pattern: str, + flags: int, + code: List[int], + groups: int = ..., + groupindex: Mapping[str, int] = ..., + indexgroup: Sequence[int] = ..., +) -> SRE_Pattern: ... + +def getcodesize() -> int: ... + +def getlower(a: int, b: int) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_struct.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_struct.pyi new file mode 100644 index 00000000..49f44f2c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_struct.pyi @@ -0,0 +1,22 @@ +"""Stub file for the '_struct' module.""" + +from typing import Any, AnyStr, Tuple + +class error(Exception): ... + +class Struct(object): + size: int + format: str + + def __init__(self, fmt: str) -> None: ... + def pack_into(self, buffer: bytearray, offset: int, obj: Any) -> None: ... + def pack(self, *args) -> str: ... + def unpack(self, s: str) -> Tuple[Any, ...]: ... + def unpack_from(self, buffer: bytearray, offset: int = ...) -> Tuple[Any, ...]: ... + +def _clearcache() -> None: ... +def calcsize(fmt: str) -> int: ... +def pack(fmt: AnyStr, obj: Any) -> str: ... +def pack_into(fmt: AnyStr, buffer: bytearray, offset: int, obj: Any) -> None: ... +def unpack(fmt: AnyStr, data: str) -> Tuple[Any, ...]: ... +def unpack_from(fmt: AnyStr, buffer: bytearray, offset: int = ...) -> Tuple[Any, ...]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_symtable.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_symtable.pyi new file mode 100644 index 00000000..fbf54244 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_symtable.pyi @@ -0,0 +1,39 @@ +from typing import List, Dict + +CELL: int +DEF_BOUND: int +DEF_FREE: int +DEF_FREE_CLASS: int +DEF_GLOBAL: int +DEF_IMPORT: int +DEF_LOCAL: int +DEF_PARAM: int +FREE: int +GLOBAL_EXPLICIT: int +GLOBAL_IMPLICIT: int +LOCAL: int +OPT_BARE_EXEC: int +OPT_EXEC: int +OPT_IMPORT_STAR: int +SCOPE_MASK: int +SCOPE_OFF: int +TYPE_CLASS: int +TYPE_FUNCTION: int +TYPE_MODULE: int +USE: int + +class _symtable_entry(object): + ... + +class symtable(object): + children: List[_symtable_entry] + id: int + lineno: int + name: str + nested: int + optimized: int + symbols: Dict[str, int] + type: int + varnames: List[str] + + def __init__(self, src: str, filename: str, startstr: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_threading_local.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_threading_local.pyi new file mode 100644 index 00000000..1a7e03de --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/_threading_local.pyi @@ -0,0 +1,12 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/_threading_local.py +from typing import Any + +class _localbase(object): ... + +class local(_localbase): + def __getattribute__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __delattr__(self, name: str) -> None: ... + def __del__(self) -> None: ... + +def _patch(self: local) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/abc.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/abc.pyi new file mode 100644 index 00000000..64fbb50b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/abc.pyi @@ -0,0 +1,31 @@ +from typing import Any, Callable, Dict, Set, Tuple, Type, TypeVar +import _weakrefset + +_FuncT = TypeVar('_FuncT', bound=Callable[..., Any]) + +# NOTE: mypy has special processing for ABCMeta and abstractmethod. + +def abstractmethod(funcobj: _FuncT) -> _FuncT: ... + +class ABCMeta(type): + # TODO: FrozenSet + __abstractmethods__: Set[Any] + _abc_cache: _weakrefset.WeakSet[Any] + _abc_invalidation_counter: int + _abc_negative_cache: _weakrefset.WeakSet[Any] + _abc_negative_cache_version: int + _abc_registry: _weakrefset.WeakSet[Any] + def __init__(self, name: str, bases: Tuple[type, ...], namespace: Dict[Any, Any]) -> None: ... + def __instancecheck__(cls: ABCMeta, instance: Any) -> Any: ... + def __subclasscheck__(cls: ABCMeta, subclass: Any) -> Any: ... + def _dump_registry(cls: ABCMeta, *args: Any, **kwargs: Any) -> None: ... + def register(cls: ABCMeta, subclass: Type[Any]) -> None: ... + +# TODO: The real abc.abstractproperty inherits from "property". +class abstractproperty(object): + def __new__(cls, func: Any) -> Any: ... + __isabstractmethod__: bool + doc: Any + fdel: Any + fget: Any + fset: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/ast.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/ast.pyi new file mode 100644 index 00000000..c5ffd655 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/ast.pyi @@ -0,0 +1,28 @@ +# Python 2.7 ast + +# Rename typing to _typing, as not to conflict with typing imported +# from _ast below when loaded in an unorthodox way by the Dropbox +# internal Bazel integration. +import typing as _typing +from typing import Any, Iterator, Optional, Union + +from _ast import * +from _ast import AST, Module + +def parse(source: Union[str, unicode], filename: Union[str, unicode] = ..., mode: Union[str, unicode] = ...) -> Module: ... +def copy_location(new_node: AST, old_node: AST) -> AST: ... +def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... +def fix_missing_locations(node: AST) -> AST: ... +def get_docstring(node: AST, clean: bool = ...) -> str: ... +def increment_lineno(node: AST, n: int = ...) -> AST: ... +def iter_child_nodes(node: AST) -> Iterator[AST]: ... +def iter_fields(node: AST) -> Iterator[_typing.Tuple[str, Any]]: ... +def literal_eval(node_or_string: Union[str, unicode, AST]) -> Any: ... +def walk(node: AST) -> Iterator[AST]: ... + +class NodeVisitor(): + def visit(self, node: AST) -> Any: ... + def generic_visit(self, node: AST) -> Any: ... + +class NodeTransformer(NodeVisitor): + def generic_visit(self, node: AST) -> Optional[AST]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/atexit.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/atexit.pyi new file mode 100644 index 00000000..13d2602b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/atexit.pyi @@ -0,0 +1,5 @@ +from typing import TypeVar, Any + +_FT = TypeVar('_FT') + +def register(func: _FT, *args: Any, **kargs: Any) -> _FT: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/cPickle.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/cPickle.pyi new file mode 100644 index 00000000..0421c50e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/cPickle.pyi @@ -0,0 +1,32 @@ +from typing import Any, IO, List + +HIGHEST_PROTOCOL: int +compatible_formats: List[str] +format_version: str + +class Pickler: + def __init__(self, file: IO[str], protocol: int = ...) -> None: ... + + def dump(self, obj: Any) -> None: ... + + def clear_memo(self) -> None: ... + + +class Unpickler: + def __init__(self, file: IO[str]) -> None: ... + + def load(self) -> Any: ... + + def noload(self) -> Any: ... + + +def dump(obj: Any, file: IO[str], protocol: int = ...) -> None: ... +def dumps(obj: Any, protocol: int = ...) -> str: ... +def load(file: IO[str]) -> Any: ... +def loads(str: str) -> Any: ... + +class PickleError(Exception): ... +class UnpicklingError(PickleError): ... +class BadPickleGet(UnpicklingError): ... +class PicklingError(PickleError): ... +class UnpickleableError(PicklingError): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/cStringIO.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/cStringIO.pyi new file mode 100644 index 00000000..380e3a4b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/cStringIO.pyi @@ -0,0 +1,54 @@ +# Stubs for cStringIO (Python 2.7) +# See https://docs.python.org/2/library/stringio.html + +from abc import ABCMeta +from typing import overload, IO, List, Iterable, Iterator, Optional, Union +from types import TracebackType + +# TODO the typing.IO[] generics should be split into input and output. + +# This class isn't actually abstract, but you can't instantiate it +# directly, so we might as well treat it as abstract in the stub. +class InputType(IO[str], Iterator[str], metaclass=ABCMeta): + def getvalue(self) -> str: ... + def close(self) -> None: ... + @property + def closed(self) -> bool: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def read(self, size: int = ...) -> str: ... + def readline(self, size: int = ...) -> str: ... + def readlines(self, hint: int = ...) -> List[str]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def __iter__(self) -> InputType: ... + def next(self) -> str: ... + def reset(self) -> None: ... + + +class OutputType(IO[str], Iterator[str], metaclass=ABCMeta): + @property + def softspace(self) -> int: ... + def getvalue(self) -> str: ... + def close(self) -> None: ... + @property + def closed(self) -> bool: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def read(self, size: int = ...) -> str: ... + def readline(self, size: int = ...) -> str: ... + def readlines(self, hint: int = ...) -> List[str]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def __iter__(self) -> OutputType: ... + def next(self) -> str: ... + def reset(self) -> None: ... + def write(self, b: Union[str, unicode]) -> int: ... + def writelines(self, lines: Iterable[Union[str, unicode]]) -> None: ... + +@overload +def StringIO() -> OutputType: ... +@overload +def StringIO(s: str) -> InputType: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/collections.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/collections.pyi new file mode 100644 index 00000000..988e9202 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/collections.pyi @@ -0,0 +1,120 @@ +# These are not exported. +from typing import Any, Dict, Generic, TypeVar, Tuple, overload, Type, Optional, List, Union, Reversible + +# These are exported. +from typing import ( + Callable as Callable, + Container as Container, + Hashable as Hashable, + ItemsView as ItemsView, + Iterable as Iterable, + Iterator as Iterator, + KeysView as KeysView, + Mapping as Mapping, + MappingView as MappingView, + MutableMapping as MutableMapping, + MutableSequence as MutableSequence, + MutableSet as MutableSet, + Sequence as Sequence, + AbstractSet as Set, + Sized as Sized, + ValuesView as ValuesView, +) + +_S = TypeVar('_S') +_T = TypeVar('_T') +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') + +# namedtuple is special-cased in the type checker; the initializer is ignored. +def namedtuple(typename: Union[str, unicode], field_names: Union[str, unicode, Iterable[Union[str, unicode]]], + verbose: bool = ..., rename: bool = ...) -> Type[Tuple[Any, ...]]: ... + +class deque(Sized, Iterable[_T], Reversible[_T], Generic[_T]): + def __init__(self, iterable: Iterable[_T] = ..., + maxlen: int = ...) -> None: ... + @property + def maxlen(self) -> Optional[int]: ... + def append(self, x: _T) -> None: ... + def appendleft(self, x: _T) -> None: ... + def clear(self) -> None: ... + def count(self, x: _T) -> int: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def extendleft(self, iterable: Iterable[_T]) -> None: ... + def pop(self) -> _T: ... + def popleft(self) -> _T: ... + def remove(self, value: _T) -> None: ... + def reverse(self) -> None: ... + def rotate(self, n: int) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __hash__(self) -> int: ... + def __getitem__(self, i: int) -> _T: ... + def __setitem__(self, i: int, x: _T) -> None: ... + def __contains__(self, o: _T) -> bool: ... + def __reversed__(self) -> Iterator[_T]: ... + def __iadd__(self: _S, iterable: Iterable[_T]) -> _S: ... + +class Counter(Dict[_T, int], Generic[_T]): + @overload + def __init__(self, **kwargs: int) -> None: ... + @overload + def __init__(self, mapping: Mapping[_T, int]) -> None: ... + @overload + def __init__(self, iterable: Iterable[_T]) -> None: ... + def copy(self: _S) -> _S: ... + def elements(self) -> Iterator[_T]: ... + def most_common(self, n: Optional[int] = ...) -> List[Tuple[_T, int]]: ... + @overload + def subtract(self, __mapping: Mapping[_T, int]) -> None: ... + @overload + def subtract(self, iterable: Iterable[_T]) -> None: ... + # The Iterable[Tuple[...]] argument type is not actually desirable + # (the tuples will be added as keys, breaking type safety) but + # it's included so that the signature is compatible with + # Dict.update. Not sure if we should use '# type: ignore' instead + # and omit the type from the union. + @overload + def update(self, __m: Mapping[_T, int], **kwargs: int) -> None: ... + @overload + def update(self, __m: Union[Iterable[_T], Iterable[Tuple[_T, int]]], **kwargs: int) -> None: ... + @overload + def update(self, **kwargs: int) -> None: ... + + def __add__(self, other: Counter[_T]) -> Counter[_T]: ... + def __sub__(self, other: Counter[_T]) -> Counter[_T]: ... + def __and__(self, other: Counter[_T]) -> Counter[_T]: ... + def __or__(self, other: Counter[_T]) -> Counter[_T]: ... + def __iadd__(self, other: Counter[_T]) -> Counter[_T]: ... + def __isub__(self, other: Counter[_T]) -> Counter[_T]: ... + def __iand__(self, other: Counter[_T]) -> Counter[_T]: ... + def __ior__(self, other: Counter[_T]) -> Counter[_T]: ... + +class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]): + def popitem(self, last: bool = ...) -> Tuple[_KT, _VT]: ... + def copy(self: _S) -> _S: ... + def __reversed__(self) -> Iterator[_KT]: ... + +class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]): + default_factory: Callable[[], _VT] + @overload + def __init__(self, **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]]) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + map: Mapping[_KT, _VT]) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + iterable: Iterable[Tuple[_KT, _VT]]) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + def __missing__(self, key: _KT) -> _VT: ... + def copy(self: _S) -> _S: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/commands.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/commands.pyi new file mode 100644 index 00000000..e321f084 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/commands.pyi @@ -0,0 +1,12 @@ +from typing import overload, AnyStr, Text, Tuple + +def getstatus(file: Text) -> str: ... +def getoutput(cmd: Text) -> str: ... +def getstatusoutput(cmd: Text) -> Tuple[int, str]: ... + +@overload +def mk2arg(head: bytes, x: bytes) -> bytes: ... +@overload +def mk2arg(head: Text, x: Text) -> Text: ... + +def mkarg(x: AnyStr) -> AnyStr: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/compileall.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/compileall.pyi new file mode 100644 index 00000000..2b7046d8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/compileall.pyi @@ -0,0 +1,19 @@ +# Stubs for compileall (Python 2) + +from typing import Any, Optional, Pattern, Union + +_Path = Union[str, bytes] + +# rx can be any object with a 'search' method; once we have Protocols we can change the type +def compile_dir( + dir: _Path, + maxlevels: int = ..., + ddir: Optional[_Path] = ..., + force: bool = ..., + rx: Optional[Pattern[Any]] = ..., + quiet: int = ..., +) -> int: ... +def compile_file( + fullname: _Path, ddir: Optional[_Path] = ..., force: bool = ..., rx: Optional[Pattern[Any]] = ..., quiet: int = ..., +) -> int: ... +def compile_path(skip_curdir: bool = ..., maxlevels: int = ..., force: bool = ..., quiet: int = ...) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/cookielib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/cookielib.pyi new file mode 100644 index 00000000..abbf2989 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/cookielib.pyi @@ -0,0 +1,112 @@ +from typing import Any, Optional + +class Cookie: + version: Any + name: Any + value: Any + port: Any + port_specified: Any + domain: Any + domain_specified: Any + domain_initial_dot: Any + path: Any + path_specified: Any + secure: Any + expires: Any + discard: Any + comment: Any + comment_url: Any + rfc2109: Any + def __init__(self, version, name, value, port, port_specified, domain, domain_specified, domain_initial_dot, path, + path_specified, secure, expires, discard, comment, comment_url, rest, rfc2109: bool = ...): ... + def has_nonstandard_attr(self, name): ... + def get_nonstandard_attr(self, name, default: Optional[Any] = ...): ... + def set_nonstandard_attr(self, name, value): ... + def is_expired(self, now: Optional[Any] = ...): ... + +class CookiePolicy: + def set_ok(self, cookie, request): ... + def return_ok(self, cookie, request): ... + def domain_return_ok(self, domain, request): ... + def path_return_ok(self, path, request): ... + +class DefaultCookiePolicy(CookiePolicy): + DomainStrictNoDots: Any + DomainStrictNonDomain: Any + DomainRFC2965Match: Any + DomainLiberal: Any + DomainStrict: Any + netscape: Any + rfc2965: Any + rfc2109_as_netscape: Any + hide_cookie2: Any + strict_domain: Any + strict_rfc2965_unverifiable: Any + strict_ns_unverifiable: Any + strict_ns_domain: Any + strict_ns_set_initial_dollar: Any + strict_ns_set_path: Any + def __init__(self, blocked_domains: Optional[Any] = ..., allowed_domains: Optional[Any] = ..., netscape: bool = ..., + rfc2965: bool = ..., rfc2109_as_netscape: Optional[Any] = ..., hide_cookie2: bool = ..., + strict_domain: bool = ..., strict_rfc2965_unverifiable: bool = ..., strict_ns_unverifiable: bool = ..., + strict_ns_domain=..., strict_ns_set_initial_dollar: bool = ..., strict_ns_set_path: bool = ...): ... + def blocked_domains(self): ... + def set_blocked_domains(self, blocked_domains): ... + def is_blocked(self, domain): ... + def allowed_domains(self): ... + def set_allowed_domains(self, allowed_domains): ... + def is_not_allowed(self, domain): ... + def set_ok(self, cookie, request): ... + def set_ok_version(self, cookie, request): ... + def set_ok_verifiability(self, cookie, request): ... + def set_ok_name(self, cookie, request): ... + def set_ok_path(self, cookie, request): ... + def set_ok_domain(self, cookie, request): ... + def set_ok_port(self, cookie, request): ... + def return_ok(self, cookie, request): ... + def return_ok_version(self, cookie, request): ... + def return_ok_verifiability(self, cookie, request): ... + def return_ok_secure(self, cookie, request): ... + def return_ok_expires(self, cookie, request): ... + def return_ok_port(self, cookie, request): ... + def return_ok_domain(self, cookie, request): ... + def domain_return_ok(self, domain, request): ... + def path_return_ok(self, path, request): ... + +class Absent: ... + +class CookieJar: + non_word_re: Any + quote_re: Any + strict_domain_re: Any + domain_re: Any + dots_re: Any + magic_re: Any + def __init__(self, policy: Optional[Any] = ...): ... + def set_policy(self, policy): ... + def add_cookie_header(self, request): ... + def make_cookies(self, response, request): ... + def set_cookie_if_ok(self, cookie, request): ... + def set_cookie(self, cookie): ... + def extract_cookies(self, response, request): ... + def clear(self, domain: Optional[Any] = ..., path: Optional[Any] = ..., name: Optional[Any] = ...): ... + def clear_session_cookies(self): ... + def clear_expired_cookies(self): ... + def __iter__(self): ... + def __len__(self): ... + +class LoadError(IOError): ... + +class FileCookieJar(CookieJar): + filename: Any + delayload: Any + def __init__(self, filename: Optional[Any] = ..., delayload: bool = ..., policy: Optional[Any] = ...): ... + def save(self, filename: Optional[Any] = ..., ignore_discard: bool = ..., ignore_expires: bool = ...): ... + def load(self, filename: Optional[Any] = ..., ignore_discard: bool = ..., ignore_expires: bool = ...): ... + def revert(self, filename: Optional[Any] = ..., ignore_discard: bool = ..., ignore_expires: bool = ...): ... + +class LWPCookieJar(FileCookieJar): + def as_lwp_str(self, ignore_discard: bool = ..., ignore_expires: bool = ...) -> str: ... # undocumented + +MozillaCookieJar = FileCookieJar +def lwp_cookie_str(cookie: Cookie) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/copy_reg.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/copy_reg.pyi new file mode 100644 index 00000000..a64a82c7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/copy_reg.pyi @@ -0,0 +1,14 @@ + +from typing import TypeVar, Callable, Union, Tuple, Any, Optional, SupportsInt, Hashable, List + + +_Type = TypeVar("_Type", bound=type) +_Reduce = Union[Tuple[Callable[..., _Type], Tuple[Any, ...]], Tuple[Callable[..., _Type], Tuple[Any, ...], Optional[Any]]] + +__all__: List[str] + +def pickle(ob_type: _Type, pickle_function: Callable[[_Type], Union[str, _Reduce[_Type]]], constructor_ob: Optional[Callable[[_Reduce[_Type]], _Type]] = ...) -> None: ... +def constructor(object: Callable[[_Reduce[_Type]], _Type]) -> None: ... +def add_extension(module: Hashable, name: Hashable, code: SupportsInt) -> None: ... +def remove_extension(module: Hashable, name: Hashable, code: int) -> None: ... +def clear_extension_cache() -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/dircache.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/dircache.pyi new file mode 100644 index 00000000..ac6732b6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/dircache.pyi @@ -0,0 +1,10 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/dircache.py + +from typing import List, MutableSequence, Text, Union + +def reset() -> None: ... +def listdir(path: Text) -> List[str]: ... + +opendir = listdir + +def annotate(head: Text, list: Union[MutableSequence[str], MutableSequence[Text], MutableSequence[Union[str, Text]]]) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/distutils/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/distutils/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/distutils/emxccompiler.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/distutils/emxccompiler.pyi new file mode 100644 index 00000000..97e4a29a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/distutils/emxccompiler.pyi @@ -0,0 +1,5 @@ +# Stubs for emxccompiler + +from distutils.unixccompiler import UnixCCompiler + +class EMXCCompiler(UnixCCompiler): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/dummy_thread.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/dummy_thread.pyi new file mode 100644 index 00000000..28041002 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/dummy_thread.pyi @@ -0,0 +1,21 @@ +from typing import Any, Callable, Dict, NoReturn, Optional, Tuple + +class error(Exception): + def __init__(self, *args: Any) -> None: ... + +def start_new_thread(function: Callable[..., Any], args: Tuple[Any, ...], kwargs: Dict[str, Any] = ...) -> None: ... +def exit() -> NoReturn: ... +def get_ident() -> int: ... +def allocate_lock() -> LockType: ... +def stack_size(size: Optional[int] = ...) -> int: ... + +class LockType(object): + locked_status: bool + def __init__(self) -> None: ... + def acquire(self, waitflag: Optional[bool] = ...) -> bool: ... + def __enter__(self, waitflag: Optional[bool] = ...) -> bool: ... + def __exit__(self, typ: Any, val: Any, tb: Any) -> None: ... + def release(self) -> bool: ... + def locked(self) -> bool: ... + +def interrupt_main() -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/MIMEText.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/MIMEText.pyi new file mode 100644 index 00000000..3b059778 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/MIMEText.pyi @@ -0,0 +1,4 @@ +from email.mime.nonmultipart import MIMENonMultipart + +class MIMEText(MIMENonMultipart): + def __init__(self, _text, _subtype=..., _charset=...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/__init__.pyi new file mode 100644 index 00000000..384d9567 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/__init__.pyi @@ -0,0 +1,6 @@ +from typing import IO, Any, AnyStr + +def message_from_string(s: AnyStr, *args, **kwargs): ... +def message_from_bytes(s: str, *args, **kwargs): ... +def message_from_file(fp: IO[AnyStr], *args, **kwargs): ... +def message_from_binary_file(fp: IO[str], *args, **kwargs): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/_parseaddr.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/_parseaddr.pyi new file mode 100644 index 00000000..424ade70 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/_parseaddr.pyi @@ -0,0 +1,40 @@ +from typing import Any, Optional + +def parsedate_tz(data): ... +def parsedate(data): ... +def mktime_tz(data): ... +def quote(str): ... + +class AddrlistClass: + specials: Any + pos: Any + LWS: Any + CR: Any + FWS: Any + atomends: Any + phraseends: Any + field: Any + commentlist: Any + def __init__(self, field): ... + def gotonext(self): ... + def getaddrlist(self): ... + def getaddress(self): ... + def getrouteaddr(self): ... + def getaddrspec(self): ... + def getdomain(self): ... + def getdelimited(self, beginchar, endchars, allowcomments: bool = ...): ... + def getquote(self): ... + def getcomment(self): ... + def getdomainliteral(self): ... + def getatom(self, atomends: Optional[Any] = ...): ... + def getphraselist(self): ... + +class AddressList(AddrlistClass): + addresslist: Any + def __init__(self, field): ... + def __len__(self): ... + def __add__(self, other): ... + def __iadd__(self, other): ... + def __sub__(self, other): ... + def __isub__(self, other): ... + def __getitem__(self, index): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/base64mime.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/base64mime.pyi new file mode 100644 index 00000000..f05003b8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/base64mime.pyi @@ -0,0 +1,8 @@ +def base64_len(s: bytes) -> int: ... +def header_encode(header, charset=..., keep_eols=..., maxlinelen=..., eol=...): ... +def encode(s, binary=..., maxlinelen=..., eol=...): ... +body_encode = encode +encodestring = encode +def decode(s, convert_eols=...): ... +body_decode = decode +decodestring = decode diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/charset.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/charset.pyi new file mode 100644 index 00000000..88b5f88d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/charset.pyi @@ -0,0 +1,26 @@ +def add_charset(charset, header_enc=..., body_enc=..., output_charset=...) -> None: ... +def add_alias(alias, canonical) -> None: ... +def add_codec(charset, codecname) -> None: ... + +QP: int # undocumented +BASE64: int # undocumented +SHORTEST: int # undocumented + +class Charset: + input_charset = ... + header_encoding = ... + body_encoding = ... + output_charset = ... + input_codec = ... + output_codec = ... + def __init__(self, input_charset=...) -> None: ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def get_body_encoding(self): ... + def convert(self, s): ... + def to_splittable(self, s): ... + def from_splittable(self, ustr, to_output: bool = ...): ... + def get_output_charset(self): ... + def encoded_header_len(self, s): ... + def header_encode(self, s, convert: bool = ...): ... + def body_encode(self, s, convert: bool = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/encoders.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/encoders.pyi new file mode 100644 index 00000000..5670cbaf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/encoders.pyi @@ -0,0 +1,4 @@ +def encode_base64(msg) -> None: ... +def encode_quopri(msg) -> None: ... +def encode_7or8bit(msg) -> None: ... +def encode_noop(msg) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/feedparser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/feedparser.pyi new file mode 100644 index 00000000..51f82593 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/feedparser.pyi @@ -0,0 +1,18 @@ +class BufferedSubFile: + def __init__(self) -> None: ... + def push_eof_matcher(self, pred) -> None: ... + def pop_eof_matcher(self): ... + def close(self) -> None: ... + def readline(self): ... + def unreadline(self, line) -> None: ... + def push(self, data): ... + def pushlines(self, lines) -> None: ... + def is_closed(self): ... + def __iter__(self): ... + def next(self): ... + + +class FeedParser: + def __init__(self, _factory=...) -> None: ... + def feed(self, data) -> None: ... + def close(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/generator.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/generator.pyi new file mode 100644 index 00000000..96cfe2d2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/generator.pyi @@ -0,0 +1,9 @@ +class Generator: + def __init__(self, outfp, mangle_from_: bool = ..., maxheaderlen: int = ...) -> None: ... + def write(self, s) -> None: ... + def flatten(self, msg, unixfrom: bool = ...) -> None: ... + def clone(self, fp): ... + + +class DecodedGenerator(Generator): + def __init__(self, outfp, mangle_from_: bool = ..., maxheaderlen: int = ..., fmt=...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/header.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/header.pyi new file mode 100644 index 00000000..69c93630 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/header.pyi @@ -0,0 +1,11 @@ +def decode_header(header): ... +def make_header(decoded_seq, maxlinelen=..., header_name=..., continuation_ws=...): ... + +class Header: + def __init__(self, s=..., charset=..., maxlinelen=..., header_name=..., continuation_ws=..., + errors=...) -> None: ... + def __unicode__(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def append(self, s, charset=..., errors=...) -> None: ... + def encode(self, splitchars=...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/iterators.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/iterators.pyi new file mode 100644 index 00000000..50026441 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/iterators.pyi @@ -0,0 +1,5 @@ +from typing import Any, Generator + +def walk(self) -> Generator[Any, Any, Any]: ... +def body_line_iterator(msg, decode: bool = ...) -> Generator[Any, Any, Any]: ... +def typed_subpart_iterator(msg, maintype=..., subtype=...) -> Generator[Any, Any, Any]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/message.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/message.pyi new file mode 100644 index 00000000..642bba7c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/message.pyi @@ -0,0 +1,45 @@ +from typing import Any, Generator + +class Message: + preamble = ... + epilogue = ... + defects = ... + def __init__(self): ... + def as_string(self, unixfrom=...): ... + def is_multipart(self) -> bool: ... + def set_unixfrom(self, unixfrom) -> None: ... + def get_unixfrom(self): ... + def attach(self, payload) -> None: ... + def get_payload(self, i=..., decode: bool = ...): ... + def set_payload(self, payload, charset=...) -> None: ... + def set_charset(self, charset): ... + def get_charset(self): ... + def __len__(self): ... + def __getitem__(self, name): ... + def __setitem__(self, name, val) -> None: ... + def __delitem__(self, name) -> None: ... + def __contains__(self, name): ... + def has_key(self, name) -> bool: ... + def keys(self): ... + def values(self): ... + def items(self): ... + def get(self, name, failobj=...): ... + def get_all(self, name, failobj=...): ... + def add_header(self, _name, _value, **_params) -> None: ... + def replace_header(self, _name, _value) -> None: ... + def get_content_type(self): ... + def get_content_maintype(self): ... + def get_content_subtype(self): ... + def get_default_type(self): ... + def set_default_type(self, ctype) -> None: ... + def get_params(self, failobj=..., header=..., unquote: bool = ...): ... + def get_param(self, param, failobj=..., header=..., unquote: bool = ...): ... + def set_param(self, param, value, header=..., requote: bool = ..., charset=..., language=...) -> None: ... + def del_param(self, param, header=..., requote: bool = ...): ... + def set_type(self, type, header=..., requote: bool = ...): ... + def get_filename(self, failobj=...): ... + def get_boundary(self, failobj=...): ... + def set_boundary(self, boundary) -> None: ... + def get_content_charset(self, failobj=...): ... + def get_charsets(self, failobj=...): ... + def walk(self) -> Generator[Any, Any, Any]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/application.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/application.pyi new file mode 100644 index 00000000..99da6728 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/application.pyi @@ -0,0 +1,11 @@ +# Stubs for email.mime.application + +from typing import Callable, Optional, Tuple, Union +from email.mime.nonmultipart import MIMENonMultipart + +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] + +class MIMEApplication(MIMENonMultipart): + def __init__(self, _data: bytes, _subtype: str = ..., + _encoder: Callable[[MIMEApplication], None] = ..., + **_params: _ParamsType) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/audio.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/audio.pyi new file mode 100644 index 00000000..406ade11 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/audio.pyi @@ -0,0 +1,5 @@ +from email.mime.nonmultipart import MIMENonMultipart + + +class MIMEAudio(MIMENonMultipart): + def __init__(self, _audiodata, _subtype=..., _encoder=..., **_params) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/base.pyi new file mode 100644 index 00000000..4bde4f07 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/base.pyi @@ -0,0 +1,4 @@ +from email import message + +class MIMEBase(message.Message): + def __init__(self, _maintype, _subtype, **_params) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/image.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/image.pyi new file mode 100644 index 00000000..2dfb098b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/image.pyi @@ -0,0 +1,5 @@ +from email.mime.nonmultipart import MIMENonMultipart + + +class MIMEImage(MIMENonMultipart): + def __init__(self, _imagedata, _subtype=..., _encoder=..., **_params) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/message.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/message.pyi new file mode 100644 index 00000000..33552faf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/message.pyi @@ -0,0 +1,5 @@ +from email.mime.nonmultipart import MIMENonMultipart + + +class MIMEMessage(MIMENonMultipart): + def __init__(self, _msg, _subtype=...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/multipart.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/multipart.pyi new file mode 100644 index 00000000..0a7d3fa8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/multipart.pyi @@ -0,0 +1,4 @@ +from email.mime.base import MIMEBase + +class MIMEMultipart(MIMEBase): + def __init__(self, _subtype=..., boundary=..., _subparts=..., **_params) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/nonmultipart.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/nonmultipart.pyi new file mode 100644 index 00000000..04d130e3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/nonmultipart.pyi @@ -0,0 +1,4 @@ +from email.mime.base import MIMEBase + +class MIMENonMultipart(MIMEBase): + def attach(self, payload): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/text.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/text.pyi new file mode 100644 index 00000000..3b059778 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/mime/text.pyi @@ -0,0 +1,4 @@ +from email.mime.nonmultipart import MIMENonMultipart + +class MIMEText(MIMENonMultipart): + def __init__(self, _text, _subtype=..., _charset=...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/parser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/parser.pyi new file mode 100644 index 00000000..4f228283 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/parser.pyi @@ -0,0 +1,10 @@ +from .feedparser import FeedParser as FeedParser # not in __all__ but listed in documentation + +class Parser: + def __init__(self, *args, **kws) -> None: ... + def parse(self, fp, headersonly: bool = ...): ... + def parsestr(self, text, headersonly: bool = ...): ... + +class HeaderParser(Parser): + def parse(self, fp, headersonly: bool = ...): ... + def parsestr(self, text, headersonly: bool = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/quoprimime.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/quoprimime.pyi new file mode 100644 index 00000000..3f2963c0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/quoprimime.pyi @@ -0,0 +1,18 @@ +def header_quopri_check(c): ... +def body_quopri_check(c): ... +def header_quopri_len(s): ... +def body_quopri_len(str): ... +def unquote(s): ... +def quote(c): ... +def header_encode(header, charset: str = ..., keep_eols: bool = ..., maxlinelen: int = ..., eol=...): ... +def encode(body, binary: bool = ..., maxlinelen: int = ..., eol=...): ... + +body_encode = encode +encodestring = encode + +def decode(encoded, eol=...): ... + +body_decode = decode +decodestring = decode + +def header_decode(s): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/utils.pyi new file mode 100644 index 00000000..7b868efc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/email/utils.pyi @@ -0,0 +1,19 @@ +from email._parseaddr import AddressList as _AddressList +from email._parseaddr import mktime_tz as mktime_tz +from email._parseaddr import parsedate as _parsedate +from email._parseaddr import parsedate_tz as _parsedate_tz +from quopri import decodestring as _qdecode +from typing import Optional, Any + +def formataddr(pair): ... +def getaddresses(fieldvalues): ... +def formatdate(timeval: Optional[Any] = ..., localtime: bool = ..., usegmt: bool = ...): ... +def make_msgid(idstring: Optional[Any] = ...): ... +def parsedate(data): ... +def parsedate_tz(data): ... +def parseaddr(addr): ... +def unquote(str): ... +def decode_rfc2231(s): ... +def encode_rfc2231(s, charset: Optional[Any] = ..., language: Optional[Any] = ...): ... +def decode_params(params): ... +def collapse_rfc2231_value(value, errors=..., fallback_charset=...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/encodings/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/encodings/__init__.pyi new file mode 100644 index 00000000..2ae6c0a9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/encodings/__init__.pyi @@ -0,0 +1,6 @@ +import codecs + +import typing + +def search_function(encoding: str) -> codecs.CodecInfo: + ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/encodings/utf_8.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/encodings/utf_8.pyi new file mode 100644 index 00000000..d38bd58d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/encodings/utf_8.pyi @@ -0,0 +1,15 @@ +import codecs +from typing import Text, Tuple + +class IncrementalEncoder(codecs.IncrementalEncoder): + def encode(self, input: Text, final: bool = ...) -> bytes: ... + +class IncrementalDecoder(codecs.BufferedIncrementalDecoder): + def _buffer_decode(self, input: bytes, errors: str, final: bool) -> Tuple[Text, int]: ... + +class StreamWriter(codecs.StreamWriter): ... +class StreamReader(codecs.StreamReader): ... + +def getregentry() -> codecs.CodecInfo: ... +def encode(input: Text, errors: Text = ...) -> bytes: ... +def decode(input: bytes, errors: Text = ...) -> Text: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/exceptions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/exceptions.pyi new file mode 100644 index 00000000..6e4bafc9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/exceptions.pyi @@ -0,0 +1,48 @@ +from __builtin__ import ArithmeticError as ArithmeticError +from __builtin__ import AssertionError as AssertionError +from __builtin__ import AttributeError as AttributeError +from __builtin__ import BaseException as BaseException +from __builtin__ import BufferError as BufferError +from __builtin__ import BytesWarning as BytesWarning +from __builtin__ import DeprecationWarning as DeprecationWarning +from __builtin__ import EOFError as EOFError +from __builtin__ import EnvironmentError as EnvironmentError +from __builtin__ import Exception as Exception +from __builtin__ import FloatingPointError as FloatingPointError +from __builtin__ import FutureWarning as FutureWarning +from __builtin__ import GeneratorExit as GeneratorExit +from __builtin__ import IOError as IOError +from __builtin__ import ImportError as ImportError +from __builtin__ import ImportWarning as ImportWarning +from __builtin__ import IndentationError as IndentationError +from __builtin__ import IndexError as IndexError +from __builtin__ import KeyError as KeyError +from __builtin__ import KeyboardInterrupt as KeyboardInterrupt +from __builtin__ import LookupError as LookupError +from __builtin__ import MemoryError as MemoryError +from __builtin__ import NameError as NameError +from __builtin__ import NotImplementedError as NotImplementedError +from __builtin__ import OSError as OSError +from __builtin__ import OverflowError as OverflowError +from __builtin__ import PendingDeprecationWarning as PendingDeprecationWarning +from __builtin__ import ReferenceError as ReferenceError +from __builtin__ import RuntimeError as RuntimeError +from __builtin__ import RuntimeWarning as RuntimeWarning +from __builtin__ import StandardError as StandardError +from __builtin__ import StopIteration as StopIteration +from __builtin__ import SyntaxError as SyntaxError +from __builtin__ import SyntaxWarning as SyntaxWarning +from __builtin__ import SystemError as SystemError +from __builtin__ import SystemExit as SystemExit +from __builtin__ import TabError as TabError +from __builtin__ import TypeError as TypeError +from __builtin__ import UnboundLocalError as UnboundLocalError +from __builtin__ import UnicodeError as UnicodeError +from __builtin__ import UnicodeDecodeError as UnicodeDecodeError +from __builtin__ import UnicodeEncodeError as UnicodeEncodeError +from __builtin__ import UnicodeTranslateError as UnicodeTranslateError +from __builtin__ import UnicodeWarning as UnicodeWarning +from __builtin__ import UserWarning as UserWarning +from __builtin__ import ValueError as ValueError +from __builtin__ import Warning as Warning +from __builtin__ import ZeroDivisionError as ZeroDivisionError diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/fcntl.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/fcntl.pyi new file mode 100644 index 00000000..5ba64ae8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/fcntl.pyi @@ -0,0 +1,87 @@ +from typing import Any, Union, IO +import io + +FASYNC: int +FD_CLOEXEC: int + +DN_ACCESS: int +DN_ATTRIB: int +DN_CREATE: int +DN_DELETE: int +DN_MODIFY: int +DN_MULTISHOT: int +DN_RENAME: int +F_DUPFD: int +F_EXLCK: int +F_GETFD: int +F_GETFL: int +F_GETLEASE: int +F_GETLK: int +F_GETLK64: int +F_GETOWN: int +F_GETSIG: int +F_NOTIFY: int +F_RDLCK: int +F_SETFD: int +F_SETFL: int +F_SETLEASE: int +F_SETLK: int +F_SETLK64: int +F_SETLKW: int +F_SETLKW64: int +F_SETOWN: int +F_SETSIG: int +F_SHLCK: int +F_UNLCK: int +F_WRLCK: int +I_ATMARK: int +I_CANPUT: int +I_CKBAND: int +I_FDINSERT: int +I_FIND: int +I_FLUSH: int +I_FLUSHBAND: int +I_GETBAND: int +I_GETCLTIME: int +I_GETSIG: int +I_GRDOPT: int +I_GWROPT: int +I_LINK: int +I_LIST: int +I_LOOK: int +I_NREAD: int +I_PEEK: int +I_PLINK: int +I_POP: int +I_PUNLINK: int +I_PUSH: int +I_RECVFD: int +I_SENDFD: int +I_SETCLTIME: int +I_SETSIG: int +I_SRDOPT: int +I_STR: int +I_SWROPT: int +I_UNLINK: int +LOCK_EX: int +LOCK_MAND: int +LOCK_NB: int +LOCK_READ: int +LOCK_RW: int +LOCK_SH: int +LOCK_UN: int +LOCK_WRITE: int + +_ANYFILE = Union[int, IO] + +# TODO All these return either int or bytes depending on the value of +# cmd (not on the type of arg). +def fcntl(fd: _ANYFILE, op: int, arg: Union[int, bytes] = ...) -> Any: ... + +# TODO: arg: int or read-only buffer interface or read-write buffer interface +def ioctl(fd: _ANYFILE, op: int, arg: Union[int, bytes] = ..., + mutate_flag: bool = ...) -> Any: ... + +def flock(fd: _ANYFILE, op: int) -> None: ... +def lockf(fd: _ANYFILE, op: int, length: int = ..., start: int = ..., + whence: int = ...) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/fnmatch.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/fnmatch.pyi new file mode 100644 index 00000000..e933b7b2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/fnmatch.pyi @@ -0,0 +1,8 @@ +from typing import AnyStr, Iterable, List, Union + +_EitherStr = Union[str, unicode] + +def fnmatch(filename: _EitherStr, pattern: _EitherStr) -> bool: ... +def fnmatchcase(filename: _EitherStr, pattern: _EitherStr) -> bool: ... +def filter(names: Iterable[AnyStr], pattern: _EitherStr) -> List[AnyStr]: ... +def translate(pattern: AnyStr) -> AnyStr: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/functools.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/functools.pyi new file mode 100644 index 00000000..dc812962 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/functools.pyi @@ -0,0 +1,33 @@ +# Stubs for functools (Python 2.7) + +# NOTE: These are incomplete! + +from abc import ABCMeta, abstractmethod +from typing import Any, Callable, Generic, Dict, Iterable, Optional, Sequence, Tuple, TypeVar, overload + +_AnyCallable = Callable[..., Any] + +_T = TypeVar("_T") +_S = TypeVar("_S") +@overload +def reduce(function: Callable[[_T, _T], _T], + sequence: Iterable[_T]) -> _T: ... +@overload +def reduce(function: Callable[[_T, _S], _T], + sequence: Iterable[_S], initial: _T) -> _T: ... + +WRAPPER_ASSIGNMENTS: Sequence[str] +WRAPPER_UPDATES: Sequence[str] + +def update_wrapper(wrapper: _AnyCallable, wrapped: _AnyCallable, assigned: Sequence[str] = ..., + updated: Sequence[str] = ...) -> _AnyCallable: ... +def wraps(wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> Callable[[_AnyCallable], _AnyCallable]: ... +def total_ordering(cls: type) -> type: ... +def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], Any]: ... + +class partial(Generic[_T]): + func = ... # Callable[..., _T] + args: Tuple[Any, ...] + keywords: Dict[str, Any] + def __init__(self, func: Callable[..., _T], *args: Any, **kwargs: Any) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> _T: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/future_builtins.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/future_builtins.pyi new file mode 100644 index 00000000..a9b25b2f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/future_builtins.pyi @@ -0,0 +1,14 @@ +from typing import Any + +from itertools import ifilter as filter +from itertools import imap as map +from itertools import izip as zip + + +def ascii(obj: Any) -> str: ... + + +def hex(x: int) -> str: ... + + +def oct(x: int) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/gc.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/gc.pyi new file mode 100644 index 00000000..cdfae749 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/gc.pyi @@ -0,0 +1,29 @@ +# Stubs for gc + +from typing import Any, List, Tuple + + +def enable() -> None: ... +def disable() -> None: ... +def isenabled() -> bool: ... +def collect(generation: int = ...) -> int: ... +def set_debug(flags: int) -> None: ... +def get_debug() -> int: ... +def get_objects() -> List[Any]: ... +def set_threshold(threshold0: int, threshold1: int = ..., + threshold2: int = ...) -> None: ... +def get_count() -> Tuple[int, int, int]: ... +def get_threshold() -> Tuple[int, int, int]: ... +def get_referrers(*objs: Any) -> List[Any]: ... +def get_referents(*objs: Any) -> List[Any]: ... +def is_tracked(obj: Any) -> bool: ... + +garbage: List[Any] + +DEBUG_STATS: int +DEBUG_COLLECTABLE: int +DEBUG_UNCOLLECTABLE: int +DEBUG_INSTANCES: int +DEBUG_OBJECTS: int +DEBUG_SAVEALL: int +DEBUG_LEAK: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/getopt.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/getopt.pyi new file mode 100644 index 00000000..370d4d5c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/getopt.pyi @@ -0,0 +1,12 @@ +from typing import List, Tuple + +class GetoptError(Exception): + opt: str + msg: str + def __init__(self, msg: str, opt: str = ...) -> None: ... + def __str__(self) -> str: ... + +error = GetoptError + +def getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ... +def gnu_getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/getpass.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/getpass.pyi new file mode 100644 index 00000000..011fc8e7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/getpass.pyi @@ -0,0 +1,8 @@ +# Stubs for getpass (Python 2) + +from typing import Any, IO + +class GetPassWarning(UserWarning): ... + +def getpass(prompt: str = ..., stream: IO[Any] = ...) -> str: ... +def getuser() -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/gettext.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/gettext.pyi new file mode 100644 index 00000000..c7bfceb7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/gettext.pyi @@ -0,0 +1,41 @@ +from typing import Any, Container, Dict, IO, List, Optional, Sequence, Type, Union + +def bindtextdomain(domain: str, localedir: str = ...) -> str: ... +def bind_textdomain_codeset(domain: str, codeset: str = ...) -> str: ... +def textdomain(domain: str = ...) -> str: ... +def gettext(message: str) -> str: ... +def lgettext(message: str) -> str: ... +def dgettext(domain: str, message: str) -> str: ... +def ldgettext(domain: str, message: str) -> str: ... +def ngettext(singular: str, plural: str, n: int) -> str: ... +def lngettext(singular: str, plural: str, n: int) -> str: ... +def dngettext(domain: str, singular: str, plural: str, n: int) -> str: ... +def ldngettext(domain: str, singular: str, plural: str, n: int) -> str: ... + +class NullTranslations(object): + def __init__(self, fp: IO[str] = ...) -> None: ... + def _parse(self, fp: IO[str]) -> None: ... + def add_fallback(self, fallback: NullTranslations) -> None: ... + def gettext(self, message: str) -> str: ... + def lgettext(self, message: str) -> str: ... + def ugettext(self, message: Union[str, unicode]) -> unicode: ... + def ngettext(self, singular: str, plural: str, n: int) -> str: ... + def lngettext(self, singular: str, plural: str, n: int) -> str: ... + def ungettext(self, singular: Union[str, unicode], plural: Union[str, unicode], n: int) -> unicode: ... + def info(self) -> Dict[str, str]: ... + def charset(self) -> Optional[str]: ... + def output_charset(self) -> Optional[str]: ... + def set_output_charset(self, charset: Optional[str]) -> None: ... + def install(self, unicode: bool = ..., names: Container[str] = ...) -> None: ... + +class GNUTranslations(NullTranslations): + LE_MAGIC: int + BE_MAGIC: int + +def find(domain: str, localedir: Optional[str] = ..., languages: Optional[Sequence[str]] = ..., + all: Any = ...) -> Optional[Union[str, List[str]]]: ... + +def translation(domain: str, localedir: Optional[str] = ..., languages: Optional[Sequence[str]] = ..., + class_: Optional[Type[NullTranslations]] = ..., fallback: bool = ..., codeset: Optional[str] = ...) -> NullTranslations: ... +def install(domain: str, localedir: Optional[str] = ..., unicode: bool = ..., codeset: Optional[str] = ..., + names: Container[str] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/glob.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/glob.pyi new file mode 100644 index 00000000..5caa166f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/glob.pyi @@ -0,0 +1,7 @@ +from typing import List, Iterator, Union, AnyStr + +def glob(pathname: AnyStr) -> List[AnyStr]: ... +def iglob(pathname: AnyStr) -> Iterator[AnyStr]: ... +def glob1(dirname: Union[str, unicode], pattern: AnyStr) -> List[AnyStr]: ... +def glob0(dirname: Union[str, unicode], basename: AnyStr) -> List[AnyStr]: ... +def has_magic(s: Union[str, unicode]) -> bool: ... # undocumented diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/gzip.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/gzip.pyi new file mode 100644 index 00000000..50c38e42 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/gzip.pyi @@ -0,0 +1,37 @@ +from typing import Any, IO, Text +import io + +class GzipFile(io.BufferedIOBase): + myfileobj: Any + max_read_chunk: Any + mode: Any + extrabuf: Any + extrasize: Any + extrastart: Any + name: Any + min_readsize: Any + compress: Any + fileobj: Any + offset: Any + mtime: Any + def __init__(self, filename: str = ..., mode: Text = ..., compresslevel: int = ..., + fileobj: IO[str] = ..., mtime: float = ...) -> None: ... + @property + def filename(self): ... + size: Any + crc: Any + def write(self, data): ... + def read(self, size=...): ... + @property + def closed(self): ... + def close(self): ... + def flush(self, zlib_mode=...): ... + def fileno(self): ... + def rewind(self): ... + def readable(self): ... + def writable(self): ... + def seekable(self): ... + def seek(self, offset, whence=...): ... + def readline(self, size=...): ... + +def open(filename: str, mode: Text = ..., compresslevel: int = ...) -> GzipFile: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/hashlib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/hashlib.pyi new file mode 100644 index 00000000..70423742 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/hashlib.pyi @@ -0,0 +1,31 @@ +# Stubs for hashlib (Python 2) + +from typing import Tuple, Union + +_DataType = Union[str, unicode, bytearray, buffer, memoryview] + +class _hash(object): # This is not actually in the module namespace. + name: str + block_size: int + digest_size: int + digestsize: int + def __init__(self, arg: _DataType = ...) -> None: ... + def update(self, arg: _DataType) -> None: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def copy(self) -> _hash: ... + +def new(name: str, data: str = ...) -> _hash: ... + +def md5(s: _DataType = ...) -> _hash: ... +def sha1(s: _DataType = ...) -> _hash: ... +def sha224(s: _DataType = ...) -> _hash: ... +def sha256(s: _DataType = ...) -> _hash: ... +def sha384(s: _DataType = ...) -> _hash: ... +def sha512(s: _DataType = ...) -> _hash: ... + +algorithms: Tuple[str, ...] +algorithms_guaranteed: Tuple[str, ...] +algorithms_available: Tuple[str, ...] + +def pbkdf2_hmac(name: str, password: str, salt: str, rounds: int, dklen: int = ...) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/heapq.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/heapq.pyi new file mode 100644 index 00000000..0e706c5f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/heapq.pyi @@ -0,0 +1,18 @@ +from typing import TypeVar, List, Iterable, Any, Callable, Optional, Protocol + +_T = TypeVar('_T') + +class _Sortable(Protocol): + def __lt__(self: _T, other: _T) -> bool: ... + +def cmp_lt(x, y) -> bool: ... +def heappush(heap: List[_T], item: _T) -> None: ... +def heappop(heap: List[_T]) -> _T: ... +def heappushpop(heap: List[_T], item: _T) -> _T: ... +def heapify(x: List[_T]) -> None: ... +def heapreplace(heap: List[_T], item: _T) -> _T: ... +def merge(*iterables: Iterable[_T]) -> Iterable[_T]: ... +def nlargest(n: int, iterable: Iterable[_T], + key: Optional[Callable[[_T], _Sortable]] = ...) -> List[_T]: ... +def nsmallest(n: int, iterable: Iterable[_T], + key: Optional[Callable[[_T], _Sortable]] = ...) -> List[_T]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/htmlentitydefs.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/htmlentitydefs.pyi new file mode 100644 index 00000000..749b3039 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/htmlentitydefs.pyi @@ -0,0 +1,5 @@ +from typing import Dict + +name2codepoint: Dict[str, int] +codepoint2name: Dict[int, str] +entitydefs: Dict[str, str] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/httplib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/httplib.pyi new file mode 100644 index 00000000..4e3843c1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/httplib.pyi @@ -0,0 +1,205 @@ +# Stubs for httplib (Python 2) +# +# Generated by stubgen and manually massaged a bit. +# Needs lots more work! + +from typing import Any, Dict, Optional, Protocol +import mimetools +import ssl + +class HTTPMessage(mimetools.Message): + def addcontinue(self, key: str, more: str) -> None: ... + dict: Dict[str, str] + def addheader(self, key: str, value: str) -> None: ... + unixfrom: str + headers: Any + status: str + seekable: bool + def readheaders(self) -> None: ... + +class HTTPResponse: + fp: Any + debuglevel: Any + strict: Any + msg: Any + version: Any + status: Any + reason: Any + chunked: Any + chunk_left: Any + length: Any + will_close: Any + def __init__(self, sock, debuglevel: int = ..., strict: int = ..., method: Optional[Any] = ..., + buffering: bool = ...) -> None: ... + def begin(self): ... + def close(self): ... + def isclosed(self): ... + def read(self, amt: Optional[Any] = ...): ... + def fileno(self): ... + def getheader(self, name, default: Optional[Any] = ...): ... + def getheaders(self): ... + +# This is an API stub only for HTTPConnection and HTTPSConnection, as used in +# urllib2.AbstractHTTPHandler.do_open, which takes either the class +# HTTPConnection or the class HTTPSConnection, *not* an instance of either +# class. do_open does not use all of the parameters of HTTPConnection.__init__ +# or HTTPSConnection.__init__, so HTTPConnectionProtocol only implements the +# parameters that do_open does use. +class HTTPConnectionProtocol(Protocol): + def __call__(self, host: str, timeout: int = ..., **http_con_args: Any) -> HTTPConnection: ... + +class HTTPConnection: + response_class: Any + default_port: Any + auto_open: Any + debuglevel: Any + strict: Any + timeout: Any + source_address: Any + sock: Any + host: str = ... + port: int = ... + def __init__(self, host, port: Optional[Any] = ..., strict: Optional[Any] = ..., timeout=..., + source_address: Optional[Any] = ...) -> None: ... + def set_tunnel(self, host, port: Optional[Any] = ..., headers: Optional[Any] = ...): ... + def set_debuglevel(self, level): ... + def connect(self): ... + def close(self): ... + def send(self, data): ... + def putrequest(self, method, url, skip_host: int = ..., skip_accept_encoding: int = ...): ... + def putheader(self, header, *values): ... + def endheaders(self, message_body: Optional[Any] = ...): ... + def request(self, method, url, body: Optional[Any] = ..., headers=...): ... + def getresponse(self, buffering: bool = ...): ... + +class HTTP: + debuglevel: Any + def __init__(self, host: str = ..., port: Optional[Any] = ..., strict: Optional[Any] = ...) -> None: ... + def connect(self, host: Optional[Any] = ..., port: Optional[Any] = ...): ... + def getfile(self): ... + file: Any + headers: Any + def getreply(self, buffering: bool = ...): ... + def close(self): ... + +class HTTPSConnection(HTTPConnection): + default_port: Any + key_file: Any + cert_file: Any + def __init__(self, host, port: Optional[Any] = ..., key_file: Optional[Any] = ..., cert_file: Optional[Any] = ..., + strict: Optional[Any] = ..., timeout=..., source_address: Optional[Any] = ..., + context: Optional[Any] = ...) -> None: ... + sock: Any + def connect(self): ... + +class HTTPS(HTTP): + key_file: Any + cert_file: Any + def __init__(self, host: str = ..., port: Optional[Any] = ..., key_file: Optional[Any] = ..., cert_file: Optional[Any] = ..., strict: Optional[Any] = ..., context: Optional[Any] = ...) -> None: ... + +class HTTPException(Exception): ... +class NotConnected(HTTPException): ... +class InvalidURL(HTTPException): ... + +class UnknownProtocol(HTTPException): + args: Any + version: Any + def __init__(self, version) -> None: ... + +class UnknownTransferEncoding(HTTPException): ... +class UnimplementedFileMode(HTTPException): ... + +class IncompleteRead(HTTPException): + args: Any + partial: Any + expected: Any + def __init__(self, partial, expected: Optional[Any] = ...) -> None: ... + +class ImproperConnectionState(HTTPException): ... +class CannotSendRequest(ImproperConnectionState): ... +class CannotSendHeader(ImproperConnectionState): ... +class ResponseNotReady(ImproperConnectionState): ... + +class BadStatusLine(HTTPException): + args: Any + line: Any + def __init__(self, line) -> None: ... + +class LineTooLong(HTTPException): + def __init__(self, line_type) -> None: ... + +error: Any + +class LineAndFileWrapper: + def __init__(self, line, file) -> None: ... + def __getattr__(self, attr): ... + def read(self, amt: Optional[Any] = ...): ... + def readline(self): ... + def readlines(self, size: Optional[Any] = ...): ... + +# Constants + +responses: Dict[int, str] + +HTTP_PORT: int +HTTPS_PORT: int + +# status codes +# informational +CONTINUE: int +SWITCHING_PROTOCOLS: int +PROCESSING: int + +# successful +OK: int +CREATED: int +ACCEPTED: int +NON_AUTHORITATIVE_INFORMATION: int +NO_CONTENT: int +RESET_CONTENT: int +PARTIAL_CONTENT: int +MULTI_STATUS: int +IM_USED: int + +# redirection +MULTIPLE_CHOICES: int +MOVED_PERMANENTLY: int +FOUND: int +SEE_OTHER: int +NOT_MODIFIED: int +USE_PROXY: int +TEMPORARY_REDIRECT: int + +# client error +BAD_REQUEST: int +UNAUTHORIZED: int +PAYMENT_REQUIRED: int +FORBIDDEN: int +NOT_FOUND: int +METHOD_NOT_ALLOWED: int +NOT_ACCEPTABLE: int +PROXY_AUTHENTICATION_REQUIRED: int +REQUEST_TIMEOUT: int +CONFLICT: int +GONE: int +LENGTH_REQUIRED: int +PRECONDITION_FAILED: int +REQUEST_ENTITY_TOO_LARGE: int +REQUEST_URI_TOO_LONG: int +UNSUPPORTED_MEDIA_TYPE: int +REQUESTED_RANGE_NOT_SATISFIABLE: int +EXPECTATION_FAILED: int +UNPROCESSABLE_ENTITY: int +LOCKED: int +FAILED_DEPENDENCY: int +UPGRADE_REQUIRED: int + +# server error +INTERNAL_SERVER_ERROR: int +NOT_IMPLEMENTED: int +BAD_GATEWAY: int +SERVICE_UNAVAILABLE: int +GATEWAY_TIMEOUT: int +HTTP_VERSION_NOT_SUPPORTED: int +INSUFFICIENT_STORAGE: int +NOT_EXTENDED: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/imp.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/imp.pyi new file mode 100644 index 00000000..8ff9e1ae --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/imp.pyi @@ -0,0 +1,35 @@ +"""Stubs for the 'imp' module.""" + +from typing import List, Optional, Tuple, Iterable, IO, Any +import types + +C_BUILTIN: int +C_EXTENSION: int +IMP_HOOK: int +PKG_DIRECTORY: int +PY_CODERESOURCE: int +PY_COMPILED: int +PY_FROZEN: int +PY_RESOURCE: int +PY_SOURCE: int +SEARCH_ERROR: int + +def acquire_lock() -> None: ... +def find_module(name: str, path: Iterable[str] = ...) -> Optional[Tuple[IO[Any], str, Tuple[str, str, int]]]: ... +def get_magic() -> str: ... +def get_suffixes() -> List[Tuple[str, str, int]]: ... +def init_builtin(name: str) -> types.ModuleType: ... +def init_frozen(name: str) -> types.ModuleType: ... +def is_builtin(name: str) -> int: ... +def is_frozen(name: str) -> bool: ... +def load_compiled(name: str, pathname: str, file: IO[Any] = ...) -> types.ModuleType: ... +def load_dynamic(name: str, pathname: str, file: IO[Any] = ...) -> types.ModuleType: ... +def load_module(name: str, file: str, pathname: str, description: Tuple[str, str, int]) -> types.ModuleType: ... +def load_source(name: str, pathname: str, file: IO[Any] = ...) -> types.ModuleType: ... +def lock_held() -> bool: ... +def new_module(name: str) -> types.ModuleType: ... +def release_lock() -> None: ... + +class NullImporter: + def __init__(self, path_string: str) -> None: ... + def find_module(self, fullname: str, path: str = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/importlib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/importlib.pyi new file mode 100644 index 00000000..8bb179a4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/importlib.pyi @@ -0,0 +1,4 @@ +import types +from typing import Optional, Text + +def import_module(name: Text, package: Optional[Text] = ...) -> types.ModuleType: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/inspect.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/inspect.pyi new file mode 100644 index 00000000..c5ed0ca7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/inspect.pyi @@ -0,0 +1,129 @@ +from types import CodeType, TracebackType, FrameType, FunctionType, MethodType, ModuleType +from typing import Any, Dict, Callable, List, NamedTuple, Optional, Sequence, Tuple, Type, Union + +# Types and members +class EndOfBlock(Exception): ... + +class BlockFinder: + indent: int + islambda: bool + started: bool + passline: bool + last: int + def tokeneater(self, type: int, token: str, srow_scol: Tuple[int, int], + erow_ecol: Tuple[int, int], line: str) -> None: ... + +CO_GENERATOR: int +CO_NESTED: int +CO_NEWLOCALS: int +CO_NOFREE: int +CO_OPTIMIZED: int +CO_VARARGS: int +CO_VARKEYWORDS: int +TPFLAGS_IS_ABSTRACT: int + +class ModuleInfo(NamedTuple): + name: str + suffix: str + mode: str + module_type: int + +def getmembers( + object: object, + predicate: Optional[Callable[[Any], bool]] = ... +) -> List[Tuple[str, Any]]: ... +def getmoduleinfo(path: str) -> Optional[ModuleInfo]: ... +def getmodulename(path: str) -> Optional[str]: ... + +def ismodule(object: object) -> bool: ... +def isclass(object: object) -> bool: ... +def ismethod(object: object) -> bool: ... +def isfunction(object: object) -> bool: ... +def isgeneratorfunction(object: object) -> bool: ... +def isgenerator(object: object) -> bool: ... +def istraceback(object: object) -> bool: ... +def isframe(object: object) -> bool: ... +def iscode(object: object) -> bool: ... +def isbuiltin(object: object) -> bool: ... +def isroutine(object: object) -> bool: ... +def isabstract(object: object) -> bool: ... +def ismethoddescriptor(object: object) -> bool: ... +def isdatadescriptor(object: object) -> bool: ... +def isgetsetdescriptor(object: object) -> bool: ... +def ismemberdescriptor(object: object) -> bool: ... + +# Retrieving source code +_SourceObjectType = Union[ModuleType, Type[Any], MethodType, FunctionType, TracebackType, FrameType, CodeType, Callable[..., Any]] + +def findsource(object: _SourceObjectType) -> Tuple[List[str], int]: ... +def getabsfile(object: _SourceObjectType) -> str: ... +def getblock(lines: Sequence[str]) -> Sequence[str]: ... +def getdoc(object: object) -> Optional[str]: ... +def getcomments(object: object) -> Optional[str]: ... +def getfile(object: _SourceObjectType) -> str: ... +def getmodule(object: object) -> Optional[ModuleType]: ... +def getsourcefile(object: _SourceObjectType) -> Optional[str]: ... +def getsourcelines(object: _SourceObjectType) -> Tuple[List[str], int]: ... +def getsource(object: _SourceObjectType) -> str: ... +def cleandoc(doc: str) -> str: ... +def indentsize(line: str) -> int: ... + +# Classes and functions +def getclasstree(classes: List[type], unique: bool = ...) -> List[Union[Tuple[type, Tuple[type, ...]], List[Any]]]: ... + +class ArgSpec(NamedTuple): + args: List[str] + varargs: Optional[str] + keywords: Optional[str] + defaults: Tuple[Any, ...] + +class ArgInfo(NamedTuple): + args: List[str] + varargs: Optional[str] + keywords: Optional[str] + locals: Dict[str, Any] + +class Arguments(NamedTuple): + args: List[Union[str, List[Any]]] + varargs: Optional[str] + keywords: Optional[str] + +def getargs(co: CodeType) -> Arguments: ... +def getargspec(func: object) -> ArgSpec: ... +def getargvalues(frame: FrameType) -> ArgInfo: ... +def formatargspec(args, varargs=..., varkw=..., defaults=..., + formatarg=..., formatvarargs=..., formatvarkw=..., formatvalue=..., + join=...) -> str: ... +def formatargvalues(args, varargs=..., varkw=..., defaults=..., + formatarg=..., formatvarargs=..., formatvarkw=..., formatvalue=..., + join=...) -> str: ... +def getmro(cls: type) -> Tuple[type, ...]: ... +def getcallargs(func, *args, **kwds) -> Dict[str, Any]: ... + +# The interpreter stack + +class Traceback(NamedTuple): + filename: str + lineno: int + function: str + code_context: Optional[List[str]] + index: Optional[int] # type: ignore + +_FrameInfo = Tuple[FrameType, str, int, str, Optional[List[str]], Optional[int]] + +def getouterframes(frame: FrameType, context: int = ...) -> List[_FrameInfo]: ... +def getframeinfo(frame: Union[FrameType, TracebackType], context: int = ...) -> Traceback: ... +def getinnerframes(traceback: TracebackType, context: int = ...) -> List[_FrameInfo]: ... +def getlineno(frame: FrameType) -> int: ... + +def currentframe(depth: int = ...) -> FrameType: ... +def stack(context: int = ...) -> List[_FrameInfo]: ... +def trace(context: int = ...) -> List[_FrameInfo]: ... + +class Attribute(NamedTuple): + name: str + kind: str + defining_class: type + object: object + +def classify_class_attrs(cls: type) -> List[Attribute]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/io.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/io.pyi new file mode 100644 index 00000000..1ab6b906 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/io.pyi @@ -0,0 +1,42 @@ +# Stubs for io + +# Based on https://docs.python.org/2/library/io.html + +# Only a subset of functionality is included. + +from typing import List, BinaryIO, TextIO, IO, overload, Iterator, Iterable, Any, Union, Optional +import _io + +from _io import BlockingIOError as BlockingIOError +from _io import BufferedRWPair as BufferedRWPair +from _io import BufferedRandom as BufferedRandom +from _io import BufferedReader as BufferedReader +from _io import BufferedWriter as BufferedWriter +from _io import BytesIO as BytesIO +from _io import DEFAULT_BUFFER_SIZE as DEFAULT_BUFFER_SIZE +from _io import FileIO as FileIO +from _io import IncrementalNewlineDecoder as IncrementalNewlineDecoder +from _io import StringIO as StringIO +from _io import TextIOWrapper as TextIOWrapper +from _io import UnsupportedOperation as UnsupportedOperation +from _io import open as open + +def _OpenWrapper(file: Union[str, unicode, int], + mode: unicode = ..., buffering: int = ..., encoding: unicode = ..., + errors: unicode = ..., newline: unicode = ..., + closefd: bool = ...) -> IO[Any]: ... + +SEEK_SET: int +SEEK_CUR: int +SEEK_END: int + + +class IOBase(_io._IOBase): ... + +class RawIOBase(_io._RawIOBase, IOBase): ... + +class BufferedIOBase(_io._BufferedIOBase, IOBase): ... + +# Note: In the actual io.py, TextIOBase subclasses IOBase. +# (Which we don't do here because we don't want to subclass both TextIO and BinaryIO.) +class TextIOBase(_io._TextIOBase): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/itertools.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/itertools.pyi new file mode 100644 index 00000000..1d5b4ee8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/itertools.pyi @@ -0,0 +1,163 @@ +# Stubs for itertools + +# Based on https://docs.python.org/2/library/itertools.html + +from typing import (Iterator, TypeVar, Iterable, overload, Any, Callable, Tuple, + Union, Sequence, Generic, Optional) + +_T = TypeVar('_T') +_S = TypeVar('_S') + +def count(start: int = ..., + step: int = ...) -> Iterator[int]: ... # more general types? +def cycle(iterable: Iterable[_T]) -> Iterator[_T]: ... + +def repeat(object: _T, times: int = ...) -> Iterator[_T]: ... + +class chain(Iterator[_T], Generic[_T]): + def __init__(self, *iterables: Iterable[_T]) -> None: ... + def next(self) -> _T: ... + def __iter__(self) -> Iterator[_T]: ... + @staticmethod + def from_iterable(iterable: Iterable[Iterable[_S]]) -> Iterator[_S]: ... + +def compress(data: Iterable[_T], selectors: Iterable[Any]) -> Iterator[_T]: ... +def dropwhile(predicate: Callable[[_T], Any], + iterable: Iterable[_T]) -> Iterator[_T]: ... +def ifilter(predicate: Optional[Callable[[_T], Any]], + iterable: Iterable[_T]) -> Iterator[_T]: ... +def ifilterfalse(predicate: Optional[Callable[[_T], Any]], + iterable: Iterable[_T]) -> Iterator[_T]: ... + +@overload +def groupby(iterable: Iterable[_T], key: None = ...) -> Iterator[Tuple[_T, Iterator[_T]]]: ... +@overload +def groupby(iterable: Iterable[_T], key: Callable[[_T], _S]) -> Iterator[Tuple[_S, Iterator[_T]]]: ... + +@overload +def islice(iterable: Iterable[_T], stop: Optional[int]) -> Iterator[_T]: ... +@overload +def islice(iterable: Iterable[_T], start: Optional[int], stop: Optional[int], + step: Optional[int] = ...) -> Iterator[_T]: ... + +_T1 = TypeVar('_T1') +_T2 = TypeVar('_T2') +_T3 = TypeVar('_T3') +_T4 = TypeVar('_T4') +_T5 = TypeVar('_T5') +_T6 = TypeVar('_T6') + +@overload +def imap(func: Callable[[_T1], _S], iter1: Iterable[_T1]) -> Iterator[_S]: ... +@overload +def imap(func: Callable[[_T1, _T2], _S], + iter1: Iterable[_T1], + iter2: Iterable[_T2]) -> Iterator[_S]: ... +@overload +def imap(func: Callable[[_T1, _T2, _T3], _S], + iter1: Iterable[_T1], iter2: Iterable[_T2], + iter3: Iterable[_T3]) -> Iterator[_S]: ... + +@overload +def imap(func: Callable[[_T1, _T2, _T3, _T4], _S], + iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], + iter4: Iterable[_T4]) -> Iterator[_S]: ... + +@overload +def imap(func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], + iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], + iter4: Iterable[_T4], iter5: Iterable[_T5]) -> Iterator[_S]: ... + +@overload +def imap(func: Callable[[_T1, _T2, _T3, _T4, _T5, _T6], _S], + iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], + iter4: Iterable[_T4], iter5: Iterable[_T5], + iter6: Iterable[_T6]) -> Iterator[_S]: ... + +@overload +def imap(func: Callable[..., _S], + iter1: Iterable[Any], iter2: Iterable[Any], iter3: Iterable[Any], + iter4: Iterable[Any], iter5: Iterable[Any], iter6: Iterable[Any], + iter7: Iterable[Any], *iterables: Iterable[Any]) -> Iterator[_S]: ... + +def starmap(func: Any, iterable: Iterable[Any]) -> Iterator[Any]: ... +def takewhile(predicate: Callable[[_T], Any], + iterable: Iterable[_T]) -> Iterator[_T]: ... +def tee(iterable: Iterable[_T], n: int = ...) -> Tuple[Iterator[_T], ...]: ... + +@overload +def izip(iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... +@overload +def izip(iter1: Iterable[_T1], + iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... +@overload +def izip(iter1: Iterable[_T1], iter2: Iterable[_T2], + iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... +@overload +def izip(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], + iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, + _T3, _T4]]: ... +@overload +def izip(iter1: Iterable[_T1], iter2: Iterable[_T2], + iter3: Iterable[_T3], iter4: Iterable[_T4], + iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, + _T3, _T4, _T5]]: ... +@overload +def izip(iter1: Iterable[_T1], iter2: Iterable[_T2], + iter3: Iterable[_T3], iter4: Iterable[_T4], + iter5: Iterable[_T5], iter6: Iterable[_T6]) -> Iterator[Tuple[_T1, _T2, _T3, + _T4, _T5, _T6]]: ... +@overload +def izip(iter1: Iterable[Any], iter2: Iterable[Any], + iter3: Iterable[Any], iter4: Iterable[Any], + iter5: Iterable[Any], iter6: Iterable[Any], + iter7: Iterable[Any], *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... + +def izip_longest(*p: Iterable[Any], + fillvalue: Any = ...) -> Iterator[Any]: ... + +@overload +def product(iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4], + iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4], + iter5: Iterable[_T5], + iter6: Iterable[_T6]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ... +@overload +def product(iter1: Iterable[Any], + iter2: Iterable[Any], + iter3: Iterable[Any], + iter4: Iterable[Any], + iter5: Iterable[Any], + iter6: Iterable[Any], + iter7: Iterable[Any], + *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... +@overload +def product(*iterables: Iterable[Any], repeat: int) -> Iterator[Tuple[Any, ...]]: ... + +def permutations(iterable: Iterable[_T], + r: int = ...) -> Iterator[Sequence[_T]]: ... +def combinations(iterable: Iterable[_T], + r: int) -> Iterator[Sequence[_T]]: ... +def combinations_with_replacement(iterable: Iterable[_T], + r: int) -> Iterator[Sequence[_T]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/json.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/json.pyi new file mode 100644 index 00000000..578e0cd0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/json.pyi @@ -0,0 +1,96 @@ +from typing import Any, IO, Optional, Tuple, Callable, Dict, List, Union, Text, Protocol, Type + +class JSONDecodeError(ValueError): + def dumps(self, obj: Any) -> str: ... + def dump(self, obj: Any, fp: IO[str], *args: Any, **kwds: Any) -> None: ... + def loads(self, s: str) -> Any: ... + def load(self, fp: IO[str]) -> Any: ... + +def dumps(obj: Any, + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + cls: Optional[Type[JSONEncoder]] = ..., + indent: Optional[int] = ..., + separators: Optional[Tuple[str, str]] = ..., + encoding: str = ..., + default: Optional[Callable[[Any], Any]] = ..., + sort_keys: bool = ..., + **kwds: Any) -> str: ... + +def dump(obj: Any, + fp: Union[IO[str], IO[Text]], + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + cls: Optional[Type[JSONEncoder]] = ..., + indent: Optional[int] = ..., + separators: Optional[Tuple[str, str]] = ..., + encoding: str = ..., + default: Optional[Callable[[Any], Any]] = ..., + sort_keys: bool = ..., + **kwds: Any) -> None: ... + +def loads(s: Union[Text, bytes], + encoding: Any = ..., + cls: Optional[Type[JSONDecoder]] = ..., + object_hook: Optional[Callable[[Dict[Any, Any]], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., + **kwds: Any) -> Any: ... + +class _Reader(Protocol): + def read(self) -> Union[Text, bytes]: ... + +def load(fp: _Reader, + encoding: Optional[str] = ..., + cls: Optional[Type[JSONDecoder]] = ..., + object_hook: Optional[Callable[[Dict[Any, Any]], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., + **kwds: Any) -> Any: ... + +class JSONDecoder(object): + def __init__(self, + encoding: Union[Text, bytes] = ..., + object_hook: Callable[..., Any] = ..., + parse_float: Callable[[str], float] = ..., + parse_int: Callable[[str], int] = ..., + parse_constant: Callable[[str], Any] = ..., + strict: bool = ..., + object_pairs_hook: Callable[..., Any] = ...) -> None: ... + def decode(self, s: Union[Text, bytes], _w: Any = ...) -> Any: ... + def raw_decode(self, s: Union[Text, bytes], idx: int = ...) -> Tuple[Any, Any]: ... + +class JSONEncoder(object): + item_separator: str + key_separator: str + skipkeys: bool + ensure_ascii: bool + check_circular: bool + allow_nan: bool + sort_keys: bool + indent: Optional[int] + + def __init__(self, + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + sort_keys: bool = ..., + indent: Optional[int] = ..., + separators: Tuple[Union[Text, bytes], Union[Text, bytes]] = ..., + encoding: Union[Text, bytes] = ..., + default: Callable[..., Any] = ...) -> None: ... + + def default(self, o: Any) -> Any: ... + + def encode(self, o: Any) -> str: ... + + def iterencode(self, o: Any, _one_shot: bool = ...) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/markupbase.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/markupbase.pyi new file mode 100644 index 00000000..358ba16c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/markupbase.pyi @@ -0,0 +1,9 @@ +from typing import Tuple + +class ParserBase(object): + def __init__(self) -> None: ... + def error(self, message: str) -> None: ... + def reset(self) -> None: ... + def getpos(self) -> Tuple[int, int]: ... + + def unknown_decl(self, data: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/md5.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/md5.pyi new file mode 100644 index 00000000..96eabd14 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/md5.pyi @@ -0,0 +1,6 @@ +# Stubs for Python 2.7 md5 stdlib module + +from hashlib import md5 as md5, md5 as new + +blocksize: int +digest_size: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/mimetools.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/mimetools.pyi new file mode 100644 index 00000000..f565202f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/mimetools.pyi @@ -0,0 +1,27 @@ +from typing import Any +import rfc822 + +class Message(rfc822.Message): + encodingheader: Any + typeheader: Any + def __init__(self, fp, seekable: int = ...): ... + plisttext: Any + type: Any + maintype: Any + subtype: Any + def parsetype(self): ... + plist: Any + def parseplist(self): ... + def getplist(self): ... + def getparam(self, name): ... + def getparamnames(self): ... + def getencoding(self): ... + def gettype(self): ... + def getmaintype(self): ... + def getsubtype(self): ... + +def choose_boundary(): ... +def decode(input, output, encoding): ... +def encode(input, output, encoding): ... +def copyliteral(input, output): ... +def copybinary(input, output): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/multiprocessing/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/multiprocessing/__init__.pyi new file mode 100644 index 00000000..fb00b245 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/multiprocessing/__init__.pyi @@ -0,0 +1,50 @@ +from typing import Any, Callable, Optional, TypeVar, Iterable + +from multiprocessing import pool +from multiprocessing.process import Process as Process, current_process as current_process, active_children as active_children +from multiprocessing.util import SUBDEBUG as SUBDEBUG, SUBWARNING as SUBWARNING +from Queue import Queue as _BaseQueue + +class ProcessError(Exception): ... +class BufferTooShort(ProcessError): ... +class TimeoutError(ProcessError): ... +class AuthenticationError(ProcessError): ... + +_T = TypeVar('_T') + +class Queue(_BaseQueue[_T]): + def __init__(self, maxsize: int = ...) -> None: ... + def get(self, block: bool = ..., timeout: Optional[float] = ...) -> _T: ... + def put(self, item: _T, block: bool = ..., timeout: Optional[float] = ...) -> None: ... + def qsize(self) -> int: ... + def empty(self) -> bool: ... + def full(self) -> bool: ... + def put_nowait(self, item: _T) -> None: ... + def get_nowait(self) -> _T: ... + def close(self) -> None: ... + def join_thread(self) -> None: ... + def cancel_join_thread(self) -> None: ... + +def Manager(): ... +def Pipe(duplex: bool = ...): ... +def cpu_count() -> int: ... +def freeze_support(): ... +def get_logger(): ... +def log_to_stderr(level: Optional[Any] = ...): ... +def allow_connection_pickling(): ... +def Lock(): ... +def RLock(): ... +def Condition(lock: Optional[Any] = ...): ... +def Semaphore(value: int = ...): ... +def BoundedSemaphore(value: int = ...): ... +def Event(): ... +def JoinableQueue(maxsize: int = ...): ... +def RawValue(typecode_or_type, *args): ... +def RawArray(typecode_or_type, size_or_initializer): ... +def Value(typecode_or_type, *args, **kwds): ... +def Array(typecode_or_type, size_or_initializer, **kwds): ... + +def Pool(processes: Optional[int] = ..., + initializer: Optional[Callable[..., Any]] = ..., + initargs: Iterable[Any] = ..., + maxtasksperchild: Optional[int] = ...) -> pool.Pool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/__init__.pyi new file mode 100644 index 00000000..ea41a4cf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/__init__.pyi @@ -0,0 +1,51 @@ +from typing import Any, Optional, List, Type + +import threading +import sys +import weakref +import array +import itertools + +from multiprocessing import TimeoutError, cpu_count +from multiprocessing.dummy.connection import Pipe +from threading import Lock, RLock, Semaphore, BoundedSemaphore +from threading import Event +from Queue import Queue + + +class DummyProcess(threading.Thread): + _children: weakref.WeakKeyDictionary[Any, Any] + _parent: threading.Thread + _pid: None + _start_called: bool + def __init__(self, group=..., target=..., name=..., args=..., kwargs=...) -> None: ... + @property + def exitcode(self) -> Optional[int]: ... + + +Process = DummyProcess + +# This should be threading._Condition but threading.pyi exports it as Condition +class Condition(threading.Condition): + notify_all: Any + +class Namespace(object): + def __init__(self, **kwds) -> None: ... + +class Value(object): + _typecode: Any + _value: Any + value: Any + def __init__(self, typecode, value, lock=...) -> None: ... + def _get(self) -> Any: ... + def _set(self, value) -> None: ... + +JoinableQueue = Queue + +def Array(typecode, sequence, lock=...) -> array.array[Any]: ... +def Manager() -> Any: ... +def Pool(processes=..., initializer=..., initargs=...) -> Any: ... +def active_children() -> List[Any]: ... +def current_process() -> threading.Thread: ... +def freeze_support() -> None: ... +def shutdown() -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/connection.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/connection.pyi new file mode 100644 index 00000000..663d3943 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/multiprocessing/dummy/connection.pyi @@ -0,0 +1,26 @@ +from Queue import Queue +from typing import Any, List, Optional, Tuple, Type + +families: List[None] + +class Connection(object): + _in: Any + _out: Any + recv: Any + recv_bytes: Any + send: Any + send_bytes: Any + def __init__(self, _in, _out) -> None: ... + def close(self) -> None: ... + def poll(self, timeout=...) -> Any: ... + +class Listener(object): + _backlog_queue: Optional[Queue[Any]] + address: Any + def __init__(self, address=..., family=..., backlog=...) -> None: ... + def accept(self) -> Connection: ... + def close(self) -> None: ... + + +def Client(address) -> Connection: ... +def Pipe(duplex=...) -> Tuple[Connection, Connection]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/multiprocessing/pool.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/multiprocessing/pool.pyi new file mode 100644 index 00000000..4001a5a2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/multiprocessing/pool.pyi @@ -0,0 +1,59 @@ +from typing import ( + Any, Callable, ContextManager, Iterable, Optional, Dict, List, + TypeVar, Iterator, +) + +_T = TypeVar('_T', bound=Pool) + +class AsyncResult(): + def get(self, timeout: Optional[float] = ...) -> Any: ... + def wait(self, timeout: Optional[float] = ...) -> None: ... + def ready(self) -> bool: ... + def successful(self) -> bool: ... + +class IMapIterator(Iterator[Any]): + def __iter__(self) -> Iterator[Any]: ... + def next(self, timeout: Optional[float] = ...) -> Any: ... + +class IMapUnorderedIterator(IMapIterator): ... + +class Pool(ContextManager[Pool]): + def __init__(self, processes: Optional[int] = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Iterable[Any] = ..., + maxtasksperchild: Optional[int] = ...) -> None: ... + def apply(self, + func: Callable[..., Any], + args: Iterable[Any] = ..., + kwds: Dict[str, Any] = ...) -> Any: ... + def apply_async(self, + func: Callable[..., Any], + args: Iterable[Any] = ..., + kwds: Dict[str, Any] = ..., + callback: Optional[Callable[..., None]] = ...) -> AsyncResult: ... + def map(self, + func: Callable[..., Any], + iterable: Iterable[Any] = ..., + chunksize: Optional[int] = ...) -> List[Any]: ... + def map_async(self, func: Callable[..., Any], + iterable: Iterable[Any] = ..., + chunksize: Optional[int] = ..., + callback: Optional[Callable[..., None]] = ...) -> AsyncResult: ... + def imap(self, + func: Callable[..., Any], + iterable: Iterable[Any] = ..., + chunksize: Optional[int] = ...) -> IMapIterator: ... + def imap_unordered(self, + func: Callable[..., Any], + iterable: Iterable[Any] = ..., + chunksize: Optional[int] = ...) -> IMapIterator: ... + def close(self) -> None: ... + def terminate(self) -> None: ... + def join(self) -> None: ... + def __enter__(self: _T) -> _T: ... + +class ThreadPool(Pool, ContextManager[ThreadPool]): + + def __init__(self, processes: Optional[int] = ..., + initializer: Optional[Callable[..., Any]] = ..., + initargs: Iterable[Any] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/multiprocessing/process.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/multiprocessing/process.pyi new file mode 100644 index 00000000..476b4032 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/multiprocessing/process.pyi @@ -0,0 +1,36 @@ +from typing import Any, Optional + +def current_process(): ... +def active_children(): ... + +class Process: + def __init__(self, group: Optional[Any] = ..., target: Optional[Any] = ..., name: Optional[Any] = ..., args=..., + kwargs=...): ... + def run(self): ... + def start(self): ... + def terminate(self): ... + def join(self, timeout: Optional[Any] = ...): ... + def is_alive(self): ... + @property + def name(self): ... + @name.setter + def name(self, name): ... + @property + def daemon(self): ... + @daemon.setter + def daemon(self, daemonic): ... + @property + def authkey(self): ... + @authkey.setter + def authkey(self, authkey): ... + @property + def exitcode(self): ... + @property + def ident(self): ... + pid: Any + +class AuthenticationString(bytes): + def __reduce__(self): ... + +class _MainProcess(Process): + def __init__(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/multiprocessing/util.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/multiprocessing/util.pyi new file mode 100644 index 00000000..14d44f6e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/multiprocessing/util.pyi @@ -0,0 +1,29 @@ +from typing import Any, Optional +import threading + +SUBDEBUG: Any +SUBWARNING: Any + +def sub_debug(msg, *args): ... +def debug(msg, *args): ... +def info(msg, *args): ... +def sub_warning(msg, *args): ... +def get_logger(): ... +def log_to_stderr(level: Optional[Any] = ...): ... +def get_temp_dir(): ... +def register_after_fork(obj, func): ... + +class Finalize: + def __init__(self, obj, callback, args=..., kwargs: Optional[Any] = ..., exitpriority: Optional[Any] = ...): ... + def __call__(self, wr: Optional[Any] = ...): ... + def cancel(self): ... + def still_active(self): ... + +def is_exiting(): ... + +class ForkAwareThreadLock: + def __init__(self): ... + +class ForkAwareLocal(threading.local): + def __init__(self): ... + def __reduce__(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/mutex.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/mutex.pyi new file mode 100644 index 00000000..fa41bbb4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/mutex.pyi @@ -0,0 +1,14 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/mutex.py + +from typing import Any, Callable, Deque, TypeVar + +_ArgType = TypeVar('_ArgType') + +class mutex: + locked: bool + queue: Deque[Any] + def __init__(self) -> None: ... + def test(self) -> bool: ... + def testandset(self) -> bool: ... + def lock(self, function: Callable[[_ArgType], Any], argument: _ArgType) -> None: ... + def unlock(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/nturl2path.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/nturl2path.pyi new file mode 100644 index 00000000..b87b008e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/nturl2path.pyi @@ -0,0 +1,4 @@ +from typing import AnyStr + +def url2pathname(url: AnyStr) -> AnyStr: ... +def pathname2url(p: AnyStr) -> AnyStr: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/os/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/os/__init__.pyi new file mode 100644 index 00000000..7041e1fb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/os/__init__.pyi @@ -0,0 +1,358 @@ +# Stubs for os +# Ron Murawski + +from builtins import OSError as error +from io import TextIOWrapper as _TextIOWrapper +from posix import listdir as listdir, stat_result as stat_result # TODO: use this, see https://github.com/python/mypy/issues/3078 +import sys +from typing import ( + Mapping, MutableMapping, Dict, List, Any, Tuple, Iterator, overload, Union, AnyStr, + Optional, Generic, Set, Callable, Text, Sequence, IO, NamedTuple, NoReturn, TypeVar +) +from . import path as path + +_T = TypeVar('_T') + +# ----- os variables ----- + +if sys.version_info >= (3, 2): + supports_bytes_environ: bool + +if sys.version_info >= (3, 3): + supports_dir_fd: Set[Callable[..., Any]] + supports_fd: Set[Callable[..., Any]] + supports_effective_ids: Set[Callable[..., Any]] + supports_follow_symlinks: Set[Callable[..., Any]] + +SEEK_SET: int +SEEK_CUR: int +SEEK_END: int + +O_RDONLY: int +O_WRONLY: int +O_RDWR: int +O_APPEND: int +O_CREAT: int +O_EXCL: int +O_TRUNC: int +# We don't use sys.platform for O_* flags to denote platform-dependent APIs because some codes, +# including tests for mypy, use a more finer way than sys.platform before using these APIs +# See https://github.com/python/typeshed/pull/2286 for discussions +O_DSYNC: int # Unix only +O_RSYNC: int # Unix only +O_SYNC: int # Unix only +O_NDELAY: int # Unix only +O_NONBLOCK: int # Unix only +O_NOCTTY: int # Unix only +O_SHLOCK: int # Unix only +O_EXLOCK: int # Unix only +O_BINARY: int # Windows only +O_NOINHERIT: int # Windows only +O_SHORT_LIVED: int # Windows only +O_TEMPORARY: int # Windows only +O_RANDOM: int # Windows only +O_SEQUENTIAL: int # Windows only +O_TEXT: int # Windows only +O_ASYNC: int # Gnu extension if in C library +O_DIRECT: int # Gnu extension if in C library +O_DIRECTORY: int # Gnu extension if in C library +O_NOFOLLOW: int # Gnu extension if in C library +O_NOATIME: int # Gnu extension if in C library +O_LARGEFILE: int # Gnu extension if in C library + +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +linesep: str +devnull: str +name: str + +F_OK: int +R_OK: int +W_OK: int +X_OK: int + +class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]): + def copy(self) -> Dict[AnyStr, AnyStr]: ... + def __delitem__(self, key: AnyStr) -> None: ... + def __getitem__(self, key: AnyStr) -> AnyStr: ... + def __setitem__(self, key: AnyStr, value: AnyStr) -> None: ... + def __iter__(self) -> Iterator[AnyStr]: ... + def __len__(self) -> int: ... + +environ: _Environ[str] +if sys.version_info >= (3, 2): + environb: _Environ[bytes] + +if sys.platform != 'win32': + # Unix only + confstr_names: Dict[str, int] + pathconf_names: Dict[str, int] + sysconf_names: Dict[str, int] + + EX_OK: int + EX_USAGE: int + EX_DATAERR: int + EX_NOINPUT: int + EX_NOUSER: int + EX_NOHOST: int + EX_UNAVAILABLE: int + EX_SOFTWARE: int + EX_OSERR: int + EX_OSFILE: int + EX_CANTCREAT: int + EX_IOERR: int + EX_TEMPFAIL: int + EX_PROTOCOL: int + EX_NOPERM: int + EX_CONFIG: int + EX_NOTFOUND: int + +P_NOWAIT: int +P_NOWAITO: int +P_WAIT: int +if sys.platform == 'win32': + P_DETACH: int + P_OVERLAY: int + +# wait()/waitpid() options +if sys.platform != 'win32': + WNOHANG: int # Unix only + WCONTINUED: int # some Unix systems + WUNTRACED: int # Unix only + +TMP_MAX: int # Undocumented, but used by tempfile + +# ----- os classes (structures) ----- +if sys.version_info >= (3, 6): + from builtins import _PathLike as PathLike # See comment in builtins + +_PathType = path._PathType + +class _StatVFS(NamedTuple): + f_bsize: int + f_frsize: int + f_blocks: int + f_bfree: int + f_bavail: int + f_files: int + f_ffree: int + f_favail: int + f_flag: int + f_namemax: int + +def getlogin() -> str: ... +def getpid() -> int: ... +def getppid() -> int: ... +def strerror(code: int) -> str: ... +def umask(mask: int) -> int: ... + +if sys.platform != 'win32': + def ctermid() -> str: ... + def getegid() -> int: ... + def geteuid() -> int: ... + def getgid() -> int: ... + def getgroups() -> List[int]: ... # Unix only, behaves differently on Mac + def initgroups(username: str, gid: int) -> None: ... + def getpgid(pid: int) -> int: ... + def getpgrp() -> int: ... + def getresuid() -> Tuple[int, int, int]: ... + def getresgid() -> Tuple[int, int, int]: ... + def getuid() -> int: ... + def setegid(egid: int) -> None: ... + def seteuid(euid: int) -> None: ... + def setgid(gid: int) -> None: ... + def setgroups(groups: Sequence[int]) -> None: ... + def setpgrp() -> None: ... + def setpgid(pid: int, pgrp: int) -> None: ... + def setregid(rgid: int, egid: int) -> None: ... + def setresgid(rgid: int, egid: int, sgid: int) -> None: ... + def setresuid(ruid: int, euid: int, suid: int) -> None: ... + def setreuid(ruid: int, euid: int) -> None: ... + def getsid(pid: int) -> int: ... + def setsid() -> None: ... + def setuid(uid: int) -> None: ... + def uname() -> Tuple[str, str, str, str, str]: ... + +@overload +def getenv(key: Text) -> Optional[str]: ... +@overload +def getenv(key: Text, default: _T) -> Union[str, _T]: ... +def putenv(key: Union[bytes, Text], value: Union[bytes, Text]) -> None: ... +def unsetenv(key: Union[bytes, Text]) -> None: ... + +def fdopen(fd: int, *args, **kwargs) -> IO[Any]: ... +def close(fd: int) -> None: ... +def closerange(fd_low: int, fd_high: int) -> None: ... +def dup(fd: int) -> int: ... +def dup2(fd: int, fd2: int) -> None: ... +def fstat(fd: int) -> Any: ... +def fsync(fd: int) -> None: ... +def lseek(fd: int, pos: int, how: int) -> int: ... +def open(file: _PathType, flags: int, mode: int = ...) -> int: ... +def pipe() -> Tuple[int, int]: ... +def read(fd: int, n: int) -> bytes: ... +def write(fd: int, string: Union[bytes, buffer]) -> int: ... +def access(path: _PathType, mode: int) -> bool: ... +def chdir(path: _PathType) -> None: ... +def fchdir(fd: int) -> None: ... +def getcwd() -> str: ... +def getcwdu() -> unicode: ... +def chmod(path: _PathType, mode: int) -> None: ... +def link(src: _PathType, link_name: _PathType) -> None: ... +def lstat(path: _PathType) -> Any: ... +def mknod(filename: _PathType, mode: int = ..., device: int = ...) -> None: ... +def major(device: int) -> int: ... +def minor(device: int) -> int: ... +def makedev(major: int, minor: int) -> int: ... +def mkdir(path: _PathType, mode: int = ...) -> None: ... +def makedirs(path: _PathType, mode: int = ...) -> None: ... +def readlink(path: AnyStr) -> AnyStr: ... +def remove(path: _PathType) -> None: ... +def removedirs(path: _PathType) -> None: ... +def rename(src: _PathType, dst: _PathType) -> None: ... +def renames(old: _PathType, new: _PathType) -> None: ... +def rmdir(path: _PathType) -> None: ... +def stat(path: _PathType) -> Any: ... +@overload +def stat_float_times() -> bool: ... +@overload +def stat_float_times(newvalue: bool) -> None: ... +def symlink(source: _PathType, link_name: _PathType) -> None: ... +def unlink(path: _PathType) -> None: ... +# TODO: add ns, dir_fd, follow_symlinks argument +if sys.version_info >= (3, 0): + def utime(path: _PathType, times: Optional[Tuple[float, float]] = ...) -> None: ... +else: + def utime(path: _PathType, times: Optional[Tuple[float, float]]) -> None: ... + +if sys.platform != 'win32': + # Unix only + def fchmod(fd: int, mode: int) -> None: ... + def fchown(fd: int, uid: int, gid: int) -> None: ... + if sys.platform != 'darwin': + def fdatasync(fd: int) -> None: ... # Unix only, not Mac + def fpathconf(fd: int, name: Union[str, int]) -> int: ... + def fstatvfs(fd: int) -> _StatVFS: ... + def ftruncate(fd: int, length: int) -> None: ... + def isatty(fd: int) -> bool: ... + def openpty() -> Tuple[int, int]: ... # some flavors of Unix + def tcgetpgrp(fd: int) -> int: ... + def tcsetpgrp(fd: int, pg: int) -> None: ... + def ttyname(fd: int) -> str: ... + def chflags(path: _PathType, flags: int) -> None: ... + def chroot(path: _PathType) -> None: ... + def chown(path: _PathType, uid: int, gid: int) -> None: ... + def lchflags(path: _PathType, flags: int) -> None: ... + def lchmod(path: _PathType, mode: int) -> None: ... + def lchown(path: _PathType, uid: int, gid: int) -> None: ... + def mkfifo(path: _PathType, mode: int = ...) -> None: ... + def pathconf(path: _PathType, name: Union[str, int]) -> int: ... + def statvfs(path: _PathType) -> _StatVFS: ... + +if sys.version_info >= (3, 6): + def walk(top: Union[AnyStr, PathLike[AnyStr]], topdown: bool = ..., + onerror: Optional[Callable[[OSError], Any]] = ..., + followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr], + List[AnyStr]]]: ... +else: + def walk(top: AnyStr, topdown: bool = ..., onerror: Optional[Callable[[OSError], Any]] = ..., + followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr], + List[AnyStr]]]: ... + +def abort() -> NoReturn: ... +# These are defined as execl(file, *args) but the first *arg is mandatory. +def execl(file: _PathType, __arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> NoReturn: ... +def execlp(file: _PathType, __arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> NoReturn: ... + +# These are: execle(file, *args, env) but env is pulled from the last element of the args. +def execle(file: _PathType, __arg0: Union[bytes, Text], *args: Any) -> NoReturn: ... +def execlpe(file: _PathType, __arg0: Union[bytes, Text], *args: Any) -> NoReturn: ... + +# The docs say `args: tuple or list of strings` +# The implementation enforces tuple or list so we can't use Sequence. +_ExecVArgs = Union[Tuple[Union[bytes, Text], ...], List[bytes], List[Text], List[Union[bytes, Text]]] +def execv(path: _PathType, args: _ExecVArgs) -> NoReturn: ... +def execve(path: _PathType, args: _ExecVArgs, env: Mapping[str, str]) -> NoReturn: ... +def execvp(file: _PathType, args: _ExecVArgs) -> NoReturn: ... +def execvpe(file: _PathType, args: _ExecVArgs, env: Mapping[str, str]) -> NoReturn: ... + +def _exit(n: int) -> NoReturn: ... +def kill(pid: int, sig: int) -> None: ... + +if sys.platform != 'win32': + # Unix only + def fork() -> int: ... + def forkpty() -> Tuple[int, int]: ... # some flavors of Unix + def killpg(pgid: int, sig: int) -> None: ... + def nice(increment: int) -> int: ... + def plock(op: int) -> None: ... # ???op is int? + +if sys.version_info >= (3, 0): + class popen(_TextIOWrapper): + # TODO 'b' modes or bytes command not accepted? + def __init__(self, command: str, mode: str = ..., + bufsize: int = ...) -> None: ... + def close(self) -> Any: ... # may return int +else: + def popen(command: str, *args, **kwargs) -> IO[Any]: ... + def popen2(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any]]: ... + def popen3(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any], IO[Any]]: ... + def popen4(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any]]: ... + +def spawnl(mode: int, path: _PathType, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ... +def spawnle(mode: int, path: _PathType, arg0: Union[bytes, Text], + *args: Any) -> int: ... # Imprecise sig +def spawnv(mode: int, path: _PathType, args: List[Union[bytes, Text]]) -> int: ... +def spawnve(mode: int, path: _PathType, args: List[Union[bytes, Text]], + env: Mapping[str, str]) -> int: ... +def system(command: _PathType) -> int: ... +def times() -> Tuple[float, float, float, float, float]: ... +def waitpid(pid: int, options: int) -> Tuple[int, int]: ... +def urandom(n: int) -> bytes: ... + +if sys.platform == 'win32': + def startfile(path: _PathType, operation: Optional[str] = ...) -> None: ... +else: + # Unix only + def spawnlp(mode: int, file: _PathType, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ... + def spawnlpe(mode: int, file: _PathType, arg0: Union[bytes, Text], *args: Any) -> int: ... # Imprecise signature + def spawnvp(mode: int, file: _PathType, args: List[Union[bytes, Text]]) -> int: ... + def spawnvpe(mode: int, file: _PathType, args: List[Union[bytes, Text]], env: Mapping[str, str]) -> int: ... + def wait() -> Tuple[int, int]: ... + def wait3(options: int) -> Tuple[int, int, Any]: ... + def wait4(pid: int, options: int) -> Tuple[int, int, Any]: ... + def WCOREDUMP(status: int) -> bool: ... + def WIFCONTINUED(status: int) -> bool: ... + def WIFSTOPPED(status: int) -> bool: ... + def WIFSIGNALED(status: int) -> bool: ... + def WIFEXITED(status: int) -> bool: ... + def WEXITSTATUS(status: int) -> int: ... + def WSTOPSIG(status: int) -> int: ... + def WTERMSIG(status: int) -> int: ... + def confstr(name: Union[str, int]) -> Optional[str]: ... + def getloadavg() -> Tuple[float, float, float]: ... + def sysconf(name: Union[str, int]) -> int: ... + +if sys.version_info >= (3, 0): + def sched_getaffinity(id: int) -> Set[int]: ... +if sys.version_info >= (3, 3): + class waitresult: + si_pid: int + def waitid(idtype: int, id: int, options: int) -> waitresult: ... + +if sys.version_info < (3, 0): + def tmpfile() -> IO[Any]: ... + def tmpnam() -> str: ... + def tempnam(dir: str = ..., prefix: str = ...) -> str: ... + +P_ALL: int +WEXITED: int +WNOWAIT: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/os/path.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/os/path.pyi new file mode 100644 index 00000000..42409c0e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/os/path.pyi @@ -0,0 +1,177 @@ +# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! +# Stubs for os.path +# Ron Murawski + +import os +import sys +from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional + +_T = TypeVar('_T') + +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PathType = Union[bytes, Text, _PathLike] + _StrPath = Union[Text, _PathLike[Text]] + _BytesPath = Union[bytes, _PathLike[bytes]] +else: + _PathType = Union[bytes, Text] + _StrPath = Text + _BytesPath = bytes + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(path: AnyStr) -> AnyStr: ... + @overload + def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(path: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(path: AnyStr) -> AnyStr: ... + @overload + def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + @overload + def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(filename: AnyStr) -> AnyStr: ... + +else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(path: AnyStr) -> AnyStr: ... + def dirname(path: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(path: AnyStr) -> AnyStr: ... + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + def realpath(path: AnyStr) -> AnyStr: ... + else: + def realpath(filename: AnyStr) -> AnyStr: ... + +if sys.version_info >= (3, 6): + # In reality it returns str for sequences of _StrPath and bytes for sequences + # of _BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[_PathType]) -> Any: ... +elif sys.version_info >= (3, 5): + def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes +# So, fall back to Any +def commonprefix(list: Sequence[_PathType]) -> Any: ... + +if sys.version_info >= (3, 3): + def exists(path: Union[_PathType, int]) -> bool: ... +else: + def exists(path: _PathType) -> bool: ... +def lexists(path: _PathType) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(path: _PathType) -> float: ... +def getmtime(path: _PathType) -> float: ... +def getctime(path: _PathType) -> float: ... + +def getsize(path: _PathType) -> int: ... +def isabs(path: _PathType) -> bool: ... +def isfile(path: _PathType) -> bool: ... +def isdir(path: _PathType) -> bool: ... +def islink(path: _PathType) -> bool: ... +def ismount(path: _PathType) -> bool: ... + +if sys.version_info < (3, 0): + # Make sure signatures are disjunct, and allow combinations of bytes and unicode. + # (Since Python 2 allows that, too) + # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in + # a type error. + @overload + def join(__p1: bytes, *p: bytes) -> bytes: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: Text, *p: _PathType) -> Text: ... +elif sys.version_info >= (3, 6): + # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. + @overload + def join(path: _StrPath, *paths: _StrPath) -> Text: ... + @overload + def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... +else: + def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... + +@overload +def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... + +def samefile(path1: _PathType, path2: _PathType) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +else: + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.platform == 'win32': + def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated + +if sys.version_info < (3,): + def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/os2emxpath.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/os2emxpath.pyi new file mode 100644 index 00000000..42409c0e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/os2emxpath.pyi @@ -0,0 +1,177 @@ +# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! +# Stubs for os.path +# Ron Murawski + +import os +import sys +from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional + +_T = TypeVar('_T') + +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PathType = Union[bytes, Text, _PathLike] + _StrPath = Union[Text, _PathLike[Text]] + _BytesPath = Union[bytes, _PathLike[bytes]] +else: + _PathType = Union[bytes, Text] + _StrPath = Text + _BytesPath = bytes + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(path: AnyStr) -> AnyStr: ... + @overload + def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(path: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(path: AnyStr) -> AnyStr: ... + @overload + def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + @overload + def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(filename: AnyStr) -> AnyStr: ... + +else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(path: AnyStr) -> AnyStr: ... + def dirname(path: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(path: AnyStr) -> AnyStr: ... + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + def realpath(path: AnyStr) -> AnyStr: ... + else: + def realpath(filename: AnyStr) -> AnyStr: ... + +if sys.version_info >= (3, 6): + # In reality it returns str for sequences of _StrPath and bytes for sequences + # of _BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[_PathType]) -> Any: ... +elif sys.version_info >= (3, 5): + def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes +# So, fall back to Any +def commonprefix(list: Sequence[_PathType]) -> Any: ... + +if sys.version_info >= (3, 3): + def exists(path: Union[_PathType, int]) -> bool: ... +else: + def exists(path: _PathType) -> bool: ... +def lexists(path: _PathType) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(path: _PathType) -> float: ... +def getmtime(path: _PathType) -> float: ... +def getctime(path: _PathType) -> float: ... + +def getsize(path: _PathType) -> int: ... +def isabs(path: _PathType) -> bool: ... +def isfile(path: _PathType) -> bool: ... +def isdir(path: _PathType) -> bool: ... +def islink(path: _PathType) -> bool: ... +def ismount(path: _PathType) -> bool: ... + +if sys.version_info < (3, 0): + # Make sure signatures are disjunct, and allow combinations of bytes and unicode. + # (Since Python 2 allows that, too) + # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in + # a type error. + @overload + def join(__p1: bytes, *p: bytes) -> bytes: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: Text, *p: _PathType) -> Text: ... +elif sys.version_info >= (3, 6): + # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. + @overload + def join(path: _StrPath, *paths: _StrPath) -> Text: ... + @overload + def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... +else: + def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... + +@overload +def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... + +def samefile(path1: _PathType, path2: _PathType) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +else: + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.platform == 'win32': + def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated + +if sys.version_info < (3,): + def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/pipes.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/pipes.pyi new file mode 100644 index 00000000..d5f5291e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/pipes.pyi @@ -0,0 +1,13 @@ +from typing import Any, IO + +class Template: + def __init__(self) -> None: ... + def reset(self) -> None: ... + def clone(self) -> Template: ... + def debug(self, flag: bool) -> None: ... + def append(self, cmd: str, kind: str) -> None: ... + def prepend(self, cmd: str, kind: str) -> None: ... + def open(self, file: str, mode: str) -> IO[Any]: ... + def copy(self, infile: str, outfile: str) -> None: ... + +def quote(s: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/platform.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/platform.pyi new file mode 100644 index 00000000..e6e03780 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/platform.pyi @@ -0,0 +1,45 @@ +# Stubs for platform (Python 2) +# +# Based on stub generated by stubgen. + +from typing import Any, Optional, Tuple + +__copyright__: Any +DEV_NULL: Any + +def libc_ver(executable=..., lib=..., version=..., chunksize: int = ...): ... +def linux_distribution(distname=..., version=..., id=..., supported_dists=..., full_distribution_name: int = ...): ... +def dist(distname=..., version=..., id=..., supported_dists=...): ... + +class _popen: + tmpfile: Any + pipe: Any + bufsize: Any + mode: Any + def __init__(self, cmd, mode=..., bufsize: Optional[Any] = ...): ... + def read(self): ... + def readlines(self): ... + def close(self, remove=..., error=...): ... + __del__: Any + +def popen(cmd, mode=..., bufsize: Optional[Any] = ...): ... +def win32_ver(release=..., version=..., csd=..., ptype=...): ... +def mac_ver(release=..., versioninfo=..., machine=...): ... +def java_ver(release=..., vendor=..., vminfo=..., osinfo=...): ... +def system_alias(system, release, version): ... +def architecture(executable=..., bits=..., linkage=...) -> Tuple[str, str]: ... +def uname() -> Tuple[str, str, str, str, str, str]: ... +def system() -> str: ... +def node() -> str: ... +def release() -> str: ... +def version() -> str: ... +def machine() -> str: ... +def processor() -> str: ... +def python_implementation() -> str: ... +def python_version() -> str: ... +def python_version_tuple() -> Tuple[str, str, str]: ... +def python_branch() -> str: ... +def python_revision() -> str: ... +def python_build() -> Tuple[str, str]: ... +def python_compiler() -> str: ... +def platform(aliased: int = ..., terse: int = ...) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/popen2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/popen2.pyi new file mode 100644 index 00000000..b39ba5f0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/popen2.pyi @@ -0,0 +1,28 @@ +from typing import Any, Iterable, List, Optional, Union, TextIO, Tuple, TypeVar + +_T = TypeVar('_T') + + +class Popen3: + sts: int + cmd: Iterable[Any] + pid: int + tochild: TextIO + fromchild: TextIO + childerr: Optional[TextIO] + def __init__(self, cmd: Iterable[Any] = ..., capturestderr: bool = ..., bufsize: int = ...) -> None: ... + def __del__(self) -> None: ... + def poll(self, _deadstate: _T = ...) -> Union[int, _T]: ... + def wait(self) -> int: ... + +class Popen4(Popen3): + childerr: None + cmd: Iterable[Any] + pid: int + tochild: TextIO + fromchild: TextIO + def __init__(self, cmd: Iterable[Any] = ..., bufsize: int = ...) -> None: ... + +def popen2(cmd: Iterable[Any] = ..., bufsize: int = ..., mode: str = ...) -> Tuple[TextIO, TextIO]: ... +def popen3(cmd: Iterable[Any] = ..., bufsize: int = ..., mode: str = ...) -> Tuple[TextIO, TextIO, TextIO]: ... +def popen4(cmd: Iterable[Any] = ..., bufsize: int = ..., mode: str = ...) -> Tuple[TextIO, TextIO]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/posix.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/posix.pyi new file mode 100644 index 00000000..6cfd8520 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/posix.pyi @@ -0,0 +1,201 @@ +from typing import AnyStr, Dict, List, Mapping, Tuple, Union, Sequence, IO, Optional, TypeVar + +error = OSError + +confstr_names: Dict[str, int] +environ: Dict[str, str] +pathconf_names: Dict[str, int] +sysconf_names: Dict[str, int] + +_T = TypeVar("_T") + +EX_CANTCREAT: int +EX_CONFIG: int +EX_DATAERR: int +EX_IOERR: int +EX_NOHOST: int +EX_NOINPUT: int +EX_NOPERM: int +EX_NOUSER: int +EX_OK: int +EX_OSERR: int +EX_OSFILE: int +EX_PROTOCOL: int +EX_SOFTWARE: int +EX_TEMPFAIL: int +EX_UNAVAILABLE: int +EX_USAGE: int +F_OK: int +NGROUPS_MAX: int +O_APPEND: int +O_ASYNC: int +O_CREAT: int +O_DIRECT: int +O_DIRECTORY: int +O_DSYNC: int +O_EXCL: int +O_LARGEFILE: int +O_NDELAY: int +O_NOATIME: int +O_NOCTTY: int +O_NOFOLLOW: int +O_NONBLOCK: int +O_RDONLY: int +O_RDWR: int +O_RSYNC: int +O_SYNC: int +O_TRUNC: int +O_WRONLY: int +R_OK: int +TMP_MAX: int +WCONTINUED: int +WNOHANG: int +WUNTRACED: int +W_OK: int +X_OK: int + +def WCOREDUMP(status: int) -> bool: ... +def WEXITSTATUS(status: int) -> bool: ... +def WIFCONTINUED(status: int) -> bool: ... +def WIFEXITED(status: int) -> bool: ... +def WIFSIGNALED(status: int) -> bool: ... +def WIFSTOPPED(status: int) -> bool: ... +def WSTOPSIG(status: int) -> bool: ... +def WTERMSIG(status: int) -> bool: ... + +class stat_result(object): + n_fields: int + n_sequence_fields: int + n_unnamed_fields: int + st_mode: int + st_ino: int + st_dev: int + st_nlink: int + st_uid: int + st_gid: int + st_size: int + st_atime: int + st_mtime: int + st_ctime: int + +class statvfs_result(object): + n_fields: int + n_sequence_fields: int + n_unnamed_fields: int + f_bsize: int + f_frsize: int + f_blocks: int + f_bfree: int + f_bavail: int + f_files: int + f_ffree: int + f_favail: int + f_flag: int + f_namemax: int + +def _exit(status: int) -> None: ... +def abort() -> None: ... +def access(path: unicode, mode: int) -> bool: ... +def chdir(path: unicode) -> None: ... +def chmod(path: unicode, mode: int) -> None: ... +def chown(path: unicode, uid: int, gid: int) -> None: ... +def chroot(path: unicode) -> None: ... +def close(fd: int) -> None: ... +def closerange(fd_low: int, fd_high: int) -> None: ... +def confstr(name: Union[str, int]) -> str: ... +def ctermid() -> str: ... +def dup(fd: int) -> int: ... +def dup2(fd: int, fd2: int) -> None: ... +def execv(path: str, args: Sequence[str], env: Mapping[str, str]) -> None: ... +def execve(path: str, args: Sequence[str], env: Mapping[str, str]) -> None: ... +def fchdir(fd: int) -> None: ... +def fchmod(fd: int, mode: int) -> None: ... +def fchown(fd: int, uid: int, gid: int) -> None: ... +def fdatasync(fd: int) -> None: ... +def fdopen(fd: int, mode: str = ..., bufsize: int = ...) -> IO[str]: ... +def fork() -> int: ... +def forkpty() -> Tuple[int, int]: ... +def fpathconf(fd: int, name: str) -> None: ... +def fstat(fd: int) -> stat_result: ... +def fstatvfs(fd: int) -> statvfs_result: ... +def fsync(fd: int) -> None: ... +def ftruncate(fd: int, length: int) -> None: ... +def getcwd() -> str: ... +def getcwdu() -> unicode: ... +def getegid() -> int: ... +def geteuid() -> int: ... +def getgid() -> int: ... +def getgroups() -> List[int]: ... +def getloadavg() -> Tuple[float, float, float]: ... +def getlogin() -> str: ... +def getpgid(pid: int) -> int: ... +def getpgrp() -> int: ... +def getpid() -> int: ... +def getppid() -> int: ... +def getresgid() -> Tuple[int, int, int]: ... +def getresuid() -> Tuple[int, int, int]: ... +def getsid(pid: int) -> int: ... +def getuid() -> int: ... +def initgroups(username: str, gid: int) -> None: ... +def isatty(fd: int) -> bool: ... +def kill(pid: int, sig: int) -> None: ... +def killpg(pgid: int, sig: int) -> None: ... +def lchown(path: unicode, uid: int, gid: int) -> None: ... +def link(source: unicode, link_name: str) -> None: ... +def listdir(path: AnyStr) -> List[AnyStr]: ... +def lseek(fd: int, pos: int, how: int) -> None: ... +def lstat(path: unicode) -> stat_result: ... +def major(device: int) -> int: ... +def makedev(major: int, minor: int) -> int: ... +def minor(device: int) -> int: ... +def mkdir(path: unicode, mode: int = ...) -> None: ... +def mkfifo(path: unicode, mode: int = ...) -> None: ... +def mknod(filename: unicode, mode: int = ..., device: int = ...) -> None: ... +def nice(increment: int) -> int: ... +def open(file: unicode, flags: int, mode: int = ...) -> int: ... +def openpty() -> Tuple[int, int]: ... +def pathconf(path: unicode, name: str) -> str: ... +def pipe() -> Tuple[int, int]: ... +def popen(command: str, mode: str = ..., bufsize: int = ...) -> IO[str]: ... +def putenv(varname: str, value: str) -> None: ... +def read(fd: int, n: int) -> str: ... +def readlink(path: _T) -> _T: ... +def remove(path: unicode) -> None: ... +def rename(src: unicode, dst: unicode) -> None: ... +def rmdir(path: unicode) -> None: ... +def setegid(egid: int) -> None: ... +def seteuid(euid: int) -> None: ... +def setgid(gid: int) -> None: ... +def setgroups(groups: Sequence[int]) -> None: ... +def setpgid(pid: int, pgrp: int) -> None: ... +def setpgrp() -> None: ... +def setregid(rgid: int, egid: int) -> None: ... +def setresgid(rgid: int, egid: int, sgid: int) -> None: ... +def setresuid(ruid: int, euid: int, suid: int) -> None: ... +def setreuid(ruid: int, euid: int) -> None: ... +def setsid() -> None: ... +def setuid(pid: int) -> None: ... +def stat(path: unicode) -> stat_result: ... +def statvfs(path: unicode) -> statvfs_result: ... +def stat_float_times(fd: int) -> None: ... +def strerror(code: int) -> str: ... +def symlink(source: unicode, link_name: unicode) -> None: ... +def sysconf(name: Union[str, int]) -> int: ... +def system(command: unicode) -> int: ... +def tcgetpgrp(fd: int) -> int: ... +def tcsetpgrp(fd: int, pg: int) -> None: ... +def times() -> Tuple[float, float, float, float, float]: ... +def tmpfile() -> IO[str]: ... +def ttyname(fd: int) -> str: ... +def umask(mask: int) -> int: ... +def uname() -> Tuple[str, str, str, str, str]: ... +def unlink(path: unicode) -> None: ... +def unsetenv(varname: str) -> None: ... +def urandom(n: int) -> str: ... +def utime(path: unicode, times: Optional[Tuple[int, int]]) -> None: ... +def wait() -> int: ... +_r = Tuple[float, float, int, int, int, int, int, int, int, int, int, int, int, int, int, int] +def wait3(options: int) -> Tuple[int, int, _r]: ... +def wait4(pid: int, options: int) -> Tuple[int, int, _r]: ... +def waitpid(pid: int, options: int) -> int: ... +def write(fd: int, str: str) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/random.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/random.pyi new file mode 100644 index 00000000..65d323db --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/random.pyi @@ -0,0 +1,77 @@ +# Stubs for random +# Ron Murawski +# Updated by Jukka Lehtosalo + +# based on https://docs.python.org/2/library/random.html + +# ----- random classes ----- + +import _random +from typing import AbstractSet, Any, Callable, Iterator, List, Protocol, Sequence, TypeVar, Union, overload + +_T = TypeVar("_T") +_T_co = TypeVar('_T_co', covariant=True) + +class _Sampleable(Protocol[_T_co]): + def __iter__(self) -> Iterator[_T_co]: ... + def __len__(self) -> int: ... + +class Random(_random.Random): + def __init__(self, x: object = ...) -> None: ... + def seed(self, x: object = ...) -> None: ... + def getstate(self) -> _random._State: ... + def setstate(self, state: _random._State) -> None: ... + def jumpahead(self, n: int) -> None: ... + def getrandbits(self, k: int) -> int: ... + @overload + def randrange(self, stop: int) -> int: ... + @overload + def randrange(self, start: int, stop: int, step: int = ...) -> int: ... + def randint(self, a: int, b: int) -> int: ... + def choice(self, seq: Sequence[_T]) -> _T: ... + def shuffle(self, x: List[Any], random: Callable[[], None] = ...) -> None: ... + def sample(self, population: _Sampleable[_T], k: int) -> List[_T]: ... + def random(self) -> float: ... + def uniform(self, a: float, b: float) -> float: ... + def triangular(self, low: float = ..., high: float = ..., mode: float = ...) -> float: ... + def betavariate(self, alpha: float, beta: float) -> float: ... + def expovariate(self, lambd: float) -> float: ... + def gammavariate(self, alpha: float, beta: float) -> float: ... + def gauss(self, mu: float, sigma: float) -> float: ... + def lognormvariate(self, mu: float, sigma: float) -> float: ... + def normalvariate(self, mu: float, sigma: float) -> float: ... + def vonmisesvariate(self, mu: float, kappa: float) -> float: ... + def paretovariate(self, alpha: float) -> float: ... + def weibullvariate(self, alpha: float, beta: float) -> float: ... + +# SystemRandom is not implemented for all OS's; good on Windows & Linux +class SystemRandom(Random): + ... + +# ----- random function stubs ----- +def seed(x: object = ...) -> None: ... +def getstate() -> object: ... +def setstate(state: object) -> None: ... +def jumpahead(n: int) -> None: ... +def getrandbits(k: int) -> int: ... +@overload +def randrange(stop: int) -> int: ... +@overload +def randrange(start: int, stop: int, step: int = ...) -> int: ... +def randint(a: int, b: int) -> int: ... +def choice(seq: Sequence[_T]) -> _T: ... +def shuffle(x: List[Any], random: Callable[[], float] = ...) -> None: ... +def sample(population: _Sampleable[_T], k: int) -> List[_T]: ... +def random() -> float: ... +def uniform(a: float, b: float) -> float: ... +def triangular(low: float = ..., high: float = ..., + mode: float = ...) -> float: ... +def betavariate(alpha: float, beta: float) -> float: ... +def expovariate(lambd: float) -> float: ... +def gammavariate(alpha: float, beta: float) -> float: ... +def gauss(mu: float, sigma: float) -> float: ... +def lognormvariate(mu: float, sigma: float) -> float: ... +def normalvariate(mu: float, sigma: float) -> float: ... +def vonmisesvariate(mu: float, kappa: float) -> float: ... +def paretovariate(alpha: float) -> float: ... +def weibullvariate(alpha: float, beta: float) -> float: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/re.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/re.pyi new file mode 100644 index 00000000..71486692 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/re.pyi @@ -0,0 +1,100 @@ +# Stubs for re +# Ron Murawski +# 'bytes' support added by Jukka Lehtosalo + +# based on: http: //docs.python.org/2.7/library/re.html + +from typing import ( + List, Iterator, overload, Callable, Tuple, Sequence, Dict, + Generic, AnyStr, Match, Pattern, Any, Optional, Union +) + +# ----- re variables and constants ----- +DEBUG: int +I: int +IGNORECASE: int +L: int +LOCALE: int +M: int +MULTILINE: int +S: int +DOTALL: int +X: int +VERBOSE: int +U: int +UNICODE: int +T: int +TEMPLATE: int + +class error(Exception): ... + +@overload +def compile(pattern: AnyStr, flags: int = ...) -> Pattern[AnyStr]: ... +@overload +def compile(pattern: Pattern[AnyStr], flags: int = ...) -> Pattern[AnyStr]: ... + +@overload +def search(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ... +@overload +def search(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ... + +@overload +def match(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ... +@overload +def match(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ... + +@overload +def split(pattern: Union[str, unicode], string: AnyStr, + maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ... +@overload +def split(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, + maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ... + +@overload +def findall(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> List[Any]: ... +@overload +def findall(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> List[Any]: ... + +# Return an iterator yielding match objects over all non-overlapping matches +# for the RE pattern in string. The string is scanned left-to-right, and +# matches are returned in the order found. Empty matches are included in the +# result unless they touch the beginning of another match. +@overload +def finditer(pattern: Union[str, unicode], string: AnyStr, + flags: int = ...) -> Iterator[Match[AnyStr]]: ... +@overload +def finditer(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, + flags: int = ...) -> Iterator[Match[AnyStr]]: ... + +@overload +def sub(pattern: Union[str, unicode], repl: AnyStr, string: AnyStr, count: int = ..., + flags: int = ...) -> AnyStr: ... +@overload +def sub(pattern: Union[str, unicode], repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., flags: int = ...) -> AnyStr: ... +@overload +def sub(pattern: Union[Pattern[str], Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ..., + flags: int = ...) -> AnyStr: ... +@overload +def sub(pattern: Union[Pattern[str], Pattern[unicode]], repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., flags: int = ...) -> AnyStr: ... + +@overload +def subn(pattern: Union[str, unicode], repl: AnyStr, string: AnyStr, count: int = ..., + flags: int = ...) -> Tuple[AnyStr, int]: ... +@overload +def subn(pattern: Union[str, unicode], repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., + flags: int = ...) -> Tuple[AnyStr, int]: ... +@overload +def subn(pattern: Union[Pattern[str], Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ..., + flags: int = ...) -> Tuple[AnyStr, int]: ... +@overload +def subn(pattern: Union[Pattern[str], Pattern[unicode]], repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., + flags: int = ...) -> Tuple[AnyStr, int]: ... + +def escape(string: AnyStr) -> AnyStr: ... + +def purge() -> None: ... +def template(pattern: Union[AnyStr, Pattern[AnyStr]], flags: int = ...) -> Pattern[AnyStr]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/repr.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/repr.pyi new file mode 100644 index 00000000..a24e59bc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/repr.pyi @@ -0,0 +1,33 @@ +from typing import Any, List + +class Repr: + maxarray: int + maxdeque: int + maxdict: int + maxfrozenset: int + maxlevel: int + maxlist: int + maxlong: int + maxother: int + maxset: int + maxstring: int + maxtuple: int + def __init__(self) -> None: ... + def _repr_iterable(self, x, level: complex, left, right, maxiter, trail=...) -> str: ... + def repr(self, x) -> str: ... + def repr1(self, x, level: complex) -> str: ... + def repr_array(self, x, level: complex) -> str: ... + def repr_deque(self, x, level: complex) -> str: ... + def repr_dict(self, x, level: complex) -> str: ... + def repr_frozenset(self, x, level: complex) -> str: ... + def repr_instance(self, x, level: complex) -> str: ... + def repr_list(self, x, level: complex) -> str: ... + def repr_long(self, x, level: complex) -> str: ... + def repr_set(self, x, level: complex) -> str: ... + def repr_str(self, x, level: complex) -> str: ... + def repr_tuple(self, x, level: complex) -> str: ... + +def _possibly_sorted(x) -> List[Any]: ... + +aRepr: Repr +def repr(x) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/resource.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/resource.pyi new file mode 100644 index 00000000..3763bc25 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/resource.pyi @@ -0,0 +1,45 @@ +from typing import Tuple, NamedTuple + +class error(Exception): ... + +RLIM_INFINITY: int +def getrlimit(resource: int) -> Tuple[int, int]: ... +def setrlimit(resource: int, limits: Tuple[int, int]) -> None: ... + +RLIMIT_CORE: int +RLIMIT_CPU: int +RLIMIT_FSIZE: int +RLIMIT_DATA: int +RLIMIT_STACK: int +RLIMIT_RSS: int +RLIMIT_NPROC: int +RLIMIT_NOFILE: int +RLIMIT_OFILE: int +RLIMIT_MEMLOCK: int +RLIMIT_VMEM: int +RLIMIT_AS: int + +class _RUsage(NamedTuple): + ru_utime: float + ru_stime: float + ru_maxrss: int + ru_ixrss: int + ru_idrss: int + ru_isrss: int + ru_minflt: int + ru_majflt: int + ru_nswap: int + ru_inblock: int + ru_oublock: int + ru_msgsnd: int + ru_msgrcv: int + ru_nsignals: int + ru_nvcsw: int + ru_nivcsw: int + +def getrusage(who: int) -> _RUsage: ... +def getpagesize() -> int: ... + +RUSAGE_SELF: int +RUSAGE_CHILDREN: int +RUSAGE_BOTH: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/rfc822.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/rfc822.pyi new file mode 100644 index 00000000..20cd1d63 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/rfc822.pyi @@ -0,0 +1,79 @@ +# Stubs for rfc822 (Python 2) +# +# Based on stub generated by stubgen. + +from typing import Any, Optional + +class Message: + fp: Any + seekable: Any + startofheaders: Any + startofbody: Any + def __init__(self, fp, seekable: int = ...): ... + def rewindbody(self): ... + dict: Any + unixfrom: Any + headers: Any + status: Any + def readheaders(self): ... + def isheader(self, line): ... + def islast(self, line): ... + def iscomment(self, line): ... + def getallmatchingheaders(self, name): ... + def getfirstmatchingheader(self, name): ... + def getrawheader(self, name): ... + def getheader(self, name, default: Optional[Any] = ...): ... + get: Any + def getheaders(self, name): ... + def getaddr(self, name): ... + def getaddrlist(self, name): ... + def getdate(self, name): ... + def getdate_tz(self, name): ... + def __len__(self): ... + def __getitem__(self, name): ... + def __setitem__(self, name, value): ... + def __delitem__(self, name): ... + def setdefault(self, name, default=...): ... + def has_key(self, name): ... + def __contains__(self, name): ... + def __iter__(self): ... + def keys(self): ... + def values(self): ... + def items(self): ... + +class AddrlistClass: + specials: Any + pos: Any + LWS: Any + CR: Any + atomends: Any + phraseends: Any + field: Any + commentlist: Any + def __init__(self, field): ... + def gotonext(self): ... + def getaddrlist(self): ... + def getaddress(self): ... + def getrouteaddr(self): ... + def getaddrspec(self): ... + def getdomain(self): ... + def getdelimited(self, beginchar, endchars, allowcomments: int = ...): ... + def getquote(self): ... + def getcomment(self): ... + def getdomainliteral(self): ... + def getatom(self, atomends: Optional[Any] = ...): ... + def getphraselist(self): ... + +class AddressList(AddrlistClass): + addresslist: Any + def __init__(self, field): ... + def __len__(self): ... + def __add__(self, other): ... + def __iadd__(self, other): ... + def __sub__(self, other): ... + def __isub__(self, other): ... + def __getitem__(self, index): ... + +def parsedate_tz(data): ... +def parsedate(data): ... +def mktime_tz(data): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/robotparser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/robotparser.pyi new file mode 100644 index 00000000..403039ae --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/robotparser.pyi @@ -0,0 +1,7 @@ +class RobotFileParser: + def set_url(self, url: str): ... + def read(self): ... + def parse(self, lines: str): ... + def can_fetch(self, user_agent: str, url: str): ... + def mtime(self): ... + def modified(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/runpy.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/runpy.pyi new file mode 100644 index 00000000..6674af07 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/runpy.pyi @@ -0,0 +1,17 @@ +from typing import Any, Optional + +class _TempModule: + mod_name: Any + module: Any + def __init__(self, mod_name): ... + def __enter__(self): ... + def __exit__(self, *args): ... + +class _ModifiedArgv0: + value: Any + def __init__(self, value): ... + def __enter__(self): ... + def __exit__(self, *args): ... + +def run_module(mod_name, init_globals: Optional[Any] = ..., run_name: Optional[Any] = ..., alter_sys: bool = ...): ... +def run_path(path_name, init_globals: Optional[Any] = ..., run_name: Optional[Any] = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/sets.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/sets.pyi new file mode 100644 index 00000000..3ec4cae2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/sets.pyi @@ -0,0 +1,61 @@ +# Stubs for sets (Python 2) +from typing import Any, Callable, Hashable, Iterable, Iterator, MutableMapping, Optional, TypeVar, Union + +_T = TypeVar('_T') +_Setlike = Union[BaseSet[_T], Iterable[_T]] +_SelfT = TypeVar('_SelfT') + +class BaseSet(Iterable[_T]): + def __init__(self) -> None: ... + def __len__(self) -> int: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + def __iter__(self) -> Iterator[_T]: ... + def __cmp__(self, other: Any) -> int: ... + def __eq__(self, other: Any) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + def copy(self: _SelfT) -> _SelfT: ... + def __copy__(self: _SelfT) -> _SelfT: ... + def __deepcopy__(self: _SelfT, memo: MutableMapping[int, BaseSet[_T]]) -> _SelfT: ... + def __or__(self: _SelfT, other: BaseSet[_T]) -> _SelfT: ... + def union(self: _SelfT, other: _Setlike[_T]) -> _SelfT: ... + def __and__(self: _SelfT, other: BaseSet[_T]) -> _SelfT: ... + def intersection(self: _SelfT, other: _Setlike[Any]) -> _SelfT: ... + def __xor__(self: _SelfT, other: BaseSet[_T]) -> _SelfT: ... + def symmetric_difference(self: _SelfT, other: _Setlike[_T]) -> _SelfT: ... + def __sub__(self: _SelfT, other: BaseSet[_T]) -> _SelfT: ... + def difference(self: _SelfT, other: _Setlike[Any]) -> _SelfT: ... + def __contains__(self, element: Any) -> bool: ... + def issubset(self, other: BaseSet[_T]) -> bool: ... + def issuperset(self, other: BaseSet[_T]) -> bool: ... + def __le__(self, other: BaseSet[_T]) -> bool: ... + def __ge__(self, other: BaseSet[_T]) -> bool: ... + def __lt__(self, other: BaseSet[_T]) -> bool: ... + def __gt__(self, other: BaseSet[_T]) -> bool: ... + +class ImmutableSet(BaseSet[_T], Hashable): + def __init__(self, iterable: Optional[_Setlike[_T]] = ...) -> None: ... + def __hash__(self) -> int: ... + +class Set(BaseSet[_T]): + def __init__(self, iterable: Optional[_Setlike[_T]] = ...) -> None: ... + def __ior__(self: _SelfT, other: BaseSet[_T]) -> _SelfT: ... + def union_update(self, other: _Setlike[_T]) -> None: ... + def __iand__(self: _SelfT, other: BaseSet[_T]) -> _SelfT: ... + def intersection_update(self, other: _Setlike[Any]) -> None: ... + def __ixor__(self: _SelfT, other: BaseSet[_T]) -> _SelfT: ... + def symmetric_difference_update(self, other: _Setlike[_T]) -> None: ... + def __isub__(self: _SelfT, other: BaseSet[_T]) -> _SelfT: ... + def difference_update(self, other: _Setlike[Any]) -> None: ... + def update(self, iterable: _Setlike[_T]) -> None: ... + def clear(self) -> None: ... + def add(self, element: _T) -> None: ... + def remove(self, element: _T) -> None: ... + def discard(self, element: _T) -> None: ... + def pop(self) -> _T: ... + def __as_immutable__(self) -> ImmutableSet[_T]: ... + def __as_temporarily_immutable__(self) -> _TemporarilyImmutableSet[_T]: ... + +class _TemporarilyImmutableSet(BaseSet[_T]): + def __init__(self, set: BaseSet[_T]) -> None: ... + def __hash__(self) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/sha.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/sha.pyi new file mode 100644 index 00000000..00ad4d9f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/sha.pyi @@ -0,0 +1,11 @@ +# Stubs for Python 2.7 sha stdlib module + +class sha(object): + def update(self, arg: str) -> None: ... + def digest(self) -> str: ... + def hexdigest(self) -> str: ... + def copy(self) -> sha: ... + +def new(string: str = ...) -> sha: ... +blocksize: int +digest_size: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/shelve.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/shelve.pyi new file mode 100644 index 00000000..15828bc1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/shelve.pyi @@ -0,0 +1,33 @@ +from typing import Any, Dict, Iterator, List, Optional, Tuple +import collections + + +class Shelf(collections.MutableMapping[Any, Any]): + def __init__(self, dict: Dict[Any, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ...) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def keys(self) -> List[Any]: ... + def __len__(self) -> int: ... + def has_key(self, key: Any) -> bool: ... + def __contains__(self, key: Any) -> bool: ... + def get(self, key: Any, default: Any = ...) -> Any: ... + def __getitem__(self, key: Any) -> Any: ... + def __setitem__(self, key: Any, value: Any) -> None: ... + def __delitem__(self, key: Any) -> None: ... + def __enter__(self) -> Shelf: ... + def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ... + def close(self) -> None: ... + def __del__(self) -> None: ... + def sync(self) -> None: ... + +class BsdDbShelf(Shelf): + def __init__(self, dict: Dict[Any, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ...) -> None: ... + def set_location(self, key: Any) -> Tuple[str, Any]: ... + def next(self) -> Tuple[str, Any]: ... + def previous(self) -> Tuple[str, Any]: ... + def first(self) -> Tuple[str, Any]: ... + def last(self) -> Tuple[str, Any]: ... + +class DbfilenameShelf(Shelf): + def __init__(self, filename: str, flag: str = ..., protocol: Optional[int] = ..., writeback: bool = ...) -> None: ... + +def open(filename: str, flag: str = ..., protocol: Optional[int] = ..., writeback: bool = ...) -> DbfilenameShelf: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/shlex.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/shlex.pyi new file mode 100644 index 00000000..a29b83eb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/shlex.pyi @@ -0,0 +1,31 @@ +from typing import Any, IO, List, Optional, TypeVar + +def split(s: Optional[str], comments: bool = ..., posix: bool = ...) -> List[str]: ... + +_SLT = TypeVar('_SLT', bound=shlex) + +class shlex: + def __init__(self, instream: IO[Any] = ..., infile: IO[Any] = ..., posix: bool = ...) -> None: ... + def __iter__(self: _SLT) -> _SLT: ... + def next(self) -> str: ... + def get_token(self) -> Optional[str]: ... + def push_token(self, _str: str) -> None: ... + def read_token(self) -> str: ... + def sourcehook(self, filename: str) -> None: ... + def push_source(self, stream: IO[Any], filename: str = ...) -> None: ... + def pop_source(self) -> IO[Any]: ... + def error_leader(self, file: str = ..., line: int = ...) -> str: ... + + commenters: str + wordchars: str + whitespace: str + escape: str + quotes: str + escapedquotes: str + whitespace_split: bool + infile: IO[Any] + source: Optional[str] + debug: int + lineno: int + token: Any + eof: Optional[str] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/signal.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/signal.pyi new file mode 100644 index 00000000..24bfbf07 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/signal.pyi @@ -0,0 +1,68 @@ +from typing import Callable, Any, Tuple, Union +from types import FrameType + +SIG_DFL: int = ... +SIG_IGN: int = ... + +ITIMER_REAL: int = ... +ITIMER_VIRTUAL: int = ... +ITIMER_PROF: int = ... + +NSIG: int = ... + +SIGABRT: int = ... +SIGALRM: int = ... +SIGBREAK: int = ... # Windows +SIGBUS: int = ... +SIGCHLD: int = ... +SIGCLD: int = ... +SIGCONT: int = ... +SIGEMT: int = ... +SIGFPE: int = ... +SIGHUP: int = ... +SIGILL: int = ... +SIGINFO: int = ... +SIGINT: int = ... +SIGIO: int = ... +SIGIOT: int = ... +SIGKILL: int = ... +SIGPIPE: int = ... +SIGPOLL: int = ... +SIGPROF: int = ... +SIGPWR: int = ... +SIGQUIT: int = ... +SIGRTMAX: int = ... +SIGRTMIN: int = ... +SIGSEGV: int = ... +SIGSTOP: int = ... +SIGSYS: int = ... +SIGTERM: int = ... +SIGTRAP: int = ... +SIGTSTP: int = ... +SIGTTIN: int = ... +SIGTTOU: int = ... +SIGURG: int = ... +SIGUSR1: int = ... +SIGUSR2: int = ... +SIGVTALRM: int = ... +SIGWINCH: int = ... +SIGXCPU: int = ... +SIGXFSZ: int = ... + +# Windows +CTRL_C_EVENT: int = ... +CTRL_BREAK_EVENT: int = ... + +class ItimerError(IOError): ... + +_HANDLER = Union[Callable[[int, FrameType], None], int, None] + +def alarm(time: int) -> int: ... +def getsignal(signalnum: int) -> _HANDLER: ... +def pause() -> None: ... +def setitimer(which: int, seconds: float, interval: float = ...) -> Tuple[float, float]: ... +def getitimer(which: int) -> Tuple[float, float]: ... +def set_wakeup_fd(fd: int) -> int: ... +def siginterrupt(signalnum: int, flag: bool) -> None: ... +def signal(signalnum: int, handler: _HANDLER) -> _HANDLER: ... +def default_int_handler(signum: int, frame: FrameType) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/smtplib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/smtplib.pyi new file mode 100644 index 00000000..438221a4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/smtplib.pyi @@ -0,0 +1,86 @@ +from typing import Any + +class SMTPException(Exception): ... +class SMTPServerDisconnected(SMTPException): ... + +class SMTPResponseException(SMTPException): + smtp_code: Any + smtp_error: Any + args: Any + def __init__(self, code, msg) -> None: ... + +class SMTPSenderRefused(SMTPResponseException): + smtp_code: Any + smtp_error: Any + sender: Any + args: Any + def __init__(self, code, msg, sender) -> None: ... + +class SMTPRecipientsRefused(SMTPException): + recipients: Any + args: Any + def __init__(self, recipients) -> None: ... + +class SMTPDataError(SMTPResponseException): ... +class SMTPConnectError(SMTPResponseException): ... +class SMTPHeloError(SMTPResponseException): ... +class SMTPAuthenticationError(SMTPResponseException): ... + +def quoteaddr(addr): ... +def quotedata(data): ... + +class SSLFakeFile: + sslobj: Any + def __init__(self, sslobj) -> None: ... + def readline(self, size=...): ... + def close(self): ... + +class SMTP: + debuglevel: Any + file: Any + helo_resp: Any + ehlo_msg: Any + ehlo_resp: Any + does_esmtp: Any + default_port: Any + timeout: Any + esmtp_features: Any + local_hostname: Any + def __init__(self, host: str = ..., port: int = ..., local_hostname=..., timeout=...) -> None: ... + def set_debuglevel(self, debuglevel): ... + sock: Any + def connect(self, host=..., port=...): ... + def send(self, str): ... + def putcmd(self, cmd, args=...): ... + def getreply(self): ... + def docmd(self, cmd, args=...): ... + def helo(self, name=...): ... + def ehlo(self, name=...): ... + def has_extn(self, opt): ... + def help(self, args=...): ... + def rset(self): ... + def noop(self): ... + def mail(self, sender, options=...): ... + def rcpt(self, recip, options=...): ... + def data(self, msg): ... + def verify(self, address): ... + vrfy: Any + def expn(self, address): ... + def ehlo_or_helo_if_needed(self): ... + def login(self, user, password): ... + def starttls(self, keyfile=..., certfile=...): ... + def sendmail(self, from_addr, to_addrs, msg, mail_options=..., rcpt_options=...): ... + def close(self): ... + def quit(self): ... + +class SMTP_SSL(SMTP): + default_port: Any + keyfile: Any + certfile: Any + def __init__(self, host=..., port=..., local_hostname=..., keyfile=..., certfile=..., timeout=...) -> None: ... + +class LMTP(SMTP): + ehlo_msg: Any + def __init__(self, host=..., port=..., local_hostname=...) -> None: ... + sock: Any + def connect(self, host=..., port=...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/spwd.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/spwd.pyi new file mode 100644 index 00000000..756c142a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/spwd.pyi @@ -0,0 +1,15 @@ +from typing import List, NamedTuple + +class struct_spwd(NamedTuple): + sp_nam: str + sp_pwd: str + sp_lstchg: int + sp_min: int + sp_max: int + sp_warn: int + sp_inact: int + sp_expire: int + sp_flag: int + +def getspall() -> List[struct_spwd]: ... +def getspnam(name: str) -> struct_spwd: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/sre_constants.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/sre_constants.pyi new file mode 100644 index 00000000..89d453ea --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/sre_constants.pyi @@ -0,0 +1,94 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/sre_constants.py + +from typing import Dict, List, TypeVar + +MAGIC: int +MAXREPEAT: int + +class error(Exception): ... + +FAILURE: str +SUCCESS: str +ANY: str +ANY_ALL: str +ASSERT: str +ASSERT_NOT: str +AT: str +BIGCHARSET: str +BRANCH: str +CALL: str +CATEGORY: str +CHARSET: str +GROUPREF: str +GROUPREF_IGNORE: str +GROUPREF_EXISTS: str +IN: str +IN_IGNORE: str +INFO: str +JUMP: str +LITERAL: str +LITERAL_IGNORE: str +MARK: str +MAX_REPEAT: str +MAX_UNTIL: str +MIN_REPEAT: str +MIN_UNTIL: str +NEGATE: str +NOT_LITERAL: str +NOT_LITERAL_IGNORE: str +RANGE: str +REPEAT: str +REPEAT_ONE: str +SUBPATTERN: str +MIN_REPEAT_ONE: str +AT_BEGINNING: str +AT_BEGINNING_LINE: str +AT_BEGINNING_STRING: str +AT_BOUNDARY: str +AT_NON_BOUNDARY: str +AT_END: str +AT_END_LINE: str +AT_END_STRING: str +AT_LOC_BOUNDARY: str +AT_LOC_NON_BOUNDARY: str +AT_UNI_BOUNDARY: str +AT_UNI_NON_BOUNDARY: str +CATEGORY_DIGIT: str +CATEGORY_NOT_DIGIT: str +CATEGORY_SPACE: str +CATEGORY_NOT_SPACE: str +CATEGORY_WORD: str +CATEGORY_NOT_WORD: str +CATEGORY_LINEBREAK: str +CATEGORY_NOT_LINEBREAK: str +CATEGORY_LOC_WORD: str +CATEGORY_LOC_NOT_WORD: str +CATEGORY_UNI_DIGIT: str +CATEGORY_UNI_NOT_DIGIT: str +CATEGORY_UNI_SPACE: str +CATEGORY_UNI_NOT_SPACE: str +CATEGORY_UNI_WORD: str +CATEGORY_UNI_NOT_WORD: str +CATEGORY_UNI_LINEBREAK: str +CATEGORY_UNI_NOT_LINEBREAK: str + +_T = TypeVar('_T') +def makedict(list: List[_T]) -> Dict[_T, int]: ... + +OP_IGNORE: Dict[str, str] +AT_MULTILINE: Dict[str, str] +AT_LOCALE: Dict[str, str] +AT_UNICODE: Dict[str, str] +CH_LOCALE: Dict[str, str] +CH_UNICODE: Dict[str, str] +SRE_FLAG_TEMPLATE: int +SRE_FLAG_IGNORECASE: int +SRE_FLAG_LOCALE: int +SRE_FLAG_MULTILINE: int +SRE_FLAG_DOTALL: int +SRE_FLAG_UNICODE: int +SRE_FLAG_VERBOSE: int +SRE_FLAG_DEBUG: int +SRE_INFO_PREFIX: int +SRE_INFO_LITERAL: int +SRE_INFO_CHARSET: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/sre_parse.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/sre_parse.pyi new file mode 100644 index 00000000..d2375352 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/sre_parse.pyi @@ -0,0 +1,63 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/sre_parse.py + +from typing import Any, Dict, Iterable, List, Match, Optional, Pattern as _Pattern, Set, Tuple, Union + +SPECIAL_CHARS: str +REPEAT_CHARS: str +DIGITS: Set[Any] +OCTDIGITS: Set[Any] +HEXDIGITS: Set[Any] +WHITESPACE: Set[Any] +ESCAPES: Dict[str, Tuple[str, int]] +CATEGORIES: Dict[str, Union[Tuple[str, str], Tuple[str, List[Tuple[str, str]]]]] +FLAGS: Dict[str, int] + +class Pattern: + flags: int + open: List[int] + groups: int + groupdict: Dict[str, int] + lookbehind: int + def __init__(self) -> None: ... + def opengroup(self, name: str = ...) -> int: ... + def closegroup(self, gid: int) -> None: ... + def checkgroup(self, gid: int) -> bool: ... + + +_OpSubpatternType = Tuple[Optional[int], int, int, SubPattern] +_OpGroupRefExistsType = Tuple[int, SubPattern, SubPattern] +_OpInType = List[Tuple[str, int]] +_OpBranchType = Tuple[None, List[SubPattern]] +_AvType = Union[_OpInType, _OpBranchType, Iterable[SubPattern], _OpGroupRefExistsType, _OpSubpatternType] +_CodeType = Union[str, _AvType] + +class SubPattern: + pattern: str + data: List[_CodeType] + width: Optional[int] + def __init__(self, pattern, data: List[_CodeType] = ...) -> None: ... + def dump(self, level: int = ...) -> None: ... + def __len__(self) -> int: ... + def __delitem__(self, index: Union[int, slice]) -> None: ... + def __getitem__(self, index: Union[int, slice]) -> Union[SubPattern, _CodeType]: ... + def __setitem__(self, index: Union[int, slice], code: _CodeType): ... + def insert(self, index, code: _CodeType) -> None: ... + def append(self, code: _CodeType) -> None: ... + def getwidth(self) -> int: ... + +class Tokenizer: + string: str + index: int + def __init__(self, string: str) -> None: ... + def match(self, char: str, skip: int = ...) -> int: ... + def get(self) -> Optional[str]: ... + def tell(self) -> Tuple[int, Optional[str]]: ... + def seek(self, index: int) -> None: ... + +def isident(char: str) -> bool: ... +def isdigit(char: str) -> bool: ... +def isname(name: str) -> bool: ... +def parse(str: str, flags: int = ..., pattern: Pattern = ...) -> SubPattern: ... +_Template = Tuple[List[Tuple[int, int]], List[Optional[int]]] +def parse_template(source: str, pattern: _Pattern[Any]) -> _Template: ... +def expand_template(template: _Template, match: Match[Any]) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/stat.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/stat.pyi new file mode 100644 index 00000000..5230d670 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/stat.pyi @@ -0,0 +1,59 @@ +def S_ISDIR(mode: int) -> bool: ... +def S_ISCHR(mode: int) -> bool: ... +def S_ISBLK(mode: int) -> bool: ... +def S_ISREG(mode: int) -> bool: ... +def S_ISFIFO(mode: int) -> bool: ... +def S_ISLNK(mode: int) -> bool: ... +def S_ISSOCK(mode: int) -> bool: ... + +def S_IMODE(mode: int) -> int: ... +def S_IFMT(mode: int) -> int: ... + +ST_MODE: int +ST_INO: int +ST_DEV: int +ST_NLINK: int +ST_UID: int +ST_GID: int +ST_SIZE: int +ST_ATIME: int +ST_MTIME: int +ST_CTIME: int +S_IFSOCK: int +S_IFLNK: int +S_IFREG: int +S_IFBLK: int +S_IFDIR: int +S_IFCHR: int +S_IFIFO: int +S_ISUID: int +S_ISGID: int +S_ISVTX: int +S_IRWXU: int +S_IRUSR: int +S_IWUSR: int +S_IXUSR: int +S_IRWXG: int +S_IRGRP: int +S_IWGRP: int +S_IXGRP: int +S_IRWXO: int +S_IROTH: int +S_IWOTH: int +S_IXOTH: int +S_ENFMT: int +S_IREAD: int +S_IWRITE: int +S_IEXEC: int +UF_NODUMP: int +UF_IMMUTABLE: int +UF_APPEND: int +UF_OPAQUE: int +UF_NOUNLINK: int +UF_COMPRESSED: int +UF_HIDDEN: int +SF_ARCHIVED: int +SF_IMMUTABLE: int +SF_APPEND: int +SF_NOUNLINK: int +SF_SNAPSHOT: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/string.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/string.pyi new file mode 100644 index 00000000..bf55e922 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/string.pyi @@ -0,0 +1,75 @@ +# Stubs for string + +# Based on http://docs.python.org/3.2/library/string.html + +from typing import Any, AnyStr, Iterable, List, Mapping, Optional, overload, Sequence, Text, Tuple, Union + +ascii_letters: str +ascii_lowercase: str +ascii_uppercase: str +digits: str +hexdigits: str +letters: str +lowercase: str +octdigits: str +punctuation: str +printable: str +uppercase: str +whitespace: str + +def capwords(s: AnyStr, sep: AnyStr = ...) -> AnyStr: ... +# TODO: originally named 'from' +def maketrans(_from: str, to: str) -> str: ... +def atof(s: unicode) -> float: ... +def atoi(s: unicode, base: int = ...) -> int: ... +def atol(s: unicode, base: int = ...) -> int: ... +def capitalize(word: AnyStr) -> AnyStr: ... +def find(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def rfind(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def index(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def rindex(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def count(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def lower(s: AnyStr) -> AnyStr: ... +def split(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ... +def rsplit(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ... +def splitfields(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ... +def join(words: Iterable[AnyStr], sep: AnyStr = ...) -> AnyStr: ... +def joinfields(word: Iterable[AnyStr], sep: AnyStr = ...) -> AnyStr: ... +def lstrip(s: AnyStr, chars: AnyStr = ...) -> AnyStr: ... +def rstrip(s: AnyStr, chars: AnyStr = ...) -> AnyStr: ... +def strip(s: AnyStr, chars: AnyStr = ...) -> AnyStr: ... +def swapcase(s: AnyStr) -> AnyStr: ... +def translate(s: str, table: str, deletechars: str = ...) -> str: ... +def upper(s: AnyStr) -> AnyStr: ... +def ljust(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ... +def rjust(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ... +def center(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ... +def zfill(s: AnyStr, width: int) -> AnyStr: ... +def replace(s: AnyStr, old: AnyStr, new: AnyStr, maxreplace: int = ...) -> AnyStr: ... + +class Template: + template: Text + + def __init__(self, template: Text) -> None: ... + @overload + def substitute(self, mapping: Union[Mapping[str, str], Mapping[unicode, str]] = ..., **kwds: str) -> str: ... + @overload + def substitute(self, mapping: Union[Mapping[str, Text], Mapping[unicode, Text]] = ..., **kwds: Text) -> Text: ... + @overload + def safe_substitute(self, mapping: Union[Mapping[str, str], Mapping[unicode, str]] = ..., **kwds: str) -> str: ... + @overload + def safe_substitute(self, mapping: Union[Mapping[str, Text], Mapping[unicode, Text]], **kwds: Text) -> Text: ... + +# TODO(MichalPokorny): This is probably badly and/or loosely typed. +class Formatter(object): + def format(self, format_string: str, *args, **kwargs) -> str: ... + def vformat(self, format_string: str, args: Sequence[Any], + kwargs: Mapping[str, Any]) -> str: ... + def parse(self, format_string: str) -> Iterable[Tuple[str, str, str, str]]: ... + def get_field(self, field_name: str, args: Sequence[Any], + kwargs: Mapping[str, Any]) -> Any: ... + def get_value(self, key: Union[int, str], args: Sequence[Any], kwargs: Mapping[str, Any]) -> Any: ... + def check_unused_args(self, used_args: Sequence[Union[int, str]], args: Sequence[Any], + kwargs: Mapping[str, Any]) -> None: ... + def format_field(self, value: Any, format_spec: str) -> Any: ... + def convert_field(self, value: Any, conversion: str) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/stringold.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/stringold.pyi new file mode 100644 index 00000000..ab3e764e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/stringold.pyi @@ -0,0 +1,46 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/stringold.py +from typing import AnyStr, Iterable, List, Optional, Type + +whitespace: str +lowercase: str +uppercase: str +letters: str +digits: str +hexdigits: str +octdigits: str +_idmap: str +_idmapL: Optional[List[str]] +index_error = ValueError +atoi_error = ValueError +atof_error = ValueError +atol_error = ValueError + + +def lower(s: AnyStr) -> AnyStr: ... +def upper(s: AnyStr) -> AnyStr: ... +def swapcase(s: AnyStr) -> AnyStr: ... +def strip(s: AnyStr) -> AnyStr: ... +def lstrip(s: AnyStr) -> AnyStr: ... +def rstrip(s: AnyStr) -> AnyStr: ... +def split(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ... +def splitfields(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ... +def join(words: Iterable[AnyStr], sep: AnyStr = ...) -> AnyStr: ... +def joinfields(words: Iterable[AnyStr], sep: AnyStr = ...) -> AnyStr: ... +def index(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def rindex(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def count(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def find(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def rfind(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ... +def atof(s: unicode) -> float: ... +def atoi(s: unicode, base: int = ...) -> int: ... +def atol(s: unicode, base: int = ...) -> long: ... +def ljust(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ... +def rjust(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ... +def center(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ... +def zfill(s: AnyStr, width: int) -> AnyStr: ... +def expandtabs(s: AnyStr, tabsize: int = ...) -> AnyStr: ... +def translate(s: str, table: str, deletions: str = ...) -> str: ... +def capitalize(s: AnyStr) -> AnyStr: ... +def capwords(s: AnyStr, sep: AnyStr = ...) -> AnyStr: ... +def maketrans(fromstr: str, tostr: str) -> str: ... +def replace(s: AnyStr, old: AnyStr, new: AnyStr, maxreplace: int = ...) -> AnyStr: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/strop.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/strop.pyi new file mode 100644 index 00000000..578a4775 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/strop.pyi @@ -0,0 +1,29 @@ +"""Stub file for the 'strop' module.""" + +from typing import List, Sequence + +lowercase: str +uppercase: str +whitespace: str + +def atof(a: str) -> float: ... +def atoi(a: str, base: int = ...) -> int: ... +def atol(a: str, base: int = ...) -> long: ... +def capitalize(s: str) -> str: ... +def count(s: str, sub: str, start: int = ..., end: int = ...) -> int: ... +def expandtabs(string: str, tabsize: int = ...) -> str: ... +def find(s: str, sub: str, start: int = ..., end: int = ...) -> int: ... +def join(list: Sequence[str], sep: str = ...) -> str: ... +def joinfields(list: Sequence[str], sep: str = ...) -> str: ... +def lower(s: str) -> str: ... +def lstrip(s: str) -> str: ... +def maketrans(frm: str, to: str) -> str: ... +def replace(s: str, old: str, new: str, maxsplit: int = ...) -> str: ... +def rfind(s: str, sub: str, start: int = ..., end: int = ...) -> int: ... +def rstrip(s: str) -> str: ... +def split(s: str, sep: str, maxsplit: int = ...) -> List[str]: ... +def splitfields(s: str, sep: str, maxsplit: int = ...) -> List[str]: ... +def strip(s: str) -> str: ... +def swapcase(s: str) -> str: ... +def translate(s: str, table: str, deletechars: str = ...) -> str: ... +def upper(s: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/subprocess.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/subprocess.pyi new file mode 100644 index 00000000..b603e42c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/subprocess.pyi @@ -0,0 +1,120 @@ +# Stubs for subprocess + +# Based on http://docs.python.org/2/library/subprocess.html and Python 3 stub + +from typing import ( + Sequence, Any, Mapping, Callable, Tuple, IO, Union, Optional, List, Text, TypeVar, Generic, +) + +_FILE = Union[None, int, IO[Any]] +_TXT = Union[bytes, Text] +_CMD = Union[_TXT, Sequence[_TXT]] +_ENV = Union[Mapping[bytes, _TXT], Mapping[Text, _TXT]] + +# Same args as Popen.__init__ +def call(args: _CMD, + bufsize: int = ..., + executable: _TXT = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: _TXT = ..., + env: _ENV = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ...) -> int: ... + +def check_call(args: _CMD, + bufsize: int = ..., + executable: _TXT = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: _TXT = ..., + env: _ENV = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ...) -> int: ... + +# Same args as Popen.__init__ except for stdout +def check_output(args: _CMD, + bufsize: int = ..., + executable: _TXT = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: _TXT = ..., + env: _ENV = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ...) -> bytes: ... + +PIPE: int +STDOUT: int + +class CalledProcessError(Exception): + returncode: int + # morally: _CMD + cmd: Any + # morally: Optional[bytes] + output: bytes + + def __init__(self, + returncode: int, + cmd: _CMD, + output: Optional[bytes] = ...) -> None: ... + +# We use a dummy type variable used to make Popen generic like it is in python 3 +_T = TypeVar('_T', bound=bytes) + +class Popen(Generic[_T]): + stdin: Optional[IO[bytes]] + stdout: Optional[IO[bytes]] + stderr: Optional[IO[bytes]] + pid: int + returncode: int + + def __new__(cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[_TXT] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_TXT] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ...) -> Popen[bytes]: ... + + def poll(self) -> int: ... + def wait(self) -> int: ... + # morally: -> Tuple[Optional[bytes], Optional[bytes]] + def communicate(self, input: Optional[_TXT] = ...) -> Tuple[bytes, bytes]: ... + def send_signal(self, signal: int) -> None: ... + def terminate(self) -> None: ... + def kill(self) -> None: ... + +def list2cmdline(seq: Sequence[str]) -> str: ... # undocumented + +# Windows-only: STARTUPINFO etc. + +STD_INPUT_HANDLE: Any +STD_OUTPUT_HANDLE: Any +STD_ERROR_HANDLE: Any +SW_HIDE: Any +STARTF_USESTDHANDLES: Any +STARTF_USESHOWWINDOW: Any +CREATE_NEW_CONSOLE: Any +CREATE_NEW_PROCESS_GROUP: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/symbol.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/symbol.pyi new file mode 100644 index 00000000..55d25a6b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/symbol.pyi @@ -0,0 +1,91 @@ +# Stubs for symbol (Python 2) + +from typing import Dict + +single_input: int +file_input: int +eval_input: int +decorator: int +decorators: int +decorated: int +funcdef: int +parameters: int +varargslist: int +fpdef: int +fplist: int +stmt: int +simple_stmt: int +small_stmt: int +expr_stmt: int +augassign: int +print_stmt: int +del_stmt: int +pass_stmt: int +flow_stmt: int +break_stmt: int +continue_stmt: int +return_stmt: int +yield_stmt: int +raise_stmt: int +import_stmt: int +import_name: int +import_from: int +import_as_name: int +dotted_as_name: int +import_as_names: int +dotted_as_names: int +dotted_name: int +global_stmt: int +exec_stmt: int +assert_stmt: int +compound_stmt: int +if_stmt: int +while_stmt: int +for_stmt: int +try_stmt: int +with_stmt: int +with_item: int +except_clause: int +suite: int +testlist_safe: int +old_test: int +old_lambdef: int +test: int +or_test: int +and_test: int +not_test: int +comparison: int +comp_op: int +expr: int +xor_expr: int +and_expr: int +shift_expr: int +arith_expr: int +term: int +factor: int +power: int +atom: int +listmaker: int +testlist_comp: int +lambdef: int +trailer: int +subscriptlist: int +subscript: int +sliceop: int +exprlist: int +testlist: int +dictorsetmaker: int +classdef: int +arglist: int +argument: int +list_iter: int +list_for: int +list_if: int +comp_iter: int +comp_for: int +comp_if: int +testlist1: int +encoding_decl: int +yield_expr: int + +sym_name: Dict[int, str] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/sys.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/sys.pyi new file mode 100644 index 00000000..be688f5b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/sys.pyi @@ -0,0 +1,136 @@ +"""Stubs for the 'sys' module.""" + +from typing import ( + IO, NoReturn, Union, List, Sequence, Any, Dict, Tuple, BinaryIO, Optional, + Callable, overload, Text, Type, +) +from types import FrameType, ModuleType, TracebackType, ClassType + +# The following type alias are stub-only and do not exist during runtime +_ExcInfo = Tuple[Type[BaseException], BaseException, TracebackType] +_OptExcInfo = Union[_ExcInfo, Tuple[None, None, None]] + +class _flags: + bytes_warning: int + debug: int + division_new: int + division_warning: int + dont_write_bytecode: int + hash_randomization: int + ignore_environment: int + inspect: int + interactive: int + no_site: int + no_user_site: int + optimize: int + py3k_warning: int + tabcheck: int + unicode: int + verbose: int + +class _float_info: + max: float + max_exp: int + max_10_exp: int + min: float + min_exp: int + min_10_exp: int + dig: int + mant_dig: int + epsilon: float + radix: int + rounds: int + +class _version_info(Tuple[int, int, int, str, int]): + major: int + minor: int + micro: int + releaselevel: str + serial: int + +_mercurial: Tuple[str, str, str] +api_version: int +argv: List[str] +builtin_module_names: Tuple[str, ...] +byteorder: str +copyright: str +dont_write_bytecode: bool +exec_prefix: str +executable: str +flags: _flags +float_repr_style: str +hexversion: int +long_info: object +maxint: int +maxsize: int +maxunicode: int +modules: Dict[str, Any] +path: List[str] +platform: str +prefix: str +py3kwarning: bool +__stderr__: IO[str] +__stdin__: IO[str] +__stdout__: IO[str] +stderr: IO[str] +stdin: IO[str] +stdout: IO[str] +subversion: Tuple[str, str, str] +version: str +warnoptions: object +float_info: _float_info +version_info: _version_info +ps1: str +ps2: str +last_type: type +last_value: BaseException +last_traceback: TracebackType +# TODO precise types +meta_path: List[Any] +path_hooks: List[Any] +path_importer_cache: Dict[str, Any] +displayhook: Optional[Callable[[int], None]] +excepthook: Optional[Callable[[type, BaseException, TracebackType], None]] +exc_type: Optional[type] +exc_value: Union[BaseException, ClassType] +exc_traceback: TracebackType + +class _WindowsVersionType: + major: Any + minor: Any + build: Any + platform: Any + service_pack: Any + service_pack_major: Any + service_pack_minor: Any + suite_mask: Any + product_type: Any + +def getwindowsversion() -> _WindowsVersionType: ... + +def _clear_type_cache() -> None: ... +def _current_frames() -> Dict[int, FrameType]: ... +def _getframe(depth: int = ...) -> FrameType: ... +def call_tracing(fn: Any, args: Any) -> Any: ... +def __displayhook__(value: int) -> None: ... +def __excepthook__(type_: type, value: BaseException, traceback: TracebackType) -> None: ... +def exc_clear() -> None: ... +def exc_info() -> _OptExcInfo: ... + +# sys.exit() accepts an optional argument of anything printable +def exit(arg: Any = ...) -> NoReturn: ... +def getcheckinterval() -> int: ... # deprecated +def getdefaultencoding() -> str: ... +def getdlopenflags() -> int: ... +def getfilesystemencoding() -> str: ... # In practice, never returns None +def getrefcount(arg: Any) -> int: ... +def getrecursionlimit() -> int: ... +def getsizeof(obj: object, default: int = ...) -> int: ... +def getprofile() -> Optional[Any]: ... +def gettrace() -> Optional[Any]: ... +def setcheckinterval(interval: int) -> None: ... # deprecated +def setdlopenflags(n: int) -> None: ... +def setdefaultencoding(encoding: Text) -> None: ... # only exists after reload(sys) +def setprofile(profilefunc: Any) -> None: ... # TODO type +def setrecursionlimit(limit: int) -> None: ... +def settrace(tracefunc: Any) -> None: ... # TODO type diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/tempfile.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/tempfile.pyi new file mode 100644 index 00000000..536b391a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/tempfile.pyi @@ -0,0 +1,111 @@ +from typing import Any, AnyStr, IO, Iterable, Iterator, List, Optional, overload, Text, Tuple, Union +from thread import LockType +from random import Random + +TMP_MAX: int +tempdir: str +template: str +_name_sequence: Optional[_RandomNameSequence] + +class _RandomNameSequence: + characters: str = ... + mutex: LockType + @property + def rng(self) -> Random: ... + def __iter__(self) -> _RandomNameSequence: ... + def next(self) -> str: ... + # from os.path: + def normcase(self, path: AnyStr) -> AnyStr: ... + +class _TemporaryFileWrapper(IO[str]): + delete: bool + file: IO[str] + name: Any + def __init__(self, file: IO[str], name: Any, delete: bool = ...) -> None: ... + def __del__(self) -> None: ... + def __enter__(self) -> _TemporaryFileWrapper: ... + def __exit__(self, exc, value, tb) -> Optional[bool]: ... + def __getattr__(self, name: unicode) -> Any: ... + def close(self) -> None: ... + def unlink(self, path: unicode) -> None: ... + # These methods don't exist directly on this object, but + # are delegated to the underlying IO object through __getattr__. + # We need to add them here so that this class is concrete. + def __iter__(self) -> Iterator[str]: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def next(self) -> str: ... + def read(self, n: int = ...) -> str: ... + def readable(self) -> bool: ... + def readline(self, limit: int = ...) -> str: ... + def readlines(self, hint: int = ...) -> List[str]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + def write(self, s: Text) -> int: ... + def writelines(self, lines: Iterable[str]) -> None: ... + + +# TODO text files + +def TemporaryFile( + mode: Union[bytes, unicode] = ..., + bufsize: int = ..., + suffix: Union[bytes, unicode] = ..., + prefix: Union[bytes, unicode] = ..., + dir: Union[bytes, unicode] = ... +) -> _TemporaryFileWrapper: + ... + +def NamedTemporaryFile( + mode: Union[bytes, unicode] = ..., + bufsize: int = ..., + suffix: Union[bytes, unicode] = ..., + prefix: Union[bytes, unicode] = ..., + dir: Union[bytes, unicode] = ..., + delete: bool = ... +) -> _TemporaryFileWrapper: + ... + +def SpooledTemporaryFile( + max_size: int = ..., + mode: Union[bytes, unicode] = ..., + buffering: int = ..., + suffix: Union[bytes, unicode] = ..., + prefix: Union[bytes, unicode] = ..., + dir: Union[bytes, unicode] = ... +) -> _TemporaryFileWrapper: + ... + +class TemporaryDirectory: + name: Any + def __init__(self, + suffix: Union[bytes, unicode] = ..., + prefix: Union[bytes, unicode] = ..., + dir: Union[bytes, unicode] = ...) -> None: ... + def cleanup(self) -> None: ... + def __enter__(self) -> Any: ... # Can be str or unicode + def __exit__(self, type, value, traceback) -> None: ... + +@overload +def mkstemp() -> Tuple[int, str]: ... +@overload +def mkstemp(suffix: AnyStr = ..., prefix: AnyStr = ..., dir: Optional[AnyStr] = ..., + text: bool = ...) -> Tuple[int, AnyStr]: ... +@overload +def mkdtemp() -> str: ... +@overload +def mkdtemp(suffix: AnyStr = ..., prefix: AnyStr = ..., dir: Optional[AnyStr] = ...) -> AnyStr: ... +@overload +def mktemp() -> str: ... +@overload +def mktemp(suffix: AnyStr = ..., prefix: AnyStr = ..., dir: Optional[AnyStr] = ...) -> AnyStr: ... +def gettempdir() -> str: ... +def gettempprefix() -> str: ... + +def _candidate_tempdir_list() -> List[str]: ... +def _get_candidate_names() -> Optional[_RandomNameSequence]: ... +def _get_default_tempdir() -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/textwrap.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/textwrap.pyi new file mode 100644 index 00000000..60498a65 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/textwrap.pyi @@ -0,0 +1,61 @@ +from typing import AnyStr, List, Dict, Pattern + +class TextWrapper(object): + width: int = ... + initial_indent: str = ... + subsequent_indent: str = ... + expand_tabs: bool = ... + replace_whitespace: bool = ... + fix_sentence_endings: bool = ... + drop_whitespace: bool = ... + break_long_words: bool = ... + break_on_hyphens: bool = ... + + # Attributes not present in documentation + sentence_end_re: Pattern[str] = ... + wordsep_re: Pattern[str] = ... + wordsep_simple_re: Pattern[str] = ... + whitespace_trans: str = ... + unicode_whitespace_trans: Dict[int, int] = ... + uspace: int = ... + x: int = ... + + def __init__( + self, + width: int = ..., + initial_indent: str = ..., + subsequent_indent: str = ..., + expand_tabs: bool = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + drop_whitespace: bool = ..., + break_on_hyphens: bool = ...) -> None: + ... + + def wrap(self, text: AnyStr) -> List[AnyStr]: ... + def fill(self, text: AnyStr) -> AnyStr: ... + +def wrap(text: AnyStr, + width: int = ..., + initial_indent: AnyStr = ..., + subsequent_indent: AnyStr = ..., + expand_tabs: bool = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + drop_whitespace: bool = ..., + break_on_hyphens: bool = ...) -> List[AnyStr]: ... + +def fill(text: AnyStr, + width: int = ..., + initial_indent: AnyStr = ..., + subsequent_indent: AnyStr = ..., + expand_tabs: bool = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + drop_whitespace: bool = ..., + break_on_hyphens: bool = ...) -> AnyStr: ... + +def dedent(text: AnyStr) -> AnyStr: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/thread.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/thread.pyi new file mode 100644 index 00000000..5bc40f4b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/thread.pyi @@ -0,0 +1,28 @@ +"""Stubs for the "thread" module.""" +from typing import Callable, Any + +def _count() -> int: ... + +class error(Exception): ... + +class LockType: + def acquire(self, waitflag: int = ...) -> bool: ... + def acquire_lock(self, waitflag: int = ...) -> bool: ... + def release(self) -> None: ... + def release_lock(self) -> None: ... + def locked(self) -> bool: ... + def locked_lock(self) -> bool: ... + def __enter__(self) -> LockType: ... + def __exit__(self, typ: Any, value: Any, traceback: Any) -> None: ... + +class _local(object): ... +class _localdummy(object): ... + +def start_new(function: Callable[..., Any], args: Any, kwargs: Any = ...) -> int: ... +def start_new_thread(function: Callable[..., Any], args: Any, kwargs: Any = ...) -> int: ... +def interrupt_main() -> None: ... +def exit() -> None: ... +def exit_thread() -> Any: ... +def allocate_lock() -> LockType: ... +def get_ident() -> int: ... +def stack_size(size: int = ...) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/toaiff.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/toaiff.pyi new file mode 100644 index 00000000..f3e1b29d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/toaiff.pyi @@ -0,0 +1,14 @@ +# Stubs for toaiff (Python 2) + +# Source: https://hg.python.org/cpython/file/2.7/Lib/toaiff.py +from pipes import Template +from typing import Dict, List + +table: Dict[str, Template] +t: Template +uncompress: Template + +class error(Exception): ... + +def toaiff(filename: str) -> str: ... +def _toaiff(filename: str, temps: List[str]) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/tokenize.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/tokenize.pyi new file mode 100644 index 00000000..43457b6a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/tokenize.pyi @@ -0,0 +1,136 @@ +# Automatically generated by pytype, manually fixed up. May still contain errors. + +from typing import Any, Callable, Dict, Generator, Iterator, List, Tuple, Union, Iterable + +__author__: str +__credits__: str + +AMPER: int +AMPEREQUAL: int +AT: int +BACKQUOTE: int +Binnumber: str +Bracket: str +CIRCUMFLEX: int +CIRCUMFLEXEQUAL: int +COLON: int +COMMA: int +COMMENT: int +Comment: str +ContStr: str +DEDENT: int +DOT: int +DOUBLESLASH: int +DOUBLESLASHEQUAL: int +DOUBLESTAR: int +DOUBLESTAREQUAL: int +Decnumber: str +Double: str +Double3: str +ENDMARKER: int +EQEQUAL: int +EQUAL: int +ERRORTOKEN: int +Expfloat: str +Exponent: str +Floatnumber: str +Funny: str +GREATER: int +GREATEREQUAL: int +Hexnumber: str +INDENT: int + +def ISEOF(x: int) -> bool: ... +def ISNONTERMINAL(x: int) -> bool: ... +def ISTERMINAL(x: int) -> bool: ... + +Ignore: str +Imagnumber: str +Intnumber: str +LBRACE: int +LEFTSHIFT: int +LEFTSHIFTEQUAL: int +LESS: int +LESSEQUAL: int +LPAR: int +LSQB: int +MINEQUAL: int +MINUS: int +NAME: int +NEWLINE: int +NL: int +NOTEQUAL: int +NT_OFFSET: int +NUMBER: int +N_TOKENS: int +Name: str +Number: str +OP: int +Octnumber: str +Operator: str +PERCENT: int +PERCENTEQUAL: int +PLUS: int +PLUSEQUAL: int +PlainToken: str +Pointfloat: str +PseudoExtras: str +PseudoToken: str +RBRACE: int +RIGHTSHIFT: int +RIGHTSHIFTEQUAL: int +RPAR: int +RSQB: int +SEMI: int +SLASH: int +SLASHEQUAL: int +STAR: int +STAREQUAL: int +STRING: int +Single: str +Single3: str +Special: str +String: str +TILDE: int +Token: str +Triple: str +VBAR: int +VBAREQUAL: int +Whitespace: str +chain: type +double3prog: type +endprogs: Dict[str, Any] +pseudoprog: type +single3prog: type +single_quoted: Dict[str, str] +t: str +tabsize: int +tok_name: Dict[int, str] +tokenprog: type +triple_quoted: Dict[str, str] +x: str + +_Pos = Tuple[int, int] +_TokenType = Tuple[int, str, _Pos, _Pos, str] + +def any(*args, **kwargs) -> str: ... +def generate_tokens(readline: Callable[[], str]) -> Generator[_TokenType, None, None]: ... +def group(*args: str) -> str: ... +def maybe(*args: str) -> str: ... +def printtoken(type: int, token: str, srow_scol: _Pos, erow_ecol: _Pos, line: str) -> None: ... +def tokenize(readline: Callable[[], str], tokeneater: Callable[[Tuple[int, str, _Pos, _Pos, str]], None]) -> None: ... +def tokenize_loop(readline: Callable[[], str], tokeneater: Callable[[Tuple[int, str, _Pos, _Pos, str]], None]) -> None: ... +def untokenize(iterable: Iterable[_TokenType]) -> str: ... + +class StopTokenizing(Exception): ... + +class TokenError(Exception): ... + +class Untokenizer: + prev_col: int + prev_row: int + tokens: List[str] + def __init__(self) -> None: ... + def add_whitespace(self, _Pos) -> None: ... + def compat(self, token: Tuple[int, Any], iterable: Iterator[_TokenType]) -> None: ... + def untokenize(self, iterable: Iterable[_TokenType]) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/types.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/types.pyi new file mode 100644 index 00000000..47c52e88 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/types.pyi @@ -0,0 +1,185 @@ +# Stubs for types +# Note, all classes "defined" here require special handling. + +from typing import ( + Any, Callable, Dict, Iterable, Iterator, List, Optional, + Tuple, Type, TypeVar, Union, overload, +) + +_T = TypeVar('_T') + +class NoneType: ... +TypeType = type +ObjectType = object + +IntType = int +LongType = int # Really long, but can't reference that due to a mypy import cycle +FloatType = float +BooleanType = bool +ComplexType = complex +StringType = str +UnicodeType = unicode +StringTypes: Tuple[Type[StringType], Type[UnicodeType]] +BufferType = buffer +TupleType = tuple +ListType = list +DictType = dict +DictionaryType = dict + +class _Cell: + cell_contents: Any + +class FunctionType: + func_closure: Optional[Tuple[_Cell, ...]] = ... + func_code: CodeType = ... + func_defaults: Optional[Tuple[Any, ...]] = ... + func_dict: Dict[str, Any] = ... + func_doc: Optional[str] = ... + func_globals: Dict[str, Any] = ... + func_name: str = ... + __closure__ = func_closure + __code__ = func_code + __defaults__ = func_defaults + __dict__ = func_dict + __globals__ = func_globals + __name__ = func_name + def __init__(self, code: CodeType, globals: Dict[str, Any], name: Optional[str] = ..., argdefs: Optional[Tuple[object, ...]] = ..., closure: Optional[Tuple[_Cell, ...]] = ...) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def __get__(self, obj: Optional[object], type: Optional[type]) -> UnboundMethodType: ... + +LambdaType = FunctionType + +class CodeType: + co_argcount: int + co_cellvars: Tuple[str, ...] + co_code: str + co_consts: Tuple[Any, ...] + co_filename: str + co_firstlineno: int + co_flags: int + co_freevars: Tuple[str, ...] + co_lnotab: str + co_name: str + co_names: Tuple[str, ...] + co_nlocals: int + co_stacksize: int + co_varnames: Tuple[str, ...] + def __init__( + self, + argcount: int, + nlocals: int, + stacksize: int, + flags: int, + codestring: str, + constants: Tuple[Any, ...], + names: Tuple[str, ...], + varnames: Tuple[str, ...], + filename: str, + name: str, + firstlineno: int, + lnotab: str, + freevars: Tuple[str, ...] = ..., + cellvars: Tuple[str, ...] = ..., + ) -> None: ... + +class GeneratorType: + gi_code: CodeType + gi_frame: FrameType + gi_running: int + def __iter__(self) -> GeneratorType: ... + def close(self) -> None: ... + def next(self) -> Any: ... + def send(self, arg: Any) -> Any: ... + @overload + def throw(self, val: BaseException) -> Any: ... + @overload + def throw(self, typ: type, val: BaseException = ..., tb: TracebackType = ...) -> Any: ... + +class ClassType: ... +class UnboundMethodType: + im_class: type = ... + im_func: FunctionType = ... + im_self: object = ... + __name__: str + __func__ = im_func + __self__ = im_self + def __init__(self, func: Callable[..., Any], obj: object) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + +class InstanceType(object): ... + +MethodType = UnboundMethodType + +class BuiltinFunctionType: + __self__: Optional[object] + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... +BuiltinMethodType = BuiltinFunctionType + +class ModuleType: + __doc__: Optional[str] + __file__: Optional[str] + __name__: str + __package__: Optional[str] + __path__: Optional[Iterable[str]] + __dict__: Dict[str, Any] + def __init__(self, name: str, doc: Optional[str] = ...) -> None: ... +FileType = file +XRangeType = xrange + +class TracebackType: + tb_frame: FrameType + tb_lasti: int + tb_lineno: int + tb_next: TracebackType + +class FrameType: + f_back: FrameType + f_builtins: Dict[str, Any] + f_code: CodeType + f_exc_type: None + f_exc_value: None + f_exc_traceback: None + f_globals: Dict[str, Any] + f_lasti: int + f_lineno: int + f_locals: Dict[str, Any] + f_restricted: bool + f_trace: Callable[[], None] + + def clear(self) -> None: ... + +SliceType = slice +class EllipsisType: ... + +class DictProxyType: + # TODO is it possible to have non-string keys? + # no __init__ + def copy(self) -> Dict[Any, Any]: ... + def get(self, key: str, default: _T = ...) -> Union[Any, _T]: ... + def has_key(self, key: str) -> bool: ... + def items(self) -> List[Tuple[str, Any]]: ... + def iteritems(self) -> Iterator[Tuple[str, Any]]: ... + def iterkeys(self) -> Iterator[str]: ... + def itervalues(self) -> Iterator[Any]: ... + def keys(self) -> List[str]: ... + def values(self) -> List[Any]: ... + def __contains__(self, key: str) -> bool: ... + def __getitem__(self, key: str) -> Any: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + +class NotImplementedType: ... + +class GetSetDescriptorType: + __name__: str + __objclass__: type + def __get__(self, obj: Any, type: type = ...) -> Any: ... + def __set__(self, obj: Any) -> None: ... + def __delete__(self, obj: Any) -> None: ... +# Same type on Jython, different on CPython and PyPy, unknown on IronPython. +class MemberDescriptorType: + __name__: str + __objclass__: type + def __get__(self, obj: Any, type: type = ...) -> Any: ... + def __set__(self, obj: Any) -> None: ... + def __delete__(self, obj: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/typing.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/typing.pyi new file mode 100644 index 00000000..45eb2e49 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/typing.pyi @@ -0,0 +1,494 @@ +# Stubs for typing (Python 2.7) + +from abc import abstractmethod, ABCMeta +from types import CodeType, FrameType, TracebackType +import collections # Needed by aliases like DefaultDict, see mypy issue 2986 + +# Definitions of special type checking related constructs. Their definitions +# are not used, so their value does not matter. + +overload = object() +Any = object() +TypeVar = object() +_promote = object() + +class _SpecialForm(object): + def __getitem__(self, typeargs: Any) -> object: ... + +Tuple: _SpecialForm = ... +Generic: _SpecialForm = ... +Protocol: _SpecialForm = ... +Callable: _SpecialForm = ... +Type: _SpecialForm = ... +ClassVar: _SpecialForm = ... +Final: _SpecialForm = ... +_F = TypeVar('_F', bound=Callable[..., Any]) +def final(f: _F) -> _F: ... +Literal: _SpecialForm = ... +# TypedDict is a (non-subscriptable) special form. +TypedDict: object = ... + +class GenericMeta(type): ... + +# Return type that indicates a function does not return. +# This type is equivalent to the None type, but the no-op Union is necessary to +# distinguish the None type from the None value. +NoReturn = Union[None] + +# These type variables are used by the container types. +_T = TypeVar('_T') +_S = TypeVar('_S') +_KT = TypeVar('_KT') # Key type. +_VT = TypeVar('_VT') # Value type. +_T_co = TypeVar('_T_co', covariant=True) # Any type covariant containers. +_V_co = TypeVar('_V_co', covariant=True) # Any type covariant containers. +_KT_co = TypeVar('_KT_co', covariant=True) # Key type covariant containers. +_VT_co = TypeVar('_VT_co', covariant=True) # Value type covariant containers. +_T_contra = TypeVar('_T_contra', contravariant=True) # Ditto contravariant. +_TC = TypeVar('_TC', bound=Type[object]) +_C = TypeVar("_C", bound=Callable[..., Any]) + +no_type_check = object() +def no_type_check_decorator(decorator: _C) -> _C: ... + +# Type aliases and type constructors + +class TypeAlias: + # Class for defining generic aliases for library types. + def __init__(self, target_type: type) -> None: ... + def __getitem__(self, typeargs: Any) -> Any: ... + +Union = TypeAlias(object) +Optional = TypeAlias(object) +List = TypeAlias(object) +Dict = TypeAlias(object) +DefaultDict = TypeAlias(object) +Set = TypeAlias(object) +FrozenSet = TypeAlias(object) +Counter = TypeAlias(object) +Deque = TypeAlias(object) + +# Predefined type variables. +AnyStr = TypeVar('AnyStr', str, unicode) + +# Abstract base classes. + +def runtime_checkable(cls: _TC) -> _TC: ... + +@runtime_checkable +class SupportsInt(Protocol, metaclass=ABCMeta): + @abstractmethod + def __int__(self) -> int: ... + +@runtime_checkable +class SupportsFloat(Protocol, metaclass=ABCMeta): + @abstractmethod + def __float__(self) -> float: ... + +@runtime_checkable +class SupportsComplex(Protocol, metaclass=ABCMeta): + @abstractmethod + def __complex__(self) -> complex: ... + +@runtime_checkable +class SupportsAbs(Protocol[_T_co]): + @abstractmethod + def __abs__(self) -> _T_co: ... + +@runtime_checkable +class Reversible(Protocol[_T_co]): + @abstractmethod + def __reversed__(self) -> Iterator[_T_co]: ... + +@runtime_checkable +class Sized(Protocol, metaclass=ABCMeta): + @abstractmethod + def __len__(self) -> int: ... + +@runtime_checkable +class Hashable(Protocol, metaclass=ABCMeta): + # TODO: This is special, in that a subclass of a hashable class may not be hashable + # (for example, list vs. object). It's not obvious how to represent this. This class + # is currently mostly useless for static checking. + @abstractmethod + def __hash__(self) -> int: ... + +@runtime_checkable +class Iterable(Protocol[_T_co]): + @abstractmethod + def __iter__(self) -> Iterator[_T_co]: ... + +@runtime_checkable +class Iterator(Iterable[_T_co], Protocol[_T_co]): + @abstractmethod + def next(self) -> _T_co: ... + def __iter__(self) -> Iterator[_T_co]: ... + +class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]): + @abstractmethod + def next(self) -> _T_co: ... + + @abstractmethod + def send(self, value: _T_contra) -> _T_co: ... + + @abstractmethod + def throw(self, typ: Type[BaseException], val: Optional[BaseException] = ..., + tb: TracebackType = ...) -> _T_co: ... + @abstractmethod + def close(self) -> None: ... + @property + def gi_code(self) -> CodeType: ... + @property + def gi_frame(self) -> FrameType: ... + @property + def gi_running(self) -> bool: ... + +@runtime_checkable +class Container(Protocol[_T_co]): + @abstractmethod + def __contains__(self, x: object) -> bool: ... + +class Sequence(Iterable[_T_co], Container[_T_co], Reversible[_T_co], Generic[_T_co]): + @overload + @abstractmethod + def __getitem__(self, i: int) -> _T_co: ... + @overload + @abstractmethod + def __getitem__(self, s: slice) -> Sequence[_T_co]: ... + # Mixin methods + def index(self, x: Any) -> int: ... + def count(self, x: Any) -> int: ... + def __contains__(self, x: object) -> bool: ... + def __iter__(self) -> Iterator[_T_co]: ... + def __reversed__(self) -> Iterator[_T_co]: ... + # Implement Sized (but don't have it as a base class). + @abstractmethod + def __len__(self) -> int: ... + +class MutableSequence(Sequence[_T], Generic[_T]): + @abstractmethod + def insert(self, index: int, object: _T) -> None: ... + @overload + @abstractmethod + def __getitem__(self, i: int) -> _T: ... + @overload + @abstractmethod + def __getitem__(self, s: slice) -> MutableSequence[_T]: ... + @overload + @abstractmethod + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + @abstractmethod + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... + @overload + @abstractmethod + def __delitem__(self, i: int) -> None: ... + @overload + @abstractmethod + def __delitem__(self, i: slice) -> None: ... + # Mixin methods + def append(self, object: _T) -> None: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def reverse(self) -> None: ... + def pop(self, index: int = ...) -> _T: ... + def remove(self, object: _T) -> None: ... + def __iadd__(self, x: Iterable[_T]) -> MutableSequence[_T]: ... + +class AbstractSet(Iterable[_T_co], Container[_T_co], Generic[_T_co]): + @abstractmethod + def __contains__(self, x: object) -> bool: ... + # Mixin methods + def __le__(self, s: AbstractSet[Any]) -> bool: ... + def __lt__(self, s: AbstractSet[Any]) -> bool: ... + def __gt__(self, s: AbstractSet[Any]) -> bool: ... + def __ge__(self, s: AbstractSet[Any]) -> bool: ... + def __and__(self, s: AbstractSet[Any]) -> AbstractSet[_T_co]: ... + def __or__(self, s: AbstractSet[_T]) -> AbstractSet[Union[_T_co, _T]]: ... + def __sub__(self, s: AbstractSet[Any]) -> AbstractSet[_T_co]: ... + def __xor__(self, s: AbstractSet[_T]) -> AbstractSet[Union[_T_co, _T]]: ... + # TODO: argument can be any container? + def isdisjoint(self, s: AbstractSet[Any]) -> bool: ... + # Implement Sized (but don't have it as a base class). + @abstractmethod + def __len__(self) -> int: ... + + +class MutableSet(AbstractSet[_T], Generic[_T]): + @abstractmethod + def add(self, x: _T) -> None: ... + @abstractmethod + def discard(self, x: _T) -> None: ... + # Mixin methods + def clear(self) -> None: ... + def pop(self) -> _T: ... + def remove(self, element: _T) -> None: ... + def __ior__(self, s: AbstractSet[_S]) -> MutableSet[Union[_T, _S]]: ... + def __iand__(self, s: AbstractSet[Any]) -> MutableSet[_T]: ... + def __ixor__(self, s: AbstractSet[_S]) -> MutableSet[Union[_T, _S]]: ... + def __isub__(self, s: AbstractSet[Any]) -> MutableSet[_T]: ... + +class MappingView(object): + def __len__(self) -> int: ... + +class ItemsView(MappingView, AbstractSet[Tuple[_KT_co, _VT_co]], Generic[_KT_co, _VT_co]): + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[Tuple[_KT_co, _VT_co]]: ... + +class KeysView(MappingView, AbstractSet[_KT_co], Generic[_KT_co]): + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_KT_co]: ... + +class ValuesView(MappingView, Iterable[_VT_co], Generic[_VT_co]): + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_VT_co]: ... + +@runtime_checkable +class ContextManager(Protocol[_T_co]): + def __enter__(self) -> _T_co: ... + def __exit__(self, __exc_type: Optional[Type[BaseException]], + __exc_value: Optional[BaseException], + __traceback: Optional[TracebackType]) -> Optional[bool]: ... + +class Mapping(Iterable[_KT], Container[_KT], Generic[_KT, _VT_co]): + # TODO: We wish the key type could also be covariant, but that doesn't work, + # see discussion in https: //github.com/python/typing/pull/273. + @abstractmethod + def __getitem__(self, k: _KT) -> _VT_co: + ... + # Mixin methods + @overload + def get(self, k: _KT) -> Optional[_VT_co]: ... + @overload + def get(self, k: _KT, default: Union[_VT_co, _T]) -> Union[_VT_co, _T]: ... + def keys(self) -> list[_KT]: ... + def values(self) -> list[_VT_co]: ... + def items(self) -> list[Tuple[_KT, _VT_co]]: ... + def iterkeys(self) -> Iterator[_KT]: ... + def itervalues(self) -> Iterator[_VT_co]: ... + def iteritems(self) -> Iterator[Tuple[_KT, _VT_co]]: ... + def __contains__(self, o: object) -> bool: ... + # Implement Sized (but don't have it as a base class). + @abstractmethod + def __len__(self) -> int: ... + +class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]): + @abstractmethod + def __setitem__(self, k: _KT, v: _VT) -> None: ... + @abstractmethod + def __delitem__(self, v: _KT) -> None: ... + + def clear(self) -> None: ... + @overload + def pop(self, k: _KT) -> _VT: ... + @overload + def pop(self, k: _KT, default: Union[_VT, _T] = ...) -> Union[_VT, _T]: ... + def popitem(self) -> Tuple[_KT, _VT]: ... + def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ... + @overload + def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + @overload + def update(self, **kwargs: _VT) -> None: ... + +Text = unicode + +TYPE_CHECKING = True + +class IO(Iterator[AnyStr], Generic[AnyStr]): + # TODO detach + # TODO use abstract properties + @property + def mode(self) -> str: ... + @property + def name(self) -> str: ... + @abstractmethod + def close(self) -> None: ... + @property + def closed(self) -> bool: ... + @abstractmethod + def fileno(self) -> int: ... + @abstractmethod + def flush(self) -> None: ... + @abstractmethod + def isatty(self) -> bool: ... + # TODO what if n is None? + @abstractmethod + def read(self, n: int = ...) -> AnyStr: ... + @abstractmethod + def readable(self) -> bool: ... + @abstractmethod + def readline(self, limit: int = ...) -> AnyStr: ... + @abstractmethod + def readlines(self, hint: int = ...) -> list[AnyStr]: ... + @abstractmethod + def seek(self, offset: int, whence: int = ...) -> int: ... + @abstractmethod + def seekable(self) -> bool: ... + @abstractmethod + def tell(self) -> int: ... + @abstractmethod + def truncate(self, size: Optional[int] = ...) -> int: ... + @abstractmethod + def writable(self) -> bool: ... + # TODO buffer objects + @abstractmethod + def write(self, s: AnyStr) -> int: ... + @abstractmethod + def writelines(self, lines: Iterable[AnyStr]) -> None: ... + + @abstractmethod + def next(self) -> AnyStr: ... + @abstractmethod + def __iter__(self) -> Iterator[AnyStr]: ... + @abstractmethod + def __enter__(self) -> IO[AnyStr]: ... + @abstractmethod + def __exit__(self, t: Optional[Type[BaseException]], value: Optional[BaseException], + traceback: Optional[TracebackType]) -> Optional[bool]: ... + +class BinaryIO(IO[str]): + # TODO readinto + # TODO read1? + # TODO peek? + @abstractmethod + def __enter__(self) -> BinaryIO: ... + +class TextIO(IO[unicode]): + # TODO use abstractproperty + @property + def buffer(self) -> BinaryIO: ... + @property + def encoding(self) -> str: ... + @property + def errors(self) -> Optional[str]: ... + @property + def line_buffering(self) -> bool: ... + @property + def newlines(self) -> Any: ... # None, str or tuple + @abstractmethod + def __enter__(self) -> TextIO: ... + +class ByteString(Sequence[int], metaclass=ABCMeta): ... + +class Match(Generic[AnyStr]): + pos: int + endpos: int + lastindex: Optional[int] + string: AnyStr + + # The regular expression object whose match() or search() method produced + # this match instance. This should not be Pattern[AnyStr] because the type + # of the pattern is independent of the type of the matched string in + # Python 2. Strictly speaking Match should be generic over AnyStr twice: + # once for the type of the pattern and once for the type of the matched + # string. + re: Pattern[Any] + # Can be None if there are no groups or if the last group was unnamed; + # otherwise matches the type of the pattern. + lastgroup: Optional[Any] + + def expand(self, template: Union[str, Text]) -> Any: ... + + @overload + def group(self, group1: int = ...) -> AnyStr: ... + @overload + def group(self, group1: str) -> AnyStr: ... + @overload + def group(self, group1: int, group2: int, + *groups: int) -> Tuple[AnyStr, ...]: ... + @overload + def group(self, group1: str, group2: str, + *groups: str) -> Tuple[AnyStr, ...]: ... + + def groups(self, default: AnyStr = ...) -> Tuple[AnyStr, ...]: ... + def groupdict(self, default: AnyStr = ...) -> Dict[str, AnyStr]: ... + def start(self, group: Union[int, str] = ...) -> int: ... + def end(self, group: Union[int, str] = ...) -> int: ... + def span(self, group: Union[int, str] = ...) -> Tuple[int, int]: ... + @property + def regs(self) -> Tuple[Tuple[int, int], ...]: ... # undocumented + +# We need a second TypeVar with the same definition as AnyStr, because +# Pattern is generic over AnyStr (determining the type of its .pattern +# attribute), but at the same time its methods take either bytes or +# Text and return the same type, regardless of the type of the pattern. +_AnyStr2 = TypeVar('_AnyStr2', bytes, Text) + +class Pattern(Generic[AnyStr]): + flags: int + groupindex: Dict[AnyStr, int] + groups: int + pattern: AnyStr + + def search(self, string: _AnyStr2, pos: int = ..., + endpos: int = ...) -> Optional[Match[_AnyStr2]]: ... + def match(self, string: _AnyStr2, pos: int = ..., + endpos: int = ...) -> Optional[Match[_AnyStr2]]: ... + def split(self, string: _AnyStr2, maxsplit: int = ...) -> List[_AnyStr2]: ... + # Returns either a list of _AnyStr2 or a list of tuples, depending on + # whether there are groups in the pattern. + def findall(self, string: Union[bytes, Text], pos: int = ..., + endpos: int = ...) -> List[Any]: ... + def finditer(self, string: _AnyStr2, pos: int = ..., + endpos: int = ...) -> Iterator[Match[_AnyStr2]]: ... + + @overload + def sub(self, repl: _AnyStr2, string: _AnyStr2, + count: int = ...) -> _AnyStr2: ... + @overload + def sub(self, repl: Callable[[Match[_AnyStr2]], _AnyStr2], string: _AnyStr2, + count: int = ...) -> _AnyStr2: ... + + @overload + def subn(self, repl: _AnyStr2, string: _AnyStr2, + count: int = ...) -> Tuple[_AnyStr2, int]: ... + @overload + def subn(self, repl: Callable[[Match[_AnyStr2]], _AnyStr2], string: _AnyStr2, + count: int = ...) -> Tuple[_AnyStr2, int]: ... + +# Functions + +def get_type_hints( + obj: Callable[..., Any], globalns: Optional[Dict[Text, Any]] = ..., localns: Optional[Dict[Text, Any]] = ..., +) -> None: ... + +@overload +def cast(tp: Type[_T], obj: Any) -> _T: ... +@overload +def cast(tp: str, obj: Any) -> Any: ... + +# Type constructors + +# NamedTuple is special-cased in the type checker +class NamedTuple(Tuple[Any, ...]): + _fields: Tuple[str, ...] + + def __init__(self, typename: Text, fields: Iterable[Tuple[Text, Any]] = ..., + **kwargs: Any) -> None: ... + + @classmethod + def _make(cls: Type[_T], iterable: Iterable[Any]) -> _T: ... + + def _asdict(self) -> Dict[str, Any]: ... + def _replace(self: _T, **kwargs: Any) -> _T: ... + +# Internal mypy fallback type for all typed dicts (does not exist at runtime) +class _TypedDict(Mapping[str, object], metaclass=ABCMeta): + def copy(self: _T) -> _T: ... + # Using NoReturn so that only calls using mypy plugin hook that specialize the signature + # can go through. + def setdefault(self, k: NoReturn, default: object) -> object: ... + # Mypy plugin hook for 'pop' expects that 'default' has a type variable type. + def pop(self, k: NoReturn, default: _T = ...) -> object: ... + def update(self: _T, __m: _T) -> None: ... + def has_key(self, k: str) -> bool: ... + def viewitems(self) -> ItemsView[str, object]: ... + def viewkeys(self) -> KeysView[str]: ... + def viewvalues(self) -> ValuesView[object]: ... + def __delitem__(self, k: NoReturn) -> None: ... + +def NewType(name: str, tp: Type[_T]) -> Type[_T]: ... + +# This itself is only available during type checking +def type_check_only(func_or_cls: _C) -> _C: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/unittest.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/unittest.pyi new file mode 100644 index 00000000..366a3735 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/unittest.pyi @@ -0,0 +1,282 @@ +# Stubs for unittest + +# Based on http://docs.python.org/2.7/library/unittest.html + +from typing import (Any, Callable, Dict, FrozenSet, Iterable, Iterator, + List, Mapping, NoReturn, Optional, overload, Pattern, + Sequence, Set, Text, TextIO, Tuple, Type, TypeVar, Union) +from abc import abstractmethod, ABCMeta +import datetime +import types + +_T = TypeVar('_T') +_FT = TypeVar('_FT') + +_ExceptionType = Union[Type[BaseException], Tuple[Type[BaseException], ...]] +_Regexp = Union[Text, Pattern[Text]] + +class Testable(metaclass=ABCMeta): + @abstractmethod + def run(self, result: TestResult) -> None: ... + @abstractmethod + def debug(self) -> None: ... + @abstractmethod + def countTestCases(self) -> int: ... + +# TODO ABC for test runners? + +class TestResult: + errors: List[Tuple[Testable, str]] + failures: List[Tuple[Testable, str]] + skipped: List[Tuple[Testable, str]] + expectedFailures: List[Tuple[Testable, str]] + unexpectedSuccesses: List[Testable] + shouldStop: bool + testsRun: int + buffer: bool + failfast: bool + + def wasSuccessful(self) -> bool: ... + def stop(self) -> None: ... + def startTest(self, test: Testable) -> None: ... + def stopTest(self, test: Testable) -> None: ... + def startTestRun(self) -> None: ... + def stopTestRun(self) -> None: ... + def addError(self, test: Testable, err: Tuple[type, Any, Any]) -> None: ... # TODO + def addFailure(self, test: Testable, err: Tuple[type, Any, Any]) -> None: ... # TODO + def addSuccess(self, test: Testable) -> None: ... + def addSkip(self, test: Testable, reason: str) -> None: ... + def addExpectedFailure(self, test: Testable, err: str) -> None: ... + def addUnexpectedSuccess(self, test: Testable) -> None: ... + +class _AssertRaisesBaseContext: + expected: Any + failureException: Type[BaseException] + obj_name: str + expected_regex: Pattern[str] + +class _AssertRaisesContext(_AssertRaisesBaseContext): + exception: Any + def __enter__(self) -> _AssertRaisesContext: ... + def __exit__(self, exc_type, exc_value, tb) -> bool: ... + +class TestCase(Testable): + failureException: Type[BaseException] + longMessage: bool + maxDiff: Optional[int] + # undocumented + _testMethodName: str + def __init__(self, methodName: str = ...) -> None: ... + def setUp(self) -> None: ... + def tearDown(self) -> None: ... + @classmethod + def setUpClass(cls) -> None: ... + @classmethod + def tearDownClass(cls) -> None: ... + def run(self, result: TestResult = ...) -> None: ... + def debug(self) -> None: ... + def assert_(self, expr: Any, msg: object = ...) -> None: ... + def failUnless(self, expr: Any, msg: object = ...) -> None: ... + def assertTrue(self, expr: Any, msg: object = ...) -> None: ... + def assertEqual(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def assertEquals(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def failUnlessEqual(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def assertNotEqual(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def assertNotEquals(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def failIfEqual(self, first: Any, second: Any, + msg: object = ...) -> None: ... + @overload + def assertAlmostEqual(self, first: float, second: float, + places: int = ..., msg: Any = ...) -> None: ... + @overload + def assertAlmostEqual(self, first: float, second: float, *, + msg: Any = ..., delta: float = ...) -> None: ... + @overload + def assertAlmostEqual(self, first: datetime.datetime, + second: datetime.datetime, *, + msg: Any = ..., delta: datetime.timedelta = ...) -> None: ... + @overload + def assertAlmostEquals(self, first: float, second: float, + places: int = ..., msg: Any = ...) -> None: ... + @overload + def assertAlmostEquals(self, first: float, second: float, *, + msg: Any = ..., delta: float = ...) -> None: ... + @overload + def assertAlmostEquals(self, first: datetime.datetime, + second: datetime.datetime, *, + msg: Any = ..., delta: datetime.timedelta = ...) -> None: ... + def failUnlessAlmostEqual(self, first: float, second: float, places: int = ..., + msg: object = ...) -> None: ... + @overload + def assertNotAlmostEqual(self, first: float, second: float, + places: int = ..., msg: Any = ...) -> None: ... + @overload + def assertNotAlmostEqual(self, first: float, second: float, *, + msg: Any = ..., delta: float = ...) -> None: ... + @overload + def assertNotAlmostEqual(self, first: datetime.datetime, + second: datetime.datetime, *, + msg: Any = ..., delta: datetime.timedelta = ...) -> None: ... + @overload + def assertNotAlmostEquals(self, first: float, second: float, + places: int = ..., msg: Any = ...) -> None: ... + @overload + def assertNotAlmostEquals(self, first: float, second: float, *, + msg: Any = ..., delta: float = ...) -> None: ... + @overload + def assertNotAlmostEquals(self, first: datetime.datetime, + second: datetime.datetime, *, + msg: Any = ..., delta: datetime.timedelta = ...) -> None: ... + def failIfAlmostEqual(self, first: float, second: float, places: int = ..., + msg: object = ..., + delta: float = ...) -> None: ... + def assertGreater(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def assertGreaterEqual(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def assertMultiLineEqual(self, first: str, second: str, + msg: object = ...) -> None: ... + def assertSequenceEqual(self, first: Sequence[Any], second: Sequence[Any], + msg: object = ..., seq_type: type = ...) -> None: ... + def assertListEqual(self, first: List[Any], second: List[Any], + msg: object = ...) -> None: ... + def assertTupleEqual(self, first: Tuple[Any, ...], second: Tuple[Any, ...], + msg: object = ...) -> None: ... + def assertSetEqual(self, first: Union[Set[Any], FrozenSet[Any]], + second: Union[Set[Any], FrozenSet[Any]], msg: object = ...) -> None: ... + def assertDictEqual(self, first: Dict[Any, Any], second: Dict[Any, Any], + msg: object = ...) -> None: ... + def assertLess(self, first: Any, second: Any, + msg: object = ...) -> None: ... + def assertLessEqual(self, first: Any, second: Any, + msg: object = ...) -> None: ... + @overload + def assertRaises(self, exception: _ExceptionType, callable: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ... + @overload + def assertRaises(self, exception: _ExceptionType) -> _AssertRaisesContext: ... + @overload + def assertRaisesRegexp(self, exception: _ExceptionType, regexp: _Regexp, callable: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ... + @overload + def assertRaisesRegexp(self, exception: _ExceptionType, regexp: _Regexp) -> _AssertRaisesContext: ... + def assertRegexpMatches(self, text: Text, regexp: _Regexp, msg: object = ...) -> None: ... + def assertNotRegexpMatches(self, text: Text, regexp: _Regexp, msg: object = ...) -> None: ... + def assertItemsEqual(self, first: Iterable[Any], second: Iterable[Any], msg: object = ...) -> None: ... + def assertDictContainsSubset(self, + expected: Mapping[Any, Any], + actual: Mapping[Any, Any], + msg: object = ...) -> None: ... + def addTypeEqualityFunc(self, typeobj: type, function: Callable[..., None]) -> None: ... + @overload + def failUnlessRaises(self, exception: _ExceptionType, callable: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ... + @overload + def failUnlessRaises(self, exception: _ExceptionType) -> _AssertRaisesContext: ... + def failIf(self, expr: Any, msg: object = ...) -> None: ... + def assertFalse(self, expr: Any, msg: object = ...) -> None: ... + def assertIs(self, first: object, second: object, + msg: object = ...) -> None: ... + def assertIsNot(self, first: object, second: object, + msg: object = ...) -> None: ... + def assertIsNone(self, expr: Any, msg: object = ...) -> None: ... + def assertIsNotNone(self, expr: Any, msg: object = ...) -> None: ... + def assertIn(self, first: _T, second: Iterable[_T], + msg: object = ...) -> None: ... + def assertNotIn(self, first: _T, second: Iterable[_T], + msg: object = ...) -> None: ... + def assertIsInstance(self, obj: Any, cls: Union[type, Tuple[type, ...]], + msg: object = ...) -> None: ... + def assertNotIsInstance(self, obj: Any, cls: Union[type, Tuple[type, ...]], + msg: object = ...) -> None: ... + def fail(self, msg: object = ...) -> NoReturn: ... + def countTestCases(self) -> int: ... + def defaultTestResult(self) -> TestResult: ... + def id(self) -> str: ... + def shortDescription(self) -> str: ... # May return None + def addCleanup(self, function: Any, *args: Any, **kwargs: Any) -> None: ... + def doCleanups(self) -> bool: ... + def skipTest(self, reason: Any) -> None: ... + def _formatMessage(self, msg: Optional[Text], standardMsg: Text) -> str: ... # undocumented + def _getAssertEqualityFunc(self, first: Any, second: Any) -> Callable[..., None]: ... # undocumented + +class FunctionTestCase(Testable): + def __init__(self, testFunc: Callable[[], None], + setUp: Optional[Callable[[], None]] = ..., + tearDown: Optional[Callable[[], None]] = ..., + description: Optional[str] = ...) -> None: ... + def run(self, result: TestResult) -> None: ... + def debug(self) -> None: ... + def countTestCases(self) -> int: ... + +class TestSuite(Testable): + def __init__(self, tests: Iterable[Testable] = ...) -> None: ... + def addTest(self, test: Testable) -> None: ... + def addTests(self, tests: Iterable[Testable]) -> None: ... + def run(self, result: TestResult) -> None: ... + def debug(self) -> None: ... + def countTestCases(self) -> int: ... + def __iter__(self) -> Iterator[Testable]: ... + +class TestLoader: + testMethodPrefix: str + sortTestMethodsUsing: Optional[Callable[[str, str], int]] + suiteClass: Callable[[List[TestCase]], TestSuite] + def loadTestsFromTestCase(self, + testCaseClass: Type[TestCase]) -> TestSuite: ... + def loadTestsFromModule(self, module: types.ModuleType = ..., + use_load_tests: bool = ...) -> TestSuite: ... + def loadTestsFromName(self, name: str = ..., + module: Optional[types.ModuleType] = ...) -> TestSuite: ... + def loadTestsFromNames(self, names: List[str] = ..., + module: Optional[types.ModuleType] = ...) -> TestSuite: ... + def discover(self, start_dir: str, pattern: str = ..., + top_level_dir: Optional[str] = ...) -> TestSuite: ... + def getTestCaseNames(self, testCaseClass: Type[TestCase] = ...) -> List[str]: ... + +defaultTestLoader: TestLoader + +class TextTestResult(TestResult): + def __init__(self, stream: TextIO, descriptions: bool, verbosity: int) -> None: ... + +class TextTestRunner: + def __init__(self, stream: Optional[TextIO] = ..., descriptions: bool = ..., + verbosity: int = ..., failfast: bool = ..., buffer: bool = ..., + resultclass: Optional[Type[TestResult]] = ...) -> None: ... + def _makeResult(self) -> TestResult: ... + +class SkipTest(Exception): + ... + +# TODO precise types +def skipUnless(condition: Any, reason: Union[str, unicode]) -> Any: ... +def skipIf(condition: Any, reason: Union[str, unicode]) -> Any: ... +def expectedFailure(func: _FT) -> _FT: ... +def skip(reason: Union[str, unicode]) -> Any: ... + +# not really documented +class TestProgram: + result: TestResult + def runTests(self) -> None: ... # undocumented + +def main(module: Union[None, Text, types.ModuleType] = ..., defaultTest: Optional[str] = ..., + argv: Optional[Sequence[str]] = ..., + testRunner: Union[Type[TextTestRunner], TextTestRunner, None] = ..., + testLoader: TestLoader = ..., exit: bool = ..., verbosity: int = ..., + failfast: Optional[bool] = ..., catchbreak: Optional[bool] = ..., + buffer: Optional[bool] = ...) -> TestProgram: ... + +def load_tests(loader: TestLoader, tests: TestSuite, pattern: Optional[Text]) -> TestSuite: ... + +def installHandler() -> None: ... +def registerResult(result: TestResult) -> None: ... +def removeResult(result: TestResult) -> bool: ... +@overload +def removeHandler() -> None: ... +@overload +def removeHandler(function: Callable[..., Any]) -> Callable[..., Any]: ... + +# private but occasionally used +util: types.ModuleType diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/urllib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/urllib.pyi new file mode 100644 index 00000000..fe044948 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/urllib.pyi @@ -0,0 +1,134 @@ +from typing import Any, AnyStr, IO, List, Mapping, Sequence, Text, Tuple, TypeVar, Union + +def url2pathname(pathname: AnyStr) -> AnyStr: ... +def pathname2url(pathname: AnyStr) -> AnyStr: ... +def urlopen(url: str, data=..., proxies: Mapping[str, str] = ..., context=...) -> IO[Any]: ... +def urlretrieve(url, filename=..., reporthook=..., data=..., context=...): ... +def urlcleanup() -> None: ... + +class ContentTooShortError(IOError): + content: Any + def __init__(self, message, content) -> None: ... + +class URLopener: + version: Any + proxies: Any + key_file: Any + cert_file: Any + context: Any + addheaders: Any + tempcache: Any + ftpcache: Any + def __init__(self, proxies: Mapping[str, str] = ..., context=..., **x509) -> None: ... + def __del__(self): ... + def close(self): ... + def cleanup(self): ... + def addheader(self, *args): ... + type: Any + def open(self, fullurl: str, data=...): ... + def open_unknown(self, fullurl, data=...): ... + def open_unknown_proxy(self, proxy, fullurl, data=...): ... + def retrieve(self, url, filename=..., reporthook=..., data=...): ... + def open_http(self, url, data=...): ... + def http_error(self, url, fp, errcode, errmsg, headers, data=...): ... + def http_error_default(self, url, fp, errcode, errmsg, headers): ... + def open_https(self, url, data=...): ... + def open_file(self, url): ... + def open_local_file(self, url): ... + def open_ftp(self, url): ... + def open_data(self, url, data=...): ... + +class FancyURLopener(URLopener): + auth_cache: Any + tries: Any + maxtries: Any + def __init__(self, *args, **kwargs) -> None: ... + def http_error_default(self, url, fp, errcode, errmsg, headers): ... + def http_error_302(self, url, fp, errcode, errmsg, headers, data=...): ... + def redirect_internal(self, url, fp, errcode, errmsg, headers, data): ... + def http_error_301(self, url, fp, errcode, errmsg, headers, data=...): ... + def http_error_303(self, url, fp, errcode, errmsg, headers, data=...): ... + def http_error_307(self, url, fp, errcode, errmsg, headers, data=...): ... + def http_error_401(self, url, fp, errcode, errmsg, headers, data=...): ... + def http_error_407(self, url, fp, errcode, errmsg, headers, data=...): ... + def retry_proxy_http_basic_auth(self, url, realm, data=...): ... + def retry_proxy_https_basic_auth(self, url, realm, data=...): ... + def retry_http_basic_auth(self, url, realm, data=...): ... + def retry_https_basic_auth(self, url, realm, data=...): ... + def get_user_passwd(self, host, realm, clear_cache=...): ... + def prompt_user_passwd(self, host, realm): ... + +class ftpwrapper: + user: Any + passwd: Any + host: Any + port: Any + dirs: Any + timeout: Any + refcount: Any + keepalive: Any + def __init__(self, user, passwd, host, port, dirs, timeout=..., persistent=...) -> None: ... + busy: Any + ftp: Any + def init(self): ... + def retrfile(self, file, type): ... + def endtransfer(self): ... + def close(self): ... + def file_close(self): ... + def real_close(self): ... + +_AIUT = TypeVar("_AIUT", bound=addbase) + +class addbase: + fp: Any + def read(self, n: int = ...) -> bytes: ... + def readline(self, limit: int = ...) -> bytes: ... + def readlines(self, hint: int = ...) -> List[bytes]: ... + def fileno(self) -> int: ... # Optional[int], but that is rare + def __iter__(self: _AIUT) -> _AIUT: ... + def next(self) -> bytes: ... + def __init__(self, fp) -> None: ... + def close(self) -> None: ... + +class addclosehook(addbase): + closehook: Any + hookargs: Any + def __init__(self, fp, closehook, *hookargs) -> None: ... + def close(self): ... + +class addinfo(addbase): + headers: Any + def __init__(self, fp, headers) -> None: ... + def info(self): ... + +class addinfourl(addbase): + headers: Any + url: Any + code: Any + def __init__(self, fp, headers, url, code=...) -> None: ... + def info(self): ... + def getcode(self): ... + def geturl(self): ... + +def unwrap(url): ... +def splittype(url): ... +def splithost(url): ... +def splituser(host): ... +def splitpasswd(user): ... +def splitport(host): ... +def splitnport(host, defport=...): ... +def splitquery(url): ... +def splittag(url): ... +def splitattr(url): ... +def splitvalue(attr): ... +def unquote(s: AnyStr) -> AnyStr: ... +def unquote_plus(s: AnyStr) -> AnyStr: ... +def quote(s: AnyStr, safe: Text = ...) -> AnyStr: ... +def quote_plus(s: AnyStr, safe: Text = ...) -> AnyStr: ... +def urlencode(query: Union[Sequence[Tuple[Any, Any]], Mapping[Any, Any]], doseq=...) -> str: ... + +def getproxies() -> Mapping[str, str]: ... +def proxy_bypass(host: str) -> Any: ... # Undocumented + +# Names in __all__ with no definition: +# basejoin diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/urllib2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/urllib2.pyi new file mode 100644 index 00000000..6611ad24 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/urllib2.pyi @@ -0,0 +1,182 @@ + +import ssl +from typing import Any, AnyStr, Dict, List, Union, Optional, Mapping, Callable, Sequence, Text, Tuple, Type +from urllib import addinfourl +from httplib import HTTPConnectionProtocol, HTTPResponse + +_string = Union[str, unicode] + +class URLError(IOError): + reason: Union[str, BaseException] + +class HTTPError(URLError, addinfourl): + code: int + headers: Mapping[str, str] + def __init__(self, url, code: int, msg: str, hdrs: Mapping[str, str], fp: addinfourl) -> None: ... + +class Request(object): + host: str + port: str + data: str + headers: Dict[str, str] + unverifiable: bool + type: Optional[str] + origin_req_host = ... + unredirected_hdrs: Dict[str, str] + + def __init__(self, url: str, data: Optional[str] = ..., headers: Dict[str, str] = ..., + origin_req_host: Optional[str] = ..., unverifiable: bool = ...) -> None: ... + def __getattr__(self, attr): ... + def get_method(self) -> str: ... + def add_data(self, data) -> None: ... + def has_data(self) -> bool: ... + def get_data(self) -> str: ... + def get_full_url(self) -> str: ... + def get_type(self): ... + def get_host(self) -> str: ... + def get_selector(self): ... + def set_proxy(self, host, type) -> None: ... + def has_proxy(self) -> bool: ... + def get_origin_req_host(self) -> str: ... + def is_unverifiable(self) -> bool: ... + def add_header(self, key: str, val: str) -> None: ... + def add_unredirected_header(self, key: str, val: str) -> None: ... + def has_header(self, header_name: str) -> bool: ... + def get_header(self, header_name: str, default: Optional[str] = ...) -> str: ... + def header_items(self): ... + +class OpenerDirector(object): + addheaders: List[Tuple[str, str]] + + def add_handler(self, handler: BaseHandler) -> None: ... + def open(self, fullurl: Union[Request, _string], data: Optional[_string] = ..., timeout: Optional[float] = ...) -> Optional[addinfourl]: ... + def error(self, proto: _string, *args: Any): ... + +# Note that this type is somewhat a lie. The return *can* be None if +# a custom opener has been installed that fails to handle the request. +def urlopen(url: Union[Request, _string], data: Optional[_string] = ..., timeout: Optional[float] = ..., + cafile: Optional[_string] = ..., capath: Optional[_string] = ..., cadefault: bool = ..., + context: Optional[ssl.SSLContext] = ...) -> addinfourl: ... +def install_opener(opener: OpenerDirector) -> None: ... +def build_opener(*handlers: Union[BaseHandler, Type[BaseHandler]]) -> OpenerDirector: ... + +class BaseHandler: + handler_order: int + parent: OpenerDirector + + def add_parent(self, parent: OpenerDirector) -> None: ... + def close(self) -> None: ... + def __lt__(self, other: Any) -> bool: ... + +class HTTPErrorProcessor(BaseHandler): + def http_response(self, request, response): ... + +class HTTPDefaultErrorHandler(BaseHandler): + def http_error_default(self, req: Request, fp: addinfourl, code: int, msg: str, hdrs: Mapping[str, str]): ... + +class HTTPRedirectHandler(BaseHandler): + max_repeats: int + max_redirections: int + def redirect_request(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str], newurl): ... + def http_error_301(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + def http_error_302(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + def http_error_303(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + def http_error_307(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + inf_msg: str + + +class ProxyHandler(BaseHandler): + proxies: Mapping[str, str] + + def __init__(self, proxies: Optional[Mapping[str, str]] = ...): ... + def proxy_open(self, req: Request, proxy, type): ... + +class HTTPPasswordMgr: + def __init__(self) -> None: ... + def add_password(self, realm: Optional[Text], uri: Union[Text, Sequence[Text]], user: Text, passwd: Text) -> None: ... + def find_user_password(self, realm: Optional[Text], authuri: Text) -> Tuple[Any, Any]: ... + def reduce_uri(self, uri: _string, default_port: bool = ...) -> Tuple[Any, Any]: ... + def is_suburi(self, base: _string, test: _string) -> bool: ... + +class HTTPPasswordMgrWithDefaultRealm(HTTPPasswordMgr): ... + +class AbstractBasicAuthHandler: + def __init__(self, password_mgr: Optional[HTTPPasswordMgr] = ...) -> None: ... + def add_password(self, realm: Optional[Text], uri: Union[Text, Sequence[Text]], user: Text, passwd: Text) -> None: ... + def http_error_auth_reqed(self, authreq, host, req: Request, headers: Mapping[str, str]): ... + def retry_http_basic_auth(self, host, req: Request, realm): ... + +class HTTPBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): + auth_header: str + def http_error_401(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + +class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): + auth_header: str + def http_error_407(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + +class AbstractDigestAuthHandler: + def __init__(self, passwd: Optional[HTTPPasswordMgr] = ...) -> None: ... + def add_password(self, realm: Optional[Text], uri: Union[Text, Sequence[Text]], user: Text, passwd: Text) -> None: ... + def reset_retry_count(self) -> None: ... + def http_error_auth_reqed(self, auth_header: str, host: str, req: Request, + headers: Mapping[str, str]) -> None: ... + def retry_http_digest_auth(self, req: Request, auth: str) -> Optional[HTTPResponse]: ... + def get_cnonce(self, nonce: str) -> str: ... + def get_authorization(self, req: Request, chal: Mapping[str, str]) -> str: ... + def get_algorithm_impls(self, algorithm: str) -> Tuple[Callable[[str], str], Callable[[str, str], str]]: ... + def get_entity_digest(self, data: Optional[bytes], chal: Mapping[str, str]) -> Optional[str]: ... + +class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): + auth_header: str + handler_order: int + def http_error_401(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + +class ProxyDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): + auth_header: str + handler_order: int + def http_error_407(self, req: Request, fp: addinfourl, code: int, msg: str, headers: Mapping[str, str]): ... + +class AbstractHTTPHandler(BaseHandler): # undocumented + def __init__(self, debuglevel: int = ...) -> None: ... + def set_http_debuglevel(self, level: int) -> None: ... + def do_request_(self, request: Request) -> Request: ... + def do_open(self, + http_class: HTTPConnectionProtocol, + req: Request, + **http_conn_args: Optional[Any]) -> addinfourl: ... + +class HTTPHandler(AbstractHTTPHandler): + def http_open(self, req: Request) -> addinfourl: ... + def http_request(self, request: Request) -> Request: ... # undocumented + +class HTTPSHandler(AbstractHTTPHandler): + def __init__(self, debuglevel: int = ..., context: Optional[ssl.SSLContext] = ...) -> None: ... + def https_open(self, req: Request) -> addinfourl: ... + def https_request(self, request: Request) -> Request: ... # undocumented + +class HTTPCookieProcessor(BaseHandler): + def __init__(self, cookiejar: Optional[Any] = ...): ... + def http_request(self, request: Request): ... + def http_response(self, request: Request, response): ... + +class UnknownHandler(BaseHandler): + def unknown_open(self, req: Request): ... + +class FileHandler(BaseHandler): + def file_open(self, req: Request): ... + def get_names(self): ... + def open_local_file(self, req: Request): ... + +class FTPHandler(BaseHandler): + def ftp_open(self, req: Request): ... + def connect_ftp(self, user, passwd, host, port, dirs, timeout): ... + +class CacheFTPHandler(FTPHandler): + def __init__(self) -> None: ... + def setTimeout(self, t: Optional[float]): ... + def setMaxConns(self, m: int): ... + def check_cache(self): ... + def clear_cache(self): ... + +def parse_http_list(s: AnyStr) -> List[AnyStr]: ... +def parse_keqv_list(l: List[AnyStr]) -> Dict[AnyStr, AnyStr]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/urlparse.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/urlparse.pyi new file mode 100644 index 00000000..2ab28a7e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/urlparse.pyi @@ -0,0 +1,66 @@ +# Stubs for urlparse (Python 2) + +from typing import AnyStr, Dict, List, NamedTuple, Tuple, Sequence, Union, overload, Optional + +_String = Union[str, unicode] + +uses_relative: List[str] +uses_netloc: List[str] +uses_params: List[str] +non_hierarchical: List[str] +uses_query: List[str] +uses_fragment: List[str] +scheme_chars: str +MAX_CACHE_SIZE: int + +def clear_cache() -> None: ... + +class ResultMixin(object): + @property + def username(self) -> Optional[str]: ... + @property + def password(self) -> Optional[str]: ... + @property + def hostname(self) -> Optional[str]: ... + @property + def port(self) -> Optional[int]: ... + +class _SplitResult(NamedTuple): + scheme: str + netloc: str + path: str + query: str + fragment: str +class SplitResult(_SplitResult, ResultMixin): + def geturl(self) -> str: ... + +class _ParseResult(NamedTuple): + scheme: str + netloc: str + path: str + params: str + query: str + fragment: str +class ParseResult(_ParseResult, ResultMixin): + def geturl(self) -> str: ... + +def urlparse(url: _String, scheme: _String = ..., + allow_fragments: bool = ...) -> ParseResult: ... +def urlsplit(url: _String, scheme: _String = ..., + allow_fragments: bool = ...) -> SplitResult: ... +@overload +def urlunparse(data: Tuple[_String, _String, _String, _String, _String, _String]) -> str: ... +@overload +def urlunparse(data: Sequence[_String]) -> str: ... +@overload +def urlunsplit(data: Tuple[_String, _String, _String, _String, _String]) -> str: ... +@overload +def urlunsplit(data: Sequence[_String]) -> str: ... +def urljoin(base: _String, url: _String, + allow_fragments: bool = ...) -> str: ... +def urldefrag(url: AnyStr) -> Tuple[AnyStr, str]: ... +def unquote(s: AnyStr) -> AnyStr: ... +def parse_qs(qs: AnyStr, keep_blank_values: bool = ..., + strict_parsing: bool = ...) -> Dict[AnyStr, List[AnyStr]]: ... +def parse_qsl(qs: AnyStr, keep_blank_values: int = ..., + strict_parsing: bool = ...) -> List[Tuple[AnyStr, AnyStr]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/user.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/user.pyi new file mode 100644 index 00000000..e857a3a9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/user.pyi @@ -0,0 +1,9 @@ +# Stubs for user (Python 2) + +# Docs: https://docs.python.org/2/library/user.html +# Source: https://hg.python.org/cpython/file/2.7/Lib/user.py +from typing import Any + +def __getattr__(name) -> Any: ... +home: str +pythonrc: str diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/whichdb.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/whichdb.pyi new file mode 100644 index 00000000..b1a69f48 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/whichdb.pyi @@ -0,0 +1,5 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/whichdb.py + +from typing import Optional, Text + +def whichdb(filename: Text) -> Optional[str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/xmlrpclib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/xmlrpclib.pyi new file mode 100644 index 00000000..d1d29371 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2/xmlrpclib.pyi @@ -0,0 +1,231 @@ +# Stubs for xmlrpclib (Python 2) + +from typing import Any, AnyStr, Callable, IO, Iterable, List, Mapping, MutableMapping, Optional, Tuple, Type, TypeVar, Union +from types import InstanceType +from datetime import datetime +from time import struct_time +from httplib import HTTPConnection, HTTPResponse, HTTPSConnection +from ssl import SSLContext +from StringIO import StringIO +from gzip import GzipFile + +_Unmarshaller = Any +_timeTuple = Tuple[int, int, int, int, int, int, int, int, int] +# Represents types that can be compared against a DateTime object +_dateTimeComp = Union[unicode, DateTime, datetime] +# A "host description" used by Transport factories +_hostDesc = Union[str, Tuple[str, Mapping[Any, Any]]] + +def escape(s: AnyStr, replace: Callable[[AnyStr, AnyStr, AnyStr], AnyStr] = ...) -> AnyStr: ... + +MAXINT: int +MININT: int +PARSE_ERROR: int +SERVER_ERROR: int +APPLICATION_ERROR: int +SYSTEM_ERROR: int +TRANSPORT_ERROR: int +NOT_WELLFORMED_ERROR: int +UNSUPPORTED_ENCODING: int +INVALID_ENCODING_CHAR: int +INVALID_XMLRPC: int +METHOD_NOT_FOUND: int +INVALID_METHOD_PARAMS: int +INTERNAL_ERROR: int + +class Error(Exception): ... + +class ProtocolError(Error): + url: str + errcode: int + errmsg: str + headers: Any + def __init__(self, url: str, errcode: int, errmsg: str, headers: Any) -> None: ... + +class ResponseError(Error): ... + +class Fault(Error): + faultCode: Any + faultString: str + def __init__(self, faultCode: Any, faultString: str, **extra: Any) -> None: ... + +boolean: Type[bool] +Boolean: Type[bool] + +class DateTime: + value: str + def __init__(self, value: Union[str, unicode, datetime, float, int, _timeTuple, struct_time] = ...) -> None: ... + def make_comparable(self, other: _dateTimeComp) -> Tuple[unicode, unicode]: ... + def __lt__(self, other: _dateTimeComp) -> bool: ... + def __le__(self, other: _dateTimeComp) -> bool: ... + def __gt__(self, other: _dateTimeComp) -> bool: ... + def __ge__(self, other: _dateTimeComp) -> bool: ... + def __eq__(self, other: _dateTimeComp) -> bool: ... # type: ignore + def __ne__(self, other: _dateTimeComp) -> bool: ... # type: ignore + def timetuple(self) -> struct_time: ... + def __cmp__(self, other: _dateTimeComp) -> int: ... + def decode(self, data: Any) -> None: ... + def encode(self, out: IO[str]) -> None: ... + +class Binary: + data: str + def __init__(self, data: Optional[str] = ...) -> None: ... + def __cmp__(self, other: Any) -> int: ... + def decode(self, data: str) -> None: ... + def encode(self, out: IO[str]) -> None: ... + +WRAPPERS: Tuple[Type[Any], ...] + +# Still part of the public API, but see http://bugs.python.org/issue1773632 +FastParser: None +FastUnmarshaller: None +FastMarshaller: None + +# xmlrpclib.py will leave ExpatParser undefined if it can't import expat from +# xml.parsers. Because this is Python 2.7, the import will succeed. +class ExpatParser: + def __init__(self, target: _Unmarshaller) -> None: ... + def feed(self, data: str): ... + def close(self): ... + +# TODO: Add xmllib.XMLParser as base class +class SlowParser: + handle_xml: Callable[[str, bool], None] + unknown_starttag: Callable[[str, Any], None] + handle_data: Callable[[str], None] + handle_cdata: Callable[[str], None] + unknown_endtag: Callable[[str, Callable[[Iterable[str], str], str]], None] + def __init__(self, target: _Unmarshaller) -> None: ... + +class Marshaller: + memo: MutableMapping[int, Any] + data: Optional[str] + encoding: Optional[str] + allow_none: bool + def __init__(self, encoding: Optional[str] = ..., allow_none: bool = ...) -> None: ... + dispatch: Mapping[type, Callable[[Marshaller, str, Callable[[str], None]], None]] + def dumps( + self, + values: Union[ + Iterable[ + Union[ + None, + int, + bool, + long, + float, + str, + unicode, + List[Any], + Tuple[Any, ...], + Mapping[Any, Any], + datetime, + InstanceType, + ], + ], + Fault, + ], + ) -> str: ... + def dump_nil(self, value: None, write: Callable[[str], None]) -> None: ... + def dump_int(self, value: int, write: Callable[[str], None]) -> None: ... + def dump_bool(self, value: bool, write: Callable[[str], None]) -> None: ... + def dump_long(self, value: long, write: Callable[[str], None]) -> None: ... + def dump_double(self, value: float, write: Callable[[str], None]) -> None: ... + def dump_string(self, value: str, write: Callable[[str], None], escape: Callable[[AnyStr, Callable[[AnyStr, AnyStr, AnyStr], AnyStr]], AnyStr] = ...) -> None: ... + def dump_unicode(self, value: unicode, write: Callable[[str], None], escape: Callable[[AnyStr, Callable[[AnyStr, AnyStr, AnyStr], AnyStr]], AnyStr] = ...) -> None: ... + def dump_array(self, value: Iterable[Any], write: Callable[[str], None]) -> None: ... + def dump_struct( + self, + value: Mapping[unicode, Any], + write: Callable[[str], None], + escape: Callable[[AnyStr, Callable[[AnyStr, AnyStr, AnyStr], AnyStr]], AnyStr] = ..., + ) -> None: ... + def dump_datetime(self, value: datetime, write: Callable[[str], None]) -> None: ... + def dump_instance(self, value: InstanceType, write: Callable[[str], None]) -> None: ... + +class Unmarshaller: + def append(self, object: Any) -> None: ... + def __init__(self, use_datetime: bool = ...) -> None: ... + def close(self) -> Tuple[Any, ...]: ... + def getmethodname(self) -> Optional[str]: ... + def xml(self, encoding: str, standalone: bool) -> None: ... + def start(self, tag: str, attrs: Any) -> None: ... + def data(self, text: str) -> None: ... + def end(self, tag: str, join: Callable[[Iterable[str], str], str] = ...) -> None: ... + def end_dispatch(self, tag: str, data: str) -> None: ... + dispatch: Mapping[str, Callable[[Unmarshaller, str], None]] + def end_nil(self, data: str): ... + def end_boolean(self, data: str) -> None: ... + def end_int(self, data: str) -> None: ... + def end_double(self, data: str) -> None: ... + def end_string(self, data: str) -> None: ... + def end_array(self, data: str) -> None: ... + def end_struct(self, data: str) -> None: ... + def end_base64(self, data: str) -> None: ... + def end_dateTime(self, data: str) -> None: ... + def end_value(self, data: str) -> None: ... + def end_params(self, data: str) -> None: ... + def end_fault(self, data: str) -> None: ... + def end_methodName(self, data: str) -> None: ... + +class _MultiCallMethod: + def __init__(self, call_list: List[Tuple[str, Tuple[Any, ...]]], name: str) -> None: ... +class MultiCallIterator: + def __init__(self, results: List[Any]) -> None: ... + +class MultiCall: + def __init__(self, server: ServerProxy) -> None: ... + def __getattr__(self, name: str) -> _MultiCallMethod: ... + def __call__(self) -> MultiCallIterator: ... + +def getparser(use_datetime: bool = ...) -> Tuple[Union[ExpatParser, SlowParser], Unmarshaller]: ... +def dumps( + params: Union[Tuple[Any, ...], Fault], + methodname: Optional[str] = ..., + methodresponse: Optional[bool] = ..., + encoding: Optional[str] = ..., + allow_none: bool = ..., +) -> str: ... +def loads(data: str, use_datetime: bool = ...) -> Tuple[Tuple[Any, ...], Optional[str]]: ... + +def gzip_encode(data: str) -> str: ... +def gzip_decode(data: str, max_decode: int = ...) -> str: ... + +class GzipDecodedResponse(GzipFile): + stringio: StringIO[Any] + def __init__(self, response: HTTPResponse) -> None: ... + def close(self): ... + +class _Method: + def __init__(self, send: Callable[[str, Tuple[Any, ...]], Any], name: str) -> None: ... + def __getattr__(self, name: str) -> _Method: ... + def __call__(self, *args: Any) -> Any: ... + +class Transport: + user_agent: str + accept_gzip_encoding: bool + encode_threshold: Optional[int] + def __init__(self, use_datetime: bool = ...) -> None: ... + def request(self, host: _hostDesc, handler: str, request_body: str, verbose: bool = ...) -> Tuple[Any, ...]: ... + verbose: bool + def single_request(self, host: _hostDesc, handler: str, request_body: str, verbose: bool = ...) -> Tuple[Any, ...]: ... + def getparser(self) -> Tuple[Union[ExpatParser, SlowParser], Unmarshaller]: ... + def get_host_info(self, host: _hostDesc) -> Tuple[str, Optional[List[Tuple[str, str]]], Optional[Mapping[Any, Any]]]: ... + def make_connection(self, host: _hostDesc) -> HTTPConnection: ... + def close(self) -> None: ... + def send_request(self, connection: HTTPConnection, handler: str, request_body: str) -> None: ... + def send_host(self, connection: HTTPConnection, host: str) -> None: ... + def send_user_agent(self, connection: HTTPConnection) -> None: ... + def send_content(self, connection: HTTPConnection, request_body: str) -> None: ... + def parse_response(self, response: HTTPResponse) -> Tuple[Any, ...]: ... + +class SafeTransport(Transport): + def __init__(self, use_datetime: bool = ..., context: Optional[SSLContext] = ...) -> None: ... + def make_connection(self, host: _hostDesc) -> HTTPSConnection: ... + +class ServerProxy: + def __init__(self, uri: str, transport: Optional[Transport] = ..., encoding: Optional[str] = ..., verbose: bool = ..., allow_none: bool = ..., use_datetime: bool = ..., context: Optional[SSLContext] = ...) -> None: ... + def __getattr__(self, name: str) -> _Method: ... + def __call__(self, attr: str) -> Optional[Transport]: ... + +Server = ServerProxy diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/__future__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/__future__.pyi new file mode 100644 index 00000000..0483e736 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/__future__.pyi @@ -0,0 +1,25 @@ +import sys +from typing import List + +class _Feature: + def getOptionalRelease(self) -> sys._version_info: ... + def getMandatoryRelease(self) -> sys._version_info: ... + compiler_flag: int + +absolute_import: _Feature +division: _Feature +generators: _Feature +nested_scopes: _Feature +print_function: _Feature +unicode_literals: _Feature +with_statement: _Feature +if sys.version_info >= (3, 0): + barry_as_FLUFL: _Feature + +if sys.version_info >= (3, 5): + generator_stop: _Feature + +if sys.version_info >= (3, 7): + annotations: _Feature + +all_feature_names: List[str] # undocumented diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_bisect.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_bisect.pyi new file mode 100644 index 00000000..38e7a7b3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_bisect.pyi @@ -0,0 +1,11 @@ +"""Stub file for the '_bisect' module.""" + +from typing import Sequence, MutableSequence, TypeVar + +_T = TypeVar('_T') +def bisect(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +def bisect_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +def bisect_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +def insort(a: MutableSequence[_T], x: _T, lo: int = ..., hi: int = ...) -> None: ... +def insort_left(a: MutableSequence[_T], x: _T, lo: int = ..., hi: int = ...) -> None: ... +def insort_right(a: MutableSequence[_T], x: _T, lo: int = ..., hi: int = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_codecs.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_codecs.pyi new file mode 100644 index 00000000..c9762567 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_codecs.pyi @@ -0,0 +1,75 @@ +"""Stub file for the '_codecs' module.""" + +import sys +from typing import Any, Callable, Tuple, Optional, Dict, Text, Union + +import codecs + +# For convenience: +_Handler = Callable[[Exception], Tuple[Text, int]] +_String = Union[bytes, str] +_Errors = Union[str, Text, None] +if sys.version_info < (3, 0): + _Decodable = Union[bytes, Text] + _Encodable = Union[bytes, Text] +else: + _Decodable = bytes + _Encodable = str + +# This type is not exposed; it is defined in unicodeobject.c +class _EncodingMap(object): + def size(self) -> int: ... +_MapT = Union[Dict[int, int], _EncodingMap] + +def register(search_function: Callable[[str], Any]) -> None: ... +def register_error(errors: Union[str, Text], handler: _Handler) -> None: ... +def lookup(encoding: Union[str, Text]) -> codecs.CodecInfo: ... +def lookup_error(name: Union[str, Text]) -> _Handler: ... +def decode(obj: Any, encoding: Union[str, Text] = ..., errors: _Errors = ...) -> Any: ... +def encode(obj: Any, encoding: Union[str, Text] = ..., errors: _Errors = ...) -> Any: ... +def charmap_build(map: Text) -> _MapT: ... + +def ascii_decode(data: _Decodable, errors: _Errors = ...) -> Tuple[Text, int]: ... +def ascii_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def charbuffer_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def charmap_decode(data: _Decodable, errors: _Errors = ..., mapping: Optional[_MapT] = ...) -> Tuple[Text, int]: ... +def charmap_encode(data: _Encodable, errors: _Errors, mapping: Optional[_MapT] = ...) -> Tuple[bytes, int]: ... +def escape_decode(data: _String, errors: _Errors = ...) -> Tuple[str, int]: ... +def escape_encode(data: bytes, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def latin_1_decode(data: _Decodable, errors: _Errors = ...) -> Tuple[Text, int]: ... +def latin_1_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def raw_unicode_escape_decode(data: _String, errors: _Errors = ...) -> Tuple[Text, int]: ... +def raw_unicode_escape_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def readbuffer_encode(data: _String, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def unicode_escape_decode(data: _String, errors: _Errors = ...) -> Tuple[Text, int]: ... +def unicode_escape_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +if sys.version_info < (3, 8): + def unicode_internal_decode(data: _String, errors: _Errors = ...) -> Tuple[Text, int]: ... + def unicode_internal_encode(data: _String, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_16_be_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_16_be_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_16_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_16_encode(data: _Encodable, errors: _Errors = ..., byteorder: int = ...) -> Tuple[bytes, int]: ... +def utf_16_ex_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int, int]: ... +def utf_16_le_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_16_le_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_32_be_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_32_be_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_32_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_32_encode(data: _Encodable, errors: _Errors = ..., byteorder: int = ...) -> Tuple[bytes, int]: ... +def utf_32_ex_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int, int]: ... +def utf_32_le_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_32_le_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_7_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_7_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... +def utf_8_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... +def utf_8_encode(data: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... + +if sys.platform == 'win32': + def mbcs_decode(data: _Decodable, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... + def mbcs_encode(str: _Encodable, errors: _Errors = ...) -> Tuple[bytes, int]: ... + if sys.version_info >= (3, 0): + def oem_decode(data: bytes, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... + def code_page_decode(codepage: int, data: bytes, errors: _Errors = ..., final: int = ...) -> Tuple[Text, int]: ... + def oem_encode(str: Text, errors: _Errors = ...) -> Tuple[bytes, int]: ... + def code_page_encode(code_page: int, str: Text, errors: _Errors = ...) -> Tuple[bytes, int]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_csv.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_csv.pyi new file mode 100644 index 00000000..1c4c26ef --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_csv.pyi @@ -0,0 +1,49 @@ +import sys + +from typing import Any, Iterable, Iterator, List, Optional, Sequence, Text + +QUOTE_ALL: int +QUOTE_MINIMAL: int +QUOTE_NONE: int +QUOTE_NONNUMERIC: int + +class Error(Exception): ... + +class Dialect: + delimiter: str + quotechar: Optional[str] + escapechar: Optional[str] + doublequote: bool + skipinitialspace: bool + lineterminator: str + quoting: int + strict: int + def __init__(self) -> None: ... + +class _reader(Iterator[List[str]]): + dialect: Dialect + line_num: int + if sys.version_info >= (3, 0): + def __next__(self) -> List[str]: ... + else: + def next(self) -> List[str]: ... + +class _writer: + dialect: Dialect + + if sys.version_info >= (3, 5): + def writerow(self, row: Iterable[Any]) -> None: ... + def writerows(self, rows: Iterable[Iterable[Any]]) -> None: ... + else: + def writerow(self, row: Sequence[Any]) -> None: ... + def writerows(self, rows: Iterable[Sequence[Any]]) -> None: ... + + +# TODO: precise type +def writer(csvfile: Any, dialect: Any = ..., **fmtparams: Any) -> _writer: ... +def reader(csvfile: Iterable[Text], dialect: Any = ..., **fmtparams: Any) -> _reader: ... +def register_dialect(name: str, dialect: Any = ..., **fmtparams: Any) -> None: ... +def unregister_dialect(name: str) -> None: ... +def get_dialect(name: str) -> Dialect: ... +def list_dialects() -> List[str]: ... +def field_size_limit(new_limit: int = ...) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_curses.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_curses.pyi new file mode 100644 index 00000000..4126f36d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_curses.pyi @@ -0,0 +1,461 @@ +import sys +from typing import Any, BinaryIO, IO, NamedTuple, Optional, Tuple, Union, overload + +_chtype = Union[str, bytes, int] + +ALL_MOUSE_EVENTS: int +A_ALTCHARSET: int +A_ATTRIBUTES: int +A_BLINK: int +A_BOLD: int +A_CHARTEXT: int +A_COLOR: int +A_DIM: int +A_HORIZONTAL: int +A_INVIS: int +if sys.version_info >= (3, 7): + A_ITALIC: int +A_LEFT: int +A_LOW: int +A_NORMAL: int +A_PROTECT: int +A_REVERSE: int +A_RIGHT: int +A_STANDOUT: int +A_TOP: int +A_UNDERLINE: int +A_VERTICAL: int +BUTTON1_CLICKED: int +BUTTON1_DOUBLE_CLICKED: int +BUTTON1_PRESSED: int +BUTTON1_RELEASED: int +BUTTON1_TRIPLE_CLICKED: int +BUTTON2_CLICKED: int +BUTTON2_DOUBLE_CLICKED: int +BUTTON2_PRESSED: int +BUTTON2_RELEASED: int +BUTTON2_TRIPLE_CLICKED: int +BUTTON3_CLICKED: int +BUTTON3_DOUBLE_CLICKED: int +BUTTON3_PRESSED: int +BUTTON3_RELEASED: int +BUTTON3_TRIPLE_CLICKED: int +BUTTON4_CLICKED: int +BUTTON4_DOUBLE_CLICKED: int +BUTTON4_PRESSED: int +BUTTON4_RELEASED: int +BUTTON4_TRIPLE_CLICKED: int +BUTTON_ALT: int +BUTTON_CTRL: int +BUTTON_SHIFT: int +COLOR_BLACK: int +COLOR_BLUE: int +COLOR_CYAN: int +COLOR_GREEN: int +COLOR_MAGENTA: int +COLOR_RED: int +COLOR_WHITE: int +COLOR_YELLOW: int +ERR: int +KEY_A1: int +KEY_A3: int +KEY_B2: int +KEY_BACKSPACE: int +KEY_BEG: int +KEY_BREAK: int +KEY_BTAB: int +KEY_C1: int +KEY_C3: int +KEY_CANCEL: int +KEY_CATAB: int +KEY_CLEAR: int +KEY_CLOSE: int +KEY_COMMAND: int +KEY_COPY: int +KEY_CREATE: int +KEY_CTAB: int +KEY_DC: int +KEY_DL: int +KEY_DOWN: int +KEY_EIC: int +KEY_END: int +KEY_ENTER: int +KEY_EOL: int +KEY_EOS: int +KEY_EXIT: int +KEY_F0: int +KEY_F1: int +KEY_F10: int +KEY_F11: int +KEY_F12: int +KEY_F13: int +KEY_F14: int +KEY_F15: int +KEY_F16: int +KEY_F17: int +KEY_F18: int +KEY_F19: int +KEY_F2: int +KEY_F20: int +KEY_F21: int +KEY_F22: int +KEY_F23: int +KEY_F24: int +KEY_F25: int +KEY_F26: int +KEY_F27: int +KEY_F28: int +KEY_F29: int +KEY_F3: int +KEY_F30: int +KEY_F31: int +KEY_F32: int +KEY_F33: int +KEY_F34: int +KEY_F35: int +KEY_F36: int +KEY_F37: int +KEY_F38: int +KEY_F39: int +KEY_F4: int +KEY_F40: int +KEY_F41: int +KEY_F42: int +KEY_F43: int +KEY_F44: int +KEY_F45: int +KEY_F46: int +KEY_F47: int +KEY_F48: int +KEY_F49: int +KEY_F5: int +KEY_F50: int +KEY_F51: int +KEY_F52: int +KEY_F53: int +KEY_F54: int +KEY_F55: int +KEY_F56: int +KEY_F57: int +KEY_F58: int +KEY_F59: int +KEY_F6: int +KEY_F60: int +KEY_F61: int +KEY_F62: int +KEY_F63: int +KEY_F7: int +KEY_F8: int +KEY_F9: int +KEY_FIND: int +KEY_HELP: int +KEY_HOME: int +KEY_IC: int +KEY_IL: int +KEY_LEFT: int +KEY_LL: int +KEY_MARK: int +KEY_MAX: int +KEY_MESSAGE: int +KEY_MIN: int +KEY_MOUSE: int +KEY_MOVE: int +KEY_NEXT: int +KEY_NPAGE: int +KEY_OPEN: int +KEY_OPTIONS: int +KEY_PPAGE: int +KEY_PREVIOUS: int +KEY_PRINT: int +KEY_REDO: int +KEY_REFERENCE: int +KEY_REFRESH: int +KEY_REPLACE: int +KEY_RESET: int +KEY_RESIZE: int +KEY_RESTART: int +KEY_RESUME: int +KEY_RIGHT: int +KEY_SAVE: int +KEY_SBEG: int +KEY_SCANCEL: int +KEY_SCOMMAND: int +KEY_SCOPY: int +KEY_SCREATE: int +KEY_SDC: int +KEY_SDL: int +KEY_SELECT: int +KEY_SEND: int +KEY_SEOL: int +KEY_SEXIT: int +KEY_SF: int +KEY_SFIND: int +KEY_SHELP: int +KEY_SHOME: int +KEY_SIC: int +KEY_SLEFT: int +KEY_SMESSAGE: int +KEY_SMOVE: int +KEY_SNEXT: int +KEY_SOPTIONS: int +KEY_SPREVIOUS: int +KEY_SPRINT: int +KEY_SR: int +KEY_SREDO: int +KEY_SREPLACE: int +KEY_SRESET: int +KEY_SRIGHT: int +KEY_SRSUME: int +KEY_SSAVE: int +KEY_SSUSPEND: int +KEY_STAB: int +KEY_SUNDO: int +KEY_SUSPEND: int +KEY_UNDO: int +KEY_UP: int +OK: int +REPORT_MOUSE_POSITION: int +_C_API: Any +version: bytes + +def baudrate() -> int: ... +def beep() -> None: ... +def can_change_color() -> bool: ... +def cbreak(flag: bool = ...) -> None: ... +def color_content(color_number: int) -> Tuple[int, int, int]: ... +def color_pair(color_number: int) -> int: ... +def curs_set(visibility: int) -> int: ... +def def_prog_mode() -> None: ... +def def_shell_mode() -> None: ... +def delay_output(ms: int) -> None: ... +def doupdate() -> None: ... +def echo(flag: bool = ...) -> None: ... +def endwin() -> None: ... +def erasechar() -> bytes: ... +def filter() -> None: ... +def flash() -> None: ... +def flushinp() -> None: ... +def getmouse() -> Tuple[int, int, int, int, int]: ... +def getsyx() -> Tuple[int, int]: ... +def getwin(f: BinaryIO) -> _CursesWindow: ... +def halfdelay(tenths: int) -> None: ... +def has_colors() -> bool: ... +def has_ic() -> bool: ... +def has_il() -> bool: ... +def has_key(ch: int) -> bool: ... +def init_color(color_number: int, r: int, g: int, b: int) -> None: ... +def init_pair(pair_number: int, fg: int, bg: int) -> None: ... +def initscr() -> _CursesWindow: ... +def intrflush(ch: bool) -> None: ... +def is_term_resized(nlines: int, ncols: int) -> bool: ... +def isendwin() -> bool: ... +def keyname(k: int) -> bytes: ... +def killchar() -> bytes: ... +def longname() -> bytes: ... +def meta(yes: bool) -> None: ... +def mouseinterval(interval: int) -> None: ... +def mousemask(mousemask: int) -> Tuple[int, int]: ... +def napms(ms: int) -> int: ... +def newpad(nlines: int, ncols: int) -> _CursesWindow: ... +def newwin(nlines: int, ncols: int, begin_y: int = ..., begin_x: int = ...) -> _CursesWindow: ... +def nl(flag: bool = ...) -> None: ... +def nocbreak() -> None: ... +def noecho() -> None: ... +def nonl() -> None: ... +def noqiflush() -> None: ... +def noraw() -> None: ... +def pair_content(pair_number: int) -> Tuple[int, int]: ... +def pair_number(attr: int) -> int: ... +def putp(string: bytes) -> None: ... +def qiflush(flag: bool = ...) -> None: ... +def raw(flag: bool = ...) -> None: ... +def reset_prog_mode() -> None: ... +def reset_shell_mode() -> None: ... +def resetty() -> None: ... +def resize_term(nlines: int, ncols: int) -> None: ... +def resizeterm(nlines: int, ncols: int) -> None: ... +def savetty() -> None: ... +def setsyx(y: int, x: int) -> None: ... +def setupterm(termstr: str = ..., fd: int = ...) -> None: ... +def start_color() -> None: ... +def termattrs() -> int: ... +def termname() -> bytes: ... +def tigetflag(capname: str) -> int: ... +def tigetnum(capname: str) -> int: ... +def tigetstr(capname: str) -> bytes: ... +def tparm(fmt: bytes, i1: int = ..., i2: int = ..., i3: int = ..., i4: int = ..., i5: int = ..., i6: int = ..., i7: int = ..., i8: int = ..., i9: int = ...) -> bytes: ... +def typeahead(fd: int) -> None: ... +def unctrl(ch: _chtype) -> bytes: ... +if sys.version_info >= (3, 3): + def unget_wch(ch: Union[int, str]) -> None: ... +def ungetch(ch: _chtype) -> None: ... +def ungetmouse(id: int, x: int, y: int, z: int, bstate: int) -> None: ... +if sys.version_info >= (3, 5): + def update_lines_cols() -> int: ... +def use_default_colors() -> None: ... +def use_env(flag: bool) -> None: ... + +class error(Exception): ... + +class _CursesWindow: + if sys.version_info >= (3, 3): + encoding: str + @overload + def addch(self, ch: _chtype, attr: int = ...) -> None: ... + @overload + def addch(self, y: int, x: int, ch: _chtype, attr: int = ...) -> None: ... + @overload + def addnstr(self, str: str, n: int, attr: int = ...) -> None: ... + @overload + def addnstr(self, y: int, x: int, str: str, n: int, attr: int = ...) -> None: ... + @overload + def addstr(self, str: str, attr: int = ...) -> None: ... + @overload + def addstr(self, y: int, x: int, str: str, attr: int = ...) -> None: ... + def attroff(self, attr: int) -> None: ... + def attron(self, attr: int) -> None: ... + def attrset(self, attr: int) -> None: ... + def bkgd(self, ch: _chtype, attr: int = ...) -> None: ... + def bkgset(self, ch: _chtype, attr: int = ...) -> None: ... + def border(self, ls: _chtype = ..., rs: _chtype = ..., ts: _chtype = ..., bs: _chtype = ..., tl: _chtype = ..., tr: _chtype = ..., bl: _chtype = ..., br: _chtype = ...) -> None: ... + @overload + def box(self) -> None: ... + @overload + def box(self, vertch: _chtype = ..., horch: _chtype = ...) -> None: ... + @overload + def chgat(self, attr: int) -> None: ... + @overload + def chgat(self, num: int, attr: int) -> None: ... + @overload + def chgat(self, y: int, x: int, attr: int) -> None: ... + @overload + def chgat(self, y: int, x: int, num: int, attr: int) -> None: ... + def clear(self) -> None: ... + def clearok(self, yes: int) -> None: ... + def clrtobot(self) -> None: ... + def clrtoeol(self) -> None: ... + def cursyncup(self) -> None: ... + @overload + def delch(self) -> None: ... + @overload + def delch(self, y: int, x: int) -> None: ... + def deleteln(self) -> None: ... + @overload + def derwin(self, begin_y: int, begin_x: int) -> _CursesWindow: ... + @overload + def derwin(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> _CursesWindow: ... + def echochar(self, ch: _chtype, attr: int = ...) -> None: ... + def enclose(self, y: int, x: int) -> bool: ... + def erase(self) -> None: ... + def getbegyx(self) -> Tuple[int, int]: ... + def getbkgd(self) -> Tuple[int, int]: ... + @overload + def getch(self) -> int: ... + @overload + def getch(self, y: int, x: int) -> int: ... + if sys.version_info >= (3, 3): + @overload + def get_wch(self) -> Union[int, str]: ... + @overload + def get_wch(self, y: int, x: int) -> Union[int, str]: ... + @overload + def getkey(self) -> str: ... + @overload + def getkey(self, y: int, x: int) -> str: ... + def getmaxyx(self) -> Tuple[int, int]: ... + def getparyx(self) -> Tuple[int, int]: ... + @overload + def getstr(self) -> _chtype: ... + @overload + def getstr(self, n: int) -> _chtype: ... + @overload + def getstr(self, y: int, x: int) -> _chtype: ... + @overload + def getstr(self, y: int, x: int, n: int) -> _chtype: ... + def getyx(self) -> Tuple[int, int]: ... + @overload + def hline(self, ch: _chtype, n: int) -> None: ... + @overload + def hline(self, y: int, x: int, ch: _chtype, n: int) -> None: ... + def idcok(self, flag: bool) -> None: ... + def idlok(self, yes: bool) -> None: ... + def immedok(self, flag: bool) -> None: ... + @overload + def inch(self) -> _chtype: ... + @overload + def inch(self, y: int, x: int) -> _chtype: ... + @overload + def insch(self, ch: _chtype, attr: int = ...) -> None: ... + @overload + def insch(self, y: int, x: int, ch: _chtype, attr: int = ...) -> None: ... + def insdelln(self, nlines: int) -> None: ... + def insertln(self) -> None: ... + @overload + def insnstr(self, str: str, n: int, attr: int = ...) -> None: ... + @overload + def insnstr(self, y: int, x: int, str: str, n: int, attr: int = ...) -> None: ... + @overload + def insstr(self, str: str, attr: int = ...) -> None: ... + @overload + def insstr(self, y: int, x: int, str: str, attr: int = ...) -> None: ... + @overload + def instr(self, n: int = ...) -> _chtype: ... + @overload + def instr(self, y: int, x: int, n: int = ...) -> _chtype: ... + def is_linetouched(self, line: int) -> bool: ... + def is_wintouched(self) -> bool: ... + def keypad(self, yes: bool) -> None: ... + def leaveok(self, yes: bool) -> None: ... + def move(self, new_y: int, new_x: int) -> None: ... + def mvderwin(self, y: int, x: int) -> None: ... + def mvwin(self, new_y: int, new_x: int) -> None: ... + def nodelay(self, yes: bool) -> None: ... + def notimeout(self, yes: bool) -> None: ... + def noutrefresh(self) -> None: ... + @overload + def overlay(self, destwin: _CursesWindow) -> None: ... + @overload + def overlay(self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int) -> None: ... + @overload + def overwrite(self, destwin: _CursesWindow) -> None: ... + @overload + def overwrite(self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int) -> None: ... + def putwin(self, file: IO[Any]) -> None: ... + def redrawln(self, beg: int, num: int) -> None: ... + def redrawwin(self) -> None: ... + @overload + def refresh(self) -> None: ... + @overload + def refresh(self, pminrow: int, pmincol: int, sminrow: int, smincol: int, smaxrow: int, smaxcol: int) -> None: ... + def resize(self, nlines: int, ncols: int) -> None: ... + def scroll(self, lines: int = ...) -> None: ... + def scrollok(self, flag: bool) -> None: ... + def setscrreg(self, top: int, bottom: int) -> None: ... + def standend(self) -> None: ... + def standout(self) -> None: ... + @overload + def subpad(self, begin_y: int, begin_x: int) -> _CursesWindow: ... + @overload + def subpad(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> _CursesWindow: ... + @overload + def subwin(self, begin_y: int, begin_x: int) -> _CursesWindow: ... + @overload + def subwin(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> _CursesWindow: ... + def syncdown(self) -> None: ... + def syncok(self, flag: bool) -> None: ... + def syncup(self) -> None: ... + def timeout(self, delay: int) -> None: ... + def touchline(self, start: int, count: int, changed: bool = ...) -> None: ... + def touchwin(self) -> None: ... + def untouchwin(self) -> None: ... + @overload + def vline(self, ch: _chtype, n: int) -> None: ... + @overload + def vline(self, y: int, x: int, ch: _chtype, n: int) -> None: ... + +if sys.version_info >= (3, 8): + class _ncurses_version(NamedTuple): + major: int + minor: int + patch: int + ncurses_version: _ncurses_version diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_heapq.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_heapq.pyi new file mode 100644 index 00000000..2fc4e048 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_heapq.pyi @@ -0,0 +1,15 @@ +"""Stub file for the '_heapq' module.""" + +from typing import TypeVar, List, Iterable, Any, Callable, Optional +import sys + +_T = TypeVar("_T") + +def heapify(heap: List[_T]) -> None: ... +def heappop(heap: List[_T]) -> _T: ... +def heappush(heap: List[_T], item: _T) -> None: ... +def heappushpop(heap: List[_T], item: _T) -> _T: ... +def heapreplace(heap: List[_T], item: _T) -> _T: ... +if sys.version_info < (3,): + def nlargest(n: int, iterable: Iterable[_T]) -> List[_T]: ... + def nsmallest(n: int, iterable: Iterable[_T]) -> List[_T]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_random.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_random.pyi new file mode 100644 index 00000000..a37149da --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_random.pyi @@ -0,0 +1,17 @@ +# Stubs for _random + +import sys +from typing import Tuple + +# Actually Tuple[(int,) * 625] +_State = Tuple[int, ...] + +class Random(object): + def __init__(self, seed: object = ...) -> None: ... + def seed(self, x: object = ...) -> None: ... + def getstate(self) -> _State: ... + def setstate(self, state: _State) -> None: ... + def random(self) -> float: ... + def getrandbits(self, k: int) -> int: ... + if sys.version_info < (3,): + def jumpahead(self, i: int) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_warnings.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_warnings.pyi new file mode 100644 index 00000000..f764f7c7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_warnings.pyi @@ -0,0 +1,34 @@ +import sys +from typing import Any, Dict, List, Optional, Tuple, Type, Union, overload + +if sys.version_info >= (3, 0): + _defaultaction: str + _onceregistry: Dict[Any, Any] +else: + default_action: str + once_registry: Dict[Any, Any] +filters: List[Tuple[Any, ...]] +@overload +def warn(message: str, category: Optional[Type[Warning]] = ..., stacklevel: int = ...) -> None: ... +@overload +def warn(message: Warning, category: Any = ..., stacklevel: int = ...) -> None: ... +@overload +def warn_explicit( + message: str, + category: Type[Warning], + filename: str, + lineno: int, + module: Optional[str] = ..., + registry: Optional[Dict[Union[str, Tuple[str, Type[Warning], int]], int]] = ..., + module_globals: Optional[Dict[str, Any]] = ..., +) -> None: ... +@overload +def warn_explicit( + message: Warning, + category: Any, + filename: str, + lineno: int, + module: Optional[str] = ..., + registry: Optional[Dict[Union[str, Tuple[str, Type[Warning], int]], int]] = ..., + module_globals: Optional[Dict[str, Any]] = ..., +) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_weakref.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_weakref.pyi new file mode 100644 index 00000000..6a527c18 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_weakref.pyi @@ -0,0 +1,28 @@ +import sys +from typing import Any, Callable, Generic, Optional, TypeVar, overload + +_C = TypeVar('_C', bound=Callable[..., Any]) +_T = TypeVar('_T') + +class CallableProxyType(object): # "weakcallableproxy" + def __getattr__(self, attr: str) -> Any: ... + +class ProxyType(object): # "weakproxy" + def __getattr__(self, attr: str) -> Any: ... + +class ReferenceType(Generic[_T]): + if sys.version_info >= (3, 4): + __callback__: Callable[[ReferenceType[_T]], Any] + def __init__(self, o: _T, callback: Optional[Callable[[ReferenceType[_T]], Any]] = ...) -> None: ... + def __call__(self) -> Optional[_T]: ... + def __hash__(self) -> int: ... + +ref = ReferenceType + +def getweakrefcount(object: Any) -> int: ... +def getweakrefs(object: Any) -> int: ... +@overload +def proxy(object: _C, callback: Optional[Callable[[_C], Any]] = ...) -> CallableProxyType: ... +# Return CallableProxyType if object is callable, ProxyType otherwise +@overload +def proxy(object: _T, callback: Optional[Callable[[_T], Any]] = ...) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_weakrefset.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_weakrefset.pyi new file mode 100644 index 00000000..f7dc56ec --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/_weakrefset.pyi @@ -0,0 +1,43 @@ +from typing import Iterator, Any, Iterable, MutableSet, Optional, TypeVar, Generic, Union + +_S = TypeVar('_S') +_T = TypeVar('_T') +_SelfT = TypeVar('_SelfT', bound=WeakSet[Any]) + +class WeakSet(MutableSet[_T], Generic[_T]): + def __init__(self, data: Optional[Iterable[_T]] = ...) -> None: ... + + def add(self, item: _T) -> None: ... + def clear(self) -> None: ... + def discard(self, item: _T) -> None: ... + def copy(self: _SelfT) -> _SelfT: ... + def pop(self) -> _T: ... + def remove(self, item: _T) -> None: ... + def update(self, other: Iterable[_T]) -> None: ... + def __contains__(self, item: object) -> bool: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T]: ... + + def __ior__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... + def difference(self: _SelfT, other: Iterable[_T]) -> _SelfT: ... + def __sub__(self: _SelfT, other: Iterable[_T]) -> _SelfT: ... + def difference_update(self: _SelfT, other: Iterable[_T]) -> None: ... + def __isub__(self: _SelfT, other: Iterable[_T]) -> _SelfT: ... + def intersection(self: _SelfT, other: Iterable[_T]) -> _SelfT: ... + def __and__(self: _SelfT, other: Iterable[_T]) -> _SelfT: ... + def intersection_update(self, other: Iterable[_T]) -> None: ... + def __iand__(self: _SelfT, other: Iterable[_T]) -> _SelfT: ... + def issubset(self, other: Iterable[_T]) -> bool: ... + def __le__(self, other: Iterable[_T]) -> bool: ... + def __lt__(self, other: Iterable[_T]) -> bool: ... + def issuperset(self, other: Iterable[_T]) -> bool: ... + def __ge__(self, other: Iterable[_T]) -> bool: ... + def __gt__(self, other: Iterable[_T]) -> bool: ... + def __eq__(self, other: object) -> bool: ... + def symmetric_difference(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... + def __xor__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... + def symmetric_difference_update(self, other: Iterable[_S]) -> None: ... + def __ixor__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... + def union(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... + def __or__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ... + def isdisjoint(self, other: Iterable[_T]) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/aifc.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/aifc.pyi new file mode 100644 index 00000000..c2fd608d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/aifc.pyi @@ -0,0 +1,85 @@ +from typing import Union, IO, Optional, Type, NamedTuple, List, Tuple, Any, Text, overload +from typing_extensions import Literal +from types import TracebackType +import sys + +class Error(Exception): ... + +class _aifc_params(NamedTuple): + nchannels: int + sampwidth: int + framerate: int + nframes: int + comptype: bytes + compname: bytes + +_File = Union[Text, IO[bytes]] +_Marker = Tuple[int, int, bytes] + +class Aifc_read: + def __init__(self, f: _File) -> None: ... + if sys.version_info >= (3, 4): + def __enter__(self) -> Aifc_read: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> None: ... + def initfp(self, file: IO[bytes]) -> None: ... + def getfp(self) -> IO[bytes]: ... + def rewind(self) -> None: ... + def close(self) -> None: ... + def tell(self) -> int: ... + def getnchannels(self) -> int: ... + def getnframes(self) -> int: ... + def getsampwidth(self) -> int: ... + def getframerate(self) -> int: ... + def getcomptype(self) -> bytes: ... + def getcompname(self) -> bytes: ... + def getparams(self) -> _aifc_params: ... + def getmarkers(self) -> Optional[List[_Marker]]: ... + def getmark(self, id: int) -> _Marker: ... + def setpos(self, pos: int) -> None: ... + def readframes(self, nframes: int) -> bytes: ... + +class Aifc_write: + def __init__(self, f: _File) -> None: ... + def __del__(self) -> None: ... + if sys.version_info >= (3, 4): + def __enter__(self) -> Aifc_write: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> None: ... + def initfp(self, file: IO[bytes]) -> None: ... + def aiff(self) -> None: ... + def aifc(self) -> None: ... + def setnchannels(self, nchannels: int) -> None: ... + def getnchannels(self) -> int: ... + def setsampwidth(self, sampwidth: int) -> None: ... + def getsampwidth(self) -> int: ... + def setframerate(self, framerate: int) -> None: ... + def getframerate(self) -> int: ... + def setnframes(self, nframes: int) -> None: ... + def getnframes(self) -> int: ... + def setcomptype(self, comptype: bytes, compname: bytes) -> None: ... + def getcomptype(self) -> bytes: ... + def getcompname(self) -> bytes: ... + def setparams(self, params: Tuple[int, int, int, int, bytes, bytes]) -> None: ... + def getparams(self) -> _aifc_params: ... + def setmark(self, id: int, pos: int, name: bytes) -> None: ... + def getmark(self, id: int) -> _Marker: ... + def getmarkers(self) -> Optional[List[_Marker]]: ... + def tell(self) -> int: ... + def writeframesraw(self, data: Any) -> None: ... # Actual type for data is Buffer Protocol + def writeframes(self, data: Any) -> None: ... + def close(self) -> None: ... + +@overload +def open(f: _File, mode: Literal["r", "rb"] = ...) -> Aifc_read: ... +@overload +def open(f: _File, mode: Literal["w", "wb"]) -> Aifc_write: ... +@overload +def open(f: _File, mode: str) -> Any: ... + +@overload +def openfp(f: _File, mode: Literal["r", "rb"] = ...) -> Aifc_read: ... +@overload +def openfp(f: _File, mode: Literal["w", "wb"]) -> Aifc_write: ... +@overload +def openfp(f: _File, mode: str) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/argparse.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/argparse.pyi new file mode 100644 index 00000000..2c33cac7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/argparse.pyi @@ -0,0 +1,402 @@ +from typing import ( + Any, Callable, Dict, Generator, Iterable, List, IO, NoReturn, Optional, + Pattern, Sequence, Text, Tuple, Type, Union, TypeVar, overload +) +import sys + +_T = TypeVar('_T') +_ActionT = TypeVar('_ActionT', bound=Action) +_N = TypeVar('_N') + +if sys.version_info >= (3,): + _Text = str +else: + _Text = Union[str, unicode] + +ONE_OR_MORE: str +OPTIONAL: str +PARSER: str +REMAINDER: str +SUPPRESS: str +ZERO_OR_MORE: str +_UNRECOGNIZED_ARGS_ATTR: str # undocumented + +class ArgumentError(Exception): ... + +# undocumented +class _AttributeHolder: + def _get_kwargs(self) -> List[Tuple[str, Any]]: ... + def _get_args(self) -> List[Any]: ... + +# undocumented +class _ActionsContainer: + description: Optional[_Text] + prefix_chars: _Text + argument_default: Optional[_Text] + conflict_handler: _Text + + _registries: Dict[_Text, Dict[Any, Any]] + _actions: List[Action] + _option_string_actions: Dict[_Text, Action] + _action_groups: List[_ArgumentGroup] + _mutually_exclusive_groups: List[_MutuallyExclusiveGroup] + _defaults: Dict[str, Any] + _negative_number_matcher: Pattern[str] + _has_negative_number_optionals: List[bool] + + def __init__(self, description: Optional[Text], prefix_chars: Text, + argument_default: Optional[Text], conflict_handler: Text) -> None: ... + def register(self, registry_name: Text, value: Any, object: Any) -> None: ... + def _registry_get(self, registry_name: Text, value: Any, default: Any = ...) -> Any: ... + def set_defaults(self, **kwargs: Any) -> None: ... + def get_default(self, dest: Text) -> Any: ... + def add_argument(self, + *name_or_flags: Text, + action: Union[Text, Type[Action]] = ..., + nargs: Union[int, Text] = ..., + const: Any = ..., + default: Any = ..., + type: Union[Callable[[Text], _T], Callable[[str], _T], FileType] = ..., + choices: Iterable[_T] = ..., + required: bool = ..., + help: Optional[Text] = ..., + metavar: Optional[Union[Text, Tuple[Text, ...]]] = ..., + dest: Optional[Text] = ..., + version: Text = ..., + **kwargs: Any) -> Action: ... + def add_argument_group(self, *args: Any, **kwargs: Any) -> _ArgumentGroup: ... + def add_mutually_exclusive_group(self, **kwargs: Any) -> _MutuallyExclusiveGroup: ... + def _add_action(self, action: _ActionT) -> _ActionT: ... + def _remove_action(self, action: Action) -> None: ... + def _add_container_actions(self, container: _ActionsContainer) -> None: ... + def _get_positional_kwargs(self, dest: Text, **kwargs: Any) -> Dict[str, Any]: ... + def _get_optional_kwargs(self, *args: Any, **kwargs: Any) -> Dict[str, Any]: ... + def _pop_action_class(self, kwargs: Any, default: Optional[Type[Action]] = ...) -> Type[Action]: ... + def _get_handler(self) -> Callable[[Action, Iterable[Tuple[Text, Action]]], Any]: ... + def _check_conflict(self, action: Action) -> None: ... + def _handle_conflict_error(self, action: Action, conflicting_actions: Iterable[Tuple[Text, Action]]) -> NoReturn: ... + def _handle_conflict_resolve(self, action: Action, conflicting_actions: Iterable[Tuple[Text, Action]]) -> None: ... + +class ArgumentParser(_AttributeHolder, _ActionsContainer): + prog: _Text + usage: Optional[_Text] + epilog: Optional[_Text] + formatter_class: Type[HelpFormatter] + fromfile_prefix_chars: Optional[_Text] + add_help: bool + + if sys.version_info >= (3, 5): + allow_abbrev: bool + + # undocumented + _positionals: _ArgumentGroup + _optionals: _ArgumentGroup + _subparsers: Optional[_ArgumentGroup] + + if sys.version_info >= (3, 5): + def __init__(self, + prog: Optional[str] = ..., + usage: Optional[str] = ..., + description: Optional[str] = ..., + epilog: Optional[str] = ..., + parents: Sequence[ArgumentParser] = ..., + formatter_class: Type[HelpFormatter] = ..., + prefix_chars: str = ..., + fromfile_prefix_chars: Optional[str] = ..., + argument_default: Optional[str] = ..., + conflict_handler: str = ..., + add_help: bool = ..., + allow_abbrev: bool = ...) -> None: ... + else: + def __init__(self, + prog: Optional[Text] = ..., + usage: Optional[Text] = ..., + description: Optional[Text] = ..., + epilog: Optional[Text] = ..., + parents: Sequence[ArgumentParser] = ..., + formatter_class: Type[HelpFormatter] = ..., + prefix_chars: Text = ..., + fromfile_prefix_chars: Optional[Text] = ..., + argument_default: Optional[Text] = ..., + conflict_handler: Text = ..., + add_help: bool = ...) -> None: ... + + # The type-ignores in these overloads should be temporary. See: + # https://github.com/python/typeshed/pull/2643#issuecomment-442280277 + @overload + def parse_args(self, args: Optional[Sequence[Text]] = ...) -> Namespace: ... + @overload + def parse_args(self, args: Optional[Sequence[Text]], namespace: None) -> Namespace: ... # type: ignore + @overload + def parse_args(self, args: Optional[Sequence[Text]], namespace: _N) -> _N: ... + @overload + def parse_args(self, *, namespace: None) -> Namespace: ... # type: ignore + @overload + def parse_args(self, *, namespace: _N) -> _N: ... + + if sys.version_info >= (3, 7): + def add_subparsers(self, title: str = ..., + description: Optional[str] = ..., + prog: str = ..., + parser_class: Type[ArgumentParser] = ..., + action: Type[Action] = ..., + option_string: str = ..., + dest: Optional[str] = ..., + required: bool = ..., + help: Optional[str] = ..., + metavar: Optional[str] = ...) -> _SubParsersAction: ... + else: + def add_subparsers(self, title: Text = ..., + description: Optional[Text] = ..., + prog: Text = ..., + parser_class: Type[ArgumentParser] = ..., + action: Type[Action] = ..., + option_string: Text = ..., + dest: Optional[Text] = ..., + help: Optional[Text] = ..., + metavar: Optional[Text] = ...) -> _SubParsersAction: ... + + def print_usage(self, file: Optional[IO[str]] = ...) -> None: ... + def print_help(self, file: Optional[IO[str]] = ...) -> None: ... + def format_usage(self) -> str: ... + def format_help(self) -> str: ... + def parse_known_args(self, args: Optional[Sequence[Text]] = ..., + namespace: Optional[Namespace] = ...) -> Tuple[Namespace, List[str]]: ... + def convert_arg_line_to_args(self, arg_line: Text) -> List[str]: ... + def exit(self, status: int = ..., message: Optional[Text] = ...) -> NoReturn: ... + def error(self, message: Text) -> NoReturn: ... + if sys.version_info >= (3, 7): + def parse_intermixed_args(self, args: Optional[Sequence[str]] = ..., + namespace: Optional[Namespace] = ...) -> Namespace: ... + def parse_known_intermixed_args(self, + args: Optional[Sequence[str]] = ..., + namespace: Optional[Namespace] = ...) -> Tuple[Namespace, List[str]]: ... + # undocumented + def _get_optional_actions(self) -> List[Action]: ... + def _get_positional_actions(self) -> List[Action]: ... + def _parse_known_args(self, arg_strings: List[Text], namespace: Namespace) -> Tuple[Namespace, List[str]]: ... + def _read_args_from_files(self, arg_strings: List[Text]) -> List[Text]: ... + def _match_argument(self, action: Action, arg_strings_pattern: Text) -> int: ... + def _match_arguments_partial(self, actions: Sequence[Action], arg_strings_pattern: Text) -> List[int]: ... + def _parse_optional(self, arg_string: Text) -> Optional[Tuple[Optional[Action], Text, Optional[Text]]]: ... + def _get_option_tuples(self, option_string: Text) -> List[Tuple[Action, Text, Optional[Text]]]: ... + def _get_nargs_pattern(self, action: Action) -> _Text: ... + def _get_values(self, action: Action, arg_strings: List[Text]) -> Any: ... + def _get_value(self, action: Action, arg_string: Text) -> Any: ... + def _check_value(self, action: Action, value: Any) -> None: ... + def _get_formatter(self) -> HelpFormatter: ... + def _print_message(self, message: str, file: Optional[IO[str]] = ...) -> None: ... + +class HelpFormatter: + # undocumented + _prog: _Text + _indent_increment: int + _max_help_position: int + _width: int + _current_indent: int + _level: int + _action_max_length: int + _root_section: Any + _current_section: Any + _whitespace_matcher: Pattern[str] + _long_break_matcher: Pattern[str] + _Section: Type[Any] # Nested class + def __init__(self, prog: Text, indent_increment: int = ..., + max_help_position: int = ..., + width: Optional[int] = ...) -> None: ... + def _indent(self) -> None: ... + def _dedent(self) -> None: ... + def _add_item(self, func: Callable[..., _Text], args: Iterable[Any]) -> None: ... + def start_section(self, heading: Optional[Text]) -> None: ... + def end_section(self) -> None: ... + def add_text(self, text: Optional[Text]) -> None: ... + def add_usage(self, usage: Text, actions: Iterable[Action], groups: Iterable[_ArgumentGroup], prefix: Optional[Text] = ...) -> None: ... + def add_argument(self, action: Action) -> None: ... + def add_arguments(self, actions: Iterable[Action]) -> None: ... + def format_help(self) -> _Text: ... + def _join_parts(self, part_strings: Iterable[Text]) -> _Text: ... + def _format_usage(self, usage: Text, actions: Iterable[Action], groups: Iterable[_ArgumentGroup], prefix: Optional[Text]) -> _Text: ... + def _format_actions_usage(self, actions: Iterable[Action], groups: Iterable[_ArgumentGroup]) -> _Text: ... + def _format_text(self, text: Text) -> _Text: ... + def _format_action(self, action: Action) -> _Text: ... + def _format_action_invocation(self, action: Action) -> _Text: ... + def _metavar_formatter(self, action: Action, default_metavar: Text) -> Callable[[int], Tuple[_Text, ...]]: ... + def _format_args(self, action: Action, default_metavar: Text) -> _Text: ... + def _expand_help(self, action: Action) -> _Text: ... + def _iter_indented_subactions(self, action: Action) -> Generator[Action, None, None]: ... + def _split_lines(self, text: Text, width: int) -> List[_Text]: ... + def _fill_text(self, text: Text, width: int, indent: Text) -> _Text: ... + def _get_help_string(self, action: Action) -> Optional[_Text]: ... + def _get_default_metavar_for_optional(self, action: Action) -> _Text: ... + def _get_default_metavar_for_positional(self, action: Action) -> _Text: ... + +class RawDescriptionHelpFormatter(HelpFormatter): ... +class RawTextHelpFormatter(HelpFormatter): ... +class ArgumentDefaultsHelpFormatter(HelpFormatter): ... +if sys.version_info >= (3,): + class MetavarTypeHelpFormatter(HelpFormatter): ... + +class Action(_AttributeHolder): + option_strings: Sequence[_Text] + dest: _Text + nargs: Optional[Union[int, _Text]] + const: Any + default: Any + type: Union[Callable[[str], Any], FileType, None] + choices: Optional[Iterable[Any]] + required: bool + help: Optional[_Text] + metavar: Optional[Union[_Text, Tuple[_Text, ...]]] + + def __init__(self, + option_strings: Sequence[Text], + dest: Text, + nargs: Optional[Union[int, Text]] = ..., + const: Any = ..., + default: Any = ..., + type: Optional[Union[Callable[[Text], _T], Callable[[str], _T], FileType]] = ..., + choices: Optional[Iterable[_T]] = ..., + required: bool = ..., + help: Optional[Text] = ..., + metavar: Optional[Union[Text, Tuple[Text, ...]]] = ...) -> None: ... + def __call__(self, parser: ArgumentParser, namespace: Namespace, + values: Union[Text, Sequence[Any], None], + option_string: Optional[Text] = ...) -> None: ... + +class Namespace(_AttributeHolder): + def __init__(self, **kwargs: Any) -> None: ... + def __getattr__(self, name: Text) -> Any: ... + def __setattr__(self, name: Text, value: Any) -> None: ... + def __contains__(self, key: str) -> bool: ... + +class FileType: + # undocumented + _mode: _Text + _bufsize: int + if sys.version_info >= (3,): + _encoding: Optional[str] + _errors: Optional[str] + def __init__(self, mode: str = ..., bufsize: int = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ...) -> None: ... + else: + def __init__(self, + mode: Text = ..., bufsize: Optional[int] = ...) -> None: ... + def __call__(self, string: Text) -> IO[Any]: ... + +# undocumented +class _ArgumentGroup(_ActionsContainer): + title: Optional[_Text] + _group_actions: List[Action] + def __init__(self, container: _ActionsContainer, + title: Optional[Text] = ..., + description: Optional[Text] = ..., **kwargs: Any) -> None: ... + +# undocumented +class _MutuallyExclusiveGroup(_ArgumentGroup): + required: bool + _container: _ActionsContainer + def __init__(self, container: _ActionsContainer, required: bool = ...) -> None: ... + +# undocumented +class _StoreAction(Action): ... + +# undocumented +class _StoreConstAction(Action): + def __init__(self, + option_strings: Sequence[Text], + dest: Text, + const: Any, + default: Any = ..., + required: bool = ..., + help: Optional[Text] = ..., + metavar: Optional[Union[Text, Tuple[Text, ...]]] = ...) -> None: ... + +# undocumented +class _StoreTrueAction(_StoreConstAction): + def __init__(self, + option_strings: Sequence[Text], + dest: Text, + default: bool = ..., + required: bool = ..., + help: Optional[Text] = ...) -> None: ... + +# undocumented +class _StoreFalseAction(_StoreConstAction): + def __init__(self, + option_strings: Sequence[Text], + dest: Text, + default: bool = ..., + required: bool = ..., + help: Optional[Text] = ...) -> None: ... + +# undocumented +class _AppendAction(Action): ... + +# undocumented +class _AppendConstAction(Action): + def __init__(self, + option_strings: Sequence[Text], + dest: Text, + const: Any, + default: Any = ..., + required: bool = ..., + help: Optional[Text] = ..., + metavar: Optional[Union[Text, Tuple[Text, ...]]] = ...) -> None: ... + +# undocumented +class _CountAction(Action): + def __init__(self, + option_strings: Sequence[Text], + dest: Text, + default: Any = ..., + required: bool = ..., + help: Optional[Text] = ...) -> None: ... + +# undocumented +class _HelpAction(Action): + def __init__(self, + option_strings: Sequence[Text], + dest: Text = ..., + default: Text = ..., + help: Optional[Text] = ...) -> None: ... + +# undocumented +class _VersionAction(Action): + version: Optional[_Text] + def __init__(self, + option_strings: Sequence[Text], + version: Optional[Text] = ..., + dest: Text = ..., + default: Text = ..., + help: Text = ...) -> None: ... + +# undocumented +class _SubParsersAction(Action): + _ChoicesPseudoAction: Type[Any] # nested class + _prog_prefix: _Text + _parser_class: Type[ArgumentParser] + _name_parser_map: Dict[_Text, ArgumentParser] + choices: Dict[_Text, ArgumentParser] + _choices_actions: List[Action] + def __init__(self, + option_strings: Sequence[Text], + prog: Text, + parser_class: Type[ArgumentParser], + dest: Text = ..., + required: bool = ..., + help: Optional[Text] = ..., + metavar: Optional[Union[Text, Tuple[Text, ...]]] = ...) -> None: ... + # TODO: Type keyword args properly. + def add_parser(self, name: Text, **kwargs: Any) -> ArgumentParser: ... + def _get_subactions(self) -> List[Action]: ... + +# undocumented +class ArgumentTypeError(Exception): ... + +if sys.version_info < (3, 7): + # undocumented + def _ensure_value(namespace: Namespace, name: Text, value: Any) -> Any: ... + +# undocumented +def _get_action_name(argument: Optional[Action]) -> Optional[str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/array.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/array.pyi new file mode 100644 index 00000000..01c6f994 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/array.pyi @@ -0,0 +1,73 @@ +# Stubs for array + +# Based on http://docs.python.org/3.6/library/array.html + +import sys +from typing import (Any, BinaryIO, Generic, Iterable, Iterator, List, MutableSequence, + overload, Text, Tuple, TypeVar, Union) + +_T = TypeVar('_T', int, float, Text) + +if sys.version_info >= (3,): + typecodes: str + +class array(MutableSequence[_T], Generic[_T]): + typecode: str + itemsize: int + def __init__(self, typecode: str, + __initializer: Union[bytes, Iterable[_T]] = ...) -> None: ... + def append(self, x: _T) -> None: ... + def buffer_info(self) -> Tuple[int, int]: ... + def byteswap(self) -> None: ... + def count(self, x: Any) -> int: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + if sys.version_info >= (3, 2): + def frombytes(self, s: bytes) -> None: ... + def fromfile(self, f: BinaryIO, n: int) -> None: ... + def fromlist(self, list: List[_T]) -> None: ... + def fromstring(self, s: bytes) -> None: ... + def fromunicode(self, s: str) -> None: ... + def index(self, x: _T) -> int: ... # type: ignore # Overrides Sequence + def insert(self, i: int, x: _T) -> None: ... + def pop(self, i: int = ...) -> _T: ... + if sys.version_info < (3,): + def read(self, f: BinaryIO, n: int) -> None: ... + def remove(self, x: Any) -> None: ... + def reverse(self) -> None: ... + if sys.version_info >= (3, 2): + def tobytes(self) -> bytes: ... + def tofile(self, f: BinaryIO) -> None: ... + def tolist(self) -> List[_T]: ... + def tostring(self) -> bytes: ... + def tounicode(self) -> str: ... + if sys.version_info < (3,): + def write(self, f: BinaryIO) -> None: ... + + def __len__(self) -> int: ... + + @overload + def __getitem__(self, i: int) -> _T: ... + @overload + def __getitem__(self, s: slice) -> array[_T]: ... + + @overload # type: ignore # Overrides MutableSequence + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + def __setitem__(self, s: slice, o: array[_T]) -> None: ... + + def __delitem__(self, i: Union[int, slice]) -> None: ... + def __add__(self, x: array[_T]) -> array[_T]: ... + def __ge__(self, other: array[_T]) -> bool: ... + def __gt__(self, other: array[_T]) -> bool: ... + def __iadd__(self, x: array[_T]) -> array[_T]: ... # type: ignore # Overrides MutableSequence + def __imul__(self, n: int) -> array[_T]: ... + def __le__(self, other: array[_T]) -> bool: ... + def __lt__(self, other: array[_T]) -> bool: ... + def __mul__(self, n: int) -> array[_T]: ... + def __rmul__(self, n: int) -> array[_T]: ... + if sys.version_info < (3,): + def __delslice__(self, i: int, j: int) -> None: ... + def __getslice__(self, i: int, j: int) -> array[_T]: ... + def __setslice__(self, i: int, j: int, y: array[_T]) -> None: ... + +ArrayType = array diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/asynchat.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/asynchat.pyi new file mode 100644 index 00000000..a359ae7d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/asynchat.pyi @@ -0,0 +1,41 @@ +from abc import abstractmethod +import asyncore +import socket +import sys +from typing import Optional, Sequence, Tuple, Union + + +class simple_producer: + def __init__(self, data: bytes, buffer_size: int = ...) -> None: ... + def more(self) -> bytes: ... + +class async_chat(asyncore.dispatcher): + ac_in_buffer_size: int + ac_out_buffer_size: int + def __init__(self, sock: Optional[socket.socket] = ..., map: Optional[asyncore._maptype] = ...) -> None: ... + + @abstractmethod + def collect_incoming_data(self, data: bytes) -> None: ... + @abstractmethod + def found_terminator(self) -> None: ... + def set_terminator(self, term: Union[bytes, int, None]) -> None: ... + def get_terminator(self) -> Union[bytes, int, None]: ... + def handle_read(self) -> None: ... + def handle_write(self) -> None: ... + def handle_close(self) -> None: ... + def push(self, data: bytes) -> None: ... + def push_with_producer(self, producer: simple_producer) -> None: ... + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def close_when_done(self) -> None: ... + def initiate_send(self) -> None: ... + def discard_buffers(self) -> None: ... + +if sys.version_info < (3, 0): + class fifo: + def __init__(self, list: Sequence[Union[bytes, simple_producer]] = ...) -> None: ... + def __len__(self) -> int: ... + def is_empty(self) -> bool: ... + def first(self) -> bytes: ... + def push(self, data: Union[bytes, simple_producer]) -> None: ... + def pop(self) -> Tuple[int, bytes]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/asyncore.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/asyncore.pyi new file mode 100644 index 00000000..9d0a2c60 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/asyncore.pyi @@ -0,0 +1,145 @@ +from typing import Tuple, Union, Optional, Any, Dict, overload + +import os +import select +import sys +import time +import warnings +from socket import SocketType +from typing import Optional + +from errno import (EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL, + ENOTCONN, ESHUTDOWN, EINTR, EISCONN, EBADF, ECONNABORTED, + EPIPE, EAGAIN, errorcode) + +# cyclic dependence with asynchat +_maptype = Dict[int, Any] + +socket_map: _maptype = ... # Undocumented + +class ExitNow(Exception): ... + +def read(obj: Any) -> None: ... +def write(obj: Any) -> None: ... +def readwrite(obj: Any, flags: int) -> None: ... +def poll(timeout: float = ..., map: _maptype = ...) -> None: ... +def poll2(timeout: float = ..., map: _maptype = ...) -> None: ... + +poll3 = poll2 + +def loop(timeout: float = ..., use_poll: bool = ..., map: _maptype = ..., count: Optional[int] = ...) -> None: ... + + +# Not really subclass of socket.socket; it's only delegation. +# It is not covariant to it. +class dispatcher: + + debug: bool + connected: bool + accepting: bool + connecting: bool + closing: bool + ignore_log_types: frozenset[str] + socket: Optional[SocketType] + + def __init__(self, sock: Optional[SocketType] = ..., map: _maptype = ...) -> None: ... + def add_channel(self, map: _maptype = ...) -> None: ... + def del_channel(self, map: _maptype = ...) -> None: ... + def create_socket(self, family: int, type: int) -> None: ... + def set_socket(self, sock: SocketType, map: _maptype = ...) -> None: ... + def set_reuse_addr(self) -> None: ... + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def listen(self, backlog: int) -> None: ... + def bind(self, address: Union[Tuple[Any, ...], str]) -> None: ... + def connect(self, address: Union[Tuple[Any, ...], str]) -> None: ... + def accept(self) -> Optional[Tuple[SocketType, Any]]: ... + def send(self, data: bytes) -> int: ... + def recv(self, buffer_size: int) -> bytes: ... + def close(self) -> None: ... + + def log(self, message: Any) -> None: ... + def log_info(self, message: Any, type: str = ...) -> None: ... + def handle_read_event(self) -> None: ... + def handle_connect_event(self) -> None: ... + def handle_write_event(self) -> None: ... + def handle_expt_event(self) -> None: ... + def handle_error(self) -> None: ... + def handle_expt(self) -> None: ... + def handle_read(self) -> None: ... + def handle_write(self) -> None: ... + def handle_connect(self) -> None: ... + def handle_accept(self) -> None: ... + def handle_close(self) -> None: ... + + if sys.version_info < (3, 5): + # Historically, some methods were "imported" from `self.socket` by + # means of `__getattr__`. This was long deprecated, and as of Python + # 3.5 has been removed; simply call the relevant methods directly on + # self.socket if necessary. + + def detach(self) -> int: ... + def fileno(self) -> int: ... + + # return value is an address + def getpeername(self) -> Any: ... + def getsockname(self) -> Any: ... + + @overload + def getsockopt(self, level: int, optname: int) -> int: ... + @overload + def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... + + def gettimeout(self) -> float: ... + def ioctl(self, control: object, + option: Tuple[int, int, int]) -> None: ... + # TODO the return value may be BinaryIO or TextIO, depending on mode + def makefile(self, mode: str = ..., buffering: int = ..., + encoding: str = ..., errors: str = ..., + newline: str = ...) -> Any: + ... + + # return type is an address + def recvfrom(self, bufsize: int, flags: int = ...) -> Any: ... + def recvfrom_into(self, buffer: bytes, nbytes: int, flags: int = ...) -> Any: ... + def recv_into(self, buffer: bytes, nbytes: int, flags: int = ...) -> Any: ... + def sendall(self, data: bytes, flags: int = ...) -> None: ... + def sendto(self, data: bytes, address: Union[Tuple[str, int], str], flags: int = ...) -> int: ... + def setblocking(self, flag: bool) -> None: ... + def settimeout(self, value: Union[float, None]) -> None: ... + def setsockopt(self, level: int, optname: int, value: Union[int, bytes]) -> None: ... + def shutdown(self, how: int) -> None: ... + +class dispatcher_with_send(dispatcher): + def __init__(self, sock: SocketType = ..., map: _maptype = ...) -> None: ... + def initiate_send(self) -> None: ... + def handle_write(self) -> None: ... + # incompatible signature: + # def send(self, data: bytes) -> Optional[int]: ... + +def compact_traceback() -> Tuple[Tuple[str, str, str], type, type, str]: ... +def close_all(map: _maptype = ..., ignore_all: bool = ...) -> None: ... + +# if os.name == 'posix': +# import fcntl +class file_wrapper: + fd: int + + def __init__(self, fd: int) -> None: ... + def recv(self, bufsize: int, flags: int = ...) -> bytes: ... + def send(self, data: bytes, flags: int = ...) -> int: ... + + @overload + def getsockopt(self, level: int, optname: int) -> int: ... + @overload + def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... + + def read(self, bufsize: int, flags: int = ...) -> bytes: ... + def write(self, data: bytes, flags: int = ...) -> int: ... + + def close(self) -> None: ... + def fileno(self) -> int: ... + +class file_dispatcher(dispatcher): + def __init__(self, fd: int, map: _maptype = ...) -> None: ... + def set_file(self, fd: int) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/audioop.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/audioop.pyi new file mode 100644 index 00000000..0881dc43 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/audioop.pyi @@ -0,0 +1,42 @@ +from typing import Any, Optional, Tuple + +AdpcmState = Tuple[int, int] +RatecvState = Tuple[int, Tuple[Tuple[int, int], ...]] + +class error(Exception): ... + +def add(fragment1: bytes, fragment2: bytes, width: int) -> bytes: ... +def adpcm2lin(adpcmfragment: bytes, width: int, state: Optional[AdpcmState]) -> Tuple[bytes, AdpcmState]: ... +def alaw2lin(fragment: bytes, width: int) -> bytes: ... +def avg(fragment: bytes, width: int) -> int: ... +def avgpp(fragment: bytes, width: int) -> int: ... +def bias(fragment: bytes, width: int, bias: int) -> bytes: ... +def byteswap(fragment: bytes, width: int) -> bytes: ... +def cross(fragment: bytes, width: int) -> int: ... +def findfactor(fragment: bytes, reference: bytes) -> float: ... +def findfit(fragment: bytes, reference: bytes) -> Tuple[int, float]: ... +def findmax(fragment: bytes, length: int) -> int: ... +def getsample(fragment: bytes, width: int, index: int) -> int: ... +def lin2adpcm(fragment: bytes, width: int, state: Optional[AdpcmState]) -> Tuple[bytes, AdpcmState]: ... +def lin2alaw(fragment: bytes, width: int) -> bytes: ... +def lin2lin(fragment: bytes, width: int, newwidth: int) -> bytes: ... +def lin2ulaw(fragment: bytes, width: int) -> bytes: ... +def max(fragment: bytes, width: int) -> int: ... +def maxpp(fragment: bytes, width: int) -> int: ... +def minmax(fragment: bytes, width: int) -> Tuple[int, int]: ... +def mul(fragment: bytes, width: int, factor: float) -> bytes: ... +def ratecv( + fragment: bytes, + width: int, + nchannels: int, + inrate: int, + outrate: int, + state: Optional[RatecvState], + weightA: int = ..., + weightB: int = ..., +) -> Tuple[bytes, RatecvState]: ... +def reverse(fragment: bytes, width: int) -> bytes: ... +def rms(fragment: bytes, width: int) -> int: ... +def tomono(fragment: bytes, width: int, lfactor: float, rfactor: float) -> bytes: ... +def tostereo(fragment: bytes, width: int, lfactor: float, rfactor: float) -> bytes: ... +def ulaw2lin(fragment: bytes, width: int) -> bytes: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/base64.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/base64.pyi new file mode 100644 index 00000000..7c648c8b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/base64.pyi @@ -0,0 +1,38 @@ +# Stubs for base64 + +from typing import IO, Union, Text +import sys + +if sys.version_info < (3,): + _encodable = Union[bytes, unicode] + _decodable = Union[bytes, unicode] +else: + _encodable = bytes + _decodable = Union[bytes, str] + +def b64encode(s: _encodable, altchars: bytes = ...) -> bytes: ... +def b64decode(s: _decodable, altchars: bytes = ..., + validate: bool = ...) -> bytes: ... +def standard_b64encode(s: _encodable) -> bytes: ... +def standard_b64decode(s: _decodable) -> bytes: ... +def urlsafe_b64encode(s: _encodable) -> bytes: ... +def urlsafe_b64decode(s: _decodable) -> bytes: ... +def b32encode(s: _encodable) -> bytes: ... +def b32decode(s: _decodable, casefold: bool = ..., + map01: bytes = ...) -> bytes: ... +def b16encode(s: _encodable) -> bytes: ... +def b16decode(s: _decodable, casefold: bool = ...) -> bytes: ... +if sys.version_info >= (3, 4): + def a85encode(b: _encodable, *, foldspaces: bool = ..., wrapcol: int = ..., + pad: bool = ..., adobe: bool = ...) -> bytes: ... + def a85decode(b: _decodable, *, foldspaces: bool = ..., + adobe: bool = ..., ignorechars: Union[str, bytes] = ...) -> bytes: ... + def b85encode(b: _encodable, pad: bool = ...) -> bytes: ... + def b85decode(b: _decodable) -> bytes: ... + +def decode(input: IO[bytes], output: IO[bytes]) -> None: ... +def decodebytes(s: bytes) -> bytes: ... +def decodestring(s: bytes) -> bytes: ... +def encode(input: IO[bytes], output: IO[bytes]) -> None: ... +def encodebytes(s: bytes) -> bytes: ... +def encodestring(s: bytes) -> bytes: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/bdb.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/bdb.pyi new file mode 100644 index 00000000..18f46893 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/bdb.pyi @@ -0,0 +1,94 @@ + +from typing import Set, Dict, Iterable, Any, Callable, Tuple, Type, SupportsInt, List, Union, TypeVar, Optional, IO +from types import FrameType, TracebackType, CodeType + + +_T = TypeVar("_T") +_TraceDispatch = Callable[[FrameType, str, Any], Any] # TODO: Recursive type +_ExcInfo = Tuple[Type[BaseException], BaseException, FrameType] + +GENERATOR_AND_COROUTINE_FLAGS: int = ... + +class BdbQuit(Exception): ... + +class Bdb: + + skip: Optional[Set[str]] + breaks: Dict[str, List[int]] + fncache: Dict[str, str] + frame_returning: Optional[FrameType] + botframe: Optional[FrameType] + quitting: bool + stopframe: Optional[FrameType] + returnframe: Optional[FrameType] + stoplineno: int + + def __init__(self, skip: Iterable[str] = ...) -> None: ... + def canonic(self, filename: str) -> str: ... + def reset(self) -> None: ... + def trace_dispatch(self, frame: FrameType, event: str, arg: Any) -> _TraceDispatch: ... + def dispatch_line(self, frame: FrameType) -> _TraceDispatch: ... + def dispatch_call(self, frame: FrameType, arg: None) -> _TraceDispatch: ... + def dispatch_return(self, frame: FrameType, arg: Any) -> _TraceDispatch: ... + def dispatch_exception(self, frame: FrameType, arg: _ExcInfo) -> _TraceDispatch: ... + def is_skipped_module(self, module_name: str) -> bool: ... + def stop_here(self, frame: FrameType) -> bool: ... + def break_here(self, frame: FrameType) -> bool: ... + def do_clear(self, arg: Any) -> None: ... + def break_anywhere(self, frame: FrameType) -> bool: ... + def user_call(self, frame: FrameType, argument_list: None) -> None: ... + def user_line(self, frame: FrameType) -> None: ... + def user_return(self, frame: FrameType, return_value: Any) -> None: ... + def user_exception(self, frame: FrameType, exc_info: _ExcInfo) -> None: ... + def set_until(self, frame: FrameType, lineno: Optional[int] = ...) -> None: ... + def set_step(self) -> None: ... + def set_next(self, frame: FrameType) -> None: ... + def set_return(self, frame: FrameType) -> None: ... + def set_trace(self, frame: Optional[FrameType] = ...) -> None: ... + def set_continue(self) -> None: ... + def set_quit(self) -> None: ... + def set_break(self, filename: str, lineno: int, temporary: bool = ..., cond: Optional[str] = ..., funcname: Optional[str] = ...) -> None: ... + def clear_break(self, filename: str, lineno: int) -> None: ... + def clear_bpbynumber(self, arg: SupportsInt) -> None: ... + def clear_all_file_breaks(self, filename: str) -> None: ... + def clear_all_breaks(self) -> None: ... + def get_bpbynumber(self, arg: SupportsInt) -> Breakpoint: ... + def get_break(self, filename: str, lineno: int) -> bool: ... + def get_breaks(self, filename: str, lineno: int) -> List[Breakpoint]: ... + def get_file_breaks(self, filename: str) -> List[Breakpoint]: ... + def get_all_breaks(self) -> List[Breakpoint]: ... + def get_stack(self, f: FrameType, t: TracebackType) -> Tuple[List[Tuple[FrameType, int]], int]: ... + def format_stack_entry(self, frame_lineno: int, lprefix: str = ...) -> str: ... + def run(self, cmd: Union[str, CodeType], globals: Dict[str, Any] = ..., locals: Dict[str, Any] = ...) -> None: ... + def runeval(self, expr: str, globals: Dict[str, Any] = ..., locals: Dict[str, Any] = ...) -> None: ... + def runctx(self, cmd: Union[str, CodeType], globals: Dict[str, Any], locals: Dict[str, Any]) -> None: ... + def runcall(self, func: Callable[[Any], _T], *args: Any, **kwds: Any) -> Optional[_T]: ... + +class Breakpoint: + + next: int = ... + bplist: Dict[Tuple[str, int], List[Breakpoint]] = ... + bpbynumber: List[Optional[Breakpoint]] = ... + + funcname: Optional[str] + func_first_executable_line: Optional[int] + file: str + line: int + temporary: bool + cond: Optional[str] + enabled: bool + ignore: int + hits: int + number: int + + def __init__(self, file: str, line: int, temporary: bool = ..., cond: Optional[str] = ..., funcname: Optional[str] = ...) -> None: ... + def deleteMe(self) -> None: ... + def enable(self) -> None: ... + def disable(self) -> None: ... + def bpprint(self, out: Optional[IO[str]] = ...) -> None: ... + def bpformat(self) -> str: ... + def __str__(self) -> str: ... + +def checkfuncname(b: Breakpoint, frame: FrameType) -> bool: ... +def effective(file: str, line: int, frame: FrameType) -> Union[Tuple[Breakpoint, bool], Tuple[None, None]]: ... +def set_trace() -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/binascii.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/binascii.pyi new file mode 100644 index 00000000..d268a1b6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/binascii.pyi @@ -0,0 +1,42 @@ +# Stubs for binascii + +# Based on http://docs.python.org/3.2/library/binascii.html + +import sys +from typing import Union, Text + +if sys.version_info < (3,): + # Python 2 accepts unicode ascii pretty much everywhere. + _Bytes = Text + _Ascii = Text +else: + # But since Python 3.3 ASCII-only unicode strings are accepted by the + # a2b_* functions. + _Bytes = bytes + _Ascii = Union[bytes, str] + +def a2b_uu(string: _Ascii) -> bytes: ... +if sys.version_info >= (3, 7): + def b2a_uu(data: _Bytes, *, backtick: bool = ...) -> bytes: ... +else: + def b2a_uu(data: _Bytes) -> bytes: ... +def a2b_base64(string: _Ascii) -> bytes: ... +if sys.version_info >= (3, 6): + def b2a_base64(data: _Bytes, *, newline: bool = ...) -> bytes: ... +else: + def b2a_base64(data: _Bytes) -> bytes: ... +def a2b_qp(string: _Ascii, header: bool = ...) -> bytes: ... +def b2a_qp(data: _Bytes, quotetabs: bool = ..., istext: bool = ..., header: bool = ...) -> bytes: ... +def a2b_hqx(string: _Ascii) -> bytes: ... +def rledecode_hqx(data: _Bytes) -> bytes: ... +def rlecode_hqx(data: _Bytes) -> bytes: ... +def b2a_hqx(data: _Bytes) -> bytes: ... +def crc_hqx(data: _Bytes, crc: int) -> int: ... +def crc32(data: _Bytes, crc: int = ...) -> int: ... +def b2a_hex(data: _Bytes) -> bytes: ... +def hexlify(data: _Bytes) -> bytes: ... +def a2b_hex(hexstr: _Ascii) -> bytes: ... +def unhexlify(hexlify: _Ascii) -> bytes: ... + +class Error(Exception): ... +class Incomplete(Exception): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/binhex.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/binhex.pyi new file mode 100644 index 00000000..c759ba0b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/binhex.pyi @@ -0,0 +1,48 @@ +from typing import ( + Any, + IO, + Tuple, + Union, +) + + +class Error(Exception): ... + +REASONABLY_LARGE: int +LINELEN: int +RUNCHAR: bytes + +class FInfo: + def __init__(self) -> None: ... + Type: str + Creator: str + Flags: int + +_FileInfoTuple = Tuple[str, FInfo, int, int] +_FileHandleUnion = Union[str, IO[bytes]] + +def getfileinfo(name: str) -> _FileInfoTuple: ... + +class openrsrc: + def __init__(self, *args: Any) -> None: ... + def read(self, *args: Any) -> bytes: ... + def write(self, *args: Any) -> None: ... + def close(self) -> None: ... + +class BinHex: + def __init__(self, name_finfo_dlen_rlen: _FileInfoTuple, ofp: _FileHandleUnion) -> None: ... + def write(self, data: bytes) -> None: ... + def close_data(self) -> None: ... + def write_rsrc(self, data: bytes) -> None: ... + def close(self) -> None: ... + +def binhex(inp: str, out: str) -> None: ... + +class HexBin: + def __init__(self, ifp: _FileHandleUnion) -> None: ... + def read(self, *n: int) -> bytes: ... + def close_data(self) -> None: ... + def read_rsrc(self, *n: int) -> bytes: ... + def close(self) -> None: ... + +def hexbin(inp: str, out: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/bisect.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/bisect.pyi new file mode 100644 index 00000000..c3075297 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/bisect.pyi @@ -0,0 +1,13 @@ +# Stubs for bisect + +from typing import Any, Sequence, MutableSequence, TypeVar + +_T = TypeVar('_T') + +def bisect_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +def bisect_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +def bisect(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... + +def insort_left(a: MutableSequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +def insort_right(a: MutableSequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... +def insort(a: MutableSequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/builtins.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/builtins.pyi new file mode 100644 index 00000000..249a5cd6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/builtins.pyi @@ -0,0 +1,1650 @@ +# True and False are deliberately omitted because they are keywords in +# Python 3, and stub files conform to Python 3 syntax. + +from typing import ( + TypeVar, Iterator, Iterable, NoReturn, overload, Container, + Sequence, MutableSequence, Mapping, MutableMapping, Tuple, List, Any, Dict, Callable, Generic, + Set, AbstractSet, FrozenSet, MutableSet, Sized, Reversible, SupportsInt, SupportsFloat, SupportsAbs, + SupportsComplex, IO, BinaryIO, Union, + ItemsView, KeysView, ValuesView, ByteString, Optional, AnyStr, Type, Text, + Protocol, +) +from abc import abstractmethod, ABCMeta +from ast import mod, AST +from types import TracebackType, CodeType +import sys + +if sys.version_info >= (3,): + from typing import SupportsBytes, SupportsRound + +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + +_T = TypeVar('_T') +_T_co = TypeVar('_T_co', covariant=True) +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') +_S = TypeVar('_S') +_T1 = TypeVar('_T1') +_T2 = TypeVar('_T2') +_T3 = TypeVar('_T3') +_T4 = TypeVar('_T4') +_T5 = TypeVar('_T5') +_TT = TypeVar('_TT', bound='type') + +class _SupportsIndex(Protocol): + def __index__(self) -> int: ... + +class object: + __doc__: Optional[str] + __dict__: Dict[str, Any] + __slots__: Union[Text, Iterable[Text]] + __module__: str + if sys.version_info >= (3, 6): + __annotations__: Dict[str, Any] + + @property + def __class__(self: _T) -> Type[_T]: ... + @__class__.setter + def __class__(self, __type: Type[object]) -> None: ... + def __init__(self) -> None: ... + def __new__(cls) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __eq__(self, o: object) -> bool: ... + def __ne__(self, o: object) -> bool: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __hash__(self) -> int: ... + def __format__(self, format_spec: str) -> str: ... + def __getattribute__(self, name: str) -> Any: ... + def __delattr__(self, name: str) -> None: ... + def __sizeof__(self) -> int: ... + def __reduce__(self) -> Union[str, Tuple[Any, ...]]: ... + def __reduce_ex__(self, protocol: int) -> Union[str, Tuple[Any, ...]]: ... + if sys.version_info >= (3,): + def __dir__(self) -> Iterable[str]: ... + if sys.version_info >= (3, 6): + def __init_subclass__(cls) -> None: ... + +class staticmethod(object): # Special, only valid as a decorator. + __func__: Callable[..., Any] + if sys.version_info >= (3,): + __isabstractmethod__: bool + + def __init__(self, f: Callable[..., Any]) -> None: ... + def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable[..., Any]: ... + +class classmethod(object): # Special, only valid as a decorator. + __func__: Callable[..., Any] + if sys.version_info >= (3,): + __isabstractmethod__: bool + + def __init__(self, f: Callable[..., Any]) -> None: ... + def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ... + def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> Callable[..., Any]: ... + +class type(object): + __base__: type + __bases__: Tuple[type, ...] + __basicsize__: int + __dict__: Dict[str, Any] + __dictoffset__: int + __flags__: int + __itemsize__: int + __module__: str + __mro__: Tuple[type, ...] + __name__: str + if sys.version_info >= (3,): + __qualname__: str + __text_signature__: Optional[str] + __weakrefoffset__: int + + @overload + def __init__(self, o: object) -> None: ... + @overload + def __init__(self, name: str, bases: Tuple[type, ...], dict: Dict[str, Any]) -> None: ... + @overload + def __new__(cls, o: object) -> type: ... + @overload + def __new__(cls, name: str, bases: Tuple[type, ...], namespace: Dict[str, Any]) -> type: ... + def __call__(self, *args: Any, **kwds: Any) -> Any: ... + def __subclasses__(self: _TT) -> List[_TT]: ... + # Note: the documentation doesnt specify what the return type is, the standard + # implementation seems to be returning a list. + def mro(self) -> List[type]: ... + def __instancecheck__(self, instance: Any) -> bool: ... + def __subclasscheck__(self, subclass: type) -> bool: ... + if sys.version_info >= (3,): + @classmethod + def __prepare__(metacls, __name: str, __bases: Tuple[type, ...], **kwds: Any) -> Mapping[str, Any]: ... + +class super(object): + if sys.version_info >= (3,): + @overload + def __init__(self, t: Any, obj: Any) -> None: ... + @overload + def __init__(self, t: Any) -> None: ... + @overload + def __init__(self) -> None: ... + else: + @overload + def __init__(self, t: Any, obj: Any) -> None: ... + @overload + def __init__(self, t: Any) -> None: ... + +class int: + @overload + def __init__(self, x: Union[Text, bytes, SupportsInt, _SupportsIndex] = ...) -> None: ... + @overload + def __init__(self, x: Union[Text, bytes, bytearray], base: int) -> None: ... + + if sys.version_info >= (3, 8): + def as_integer_ratio(self) -> Tuple[int, Literal[1]]: ... + @property + def real(self) -> int: ... + @property + def imag(self) -> int: ... + @property + def numerator(self) -> int: ... + @property + def denominator(self) -> int: ... + def conjugate(self) -> int: ... + + def bit_length(self) -> int: ... + if sys.version_info >= (3,): + def to_bytes(self, length: int, byteorder: str, *, signed: bool = ...) -> bytes: ... + @classmethod + def from_bytes(cls, bytes: Sequence[int], byteorder: str, *, + signed: bool = ...) -> int: ... # TODO buffer object argument + + def __add__(self, x: int) -> int: ... + def __sub__(self, x: int) -> int: ... + def __mul__(self, x: int) -> int: ... + def __floordiv__(self, x: int) -> int: ... + if sys.version_info < (3,): + def __div__(self, x: int) -> int: ... + def __truediv__(self, x: int) -> float: ... + def __mod__(self, x: int) -> int: ... + def __divmod__(self, x: int) -> Tuple[int, int]: ... + def __radd__(self, x: int) -> int: ... + def __rsub__(self, x: int) -> int: ... + def __rmul__(self, x: int) -> int: ... + def __rfloordiv__(self, x: int) -> int: ... + if sys.version_info < (3,): + def __rdiv__(self, x: int) -> int: ... + def __rtruediv__(self, x: int) -> float: ... + def __rmod__(self, x: int) -> int: ... + def __rdivmod__(self, x: int) -> Tuple[int, int]: ... + def __pow__(self, __x: int, __modulo: Optional[int] = ...) -> Any: ... # Return type can be int or float, depending on x. + def __rpow__(self, x: int) -> Any: ... + def __and__(self, n: int) -> int: ... + def __or__(self, n: int) -> int: ... + def __xor__(self, n: int) -> int: ... + def __lshift__(self, n: int) -> int: ... + def __rshift__(self, n: int) -> int: ... + def __rand__(self, n: int) -> int: ... + def __ror__(self, n: int) -> int: ... + def __rxor__(self, n: int) -> int: ... + def __rlshift__(self, n: int) -> int: ... + def __rrshift__(self, n: int) -> int: ... + def __neg__(self) -> int: ... + def __pos__(self) -> int: ... + def __invert__(self) -> int: ... + def __trunc__(self) -> int: ... + if sys.version_info >= (3,): + def __ceil__(self) -> int: ... + def __floor__(self) -> int: ... + def __round__(self, ndigits: Optional[int] = ...) -> int: ... + def __getnewargs__(self) -> Tuple[int]: ... + + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: int) -> bool: ... + def __le__(self, x: int) -> bool: ... + def __gt__(self, x: int) -> bool: ... + def __ge__(self, x: int) -> bool: ... + + def __str__(self) -> str: ... + def __float__(self) -> float: ... + def __int__(self) -> int: ... + def __abs__(self) -> int: ... + def __hash__(self) -> int: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + def __index__(self) -> int: ... + +class float: + def __init__(self, x: Union[SupportsFloat, _SupportsIndex, Text, bytes, bytearray] = ...) -> None: ... + def as_integer_ratio(self) -> Tuple[int, int]: ... + def hex(self) -> str: ... + def is_integer(self) -> bool: ... + @classmethod + def fromhex(cls, s: str) -> float: ... + + @property + def real(self) -> float: ... + @property + def imag(self) -> float: ... + def conjugate(self) -> float: ... + + def __add__(self, x: float) -> float: ... + def __sub__(self, x: float) -> float: ... + def __mul__(self, x: float) -> float: ... + def __floordiv__(self, x: float) -> float: ... + if sys.version_info < (3,): + def __div__(self, x: float) -> float: ... + def __truediv__(self, x: float) -> float: ... + def __mod__(self, x: float) -> float: ... + def __divmod__(self, x: float) -> Tuple[float, float]: ... + def __pow__(self, x: float) -> float: ... # In Python 3, returns complex if self is negative and x is not whole + def __radd__(self, x: float) -> float: ... + def __rsub__(self, x: float) -> float: ... + def __rmul__(self, x: float) -> float: ... + def __rfloordiv__(self, x: float) -> float: ... + if sys.version_info < (3,): + def __rdiv__(self, x: float) -> float: ... + def __rtruediv__(self, x: float) -> float: ... + def __rmod__(self, x: float) -> float: ... + def __rdivmod__(self, x: float) -> Tuple[float, float]: ... + def __rpow__(self, x: float) -> float: ... + def __getnewargs__(self) -> Tuple[float]: ... + def __trunc__(self) -> int: ... + if sys.version_info >= (3,): + @overload + def __round__(self, ndigits: None = ...) -> int: ... + @overload + def __round__(self, ndigits: int) -> float: ... + + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: float) -> bool: ... + def __le__(self, x: float) -> bool: ... + def __gt__(self, x: float) -> bool: ... + def __ge__(self, x: float) -> bool: ... + def __neg__(self) -> float: ... + def __pos__(self) -> float: ... + + def __str__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __abs__(self) -> float: ... + def __hash__(self) -> int: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + +class complex: + @overload + def __init__(self, real: float = ..., imag: float = ...) -> None: ... + @overload + def __init__(self, real: Union[str, SupportsComplex, _SupportsIndex]) -> None: ... + + @property + def real(self) -> float: ... + @property + def imag(self) -> float: ... + + def conjugate(self) -> complex: ... + + def __add__(self, x: complex) -> complex: ... + def __sub__(self, x: complex) -> complex: ... + def __mul__(self, x: complex) -> complex: ... + def __pow__(self, x: complex) -> complex: ... + if sys.version_info < (3,): + def __div__(self, x: complex) -> complex: ... + def __truediv__(self, x: complex) -> complex: ... + def __radd__(self, x: complex) -> complex: ... + def __rsub__(self, x: complex) -> complex: ... + def __rmul__(self, x: complex) -> complex: ... + def __rpow__(self, x: complex) -> complex: ... + if sys.version_info < (3,): + def __rdiv__(self, x: complex) -> complex: ... + def __rtruediv__(self, x: complex) -> complex: ... + + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __neg__(self) -> complex: ... + def __pos__(self) -> complex: ... + + def __str__(self) -> str: ... + def __complex__(self) -> complex: ... + def __abs__(self) -> float: ... + def __hash__(self) -> int: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + +if sys.version_info >= (3,): + _str_base = object +else: + class basestring(metaclass=ABCMeta): ... + + class unicode(basestring, Sequence[unicode]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, o: object) -> None: ... + @overload + def __init__(self, o: str, encoding: unicode = ..., errors: unicode = ...) -> None: ... + def capitalize(self) -> unicode: ... + def center(self, width: int, fillchar: unicode = ...) -> unicode: ... + def count(self, x: unicode) -> int: ... + def decode(self, encoding: unicode = ..., errors: unicode = ...) -> unicode: ... + def encode(self, encoding: unicode = ..., errors: unicode = ...) -> str: ... + def endswith(self, suffix: Union[unicode, Tuple[unicode, ...]], start: int = ..., + end: int = ...) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> unicode: ... + def find(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def format(self, *args: object, **kwargs: object) -> unicode: ... + def index(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + def isidentifier(self) -> bool: ... + def islower(self) -> bool: ... + def isnumeric(self) -> bool: ... + def isprintable(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, iterable: Iterable[unicode]) -> unicode: ... + def ljust(self, width: int, fillchar: unicode = ...) -> unicode: ... + def lower(self) -> unicode: ... + def lstrip(self, chars: unicode = ...) -> unicode: ... + def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def replace(self, old: unicode, new: unicode, count: int = ...) -> unicode: ... + def rfind(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: unicode, start: int = ..., end: int = ...) -> int: ... + def rjust(self, width: int, fillchar: unicode = ...) -> unicode: ... + def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def rsplit(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ... + def rstrip(self, chars: unicode = ...) -> unicode: ... + def split(self, sep: Optional[unicode] = ..., maxsplit: int = ...) -> List[unicode]: ... + def splitlines(self, keepends: bool = ...) -> List[unicode]: ... + def startswith(self, prefix: Union[unicode, Tuple[unicode, ...]], start: int = ..., + end: int = ...) -> bool: ... + def strip(self, chars: unicode = ...) -> unicode: ... + def swapcase(self) -> unicode: ... + def title(self) -> unicode: ... + def translate(self, table: Union[Dict[int, Any], unicode]) -> unicode: ... + def upper(self) -> unicode: ... + def zfill(self, width: int) -> unicode: ... + + @overload + def __getitem__(self, i: int) -> unicode: ... + @overload + def __getitem__(self, s: slice) -> unicode: ... + def __getslice__(self, start: int, stop: int) -> unicode: ... + def __add__(self, s: unicode) -> unicode: ... + def __mul__(self, n: int) -> unicode: ... + def __rmul__(self, n: int) -> unicode: ... + def __mod__(self, x: Any) -> unicode: ... + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: unicode) -> bool: ... + def __le__(self, x: unicode) -> bool: ... + def __gt__(self, x: unicode) -> bool: ... + def __ge__(self, x: unicode) -> bool: ... + + def __len__(self) -> int: ... + # The argument type is incompatible with Sequence + def __contains__(self, s: Union[unicode, bytes]) -> bool: ... # type: ignore + def __iter__(self) -> Iterator[unicode]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __hash__(self) -> int: ... + def __getnewargs__(self) -> Tuple[unicode]: ... + + _str_base = basestring + +class str(Sequence[str], _str_base): + if sys.version_info >= (3,): + @overload + def __init__(self, o: object = ...) -> None: ... + @overload + def __init__(self, o: bytes, encoding: str = ..., errors: str = ...) -> None: ... + else: + def __init__(self, o: object = ...) -> None: ... + + def capitalize(self) -> str: ... + if sys.version_info >= (3, 3): + def casefold(self) -> str: ... + def center(self, width: int, fillchar: str = ...) -> str: ... + def count(self, x: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + if sys.version_info < (3,): + def decode(self, encoding: Text = ..., errors: Text = ...) -> unicode: ... + def encode(self, encoding: Text = ..., errors: Text = ...) -> bytes: ... + if sys.version_info >= (3,): + def endswith(self, suffix: Union[Text, Tuple[Text, ...]], start: Optional[int] = ..., + end: Optional[int] = ...) -> bool: ... + else: + def endswith(self, suffix: Union[Text, Tuple[Text, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> str: ... + def find(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def format(self, *args: object, **kwargs: object) -> str: ... + if sys.version_info >= (3,): + def format_map(self, map: Mapping[str, Any]) -> str: ... + def index(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + if sys.version_info >= (3,): + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + if sys.version_info >= (3,): + def isidentifier(self) -> bool: ... + def islower(self) -> bool: ... + if sys.version_info >= (3,): + def isnumeric(self) -> bool: ... + def isprintable(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + if sys.version_info >= (3,): + def join(self, iterable: Iterable[str]) -> str: ... + else: + def join(self, iterable: Iterable[AnyStr]) -> AnyStr: ... + def ljust(self, width: int, fillchar: str = ...) -> str: ... + def lower(self) -> str: ... + if sys.version_info >= (3,): + def lstrip(self, chars: Optional[str] = ...) -> str: ... + def partition(self, sep: str) -> Tuple[str, str, str]: ... + def replace(self, old: str, new: str, count: int = ...) -> str: ... + else: + @overload + def lstrip(self, chars: str = ...) -> str: ... + @overload + def lstrip(self, chars: unicode) -> unicode: ... + @overload + def partition(self, sep: bytearray) -> Tuple[str, bytearray, str]: ... + @overload + def partition(self, sep: str) -> Tuple[str, str, str]: ... + @overload + def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + def replace(self, old: AnyStr, new: AnyStr, count: int = ...) -> AnyStr: ... + def rfind(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def rindex(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ... + def rjust(self, width: int, fillchar: str = ...) -> str: ... + if sys.version_info >= (3,): + def rpartition(self, sep: str) -> Tuple[str, str, str]: ... + def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + def rstrip(self, chars: Optional[str] = ...) -> str: ... + def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + else: + @overload + def rpartition(self, sep: bytearray) -> Tuple[str, bytearray, str]: ... + @overload + def rpartition(self, sep: str) -> Tuple[str, str, str]: ... + @overload + def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ... + @overload + def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + @overload + def rsplit(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ... + @overload + def rstrip(self, chars: str = ...) -> str: ... + @overload + def rstrip(self, chars: unicode) -> unicode: ... + @overload + def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + @overload + def split(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ... + def splitlines(self, keepends: bool = ...) -> List[str]: ... + if sys.version_info >= (3,): + def startswith(self, prefix: Union[Text, Tuple[Text, ...]], start: Optional[int] = ..., + end: Optional[int] = ...) -> bool: ... + def strip(self, chars: Optional[str] = ...) -> str: ... + else: + def startswith(self, prefix: Union[Text, Tuple[Text, ...]]) -> bool: ... + @overload + def strip(self, chars: str = ...) -> str: ... + @overload + def strip(self, chars: unicode) -> unicode: ... + def swapcase(self) -> str: ... + def title(self) -> str: ... + if sys.version_info >= (3,): + def translate(self, table: Union[Mapping[int, Union[int, str, None]], Sequence[Union[int, str, None]]]) -> str: ... + else: + def translate(self, table: Optional[AnyStr], deletechars: AnyStr = ...) -> AnyStr: ... + def upper(self) -> str: ... + def zfill(self, width: int) -> str: ... + if sys.version_info >= (3,): + @staticmethod + @overload + def maketrans(x: Union[Dict[int, _T], Dict[str, _T], Dict[Union[str, int], _T]]) -> Dict[int, _T]: ... + @staticmethod + @overload + def maketrans(x: str, y: str, z: str = ...) -> Dict[int, Union[int, None]]: ... + + if sys.version_info >= (3,): + def __add__(self, s: str) -> str: ... + else: + def __add__(self, s: AnyStr) -> AnyStr: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[str, Text]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ge__(self, x: Text) -> bool: ... + def __getitem__(self, i: Union[int, slice]) -> str: ... + def __gt__(self, x: Text) -> bool: ... + def __hash__(self) -> int: ... + def __iter__(self) -> Iterator[str]: ... + def __le__(self, x: Text) -> bool: ... + def __len__(self) -> int: ... + def __lt__(self, x: Text) -> bool: ... + def __mod__(self, x: Any) -> str: ... + def __mul__(self, n: int) -> str: ... + def __ne__(self, x: object) -> bool: ... + def __repr__(self) -> str: ... + def __rmul__(self, n: int) -> str: ... + def __str__(self) -> str: ... + def __getnewargs__(self) -> Tuple[str]: ... + + if sys.version_info < (3,): + def __getslice__(self, start: int, stop: int) -> str: ... + def __float__(self) -> float: ... + def __int__(self) -> int: ... + +if sys.version_info >= (3,): + class bytes(ByteString): + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: str, encoding: str, + errors: str = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, o: SupportsBytes) -> None: ... + def capitalize(self) -> bytes: ... + def center(self, width: int, fillchar: bytes = ...) -> bytes: ... + def count(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def decode(self, encoding: str = ..., errors: str = ...) -> str: ... + def endswith(self, suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> bytes: ... + def find(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + if sys.version_info >= (3, 5): + def hex(self) -> str: ... + def index(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + def isdigit(self) -> bool: ... + def islower(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, iterable: Iterable[Union[ByteString, memoryview]]) -> bytes: ... + def ljust(self, width: int, fillchar: bytes = ...) -> bytes: ... + def lower(self) -> bytes: ... + def lstrip(self, chars: Optional[bytes] = ...) -> bytes: ... + def partition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ... + def replace(self, old: bytes, new: bytes, count: int = ...) -> bytes: ... + def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def rindex(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def rjust(self, width: int, fillchar: bytes = ...) -> bytes: ... + def rpartition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ... + def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ... + def rstrip(self, chars: Optional[bytes] = ...) -> bytes: ... + def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ... + def splitlines(self, keepends: bool = ...) -> List[bytes]: ... + def startswith( + self, + prefix: Union[bytes, Tuple[bytes, ...]], + start: Optional[int] = ..., + end: Optional[int] = ..., + ) -> bool: ... + def strip(self, chars: Optional[bytes] = ...) -> bytes: ... + def swapcase(self) -> bytes: ... + def title(self) -> bytes: ... + def translate(self, table: Optional[bytes], delete: bytes = ...) -> bytes: ... + def upper(self) -> bytes: ... + def zfill(self, width: int) -> bytes: ... + @classmethod + def fromhex(cls, s: str) -> bytes: ... + @classmethod + def maketrans(cls, frm: bytes, to: bytes) -> bytes: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __hash__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> bytes: ... + def __add__(self, s: bytes) -> bytes: ... + def __mul__(self, n: int) -> bytes: ... + def __rmul__(self, n: int) -> bytes: ... + if sys.version_info >= (3, 5): + def __mod__(self, value: Any) -> bytes: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[int, bytes]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: bytes) -> bool: ... + def __le__(self, x: bytes) -> bool: ... + def __gt__(self, x: bytes) -> bool: ... + def __ge__(self, x: bytes) -> bool: ... + def __getnewargs__(self) -> Tuple[bytes]: ... +else: + bytes = str + +class bytearray(MutableSequence[int], ByteString): + if sys.version_info >= (3,): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: Text, encoding: Text, errors: Text = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... + else: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, ints: Iterable[int]) -> None: ... + @overload + def __init__(self, string: str) -> None: ... + @overload + def __init__(self, string: Text, encoding: Text, errors: Text = ...) -> None: ... + @overload + def __init__(self, length: int) -> None: ... + def capitalize(self) -> bytearray: ... + def center(self, width: int, fillchar: bytes = ...) -> bytearray: ... + if sys.version_info >= (3,): + def count(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def copy(self) -> bytearray: ... + else: + def count(self, x: str) -> int: ... + def decode(self, encoding: Text = ..., errors: Text = ...) -> str: ... + def endswith(self, suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ... + def expandtabs(self, tabsize: int = ...) -> bytearray: ... + if sys.version_info < (3,): + def extend(self, iterable: Union[str, Iterable[int]]) -> None: ... + if sys.version_info >= (3,): + def find(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + if sys.version_info >= (3, 5): + def hex(self) -> str: ... + def index(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + else: + def find(self, sub: str, start: int = ..., end: int = ...) -> int: ... + def index(self, sub: str, start: int = ..., end: int = ...) -> int: ... + def insert(self, index: int, object: int) -> None: ... + def isalnum(self) -> bool: ... + def isalpha(self) -> bool: ... + if sys.version_info >= (3, 7): + def isascii(self) -> bool: ... + def isdigit(self) -> bool: ... + def islower(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + if sys.version_info >= (3,): + def join(self, iterable: Iterable[Union[ByteString, memoryview]]) -> bytearray: ... + def ljust(self, width: int, fillchar: bytes = ...) -> bytearray: ... + else: + def join(self, iterable: Iterable[str]) -> bytearray: ... + def ljust(self, width: int, fillchar: str = ...) -> bytearray: ... + def lower(self) -> bytearray: ... + def lstrip(self, chars: Optional[bytes] = ...) -> bytearray: ... + def partition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... + def replace(self, old: bytes, new: bytes, count: int = ...) -> bytearray: ... + if sys.version_info >= (3,): + def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + def rindex(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ... + else: + def rfind(self, sub: bytes, start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: bytes, start: int = ..., end: int = ...) -> int: ... + def rjust(self, width: int, fillchar: bytes = ...) -> bytearray: ... + def rpartition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ... + def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ... + def rstrip(self, chars: Optional[bytes] = ...) -> bytearray: ... + def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ... + def splitlines(self, keepends: bool = ...) -> List[bytearray]: ... + def startswith( + self, + prefix: Union[bytes, Tuple[bytes, ...]], + start: Optional[int] = ..., + end: Optional[int] = ..., + ) -> bool: ... + def strip(self, chars: Optional[bytes] = ...) -> bytearray: ... + def swapcase(self) -> bytearray: ... + def title(self) -> bytearray: ... + if sys.version_info >= (3,): + def translate(self, table: Optional[bytes], delete: bytes = ...) -> bytearray: ... + else: + def translate(self, table: str) -> bytearray: ... + def upper(self) -> bytearray: ... + def zfill(self, width: int) -> bytearray: ... + @staticmethod + def fromhex(s: str) -> bytearray: ... + if sys.version_info >= (3,): + @classmethod + def maketrans(cls, frm: bytes, to: bytes) -> bytes: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + __hash__: None # type: ignore + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> bytearray: ... + @overload + def __setitem__(self, i: int, x: int) -> None: ... + @overload + def __setitem__(self, s: slice, x: Union[Iterable[int], bytes]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + if sys.version_info < (3,): + def __getslice__(self, start: int, stop: int) -> bytearray: ... + def __setslice__(self, start: int, stop: int, x: Union[Sequence[int], str]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... + def __add__(self, s: bytes) -> bytearray: ... + if sys.version_info >= (3,): + def __iadd__(self, s: Iterable[int]) -> bytearray: ... + def __mul__(self, n: int) -> bytearray: ... + if sys.version_info >= (3,): + def __rmul__(self, n: int) -> bytearray: ... + def __imul__(self, n: int) -> bytearray: ... + if sys.version_info >= (3, 5): + def __mod__(self, value: Any) -> bytes: ... + # Incompatible with Sequence.__contains__ + def __contains__(self, o: Union[int, bytes]) -> bool: ... # type: ignore + def __eq__(self, x: object) -> bool: ... + def __ne__(self, x: object) -> bool: ... + def __lt__(self, x: bytes) -> bool: ... + def __le__(self, x: bytes) -> bool: ... + def __gt__(self, x: bytes) -> bool: ... + def __ge__(self, x: bytes) -> bool: ... + +if sys.version_info >= (3,): + _mv_container_type = int +else: + _mv_container_type = str + +class memoryview(Sized, Container[_mv_container_type]): + format: str + itemsize: int + shape: Optional[Tuple[int, ...]] + strides: Optional[Tuple[int, ...]] + suboffsets: Optional[Tuple[int, ...]] + readonly: bool + ndim: int + + if sys.version_info >= (3,): + c_contiguous: bool + f_contiguous: bool + contiguous: bool + nbytes: int + def __init__(self, obj: Union[bytes, bytearray, memoryview]) -> None: ... + def __enter__(self) -> memoryview: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]) -> None: ... + else: + def __init__(self, obj: Union[bytes, bytearray, buffer, memoryview]) -> None: ... + + @overload + def __getitem__(self, i: int) -> _mv_container_type: ... + @overload + def __getitem__(self, s: slice) -> memoryview: ... + + def __contains__(self, x: object) -> bool: ... + def __iter__(self) -> Iterator[_mv_container_type]: ... + def __len__(self) -> int: ... + + @overload + def __setitem__(self, s: slice, o: memoryview) -> None: ... + @overload + def __setitem__(self, i: int, o: bytes) -> None: ... + @overload + def __setitem__(self, s: slice, o: Sequence[bytes]) -> None: ... + + def tobytes(self) -> bytes: ... + def tolist(self) -> List[int]: ... + + if sys.version_info >= (3, 2): + def release(self) -> None: ... + + if sys.version_info >= (3, 5): + def hex(self) -> str: ... + +class bool(int): + def __init__(self, o: object = ...) -> None: ... + @overload + def __and__(self, x: bool) -> bool: ... + @overload + def __and__(self, x: int) -> int: ... + @overload + def __or__(self, x: bool) -> bool: ... + @overload + def __or__(self, x: int) -> int: ... + @overload + def __xor__(self, x: bool) -> bool: ... + @overload + def __xor__(self, x: int) -> int: ... + @overload + def __rand__(self, x: bool) -> bool: ... + @overload + def __rand__(self, x: int) -> int: ... + @overload + def __ror__(self, x: bool) -> bool: ... + @overload + def __ror__(self, x: int) -> int: ... + @overload + def __rxor__(self, x: bool) -> bool: ... + @overload + def __rxor__(self, x: int) -> int: ... + def __getnewargs__(self) -> Tuple[int]: ... + +class slice(object): + start: Any + step: Any + stop: Any + @overload + def __init__(self, stop: Any) -> None: ... + @overload + def __init__(self, start: Any, stop: Any, step: Any = ...) -> None: ... + __hash__: None # type: ignore + def indices(self, len: int) -> Tuple[int, int, int]: ... + +class tuple(Sequence[_T_co], Generic[_T_co]): + def __new__(cls: Type[_T], iterable: Iterable[_T_co] = ...) -> _T: ... + def __init__(self, iterable: Iterable[_T_co] = ...): ... + def __len__(self) -> int: ... + def __contains__(self, x: object) -> bool: ... + @overload + def __getitem__(self, x: int) -> _T_co: ... + @overload + def __getitem__(self, x: slice) -> Tuple[_T_co, ...]: ... + def __iter__(self) -> Iterator[_T_co]: ... + def __lt__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __le__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __gt__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __ge__(self, x: Tuple[_T_co, ...]) -> bool: ... + @overload + def __add__(self, x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ... + @overload + def __add__(self, x: Tuple[Any, ...]) -> Tuple[Any, ...]: ... + def __mul__(self, n: int) -> Tuple[_T_co, ...]: ... + def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ... + def count(self, x: Any) -> int: ... + if sys.version_info >= (3, 5): + def index(self, x: Any, start: int = ..., end: int = ...) -> int: ... + else: + def index(self, x: Any) -> int: ... + +class list(MutableSequence[_T], Generic[_T]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, iterable: Iterable[_T]) -> None: ... + if sys.version_info >= (3,): + def clear(self) -> None: ... + def copy(self) -> List[_T]: ... + def append(self, object: _T) -> None: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def pop(self, index: int = ...) -> _T: ... + def index(self, object: _T, start: int = ..., stop: int = ...) -> int: ... + def count(self, object: _T) -> int: ... + def insert(self, index: int, object: _T) -> None: ... + def remove(self, object: _T) -> None: ... + def reverse(self) -> None: ... + if sys.version_info >= (3,): + def sort(self, *, key: Optional[Callable[[_T], Any]] = ..., reverse: bool = ...) -> None: ... + else: + def sort(self, cmp: Callable[[_T, _T], Any] = ..., key: Callable[[_T], Any] = ..., reverse: bool = ...) -> None: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + __hash__: None # type: ignore + @overload + def __getitem__(self, i: int) -> _T: ... + @overload + def __getitem__(self, s: slice) -> List[_T]: ... + @overload + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + if sys.version_info < (3,): + def __getslice__(self, start: int, stop: int) -> List[_T]: ... + def __setslice__(self, start: int, stop: int, o: Sequence[_T]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... + def __add__(self, x: List[_T]) -> List[_T]: ... + def __iadd__(self: _S, x: Iterable[_T]) -> _S: ... + def __mul__(self, n: int) -> List[_T]: ... + def __rmul__(self, n: int) -> List[_T]: ... + if sys.version_info >= (3,): + def __imul__(self: _S, n: int) -> _S: ... + def __contains__(self, o: object) -> bool: ... + def __reversed__(self) -> Iterator[_T]: ... + def __gt__(self, x: List[_T]) -> bool: ... + def __ge__(self, x: List[_T]) -> bool: ... + def __lt__(self, x: List[_T]) -> bool: ... + def __le__(self, x: List[_T]) -> bool: ... + +class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): + # NOTE: Keyword arguments are special. If they are used, _KT must include + # str, but we have no way of enforcing it here. + @overload + def __init__(self, **kwargs: _VT) -> None: ... + @overload + def __init__(self, map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def __init__(self, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + + def __new__(cls: Type[_T1], *args: Any, **kwargs: Any) -> _T1: ... + + if sys.version_info < (3,): + def has_key(self, k: _KT) -> bool: ... + def clear(self) -> None: ... + def copy(self) -> Dict[_KT, _VT]: ... + def popitem(self) -> Tuple[_KT, _VT]: ... + def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ... + @overload + def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + @overload + def update(self, **kwargs: _VT) -> None: ... + if sys.version_info >= (3,): + def keys(self) -> KeysView[_KT]: ... + def values(self) -> ValuesView[_VT]: ... + def items(self) -> ItemsView[_KT, _VT]: ... + else: + def iterkeys(self) -> Iterator[_KT]: ... + def itervalues(self) -> Iterator[_VT]: ... + def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... + def viewkeys(self) -> KeysView[_KT]: ... + def viewvalues(self) -> ValuesView[_VT]: ... + def viewitems(self) -> ItemsView[_KT, _VT]: ... + @staticmethod + @overload + def fromkeys(seq: Iterable[_T]) -> Dict[_T, Any]: ... # TODO: Actually a class method (mypy/issues#328) + @staticmethod + @overload + def fromkeys(seq: Iterable[_T], value: _S) -> Dict[_T, _S]: ... + def __len__(self) -> int: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __setitem__(self, k: _KT, v: _VT) -> None: ... + def __delitem__(self, v: _KT) -> None: ... + def __iter__(self) -> Iterator[_KT]: ... + if sys.version_info >= (3, 8): + def __reversed__(self) -> Iterator[_KT]: ... + def __str__(self) -> str: ... + __hash__: None # type: ignore + +class set(MutableSet[_T], Generic[_T]): + def __init__(self, iterable: Iterable[_T] = ...) -> None: ... + def add(self, element: _T) -> None: ... + def clear(self) -> None: ... + def copy(self) -> Set[_T]: ... + def difference(self, *s: Iterable[Any]) -> Set[_T]: ... + def difference_update(self, *s: Iterable[Any]) -> None: ... + def discard(self, element: _T) -> None: ... + def intersection(self, *s: Iterable[Any]) -> Set[_T]: ... + def intersection_update(self, *s: Iterable[Any]) -> None: ... + def isdisjoint(self, s: Iterable[Any]) -> bool: ... + def issubset(self, s: Iterable[Any]) -> bool: ... + def issuperset(self, s: Iterable[Any]) -> bool: ... + def pop(self) -> _T: ... + def remove(self, element: _T) -> None: ... + def symmetric_difference(self, s: Iterable[_T]) -> Set[_T]: ... + def symmetric_difference_update(self, s: Iterable[_T]) -> None: ... + def union(self, *s: Iterable[_T]) -> Set[_T]: ... + def update(self, *s: Iterable[_T]) -> None: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __and__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __iand__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __or__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __ior__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __sub__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __isub__(self, s: AbstractSet[object]) -> Set[_T]: ... + def __xor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __ixor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ... + def __le__(self, s: AbstractSet[object]) -> bool: ... + def __lt__(self, s: AbstractSet[object]) -> bool: ... + def __ge__(self, s: AbstractSet[object]) -> bool: ... + def __gt__(self, s: AbstractSet[object]) -> bool: ... + __hash__: None # type: ignore + +class frozenset(AbstractSet[_T], Generic[_T]): + def __init__(self, iterable: Iterable[_T] = ...) -> None: ... + def copy(self) -> FrozenSet[_T]: ... + def difference(self, *s: Iterable[object]) -> FrozenSet[_T]: ... + def intersection(self, *s: Iterable[object]) -> FrozenSet[_T]: ... + def isdisjoint(self, s: Iterable[_T]) -> bool: ... + def issubset(self, s: Iterable[object]) -> bool: ... + def issuperset(self, s: Iterable[object]) -> bool: ... + def symmetric_difference(self, s: Iterable[_T]) -> FrozenSet[_T]: ... + def union(self, *s: Iterable[_T]) -> FrozenSet[_T]: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __and__(self, s: AbstractSet[_T]) -> FrozenSet[_T]: ... + def __or__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T, _S]]: ... + def __sub__(self, s: AbstractSet[_T]) -> FrozenSet[_T]: ... + def __xor__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T, _S]]: ... + def __le__(self, s: AbstractSet[object]) -> bool: ... + def __lt__(self, s: AbstractSet[object]) -> bool: ... + def __ge__(self, s: AbstractSet[object]) -> bool: ... + def __gt__(self, s: AbstractSet[object]) -> bool: ... + +class enumerate(Iterator[Tuple[int, _T]], Generic[_T]): + def __init__(self, iterable: Iterable[_T], start: int = ...) -> None: ... + def __iter__(self) -> Iterator[Tuple[int, _T]]: ... + if sys.version_info >= (3,): + def __next__(self) -> Tuple[int, _T]: ... + else: + def next(self) -> Tuple[int, _T]: ... + +if sys.version_info >= (3,): + class range(Sequence[int]): + start: int + stop: int + step: int + @overload + def __init__(self, stop: int) -> None: ... + @overload + def __init__(self, start: int, stop: int, step: int = ...) -> None: ... + def count(self, value: int) -> int: ... + def index(self, value: int, start: int = ..., stop: Optional[int] = ...) -> int: ... + def __len__(self) -> int: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[int]: ... + @overload + def __getitem__(self, i: int) -> int: ... + @overload + def __getitem__(self, s: slice) -> range: ... + def __repr__(self) -> str: ... + def __reversed__(self) -> Iterator[int]: ... +else: + class xrange(Sized, Iterable[int], Reversible[int]): + @overload + def __init__(self, stop: int) -> None: ... + @overload + def __init__(self, start: int, stop: int, step: int = ...) -> None: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[int]: ... + def __getitem__(self, i: int) -> int: ... + def __reversed__(self) -> Iterator[int]: ... + +class property(object): + def __init__(self, fget: Optional[Callable[[Any], Any]] = ..., + fset: Optional[Callable[[Any, Any], None]] = ..., + fdel: Optional[Callable[[Any], None]] = ..., + doc: Optional[str] = ...) -> None: ... + def getter(self, fget: Callable[[Any], Any]) -> property: ... + def setter(self, fset: Callable[[Any, Any], None]) -> property: ... + def deleter(self, fdel: Callable[[Any], None]) -> property: ... + def __get__(self, obj: Any, type: Optional[type] = ...) -> Any: ... + def __set__(self, obj: Any, value: Any) -> None: ... + def __delete__(self, obj: Any) -> None: ... + def fget(self) -> Any: ... + def fset(self, value: Any) -> None: ... + def fdel(self) -> None: ... + +if sys.version_info < (3,): + long = int + +NotImplemented: Any + +def abs(__n: SupportsAbs[_T]) -> _T: ... +def all(__i: Iterable[object]) -> bool: ... +def any(__i: Iterable[object]) -> bool: ... +if sys.version_info < (3,): + def apply(__func: Callable[..., _T], __args: Optional[Sequence[Any]] = ..., __kwds: Optional[Mapping[str, Any]] = ...) -> _T: ... +if sys.version_info >= (3,): + def ascii(__o: object) -> str: ... + +def bin(__number: Union[int, _SupportsIndex]) -> str: ... + +if sys.version_info >= (3, 7): + def breakpoint(*args: Any, **kws: Any) -> None: ... +def callable(__o: object) -> bool: ... +def chr(__code: int) -> str: ... +if sys.version_info < (3,): + def cmp(__x: Any, __y: Any) -> int: ... + _N1 = TypeVar('_N1', bool, int, float, complex) + def coerce(__x: _N1, __y: _N1) -> Tuple[_N1, _N1]: ... +if sys.version_info >= (3, 6): + # This class is to be exported as PathLike from os, + # but we define it here as _PathLike to avoid import cycle issues. + # See https://github.com/python/typeshed/pull/991#issuecomment-288160993 + class _PathLike(Generic[AnyStr]): + def __fspath__(self) -> AnyStr: ... + def compile(source: Union[str, bytes, mod, AST], filename: Union[str, bytes, _PathLike[Any]], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ... +elif sys.version_info >= (3,): + def compile(source: Union[str, bytes, mod, AST], filename: Union[str, bytes], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ... +else: + def compile(source: Union[Text, mod], filename: Text, mode: Text, flags: int = ..., dont_inherit: int = ...) -> Any: ... +if sys.version_info >= (3,): + def copyright() -> None: ... + def credits() -> None: ... +def delattr(__o: Any, __name: Text) -> None: ... +def dir(__o: object = ...) -> List[str]: ... +_N2 = TypeVar('_N2', int, float) +def divmod(__a: _N2, __b: _N2) -> Tuple[_N2, _N2]: ... +def eval(__source: Union[Text, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ...) -> Any: ... +if sys.version_info >= (3,): + def exec(__object: Union[str, bytes, CodeType], __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Mapping[str, Any]] = ...) -> Any: ... +else: + def execfile(__filename: str, __globals: Optional[Dict[str, Any]] = ..., __locals: Optional[Dict[str, Any]] = ...) -> None: ... +def exit(code: object = ...) -> NoReturn: ... +if sys.version_info >= (3,): + @overload + def filter(__function: None, __iterable: Iterable[Optional[_T]]) -> Iterator[_T]: ... + @overload + def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> Iterator[_T]: ... +else: + @overload + def filter(__function: Callable[[AnyStr], Any], __iterable: AnyStr) -> AnyStr: ... # type: ignore + @overload + def filter(__function: None, __iterable: Tuple[Optional[_T], ...]) -> Tuple[_T, ...]: ... # type: ignore + @overload + def filter(__function: Callable[[_T], Any], __iterable: Tuple[_T, ...]) -> Tuple[_T, ...]: ... # type: ignore + @overload + def filter(__function: None, __iterable: Iterable[Optional[_T]]) -> List[_T]: ... + @overload + def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> List[_T]: ... +def format(__o: object, __format_spec: str = ...) -> str: ... # TODO unicode +def getattr(__o: Any, name: Text, __default: Any = ...) -> Any: ... +def globals() -> Dict[str, Any]: ... +def hasattr(__o: Any, __name: Text) -> bool: ... +def hash(__o: object) -> int: ... +if sys.version_info >= (3,): + def help(*args: Any, **kwds: Any) -> None: ... +def hex(__i: Union[int, _SupportsIndex]) -> str: ... +def id(__o: object) -> int: ... +if sys.version_info >= (3,): + def input(__prompt: Any = ...) -> str: ... +else: + def input(__prompt: Any = ...) -> Any: ... + def intern(__string: str) -> str: ... +@overload +def iter(__iterable: Iterable[_T]) -> Iterator[_T]: ... +@overload +def iter(__function: Callable[[], Optional[_T]], __sentinel: None) -> Iterator[_T]: ... +@overload +def iter(__function: Callable[[], _T], __sentinel: Any) -> Iterator[_T]: ... +def isinstance(__o: object, __t: Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]]) -> bool: ... +def issubclass(__cls: type, __classinfo: Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]]) -> bool: ... +def len(__o: Sized) -> int: ... +if sys.version_info >= (3,): + def license() -> None: ... +def locals() -> Dict[str, Any]: ... +if sys.version_info >= (3,): + @overload + def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2], _S], __iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5]) -> Iterator[_S]: ... + @overload + def map(__func: Callable[..., _S], + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> Iterator[_S]: ... +else: + @overload + def map(__func: None, __iter1: Iterable[_T1]) -> List[_T1]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2, _T3, _T4]]: ... + @overload + def map(__func: None, + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... + @overload + def map(__func: None, + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> List[Tuple[Any, ...]]: ... + @overload + def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> List[_S]: ... + @overload + def map(__func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], + __iter1: Iterable[_T1], + __iter2: Iterable[_T2], + __iter3: Iterable[_T3], + __iter4: Iterable[_T4], + __iter5: Iterable[_T5]) -> List[_S]: ... + @overload + def map(__func: Callable[..., _S], + __iter1: Iterable[Any], + __iter2: Iterable[Any], + __iter3: Iterable[Any], + __iter4: Iterable[Any], + __iter5: Iterable[Any], + __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> List[_S]: ... +if sys.version_info >= (3,): + @overload + def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ..., default: _VT) -> Union[_T, _VT]: ... +else: + @overload + def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def max(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... +if sys.version_info >= (3,): + @overload + def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ..., default: _VT) -> Union[_T, _VT]: ... +else: + @overload + def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ... + @overload + def min(__iterable: Iterable[_T], *, key: Callable[[_T], Any] = ...) -> _T: ... +@overload +def next(__i: Iterator[_T]) -> _T: ... +@overload +def next(__i: Iterator[_T], default: _VT) -> Union[_T, _VT]: ... +def oct(__i: Union[int, _SupportsIndex]) -> str: ... + +if sys.version_info >= (3, 6): + def open(file: Union[str, bytes, int, _PathLike[Any]], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., + opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ... +elif sys.version_info >= (3,): + def open(file: Union[str, bytes, int], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., + opener: Optional[Callable[[str, int], int]] = ...) -> IO[Any]: ... +else: + def open(name: Union[unicode, int], mode: unicode = ..., buffering: int = ...) -> BinaryIO: ... + +def ord(__c: Union[Text, bytes]) -> int: ... +if sys.version_info >= (3,): + class _Writer(Protocol): + def write(self, __s: str) -> Any: ... + def print( + *values: object, sep: Optional[Text] = ..., end: Optional[Text] = ..., file: Optional[_Writer] = ..., flush: bool = ... + ) -> None: ... + +else: + class _Writer(Protocol): + def write(self, __s: Any) -> Any: ... + # This is only available after from __future__ import print_function. + def print(*values: object, sep: Optional[Text] = ..., end: Optional[Text] = ..., file: Optional[_Writer] = ...) -> None: ... + +@overload +def pow(__x: int, __y: int) -> Any: ... # The return type can be int or float, depending on y +@overload +def pow(__x: int, __y: int, __z: int) -> Any: ... +@overload +def pow(__x: float, __y: float) -> float: ... +@overload +def pow(__x: float, __y: float, __z: float) -> float: ... +def quit(code: object = ...) -> NoReturn: ... +if sys.version_info < (3,): + def range(__x: int, __y: int = ..., __step: int = ...) -> List[int]: ... + def raw_input(__prompt: Any = ...) -> str: ... + @overload + def reduce(__function: Callable[[_T, _S], _T], __iterable: Iterable[_S], __initializer: _T) -> _T: ... + @overload + def reduce(__function: Callable[[_T, _T], _T], __iterable: Iterable[_T]) -> _T: ... + def reload(__module: Any) -> Any: ... +@overload +def reversed(__object: Sequence[_T]) -> Iterator[_T]: ... +@overload +def reversed(__object: Reversible[_T]) -> Iterator[_T]: ... +def repr(__o: object) -> str: ... +if sys.version_info >= (3,): + @overload + def round(number: float) -> int: ... + @overload + def round(number: float, ndigits: None) -> int: ... + @overload + def round(number: float, ndigits: int) -> float: ... + @overload + def round(number: SupportsRound[_T]) -> int: ... + @overload + def round(number: SupportsRound[_T], ndigits: None) -> int: ... + @overload + def round(number: SupportsRound[_T], ndigits: int) -> _T: ... +else: + @overload + def round(number: float) -> float: ... + @overload + def round(number: float, ndigits: int) -> float: ... + @overload + def round(number: SupportsFloat) -> float: ... + @overload + def round(number: SupportsFloat, ndigits: int) -> float: ... +def setattr(__object: Any, __name: Text, __value: Any) -> None: ... +if sys.version_info >= (3,): + def sorted(__iterable: Iterable[_T], *, + key: Optional[Callable[[_T], Any]] = ..., + reverse: bool = ...) -> List[_T]: ... +else: + def sorted(__iterable: Iterable[_T], *, + cmp: Callable[[_T, _T], int] = ..., + key: Optional[Callable[[_T], Any]] = ..., + reverse: bool = ...) -> List[_T]: ... +@overload +def sum(__iterable: Iterable[_T]) -> Union[_T, int]: ... +@overload +def sum(__iterable: Iterable[_T], __start: _S) -> Union[_T, _S]: ... +if sys.version_info < (3,): + def unichr(__i: int) -> unicode: ... +def vars(__object: Any = ...) -> Dict[str, Any]: ... +if sys.version_info >= (3,): + @overload + def zip(__iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4], __iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... + @overload + def zip(__iter1: Iterable[Any], __iter2: Iterable[Any], __iter3: Iterable[Any], + __iter4: Iterable[Any], __iter5: Iterable[Any], __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... +else: + @overload + def zip(__iter1: Iterable[_T1]) -> List[Tuple[_T1]]: ... + @overload + def zip(__iter1: Iterable[_T1], + __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], + __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2, _T3, _T4]]: ... + @overload + def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], + __iter4: Iterable[_T4], __iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... + @overload + def zip(__iter1: Iterable[Any], __iter2: Iterable[Any], __iter3: Iterable[Any], + __iter4: Iterable[Any], __iter5: Iterable[Any], __iter6: Iterable[Any], + *iterables: Iterable[Any]) -> List[Tuple[Any, ...]]: ... +def __import__(name: Text, globals: Optional[Mapping[str, Any]] = ..., + locals: Optional[Mapping[str, Any]] = ..., + fromlist: Sequence[str] = ..., + level: int = ...) -> Any: ... + +# Actually the type of Ellipsis is , but since it's +# not exposed anywhere under that name, we make it private here. +class ellipsis: ... +Ellipsis: ellipsis + +if sys.version_info < (3,): + # TODO: buffer support is incomplete; e.g. some_string.startswith(some_buffer) doesn't type check. + _AnyBuffer = TypeVar('_AnyBuffer', str, unicode, bytearray, buffer) + + class buffer(Sized): + def __init__(self, object: _AnyBuffer, offset: int = ..., size: int = ...) -> None: ... + def __add__(self, other: _AnyBuffer) -> str: ... + def __cmp__(self, other: _AnyBuffer) -> bool: ... + def __getitem__(self, key: Union[int, slice]) -> str: ... + def __getslice__(self, i: int, j: int) -> str: ... + def __len__(self) -> int: ... + def __mul__(self, x: int) -> str: ... + +class BaseException(object): + args: Tuple[Any, ...] + if sys.version_info < (3,): + message: Any + if sys.version_info >= (3,): + __cause__: Optional[BaseException] + __context__: Optional[BaseException] + __suppress_context__: bool + __traceback__: Optional[TracebackType] + def __init__(self, *args: object) -> None: ... + def __str__(self) -> str: ... + def __repr__(self) -> str: ... + if sys.version_info < (3,): + def __getitem__(self, i: int) -> Any: ... + def __getslice__(self, start: int, stop: int) -> Tuple[Any, ...]: ... + if sys.version_info >= (3,): + def with_traceback(self, tb: Optional[TracebackType]) -> BaseException: ... + +class GeneratorExit(BaseException): ... +class KeyboardInterrupt(BaseException): ... +class SystemExit(BaseException): + code: int +class Exception(BaseException): ... +class StopIteration(Exception): + if sys.version_info >= (3,): + value: Any +if sys.version_info >= (3,): + _StandardError = Exception + class OSError(Exception): + errno: int + strerror: str + # filename, filename2 are actually Union[str, bytes, None] + filename: Any + filename2: Any + EnvironmentError = OSError + IOError = OSError +else: + class StandardError(Exception): ... + _StandardError = StandardError + class EnvironmentError(StandardError): + errno: int + strerror: str + # TODO can this be unicode? + filename: str + class OSError(EnvironmentError): ... + class IOError(EnvironmentError): ... + +class ArithmeticError(_StandardError): ... +class AssertionError(_StandardError): ... +class AttributeError(_StandardError): ... +class BufferError(_StandardError): ... +class EOFError(_StandardError): ... +class ImportError(_StandardError): + if sys.version_info >= (3, 3): + def __init__(self, *args, name: Optional[str] = ..., path: Optional[str] = ...) -> None: ... + name: Optional[str] + path: Optional[str] +class LookupError(_StandardError): ... +class MemoryError(_StandardError): ... +class NameError(_StandardError): ... +class ReferenceError(_StandardError): ... +class RuntimeError(_StandardError): ... +if sys.version_info >= (3, 5): + class StopAsyncIteration(Exception): + value: Any +class SyntaxError(_StandardError): + msg: str + lineno: int + offset: Optional[int] + text: Optional[str] + filename: str +class SystemError(_StandardError): ... +class TypeError(_StandardError): ... +class ValueError(_StandardError): ... + +class FloatingPointError(ArithmeticError): ... +class OverflowError(ArithmeticError): ... +class ZeroDivisionError(ArithmeticError): ... + +if sys.version_info >= (3, 6): + class ModuleNotFoundError(ImportError): ... + +class IndexError(LookupError): ... +class KeyError(LookupError): ... + +class UnboundLocalError(NameError): ... + +class WindowsError(OSError): + winerror: int +if sys.version_info >= (3,): + class BlockingIOError(OSError): + characters_written: int + class ChildProcessError(OSError): ... + class ConnectionError(OSError): ... + class BrokenPipeError(ConnectionError): ... + class ConnectionAbortedError(ConnectionError): ... + class ConnectionRefusedError(ConnectionError): ... + class ConnectionResetError(ConnectionError): ... + class FileExistsError(OSError): ... + class FileNotFoundError(OSError): ... + class InterruptedError(OSError): ... + class IsADirectoryError(OSError): ... + class NotADirectoryError(OSError): ... + class PermissionError(OSError): ... + class ProcessLookupError(OSError): ... + class TimeoutError(OSError): ... + +class NotImplementedError(RuntimeError): ... +if sys.version_info >= (3, 5): + class RecursionError(RuntimeError): ... + +class IndentationError(SyntaxError): ... +class TabError(IndentationError): ... + +class UnicodeError(ValueError): ... +class UnicodeDecodeError(UnicodeError): + encoding: str + object: bytes + start: int + end: int + reason: str + def __init__(self, __encoding: str, __object: bytes, __start: int, __end: int, + __reason: str) -> None: ... +class UnicodeEncodeError(UnicodeError): + encoding: str + object: Text + start: int + end: int + reason: str + def __init__(self, __encoding: str, __object: Text, __start: int, __end: int, + __reason: str) -> None: ... +class UnicodeTranslateError(UnicodeError): ... + +class Warning(Exception): ... +class UserWarning(Warning): ... +class DeprecationWarning(Warning): ... +class SyntaxWarning(Warning): ... +class RuntimeWarning(Warning): ... +class FutureWarning(Warning): ... +class PendingDeprecationWarning(Warning): ... +class ImportWarning(Warning): ... +class UnicodeWarning(Warning): ... +class BytesWarning(Warning): ... +if sys.version_info >= (3, 2): + class ResourceWarning(Warning): ... + +if sys.version_info < (3,): + class file(BinaryIO): + @overload + def __init__(self, file: str, mode: str = ..., buffering: int = ...) -> None: ... + @overload + def __init__(self, file: unicode, mode: str = ..., buffering: int = ...) -> None: ... + @overload + def __init__(self, file: int, mode: str = ..., buffering: int = ...) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def next(self) -> str: ... + def read(self, n: int = ...) -> str: ... + def __enter__(self) -> BinaryIO: ... + def __exit__(self, t: Optional[type] = ..., exc: Optional[BaseException] = ..., tb: Optional[Any] = ...) -> Optional[bool]: ... + def flush(self) -> None: ... + def fileno(self) -> int: ... + def isatty(self) -> bool: ... + def close(self) -> None: ... + + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def seekable(self) -> bool: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + def readline(self, limit: int = ...) -> str: ... + def readlines(self, hint: int = ...) -> List[str]: ... + def write(self, data: str) -> int: ... + def writelines(self, data: Iterable[str]) -> None: ... + def truncate(self, pos: Optional[int] = ...) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/bz2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/bz2.pyi new file mode 100644 index 00000000..2cb329ce --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/bz2.pyi @@ -0,0 +1,48 @@ +import io +import sys +from typing import Any, IO, Optional, Union + +if sys.version_info >= (3, 6): + from os import PathLike + _PathOrFile = Union[str, bytes, IO[Any], PathLike[Any]] +elif sys.version_info >= (3, 3): + _PathOrFile = Union[str, bytes, IO[Any]] +else: + _PathOrFile = str + +def compress(data: bytes, compresslevel: int = ...) -> bytes: ... +def decompress(data: bytes) -> bytes: ... + +if sys.version_info >= (3, 3): + def open(filename: _PathOrFile, + mode: str = ..., + compresslevel: int = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ...) -> IO[Any]: ... + +class BZ2File(io.BufferedIOBase, IO[bytes]): # type: ignore # python/mypy#5027 + def __init__(self, + filename: _PathOrFile, + mode: str = ..., + buffering: Optional[Any] = ..., + compresslevel: int = ...) -> None: ... + +class BZ2Compressor(object): + def __init__(self, compresslevel: int = ...) -> None: ... + def compress(self, data: bytes) -> bytes: ... + def flush(self) -> bytes: ... + +class BZ2Decompressor(object): + if sys.version_info >= (3, 5): + def decompress(self, data: bytes, max_length: int = ...) -> bytes: ... + else: + def decompress(self, data: bytes) -> bytes: ... + if sys.version_info >= (3, 3): + @property + def eof(self) -> bool: ... + if sys.version_info >= (3, 5): + @property + def needs_input(self) -> bool: ... + @property + def unused_data(self) -> bytes: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/cProfile.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/cProfile.pyi new file mode 100644 index 00000000..c6a11721 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/cProfile.pyi @@ -0,0 +1,27 @@ +import os +import sys +from typing import Any, Callable, Dict, Optional, Text, TypeVar, Union + +def run(statement: str, filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ... +def runctx(statement: str, globals: Dict[str, Any], locals: Dict[str, Any], filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ... + +_SelfT = TypeVar('_SelfT', bound=Profile) +_T = TypeVar('_T') +if sys.version_info >= (3, 6): + _Path = Union[bytes, Text, os.PathLike[Any]] +else: + _Path = Union[bytes, Text] + +class Profile: + def __init__(self, custom_timer: Callable[[], float] = ..., time_unit: float = ..., subcalls: bool = ..., builtins: bool = ...) -> None: ... + def enable(self) -> None: ... + def disable(self) -> None: ... + def print_stats(self, sort: Union[str, int] = ...) -> None: ... + def dump_stats(self, file: _Path) -> None: ... + def create_stats(self) -> None: ... + def run(self: _SelfT, cmd: str) -> _SelfT: ... + def runctx(self: _SelfT, cmd: str, globals: Dict[str, Any], locals: Dict[str, Any]) -> _SelfT: ... + def runcall(self, func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ... + if sys.version_info >= (3, 8): + def __enter__(self: _SelfT) -> _SelfT: ... + def __exit__(self, *exc_info: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/calendar.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/calendar.pyi new file mode 100644 index 00000000..4b452cc3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/calendar.pyi @@ -0,0 +1,122 @@ +import datetime +import sys +from time import struct_time +from typing import Any, Iterable, List, Optional, Sequence, Tuple, Union + + +_LocaleType = Tuple[Optional[str], Optional[str]] + +class IllegalMonthError(ValueError): + def __init__(self, month: int) -> None: ... + def __str__(self) -> str: ... + +class IllegalWeekdayError(ValueError): + def __init__(self, weekday: int) -> None: ... + def __str__(self) -> str: ... + +def isleap(year: int) -> bool: ... +def leapdays(y1: int, y2: int) -> int: ... +def weekday(year: int, month: int, day: int) -> int: ... +def monthrange(year: int, month: int) -> Tuple[int, int]: ... + +class Calendar: + def __init__(self, firstweekday: int = ...) -> None: ... + def getfirstweekday(self) -> int: ... + def setfirstweekday(self, firstweekday: int) -> None: ... + def iterweekdays(self) -> Iterable[int]: ... + def itermonthdates(self, year: int, month: int) -> Iterable[datetime.date]: ... + def itermonthdays2(self, year: int, month: int) -> Iterable[Tuple[int, int]]: ... + def itermonthdays(self, year: int, month: int) -> Iterable[int]: ... + def monthdatescalendar(self, year: int, month: int) -> List[List[datetime.date]]: ... + def monthdays2calendar(self, year: int, month: int) -> List[List[Tuple[int, int]]]: ... + def monthdayscalendar(self, year: int, month: int) -> List[List[int]]: ... + def yeardatescalendar(self, year: int, width: int = ...) -> List[List[int]]: ... + def yeardays2calendar(self, year: int, width: int = ...) -> List[List[Tuple[int, int]]]: ... + def yeardayscalendar(self, year: int, width: int = ...) -> List[List[int]]: ... + if sys.version_info >= (3, 7): + def itermonthdays3(self, year: int, month: int) -> Iterable[Tuple[int, int, int]]: ... + def itermonthdays4(self, year: int, month: int) -> Iterable[Tuple[int, int, int, int]]: ... + +class TextCalendar(Calendar): + def prweek(self, theweek: int, width: int) -> None: ... + def formatday(self, day: int, weekday: int, width: int) -> str: ... + def formatweek(self, theweek: int, width: int) -> str: ... + def formatweekday(self, day: int, width: int) -> str: ... + def formatweekheader(self, width: int) -> str: ... + def formatmonthname(self, theyear: int, themonth: int, width: int, withyear: bool = ...) -> str: ... + def prmonth(self, theyear: int, themonth: int, w: int = ..., l: int = ...) -> None: ... + def formatmonth(self, theyear: int, themonth: int, w: int = ..., l: int = ...) -> str: ... + def formatyear(self, theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> str: ... + def pryear(self, theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> None: ... + +def firstweekday() -> int: ... +def monthcalendar(year: int, month: int) -> List[List[int]]: ... +def prweek(theweek: int, width: int) -> None: ... +def week(theweek: int, width: int) -> str: ... +def weekheader(width: int) -> str: ... +def prmonth(theyear: int, themonth: int, w: int = ..., l: int = ...) -> None: ... +def month(theyear: int, themonth: int, w: int = ..., l: int = ...) -> str: ... +def calendar(theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> str: ... +def prcal(theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> None: ... + +class HTMLCalendar(Calendar): + def formatday(self, day: int, weekday: int) -> str: ... + def formatweek(self, theweek: int) -> str: ... + def formatweekday(self, day: int) -> str: ... + def formatweekheader(self) -> str: ... + def formatmonthname(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ... + def formatmonth(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ... + def formatyear(self, theyear: int, width: int = ...) -> str: ... + def formatyearpage(self, theyear: int, width: int = ..., css: Optional[str] = ..., encoding: Optional[str] = ...) -> str: ... + if sys.version_info >= (3, 7): + cssclasses: List[str] + cssclass_noday: str + cssclasses_weekday_head: List[str] + cssclass_month_head: str + cssclass_month: str + cssclass_year: str + cssclass_year_head: str + +if sys.version_info < (3, 0): + class TimeEncoding: + def __init__(self, locale: _LocaleType) -> None: ... + def __enter__(self) -> _LocaleType: ... + def __exit__(self, *args: Any) -> None: ... +else: + class different_locale: + def __init__(self, locale: _LocaleType) -> None: ... + def __enter__(self) -> _LocaleType: ... + def __exit__(self, *args: Any) -> None: ... + +class LocaleTextCalendar(TextCalendar): + def __init__(self, firstweekday: int = ..., locale: Optional[_LocaleType] = ...) -> None: ... + def formatweekday(self, day: int, width: int) -> str: ... + def formatmonthname(self, theyear: int, themonth: int, width: int, withyear: bool = ...) -> str: ... + +class LocaleHTMLCalendar(HTMLCalendar): + def __init__(self, firstweekday: int = ..., locale: Optional[_LocaleType] = ...) -> None: ... + def formatweekday(self, day: int) -> str: ... + def formatmonthname(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ... + +c: TextCalendar +def setfirstweekday(firstweekday: int) -> None: ... +def format(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ... +def formatstring(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ... +def timegm(tuple: Union[Tuple[int, ...], struct_time]) -> int: ... + +# Data attributes +day_name: Sequence[str] +day_abbr: Sequence[str] +month_name: Sequence[str] +month_abbr: Sequence[str] + +# Below constants are not in docs or __all__, but enough people have used them +# they are now effectively public. + +MONDAY: int +TUESDAY: int +WEDNESDAY: int +THURSDAY: int +FRIDAY: int +SATURDAY: int +SUNDAY: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/cgi.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/cgi.pyi new file mode 100644 index 00000000..5d901d93 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/cgi.pyi @@ -0,0 +1,122 @@ +import sys +from typing import Any, AnyStr, Dict, IO, Iterable, List, Mapping, Optional, Tuple, TypeVar, Union + +_T = TypeVar('_T', bound=FieldStorage) + +def parse(fp: IO[Any] = ..., environ: Mapping[str, str] = ..., + keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ... +if sys.version_info < (3, 8): + def parse_qs(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ... + def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ... +if sys.version_info >= (3, 7): + def parse_multipart(fp: IO[Any], pdict: Mapping[str, bytes], encoding: str = ..., errors: str = ...) -> Dict[str, List[Any]]: ... +else: + def parse_multipart(fp: IO[Any], pdict: Mapping[str, bytes]) -> Dict[str, List[bytes]]: ... +def parse_header(s: str) -> Tuple[str, Dict[str, str]]: ... +def test(environ: Mapping[str, str] = ...) -> None: ... +def print_environ(environ: Mapping[str, str] = ...) -> None: ... +def print_form(form: Dict[str, Any]) -> None: ... +def print_directory() -> None: ... +def print_environ_usage() -> None: ... +if sys.version_info < (3,): + def escape(s: AnyStr, quote: bool = ...) -> AnyStr: ... +elif sys.version_info < (3, 8): + def escape(s: str, quote: bool = ...) -> str: ... + +class MiniFieldStorage: + # The first five "Any" attributes here are always None, but mypy doesn't support that + filename: Any + list: Any + type: Any + file: Optional[IO[bytes]] + type_options: Dict[Any, Any] + disposition: Any + disposition_options: Dict[Any, Any] + headers: Dict[Any, Any] + name: Any + value: Any + + def __init__(self, name: Any, value: Any) -> None: ... + def __repr__(self) -> str: ... + + +class FieldStorage(object): + FieldStorageClass: Optional[type] + keep_blank_values: int + strict_parsing: int + qs_on_post: Optional[str] + headers: Mapping[str, str] + fp: IO[bytes] + encoding: str + errors: str + outerboundary: bytes + bytes_read: int + limit: Optional[int] + disposition: str + disposition_options: Dict[str, str] + filename: Optional[str] + file: Optional[IO[bytes]] + type: str + type_options: Dict[str, str] + innerboundary: bytes + length: int + done: int + list: Optional[List[Any]] + value: Union[None, bytes, List[Any]] + + if sys.version_info >= (3, 0): + def __init__(self, fp: IO[Any] = ..., headers: Mapping[str, str] = ..., outerboundary: bytes = ..., + environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ..., + limit: int = ..., encoding: str = ..., errors: str = ...) -> None: ... + else: + def __init__(self, fp: IO[Any] = ..., headers: Mapping[str, str] = ..., outerboundary: bytes = ..., + environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...) -> None: ... + + if sys.version_info >= (3, 0): + def __enter__(self: _T) -> _T: ... + def __exit__(self, *args: Any) -> None: ... + def __repr__(self) -> str: ... + def __iter__(self) -> Iterable[str]: ... + def __getitem__(self, key: str) -> Any: ... + def getvalue(self, key: str, default: Any = ...) -> Any: ... + def getfirst(self, key: str, default: Any = ...) -> Any: ... + def getlist(self, key: str) -> List[Any]: ... + def keys(self) -> List[str]: ... + if sys.version_info < (3, 0): + def has_key(self, key: str) -> bool: ... + def __contains__(self, key: str) -> bool: ... + def __len__(self) -> int: ... + if sys.version_info >= (3, 0): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + if sys.version_info >= (3, 0): + # In Python 3 it returns bytes or str IO depending on an internal flag + def make_file(self) -> IO[Any]: ... + else: + # In Python 2 it always returns bytes and ignores the "binary" flag + def make_file(self, binary: Any = ...) -> IO[bytes]: ... + + +if sys.version_info < (3, 0): + from UserDict import UserDict + + class FormContentDict(UserDict[str, List[str]]): + query_string: str + def __init__(self, environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...) -> None: ... + + class SvFormContentDict(FormContentDict): + def getlist(self, key: Any) -> Any: ... + + class InterpFormContentDict(SvFormContentDict): ... + + class FormContent(FormContentDict): + # TODO this should have + # def values(self, key: Any) -> Any: ... + # but this is incompatible with the supertype, and adding '# type: ignore' triggers + # a parse error in pytype (https://github.com/google/pytype/issues/53) + def indexed_value(self, key: Any, location: int) -> Any: ... + def value(self, key: Any) -> Any: ... + def length(self, key: Any) -> int: ... + def stripped(self, key: Any) -> Any: ... + def pars(self) -> Dict[Any, Any]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/cgitb.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/cgitb.pyi new file mode 100644 index 00000000..ded055cb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/cgitb.pyi @@ -0,0 +1,33 @@ + +from typing import Dict, Any, List, Tuple, Optional, Callable, Type, Union, IO, AnyStr, TypeVar +from types import FrameType, TracebackType +import sys + + +_T = TypeVar("_T") +_ExcInfo = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]] +if sys.version_info >= (3, 6): + from os import PathLike + _Path = Union[_T, PathLike[_T]] +else: + _Path = Union[_T] + + +def reset() -> str: ... # undocumented +def small(text: str) -> str: ... # undocumented +def strong(text: str) -> str: ... # undocumented +def grey(text: str) -> str: ... # undocumented +def lookup(name: str, frame: FrameType, locals: Dict[str, Any]) -> Tuple[Optional[str], Any]: ... # undocumented +def scanvars(reader: Callable[[], bytes], frame: FrameType, locals: Dict[str, Any]) -> List[Tuple[str, Optional[str], Any]]: ... # undocumented +def html(einfo: _ExcInfo, context: int = ...) -> str: ... +def text(einfo: _ExcInfo, context: int = ...) -> str: ... + +class Hook: # undocumented + + def __init__(self, display: int = ..., logdir: Optional[_Path[AnyStr]] = ..., context: int = ..., file: Optional[IO[str]] = ..., format: str = ...) -> None: ... + def __call__(self, etype: Optional[Type[BaseException]], evalue: Optional[BaseException], etb: Optional[TracebackType]) -> None: ... + def handle(self, info: Optional[_ExcInfo] = ...) -> None: ... + +def handler(info: Optional[_ExcInfo] = ...) -> None: ... + +def enable(display: int = ..., logdir: Optional[_Path[AnyStr]] = ..., context: int = ..., format: str = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/chunk.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/chunk.pyi new file mode 100644 index 00000000..2337f00c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/chunk.pyi @@ -0,0 +1,23 @@ +# Source(py2): https://hg.python.org/cpython/file/2.7/Lib/chunk.py +# Source(py3): https://github.com/python/cpython/blob/master/Lib/chunk.py + +from typing import IO + +class Chunk: + closed: bool + align: bool + file: IO[bytes] + chunkname: bytes + chunksize: int + size_read: int + offset: int + seekable: bool + def __init__(self, file: IO[bytes], align: bool = ..., bigendian: bool = ..., inclheader: bool = ...) -> None: ... + def getname(self) -> bytes: ... + def getsize(self) -> int: ... + def close(self) -> None: ... + def isatty(self) -> bool: ... + def seek(self, pos: int, whence: int = ...) -> None: ... + def tell(self) -> int: ... + def read(self, size: int = ...) -> bytes: ... + def skip(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/cmath.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/cmath.pyi new file mode 100644 index 00000000..4b15f0b7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/cmath.pyi @@ -0,0 +1,42 @@ +"""Stub file for the 'cmath' module.""" + +import sys +from typing import SupportsComplex, SupportsFloat, Tuple, Union + +e: float +pi: float +if sys.version_info >= (3, 6): + inf: float + infj: complex + nan: float + nanj: complex + tau: float + +_C = Union[SupportsFloat, SupportsComplex] + +def acos(x: _C) -> complex: ... +def acosh(x: _C) -> complex: ... +def asin(x: _C) -> complex: ... +def asinh(x: _C) -> complex: ... +def atan(x: _C) -> complex: ... +def atanh(x: _C) -> complex: ... +def cos(x: _C) -> complex: ... +def cosh(x: _C) -> complex: ... +def exp(x: _C) -> complex: ... +if sys.version_info >= (3, 5): + def isclose(a: _C, b: _C, *, rel_tol: SupportsFloat = ..., abs_tol: SupportsFloat = ...) -> bool: ... +def isinf(z: _C) -> bool: ... +def isnan(z: _C) -> bool: ... +def log(x: _C, base: _C = ...) -> complex: ... +def log10(x: _C) -> complex: ... +def phase(z: _C) -> float: ... +def polar(z: _C) -> Tuple[float, float]: ... +def rect(r: float, phi: float) -> complex: ... +def sin(x: _C) -> complex: ... +def sinh(x: _C) -> complex: ... +def sqrt(x: _C) -> complex: ... +def tan(x: _C) -> complex: ... +def tanh(x: _C) -> complex: ... + +if sys.version_info >= (3,): + def isfinite(z: _C) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/cmd.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/cmd.pyi new file mode 100644 index 00000000..c2aeb75b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/cmd.pyi @@ -0,0 +1,41 @@ +# Stubs for cmd (Python 2/3) + +from typing import Any, Optional, Text, IO, List, Callable, Tuple + +class Cmd: + prompt: str + identchars: str + ruler: str + lastcmd: str + intro: Optional[Any] + doc_leader: str + doc_header: str + misc_header: str + undoc_header: str + nohelp: str + use_rawinput: bool + stdin: IO[str] + stdout: IO[str] + cmdqueue: List[str] + completekey: str + def __init__(self, completekey: str = ..., stdin: Optional[IO[str]] = ..., stdout: Optional[IO[str]] = ...) -> None: ... + old_completer: Optional[Callable[[str, int], Optional[str]]] + def cmdloop(self, intro: Optional[Any] = ...) -> None: ... + def precmd(self, line: str) -> str: ... + def postcmd(self, stop: bool, line: str) -> bool: ... + def preloop(self) -> None: ... + def postloop(self) -> None: ... + def parseline(self, line: str) -> Tuple[Optional[str], Optional[str], str]: ... + def onecmd(self, line: str) -> bool: ... + def emptyline(self) -> bool: ... + def default(self, line: str) -> bool: ... + def completedefault(self, *ignored: Any) -> List[str]: ... + def completenames(self, text: str, *ignored: Any) -> List[str]: ... + completion_matches: Optional[List[str]] + def complete(self, text: str, state: int) -> Optional[List[str]]: ... + def get_names(self) -> List[str]: ... + # Only the first element of args matters. + def complete_help(self, *args: Any) -> List[str]: ... + def do_help(self, arg: Optional[str]) -> None: ... + def print_topics(self, header: str, cmds: Optional[List[str]], cmdlen: Any, maxcol: int) -> None: ... + def columnize(self, list: Optional[List[str]], displaywidth: int = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/code.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/code.pyi new file mode 100644 index 00000000..293ab9b9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/code.pyi @@ -0,0 +1,38 @@ +# Stubs for code + +import sys +from typing import Any, Callable, Mapping, Optional +from types import CodeType + +class InteractiveInterpreter: + def __init__(self, locals: Optional[Mapping[str, Any]] = ...) -> None: ... + def runsource(self, source: str, filename: str = ..., + symbol: str = ...) -> bool: ... + def runcode(self, code: CodeType) -> None: ... + def showsyntaxerror(self, filename: Optional[str] = ...) -> None: ... + def showtraceback(self) -> None: ... + def write(self, data: str) -> None: ... + +class InteractiveConsole(InteractiveInterpreter): + def __init__(self, locals: Optional[Mapping[str, Any]] = ..., + filename: str = ...) -> None: ... + if sys.version_info >= (3, 6): + def interact(self, banner: Optional[str] = ..., + exitmsg: Optional[str] = ...) -> None: ... + else: + def interact(self, banner: Optional[str] = ...) -> None: ... + def push(self, line: str) -> bool: ... + def resetbuffer(self) -> None: ... + def raw_input(self, prompt: str = ...) -> str: ... + +if sys.version_info >= (3, 6): + def interact(banner: Optional[str] = ..., + readfunc: Optional[Callable[[str], str]] = ..., + local: Optional[Mapping[str, Any]] = ..., + exitmsg: Optional[str] = ...) -> None: ... +else: + def interact(banner: Optional[str] = ..., + readfunc: Optional[Callable[[str], str]] = ..., + local: Optional[Mapping[str, Any]] = ...) -> None: ... +def compile_command(source: str, filename: str = ..., + symbol: str = ...) -> Optional[CodeType]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/codecs.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/codecs.pyi new file mode 100644 index 00000000..7c06ee93 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/codecs.pyi @@ -0,0 +1,244 @@ +import sys +from typing import Any, BinaryIO, Callable, Generator, IO, Iterable, Iterator, List, Optional, Protocol, Text, TextIO, Tuple, Type, TypeVar, Union + +from abc import abstractmethod +import types + +# TODO: this only satisfies the most common interface, where +# bytes (py2 str) is the raw form and str (py2 unicode) is the cooked form. +# In the long run, both should become template parameters maybe? +# There *are* bytes->bytes and str->str encodings in the standard library. +# They are much more common in Python 2 than in Python 3. + +_Decoded = Text +_Encoded = bytes + +class _Encoder(Protocol): + def __call__(self, input: _Decoded, errors: str = ...) -> Tuple[_Encoded, int]: ... # signature of Codec().encode +class _Decoder(Protocol): + def __call__(self, input: _Encoded, errors: str = ...) -> Tuple[_Decoded, int]: ... # signature of Codec().decode + +class _StreamReader(Protocol): + def __call__(self, stream: IO[_Encoded], errors: str = ...) -> StreamReader: ... +class _StreamWriter(Protocol): + def __call__(self, stream: IO[_Encoded], errors: str = ...) -> StreamWriter: ... + +class _IncrementalEncoder(Protocol): + def __call__(self, errors: str = ...) -> IncrementalEncoder: ... +class _IncrementalDecoder(Protocol): + def __call__(self, errors: str = ...) -> IncrementalDecoder: ... + +def encode(obj: _Decoded, encoding: str = ..., errors: str = ...) -> _Encoded: ... +def decode(obj: _Encoded, encoding: str = ..., errors: str = ...) -> _Decoded: ... +def lookup(encoding: str) -> CodecInfo: ... +def utf_16_be_decode(__obj: _Encoded, __errors: str = ..., __final: bool = ...) -> Tuple[_Decoded, int]: ... # undocumented +def utf_16_be_encode(__obj: _Decoded, __errors: str = ...) -> Tuple[_Encoded, int]: ... # undocumented + +class CodecInfo(Tuple[_Encoder, _Decoder, _StreamReader, _StreamWriter]): + @property + def encode(self) -> _Encoder: ... + @property + def decode(self) -> _Decoder: ... + @property + def streamreader(self) -> _StreamReader: ... + @property + def streamwriter(self) -> _StreamWriter: ... + @property + def incrementalencoder(self) -> _IncrementalEncoder: ... + @property + def incrementaldecoder(self) -> _IncrementalDecoder: ... + name: str + def __init__( + self, + encode: _Encoder, + decode: _Decoder, + streamreader: _StreamReader = ..., + streamwriter: _StreamWriter = ..., + incrementalencoder: _IncrementalEncoder = ..., + incrementaldecoder: _IncrementalDecoder = ..., + name: str = ..., + ) -> None: ... + +def getencoder(encoding: str) -> _Encoder: ... +def getdecoder(encoding: str) -> _Decoder: ... +def getincrementalencoder(encoding: str) -> _IncrementalEncoder: ... +def getincrementaldecoder(encoding: str) -> _IncrementalDecoder: ... +def getreader(encoding: str) -> _StreamReader: ... +def getwriter(encoding: str) -> _StreamWriter: ... +def register(search_function: Callable[[str], Optional[CodecInfo]]) -> None: ... +def open(filename: str, mode: str = ..., encoding: str = ..., errors: str = ..., buffering: int = ...) -> StreamReaderWriter: ... +def EncodedFile(file: IO[_Encoded], data_encoding: str, file_encoding: str = ..., errors: str = ...) -> StreamRecoder: ... +def iterencode(iterator: Iterable[_Decoded], encoding: str, errors: str = ...) -> Generator[_Encoded, None, None]: ... +def iterdecode(iterator: Iterable[_Encoded], encoding: str, errors: str = ...) -> Generator[_Decoded, None, None]: ... + +BOM: bytes +BOM_BE: bytes +BOM_LE: bytes +BOM_UTF8: bytes +BOM_UTF16: bytes +BOM_UTF16_BE: bytes +BOM_UTF16_LE: bytes +BOM_UTF32: bytes +BOM_UTF32_BE: bytes +BOM_UTF32_LE: bytes + +# It is expected that different actions be taken depending on which of the +# three subclasses of `UnicodeError` is actually ...ed. However, the Union +# is still needed for at least one of the cases. +def register_error(name: str, error_handler: Callable[[UnicodeError], Tuple[Union[str, bytes], int]]) -> None: ... +def lookup_error(name: str) -> Callable[[UnicodeError], Tuple[Union[str, bytes], int]]: ... +def strict_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: ... +def replace_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: ... +def ignore_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: ... +def xmlcharrefreplace_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: ... +def backslashreplace_errors(exception: UnicodeError) -> Tuple[Union[str, bytes], int]: ... + +class Codec: + # These are sort of @abstractmethod but sort of not. + # The StreamReader and StreamWriter subclasses only implement one. + def encode(self, input: _Decoded, errors: str = ...) -> Tuple[_Encoded, int]: ... + def decode(self, input: _Encoded, errors: str = ...) -> Tuple[_Decoded, int]: ... + +class IncrementalEncoder: + errors: str + def __init__(self, errors: str = ...) -> None: ... + @abstractmethod + def encode(self, object: _Decoded, final: bool = ...) -> _Encoded: ... + def reset(self) -> None: ... + # documentation says int but str is needed for the subclass. + def getstate(self) -> Union[int, _Decoded]: ... + def setstate(self, state: Union[int, _Decoded]) -> None: ... + +class IncrementalDecoder: + errors: str + def __init__(self, errors: str = ...) -> None: ... + @abstractmethod + def decode(self, object: _Encoded, final: bool = ...) -> _Decoded: ... + def reset(self) -> None: ... + def getstate(self) -> Tuple[_Encoded, int]: ... + def setstate(self, state: Tuple[_Encoded, int]) -> None: ... + +# These are not documented but used in encodings/*.py implementations. +class BufferedIncrementalEncoder(IncrementalEncoder): + buffer: str + def __init__(self, errors: str = ...) -> None: ... + @abstractmethod + def _buffer_encode(self, input: _Decoded, errors: str, final: bool) -> _Encoded: ... + def encode(self, input: _Decoded, final: bool = ...) -> _Encoded: ... + +class BufferedIncrementalDecoder(IncrementalDecoder): + buffer: bytes + def __init__(self, errors: str = ...) -> None: ... + @abstractmethod + def _buffer_decode(self, input: _Encoded, errors: str, final: bool) -> Tuple[_Decoded, int]: ... + def decode(self, object: _Encoded, final: bool = ...) -> _Decoded: ... + +_SW = TypeVar("_SW", bound=StreamWriter) + +# TODO: it is not possible to specify the requirement that all other +# attributes and methods are passed-through from the stream. +class StreamWriter(Codec): + errors: str + def __init__(self, stream: IO[_Encoded], errors: str = ...) -> None: ... + def write(self, obj: _Decoded) -> None: ... + def writelines(self, list: Iterable[_Decoded]) -> None: ... + def reset(self) -> None: ... + def __enter__(self: _SW) -> _SW: ... + def __exit__( + self, typ: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[types.TracebackType] + ) -> None: ... + def __getattr__(self, name: str) -> Any: ... + +_SR = TypeVar("_SR", bound=StreamReader) + +class StreamReader(Codec): + errors: str + def __init__(self, stream: IO[_Encoded], errors: str = ...) -> None: ... + def read(self, size: int = ..., chars: int = ..., firstline: bool = ...) -> _Decoded: ... + def readline(self, size: int = ..., keepends: bool = ...) -> _Decoded: ... + def readlines(self, sizehint: int = ..., keepends: bool = ...) -> List[_Decoded]: ... + def reset(self) -> None: ... + def __enter__(self: _SR) -> _SR: ... + def __exit__( + self, typ: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[types.TracebackType] + ) -> None: ... + def __iter__(self) -> Iterator[_Decoded]: ... + def __getattr__(self, name: str) -> Any: ... + +_T = TypeVar("_T", bound=StreamReaderWriter) + +# Doesn't actually inherit from TextIO, but wraps a BinaryIO to provide text reading and writing +# and delegates attributes to the underlying binary stream with __getattr__. +class StreamReaderWriter(TextIO): + def __init__(self, stream: IO[_Encoded], Reader: _StreamReader, Writer: _StreamWriter, errors: str = ...) -> None: ... + def read(self, size: int = ...) -> _Decoded: ... + def readline(self, size: Optional[int] = ...) -> _Decoded: ... + def readlines(self, sizehint: Optional[int] = ...) -> List[_Decoded]: ... + if sys.version_info >= (3,): + def __next__(self) -> Text: ... + else: + def next(self) -> Text: ... + def __iter__(self: _T) -> _T: ... + # This actually returns None, but that's incompatible with the supertype + def write(self, data: _Decoded) -> int: ... + def writelines(self, list: Iterable[_Decoded]) -> None: ... + def reset(self) -> None: ... + # Same as write() + def seek(self, offset: int, whence: int = ...) -> int: ... + def __enter__(self: _T) -> _T: ... + def __exit__( + self, typ: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[types.TracebackType] + ) -> None: ... + def __getattr__(self, name: str) -> Any: ... + # These methods don't actually exist directly, but they are needed to satisfy the TextIO + # interface. At runtime, they are delegated through __getattr__. + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def readable(self) -> bool: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def writable(self) -> bool: ... + +_SRT = TypeVar("_SRT", bound=StreamRecoder) + +class StreamRecoder(BinaryIO): + def __init__( + self, + stream: IO[_Encoded], + encode: _Encoder, + decode: _Decoder, + Reader: _StreamReader, + Writer: _StreamWriter, + errors: str = ..., + ) -> None: ... + def read(self, size: int = ...) -> bytes: ... + def readline(self, size: Optional[int] = ...) -> bytes: ... + def readlines(self, sizehint: Optional[int] = ...) -> List[bytes]: ... + if sys.version_info >= (3,): + def __next__(self) -> bytes: ... + else: + def next(self) -> bytes: ... + def __iter__(self: _SRT) -> _SRT: ... + def write(self, data: bytes) -> int: ... + def writelines(self, list: Iterable[bytes]) -> int: ... # type: ignore # it's supposed to return None + def reset(self) -> None: ... + def __getattr__(self, name: str) -> Any: ... + def __enter__(self: _SRT) -> _SRT: ... + def __exit__( + self, type: Optional[Type[BaseException]], value: Optional[BaseException], tb: Optional[types.TracebackType] + ) -> None: ... + # These methods don't actually exist directly, but they are needed to satisfy the BinaryIO + # interface. At runtime, they are delegated through __getattr__. + def seek(self, offset: int, whence: int = ...) -> int: ... + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def readable(self) -> bool: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def writable(self) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/codeop.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/codeop.pyi new file mode 100644 index 00000000..0e1129e6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/codeop.pyi @@ -0,0 +1,17 @@ +# Source(py2): https://hg.python.org/cpython/file/2.7/Lib/codeop.py +# Source(py3): https://github.com/python/cpython/blob/master/Lib/codeop.py + +from types import CodeType +from typing import Optional + +def compile_command(source: str, filename: str = ..., symbol: str = ...) -> Optional[CodeType]: ... + +class Compile: + flags: int + def __init__(self) -> None: ... + def __call__(self, source: str, filename: str, symbol: str) -> CodeType: ... + +class CommandCompiler: + compiler: Compile + def __init__(self) -> None: ... + def __call__(self, source: str, filename: str = ..., symbol: str = ...) -> Optional[CodeType]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/colorsys.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/colorsys.pyi new file mode 100644 index 00000000..c8b55918 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/colorsys.pyi @@ -0,0 +1,15 @@ +# Stubs for colorsys + +from typing import Tuple + +def rgb_to_yiq(r: float, g: float, b: float) -> Tuple[float, float, float]: ... +def yiq_to_rgb(y: float, i: float, q: float) -> Tuple[float, float, float]: ... +def rgb_to_hls(r: float, g: float, b: float) -> Tuple[float, float, float]: ... +def hls_to_rgb(h: float, l: float, s: float) -> Tuple[float, float, float]: ... +def rgb_to_hsv(r: float, g: float, b: float) -> Tuple[float, float, float]: ... +def hsv_to_rgb(h: float, s: float, v: float) -> Tuple[float, float, float]: ... + +# TODO undocumented +ONE_SIXTH: float +ONE_THIRD: float +TWO_THIRD: float diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/contextlib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/contextlib.pyi new file mode 100644 index 00000000..2832d94b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/contextlib.pyi @@ -0,0 +1,111 @@ +# Stubs for contextlib + +from typing import ( + Any, Callable, Generator, IO, Iterable, Iterator, Optional, Type, + Generic, TypeVar, overload +) +from types import TracebackType +import sys +# Aliased here for backwards compatibility; TODO eventually remove this +from typing import ContextManager as ContextManager + +if sys.version_info >= (3, 5): + from typing import AsyncContextManager, AsyncIterator + +if sys.version_info >= (3, 6): + from typing import ContextManager as AbstractContextManager +if sys.version_info >= (3, 7): + from typing import AsyncContextManager as AbstractAsyncContextManager + +_T = TypeVar('_T') +_F = TypeVar('_F', bound=Callable[..., Any]) + +_ExitFunc = Callable[[Optional[Type[BaseException]], + Optional[BaseException], + Optional[TracebackType]], bool] +_CM_EF = TypeVar('_CM_EF', ContextManager[Any], _ExitFunc) + +if sys.version_info >= (3, 2): + class _GeneratorContextManager(ContextManager[_T], Generic[_T]): + def __call__(self, func: _F) -> _F: ... + def contextmanager(func: Callable[..., Iterator[_T]]) -> Callable[..., _GeneratorContextManager[_T]]: ... +else: + class GeneratorContextManager(ContextManager[_T], Generic[_T]): + def __call__(self, func: _F) -> _F: ... + def contextmanager(func: Callable[..., Iterator[_T]]) -> Callable[..., ContextManager[_T]]: ... + +if sys.version_info >= (3, 7): + def asynccontextmanager(func: Callable[..., AsyncIterator[_T]]) -> Callable[..., AsyncContextManager[_T]]: ... + +if sys.version_info < (3,): + def nested(*mgr: ContextManager[Any]) -> ContextManager[Iterable[Any]]: ... + +class closing(ContextManager[_T], Generic[_T]): + def __init__(self, thing: _T) -> None: ... + +if sys.version_info >= (3, 4): + class suppress(ContextManager[None]): + def __init__(self, *exceptions: Type[BaseException]) -> None: ... + def __exit__(self, exctype: Optional[Type[BaseException]], + excinst: Optional[BaseException], + exctb: Optional[TracebackType]) -> bool: ... + + class redirect_stdout(ContextManager[None]): + def __init__(self, new_target: Optional[IO[str]]) -> None: ... + +if sys.version_info >= (3, 5): + class redirect_stderr(ContextManager[None]): + def __init__(self, new_target: Optional[IO[str]]) -> None: ... + +if sys.version_info >= (3,): + class ContextDecorator: + def __call__(self, func: Callable[..., None]) -> Callable[..., ContextManager[None]]: ... + + _U = TypeVar('_U', bound=ExitStack) + + class ExitStack(ContextManager[ExitStack]): + def __init__(self) -> None: ... + def enter_context(self, cm: ContextManager[_T]) -> _T: ... + def push(self, exit: _CM_EF) -> _CM_EF: ... + def callback(self, callback: Callable[..., Any], + *args: Any, **kwds: Any) -> Callable[..., Any]: ... + def pop_all(self: _U) -> _U: ... + def close(self) -> None: ... + def __enter__(self: _U) -> _U: ... + def __exit__(self, __exc_type: Optional[Type[BaseException]], + __exc_value: Optional[BaseException], + __traceback: Optional[TracebackType]) -> bool: ... + +if sys.version_info >= (3, 7): + from typing import Awaitable + + _S = TypeVar('_S', bound=AsyncExitStack) + + _ExitCoroFunc = Callable[[Optional[Type[BaseException]], + Optional[BaseException], + Optional[TracebackType]], Awaitable[bool]] + _CallbackCoroFunc = Callable[..., Awaitable[Any]] + _ACM_EF = TypeVar('_ACM_EF', AsyncContextManager[Any], _ExitCoroFunc) + + class AsyncExitStack(AsyncContextManager[AsyncExitStack]): + def __init__(self) -> None: ... + def enter_context(self, cm: ContextManager[_T]) -> _T: ... + def enter_async_context(self, cm: AsyncContextManager[_T]) -> Awaitable[_T]: ... + def push(self, exit: _CM_EF) -> _CM_EF: ... + def push_async_exit(self, exit: _ACM_EF) -> _ACM_EF: ... + def callback(self, callback: Callable[..., Any], + *args: Any, **kwds: Any) -> Callable[..., Any]: ... + def push_async_callback(self, callback: _CallbackCoroFunc, + *args: Any, **kwds: Any) -> _CallbackCoroFunc: ... + def pop_all(self: _S) -> _S: ... + def aclose(self) -> Awaitable[None]: ... + def __aenter__(self: _S) -> Awaitable[_S]: ... + def __aexit__(self, __exc_type: Optional[Type[BaseException]], + __exc_value: Optional[BaseException], + __traceback: Optional[TracebackType]) -> Awaitable[bool]: ... + +if sys.version_info >= (3, 7): + @overload + def nullcontext(enter_result: _T) -> ContextManager[_T]: ... + @overload + def nullcontext() -> ContextManager[None]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/copy.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/copy.pyi new file mode 100644 index 00000000..523802a8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/copy.pyi @@ -0,0 +1,14 @@ +# Stubs for copy + +from typing import TypeVar, Optional, Dict, Any + +_T = TypeVar('_T') + +# None in CPython but non-None in Jython +PyStringMap: Any + +# Note: memo and _nil are internal kwargs. +def deepcopy(x: _T, memo: Optional[Dict[int, _T]] = ..., _nil: Any = ...) -> _T: ... +def copy(x: _T) -> _T: ... +class Error(Exception): ... +error = Error diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/crypt.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/crypt.pyi new file mode 100644 index 00000000..621ce0bd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/crypt.pyi @@ -0,0 +1,22 @@ +import sys +from typing import List, Optional, Union + +if sys.version_info >= (3, 3): + class _Method: ... + + METHOD_CRYPT: _Method + METHOD_MD5: _Method + METHOD_SHA256: _Method + METHOD_SHA512: _Method + if sys.version_info >= (3, 7): + METHOD_BLOWFISH: _Method + + methods: List[_Method] + + if sys.version_info >= (3, 7): + def mksalt(method: Optional[_Method] = ..., *, rounds: Optional[int] = ...) -> str: ... + else: + def mksalt(method: Optional[_Method] = ...) -> str: ... + def crypt(word: str, salt: Optional[Union[str, _Method]] = ...) -> str: ... +else: + def crypt(word: str, salt: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/csv.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/csv.pyi new file mode 100644 index 00000000..f2493db0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/csv.pyi @@ -0,0 +1,105 @@ +import sys +from _csv import ( + QUOTE_ALL as QUOTE_ALL, + QUOTE_MINIMAL as QUOTE_MINIMAL, + QUOTE_NONE as QUOTE_NONE, + QUOTE_NONNUMERIC as QUOTE_NONNUMERIC, + Error as Error, + _reader, + _writer, + field_size_limit as field_size_limit, + get_dialect as get_dialect, + list_dialects as list_dialects, + reader as reader, + register_dialect as register_dialect, + unregister_dialect as unregister_dialect, + writer as writer, +) +from collections import OrderedDict +from typing import Any, Dict, Iterable, Iterator, List, Mapping, Optional, Sequence, Text, Type, Union + +_Dialect = Union[str, Dialect, Type[Dialect]] +_DictRow = Mapping[str, Any] + +class Dialect(object): + delimiter: str + quotechar: Optional[str] + escapechar: Optional[str] + doublequote: bool + skipinitialspace: bool + lineterminator: str + quoting: int + def __init__(self) -> None: ... + +class excel(Dialect): + delimiter: str + quotechar: str + doublequote: bool + skipinitialspace: bool + lineterminator: str + quoting: int + +class excel_tab(excel): + delimiter: str + +if sys.version_info >= (3,): + class unix_dialect(Dialect): + delimiter: str + quotechar: str + doublequote: bool + skipinitialspace: bool + lineterminator: str + quoting: int + +if sys.version_info >= (3, 6): + _DRMapping = OrderedDict[str, str] +else: + _DRMapping = Dict[str, str] + +class DictReader(Iterator[_DRMapping]): + restkey: Optional[str] + restval: Optional[str] + reader: _reader + dialect: _Dialect + line_num: int + fieldnames: Sequence[str] + def __init__( + self, + f: Iterable[Text], + fieldnames: Optional[Sequence[str]] = ..., + restkey: Optional[str] = ..., + restval: Optional[str] = ..., + dialect: _Dialect = ..., + *args: Any, + **kwds: Any, + ) -> None: ... + def __iter__(self) -> DictReader: ... + if sys.version_info >= (3,): + def __next__(self) -> _DRMapping: ... + else: + def next(self) -> _DRMapping: ... + +class DictWriter(object): + fieldnames: Sequence[str] + restval: Optional[Any] + extrasaction: str + writer: _writer + def __init__( + self, + f: Any, + fieldnames: Iterable[str], + restval: Optional[Any] = ..., + extrasaction: str = ..., + dialect: _Dialect = ..., + *args: Any, + **kwds: Any, + ) -> None: ... + def writeheader(self) -> None: ... + def writerow(self, rowdict: _DictRow) -> None: ... + def writerows(self, rowdicts: Iterable[_DictRow]) -> None: ... + +class Sniffer(object): + preferred: List[str] + def __init__(self) -> None: ... + def sniff(self, sample: str, delimiters: Optional[str] = ...) -> Type[Dialect]: ... + def has_header(self, sample: str) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ctypes/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ctypes/__init__.pyi new file mode 100644 index 00000000..d07efd65 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ctypes/__init__.pyi @@ -0,0 +1,292 @@ +# Stubs for ctypes + +from array import array +from typing import ( + Any, Callable, ClassVar, Iterator, Iterable, List, Mapping, Optional, Sequence, Sized, Text, + Tuple, Type, Generic, TypeVar, overload, +) +from typing import Union as _UnionT +import sys + +_T = TypeVar('_T') +_DLLT = TypeVar('_DLLT', bound=CDLL) +_CT = TypeVar('_CT', bound=_CData) + + +RTLD_GLOBAL: int = ... +RTLD_LOCAL: int = ... +DEFAULT_MODE: int = ... + + +class CDLL(object): + _func_flags_: ClassVar[int] = ... + _func_restype_: ClassVar[_CData] = ... + _name: str = ... + _handle: int = ... + _FuncPtr: Type[_FuncPointer] = ... + def __init__( + self, + name: str, + mode: int = ..., + handle: Optional[int] = ..., + use_errno: bool = ..., + use_last_error: bool = ..., + winmode: Optional[int] = ..., + ) -> None: ... + def __getattr__(self, name: str) -> _FuncPointer: ... + def __getitem__(self, name: str) -> _FuncPointer: ... +if sys.platform == 'win32': + class OleDLL(CDLL): ... + class WinDLL(CDLL): ... +class PyDLL(CDLL): ... + +class LibraryLoader(Generic[_DLLT]): + def __init__(self, dlltype: Type[_DLLT]) -> None: ... + def __getattr__(self, name: str) -> _DLLT: ... + def __getitem__(self, name: str) -> _DLLT: ... + def LoadLibrary(self, name: str) -> _DLLT: ... + +cdll: LibraryLoader[CDLL] = ... +if sys.platform == 'win32': + windll: LibraryLoader[WinDLL] = ... + oledll: LibraryLoader[OleDLL] = ... +pydll: LibraryLoader[PyDLL] = ... +pythonapi: PyDLL = ... + +# Anything that implements the read-write buffer interface. +# The buffer interface is defined purely on the C level, so we cannot define a normal Protocol +# for it. Instead we have to list the most common stdlib buffer classes in a Union. +_WritableBuffer = _UnionT[bytearray, memoryview, array, _CData] +# Same as _WritableBuffer, but also includes read-only buffer types (like bytes). +_ReadOnlyBuffer = _UnionT[_WritableBuffer, bytes] + +class _CDataMeta(type): + # By default mypy complains about the following two methods, because strictly speaking cls + # might not be a Type[_CT]. However this can never actually happen, because the only class that + # uses _CDataMeta as its metaclass is _CData. So it's safe to ignore the errors here. + def __mul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore + def __rmul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore +class _CData(metaclass=_CDataMeta): + _b_base: int = ... + _b_needsfree_: bool = ... + _objects: Optional[Mapping[Any, int]] = ... + @classmethod + def from_buffer(cls: Type[_CT], source: _WritableBuffer, offset: int = ...) -> _CT: ... + @classmethod + def from_buffer_copy(cls: Type[_CT], source: _ReadOnlyBuffer, offset: int = ...) -> _CT: ... + @classmethod + def from_address(cls: Type[_CT], address: int) -> _CT: ... + @classmethod + def from_param(cls: Type[_CT], obj: Any) -> _UnionT[_CT, _CArgObject]: ... + @classmethod + def in_dll(cls: Type[_CT], library: CDLL, name: str) -> _CT: ... + +class _PointerLike(_CData): ... + +_ECT = Callable[[Optional[Type[_CData]], + _FuncPointer, + Tuple[_CData, ...]], + _CData] +_PF = _UnionT[ + Tuple[int], + Tuple[int, str], + Tuple[int, str, Any] +] +class _FuncPointer(_PointerLike, _CData): + restype: _UnionT[Type[_CData], Callable[[int], None], None] = ... + argtypes: Sequence[Type[_CData]] = ... + errcheck: _ECT = ... + @overload + def __init__(self, address: int) -> None: ... + @overload + def __init__(self, callable: Callable[..., Any]) -> None: ... + @overload + def __init__(self, func_spec: Tuple[_UnionT[str, int], CDLL], + paramflags: Tuple[_PF, ...] = ...) -> None: ... + @overload + def __init__(self, vtlb_index: int, name: str, + paramflags: Tuple[_PF, ...] = ..., + iid: pointer[c_int] = ...) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + +class ArgumentError(Exception): ... + + +def CFUNCTYPE(restype: Optional[Type[_CData]], + *argtypes: Type[_CData], + use_errno: bool = ..., + use_last_error: bool = ...) -> Type[_FuncPointer]: ... +if sys.platform == 'win32': + def WINFUNCTYPE(restype: Optional[Type[_CData]], + *argtypes: Type[_CData], + use_errno: bool = ..., + use_last_error: bool = ...) -> Type[_FuncPointer]: ... +def PYFUNCTYPE(restype: Optional[Type[_CData]], + *argtypes: Type[_CData]) -> Type[_FuncPointer]: ... + +class _CArgObject: ... + +# Any type that can be implicitly converted to c_void_p when passed as a C function argument. +# (bytes is not included here, see below.) +_CVoidPLike = _UnionT[_PointerLike, Array[Any], _CArgObject, int] +# Same as above, but including types known to be read-only (i. e. bytes). +# This distinction is not strictly necessary (ctypes doesn't differentiate between const +# and non-const pointers), but it catches errors like memmove(b'foo', buf, 4) +# when memmove(buf, b'foo', 4) was intended. +_CVoidConstPLike = _UnionT[_CVoidPLike, bytes] + +def addressof(obj: _CData) -> int: ... +def alignment(obj_or_type: _UnionT[_CData, Type[_CData]]) -> int: ... +def byref(obj: _CData, offset: int = ...) -> _CArgObject: ... +_PT = TypeVar('_PT', bound=_PointerLike) +def cast(obj: _UnionT[_CData, _CArgObject], type: Type[_PT]) -> _PT: ... +def create_string_buffer(init_or_size: _UnionT[int, bytes], + size: Optional[int] = ...) -> Array[c_char]: ... +c_buffer = create_string_buffer +def create_unicode_buffer(init_or_size: _UnionT[int, Text], + size: Optional[int] = ...) -> Array[c_wchar]: ... +if sys.platform == 'win32': + def DllCanUnloadNow() -> int: ... + def DllGetClassObject(rclsid: Any, riid: Any, ppv: Any) -> int: ... # TODO not documented + def FormatError(code: int) -> str: ... + def GetLastError() -> int: ... +def get_errno() -> int: ... +if sys.platform == 'win32': + def get_last_error() -> int: ... +def memmove(dst: _CVoidPLike, src: _CVoidConstPLike, count: int) -> None: ... +def memset(dst: _CVoidPLike, c: int, count: int) -> None: ... +def POINTER(type: Type[_CT]) -> Type[pointer[_CT]]: ... + +# The real ctypes.pointer is a function, not a class. The stub version of pointer behaves like +# ctypes._Pointer in that it is the base class for all pointer types. Unlike the real _Pointer, +# it can be instantiated directly (to mimic the behavior of the real pointer function). +class pointer(Generic[_CT], _PointerLike, _CData): + _type_: ClassVar[Type[_CT]] = ... + contents: _CT = ... + def __init__(self, arg: _CT = ...) -> None: ... + @overload + def __getitem__(self, i: int) -> _CT: ... + @overload + def __getitem__(self, s: slice) -> List[_CT]: ... + @overload + def __setitem__(self, i: int, o: _CT) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[_CT]) -> None: ... + +def resize(obj: _CData, size: int) -> None: ... +if sys.version_info < (3,): + def set_conversion_mode(encoding: str, errors: str) -> Tuple[str, str]: ... +def set_errno(value: int) -> int: ... +if sys.platform == 'win32': + def set_last_error(value: int) -> int: ... +def sizeof(obj_or_type: _UnionT[_CData, Type[_CData]]) -> int: ... +def string_at(address: _CVoidConstPLike, size: int = ...) -> bytes: ... +if sys.platform == 'win32': + def WinError(code: Optional[int] = ..., + desc: Optional[str] = ...) -> WindowsError: ... +def wstring_at(address: _CVoidConstPLike, size: int = ...) -> str: ... + +class _SimpleCData(Generic[_T], _CData): + value: _T = ... + def __init__(self, value: _T = ...) -> None: ... + +class c_byte(_SimpleCData[int]): ... + +class c_char(_SimpleCData[bytes]): + def __init__(self, value: _UnionT[int, bytes] = ...) -> None: ... +class c_char_p(_PointerLike, _SimpleCData[Optional[bytes]]): + def __init__(self, value: Optional[_UnionT[int, bytes]] = ...) -> None: ... + +class c_double(_SimpleCData[float]): ... +class c_longdouble(_SimpleCData[float]): ... +class c_float(_SimpleCData[float]): ... + +class c_int(_SimpleCData[int]): ... +class c_int8(_SimpleCData[int]): ... +class c_int16(_SimpleCData[int]): ... +class c_int32(_SimpleCData[int]): ... +class c_int64(_SimpleCData[int]): ... + +class c_long(_SimpleCData[int]): ... +class c_longlong(_SimpleCData[int]): ... + +class c_short(_SimpleCData[int]): ... + +class c_size_t(_SimpleCData[int]): ... +class c_ssize_t(_SimpleCData[int]): ... + +class c_ubyte(_SimpleCData[int]): ... + +class c_uint(_SimpleCData[int]): ... +class c_uint8(_SimpleCData[int]): ... +class c_uint16(_SimpleCData[int]): ... +class c_uint32(_SimpleCData[int]): ... +class c_uint64(_SimpleCData[int]): ... + +class c_ulong(_SimpleCData[int]): ... +class c_ulonglong(_SimpleCData[int]): ... + +class c_ushort(_SimpleCData[int]): ... + +class c_void_p(_PointerLike, _SimpleCData[Optional[int]]): ... + +class c_wchar(_SimpleCData[Text]): ... +class c_wchar_p(_PointerLike, _SimpleCData[Optional[Text]]): + def __init__(self, value: Optional[_UnionT[int, Text]] = ...) -> None: ... + +class c_bool(_SimpleCData[bool]): + def __init__(self, value: bool = ...) -> None: ... + +if sys.platform == 'win32': + class HRESULT(_SimpleCData[int]): ... # TODO undocumented + +class py_object(_SimpleCData[_T]): ... + +class _CField: + offset: int = ... + size: int = ... +class _StructUnionMeta(_CDataMeta): + _fields_: Sequence[_UnionT[Tuple[str, Type[_CData]], Tuple[str, Type[_CData], int]]] = ... + _pack_: int = ... + _anonymous_: Sequence[str] = ... + def __getattr__(self, name: str) -> _CField: ... +class _StructUnionBase(_CData, metaclass=_StructUnionMeta): + def __init__(self, *args: Any, **kw: Any) -> None: ... + def __getattr__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + +class Union(_StructUnionBase): ... +class Structure(_StructUnionBase): ... +class BigEndianStructure(Structure): ... +class LittleEndianStructure(Structure): ... + +class Array(Generic[_CT], _CData): + _length_: ClassVar[int] = ... + _type_: ClassVar[Type[_CT]] = ... + raw: bytes = ... # Note: only available if _CT == c_char + value: Any = ... # Note: bytes if _CT == c_char, Text if _CT == c_wchar, unavailable otherwise + # TODO These methods cannot be annotated correctly at the moment. + # All of these "Any"s stand for the array's element type, but it's not possible to use _CT + # here, because of a special feature of ctypes. + # By default, when accessing an element of an Array[_CT], the returned object has type _CT. + # However, when _CT is a "simple type" like c_int, ctypes automatically "unboxes" the object + # and converts it to the corresponding Python primitive. For example, when accessing an element + # of an Array[c_int], a Python int object is returned, not a c_int. + # This behavior does *not* apply to subclasses of "simple types". + # If MyInt is a subclass of c_int, then accessing an element of an Array[MyInt] returns + # a MyInt, not an int. + # This special behavior is not easy to model in a stub, so for now all places where + # the array element type would belong are annotated with Any instead. + def __init__(self, *args: Any) -> None: ... + @overload + def __getitem__(self, i: int) -> Any: ... + @overload + def __getitem__(self, s: slice) -> List[Any]: ... + @overload + def __setitem__(self, i: int, o: Any) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[Any]) -> None: ... + def __iter__(self) -> Iterator[Any]: ... + # Can't inherit from Sized because the metaclass conflict between + # Sized and _CData prevents using _CDataMeta. + def __len__(self) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ctypes/util.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ctypes/util.pyi new file mode 100644 index 00000000..7077d9d2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ctypes/util.pyi @@ -0,0 +1,8 @@ +# Stubs for ctypes.util + +from typing import Optional +import sys + +def find_library(name: str) -> Optional[str]: ... +if sys.platform == 'win32': + def find_msvcrt() -> Optional[str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ctypes/wintypes.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ctypes/wintypes.pyi new file mode 100644 index 00000000..c5a6226b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ctypes/wintypes.pyi @@ -0,0 +1,209 @@ +from ctypes import ( + _SimpleCData, Array, Structure, c_byte, c_char, c_char_p, c_double, c_float, c_int, c_long, + c_longlong, c_short, c_uint, c_ulong, c_ulonglong, c_ushort, c_void_p, c_wchar, c_wchar_p, + pointer, +) + +BYTE = c_byte +WORD = c_ushort +DWORD = c_ulong +CHAR = c_char +WCHAR = c_wchar +UINT = c_uint +INT = c_int +DOUBLE = c_double +FLOAT = c_float +BOOLEAN = BYTE +BOOL = c_long +class VARIANT_BOOL(_SimpleCData[bool]): ... +ULONG = c_ulong +LONG = c_long +USHORT = c_ushort +SHORT = c_short +LARGE_INTEGER = c_longlong +_LARGE_INTEGER = c_longlong +ULARGE_INTEGER = c_ulonglong +_ULARGE_INTEGER = c_ulonglong + +OLESTR = c_wchar_p +LPOLESTR = c_wchar_p +LPCOLESTR = c_wchar_p +LPWSTR = c_wchar_p +LPCWSTR = c_wchar_p +LPSTR = c_char_p +LPCSTR = c_char_p +LPVOID = c_void_p +LPCVOID = c_void_p + +# These two types are pointer-sized unsigned and signed ints, respectively. +# At runtime, they are either c_[u]long or c_[u]longlong, depending on the host's pointer size +# (they are not really separate classes). +class WPARAM(_SimpleCData[int]): ... +class LPARAM(_SimpleCData[int]): ... + +ATOM = WORD +LANGID = WORD +COLORREF = DWORD +LGRPID = DWORD +LCTYPE = DWORD +LCID = DWORD + +HANDLE = c_void_p +HACCEL = HANDLE +HBITMAP = HANDLE +HBRUSH = HANDLE +HCOLORSPACE = HANDLE +HDC = HANDLE +HDESK = HANDLE +HDWP = HANDLE +HENHMETAFILE = HANDLE +HFONT = HANDLE +HGDIOBJ = HANDLE +HGLOBAL = HANDLE +HHOOK = HANDLE +HICON = HANDLE +HINSTANCE = HANDLE +HKEY = HANDLE +HKL = HANDLE +HLOCAL = HANDLE +HMENU = HANDLE +HMETAFILE = HANDLE +HMODULE = HANDLE +HMONITOR = HANDLE +HPALETTE = HANDLE +HPEN = HANDLE +HRGN = HANDLE +HRSRC = HANDLE +HSTR = HANDLE +HTASK = HANDLE +HWINSTA = HANDLE +HWND = HANDLE +SC_HANDLE = HANDLE +SERVICE_STATUS_HANDLE = HANDLE + +class RECT(Structure): + left: LONG + top: LONG + right: LONG + bottom: LONG +RECTL = RECT +_RECTL = RECT +tagRECT = RECT + +class _SMALL_RECT(Structure): + Left: SHORT + Top: SHORT + Right: SHORT + Bottom: SHORT +SMALL_RECT = _SMALL_RECT + +class _COORD(Structure): + X: SHORT + Y: SHORT + +class POINT(Structure): + x: LONG + y: LONG +POINTL = POINT +_POINTL = POINT +tagPOINT = POINT + +class SIZE(Structure): + cx: LONG + cy: LONG +SIZEL = SIZE +tagSIZE = SIZE + +def RGB(red: int, green: int, blue: int) -> int: ... + +class FILETIME(Structure): + dwLowDateTime: DWORD + dwHighDateTime: DWORD +_FILETIME = FILETIME + +class MSG(Structure): + hWnd: HWND + message: UINT + wParam: WPARAM + lParam: LPARAM + time: DWORD + pt: POINT +tagMSG = MSG +MAX_PATH: int + +class WIN32_FIND_DATAA(Structure): + dwFileAttributes: DWORD + ftCreationTime: FILETIME + ftLastAccessTime: FILETIME + ftLastWriteTime: FILETIME + nFileSizeHigh: DWORD + nFileSizeLow: DWORD + dwReserved0: DWORD + dwReserved1: DWORD + cFileName: Array[CHAR] + cAlternateFileName: Array[CHAR] + +class WIN32_FIND_DATAW(Structure): + dwFileAttributes: DWORD + ftCreationTime: FILETIME + ftLastAccessTime: FILETIME + ftLastWriteTime: FILETIME + nFileSizeHigh: DWORD + nFileSizeLow: DWORD + dwReserved0: DWORD + dwReserved1: DWORD + cFileName: Array[WCHAR] + cAlternateFileName: Array[WCHAR] + +# These pointer type definitions use pointer[...] instead of POINTER(...), to allow them +# to be used in type annotations. +PBOOL = pointer[BOOL] +LPBOOL = pointer[BOOL] +PBOOLEAN = pointer[BOOLEAN] +PBYTE = pointer[BYTE] +LPBYTE = pointer[BYTE] +PCHAR = pointer[CHAR] +LPCOLORREF = pointer[COLORREF] +PDWORD = pointer[DWORD] +LPDWORD = pointer[DWORD] +PFILETIME = pointer[FILETIME] +LPFILETIME = pointer[FILETIME] +PFLOAT = pointer[FLOAT] +PHANDLE = pointer[HANDLE] +LPHANDLE = pointer[HANDLE] +PHKEY = pointer[HKEY] +LPHKL = pointer[HKL] +PINT = pointer[INT] +LPINT = pointer[INT] +PLARGE_INTEGER = pointer[LARGE_INTEGER] +PLCID = pointer[LCID] +PLONG = pointer[LONG] +LPLONG = pointer[LONG] +PMSG = pointer[MSG] +LPMSG = pointer[MSG] +PPOINT = pointer[POINT] +LPPOINT = pointer[POINT] +PPOINTL = pointer[POINTL] +PRECT = pointer[RECT] +LPRECT = pointer[RECT] +PRECTL = pointer[RECTL] +LPRECTL = pointer[RECTL] +LPSC_HANDLE = pointer[SC_HANDLE] +PSHORT = pointer[SHORT] +PSIZE = pointer[SIZE] +LPSIZE = pointer[SIZE] +PSIZEL = pointer[SIZEL] +LPSIZEL = pointer[SIZEL] +PSMALL_RECT = pointer[SMALL_RECT] +PUINT = pointer[UINT] +LPUINT = pointer[UINT] +PULARGE_INTEGER = pointer[ULARGE_INTEGER] +PULONG = pointer[ULONG] +PUSHORT = pointer[USHORT] +PWCHAR = pointer[WCHAR] +PWIN32_FIND_DATAA = pointer[WIN32_FIND_DATAA] +LPWIN32_FIND_DATAA = pointer[WIN32_FIND_DATAA] +PWIN32_FIND_DATAW = pointer[WIN32_FIND_DATAW] +LPWIN32_FIND_DATAW = pointer[WIN32_FIND_DATAW] +PWORD = pointer[WORD] +LPWORD = pointer[WORD] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/curses/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/curses/__init__.pyi new file mode 100644 index 00000000..8bd806b4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/curses/__init__.pyi @@ -0,0 +1,15 @@ +from _curses import * # noqa: F403 +from _curses import _CursesWindow as _CursesWindow +from typing import TypeVar, Callable, Any + +_T = TypeVar('_T') + +# available after calling `curses.initscr()` +LINES: int +COLS: int + +# available after calling `curses.start_color()` +COLORS: int +COLOR_PAIRS: int + +def wrapper(func: Callable[..., _T], *arg: Any, **kwds: Any) -> _T: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/curses/ascii.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/curses/ascii.pyi new file mode 100644 index 00000000..40337692 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/curses/ascii.pyi @@ -0,0 +1,62 @@ +from typing import List, Union, overload, TypeVar + +_Ch = TypeVar('_Ch', str, int) + +NUL: int +SOH: int +STX: int +ETX: int +EOT: int +ENQ: int +ACK: int +BEL: int +BS: int +TAB: int +HT: int +LF: int +NL: int +VT: int +FF: int +CR: int +SO: int +SI: int +DLE: int +DC1: int +DC2: int +DC3: int +DC4: int +NAK: int +SYN: int +ETB: int +CAN: int +EM: int +SUB: int +ESC: int +FS: int +GS: int +RS: int +US: int +SP: int +DEL: int + +controlnames: List[int] + +def isalnum(c: Union[str, int]) -> bool: ... +def isalpha(c: Union[str, int]) -> bool: ... +def isascii(c: Union[str, int]) -> bool: ... +def isblank(c: Union[str, int]) -> bool: ... +def iscntrl(c: Union[str, int]) -> bool: ... +def isdigit(c: Union[str, int]) -> bool: ... +def isgraph(c: Union[str, int]) -> bool: ... +def islower(c: Union[str, int]) -> bool: ... +def isprint(c: Union[str, int]) -> bool: ... +def ispunct(c: Union[str, int]) -> bool: ... +def isspace(c: Union[str, int]) -> bool: ... +def isupper(c: Union[str, int]) -> bool: ... +def isxdigit(c: Union[str, int]) -> bool: ... +def isctrl(c: Union[str, int]) -> bool: ... +def ismeta(c: Union[str, int]) -> bool: ... +def ascii(c: _Ch) -> _Ch: ... +def ctrl(c: _Ch) -> _Ch: ... +def alt(c: _Ch) -> _Ch: ... +def unctrl(c: Union[str, int]) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/curses/panel.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/curses/panel.pyi new file mode 100644 index 00000000..90f70c4f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/curses/panel.pyi @@ -0,0 +1,20 @@ +from _curses import _CursesWindow + +class _Curses_Panel: # type is (note the space in the class name) + def above(self) -> _Curses_Panel: ... + def below(self) -> _Curses_Panel: ... + def bottom(self) -> None: ... + def hidden(self) -> bool: ... + def hide(self) -> None: ... + def move(self, y: int, x: int) -> None: ... + def replace(self, win: _CursesWindow) -> None: ... + def set_userptr(self, obj: object) -> None: ... + def show(self) -> None: ... + def top(self) -> None: ... + def userptr(self) -> object: ... + def window(self) -> _CursesWindow: ... + +def bottom_panel() -> _Curses_Panel: ... +def new_panel(win: _CursesWindow) -> _Curses_Panel: ... +def top_panel() -> _Curses_Panel: ... +def update_panels() -> _Curses_Panel: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/curses/textpad.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/curses/textpad.pyi new file mode 100644 index 00000000..a218564c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/curses/textpad.pyi @@ -0,0 +1,11 @@ +from _curses import _CursesWindow +from typing import Callable, Union + +def rectangle(win: _CursesWindow, uly: int, ulx: int, lry: int, lrx: int) -> None: ... + +class Textbox: + stripspaces: bool + def __init__(self, w: _CursesWindow, insert_mode: bool = ...) -> None: ... + def edit(self, validate: Callable[[int], int]) -> str: ... + def do_command(self, ch: Union[str, int]) -> None: ... + def gather(self) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/datetime.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/datetime.pyi new file mode 100644 index 00000000..9c4031ad --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/datetime.pyi @@ -0,0 +1,315 @@ +import sys +from time import struct_time +from typing import AnyStr, Optional, SupportsAbs, Tuple, Union, overload, ClassVar, Type, TypeVar + +_S = TypeVar("_S") + +if sys.version_info >= (3,): + _Text = str +else: + _Text = Union[str, unicode] + +MINYEAR: int +MAXYEAR: int + +class tzinfo: + def tzname(self, dt: Optional[datetime]) -> Optional[str]: ... + def utcoffset(self, dt: Optional[datetime]) -> Optional[timedelta]: ... + def dst(self, dt: Optional[datetime]) -> Optional[timedelta]: ... + def fromutc(self, dt: datetime) -> datetime: ... + +if sys.version_info >= (3, 2): + class timezone(tzinfo): + utc: ClassVar[timezone] + min: ClassVar[timezone] + max: ClassVar[timezone] + + def __init__(self, offset: timedelta, name: str = ...) -> None: ... + def __hash__(self) -> int: ... + +_tzinfo = tzinfo + +class date: + min: ClassVar[date] + max: ClassVar[date] + resolution: ClassVar[timedelta] + + def __init__(self, year: int, month: int, day: int) -> None: ... + + @classmethod + def fromtimestamp(cls: Type[_S], t: float) -> _S: ... + @classmethod + def today(cls: Type[_S]) -> _S: ... + @classmethod + def fromordinal(cls: Type[_S], n: int) -> _S: ... + if sys.version_info >= (3, 7): + @classmethod + def fromisoformat(cls: Type[_S], date_string: str) -> _S: ... + if sys.version_info >= (3, 8): + @classmethod + def fromisocalendar(cls: Type[_S], year: int, week: int, day: int) -> _S: ... + + @property + def year(self) -> int: ... + @property + def month(self) -> int: ... + @property + def day(self) -> int: ... + + def ctime(self) -> str: ... + def strftime(self, fmt: _Text) -> str: ... + if sys.version_info >= (3,): + def __format__(self, fmt: str) -> str: ... + else: + def __format__(self, fmt: AnyStr) -> AnyStr: ... + def isoformat(self) -> str: ... + def timetuple(self) -> struct_time: ... + def toordinal(self) -> int: ... + def replace(self, year: int = ..., month: int = ..., day: int = ...) -> date: ... + def __le__(self, other: date) -> bool: ... + def __lt__(self, other: date) -> bool: ... + def __ge__(self, other: date) -> bool: ... + def __gt__(self, other: date) -> bool: ... + if sys.version_info >= (3, 8): + def __add__(self: _S, other: timedelta) -> _S: ... + def __radd__(self: _S, other: timedelta) -> _S: ... + else: + def __add__(self, other: timedelta) -> date: ... + def __radd__(self, other: timedelta) -> date: ... + @overload + def __sub__(self, other: timedelta) -> date: ... + @overload + def __sub__(self, other: date) -> timedelta: ... + def __hash__(self) -> int: ... + def weekday(self) -> int: ... + def isoweekday(self) -> int: ... + def isocalendar(self) -> Tuple[int, int, int]: ... + +class time: + min: ClassVar[time] + max: ClassVar[time] + resolution: ClassVar[timedelta] + + if sys.version_info >= (3, 6): + def __init__(self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ..., + tzinfo: Optional[_tzinfo] = ..., *, fold: int = ...) -> None: ... + else: + def __init__(self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ..., + tzinfo: Optional[_tzinfo] = ...) -> None: ... + + @property + def hour(self) -> int: ... + @property + def minute(self) -> int: ... + @property + def second(self) -> int: ... + @property + def microsecond(self) -> int: ... + @property + def tzinfo(self) -> Optional[_tzinfo]: ... + if sys.version_info >= (3, 6): + @property + def fold(self) -> int: ... + + def __le__(self, other: time) -> bool: ... + def __lt__(self, other: time) -> bool: ... + def __ge__(self, other: time) -> bool: ... + def __gt__(self, other: time) -> bool: ... + def __hash__(self) -> int: ... + if sys.version_info >= (3, 6): + def isoformat(self, timespec: str = ...) -> str: ... + else: + def isoformat(self) -> str: ... + if sys.version_info >= (3, 7): + @classmethod + def fromisoformat(cls: Type[_S], time_string: str) -> _S: ... + def strftime(self, fmt: _Text) -> str: ... + if sys.version_info >= (3,): + def __format__(self, fmt: str) -> str: ... + else: + def __format__(self, fmt: AnyStr) -> AnyStr: ... + def utcoffset(self) -> Optional[timedelta]: ... + def tzname(self) -> Optional[str]: ... + def dst(self) -> Optional[int]: ... + if sys.version_info >= (3, 6): + def replace(self, hour: int = ..., minute: int = ..., second: int = ..., + microsecond: int = ..., tzinfo: Optional[_tzinfo] = ..., + *, fold: int = ...) -> time: ... + else: + def replace(self, hour: int = ..., minute: int = ..., second: int = ..., + microsecond: int = ..., tzinfo: Optional[_tzinfo] = ...) -> time: ... + +_date = date +_time = time + +class timedelta(SupportsAbs[timedelta]): + min: ClassVar[timedelta] + max: ClassVar[timedelta] + resolution: ClassVar[timedelta] + + if sys.version_info >= (3, 6): + def __init__(self, days: float = ..., seconds: float = ..., microseconds: float = ..., + milliseconds: float = ..., minutes: float = ..., hours: float = ..., + weeks: float = ..., *, fold: int = ...) -> None: ... + else: + def __init__(self, days: float = ..., seconds: float = ..., microseconds: float = ..., + milliseconds: float = ..., minutes: float = ..., hours: float = ..., + weeks: float = ...) -> None: ... + + @property + def days(self) -> int: ... + @property + def seconds(self) -> int: ... + @property + def microseconds(self) -> int: ... + + def total_seconds(self) -> float: ... + def __add__(self, other: timedelta) -> timedelta: ... + def __radd__(self, other: timedelta) -> timedelta: ... + def __sub__(self, other: timedelta) -> timedelta: ... + def __rsub__(self, other: timedelta) -> timedelta: ... + def __neg__(self) -> timedelta: ... + def __pos__(self) -> timedelta: ... + def __abs__(self) -> timedelta: ... + def __mul__(self, other: float) -> timedelta: ... + def __rmul__(self, other: float) -> timedelta: ... + @overload + def __floordiv__(self, other: timedelta) -> int: ... + @overload + def __floordiv__(self, other: int) -> timedelta: ... + if sys.version_info >= (3,): + @overload + def __truediv__(self, other: timedelta) -> float: ... + @overload + def __truediv__(self, other: float) -> timedelta: ... + def __mod__(self, other: timedelta) -> timedelta: ... + def __divmod__(self, other: timedelta) -> Tuple[int, timedelta]: ... + else: + @overload + def __div__(self, other: timedelta) -> float: ... + @overload + def __div__(self, other: float) -> timedelta: ... + def __le__(self, other: timedelta) -> bool: ... + def __lt__(self, other: timedelta) -> bool: ... + def __ge__(self, other: timedelta) -> bool: ... + def __gt__(self, other: timedelta) -> bool: ... + def __hash__(self) -> int: ... + +class datetime(date): + min: ClassVar[datetime] + max: ClassVar[datetime] + resolution: ClassVar[timedelta] + + if sys.version_info >= (3, 6): + def __init__(self, year: int, month: int, day: int, hour: int = ..., + minute: int = ..., second: int = ..., microsecond: int = ..., + tzinfo: Optional[_tzinfo] = ..., *, fold: int = ...) -> None: ... + else: + def __init__(self, year: int, month: int, day: int, hour: int = ..., + minute: int = ..., second: int = ..., microsecond: int = ..., + tzinfo: Optional[_tzinfo] = ...) -> None: ... + + @property + def year(self) -> int: ... + @property + def month(self) -> int: ... + @property + def day(self) -> int: ... + @property + def hour(self) -> int: ... + @property + def minute(self) -> int: ... + @property + def second(self) -> int: ... + @property + def microsecond(self) -> int: ... + @property + def tzinfo(self) -> Optional[_tzinfo]: ... + if sys.version_info >= (3, 6): + @property + def fold(self) -> int: ... + + @classmethod + def fromtimestamp(cls: Type[_S], t: float, tz: Optional[_tzinfo] = ...) -> _S: ... + @classmethod + def utcfromtimestamp(cls: Type[_S], t: float) -> _S: ... + @classmethod + def today(cls: Type[_S]) -> _S: ... + @classmethod + def fromordinal(cls: Type[_S], n: int) -> _S: ... + if sys.version_info >= (3, 8): + @classmethod + def now(cls: Type[_S], tz: Optional[_tzinfo] = ...) -> _S: ... + else: + @overload + @classmethod + def now(cls: Type[_S], tz: None = ...) -> _S: ... + @overload + @classmethod + def now(cls, tz: _tzinfo) -> datetime: ... + @classmethod + def utcnow(cls: Type[_S]) -> _S: ... + if sys.version_info >= (3, 6): + @classmethod + def combine(cls, date: _date, time: _time, tzinfo: Optional[_tzinfo] = ...) -> datetime: ... + else: + @classmethod + def combine(cls, date: _date, time: _time) -> datetime: ... + if sys.version_info >= (3, 7): + @classmethod + def fromisoformat(cls: Type[_S], date_string: str) -> _S: ... + def strftime(self, fmt: _Text) -> str: ... + if sys.version_info >= (3,): + def __format__(self, fmt: str) -> str: ... + else: + def __format__(self, fmt: AnyStr) -> AnyStr: ... + def toordinal(self) -> int: ... + def timetuple(self) -> struct_time: ... + if sys.version_info >= (3, 3): + def timestamp(self) -> float: ... + def utctimetuple(self) -> struct_time: ... + def date(self) -> _date: ... + def time(self) -> _time: ... + def timetz(self) -> _time: ... + if sys.version_info >= (3, 6): + def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ..., + minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo: + Optional[_tzinfo] = ..., *, fold: int = ...) -> datetime: ... + else: + def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ..., + minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo: + Optional[_tzinfo] = ...) -> datetime: ... + if sys.version_info >= (3, 8): + def astimezone(self: _S, tz: Optional[_tzinfo] = ...) -> _S: ... + elif sys.version_info >= (3, 3): + def astimezone(self, tz: Optional[_tzinfo] = ...) -> datetime: ... + else: + def astimezone(self, tz: _tzinfo) -> datetime: ... + def ctime(self) -> str: ... + if sys.version_info >= (3, 6): + def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ... + else: + def isoformat(self, sep: str = ...) -> str: ... + @classmethod + def strptime(cls, date_string: _Text, format: _Text) -> datetime: ... + def utcoffset(self) -> Optional[timedelta]: ... + def tzname(self) -> Optional[str]: ... + def dst(self) -> Optional[timedelta]: ... + def __le__(self, other: datetime) -> bool: ... # type: ignore + def __lt__(self, other: datetime) -> bool: ... # type: ignore + def __ge__(self, other: datetime) -> bool: ... # type: ignore + def __gt__(self, other: datetime) -> bool: ... # type: ignore + if sys.version_info >= (3, 8): + def __add__(self: _S, other: timedelta) -> _S: ... + def __radd__(self: _S, other: timedelta) -> _S: ... + else: + def __add__(self, other: timedelta) -> datetime: ... + def __radd__(self, other: timedelta) -> datetime: ... + @overload # type: ignore + def __sub__(self, other: datetime) -> timedelta: ... + @overload + def __sub__(self, other: timedelta) -> datetime: ... + def __hash__(self) -> int: ... + def weekday(self) -> int: ... + def isoweekday(self) -> int: ... + def isocalendar(self) -> Tuple[int, int, int]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/decimal.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/decimal.pyi new file mode 100644 index 00000000..06193c7a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/decimal.pyi @@ -0,0 +1,315 @@ +import numbers +import sys +from types import TracebackType +from typing import ( + Any, Container, Dict, List, NamedTuple, Optional, overload, Sequence, Text, Tuple, Type, TypeVar, Union, +) + +_Decimal = Union[Decimal, int] +_DecimalNew = Union[Decimal, float, Text, Tuple[int, Sequence[int], int]] +if sys.version_info >= (3,): + _ComparableNum = Union[Decimal, float, numbers.Rational] +else: + _ComparableNum = Union[Decimal, float] +_DecimalT = TypeVar('_DecimalT', bound=Decimal) + +class DecimalTuple(NamedTuple): + sign: int + digits: Tuple[int, ...] + exponent: int + +ROUND_DOWN: str +ROUND_HALF_UP: str +ROUND_HALF_EVEN: str +ROUND_CEILING: str +ROUND_FLOOR: str +ROUND_UP: str +ROUND_HALF_DOWN: str +ROUND_05UP: str + +if sys.version_info >= (3,): + HAVE_THREADS: bool + MAX_EMAX: int + MAX_PREC: int + MIN_EMIN: int + MIN_ETINY: int + +class DecimalException(ArithmeticError): + def handle(self, context: Context, *args: Any) -> Optional[Decimal]: ... + +class Clamped(DecimalException): ... + +class InvalidOperation(DecimalException): ... + +class ConversionSyntax(InvalidOperation): ... + +class DivisionByZero(DecimalException, ZeroDivisionError): ... + +class DivisionImpossible(InvalidOperation): ... + +class DivisionUndefined(InvalidOperation, ZeroDivisionError): ... + +class Inexact(DecimalException): ... + +class InvalidContext(InvalidOperation): ... + +class Rounded(DecimalException): ... + +class Subnormal(DecimalException): ... + +class Overflow(Inexact, Rounded): ... + +class Underflow(Inexact, Rounded, Subnormal): ... + +if sys.version_info >= (3,): + class FloatOperation(DecimalException, TypeError): ... + +def setcontext(context: Context) -> None: ... +def getcontext() -> Context: ... +def localcontext(ctx: Optional[Context] = ...) -> _ContextManager: ... + +class Decimal(object): + def __new__(cls: Type[_DecimalT], value: _DecimalNew = ..., context: Optional[Context] = ...) -> _DecimalT: ... + @classmethod + def from_float(cls, f: float) -> Decimal: ... + if sys.version_info >= (3,): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + def __eq__(self, other: object, context: Optional[Context] = ...) -> bool: ... + if sys.version_info < (3,): + def __ne__(self, other: object, context: Optional[Context] = ...) -> bool: ... + def __lt__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def __le__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def __gt__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def __ge__(self, other: _ComparableNum, context: Optional[Context] = ...) -> bool: ... + def compare(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __hash__(self) -> int: ... + def as_tuple(self) -> DecimalTuple: ... + if sys.version_info >= (3,): + def as_integer_ratio(self) -> Tuple[int, int]: ... + def __str__(self, eng: bool = ..., context: Optional[Context] = ...) -> str: ... + def to_eng_string(self, context: Optional[Context] = ...) -> str: ... + def __neg__(self, context: Optional[Context] = ...) -> Decimal: ... + def __pos__(self, context: Optional[Context] = ...) -> Decimal: ... + def __abs__(self, round: bool = ..., context: Optional[Context] = ...) -> Decimal: ... + def __add__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __radd__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __sub__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rsub__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __mul__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rmul__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __truediv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rtruediv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + if sys.version_info < (3,): + def __div__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rdiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __divmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Tuple[Decimal, Decimal]: ... + def __rdivmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Tuple[Decimal, Decimal]: ... + def __mod__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rmod__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def remainder_near(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __floordiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __rfloordiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __float__(self) -> float: ... + def __int__(self) -> int: ... + def __trunc__(self) -> int: ... + @property + def real(self) -> Decimal: ... + @property + def imag(self) -> Decimal: ... + def conjugate(self) -> Decimal: ... + def __complex__(self) -> complex: ... + if sys.version_info >= (3,): + @overload + def __round__(self) -> int: ... + @overload + def __round__(self, ndigits: int) -> Decimal: ... + def __floor__(self) -> int: ... + def __ceil__(self) -> int: ... + else: + def __long__(self) -> long: ... + def fma(self, other: _Decimal, third: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __pow__(self, other: _Decimal, modulo: Optional[_Decimal] = ..., context: Optional[Context] = ...) -> Decimal: ... + def __rpow__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def normalize(self, context: Optional[Context] = ...) -> Decimal: ... + if sys.version_info >= (3,): + def quantize(self, exp: _Decimal, rounding: Optional[str] = ..., + context: Optional[Context] = ...) -> Decimal: ... + def same_quantum(self, other: _Decimal, context: Optional[Context] = ...) -> bool: ... + else: + def quantize(self, exp: _Decimal, rounding: Optional[str] = ..., + context: Optional[Context] = ..., watchexp: bool = ...) -> Decimal: ... + def same_quantum(self, other: _Decimal) -> bool: ... + def to_integral_exact(self, rounding: Optional[str] = ..., context: Optional[Context] = ...) -> Decimal: ... + def to_integral_value(self, rounding: Optional[str] = ..., context: Optional[Context] = ...) -> Decimal: ... + def to_integral(self, rounding: Optional[str] = ..., context: Optional[Context] = ...) -> Decimal: ... + def sqrt(self, context: Optional[Context] = ...) -> Decimal: ... + def max(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def min(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def adjusted(self) -> int: ... + if sys.version_info >= (3,): + def canonical(self) -> Decimal: ... + else: + def canonical(self, context: Optional[Context] = ...) -> Decimal: ... + def compare_signal(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + if sys.version_info >= (3,): + def compare_total(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def compare_total_mag(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + else: + def compare_total(self, other: _Decimal) -> Decimal: ... + def compare_total_mag(self, other: _Decimal) -> Decimal: ... + def copy_abs(self) -> Decimal: ... + def copy_negate(self) -> Decimal: ... + if sys.version_info >= (3,): + def copy_sign(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + else: + def copy_sign(self, other: _Decimal) -> Decimal: ... + def exp(self, context: Optional[Context] = ...) -> Decimal: ... + def is_canonical(self) -> bool: ... + def is_finite(self) -> bool: ... + def is_infinite(self) -> bool: ... + def is_nan(self) -> bool: ... + def is_normal(self, context: Optional[Context] = ...) -> bool: ... + def is_qnan(self) -> bool: ... + def is_signed(self) -> bool: ... + def is_snan(self) -> bool: ... + def is_subnormal(self, context: Optional[Context] = ...) -> bool: ... + def is_zero(self) -> bool: ... + def ln(self, context: Optional[Context] = ...) -> Decimal: ... + def log10(self, context: Optional[Context] = ...) -> Decimal: ... + def logb(self, context: Optional[Context] = ...) -> Decimal: ... + def logical_and(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def logical_invert(self, context: Optional[Context] = ...) -> Decimal: ... + def logical_or(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def logical_xor(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def max_mag(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def min_mag(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def next_minus(self, context: Optional[Context] = ...) -> Decimal: ... + def next_plus(self, context: Optional[Context] = ...) -> Decimal: ... + def next_toward(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def number_class(self, context: Optional[Context] = ...) -> str: ... + def radix(self) -> Decimal: ... + def rotate(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def scaleb(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def shift(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ... + def __reduce__(self) -> Tuple[Type[Decimal], Tuple[str]]: ... + def __copy__(self) -> Decimal: ... + def __deepcopy__(self, memo: Any) -> Decimal: ... + def __format__(self, specifier: str, context: Optional[Context] = ...) -> str: ... + +class _ContextManager(object): + new_context: Context + saved_context: Context + def __init__(self, new_context: Context) -> None: ... + def __enter__(self) -> Context: ... + def __exit__(self, t: Optional[Type[BaseException]], v: Optional[BaseException], tb: Optional[TracebackType]) -> None: ... + +_TrapType = Type[DecimalException] + +class Context(object): + prec: int + rounding: str + Emin: int + Emax: int + capitals: int + if sys.version_info >= (3,): + clamp: int + else: + _clamp: int + traps: Dict[_TrapType, bool] + flags: Dict[_TrapType, bool] + if sys.version_info >= (3,): + def __init__(self, prec: Optional[int] = ..., rounding: Optional[str] = ..., + Emin: Optional[int] = ..., Emax: Optional[int] = ..., + capitals: Optional[int] = ..., clamp: Optional[int] = ..., + flags: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ..., + traps: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ..., + _ignored_flags: Optional[List[_TrapType]] = ...) -> None: ... + else: + def __init__(self, prec: Optional[int] = ..., rounding: Optional[str] = ..., + traps: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ..., + flags: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ..., + Emin: Optional[int] = ..., Emax: Optional[int] = ..., + capitals: Optional[int] = ..., _clamp: Optional[int] = ..., + _ignored_flags: Optional[List[_TrapType]] = ...) -> None: ... + if sys.version_info >= (3,): + # __setattr__() only allows to set a specific set of attributes, + # already defined above. + def __delattr__(self, name: str) -> None: ... + def __reduce__(self) -> Tuple[Type[Context], Tuple[Any, ...]]: ... + def clear_flags(self) -> None: ... + if sys.version_info >= (3,): + def clear_traps(self) -> None: ... + def copy(self) -> Context: ... + def __copy__(self) -> Context: ... + __hash__: Any = ... + def Etiny(self) -> int: ... + def Etop(self) -> int: ... + def create_decimal(self, num: _DecimalNew = ...) -> Decimal: ... + def create_decimal_from_float(self, f: float) -> Decimal: ... + def abs(self, a: _Decimal) -> Decimal: ... + def add(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def canonical(self, a: Decimal) -> Decimal: ... + def compare(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def compare_signal(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def compare_total(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def compare_total_mag(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def copy_abs(self, a: _Decimal) -> Decimal: ... + def copy_decimal(self, a: _Decimal) -> Decimal: ... + def copy_negate(self, a: _Decimal) -> Decimal: ... + def copy_sign(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def divide(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def divide_int(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def divmod(self, a: _Decimal, b: _Decimal) -> Tuple[Decimal, Decimal]: ... + def exp(self, a: _Decimal) -> Decimal: ... + def fma(self, a: _Decimal, b: _Decimal, c: _Decimal) -> Decimal: ... + def is_canonical(self, a: _Decimal) -> bool: ... + def is_finite(self, a: _Decimal) -> bool: ... + def is_infinite(self, a: _Decimal) -> bool: ... + def is_nan(self, a: _Decimal) -> bool: ... + def is_normal(self, a: _Decimal) -> bool: ... + def is_qnan(self, a: _Decimal) -> bool: ... + def is_signed(self, a: _Decimal) -> bool: ... + def is_snan(self, a: _Decimal) -> bool: ... + def is_subnormal(self, a: _Decimal) -> bool: ... + def is_zero(self, a: _Decimal) -> bool: ... + def ln(self, a: _Decimal) -> Decimal: ... + def log10(self, a: _Decimal) -> Decimal: ... + def logb(self, a: _Decimal) -> Decimal: ... + def logical_and(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def logical_invert(self, a: _Decimal) -> Decimal: ... + def logical_or(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def logical_xor(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def max(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def max_mag(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def min(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def min_mag(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def minus(self, a: _Decimal) -> Decimal: ... + def multiply(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def next_minus(self, a: _Decimal) -> Decimal: ... + def next_plus(self, a: _Decimal) -> Decimal: ... + def next_toward(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def normalize(self, a: _Decimal) -> Decimal: ... + def number_class(self, a: _Decimal) -> str: ... + def plus(self, a: _Decimal) -> Decimal: ... + def power(self, a: _Decimal, b: _Decimal, modulo: Optional[_Decimal] = ...) -> Decimal: ... + def quantize(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def radix(self) -> Decimal: ... + def remainder(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def remainder_near(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def rotate(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def same_quantum(self, a: _Decimal, b: _Decimal) -> bool: ... + def scaleb(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def shift(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def sqrt(self, a: _Decimal) -> Decimal: ... + def subtract(self, a: _Decimal, b: _Decimal) -> Decimal: ... + def to_eng_string(self, a: _Decimal) -> str: ... + def to_sci_string(self, a: _Decimal) -> str: ... + def to_integral_exact(self, a: _Decimal) -> Decimal: ... + def to_integral_value(self, a: _Decimal) -> Decimal: ... + def to_integral(self, a: _Decimal) -> Decimal: ... + +DefaultContext: Context +BasicContext: Context +ExtendedContext: Context diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/difflib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/difflib.pyi new file mode 100644 index 00000000..197c5d03 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/difflib.pyi @@ -0,0 +1,86 @@ +# Based on https://docs.python.org/2.7/library/difflib.html and https://docs.python.org/3.2/library/difflib.html + +import sys +from typing import ( + TypeVar, Callable, Iterable, Iterator, List, NamedTuple, Sequence, Tuple, + Generic, Optional, Text, Union, AnyStr +) + +_T = TypeVar('_T') + +if sys.version_info >= (3,): + _StrType = Text +else: + # Aliases can't point to type vars, so we need to redeclare AnyStr + _StrType = TypeVar('_StrType', Text, bytes) + +_JunkCallback = Union[Callable[[Text], bool], Callable[[str], bool]] + +class Match(NamedTuple): + a: int + b: int + size: int + +class SequenceMatcher(Generic[_T]): + def __init__(self, isjunk: Optional[Callable[[_T], bool]] = ..., + a: Sequence[_T] = ..., b: Sequence[_T] = ..., + autojunk: bool = ...) -> None: ... + def set_seqs(self, a: Sequence[_T], b: Sequence[_T]) -> None: ... + def set_seq1(self, a: Sequence[_T]) -> None: ... + def set_seq2(self, b: Sequence[_T]) -> None: ... + def find_longest_match(self, alo: int, ahi: int, blo: int, + bhi: int) -> Match: ... + def get_matching_blocks(self) -> List[Match]: ... + def get_opcodes(self) -> List[Tuple[str, int, int, int, int]]: ... + def get_grouped_opcodes(self, n: int = ... + ) -> Iterable[List[Tuple[str, int, int, int, int]]]: ... + def ratio(self) -> float: ... + def quick_ratio(self) -> float: ... + def real_quick_ratio(self) -> float: ... + +def get_close_matches(word: Sequence[_T], possibilities: Iterable[Sequence[_T]], + n: int = ..., cutoff: float = ...) -> List[Sequence[_T]]: ... + +class Differ: + def __init__(self, linejunk: _JunkCallback = ..., charjunk: _JunkCallback = ...) -> None: ... + def compare(self, a: Sequence[_StrType], b: Sequence[_StrType]) -> Iterator[_StrType]: ... + +def IS_LINE_JUNK(line: _StrType) -> bool: ... +def IS_CHARACTER_JUNK(line: _StrType) -> bool: ... +def unified_diff(a: Sequence[_StrType], b: Sequence[_StrType], fromfile: _StrType = ..., + tofile: _StrType = ..., fromfiledate: _StrType = ..., tofiledate: _StrType = ..., + n: int = ..., lineterm: _StrType = ...) -> Iterator[_StrType]: ... +def context_diff(a: Sequence[_StrType], b: Sequence[_StrType], fromfile: _StrType = ..., + tofile: _StrType = ..., fromfiledate: _StrType = ..., tofiledate: _StrType = ..., + n: int = ..., lineterm: _StrType = ...) -> Iterator[_StrType]: ... +def ndiff(a: Sequence[_StrType], b: Sequence[_StrType], + linejunk: _JunkCallback = ..., + charjunk: _JunkCallback = ... + ) -> Iterator[_StrType]: ... + +class HtmlDiff(object): + def __init__(self, tabsize: int = ..., wrapcolumn: int = ..., + linejunk: _JunkCallback = ..., + charjunk: _JunkCallback = ... + ) -> None: ... + def make_file(self, fromlines: Sequence[_StrType], tolines: Sequence[_StrType], + fromdesc: _StrType = ..., todesc: _StrType = ..., context: bool = ..., + numlines: int = ...) -> _StrType: ... + def make_table(self, fromlines: Sequence[_StrType], tolines: Sequence[_StrType], + fromdesc: _StrType = ..., todesc: _StrType = ..., context: bool = ..., + numlines: int = ...) -> _StrType: ... + +def restore(delta: Iterable[_StrType], which: int) -> Iterator[_StrType]: ... + +if sys.version_info >= (3, 5): + def diff_bytes( + dfunc: Callable[[Sequence[str], Sequence[str], str, str, str, str, int, str], Iterator[str]], + a: Sequence[bytes], + b: Sequence[bytes], + fromfile: bytes = ..., + tofile: bytes = ..., + fromfiledate: bytes = ..., + tofiledate: bytes = ..., + n: int = ..., + lineterm: bytes = ... + ) -> Iterator[bytes]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/dis.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/dis.pyi new file mode 100644 index 00000000..22630a5b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/dis.pyi @@ -0,0 +1,73 @@ +from typing import Callable, List, Union, Iterator, Tuple, Optional, Any, IO, NamedTuple, Dict + +import sys +import types + +from opcode import (hasconst as hasconst, hasname as hasname, hasjrel as hasjrel, + hasjabs as hasjabs, haslocal as haslocal, hascompare as hascompare, + hasfree as hasfree, cmp_op as cmp_op, opname as opname, opmap as opmap, + HAVE_ARGUMENT as HAVE_ARGUMENT, EXTENDED_ARG as EXTENDED_ARG) + +if sys.version_info >= (3, 4): + from opcode import stack_effect as stack_effect + +if sys.version_info >= (3, 6): + from opcode import hasnargs as hasnargs + +# Strictly this should not have to include Callable, but mypy doesn't use FunctionType +# for functions (python/mypy#3171) +_have_code = Union[types.MethodType, types.FunctionType, types.CodeType, type, Callable[..., Any]] +_have_code_or_string = Union[_have_code, str, bytes] + + +if sys.version_info >= (3, 4): + class Instruction(NamedTuple): + opname: str + opcode: int + arg: Optional[int] + argval: Any + argrepr: str + offset: int + starts_line: Optional[int] + is_jump_target: bool + + class Bytecode: + codeobj: types.CodeType + first_line: int + def __init__(self, x: _have_code_or_string, *, first_line: Optional[int] = ..., + current_offset: Optional[int] = ...) -> None: ... + def __iter__(self) -> Iterator[Instruction]: ... + def __repr__(self) -> str: ... + def info(self) -> str: ... + def dis(self) -> str: ... + + @classmethod + def from_traceback(cls, tb: types.TracebackType) -> Bytecode: ... + + +COMPILER_FLAG_NAMES: Dict[int, str] + + +def findlabels(code: _have_code) -> List[int]: ... +def findlinestarts(code: _have_code) -> Iterator[Tuple[int, int]]: ... + +if sys.version_info >= (3, 0): + def pretty_flags(flags: int) -> str: ... + def code_info(x: _have_code_or_string) -> str: ... + +if sys.version_info >= (3, 4): + def dis(x: _have_code_or_string = ..., *, file: Optional[IO[str]] = ...) -> None: ... + def distb(tb: Optional[types.TracebackType] = ..., *, file: Optional[IO[str]] = ...) -> None: ... + def disassemble(co: _have_code, lasti: int = ..., *, file: Optional[IO[str]] = ...) -> None: ... + def disco(co: _have_code, lasti: int = ..., *, file: Optional[IO[str]] = ...) -> None: ... + def show_code(co: _have_code, *, file: Optional[IO[str]] = ...) -> None: ... + + def get_instructions(x: _have_code, *, first_line: Optional[int] = ...) -> Iterator[Instruction]: ... +else: + def dis(x: _have_code_or_string = ...) -> None: ... + def distb(tb: types.TracebackType = ...) -> None: ... + def disassemble(co: _have_code, lasti: int = ...) -> None: ... + def disco(co: _have_code, lasti: int = ...) -> None: ... + + if sys.version_info >= (3, 0): + def show_code(co: _have_code) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/archive_util.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/archive_util.pyi new file mode 100644 index 00000000..12172f3f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/archive_util.pyi @@ -0,0 +1,12 @@ +# Stubs for distutils.archive_util + +from typing import Optional + + +def make_archive(base_name: str, format: str, root_dir: Optional[str] = ..., + base_dir: Optional[str] = ..., verbose: int = ..., + dry_run: int = ...) -> str: ... +def make_tarball(base_name: str, base_dir: str, compress: Optional[str] = ..., + verbose: int = ..., dry_run: int = ...) -> str: ... +def make_zipfile(base_name: str, base_dir: str, verbose: int = ..., + dry_run: int = ...) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/bcppcompiler.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/bcppcompiler.pyi new file mode 100644 index 00000000..9f27a0ae --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/bcppcompiler.pyi @@ -0,0 +1,6 @@ +# Stubs for distutils.bcppcompiler + +from distutils.ccompiler import CCompiler + + +class BCPPCompiler(CCompiler): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/ccompiler.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/ccompiler.pyi new file mode 100644 index 00000000..94fad8ba --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/ccompiler.pyi @@ -0,0 +1,119 @@ +# Stubs for distutils.ccompiler + +from typing import Any, Callable, List, Optional, Tuple, Union + + +_Macro = Union[Tuple[str], Tuple[str, str]] + + +def gen_lib_options(compiler: CCompiler, library_dirs: List[str], + runtime_library_dirs: List[str], + libraries: List[str]) -> List[str]: ... +def gen_preprocess_options(macros: List[_Macro], + include_dirs: List[str]) -> List[str]: ... +def get_default_compiler(osname: Optional[str] = ..., + platform: Optional[str] = ...) -> str: ... +def new_compiler(plat: Optional[str] = ..., compiler: Optional[str] = ..., + verbose: int = ..., dry_run: int = ..., + force: int = ...) -> CCompiler: ... +def show_compilers() -> None: ... + +class CCompiler: + def __init__(self, verbose: int = ..., dry_run: int = ..., + force: int = ...) -> None: ... + def add_include_dir(self, dir: str) -> None: ... + def set_include_dirs(self, dirs: List[str]) -> None: ... + def add_library(self, libname: str) -> None: ... + def set_libraries(self, libnames: List[str]) -> None: ... + def add_library_dir(self, dir: str) -> None: ... + def set_library_dirs(self, dirs: List[str]) -> None: ... + def add_runtime_library_dir(self, dir: str) -> None: ... + def set_runtime_library_dirs(self, dirs: List[str]) -> None: ... + def define_macro(self, name: str, value: Optional[str] = ...) -> None: ... + def undefine_macro(self, name: str) -> None: ... + def add_link_object(self, object: str) -> None: ... + def set_link_objects(self, objects: List[str]) -> None: ... + def detect_language(self, sources: Union[str, List[str]]) -> Optional[str]: ... + def find_library_file(self, dirs: List[str], lib: str, + debug: bool = ...) -> Optional[str]: ... + def has_function(self, funcname: str, includes: Optional[List[str]] = ..., + include_dirs: Optional[List[str]] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ...) -> bool: ... + def library_dir_option(self, dir: str) -> str: ... + def library_option(self, lib: str) -> str: ... + def runtime_library_dir_option(self, dir: str) -> str: ... + def set_executables(self, **args: str) -> None: ... + def compile(self, sources: List[str], output_dir: Optional[str] = ..., + macros: Optional[_Macro] = ..., + include_dirs: Optional[List[str]] = ..., debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + depends: Optional[List[str]] = ...) -> List[str]: ... + def create_static_lib(self, objects: List[str], output_libname: str, + output_dir: Optional[str] = ..., debug: bool = ..., + target_lang: Optional[str] = ...) -> None: ... + def link(self, target_desc: str, objects: List[str], output_filename: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + export_symbols: Optional[List[str]] = ..., debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + build_temp: Optional[str] = ..., + target_lang: Optional[str] = ...) -> None: ... + def link_executable(self, objects: List[str], output_progname: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + target_lang: Optional[str] = ...) -> None: ... + def link_shared_lib(self, objects: List[str], output_libname: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + export_symbols: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + build_temp: Optional[str] = ..., + target_lang: Optional[str] = ...) -> None: ... + def link_shared_object(self, objects: List[str], output_filename: str, + output_dir: Optional[str] = ..., + libraries: Optional[List[str]] = ..., + library_dirs: Optional[List[str]] = ..., + runtime_library_dirs: Optional[List[str]] = ..., + export_symbols: Optional[List[str]] = ..., + debug: bool = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ..., + build_temp: Optional[str] = ..., + target_lang: Optional[str] = ...) -> None: ... + def preprocess(self, source: str, output_file: Optional[str] = ..., + macros: Optional[List[_Macro]] = ..., + include_dirs: Optional[List[str]] = ..., + extra_preargs: Optional[List[str]] = ..., + extra_postargs: Optional[List[str]] = ...) -> None: ... + def executable_filename(self, basename: str, strip_dir: int = ..., + output_dir: str = ...) -> str: ... + def library_filename(self, libname: str, lib_type: str = ..., + strip_dir: int = ..., + output_dir: str = ...) -> str: ... + def object_filenames(self, source_filenames: List[str], + strip_dir: int = ..., + output_dir: str = ...) -> List[str]: ... + def shared_object_filename(self, basename: str, strip_dir: int = ..., + output_dir: str = ...) -> str: ... + def execute(self, func: Callable[..., None], args: Tuple[Any, ...], + msg: Optional[str] = ..., level: int = ...) -> None: ... + def spawn(self, cmd: List[str]) -> None: ... + def mkpath(self, name: str, mode: int = ...) -> None: ... + def move_file(self, src: str, dst: str) -> str: ... + def announce(self, msg: str, level: int = ...) -> None: ... + def warn(self, msg: str) -> None: ... + def debug_print(self, msg: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/cmd.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/cmd.pyi new file mode 100644 index 00000000..2ec5a508 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/cmd.pyi @@ -0,0 +1,40 @@ +# Stubs for distutils.cmd + +from typing import Callable, List, Tuple, Union, Optional, Iterable, Any, Text +from abc import abstractmethod +from distutils.dist import Distribution + +class Command: + sub_commands: List[Tuple[str, Union[Callable[[], bool], str, None]]] + def __init__(self, dist: Distribution) -> None: ... + @abstractmethod + def initialize_options(self) -> None: ... + @abstractmethod + def finalize_options(self) -> None: ... + @abstractmethod + def run(self) -> None: ... + + def announce(self, msg: Text, level: int = ...) -> None: ... + def debug_print(self, msg: Text) -> None: ... + + def ensure_string(self, option: str, default: Optional[str] = ...) -> None: ... + def ensure_string_list(self, option: Union[str, List[str]]) -> None: ... + def ensure_filename(self, option: str) -> None: ... + def ensure_dirname(self, option: str) -> None: ... + + def get_command_name(self) -> str: ... + def set_undefined_options(self, src_cmd: Text, *option_pairs: Tuple[str, str]) -> None: ... + def get_finalized_command(self, command: Text, create: int = ...) -> Command: ... + def reinitialize_command(self, command: Union[Command, Text], reinit_subcommands: int = ...) -> Command: ... + def run_command(self, command: Text) -> None: ... + def get_sub_commands(self) -> List[str]: ... + + def warn(self, msg: Text) -> None: ... + def execute(self, func: Callable[..., Any], args: Iterable[Any], msg: Optional[Text] = ..., level: int = ...) -> None: ... + def mkpath(self, name: str, mode: int = ...) -> None: ... + def copy_file(self, infile: str, outfile: str, preserve_mode: int = ..., preserve_times: int = ..., link: Optional[str] = ..., level: Any = ...) -> Tuple[str, bool]: ... # level is not used + def copy_tree(self, infile: str, outfile: str, preserve_mode: int = ..., preserve_times: int = ..., preserve_symlinks: int = ..., level: Any = ...) -> List[str]: ... # level is not used + def move_file(self, src: str, dest: str, level: Any = ...) -> str: ... # level is not used + def spawn(self, cmd: Iterable[str], search_path: int = ..., level: Any = ...) -> None: ... # level is not used + def make_archive(self, base_name: str, format: str, root_dir: Optional[str] = ..., base_dir: Optional[str] = ..., owner: Optional[str] = ..., group: Optional[str] = ...) -> str: ... + def make_file(self, infiles: Union[str, List[str], Tuple[str]], outfile: str, func: Callable[..., Any], args: List[Any], exec_msg: Optional[str] = ..., skip_msg: Optional[str] = ..., level: Any = ...) -> None: ... # level is not used diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_dumb.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_dumb.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_msi.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_msi.pyi new file mode 100644 index 00000000..a7617920 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_msi.pyi @@ -0,0 +1,6 @@ +from distutils.cmd import Command + +class bdist_msi(Command): + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_packager.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_packager.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_rpm.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_rpm.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_wininst.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/bdist_wininst.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_clib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_clib.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_ext.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_ext.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_py.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_py.pyi new file mode 100644 index 00000000..34753e4a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_py.pyi @@ -0,0 +1,10 @@ +from distutils.cmd import Command +import sys + +if sys.version_info >= (3,): + class build_py(Command): + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... + + class build_py_2to3(build_py): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_scripts.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/build_scripts.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/check.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/check.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/clean.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/clean.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/config.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/config.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install.pyi new file mode 100644 index 00000000..94a90082 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install.pyi @@ -0,0 +1,14 @@ +from distutils.cmd import Command +from typing import Optional, Text + + +class install(Command): + user: bool + prefix: Optional[Text] + home: Optional[Text] + root: Optional[Text] + install_lib: Optional[Text] + + def initialize_options(self) -> None: ... + def finalize_options(self) -> None: ... + def run(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_data.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_data.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_headers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_headers.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_lib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_lib.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_scripts.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/install_scripts.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/register.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/register.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/sdist.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/command/sdist.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/core.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/core.pyi new file mode 100644 index 00000000..125b7999 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/core.pyi @@ -0,0 +1,50 @@ +# Stubs for distutils.core + +from typing import Any, List, Mapping, Optional, Tuple, Type, Union +from distutils.cmd import Command as Command +from distutils.dist import Distribution as Distribution +from distutils.extension import Extension as Extension + +def setup(name: str = ..., + version: str = ..., + description: str = ..., + long_description: str = ..., + author: str = ..., + author_email: str = ..., + maintainer: str = ..., + maintainer_email: str = ..., + url: str = ..., + download_url: str = ..., + packages: List[str] = ..., + py_modules: List[str] = ..., + scripts: List[str] = ..., + ext_modules: List[Extension] = ..., + classifiers: List[str] = ..., + distclass: Type[Distribution] = ..., + script_name: str = ..., + script_args: List[str] = ..., + options: Mapping[str, Any] = ..., + license: str = ..., + keywords: Union[List[str], str] = ..., + platforms: Union[List[str], str] = ..., + cmdclass: Mapping[str, Type[Command]] = ..., + data_files: List[Tuple[str, List[str]]] = ..., + package_dir: Mapping[str, str] = ..., + obsoletes: List[str] = ..., + provides: List[str] = ..., + requires: List[str] = ..., + command_packages: List[str] = ..., + command_options: Mapping[str, Mapping[str, Tuple[Any, Any]]] = ..., + package_data: Mapping[str, List[str]] = ..., + include_package_data: bool = ..., + libraries: List[str] = ..., + headers: List[str] = ..., + ext_package: str = ..., + include_dirs: List[str] = ..., + password: str = ..., + fullname: str = ..., + **attrs: Any) -> None: ... + +def run_setup(script_name: str, + script_args: Optional[List[str]] = ..., + stop_after: str = ...) -> Distribution: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/cygwinccompiler.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/cygwinccompiler.pyi new file mode 100644 index 00000000..1bfab90e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/cygwinccompiler.pyi @@ -0,0 +1,7 @@ +# Stubs for distutils.cygwinccompiler + +from distutils.unixccompiler import UnixCCompiler + + +class CygwinCCompiler(UnixCCompiler): ... +class Mingw32CCompiler(CygwinCCompiler): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/debug.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/debug.pyi new file mode 100644 index 00000000..76de4477 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/debug.pyi @@ -0,0 +1,3 @@ +# Stubs for distutils.debug + +DEBUG: bool diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/dep_util.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/dep_util.pyi new file mode 100644 index 00000000..7df58478 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/dep_util.pyi @@ -0,0 +1,8 @@ +# Stubs for distutils.dep_util + +from typing import List, Tuple + +def newer(source: str, target: str) -> bool: ... +def newer_pairwise(sources: List[str], + targets: List[str]) -> List[Tuple[str, str]]: ... +def newer_group(sources: List[str], target: str, missing: str = ...) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/dir_util.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/dir_util.pyi new file mode 100644 index 00000000..667ac2fe --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/dir_util.pyi @@ -0,0 +1,15 @@ +# Stubs for distutils.dir_util + +from typing import List + + +def mkpath(name: str, mode: int = ..., verbose: int = ..., + dry_run: int = ...) -> List[str]: ... +def create_tree(base_dir: str, files: List[str], mode: int = ..., + verbose: int = ..., dry_run: int = ...) -> None: ... +def copy_tree(src: str, dst: str, preserve_mode: int = ..., + preserve_times: int = ..., preserve_symlinks: int = ..., + update: int = ..., verbose: int = ..., + dry_run: int = ...) -> List[str]: ... +def remove_tree(directory: str, verbose: int = ..., + dry_run: int = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/dist.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/dist.pyi new file mode 100644 index 00000000..65e766d1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/dist.pyi @@ -0,0 +1,11 @@ +# Stubs for distutils.dist +from distutils.cmd import Command + +from typing import Any, Mapping, Optional, Dict, Tuple, Iterable, Text + + +class Distribution: + def __init__(self, attrs: Optional[Mapping[str, Any]] = ...) -> None: ... + def get_option_dict(self, command: str) -> Dict[str, Tuple[str, Text]]: ... + def parse_config_files(self, filenames: Optional[Iterable[Text]] = ...) -> None: ... + def get_command_obj(self, command: str, create: bool = ...) -> Optional[Command]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/errors.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/errors.pyi new file mode 100644 index 00000000..e483362b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/errors.pyi @@ -0,0 +1,19 @@ +class DistutilsError(Exception): ... +class DistutilsModuleError(DistutilsError): ... +class DistutilsClassError(DistutilsError): ... +class DistutilsGetoptError(DistutilsError): ... +class DistutilsArgError(DistutilsError): ... +class DistutilsFileError(DistutilsError): ... +class DistutilsOptionError(DistutilsError): ... +class DistutilsSetupError(DistutilsError): ... +class DistutilsPlatformError(DistutilsError): ... +class DistutilsExecError(DistutilsError): ... +class DistutilsInternalError(DistutilsError): ... +class DistutilsTemplateError(DistutilsError): ... +class DistutilsByteCompileError(DistutilsError): ... +class CCompilerError(Exception): ... +class PreprocessError(CCompilerError): ... +class CompileError(CCompilerError): ... +class LibError(CCompilerError): ... +class LinkError(CCompilerError): ... +class UnknownFileError(CCompilerError): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/extension.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/extension.pyi new file mode 100644 index 00000000..5aa070e4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/extension.pyi @@ -0,0 +1,39 @@ +# Stubs for distutils.extension + +from typing import List, Optional, Tuple +import sys + +class Extension: + if sys.version_info >= (3,): + def __init__(self, + name: str, + sources: List[str], + include_dirs: List[str] = ..., + define_macros: List[Tuple[str, Optional[str]]] = ..., + undef_macros: List[str] = ..., + library_dirs: List[str] = ..., + libraries: List[str] = ..., + runtime_library_dirs: List[str] = ..., + extra_objects: List[str] = ..., + extra_compile_args: List[str] = ..., + extra_link_args: List[str] = ..., + export_symbols: List[str] = ..., + depends: List[str] = ..., + language: str = ..., + optional: bool = ...) -> None: ... + else: + def __init__(self, + name: str, + sources: List[str], + include_dirs: List[str] = ..., + define_macros: List[Tuple[str, Optional[str]]] = ..., + undef_macros: List[str] = ..., + library_dirs: List[str] = ..., + libraries: List[str] = ..., + runtime_library_dirs: List[str] = ..., + extra_objects: List[str] = ..., + extra_compile_args: List[str] = ..., + extra_link_args: List[str] = ..., + export_symbols: List[str] = ..., + depends: List[str] = ..., + language: str = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/fancy_getopt.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/fancy_getopt.pyi new file mode 100644 index 00000000..4d38a755 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/fancy_getopt.pyi @@ -0,0 +1,27 @@ +# Stubs for distutils.fancy_getopt + +from typing import ( + Any, List, Mapping, Optional, Tuple, Union, + TypeVar, overload, +) + +_Option = Tuple[str, Optional[str], str] +_GR = Tuple[List[str], OptionDummy] + +def fancy_getopt(options: List[_Option], + negative_opt: Mapping[_Option, _Option], + object: Any, + args: Optional[List[str]]) -> Union[List[str], _GR]: ... +def wrap_text(text: str, width: int) -> List[str]: ... + +class FancyGetopt: + def __init__(self, option_table: Optional[List[_Option]] = ...) -> None: ... + # TODO kinda wrong, `getopt(object=object())` is invalid + @overload + def getopt(self, args: Optional[List[str]] = ...) -> _GR: ... + @overload + def getopt(self, args: Optional[List[str]], object: Any) -> List[str]: ... + def get_option_order(self) -> List[Tuple[str, str]]: ... + def generate_help(self, header: Optional[str] = ...) -> List[str]: ... + +class OptionDummy: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/file_util.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/file_util.pyi new file mode 100644 index 00000000..6324d63d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/file_util.pyi @@ -0,0 +1,12 @@ +# Stubs for distutils.file_util + +from typing import Optional, Sequence, Tuple + + +def copy_file(src: str, dst: str, preserve_mode: bool = ..., + preserve_times: bool = ..., update: bool = ..., + link: Optional[str] = ..., verbose: bool = ..., + dry_run: bool = ...) -> Tuple[str, str]: ... +def move_file(src: str, dst: str, verbose: bool = ..., + dry_run: bool = ...) -> str: ... +def write_file(filename: str, contents: Sequence[str]) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/filelist.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/filelist.pyi new file mode 100644 index 00000000..4ecaebaf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/filelist.pyi @@ -0,0 +1,3 @@ +# Stubs for distutils.filelist + +class FileList: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/log.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/log.pyi new file mode 100644 index 00000000..6c37cc50 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/log.pyi @@ -0,0 +1,28 @@ +from typing import Any, Callable, Iterable, Text + +DEBUG: int +INFO: int +WARN: int +ERROR: int +FATAL: int + +class Log: + def __init__(self, threshold: int = ...) -> None: ... + def log(self, level: int, msg: Text, *args: Any) -> None: ... + def debug(self, msg: Text, *args: Any) -> None: ... + def info(self, msg: Text, *args: Any) -> None: ... + def warn(self, msg: Text, *args: Any) -> None: ... + def error(self, msg: Text, *args: Any) -> None: ... + def fatal(self, msg: Text, *args: Any) -> None: ... + +_LogFunc = Callable[[Text, Iterable[Any]], None] + +log: Callable[[int, Text, Iterable[Any]], None] +debug: _LogFunc +info: _LogFunc +warn: _LogFunc +error: _LogFunc +fatal: _LogFunc + +def set_threshold(level: int) -> int: ... +def set_verbosity(v: int) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/msvccompiler.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/msvccompiler.pyi new file mode 100644 index 00000000..ffc9e449 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/msvccompiler.pyi @@ -0,0 +1,6 @@ +# Stubs for distutils.msvccompiler + +from distutils.ccompiler import CCompiler + + +class MSVCCompiler(CCompiler): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/spawn.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/spawn.pyi new file mode 100644 index 00000000..8df9ebab --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/spawn.pyi @@ -0,0 +1,8 @@ +# Stubs for distutils.spawn + +from typing import List, Optional + +def spawn(cmd: List[str], search_path: bool = ..., + verbose: bool = ..., dry_run: bool = ...) -> None: ... +def find_executable(executable: str, + path: Optional[str] = ...) -> Optional[str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/sysconfig.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/sysconfig.pyi new file mode 100644 index 00000000..62fa9af8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/sysconfig.pyi @@ -0,0 +1,19 @@ +# Stubs for distutils.sysconfig + +from typing import Mapping, Optional, Union +from distutils.ccompiler import CCompiler + +PREFIX: str +EXEC_PREFIX: str + +def get_config_var(name: str) -> Union[int, str, None]: ... +def get_config_vars(*args: str) -> Mapping[str, Union[int, str]]: ... +def get_config_h_filename() -> str: ... +def get_makefile_filename() -> str: ... +def get_python_inc(plat_specific: bool = ..., + prefix: Optional[str] = ...) -> str: ... +def get_python_lib(plat_specific: bool = ..., standard_lib: bool = ..., + prefix: Optional[str] = ...) -> str: ... + +def customize_compiler(compiler: CCompiler) -> None: ... +def set_python_build() -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/text_file.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/text_file.pyi new file mode 100644 index 00000000..8f90d41d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/text_file.pyi @@ -0,0 +1,18 @@ +# Stubs for distutils.text_file + +from typing import IO, List, Optional, Tuple, Union + +class TextFile: + def __init__(self, filename: Optional[str] = ..., + file: Optional[IO[str]] = ..., + *, strip_comments: bool = ..., + lstrip_ws: bool = ..., rstrip_ws: bool = ..., + skip_blanks: bool = ..., join_lines: bool = ..., + collapse_join: bool = ...) -> None: ... + def open(self, filename: str) -> None: ... + def close(self) -> None: ... + def warn(self, msg: str, + line: Union[List[int], Tuple[int, int], int] = ...) -> None: ... + def readline(self) -> Optional[str]: ... + def readlines(self) -> List[str]: ... + def unreadline(self, line: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/unixccompiler.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/unixccompiler.pyi new file mode 100644 index 00000000..7ab7298b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/unixccompiler.pyi @@ -0,0 +1,6 @@ +# Stubs for distutils.unixccompiler + +from distutils.ccompiler import CCompiler + + +class UnixCCompiler(CCompiler): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/util.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/util.pyi new file mode 100644 index 00000000..942886d7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/util.pyi @@ -0,0 +1,20 @@ +# Stubs for distutils.util + +from typing import Any, Callable, List, Mapping, Optional, Tuple + + +def get_platform() -> str: ... +def convert_path(pathname: str) -> str: ... +def change_root(new_root: str, pathname: str) -> str: ... +def check_environ() -> None: ... +def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ... +def split_quoted(s: str) -> List[str]: ... +def execute(func: Callable[..., None], args: Tuple[Any, ...], + msg: Optional[str] = ..., verbose: bool = ..., + dry_run: bool = ...) -> None: ... +def strtobool(val: str) -> bool: ... +def byte_compile(py_files: List[str], optimize: int = ..., force: bool = ..., + prefix: Optional[str] = ..., base_dir: Optional[str] = ..., + verbose: bool = ..., dry_run: bool = ..., + direct: Optional[bool] = ...) -> None: ... +def rfc822_escape(header: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/version.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/version.pyi new file mode 100644 index 00000000..36ee4b84 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/distutils/version.pyi @@ -0,0 +1,54 @@ +import sys +from abc import abstractmethod +from typing import Any, Optional, TypeVar, Union, Pattern, Text, Tuple + +_T = TypeVar('_T', bound=Version) + +class Version: + def __repr__(self) -> str: ... + + if sys.version_info >= (3,): + def __eq__(self, other: object) -> bool: ... + def __lt__(self: _T, other: Union[_T, str]) -> bool: ... + def __le__(self: _T, other: Union[_T, str]) -> bool: ... + def __gt__(self: _T, other: Union[_T, str]) -> bool: ... + def __ge__(self: _T, other: Union[_T, str]) -> bool: ... + + @abstractmethod + def __init__(self, vstring: Optional[Text] = ...) -> None: ... + @abstractmethod + def parse(self: _T, vstring: Text) -> _T: ... + @abstractmethod + def __str__(self) -> str: ... + if sys.version_info >= (3,): + @abstractmethod + def _cmp(self: _T, other: Union[_T, str]) -> bool: ... + else: + @abstractmethod + def __cmp__(self: _T, other: Union[_T, str]) -> bool: ... + +class StrictVersion(Version): + version_re: Pattern[str] + version: Tuple[int, int, int] + prerelease: Optional[Tuple[Text, int]] + + def __init__(self, vstring: Optional[Text] = ...) -> None: ... + def parse(self: _T, vstring: Text) -> _T: ... + def __str__(self) -> str: ... + if sys.version_info >= (3,): + def _cmp(self: _T, other: Union[_T, str]) -> bool: ... + else: + def __cmp__(self: _T, other: Union[_T, str]) -> bool: ... + +class LooseVersion(Version): + component_re: Pattern[str] + vstring: Text + version: Tuple[Union[Text, int], ...] + + def __init__(self, vstring: Optional[Text] = ...) -> None: ... + def parse(self: _T, vstring: Text) -> _T: ... + def __str__(self) -> str: ... + if sys.version_info >= (3,): + def _cmp(self: _T, other: Union[_T, str]) -> bool: ... + else: + def __cmp__(self: _T, other: Union[_T, str]) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/doctest.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/doctest.pyi new file mode 100644 index 00000000..54a8c874 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/doctest.pyi @@ -0,0 +1,160 @@ +from typing import Any, Callable, Dict, List, NamedTuple, Optional, Tuple, Type, Union + +import sys +import types +import unittest + +class TestResults(NamedTuple): + failed: int + attempted: int + +OPTIONFLAGS_BY_NAME: Dict[str, int] +def register_optionflag(name: str) -> int: ... +DONT_ACCEPT_TRUE_FOR_1: int +DONT_ACCEPT_BLANKLINE: int +NORMALIZE_WHITESPACE: int +ELLIPSIS: int +SKIP: int +IGNORE_EXCEPTION_DETAIL: int + +COMPARISON_FLAGS: int + +REPORT_UDIFF: int +REPORT_CDIFF: int +REPORT_NDIFF: int +REPORT_ONLY_FIRST_FAILURE: int +if sys.version_info >= (3, 4): + FAIL_FAST: int + +REPORTING_FLAGS: int + +BLANKLINE_MARKER: str +ELLIPSIS_MARKER: str + +class Example: + source: str + want: str + exc_msg: Optional[str] + lineno: int + indent: int + options: Dict[int, bool] + def __init__(self, source: str, want: str, exc_msg: Optional[str] = ..., lineno: int = ..., indent: int = ..., + options: Optional[Dict[int, bool]] = ...) -> None: ... + def __hash__(self) -> int: ... + +class DocTest: + examples: List[Example] + globs: Dict[str, Any] + name: str + filename: Optional[str] + lineno: Optional[int] + docstring: Optional[str] + def __init__(self, examples: List[Example], globs: Dict[str, Any], name: str, filename: Optional[str], lineno: Optional[int], docstring: Optional[str]) -> None: ... + def __hash__(self) -> int: ... + def __lt__(self, other: DocTest) -> bool: ... + +class DocTestParser: + def parse(self, string: str, name: str = ...) -> List[Union[str, Example]]: ... + def get_doctest(self, string: str, globs: Dict[str, Any], name: str, filename: Optional[str], lineno: Optional[int]) -> DocTest: ... + def get_examples(self, string: str, name: str = ...) -> List[Example]: ... + +class DocTestFinder: + def __init__(self, verbose: bool = ..., parser: DocTestParser = ..., + recurse: bool = ..., exclude_empty: bool = ...) -> None: ... + def find(self, obj: object, name: Optional[str] = ..., module: Union[None, bool, types.ModuleType] = ..., + globs: Optional[Dict[str, Any]] = ..., extraglobs: Optional[Dict[str, Any]] = ...) -> List[DocTest]: ... + +_Out = Callable[[str], Any] +_ExcInfo = Tuple[Type[BaseException], BaseException, types.TracebackType] + +class DocTestRunner: + DIVIDER: str + optionflags: int + original_optionflags: int + tries: int + failures: int + test: DocTest + + def __init__(self, checker: Optional[OutputChecker] = ..., verbose: Optional[bool] = ..., optionflags: int = ...) -> None: ... + def report_start(self, out: _Out, test: DocTest, example: Example) -> None: ... + def report_success(self, out: _Out, test: DocTest, example: Example, got: str) -> None: ... + def report_failure(self, out: _Out, test: DocTest, example: Example, got: str) -> None: ... + def report_unexpected_exception(self, out: _Out, test: DocTest, example: Example, exc_info: _ExcInfo) -> None: ... + def run(self, test: DocTest, compileflags: Optional[int] = ..., out: Optional[_Out] = ..., clear_globs: bool = ...) -> TestResults: ... + def summarize(self, verbose: Optional[bool] = ...) -> TestResults: ... + def merge(self, other: DocTestRunner) -> None: ... + +class OutputChecker: + def check_output(self, want: str, got: str, optionflags: int) -> bool: ... + def output_difference(self, example: Example, got: str, optionflags: int) -> str: ... + +class DocTestFailure(Exception): + test: DocTest + example: Example + got: str + + def __init__(self, test: DocTest, example: Example, got: str) -> None: ... + +class UnexpectedException(Exception): + test: DocTest + example: Example + exc_info: _ExcInfo + + def __init__(self, test: DocTest, example: Example, exc_info: _ExcInfo) -> None: ... + +class DebugRunner(DocTestRunner): ... + +master: Optional[DocTestRunner] + +def testmod(m: Optional[types.ModuleType] = ..., name: Optional[str] = ..., globs: Dict[str, Any] = ..., verbose: Optional[bool] = ..., + report: bool = ..., optionflags: int = ..., extraglobs: Dict[str, Any] = ..., + raise_on_error: bool = ..., exclude_empty: bool = ...) -> TestResults: ... +def testfile(filename: str, module_relative: bool = ..., name: Optional[str] = ..., package: Union[None, str, types.ModuleType] = ..., + globs: Optional[Dict[str, Any]] = ..., verbose: Optional[bool] = ..., report: bool = ..., optionflags: int = ..., + extraglobs: Optional[Dict[str, Any]] = ..., raise_on_error: bool = ..., parser: DocTestParser = ..., + encoding: Optional[str] = ...) -> TestResults: ... +def run_docstring_examples(f: object, globs: Dict[str, Any], verbose: bool = ..., name: str = ..., + compileflags: Optional[int] = ..., optionflags: int = ...) -> None: ... +def set_unittest_reportflags(flags: int) -> int: ... + +class DocTestCase(unittest.TestCase): + def __init__(self, test: DocTest, optionflags: int = ..., setUp: Optional[Callable[[DocTest], Any]] = ..., + tearDown: Optional[Callable[[DocTest], Any]] = ..., + checker: Optional[OutputChecker] = ...) -> None: ... + def setUp(self) -> None: ... + def tearDown(self) -> None: ... + def runTest(self) -> None: ... + def format_failure(self, err: str) -> str: ... + def debug(self) -> None: ... + def id(self) -> str: ... + def __hash__(self) -> int: ... + def shortDescription(self) -> str: ... + +class SkipDocTestCase(DocTestCase): + def __init__(self, module: types.ModuleType) -> None: ... + def setUp(self) -> None: ... + def test_skip(self) -> None: ... + def shortDescription(self) -> str: ... + +if sys.version_info >= (3, 4): + class _DocTestSuite(unittest.TestSuite): ... +else: + _DocTestSuite = unittest.TestSuite + +def DocTestSuite(module: Union[None, str, types.ModuleType] = ..., globs: Optional[Dict[str, Any]] = ..., + extraglobs: Optional[Dict[str, Any]] = ..., test_finder: Optional[DocTestFinder] = ..., + **options: Any) -> _DocTestSuite: ... + +class DocFileCase(DocTestCase): + def id(self) -> str: ... + def format_failure(self, err: str) -> str: ... + +def DocFileTest(path: str, module_relative: bool = ..., package: Union[None, str, types.ModuleType] = ..., + globs: Optional[Dict[str, Any]] = ..., parser: DocTestParser = ..., + encoding: Optional[str] = ..., **options: Any) -> DocFileCase: ... +def DocFileSuite(*paths: str, **kw: Any) -> _DocTestSuite: ... +def script_from_examples(s: str) -> str: ... +def testsource(module: Union[None, str, types.ModuleType], name: str) -> str: ... +def debug_src(src: str, pm: bool = ..., globs: Optional[Dict[str, Any]] = ...) -> None: ... +def debug_script(src: str, pm: bool = ..., globs: Optional[Dict[str, Any]] = ...) -> None: ... +def debug(module: Union[None, str, types.ModuleType], name: str, pm: bool = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ensurepip/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ensurepip/__init__.pyi new file mode 100644 index 00000000..10634f2b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ensurepip/__init__.pyi @@ -0,0 +1,10 @@ + +from typing import Optional +import sys + + +def version() -> str: ... +if sys.version_info >= (3, 0): + def bootstrap(*, root: Optional[str] = ..., upgrade: bool = ..., user: bool = ..., altinstall: bool = ..., default_pip: bool = ..., verbosity: int = ...) -> None: ... +else: + def bootstrap(root: Optional[str] = ..., upgrade: bool = ..., user: bool = ..., altinstall: bool = ..., default_pip: bool = ..., verbosity: int = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/errno.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/errno.pyi new file mode 100644 index 00000000..731681f1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/errno.pyi @@ -0,0 +1,140 @@ +# Stubs for errno + +from typing import Mapping +import sys + +errorcode: Mapping[int, str] + +EPERM: int +ENOENT: int +ESRCH: int +EINTR: int +EIO: int +ENXIO: int +E2BIG: int +ENOEXEC: int +EBADF: int +ECHILD: int +EAGAIN: int +ENOMEM: int +EACCES: int +EFAULT: int +ENOTBLK: int +EBUSY: int +EEXIST: int +EXDEV: int +ENODEV: int +ENOTDIR: int +EISDIR: int +EINVAL: int +ENFILE: int +EMFILE: int +ENOTTY: int +ETXTBSY: int +EFBIG: int +ENOSPC: int +ESPIPE: int +EROFS: int +EMLINK: int +EPIPE: int +EDOM: int +ERANGE: int +EDEADLCK: int +ENAMETOOLONG: int +ENOLCK: int +ENOSYS: int +ENOTEMPTY: int +ELOOP: int +EWOULDBLOCK: int +ENOMSG: int +EIDRM: int +ECHRNG: int +EL2NSYNC: int +EL3HLT: int +EL3RST: int +ELNRNG: int +EUNATCH: int +ENOCSI: int +EL2HLT: int +EBADE: int +EBADR: int +EXFULL: int +ENOANO: int +EBADRQC: int +EBADSLT: int +EDEADLOCK: int +EBFONT: int +ENOSTR: int +ENODATA: int +ETIME: int +ENOSR: int +ENONET: int +ENOPKG: int +EREMOTE: int +ENOLINK: int +EADV: int +ESRMNT: int +ECOMM: int +EPROTO: int +EMULTIHOP: int +EDOTDOT: int +EBADMSG: int +EOVERFLOW: int +ENOTUNIQ: int +EBADFD: int +EREMCHG: int +ELIBACC: int +ELIBBAD: int +ELIBSCN: int +ELIBMAX: int +ELIBEXEC: int +EILSEQ: int +ERESTART: int +ESTRPIPE: int +EUSERS: int +ENOTSOCK: int +EDESTADDRREQ: int +EMSGSIZE: int +EPROTOTYPE: int +ENOPROTOOPT: int +EPROTONOSUPPORT: int +ESOCKTNOSUPPORT: int +ENOTSUP: int +EOPNOTSUPP: int +EPFNOSUPPORT: int +EAFNOSUPPORT: int +EADDRINUSE: int +EADDRNOTAVAIL: int +ENETDOWN: int +ENETUNREACH: int +ENETRESET: int +ECONNABORTED: int +ECONNRESET: int +ENOBUFS: int +EISCONN: int +ENOTCONN: int +ESHUTDOWN: int +ETOOMANYREFS: int +ETIMEDOUT: int +ECONNREFUSED: int +EHOSTDOWN: int +EHOSTUNREACH: int +EALREADY: int +EINPROGRESS: int +ESTALE: int +EUCLEAN: int +ENOTNAM: int +ENAVAIL: int +EISNAM: int +EREMOTEIO: int +EDQUOT: int +ECANCELED: int # undocumented +EKEYEXPIRED: int # undocumented +EKEYREJECTED: int # undocumented +EKEYREVOKED: int # undocumented +EMEDIUMTYPE: int # undocumented +ENOKEY: int # undocumented +ENOMEDIUM: int # undocumented +ENOTRECOVERABLE: int # undocumented +EOWNERDEAD: int # undocumented +ERFKILL: int # undocumented diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/filecmp.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/filecmp.pyi new file mode 100644 index 00000000..57a88466 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/filecmp.pyi @@ -0,0 +1,48 @@ +# Stubs for filecmp (Python 2/3) +import sys +from typing import AnyStr, Callable, Dict, Generic, Iterable, List, Optional, Sequence, Tuple, Union, Text + +DEFAULT_IGNORES: List[str] + +def cmp(f1: Union[bytes, Text], f2: Union[bytes, Text], shallow: Union[int, bool] = ...) -> bool: ... +def cmpfiles(a: AnyStr, b: AnyStr, common: Iterable[AnyStr], + shallow: Union[int, bool] = ...) -> Tuple[List[AnyStr], List[AnyStr], List[AnyStr]]: ... + +class dircmp(Generic[AnyStr]): + def __init__(self, a: AnyStr, b: AnyStr, + ignore: Optional[Sequence[AnyStr]] = ..., + hide: Optional[Sequence[AnyStr]] = ...) -> None: ... + + left: AnyStr + right: AnyStr + hide: Sequence[AnyStr] + ignore: Sequence[AnyStr] + + # These properties are created at runtime by __getattr__ + subdirs: Dict[AnyStr, dircmp[AnyStr]] + same_files: List[AnyStr] + diff_files: List[AnyStr] + funny_files: List[AnyStr] + common_dirs: List[AnyStr] + common_files: List[AnyStr] + common_funny: List[AnyStr] + common: List[AnyStr] + left_only: List[AnyStr] + right_only: List[AnyStr] + left_list: List[AnyStr] + right_list: List[AnyStr] + + def report(self) -> None: ... + def report_partial_closure(self) -> None: ... + def report_full_closure(self) -> None: ... + + methodmap: Dict[str, Callable[[], None]] + def phase0(self) -> None: ... + def phase1(self) -> None: ... + def phase2(self) -> None: ... + def phase3(self) -> None: ... + def phase4(self) -> None: ... + def phase4_closure(self) -> None: ... + +if sys.version_info >= (3,): + def clear_cache() -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/fileinput.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/fileinput.pyi new file mode 100644 index 00000000..e5c20e52 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/fileinput.pyi @@ -0,0 +1,82 @@ +from typing import Iterable, Callable, IO, AnyStr, Generic, Any, Text, Union, Iterator, Optional + +import os +import sys + +if sys.version_info >= (3, 6): + _Path = Union[Text, bytes, os.PathLike[Any]] +else: + _Path = Union[Text, bytes] + +if sys.version_info >= (3, 8): + def input( + files: Union[_Path, Iterable[_Path], None] = ..., + inplace: bool = ..., + backup: str = ..., + *, + mode: str = ..., + openhook: Callable[[_Path, str], IO[AnyStr]] = ..., + ) -> FileInput[AnyStr]: ... +else: + def input( + files: Union[_Path, Iterable[_Path], None] = ..., + inplace: bool = ..., + backup: str = ..., + bufsize: int = ..., + mode: str = ..., + openhook: Callable[[_Path, str], IO[AnyStr]] = ..., + ) -> FileInput[AnyStr]: ... + +def close() -> None: ... +def nextfile() -> None: ... +def filename() -> str: ... +def lineno() -> int: ... +def filelineno() -> int: ... +def fileno() -> int: ... +def isfirstline() -> bool: ... +def isstdin() -> bool: ... + +class FileInput(Iterable[AnyStr], Generic[AnyStr]): + if sys.version_info >= (3, 8): + def __init__( + self, + files: Union[None, _Path, Iterable[_Path]] = ..., + inplace: bool = ..., + backup: str = ..., + *, + mode: str = ..., + openhook: Callable[[_Path, str], IO[AnyStr]] = ... + ) -> None: ... + else: + def __init__( + self, + files: Union[None, _Path, Iterable[_Path]] = ..., + inplace: bool = ..., + backup: str = ..., + bufsize: int = ..., + mode: str = ..., + openhook: Callable[[_Path, str], IO[AnyStr]] = ... + ) -> None: ... + + def __del__(self) -> None: ... + def close(self) -> None: ... + if sys.version_info >= (3, 2): + def __enter__(self) -> FileInput[AnyStr]: ... + def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ... + def __iter__(self) -> Iterator[AnyStr]: ... + def __next__(self) -> AnyStr: ... + def __getitem__(self, i: int) -> AnyStr: ... + def nextfile(self) -> None: ... + def readline(self) -> AnyStr: ... + def filename(self) -> str: ... + def lineno(self) -> int: ... + def filelineno(self) -> int: ... + def fileno(self) -> int: ... + def isfirstline(self) -> bool: ... + def isstdin(self) -> bool: ... + +def hook_compressed(filename: _Path, mode: str) -> IO[Any]: ... +if sys.version_info >= (3, 6): + def hook_encoded(encoding: str, errors: Optional[str] = ...) -> Callable[[_Path, str], IO[Any]]: ... +else: + def hook_encoded(encoding: str) -> Callable[[_Path, str], IO[Any]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/formatter.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/formatter.pyi new file mode 100644 index 00000000..bda4c790 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/formatter.pyi @@ -0,0 +1,105 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/formatter.py +# and https://github.com/python/cpython/blob/master/Lib/formatter.py +from typing import Any, IO, List, Optional, Tuple + +AS_IS: None +_FontType = Tuple[str, bool, bool, bool] +_StylesType = Tuple[Any, ...] + +class NullFormatter: + writer: Optional[NullWriter] + def __init__(self, writer: Optional[NullWriter] = ...) -> None: ... + def end_paragraph(self, blankline: int) -> None: ... + def add_line_break(self) -> None: ... + def add_hor_rule(self, *args, **kw) -> None: ... + def add_label_data(self, format, counter: int, blankline: Optional[int] = ...) -> None: ... + def add_flowing_data(self, data: str) -> None: ... + def add_literal_data(self, data: str) -> None: ... + def flush_softspace(self) -> None: ... + def push_alignment(self, align: Optional[str]) -> None: ... + def pop_alignment(self) -> None: ... + def push_font(self, x: _FontType) -> None: ... + def pop_font(self) -> None: ... + def push_margin(self, margin: int) -> None: ... + def pop_margin(self) -> None: ... + def set_spacing(self, spacing: Optional[str]) -> None: ... + def push_style(self, *styles: _StylesType) -> None: ... + def pop_style(self, n: int = ...) -> None: ... + def assert_line_data(self, flag: int = ...) -> None: ... + +class AbstractFormatter: + writer: NullWriter + align: Optional[str] + align_stack: List[Optional[str]] + font_stack: List[_FontType] + margin_stack: List[int] + spacing: Optional[str] + style_stack: Any + nospace: int + softspace: int + para_end: int + parskip: int + hard_break: int + have_label: int + def __init__(self, writer: NullWriter) -> None: ... + def end_paragraph(self, blankline: int) -> None: ... + def add_line_break(self) -> None: ... + def add_hor_rule(self, *args, **kw) -> None: ... + def add_label_data(self, format, counter: int, blankline: Optional[int] = ...) -> None: ... + def format_counter(self, format, counter: int) -> str: ... + def format_letter(self, case: str, counter: int) -> str: ... + def format_roman(self, case: str, counter: int) -> str: ... + def add_flowing_data(self, data: str) -> None: ... + def add_literal_data(self, data: str) -> None: ... + def flush_softspace(self) -> None: ... + def push_alignment(self, align: Optional[str]) -> None: ... + def pop_alignment(self) -> None: ... + def push_font(self, font: _FontType) -> None: ... + def pop_font(self) -> None: ... + def push_margin(self, margin: int) -> None: ... + def pop_margin(self) -> None: ... + def set_spacing(self, spacing: Optional[str]) -> None: ... + def push_style(self, *styles: _StylesType) -> None: ... + def pop_style(self, n: int = ...) -> None: ... + def assert_line_data(self, flag: int = ...) -> None: ... + +class NullWriter: + def __init__(self) -> None: ... + def flush(self) -> None: ... + def new_alignment(self, align: Optional[str]) -> None: ... + def new_font(self, font: _FontType) -> None: ... + def new_margin(self, margin: int, level: int) -> None: ... + def new_spacing(self, spacing: Optional[str]) -> None: ... + def new_styles(self, styles) -> None: ... + def send_paragraph(self, blankline: int) -> None: ... + def send_line_break(self) -> None: ... + def send_hor_rule(self, *args, **kw) -> None: ... + def send_label_data(self, data: str) -> None: ... + def send_flowing_data(self, data: str) -> None: ... + def send_literal_data(self, data: str) -> None: ... + +class AbstractWriter(NullWriter): + def new_alignment(self, align: Optional[str]) -> None: ... + def new_font(self, font: _FontType) -> None: ... + def new_margin(self, margin: int, level: int) -> None: ... + def new_spacing(self, spacing: Optional[str]) -> None: ... + def new_styles(self, styles) -> None: ... + def send_paragraph(self, blankline: int) -> None: ... + def send_line_break(self) -> None: ... + def send_hor_rule(self, *args, **kw) -> None: ... + def send_label_data(self, data: str) -> None: ... + def send_flowing_data(self, data: str) -> None: ... + def send_literal_data(self, data: str) -> None: ... + +class DumbWriter(NullWriter): + file: IO[str] + maxcol: int + def __init__(self, file: Optional[IO[str]] = ..., maxcol: int = ...) -> None: ... + def reset(self) -> None: ... + def send_paragraph(self, blankline: int) -> None: ... + def send_line_break(self) -> None: ... + def send_hor_rule(self, *args, **kw) -> None: ... + def send_literal_data(self, data: str) -> None: ... + def send_flowing_data(self, data: str) -> None: ... + +def test(file: Optional[str] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/fractions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/fractions.pyi new file mode 100644 index 00000000..ce3f89f8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/fractions.pyi @@ -0,0 +1,98 @@ +# Stubs for fractions +# See https://docs.python.org/3/library/fractions.html +# +# Note: these stubs are incomplete. The more complex type +# signatures are currently omitted. Also see numbers.pyi. + +from typing import Optional, TypeVar, Union, overload, Any, Tuple +from numbers import Real, Integral, Rational +from decimal import Decimal +import sys + +_ComparableNum = Union[int, float, Decimal, Real] + + +@overload +def gcd(a: int, b: int) -> int: ... +@overload +def gcd(a: Integral, b: int) -> Integral: ... +@overload +def gcd(a: int, b: Integral) -> Integral: ... +@overload +def gcd(a: Integral, b: Integral) -> Integral: ... + + +class Fraction(Rational): + @overload + def __init__(self, + numerator: Union[int, Rational] = ..., + denominator: Optional[Union[int, Rational]] = ..., + *, + _normalize: bool = ...) -> None: ... + @overload + def __init__(self, value: float, *, _normalize: bool = ...) -> None: ... + @overload + def __init__(self, value: Decimal, *, _normalize: bool = ...) -> None: ... + @overload + def __init__(self, value: str, *, _normalize: bool = ...) -> None: ... + + @classmethod + def from_float(cls, f: float) -> Fraction: ... + @classmethod + def from_decimal(cls, dec: Decimal) -> Fraction: ... + def limit_denominator(self, max_denominator: int = ...) -> Fraction: ... + + if sys.version_info >= (3, 8): + def as_integer_ratio(self) -> Tuple[int, int]: ... + @property + def numerator(self) -> int: ... + @property + def denominator(self) -> int: ... + + def __add__(self, other): ... + def __radd__(self, other): ... + def __sub__(self, other): ... + def __rsub__(self, other): ... + def __mul__(self, other): ... + def __rmul__(self, other): ... + def __truediv__(self, other): ... + def __rtruediv__(self, other): ... + if sys.version_info < (3, 0): + def __div__(self, other): ... + def __rdiv__(self, other): ... + def __floordiv__(self, other) -> int: ... + def __rfloordiv__(self, other) -> int: ... + def __mod__(self, other): ... + def __rmod__(self, other): ... + def __divmod__(self, other): ... + def __rdivmod__(self, other): ... + def __pow__(self, other): ... + def __rpow__(self, other): ... + + def __pos__(self) -> Fraction: ... + def __neg__(self) -> Fraction: ... + def __abs__(self) -> Fraction: ... + def __trunc__(self) -> int: ... + if sys.version_info >= (3, 0): + def __floor__(self) -> int: ... + def __ceil__(self) -> int: ... + def __round__(self, ndigits: Optional[Any] = ...): ... + + def __hash__(self) -> int: ... + def __eq__(self, other: object) -> bool: ... + def __lt__(self, other: _ComparableNum) -> bool: ... + def __gt__(self, other: _ComparableNum) -> bool: ... + def __le__(self, other: _ComparableNum) -> bool: ... + def __ge__(self, other: _ComparableNum) -> bool: ... + if sys.version_info >= (3, 0): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + + # Not actually defined within fractions.py, but provides more useful + # overrides + @property + def real(self) -> Fraction: ... + @property + def imag(self) -> Fraction: ... + def conjugate(self) -> Fraction: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ftplib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ftplib.pyi new file mode 100644 index 00000000..9c303f5c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ftplib.pyi @@ -0,0 +1,174 @@ +import sys +from typing import ( + Any, + BinaryIO, + Callable, + Dict, + Generic, + Iterable, + Iterator, + List, + Optional, + Protocol, + Text, + TextIO, + Tuple, + Type, + TypeVar, + Union, +) +from types import TracebackType +from socket import socket +from ssl import SSLContext + +_T = TypeVar("_T") +_IntOrStr = Union[int, Text] + +MSG_OOB: int +FTP_PORT: int +MAXLINE: int +CRLF: str +if sys.version_info >= (3,): + B_CRLF: bytes + +class Error(Exception): ... +class error_reply(Error): ... +class error_temp(Error): ... +class error_perm(Error): ... +class error_proto(Error): ... + +all_errors = Tuple[Exception, ...] + +class _Readable(Protocol): + def read(self, __length: int) -> bytes: ... + +class _ReadLineable(Protocol): + def readline(self, _length: int) -> bytes: ... + +class FTP: + debugging: int + + # Note: This is technically the type that's passed in as the host argument. But to make it easier in Python 2 we + # accept Text but return str. + host: str + + port: int + maxline: int + sock: Optional[socket] + welcome: Optional[str] + passiveserver: int + timeout: int + af: int + lastresp: str + + if sys.version_info >= (3,): + file: Optional[TextIO] + encoding: str + def __enter__(self: _T) -> _T: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> None: ... + else: + file: Optional[BinaryIO] + + if sys.version_info >= (3, 3): + source_address: Optional[Tuple[str, int]] + def __init__( + self, + host: Text = ..., + user: Text = ..., + passwd: Text = ..., + acct: Text = ..., + timeout: float = ..., + source_address: Optional[Tuple[str, int]] = ..., + ) -> None: ... + def connect( + self, host: Text = ..., port: int = ..., timeout: float = ..., source_address: Optional[Tuple[str, int]] = ... + ) -> str: ... + else: + def __init__( + self, host: Text = ..., user: Text = ..., passwd: Text = ..., acct: Text = ..., timeout: float = ... + ) -> None: ... + def connect(self, host: Text = ..., port: int = ..., timeout: float = ...) -> str: ... + def getwelcome(self) -> str: ... + def set_debuglevel(self, level: int) -> None: ... + def debug(self, level: int) -> None: ... + def set_pasv(self, val: Union[bool, int]) -> None: ... + def sanitize(self, s: Text) -> str: ... + def putline(self, line: Text) -> None: ... + def putcmd(self, line: Text) -> None: ... + def getline(self) -> str: ... + def getmultiline(self) -> str: ... + def getresp(self) -> str: ... + def voidresp(self) -> str: ... + def abort(self) -> str: ... + def sendcmd(self, cmd: Text) -> str: ... + def voidcmd(self, cmd: Text) -> str: ... + def sendport(self, host: Text, port: int) -> str: ... + def sendeprt(self, host: Text, port: int) -> str: ... + def makeport(self) -> socket: ... + def makepasv(self) -> Tuple[str, int]: ... + def login(self, user: Text = ..., passwd: Text = ..., acct: Text = ...) -> str: ... + # In practice, `rest` rest can actually be anything whose str() is an integer sequence, so to make it simple we allow integers. + def ntransfercmd(self, cmd: Text, rest: Optional[_IntOrStr] = ...) -> Tuple[socket, int]: ... + def transfercmd(self, cmd: Text, rest: Optional[_IntOrStr] = ...) -> socket: ... + def retrbinary( + self, cmd: Text, callback: Callable[[bytes], Any], blocksize: int = ..., rest: Optional[_IntOrStr] = ... + ) -> str: ... + def storbinary( + self, + cmd: Text, + fp: _Readable, + blocksize: int = ..., + callback: Optional[Callable[[bytes], Any]] = ..., + rest: Optional[_IntOrStr] = ..., + ) -> str: ... + def retrlines(self, cmd: Text, callback: Optional[Callable[[str], Any]] = ...) -> str: ... + def storlines(self, cmd: Text, fp: _ReadLineable, callback: Optional[Callable[[bytes], Any]] = ...) -> str: ... + def acct(self, password: Text) -> str: ... + def nlst(self, *args: Text) -> List[str]: ... + # Technically only the last arg can be a Callable but ... + def dir(self, *args: Union[str, Callable[[str], None]]) -> None: ... + if sys.version_info >= (3, 3): + def mlsd(self, path: Text = ..., facts: Iterable[str] = ...) -> Iterator[Tuple[str, Dict[str, str]]]: ... + def rename(self, fromname: Text, toname: Text) -> str: ... + def delete(self, filename: Text) -> str: ... + def cwd(self, dirname: Text) -> str: ... + def size(self, filename: Text) -> str: ... + def mkd(self, dirname: Text) -> str: ... + def rmd(self, dirname: Text) -> str: ... + def pwd(self) -> str: ... + def quit(self) -> str: ... + def close(self) -> None: ... + +class FTP_TLS(FTP): + def __init__( + self, + host: Text = ..., + user: Text = ..., + passwd: Text = ..., + acct: Text = ..., + keyfile: Optional[str] = ..., + certfile: Optional[str] = ..., + context: Optional[SSLContext] = ..., + timeout: float = ..., + source_address: Optional[Tuple[str, int]] = ..., + ) -> None: ... + ssl_version: int + keyfile: Optional[str] + certfile: Optional[str] + context: SSLContext + def login(self, user: Text = ..., passwd: Text = ..., acct: Text = ..., secure: bool = ...) -> str: ... + def auth(self) -> str: ... + def prot_p(self) -> str: ... + def prot_c(self) -> str: ... + if sys.version_info >= (3, 3): + def ccc(self) -> str: ... + +if sys.version_info < (3,): + class Netrc: + def __init__(self, filename: Optional[Text] = ...) -> None: ... + def get_hosts(self) -> List[str]: ... + def get_account(self, host: Text) -> Tuple[Optional[str], Optional[str], Optional[str]]: ... + def get_macros(self) -> List[str]: ... + def get_macro(self, macro: Text) -> Tuple[str, ...]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/genericpath.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/genericpath.pyi new file mode 100644 index 00000000..e0b1c6de --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/genericpath.pyi @@ -0,0 +1,21 @@ +from typing import Sequence, AnyStr, Text +import sys + +if sys.version_info >= (3, 0): + def commonprefix(m: Sequence[str]) -> str: ... +else: + def commonprefix(m: Sequence[AnyStr]) -> AnyStr: ... + +def exists(path: Text) -> bool: ... +def isfile(path: Text) -> bool: ... +def isdir(s: Text) -> bool: ... +def getsize(filename: Text) -> int: ... +def getmtime(filename: Text) -> float: ... +def getatime(filename: Text) -> float: ... +def getctime(filename: Text) -> float: ... + + +if sys.version_info >= (3, 4): + def samestat(s1: str, s2: str) -> int: ... + def samefile(f1: str, f2: str) -> int: ... + def sameopenfile(fp1: str, fp2: str) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/grp.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/grp.pyi new file mode 100644 index 00000000..5b585558 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/grp.pyi @@ -0,0 +1,11 @@ +from typing import List, NamedTuple, Optional + +class struct_group(NamedTuple): + gr_name: str + gr_passwd: Optional[str] + gr_gid: int + gr_mem: List[str] + +def getgrall() -> List[struct_group]: ... +def getgrgid(gid: int) -> struct_group: ... +def getgrnam(name: str) -> struct_group: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/hmac.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/hmac.pyi new file mode 100644 index 00000000..47bbc7ec --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/hmac.pyi @@ -0,0 +1,38 @@ +# Stubs for hmac + +from typing import Any, Callable, Optional, Union, overload, AnyStr +from types import ModuleType +import sys + +_B = Union[bytes, bytearray] + +# TODO more precise type for object of hashlib +_Hash = Any + +digest_size: None + +if sys.version_info >= (3, 4): + def new(key: _B, msg: Optional[_B] = ..., + digestmod: Optional[Union[str, Callable[[], _Hash], ModuleType]] = ...) -> HMAC: ... +else: + def new(key: _B, msg: Optional[_B] = ..., + digestmod: Optional[Union[Callable[[], _Hash], ModuleType]] = ...) -> HMAC: ... + +class HMAC: + if sys.version_info >= (3,): + digest_size: int + if sys.version_info >= (3, 4): + block_size: int + name: str + def update(self, msg: _B) -> None: ... + def digest(self) -> bytes: ... + def hexdigest(self) -> str: ... + def copy(self) -> HMAC: ... + +@overload +def compare_digest(a: bytearray, b: bytearray) -> bool: ... +@overload +def compare_digest(a: AnyStr, b: AnyStr) -> bool: ... + +if sys.version_info >= (3, 7): + def digest(key: _B, msg: _B, digest: str) -> bytes: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/imaplib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/imaplib.pyi new file mode 100644 index 00000000..07f770df --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/imaplib.pyi @@ -0,0 +1,140 @@ +# Stubs for imaplib (Python 2) + +import imaplib +import subprocess +import sys +import time +from socket import socket as _socket +from ssl import SSLSocket, SSLContext +from typing import Any, Callable, Dict, IO, List, Optional, Pattern, Text, Tuple, Type, Union + +CommandResults = Tuple[str, List[Any]] + + +class IMAP4: + error: Type[Exception] = ... + abort: Type[Exception] = ... + readonly: Type[Exception] = ... + mustquote: Pattern[Text] = ... + debug: int = ... + state: str = ... + literal: Optional[Text] = ... + tagged_commands: Dict[str, str] = ... + untagged_responses: Dict[str, str] = ... + continuation_response: str = ... + is_readonly: bool = ... + tagnum: int = ... + tagpre: str = ... + tagre: Pattern[Text] = ... + welcome: bytes = ... + capabilities: Tuple[str] = ... + PROTOCOL_VERSION: str = ... + def __init__(self, host: str = ..., port: int = ...) -> None: ... + def __getattr__(self, attr: str) -> Any: ... + host: str = ... + port: int = ... + sock: _socket = ... + file: Union[IO[Text], IO[bytes]] = ... + def open(self, host: str = ..., port: int = ...) -> None: ... + def read(self, size: int) -> bytes: ... + def readline(self) -> bytes: ... + def send(self, data: bytes) -> None: ... + def shutdown(self) -> None: ... + def socket(self) -> _socket: ... + def recent(self) -> CommandResults: ... + def response(self, code: str) -> CommandResults: ... + def append(self, mailbox: str, flags: str, date_time: str, message: str) -> str: ... + def authenticate(self, mechanism: str, authobject: Callable[[bytes], Optional[bytes]]) -> Tuple[str, str]: ... + def capability(self) -> CommandResults: ... + def check(self) -> CommandResults: ... + def close(self) -> CommandResults: ... + def copy(self, message_set: str, new_mailbox: str) -> CommandResults: ... + def create(self, mailbox: str) -> CommandResults: ... + def delete(self, mailbox: str) -> CommandResults: ... + def deleteacl(self, mailbox: str, who: str) -> CommandResults: ... + if sys.version_info >= (3, 5): + def enable(self, capability: str) -> CommandResults: ... + def __enter__(self) -> IMAP4: ... + def __exit__(self, *args) -> None: ... + def expunge(self) -> CommandResults: ... + def fetch(self, message_set: str, message_parts: str) -> CommandResults: ... + def getacl(self, mailbox: str) -> CommandResults: ... + def getannotation(self, mailbox: str, entry: str, attribute: str) -> CommandResults: ... + def getquota(self, root: str) -> CommandResults: ... + def getquotaroot(self, mailbox: str) -> CommandResults: ... + def list(self, directory: str = ..., pattern: str = ...) -> CommandResults: ... + def login(self, user: str, password: str) -> CommandResults: ... + def login_cram_md5(self, user: str, password: str) -> CommandResults: ... + def logout(self) -> CommandResults: ... + def lsub(self, directory: str = ..., pattern: str = ...) -> CommandResults: ... + def myrights(self, mailbox: str) -> CommandResults: ... + def namespace(self) -> CommandResults: ... + def noop(self) -> CommandResults: ... + def partial(self, message_num: str, message_part: str, start: str, length: str) -> CommandResults: ... + def proxyauth(self, user: str) -> CommandResults: ... + def rename(self, oldmailbox: str, newmailbox: str) -> CommandResults: ... + def search(self, charset: Optional[str], *criteria: str) -> CommandResults: ... + def select(self, mailbox: str = ..., readonly: bool = ...) -> CommandResults: ... + def setacl(self, mailbox: str, who: str, what: str) -> CommandResults: ... + def setannotation(self, *args: str) -> CommandResults: ... + def setquota(self, root: str, limits: str) -> CommandResults: ... + def sort(self, sort_criteria: str, charset: str, *search_criteria: str) -> CommandResults: ... + if sys.version_info >= (3,): + def starttls(self, ssl_context: Optional[Any] = ...) -> CommandResults: ... + def status(self, mailbox: str, names: str) -> CommandResults: ... + def store(self, message_set: str, command: str, flags: str) -> CommandResults: ... + def subscribe(self, mailbox: str) -> CommandResults: ... + def thread(self, threading_algorithm: str, charset: str, *search_criteria: str) -> CommandResults: ... + def uid(self, command: str, *args: str) -> CommandResults: ... + def unsubscribe(self, mailbox: str) -> CommandResults: ... + def xatom(self, name: str, *args: str) -> CommandResults: ... + def print_log(self) -> None: ... + +class IMAP4_SSL(IMAP4): + keyfile: str = ... + certfile: str = ... + if sys.version_info >= (3, 3): + def __init__(self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ..., ssl_context: Optional[SSLContext] = ...) -> None: ... + else: + def __init__(self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ...) -> None: ... + host: str = ... + port: int = ... + sock: _socket = ... + sslobj: SSLSocket = ... + file: IO[Any] = ... + def open(self, host: str = ..., port: Optional[int] = ...) -> None: ... + def read(self, size: int) -> bytes: ... + def readline(self) -> bytes: ... + def send(self, data: bytes) -> None: ... + def shutdown(self) -> None: ... + def socket(self) -> _socket: ... + def ssl(self) -> SSLSocket: ... + + +class IMAP4_stream(IMAP4): + command: str = ... + def __init__(self, command: str) -> None: ... + host: str = ... + port: int = ... + sock: _socket = ... + file: IO[Any] = ... + process: subprocess.Popen[bytes] = ... + writefile: IO[Any] = ... + readfile: IO[Any] = ... + def open(self, host: str = ..., port: Optional[int] = ...) -> None: ... + def read(self, size: int) -> bytes: ... + def readline(self) -> bytes: ... + def send(self, data: bytes) -> None: ... + def shutdown(self) -> None: ... + +class _Authenticator: + mech: Callable[[bytes], bytes] = ... + def __init__(self, mechinst: Callable[[bytes], bytes]) -> None: ... + def process(self, data: str) -> str: ... + def encode(self, inp: bytes) -> str: ... + def decode(self, inp: str) -> bytes: ... + +def Internaldate2tuple(resp: str) -> time.struct_time: ... +def Int2AP(num: int) -> str: ... +def ParseFlags(resp: str) -> Tuple[str]: ... +def Time2Internaldate(date_time: Union[float, time.struct_time, str]) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/imghdr.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/imghdr.pyi new file mode 100644 index 00000000..b9d8d17e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/imghdr.pyi @@ -0,0 +1,16 @@ +from typing import overload, Union, Text, BinaryIO, Optional, Any, List, Callable +import sys +import os + + +if sys.version_info >= (3, 6): + _File = Union[Text, os.PathLike[Text], BinaryIO] +else: + _File = Union[Text, BinaryIO] + + +@overload +def what(file: _File) -> Optional[str]: ... +@overload +def what(file: Any, h: bytes) -> Optional[str]: ... +tests: List[Callable[[bytes, BinaryIO], Optional[str]]] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/keyword.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/keyword.pyi new file mode 100644 index 00000000..f9e3376e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/keyword.pyi @@ -0,0 +1,6 @@ +# Stubs for keyword + +from typing import Sequence, Text, Union + +def iskeyword(s: Union[Text, bytes]) -> bool: ... +kwlist: Sequence[str] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/__init__.pyi new file mode 100644 index 00000000..145e31b1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/__init__.pyi @@ -0,0 +1 @@ +# Stubs for lib2to3 (Python 3.6) diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/__init__.pyi new file mode 100644 index 00000000..1adc82a6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/__init__.pyi @@ -0,0 +1,10 @@ +# Stubs for lib2to3.pgen2 (Python 3.6) + +import os +import sys +from typing import Text, Union + +if sys.version_info >= (3, 6): + _Path = Union[Text, os.PathLike] +else: + _Path = Text diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/driver.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/driver.pyi new file mode 100644 index 00000000..56785f08 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/driver.pyi @@ -0,0 +1,24 @@ +# Stubs for lib2to3.pgen2.driver (Python 3.6) + +import os +import sys +from typing import Any, Callable, IO, Iterable, List, Optional, Text, Tuple, Union + +from logging import Logger +from lib2to3.pytree import _Convert, _NL +from lib2to3.pgen2 import _Path +from lib2to3.pgen2.grammar import Grammar + + +class Driver: + grammar: Grammar + logger: Logger + convert: _Convert + def __init__(self, grammar: Grammar, convert: Optional[_Convert] = ..., logger: Optional[Logger] = ...) -> None: ... + def parse_tokens(self, tokens: Iterable[Any], debug: bool = ...) -> _NL: ... + def parse_stream_raw(self, stream: IO[Text], debug: bool = ...) -> _NL: ... + def parse_stream(self, stream: IO[Text], debug: bool = ...) -> _NL: ... + def parse_file(self, filename: _Path, encoding: Optional[Text] = ..., debug: bool = ...) -> _NL: ... + def parse_string(self, text: Text, debug: bool = ...) -> _NL: ... + +def load_grammar(gt: Text = ..., gp: Optional[Text] = ..., save: bool = ..., force: bool = ..., logger: Optional[Logger] = ...) -> Grammar: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/grammar.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/grammar.pyi new file mode 100644 index 00000000..122d771d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/grammar.pyi @@ -0,0 +1,29 @@ +# Stubs for lib2to3.pgen2.grammar (Python 3.6) + +from lib2to3.pgen2 import _Path + +from typing import Any, Dict, List, Optional, Text, Tuple, TypeVar + +_P = TypeVar('_P') +_Label = Tuple[int, Optional[Text]] +_DFA = List[List[Tuple[int, int]]] +_DFAS = Tuple[_DFA, Dict[int, int]] + +class Grammar: + symbol2number: Dict[Text, int] + number2symbol: Dict[int, Text] + states: List[_DFA] + dfas: Dict[int, _DFAS] + labels: List[_Label] + keywords: Dict[Text, int] + tokens: Dict[int, int] + symbol2label: Dict[Text, int] + start: int + def __init__(self) -> None: ... + def dump(self, filename: _Path) -> None: ... + def load(self, filename: _Path) -> None: ... + def copy(self: _P) -> _P: ... + def report(self) -> None: ... + +opmap_raw: Text +opmap: Dict[Text, Text] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/literals.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/literals.pyi new file mode 100644 index 00000000..3166ffbf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/literals.pyi @@ -0,0 +1,9 @@ +# Stubs for lib2to3.pgen2.literals (Python 3.6) + +from typing import Dict, Match, Text + +simple_escapes: Dict[Text, Text] + +def escape(m: Match[str]) -> Text: ... +def evalString(s: Text) -> Text: ... +def test() -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/parse.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/parse.pyi new file mode 100644 index 00000000..101d4760 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/parse.pyi @@ -0,0 +1,29 @@ +# Stubs for lib2to3.pgen2.parse (Python 3.6) + +from typing import Any, Dict, List, Optional, Sequence, Set, Text, Tuple + +from lib2to3.pgen2.grammar import Grammar, _DFAS +from lib2to3.pytree import _NL, _Convert, _RawNode + +_Context = Sequence[Any] + +class ParseError(Exception): + msg: Text + type: int + value: Optional[Text] + context: _Context + def __init__(self, msg: Text, type: int, value: Optional[Text], context: _Context) -> None: ... + +class Parser: + grammar: Grammar + convert: _Convert + stack: List[Tuple[_DFAS, int, _RawNode]] + rootnode: Optional[_NL] + used_names: Set[Text] + def __init__(self, grammar: Grammar, convert: Optional[_Convert] = ...) -> None: ... + def setup(self, start: Optional[int] = ...) -> None: ... + def addtoken(self, type: int, value: Optional[Text], context: _Context) -> bool: ... + def classify(self, type: int, value: Optional[Text], context: _Context) -> int: ... + def shift(self, type: int, value: Optional[Text], newstate: int, context: _Context) -> None: ... + def push(self, type: int, newdfa: _DFAS, newstate: int, context: _Context) -> None: ... + def pop(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/pgen.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/pgen.pyi new file mode 100644 index 00000000..42d503b4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/pgen.pyi @@ -0,0 +1,50 @@ +# Stubs for lib2to3.pgen2.pgen (Python 3.6) + +from typing import ( + Any, Dict, IO, Iterable, Iterator, List, NoReturn, Optional, Text, Tuple +) + +from lib2to3.pgen2 import _Path, grammar +from lib2to3.pgen2.tokenize import _TokenInfo + +class PgenGrammar(grammar.Grammar): ... + +class ParserGenerator: + filename: _Path + stream: IO[Text] + generator: Iterator[_TokenInfo] + first: Dict[Text, Dict[Text, int]] + def __init__(self, filename: _Path, stream: Optional[IO[Text]] = ...) -> None: ... + def make_grammar(self) -> PgenGrammar: ... + def make_first(self, c: PgenGrammar, name: Text) -> Dict[int, int]: ... + def make_label(self, c: PgenGrammar, label: Text) -> int: ... + def addfirstsets(self) -> None: ... + def calcfirst(self, name: Text) -> None: ... + def parse(self) -> Tuple[Dict[Text, List[DFAState]], Text]: ... + def make_dfa(self, start: NFAState, finish: NFAState) -> List[DFAState]: ... + def dump_nfa(self, name: Text, start: NFAState, finish: NFAState) -> List[DFAState]: ... + def dump_dfa(self, name: Text, dfa: Iterable[DFAState]) -> None: ... + def simplify_dfa(self, dfa: List[DFAState]) -> None: ... + def parse_rhs(self) -> Tuple[NFAState, NFAState]: ... + def parse_alt(self) -> Tuple[NFAState, NFAState]: ... + def parse_item(self) -> Tuple[NFAState, NFAState]: ... + def parse_atom(self) -> Tuple[NFAState, NFAState]: ... + def expect(self, type: int, value: Optional[Any] = ...) -> Text: ... + def gettoken(self) -> None: ... + def raise_error(self, msg: str, *args: Any) -> NoReturn: ... + +class NFAState: + arcs: List[Tuple[Optional[Text], NFAState]] + def __init__(self) -> None: ... + def addarc(self, next: NFAState, label: Optional[Text] = ...) -> None: ... + +class DFAState: + nfaset: Dict[NFAState, Any] + isfinal: bool + arcs: Dict[Text, DFAState] + def __init__(self, nfaset: Dict[NFAState, Any], final: NFAState) -> None: ... + def addarc(self, next: DFAState, label: Text) -> None: ... + def unifystate(self, old: DFAState, new: DFAState) -> None: ... + def __eq__(self, other: Any) -> bool: ... + +def generate_grammar(filename: _Path = ...) -> PgenGrammar: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/token.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/token.pyi new file mode 100644 index 00000000..c256af8f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/token.pyi @@ -0,0 +1,73 @@ +# Stubs for lib2to3.pgen2.token (Python 3.6) + +import sys +from typing import Dict, Text + +ENDMARKER: int +NAME: int +NUMBER: int +STRING: int +NEWLINE: int +INDENT: int +DEDENT: int +LPAR: int +RPAR: int +LSQB: int +RSQB: int +COLON: int +COMMA: int +SEMI: int +PLUS: int +MINUS: int +STAR: int +SLASH: int +VBAR: int +AMPER: int +LESS: int +GREATER: int +EQUAL: int +DOT: int +PERCENT: int +BACKQUOTE: int +LBRACE: int +RBRACE: int +EQEQUAL: int +NOTEQUAL: int +LESSEQUAL: int +GREATEREQUAL: int +TILDE: int +CIRCUMFLEX: int +LEFTSHIFT: int +RIGHTSHIFT: int +DOUBLESTAR: int +PLUSEQUAL: int +MINEQUAL: int +STAREQUAL: int +SLASHEQUAL: int +PERCENTEQUAL: int +AMPEREQUAL: int +VBAREQUAL: int +CIRCUMFLEXEQUAL: int +LEFTSHIFTEQUAL: int +RIGHTSHIFTEQUAL: int +DOUBLESTAREQUAL: int +DOUBLESLASH: int +DOUBLESLASHEQUAL: int +OP: int +COMMENT: int +NL: int +if sys.version_info >= (3,): + RARROW: int +if sys.version_info >= (3, 5): + AT: int + ATEQUAL: int + AWAIT: int + ASYNC: int +ERRORTOKEN: int +N_TOKENS: int +NT_OFFSET: int +tok_name: Dict[int, Text] + +def ISTERMINAL(x: int) -> bool: ... +def ISNONTERMINAL(x: int) -> bool: ... +def ISEOF(x: int) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/tokenize.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/tokenize.pyi new file mode 100644 index 00000000..c10305ff --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pgen2/tokenize.pyi @@ -0,0 +1,30 @@ +# Stubs for lib2to3.pgen2.tokenize (Python 3.6) +# NOTE: Only elements from __all__ are present. + +from typing import Callable, Iterable, Iterator, List, Text, Tuple +from lib2to3.pgen2.token import * # noqa + + +_Coord = Tuple[int, int] +_TokenEater = Callable[[int, Text, _Coord, _Coord, Text], None] +_TokenInfo = Tuple[int, Text, _Coord, _Coord, Text] + + +class TokenError(Exception): ... +class StopTokenizing(Exception): ... + +def tokenize(readline: Callable[[], Text], tokeneater: _TokenEater = ...) -> None: ... + +class Untokenizer: + tokens: List[Text] + prev_row: int + prev_col: int + def __init__(self) -> None: ... + def add_whitespace(self, start: _Coord) -> None: ... + def untokenize(self, iterable: Iterable[_TokenInfo]) -> Text: ... + def compat(self, token: Tuple[int, Text], iterable: Iterable[_TokenInfo]) -> None: ... + +def untokenize(iterable: Iterable[_TokenInfo]) -> Text: ... +def generate_tokens( + readline: Callable[[], Text] +) -> Iterator[_TokenInfo]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pygram.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pygram.pyi new file mode 100644 index 00000000..aeb7b93b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pygram.pyi @@ -0,0 +1,116 @@ +# Stubs for lib2to3.pygram (Python 3.6) + +from typing import Any +from lib2to3.pgen2.grammar import Grammar + +class Symbols: + def __init__(self, grammar: Grammar) -> None: ... + +class python_symbols(Symbols): + and_expr: int + and_test: int + annassign: int + arglist: int + argument: int + arith_expr: int + assert_stmt: int + async_funcdef: int + async_stmt: int + atom: int + augassign: int + break_stmt: int + classdef: int + comp_for: int + comp_if: int + comp_iter: int + comp_op: int + comparison: int + compound_stmt: int + continue_stmt: int + decorated: int + decorator: int + decorators: int + del_stmt: int + dictsetmaker: int + dotted_as_name: int + dotted_as_names: int + dotted_name: int + encoding_decl: int + eval_input: int + except_clause: int + exec_stmt: int + expr: int + expr_stmt: int + exprlist: int + factor: int + file_input: int + flow_stmt: int + for_stmt: int + funcdef: int + global_stmt: int + if_stmt: int + import_as_name: int + import_as_names: int + import_from: int + import_name: int + import_stmt: int + lambdef: int + listmaker: int + not_test: int + old_lambdef: int + old_test: int + or_test: int + parameters: int + pass_stmt: int + power: int + print_stmt: int + raise_stmt: int + return_stmt: int + shift_expr: int + simple_stmt: int + single_input: int + sliceop: int + small_stmt: int + star_expr: int + stmt: int + subscript: int + subscriptlist: int + suite: int + term: int + test: int + testlist: int + testlist1: int + testlist_gexp: int + testlist_safe: int + testlist_star_expr: int + tfpdef: int + tfplist: int + tname: int + trailer: int + try_stmt: int + typedargslist: int + varargslist: int + vfpdef: int + vfplist: int + vname: int + while_stmt: int + with_item: int + with_stmt: int + with_var: int + xor_expr: int + yield_arg: int + yield_expr: int + yield_stmt: int + +class pattern_symbols(Symbols): + Alternative: int + Alternatives: int + Details: int + Matcher: int + NegatedUnit: int + Repeater: int + Unit: int + +python_grammar: Grammar +python_grammar_no_print_statement: Grammar +pattern_grammar: Grammar diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pytree.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pytree.pyi new file mode 100644 index 00000000..06a7c122 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/lib2to3/pytree.pyi @@ -0,0 +1,86 @@ +# Stubs for lib2to3.pytree (Python 3.6) + +import sys +from typing import Any, Callable, Dict, Iterator, List, Optional, Text, Tuple, TypeVar, Union + +from lib2to3.pgen2.grammar import Grammar + +_P = TypeVar('_P') +_NL = Union[Node, Leaf] +_Context = Tuple[Text, int, int] +_Results = Dict[Text, _NL] +_RawNode = Tuple[int, Text, _Context, Optional[List[_NL]]] +_Convert = Callable[[Grammar, _RawNode], Any] + +HUGE: int + +def type_repr(type_num: int) -> Text: ... + +class Base: + type: int + parent: Optional[Node] + prefix: Text + children: List[_NL] + was_changed: bool + was_checked: bool + def __eq__(self, other: Any) -> bool: ... + def _eq(self: _P, other: _P) -> bool: ... + def clone(self: _P) -> _P: ... + def post_order(self) -> Iterator[_NL]: ... + def pre_order(self) -> Iterator[_NL]: ... + def replace(self, new: Union[_NL, List[_NL]]) -> None: ... + def get_lineno(self) -> int: ... + def changed(self) -> None: ... + def remove(self) -> Optional[int]: ... + @property + def next_sibling(self) -> Optional[_NL]: ... + @property + def prev_sibling(self) -> Optional[_NL]: ... + def leaves(self) -> Iterator[Leaf]: ... + def depth(self) -> int: ... + def get_suffix(self) -> Text: ... + if sys.version_info < (3,): + def get_prefix(self) -> Text: ... + def set_prefix(self, prefix: Text) -> None: ... + +class Node(Base): + fixers_applied: List[Any] + def __init__(self, type: int, children: List[_NL], context: Optional[Any] = ..., prefix: Optional[Text] = ..., fixers_applied: Optional[List[Any]] = ...) -> None: ... + def set_child(self, i: int, child: _NL) -> None: ... + def insert_child(self, i: int, child: _NL) -> None: ... + def append_child(self, child: _NL) -> None: ... + +class Leaf(Base): + lineno: int + column: int + value: Text + fixers_applied: List[Any] + def __init__(self, type: int, value: Text, context: Optional[_Context] = ..., prefix: Optional[Text] = ..., fixers_applied: List[Any] = ...) -> None: ... + +def convert(gr: Grammar, raw_node: _RawNode) -> _NL: ... + +class BasePattern: + type: int + content: Optional[Text] + name: Optional[Text] + def optimize(self) -> BasePattern: ... # sic, subclasses are free to optimize themselves into different patterns + def match(self, node: _NL, results: Optional[_Results] = ...) -> bool: ... + def match_seq(self, nodes: List[_NL], results: Optional[_Results] = ...) -> bool: ... + def generate_matches(self, nodes: List[_NL]) -> Iterator[Tuple[int, _Results]]: ... + +class LeafPattern(BasePattern): + def __init__(self, type: Optional[int] = ..., content: Optional[Text] = ..., name: Optional[Text] = ...) -> None: ... + +class NodePattern(BasePattern): + wildcards: bool + def __init__(self, type: Optional[int] = ..., content: Optional[Text] = ..., name: Optional[Text] = ...) -> None: ... + +class WildcardPattern(BasePattern): + min: int + max: int + def __init__(self, content: Optional[Text] = ..., min: int = ..., max: int = ..., name: Optional[Text] = ...) -> None: ... + +class NegatedPattern(BasePattern): + def __init__(self, content: Optional[Text] = ...) -> None: ... + +def generate_matches(patterns: List[BasePattern], nodes: List[_NL]) -> Iterator[Tuple[int, _Results]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/linecache.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/linecache.pyi new file mode 100644 index 00000000..3f35f469 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/linecache.pyi @@ -0,0 +1,12 @@ +import sys +from typing import Any, Dict, List, Optional, Text + +_ModuleGlobals = Dict[str, Any] + +def getline(filename: Text, lineno: int, module_globals: Optional[_ModuleGlobals] = ...) -> str: ... +def clearcache() -> None: ... +def getlines(filename: Text, module_globals: Optional[_ModuleGlobals] = ...) -> List[str]: ... +def checkcache(filename: Optional[Text] = ...) -> None: ... +def updatecache(filename: Text, module_globals: Optional[_ModuleGlobals] = ...) -> List[str]: ... +if sys.version_info >= (3, 5): + def lazycache(filename: Text, module_globals: _ModuleGlobals) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/locale.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/locale.pyi new file mode 100644 index 00000000..a0d7383a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/locale.pyi @@ -0,0 +1,113 @@ +# Stubs for locale + +from decimal import Decimal +from typing import Any, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Union +import sys + +# workaround for mypy#2010 +if sys.version_info < (3,): + from __builtin__ import str as _str +else: + from builtins import str as _str + +CODESET: int +D_T_FMT: int +D_FMT: int +T_FMT: int +T_FMT_AMPM: int + +DAY_1: int +DAY_2: int +DAY_3: int +DAY_4: int +DAY_5: int +DAY_6: int +DAY_7: int +ABDAY_1: int +ABDAY_2: int +ABDAY_3: int +ABDAY_4: int +ABDAY_5: int +ABDAY_6: int +ABDAY_7: int + +MON_1: int +MON_2: int +MON_3: int +MON_4: int +MON_5: int +MON_6: int +MON_7: int +MON_8: int +MON_9: int +MON_10: int +MON_11: int +MON_12: int +ABMON_1: int +ABMON_2: int +ABMON_3: int +ABMON_4: int +ABMON_5: int +ABMON_6: int +ABMON_7: int +ABMON_8: int +ABMON_9: int +ABMON_10: int +ABMON_11: int +ABMON_12: int + +RADIXCHAR: int +THOUSEP: int +YESEXPR: int +NOEXPR: int +CRNCYSTR: int + +ERA: int +ERA_D_T_FMT: int +ERA_D_FMT: int +ERA_T_FMT: int + +ALT_DIGITS: int + +LC_CTYPE: int +LC_COLLATE: int +LC_TIME: int +LC_MONETARY: int +LC_MESSAGES: int +LC_NUMERIC: int +LC_ALL: int + +CHAR_MAX: int + +class Error(Exception): ... + +def setlocale(category: int, + locale: Union[_str, Iterable[_str], None] = ...) -> _str: ... +def localeconv() -> Mapping[_str, Union[int, _str, List[int]]]: ... +def nl_langinfo(option: int) -> _str: ... +def getdefaultlocale(envvars: Tuple[_str, ...] = ...) -> Tuple[Optional[_str], Optional[_str]]: ... +def getlocale(category: int = ...) -> Sequence[_str]: ... +def getpreferredencoding(do_setlocale: bool = ...) -> _str: ... +def normalize(localename: _str) -> _str: ... +def resetlocale(category: int = ...) -> None: ... +def strcoll(string1: _str, string2: _str) -> int: ... +def strxfrm(string: _str) -> _str: ... +def format(format: _str, val: Union[float, Decimal], grouping: bool = ..., + monetary: bool = ...) -> _str: ... +if sys.version_info >= (3, 7): + def format_string(format: _str, val: Any, + grouping: bool = ..., monetary: bool = ...) -> _str: ... +else: + def format_string(format: _str, val: Any, + grouping: bool = ...) -> _str: ... +def currency(val: Union[int, float, Decimal], symbol: bool = ..., grouping: bool = ..., + international: bool = ...) -> _str: ... +if sys.version_info >= (3, 5): + def delocalize(string: _str) -> None: ... +def atof(string: _str) -> float: ... +def atoi(string: _str) -> int: ... +def str(float: float) -> _str: ... + +locale_alias: Dict[_str, _str] # undocumented +locale_encoding_alias: Dict[_str, _str] # undocumented +windows_locale: Dict[int, _str] # undocumented diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/logging/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/logging/__init__.pyi new file mode 100644 index 00000000..13117947 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/logging/__init__.pyi @@ -0,0 +1,438 @@ +# Stubs for logging (Python 3.7) + +from typing import ( + Any, Callable, Dict, Iterable, List, Mapping, MutableMapping, Optional, IO, + Tuple, Text, Union, overload, +) +from string import Template +from time import struct_time +from types import TracebackType, FrameType +import sys +import threading + +_SysExcInfoType = Union[Tuple[type, BaseException, Optional[TracebackType]], + Tuple[None, None, None]] +if sys.version_info >= (3, 5): + _ExcInfoType = Union[None, bool, _SysExcInfoType, BaseException] +else: + _ExcInfoType = Union[None, bool, _SysExcInfoType] +_ArgsType = Union[Tuple[Any, ...], Mapping[str, Any]] +_FilterType = Union[Filter, Callable[[LogRecord], int]] +_Level = Union[int, Text] +if sys.version_info >= (3, 6): + from os import PathLike + _Path = Union[str, PathLike[str]] +else: + _Path = str + +raiseExceptions: bool +logThreads: bool +logMultiprocessing: bool +logProcesses: bool + +def currentframe() -> FrameType: ... + +if sys.version_info >= (3,): + _levelToName: Dict[int, str] + _nameToLevel: Dict[str, int] +else: + _levelNames: Dict[Union[int, str], Union[str, int]] # Union[int:str, str:int] + +class Filterer(object): + filters: List[Filter] + def __init__(self) -> None: ... + def addFilter(self, filter: Filter) -> None: ... + def removeFilter(self, filter: Filter) -> None: ... + def filter(self, record: LogRecord) -> bool: ... + +class Logger(Filterer): + name: str + level: int + parent: Union[Logger, PlaceHolder] + propagate: bool + handlers: List[Handler] + disabled: int + def __init__(self, name: str, level: _Level = ...) -> None: ... + def setLevel(self, level: _Level) -> None: ... + def isEnabledFor(self, level: int) -> bool: ... + def getEffectiveLevel(self) -> int: ... + def getChild(self, suffix: str) -> Logger: ... + if sys.version_info >= (3,): + def debug(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def info(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def warning(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def warn(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def error(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def critical(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + fatal = critical + def log(self, level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def exception(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + else: + def debug(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def info(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def warning(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + warn = warning + def error(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def critical(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + fatal = critical + def log(self, + level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def exception(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def addFilter(self, filt: _FilterType) -> None: ... + def removeFilter(self, filt: _FilterType) -> None: ... + def filter(self, record: LogRecord) -> bool: ... + def addHandler(self, hdlr: Handler) -> None: ... + def removeHandler(self, hdlr: Handler) -> None: ... + if sys.version_info >= (3,): + def findCaller(self, stack_info: bool = ...) -> Tuple[str, int, str, Optional[str]]: ... + else: + def findCaller(self) -> Tuple[str, int, str]: ... + def handle(self, record: LogRecord) -> None: ... + if sys.version_info >= (3,): + def makeRecord(self, name: str, level: int, fn: str, lno: int, msg: Any, + args: _ArgsType, + exc_info: Optional[_SysExcInfoType], + func: Optional[str] = ..., + extra: Optional[Mapping[str, Any]] = ..., + sinfo: Optional[str] = ...) -> LogRecord: ... + else: + def makeRecord(self, + name: str, level: int, fn: str, lno: int, msg: Any, + args: _ArgsType, + exc_info: Optional[_SysExcInfoType], + func: Optional[str] = ..., + extra: Optional[Mapping[str, Any]] = ...) -> LogRecord: ... + if sys.version_info >= (3,): + def hasHandlers(self) -> bool: ... + + +CRITICAL: int +FATAL: int +ERROR: int +WARNING: int +WARN: int +INFO: int +DEBUG: int +NOTSET: int + + +class Handler(Filterer): + level: int # undocumented + formatter: Optional[Formatter] # undocumented + lock: Optional[threading.Lock] # undocumented + name: Optional[str] # undocumented + def __init__(self, level: _Level = ...) -> None: ... + def createLock(self) -> None: ... + def acquire(self) -> None: ... + def release(self) -> None: ... + def setLevel(self, level: _Level) -> None: ... + def setFormatter(self, fmt: Formatter) -> None: ... + def addFilter(self, filt: _FilterType) -> None: ... + def removeFilter(self, filt: _FilterType) -> None: ... + def filter(self, record: LogRecord) -> bool: ... + def flush(self) -> None: ... + def close(self) -> None: ... + def handle(self, record: LogRecord) -> None: ... + def handleError(self, record: LogRecord) -> None: ... + def format(self, record: LogRecord) -> str: ... + def emit(self, record: LogRecord) -> None: ... + + +class Formatter: + converter: Callable[[Optional[float]], struct_time] + _fmt: Optional[str] + datefmt: Optional[str] + if sys.version_info >= (3,): + _style: PercentStyle + default_time_format: str + default_msec_format: str + + if sys.version_info >= (3,): + def __init__(self, fmt: Optional[str] = ..., + datefmt: Optional[str] = ..., + style: str = ...) -> None: ... + else: + def __init__(self, + fmt: Optional[str] = ..., + datefmt: Optional[str] = ...) -> None: ... + + def format(self, record: LogRecord) -> str: ... + def formatTime(self, record: LogRecord, datefmt: Optional[str] = ...) -> str: ... + def formatException(self, exc_info: _SysExcInfoType) -> str: ... + if sys.version_info >= (3,): + def formatMessage(self, record: LogRecord) -> str: ... # undocumented + def formatStack(self, stack_info: str) -> str: ... + + +class Filter: + def __init__(self, name: str = ...) -> None: ... + def filter(self, record: LogRecord) -> int: ... + + +class LogRecord: + args: _ArgsType + asctime: str + created: int + exc_info: Optional[_SysExcInfoType] + exc_text: Optional[str] + filename: str + funcName: str + levelname: str + levelno: int + lineno: int + module: str + msecs: int + message: str + msg: str + name: str + pathname: str + process: int + processName: str + relativeCreated: int + if sys.version_info >= (3,): + stack_info: Optional[str] + thread: int + threadName: str + if sys.version_info >= (3,): + def __init__(self, name: str, level: int, pathname: str, lineno: int, + msg: Any, args: _ArgsType, + exc_info: Optional[_SysExcInfoType], + func: Optional[str] = ..., + sinfo: Optional[str] = ...) -> None: ... + else: + def __init__(self, + name: str, level: int, pathname: str, lineno: int, + msg: Any, args: _ArgsType, + exc_info: Optional[_SysExcInfoType], + func: Optional[str] = ...) -> None: ... + def getMessage(self) -> str: ... + + +class LoggerAdapter: + logger: Logger + extra: Mapping[str, Any] + def __init__(self, logger: Logger, extra: Mapping[str, Any]) -> None: ... + def process(self, msg: Any, kwargs: MutableMapping[str, Any]) -> Tuple[Any, MutableMapping[str, Any]]: ... + if sys.version_info >= (3,): + def debug(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def info(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def warning(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def warn(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def error(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def exception(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def critical(self, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def log(self, level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + else: + def debug(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def info(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def warning(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def error(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def exception(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def critical(self, + msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def log(self, + level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def isEnabledFor(self, lvl: int) -> bool: ... + if sys.version_info >= (3,): + def getEffectiveLevel(self) -> int: ... + def setLevel(self, lvl: Union[int, str]) -> None: ... + def hasHandlers(self) -> bool: ... + + +if sys.version_info >= (3,): + def getLogger(name: Optional[str] = ...) -> Logger: ... +else: + @overload + def getLogger() -> Logger: ... + @overload + def getLogger(name: Union[Text, str]) -> Logger: ... +def getLoggerClass() -> type: ... +if sys.version_info >= (3,): + def getLogRecordFactory() -> Callable[..., LogRecord]: ... + +if sys.version_info >= (3,): + def debug(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def info(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def warning(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def warn(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def error(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def critical(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def exception(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... + def log(level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + stack_info: bool = ..., extra: Optional[Dict[str, Any]] = ..., + **kwargs: Any) -> None: ... +else: + def debug(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def info(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def warning(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + warn = warning + def error(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def critical(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def exception(msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... + def log(level: int, msg: Any, *args: Any, exc_info: _ExcInfoType = ..., + extra: Optional[Dict[str, Any]] = ..., **kwargs: Any) -> None: ... +fatal = critical + +def disable(lvl: int) -> None: ... +def addLevelName(lvl: int, levelName: str) -> None: ... +def getLevelName(lvl: Union[int, str]) -> Any: ... + +def makeLogRecord(attrdict: Mapping[str, Any]) -> LogRecord: ... + +if sys.version_info >= (3,): + def basicConfig(*, filename: Optional[_Path] = ..., filemode: str = ..., + format: str = ..., datefmt: Optional[str] = ..., style: str = ..., + level: Optional[_Level] = ..., stream: Optional[IO[str]] = ..., + handlers: Optional[Iterable[Handler]] = ...) -> None: ... +else: + @overload + def basicConfig() -> None: ... + @overload + def basicConfig(*, filename: Optional[str] = ..., filemode: str = ..., + format: str = ..., datefmt: Optional[str] = ..., + level: Optional[_Level] = ..., stream: IO[str] = ...) -> None: ... +def shutdown() -> None: ... + +def setLoggerClass(klass: type) -> None: ... + +def captureWarnings(capture: bool) -> None: ... + +if sys.version_info >= (3,): + def setLogRecordFactory(factory: Callable[..., LogRecord]) -> None: ... + + +if sys.version_info >= (3,): + lastResort: Optional[StreamHandler] + + +class StreamHandler(Handler): + stream: IO[str] # undocumented + if sys.version_info >= (3, 2): + terminator: str + def __init__(self, stream: Optional[IO[str]] = ...) -> None: ... + if sys.version_info >= (3, 7): + def setStream(self, stream: IO[str]) -> Optional[IO[str]]: ... + + +class FileHandler(StreamHandler): + baseFilename: str # undocumented + mode: str # undocumented + encoding: Optional[str] # undocumented + delay: bool # undocumented + def __init__(self, filename: _Path, mode: str = ..., + encoding: Optional[str] = ..., delay: bool = ...) -> None: ... + + +class NullHandler(Handler): ... + + +class PlaceHolder: + def __init__(self, alogger: Logger) -> None: ... + def append(self, alogger: Logger) -> None: ... + + +# Below aren't in module docs but still visible + +class RootLogger(Logger): ... + +root: RootLogger + + +if sys.version_info >= (3,): + class PercentStyle(object): + default_format: str + asctime_format: str + asctime_search: str + _fmt: str + + def __init__(self, fmt: str) -> None: ... + def usesTime(self) -> bool: ... + def format(self, record: Any) -> str: ... + + class StrFormatStyle(PercentStyle): + ... + + class StringTemplateStyle(PercentStyle): + _tpl: Template + + _STYLES: Dict[str, Tuple[PercentStyle, str]] + + +BASIC_FORMAT: str diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/logging/config.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/logging/config.pyi new file mode 100644 index 00000000..c8dbfdff --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/logging/config.pyi @@ -0,0 +1,33 @@ +# Stubs for logging.config (Python 3.4) + +from typing import Any, Callable, Dict, Optional, IO, Union +from threading import Thread +import sys +if sys.version_info >= (3,): + from configparser import RawConfigParser +else: + from ConfigParser import RawConfigParser +if sys.version_info >= (3, 6): + from os import PathLike + +if sys.version_info >= (3, 7): + _Path = Union[str, bytes, PathLike[str]] +elif sys.version_info >= (3, 6): + _Path = Union[str, PathLike[str]] +else: + _Path = str + + +def dictConfig(config: Dict[str, Any]) -> None: ... +if sys.version_info >= (3, 4): + def fileConfig(fname: Union[_Path, IO[str], RawConfigParser], + defaults: Optional[Dict[str, str]] = ..., + disable_existing_loggers: bool = ...) -> None: ... + def listen(port: int = ..., + verify: Optional[Callable[[bytes], Optional[bytes]]] = ...) -> Thread: ... +else: + def fileConfig(fname: Union[str, IO[str]], + defaults: Optional[Dict[str, str]] = ..., + disable_existing_loggers: bool = ...) -> None: ... + def listen(port: int = ...) -> Thread: ... +def stopListening() -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/logging/handlers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/logging/handlers.pyi new file mode 100644 index 00000000..161eb609 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/logging/handlers.pyi @@ -0,0 +1,215 @@ +# Stubs for logging.handlers (Python 2.4) + +import datetime +from logging import Handler, FileHandler, LogRecord +from socket import SocketType +import ssl +import sys +from typing import Any, Callable, Dict, List, Optional, Tuple, Union, overload +if sys.version_info >= (3, 7): + from queue import SimpleQueue, Queue +elif sys.version_info >= (3,): + from queue import Queue +else: + from Queue import Queue + +# TODO update socket stubs to add SocketKind +_SocketKind = int +if sys.version_info >= (3, 6): + from os import PathLike + _Path = Union[str, PathLike[str]] +else: + _Path = str + +DEFAULT_TCP_LOGGING_PORT: int +DEFAULT_UDP_LOGGING_PORT: int +DEFAULT_HTTP_LOGGING_PORT: int +DEFAULT_SOAP_LOGGING_PORT: int +SYSLOG_UDP_PORT: int +SYSLOG_TCP_PORT: int + +class WatchedFileHandler(FileHandler): + def __init__(self, filename: _Path, mode: str = ..., encoding: Optional[str] = ..., + delay: bool = ...) -> None: ... + + +if sys.version_info >= (3,): + class BaseRotatingHandler(FileHandler): + terminator: str + namer: Optional[Callable[[str], str]] + rotator: Optional[Callable[[str, str], None]] + def __init__(self, filename: _Path, mode: str, + encoding: Optional[str] = ..., + delay: bool = ...) -> None: ... + def rotation_filename(self, default_name: str) -> None: ... + def rotate(self, source: str, dest: str) -> None: ... + + +if sys.version_info >= (3,): + class RotatingFileHandler(BaseRotatingHandler): + def __init__(self, filename: _Path, mode: str = ..., maxBytes: int = ..., + backupCount: int = ..., encoding: Optional[str] = ..., + delay: bool = ...) -> None: ... + def doRollover(self) -> None: ... +else: + class RotatingFileHandler(Handler): + def __init__(self, filename: str, mode: str = ..., maxBytes: int = ..., + backupCount: int = ..., encoding: Optional[str] = ..., + delay: bool = ...) -> None: ... + def doRollover(self) -> None: ... + + +if sys.version_info >= (3,): + class TimedRotatingFileHandler(BaseRotatingHandler): + if sys.version_info >= (3, 4): + def __init__(self, filename: _Path, when: str = ..., + interval: int = ..., + backupCount: int = ..., encoding: Optional[str] = ..., + delay: bool = ..., utc: bool = ..., + atTime: Optional[datetime.datetime] = ...) -> None: ... + else: + def __init__(self, + filename: str, when: str = ..., interval: int = ..., + backupCount: int = ..., encoding: Optional[str] = ..., + delay: bool = ..., utc: bool = ...) -> None: ... + def doRollover(self) -> None: ... +else: + class TimedRotatingFileHandler(Handler): + def __init__(self, + filename: str, when: str = ..., interval: int = ..., + backupCount: int = ..., encoding: Optional[str] = ..., + delay: bool = ..., utc: bool = ...) -> None: ... + def doRollover(self) -> None: ... + + +class SocketHandler(Handler): + retryStart: float + retryFactor: float + retryMax: float + if sys.version_info >= (3, 4): + def __init__(self, host: str, port: Optional[int]) -> None: ... + else: + def __init__(self, host: str, port: int) -> None: ... + def makeSocket(self) -> SocketType: ... + def makePickle(self, record: LogRecord) -> bytes: ... + def send(self, packet: bytes) -> None: ... + def createSocket(self) -> None: ... + + +class DatagramHandler(SocketHandler): ... + + +class SysLogHandler(Handler): + LOG_ALERT: int + LOG_CRIT: int + LOG_DEBUG: int + LOG_EMERG: int + LOG_ERR: int + LOG_INFO: int + LOG_NOTICE: int + LOG_WARNING: int + LOG_AUTH: int + LOG_AUTHPRIV: int + LOG_CRON: int + LOG_DAEMON: int + LOG_FTP: int + LOG_KERN: int + LOG_LPR: int + LOG_MAIL: int + LOG_NEWS: int + LOG_SYSLOG: int + LOG_USER: int + LOG_UUCP: int + LOG_LOCAL0: int + LOG_LOCAL1: int + LOG_LOCAL2: int + LOG_LOCAL3: int + LOG_LOCAL4: int + LOG_LOCAL5: int + LOG_LOCAL6: int + LOG_LOCAL7: int + def __init__(self, address: Union[Tuple[str, int], str] = ..., + facility: int = ..., socktype: _SocketKind = ...) -> None: ... + def encodePriority(self, facility: Union[int, str], + priority: Union[int, str]) -> int: ... + def mapPriority(self, levelName: str) -> str: ... + + +class NTEventLogHandler(Handler): + def __init__(self, appname: str, dllname: str = ..., + logtype: str = ...) -> None: ... + def getEventCategory(self, record: LogRecord) -> int: ... + # TODO correct return value? + def getEventType(self, record: LogRecord) -> int: ... + def getMessageID(self, record: LogRecord) -> int: ... + + +class SMTPHandler(Handler): + # TODO `secure` can also be an empty tuple + if sys.version_info >= (3,): + def __init__(self, mailhost: Union[str, Tuple[str, int]], fromaddr: str, + toaddrs: List[str], subject: str, + credentials: Optional[Tuple[str, str]] = ..., + secure: Union[Tuple[str], Tuple[str, str], None] = ..., + timeout: float = ...) -> None: ... + else: + def __init__(self, + mailhost: Union[str, Tuple[str, int]], fromaddr: str, + toaddrs: List[str], subject: str, + credentials: Optional[Tuple[str, str]] = ..., + secure: Union[Tuple[str], Tuple[str, str], None] = ...) -> None: ... + def getSubject(self, record: LogRecord) -> str: ... + + +class BufferingHandler(Handler): + buffer: List[LogRecord] + def __init__(self, capacity: int) -> None: ... + def shouldFlush(self, record: LogRecord) -> bool: ... + +class MemoryHandler(BufferingHandler): + def __init__(self, capacity: int, flushLevel: int = ..., + target: Optional[Handler] = ...) -> None: ... + def setTarget(self, target: Handler) -> None: ... + + +class HTTPHandler(Handler): + if sys.version_info >= (3, 5): + def __init__(self, host: str, url: str, method: str = ..., + secure: bool = ..., + credentials: Optional[Tuple[str, str]] = ..., + context: Optional[ssl.SSLContext] = ...) -> None: ... + elif sys.version_info >= (3,): + def __init__(self, + host: str, url: str, method: str = ..., secure: bool = ..., + credentials: Optional[Tuple[str, str]] = ...) -> None: ... + else: + def __init__(self, + host: str, url: str, method: str = ...) -> None: ... + def mapLogRecord(self, record: LogRecord) -> Dict[str, Any]: ... + + +if sys.version_info >= (3,): + class QueueHandler(Handler): + if sys.version_info >= (3, 7): + def __init__(self, queue: Union[SimpleQueue[Any], Queue[Any]]) -> None: ... + else: + def __init__(self, queue: Queue[Any]) -> None: ... + def prepare(self, record: LogRecord) -> Any: ... + def enqueue(self, record: LogRecord) -> None: ... + + class QueueListener: + if sys.version_info >= (3, 7): + def __init__(self, queue: Union[SimpleQueue[Any], Queue[Any]], + *handlers: Handler, + respect_handler_level: bool = ...) -> None: ... + elif sys.version_info >= (3, 5): + def __init__(self, queue: Queue[Any], *handlers: Handler, + respect_handler_level: bool = ...) -> None: ... + else: + def __init__(self, + queue: Queue, *handlers: Handler) -> None: ... + def dequeue(self, block: bool) -> LogRecord: ... + def prepare(self, record: LogRecord) -> Any: ... + def start(self) -> None: ... + def stop(self) -> None: ... + def enqueue_sentinel(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/macpath.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/macpath.pyi new file mode 100644 index 00000000..324fc7b3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/macpath.pyi @@ -0,0 +1,171 @@ +# Stubs for os.path +# Ron Murawski + +import os +import sys +from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional + +if sys.version_info < (3, 8): + _T = TypeVar('_T') + + if sys.version_info >= (3, 6): + from builtins import _PathLike + _PathType = Union[bytes, Text, _PathLike] + _StrPath = Union[Text, _PathLike[Text]] + _BytesPath = Union[bytes, _PathLike[bytes]] + else: + _PathType = Union[bytes, Text] + _StrPath = Text + _BytesPath = bytes + + # ----- os.path variables ----- + supports_unicode_filenames: bool + # aliases (also in os) + curdir: str + pardir: str + sep: str + altsep: Optional[str] + extsep: str + pathsep: str + defpath: str + devnull: str + + # ----- os.path function stubs ----- + if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(path: AnyStr) -> AnyStr: ... + @overload + def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(path: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(path: AnyStr) -> AnyStr: ... + @overload + def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + @overload + def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(filename: AnyStr) -> AnyStr: ... + + else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(path: AnyStr) -> AnyStr: ... + def dirname(path: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(path: AnyStr) -> AnyStr: ... + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + def realpath(path: AnyStr) -> AnyStr: ... + else: + def realpath(filename: AnyStr) -> AnyStr: ... + + if sys.version_info >= (3, 6): + # In reality it returns str for sequences of _StrPath and bytes for sequences + # of _BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[_PathType]) -> Any: ... + elif sys.version_info >= (3, 5): + def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... + + # NOTE: Empty lists results in '' (str) regardless of contained type. + # Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes + # So, fall back to Any + def commonprefix(list: Sequence[_PathType]) -> Any: ... + + if sys.version_info >= (3, 3): + def exists(path: Union[_PathType, int]) -> bool: ... + else: + def exists(path: _PathType) -> bool: ... + def lexists(path: _PathType) -> bool: ... + + # These return float if os.stat_float_times() == True, + # but int is a subclass of float. + def getatime(path: _PathType) -> float: ... + def getmtime(path: _PathType) -> float: ... + def getctime(path: _PathType) -> float: ... + + def getsize(path: _PathType) -> int: ... + def isabs(path: _PathType) -> bool: ... + def isfile(path: _PathType) -> bool: ... + def isdir(path: _PathType) -> bool: ... + def islink(path: _PathType) -> bool: ... + def ismount(path: _PathType) -> bool: ... + + if sys.version_info < (3, 0): + # Make sure signatures are disjunct, and allow combinations of bytes and unicode. + # (Since Python 2 allows that, too) + # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in + # a type error. + @overload + def join(__p1: bytes, *p: bytes) -> bytes: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: Text, *p: _PathType) -> Text: ... + elif sys.version_info >= (3, 6): + # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. + @overload + def join(path: _StrPath, *paths: _StrPath) -> Text: ... + @overload + def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... + else: + def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... + + @overload + def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... + @overload + def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... + + def samefile(path1: _PathType, path2: _PathType) -> bool: ... + def sameopenfile(fp1: int, fp2: int) -> bool: ... + def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... + + if sys.version_info >= (3, 6): + @overload + def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + else: + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + + if sys.version_info < (3,): + def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/mailbox.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/mailbox.pyi new file mode 100644 index 00000000..0793f27f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/mailbox.pyi @@ -0,0 +1,199 @@ + +from typing import Optional, Union, Text, AnyStr, Callable, IO, Any, Iterator, List, Tuple, TypeVar, Protocol, Dict, Sequence, Iterable, Generic, Type, Mapping, overload +from types import TracebackType +import sys +import email + +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PathType = Union[bytes, Text, _PathLike] +else: + _PathType = Union[bytes, Text] + +_T = TypeVar("_T") +_MessageType = TypeVar("_MessageType", bound=Message) +_MessageData = Union[email.message.Message, bytes, str, IO[str], IO[bytes]] + +class _HasIteritems(Protocol): + def iteritems(self) -> Iterator[Tuple[str, _MessageData]]: ... + +class _HasItems(Protocol): + def items(self) -> Iterator[Tuple[str, _MessageData]]: ... + +linesep: bytes + +class Mailbox(Generic[_MessageType]): + + _path: Union[bytes, str] # undocumented + _factory: Optional[Callable[[IO[Any]], _MessageType]] # undocumented + + def __init__(self, path: _PathType, factory: Optional[Callable[[IO[Any]], _MessageType]] = ..., create: bool = ...) -> None: ... + def add(self, message: _MessageData) -> str: ... + def remove(self, key: str) -> None: ... + def __delitem__(self, key: str) -> None: ... + def discard(self, key: str) -> None: ... + def __setitem__(self, key: str, message: _MessageData) -> None: ... + @overload + def get(self, key: str, default: None = ...) -> Optional[_MessageType]: ... + @overload + def get(self, key: str, default: _T) -> Union[_MessageType, _T]: ... + def __getitem__(self, key: str) -> _MessageType: ... + def get_message(self, key: str) -> _MessageType: ... + def get_string(self, key: str) -> str: ... + def get_bytes(self, key: str) -> bytes: ... + # As '_ProxyFile' doesn't implement the full IO spec, and BytesIO is incompatible with it, get_file return is Any here + def get_file(self, key: str) -> Any: ... + def iterkeys(self) -> Iterator[str]: ... + def keys(self) -> List[str]: ... + def itervalues(self) -> Iterator[_MessageType]: ... + def __iter__(self) -> Iterator[_MessageType]: ... + def values(self) -> List[_MessageType]: ... + def iteritems(self) -> Iterator[Tuple[str, _MessageType]]: ... + def items(self) -> List[Tuple[str, _MessageType]]: ... + def __contains__(self, key: str) -> bool: ... + def __len__(self) -> int: ... + def clear(self) -> None: ... + @overload + def pop(self, key: str, default: None = ...) -> Optional[_MessageType]: ... + @overload + def pop(self, key: str, default: _T = ...) -> Union[_MessageType, _T]: ... + def popitem(self) -> Tuple[str, _MessageType]: ... + def update(self, arg: Optional[Union[_HasIteritems, _HasItems, Iterable[Tuple[str, _MessageData]]]] = ...) -> None: ... + def flush(self) -> None: ... + def lock(self) -> None: ... + def unlock(self) -> None: ... + def close(self) -> None: ... + +class Maildir(Mailbox[MaildirMessage]): + + colon: str + + def __init__(self, dirname: _PathType, factory: Optional[Callable[[IO[Any]], MaildirMessage]] = ..., create: bool = ...) -> None: ... + def get_file(self, key: str) -> _ProxyFile[bytes]: ... + + def list_folders(self) -> List[str]: ... + def get_folder(self, folder: Text) -> Maildir: ... + def add_folder(self, folder: Text) -> Maildir: ... + def remove_folder(self, folder: Text) -> None: ... + def clean(self) -> None: ... + def next(self) -> Optional[str]: ... + +class _singlefileMailbox(Mailbox[_MessageType]): ... + +class _mboxMMDF(_singlefileMailbox[_MessageType]): + + def get_file(self, key: str) -> _PartialFile[bytes]: ... + +class mbox(_mboxMMDF[mboxMessage]): + + def __init__(self, dirname: _PathType, factory: Optional[Callable[[IO[Any]], mboxMessage]] = ..., create: bool = ...) -> None: ... + +class MMDF(_mboxMMDF[MMDFMessage]): + + def __init__(self, dirname: _PathType, factory: Optional[Callable[[IO[Any]], MMDFMessage]] = ..., create: bool = ...) -> None: ... + +class MH(Mailbox[MHMessage]): + + def __init__(self, dirname: _PathType, factory: Optional[Callable[[IO[Any]], MHMessage]] = ..., create: bool = ...) -> None: ... + def get_file(self, key: str) -> _ProxyFile[bytes]: ... + + def list_folders(self) -> List[str]: ... + def get_folder(self, folder: _PathType) -> MH: ... + def add_folder(self, folder: _PathType) -> MH: ... + def remove_folder(self, folder: _PathType) -> None: ... + def get_sequences(self) -> Dict[str, List[int]]: ... + def set_sequences(self, sequences: Mapping[str, Sequence[int]]) -> None: ... + def pack(self) -> None: ... + +class Babyl(_singlefileMailbox[BabylMessage]): + + def __init__(self, dirname: _PathType, factory: Optional[Callable[[IO[Any]], BabylMessage]] = ..., create: bool = ...) -> None: ... + + def get_file(self, key: str) -> IO[bytes]: ... + def get_labels(self) -> List[str]: ... + +class Message(email.message.Message): + + def __init__(self, message: Optional[_MessageData] = ...) -> None: ... + +class MaildirMessage(Message): + + def get_subdir(self) -> str: ... + def set_subdir(self, subdir: Literal["new", "cur"]) -> None: ... + def get_flags(self) -> str: ... + def set_flags(self, flags: Iterable[str]) -> None: ... + def add_flag(self, flag: str) -> None: ... + def remove_flag(self, flag: str) -> None: ... + def get_date(self) -> int: ... + def set_date(self, date: int) -> None: ... + def get_info(self) -> str: ... + def set_info(self, info: str) -> None: ... + +class _mboxMMDFMessage(Message): + + def get_from(self) -> str: ... + def set_from(self, from_: str, time_: Optional[Union[bool, Tuple[int, int, int, int, int, int, int, int, int]]] = ...) -> None: ... + def get_flags(self) -> str: ... + def set_flags(self, flags: Iterable[str]) -> None: ... + def add_flag(self, flag: str) -> None: ... + def remove_flag(self, flag: str) -> None: ... + +class mboxMessage(_mboxMMDFMessage): ... + +class MHMessage(Message): + + def get_sequences(self) -> List[str]: ... + def set_sequences(self, sequences: Iterable[str]) -> None: ... + def add_sequence(self, sequence: str) -> None: ... + def remove_sequence(self, sequence: str) -> None: ... + +class BabylMessage(Message): + + def get_labels(self) -> List[str]: ... + def set_labels(self, labels: Iterable[str]) -> None: ... + def add_label(self, label: str) -> None: ... + def remove_label(self, label: str) -> None: ... + def get_visible(self) -> Message: ... + def set_visible(self, visible: _MessageData) -> None: ... + def update_visible(self) -> None: ... + +class MMDFMessage(_mboxMMDFMessage): ... + +class _ProxyFile(Generic[AnyStr]): + + def __init__(self, f: IO[AnyStr], pos: Optional[int] = ...) -> None: ... + def read(self, size: Optional[int] = ...) -> AnyStr: ... + def read1(self, size: Optional[int] = ...) -> AnyStr: ... + def readline(self, size: Optional[int] = ...) -> AnyStr: ... + def readlines(self, sizehint: Optional[int] = ...) -> List[AnyStr]: ... + def __iter__(self) -> Iterator[AnyStr]: ... + def tell(self) -> int: ... + def seek(self, offset: int, whence: int = ...) -> None: ... + def close(self) -> None: ... + def __enter__(self) -> _ProxyFile[AnyStr]: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[TracebackType]) -> None: ... + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def seekable(self) -> bool: ... + def flush(self) -> None: ... + @property + def closed(self) -> bool: ... + +class _PartialFile(_ProxyFile[AnyStr]): + + def __init__(self, f: IO[AnyStr], start: Optional[int] = ..., stop: Optional[int] = ...) -> None: ... + +class Error(Exception): ... + +class NoSuchMailboxError(Error): ... + +class NotEmptyError(Error): ... + +class ExternalClashError(Error): ... + +class FormatError(Error): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/mailcap.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/mailcap.pyi new file mode 100644 index 00000000..8f9689d9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/mailcap.pyi @@ -0,0 +1,7 @@ + +from typing import Sequence, Dict, List, Union, Tuple, Optional, Mapping + +_Cap = Dict[str, Union[str, int]] + +def findmatch(caps: Mapping[str, List[_Cap]], MIMEtype: str, key: str = ..., filename: str = ..., plist: Sequence[str] = ...) -> Tuple[Optional[str], Optional[_Cap]]: ... +def getcaps() -> Dict[str, List[_Cap]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/marshal.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/marshal.pyi new file mode 100644 index 00000000..9848f775 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/marshal.pyi @@ -0,0 +1,8 @@ +from typing import Any, IO + +version: int + +def dump(value: Any, file: IO[Any], version: int = ...) -> None: ... +def load(file: IO[Any]) -> Any: ... +def dumps(value: Any, version: int = ...) -> bytes: ... +def loads(string: bytes) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/math.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/math.pyi new file mode 100644 index 00000000..aa8b191a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/math.pyi @@ -0,0 +1,83 @@ +# Stubs for math +# See: http://docs.python.org/2/library/math.html + +from typing import Tuple, Iterable, SupportsFloat, SupportsInt, overload + +import sys + +e: float +pi: float +if sys.version_info >= (3, 5): + inf: float + nan: float +if sys.version_info >= (3, 6): + tau: float + +def acos(x: SupportsFloat) -> float: ... +def acosh(x: SupportsFloat) -> float: ... +def asin(x: SupportsFloat) -> float: ... +def asinh(x: SupportsFloat) -> float: ... +def atan(x: SupportsFloat) -> float: ... +def atan2(y: SupportsFloat, x: SupportsFloat) -> float: ... +def atanh(x: SupportsFloat) -> float: ... +if sys.version_info >= (3,): + def ceil(x: SupportsFloat) -> int: ... +else: + def ceil(x: SupportsFloat) -> float: ... +def copysign(x: SupportsFloat, y: SupportsFloat) -> float: ... +def cos(x: SupportsFloat) -> float: ... +def cosh(x: SupportsFloat) -> float: ... +def degrees(x: SupportsFloat) -> float: ... +if sys.version_info >= (3, 8): + def dist(__p: Iterable[SupportsFloat], __q: Iterable[SupportsFloat]) -> float: ... +def erf(x: SupportsFloat) -> float: ... +def erfc(x: SupportsFloat) -> float: ... +def exp(x: SupportsFloat) -> float: ... +def expm1(x: SupportsFloat) -> float: ... +def fabs(x: SupportsFloat) -> float: ... +def factorial(x: SupportsInt) -> int: ... +if sys.version_info >= (3,): + def floor(x: SupportsFloat) -> int: ... +else: + def floor(x: SupportsFloat) -> float: ... +def fmod(x: SupportsFloat, y: SupportsFloat) -> float: ... +def frexp(x: SupportsFloat) -> Tuple[float, int]: ... +def fsum(iterable: Iterable[float]) -> float: ... +def gamma(x: SupportsFloat) -> float: ... +if sys.version_info >= (3, 5): + def gcd(a: int, b: int) -> int: ... +if sys.version_info >= (3, 8): + def hypot(*coordinates: SupportsFloat) -> float: ... +else: + def hypot(__x: SupportsFloat, __y: SupportsFloat) -> float: ... +if sys.version_info >= (3, 5): + def isclose(a: SupportsFloat, b: SupportsFloat, rel_tol: SupportsFloat = ..., abs_tol: SupportsFloat = ...) -> bool: ... +def isinf(x: SupportsFloat) -> bool: ... +if sys.version_info >= (3,): + def isfinite(x: SupportsFloat) -> bool: ... +def isnan(x: SupportsFloat) -> bool: ... +if sys.version_info >= (3, 8): + def isqrt(__n: int) -> int: ... +def ldexp(x: SupportsFloat, i: int) -> float: ... +def lgamma(x: SupportsFloat) -> float: ... +def log(x: SupportsFloat, base: SupportsFloat = ...) -> float: ... +def log10(x: SupportsFloat) -> float: ... +def log1p(x: SupportsFloat) -> float: ... +if sys.version_info >= (3, 3): + def log2(x: SupportsFloat) -> float: ... +def modf(x: SupportsFloat) -> Tuple[float, float]: ... +def pow(x: SupportsFloat, y: SupportsFloat) -> float: ... +if sys.version_info >= (3, 8): + @overload + def prod(__iterable: Iterable[int], *, start: int = ...) -> int: ... # type: ignore + @overload + def prod(__iterable: Iterable[SupportsFloat], *, start: SupportsFloat = ...) -> float: ... +def radians(x: SupportsFloat) -> float: ... +if sys.version_info >= (3, 7): + def remainder(x: SupportsFloat, y: SupportsFloat) -> float: ... +def sin(x: SupportsFloat) -> float: ... +def sinh(x: SupportsFloat) -> float: ... +def sqrt(x: SupportsFloat) -> float: ... +def tan(x: SupportsFloat) -> float: ... +def tanh(x: SupportsFloat) -> float: ... +def trunc(x: SupportsFloat) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/mimetypes.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/mimetypes.pyi new file mode 100644 index 00000000..eb830279 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/mimetypes.pyi @@ -0,0 +1,38 @@ +# Stubs for mimetypes + +from typing import Dict, IO, List, Optional, Sequence, Text, Tuple +import sys + +def guess_type(url: Text, + strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ... +def guess_all_extensions(type: str, strict: bool = ...) -> List[str]: ... +def guess_extension(type: str, strict: bool = ...) -> Optional[str]: ... + +def init(files: Optional[Sequence[str]] = ...) -> None: ... +def read_mime_types(filename: str) -> Optional[Dict[str, str]]: ... +def add_type(type: str, ext: str, strict: bool = ...) -> None: ... + +inited: bool +knownfiles: List[str] +suffix_map: Dict[str, str] +encodings_map: Dict[str, str] +types_map: Dict[str, str] +common_types: Dict[str, str] + +class MimeTypes: + suffix_map: Dict[str, str] + encodings_map: Dict[str, str] + types_map: Tuple[Dict[str, str], Dict[str, str]] + types_map_inv: Tuple[Dict[str, str], Dict[str, str]] + def __init__(self, filenames: Tuple[str, ...] = ..., + strict: bool = ...) -> None: ... + def guess_extension(self, type: str, + strict: bool = ...) -> Optional[str]: ... + def guess_type(self, url: str, + strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ... + def guess_all_extensions(self, type: str, + strict: bool = ...) -> List[str]: ... + def read(self, filename: str, strict: bool = ...) -> None: ... + def readfp(self, fp: IO[str], strict: bool = ...) -> None: ... + if sys.platform == 'win32': + def read_windows_registry(self, strict: bool = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/mmap.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/mmap.pyi new file mode 100644 index 00000000..aff41b9b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/mmap.pyi @@ -0,0 +1,102 @@ +import sys +from typing import (Optional, Sequence, Union, Generic, overload, + Iterable, Iterator, Sized, ContextManager, AnyStr) + +ACCESS_DEFAULT: int +ACCESS_READ: int +ACCESS_WRITE: int +ACCESS_COPY: int + +ALLOCATIONGRANULARITY: int + +if sys.platform != 'win32': + MAP_ANON: int + MAP_ANONYMOUS: int + MAP_DENYWRITE: int + MAP_EXECUTABLE: int + MAP_PRIVATE: int + MAP_SHARED: int + PROT_EXEC: int + PROT_READ: int + PROT_WRITE: int + + PAGESIZE: int + +class _mmap(Generic[AnyStr]): + if sys.platform == 'win32': + def __init__(self, fileno: int, length: int, + tagname: Optional[str] = ..., access: int = ..., + offset: int = ...) -> None: ... + else: + def __init__(self, + fileno: int, length: int, flags: int = ..., + prot: int = ..., access: int = ..., + offset: int = ...) -> None: ... + def close(self) -> None: ... + def find(self, sub: AnyStr, + start: int = ..., end: int = ...) -> int: ... + if sys.version_info >= (3, 8): + def flush(self, offset: int = ..., size: int = ...) -> None: ... + else: + def flush(self, offset: int = ..., size: int = ...) -> int: ... + def move(self, dest: int, src: int, count: int) -> None: ... + def read(self, n: int = ...) -> AnyStr: ... + def read_byte(self) -> AnyStr: ... + def readline(self) -> AnyStr: ... + def resize(self, newsize: int) -> None: ... + def seek(self, pos: int, whence: int = ...) -> None: ... + def size(self) -> int: ... + def tell(self) -> int: ... + def write(self, bytes: AnyStr) -> None: ... + def write_byte(self, byte: AnyStr) -> None: ... + def __len__(self) -> int: ... + +if sys.version_info >= (3,): + class mmap(_mmap[bytes], ContextManager[mmap], Iterable[bytes], Sized): + closed: bool + if sys.version_info >= (3, 8): + def madvise(self, option: int, start: int = ..., length: int = ...) -> None: ... + def rfind(self, sub: bytes, start: int = ..., stop: int = ...) -> int: ... + @overload + def __getitem__(self, index: int) -> int: ... + @overload + def __getitem__(self, index: slice) -> bytes: ... + def __delitem__(self, index: Union[int, slice]) -> None: ... + @overload + def __setitem__(self, index: int, object: int) -> None: ... + @overload + def __setitem__(self, index: slice, object: bytes) -> None: ... + # Doesn't actually exist, but the object is actually iterable because it has __getitem__ and + # __len__, so we claim that there is also an __iter__ to help type checkers. + def __iter__(self) -> Iterator[bytes]: ... +else: + class mmap(_mmap[bytes], Sequence[bytes]): + def rfind(self, string: bytes, start: int = ..., stop: int = ...) -> int: ... + def __getitem__(self, index: Union[int, slice]) -> bytes: ... + def __getslice__(self, i: Optional[int], j: Optional[int]) -> bytes: ... + def __delitem__(self, index: Union[int, slice]) -> None: ... + def __setitem__(self, index: Union[int, slice], object: bytes) -> None: ... + +if sys.version_info >= (3, 8): + MADV_NORMAL: int + MADV_RANDOM: int + MADV_SEQUENTIAL: int + MADV_WILLNEED: int + MADV_DONTNEED: int + MADV_REMOVE: int + MADV_DONTFORK: int + MADV_DOFORK: int + MADV_HWPOISON: int + MADV_MERGEABLE: int + MADV_UNMERGEABLE: int + MADV_SOFT_OFFLINE: int + MADV_HUGEPAGE: int + MADV_NOHUGEPAGE: int + MADV_DONTDUMP: int + MADV_DODUMP: int + MADV_FREE: int + MADV_NOSYNC: int + MADV_AUTOSYNC: int + MADV_NOCORE: int + MADV_CORE: int + MADV_PROTECT: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/modulefinder.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/modulefinder.pyi new file mode 100644 index 00000000..da99f29f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/modulefinder.pyi @@ -0,0 +1,48 @@ + +from typing import Optional, Container, Dict, Sequence, Tuple, List, Any, Iterator, IO, Iterable +from types import CodeType + +LOAD_CONST: int # undocumented +IMPORT_NAME: int # undocumented +STORE_NAME: int # undocumented +STORE_GLOBAL: int # undocumented +STORE_OPS: Tuple[int, int] # undocumented +EXTENDED_ARG: int # undocumented + +packagePathMap: Dict[str, List[str]] # undocumented +def AddPackagePath(packagename: str, path: str) -> None: ... +replacePackageMap: Dict[str, str] # undocumented +def ReplacePackage(oldname: str, newname: str) -> None: ... + +class Module: # undocumented + + def __init__(self, name: str, file: Optional[str] = ..., path: Optional[str] = ...) -> None: ... + def __repr__(self) -> str: ... + +class ModuleFinder: + + modules: Dict[str, Module] + + def __init__(self, path: Optional[List[str]] = ..., debug: int = ..., excludes: Container[str] = ..., replace_paths: Sequence[Tuple[str, str]] = ...) -> None: ... + def msg(self, level: int, str: str, *args: Any) -> None: ... # undocumented + def msgin(self, *args: Any) -> None: ... # undocumented + def msgout(self, *args: Any) -> None: ... # undocumented + def run_script(self, pathname: str) -> None: ... + def load_file(self, pathname: str) -> None: ... # undocumented + def import_hook(self, name: str, caller: Optional[Module] = ..., fromlist: Optional[List[str]] = ..., level: int = ...) -> Optional[Module]: ... # undocumented + def determine_parent(self, caller: Optional[Module], level: int = ...) -> Optional[Module]: ... # undocumented + def find_head_package(self, parent: Module, name: str) -> Tuple[Module, str]: ... # undocumented + def load_tail(self, q: Module, tail: str) -> Module: ... # undocumented + def ensure_fromlist(self, m: Module, fromlist: Iterable[str], recursive: int = ...) -> None: ... # undocumented + def find_all_submodules(self, m: Module) -> Iterable[str]: ... # undocumented + def import_module(self, partname: str, fqname: str, parent: Module) -> Optional[Module]: ... # undocumented + def load_module(self, fqname: str, fp: IO[str], pathname: str, file_info: Tuple[str, str, str]) -> Module: ... # undocumented + def scan_opcodes(self, co: CodeType) -> Iterator[Tuple[str, Tuple[Any, ...]]]: ... # undocumented + def scan_code(self, co: CodeType, m: Module) -> None: ... # undocumented + def load_package(self, fqname: str, pathname: str) -> Module: ... # undocumented + def add_module(self, fqname: str) -> Module: ... # undocumented + def find_module(self, name: str, path: Optional[str], parent: Optional[Module] = ...) -> Tuple[Optional[IO[Any]], Optional[str], Tuple[str, str, int]]: ... # undocumented + def report(self) -> None: ... + def any_missing(self) -> List[str]: ... # undocumented + def any_missing_maybe(self) -> Tuple[List[str], List[str]]: ... # undocumented + def replace_paths_in_code(self, co: CodeType) -> CodeType: ... # undocumented diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/netrc.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/netrc.pyi new file mode 100644 index 00000000..3ceae889 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/netrc.pyi @@ -0,0 +1,19 @@ +from typing import AnyStr, Dict, List, Optional, Tuple, overload + + +class NetrcParseError(Exception): + filename: Optional[str] + lineno: Optional[int] + msg: str + + +# (login, account, password) tuple +_NetrcTuple = Tuple[str, Optional[str], Optional[str]] + + +class netrc: + hosts: Dict[str, _NetrcTuple] + macros: Dict[str, List[str]] + + def __init__(self, file: str = ...) -> None: ... + def authenticators(self, host: str) -> Optional[_NetrcTuple]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/nis.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/nis.pyi new file mode 100644 index 00000000..87223caf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/nis.pyi @@ -0,0 +1,10 @@ +import sys +from typing import Dict, List + +if sys.platform != 'win32': + def cat(map: str, domain: str = ...) -> Dict[str, str]: ... + def get_default_domain() -> str: ... + def maps(domain: str = ...) -> List[str]: ... + def match(key: str, map: str, domain: str = ...) -> str: ... + + class error(Exception): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ntpath.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ntpath.pyi new file mode 100644 index 00000000..42409c0e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ntpath.pyi @@ -0,0 +1,177 @@ +# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! +# Stubs for os.path +# Ron Murawski + +import os +import sys +from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional + +_T = TypeVar('_T') + +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PathType = Union[bytes, Text, _PathLike] + _StrPath = Union[Text, _PathLike[Text]] + _BytesPath = Union[bytes, _PathLike[bytes]] +else: + _PathType = Union[bytes, Text] + _StrPath = Text + _BytesPath = bytes + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(path: AnyStr) -> AnyStr: ... + @overload + def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(path: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(path: AnyStr) -> AnyStr: ... + @overload + def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + @overload + def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(filename: AnyStr) -> AnyStr: ... + +else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(path: AnyStr) -> AnyStr: ... + def dirname(path: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(path: AnyStr) -> AnyStr: ... + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + def realpath(path: AnyStr) -> AnyStr: ... + else: + def realpath(filename: AnyStr) -> AnyStr: ... + +if sys.version_info >= (3, 6): + # In reality it returns str for sequences of _StrPath and bytes for sequences + # of _BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[_PathType]) -> Any: ... +elif sys.version_info >= (3, 5): + def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes +# So, fall back to Any +def commonprefix(list: Sequence[_PathType]) -> Any: ... + +if sys.version_info >= (3, 3): + def exists(path: Union[_PathType, int]) -> bool: ... +else: + def exists(path: _PathType) -> bool: ... +def lexists(path: _PathType) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(path: _PathType) -> float: ... +def getmtime(path: _PathType) -> float: ... +def getctime(path: _PathType) -> float: ... + +def getsize(path: _PathType) -> int: ... +def isabs(path: _PathType) -> bool: ... +def isfile(path: _PathType) -> bool: ... +def isdir(path: _PathType) -> bool: ... +def islink(path: _PathType) -> bool: ... +def ismount(path: _PathType) -> bool: ... + +if sys.version_info < (3, 0): + # Make sure signatures are disjunct, and allow combinations of bytes and unicode. + # (Since Python 2 allows that, too) + # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in + # a type error. + @overload + def join(__p1: bytes, *p: bytes) -> bytes: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: Text, *p: _PathType) -> Text: ... +elif sys.version_info >= (3, 6): + # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. + @overload + def join(path: _StrPath, *paths: _StrPath) -> Text: ... + @overload + def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... +else: + def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... + +@overload +def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... + +def samefile(path1: _PathType, path2: _PathType) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +else: + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.platform == 'win32': + def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated + +if sys.version_info < (3,): + def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/numbers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/numbers.pyi new file mode 100644 index 00000000..befe7d53 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/numbers.pyi @@ -0,0 +1,144 @@ +# Stubs for numbers (Python 3.5) +# See https://docs.python.org/2.7/library/numbers.html +# and https://docs.python.org/3/library/numbers.html +# +# Note: these stubs are incomplete. The more complex type +# signatures are currently omitted. + +from typing import Any, Optional, SupportsFloat, overload +from abc import ABCMeta, abstractmethod +import sys + +class Number(metaclass=ABCMeta): + @abstractmethod + def __hash__(self) -> int: ... + +class Complex(Number): + @abstractmethod + def __complex__(self) -> complex: ... + if sys.version_info >= (3, 0): + def __bool__(self) -> bool: ... + else: + def __nonzero__(self) -> bool: ... + @property + @abstractmethod + def real(self): ... + @property + @abstractmethod + def imag(self): ... + @abstractmethod + def __add__(self, other): ... + @abstractmethod + def __radd__(self, other): ... + @abstractmethod + def __neg__(self): ... + @abstractmethod + def __pos__(self): ... + def __sub__(self, other): ... + def __rsub__(self, other): ... + @abstractmethod + def __mul__(self, other): ... + @abstractmethod + def __rmul__(self, other): ... + if sys.version_info < (3, 0): + @abstractmethod + def __div__(self, other): ... + @abstractmethod + def __rdiv__(self, other): ... + @abstractmethod + def __truediv__(self, other): ... + @abstractmethod + def __rtruediv__(self, other): ... + @abstractmethod + def __pow__(self, exponent): ... + @abstractmethod + def __rpow__(self, base): ... + def __abs__(self): ... + def conjugate(self): ... + def __eq__(self, other: object) -> bool: ... + if sys.version_info < (3, 0): + def __ne__(self, other: object) -> bool: ... + +class Real(Complex, SupportsFloat): + @abstractmethod + def __float__(self) -> float: ... + @abstractmethod + def __trunc__(self) -> int: ... + if sys.version_info >= (3, 0): + @abstractmethod + def __floor__(self) -> int: ... + @abstractmethod + def __ceil__(self) -> int: ... + @abstractmethod + @overload + def __round__(self, ndigits: None = ...): ... + @abstractmethod + @overload + def __round__(self, ndigits: int): ... + def __divmod__(self, other): ... + def __rdivmod__(self, other): ... + @abstractmethod + def __floordiv__(self, other): ... + @abstractmethod + def __rfloordiv__(self, other): ... + @abstractmethod + def __mod__(self, other): ... + @abstractmethod + def __rmod__(self, other): ... + @abstractmethod + def __lt__(self, other) -> bool: ... + @abstractmethod + def __le__(self, other) -> bool: ... + def __complex__(self) -> complex: ... + @property + def real(self): ... + @property + def imag(self): ... + def conjugate(self): ... + +class Rational(Real): + @property + @abstractmethod + def numerator(self) -> int: ... + @property + @abstractmethod + def denominator(self) -> int: ... + def __float__(self) -> float: ... + +class Integral(Rational): + if sys.version_info >= (3, 0): + @abstractmethod + def __int__(self) -> int: ... + else: + @abstractmethod + def __long__(self) -> long: ... + def __index__(self) -> int: ... + @abstractmethod + def __pow__(self, exponent, modulus: Optional[Any] = ...): ... + @abstractmethod + def __lshift__(self, other): ... + @abstractmethod + def __rlshift__(self, other): ... + @abstractmethod + def __rshift__(self, other): ... + @abstractmethod + def __rrshift__(self, other): ... + @abstractmethod + def __and__(self, other): ... + @abstractmethod + def __rand__(self, other): ... + @abstractmethod + def __xor__(self, other): ... + @abstractmethod + def __rxor__(self, other): ... + @abstractmethod + def __or__(self, other): ... + @abstractmethod + def __ror__(self, other): ... + @abstractmethod + def __invert__(self): ... + def __float__(self) -> float: ... + @property + def numerator(self) -> int: ... + @property + def denominator(self) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/opcode.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/opcode.pyi new file mode 100644 index 00000000..34350e74 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/opcode.pyi @@ -0,0 +1,23 @@ +from typing import List, Dict, Optional, Sequence + +import sys + +cmp_op: Sequence[str] +hasconst: List[int] +hasname: List[int] +hasjrel: List[int] +hasjabs: List[int] +haslocal: List[int] +hascompare: List[int] +hasfree: List[int] +opname: List[str] + +opmap: Dict[str, int] +HAVE_ARGUMENT: int +EXTENDED_ARG: int + +if sys.version_info >= (3, 4): + def stack_effect(opcode: int, oparg: Optional[int] = ...) -> int: ... + +if sys.version_info >= (3, 6): + hasnargs: List[int] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/operator.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/operator.pyi new file mode 100644 index 00000000..3a70b47e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/operator.pyi @@ -0,0 +1,227 @@ +# Stubs for operator + +from typing import ( + Any, Callable, Container, Mapping, MutableMapping, MutableSequence, Sequence, SupportsAbs, Tuple, + TypeVar, overload, +) +import sys + + +_T = TypeVar('_T') +_K = TypeVar('_K') +_V = TypeVar('_V') + + +def lt(a: Any, b: Any) -> Any: ... +def le(a: Any, b: Any) -> Any: ... +def eq(a: Any, b: Any) -> Any: ... +def ne(a: Any, b: Any) -> Any: ... +def ge(a: Any, b: Any) -> Any: ... +def gt(a: Any, b: Any) -> Any: ... +def __lt__(a: Any, b: Any) -> Any: ... +def __le__(a: Any, b: Any) -> Any: ... +def __eq__(a: Any, b: Any) -> Any: ... +def __ne__(a: Any, b: Any) -> Any: ... +def __ge__(a: Any, b: Any) -> Any: ... +def __gt__(a: Any, b: Any) -> Any: ... + +def not_(obj: Any) -> bool: ... +def __not__(obj: Any) -> bool: ... + +def truth(x: Any) -> bool: ... + +def is_(a: Any, b: Any) -> bool: ... + +def is_not(a: Any, b: Any) -> bool: ... + +def abs(x: SupportsAbs[_T]) -> _T: ... +def __abs__(a: SupportsAbs[_T]) -> _T: ... + +def add(a: Any, b: Any) -> Any: ... +def __add__(a: Any, b: Any) -> Any: ... + +def and_(a: Any, b: Any) -> Any: ... +def __and__(a: Any, b: Any) -> Any: ... + +if sys.version_info < (3, ): + def div(a: Any, b: Any) -> Any: ... + def __div__(a: Any, b: Any) -> Any: ... + +def floordiv(a: Any, b: Any) -> Any: ... +def __floordiv__(a: Any, b: Any) -> Any: ... + +def index(a: Any) -> int: ... +def __index__(a: Any) -> int: ... + +def inv(obj: Any) -> Any: ... +def invert(obj: Any) -> Any: ... +def __inv__(obj: Any) -> Any: ... +def __invert__(obj: Any) -> Any: ... + +def lshift(a: Any, b: Any) -> Any: ... +def __lshift__(a: Any, b: Any) -> Any: ... + +def mod(a: Any, b: Any) -> Any: ... +def __mod__(a: Any, b: Any) -> Any: ... + +def mul(a: Any, b: Any) -> Any: ... +def __mul__(a: Any, b: Any) -> Any: ... + +if sys.version_info >= (3, 5): + def matmul(a: Any, b: Any) -> Any: ... + def __matmul__(a: Any, b: Any) -> Any: ... + +def neg(obj: Any) -> Any: ... +def __neg__(obj: Any) -> Any: ... + +def or_(a: Any, b: Any) -> Any: ... +def __or__(a: Any, b: Any) -> Any: ... + +def pos(obj: Any) -> Any: ... +def __pos__(obj: Any) -> Any: ... + +def pow(a: Any, b: Any) -> Any: ... +def __pow__(a: Any, b: Any) -> Any: ... + +def rshift(a: Any, b: Any) -> Any: ... +def __rshift__(a: Any, b: Any) -> Any: ... + +def sub(a: Any, b: Any) -> Any: ... +def __sub__(a: Any, b: Any) -> Any: ... + +def truediv(a: Any, b: Any) -> Any: ... +def __truediv__(a: Any, b: Any) -> Any: ... + +def xor(a: Any, b: Any) -> Any: ... +def __xor__(a: Any, b: Any) -> Any: ... + +def concat(a: Sequence[_T], b: Sequence[_T]) -> Sequence[_T]: ... +def __concat__(a: Sequence[_T], b: Sequence[_T]) -> Sequence[_T]: ... + +def contains(a: Container[Any], b: Any) -> bool: ... +def __contains__(a: Container[Any], b: Any) -> bool: ... + +def countOf(a: Container[Any], b: Any) -> int: ... + +@overload +def delitem(a: MutableSequence[_T], b: int) -> None: ... +@overload +def delitem(a: MutableMapping[_K, _V], b: _K) -> None: ... +@overload +def __delitem__(a: MutableSequence[_T], b: int) -> None: ... +@overload +def __delitem__(a: MutableMapping[_K, _V], b: _K) -> None: ... + +if sys.version_info < (3, ): + def delslice(a: MutableSequence[Any], b: int, c: int) -> None: ... + def __delslice__(a: MutableSequence[Any], b: int, c: int) -> None: ... + +@overload +def getitem(a: Sequence[_T], b: int) -> _T: ... +@overload +def getitem(a: Mapping[_K, _V], b: _K) -> _V: ... +@overload +def __getitem__(a: Sequence[_T], b: int) -> _T: ... +@overload +def __getitem__(a: Mapping[_K, _V], b: _K) -> _V: ... + +if sys.version_info < (3, ): + def getslice(a: Sequence[_T], b: int, c: int) -> Sequence[_T]: ... + def __getslice__(a: Sequence[_T], b: int, c: int) -> Sequence[_T]: ... + +def indexOf(a: Sequence[_T], b: _T) -> int: ... + +if sys.version_info < (3, ): + def repeat(a: Any, b: int) -> Any: ... + def __repeat__(a: Any, b: int) -> Any: ... + +if sys.version_info < (3, ): + def sequenceIncludes(a: Container[Any], b: Any) -> bool: ... + +@overload +def setitem(a: MutableSequence[_T], b: int, c: _T) -> None: ... +@overload +def setitem(a: MutableMapping[_K, _V], b: _K, c: _V) -> None: ... +@overload +def __setitem__(a: MutableSequence[_T], b: int, c: _T) -> None: ... +@overload +def __setitem__(a: MutableMapping[_K, _V], b: _K, c: _V) -> None: ... + +if sys.version_info < (3, ): + def setslice(a: MutableSequence[_T], b: int, c: int, v: Sequence[_T]) -> None: ... + def __setslice__(a: MutableSequence[_T], b: int, c: int, v: Sequence[_T]) -> None: ... + + +if sys.version_info >= (3, 4): + def length_hint(obj: Any, default: int = ...) -> int: ... + +@overload +def attrgetter(attr: str) -> Callable[[Any], Any]: ... +@overload +def attrgetter(*attrs: str) -> Callable[[Any], Tuple[Any, ...]]: ... + +@overload +def itemgetter(item: Any) -> Callable[[Any], Any]: ... +@overload +def itemgetter(*items: Any) -> Callable[[Any], Tuple[Any, ...]]: ... + +def methodcaller(name: str, *args: Any, **kwargs: Any) -> Callable[..., Any]: ... + + +def iadd(a: Any, b: Any) -> Any: ... +def __iadd__(a: Any, b: Any) -> Any: ... + +def iand(a: Any, b: Any) -> Any: ... +def __iand__(a: Any, b: Any) -> Any: ... + +def iconcat(a: Any, b: Any) -> Any: ... +def __iconcat__(a: Any, b: Any) -> Any: ... + +if sys.version_info < (3, ): + def idiv(a: Any, b: Any) -> Any: ... + def __idiv__(a: Any, b: Any) -> Any: ... + +def ifloordiv(a: Any, b: Any) -> Any: ... +def __ifloordiv__(a: Any, b: Any) -> Any: ... + +def ilshift(a: Any, b: Any) -> Any: ... +def __ilshift__(a: Any, b: Any) -> Any: ... + +def imod(a: Any, b: Any) -> Any: ... +def __imod__(a: Any, b: Any) -> Any: ... + +def imul(a: Any, b: Any) -> Any: ... +def __imul__(a: Any, b: Any) -> Any: ... + +if sys.version_info >= (3, 5): + def imatmul(a: Any, b: Any) -> Any: ... + def __imatmul__(a: Any, b: Any) -> Any: ... + +def ior(a: Any, b: Any) -> Any: ... +def __ior__(a: Any, b: Any) -> Any: ... + +def ipow(a: Any, b: Any) -> Any: ... +def __ipow__(a: Any, b: Any) -> Any: ... + +if sys.version_info < (3, ): + def irepeat(a: Any, b: int) -> Any: ... + def __irepeat__(a: Any, b: int) -> Any: ... + +def irshift(a: Any, b: Any) -> Any: ... +def __irshift__(a: Any, b: Any) -> Any: ... + +def isub(a: Any, b: Any) -> Any: ... +def __isub__(a: Any, b: Any) -> Any: ... + +def itruediv(a: Any, b: Any) -> Any: ... +def __itruediv__(a: Any, b: Any) -> Any: ... + +def ixor(a: Any, b: Any) -> Any: ... +def __ixor__(a: Any, b: Any) -> Any: ... + + +if sys.version_info < (3, ): + def isCallable(x: Any) -> bool: ... + def isMappingType(x: Any) -> bool: ... + def isNumberType(x: Any) -> bool: ... + def isSequenceType(x: Any) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/optparse.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/optparse.pyi new file mode 100644 index 00000000..e3fe3142 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/optparse.pyi @@ -0,0 +1,228 @@ +# Generated by pytype, with only minor tweaks. Might be incomplete. +import sys +from typing import Any, AnyStr, Callable, Dict, IO, Iterable, List, Mapping, Optional, Sequence, Tuple, Union + +# See https://groups.google.com/forum/#!topic/python-ideas/gA1gdj3RZ5g +if sys.version_info >= (3,): + _Text = str +else: + _Text = Union[str, unicode] + +NO_DEFAULT: Tuple[_Text, ...] +SUPPRESS_HELP: _Text +SUPPRESS_USAGE: _Text + +def check_builtin(option: Option, opt: Any, value: _Text) -> Any: ... +def check_choice(option: Option, opt: Any, value: _Text) -> Any: ... +if sys.version_info < (3,): + def isbasestring(x: Any) -> bool: ... + +class OptParseError(Exception): + msg: _Text + def __init__(self, msg: _Text) -> None: ... + +class BadOptionError(OptParseError): + opt_str: _Text + def __init__(self, opt_str: _Text) -> None: ... + +class AmbiguousOptionError(BadOptionError): + possibilities: Iterable[_Text] + def __init__(self, opt_str: _Text, possibilities: Sequence[_Text]) -> None: ... + +class OptionError(OptParseError): + msg: _Text + option_id: _Text + def __init__(self, msg: _Text, option: Option) -> None: ... + +class OptionConflictError(OptionError): ... + +class OptionValueError(OptParseError): ... + + +class HelpFormatter: + NO_DEFAULT_VALUE: _Text + _long_opt_fmt: _Text + _short_opt_fmt: _Text + current_indent: int + default_tag: _Text + help_position: Any + help_width: Any + indent_increment: int + level: int + max_help_position: int + option_strings: Dict[Option, _Text] + parser: OptionParser + short_first: Any + width: int + def __init__(self, indent_increment: int, max_help_position: int, width: Optional[int], short_first: int) -> None: ... + def _format__Text(self, _Text: _Text) -> _Text: ... + def dedent(self) -> None: ... + def expand_default(self, option: Option) -> _Text: ... + def format_description(self, description: _Text) -> _Text: ... + def format_epilog(self, epilog) -> _Text: ... + def format_heading(self, heading: Any) -> _Text: ... + def format_option(self, option: OptionParser) -> _Text: ... + def format_option_strings(self, option: OptionParser) -> Any: ... + def format_usage(self, usage: Any) -> _Text: ... + def indent(self) -> None: ... + def set_long_opt_delimiter(self, delim: _Text) -> None: ... + def set_parser(self, parser: OptionParser) -> None: ... + def set_short_opt_delimiter(self, delim: _Text) -> None: ... + def store_option_strings(self, parser: OptionParser) -> None: ... + +class IndentedHelpFormatter(HelpFormatter): + def __init__(self, + indent_increment: int = ..., + max_help_position: int = ..., + width: Optional[int] = ..., + short_first: int = ...) -> None: ... + def format_heading(self, heading: _Text) -> _Text: ... + def format_usage(self, usage: _Text) -> _Text: ... + +class TitledHelpFormatter(HelpFormatter): + def __init__(self, + indent_increment: int = ..., + max_help_position: int = ..., + width: Optional[int] = ..., + short_first: int = ...) -> None: ... + def format_heading(self, heading: _Text) -> _Text: ... + def format_usage(self, usage: _Text) -> _Text: ... + +class Option: + ACTIONS: Tuple[_Text, ...] + ALWAYS_TYPED_ACTIONS: Tuple[_Text, ...] + ATTRS: List[_Text] + CHECK_METHODS: Optional[List[Callable[..., Any]]] + CONST_ACTIONS: Tuple[_Text, ...] + STORE_ACTIONS: Tuple[_Text, ...] + TYPED_ACTIONS: Tuple[_Text, ...] + TYPES: Tuple[_Text, ...] + TYPE_CHECKER: Dict[_Text, Callable[..., Any]] + _long_opts: List[_Text] + _short_opts: List[_Text] + action: _Text + dest: Optional[_Text] + nargs: int + type: Any + def __init__(self, *opts, **attrs) -> None: ... + def _check_action(self) -> None: ... + def _check_callback(self) -> None: ... + def _check_choice(self) -> None: ... + def _check_const(self) -> None: ... + def _check_dest(self) -> None: ... + def _check_nargs(self) -> None: ... + def _check_opt_strings(self, opts: Optional[_Text]) -> Any: ... + def _check_type(self) -> None: ... + def _set_attrs(self, attrs: Dict[_Text, Any]) -> None: ... + def _set_opt_strings(self, opts: _Text) -> None: ... + def check_value(self, opt: Any, value: Any) -> Any: ... + def convert_value(self, opt: Any, value: Any) -> Any: ... + def get_opt_string(self) -> _Text: ... + def process(self, opt: Any, value: Any, values: Any, parser: OptionParser) -> int: ... + def take_action(self, action: _Text, dest: _Text, opt: Any, value: Any, values: Any, parser: OptionParser) -> int: ... + def takes_value(self) -> bool: ... + +make_option = Option + +class OptionContainer: + _long_opt: Dict[_Text, Option] + _short_opt: Dict[_Text, Option] + conflict_handler: _Text + defaults: Dict[_Text, Any] + description: Any + option_class: Any + def __init__(self, option_class: Option, conflict_handler: Any, description: Any) -> None: ... + def _check_conflict(self, option: Any) -> None: ... + def _create_option_mappings(self) -> None: ... + def _share_option_mappings(self, parser: OptionParser) -> None: ... + def add_option(self, *args, **kwargs) -> Any: ... + def add_options(self, option_list: Iterable[Option]) -> None: ... + def destroy(self) -> None: ... + def format_description(self, formatter: Optional[HelpFormatter]) -> Any: ... + def format_help(self, formatter: Optional[HelpFormatter]) -> _Text: ... + def format_option_help(self, formatter: Optional[HelpFormatter]) -> _Text: ... + def get_description(self) -> Any: ... + def get_option(self, opt_str: _Text) -> Optional[Option]: ... + def has_option(self, opt_str: _Text) -> bool: ... + def remove_option(self, opt_str: _Text) -> None: ... + def set_conflict_handler(self, handler: Any) -> None: ... + def set_description(self, description: Any) -> None: ... + +class OptionGroup(OptionContainer): + option_list: List[Option] + parser: OptionParser + title: _Text + def __init__(self, parser: OptionParser, title: _Text, description: Optional[_Text] = ...) -> None: ... + def _create_option_list(self) -> None: ... + def set_title(self, title: _Text) -> None: ... + +class Values: + def __init__(self, defaults: Optional[Mapping[str, Any]] = ...) -> None: ... + def _update(self, dict: Mapping[_Text, Any], mode: Any) -> None: ... + def _update_careful(self, dict: Mapping[_Text, Any]) -> None: ... + def _update_loose(self, dict: Mapping[_Text, Any]) -> None: ... + def ensure_value(self, attr: _Text, value: Any) -> Any: ... + def read_file(self, filename: _Text, mode: _Text) -> None: ... + def read_module(self, modname: _Text, mode: _Text) -> None: ... + def __getattr__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + +class OptionParser(OptionContainer): + allow_interspersed_args: bool + epilog: Optional[_Text] + formatter: HelpFormatter + largs: Optional[List[_Text]] + option_groups: List[OptionParser] + option_list: List[Option] + process_default_values: Any + prog: Optional[_Text] + rargs: Optional[List[Any]] + standard_option_list: List[Option] + usage: Optional[_Text] + values: Optional[Values] + version: _Text + def __init__(self, + usage: Optional[_Text] = ..., + option_list: Iterable[Option] = ..., + option_class: Option = ..., + version: Optional[_Text] = ..., + conflict_handler: _Text = ..., + description: Optional[_Text] = ..., + formatter: Optional[HelpFormatter] = ..., + add_help_option: bool = ..., + prog: Optional[_Text] = ..., + epilog: Optional[_Text] = ...) -> None: ... + def _add_help_option(self) -> None: ... + def _add_version_option(self) -> None: ... + def _create_option_list(self) -> None: ... + def _get_all_options(self) -> List[Option]: ... + def _get_args(self, args: Iterable[Any]) -> List[Any]: ... + def _init_parsing_state(self) -> None: ... + def _match_long_opt(self, opt: _Text) -> _Text: ... + def _populate_option_list(self, option_list: Iterable[Option], add_help: bool = ...) -> None: ... + def _process_args(self, largs: List[Any], rargs: List[Any], values: Values) -> None: ... + def _process_long_opt(self, rargs: List[Any], values: Any) -> None: ... + def _process_short_opts(self, rargs: List[Any], values: Any) -> None: ... + def add_option_group(self, *args, **kwargs) -> OptionParser: ... + def check_values(self, values: Values, args: List[_Text]) -> Tuple[Values, List[_Text]]: ... + def disable_interspersed_args(self) -> None: ... + def enable_interspersed_args(self) -> None: ... + def error(self, msg: _Text) -> None: ... + def exit(self, status: int = ..., msg: Optional[str] = ...) -> None: ... + def expand_prog_name(self, s: Optional[_Text]) -> Any: ... + def format_epilog(self, formatter: HelpFormatter) -> Any: ... + def format_help(self, formatter: Optional[HelpFormatter] = ...) -> _Text: ... + def format_option_help(self, formatter: Optional[HelpFormatter] = ...) -> _Text: ... + def get_default_values(self) -> Values: ... + def get_option_group(self, opt_str: _Text) -> Any: ... + def get_prog_name(self) -> _Text: ... + def get_usage(self) -> _Text: ... + def get_version(self) -> _Text: ... + def parse_args(self, args: Optional[Sequence[AnyStr]] = ..., values: Optional[Values] = ...) -> Tuple[Values, List[AnyStr]]: ... + def print_usage(self, file: Optional[IO[str]] = ...) -> None: ... + def print_help(self, file: Optional[IO[str]] = ...) -> None: ... + def print_version(self, file: Optional[IO[str]] = ...) -> None: ... + def set_default(self, dest: Any, value: Any) -> None: ... + def set_defaults(self, **kwargs) -> None: ... + def set_process_default_values(self, process: Any) -> None: ... + def set_usage(self, usage: _Text) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pdb.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pdb.pyi new file mode 100644 index 00000000..e403c36c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pdb.pyi @@ -0,0 +1,62 @@ +# NOTE: This stub is incomplete - only contains some global functions + +from cmd import Cmd +import sys +from types import FrameType +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar + +_T = TypeVar('_T') + +class Restart(Exception): ... + +def run(statement: str, globals: Optional[Dict[str, Any]] = ..., + locals: Optional[Dict[str, Any]] = ...) -> None: ... +def runeval(expression: str, globals: Optional[Dict[str, Any]] = ..., + locals: Optional[Dict[str, Any]] = ...) -> Any: ... +def runctx(statement: str, globals: Dict[str, Any], locals: Dict[str, Any]) -> None: ... +def runcall(*args: Any, **kwds: Any) -> Any: ... + +if sys.version_info >= (3, 7): + def set_trace(*, header: Optional[str] = ...) -> None: ... +else: + def set_trace() -> None: ... + +def post_mortem(t: Optional[Any] = ...) -> None: ... +def pm() -> None: ... + +class Pdb(Cmd): + if sys.version_info >= (3, 6): + def __init__( + self, + completekey: str = ..., + stdin: Optional[IO[str]] = ..., + stdout: Optional[IO[str]] = ..., + skip: Optional[Iterable[str]] = ..., + nosigint: bool = ..., + readrc: bool = ..., + ) -> None: ... + elif sys.version_info >= (3, 2): + def __init__( + self, + completekey: str = ..., + stdin: Optional[IO[str]] = ..., + stdout: Optional[IO[str]] = ..., + skip: Optional[Iterable[str]] = ..., + nosigint: bool = ..., + ) -> None: ... + else: + def __init__( + self, + completekey: str = ..., + stdin: Optional[IO[str]] = ..., + stdout: Optional[IO[str]] = ..., + skip: Optional[Iterable[str]] = ..., + ) -> None: ... + # TODO: The run* and set_trace() methods are actually defined on bdb.Bdb, from which Pdb inherits. + # Move these methods there once we have a bdb stub. + def run(self, statement: str, globals: Optional[Dict[str, Any]] = ..., + locals: Optional[Dict[str, Any]] = ...) -> None: ... + def runeval(self, expression: str, globals: Optional[Dict[str, Any]] = ..., + locals: Optional[Dict[str, Any]] = ...) -> Any: ... + def runcall(self, func: Callable[..., _T], *args: Any, **kwds: Any) -> Optional[_T]: ... + def set_trace(self, frame: Optional[FrameType] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pickle.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pickle.pyi new file mode 100644 index 00000000..ec9353f6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pickle.pyi @@ -0,0 +1,141 @@ +import sys +from typing import Any, IO, Mapping, Union, Tuple, Callable, Optional, Iterator + +HIGHEST_PROTOCOL: int +if sys.version_info >= (3, 0): + DEFAULT_PROTOCOL: int + + +if sys.version_info >= (3, 0): + def dump(obj: Any, file: IO[bytes], protocol: Optional[int] = ..., *, + fix_imports: bool = ...) -> None: ... + def dumps(obj: Any, protocol: Optional[int] = ..., *, + fix_imports: bool = ...) -> bytes: ... + def loads(bytes_object: bytes, *, fix_imports: bool = ..., + encoding: str = ..., errors: str = ...) -> Any: ... + def load(file: IO[bytes], *, fix_imports: bool = ..., encoding: str = ..., + errors: str = ...) -> Any: ... +else: + def dump(obj: Any, file: IO[bytes], protocol: Optional[int] = ...) -> None: ... + def dumps(obj: Any, protocol: Optional[int] = ...) -> bytes: ... + def load(file: IO[bytes]) -> Any: ... + def loads(string: bytes) -> Any: ... + +class PickleError(Exception): ... +class PicklingError(PickleError): ... +class UnpicklingError(PickleError): ... + +_reducedtype = Union[str, + Tuple[Callable[..., Any], Tuple[Any, ...]], + Tuple[Callable[..., Any], Tuple[Any, ...], Any], + Tuple[Callable[..., Any], Tuple[Any, ...], Any, + Optional[Iterator]], + Tuple[Callable[..., Any], Tuple[Any, ...], Any, + Optional[Iterator], Optional[Iterator]]] + + +class Pickler: + fast: bool + if sys.version_info >= (3, 3): + dispatch_table: Mapping[type, Callable[[Any], _reducedtype]] + + if sys.version_info >= (3, 0): + def __init__(self, file: IO[bytes], protocol: Optional[int] = ..., *, + fix_imports: bool = ...) -> None: ... + else: + def __init__(self, file: IO[bytes], protocol: Optional[int] = ...) -> None: ... + + def dump(self, obj: Any) -> None: ... + def clear_memo(self) -> None: ... + def persistent_id(self, obj: Any) -> Any: ... + if sys.version_info >= (3, 8): + def reducer_override(self, obj: Any) -> Any: ... + +class Unpickler: + if sys.version_info >= (3, 0): + def __init__(self, file: IO[bytes], *, fix_imports: bool = ..., + encoding: str = ..., errors: str = ...) -> None: ... + else: + def __init__(self, file: IO[bytes]) -> None: ... + + def load(self) -> Any: ... + def find_class(self, module: str, name: str) -> Any: ... + if sys.version_info >= (3, 0): + def persistent_load(self, pid: Any) -> Any: ... + +MARK: bytes +STOP: bytes +POP: bytes +POP_MARK: bytes +DUP: bytes +FLOAT: bytes +INT: bytes +BININT: bytes +BININT1: bytes +LONG: bytes +BININT2: bytes +NONE: bytes +PERSID: bytes +BINPERSID: bytes +REDUCE: bytes +STRING: bytes +BINSTRING: bytes +SHORT_BINSTRING: bytes +UNICODE: bytes +BINUNICODE: bytes +APPEND: bytes +BUILD: bytes +GLOBAL: bytes +DICT: bytes +EMPTY_DICT: bytes +APPENDS: bytes +GET: bytes +BINGET: bytes +INST: bytes +LONG_BINGET: bytes +LIST: bytes +EMPTY_LIST: bytes +OBJ: bytes +PUT: bytes +BINPUT: bytes +LONG_BINPUT: bytes +SETITEM: bytes +TUPLE: bytes +EMPTY_TUPLE: bytes +SETITEMS: bytes +BINFLOAT: bytes + +TRUE: bytes +FALSE: bytes + +# protocol 2 +PROTO: bytes +NEWOBJ: bytes +EXT1: bytes +EXT2: bytes +EXT4: bytes +TUPLE1: bytes +TUPLE2: bytes +TUPLE3: bytes +NEWTRUE: bytes +NEWFALSE: bytes +LONG1: bytes +LONG4: bytes + +if sys.version_info >= (3, 0): + # protocol 3 + BINBYTES: bytes + SHORT_BINBYTES: bytes + +if sys.version_info >= (3, 4): + # protocol 4 + SHORT_BINUNICODE: bytes + BINUNICODE8: bytes + BINBYTES8: bytes + EMPTY_SET: bytes + ADDITEMS: bytes + FROZENSET: bytes + NEWOBJ_EX: bytes + STACK_GLOBAL: bytes + MEMOIZE: bytes + FRAME: bytes diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pickletools.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pickletools.pyi new file mode 100644 index 00000000..c0366469 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pickletools.pyi @@ -0,0 +1,145 @@ +# Stubs for pickletools (Python 2 and 3) +import sys +from typing import Any, Callable, IO, Iterator, List, MutableMapping, Optional, Text, Tuple, Type, Union + +_Reader = Callable[[IO[bytes]], Any] + +if sys.version_info >= (3, 0): + bytes_types: Tuple[Type[Any], ...] + +UP_TO_NEWLINE: int +TAKEN_FROM_ARGUMENT1: int +TAKEN_FROM_ARGUMENT4: int +if sys.version_info >= (3, 3): + TAKEN_FROM_ARGUMENT4U: int +if sys.version_info >= (3, 4): + TAKEN_FROM_ARGUMENT8U: int + +class ArgumentDescriptor(object): + name: str + n: int + reader: _Reader + doc: str + def __init__(self, name: str, n: int, reader: _Reader, doc: str) -> None: ... + +def read_uint1(f: IO[bytes]) -> int: ... +uint1: ArgumentDescriptor + +def read_uint2(f: IO[bytes]) -> int: ... +uint2: ArgumentDescriptor + +def read_int4(f: IO[bytes]) -> int: ... +int4: ArgumentDescriptor + +if sys.version_info >= (3, 3): + def read_uint4(f: IO[bytes]) -> int: ... + uint4: ArgumentDescriptor + +if sys.version_info >= (3, 5): + def read_uint8(f: IO[bytes]) -> int: ... + uint8: ArgumentDescriptor + +def read_stringnl(f: IO[bytes], decode: bool = ..., stripquotes: bool = ...) -> Union[bytes, Text]: ... +stringnl: ArgumentDescriptor + +def read_stringnl_noescape(f: IO[bytes]) -> str: ... +stringnl_noescape: ArgumentDescriptor + +def read_stringnl_noescape_pair(f: IO[bytes]) -> Text: ... +stringnl_noescape_pair: ArgumentDescriptor + +def read_string1(f: IO[bytes]) -> str: ... +string1: ArgumentDescriptor + +def read_string4(f: IO[bytes]) -> str: ... +string4: ArgumentDescriptor + +if sys.version_info >= (3, 3): + def read_bytes1(f: IO[bytes]) -> bytes: ... + bytes1: ArgumentDescriptor + + def read_bytes4(f: IO[bytes]) -> bytes: ... + bytes4: ArgumentDescriptor + +if sys.version_info >= (3, 4): + def read_bytes8(f: IO[bytes]) -> bytes: ... + bytes8: ArgumentDescriptor + +def read_unicodestringnl(f: IO[bytes]) -> Text: ... +unicodestringnl: ArgumentDescriptor + +if sys.version_info >= (3, 4): + def read_unicodestring1(f: IO[bytes]) -> Text: ... + unicodestring1: ArgumentDescriptor + +def read_unicodestring4(f: IO[bytes]) -> Text: ... +unicodestring4: ArgumentDescriptor + +if sys.version_info >= (3, 4): + def read_unicodestring8(f: IO[bytes]) -> Text: ... + unicodestring8: ArgumentDescriptor + +def read_decimalnl_short(f: IO[bytes]) -> int: ... +def read_decimalnl_long(f: IO[bytes]) -> int: ... +decimalnl_short: ArgumentDescriptor +decimalnl_long: ArgumentDescriptor + +def read_floatnl(f: IO[bytes]) -> float: ... +floatnl: ArgumentDescriptor + +def read_float8(f: IO[bytes]) -> float: ... +float8: ArgumentDescriptor + +def read_long1(f: IO[bytes]) -> int: ... +long1: ArgumentDescriptor + +def read_long4(f: IO[bytes]) -> int: ... +long4: ArgumentDescriptor + +class StackObject(object): + name: str + obtype: Union[Type[Any], Tuple[Type[Any], ...]] + doc: str + def __init__(self, name: str, obtype: Union[Type[Any], Tuple[Type[Any], ...]], doc: str) -> None: ... + +pyint: StackObject +pylong: StackObject +pyinteger_or_bool: StackObject +pybool: StackObject +pyfloat: StackObject +if sys.version_info >= (3, 4): + pybytes_or_str: StackObject +pystring: StackObject +if sys.version_info >= (3, 0): + pybytes: StackObject +pyunicode: StackObject +pynone: StackObject +pytuple: StackObject +pylist: StackObject +pydict: StackObject +if sys.version_info >= (3, 4): + pyset: StackObject + pyfrozenset: StackObject +anyobject: StackObject +markobject: StackObject +stackslice: StackObject + +class OpcodeInfo(object): + name: str + code: str + arg: Optional[ArgumentDescriptor] + stack_before: List[StackObject] + stack_after: List[StackObject] + proto: int + doc: str + def __init__(self, name: str, code: str, arg: Optional[ArgumentDescriptor], + stack_before: List[StackObject], stack_after: List[StackObject], proto: int, doc: str) -> None: ... + +opcodes: List[OpcodeInfo] + +def genops(pickle: Union[bytes, IO[bytes]]) -> Iterator[Tuple[OpcodeInfo, Optional[Any], Optional[int]]]: ... +def optimize(p: Union[bytes, IO[bytes]]) -> bytes: ... +if sys.version_info >= (3, 2): + def dis(pickle: Union[bytes, IO[bytes]], out: Optional[IO[str]] = ..., memo: Optional[MutableMapping[int, Any]] = ..., indentlevel: int = ..., annotate: int = ...) -> None: ... +else: + def dis(pickle: Union[bytes, IO[bytes]], out: Optional[IO[str]] = ..., memo: Optional[MutableMapping[int, Any]] = ..., indentlevel: int = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pkgutil.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pkgutil.pyi new file mode 100644 index 00000000..138a0f8b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pkgutil.pyi @@ -0,0 +1,38 @@ +# Stubs for pkgutil + +from typing import Any, Callable, Generator, IO, Iterable, Optional, Tuple, NamedTuple +import sys + +if sys.version_info >= (3,): + from importlib.abc import Loader +else: + Loader = Any + +if sys.version_info >= (3, 6): + class ModuleInfo(NamedTuple): + module_finder: Any + name: str + ispkg: bool + _YMFNI = Generator[ModuleInfo, None, None] +else: + _YMFNI = Generator[Tuple[Any, str, bool], None, None] + + +def extend_path(path: Iterable[str], name: str) -> Iterable[str]: ... + +class ImpImporter: + def __init__(self, dirname: Optional[str] = ...) -> None: ... + +class ImpLoader: + def __init__(self, fullname: str, file: IO[str], filename: str, + etc: Tuple[str, str, int]) -> None: ... + +def find_loader(fullname: str) -> Optional[Loader]: ... +def get_importer(path_item: str) -> Any: ... # TODO precise type +def get_loader(module_or_name: str) -> Loader: ... +def iter_importers(fullname: str = ...) -> Generator[Any, None, None]: ... # TODO precise type +def iter_modules(path: Optional[Iterable[str]] = ..., + prefix: str = ...) -> _YMFNI: ... # TODO precise type +def walk_packages(path: Optional[Iterable[str]] = ..., prefix: str = ..., + onerror: Optional[Callable[[str], None]] = ...) -> _YMFNI: ... +def get_data(package: str, resource: str) -> Optional[bytes]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/plistlib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/plistlib.pyi new file mode 100644 index 00000000..5b840980 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/plistlib.pyi @@ -0,0 +1,65 @@ +# Stubs for plistlib + +from typing import ( + Any, IO, Mapping, MutableMapping, Optional, Union, + Type, TypeVar, +) +from typing import Dict as DictT +import sys +if sys.version_info >= (3,): + from enum import Enum + + class PlistFormat(Enum): + FMT_XML: int + FMT_BINARY: int + FMT_XML = PlistFormat.FMT_XML + FMT_BINARY = PlistFormat.FMT_BINARY + +mm = MutableMapping[str, Any] +_D = TypeVar('_D', bound=mm) +if sys.version_info >= (3,): + _Path = str +else: + _Path = Union[str, unicode] + +if sys.version_info >= (3, 4): + def load(fp: IO[bytes], *, fmt: Optional[PlistFormat] = ..., + use_builtin_types: bool = ..., dict_type: Type[_D] = ...) -> _D: ... + def loads(data: bytes, *, fmt: Optional[PlistFormat] = ..., + use_builtin_types: bool = ..., dict_type: Type[_D] = ...) -> _D: ... + def dump(value: Mapping[str, Any], fp: IO[bytes], *, + fmt: PlistFormat = ..., sort_keys: bool = ..., + skipkeys: bool = ...) -> None: ... + def dumps(value: Mapping[str, Any], *, fmt: PlistFormat = ..., + skipkeys: bool = ..., sort_keys: bool = ...) -> bytes: ... + +def readPlist(pathOrFile: Union[_Path, IO[bytes]]) -> DictT[str, Any]: ... +def writePlist(value: Mapping[str, Any], pathOrFile: Union[_Path, IO[bytes]]) -> None: ... +def readPlistFromBytes(data: bytes) -> DictT[str, Any]: ... +def writePlistToBytes(value: Mapping[str, Any]) -> bytes: ... +if sys.version_info < (3,): + def readPlistFromResource(path: _Path, restype: str = ..., + resid: int = ...) -> DictT[str, Any]: ... + def writePlistToResource(rootObject: Mapping[str, Any], path: _Path, + restype: str = ..., + resid: int = ...) -> None: ... + def readPlistFromString(data: str) -> DictT[str, Any]: ... + def writePlistToString(rootObject: Mapping[str, Any]) -> str: ... + +if sys.version_info < (3, 7): + class Dict(DictT[str, Any]): + def __getattr__(self, attr: str) -> Any: ... + def __setattr__(self, attr: str, value: Any) -> None: ... + def __delattr__(self, attr: str) -> None: ... + +class Data: + data: bytes + def __init__(self, data: bytes) -> None: ... + +if sys.version_info >= (3, 8): + class UID: + data: int + def __init__(self, data: int) -> None: ... + def __index__(self) -> int: ... + def __reduce__(self) -> Any: ... + def __hash__(self) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/poplib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/poplib.pyi new file mode 100644 index 00000000..d2b7dab6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/poplib.pyi @@ -0,0 +1,77 @@ +# Stubs for poplib (Python 2 and 3) + +import socket +import ssl +import sys +from typing import ( + Any, BinaryIO, Dict, List, NoReturn, Optional, overload, Pattern, Text, + Tuple, +) + +_LongResp = Tuple[bytes, List[bytes], int] + +class error_proto(Exception): ... + +POP3_PORT: int +POP3_SSL_PORT: int +CR: bytes +LF: bytes +CRLF: bytes + + +class POP3: + if sys.version_info >= (3, 0): + encoding: Text + + host: Text + port: int + sock: socket.socket + file: BinaryIO + welcome: bytes + + def __init__(self, host: Text, port: int = ..., timeout: float = ...) -> None: ... + def getwelcome(self) -> bytes: ... + def set_debuglevel(self, level: int) -> None: ... + def user(self, user: Text) -> bytes: ... + def pass_(self, pswd: Text) -> bytes: ... + def stat(self) -> Tuple[int, int]: ... + def list(self, which: Optional[Any] = ...) -> _LongResp: ... + def retr(self, which: Any) -> _LongResp: ... + def dele(self, which: Any) -> bytes: ... + def noop(self) -> bytes: ... + def rset(self) -> bytes: ... + def quit(self) -> bytes: ... + def close(self) -> None: ... + def rpop(self, user: Text) -> bytes: ... + + timestamp: Pattern[Text] + + if sys.version_info < (3, 0): + def apop(self, user: Text, secret: Text) -> bytes: ... + else: + def apop(self, user: Text, password: Text) -> bytes: ... + def top(self, which: Any, howmuch: int) -> _LongResp: ... + + @overload + def uidl(self) -> _LongResp: ... + @overload + def uidl(self, which: Any) -> bytes: ... + + if sys.version_info >= (3, 5): + def utf8(self) -> bytes: ... + if sys.version_info >= (3, 4): + def capa(self) -> Dict[Text, List[Text]]: ... + def stls(self, context: Optional[ssl.SSLContext] = ...) -> bytes: ... + + +class POP3_SSL(POP3): + if sys.version_info >= (3, 0): + def __init__(self, host: Text, port: int = ..., keyfile: Optional[Text] = ..., certfile: Optional[Text] = ..., + timeout: float = ..., context: Optional[ssl.SSLContext] = ...) -> None: ... + else: + def __init__(self, host: Text, port: int = ..., keyfile: Optional[Text] = ..., certfile: Optional[Text] = ..., + timeout: float = ...) -> None: ... + + if sys.version_info >= (3, 4): + # "context" is actually the last argument, but that breaks LSP and it doesn't really matter because all the arguments are ignored + def stls(self, context: Any = ..., keyfile: Any = ..., certfile: Any = ...) -> bytes: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/posixpath.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/posixpath.pyi new file mode 100644 index 00000000..42409c0e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/posixpath.pyi @@ -0,0 +1,177 @@ +# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! +# Stubs for os.path +# Ron Murawski + +import os +import sys +from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional + +_T = TypeVar('_T') + +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PathType = Union[bytes, Text, _PathLike] + _StrPath = Union[Text, _PathLike[Text]] + _BytesPath = Union[bytes, _PathLike[bytes]] +else: + _PathType = Union[bytes, Text] + _StrPath = Text + _BytesPath = bytes + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(path: AnyStr) -> AnyStr: ... + @overload + def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(path: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(path: AnyStr) -> AnyStr: ... + @overload + def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + @overload + def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(filename: AnyStr) -> AnyStr: ... + +else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(path: AnyStr) -> AnyStr: ... + def dirname(path: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(path: AnyStr) -> AnyStr: ... + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + def realpath(path: AnyStr) -> AnyStr: ... + else: + def realpath(filename: AnyStr) -> AnyStr: ... + +if sys.version_info >= (3, 6): + # In reality it returns str for sequences of _StrPath and bytes for sequences + # of _BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[_PathType]) -> Any: ... +elif sys.version_info >= (3, 5): + def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes +# So, fall back to Any +def commonprefix(list: Sequence[_PathType]) -> Any: ... + +if sys.version_info >= (3, 3): + def exists(path: Union[_PathType, int]) -> bool: ... +else: + def exists(path: _PathType) -> bool: ... +def lexists(path: _PathType) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(path: _PathType) -> float: ... +def getmtime(path: _PathType) -> float: ... +def getctime(path: _PathType) -> float: ... + +def getsize(path: _PathType) -> int: ... +def isabs(path: _PathType) -> bool: ... +def isfile(path: _PathType) -> bool: ... +def isdir(path: _PathType) -> bool: ... +def islink(path: _PathType) -> bool: ... +def ismount(path: _PathType) -> bool: ... + +if sys.version_info < (3, 0): + # Make sure signatures are disjunct, and allow combinations of bytes and unicode. + # (Since Python 2 allows that, too) + # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in + # a type error. + @overload + def join(__p1: bytes, *p: bytes) -> bytes: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: Text, *p: _PathType) -> Text: ... +elif sys.version_info >= (3, 6): + # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. + @overload + def join(path: _StrPath, *paths: _StrPath) -> Text: ... + @overload + def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... +else: + def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... + +@overload +def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... + +def samefile(path1: _PathType, path2: _PathType) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +else: + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.platform == 'win32': + def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated + +if sys.version_info < (3,): + def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pprint.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pprint.pyi new file mode 100644 index 00000000..3b15d731 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pprint.pyi @@ -0,0 +1,40 @@ +# Stubs for pprint + +# Based on http://docs.python.org/2/library/pprint.html +# Based on http://docs.python.org/3/library/pprint.html + +import sys +from typing import Any, Dict, Tuple, IO, Optional + +if sys.version_info >= (3, 4): + def pformat(o: object, indent: int = ..., width: int = ..., + depth: Optional[int] = ..., compact: bool = ...) -> str: ... +else: + def pformat(o: object, indent: int = ..., width: int = ..., + depth: Optional[int] = ...) -> str: ... + +if sys.version_info >= (3, 4): + def pprint(o: object, stream: Optional[IO[str]] = ..., indent: int = ..., width: int = ..., + depth: Optional[int] = ..., compact: bool = ...) -> None: ... +else: + def pprint(o: object, stream: Optional[IO[str]] = ..., indent: int = ..., width: int = ..., + depth: Optional[int] = ...) -> None: ... + +def isreadable(o: object) -> bool: ... +def isrecursive(o: object) -> bool: ... +def saferepr(o: object) -> str: ... + +class PrettyPrinter: + if sys.version_info >= (3, 4): + def __init__(self, indent: int = ..., width: int = ..., depth: Optional[int] = ..., + stream: Optional[IO[str]] = ..., compact: bool = ...) -> None: ... + else: + def __init__(self, indent: int = ..., width: int = ..., depth: Optional[int] = ..., + stream: Optional[IO[str]] = ...) -> None: ... + + def pformat(self, o: object) -> str: ... + def pprint(self, o: object) -> None: ... + def isreadable(self, o: object) -> bool: ... + def isrecursive(self, o: object) -> bool: ... + def format(self, o: object, context: Dict[int, Any], maxlevels: int, + level: int) -> Tuple[str, bool, bool]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/profile.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/profile.pyi new file mode 100644 index 00000000..b511cbc2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/profile.pyi @@ -0,0 +1,27 @@ +import os +import sys +from typing import Any, Callable, Dict, Optional, Text, TypeVar, Union + +def run(statement: str, filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ... +def runctx(statement: str, globals: Dict[str, Any], locals: Dict[str, Any], filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ... + +_SelfT = TypeVar('_SelfT', bound=Profile) +_T = TypeVar('_T') +if sys.version_info >= (3, 6): + _Path = Union[bytes, Text, os.PathLike[Any]] +else: + _Path = Union[bytes, Text] + +class Profile: + def __init__(self, timer: Optional[Callable[[], float]] = ..., bias: Optional[int] = ...) -> None: ... + def set_cmd(self, cmd: str) -> None: ... + def simulate_call(self, name: str) -> None: ... + def simulate_cmd_complete(self) -> None: ... + def print_stats(self, sort: Union[str, int] = ...) -> None: ... + def dump_stats(self, file: _Path) -> None: ... + def create_stats(self) -> None: ... + def snapshot_stats(self) -> None: ... + def run(self: _SelfT, cmd: str) -> _SelfT: ... + def runctx(self: _SelfT, cmd: str, globals: Dict[str, Any], locals: Dict[str, Any]) -> _SelfT: ... + def runcall(self, func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ... + def calibrate(self, m: int, verbose: int = ...) -> float: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pstats.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pstats.pyi new file mode 100644 index 00000000..5c1bb2a3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pstats.pyi @@ -0,0 +1,39 @@ +from profile import Profile +from cProfile import Profile as _cProfile +import os +import sys +from typing import Any, Dict, IO, Iterable, List, Text, Tuple, TypeVar, Union, overload + +_Selector = Union[str, float, int] +_T = TypeVar('_T', bound=Stats) +if sys.version_info >= (3, 6): + _Path = Union[bytes, Text, os.PathLike[Any]] +else: + _Path = Union[bytes, Text] + +class Stats: + def __init__(self: _T, __arg: Union[None, str, Text, Profile, _cProfile] = ..., + *args: Union[None, str, Text, Profile, _cProfile, _T], + stream: IO[Any] = ...) -> None: ... + def init(self, arg: Union[None, str, Text, Profile, _cProfile]) -> None: ... + def load_stats(self, arg: Union[None, str, Text, Profile, _cProfile]) -> None: ... + def get_top_level_stats(self) -> None: ... + def add(self: _T, *arg_list: Union[None, str, Text, Profile, _cProfile, _T]) -> _T: ... + def dump_stats(self, filename: _Path) -> None: ... + def get_sort_arg_defs(self) -> Dict[str, Tuple[Tuple[Tuple[int, int], ...], str]]: ... + @overload + def sort_stats(self: _T, field: int) -> _T: ... + @overload + def sort_stats(self: _T, *field: str) -> _T: ... + def reverse_order(self: _T) -> _T: ... + def strip_dirs(self: _T) -> _T: ... + def calc_callees(self) -> None: ... + def eval_print_amount(self, sel: _Selector, list: List[str], msg: str) -> Tuple[List[str], str]: ... + def get_print_list(self, sel_list: Iterable[_Selector]) -> Tuple[int, List[str]]: ... + def print_stats(self: _T, *amount: _Selector) -> _T: ... + def print_callees(self: _T, *amount: _Selector) -> _T: ... + def print_callers(self: _T, *amount: _Selector) -> _T: ... + def print_call_heading(self, name_size: int, column_title: str) -> None: ... + def print_call_line(self, name_size: int, source: str, call_dict: Dict[str, Any], arrow: str = ...) -> None: ... + def print_title(self) -> None: ... + def print_line(self, func: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pty.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pty.pyi new file mode 100644 index 00000000..3931bb0a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pty.pyi @@ -0,0 +1,20 @@ +# Stubs for pty (Python 2 and 3) +import sys +from typing import Callable, Iterable, Tuple, Union + +_Reader = Callable[[int], bytes] + +STDIN_FILENO: int +STDOUT_FILENO: int +STDERR_FILENO: int + +CHILD: int + +def openpty() -> Tuple[int, int]: ... +def master_open() -> Tuple[int, str]: ... +def slave_open(tty_name: str) -> int: ... +def fork() -> Tuple[int, int]: ... +if sys.version_info >= (3, 4): + def spawn(argv: Union[str, Iterable[str]], master_read: _Reader = ..., stdin_read: _Reader = ...) -> int: ... +else: + def spawn(argv: Union[str, Iterable[str]], master_read: _Reader = ..., stdin_read: _Reader = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pwd.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pwd.pyi new file mode 100644 index 00000000..ea584520 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pwd.pyi @@ -0,0 +1,14 @@ +from typing import List, Tuple + +class struct_passwd(Tuple[str, str, int, int, str, str, str]): + pw_name: str + pw_passwd: str + pw_uid: int + pw_gid: int + pw_gecos: str + pw_dir: str + pw_shell: str + +def getpwall() -> List[struct_passwd]: ... +def getpwuid(uid: int) -> struct_passwd: ... +def getpwnam(name: str) -> struct_passwd: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/py_compile.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/py_compile.pyi new file mode 100644 index 00000000..4b57f0d3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/py_compile.pyi @@ -0,0 +1,28 @@ +# Stubs for py_compile (Python 2 and 3) +import enum +import sys + +from typing import Optional, List, Text, AnyStr, Union, Type + +_EitherStr = Union[bytes, Text] + +class PyCompileError(Exception): + exc_type_name: str + exc_value: BaseException + file: str + msg: str + def __init__(self, exc_type: Type[BaseException], exc_value: BaseException, file: str, msg: str = ...) -> None: ... + +if sys.version_info >= (3, 7): + class PycInvalidationMode(enum.Enum): + TIMESTAMP: int = ... + CHECKED_HASH: int = ... + UNCHECKED_HASH: int = ... + def _get_default_invalidation_mode() -> PycInvalidationMode: ... + def compile(file: AnyStr, cfile: Optional[AnyStr] = ..., dfile: Optional[AnyStr] = ..., doraise: bool = ..., optimize: int = ..., invalidation_mode: Optional[PycInvalidationMode] = ...) -> Optional[AnyStr]: ... +elif sys.version_info >= (3, 2): + def compile(file: AnyStr, cfile: Optional[AnyStr] = ..., dfile: Optional[AnyStr] = ..., doraise: bool = ..., optimize: int = ...) -> Optional[AnyStr]: ... +else: + def compile(file: _EitherStr, cfile: Optional[_EitherStr] = ..., dfile: Optional[_EitherStr] = ..., doraise: bool = ...) -> None: ... + +def main(args: Optional[List[Text]] = ...) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pyclbr.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pyclbr.pyi new file mode 100644 index 00000000..efecf329 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pyclbr.pyi @@ -0,0 +1,40 @@ +from typing import List, Union, Sequence, Optional, Dict + + +class Class: + module: str + name: str + super: Optional[List[Union[Class, str]]] + methods: Dict[str, int] + file: int + lineno: int + + def __init__(self, + module: str, + name: str, + super: Optional[List[Union[Class, str]]], + file: str, + lineno: int) -> None: ... + + +class Function: + module: str + name: str + file: int + lineno: int + + def __init__(self, + module: str, + name: str, + file: str, + lineno: int) -> None: ... + + +def readmodule(module: str, + path: Optional[Sequence[str]] = ... + ) -> Dict[str, Class]: ... + + +def readmodule_ex(module: str, + path: Optional[Sequence[str]] = ... + ) -> Dict[str, Union[Class, Function, List[str]]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pydoc.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pydoc.pyi new file mode 100644 index 00000000..6a238505 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pydoc.pyi @@ -0,0 +1,180 @@ +import sys +from typing import Any, AnyStr, Callable, Container, Dict, IO, List, Mapping, MutableMapping, NoReturn, Optional, Text, Tuple, Type, Union +from types import FunctionType, MethodType, ModuleType, TracebackType +if sys.version_info >= (3,): + from reprlib import Repr +else: + from repr import Repr + +# the return type of sys.exc_info(), used by ErrorDuringImport.__init__ +_Exc_Info = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]] + +__author__: str +__date__: str +__version__: str +__credits__: str + +def pathdirs() -> List[str]: ... +def getdoc(object: object) -> Text: ... +def splitdoc(doc: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +def classname(object: object, modname: str) -> str: ... +def isdata(object: object) -> bool: ... +def replace(text: AnyStr, *pairs: AnyStr) -> AnyStr: ... +def cram(text: str, maxlen: int) -> str: ... +def stripid(text: str) -> str: ... +def allmethods(cl: type) -> MutableMapping[str, MethodType]: ... +def visiblename(name: str, all: Optional[Container[str]] = ..., obj: Optional[object] = ...) -> bool: ... +def classify_class_attrs(object: object) -> List[Tuple[str, str, type, str]]: ... + +def ispackage(path: str) -> bool: ... +def source_synopsis(file: IO[AnyStr]) -> Optional[AnyStr]: ... +def synopsis(filename: str, cache: MutableMapping[str, Tuple[int, str]] = ...) -> Optional[str]: ... + +class ErrorDuringImport(Exception): + filename: str + exc: Optional[Type[BaseException]] + value: Optional[BaseException] + tb: Optional[TracebackType] + def __init__(self, filename: str, exc_info: _Exc_Info) -> None: ... + +def importfile(path: str) -> ModuleType: ... +def safeimport(path: str, forceload: bool = ..., cache: MutableMapping[str, ModuleType] = ...) -> ModuleType: ... + +class Doc: + def document(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def fail(self, object: object, name: Optional[str] = ..., *args: Any) -> NoReturn: ... + def docmodule(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def docclass(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def docroutine(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def docother(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def docproperty(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def docdata(self, object: object, name: Optional[str] = ..., *args: Any) -> str: ... + def getdocloc(self, object: object) -> Optional[str]: ... + +class HTMLRepr(Repr): + maxlist: int + maxtuple: int + maxdict: int + maxstring: int + maxother: int + def __init__(self) -> None: ... + def escape(self, text: str) -> str: ... + def repr(self, object: object) -> str: ... + def repr1(self, x: object, level: complex) -> str: ... + def repr_string(self, x: Text, level: complex) -> str: ... + def repr_str(self, x: Text, level: complex) -> str: ... + def repr_instance(self, x: object, level: complex) -> str: ... + def repr_unicode(self, x: AnyStr, level: complex) -> str: ... + +class HTMLDoc(Doc): + def repr(self, object: object) -> str: ... + def escape(self, test: str) -> str: ... + def page(self, title: str, contents: str) -> str: ... + def heading(self, title: str, fgcol: str, bgcol: str, extras: str = ...) -> str: ... + def section(self, title: str, fgcol: str, bgcol: str, contents: str, width: int = ..., prelude: str = ..., marginalia: Optional[str] = ..., gap: str = ...) -> str: ... + def bigsection(self, title: str, *args) -> str: ... + def preformat(self, text: str) -> str: ... + def multicolumn(self, list: List[Any], format: Callable[[Any], str], cols: int = ...) -> str: ... + def grey(self, text: str) -> str: ... + def namelink(self, name: str, *dicts: MutableMapping[str, str]) -> str: ... + def classlink(self, object: object, modname: str) -> str: ... + def modulelink(self, object: object) -> str: ... + def modpkglink(self, data: Tuple[str, str, bool, bool]) -> str: ... + def markup(self, text: str, escape: Optional[Callable[[str], str]] = ..., funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., methods: Mapping[str, str] = ...) -> str: ... + def formattree(self, tree: List[Union[Tuple[type, Tuple[type, ...]], List[Any]]], modname: str, parent: Optional[type] = ...) -> str: ... + def docmodule(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., *ignored) -> str: ... + def docclass(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., *ignored) -> str: ... + def formatvalue(self, object: object) -> str: ... + def docroutine(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., methods: Mapping[str, str] = ..., cl: Optional[type] = ..., *ignored) -> str: ... + def docproperty(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., cl: Optional[Any] = ..., *ignored) -> str: ... + def docother(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., *ignored) -> str: ... + def docdata(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., cl: Optional[Any] = ..., *ignored) -> str: ... + def index(self, dir: str, shadowed: Optional[MutableMapping[str, bool]] = ...) -> str: ... + +class TextRepr(Repr): + maxlist: int + maxtuple: int + maxdict: int + maxstring: int + maxother: int + def __init__(self) -> None: ... + def repr1(self, x: object, level: complex) -> str: ... + def repr_string(self, x: str, level: complex) -> str: ... + def repr_str(self, x: str, level: complex) -> str: ... + def repr_instance(self, x: object, level: complex) -> str: ... + +class TextDoc(Doc): + def repr(self, object: object) -> str: ... + def bold(self, text: str) -> str: ... + def indent(self, text: str, prefix: str = ...) -> str: ... + def section(self, title: str, contents: str) -> str: ... + def formattree(self, tree: List[Union[Tuple[type, Tuple[type, ...]], List[Any]]], modname: str, parent: Optional[type] = ..., prefix: str = ...) -> str: ... + def docmodule(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., *ignored) -> str: ... + def docclass(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., *ignored) -> str: ... + def formatvalue(self, object: object) -> str: ... + def docroutine(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., cl: Optional[Any] = ..., *ignored) -> str: ... + def docproperty(self, object: object, name: Optional[str] = ..., mod: Optional[Any] = ..., cl: Optional[Any] = ..., *ignored) -> str: ... + def docdata(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., cl: Optional[Any] = ..., *ignored) -> str: ... + def docother(self, object: object, name: Optional[str] = ..., mod: Optional[str] = ..., parent: Optional[str] = ..., maxlen: Optional[int] = ..., doc: Optional[Any] = ..., *ignored) -> str: ... + +def pager(text: str) -> None: ... +def getpager() -> Callable[[str], None]: ... +def plain(text: str) -> str: ... +def pipepager(text: str, cmd: str) -> None: ... +def tempfilepager(text: str, cmd: str) -> None: ... +def ttypager(text: str) -> None: ... +def plainpager(text: str) -> None: ... +def describe(thing: Any) -> str: ... +def locate(path: str, forceload: bool = ...) -> object: ... + +text: TextDoc +html: HTMLDoc + +class _OldStyleClass: ... + +def resolve(thing: Union[str, object], forceload: bool = ...) -> Optional[Tuple[object, str]]: ... +def render_doc(thing: Union[str, object], title: str = ..., forceload: bool = ...) -> str: ... +def doc(thing: Union[str, object], title: str = ..., forceload: bool = ...) -> None: ... +def writedoc(thing: Union[str, object], forceload: bool = ...) -> None: ... +def writedocs(dir: str, pkgpath: str = ..., done: Optional[Any] = ...) -> None: ... + +class Helper: + keywords: Dict[str, Union[str, Tuple[str, str]]] + symbols: Dict[str, str] + topics: Dict[str, Union[str, Tuple[str, ...]]] + def __init__(self, input: Optional[IO[str]] = ..., output: Optional[IO[str]] = ...) -> None: ... + input: IO[str] + output: IO[str] + def __call__(self, request: Union[str, Helper, object] = ...) -> None: ... + def interact(self) -> None: ... + def getline(self, prompt: str) -> str: ... + def help(self, request: Any) -> None: ... + def intro(self) -> None: ... + def list(self, items: List[str], columns: int = ..., width: int = ...) -> None: ... + def listkeywords(self) -> None: ... + def listsymbols(self) -> None: ... + def listtopics(self) -> None: ... + def showtopic(self, topic: str, more_xrefs: str = ...) -> None: ... + def showsymbol(self, symbol: str) -> None: ... + def listmodules(self, key: str = ...) -> None: ... + +help: Helper + +# See Python issue #11182: "remove the unused and undocumented pydoc.Scanner class" +# class Scanner: +# roots = ... # type: Any +# state = ... # type: Any +# children = ... # type: Any +# descendp = ... # type: Any +# def __init__(self, roots, children, descendp) -> None: ... +# def next(self): ... + +class ModuleScanner: + quit: bool + def run(self, callback: Callable[[Optional[str], str, str], None], key: Optional[Any] = ..., completer: Optional[Callable[[], None]] = ..., onerror: Optional[Callable[[str], None]] = ...) -> None: ... + +def apropos(key: str) -> None: ... +def serve(port: int, callback: Optional[Callable[[Any], None]] = ..., completer: Optional[Callable[[], None]] = ...) -> None: ... +def gui() -> None: ... +def ispath(x: Any) -> bool: ... +def cli() -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pyexpat/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pyexpat/__init__.pyi new file mode 100644 index 00000000..670e5610 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pyexpat/__init__.pyi @@ -0,0 +1,75 @@ +from typing import List, Tuple, Optional, Callable, Any, Protocol, Union, Dict, Text + +import pyexpat.errors as errors +import pyexpat.model as model + +EXPAT_VERSION: str # undocumented +version_info: Tuple[int, int, int] # undocumented +native_encoding: str # undocumented +features: List[Tuple[str, int]] # undocumented + +class ExpatError(Exception): + code: int + lineno: int + offset: int + +error = ExpatError + +class _Reader(Protocol): + def read(self, length: int) -> bytes: ... + +XML_PARAM_ENTITY_PARSING_NEVER: int +XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE: int +XML_PARAM_ENTITY_PARSING_ALWAYS: int + +_Model = Tuple[int, int, Optional[str], tuple] + +class XMLParserType(object): + def Parse(self, data: Union[Text, bytes], isfinal: bool = ...) -> int: ... + def ParseFile(self, file: _Reader) -> int: ... + def SetBase(self, base: Text) -> None: ... + def GetBase(self) -> Optional[str]: ... + def GetInputContext(self) -> Optional[bytes]: ... + def ExternalEntityParserCreate(self, context: Optional[Text], encoding: Text = ...) -> XMLParserType: ... + def SetParamEntityParsing(self, flag: int) -> int: ... + def UseForeignDTD(self, flag: bool = ...) -> None: ... + buffer_size: int + buffer_text: bool + buffer_used: int + namespace_prefixes: bool # undocumented + ordered_attributes: bool + specified_attributes: bool + ErrorByteIndex: int + ErrorCode: int + ErrorColumnNumber: int + ErrorLineNumber: int + CurrentByteIndex: int + CurrentColumnNumber: int + CurrentLineNumber: int + XmlDeclHandler: Optional[Callable[[str, Optional[str], int], Any]] + StartDoctypeDeclHandler: Optional[Callable[[str, Optional[str], Optional[str], bool], Any]] + EndDoctypeDeclHandler: Optional[Callable[[], Any]] + ElementDeclHandler: Optional[Callable[[str, _Model], Any]] + AttlistDeclHandler: Optional[Callable[[str, str, str, Optional[str], bool], Any]] + StartElementHandler: Optional[Union[ + Callable[[str, Dict[str, str]], Any], + Callable[[str, List[str]], Any], + Callable[[str, Union[Dict[str, str]], List[str]], Any]]] + EndElementHandler: Optional[Callable[[str], Any]] + ProcessingInstructionHandler: Optional[Callable[[str, str], Any]] + CharacterDataHandler: Optional[Callable[[str], Any]] + UnparsedEntityDeclHandler: Optional[Callable[[str, Optional[str], str, Optional[str], str], Any]] + EntityDeclHandler: Optional[Callable[[str, bool, Optional[str], Optional[str], str, Optional[str], Optional[str]], Any]] + NotationDeclHandler: Optional[Callable[[str, Optional[str], str, Optional[str]], Any]] + StartNamespaceDeclHandler: Optional[Callable[[str, str], Any]] + EndNamespaceDeclHandler: Optional[Callable[[str], Any]] + CommentHandler: Optional[Callable[[str], Any]] + StartCdataSectionHandler: Optional[Callable[[], Any]] + EndCdataSectionHandler: Optional[Callable[[], Any]] + DefaultHandler: Optional[Callable[[str], Any]] + DefaultHandlerExpand: Optional[Callable[[str], Any]] + NotStandaloneHandler: Optional[Callable[[], int]] + ExternalEntityRefHandler: Optional[Callable[[str, Optional[str], Optional[str], Optional[str]], int]] + +def ErrorString(errno: int) -> str: ... +def ParserCreate(encoding: Optional[Text] = ..., namespace_separator: Optional[Text] = ...) -> XMLParserType: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pyexpat/errors.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pyexpat/errors.pyi new file mode 100644 index 00000000..6cde43e3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pyexpat/errors.pyi @@ -0,0 +1,44 @@ +import sys +from typing import Dict + +if sys.version_info >= (3, 2): + codes: Dict[str, int] + messages: Dict[int, str] + +XML_ERROR_ABORTED: str +XML_ERROR_ASYNC_ENTITY: str +XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF: str +XML_ERROR_BAD_CHAR_REF: str +XML_ERROR_BINARY_ENTITY_REF: str +XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING: str +XML_ERROR_DUPLICATE_ATTRIBUTE: str +XML_ERROR_ENTITY_DECLARED_IN_PE: str +XML_ERROR_EXTERNAL_ENTITY_HANDLING: str +XML_ERROR_FEATURE_REQUIRES_XML_DTD: str +XML_ERROR_FINISHED: str +XML_ERROR_INCOMPLETE_PE: str +XML_ERROR_INCORRECT_ENCODING: str +XML_ERROR_INVALID_TOKEN: str +XML_ERROR_JUNK_AFTER_DOC_ELEMENT: str +XML_ERROR_MISPLACED_XML_PI: str +XML_ERROR_NOT_STANDALONE: str +XML_ERROR_NOT_SUSPENDED: str +XML_ERROR_NO_ELEMENTS: str +XML_ERROR_NO_MEMORY: str +XML_ERROR_PARAM_ENTITY_REF: str +XML_ERROR_PARTIAL_CHAR: str +XML_ERROR_PUBLICID: str +XML_ERROR_RECURSIVE_ENTITY_REF: str +XML_ERROR_SUSPENDED: str +XML_ERROR_SUSPEND_PE: str +XML_ERROR_SYNTAX: str +XML_ERROR_TAG_MISMATCH: str +XML_ERROR_TEXT_DECL: str +XML_ERROR_UNBOUND_PREFIX: str +XML_ERROR_UNCLOSED_CDATA_SECTION: str +XML_ERROR_UNCLOSED_TOKEN: str +XML_ERROR_UNDECLARING_PREFIX: str +XML_ERROR_UNDEFINED_ENTITY: str +XML_ERROR_UNEXPECTED_STATE: str +XML_ERROR_UNKNOWN_ENCODING: str +XML_ERROR_XML_DECL: str diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pyexpat/model.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pyexpat/model.pyi new file mode 100644 index 00000000..f357cf65 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/pyexpat/model.pyi @@ -0,0 +1,11 @@ +XML_CTYPE_ANY: int +XML_CTYPE_CHOICE: int +XML_CTYPE_EMPTY: int +XML_CTYPE_MIXED: int +XML_CTYPE_NAME: int +XML_CTYPE_SEQ: int + +XML_CQUANT_NONE: int +XML_CQUANT_OPT: int +XML_CQUANT_PLUS: int +XML_CQUANT_REP: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/quopri.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/quopri.pyi new file mode 100644 index 00000000..2823f8c4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/quopri.pyi @@ -0,0 +1,8 @@ +# Stubs for quopri (Python 2 and 3) + +from typing import BinaryIO + +def encode(input: BinaryIO, output: BinaryIO, quotetabs: int, header: int = ...) -> None: ... +def encodestring(s: bytes, quotetabs: int = ..., header: int = ...) -> bytes: ... +def decode(input: BinaryIO, output: BinaryIO, header: int = ...) -> None: ... +def decodestring(s: bytes, header: int = ...) -> bytes: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/readline.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/readline.pyi new file mode 100644 index 00000000..aff2debf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/readline.pyi @@ -0,0 +1,41 @@ +# Stubs for readline + +from typing import Callable, Optional, Sequence +import sys + +_CompleterT = Optional[Callable[[str, int], Optional[str]]] +_CompDispT = Optional[Callable[[str, Sequence[str], int], None]] + + +def parse_and_bind(string: str) -> None: ... +def read_init_file(filename: str = ...) -> None: ... + +def get_line_buffer() -> str: ... +def insert_text(string: str) -> None: ... +def redisplay() -> None: ... + +def read_history_file(filename: str = ...) -> None: ... +def write_history_file(filename: str = ...) -> None: ... +if sys.version_info >= (3, 5): + def append_history_file(nelements: int, filename: str = ...) -> None: ... +def get_history_length() -> int: ... +def set_history_length(length: int) -> None: ... + +def clear_history() -> None: ... +def get_current_history_length() -> int: ... +def get_history_item(index: int) -> str: ... +def remove_history_item(pos: int) -> None: ... +def replace_history_item(pos: int, line: str) -> None: ... +def add_history(string: str) -> None: ... + +def set_startup_hook(function: Optional[Callable[[], None]] = ...) -> None: ... +def set_pre_input_hook(function: Optional[Callable[[], None]] = ...) -> None: ... + +def set_completer(function: _CompleterT = ...) -> None: ... +def get_completer() -> _CompleterT: ... +def get_completion_type() -> int: ... +def get_begidx() -> int: ... +def get_endidx() -> int: ... +def set_completer_delims(string: str) -> None: ... +def get_completer_delims() -> str: ... +def set_completion_display_matches_hook(function: _CompDispT = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/rlcompleter.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/rlcompleter.pyi new file mode 100644 index 00000000..3db9d0c4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/rlcompleter.pyi @@ -0,0 +1,14 @@ +# Stubs for rlcompleter + +from typing import Any, Dict, Optional, Union +import sys + +if sys.version_info >= (3,): + _Text = str +else: + _Text = Union[str, unicode] + + +class Completer: + def __init__(self, namespace: Optional[Dict[str, Any]] = ...) -> None: ... + def complete(self, text: _Text, state: int) -> Optional[str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sched.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sched.pyi new file mode 100644 index 00000000..6a820c83 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sched.pyi @@ -0,0 +1,26 @@ +import sys +from typing import Any, Callable, Dict, List, NamedTuple, Optional, Text, Tuple + +class Event(NamedTuple): + time: float + priority: Any + action: Callable[..., Any] + argument: Tuple[Any, ...] + kwargs: Dict[Text, Any] + +class scheduler: + if sys.version_info >= (3, 3): + def __init__(self, timefunc: Callable[[], float] = ..., delayfunc: Callable[[float], None] = ...) -> None: ... + def enterabs(self, time: float, priority: Any, action: Callable[..., Any], argument: Tuple[Any, ...] = ..., kwargs: Dict[str, Any] = ...) -> Event: ... + def enter(self, delay: float, priority: Any, action: Callable[..., Any], argument: Tuple[Any, ...] = ..., kwargs: Dict[str, Any] = ...) -> Event: ... + def run(self, blocking: bool = ...) -> Optional[float]: ... + else: + def __init__(self, timefunc: Callable[[], float], delayfunc: Callable[[float], None]) -> None: ... + def enterabs(self, time: float, priority: Any, action: Callable[..., Any], argument: Tuple[Any, ...]) -> Event: ... + def enter(self, delay: float, priority: Any, action: Callable[..., Any], argument: Tuple[Any, ...]) -> Event: ... + def run(self) -> None: ... + + def cancel(self, event: Event) -> None: ... + def empty(self) -> bool: ... + @property + def queue(self) -> List[Event]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/select.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/select.pyi new file mode 100644 index 00000000..6387f52c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/select.pyi @@ -0,0 +1,138 @@ +import sys +from typing import Any, Iterable, List, Optional, Protocol, Tuple, Union + +class _HasFileno(Protocol): + def fileno(self) -> int: ... + +_FileDescriptor = Union[int, _HasFileno] + +EPOLLERR: int +EPOLLET: int +EPOLLHUP: int +EPOLLIN: int +EPOLLMSG: int +EPOLLONESHOT: int +EPOLLOUT: int +EPOLLPRI: int +EPOLLRDBAND: int +EPOLLRDNORM: int +EPOLLWRBAND: int +EPOLLWRNORM: int +EPOLL_RDHUP: int +KQ_EV_ADD: int +KQ_EV_CLEAR: int +KQ_EV_DELETE: int +KQ_EV_DISABLE: int +KQ_EV_ENABLE: int +KQ_EV_EOF: int +KQ_EV_ERROR: int +KQ_EV_FLAG1: int +KQ_EV_ONESHOT: int +KQ_EV_SYSFLAGS: int +KQ_FILTER_AIO: int +KQ_FILTER_NETDEV: int +KQ_FILTER_PROC: int +KQ_FILTER_READ: int +KQ_FILTER_SIGNAL: int +KQ_FILTER_TIMER: int +KQ_FILTER_VNODE: int +KQ_FILTER_WRITE: int +KQ_NOTE_ATTRIB: int +KQ_NOTE_CHILD: int +KQ_NOTE_DELETE: int +KQ_NOTE_EXEC: int +KQ_NOTE_EXIT: int +KQ_NOTE_EXTEND: int +KQ_NOTE_FORK: int +KQ_NOTE_LINK: int +KQ_NOTE_LINKDOWN: int +KQ_NOTE_LINKINV: int +KQ_NOTE_LINKUP: int +KQ_NOTE_LOWAT: int +KQ_NOTE_PCTRLMASK: int +KQ_NOTE_PDATAMASK: int +KQ_NOTE_RENAME: int +KQ_NOTE_REVOKE: int +KQ_NOTE_TRACK: int +KQ_NOTE_TRACKERR: int +KQ_NOTE_WRITE: int +PIPE_BUF: int +POLLERR: int +POLLHUP: int +POLLIN: int +POLLMSG: int +POLLNVAL: int +POLLOUT: int +POLLPRI: int +POLLRDBAND: int +POLLRDNORM: int +POLLWRBAND: int +POLLWRNORM: int + +class poll: + def __init__(self) -> None: ... + def register(self, fd: _FileDescriptor, eventmask: int = ...) -> None: ... + def modify(self, fd: _FileDescriptor, eventmask: int) -> None: ... + def unregister(self, fd: _FileDescriptor) -> None: ... + def poll(self, timeout: Optional[float] = ...) -> List[Tuple[int, int]]: ... + +def select(rlist: Iterable[Any], wlist: Iterable[Any], xlist: Iterable[Any], + timeout: Optional[float] = ...) -> Tuple[List[Any], + List[Any], + List[Any]]: ... + +if sys.version_info >= (3, 3): + error = OSError +else: + class error(Exception): ... + +# BSD only +class kevent(object): + data: Any + fflags: int + filter: int + flags: int + ident: int + udata: Any + def __init__(self, ident: _FileDescriptor, filter: int = ..., flags: int = ..., fflags: int = ..., data: Any = ..., udata: Any = ...) -> None: ... + +# BSD only +class kqueue(object): + closed: bool + def __init__(self) -> None: ... + def close(self) -> None: ... + def control(self, changelist: Optional[Iterable[kevent]], max_events: int, timeout: float = ...) -> List[kevent]: ... + def fileno(self) -> int: ... + @classmethod + def fromfd(cls, fd: _FileDescriptor) -> kqueue: ... + +# Linux only +class epoll(object): + if sys.version_info >= (3, 3): + def __init__(self, sizehint: int = ..., flags: int = ...) -> None: ... + else: + def __init__(self, sizehint: int = ...) -> None: ... + if sys.version_info >= (3, 4): + def __enter__(self) -> epoll: ... + def __exit__(self, *args: Any) -> None: ... + def close(self) -> None: ... + closed: bool + def fileno(self) -> int: ... + def register(self, fd: _FileDescriptor, eventmask: int = ...) -> None: ... + def modify(self, fd: _FileDescriptor, eventmask: int) -> None: ... + def unregister(self, fd: _FileDescriptor) -> None: ... + def poll(self, timeout: float = ..., maxevents: int = ...) -> List[Tuple[int, int]]: ... + @classmethod + def fromfd(cls, fd: _FileDescriptor) -> epoll: ... + +if sys.version_info >= (3, 3): + # Solaris only + class devpoll: + if sys.version_info >= (3, 4): + def close(self) -> None: ... + closed: bool + def fileno(self) -> int: ... + def register(self, fd: _FileDescriptor, eventmask: int = ...) -> None: ... + def modify(self, fd: _FileDescriptor, eventmask: int = ...) -> None: ... + def unregister(self, fd: _FileDescriptor) -> None: ... + def poll(self, timeout: Optional[float] = ...) -> List[Tuple[int, int]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/shutil.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/shutil.pyi new file mode 100644 index 00000000..b4c6cc12 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/shutil.pyi @@ -0,0 +1,148 @@ +import os +import sys + +# 'bytes' paths are not properly supported: they don't work with all functions, +# sometimes they only work partially (broken exception messages), and the test +# cases don't use them. + +from typing import ( + List, Iterable, Callable, Any, Tuple, Sequence, NamedTuple, IO, + AnyStr, Optional, Union, Set, TypeVar, overload, Type, Protocol, Text +) + +if sys.version_info >= (3, 6): + _Path = Union[str, os.PathLike[str]] + _AnyStr = str + _AnyPath = TypeVar("_AnyPath", str, os.PathLike[str]) + # Return value of some functions that may either return a path-like object that was passed in or + # a string + _PathReturn = Any +elif sys.version_info >= (3,): + _Path = str + _AnyStr = str + _AnyPath = str + _PathReturn = str +else: + _Path = Text + _AnyStr = TypeVar("_AnyStr", str, unicode) + _AnyPath = TypeVar("_AnyPath", str, unicode) + _PathReturn = Type[None] + +if sys.version_info >= (3,): + class Error(OSError): ... + class SameFileError(Error): ... + class SpecialFileError(OSError): ... + class ExecError(OSError): ... + class ReadError(OSError): ... + class RegistryError(Exception): ... +else: + class Error(EnvironmentError): ... + class SpecialFileError(EnvironmentError): ... + class ExecError(EnvironmentError): ... + +_S_co = TypeVar("_S_co", covariant=True) +_S_contra = TypeVar("_S_contra", contravariant=True) + +class _Reader(Protocol[_S_co]): + def read(self, length: int) -> _S_co: ... + +class _Writer(Protocol[_S_contra]): + def write(self, data: _S_contra) -> Any: ... + +def copyfileobj(fsrc: _Reader[AnyStr], fdst: _Writer[AnyStr], + length: int = ...) -> None: ... + +if sys.version_info >= (3,): + def copyfile(src: _Path, dst: _AnyPath, *, + follow_symlinks: bool = ...) -> _AnyPath: ... + def copymode(src: _Path, dst: _Path, *, + follow_symlinks: bool = ...) -> None: ... + def copystat(src: _Path, dst: _Path, *, + follow_symlinks: bool = ...) -> None: ... + def copy(src: _Path, dst: _Path, *, + follow_symlinks: bool = ...) -> _PathReturn: ... + def copy2(src: _Path, dst: _Path, *, + follow_symlinks: bool = ...) -> _PathReturn: ... +else: + def copyfile(src: _Path, dst: _Path) -> None: ... + def copymode(src: _Path, dst: _Path) -> None: ... + def copystat(src: _Path, dst: _Path) -> None: ... + def copy(src: _Path, dst: _Path) -> _PathReturn: ... + def copy2(src: _Path, dst: _Path) -> _PathReturn: ... + +def ignore_patterns(*patterns: _Path) -> Callable[[Any, List[_AnyStr]], Set[_AnyStr]]: ... + +if sys.version_info >= (3, 8): + def copytree( + src: _Path, + dst: _Path, + symlinks: bool = ..., + ignore: Union[None, Callable[[str, List[str]], Iterable[str]], Callable[[_Path, List[str]], Iterable[str]]] = ..., + copy_function: Callable[[str, str], None] = ..., + ignore_dangling_symlinks: bool = ..., + dirs_exist_ok: bool = ..., + ) -> _PathReturn: ... +elif sys.version_info >= (3,): + def copytree(src: _Path, dst: _Path, symlinks: bool = ..., + ignore: Union[None, + Callable[[str, List[str]], Iterable[str]], + Callable[[_Path, List[str]], Iterable[str]]] = ..., + copy_function: Callable[[str, str], None] = ..., + ignore_dangling_symlinks: bool = ...) -> _PathReturn: ... +else: + def copytree(src: AnyStr, dst: AnyStr, symlinks: bool = ..., + ignore: Union[None, + Callable[[AnyStr, List[AnyStr]], + Iterable[AnyStr]]] = ...) -> _PathReturn: ... + +if sys.version_info >= (3,): + @overload + def rmtree(path: bytes, ignore_errors: bool = ..., + onerror: Optional[Callable[[Any, str, Any], Any]] = ...) -> None: ... + @overload + def rmtree(path: _AnyPath, ignore_errors: bool = ..., + onerror: Optional[Callable[[Any, _AnyPath, Any], Any]] = ...) -> None: ... +else: + def rmtree(path: _AnyPath, ignore_errors: bool = ..., + onerror: Optional[Callable[[Any, _AnyPath, Any], Any]] = ...) -> None: ... + +if sys.version_info >= (3, 5): + _CopyFn = Union[Callable[[str, str], None], Callable[[_Path, _Path], None]] + def move(src: _Path, dst: _Path, + copy_function: _CopyFn = ...) -> _PathReturn: ... +else: + def move(src: _Path, dst: _Path) -> _PathReturn: ... + +if sys.version_info >= (3,): + class _ntuple_diskusage(NamedTuple): + total: int + used: int + free: int + def disk_usage(path: _Path) -> _ntuple_diskusage: ... + def chown(path: _Path, user: Optional[str] = ..., + group: Optional[str] = ...) -> None: ... + def which(cmd: _Path, mode: int = ..., + path: Optional[_Path] = ...) -> Optional[str]: ... + +def make_archive(base_name: _AnyStr, format: str, root_dir: Optional[_Path] = ..., + base_dir: Optional[_Path] = ..., verbose: bool = ..., + dry_run: bool = ..., owner: Optional[str] = ..., group: Optional[str] = ..., + logger: Optional[Any] = ...) -> _AnyStr: ... +def get_archive_formats() -> List[Tuple[str, str]]: ... + +def register_archive_format(name: str, function: Callable[..., Any], + extra_args: Optional[Sequence[Union[Tuple[str, Any], List[Any]]]] = ..., + description: str = ...) -> None: ... +def unregister_archive_format(name: str) -> None: ... + +if sys.version_info >= (3,): + # Should be _Path once http://bugs.python.org/issue30218 is fixed + def unpack_archive(filename: str, extract_dir: Optional[_Path] = ..., + format: Optional[str] = ...) -> None: ... + def register_unpack_format(name: str, extensions: List[str], function: Any, + extra_args: Sequence[Tuple[str, Any]] = ..., + description: str = ...) -> None: ... + def unregister_unpack_format(name: str) -> None: ... + def get_unpack_formats() -> List[Tuple[str, List[str], str]]: ... + + def get_terminal_size(fallback: Tuple[int, int] = ...) -> os.terminal_size: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/site.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/site.pyi new file mode 100644 index 00000000..4fdbad8e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/site.pyi @@ -0,0 +1,17 @@ +# Stubs for site + +from typing import List, Iterable, Optional +import sys + +PREFIXES: List[str] +ENABLE_USER_SITE: Optional[bool] +USER_SITE: Optional[str] +USER_BASE: Optional[str] + +if sys.version_info < (3,): + def main() -> None: ... +def addsitedir(sitedir: str, + known_paths: Optional[Iterable[str]] = ...) -> None: ... +def getsitepackages(prefixes: Optional[Iterable[str]] = ...) -> List[str]: ... +def getuserbase() -> str: ... +def getusersitepackages() -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/smtpd.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/smtpd.pyi new file mode 100644 index 00000000..870a5014 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/smtpd.pyi @@ -0,0 +1,78 @@ +# Stubs for smtpd (Python 2 and 3) +import sys +import socket +import asyncore +import asynchat + +from typing import Any, DefaultDict, List, Optional, Text, Tuple, Type + +_Address = Tuple[str, int] # (host, port) + + +class SMTPChannel(asynchat.async_chat): + COMMAND: int + DATA: int + + if sys.version_info >= (3,): + command_size_limits: DefaultDict[str, int] + smtp_server: SMTPServer + conn: socket.socket + addr: Any + received_lines: List[Text] + smtp_state: int + seen_greeting: str + mailfrom: str + rcpttos: List[str] + received_data: str + fqdn: str + peer: str + + command_size_limit: int + data_size_limit: int + + enable_SMTPUTF8: bool + + @property + def max_command_size_limit(self) -> int: ... + + if sys.version_info >= (3,): + def __init__(self, server: SMTPServer, conn: socket.socket, addr: Any, data_size_limit: int = ..., + map: Optional[asyncore._maptype] = ..., enable_SMTPUTF8: bool = ..., decode_data: bool = ...) -> None: ... + else: + def __init__(self, server: SMTPServer, conn: socket.socket, addr: Any, data_size_limit: int = ...) -> None: ... + # base asynchat.async_chat.push() accepts bytes + def push(self, msg: Text) -> None: ... # type: ignore + def collect_incoming_data(self, data: bytes) -> None: ... + def found_terminator(self) -> None: ... + def smtp_HELO(self, arg: str) -> None: ... + def smtp_NOOP(self, arg: str) -> None: ... + def smtp_QUIT(self, arg: str) -> None: ... + def smtp_MAIL(self, arg: str) -> None: ... + def smtp_RCPT(self, arg: str) -> None: ... + def smtp_RSET(self, arg: str) -> None: ... + def smtp_DATA(self, arg: str) -> None: ... + if sys.version_info >= (3, 3): + def smtp_EHLO(self, arg: str) -> None: ... + def smtp_HELP(self, arg: str) -> None: ... + def smtp_VRFY(self, arg: str) -> None: ... + def smtp_EXPN(self, arg: str) -> None: ... + +class SMTPServer(asyncore.dispatcher): + channel_class: Type[SMTPChannel] + + data_size_limit: int + enable_SMTPUTF8: bool + + if sys.version_info >= (3,): + def __init__(self, localaddr: _Address, remoteaddr: _Address, + data_size_limit: int = ..., map: Optional[asyncore._maptype] = ..., + enable_SMTPUTF8: bool = ..., decode_data: bool = ...) -> None: ... + else: + def __init__(self, localaddr: _Address, remoteaddr: _Address, + data_size_limit: int = ...) -> None: ... + def handle_accepted(self, conn: socket.socket, addr: Any) -> None: ... + def process_message(self, peer: _Address, mailfrom: str, rcpttos: List[Text], data: str, **kwargs: Any) -> Optional[str]: ... + +class DebuggingServer(SMTPServer): ... +class PureProxy(SMTPServer): ... +class MailmanProxy(PureProxy): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sndhdr.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sndhdr.pyi new file mode 100644 index 00000000..7b742c0a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sndhdr.pyi @@ -0,0 +1,24 @@ +# Stubs for sndhdr (Python 2 and 3) + +import os +import sys +from typing import Any, NamedTuple, Optional, Tuple, Union + +if sys.version_info >= (3, 5): + class SndHeaders(NamedTuple): + filetype: str + framerate: int + nchannels: int + nframes: int + sampwidth: Union[int, str] + _SndHeaders = SndHeaders +else: + _SndHeaders = Tuple[str, int, int, int, Union[int, str]] + +if sys.version_info >= (3, 6): + _Path = Union[str, bytes, os.PathLike[Any]] +else: + _Path = Union[str, bytes] + +def what(filename: _Path) -> Optional[_SndHeaders]: ... +def whathdr(filename: _Path) -> Optional[_SndHeaders]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/socket.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/socket.pyi new file mode 100644 index 00000000..ec853416 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/socket.pyi @@ -0,0 +1,767 @@ +"""Stub for the socket module + +This file is organized to mirror the module's documentation, with a very small +number of exceptions. + +To avoid requiring tests on all platforms, platform checks are included only +where the documentation notes platform availability (as opposed to following +actual availability), with one or two exceptions. + +Module documentation: https://docs.python.org/3/library/socket.html +CPython module source: https://github.com/python/cpython/blob/master/Lib/socket.py +CPython C source: https://github.com/python/cpython/blob/master/Modules/socketmodule.c +""" +# Authorship from original mypy stubs (not in typeshed git history): +# Ron Murawski +# adapted for Python 2.7 by Michal Pokorny +import sys +from typing import Any, BinaryIO, Iterable, List, Optional, Text, TextIO, Tuple, TypeVar, Union, overload + +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + + +# ----- Constants ----- +# Some socket families are listed in the "Socket families" section of the docs, +# but not the "Constants" section. These are listed at the end of the list of +# constants. +# +# Besides those and the first few constants listed, the constants are listed in +# documentation order. + +# Constants defined by Python (i.e. not OS constants re-exported from C) +has_ipv6: bool +SocketType: Any +if sys.version_info >= (3,): + SocketIO: Any + +# Re-exported errno +EAGAIN: int +EBADF: int +EINTR: int +EWOULDBLOCK: int + +# Constants re-exported from C + +# Per socketmodule.c, only these three families are portable +AF_UNIX: AddressFamily +AF_INET: AddressFamily +AF_INET6: AddressFamily + +SOCK_STREAM: SocketKind +SOCK_DGRAM: SocketKind +SOCK_RAW: SocketKind +SOCK_RDM: SocketKind +SOCK_SEQPACKET: SocketKind + +if sys.platform == 'linux' and sys.version_info >= (3,): + SOCK_CLOEXEC: SocketKind + SOCK_NONBLOCK: SocketKind + +# Address families not mentioned in the docs +AF_AAL5: AddressFamily +AF_APPLETALK: AddressFamily +AF_ASH: AddressFamily +AF_ATMPVC: AddressFamily +AF_ATMSVC: AddressFamily +AF_AX25: AddressFamily +AF_BRIDGE: AddressFamily +AF_DECnet: AddressFamily +AF_ECONET: AddressFamily +AF_IPX: AddressFamily +AF_IRDA: AddressFamily +AF_KEY: AddressFamily +AF_LLC: AddressFamily +AF_NETBEUI: AddressFamily +AF_NETROM: AddressFamily +AF_PPPOX: AddressFamily +AF_ROSE: AddressFamily +AF_ROUTE: AddressFamily +AF_SECURITY: AddressFamily +AF_SNA: AddressFamily +AF_SYSTEM: AddressFamily +AF_UNSPEC: AddressFamily +AF_WANPIPE: AddressFamily +AF_X25: AddressFamily + +# The "many constants" referenced by the docs +SOMAXCONN: int +AI_ADDRCONFIG: AddressInfo +AI_ALL: AddressInfo +AI_CANONNAME: AddressInfo +AI_DEFAULT: AddressInfo +AI_MASK: AddressInfo +AI_NUMERICHOST: AddressInfo +AI_NUMERICSERV: AddressInfo +AI_PASSIVE: AddressInfo +AI_V4MAPPED: AddressInfo +AI_V4MAPPED_CFG: AddressInfo +EAIEAI_ADDRFAMILY: int +EAI_AGAIN: int +EAI_BADFLAGS: int +EAI_BADHINTS: int +EAI_FAIL: int +EAI_FAMILY: int +EAI_MAX: int +EAI_MEMORY: int +EAI_NODATA: int +EAI_NONAME: int +EAI_OVERFLOW: int +EAI_PROTOCOL: int +EAI_SERVICE: int +EAI_SOCKTYPE: int +EAI_SYSTEM: int +INADDR_ALLHOSTS_GROUP: int +INADDR_ANY: int +INADDR_BROADCAST: int +INADDR_LOOPBACK: int +INADDR_MAX_LOCAL_GROUP: int +INADDR_NONE: int +INADDR_UNSPEC_GROUP: int +IPPORT_RESERVED: int +IPPORT_USERRESERVED: int +IPPROTO_AH: int +IPPROTO_BIP: int +IPPROTO_DSTOPTS: int +IPPROTO_EGP: int +IPPROTO_EON: int +IPPROTO_ESP: int +IPPROTO_FRAGMENT: int +IPPROTO_GGP: int +IPPROTO_GRE: int +IPPROTO_HELLO: int +IPPROTO_HOPOPTS: int +IPPROTO_ICMP: int +IPPROTO_ICMPV6: int +IPPROTO_IDP: int +IPPROTO_IGMP: int +IPPROTO_IP: int +IPPROTO_IPCOMP: int +IPPROTO_IPIP: int +IPPROTO_IPV4: int +IPPROTO_IPV6: int +IPPROTO_MAX: int +IPPROTO_MOBILE: int +IPPROTO_ND: int +IPPROTO_NONE: int +IPPROTO_PIM: int +IPPROTO_PUP: int +IPPROTO_RAW: int +IPPROTO_ROUTING: int +IPPROTO_RSVP: int +IPPROTO_SCTP: int +IPPROTO_TCP: int +IPPROTO_TP: int +IPPROTO_UDP: int +IPPROTO_VRRP: int +IPPROTO_XTP: int +IPV6_CHECKSUM: int +IPV6_DONTFRAG: int +IPV6_DSTOPTS: int +IPV6_HOPLIMIT: int +IPV6_HOPOPTS: int +IPV6_JOIN_GROUP: int +IPV6_LEAVE_GROUP: int +IPV6_MULTICAST_HOPS: int +IPV6_MULTICAST_IF: int +IPV6_MULTICAST_LOOP: int +IPV6_NEXTHOP: int +IPV6_PATHMTU: int +IPV6_PKTINFO: int +IPV6_RECVDSTOPTS: int +IPV6_RECVHOPLIMIT: int +IPV6_RECVHOPOPTS: int +IPV6_RECVPATHMTU: int +IPV6_RECVPKTINFO: int +IPV6_RECVRTHDR: int +IPV6_RECVTCLASS: int +IPV6_RTHDR: int +IPV6_RTHDRDSTOPTS: int +IPV6_RTHDR_TYPE_0: int +IPV6_TCLASS: int +IPV6_UNICAST_HOPS: int +IPV6_USE_MIN_MTU: int +IPV6_V6ONLY: int +IPX_TYPE: int +IP_ADD_MEMBERSHIP: int +IP_DEFAULT_MULTICAST_LOOP: int +IP_DEFAULT_MULTICAST_TTL: int +IP_DROP_MEMBERSHIP: int +IP_HDRINCL: int +IP_MAX_MEMBERSHIPS: int +IP_MULTICAST_IF: int +IP_MULTICAST_LOOP: int +IP_MULTICAST_TTL: int +IP_OPTIONS: int +IP_RECVDSTADDR: int +IP_RECVOPTS: int +IP_RECVRETOPTS: int +IP_RETOPTS: int +IP_TOS: int +IP_TRANSPARENT: int +IP_TTL: int +LOCAL_PEERCRED: int +MSG_BCAST: MsgFlag +MSG_BTAG: MsgFlag +MSG_CMSG_CLOEXEC: MsgFlag +MSG_CONFIRM: MsgFlag +MSG_CTRUNC: MsgFlag +MSG_DONTROUTE: MsgFlag +MSG_DONTWAIT: MsgFlag +MSG_EOF: MsgFlag +MSG_EOR: MsgFlag +MSG_ERRQUEUE: MsgFlag +MSG_ETAG: MsgFlag +MSG_FASTOPEN: MsgFlag +MSG_MCAST: MsgFlag +MSG_MORE: MsgFlag +MSG_NOSIGNAL: MsgFlag +MSG_NOTIFICATION: MsgFlag +MSG_OOB: MsgFlag +MSG_PEEK: MsgFlag +MSG_TRUNC: MsgFlag +MSG_WAITALL: MsgFlag +NI_DGRAM: int +NI_MAXHOST: int +NI_MAXSERV: int +NI_NAMEREQD: int +NI_NOFQDN: int +NI_NUMERICHOST: int +NI_NUMERICSERV: int +SCM_CREDENTIALS: int +SCM_CREDS: int +SCM_RIGHTS: int +SHUT_RD: int +SHUT_RDWR: int +SHUT_WR: int +SOL_ATALK: int +SOL_AX25: int +SOL_HCI: int +SOL_IP: int +SOL_IPX: int +SOL_NETROM: int +SOL_ROSE: int +SOL_SOCKET: int +SOL_TCP: int +SOL_UDP: int +SO_ACCEPTCONN: int +SO_BINDTODEVICE: int +SO_BROADCAST: int +SO_DEBUG: int +SO_DONTROUTE: int +SO_ERROR: int +SO_EXCLUSIVEADDRUSE: int +SO_KEEPALIVE: int +SO_LINGER: int +SO_MARK: int +SO_OOBINLINE: int +SO_PASSCRED: int +SO_PEERCRED: int +SO_PRIORITY: int +SO_RCVBUF: int +SO_RCVLOWAT: int +SO_RCVTIMEO: int +SO_REUSEADDR: int +SO_REUSEPORT: int +SO_SETFIB: int +SO_SNDBUF: int +SO_SNDLOWAT: int +SO_SNDTIMEO: int +SO_TYPE: int +SO_USELOOPBACK: int +TCP_CORK: int +TCP_DEFER_ACCEPT: int +TCP_FASTOPEN: int +TCP_INFO: int +TCP_KEEPCNT: int +TCP_KEEPIDLE: int +TCP_KEEPINTVL: int +TCP_LINGER2: int +TCP_MAXSEG: int +TCP_NODELAY: int +TCP_QUICKACK: int +TCP_SYNCNT: int +TCP_WINDOW_CLAMP: int +if sys.version_info >= (3, 7): + TCP_NOTSENT_LOWAT: int + +# Specifically-documented constants + +if sys.platform == 'linux' and sys.version_info >= (3,): + AF_CAN: AddressFamily + PF_CAN: int + SOL_CAN_BASE: int + SOL_CAN_RAW: int + CAN_EFF_FLAG: int + CAN_EFF_MASK: int + CAN_ERR_FLAG: int + CAN_ERR_MASK: int + CAN_RAW: int + CAN_RAW_ERR_FILTER: int + CAN_RAW_FILTER: int + CAN_RAW_LOOPBACK: int + CAN_RAW_RECV_OWN_MSGS: int + CAN_RTR_FLAG: int + CAN_SFF_MASK: int + + CAN_BCM: int + CAN_BCM_TX_SETUP: int + CAN_BCM_TX_DELETE: int + CAN_BCM_TX_READ: int + CAN_BCM_TX_SEND: int + CAN_BCM_RX_SETUP: int + CAN_BCM_RX_DELETE: int + CAN_BCM_RX_READ: int + CAN_BCM_TX_STATUS: int + CAN_BCM_TX_EXPIRED: int + CAN_BCM_RX_STATUS: int + CAN_BCM_RX_TIMEOUT: int + CAN_BCM_RX_CHANGED: int + + CAN_RAW_FD_FRAMES: int + +if sys.platform == 'linux' and sys.version_info >= (3, 7): + CAN_ISOTP: int + +if sys.platform == 'linux': + AF_PACKET: AddressFamily + PF_PACKET: int + PACKET_BROADCAST: int + PACKET_FASTROUTE: int + PACKET_HOST: int + PACKET_LOOPBACK: int + PACKET_MULTICAST: int + PACKET_OTHERHOST: int + PACKET_OUTGOING: int + +if sys.platform == 'linux' and sys.version_info >= (3,): + AF_RDS: AddressFamily + PF_RDS: int + SOL_RDS: int + RDS_CANCEL_SENT_TO: int + RDS_CMSG_RDMA_ARGS: int + RDS_CMSG_RDMA_DEST: int + RDS_CMSG_RDMA_MAP: int + RDS_CMSG_RDMA_STATUS: int + RDS_CMSG_RDMA_UPDATE: int + RDS_CONG_MONITOR: int + RDS_FREE_MR: int + RDS_GET_MR: int + RDS_GET_MR_FOR_DEST: int + RDS_RDMA_DONTWAIT: int + RDS_RDMA_FENCE: int + RDS_RDMA_INVALIDATE: int + RDS_RDMA_NOTIFY_ME: int + RDS_RDMA_READWRITE: int + RDS_RDMA_SILENT: int + RDS_RDMA_USE_ONCE: int + RDS_RECVERR: int + +if sys.platform == 'win32': + SIO_RCVALL: int + SIO_KEEPALIVE_VALS: int + if sys.version_info >= (3, 6): + SIO_LOOPBACK_FAST_PATH: int + RCVALL_IPLEVEL: int + RCVALL_MAX: int + RCVALL_OFF: int + RCVALL_ON: int + RCVALL_SOCKETLEVELONLY: int + +if sys.platform == 'linux': + AF_TIPC: AddressFamily + SOL_TIPC: int + TIPC_ADDR_ID: int + TIPC_ADDR_NAME: int + TIPC_ADDR_NAMESEQ: int + TIPC_CFG_SRV: int + TIPC_CLUSTER_SCOPE: int + TIPC_CONN_TIMEOUT: int + TIPC_CRITICAL_IMPORTANCE: int + TIPC_DEST_DROPPABLE: int + TIPC_HIGH_IMPORTANCE: int + TIPC_IMPORTANCE: int + TIPC_LOW_IMPORTANCE: int + TIPC_MEDIUM_IMPORTANCE: int + TIPC_NODE_SCOPE: int + TIPC_PUBLISHED: int + TIPC_SRC_DROPPABLE: int + TIPC_SUBSCR_TIMEOUT: int + TIPC_SUB_CANCEL: int + TIPC_SUB_PORTS: int + TIPC_SUB_SERVICE: int + TIPC_TOP_SRV: int + TIPC_WAIT_FOREVER: int + TIPC_WITHDRAWN: int + TIPC_ZONE_SCOPE: int + +if sys.platform == 'linux' and sys.version_info >= (3, 6): + AF_ALG: AddressFamily + SOL_ALG: int + ALG_OP_DECRYPT: int + ALG_OP_ENCRYPT: int + ALG_OP_SIGN: int + ALG_OP_VERIFY: int + ALG_SET_AEAD_ASSOCLEN: int + ALG_SET_AEAD_AUTHSIZE: int + ALG_SET_IV: int + ALG_SET_KEY: int + ALG_SET_OP: int + ALG_SET_PUBKEY: int + +if sys.platform == 'linux' and sys.version_info >= (3, 7): + AF_VSOCK: AddressFamily + IOCTL_VM_SOCKETS_GET_LOCAL_CID: int + VMADDR_CID_ANY: int + VMADDR_CID_HOST: int + VMADDR_PORT_ANY: int + SO_VM_SOCKETS_BUFFER_MAX_SIZE: int + SO_VM_SOCKETS_BUFFER_SIZE: int + SO_VM_SOCKETS_BUFFER_MIN_SIZE: int + VM_SOCKETS_INVALID_VERSION: int + +AF_LINK: AddressFamily # Availability: BSD, macOS + +# BDADDR_* and HCI_* listed with other bluetooth constants below + +if sys.version_info >= (3, 6): + SO_DOMAIN: int + SO_PASSSEC: int + SO_PEERSEC: int + SO_PROTOCOL: int + TCP_CONGESTION: int + TCP_USER_TIMEOUT: int + +if sys.platform == 'linux' and sys.version_info >= (3, 8): + AF_QIPCRTR: AddressFamily + + +# Semi-documented constants +# (Listed under "Socket families" in the docs, but not "Constants") + +if sys.platform == 'linux': + # Netlink is defined by Linux + AF_NETLINK: AddressFamily + NETLINK_ARPD: int + NETLINK_CRYPTO: int + NETLINK_DNRTMSG: int + NETLINK_FIREWALL: int + NETLINK_IP6_FW: int + NETLINK_NFLOG: int + NETLINK_ROUTE6: int + NETLINK_ROUTE: int + NETLINK_SKIP: int + NETLINK_TAPBASE: int + NETLINK_TCPDIAG: int + NETLINK_USERSOCK: int + NETLINK_W1: int + NETLINK_XFRM: int + +if sys.platform != 'win32' and sys.platform != 'darwin': + # Linux and some BSD support is explicit in the docs + # Windows and macOS do not support in practice + AF_BLUETOOTH: AddressFamily + BTPROTO_HCI: int + BTPROTO_L2CAP: int + BTPROTO_RFCOMM: int + BTPROTO_SCO: int # not in FreeBSD + + BDADDR_ANY: str + BDADDR_LOCAL: str + + HCI_FILTER: int # not in NetBSD or DragonFlyBSD + # not in FreeBSD, NetBSD, or DragonFlyBSD + HCI_TIME_STAMP: int + HCI_DATA_DIR: int + +if sys.platform == 'darwin': + # PF_SYSTEM is defined by macOS + PF_SYSTEM: int + SYSPROTO_CONTROL: int + + +# enum versions of above flags +if sys.version_info >= (3, 4): + from enum import IntEnum + + class AddressFamily(IntEnum): + AF_UNIX: int + AF_INET: int + AF_INET6: int + AF_AAL5: int + AF_ALG: int + AF_APPLETALK: int + AF_ASH: int + AF_ATMPVC: int + AF_ATMSVC: int + AF_AX25: int + AF_BLUETOOTH: int + AF_BRIDGE: int + AF_CAN: int + AF_DECnet: int + AF_ECONET: int + AF_IPX: int + AF_IRDA: int + AF_KEY: int + AF_LINK: int + AF_LLC: int + AF_NETBEUI: int + AF_NETLINK: int + AF_NETROM: int + AF_PACKET: int + AF_PPPOX: int + AF_QIPCRTR: int + AF_RDS: int + AF_ROSE: int + AF_ROUTE: int + AF_SECURITY: int + AF_SNA: int + AF_SYSTEM: int + AF_TIPC: int + AF_UNSPEC: int + AF_VSOCK: int + AF_WANPIPE: int + AF_X25: int + + class SocketKind(IntEnum): + SOCK_STREAM: int + SOCK_DGRAM: int + SOCK_RAW: int + SOCK_RDM: int + SOCK_SEQPACKET: int + SOCK_CLOEXEC: int + SOCK_NONBLOCK: int +else: + AddressFamily = int + SocketKind = int + +if sys.version_info >= (3, 6): + from enum import IntFlag + + class AddressInfo(IntFlag): + AI_ADDRCONFIG: int + AI_ALL: int + AI_CANONNAME: int + AI_NUMERICHOST: int + AI_NUMERICSERV: int + AI_PASSIVE: int + AI_V4MAPPED: int + + class MsgFlag(IntFlag): + MSG_CTRUNC: int + MSG_DONTROUTE: int + MSG_DONTWAIT: int + MSG_EOR: int + MSG_OOB: int + MSG_PEEK: int + MSG_TRUNC: int + MSG_WAITALL: int +else: + AddressInfo = int + MsgFlag = int + + +# ----- Exceptions ----- + +if sys.version_info < (3,): + class error(IOError): ... +else: + error = OSError + +class herror(error): + def __init__(self, herror: int = ..., string: str = ...) -> None: ... + +class gaierror(error): + def __init__(self, error: int = ..., string: str = ...) -> None: ... + +class timeout(error): + def __init__(self, error: int = ..., string: str = ...) -> None: ... + + +# ----- Classes ----- + +# Addresses can be either tuples of varying lengths (AF_INET, AF_INET6, +# AF_NETLINK, AF_TIPC) or strings (AF_UNIX). +_Address = Union[tuple, str] +_RetAddress = Any +# TODO Most methods allow bytes as address objects + +_WriteBuffer = Union[bytearray, memoryview] + +_CMSG = Tuple[int, int, bytes] +_SelfT = TypeVar('_SelfT', bound=socket) + +class socket: + family: int + type: int + proto: int + + if sys.version_info < (3,): + def __init__(self, family: int = ..., type: int = ..., proto: int = ...) -> None: ... + else: + def __init__(self, family: int = ..., type: int = ..., proto: int = ..., fileno: Optional[int] = ...) -> None: ... + def __enter__(self: _SelfT) -> _SelfT: ... + def __exit__(self, *args: Any) -> None: ... + + # --- methods --- + def accept(self) -> Tuple[socket, _RetAddress]: ... + def bind(self, address: Union[_Address, bytes]) -> None: ... + def close(self) -> None: ... + def connect(self, address: Union[_Address, bytes]) -> None: ... + def connect_ex(self, address: Union[_Address, bytes]) -> int: ... + def detach(self) -> int: ... + def dup(self) -> socket: ... + def fileno(self) -> int: ... + if sys.version_info >= (3, 4): + def get_inheritable(self) -> bool: ... + def getpeername(self) -> _RetAddress: ... + def getsockname(self) -> _RetAddress: ... + + @overload + def getsockopt(self, level: int, optname: int) -> int: ... + @overload + def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... + + if sys.version_info >= (3, 7): + def getblocking(self) -> bool: ... + def gettimeout(self) -> Optional[float]: ... + + if sys.platform == 'win32': + def ioctl(self, control: object, option: Tuple[int, int, int]) -> None: ... + + if sys.version_info >= (3, 5): + def listen(self, __backlog: int = ...) -> None: ... + else: + def listen(self, __backlog: int) -> None: ... + # Note that the makefile's documented windows-specific behavior is not represented + if sys.version_info < (3,): + def makefile(self, mode: unicode = ..., buffering: int = ...) -> BinaryIO: ... + else: + # mode strings with duplicates are intentionally excluded + @overload + def makefile(self, + mode: Literal['r', 'w', 'rw', 'wr', ''], + buffering: Optional[int] = ..., + *, + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ...) -> TextIO: ... + @overload + def makefile(self, + mode: Literal['b', 'rb', 'br', 'wb', 'bw', 'rwb', 'rbw', 'wrb', 'wbr', 'brw', 'bwr'] = ..., + buffering: Optional[int] = ..., + *, + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ...) -> BinaryIO: ... + def recv(self, bufsize: int, flags: int = ...) -> bytes: ... + def recvfrom(self, bufsize: int, flags: int = ...) -> Tuple[bytes, _RetAddress]: ... + + if sys.version_info >= (3, 3): + def recvmsg(self, __bufsize: int, __ancbufsize: int = ..., __flags: int = ...) -> Tuple[bytes, List[_CMSG], int, Any]: ... + def recvmsg_into(self, + __buffers: Iterable[_WriteBuffer], + __ancbufsize: int = ..., + __flags: int = ...) -> Tuple[int, List[_CMSG], int, Any]: ... + def recvfrom_into(self, buffer: _WriteBuffer, nbytes: int = ..., flags: int = ...) -> Tuple[int, _RetAddress]: ... + def recv_into(self, buffer: _WriteBuffer, nbytes: int = ..., flags: int = ...) -> int: ... + def send(self, data: bytes, flags: int = ...) -> int: ... + def sendall(self, data: bytes, flags: int = ...) -> None: ... # return type: None on success + @overload + def sendto(self, data: bytes, address: _Address) -> int: ... + @overload + def sendto(self, data: bytes, flags: int, address: _Address) -> int: ... + if sys.version_info >= (3, 3): + def sendmsg(self, + __buffers: Iterable[bytes], + __ancdata: Iterable[_CMSG] = ..., + __flags: int = ..., + __address: _Address = ...) -> int: ... + if sys.platform == 'linux' and sys.version_info >= (3, 6): + # TODO add the parameter types for sendmsg_afalg + def sendmsg_afalg(self, msg=..., *, op, iv=..., assoclen=..., flags=...) -> int: ... + + if sys.version_info >= (3,): + # TODO determine legal types for file parameter + def sendfile(self, file, offset: int = ..., count: Optional[int] = ...) -> int: ... + def set_inheritable(self, inheritable: bool) -> None: ... + def setblocking(self, flag: bool) -> None: ... + def settimeout(self, value: Optional[float]) -> None: ... + + if sys.version_info < (3, 6): + def setsockopt(self, level: int, optname: int, value: Union[int, bytes]) -> None: ... + else: + @overload + def setsockopt(self, level: int, optname: int, value: Union[int, bytes]) -> None: ... + @overload + def setsockopt(self, level: int, optname: int, value: None, optlen: int) -> None: ... + + if sys.platform == 'win32': + def share(self, process_id: int) -> bytes: ... + + def shutdown(self, how: int) -> None: ... + + +# ----- Functions ----- + +if sys.version_info >= (3, 7): + def close(fd: int) -> None: ... + +def create_connection(address: Tuple[Optional[str], int], + timeout: Optional[float] = ..., + source_address: Tuple[Union[bytearray, bytes, Text], int] = ...) -> socket: ... + +if sys.version_info >= (3, 8): + def create_server(address: _Address, + *, + family: int = ..., + backlog: Optional[int] = ..., + reuse_port: bool = ..., + dualstack_ipv6: bool = ...) -> socket: ... + def has_dualstack_ipv6() -> bool: ... + +def fromfd(fd: int, family: int, type: int, proto: int = ...) -> socket: ... + +if sys.platform == 'win32' and sys.version_info >= (3, 3): + def fromshare(data: bytes) -> socket: ... + +# the 5th tuple item is an address +# TODO the "Tuple[Any, ...]" should be "Union[Tuple[str, int], Tuple[str, int, int, int]]" but that triggers +# https://github.com/python/mypy/issues/2509 +def getaddrinfo(host: Optional[Union[bytearray, bytes, Text]], + port: Union[str, int, None], + family: int = ..., + socktype: int = ..., + proto: int = ..., + flags: int = ...) -> List[Tuple[AddressFamily, SocketKind, int, str, Tuple[Any, ...]]]: ... + +def getfqdn(name: str = ...) -> str: ... +def gethostbyname(hostname: str) -> str: ... +def gethostbyname_ex(hostname: str) -> Tuple[str, List[str], List[str]]: ... +def gethostname() -> str: ... +def gethostbyaddr(ip_address: str) -> Tuple[str, List[str], List[str]]: ... +def getnameinfo(sockaddr: Union[Tuple[str, int], Tuple[str, int, int, int]], flags: int) -> Tuple[str, int]: ... +def getprotobyname(protocolname: str) -> int: ... +def getservbyname(servicename: str, protocolname: str = ...) -> int: ... +def getservbyport(port: int, protocolname: str = ...) -> str: ... +def socketpair(family: int = ..., type: int = ..., proto: int = ...) -> Tuple[socket, socket]: ... +def ntohl(x: int) -> int: ... # param & ret val are 32-bit ints +def ntohs(x: int) -> int: ... # param & ret val are 16-bit ints +def htonl(x: int) -> int: ... # param & ret val are 32-bit ints +def htons(x: int) -> int: ... # param & ret val are 16-bit ints +def inet_aton(ip_string: str) -> bytes: ... # ret val 4 bytes in length +def inet_ntoa(packed_ip: bytes) -> str: ... +def inet_pton(address_family: int, ip_string: str) -> bytes: ... +def inet_ntop(address_family: int, packed_ip: bytes) -> str: ... +if sys.version_info >= (3, 3): + def CMSG_LEN(length: int) -> int: ... + def CMSG_SPACE(length: int) -> int: ... +def getdefaulttimeout() -> Optional[float]: ... +def setdefaulttimeout(timeout: Optional[float]) -> None: ... +if sys.version_info >= (3, 3): + def sethostname(name: str) -> None: ... + def if_nameindex() -> List[Tuple[int, str]]: ... + def if_nametoindex(name: str) -> int: ... + def if_indextoname(index: int) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sqlite3/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sqlite3/__init__.pyi new file mode 100644 index 00000000..d5d20d67 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sqlite3/__init__.pyi @@ -0,0 +1 @@ +from sqlite3.dbapi2 import * # noqa: F403 diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sqlite3/dbapi2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sqlite3/dbapi2.pyi new file mode 100644 index 00000000..45c5c210 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sqlite3/dbapi2.pyi @@ -0,0 +1,291 @@ +# Filip Hron +# based heavily on Andrey Vlasovskikh's python-skeletons https://github.com/JetBrains/python-skeletons/blob/master/sqlite3.py + +import os +import sys +from typing import Any, Callable, Iterable, Iterator, List, Optional, Text, Tuple, Type, TypeVar, Union +from datetime import date, time, datetime + +_T = TypeVar('_T') + +paramstyle: str +threadsafety: int +apilevel: str +Date = date +Time = time +Timestamp = datetime + +def DateFromTicks(ticks): ... +def TimeFromTicks(ticks): ... +def TimestampFromTicks(ticks): ... + +version_info: str +sqlite_version_info: Tuple[int, int, int] +if sys.version_info >= (3,): + Binary = memoryview +else: + Binary = buffer + +def register_adapters_and_converters(): ... + +# The remaining definitions are imported from _sqlite3. + +PARSE_COLNAMES: int +PARSE_DECLTYPES: int +SQLITE_ALTER_TABLE: int +SQLITE_ANALYZE: int +SQLITE_ATTACH: int +SQLITE_CREATE_INDEX: int +SQLITE_CREATE_TABLE: int +SQLITE_CREATE_TEMP_INDEX: int +SQLITE_CREATE_TEMP_TABLE: int +SQLITE_CREATE_TEMP_TRIGGER: int +SQLITE_CREATE_TEMP_VIEW: int +SQLITE_CREATE_TRIGGER: int +SQLITE_CREATE_VIEW: int +SQLITE_DELETE: int +SQLITE_DENY: int +SQLITE_DETACH: int +SQLITE_DROP_INDEX: int +SQLITE_DROP_TABLE: int +SQLITE_DROP_TEMP_INDEX: int +SQLITE_DROP_TEMP_TABLE: int +SQLITE_DROP_TEMP_TRIGGER: int +SQLITE_DROP_TEMP_VIEW: int +SQLITE_DROP_TRIGGER: int +SQLITE_DROP_VIEW: int +SQLITE_IGNORE: int +SQLITE_INSERT: int +SQLITE_OK: int +SQLITE_PRAGMA: int +SQLITE_READ: int +SQLITE_REINDEX: int +SQLITE_SELECT: int +SQLITE_TRANSACTION: int +SQLITE_UPDATE: int +adapters: Any +converters: Any +sqlite_version: str +version: str + +# TODO: adapt needs to get probed +def adapt(obj, protocol, alternate): ... +def complete_statement(sql: str) -> bool: ... +if sys.version_info >= (3, 7): + def connect(database: Union[bytes, Text, os.PathLike[Text]], + timeout: float = ..., + detect_types: int = ..., + isolation_level: Optional[str] = ..., + check_same_thread: bool = ..., + factory: Optional[Type[Connection]] = ..., + cached_statements: int = ..., + uri: bool = ...) -> Connection: ... +elif sys.version_info >= (3, 4): + def connect(database: Union[bytes, Text], + timeout: float = ..., + detect_types: int = ..., + isolation_level: Optional[str] = ..., + check_same_thread: bool = ..., + factory: Optional[Type[Connection]] = ..., + cached_statements: int = ..., + uri: bool = ...) -> Connection: ... +else: + def connect(database: Union[bytes, Text], + timeout: float = ..., + detect_types: int = ..., + isolation_level: Optional[str] = ..., + check_same_thread: bool = ..., + factory: Optional[Type[Connection]] = ..., + cached_statements: int = ...) -> Connection: ... +def enable_callback_tracebacks(flag: bool) -> None: ... +def enable_shared_cache(do_enable: int) -> None: ... +def register_adapter(type: Type[_T], callable: Callable[[_T], Union[int, float, str, bytes]]) -> None: ... +def register_converter(typename: str, callable: Callable[[bytes], Any]) -> None: ... + +if sys.version_info < (3, 8): + class Cache(object): + def __init__(self, *args, **kwargs) -> None: ... + def display(self, *args, **kwargs) -> None: ... + def get(self, *args, **kwargs) -> None: ... + +class Connection(object): + DataError: Any + DatabaseError: Any + Error: Any + IntegrityError: Any + InterfaceError: Any + InternalError: Any + NotSupportedError: Any + OperationalError: Any + ProgrammingError: Any + Warning: Any + in_transaction: Any + isolation_level: Any + row_factory: Any + text_factory: Any + total_changes: Any + def __init__(self, *args, **kwargs): ... + def close(self) -> None: ... + def commit(self) -> None: ... + def create_aggregate(self, name: str, num_params: int, aggregate_class: type) -> None: ... + def create_collation(self, name: str, callable: Any) -> None: ... + def create_function(self, name: str, num_params: int, func: Any) -> None: ... + def cursor(self, cursorClass: Optional[type] = ...) -> Cursor: ... + def execute(self, sql: str, parameters: Iterable[Any] = ...) -> Cursor: ... + # TODO: please check in executemany() if seq_of_parameters type is possible like this + def executemany(self, sql: str, seq_of_parameters: Iterable[Iterable[Any]]) -> Cursor: ... + def executescript(self, sql_script: Union[bytes, Text]) -> Cursor: ... + def interrupt(self, *args, **kwargs) -> None: ... + def iterdump(self, *args, **kwargs) -> None: ... + def rollback(self, *args, **kwargs) -> None: ... + # TODO: set_authorizer(authorzer_callback) + # see https://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.set_authorizer + # returns [SQLITE_OK, SQLITE_DENY, SQLITE_IGNORE] so perhaps int + def set_authorizer(self, *args, **kwargs) -> None: ... + # set_progress_handler(handler, n) -> see https://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.set_progress_handler + def set_progress_handler(self, *args, **kwargs) -> None: ... + def set_trace_callback(self, *args, **kwargs): ... + # enable_load_extension and load_extension is not available on python distributions compiled + # without sqlite3 loadable extension support. see footnotes https://docs.python.org/3/library/sqlite3.html#f1 + def enable_load_extension(self, enabled: bool) -> None: ... + def load_extension(self, path: str) -> None: ... + if sys.version_info >= (3, 7): + def backup(self, target: Connection, *, pages: int = ..., + progress: Optional[Callable[[int, int, int], object]] = ..., name: str = ..., + sleep: float = ...) -> None: ... + def __call__(self, *args, **kwargs): ... + def __enter__(self, *args, **kwargs) -> Connection: ... + def __exit__(self, *args, **kwargs): ... + +class Cursor(Iterator[Any]): + arraysize: Any + connection: Any + description: Any + lastrowid: Any + row_factory: Any + rowcount: Any + # TODO: Cursor class accepts exactly 1 argument + # required type is sqlite3.Connection (which is imported as _Connection) + # however, the name of the __init__ variable is unknown + def __init__(self, *args, **kwargs) -> None: ... + def close(self, *args, **kwargs) -> None: ... + def execute(self, sql: str, parameters: Iterable[Any] = ...) -> Cursor: ... + def executemany(self, sql: str, seq_of_parameters: Iterable[Iterable[Any]]) -> Cursor: ... + def executescript(self, sql_script: Union[bytes, Text]) -> Cursor: ... + def fetchall(self) -> List[Any]: ... + def fetchmany(self, size: Optional[int] = ...) -> List[Any]: ... + def fetchone(self) -> Any: ... + def setinputsizes(self, *args, **kwargs) -> None: ... + def setoutputsize(self, *args, **kwargs) -> None: ... + def __iter__(self) -> Cursor: ... + if sys.version_info >= (3, 0): + def __next__(self) -> Any: ... + else: + def next(self) -> Any: ... + + +class DataError(DatabaseError): ... + +class DatabaseError(Error): ... + +class Error(Exception): ... + +class IntegrityError(DatabaseError): ... + +class InterfaceError(Error): ... + +class InternalError(DatabaseError): ... + +class NotSupportedError(DatabaseError): ... + +class OperationalError(DatabaseError): ... + +class OptimizedUnicode(object): + maketrans: Any + def __init__(self, *args, **kwargs): ... + def capitalize(self, *args, **kwargs): ... + def casefold(self, *args, **kwargs): ... + def center(self, *args, **kwargs): ... + def count(self, *args, **kwargs): ... + def encode(self, *args, **kwargs): ... + def endswith(self, *args, **kwargs): ... + def expandtabs(self, *args, **kwargs): ... + def find(self, *args, **kwargs): ... + def format(self, *args, **kwargs): ... + def format_map(self, *args, **kwargs): ... + def index(self, *args, **kwargs): ... + def isalnum(self, *args, **kwargs): ... + def isalpha(self, *args, **kwargs): ... + def isdecimal(self, *args, **kwargs): ... + def isdigit(self, *args, **kwargs): ... + def isidentifier(self, *args, **kwargs): ... + def islower(self, *args, **kwargs): ... + def isnumeric(self, *args, **kwargs): ... + def isprintable(self, *args, **kwargs): ... + def isspace(self, *args, **kwargs): ... + def istitle(self, *args, **kwargs): ... + def isupper(self, *args, **kwargs): ... + def join(self, *args, **kwargs): ... + def ljust(self, *args, **kwargs): ... + def lower(self, *args, **kwargs): ... + def lstrip(self, *args, **kwargs): ... + def partition(self, *args, **kwargs): ... + def replace(self, *args, **kwargs): ... + def rfind(self, *args, **kwargs): ... + def rindex(self, *args, **kwargs): ... + def rjust(self, *args, **kwargs): ... + def rpartition(self, *args, **kwargs): ... + def rsplit(self, *args, **kwargs): ... + def rstrip(self, *args, **kwargs): ... + def split(self, *args, **kwargs): ... + def splitlines(self, *args, **kwargs): ... + def startswith(self, *args, **kwargs): ... + def strip(self, *args, **kwargs): ... + def swapcase(self, *args, **kwargs): ... + def title(self, *args, **kwargs): ... + def translate(self, *args, **kwargs): ... + def upper(self, *args, **kwargs): ... + def zfill(self, *args, **kwargs): ... + def __add__(self, other): ... + def __contains__(self, *args, **kwargs): ... + def __eq__(self, other): ... + def __format__(self, *args, **kwargs): ... + def __ge__(self, other): ... + def __getitem__(self, index): ... + def __getnewargs__(self, *args, **kwargs): ... + def __gt__(self, other): ... + def __hash__(self): ... + def __iter__(self): ... + def __le__(self, other): ... + def __len__(self, *args, **kwargs): ... + def __lt__(self, other): ... + def __mod__(self, other): ... + def __mul__(self, other): ... + def __ne__(self, other): ... + def __rmod__(self, other): ... + def __rmul__(self, other): ... + +class PrepareProtocol(object): + def __init__(self, *args, **kwargs): ... + +class ProgrammingError(DatabaseError): ... + +class Row(object): + def __init__(self, *args, **kwargs): ... + def keys(self, *args, **kwargs): ... + def __eq__(self, other): ... + def __ge__(self, other): ... + def __getitem__(self, index): ... + def __gt__(self, other): ... + def __hash__(self): ... + def __iter__(self): ... + def __le__(self, other): ... + def __len__(self, *args, **kwargs): ... + def __lt__(self, other): ... + def __ne__(self, other): ... + +if sys.version_info < (3, 8): + class Statement(object): + def __init__(self, *args, **kwargs): ... + +class Warning(Exception): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sre_compile.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sre_compile.pyi new file mode 100644 index 00000000..e6036e20 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sre_compile.pyi @@ -0,0 +1,18 @@ +# Source: https://hg.python.org/cpython/file/2.7/Lib/sre_compile.py +# and https://github.com/python/cpython/blob/master/Lib/sre_compile.py + +import sys +from sre_parse import SubPattern +from typing import Any, List, Pattern, Tuple, Type, TypeVar, Union + +MAXCODE: int +if sys.version_info < (3, 0): + STRING_TYPES: Tuple[Type[str], Type[unicode]] + _IsStringType = int +else: + from sre_constants import _NamedIntConstant + def dis(code: List[_NamedIntConstant]) -> None: ... + _IsStringType = bool + +def isstring(obj: Any) -> _IsStringType: ... +def compile(p: Union[str, bytes, SubPattern], flags: int = ...) -> Pattern[Any]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ssl.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ssl.pyi new file mode 100644 index 00000000..3dd685ff --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/ssl.pyi @@ -0,0 +1,345 @@ +# Stubs for ssl + +from typing import ( + Any, Callable, ClassVar, Dict, List, NamedTuple, Optional, Set, Text, Type, Tuple, Union, +) +import enum +import socket +import sys +import os + +_PCTRTT = Tuple[Tuple[str, str], ...] +_PCTRTTT = Tuple[_PCTRTT, ...] +_PeerCertRetDictType = Dict[str, Union[str, _PCTRTTT, _PCTRTT]] +_PeerCertRetType = Union[_PeerCertRetDictType, bytes, None] +_EnumRetType = List[Tuple[bytes, str, Union[Set[str], bool]]] +_PasswordType = Union[Callable[[], Union[str, bytes]], str, bytes] + +if sys.version_info < (3, 6): + _Path = Text +else: + _Path = Union[str, os.PathLike[Any]] + +if sys.version_info >= (3, 5): + _SC1ArgT = Union[SSLSocket, SSLObject] +else: + _SC1ArgT = SSLSocket +_SrvnmeCbType = Callable[[_SC1ArgT, Optional[str], SSLSocket], Optional[int]] + +class SSLError(OSError): + library: str + reason: str +class SSLZeroReturnError(SSLError): ... +class SSLWantReadError(SSLError): ... +class SSLWantWriteError(SSLError): ... +class SSLSyscallError(SSLError): ... +class SSLEOFError(SSLError): ... + +if sys.version_info >= (3, 7): + class SSLCertVerificationError(SSLError, ValueError): + verify_code: int + verify_message: str + + CertificateError = SSLCertVerificationError +else: + class CertificateError(ValueError): ... + + +def wrap_socket(sock: socket.socket, keyfile: Optional[str] = ..., + certfile: Optional[str] = ..., server_side: bool = ..., + cert_reqs: int = ..., ssl_version: int = ..., + ca_certs: Optional[str] = ..., + do_handshake_on_connect: bool = ..., + suppress_ragged_eofs: bool = ..., + ciphers: Optional[str] = ...) -> SSLSocket: ... + + +def create_default_context( + purpose: Any = ..., + *, + cafile: Optional[str] = ..., + capath: Optional[str] = ..., + cadata: Union[Text, bytes, None] = ..., +) -> SSLContext: ... + +def _create_unverified_context(protocol: int = ..., *, + cert_reqs: int = ..., + check_hostname: bool = ..., + purpose: Any = ..., + certfile: Optional[str] = ..., + keyfile: Optional[str] = ..., + cafile: Optional[str] = ..., + capath: Optional[str] = ..., + cadata: Union[Text, bytes, None] = ...) -> SSLContext: ... +_create_default_https_context: Callable[..., SSLContext] + +if sys.version_info >= (3, 3): + def RAND_bytes(num: int) -> bytes: ... + def RAND_pseudo_bytes(num: int) -> Tuple[bytes, bool]: ... +def RAND_status() -> bool: ... +def RAND_egd(path: str) -> None: ... +def RAND_add(bytes: bytes, entropy: float) -> None: ... + + +def match_hostname(cert: _PeerCertRetType, hostname: str) -> None: ... +def cert_time_to_seconds(cert_time: str) -> int: ... +def get_server_certificate(addr: Tuple[str, int], ssl_version: int = ..., + ca_certs: Optional[str] = ...) -> str: ... +def DER_cert_to_PEM_cert(der_cert_bytes: bytes) -> str: ... +def PEM_cert_to_DER_cert(pem_cert_string: str) -> bytes: ... +class DefaultVerifyPaths(NamedTuple): + cafile: str + capath: str + openssl_cafile_env: str + openssl_cafile: str + openssl_capath_env: str + openssl_capath: str +def get_default_verify_paths() -> DefaultVerifyPaths: ... + +if sys.platform == 'win32': + def enum_certificates(store_name: str) -> _EnumRetType: ... + def enum_crls(store_name: str) -> _EnumRetType: ... + + +CERT_NONE: int +CERT_OPTIONAL: int +CERT_REQUIRED: int + +VERIFY_DEFAULT: int +VERIFY_CRL_CHECK_LEAF: int +VERIFY_CRL_CHECK_CHAIN: int +VERIFY_X509_STRICT: int +VERIFY_X509_TRUSTED_FIRST: int + +PROTOCOL_SSLv23: int +PROTOCOL_SSLv2: int +PROTOCOL_SSLv3: int +PROTOCOL_TLSv1: int +PROTOCOL_TLSv1_1: int +PROTOCOL_TLSv1_2: int +if sys.version_info >= (3, 5): + PROTOCOL_TLS: int +if sys.version_info >= (3, 6): + PROTOCOL_TLS_CLIENT: int + PROTOCOL_TLS_SERVER: int + +OP_ALL: int +OP_NO_SSLv2: int +OP_NO_SSLv3: int +OP_NO_TLSv1: int +OP_NO_TLSv1_1: int +OP_NO_TLSv1_2: int +OP_CIPHER_SERVER_PREFERENCE: int +OP_SINGLE_DH_USE: int +OP_SINGLE_ECDH_USE: int +OP_NO_COMPRESSION: int +if sys.version_info >= (3, 6): + OP_NO_TICKET: int + +HAS_ALPN: int +HAS_ECDH: bool +HAS_SNI: bool +HAS_NPN: bool +CHANNEL_BINDING_TYPES: List[str] + +OPENSSL_VERSION: str +OPENSSL_VERSION_INFO: Tuple[int, int, int, int, int] +OPENSSL_VERSION_NUMBER: int + +ALERT_DESCRIPTION_HANDSHAKE_FAILURE: int +ALERT_DESCRIPTION_INTERNAL_ERROR: int +ALERT_DESCRIPTION_ACCESS_DENIED: int +ALERT_DESCRIPTION_BAD_CERTIFICATE: int +ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE: int +ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE: int +ALERT_DESCRIPTION_BAD_RECORD_MAC: int +ALERT_DESCRIPTION_CERTIFICATE_EXPIRED: int +ALERT_DESCRIPTION_CERTIFICATE_REVOKED: int +ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN: int +ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE: int +ALERT_DESCRIPTION_CLOSE_NOTIFY: int +ALERT_DESCRIPTION_DECODE_ERROR: int +ALERT_DESCRIPTION_DECOMPRESSION_FAILURE: int +ALERT_DESCRIPTION_DECRYPT_ERROR: int +ALERT_DESCRIPTION_ILLEGAL_PARAMETER: int +ALERT_DESCRIPTION_INSUFFICIENT_SECURITY: int +ALERT_DESCRIPTION_NO_RENEGOTIATION: int +ALERT_DESCRIPTION_PROTOCOL_VERSION: int +ALERT_DESCRIPTION_RECORD_OVERFLOW: int +ALERT_DESCRIPTION_UNEXPECTED_MESSAGE: int +ALERT_DESCRIPTION_UNKNOWN_CA: int +ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY: int +ALERT_DESCRIPTION_UNRECOGNIZED_NAME: int +ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE: int +ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION: int +ALERT_DESCRIPTION_USER_CANCELLED: int + +class _ASN1Object(NamedTuple): + nid: int + shortname: str + longname: str + oid: str +if sys.version_info < (3,): + class Purpose(_ASN1Object): + SERVER_AUTH: ClassVar[Purpose] + CLIENT_AUTH: ClassVar[Purpose] +else: + class Purpose(_ASN1Object, enum.Enum): + SERVER_AUTH: _ASN1Object + CLIENT_AUTH: _ASN1Object + +class SSLSocket(socket.socket): + context: SSLContext + server_side: bool + server_hostname: Optional[str] + if sys.version_info >= (3, 6): + session: Optional[SSLSession] + session_reused: Optional[bool] + + def read(self, len: int = ..., + buffer: Optional[bytearray] = ...) -> bytes: ... + def write(self, buf: bytes) -> int: ... + def do_handshake(self) -> None: ... + def getpeercert(self, binary_form: bool = ...) -> _PeerCertRetType: ... + def cipher(self) -> Tuple[str, int, int]: ... + if sys.version_info >= (3, 5): + def shared_cipher(self) -> Optional[List[Tuple[str, int, int]]]: ... + def compression(self) -> Optional[str]: ... + def get_channel_binding(self, cb_type: str = ...) -> Optional[bytes]: ... + def selected_alpn_protocol(self) -> Optional[str]: ... + def selected_npn_protocol(self) -> Optional[str]: ... + def unwrap(self) -> socket.socket: ... + def version(self) -> Optional[str]: ... + def pending(self) -> int: ... + if sys.version_info >= (3, 8): + def verify_client_post_handshake(self) -> None: ... + +if sys.version_info >= (3, 7): + class TLSVersion(enum.IntEnum): + MINIMUM_SUPPORTED: int + MAXIMUM_SUPPORTED: int + SSLv3: int + TLSv1: int + TLSv1_1: int + TLSv1_2: int + TLSv1_3: int + +class SSLContext: + check_hostname: bool + options: int + if sys.version_info >= (3, 8): + post_handshake_auth: bool + @property + def protocol(self) -> int: ... + verify_flags: int + verify_mode: int + if sys.version_info >= (3, 5): + def __init__(self, protocol: int = ...) -> None: ... + else: + def __init__(self, protocol: int) -> None: ... + def cert_store_stats(self) -> Dict[str, int]: ... + def load_cert_chain(self, certfile: _Path, keyfile: Optional[_Path] = ..., + password: _PasswordType = ...) -> None: ... + def load_default_certs(self, purpose: Purpose = ...) -> None: ... + def load_verify_locations( + self, + cafile: Optional[str] = ..., + capath: Optional[str] = ..., + cadata: Union[Text, bytes, None] = ..., + ) -> None: ... + def get_ca_certs(self, binary_form: bool = ...) -> Union[List[_PeerCertRetDictType], List[bytes]]: ... + def set_default_verify_paths(self) -> None: ... + def set_ciphers(self, ciphers: str) -> None: ... + def set_alpn_protocols(self, protocols: List[str]) -> None: ... + if sys.version_info >= (3, 7): + sni_callback: Optional[Callable[[SSLObject, str, SSLContext], Union[None, int]]] + sslobject_class: Type[SSLObject] + def set_npn_protocols(self, protocols: List[str]) -> None: ... + def set_servername_callback(self, + server_name_callback: Optional[_SrvnmeCbType]) -> None: ... + def load_dh_params(self, dhfile: str) -> None: ... + def set_ecdh_curve(self, curve_name: str) -> None: ... + def wrap_socket(self, sock: socket.socket, server_side: bool = ..., + do_handshake_on_connect: bool = ..., + suppress_ragged_eofs: bool = ..., + server_hostname: Optional[str] = ...) -> SSLSocket: ... + if sys.version_info >= (3, 5): + def wrap_bio(self, incoming: MemoryBIO, outgoing: MemoryBIO, + server_side: bool = ..., + server_hostname: Optional[str] = ...) -> SSLObject: ... + def session_stats(self) -> Dict[str, int]: ... + if sys.version_info >= (3, 7): + maximum_version: TLSVersion + minimum_version: TLSVersion + + +if sys.version_info >= (3, 5): + class SSLObject: + context: SSLContext + server_side: bool + server_hostname: Optional[str] + if sys.version_info >= (3, 6): + session: Optional[SSLSession] + session_reused: bool + def read(self, len: int = ..., + buffer: Optional[bytearray] = ...) -> bytes: ... + def write(self, buf: bytes) -> int: ... + def getpeercert(self, binary_form: bool = ...) -> _PeerCertRetType: ... + def selected_npn_protocol(self) -> Optional[str]: ... + def cipher(self) -> Tuple[str, int, int]: ... + def shared_cipher(self) -> Optional[List[Tuple[str, int, int]]]: ... + def compression(self) -> Optional[str]: ... + def pending(self) -> int: ... + def do_handshake(self) -> None: ... + def unwrap(self) -> None: ... + def get_channel_binding(self, cb_type: str = ...) -> Optional[bytes]: ... + if sys.version_info >= (3, 8): + def verify_client_post_handshake(self) -> None: ... + + class MemoryBIO: + pending: int + eof: bool + def read(self, n: int = ...) -> bytes: ... + def write(self, buf: bytes) -> int: ... + def write_eof(self) -> None: ... + +if sys.version_info >= (3, 6): + class SSLSession: + id: bytes + time: int + timeout: int + ticket_lifetime_hint: int + has_ticket: bool + + class VerifyFlags(enum.IntFlag): + VERIFY_DEFAULT: int + VERIFY_CRL_CHECK_LEAF: int + VERIFY_CRL_CHECK_CHAIN: int + VERIFY_X509_STRICT: int + VERIFY_X509_TRUSTED_FIRST: int + + class VerifyMode(enum.IntEnum): + CERT_NONE: int + CERT_OPTIONAL: int + CERT_REQUIRED: int + +# TODO below documented in cpython but not in docs.python.org +# taken from python 3.4 +SSL_ERROR_EOF: int +SSL_ERROR_INVALID_ERROR_CODE: int +SSL_ERROR_SSL: int +SSL_ERROR_SYSCALL: int +SSL_ERROR_WANT_CONNECT: int +SSL_ERROR_WANT_READ: int +SSL_ERROR_WANT_WRITE: int +SSL_ERROR_WANT_X509_LOOKUP: int +SSL_ERROR_ZERO_RETURN: int + +def get_protocol_name(protocol_code: int) -> str: ... + +AF_INET: int +PEM_FOOTER: str +PEM_HEADER: str +SOCK_STREAM: int +SOL_SOCKET: int +SO_TYPE: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/stringprep.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/stringprep.pyi new file mode 100644 index 00000000..e3b7e9dc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/stringprep.pyi @@ -0,0 +1,23 @@ +# Stubs for stringprep (Python 2 and 3) + +from typing import Text + +def in_table_a1(code: Text) -> bool: ... +def in_table_b1(code: Text) -> bool: ... +def map_table_b3(code: Text) -> Text: ... +def map_table_b2(a: Text) -> Text: ... +def in_table_c11(code: Text) -> bool: ... +def in_table_c12(code: Text) -> bool: ... +def in_table_c11_c12(code: Text) -> bool: ... +def in_table_c21(code: Text) -> bool: ... +def in_table_c22(code: Text) -> bool: ... +def in_table_c21_c22(code: Text) -> bool: ... +def in_table_c3(code: Text) -> bool: ... +def in_table_c4(code: Text) -> bool: ... +def in_table_c5(code: Text) -> bool: ... +def in_table_c6(code: Text) -> bool: ... +def in_table_c7(code: Text) -> bool: ... +def in_table_c8(code: Text) -> bool: ... +def in_table_c9(code: Text) -> bool: ... +def in_table_d1(code: Text) -> bool: ... +def in_table_d2(code: Text) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/struct.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/struct.pyi new file mode 100644 index 00000000..552ee227 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/struct.pyi @@ -0,0 +1,44 @@ +# Stubs for struct + +# Based on http://docs.python.org/3.2/library/struct.html +# Based on http://docs.python.org/2/library/struct.html + +import sys +from typing import Any, Tuple, Text, Union, Iterator +from array import array +from mmap import mmap + +class error(Exception): ... + +_FmtType = Union[bytes, Text] +if sys.version_info >= (3,): + _BufferType = Union[array[int], bytes, bytearray, memoryview, mmap] + _WriteBufferType = Union[array, bytearray, memoryview, mmap] +else: + _BufferType = Union[array[int], bytes, bytearray, buffer, memoryview, mmap] + _WriteBufferType = Union[array[Any], bytearray, buffer, memoryview, mmap] + +def pack(fmt: _FmtType, *v: Any) -> bytes: ... +def pack_into(fmt: _FmtType, buffer: _WriteBufferType, offset: int, *v: Any) -> None: ... +def unpack(fmt: _FmtType, buffer: _BufferType) -> Tuple[Any, ...]: ... +def unpack_from(fmt: _FmtType, buffer: _BufferType, offset: int = ...) -> Tuple[Any, ...]: ... +if sys.version_info >= (3, 4): + def iter_unpack(fmt: _FmtType, buffer: _BufferType) -> Iterator[Tuple[Any, ...]]: ... + +def calcsize(fmt: _FmtType) -> int: ... + +class Struct: + if sys.version_info >= (3, 7): + format: str + else: + format: bytes + size: int + + def __init__(self, format: _FmtType) -> None: ... + + def pack(self, *v: Any) -> bytes: ... + def pack_into(self, buffer: _WriteBufferType, offset: int, *v: Any) -> None: ... + def unpack(self, buffer: _BufferType) -> Tuple[Any, ...]: ... + def unpack_from(self, buffer: _BufferType, offset: int = ...) -> Tuple[Any, ...]: ... + if sys.version_info >= (3, 4): + def iter_unpack(self, buffer: _BufferType) -> Iterator[Tuple[Any, ...]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sunau.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sunau.pyi new file mode 100644 index 00000000..b957f580 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sunau.pyi @@ -0,0 +1,86 @@ +# Stubs for sunau (Python 2 and 3) + +import sys +from typing import Any, NamedTuple, NoReturn, Optional, Text, IO, Union, Tuple + +_File = Union[Text, IO[bytes]] + +class Error(Exception): ... + +AUDIO_FILE_MAGIC: int +AUDIO_FILE_ENCODING_MULAW_8: int +AUDIO_FILE_ENCODING_LINEAR_8: int +AUDIO_FILE_ENCODING_LINEAR_16: int +AUDIO_FILE_ENCODING_LINEAR_24: int +AUDIO_FILE_ENCODING_LINEAR_32: int +AUDIO_FILE_ENCODING_FLOAT: int +AUDIO_FILE_ENCODING_DOUBLE: int +AUDIO_FILE_ENCODING_ADPCM_G721: int +AUDIO_FILE_ENCODING_ADPCM_G722: int +AUDIO_FILE_ENCODING_ADPCM_G723_3: int +AUDIO_FILE_ENCODING_ADPCM_G723_5: int +AUDIO_FILE_ENCODING_ALAW_8: int +AUDIO_UNKNOWN_SIZE: int + +if sys.version_info < (3, 0): + _sunau_params = Tuple[int, int, int, int, str, str] +else: + class _sunau_params(NamedTuple): + nchannels: int + sampwidth: int + framerate: int + nframes: int + comptype: str + compname: str + +class Au_read: + def __init__(self, f: _File) -> None: ... + if sys.version_info >= (3, 3): + def __enter__(self) -> Au_read: ... + def __exit__(self, *args: Any) -> None: ... + def getfp(self) -> Optional[IO[bytes]]: ... + def rewind(self) -> None: ... + def close(self) -> None: ... + def tell(self) -> int: ... + def getnchannels(self) -> int: ... + def getnframes(self) -> int: ... + def getsampwidth(self) -> int: ... + def getframerate(self) -> int: ... + def getcomptype(self) -> str: ... + def getcompname(self) -> str: ... + def getparams(self) -> _sunau_params: ... + def getmarkers(self) -> None: ... + def getmark(self, id: Any) -> NoReturn: ... + def setpos(self, pos: int) -> None: ... + def readframes(self, nframes: int) -> Optional[bytes]: ... + +class Au_write: + def __init__(self, f: _File) -> None: ... + if sys.version_info >= (3, 3): + def __enter__(self) -> Au_write: ... + def __exit__(self, *args: Any) -> None: ... + def setnchannels(self, nchannels: int) -> None: ... + def getnchannels(self) -> int: ... + def setsampwidth(self, sampwidth: int) -> None: ... + def getsampwidth(self) -> int: ... + def setframerate(self, framerate: float) -> None: ... + def getframerate(self) -> int: ... + def setnframes(self, nframes: int) -> None: ... + def getnframes(self) -> int: ... + def setcomptype(self, comptype: str, compname: str) -> None: ... + def getcomptype(self) -> str: ... + def getcompname(self) -> str: ... + def setparams(self, params: _sunau_params) -> None: ... + def getparams(self) -> _sunau_params: ... + def setmark(self, id: Any, pos: Any, name: Any) -> NoReturn: ... + def getmark(self, id: Any) -> NoReturn: ... + def getmarkers(self) -> None: ... + def tell(self) -> int: ... + # should be any bytes-like object after 3.4, but we don't have a type for that + def writeframesraw(self, data: bytes) -> None: ... + def writeframes(self, data: bytes) -> None: ... + def close(self) -> None: ... + +# Returns a Au_read if mode is rb and Au_write if mode is wb +def open(f: _File, mode: Optional[str] = ...) -> Any: ... +openfp = open diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/symtable.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/symtable.pyi new file mode 100644 index 00000000..fd8b9ad7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/symtable.pyi @@ -0,0 +1,45 @@ +import sys +from typing import List, Sequence, Tuple, Text + +def symtable(code: Text, filename: Text, compile_type: Text) -> SymbolTable: ... + +class SymbolTable(object): + def get_type(self) -> str: ... + def get_id(self) -> int: ... + def get_name(self) -> str: ... + def get_lineno(self) -> int: ... + def is_optimized(self) -> bool: ... + def is_nested(self) -> bool: ... + def has_children(self) -> bool: ... + def has_exec(self) -> bool: ... + if sys.version_info < (3, 0): + def has_import_star(self) -> bool: ... + def get_identifiers(self) -> Sequence[str]: ... + def lookup(self, name: str) -> Symbol: ... + def get_symbols(self) -> List[Symbol]: ... + def get_children(self) -> List[SymbolTable]: ... + +class Function(SymbolTable): + def get_parameters(self) -> Tuple[str, ...]: ... + def get_locals(self) -> Tuple[str, ...]: ... + def get_globals(self) -> Tuple[str, ...]: ... + def get_frees(self) -> Tuple[str, ...]: ... + +class Class(SymbolTable): + def get_methods(self) -> Tuple[str, ...]: ... + +class Symbol(object): + def get_name(self) -> str: ... + def is_referenced(self) -> bool: ... + def is_parameter(self) -> bool: ... + def is_global(self) -> bool: ... + def is_declared_global(self) -> bool: ... + def is_local(self) -> bool: ... + if sys.version_info >= (3, 6): + def is_annotated(self) -> bool: ... + def is_free(self) -> bool: ... + def is_imported(self) -> bool: ... + def is_assigned(self) -> bool: ... + def is_namespace(self) -> bool: ... + def get_namespaces(self) -> Sequence[SymbolTable]: ... + def get_namespace(self) -> SymbolTable: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sysconfig.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sysconfig.pyi new file mode 100644 index 00000000..5d6c9cb1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/sysconfig.pyi @@ -0,0 +1,19 @@ +# Stubs for sysconfig + +from typing import overload, Any, Dict, IO, List, Optional, Tuple, Union + +@overload +def get_config_vars() -> Dict[str, Any]: ... +@overload +def get_config_vars(arg: str, *args: str) -> List[Any]: ... +def get_config_var(name: str) -> Optional[str]: ... +def get_scheme_names() -> Tuple[str, ...]: ... +def get_path_names() -> Tuple[str, ...]: ... +def get_path(name: str, scheme: str = ..., vars: Optional[Dict[str, Any]] = ..., expand: bool = ...) -> Optional[str]: ... +def get_paths(scheme: str = ..., vars: Optional[Dict[str, Any]] = ..., expand: bool = ...) -> Dict[str, str]: ... +def get_python_version() -> str: ... +def get_platform() -> str: ... +def is_python_build() -> bool: ... +def parse_config_h(fp: IO[Any], vars: Optional[Dict[str, Any]]) -> Dict[str, Any]: ... +def get_config_h_filename() -> str: ... +def get_makefile_filename() -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/syslog.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/syslog.pyi new file mode 100644 index 00000000..1237a6b0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/syslog.pyi @@ -0,0 +1,44 @@ +from typing import overload + +LOG_ALERT: int +LOG_AUTH: int +LOG_CONS: int +LOG_CRIT: int +LOG_CRON: int +LOG_DAEMON: int +LOG_DEBUG: int +LOG_EMERG: int +LOG_ERR: int +LOG_INFO: int +LOG_KERN: int +LOG_LOCAL0: int +LOG_LOCAL1: int +LOG_LOCAL2: int +LOG_LOCAL3: int +LOG_LOCAL4: int +LOG_LOCAL5: int +LOG_LOCAL6: int +LOG_LOCAL7: int +LOG_LPR: int +LOG_MAIL: int +LOG_NDELAY: int +LOG_NEWS: int +LOG_NOTICE: int +LOG_NOWAIT: int +LOG_PERROR: int +LOG_PID: int +LOG_SYSLOG: int +LOG_USER: int +LOG_UUCP: int +LOG_WARNING: int + +def LOG_MASK(a: int) -> int: ... +def LOG_UPTO(a: int) -> int: ... +def closelog() -> None: ... +def openlog(ident: str = ..., logoption: int = ..., facility: int = ...) -> None: ... +def setlogmask(x: int) -> int: ... + +@overload +def syslog(priority: int, message: str) -> None: ... +@overload +def syslog(message: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/tabnanny.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/tabnanny.pyi new file mode 100644 index 00000000..cbc83533 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/tabnanny.pyi @@ -0,0 +1,22 @@ +# Stubs for tabnanny (Python 2 and 3) + +import os +import sys +from typing import Iterable, Tuple, Union + +if sys.version_info >= (3, 6): + _Path = Union[str, bytes, os.PathLike] +else: + _Path = Union[str, bytes] + +verbose: int +filename_only: int + +class NannyNag(Exception): + def __init__(self, lineno: int, msg: str, line: str) -> None: ... + def get_lineno(self) -> int: ... + def get_msg(self) -> str: ... + def get_line(self) -> str: ... + +def check(file: _Path) -> None: ... +def process_tokens(tokens: Iterable[Tuple[int, str, Tuple[int, int], Tuple[int, int], str]]) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/tarfile.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/tarfile.pyi new file mode 100644 index 00000000..98523fc4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/tarfile.pyi @@ -0,0 +1,186 @@ +# Stubs for tarfile + +from typing import ( + Callable, IO, Iterable, Iterator, List, Mapping, Optional, Type, + Union, +) +import os +import sys +from types import TracebackType + +if sys.version_info >= (3, 6): + _Path = Union[bytes, str, os.PathLike] +elif sys.version_info >= (3,): + _Path = Union[bytes, str] +else: + _Path = Union[str, unicode] + +ENCODING: str + +USTAR_FORMAT: int +GNU_FORMAT: int +PAX_FORMAT: int +DEFAULT_FORMAT: int + +REGTYPE: bytes +AREGTYPE: bytes +LNKTYPE: bytes +SYMTYPE: bytes +DIRTYPE: bytes +FIFOTYPE: bytes +CONTTYPE: bytes +CHRTYPE: bytes +BLKTYPE: bytes +GNUTYPE_SPARSE: bytes + +if sys.version_info < (3,): + TAR_PLAIN: int + TAR_GZIPPED: int + +def open(name: Optional[_Path] = ..., mode: str = ..., + fileobj: Optional[IO[bytes]] = ..., bufsize: int = ..., + *, format: Optional[int] = ..., tarinfo: Optional[TarInfo] = ..., + dereference: Optional[bool] = ..., + ignore_zeros: Optional[bool] = ..., + encoding: Optional[str] = ..., errors: str = ..., + pax_headers: Optional[Mapping[str, str]] = ..., + debug: Optional[int] = ..., + errorlevel: Optional[int] = ..., + compresslevel: Optional[int] = ...) -> TarFile: ... + +class TarFile(Iterable[TarInfo]): + name: Optional[_Path] + mode: str + fileobj: Optional[IO[bytes]] + format: Optional[int] + tarinfo: Optional[TarInfo] + dereference: Optional[bool] + ignore_zeros: Optional[bool] + encoding: Optional[str] + errors: str + pax_headers: Optional[Mapping[str, str]] + debug: Optional[int] + errorlevel: Optional[int] + if sys.version_info < (3,): + posix: bool + def __init__(self, name: Optional[_Path] = ..., mode: str = ..., + fileobj: Optional[IO[bytes]] = ..., + format: Optional[int] = ..., tarinfo: Optional[TarInfo] = ..., + dereference: Optional[bool] = ..., + ignore_zeros: Optional[bool] = ..., + encoding: Optional[str] = ..., errors: str = ..., + pax_headers: Optional[Mapping[str, str]] = ..., + debug: Optional[int] = ..., + errorlevel: Optional[int] = ..., + compresslevel: Optional[int] = ...) -> None: ... + def __enter__(self) -> TarFile: ... + def __exit__(self, + exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> None: ... + def __iter__(self) -> Iterator[TarInfo]: ... + @classmethod + def open(cls, name: Optional[_Path] = ..., mode: str = ..., + fileobj: Optional[IO[bytes]] = ..., bufsize: int = ..., + *, format: Optional[int] = ..., tarinfo: Optional[TarInfo] = ..., + dereference: Optional[bool] = ..., + ignore_zeros: Optional[bool] = ..., + encoding: Optional[str] = ..., errors: str = ..., + pax_headers: Optional[Mapping[str, str]] = ..., + debug: Optional[int] = ..., + errorlevel: Optional[int] = ...) -> TarFile: ... + def getmember(self, name: str) -> TarInfo: ... + def getmembers(self) -> List[TarInfo]: ... + def getnames(self) -> List[str]: ... + if sys.version_info >= (3, 5): + def list(self, verbose: bool = ..., + *, members: Optional[List[TarInfo]] = ...) -> None: ... + else: + def list(self, verbose: bool = ...) -> None: ... + def next(self) -> Optional[TarInfo]: ... + if sys.version_info >= (3, 5): + def extractall(self, path: _Path = ..., + members: Optional[List[TarInfo]] = ..., + *, numeric_owner: bool = ...) -> None: ... + else: + def extractall(self, path: _Path = ..., + members: Optional[List[TarInfo]] = ...) -> None: ... + if sys.version_info >= (3, 5): + def extract(self, member: Union[str, TarInfo], path: _Path = ..., + set_attrs: bool = ..., + *, numeric_owner: bool = ...) -> None: ... + else: + def extract(self, member: Union[str, TarInfo], + path: _Path = ...) -> None: ... + def extractfile(self, + member: Union[str, TarInfo]) -> Optional[IO[bytes]]: ... + if sys.version_info >= (3, 7): + def add(self, name: str, arcname: Optional[str] = ..., + recursive: bool = ..., *, + filter: Optional[Callable[[TarInfo], Optional[TarInfo]]] = ...) -> None: ... + elif sys.version_info >= (3,): + def add(self, name: str, arcname: Optional[str] = ..., + recursive: bool = ..., + exclude: Optional[Callable[[str], bool]] = ..., *, + filter: Optional[Callable[[TarInfo], Optional[TarInfo]]] = ...) -> None: ... + else: + def add(self, name: str, arcname: Optional[str] = ..., + recursive: bool = ..., + exclude: Optional[Callable[[str], bool]] = ..., + filter: Optional[Callable[[TarInfo], Optional[TarInfo]]] = ...) -> None: ... + def addfile(self, tarinfo: TarInfo, + fileobj: Optional[IO[bytes]] = ...) -> None: ... + def gettarinfo(self, name: Optional[str] = ..., + arcname: Optional[str] = ..., + fileobj: Optional[IO[bytes]] = ...) -> TarInfo: ... + def close(self) -> None: ... + +def is_tarfile(name: str) -> bool: ... + +if sys.version_info < (3, 8): + def filemode(mode: int) -> str: ... # undocumented + +if sys.version_info < (3,): + class TarFileCompat: + def __init__(self, filename: str, mode: str = ..., + compression: int = ...) -> None: ... + +class TarError(Exception): ... +class ReadError(TarError): ... +class CompressionError(TarError): ... +class StreamError(TarError): ... +class ExtractError(TarError): ... +class HeaderError(TarError): ... + +class TarInfo: + name: str + size: int + mtime: int + mode: int + type: bytes + linkname: str + uid: int + gid: int + uname: str + gname: str + pax_headers: Mapping[str, str] + def __init__(self, name: str = ...) -> None: ... + if sys.version_info >= (3,): + @classmethod + def frombuf(cls, buf: bytes, encoding: str, errors: str) -> TarInfo: ... + else: + @classmethod + def frombuf(cls, buf: bytes) -> TarInfo: ... + @classmethod + def fromtarfile(cls, tarfile: TarFile) -> TarInfo: ... + def tobuf(self, format: Optional[int] = ..., + encoding: Optional[str] = ..., errors: str = ...) -> bytes: ... + def isfile(self) -> bool: ... + def isreg(self) -> bool: ... + def isdir(self) -> bool: ... + def issym(self) -> bool: ... + def islnk(self) -> bool: ... + def ischr(self) -> bool: ... + def isblk(self) -> bool: ... + def isfifo(self) -> bool: ... + def isdev(self) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/telnetlib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/telnetlib.pyi new file mode 100644 index 00000000..50b90b58 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/telnetlib.pyi @@ -0,0 +1,115 @@ +# Stubs for telnetlib (Python 2 and 3) + +import socket +import sys +from typing import Any, Callable, Match, Optional, Pattern, Sequence, Tuple, Union + +DEBUGLEVEL: int +TELNET_PORT: int + +IAC: bytes +DONT: bytes +DO: bytes +WONT: bytes +WILL: bytes +theNULL: bytes + +SE: bytes +NOP: bytes +DM: bytes +BRK: bytes +IP: bytes +AO: bytes +AYT: bytes +EC: bytes +EL: bytes +GA: bytes +SB: bytes + +BINARY: bytes +ECHO: bytes +RCP: bytes +SGA: bytes +NAMS: bytes +STATUS: bytes +TM: bytes +RCTE: bytes +NAOL: bytes +NAOP: bytes +NAOCRD: bytes +NAOHTS: bytes +NAOHTD: bytes +NAOFFD: bytes +NAOVTS: bytes +NAOVTD: bytes +NAOLFD: bytes +XASCII: bytes +LOGOUT: bytes +BM: bytes +DET: bytes +SUPDUP: bytes +SUPDUPOUTPUT: bytes +SNDLOC: bytes +TTYPE: bytes +EOR: bytes +TUID: bytes +OUTMRK: bytes +TTYLOC: bytes +VT3270REGIME: bytes +X3PAD: bytes +NAWS: bytes +TSPEED: bytes +LFLOW: bytes +LINEMODE: bytes +XDISPLOC: bytes +OLD_ENVIRON: bytes +AUTHENTICATION: bytes +ENCRYPT: bytes +NEW_ENVIRON: bytes + +TN3270E: bytes +XAUTH: bytes +CHARSET: bytes +RSP: bytes +COM_PORT_OPTION: bytes +SUPPRESS_LOCAL_ECHO: bytes +TLS: bytes +KERMIT: bytes +SEND_URL: bytes +FORWARD_X: bytes +PRAGMA_LOGON: bytes +SSPI_LOGON: bytes +PRAGMA_HEARTBEAT: bytes +EXOPL: bytes +NOOPT: bytes + +class Telnet: + def __init__(self, host: Optional[str] = ..., port: int = ..., + timeout: int = ...) -> None: ... + def open(self, host: str, port: int = ..., timeout: int = ...) -> None: ... + def msg(self, msg: str, *args: Any) -> None: ... + def set_debuglevel(self, debuglevel: int) -> None: ... + def close(self) -> None: ... + def get_socket(self) -> socket.socket: ... + def fileno(self) -> int: ... + def write(self, buffer: bytes) -> None: ... + def read_until(self, match: bytes, timeout: Optional[int] = ...) -> bytes: ... + def read_all(self) -> bytes: ... + def read_some(self) -> bytes: ... + def read_very_eager(self) -> bytes: ... + def read_eager(self) -> bytes: ... + def read_lazy(self) -> bytes: ... + def read_very_lazy(self) -> bytes: ... + def read_sb_data(self) -> bytes: ... + def set_option_negotiation_callback(self, callback: Optional[Callable[[socket.socket, bytes, bytes], Any]]) -> None: ... + def process_rawq(self) -> None: ... + def rawq_getchar(self) -> bytes: ... + def fill_rawq(self) -> None: ... + def sock_avail(self) -> bool: ... + def interact(self) -> None: ... + def mt_interact(self) -> None: ... + def listener(self) -> None: ... + def expect(self, list: Sequence[Union[Pattern[bytes], bytes]], timeout: Optional[int] = ...) -> Tuple[int, Optional[Match[bytes]], bytes]: ... + if sys.version_info >= (3, 6): + def __enter__(self) -> Telnet: ... + def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/termios.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/termios.pyi new file mode 100644 index 00000000..d788e163 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/termios.pyi @@ -0,0 +1,248 @@ +# Stubs for termios + +from typing import IO, List, Union + +_FD = Union[int, IO[str]] +_Attr = List[Union[int, List[bytes]]] + +# TODO constants not really documented +B0: int +B1000000: int +B110: int +B115200: int +B1152000: int +B1200: int +B134: int +B150: int +B1500000: int +B1800: int +B19200: int +B200: int +B2000000: int +B230400: int +B2400: int +B2500000: int +B300: int +B3000000: int +B3500000: int +B38400: int +B4000000: int +B460800: int +B4800: int +B50: int +B500000: int +B57600: int +B576000: int +B600: int +B75: int +B921600: int +B9600: int +BRKINT: int +BS0: int +BS1: int +BSDLY: int +CBAUD: int +CBAUDEX: int +CDSUSP: int +CEOF: int +CEOL: int +CEOT: int +CERASE: int +CFLUSH: int +CIBAUD: int +CINTR: int +CKILL: int +CLNEXT: int +CLOCAL: int +CQUIT: int +CR0: int +CR1: int +CR2: int +CR3: int +CRDLY: int +CREAD: int +CRPRNT: int +CRTSCTS: int +CS5: int +CS6: int +CS7: int +CS8: int +CSIZE: int +CSTART: int +CSTOP: int +CSTOPB: int +CSUSP: int +CWERASE: int +ECHO: int +ECHOCTL: int +ECHOE: int +ECHOK: int +ECHOKE: int +ECHONL: int +ECHOPRT: int +EXTA: int +EXTB: int +FF0: int +FF1: int +FFDLY: int +FIOASYNC: int +FIOCLEX: int +FIONBIO: int +FIONCLEX: int +FIONREAD: int +FLUSHO: int +HUPCL: int +ICANON: int +ICRNL: int +IEXTEN: int +IGNBRK: int +IGNCR: int +IGNPAR: int +IMAXBEL: int +INLCR: int +INPCK: int +IOCSIZE_MASK: int +IOCSIZE_SHIFT: int +ISIG: int +ISTRIP: int +IUCLC: int +IXANY: int +IXOFF: int +IXON: int +NCC: int +NCCS: int +NL0: int +NL1: int +NLDLY: int +NOFLSH: int +N_MOUSE: int +N_PPP: int +N_SLIP: int +N_STRIP: int +N_TTY: int +OCRNL: int +OFDEL: int +OFILL: int +OLCUC: int +ONLCR: int +ONLRET: int +ONOCR: int +OPOST: int +PARENB: int +PARMRK: int +PARODD: int +PENDIN: int +TAB0: int +TAB1: int +TAB2: int +TAB3: int +TABDLY: int +TCFLSH: int +TCGETA: int +TCGETS: int +TCIFLUSH: int +TCIOFF: int +TCIOFLUSH: int +TCION: int +TCOFLUSH: int +TCOOFF: int +TCOON: int +TCSADRAIN: int +TCSAFLUSH: int +TCSANOW: int +TCSBRK: int +TCSBRKP: int +TCSETA: int +TCSETAF: int +TCSETAW: int +TCSETS: int +TCSETSF: int +TCSETSW: int +TCXONC: int +TIOCCONS: int +TIOCEXCL: int +TIOCGETD: int +TIOCGICOUNT: int +TIOCGLCKTRMIOS: int +TIOCGPGRP: int +TIOCGSERIAL: int +TIOCGSOFTCAR: int +TIOCGWINSZ: int +TIOCINQ: int +TIOCLINUX: int +TIOCMBIC: int +TIOCMBIS: int +TIOCMGET: int +TIOCMIWAIT: int +TIOCMSET: int +TIOCM_CAR: int +TIOCM_CD: int +TIOCM_CTS: int +TIOCM_DSR: int +TIOCM_DTR: int +TIOCM_LE: int +TIOCM_RI: int +TIOCM_RNG: int +TIOCM_RTS: int +TIOCM_SR: int +TIOCM_ST: int +TIOCNOTTY: int +TIOCNXCL: int +TIOCOUTQ: int +TIOCPKT: int +TIOCPKT_DATA: int +TIOCPKT_DOSTOP: int +TIOCPKT_FLUSHREAD: int +TIOCPKT_FLUSHWRITE: int +TIOCPKT_NOSTOP: int +TIOCPKT_START: int +TIOCPKT_STOP: int +TIOCSCTTY: int +TIOCSERCONFIG: int +TIOCSERGETLSR: int +TIOCSERGETMULTI: int +TIOCSERGSTRUCT: int +TIOCSERGWILD: int +TIOCSERSETMULTI: int +TIOCSERSWILD: int +TIOCSER_TEMT: int +TIOCSETD: int +TIOCSLCKTRMIOS: int +TIOCSPGRP: int +TIOCSSERIAL: int +TIOCSSOFTCAR: int +TIOCSTI: int +TIOCSWINSZ: int +TOSTOP: int +VDISCARD: int +VEOF: int +VEOL: int +VEOL2: int +VERASE: int +VINTR: int +VKILL: int +VLNEXT: int +VMIN: int +VQUIT: int +VREPRINT: int +VSTART: int +VSTOP: int +VSUSP: int +VSWTC: int +VSWTCH: int +VT0: int +VT1: int +VTDLY: int +VTIME: int +VWERASE: int +XCASE: int +XTABS: int + +def tcgetattr(fd: _FD) -> _Attr: ... +def tcsetattr(fd: _FD, when: int, attributes: _Attr) -> None: ... +def tcsendbreak(fd: _FD, duration: int) -> None: ... +def tcdrain(fd: _FD) -> None: ... +def tcflush(fd: _FD, queue: int) -> None: ... +def tcflow(fd: _FD, action: int) -> None: ... + +class error(Exception): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/threading.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/threading.pyi new file mode 100644 index 00000000..ca1b0fd2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/threading.pyi @@ -0,0 +1,196 @@ +# Stubs for threading + +from typing import ( + Any, Callable, Iterable, List, Mapping, Optional, Tuple, Type, Union, + TypeVar, +) +from types import FrameType, TracebackType +import sys + +# TODO recursive type +_TF = Callable[[FrameType, str, Any], Optional[Callable[..., Any]]] + +_PF = Callable[[FrameType, str, Any], None] +_T = TypeVar('_T') + + +def active_count() -> int: ... +if sys.version_info < (3,): + def activeCount() -> int: ... + +def current_thread() -> Thread: ... +def currentThread() -> Thread: ... + +if sys.version_info >= (3,): + def get_ident() -> int: ... + +def enumerate() -> List[Thread]: ... + +if sys.version_info >= (3, 4): + def main_thread() -> Thread: ... + +if sys.version_info >= (3, 8): + from _thread import get_native_id as get_native_id + +def settrace(func: _TF) -> None: ... +def setprofile(func: Optional[_PF]) -> None: ... +def stack_size(size: int = ...) -> int: ... + +if sys.version_info >= (3,): + TIMEOUT_MAX: float + +class ThreadError(Exception): ... + + +class local(object): + def __getattribute__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __delattr__(self, name: str) -> None: ... + + +class Thread: + name: str + ident: Optional[int] + daemon: bool + if sys.version_info >= (3,): + def __init__(self, group: None = ..., + target: Optional[Callable[..., Any]] = ..., + name: Optional[str] = ..., + args: Iterable[Any] = ..., + kwargs: Mapping[str, Any] = ..., + *, daemon: Optional[bool] = ...) -> None: ... + else: + def __init__(self, group: None = ..., + target: Optional[Callable[..., Any]] = ..., + name: Optional[str] = ..., + args: Iterable[Any] = ..., + kwargs: Mapping[str, Any] = ...) -> None: ... + def start(self) -> None: ... + def run(self) -> None: ... + def join(self, timeout: Optional[float] = ...) -> None: ... + def getName(self) -> str: ... + def setName(self, name: str) -> None: ... + if sys.version_info >= (3, 8): + @property + def native_id(self) -> Optional[int]: ... # only available on some platforms + def is_alive(self) -> bool: ... + def isAlive(self) -> bool: ... + def isDaemon(self) -> bool: ... + def setDaemon(self, daemonic: bool) -> None: ... + + +class _DummyThread(Thread): ... + + +class Lock: + def __init__(self) -> None: ... + def __enter__(self) -> bool: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> Optional[bool]: ... + if sys.version_info >= (3,): + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + else: + def acquire(self, blocking: bool = ...) -> bool: ... + def release(self) -> None: ... + def locked(self) -> bool: ... + + +class _RLock: + def __init__(self) -> None: ... + def __enter__(self) -> bool: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> Optional[bool]: ... + if sys.version_info >= (3,): + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + else: + def acquire(self, blocking: bool = ...) -> bool: ... + def release(self) -> None: ... + + +RLock = _RLock + + +class Condition: + def __init__(self, lock: Union[Lock, _RLock, None] = ...) -> None: ... + def __enter__(self) -> bool: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> Optional[bool]: ... + if sys.version_info >= (3,): + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + else: + def acquire(self, blocking: bool = ...) -> bool: ... + def release(self) -> None: ... + def wait(self, timeout: Optional[float] = ...) -> bool: ... + if sys.version_info >= (3,): + def wait_for(self, predicate: Callable[[], _T], + timeout: Optional[float] = ...) -> _T: ... + def notify(self, n: int = ...) -> None: ... + def notify_all(self) -> None: ... + def notifyAll(self) -> None: ... + + +class Semaphore: + def __init__(self, value: int = ...) -> None: ... + def __enter__(self) -> bool: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> Optional[bool]: ... + if sys.version_info >= (3,): + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + else: + def acquire(self, blocking: bool = ...) -> bool: ... + def release(self) -> None: ... + +class BoundedSemaphore: + def __init__(self, value: int = ...) -> None: ... + def __enter__(self) -> bool: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> Optional[bool]: ... + if sys.version_info >= (3,): + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + else: + def acquire(self, blocking: bool = ...) -> bool: ... + def release(self) -> None: ... + + +class Event: + def __init__(self) -> None: ... + def is_set(self) -> bool: ... + if sys.version_info < (3,): + def isSet(self) -> bool: ... + def set(self) -> None: ... + def clear(self) -> None: ... + def wait(self, timeout: Optional[float] = ...) -> bool: ... + +if sys.version_info >= (3, 8): + from _thread import _ExceptHookArgs as ExceptHookArgs, ExceptHookArgs as _ExceptHookArgs # don't ask + excepthook: Callable[[_ExceptHookArgs], Any] + +class Timer(Thread): + if sys.version_info >= (3,): + def __init__(self, interval: float, function: Callable[..., None], + args: Optional[Iterable[Any]] = ..., + kwargs: Optional[Mapping[str, Any]] = ...) -> None: ... + else: + def __init__(self, interval: float, function: Callable[..., None], + args: Iterable[Any] = ..., + kwargs: Mapping[str, Any] = ...) -> None: ... + def cancel(self) -> None: ... + + +if sys.version_info >= (3,): + class Barrier: + parties: int + n_waiting: int + broken: bool + def __init__(self, parties: int, action: Optional[Callable[[], None]] = ..., + timeout: Optional[float] = ...) -> None: ... + def wait(self, timeout: Optional[float] = ...) -> int: ... + def reset(self) -> None: ... + def abort(self) -> None: ... + + class BrokenBarrierError(RuntimeError): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/time.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/time.pyi new file mode 100644 index 00000000..0c2370ad --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/time.pyi @@ -0,0 +1,113 @@ +"""Stub file for the 'time' module.""" +# See https://docs.python.org/3/library/time.html + +import sys +from typing import Any, NamedTuple, Tuple, Union, Optional +if sys.version_info >= (3, 3): + from types import SimpleNamespace + +_TimeTuple = Tuple[int, int, int, int, int, int, int, int, int] + +if sys.version_info < (3, 3): + accept2dyear: bool +altzone: int +daylight: int +timezone: int +tzname: Tuple[str, str] + +if sys.version_info >= (3, 7) and sys.platform != 'win32': + CLOCK_BOOTTIME: int # Linux + CLOCK_PROF: int # FreeBSD, NetBSD, OpenBSD + CLOCK_UPTIME: int # FreeBSD, OpenBSD + +if sys.version_info >= (3, 3) and sys.platform != 'win32': + CLOCK_HIGHRES: int # Solaris only + CLOCK_MONOTONIC: int # Unix only + CLOCK_MONOTONIC_RAW: int # Linux 2.6.28 or later + CLOCK_PROCESS_CPUTIME_ID: int # Unix only + CLOCK_REALTIME: int # Unix only + CLOCK_THREAD_CPUTIME_ID: int # Unix only + +if sys.version_info >= (3, 8) and sys.platform == "darwin": + CLOCK_UPTIME_RAW: int + +if sys.version_info >= (3, 3): + class _struct_time(NamedTuple): + tm_year: int + tm_mon: int + tm_mday: int + tm_hour: int + tm_min: int + tm_sec: int + tm_wday: int + tm_yday: int + tm_isdst: int + tm_zone: str + tm_gmtoff: int + class struct_time(_struct_time): + def __init__( + self, + o: Union[ + Tuple[int, int, int, int, int, int, int, int, int], + Tuple[int, int, int, int, int, int, int, int, int, str], + Tuple[int, int, int, int, int, int, int, int, int, str, int] + ], + _arg: Any = ..., + ) -> None: ... + def __new__( + cls, + o: Union[ + Tuple[int, int, int, int, int, int, int, int, int], + Tuple[int, int, int, int, int, int, int, int, int, str], + Tuple[int, int, int, int, int, int, int, int, int, str, int] + ], + _arg: Any = ..., + ) -> struct_time: ... +else: + class _struct_time(NamedTuple): + tm_year: int + tm_mon: int + tm_mday: int + tm_hour: int + tm_min: int + tm_sec: int + tm_wday: int + tm_yday: int + tm_isdst: int + class struct_time(_struct_time): + def __init__(self, o: _TimeTuple, _arg: Any = ...) -> None: ... + def __new__(cls, o: _TimeTuple, _arg: Any = ...) -> struct_time: ... + +def asctime(t: Union[_TimeTuple, struct_time] = ...) -> str: ... +if sys.version_info < (3, 8): + def clock() -> float: ... +def ctime(secs: Optional[float] = ...) -> str: ... +def gmtime(secs: Optional[float] = ...) -> struct_time: ... +def localtime(secs: Optional[float] = ...) -> struct_time: ... +def mktime(t: Union[_TimeTuple, struct_time]) -> float: ... +def sleep(secs: float) -> None: ... +def strftime(format: str, t: Union[_TimeTuple, struct_time] = ...) -> str: ... +def strptime(string: str, format: str = ...) -> struct_time: ... +def time() -> float: ... +if sys.platform != 'win32': + def tzset() -> None: ... # Unix only + +if sys.version_info >= (3, 3): + def get_clock_info(name: str) -> SimpleNamespace: ... + def monotonic() -> float: ... + def perf_counter() -> float: ... + def process_time() -> float: ... + if sys.platform != 'win32': + def clock_getres(clk_id: int) -> float: ... # Unix only + def clock_gettime(clk_id: int) -> float: ... # Unix only + def clock_settime(clk_id: int, time: float) -> None: ... # Unix only + +if sys.version_info >= (3, 7): + def clock_gettime_ns(clock_id: int) -> int: ... + def clock_settime_ns(clock_id: int, time: int) -> int: ... + def monotonic_ns() -> int: ... + def perf_counter_ns() -> int: ... + def process_time_ns() -> int: ... + def time_ns() -> int: ... + def thread_time() -> float: ... + def thread_time_ns() -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/timeit.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/timeit.pyi new file mode 100644 index 00000000..bc4cbba8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/timeit.pyi @@ -0,0 +1,34 @@ +# Stubs for timeit (Python 2 and 3) + +import sys +from typing import Any, Callable, Dict, IO, List, Optional, Sequence, Text, Tuple, Union + +_str = Union[str, Text] +_Timer = Callable[[], float] +_stmt = Union[_str, Callable[[], Any]] + +default_timer: _Timer + +class Timer: + if sys.version_info >= (3, 5): + def __init__(self, stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., + globals: Optional[Dict[str, Any]] = ...) -> None: ... + else: + def __init__(self, stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ...) -> None: ... + def print_exc(self, file: Optional[IO[str]] = ...) -> None: ... + def timeit(self, number: int = ...) -> float: ... + def repeat(self, repeat: int = ..., number: int = ...) -> List[float]: ... + if sys.version_info >= (3, 6): + def autorange(self, callback: Optional[Callable[[int, float], Any]] = ...) -> Tuple[int, float]: ... + +if sys.version_info >= (3, 5): + def timeit(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., + number: int = ..., globals: Optional[Dict[str, Any]] = ...) -> float: ... + def repeat(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., + repeat: int = ..., number: int = ..., globals: Optional[Dict[str, Any]] = ...) -> List[float]: ... +else: + def timeit(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., + number: int = ...) -> float: ... + def repeat(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., + repeat: int = ..., number: int = ...) -> List[float]: ... +def main(args: Optional[Sequence[str]]) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/token.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/token.pyi new file mode 100644 index 00000000..c75f865e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/token.pyi @@ -0,0 +1,75 @@ +import sys +from typing import Dict + +ENDMARKER: int +NAME: int +NUMBER: int +STRING: int +NEWLINE: int +INDENT: int +DEDENT: int +LPAR: int +RPAR: int +LSQB: int +RSQB: int +COLON: int +COMMA: int +SEMI: int +PLUS: int +MINUS: int +STAR: int +SLASH: int +VBAR: int +AMPER: int +LESS: int +GREATER: int +EQUAL: int +DOT: int +PERCENT: int +if sys.version_info < (3,): + BACKQUOTE: int +LBRACE: int +RBRACE: int +EQEQUAL: int +NOTEQUAL: int +LESSEQUAL: int +GREATEREQUAL: int +TILDE: int +CIRCUMFLEX: int +LEFTSHIFT: int +RIGHTSHIFT: int +DOUBLESTAR: int +PLUSEQUAL: int +MINEQUAL: int +STAREQUAL: int +SLASHEQUAL: int +PERCENTEQUAL: int +AMPEREQUAL: int +VBAREQUAL: int +CIRCUMFLEXEQUAL: int +LEFTSHIFTEQUAL: int +RIGHTSHIFTEQUAL: int +DOUBLESTAREQUAL: int +DOUBLESLASH: int +DOUBLESLASHEQUAL: int +AT: int +if sys.version_info >= (3,): + RARROW: int + ELLIPSIS: int +if sys.version_info >= (3, 5): + ATEQUAL: int + AWAIT: int + ASYNC: int +OP: int +ERRORTOKEN: int +N_TOKENS: int +NT_OFFSET: int +tok_name: Dict[int, str] +if sys.version_info >= (3, 7): + COMMENT: int + NL: int + ENCODING: int + +def ISTERMINAL(x: int) -> bool: ... +def ISNONTERMINAL(x: int) -> bool: ... +def ISEOF(x: int) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/trace.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/trace.pyi new file mode 100644 index 00000000..af06d39c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/trace.pyi @@ -0,0 +1,35 @@ +# Stubs for trace (Python 2 and 3) + +import os +import sys +import types +from typing import Any, Callable, Mapping, Optional, Sequence, Text, Tuple, TypeVar, Union + +_T = TypeVar('_T') +_localtrace = Callable[[types.FrameType, str, Any], Callable[..., Any]] + +if sys.version_info >= (3, 6): + _Path = Union[Text, os.PathLike] +else: + _Path = Text + +class CoverageResults: + def update(self, other: CoverageResults) -> None: ... + def write_results(self, show_missing: bool = ..., summary: bool = ..., coverdir: Optional[_Path] = ...) -> None: ... + def write_results_file(self, path: _Path, lines: Sequence[str], lnotab: Any, lines_hit: Mapping[int, int], encoding: Optional[str] = ...) -> Tuple[int, int]: ... + +class Trace: + def __init__(self, count: int = ..., trace: int = ..., countfuncs: int = ..., countcallers: int = ..., + ignoremods: Sequence[str] = ..., ignoredirs: Sequence[str] = ..., infile: Optional[_Path] = ..., + outfile: Optional[_Path] = ..., timing: bool = ...) -> None: ... + def run(self, cmd: Union[str, types.CodeType]) -> None: ... + def runctx(self, cmd: Union[str, types.CodeType], globals: Optional[Mapping[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ...) -> None: ... + def runfunc(self, func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ... + def file_module_function_of(self, frame: types.FrameType) -> Tuple[str, Optional[str], str]: ... + def globaltrace_trackcallers(self, frame: types.FrameType, why: str, arg: Any) -> None: ... + def globaltrace_countfuncs(self, frame: types.FrameType, why: str, arg: Any) -> None: ... + def globaltrace_lt(self, frame: types.FrameType, why: str, arg: Any) -> None: ... + def localtrace_trace_and_count(self, frame: types.FrameType, why: str, arg: Any) -> _localtrace: ... + def localtrace_trace(self, frame: types.FrameType, why: str, arg: Any) -> _localtrace: ... + def localtrace_count(self, frame: types.FrameType, why: str, arg: Any) -> _localtrace: ... + def results(self) -> CoverageResults: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/traceback.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/traceback.pyi new file mode 100644 index 00000000..e6744007 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/traceback.pyi @@ -0,0 +1,120 @@ +# Stubs for traceback + +from typing import Any, Dict, Generator, IO, Iterator, List, Mapping, Optional, Protocol, Tuple, Type, Iterable +from types import FrameType, TracebackType +import sys + +_PT = Tuple[str, int, str, Optional[str]] + + +def print_tb(tb: Optional[TracebackType], limit: Optional[int] = ..., + file: Optional[IO[str]] = ...) -> None: ... +if sys.version_info >= (3,): + def print_exception(etype: Optional[Type[BaseException]], + value: Optional[BaseException], + tb: Optional[TracebackType], limit: Optional[int] = ..., + file: Optional[IO[str]] = ..., + chain: bool = ...) -> None: ... + def print_exc(limit: Optional[int] = ..., file: Optional[IO[str]] = ..., + chain: bool = ...) -> None: ... + def print_last(limit: Optional[int] = ..., file: Optional[IO[str]] = ..., + chain: bool = ...) -> None: ... +else: + def print_exception(etype: Optional[Type[BaseException]], + value: Optional[BaseException], + tb: Optional[TracebackType], limit: Optional[int] = ..., + file: Optional[IO[str]] = ...) -> None: ... + def print_exc(limit: Optional[int] = ..., + file: Optional[IO[str]] = ...) -> None: ... + def print_last(limit: Optional[int] = ..., + file: Optional[IO[str]] = ...) -> None: ... +def print_stack(f: Optional[FrameType] = ..., limit: Optional[int] = ..., + file: Optional[IO[str]] = ...) -> None: ... + +if sys.version_info >= (3, 5): + def extract_tb(tb: Optional[TracebackType], limit: Optional[int] = ...) -> StackSummary: ... + def extract_stack(f: Optional[FrameType] = ..., + limit: Optional[int] = ...) -> StackSummary: ... + def format_list(extracted_list: List[FrameSummary]) -> List[str]: ... + class _Writer(Protocol): + def write(self, s: str) -> Any: ... + # undocumented + def print_list(extracted_list: List[FrameSummary], file: Optional[_Writer] = ...) -> None: ... +else: + def extract_tb(tb: Optional[TracebackType], limit: Optional[int] = ...) -> List[_PT]: ... + def extract_stack(f: Optional[FrameType] = ..., + limit: Optional[int] = ...) -> List[_PT]: ... + def format_list(extracted_list: List[_PT]) -> List[str]: ... +def format_exception_only(etype: Optional[Type[BaseException]], + value: Optional[BaseException]) -> List[str]: ... +if sys.version_info >= (3,): + def format_exception(etype: Optional[Type[BaseException]], value: Optional[BaseException], + tb: Optional[TracebackType], limit: Optional[int] = ..., + chain: bool = ...) -> List[str]: ... + def format_exc(limit: Optional[int] = ..., chain: bool = ...) -> str: ... +else: + def format_exception(etype: Optional[Type[BaseException]], + value: Optional[BaseException], + tb: Optional[TracebackType], + limit: Optional[int] = ...) -> List[str]: ... + def format_exc(limit: Optional[int] = ...) -> str: ... +def format_tb(tb: Optional[TracebackType], limit: Optional[int] = ...) -> List[str]: ... +def format_stack(f: Optional[FrameType] = ..., + limit: Optional[int] = ...) -> List[str]: ... +if sys.version_info >= (3, 4): + def clear_frames(tb: TracebackType) -> None: ... +if sys.version_info >= (3, 5): + def walk_stack(f: Optional[FrameType]) -> Iterator[Tuple[FrameType, int]]: ... + def walk_tb(tb: Optional[TracebackType]) -> Iterator[Tuple[FrameType, int]]: ... +if sys.version_info < (3,): + def tb_lineno(tb: TracebackType) -> int: ... + + +if sys.version_info >= (3, 5): + class TracebackException: + __cause__: TracebackException + __context__: TracebackException + __suppress_context__: bool + stack: StackSummary + exc_type: Type[BaseException] + filename: str + lineno: int + text: str + offset: int + msg: str + def __init__(self, exc_type: Type[BaseException], + exc_value: BaseException, exc_traceback: TracebackType, + *, limit: Optional[int] = ..., lookup_lines: bool = ..., + capture_locals: bool = ...) -> None: ... + @classmethod + def from_exception(cls, exc: BaseException, + *, limit: Optional[int] = ..., + lookup_lines: bool = ..., + capture_locals: bool = ...) -> TracebackException: ... + def format(self, *, chain: bool = ...) -> Generator[str, None, None]: ... + def format_exception_only(self) -> Generator[str, None, None]: ... + + class FrameSummary(Iterable[Any]): + filename: str + lineno: int + name: str + line: str + locals: Optional[Dict[str, str]] + def __init__(self, filename: str, lineno: int, name: str, + lookup_line: bool = ..., + locals: Optional[Mapping[str, str]] = ..., + line: Optional[str] = ...) -> None: ... + # TODO: more precise typing for __getitem__ and __iter__, + # for a namedtuple-like view on (filename, lineno, name, str). + def __getitem__(self, i: int) -> Any: ... + def __iter__(self) -> Iterator[Any]: ... + + class StackSummary(List[FrameSummary]): + @classmethod + def extract(cls, + frame_gen: Generator[Tuple[FrameType, int], None, None], + *, limit: Optional[int] = ..., lookup_lines: bool = ..., + capture_locals: bool = ...) -> StackSummary: ... + @classmethod + def from_list(cls, a_list: List[_PT]) -> StackSummary: ... + def format(self) -> List[str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/tty.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/tty.pyi new file mode 100644 index 00000000..2bce1eca --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/tty.pyi @@ -0,0 +1,17 @@ +# Stubs for tty (Python 3.6) + +from typing import IO, Union + +_FD = Union[int, IO[str]] + +# XXX: Undocumented integer constants +IFLAG: int +OFLAG: int +CFLAG: int +LFLAG: int +ISPEED: int +OSPEED: int +CC: int + +def setraw(fd: _FD, when: int = ...) -> None: ... +def setcbreak(fd: _FD, when: int = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/turtle.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/turtle.pyi new file mode 100644 index 00000000..c9d9d90f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/turtle.pyi @@ -0,0 +1,501 @@ +from typing import Tuple, overload, Optional, Union, Dict, Any, Sequence, TypeVar, List, Callable, Text +import sys +if sys.version_info >= (3,): + from tkinter import Canvas, PhotoImage +else: + # TODO: Replace these aliases once we have Python 2 stubs for the Tkinter module. + Canvas = Any + PhotoImage = Any + +# Note: '_Color' is the alias we use for arguments and _AnyColor is the +# alias we use for return types. Really, these two aliases should be the +# same, but as per the "no union returns" typeshed policy, we'll return +# Any instead. +_Color = Union[Text, Tuple[float, float, float]] +_AnyColor = Any + +# TODO: Replace this with a TypedDict once it becomes standardized. +_PenState = Dict[str, Any] + +_Speed = Union[str, float] +_PolygonCoords = Sequence[Tuple[float, float]] + +# TODO: Type this more accurately +# Vec2D is actually a custom subclass of 'tuple'. +Vec2D = Tuple[float, float] + +class TurtleScreenBase(object): + cv: Canvas = ... + canvwidth: int = ... + canvheight: int = ... + xscale: float = ... + yscale: float = ... + def __init__(self, cv: Canvas) -> None: ... + if sys.version_info >= (3,): + def mainloop(self) -> None: ... + def textinput(self, title: str, prompt: str) -> Optional[str]: ... + def numinput(self, title: str, prompt: str, default: Optional[float] = ..., minval: Optional[float] = ..., maxval: Optional[float] = ...) -> Optional[float]: ... + +class Terminator(Exception): ... +class TurtleGraphicsError(Exception): ... + +class Shape(object): + def __init__(self, type_: str, data: Union[_PolygonCoords, PhotoImage, None] = ...) -> None: ... + def addcomponent(self, poly: _PolygonCoords, fill: _Color, outline: Optional[_Color] = ...) -> None: ... + +class TurtleScreen(TurtleScreenBase): + def __init__(self, cv: Canvas, mode: str = ..., colormode: float = ..., delay: int = ...) -> None: ... + def clear(self) -> None: ... + @overload + def mode(self) -> str: ... + @overload + def mode(self, mode: str) -> None: ... + def setworldcoordinates(self, llx: float, lly: float, urx: float, ury: float) -> None: ... + def register_shape(self, name: str, shape: Union[_PolygonCoords, Shape, None] = ...) -> None: ... + @overload + def colormode(self) -> float: ... + @overload + def colormode(self, cmode: float) -> None: ... + def reset(self) -> None: ... + def turtles(self) -> List[Turtle]: ... + @overload + def bgcolor(self) -> _AnyColor: ... + @overload + def bgcolor(self, color: _Color) -> None: ... + @overload + def bgcolor(self, r: float, g: float, b: float) -> None: ... + @overload + def tracer(self) -> int: ... + @overload + def tracer(self, n: int, delay: Optional[int] = ...) -> None: ... + @overload + def delay(self) -> int: ... + @overload + def delay(self, delay: int) -> None: ... + def update(self) -> None: ... + def window_width(self) -> int: ... + def window_height(self) -> int: ... + def getcanvas(self) -> Canvas: ... + def getshapes(self) -> List[str]: ... + def onclick(self, fun: Callable[[float, float], Any], btn: int = ..., add: Optional[Any] = ...) -> None: ... + def onkey(self, fun: Callable[[], Any], key: str) -> None: ... + def listen(self, xdummy: Optional[float] = ..., ydummy: Optional[float] = ...) -> None: ... + def ontimer(self, fun: Callable[[], Any], t: int = ...) -> None: ... + @overload + def bgpic(self) -> str: ... + @overload + def bgpic(self, picname: str) -> None: ... + @overload + def screensize(self) -> Tuple[int, int]: ... + @overload + def screensize(self, canvwidth: int, canvheight: int, bg: Optional[_Color] = ...) -> None: ... + onscreenclick = onclick + resetscreen = reset + clearscreen = clear + addshape = register_shape + if sys.version_info >= (3,): + def onkeypress(self, fun: Callable[[], Any], key: Optional[str] = ...) -> None: ... + onkeyrelease = onkey + +class TNavigator(object): + START_ORIENTATION: Dict[str, Vec2D] = ... + DEFAULT_MODE: str = ... + DEFAULT_ANGLEOFFSET: int = ... + DEFAULT_ANGLEORIENT: int = ... + def __init__(self, mode: str = ...) -> None: ... + def reset(self) -> None: ... + def degrees(self, fullcircle: float = ...) -> None: ... + def radians(self) -> None: ... + def forward(self, distance: float) -> None: ... + def back(self, distance: float) -> None: ... + def right(self, angle: float) -> None: ... + def left(self, angle: float) -> None: ... + def pos(self) -> Vec2D: ... + def xcor(self) -> float: ... + def ycor(self) -> float: ... + @overload + def goto(self, x: Tuple[float, float]) -> None: ... + @overload + def goto(self, x: float, y: float) -> None: ... + def home(self) -> None: ... + def setx(self, x: float) -> None: ... + def sety(self, y: float) -> None: ... + @overload + def distance(self, x: Union[TNavigator, Tuple[float, float]]) -> float: ... + @overload + def distance(self, x: float, y: float) -> float: ... + @overload + def towards(self, x: Union[TNavigator, Tuple[float, float]]) -> float: ... + @overload + def towards(self, x: float, y: float) -> float: ... + def heading(self) -> float: ... + def setheading(self, to_angle: float) -> None: ... + def circle(self, radius: float, extent: Optional[float] = ..., steps: Optional[int] = ...) -> None: ... + fd = forward + bk = back + backward = back + rt = right + lt = left + position = pos + setpos = goto + setposition = goto + seth = setheading + + +class TPen(object): + def __init__(self, resizemode: str = ...) -> None: ... + @overload + def resizemode(self) -> str: ... + @overload + def resizemode(self, rmode: str) -> None: ... + @overload + def pensize(self) -> int: ... + @overload + def pensize(self, width: int) -> None: ... + def penup(self) -> None: ... + def pendown(self) -> None: ... + def isdown(self) -> bool: ... + @overload + def speed(self) -> int: ... + @overload + def speed(self, speed: _Speed) -> None: ... + @overload + def pencolor(self) -> _AnyColor: ... + @overload + def pencolor(self, color: _Color) -> None: ... + @overload + def pencolor(self, r: float, g: float, b: float) -> None: ... + @overload + def fillcolor(self) -> _AnyColor: ... + @overload + def fillcolor(self, color: _Color) -> None: ... + @overload + def fillcolor(self, r: float, g: float, b: float) -> None: ... + @overload + def color(self) -> Tuple[_AnyColor, _AnyColor]: ... + @overload + def color(self, color: _Color) -> None: ... + @overload + def color(self, r: float, g: float, b: float) -> None: ... + @overload + def color(self, color1: _Color, color2: _Color) -> None: ... + def showturtle(self) -> None: ... + def hideturtle(self) -> None: ... + def isvisible(self) -> bool: ... + # Note: signatures 1 and 2 overlap unsafely when no arguments are provided + @overload + def pen(self) -> _PenState: ... # type: ignore + @overload + def pen(self, pen: Optional[_PenState] = ..., *, + shown: bool = ..., pendown: bool = ..., pencolor: _Color = ..., fillcolor: _Color = ..., + pensize: int = ..., speed: int = ..., resizemode: str = ..., stretchfactor: Tuple[float, float] = ..., + outline: int = ..., tilt: float = ...) -> None: ... + width = pensize + up = penup + pu = penup + pd = pendown + down = pendown + st = showturtle + ht = hideturtle + +_T = TypeVar('_T') + +class RawTurtle(TPen, TNavigator): + def __init__(self, canvas: Union[Canvas, TurtleScreen, None] = ..., shape: str = ..., undobuffersize: int = ..., visible: bool = ...) -> None: ... + def reset(self) -> None: ... + def setundobuffer(self, size: Optional[int]) -> None: ... + def undobufferentries(self) -> int: ... + def clear(self) -> None: ... + def clone(self: _T) -> _T: ... + @overload + def shape(self) -> str: ... + @overload + def shape(self, name: str) -> None: ... + # Unsafely overlaps when no arguments are provided + @overload + def shapesize(self) -> Tuple[float, float, float]: ... # type: ignore + @overload + def shapesize(self, stretch_wid: Optional[float] = ..., stretch_len: Optional[float] = ..., outline: Optional[float] = ...) -> None: ... + if sys.version_info >= (3,): + @overload + def shearfactor(self) -> float: ... + @overload + def shearfactor(self, shear: float) -> None: ... + # Unsafely overlaps when no arguments are provided + @overload + def shapetransform(self) -> Tuple[float, float, float, float]: ... # type: ignore + @overload + def shapetransform(self, t11: Optional[float] = ..., t12: Optional[float] = ..., t21: Optional[float] = ..., t22: Optional[float] = ...) -> None: ... + def get_shapepoly(self) -> Optional[_PolygonCoords]: ... + def settiltangle(self, angle: float) -> None: ... + @overload + def tiltangle(self) -> float: ... + @overload + def tiltangle(self, angle: float) -> None: ... + def tilt(self, angle: float) -> None: ... + # Can return either 'int' or Tuple[int, ...] based on if the stamp is + # a compound stamp or not. So, as per the "no Union return" policy, + # we return Any. + def stamp(self) -> Any: ... + def clearstamp(self, stampid: Union[int, Tuple[int, ...]]) -> None: ... + def clearstamps(self, n: Optional[int] = ...) -> None: ... + def filling(self) -> bool: ... + def begin_fill(self) -> None: ... + def end_fill(self) -> None: ... + def dot(self, size: Optional[int] = ..., *color: _Color) -> None: ... + def write(self, arg: object, move: bool = ..., align: str = ..., font: Tuple[str, int, str] = ...) -> None: ... + def begin_poly(self) -> None: ... + def end_poly(self) -> None: ... + def get_poly(self) -> Optional[_PolygonCoords]: ... + def getscreen(self) -> TurtleScreen: ... + def getturtle(self: _T) -> _T: ... + getpen = getturtle + def onclick(self, fun: Callable[[float, float], Any], btn: int = ..., add: Optional[bool] = ...) -> None: ... + def onrelease(self, fun: Callable[[float, float], Any], btn: int = ..., add: Optional[bool] = ...) -> None: ... + def ondrag(self, fun: Callable[[float, float], Any], btn: int = ..., add: Optional[bool] = ...) -> None: ... + def undo(self) -> None: ... + turtlesize = shapesize + +class _Screen(TurtleScreen): + def __init__(self) -> None: ... + def setup(self, width: int = ..., height: int = ..., startx: int = ..., starty: int = ...) -> None: ... + def title(self, titlestring: str) -> None: ... + def bye(self) -> None: ... + def exitonclick(self) -> None: ... + +def Screen() -> _Screen: ... + +class Turtle(RawTurtle): + def __init__(self, shape: str = ..., undobuffersize: int = ..., visible: bool = ...) -> None: ... + +RawPen = RawTurtle +Pen = Turtle + +def write_docstringdict(filename: str) -> None: ... + +# Note: it's somewhat unfortunate that we have to copy the function signatures. +# It would be nice if we could partially reduce the redundancy by doing something +# like the following: +# +# _screen: Screen +# clear = _screen.clear +# +# However, it seems pytype does not support this type of syntax in pyi files. + +# Functions copied from TurtleScreenBase: + +# Note: mainloop() was always present in the global scope, but was added to +# TurtleScreenBase in Python 3.0 +def mainloop() -> None: ... +if sys.version_info >= (3,): + def textinput(title: str, prompt: str) -> Optional[str]: ... + def numinput(title: str, prompt: str, default: Optional[float] = ..., minval: Optional[float] = ..., maxval: Optional[float] = ...) -> Optional[float]: ... + +# Functions copied from TurtleScreen: + +def clear() -> None: ... +@overload +def mode() -> str: ... +@overload +def mode(mode: str) -> None: ... +def setworldcoordinates(llx: float, lly: float, urx: float, ury: float) -> None: ... +def register_shape(name: str, shape: Union[_PolygonCoords, Shape, None] = ...) -> None: ... +@overload +def colormode() -> float: ... +@overload +def colormode(cmode: float) -> None: ... +def reset() -> None: ... +def turtles() -> List[Turtle]: ... +@overload +def bgcolor() -> _AnyColor: ... +@overload +def bgcolor(color: _Color) -> None: ... +@overload +def bgcolor(r: float, g: float, b: float) -> None: ... +@overload +def tracer() -> int: ... +@overload +def tracer(n: int, delay: Optional[int] = ...) -> None: ... +@overload +def delay() -> int: ... +@overload +def delay(delay: int) -> None: ... +def update() -> None: ... +def window_width() -> int: ... +def window_height() -> int: ... +def getcanvas() -> Canvas: ... +def getshapes() -> List[str]: ... +def onclick(fun: Callable[[float, float], Any], btn: int = ..., add: Optional[Any] = ...) -> None: ... +def onkey(fun: Callable[[], Any], key: str) -> None: ... +def listen(xdummy: Optional[float] = ..., ydummy: Optional[float] = ...) -> None: ... +def ontimer(fun: Callable[[], Any], t: int = ...) -> None: ... +@overload +def bgpic() -> str: ... +@overload +def bgpic(picname: str) -> None: ... +@overload +def screensize() -> Tuple[int, int]: ... +@overload +def screensize(canvwidth: int, canvheight: int, bg: Optional[_Color] = ...) -> None: ... +onscreenclick = onclick +resetscreen = reset +clearscreen = clear +addshape = register_shape +if sys.version_info >= (3,): + def onkeypress(fun: Callable[[], Any], key: Optional[str] = ...) -> None: ... + onkeyrelease = onkey + +# Functions copied from TNavigator: + +def degrees(fullcircle: float = ...) -> None: ... +def radians() -> None: ... +def forward(distance: float) -> None: ... +def back(distance: float) -> None: ... +def right(angle: float) -> None: ... +def left(angle: float) -> None: ... +def pos() -> Vec2D: ... +def xcor() -> float: ... +def ycor() -> float: ... +@overload +def goto(x: Tuple[float, float]) -> None: ... +@overload +def goto(x: float, y: float) -> None: ... +def home() -> None: ... +def setx(x: float) -> None: ... +def sety(y: float) -> None: ... +@overload +def distance(x: Union[TNavigator, Tuple[float, float]]) -> float: ... +@overload +def distance(x: float, y: float) -> float: ... +@overload +def towards(x: Union[TNavigator, Tuple[float, float]]) -> float: ... +@overload +def towards(x: float, y: float) -> float: ... +def heading() -> float: ... +def setheading(to_angle: float) -> None: ... +def circle(radius: float, extent: Optional[float] = ..., steps: Optional[int] = ...) -> None: ... +fd = forward +bk = back +backward = back +rt = right +lt = left +position = pos +setpos = goto +setposition = goto +seth = setheading + +# Functions copied from TPen: + +@overload +def resizemode() -> str: ... +@overload +def resizemode(rmode: str) -> None: ... +@overload +def pensize() -> int: ... +@overload +def pensize(width: int) -> None: ... +def penup() -> None: ... +def pendown() -> None: ... +def isdown() -> bool: ... +@overload +def speed() -> int: ... +@overload +def speed(speed: _Speed) -> None: ... +@overload +def pencolor() -> _AnyColor: ... +@overload +def pencolor(color: _Color) -> None: ... +@overload +def pencolor(r: float, g: float, b: float) -> None: ... +@overload +def fillcolor() -> _AnyColor: ... +@overload +def fillcolor(color: _Color) -> None: ... +@overload +def fillcolor(r: float, g: float, b: float) -> None: ... +@overload +def color() -> Tuple[_AnyColor, _AnyColor]: ... +@overload +def color(color: _Color) -> None: ... +@overload +def color(r: float, g: float, b: float) -> None: ... +@overload +def color(color1: _Color, color2: _Color) -> None: ... +def showturtle() -> None: ... +def hideturtle() -> None: ... +def isvisible() -> bool: ... +# Note: signatures 1 and 2 overlap unsafely when no arguments are provided +@overload +def pen() -> _PenState: ... # type: ignore +@overload +def pen(pen: Optional[_PenState] = ..., *, + shown: bool = ..., pendown: bool = ..., pencolor: _Color = ..., fillcolor: _Color = ..., + pensize: int = ..., speed: int = ..., resizemode: str = ..., stretchfactor: Tuple[float, float] = ..., + outline: int = ..., tilt: float = ...) -> None: ... +width = pensize +up = penup +pu = penup +pd = pendown +down = pendown +st = showturtle +ht = hideturtle + +# Functions copied from RawTurtle: + +def setundobuffer(size: Optional[int]) -> None: ... +def undobufferentries() -> int: ... +@overload +def shape() -> str: ... +@overload +def shape(name: str) -> None: ... +# Unsafely overlaps when no arguments are provided +@overload +def shapesize() -> Tuple[float, float, float]: ... # type: ignore +@overload +def shapesize(stretch_wid: Optional[float] = ..., stretch_len: Optional[float] = ..., outline: Optional[float] = ...) -> None: ... +if sys.version_info >= (3,): + @overload + def shearfactor() -> float: ... + @overload + def shearfactor(shear: float) -> None: ... + # Unsafely overlaps when no arguments are provided + @overload + def shapetransform() -> Tuple[float, float, float, float]: ... # type: ignore + @overload + def shapetransform(t11: Optional[float] = ..., t12: Optional[float] = ..., t21: Optional[float] = ..., t22: Optional[float] = ...) -> None: ... + def get_shapepoly() -> Optional[_PolygonCoords]: ... +def settiltangle(angle: float) -> None: ... +@overload +def tiltangle() -> float: ... +@overload +def tiltangle(angle: float) -> None: ... +def tilt(angle: float) -> None: ... +# Can return either 'int' or Tuple[int, ...] based on if the stamp is +# a compound stamp or not. So, as per the "no Union return" policy, +# we return Any. +def stamp() -> Any: ... +def clearstamp(stampid: Union[int, Tuple[int, ...]]) -> None: ... +def clearstamps(n: Optional[int] = ...) -> None: ... +def filling() -> bool: ... +def begin_fill() -> None: ... +def end_fill() -> None: ... +def dot(size: Optional[int] = ..., *color: _Color) -> None: ... +def write(arg: object, move: bool = ..., align: str = ..., font: Tuple[str, int, str] = ...) -> None: ... +def begin_poly() -> None: ... +def end_poly() -> None: ... +def get_poly() -> Optional[_PolygonCoords]: ... +def getscreen() -> TurtleScreen: ... +def getturtle() -> Turtle: ... +getpen = getturtle +def onrelease(fun: Callable[[float, float], Any], btn: int = ..., add: Optional[Any] = ...) -> None: ... +def ondrag(fun: Callable[[float, float], Any], btn: int = ..., add: Optional[Any] = ...) -> None: ... +def undo() -> None: ... +turtlesize = shapesize + +# Functions copied from RawTurtle with a few tweaks: + +def clone() -> Turtle: ... + +# Extra functions present only in the global scope: + +done = mainloop diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/unicodedata.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/unicodedata.pyi new file mode 100644 index 00000000..ddd10136 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/unicodedata.pyi @@ -0,0 +1,40 @@ +import sys +from typing import Any, Text, TypeVar, Union + +ucd_3_2_0: UCD +ucnhash_CAPI: Any +unidata_version: str + +_default = TypeVar('_default') + +def bidirectional(__chr: Text) -> Text: ... +def category(__chr: Text) -> Text: ... +def combining(__chr: Text) -> int: ... +def decimal(__chr: Text, __default: _default = ...) -> Union[int, _default]: ... +def decomposition(__chr: Text) -> Text: ... +def digit(__chr: Text, __default: _default = ...) -> Union[int, _default]: ... +def east_asian_width(__chr: Text) -> Text: ... +if sys.version_info >= (3, 8): + def is_normalized(__form: str, __unistr: str) -> bool: ... +def lookup(__name: Union[Text, bytes]) -> Text: ... +def mirrored(__chr: Text) -> int: ... +def name(__chr: Text, __default: _default = ...) -> Union[Text, _default]: ... +def normalize(__form: Text, __unistr: Text) -> Text: ... +def numeric(__chr: Text, __default: _default = ...) -> Union[float, _default]: ... + +class UCD(object): + # The methods below are constructed from the same array in C + # (unicodedata_functions) and hence identical to the methods above. + unidata_version: str + def bidirectional(self, __chr: Text) -> str: ... + def category(self, __chr: Text) -> str: ... + def combining(self, __chr: Text) -> int: ... + def decimal(self, __chr: Text, __default: _default = ...) -> Union[int, _default]: ... + def decomposition(self, __chr: Text) -> str: ... + def digit(self, __chr: Text, __default: _default = ...) -> Union[int, _default]: ... + def east_asian_width(self, __chr: Text) -> str: ... + def lookup(self, __name: Union[Text, bytes]) -> Text: ... + def mirrored(self, __chr: Text) -> int: ... + def name(self, __chr: Text, __default: _default = ...) -> Union[Text, _default]: ... + def normalize(self, __form: Text, __unistr: Text) -> Text: ... + def numeric(self, __chr: Text, __default: _default = ...) -> Union[float, _default]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/uu.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/uu.pyi new file mode 100644 index 00000000..c926dbba --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/uu.pyi @@ -0,0 +1,13 @@ +# Stubs for uu (Python 2 and 3) +import sys +from typing import BinaryIO, Union, Optional, Text + +_File = Union[Text, BinaryIO] + +class Error(Exception): ... + +if sys.version_info >= (3, 7): + def encode(in_file: _File, out_file: _File, name: Optional[str] = ..., mode: Optional[int] = ..., backtick: bool = ...) -> None: ... +else: + def encode(in_file: _File, out_file: _File, name: Optional[str] = ..., mode: Optional[int] = ...) -> None: ... +def decode(in_file: _File, out_file: Optional[_File] = ..., mode: Optional[int] = ..., quiet: int = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/uuid.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/uuid.pyi new file mode 100644 index 00000000..9c009d92 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/uuid.pyi @@ -0,0 +1,90 @@ +# Stubs for uuid + +import sys +from typing import Tuple, Optional, Any, Text + +# Because UUID has properties called int and bytes we need to rename these temporarily. +_Int = int +_Bytes = bytes +_FieldsType = Tuple[int, int, int, int, int, int] + +class UUID: + def __init__(self, hex: Optional[Text] = ..., + bytes: Optional[_Bytes] = ..., + bytes_le: Optional[_Bytes] = ..., + fields: Optional[_FieldsType] = ..., + int: Optional[_Int] = ..., + version: Optional[_Int] = ...) -> None: ... + @property + def bytes(self) -> _Bytes: ... + @property + def bytes_le(self) -> _Bytes: ... + @property + def clock_seq(self) -> _Int: ... + @property + def clock_seq_hi_variant(self) -> _Int: ... + @property + def clock_seq_low(self) -> _Int: ... + @property + def fields(self) -> _FieldsType: ... + @property + def hex(self) -> str: ... + @property + def int(self) -> _Int: ... + @property + def node(self) -> _Int: ... + @property + def time(self) -> _Int: ... + @property + def time_hi_version(self) -> _Int: ... + @property + def time_low(self) -> _Int: ... + @property + def time_mid(self) -> _Int: ... + @property + def urn(self) -> str: ... + @property + def variant(self) -> str: ... + @property + def version(self) -> Optional[_Int]: ... + + def __int__(self) -> _Int: ... + + if sys.version_info >= (3,): + def __eq__(self, other: Any) -> bool: ... + def __lt__(self, other: Any) -> bool: ... + def __le__(self, other: Any) -> bool: ... + def __gt__(self, other: Any) -> bool: ... + def __ge__(self, other: Any) -> bool: ... + else: + def get_bytes(self) -> _Bytes: ... + def get_bytes_le(self) -> _Bytes: ... + def get_clock_seq(self) -> _Int: ... + def get_clock_seq_hi_variant(self) -> _Int: ... + def get_clock_seq_low(self) -> _Int: ... + def get_fields(self) -> _FieldsType: ... + def get_hex(self) -> str: ... + def get_node(self) -> _Int: ... + def get_time(self) -> _Int: ... + def get_time_hi_version(self) -> _Int: ... + def get_time_low(self) -> _Int: ... + def get_time_mid(self) -> _Int: ... + def get_urn(self) -> str: ... + def get_variant(self) -> str: ... + def get_version(self) -> Optional[_Int]: ... + def __cmp__(self, other: Any) -> _Int: ... + +def getnode() -> int: ... +def uuid1(node: Optional[_Int] = ..., clock_seq: Optional[_Int] = ...) -> UUID: ... +def uuid3(namespace: UUID, name: str) -> UUID: ... +def uuid4() -> UUID: ... +def uuid5(namespace: UUID, name: str) -> UUID: ... + +NAMESPACE_DNS: UUID +NAMESPACE_URL: UUID +NAMESPACE_OID: UUID +NAMESPACE_X500: UUID +RESERVED_NCS: str +RFC_4122: str +RESERVED_MICROSOFT: str +RESERVED_FUTURE: str diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/warnings.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/warnings.pyi new file mode 100644 index 00000000..71be4895 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/warnings.pyi @@ -0,0 +1,41 @@ +from typing import List, NamedTuple, Optional, overload, TextIO, Type +from types import ModuleType, TracebackType +from typing_extensions import Literal + +from _warnings import warn as warn, warn_explicit as warn_explicit + +def showwarning( + message: str, category: Type[Warning], filename: str, lineno: int, file: Optional[TextIO] = ..., line: Optional[str] = ... +) -> None: ... +def formatwarning(message: str, category: Type[Warning], filename: str, lineno: int, line: Optional[str] = ...) -> str: ... +def filterwarnings( + action: str, message: str = ..., category: Type[Warning] = ..., module: str = ..., lineno: int = ..., append: bool = ... +) -> None: ... +def simplefilter(action: str, category: Type[Warning] = ..., lineno: int = ..., append: bool = ...) -> None: ... +def resetwarnings() -> None: ... + +class _Record(NamedTuple): + message: str + category: Type[Warning] + filename: str + lineno: int + file: Optional[TextIO] + line: Optional[str] + +class catch_warnings: + @overload + def __new__(cls, *, record: Literal[False] = ..., module: Optional[ModuleType] = ...) -> _catch_warnings_without_records: ... + @overload + def __new__(cls, *, record: Literal[True], module: Optional[ModuleType] = ...) -> _catch_warnings_with_records: ... + @overload + def __new__(cls, *, record: bool, module: Optional[ModuleType] = ...) -> catch_warnings: ... + def __enter__(self) -> Optional[List[_Record]]: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> None: ... + +class _catch_warnings_without_records(catch_warnings): + def __enter__(self) -> None: ... + +class _catch_warnings_with_records(catch_warnings): + def __enter__(self) -> List[_Record]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wave.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wave.pyi new file mode 100644 index 00000000..52bc9b15 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wave.pyi @@ -0,0 +1,75 @@ +# Stubs for wave (Python 2 and 3) + +import sys +from typing import ( + Any, NamedTuple, NoReturn, Optional, Text, BinaryIO, Union, Tuple +) + +_File = Union[Text, BinaryIO] + +class Error(Exception): ... + +WAVE_FORMAT_PCM: int + +if sys.version_info < (3, 0): + _wave_params = Tuple[int, int, int, int, str, str] +else: + class _wave_params(NamedTuple): + nchannels: int + sampwidth: int + framerate: int + nframes: int + comptype: str + compname: str + +class Wave_read: + def __init__(self, f: _File) -> None: ... + if sys.version_info >= (3, 0): + def __enter__(self) -> Wave_read: ... + def __exit__(self, *args: Any) -> None: ... + def getfp(self) -> Optional[BinaryIO]: ... + def rewind(self) -> None: ... + def close(self) -> None: ... + def tell(self) -> int: ... + def getnchannels(self) -> int: ... + def getnframes(self) -> int: ... + def getsampwidth(self) -> int: ... + def getframerate(self) -> int: ... + def getcomptype(self) -> str: ... + def getcompname(self) -> str: ... + def getparams(self) -> _wave_params: ... + def getmarkers(self) -> None: ... + def getmark(self, id: Any) -> NoReturn: ... + def setpos(self, pos: int) -> None: ... + def readframes(self, nframes: int) -> bytes: ... + +class Wave_write: + def __init__(self, f: _File) -> None: ... + if sys.version_info >= (3, 0): + def __enter__(self) -> Wave_write: ... + def __exit__(self, *args: Any) -> None: ... + def setnchannels(self, nchannels: int) -> None: ... + def getnchannels(self) -> int: ... + def setsampwidth(self, sampwidth: int) -> None: ... + def getsampwidth(self) -> int: ... + def setframerate(self, framerate: float) -> None: ... + def getframerate(self) -> int: ... + def setnframes(self, nframes: int) -> None: ... + def getnframes(self) -> int: ... + def setcomptype(self, comptype: str, compname: str) -> None: ... + def getcomptype(self) -> str: ... + def getcompname(self) -> str: ... + def setparams(self, params: _wave_params) -> None: ... + def getparams(self) -> _wave_params: ... + def setmark(self, id: Any, pos: Any, name: Any) -> NoReturn: ... + def getmark(self, id: Any) -> NoReturn: ... + def getmarkers(self) -> None: ... + def tell(self) -> int: ... + # should be any bytes-like object after 3.4, but we don't have a type for that + def writeframesraw(self, data: bytes) -> None: ... + def writeframes(self, data: bytes) -> None: ... + def close(self) -> None: ... + +# Returns a Wave_read if mode is rb and Wave_write if mode is wb +def open(f: _File, mode: Optional[str] = ...) -> Any: ... +openfp = open diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/weakref.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/weakref.pyi new file mode 100644 index 00000000..e3ddbf27 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/weakref.pyi @@ -0,0 +1,110 @@ +import sys +import types +from typing import ( + TypeVar, Generic, Any, Callable, overload, Mapping, Iterator, Tuple, + Iterable, Optional, Type, MutableMapping, Union, List, Dict +) + +from _weakref import ( + getweakrefcount as getweakrefcount, + getweakrefs as getweakrefs, + ref as ref, + proxy as proxy, + CallableProxyType as CallableProxyType, + ProxyType as ProxyType, + ReferenceType as ReferenceType) +from _weakrefset import WeakSet as WeakSet + +if sys.version_info < (3, 0): + from exceptions import ReferenceError as ReferenceError + +_S = TypeVar('_S') +_T = TypeVar('_T') +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') + +ProxyTypes: Tuple[Type[Any], ...] + +if sys.version_info >= (3, 4): + class WeakMethod(ref[types.MethodType]): + def __new__(cls, meth: types.MethodType, callback: Optional[Callable[[types.MethodType], Any]] = ...) -> WeakMethod: ... + def __call__(self) -> Optional[types.MethodType]: ... + +class WeakValueDictionary(MutableMapping[_KT, _VT]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, __map: Union[Mapping[_KT, _VT], Iterable[Tuple[_KT, _VT]]], **kwargs: _VT) -> None: ... + + def __len__(self) -> int: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __setitem__(self, k: _KT, v: _VT) -> None: ... + def __delitem__(self, v: _KT) -> None: ... + if sys.version_info < (3, 0): + def has_key(self, key: object) -> bool: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_KT]: ... + def __str__(self) -> str: ... + + def copy(self) -> WeakValueDictionary[_KT, _VT]: ... + + if sys.version_info < (3, 0): + def keys(self) -> List[_KT]: ... + def values(self) -> List[_VT]: ... + def items(self) -> List[Tuple[_KT, _VT]]: ... + def iterkeys(self) -> Iterator[_KT]: ... + def itervalues(self) -> Iterator[_VT]: ... + def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... + else: + # These are incompatible with Mapping + def keys(self) -> Iterator[_KT]: ... # type: ignore + def values(self) -> Iterator[_VT]: ... # type: ignore + def items(self) -> Iterator[Tuple[_KT, _VT]]: ... # type: ignore + def itervaluerefs(self) -> Iterator[KeyedRef[_KT, _VT]]: ... + def valuerefs(self) -> List[KeyedRef[_KT, _VT]]: ... + +class KeyedRef(ref[_T], Generic[_KT, _T]): + key: _KT + def __init__(self, ob: _T, callback: Callable[[_T], Any], key: _KT) -> None: ... + +class WeakKeyDictionary(MutableMapping[_KT, _VT]): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, __map: Union[Mapping[_KT, _VT], Iterable[Tuple[_KT, _VT]]], **kwargs: _VT) -> None: ... + + def __len__(self) -> int: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __setitem__(self, k: _KT, v: _VT) -> None: ... + def __delitem__(self, v: _KT) -> None: ... + if sys.version_info < (3, 0): + def has_key(self, key: object) -> bool: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_KT]: ... + def __str__(self) -> str: ... + + def copy(self) -> WeakKeyDictionary[_KT, _VT]: ... + + if sys.version_info < (3, 0): + def keys(self) -> List[_KT]: ... + def values(self) -> List[_VT]: ... + def items(self) -> List[Tuple[_KT, _VT]]: ... + def iterkeys(self) -> Iterator[_KT]: ... + def itervalues(self) -> Iterator[_VT]: ... + def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ... + def iterkeyrefs(self) -> Iterator[ref[_KT]]: ... + else: + # These are incompatible with Mapping + def keys(self) -> Iterator[_KT]: ... # type: ignore + def values(self) -> Iterator[_VT]: ... # type: ignore + def items(self) -> Iterator[Tuple[_KT, _VT]]: ... # type: ignore + def keyrefs(self) -> List[ref[_KT]]: ... + +if sys.version_info >= (3, 4): + class finalize: + def __init__(self, obj: _S, func: Callable[..., _T], *args: Any, **kwargs: Any) -> None: ... + def __call__(self, _: Any = ...) -> Optional[_T]: ... + def detach(self) -> Optional[Tuple[_S, _T, Tuple[Any, ...], Dict[str, Any]]]: ... + def peek(self) -> Optional[Tuple[_S, _T, Tuple[Any, ...], Dict[str, Any]]]: ... + alive: bool + atexit: bool diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/webbrowser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/webbrowser.pyi new file mode 100644 index 00000000..11103757 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/webbrowser.pyi @@ -0,0 +1,98 @@ +import sys +from typing import Any, Optional, Callable, List, Text, Union, Sequence + +class Error(Exception): ... + +if sys.version_info >= (3, 7): + def register(name: Text, klass: Optional[Callable[[], BaseBrowser]], instance: BaseBrowser = ..., *, preferred: bool = ...) -> None: ... +else: + def register(name: Text, klass: Optional[Callable[[], BaseBrowser]], instance: BaseBrowser = ..., update_tryorder: int = ...) -> None: ... +def get(using: Optional[Text] = ...) -> BaseBrowser: ... +def open(url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... +def open_new(url: Text) -> bool: ... +def open_new_tab(url: Text) -> bool: ... + +class BaseBrowser: + args: List[str] + name: str + basename: str + def __init__(self, name: Text = ...) -> None: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + def open_new(self, url: Text) -> bool: ... + def open_new_tab(self, url: Text) -> bool: ... + +class GenericBrowser(BaseBrowser): + args: List[str] + name: str + basename: str + def __init__(self, name: Union[Text, Sequence[Text]]) -> None: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class BackgroundBrowser(GenericBrowser): + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class UnixBrowser(BaseBrowser): + raise_opts: List[str] + background: bool + redirect_stdout: bool + remote_args: List[str] + remote_action: str + remote_action_newwin: str + remote_action_newtab: str + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class Mozilla(UnixBrowser): + raise_opts: List[str] + remote_args: List[str] + remote_action: str + remote_action_newwin: str + remote_action_newtab: str + background: bool + +class Galeon(UnixBrowser): + raise_opts: List[str] + remote_args: List[str] + remote_action: str + remote_action_newwin: str + background: bool + +class Chrome(UnixBrowser): + remote_args: List[str] + remote_action: str + remote_action_newwin: str + remote_action_newtab: str + background: bool + +class Opera(UnixBrowser): + raise_opts: List[str] + remote_args: List[str] + remote_action: str + remote_action_newwin: str + remote_action_newtab: str + background: bool + +class Elinks(UnixBrowser): + remote_args: List[str] + remote_action: str + remote_action_newwin: str + remote_action_newtab: str + background: bool + redirect_stdout: bool + +class Konqueror(BaseBrowser): + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class Grail(BaseBrowser): + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class WindowsDefault(BaseBrowser): + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class MacOSX(BaseBrowser): + name: str + def __init__(self, name: Text) -> None: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... + +class MacOSXOSAScript(BaseBrowser): + def __init__(self, name: Text) -> None: ... + def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wsgiref/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wsgiref/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wsgiref/handlers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wsgiref/handlers.pyi new file mode 100644 index 00000000..3271c881 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wsgiref/handlers.pyi @@ -0,0 +1,87 @@ +import sys +from abc import abstractmethod +from types import TracebackType +from typing import Optional, Dict, MutableMapping, Type, Text, Callable, List, Tuple, IO + +from .headers import Headers +from .types import WSGIApplication, WSGIEnvironment, StartResponse, InputStream, ErrorStream +from .util import FileWrapper, guess_scheme + +_exc_info = Tuple[Optional[Type[BaseException]], + Optional[BaseException], + Optional[TracebackType]] + +def format_date_time(timestamp: Optional[float]) -> str: ... # undocumented +if sys.version_info >= (3, 2): + def read_environ() -> Dict[str, str]: ... + +class BaseHandler: + wsgi_version: Tuple[int, int] # undocumented + wsgi_multithread: bool + wsgi_multiprocess: bool + wsgi_run_once: bool + + origin_server: bool + http_version: str + server_software: Optional[str] + + os_environ: MutableMapping[str, str] + + wsgi_file_wrapper: Optional[Type[FileWrapper]] + headers_class: Type[Headers] # undocumented + + traceback_limit: Optional[int] + error_status: str + error_headers: List[Tuple[Text, Text]] + error_body: bytes + + def run(self, application: WSGIApplication) -> None: ... + + def setup_environ(self) -> None: ... + def finish_response(self) -> None: ... + def get_scheme(self) -> str: ... + def set_content_length(self) -> None: ... + def cleanup_headers(self) -> None: ... + def start_response(self, status: Text, headers: List[Tuple[Text, Text]], exc_info: Optional[_exc_info] = ...) -> Callable[[bytes], None]: ... + def send_preamble(self) -> None: ... + def write(self, data: bytes) -> None: ... + def sendfile(self) -> bool: ... + def finish_content(self) -> None: ... + def close(self) -> None: ... + def send_headers(self) -> None: ... + def result_is_file(self) -> bool: ... + def client_is_modern(self) -> bool: ... + def log_exception(self, exc_info: _exc_info) -> None: ... + def handle_error(self) -> None: ... + def error_output(self, environ: WSGIEnvironment, start_response: StartResponse) -> List[bytes]: ... + + @abstractmethod + def _write(self, data: bytes) -> None: ... + @abstractmethod + def _flush(self) -> None: ... + @abstractmethod + def get_stdin(self) -> InputStream: ... + @abstractmethod + def get_stderr(self) -> ErrorStream: ... + @abstractmethod + def add_cgi_vars(self) -> None: ... + +class SimpleHandler(BaseHandler): + stdin: InputStream + stdout: IO[bytes] + stderr: ErrorStream + base_env: MutableMapping[str, str] + def __init__(self, stdin: InputStream, stdout: IO[bytes], stderr: ErrorStream, environ: MutableMapping[str, str], multithread: bool = ..., multiprocess: bool = ...) -> None: ... + def get_stdin(self) -> InputStream: ... + def get_stderr(self) -> ErrorStream: ... + def add_cgi_vars(self) -> None: ... + def _write(self, data: bytes) -> None: ... + def _flush(self) -> None: ... + +class BaseCGIHandler(SimpleHandler): ... + +class CGIHandler(BaseCGIHandler): + def __init__(self) -> None: ... + +class IISCGIHandler(BaseCGIHandler): + def __init__(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wsgiref/headers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wsgiref/headers.pyi new file mode 100644 index 00000000..85392252 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wsgiref/headers.pyi @@ -0,0 +1,31 @@ +import sys +from typing import overload, Pattern, Optional, List, Tuple + +_HeaderList = List[Tuple[str, str]] + +tspecials: Pattern[str] # undocumented + +class Headers: + if sys.version_info < (3, 5): + def __init__(self, headers: _HeaderList) -> None: ... + else: + def __init__(self, headers: Optional[_HeaderList] = ...) -> None: ... + def __len__(self) -> int: ... + def __setitem__(self, name: str, val: str) -> None: ... + def __delitem__(self, name: str) -> None: ... + def __getitem__(self, name: str) -> Optional[str]: ... + if sys.version_info < (3,): + def has_key(self, name: str) -> bool: ... + def __contains__(self, name: str) -> bool: ... + def get_all(self, name: str) -> List[str]: ... + @overload + def get(self, name: str, default: str) -> str: ... + @overload + def get(self, name: str, default: Optional[str] = ...) -> Optional[str]: ... + def keys(self) -> List[str]: ... + def values(self) -> List[str]: ... + def items(self) -> _HeaderList: ... + if sys.version_info >= (3,): + def __bytes__(self) -> bytes: ... + def setdefault(self, name: str, value: str) -> str: ... + def add_header(self, _name: str, _value: Optional[str], **_params: Optional[str]) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wsgiref/simple_server.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wsgiref/simple_server.pyi new file mode 100644 index 00000000..50b8377e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wsgiref/simple_server.pyi @@ -0,0 +1,40 @@ +import sys +from typing import Optional, List, Type, TypeVar, overload + +from .handlers import SimpleHandler +from .types import WSGIApplication, WSGIEnvironment, StartResponse, ErrorStream + +if sys.version_info < (3,): + from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer +else: + from http.server import HTTPServer, BaseHTTPRequestHandler + +server_version: str # undocumented +sys_version: str # undocumented +software_version: str # undocumented + +class ServerHandler(SimpleHandler): # undocumented + server_software: str + def close(self) -> None: ... + +class WSGIServer(HTTPServer): + application: Optional[WSGIApplication] + base_environ: WSGIEnvironment # only available after call to setup_environ() + def setup_environ(self) -> None: ... + def get_app(self) -> Optional[WSGIApplication]: ... + def set_app(self, application: Optional[WSGIApplication]) -> None: ... + +class WSGIRequestHandler(BaseHTTPRequestHandler): + server_version: str + def get_environ(self) -> WSGIEnvironment: ... + def get_stderr(self) -> ErrorStream: ... + def handle(self) -> None: ... + +def demo_app(environ: WSGIEnvironment, start_response: StartResponse) -> List[bytes]: ... + +_S = TypeVar("_S", bound=WSGIServer) + +@overload +def make_server(host: str, port: int, app: WSGIApplication, *, handler_class: Type[WSGIRequestHandler] = ...) -> WSGIServer: ... +@overload +def make_server(host: str, port: int, app: WSGIApplication, server_class: Type[_S], handler_class: Type[WSGIRequestHandler] = ...) -> _S: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wsgiref/types.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wsgiref/types.pyi new file mode 100644 index 00000000..39a913ee --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wsgiref/types.pyi @@ -0,0 +1,44 @@ +# Type declaration for a WSGI Function +# +# wsgiref/types.py doesn't exist and neither do the types defined in this +# file. They are provided for type checking purposes. +# +# This means you cannot simply import wsgiref.types in your code. Instead, +# use the `TYPE_CHECKING` flag from the typing module: +# +# from typing import TYPE_CHECKING +# +# if TYPE_CHECKING: +# from wsgiref.types import WSGIApplication +# +# This import is now only taken into account by the type checker. Consequently, +# you need to use 'WSGIApplication' and not simply WSGIApplication when type +# hinting your code. Otherwise Python will raise NameErrors. + +from sys import _OptExcInfo +from typing import Callable, Dict, Iterable, List, Any, Text, Protocol, Tuple, Optional + +class StartResponse(Protocol): + def __call__(self, status: str, headers: List[Tuple[str, str]], exc_info: Optional[_OptExcInfo] = ...) -> Callable[[bytes], Any]: ... + +WSGIEnvironment = Dict[Text, Any] +WSGIApplication = Callable[[WSGIEnvironment, StartResponse], Iterable[bytes]] + +# WSGI input streams per PEP 3333 +class InputStream(Protocol): + def read(self, size: int = ...) -> bytes: ... + def readline(self, size: int = ...) -> bytes: ... + def readlines(self, hint: int = ...) -> List[bytes]: ... + def __iter__(self) -> Iterable[bytes]: ... + +# WSGI error streams per PEP 3333 +class ErrorStream(Protocol): + def flush(self) -> None: ... + def write(self, s: str) -> None: ... + def writelines(self, seq: List[str]) -> None: ... + +class _Readable(Protocol): + def read(self, size: int = ...) -> bytes: ... +# Optional file wrapper in wsgi.file_wrapper +class FileWrapper(Protocol): + def __call__(self, file: _Readable, block_size: int = ...) -> Iterable[bytes]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wsgiref/util.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wsgiref/util.pyi new file mode 100644 index 00000000..501ddcd5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wsgiref/util.pyi @@ -0,0 +1,23 @@ +import sys +from typing import IO, Any, Optional + +from .types import WSGIEnvironment + +class FileWrapper: + filelike: IO[bytes] + blksize: int + def __init__(self, filelike: IO[bytes], bklsize: int = ...) -> None: ... + def __getitem__(self, key: Any) -> bytes: ... + def __iter__(self) -> FileWrapper: ... + if sys.version_info < (3,): + def next(self) -> bytes: ... + else: + def __next__(self) -> bytes: ... + def close(self) -> None: ... # only exists if filelike.close exists + +def guess_scheme(environ: WSGIEnvironment) -> str: ... +def application_uri(environ: WSGIEnvironment) -> str: ... +def request_uri(environ: WSGIEnvironment, include_query: bool = ...) -> str: ... +def shift_path_info(environ: WSGIEnvironment) -> Optional[str]: ... +def setup_testing_defaults(environ: WSGIEnvironment) -> None: ... +def is_hop_by_hop(header_name: str) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wsgiref/validate.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wsgiref/validate.pyi new file mode 100644 index 00000000..c7fa699f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/wsgiref/validate.pyi @@ -0,0 +1,53 @@ +import sys +from typing import Any, Iterable, Iterator, Optional, NoReturn, Callable + +from wsgiref.types import WSGIApplication, InputStream, ErrorStream + +class WSGIWarning(Warning): ... + +def validator(application: WSGIApplication) -> WSGIApplication: ... + +class InputWrapper: + input: InputStream + def __init__(self, wsgi_input: InputStream) -> None: ... + if sys.version_info < (3,): + def read(self, size: int = ...) -> bytes: ... + def readline(self) -> bytes: ... + else: + def read(self, size: int) -> bytes: ... + def readline(self, size: int = ...) -> bytes: ... + def readlines(self, hint: int = ...) -> bytes: ... + def __iter__(self) -> Iterable[bytes]: ... + def close(self) -> NoReturn: ... + +class ErrorWrapper: + errors: ErrorStream + def __init__(self, wsgi_errors: ErrorStream) -> None: ... + def write(self, s: str) -> None: ... + def flush(self) -> None: ... + def writelines(self, seq: Iterable[str]) -> None: ... + def close(self) -> NoReturn: ... + +class WriteWrapper: + writer: Callable[[bytes], Any] + def __init__(self, wsgi_writer: Callable[[bytes], Any]) -> None: ... + def __call__(self, s: bytes) -> None: ... + +class PartialIteratorWrapper: + iterator: Iterator[bytes] + def __init__(self, wsgi_iterator: Iterator[bytes]) -> None: ... + def __iter__(self) -> IteratorWrapper: ... + +class IteratorWrapper: + original_iterator: Iterator[bytes] + iterator: Iterator[bytes] + closed: bool + check_start_response: Optional[bool] + def __init__(self, wsgi_iterator: Iterator[bytes], check_start_response: Optional[bool]) -> None: ... + def __iter__(self) -> IteratorWrapper: ... + if sys.version_info < (3,): + def next(self) -> bytes: ... + else: + def __next__(self) -> bytes: ... + def close(self) -> None: ... + def __del__(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xdrlib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xdrlib.pyi new file mode 100644 index 00000000..864aced9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xdrlib.pyi @@ -0,0 +1,56 @@ +# Structs for xdrlib (Python 2 and 3) +from typing import Callable, List, Sequence, TypeVar + +_T = TypeVar('_T') + +class Error(Exception): + msg: str + def __init__(self, msg: str) -> None: ... + +class ConversionError(Error): ... + +class Packer: + def __init__(self) -> None: ... + def reset(self) -> None: ... + def get_buffer(self) -> bytes: ... + def get_buf(self) -> bytes: ... + def pack_uint(self, x: int) -> None: ... + def pack_int(self, x: int) -> None: ... + def pack_enum(self, x: int) -> None: ... + def pack_bool(self, x: bool) -> None: ... + def pack_uhyper(self, x: int) -> None: ... + def pack_hyper(self, x: int) -> None: ... + def pack_float(self, x: float) -> None: ... + def pack_double(self, x: float) -> None: ... + def pack_fstring(self, n: int, s: bytes) -> None: ... + def pack_fopaque(self, n: int, s: bytes) -> None: ... + def pack_string(self, s: bytes) -> None: ... + def pack_opaque(self, s: bytes) -> None: ... + def pack_bytes(self, s: bytes) -> None: ... + def pack_list(self, list: Sequence[_T], pack_item: Callable[[_T], None]) -> None: ... + def pack_farray(self, n: int, list: Sequence[_T], pack_item: Callable[[_T], None]) -> None: ... + def pack_array(self, list: Sequence[_T], pack_item: Callable[[_T], None]) -> None: ... + +class Unpacker: + def __init__(self, data: bytes) -> None: ... + def reset(self, data: bytes) -> None: ... + def get_position(self) -> int: ... + def set_position(self, position: int) -> None: ... + def get_buffer(self) -> bytes: ... + def done(self) -> None: ... + def unpack_uint(self) -> int: ... + def unpack_int(self) -> int: ... + def unpack_enum(self) -> int: ... + def unpack_bool(self) -> bool: ... + def unpack_uhyper(self) -> int: ... + def unpack_hyper(self) -> int: ... + def unpack_float(self) -> float: ... + def unpack_double(self) -> float: ... + def unpack_fstring(self, n: int) -> bytes: ... + def unpack_fopaque(self, n: int) -> bytes: ... + def unpack_string(self) -> bytes: ... + def unpack_opaque(self) -> bytes: ... + def unpack_bytes(self) -> bytes: ... + def unpack_list(self, unpack_item: Callable[[], _T]) -> List[_T]: ... + def unpack_farray(self, n: int, unpack_item: Callable[[], _T]) -> List[_T]: ... + def unpack_array(self, unpack_item: Callable[[], _T]) -> List[_T]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/__init__.pyi new file mode 100644 index 00000000..c524ac2b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/__init__.pyi @@ -0,0 +1 @@ +import xml.parsers as parsers diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementInclude.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementInclude.pyi new file mode 100644 index 00000000..e8c3cd56 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementInclude.pyi @@ -0,0 +1,17 @@ +# Stubs for xml.etree.ElementInclude (Python 3.4) + +from typing import Union, Optional, Callable +from xml.etree.ElementTree import Element + +XINCLUDE: str +XINCLUDE_INCLUDE: str +XINCLUDE_FALLBACK: str + +class FatalIncludeError(SyntaxError): ... + +def default_loader(href: Union[str, bytes, int], parse: str, encoding: Optional[str] = ...) -> Union[str, Element]: ... + +# TODO: loader is of type default_loader ie it takes a callable that has the +# same signature as default_loader. But default_loader has a keyword argument +# Which can't be represented using Callable... +def include(elem: Element, loader: Optional[Callable[..., Union[str, Element]]] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementPath.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementPath.pyi new file mode 100644 index 00000000..1250f0da --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementPath.pyi @@ -0,0 +1,33 @@ +# Stubs for xml.etree.ElementPath (Python 3.4) + +from typing import Pattern, Dict, Generator, Tuple, List, Union, TypeVar, Callable, Optional +from xml.etree.ElementTree import Element + +xpath_tokenizer_re: Pattern[str] + +_token = Tuple[str, str] +_next = Callable[[], _token] +_callback = Callable[[_SelectorContext, List[Element]], Generator[Element, None, None]] + +def xpath_tokenizer(pattern: str, namespaces: Optional[Dict[str, str]] = ...) -> Generator[_token, None, None]: ... +def get_parent_map(context: _SelectorContext) -> Dict[Element, Element]: ... +def prepare_child(next: _next, token: _token) -> _callback: ... +def prepare_star(next: _next, token: _token) -> _callback: ... +def prepare_self(next: _next, token: _token) -> _callback: ... +def prepare_descendant(next: _next, token: _token) -> _callback: ... +def prepare_parent(next: _next, token: _token) -> _callback: ... +def prepare_predicate(next: _next, token: _token) -> _callback: ... + +ops: Dict[str, Callable[[_next, _token], _callback]] + +class _SelectorContext: + parent_map: Dict[Element, Element] + root: Element + def __init__(self, root: Element) -> None: ... + +_T = TypeVar('_T') + +def iterfind(elem: Element, path: str, namespaces: Optional[Dict[str, str]] = ...) -> List[Element]: ... +def find(elem: Element, path: str, namespaces: Optional[Dict[str, str]] = ...) -> Optional[Element]: ... +def findall(elem: Element, path: str, namespaces: Optional[Dict[str, str]] = ...) -> List[Element]: ... +def findtext(elem: Element, path: str, default: Optional[_T] = ..., namespaces: Optional[Dict[str, str]] = ...) -> Union[_T, str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementTree.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementTree.pyi new file mode 100644 index 00000000..025b4749 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/etree/ElementTree.pyi @@ -0,0 +1,259 @@ +# Stubs for xml.etree.ElementTree + +from typing import ( + Any, + Callable, + Dict, + Generator, + IO, + ItemsView, + Iterable, + Iterator, + KeysView, + List, + MutableSequence, + Optional, + Protocol, + Sequence, + Text, + Tuple, + TypeVar, + Union, + overload, +) +import io +import sys + +if sys.version_info < (3,) or sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + +VERSION: str + +class ParseError(SyntaxError): + code: int + position: Tuple[int, int] + +def iselement(element: object) -> bool: ... + +_T = TypeVar('_T') + +# Type for parser inputs. Parser will accept any unicode/str/bytes and coerce, +# and this is true in py2 and py3 (even fromstringlist() in python3 can be +# called with a heterogeneous list) +_parser_input_type = Union[bytes, Text] + +# Type for individual tag/attr/ns/text values in args to most functions. +# In py2, the library accepts str or unicode everywhere and coerces +# aggressively. +# In py3, bytes is not coerced to str and so use of bytes is probably an error, +# so we exclude it. (why? the parser never produces bytes when it parses XML, +# so e.g., element.get(b'name') will always return None for parsed XML, even if +# there is a 'name' attribute.) +_str_argument_type = Union[str, Text] + +# Type for return values from individual tag/attr/text values +if sys.version_info >= (3,): + # note: in python3, everything comes out as str, yay: + _str_result_type = str +else: + # in python2, if the tag/attribute/text wasn't decode-able as ascii, it + # comes out as a unicode string; otherwise it comes out as str. (see + # _fixtext function in the source). Client code knows best: + _str_result_type = Any + +_file_or_filename = Union[str, bytes, int, IO[Any]] + +if sys.version_info >= (3, 8): + class _Writeable(Protocol): + def write(self, __s: str) -> Any: ... + + @overload + def canonicalize( + xml_data: Optional[_parser_input_type] = ..., + *, + out: None = ..., + from_file: Optional[_file_or_filename] = ..., + with_comments: bool = ..., + strip_text: bool = ..., + rewrite_prefixes: bool = ..., + qname_aware_tags: Optional[Iterable[str]] = ..., + qname_aware_attrs: Optional[Iterable[str]] = ..., + exclude_attrs: Optional[Iterable[str]] = ..., + exclude_tags: Optional[Iterable[str]] = ..., + ) -> str: ... + @overload + def canonicalize( + xml_data: Optional[_parser_input_type] = ..., + *, + out: _Writeable, + from_file: Optional[_file_or_filename] = ..., + with_comments: bool = ..., + strip_text: bool = ..., + rewrite_prefixes: bool = ..., + qname_aware_tags: Optional[Iterable[str]] = ..., + qname_aware_attrs: Optional[Iterable[str]] = ..., + exclude_attrs: Optional[Iterable[str]] = ..., + exclude_tags: Optional[Iterable[str]] = ..., + ) -> None: ... + +class Element(MutableSequence[Element]): + tag: _str_result_type + attrib: Dict[_str_result_type, _str_result_type] + text: Optional[_str_result_type] + tail: Optional[_str_result_type] + def __init__(self, tag: Union[_str_argument_type, Callable[..., Element]], attrib: Dict[_str_argument_type, _str_argument_type] = ..., **extra: _str_argument_type) -> None: ... + def append(self, subelement: Element) -> None: ... + def clear(self) -> None: ... + def copy(self) -> Element: ... + def extend(self, elements: Iterable[Element]) -> None: ... + def find(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Optional[Element]: ... + def findall(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> List[Element]: ... + @overload + def findtext(self, path: _str_argument_type, *, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Optional[_str_result_type]: ... + @overload + def findtext(self, path: _str_argument_type, default: _T, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Union[_T, _str_result_type]: ... + @overload + def get(self, key: _str_argument_type) -> Optional[_str_result_type]: ... + @overload + def get(self, key: _str_argument_type, default: _T) -> Union[_str_result_type, _T]: ... + def getchildren(self) -> List[Element]: ... + def getiterator(self, tag: Optional[_str_argument_type] = ...) -> List[Element]: ... + if sys.version_info >= (3, 2): + def insert(self, index: int, subelement: Element) -> None: ... + else: + def insert(self, index: int, element: Element) -> None: ... + def items(self) -> ItemsView[_str_result_type, _str_result_type]: ... + def iter(self, tag: Optional[_str_argument_type] = ...) -> Generator[Element, None, None]: ... + def iterfind(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> List[Element]: ... + def itertext(self) -> Generator[_str_result_type, None, None]: ... + def keys(self) -> KeysView[_str_result_type]: ... + def makeelement(self, tag: _str_argument_type, attrib: Dict[_str_argument_type, _str_argument_type]) -> Element: ... + def remove(self, subelement: Element) -> None: ... + def set(self, key: _str_argument_type, value: _str_argument_type) -> None: ... + def __bool__(self) -> bool: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + @overload + def __getitem__(self, i: int) -> Element: ... + @overload + def __getitem__(self, s: slice) -> MutableSequence[Element]: ... + def __len__(self) -> int: ... + @overload + def __setitem__(self, i: int, o: Element) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[Element]) -> None: ... + + +def SubElement(parent: Element, tag: _str_argument_type, attrib: Dict[_str_argument_type, _str_argument_type] = ..., **extra: _str_argument_type) -> Element: ... +def Comment(text: Optional[_str_argument_type] = ...) -> Element: ... +def ProcessingInstruction(target: _str_argument_type, text: Optional[_str_argument_type] = ...) -> Element: ... + +PI: Callable[..., Element] + +class QName: + text: str + def __init__(self, text_or_uri: _str_argument_type, tag: Optional[_str_argument_type] = ...) -> None: ... + +class ElementTree: + def __init__(self, element: Optional[Element] = ..., file: Optional[_file_or_filename] = ...) -> None: ... + def getroot(self) -> Element: ... + def parse(self, source: _file_or_filename, parser: Optional[XMLParser] = ...) -> Element: ... + def iter(self, tag: Optional[_str_argument_type] = ...) -> Generator[Element, None, None]: ... + def getiterator(self, tag: Optional[_str_argument_type] = ...) -> List[Element]: ... + def find(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Optional[Element]: ... + @overload + def findtext(self, path: _str_argument_type, *, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Optional[_str_result_type]: ... + @overload + def findtext(self, path: _str_argument_type, default: _T, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> Union[_T, _str_result_type]: ... + def findall(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> List[Element]: ... + def iterfind(self, path: _str_argument_type, namespaces: Optional[Dict[_str_argument_type, _str_argument_type]] = ...) -> List[Element]: ... + if sys.version_info >= (3, 4): + def write(self, file_or_filename: _file_or_filename, encoding: Optional[str] = ..., xml_declaration: Optional[bool] = ..., default_namespace: Optional[_str_argument_type] = ..., method: Optional[str] = ..., *, short_empty_elements: bool = ...) -> None: ... + else: + def write(self, file_or_filename: _file_or_filename, encoding: Optional[str] = ..., xml_declaration: Optional[bool] = ..., default_namespace: Optional[_str_argument_type] = ..., method: Optional[str] = ...) -> None: ... + def write_c14n(self, file: _file_or_filename) -> None: ... + +def register_namespace(prefix: _str_argument_type, uri: _str_argument_type) -> None: ... +if sys.version_info >= (3,): + @overload + def tostring(element: Element, encoding: None = ..., method: Optional[str] = ..., *, short_empty_elements: bool = ...) -> bytes: ... + @overload + def tostring(element: Element, encoding: Literal["unicode"], method: Optional[str] = ..., *, short_empty_elements: bool = ...) -> str: ... + @overload + def tostring(element: Element, encoding: str, method: Optional[str] = ..., *, short_empty_elements: bool = ...) -> Any: ... + @overload + def tostringlist(element: Element, encoding: None = ..., method: Optional[str] = ..., *, short_empty_elements: bool = ...) -> List[bytes]: ... + @overload + def tostringlist(element: Element, encoding: Literal["unicode"], method: Optional[str] = ..., *, short_empty_elements: bool = ...) -> List[str]: ... + @overload + def tostringlist(element: Element, encoding: str, method: Optional[str] = ..., *, short_empty_elements: bool = ...) -> List[Any]: ... +else: + def tostring(element: Element, encoding: Optional[str] = ..., method: Optional[str] = ...) -> bytes: ... + def tostringlist(element: Element, encoding: Optional[str] = ..., method: Optional[str] = ...) -> List[bytes]: ... +def dump(elem: Element) -> None: ... +def parse(source: _file_or_filename, parser: Optional[XMLParser] = ...) -> ElementTree: ... +def iterparse(source: _file_or_filename, events: Optional[Sequence[str]] = ..., parser: Optional[XMLParser] = ...) -> Iterator[Tuple[str, Any]]: ... + +if sys.version_info >= (3, 4): + class XMLPullParser: + def __init__(self, events: Optional[Sequence[str]] = ..., *, _parser: Optional[XMLParser] = ...) -> None: ... + def feed(self, data: bytes) -> None: ... + def close(self) -> None: ... + def read_events(self) -> Iterator[Tuple[str, Element]]: ... + +def XML(text: _parser_input_type, parser: Optional[XMLParser] = ...) -> Element: ... +def XMLID(text: _parser_input_type, parser: Optional[XMLParser] = ...) -> Tuple[Element, Dict[_str_result_type, Element]]: ... + +# This is aliased to XML in the source. +fromstring = XML + +def fromstringlist(sequence: Sequence[_parser_input_type], parser: Optional[XMLParser] = ...) -> Element: ... + +# This type is both not precise enough and too precise. The TreeBuilder +# requires the elementfactory to accept tag and attrs in its args and produce +# some kind of object that has .text and .tail properties. +# I've chosen to constrain the ElementFactory to always produce an Element +# because that is how almost everyone will use it. +# Unfortunately, the type of the factory arguments is dependent on how +# TreeBuilder is called by client code (they could pass strs, bytes or whatever); +# but we don't want to use a too-broad type, or it would be too hard to write +# elementfactories. +_ElementFactory = Callable[[Any, Dict[Any, Any]], Element] + +class TreeBuilder: + def __init__(self, element_factory: Optional[_ElementFactory] = ...) -> None: ... + def close(self) -> Element: ... + def data(self, data: _parser_input_type) -> None: ... + def start(self, tag: _parser_input_type, attrs: Dict[_parser_input_type, _parser_input_type]) -> Element: ... + def end(self, tag: _parser_input_type) -> Element: ... + +if sys.version_info >= (3, 8): + class C14NWriterTarget: + def __init__( + self, + write: Callable[[str], Any], + *, + with_comments: bool = ..., + strip_text: bool = ..., + rewrite_prefixes: bool = ..., + qname_aware_tags: Optional[Iterable[str]] = ..., + qname_aware_attrs: Optional[Iterable[str]] = ..., + exclude_attrs: Optional[Iterable[str]] = ..., + exclude_tags: Optional[Iterable[str]] = ..., + ) -> None: ... + + +class XMLParser: + parser: Any + target: TreeBuilder + # TODO-what is entity used for??? + entity: Any + version: str + if sys.version_info >= (3, 8): + def __init__(self, *, target: Optional[TreeBuilder] = ..., encoding: Optional[str] = ...) -> None: ... + else: + def __init__(self, html: int = ..., target: Optional[TreeBuilder] = ..., encoding: Optional[str] = ...) -> None: ... + def doctype(self, name: str, pubid: str, system: str) -> None: ... + def close(self) -> Element: ... + def feed(self, data: _parser_input_type) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/etree/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/etree/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/etree/cElementTree.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/etree/cElementTree.pyi new file mode 100644 index 00000000..c384968d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/etree/cElementTree.pyi @@ -0,0 +1,3 @@ +# Stubs for xml.etree.cElementTree (Python 3.4) + +from xml.etree.ElementTree import * # noqa: F403 diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/__init__.pyi new file mode 100644 index 00000000..cac08623 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/__init__.pyi @@ -0,0 +1 @@ +import xml.parsers.expat as expat diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/__init__.pyi new file mode 100644 index 00000000..73f3758c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/__init__.pyi @@ -0,0 +1 @@ +from pyexpat import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/errors.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/errors.pyi new file mode 100644 index 00000000..e22d769e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/errors.pyi @@ -0,0 +1 @@ +from pyexpat.errors import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/model.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/model.pyi new file mode 100644 index 00000000..d8f44b47 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/parsers/expat/model.pyi @@ -0,0 +1 @@ +from pyexpat.model import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/sax/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/sax/__init__.pyi new file mode 100644 index 00000000..6edf12da --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/sax/__init__.pyi @@ -0,0 +1,34 @@ +from typing import Any, List, NoReturn, Optional, Text, Union, IO + +import xml.sax +from xml.sax.xmlreader import InputSource, Locator +from xml.sax.handler import ContentHandler, ErrorHandler + +class SAXException(Exception): + def __init__(self, msg: str, exception: Optional[Exception] = ...) -> None: ... + def getMessage(self) -> str: ... + def getException(self) -> Exception: ... + def __getitem__(self, ix: Any) -> NoReturn: ... + +class SAXParseException(SAXException): + def __init__(self, msg: str, exception: Exception, locator: Locator) -> None: ... + def getColumnNumber(self) -> int: ... + def getLineNumber(self) -> int: ... + def getPublicId(self): ... + def getSystemId(self): ... + +class SAXNotRecognizedException(SAXException): ... +class SAXNotSupportedException(SAXException): ... +class SAXReaderNotAvailable(SAXNotSupportedException): ... + +default_parser_list: List[str] + +def make_parser(parser_list: List[str] = ...) -> xml.sax.xmlreader.XMLReader: ... + +def parse(source: Union[str, IO[str]], handler: xml.sax.handler.ContentHandler, + errorHandler: xml.sax.handler.ErrorHandler = ...) -> None: ... + +def parseString(string: Union[bytes, Text], handler: xml.sax.handler.ContentHandler, + errorHandler: Optional[xml.sax.handler.ErrorHandler] = ...) -> None: ... + +def _create_parser(parser_name: str) -> xml.sax.xmlreader.XMLReader: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/sax/handler.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/sax/handler.pyi new file mode 100644 index 00000000..3a519330 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/sax/handler.pyi @@ -0,0 +1,46 @@ +from typing import Any + +version: Any + +class ErrorHandler: + def error(self, exception): ... + def fatalError(self, exception): ... + def warning(self, exception): ... + +class ContentHandler: + def __init__(self) -> None: ... + def setDocumentLocator(self, locator): ... + def startDocument(self): ... + def endDocument(self): ... + def startPrefixMapping(self, prefix, uri): ... + def endPrefixMapping(self, prefix): ... + def startElement(self, name, attrs): ... + def endElement(self, name): ... + def startElementNS(self, name, qname, attrs): ... + def endElementNS(self, name, qname): ... + def characters(self, content): ... + def ignorableWhitespace(self, whitespace): ... + def processingInstruction(self, target, data): ... + def skippedEntity(self, name): ... + +class DTDHandler: + def notationDecl(self, name, publicId, systemId): ... + def unparsedEntityDecl(self, name, publicId, systemId, ndata): ... + +class EntityResolver: + def resolveEntity(self, publicId, systemId): ... + +feature_namespaces: Any +feature_namespace_prefixes: Any +feature_string_interning: Any +feature_validation: Any +feature_external_ges: Any +feature_external_pes: Any +all_features: Any +property_lexical_handler: Any +property_declaration_handler: Any +property_dom_node: Any +property_xml_string: Any +property_encoding: Any +property_interning_dict: Any +all_properties: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/sax/saxutils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/sax/saxutils.pyi new file mode 100644 index 00000000..342d6ed8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/sax/saxutils.pyi @@ -0,0 +1,58 @@ +import sys +from typing import Mapping, Text + +from xml.sax import handler +from xml.sax import xmlreader + +def escape(data: Text, entities: Mapping[Text, Text] = ...) -> Text: ... +def unescape(data: Text, entities: Mapping[Text, Text] = ...) -> Text: ... +def quoteattr(data: Text, entities: Mapping[Text, Text] = ...) -> Text: ... + +class XMLGenerator(handler.ContentHandler): + if sys.version_info >= (3, 0): + def __init__(self, out=..., encoding=..., short_empty_elements: bool = ...) -> None: ... + else: + def __init__(self, out=..., encoding=...) -> None: ... + def startDocument(self): ... + def endDocument(self): ... + def startPrefixMapping(self, prefix, uri): ... + def endPrefixMapping(self, prefix): ... + def startElement(self, name, attrs): ... + def endElement(self, name): ... + def startElementNS(self, name, qname, attrs): ... + def endElementNS(self, name, qname): ... + def characters(self, content): ... + def ignorableWhitespace(self, content): ... + def processingInstruction(self, target, data): ... + +class XMLFilterBase(xmlreader.XMLReader): + def __init__(self, parent=...) -> None: ... + def error(self, exception): ... + def fatalError(self, exception): ... + def warning(self, exception): ... + def setDocumentLocator(self, locator): ... + def startDocument(self): ... + def endDocument(self): ... + def startPrefixMapping(self, prefix, uri): ... + def endPrefixMapping(self, prefix): ... + def startElement(self, name, attrs): ... + def endElement(self, name): ... + def startElementNS(self, name, qname, attrs): ... + def endElementNS(self, name, qname): ... + def characters(self, content): ... + def ignorableWhitespace(self, chars): ... + def processingInstruction(self, target, data): ... + def skippedEntity(self, name): ... + def notationDecl(self, name, publicId, systemId): ... + def unparsedEntityDecl(self, name, publicId, systemId, ndata): ... + def resolveEntity(self, publicId, systemId): ... + def parse(self, source): ... + def setLocale(self, locale): ... + def getFeature(self, name): ... + def setFeature(self, name, state): ... + def getProperty(self, name): ... + def setProperty(self, name, value): ... + def getParent(self): ... + def setParent(self, parent): ... + +def prepare_input_source(source, base=...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/sax/xmlreader.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/sax/xmlreader.pyi new file mode 100644 index 00000000..fbc1ac1e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/xml/sax/xmlreader.pyi @@ -0,0 +1,71 @@ +class XMLReader: + def __init__(self) -> None: ... + def parse(self, source): ... + def getContentHandler(self): ... + def setContentHandler(self, handler): ... + def getDTDHandler(self): ... + def setDTDHandler(self, handler): ... + def getEntityResolver(self): ... + def setEntityResolver(self, resolver): ... + def getErrorHandler(self): ... + def setErrorHandler(self, handler): ... + def setLocale(self, locale): ... + def getFeature(self, name): ... + def setFeature(self, name, state): ... + def getProperty(self, name): ... + def setProperty(self, name, value): ... + +class IncrementalParser(XMLReader): + def __init__(self, bufsize=...) -> None: ... + def parse(self, source): ... + def feed(self, data): ... + def prepareParser(self, source): ... + def close(self): ... + def reset(self): ... + +class Locator: + def getColumnNumber(self): ... + def getLineNumber(self): ... + def getPublicId(self): ... + def getSystemId(self): ... + +class InputSource: + def __init__(self, system_id=...) -> None: ... + def setPublicId(self, public_id): ... + def getPublicId(self): ... + def setSystemId(self, system_id): ... + def getSystemId(self): ... + def setEncoding(self, encoding): ... + def getEncoding(self): ... + def setByteStream(self, bytefile): ... + def getByteStream(self): ... + def setCharacterStream(self, charfile): ... + def getCharacterStream(self): ... + +class AttributesImpl: + def __init__(self, attrs) -> None: ... + def getLength(self): ... + def getType(self, name): ... + def getValue(self, name): ... + def getValueByQName(self, name): ... + def getNameByQName(self, name): ... + def getQNameByName(self, name): ... + def getNames(self): ... + def getQNames(self): ... + def __len__(self): ... + def __getitem__(self, name): ... + def keys(self): ... + def has_key(self, name): ... + def __contains__(self, name): ... + def get(self, name, alternative=...): ... + def copy(self): ... + def items(self): ... + def values(self): ... + +class AttributesNSImpl(AttributesImpl): + def __init__(self, attrs, qnames) -> None: ... + def getValueByQName(self, name): ... + def getNameByQName(self, name): ... + def getQNameByName(self, name): ... + def getQNames(self): ... + def copy(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/zipfile.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/zipfile.pyi new file mode 100644 index 00000000..72021f35 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/zipfile.pyi @@ -0,0 +1,146 @@ +# Stubs for zipfile + +from typing import Callable, Dict, IO, Iterable, List, Optional, Text, Tuple, Type, Union, Sequence, Pattern +from types import TracebackType +import io +import os +import sys + +if sys.version_info >= (3, 6): + _Path = Union[os.PathLike[str], str] +else: + _Path = Text +_SZI = Union[Text, ZipInfo] +_DT = Tuple[int, int, int, int, int, int] + +if sys.version_info >= (3,): + class BadZipFile(Exception): ... + BadZipfile = BadZipFile +else: + class BadZipfile(Exception): ... + +error = BadZipfile + +class LargeZipFile(Exception): ... + +class ZipExtFile(io.BufferedIOBase): + MAX_N: int = ... + MIN_READ_SIZE: int = ... + + if sys.version_info < (3, 6): + PATTERN: Pattern[str] = ... + + if sys.version_info >= (3, 7): + MAX_SEEK_READ: int = ... + + newlines: Optional[List[bytes]] + mode: str + name: str + def __init__( + self, + fileobj: IO[bytes], + mode: str, + zipinfo: ZipInfo, + decrypter: Optional[Callable[[Sequence[int]], bytes]] = ..., + close_fileobj: bool = ..., + ) -> None: ... + def __repr__(self) -> str: ... + def peek(self, n: int = ...) -> bytes: ... + def read1(self, n: Optional[int]) -> bytes: ... # type: ignore + +class ZipFile: + filename: Optional[Text] + debug: int + comment: bytes + filelist: List[ZipInfo] + fp: IO[bytes] + NameToInfo: Dict[Text, ZipInfo] + start_dir: int # undocumented + if sys.version_info >= (3, 8): + def __init__( + self, + file: Union[_Path, IO[bytes]], + mode: Text = ..., + compression: int = ..., + allowZip64: bool = ..., + compresslevel: Optional[int] = ..., + *, + strict_timestamps: bool = ..., + ) -> None: ... + elif sys.version_info >= (3, 7): + def __init__( + self, + file: Union[_Path, IO[bytes]], + mode: Text = ..., + compression: int = ..., + allowZip64: bool = ..., + compresslevel: Optional[int] = ..., + ) -> None: ... + else: + def __init__( + self, file: Union[_Path, IO[bytes]], mode: Text = ..., compression: int = ..., allowZip64: bool = ... + ) -> None: ... + def __enter__(self) -> ZipFile: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> None: ... + def close(self) -> None: ... + def getinfo(self, name: Text) -> ZipInfo: ... + def infolist(self) -> List[ZipInfo]: ... + def namelist(self) -> List[Text]: ... + def open(self, name: _SZI, mode: Text = ..., pwd: Optional[bytes] = ...) -> IO[bytes]: ... + def extract(self, member: _SZI, path: Optional[_SZI] = ..., pwd: bytes = ...) -> str: ... + def extractall( + self, path: Optional[_Path] = ..., members: Optional[Iterable[Text]] = ..., pwd: Optional[bytes] = ... + ) -> None: ... + def printdir(self) -> None: ... + def setpassword(self, pwd: bytes) -> None: ... + def read(self, name: _SZI, pwd: Optional[bytes] = ...) -> bytes: ... + def testzip(self) -> Optional[str]: ... + def write(self, filename: _Path, arcname: Optional[_Path] = ..., compress_type: Optional[int] = ...) -> None: ... + if sys.version_info >= (3,): + def writestr(self, zinfo_or_arcname: _SZI, data: Union[bytes, str], compress_type: Optional[int] = ...) -> None: ... + else: + def writestr(self, zinfo_or_arcname: _SZI, bytes: bytes, compress_type: Optional[int] = ...) -> None: ... + +class PyZipFile(ZipFile): + if sys.version_info >= (3,): + def __init__( + self, file: Union[str, IO[bytes]], mode: str = ..., compression: int = ..., allowZip64: bool = ..., opimize: int = ... + ) -> None: ... + def writepy(self, pathname: str, basename: str = ..., filterfunc: Optional[Callable[[str], bool]] = ...) -> None: ... + else: + def writepy(self, pathname: Text, basename: Text = ...) -> None: ... + +class ZipInfo: + filename: Text + date_time: _DT + compress_type: int + comment: bytes + extra: bytes + create_system: int + create_version: int + extract_version: int + reserved: int + flag_bits: int + volume: int + internal_attr: int + external_attr: int + header_offset: int + CRC: int + compress_size: int + file_size: int + def __init__(self, filename: Optional[Text] = ..., date_time: Optional[_DT] = ...) -> None: ... + if sys.version_info >= (3, 6): + def is_dir(self) -> bool: ... + @classmethod + def from_file(cls, filename: _Path, arcname: Optional[_Path] = ...) -> ZipInfo: ... + def FileHeader(self, zip64: Optional[bool] = ...) -> bytes: ... + +def is_zipfile(filename: Union[_Path, IO[bytes]]) -> bool: ... + +ZIP_STORED: int +ZIP_DEFLATED: int +if sys.version_info >= (3, 3): + ZIP_BZIP2: int + ZIP_LZMA: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/zipimport.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/zipimport.pyi new file mode 100644 index 00000000..c22531a9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/zipimport.pyi @@ -0,0 +1,18 @@ +"""Stub file for the 'zipimport' module.""" + +from typing import Optional +from types import CodeType, ModuleType + +class ZipImportError(ImportError): ... + +class zipimporter(object): + archive: str + prefix: str + def __init__(self, archivepath: str) -> None: ... + def find_module(self, fullname: str, path: str = ...) -> Optional[zipimporter]: ... + def get_code(self, fullname: str) -> CodeType: ... + def get_data(self, pathname: str) -> str: ... + def get_filename(self, fullname: str) -> str: ... + def get_source(self, fullname: str) -> Optional[str]: ... + def is_package(self, fullname: str) -> bool: ... + def load_module(self, fullname: str) -> ModuleType: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/zlib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/zlib.pyi new file mode 100644 index 00000000..4ea53721 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/2and3/zlib.pyi @@ -0,0 +1,55 @@ +# Stubs for zlib +import sys + +DEFLATED: int +DEF_MEM_LEVEL: int +MAX_WBITS: int +ZLIB_VERSION: str +Z_BEST_COMPRESSION: int +Z_BEST_SPEED: int +Z_DEFAULT_COMPRESSION: int +Z_DEFAULT_STRATEGY: int +Z_FILTERED: int +Z_FINISH: int +Z_FULL_FLUSH: int +Z_HUFFMAN_ONLY: int +Z_NO_FLUSH: int +Z_SYNC_FLUSH: int +if sys.version_info >= (3,): + DEF_BUF_SIZE: int + ZLIB_RUNTIME_VERSION: str + +class error(Exception): ... + + +class _Compress: + def compress(self, data: bytes) -> bytes: ... + def flush(self, mode: int = ...) -> bytes: ... + def copy(self) -> _Compress: ... + + +class _Decompress: + unused_data: bytes + unconsumed_tail: bytes + if sys.version_info >= (3,): + eof: bool + def decompress(self, data: bytes, max_length: int = ...) -> bytes: ... + def flush(self, length: int = ...) -> bytes: ... + def copy(self) -> _Decompress: ... + + +def adler32(data: bytes, value: int = ...) -> int: ... +def compress(data: bytes, level: int = ...) -> bytes: ... +if sys.version_info >= (3,): + def compressobj(level: int = ..., method: int = ..., wbits: int = ..., + memLevel: int = ..., strategy: int = ..., + zdict: bytes = ...) -> _Compress: ... +else: + def compressobj(level: int = ..., method: int = ..., wbits: int = ..., + memlevel: int = ..., strategy: int = ...) -> _Compress: ... +def crc32(data: bytes, value: int = ...) -> int: ... +def decompress(data: bytes, wbits: int = ..., bufsize: int = ...) -> bytes: ... +if sys.version_info >= (3,): + def decompressobj(wbits: int = ..., zdict: bytes = ...) -> _Decompress: ... +else: + def decompressobj(wbits: int = ...) -> _Decompress: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3.6/secrets.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3.6/secrets.pyi new file mode 100644 index 00000000..5069dba2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3.6/secrets.pyi @@ -0,0 +1,14 @@ +# Stubs for secrets (Python 3.6) + +from typing import Optional, Sequence, TypeVar +from hmac import compare_digest as compare_digest +from random import SystemRandom as SystemRandom + +_T = TypeVar('_T') + +def randbelow(exclusive_upper_bound: int) -> int: ... +def randbits(k: int) -> int: ... +def choice(seq: Sequence[_T]) -> _T: ... +def token_bytes(nbytes: Optional[int] = ...) -> bytes: ... +def token_hex(nbytes: Optional[int] = ...) -> str: ... +def token_urlsafe(nbytes: Optional[int] = ...) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3.7/contextvars.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3.7/contextvars.pyi new file mode 100644 index 00000000..a90c2a8b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3.7/contextvars.pyi @@ -0,0 +1,30 @@ +from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar + +_T = TypeVar('_T') + +class ContextVar(Generic[_T]): + def __init__(self, name: str, *, default: _T = ...) -> None: ... + @property + def name(self) -> str: ... + def get(self, default: _T = ...) -> _T: ... + def set(self, value: _T) -> Token[_T]: ... + def reset(self, token: Token[_T]) -> None: ... + +class Token(Generic[_T]): + @property + def var(self) -> ContextVar[_T]: ... + @property + def old_value(self) -> Any: ... # returns either _T or MISSING, but that's hard to express + MISSING: ClassVar[object] + +def copy_context() -> Context: ... + +# It doesn't make sense to make this generic, because for most Contexts each ContextVar will have +# a different value. +class Context(Mapping[ContextVar[Any], Any]): + def __init__(self) -> None: ... + def run(self, callable: Callable[..., _T], *args: Any, **kwargs: Any) -> _T: ... + def copy(self) -> Context: ... + def __getitem__(self, key: ContextVar[Any]) -> Any: ... + def __iter__(self) -> Iterator[ContextVar[Any]]: ... + def __len__(self) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3.7/dataclasses.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3.7/dataclasses.pyi new file mode 100644 index 00000000..e3bf1d13 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3.7/dataclasses.pyi @@ -0,0 +1,71 @@ +from typing import overload, Any, Callable, Dict, Generic, Iterable, List, Mapping, Optional, Tuple, Type, TypeVar, Union + + +_T = TypeVar('_T') + +class _MISSING_TYPE: ... +MISSING: _MISSING_TYPE + +@overload +def asdict(obj: Any) -> Dict[str, Any]: ... +@overload +def asdict(obj: Any, *, dict_factory: Callable[[List[Tuple[str, Any]]], _T]) -> _T: ... + +@overload +def astuple(obj: Any) -> Tuple[Any, ...]: ... +@overload +def astuple(obj: Any, *, tuple_factory: Callable[[List[Any]], _T]) -> _T: ... + + +@overload +def dataclass(_cls: Type[_T]) -> Type[_T]: ... + +@overload +def dataclass(*, init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., + unsafe_hash: bool = ..., frozen: bool = ...) -> Callable[[Type[_T]], Type[_T]]: ... + + +class Field(Generic[_T]): + name: str + type: Type[_T] + default: _T + default_factory: Callable[[], _T] + repr: bool + hash: Optional[bool] + init: bool + compare: bool + metadata: Mapping[str, Any] + + +# NOTE: Actual return type is 'Field[_T]', but we want to help type checkers +# to understand the magic that happens at runtime. +@overload # `default` and `default_factory` are optional and mutually exclusive. +def field(*, default: _T, + init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ...) -> _T: ... + +@overload +def field(*, default_factory: Callable[[], _T], + init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ...) -> _T: ... + +@overload +def field(*, + init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ...) -> Any: ... + + +def fields(class_or_instance: Any) -> Tuple[Field[Any], ...]: ... + +def is_dataclass(obj: Any) -> bool: ... + +class FrozenInstanceError(AttributeError): ... + +class InitVar(Generic[_T]): ... + +def make_dataclass(cls_name: str, fields: Iterable[Union[str, Tuple[str, type], Tuple[str, type, Field[Any]]]], *, + bases: Tuple[type, ...] = ..., namespace: Optional[Dict[str, Any]] = ..., + init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., hash: bool = ..., + frozen: bool = ...): ... + +def replace(obj: _T, **changes: Any) -> _T: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_ast.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_ast.pyi new file mode 100644 index 00000000..da9ac361 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_ast.pyi @@ -0,0 +1,415 @@ +import sys +import typing +from typing import Any, Optional, ClassVar + +PyCF_ONLY_AST: int +if sys.version_info >= (3, 8): + PyCF_TYPE_COMMENTS: int + PyCF_ALLOW_TOP_LEVEL_AWAIT: int + +_identifier = str + +class AST: + _attributes: ClassVar[typing.Tuple[str, ...]] + _fields: ClassVar[typing.Tuple[str, ...]] + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + # TODO: Not all nodes have all of the following attributes + lineno: int + col_offset: int + if sys.version_info >= (3, 8): + end_lineno: Optional[int] + end_col_offset: Optional[int] + type_comment: Optional[str] + +class mod(AST): + ... + +if sys.version_info >= (3, 8): + class type_ignore(AST): ... + + class TypeIgnore(type_ignore): ... + + class FunctionType(mod): + argtypes: typing.List[expr] + returns: expr + +class Module(mod): + body: typing.List[stmt] + if sys.version_info >= (3, 7): + docstring: Optional[str] + if sys.version_info >= (3, 8): + type_ignores: typing.List[TypeIgnore] + +class Interactive(mod): + body: typing.List[stmt] + +class Expression(mod): + body: expr + +class Suite(mod): + body: typing.List[stmt] + + +class stmt(AST): ... + +class FunctionDef(stmt): + name: _identifier + args: arguments + body: typing.List[stmt] + decorator_list: typing.List[expr] + returns: Optional[expr] + if sys.version_info >= (3, 7): + docstring: Optional[str] + +class AsyncFunctionDef(stmt): + name: _identifier + args: arguments + body: typing.List[stmt] + decorator_list: typing.List[expr] + returns: Optional[expr] + if sys.version_info >= (3, 7): + docstring: Optional[str] + +class ClassDef(stmt): + name: _identifier + bases: typing.List[expr] + keywords: typing.List[keyword] + body: typing.List[stmt] + decorator_list: typing.List[expr] + if sys.version_info >= (3, 7): + docstring: Optional[str] + +class Return(stmt): + value: Optional[expr] + +class Delete(stmt): + targets: typing.List[expr] + +class Assign(stmt): + targets: typing.List[expr] + value: expr + +class AugAssign(stmt): + target: expr + op: operator + value: expr + +if sys.version_info >= (3, 6): + class AnnAssign(stmt): + target: expr + annotation: expr + value: Optional[expr] + simple: int + +class For(stmt): + target: expr + iter: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class AsyncFor(stmt): + target: expr + iter: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class While(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class If(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class With(stmt): + items: typing.List[withitem] + body: typing.List[stmt] + +class AsyncWith(stmt): + items: typing.List[withitem] + body: typing.List[stmt] + +class Raise(stmt): + exc: Optional[expr] + cause: Optional[expr] + +class Try(stmt): + body: typing.List[stmt] + handlers: typing.List[ExceptHandler] + orelse: typing.List[stmt] + finalbody: typing.List[stmt] + +class Assert(stmt): + test: expr + msg: Optional[expr] + +class Import(stmt): + names: typing.List[alias] + +class ImportFrom(stmt): + module: Optional[_identifier] + names: typing.List[alias] + level: int + +class Global(stmt): + names: typing.List[_identifier] + +class Nonlocal(stmt): + names: typing.List[_identifier] + +class Expr(stmt): + value: expr + +class Pass(stmt): ... +class Break(stmt): ... +class Continue(stmt): ... + + +class slice(AST): + ... + +_slice = slice # this lets us type the variable named 'slice' below + +class Slice(slice): + lower: Optional[expr] + upper: Optional[expr] + step: Optional[expr] + +class ExtSlice(slice): + dims: typing.List[slice] + +class Index(slice): + value: expr + + +class expr(AST): ... + +class BoolOp(expr): + op: boolop + values: typing.List[expr] + +class BinOp(expr): + left: expr + op: operator + right: expr + +class UnaryOp(expr): + op: unaryop + operand: expr + +class Lambda(expr): + args: arguments + body: expr + +class IfExp(expr): + test: expr + body: expr + orelse: expr + +class Dict(expr): + keys: typing.List[Optional[expr]] + values: typing.List[expr] + +class Set(expr): + elts: typing.List[expr] + +class ListComp(expr): + elt: expr + generators: typing.List[comprehension] + +class SetComp(expr): + elt: expr + generators: typing.List[comprehension] + +class DictComp(expr): + key: expr + value: expr + generators: typing.List[comprehension] + +class GeneratorExp(expr): + elt: expr + generators: typing.List[comprehension] + +class Await(expr): + value: expr + +class Yield(expr): + value: Optional[expr] + +class YieldFrom(expr): + value: expr + +class Compare(expr): + left: expr + ops: typing.List[cmpop] + comparators: typing.List[expr] + +class Call(expr): + func: expr + args: typing.List[expr] + keywords: typing.List[keyword] + +class Num(expr): # Deprecated in 3.8; use Constant + n: complex + +class Str(expr): # Deprecated in 3.8; use Constant + s: str + +if sys.version_info >= (3, 6): + class FormattedValue(expr): + value: expr + conversion: Optional[int] + format_spec: Optional[expr] + + class JoinedStr(expr): + values: typing.List[expr] + +class Bytes(expr): # Deprecated in 3.8; use Constant + s: bytes + +class NameConstant(expr): + value: Any + +if sys.version_info >= (3, 6): + class Constant(expr): + value: Any # None, str, bytes, bool, int, float, complex, Ellipsis + kind: Optional[str] + # Aliases for value, for backwards compatibility + s: Any + n: complex + +if sys.version_info >= (3, 8): + class NamedExpr(expr): + target: expr + value: expr + +class Ellipsis(expr): ... + +class Attribute(expr): + value: expr + attr: _identifier + ctx: expr_context + +class Subscript(expr): + value: expr + slice: _slice + ctx: expr_context + +class Starred(expr): + value: expr + ctx: expr_context + +class Name(expr): + id: _identifier + ctx: expr_context + +class List(expr): + elts: typing.List[expr] + ctx: expr_context + +class Tuple(expr): + elts: typing.List[expr] + ctx: expr_context + + +class expr_context(AST): + ... + +class AugLoad(expr_context): ... +class AugStore(expr_context): ... +class Del(expr_context): ... +class Load(expr_context): ... +class Param(expr_context): ... +class Store(expr_context): ... + + +class boolop(AST): + ... + +class And(boolop): ... +class Or(boolop): ... + +class operator(AST): + ... + +class Add(operator): ... +class BitAnd(operator): ... +class BitOr(operator): ... +class BitXor(operator): ... +class Div(operator): ... +class FloorDiv(operator): ... +class LShift(operator): ... +class Mod(operator): ... +class Mult(operator): ... +class MatMult(operator): ... +class Pow(operator): ... +class RShift(operator): ... +class Sub(operator): ... + +class unaryop(AST): + ... + +class Invert(unaryop): ... +class Not(unaryop): ... +class UAdd(unaryop): ... +class USub(unaryop): ... + +class cmpop(AST): + ... + +class Eq(cmpop): ... +class Gt(cmpop): ... +class GtE(cmpop): ... +class In(cmpop): ... +class Is(cmpop): ... +class IsNot(cmpop): ... +class Lt(cmpop): ... +class LtE(cmpop): ... +class NotEq(cmpop): ... +class NotIn(cmpop): ... + + +class comprehension(AST): + target: expr + iter: expr + ifs: typing.List[expr] + if sys.version_info >= (3, 6): + is_async: int + + +class excepthandler(AST): + ... + +class ExceptHandler(excepthandler): + type: Optional[expr] + name: Optional[_identifier] + body: typing.List[stmt] + + +class arguments(AST): + if sys.version_info >= (3, 8): + posonlyargs: typing.List[arg] + args: typing.List[arg] + vararg: Optional[arg] + kwonlyargs: typing.List[arg] + kw_defaults: typing.List[expr] + kwarg: Optional[arg] + defaults: typing.List[expr] + +class arg(AST): + arg: _identifier + annotation: Optional[expr] + +class keyword(AST): + arg: Optional[_identifier] + value: expr + +class alias(AST): + name: _identifier + asname: Optional[_identifier] + +class withitem(AST): + context_expr: expr + optional_vars: Optional[expr] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_compression.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_compression.pyi new file mode 100644 index 00000000..bf474e6b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_compression.pyi @@ -0,0 +1,16 @@ +from typing import Any +import io + +BUFFER_SIZE: Any + +class BaseStream(io.BufferedIOBase): ... + +class DecompressReader(io.RawIOBase): + def readable(self): ... + def __init__(self, fp, decomp_factory, trailing_error=..., **decomp_args): ... + def close(self): ... + def seekable(self): ... + def readinto(self, b): ... + def read(self, size: int = ...): ... + def seek(self, offset, whence=...): ... + def tell(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_dummy_thread.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_dummy_thread.pyi new file mode 100644 index 00000000..1260d42d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_dummy_thread.pyi @@ -0,0 +1,21 @@ +from typing import Any, Callable, Dict, NoReturn, Optional, Tuple + +TIMEOUT_MAX: int +error = RuntimeError + +def start_new_thread(function: Callable[..., Any], args: Tuple[Any, ...], kwargs: Dict[str, Any] = ...) -> None: ... +def exit() -> NoReturn: ... +def get_ident() -> int: ... +def allocate_lock() -> LockType: ... +def stack_size(size: Optional[int] = ...) -> int: ... + +class LockType(object): + locked_status: bool + def __init__(self) -> None: ... + def acquire(self, waitflag: Optional[bool] = ..., timeout: int = ...) -> bool: ... + def __enter__(self, waitflag: Optional[bool] = ..., timeout: int = ...) -> bool: ... + def __exit__(self, typ: Any, val: Any, tb: Any) -> None: ... + def release(self) -> bool: ... + def locked(self) -> bool: ... + +def interrupt_main() -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_imp.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_imp.pyi new file mode 100644 index 00000000..f3c3945b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_imp.pyi @@ -0,0 +1,20 @@ +# Stubs for _imp (Python 3.6) + +import types +from typing import Any, List + +from importlib.machinery import ModuleSpec +def create_builtin(spec: ModuleSpec) -> types.ModuleType: ... +def create_dynamic(spec: ModuleSpec, file: Any = ...) -> None: ... + +def acquire_lock() -> None: ... +def exec_builtin(mod: types.ModuleType) -> int: ... +def exec_dynamic(mod: types.ModuleType) -> int: ... +def extension_suffixes() -> List[str]: ... +def get_frozen_object(name: str) -> types.CodeType: ... +def init_frozen(name: str) -> types.ModuleType: ... +def is_builtin(name: str) -> int: ... +def is_frozen(name: str) -> bool: ... +def is_frozen_package(name: str) -> bool: ... +def lock_held() -> bool: ... +def release_lock() -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_importlib_modulespec.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_importlib_modulespec.pyi new file mode 100644 index 00000000..026dab8d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_importlib_modulespec.pyi @@ -0,0 +1,44 @@ +# ModuleSpec, ModuleType, Loader are part of a dependency cycle. +# They are officially defined/exported in other places: +# +# - ModuleType in types +# - Loader in importlib.abc +# - ModuleSpec in importlib.machinery (3.4 and later only) +# +# _Loader is the PEP-451-defined interface for a loader type/object. + +from abc import ABCMeta +from typing import Any, Dict, List, Optional, Protocol + +class _Loader(Protocol): + def load_module(self, fullname: str) -> ModuleType: ... + +class ModuleSpec: + def __init__(self, name: str, loader: Optional[Loader], *, + origin: Optional[str] = ..., loader_state: Any = ..., + is_package: Optional[bool] = ...) -> None: ... + name: str + loader: Optional[_Loader] + origin: Optional[str] + submodule_search_locations: Optional[List[str]] + loader_state: Any + cached: Optional[str] + parent: Optional[str] + has_location: bool + +class ModuleType: + __name__: str + __file__: str + __dict__: Dict[str, Any] + __loader__: Optional[_Loader] + __package__: Optional[str] + __spec__: Optional[ModuleSpec] + def __init__(self, name: str, doc: Optional[str] = ...) -> None: ... + +class Loader(metaclass=ABCMeta): + def load_module(self, fullname: str) -> ModuleType: ... + def module_repr(self, module: ModuleType) -> str: ... + def create_module(self, spec: ModuleSpec) -> Optional[ModuleType]: ... + # Not defined on the actual class for backwards-compatibility reasons, + # but expected in new code. + def exec_module(self, module: ModuleType) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_json.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_json.pyi new file mode 100644 index 00000000..217fadd1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_json.pyi @@ -0,0 +1,30 @@ +"""Stub file for the '_json' module.""" + +from typing import Any, Tuple + +class make_encoder: + sort_keys: Any + skipkeys: Any + key_separator: Any + indent: Any + markers: Any + default: Any + encoder: Any + item_separator: Any + def __init__(self, markers, default, encoder, indent, key_separator, + item_separator, sort_keys, skipkeys, allow_nan) -> None: ... + def __call__(self, *args, **kwargs) -> Any: ... + +class make_scanner: + object_hook: Any + object_pairs_hook: Any + parse_int: Any + parse_constant: Any + parse_float: Any + strict: bool + # TODO: 'context' needs the attrs above (ducktype), but not __call__. + def __init__(self, context: make_scanner) -> None: ... + def __call__(self, string: str, index: int) -> Tuple[Any, int]: ... + +def encode_basestring_ascii(s: str) -> str: ... +def scanstring(string: str, end: int, strict: bool = ...) -> Tuple[str, int]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_markupbase.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_markupbase.pyi new file mode 100644 index 00000000..09f69c74 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_markupbase.pyi @@ -0,0 +1,9 @@ +from typing import Tuple + +class ParserBase: + def __init__(self) -> None: ... + def error(self, message: str) -> None: ... + def reset(self) -> None: ... + def getpos(self) -> Tuple[int, int]: ... + + def unknown_decl(self, data: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_operator.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_operator.pyi new file mode 100644 index 00000000..e968fb7d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_operator.pyi @@ -0,0 +1,63 @@ +# Stubs for _operator (Python 3.5) + +from typing import AnyStr + +# In reality the import is the other way around, but this way we can keep the operator stub in 2and3 +from operator import ( + truth as truth, + contains as contains, + indexOf as indexOf, + countOf as countOf, + is_ as is_, + is_not as is_not, + index as index, + add as add, + sub as sub, + mul as mul, + floordiv as floordiv, + truediv as truediv, + mod as mod, + neg as neg, + pos as pos, + abs as abs, + inv as inv, + invert as invert, + length_hint as length_hint, + lshift as lshift, + rshift as rshift, + not_ as not_, + and_ as and_, + xor as xor, + or_ as or_, + iadd as iadd, + isub as isub, + imul as imul, + ifloordiv as ifloordiv, + itruediv as itruediv, + imod as imod, + ilshift as ilshift, + irshift as irshift, + iand as iand, + ixor as ixor, + ior as ior, + concat as concat, + iconcat as iconcat, + getitem as getitem, + setitem as setitem, + delitem as delitem, + pow as pow, + ipow as ipow, + eq as eq, + ne as ne, + lt as lt, + le as le, + gt as gt, + ge as ge, + itemgetter as itemgetter, + attrgetter as attrgetter, + methodcaller as methodcaller, + matmul as matmul, + imatmul as imatmul, +) + +def _compare_digest(a: AnyStr, b: AnyStr) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_posixsubprocess.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_posixsubprocess.pyi new file mode 100644 index 00000000..67b7d7cc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_posixsubprocess.pyi @@ -0,0 +1,14 @@ +# Stubs for _posixsubprocess + +# NOTE: These are incomplete! + +from typing import Tuple, Sequence, Callable + +def cloexec_pipe() -> Tuple[int, int]: ... +def fork_exec(args: Sequence[str], + executable_list: Sequence[bytes], close_fds: bool, fds_to_keep: Sequence[int], + cwd: str, env_list: Sequence[bytes], + p2cread: int, p2cwrite: int, c2pred: int, c2pwrite: int, + errread: int, errwrite: int, errpipe_read: int, + errpipe_write: int, restore_signals: int, start_new_session: int, + preexec_fn: Callable[[], None]) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_stat.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_stat.pyi new file mode 100644 index 00000000..ffd28cb8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_stat.pyi @@ -0,0 +1,69 @@ +"""Stub file for the '_stat' module.""" + +SF_APPEND: int +SF_ARCHIVED: int +SF_IMMUTABLE: int +SF_NOUNLINK: int +SF_SNAPSHOT: int +ST_ATIME: int +ST_CTIME: int +ST_DEV: int +ST_GID: int +ST_INO: int +ST_MODE: int +ST_MTIME: int +ST_NLINK: int +ST_SIZE: int +ST_UID: int +S_ENFMT: int +S_IEXEC: int +S_IFBLK: int +S_IFCHR: int +S_IFDIR: int +S_IFDOOR: int +S_IFIFO: int +S_IFLNK: int +S_IFPORT: int +S_IFREG: int +S_IFSOCK: int +S_IFWHT: int +S_IREAD: int +S_IRGRP: int +S_IROTH: int +S_IRUSR: int +S_IRWXG: int +S_IRWXO: int +S_IRWXU: int +S_ISGID: int +S_ISUID: int +S_ISVTX: int +S_IWGRP: int +S_IWOTH: int +S_IWRITE: int +S_IWUSR: int +S_IXGRP: int +S_IXOTH: int +S_IXUSR: int +UF_APPEND: int +UF_COMPRESSED: int +UF_HIDDEN: int +UF_IMMUTABLE: int +UF_NODUMP: int +UF_NOUNLINK: int +UF_OPAQUE: int + +def S_IMODE(mode: int) -> int: ... +def S_IFMT(mode: int) -> int: ... + +def S_ISBLK(mode: int) -> bool: ... +def S_ISCHR(mode: int) -> bool: ... +def S_ISDIR(mode: int) -> bool: ... +def S_ISDOOR(mode: int) -> bool: ... +def S_ISFIFO(mode: int) -> bool: ... +def S_ISLNK(mode: int) -> bool: ... +def S_ISPORT(mode: int) -> bool: ... +def S_ISREG(mode: int) -> bool: ... +def S_ISSOCK(mode: int) -> bool: ... +def S_ISWHT(mode: int) -> bool: ... + +def filemode(mode: int) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_subprocess.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_subprocess.pyi new file mode 100644 index 00000000..555a8d79 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_subprocess.pyi @@ -0,0 +1,38 @@ +# Stubs for _subprocess + +# NOTE: These are incomplete! + +from typing import Mapping, Any, Tuple + +CREATE_NEW_CONSOLE: int +CREATE_NEW_PROCESS_GROUP: int +STD_INPUT_HANDLE: int +STD_OUTPUT_HANDLE: int +STD_ERROR_HANDLE: int +SW_HIDE: int +STARTF_USESTDHANDLES: int +STARTF_USESHOWWINDOW: int +INFINITE: int +DUPLICATE_SAME_ACCESS: int +WAIT_OBJECT_0: int + +# TODO not exported by the Python module +class Handle: + def Close(self) -> None: ... + +def GetVersion() -> int: ... +def GetExitCodeProcess(handle: Handle) -> int: ... +def WaitForSingleObject(handle: Handle, timeout: int) -> int: ... +def CreateProcess(executable: str, cmd_line: str, + proc_attrs, thread_attrs, + inherit: int, flags: int, + env_mapping: Mapping[str, str], + curdir: str, + startupinfo: Any) -> Tuple[Any, Handle, int, int]: ... +def GetModuleFileName(module: int) -> str: ... +def GetCurrentProcess() -> Handle: ... +def DuplicateHandle(source_proc: Handle, source: Handle, target_proc: Handle, + target: Any, access: int, inherit: int) -> int: ... +def CreatePipe(pipe_attrs, size: int) -> Tuple[Handle, Handle]: ... +def GetStdHandle(arg: int) -> int: ... +def TerminateProcess(handle: Handle, exit_code: int) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_thread.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_thread.pyi new file mode 100644 index 00000000..051edefb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_thread.pyi @@ -0,0 +1,44 @@ +# Stubs for _thread + +import sys +from threading import Thread +from types import TracebackType +from typing import Any, Callable, Dict, NamedTuple, NoReturn, Optional, Tuple, Type + +error = RuntimeError + +def _count() -> int: ... + +_dangling: Any + +class LockType: + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + def release(self) -> None: ... + def locked(self) -> bool: ... + def __enter__(self) -> bool: ... + def __exit__( + self, + type: Optional[Type[BaseException]], + value: Optional[BaseException], + traceback: Optional[TracebackType], + ) -> None: ... + +def start_new_thread(function: Callable[..., Any], args: Tuple[Any, ...], kwargs: Dict[str, Any] = ...) -> int: ... +def interrupt_main() -> None: ... +def exit() -> NoReturn: ... +def allocate_lock() -> LockType: ... +def get_ident() -> int: ... +def stack_size(size: int = ...) -> int: ... + +TIMEOUT_MAX: int + +if sys.version_info >= (3, 8): + def get_native_id() -> int: ... # only available on some platforms + + class ExceptHookArgs(NamedTuple): + exc_type: Type[BaseException] + exc_value: Optional[BaseException] + exc_traceback: Optional[TracebackType] + thread: Optional[Thread] + def _ExceptHookArgs(args) -> ExceptHookArgs: ... + _excepthook: Callable[[ExceptHookArgs], Any] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_threading_local.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_threading_local.pyi new file mode 100644 index 00000000..426496b1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_threading_local.pyi @@ -0,0 +1,17 @@ +# Source: https://github.com/python/cpython/blob/master/Lib/_threading_local.py +from typing import Any, Dict, Tuple +from weakref import ReferenceType + +localdict = Dict[Any, Any] + +class _localimpl: + key: str + dicts: Dict[int, Tuple[ReferenceType[Any], localdict]] + def __init__(self) -> None: ... + def get_dict(self) -> localdict: ... + def create_dict(self) -> localdict: ... + +class local: + def __getattribute__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __delattr__(self, name: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_tracemalloc.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_tracemalloc.pyi new file mode 100644 index 00000000..e8a7168a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_tracemalloc.pyi @@ -0,0 +1,16 @@ +"""Stub file for the '_tracemalloc' module.""" +# This is an autogenerated file. It serves as a starting point +# for a more precise manual annotation of this module. +# Feel free to edit the source below, but remove this header when you do. + +from typing import Any, Tuple + +def _get_object_traceback(*args, **kwargs) -> Any: ... +def _get_traces() -> Any: ... +def clear_traces() -> None: ... +def get_traceback_limit() -> int: ... +def get_traced_memory() -> Tuple[Any, ...]: ... +def get_tracemalloc_memory() -> Any: ... +def is_tracing() -> bool: ... +def start(*args, **kwargs) -> None: ... +def stop() -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_winapi.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_winapi.pyi new file mode 100644 index 00000000..18a1ee93 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/_winapi.pyi @@ -0,0 +1,103 @@ +import sys +from typing import Any, Union, Tuple, Optional, overload, Dict, NoReturn, Sequence + +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + +CREATE_NEW_CONSOLE: int +CREATE_NEW_PROCESS_GROUP: int +DUPLICATE_CLOSE_SOURCE: int +DUPLICATE_SAME_ACCESS: int +ERROR_ALREADY_EXISTS: int +ERROR_BROKEN_PIPE: int +ERROR_IO_PENDING: int +ERROR_MORE_DATA: int +ERROR_NETNAME_DELETED: int +ERROR_NO_DATA: int +ERROR_NO_SYSTEM_RESOURCES: int +ERROR_OPERATION_ABORTED: int +ERROR_PIPE_BUSY: int +ERROR_PIPE_CONNECTED: int +ERROR_SEM_TIMEOUT: int +FILE_FLAG_FIRST_PIPE_INSTANCE: int +FILE_FLAG_OVERLAPPED: int +FILE_GENERIC_READ: int +FILE_GENERIC_WRITE: int +GENERIC_READ: int +GENERIC_WRITE: int +INFINITE: int +NMPWAIT_WAIT_FOREVER: int +NULL: int +OPEN_EXISTING: int +PIPE_ACCESS_DUPLEX: int +PIPE_ACCESS_INBOUND: int +PIPE_READMODE_MESSAGE: int +PIPE_TYPE_MESSAGE: int +PIPE_UNLIMITED_INSTANCES: int +PIPE_WAIT: int +PROCESS_ALL_ACCESS: int +PROCESS_DUP_HANDLE: int +STARTF_USESHOWWINDOW: int +STARTF_USESTDHANDLES: int +STD_ERROR_HANDLE: int +STD_INPUT_HANDLE: int +STD_OUTPUT_HANDLE: int +STILL_ACTIVE: int +SW_HIDE: int +WAIT_ABANDONED_0: int +WAIT_OBJECT_0: int +WAIT_TIMEOUT: int + +def CloseHandle(handle: int) -> None: ... + +@overload +def ConnectNamedPipe(handle: int, overlapped: Literal[True]) -> Overlapped: ... +@overload +def ConnectNamedPipe(handle: int, overlapped: Literal[False] = ...) -> None: ... +@overload +def ConnectNamedPipe(handle: int, overlapped: bool) -> Any: ... + +def CreateFile(file_name: str, desired_access: int, share_mode: int, security_attributes: int, creation_disposition: int, flags_and_attributes: int, template_file: int) -> int: ... +def CreateJunction(src_path: str, dest_path: str) -> None: ... +def CreateNamedPipe(name: str, open_mode: int, pipe_mode: int, max_instances: int, out_buffer_size: int, in_buffer_size: int, default_timeout: int, security_attributes: int) -> int: ... +def CreatePipe(pipe_attrs: Any, size: int) -> Tuple[int, int]: ... +def CreateProcess(application_name: Optional[str], command_line: Optional[str], proc_attrs: Any, thread_attrs: Any, inherit_handles: bool, creation_flags: int, env_mapping: Dict[str, str], cwd: Optional[str], startup_info: Any) -> Tuple[int, int, int, int]: ... +def DuplicateHandle(source_process_handle: int, source_handle: int, target_process_handle: int, desired_access: int, inherit_handle: bool, options: int = ...) -> int: ... +def ExitProcess(ExitCode: int) -> NoReturn: ... +def GetACP() -> int: ... +def GetFileType(handle: int) -> int: ... +def GetCurrentProcess() -> int: ... +def GetExitCodeProcess(process: int) -> int: ... +def GetLastError() -> int: ... +def GetModuleFileName(module_handle: int) -> str: ... +def GetStdHandle(std_handle: int) -> int: ... +def GetVersion() -> int: ... +def OpenProcess(desired_access: int, inherit_handle: bool, process_id: int) -> int: ... +def PeekNamedPipe(handle: int, size: int = ...) -> Union[Tuple[int, int], Tuple[bytes, int, int]]: ... + +# TODO: once literal types are supported, overload with Literal[True/False] +@overload +def ReadFile(handle: int, size: int, overlapped: Union[int, bool]) -> Any: ... +@overload +def ReadFile(handle: int, size: int) -> Tuple[int, int]: ... + +def SetNamedPipeHandleState(named_pipe: int, mode: Optional[int], max_collection_count: Optional[int], collect_data_timeout: Optional[int]) -> None: ... +def TerminateProcess(handle: int, exit_code: int) -> None: ... +def WaitForMultipleObjects(handle_seq: Sequence[int], wait_flag: bool, milliseconds: int = ...) -> int: ... +def WaitForSingleObject(handle: int, milliseconds: int) -> int: ... +def WaitNamedPipe(name: str, timeout: int) -> None: ... + +# TODO: once literal types are supported, overload with Literal[True/False] +@overload +def WriteFile(handle: int, buffer: bytes, overlapped: Union[int, bool]) -> Any: ... +@overload +def WriteFile(handle: int, buffer: bytes) -> Tuple[bytes, int]: ... + + +class Overlapped: + event: int = ... + def GetOverlappedResult(self, wait: bool) -> Tuple[int, int]: ... + def cancel(self) -> None: ... + def getbuffer(self) -> Optional[bytes]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/abc.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/abc.pyi new file mode 100644 index 00000000..e9c530d2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/abc.pyi @@ -0,0 +1,19 @@ +from typing import Any, Callable, Type, TypeVar +# Stubs for abc. + +_T = TypeVar('_T') +_FuncT = TypeVar('_FuncT', bound=Callable[..., Any]) + +# Thesee definitions have special processing in mypy +class ABCMeta(type): + def register(cls: ABCMeta, subclass: Type[_T]) -> Type[_T]: ... + +def abstractmethod(callable: _FuncT) -> _FuncT: ... +class abstractproperty(property): ... +# These two are deprecated and not supported by mypy +def abstractstaticmethod(callable: _FuncT) -> _FuncT: ... +def abstractclassmethod(callable: _FuncT) -> _FuncT: ... + +class ABC(metaclass=ABCMeta): ... + +def get_cache_token() -> object: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/ast.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/ast.pyi new file mode 100644 index 00000000..c517aa6e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/ast.pyi @@ -0,0 +1,61 @@ +import sys +# Rename typing to _typing, as not to conflict with typing imported +# from _ast below when loaded in an unorthodox way by the Dropbox +# internal Bazel integration. +import typing as _typing +from typing import Any, Iterator, Optional, TypeVar, Union, overload + +# The same unorthodox Bazel integration causes issues with sys, which +# is imported in both modules. unfortunately we can't just rename sys, +# since mypy only supports version checks with a sys that is named +# sys. +from _ast import * # type: ignore + +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + +class NodeVisitor: + def visit(self, node: AST) -> Any: ... + def generic_visit(self, node: AST) -> Any: ... + +class NodeTransformer(NodeVisitor): + def generic_visit(self, node: AST) -> Optional[AST]: ... + +_T = TypeVar("_T", bound=AST) + +if sys.version_info >= (3, 8): + @overload + def parse( + source: Union[str, bytes], + filename: Union[str, bytes] = ..., + mode: Literal["exec"] = ..., + type_comments: bool = ..., + feature_version: Union[None, int, _typing.Tuple[int, int]] = ..., + ) -> Module: ... + @overload + def parse( + source: Union[str, bytes], + filename: Union[str, bytes] = ..., + mode: str = ..., + type_comments: bool = ..., + feature_version: Union[None, int, _typing.Tuple[int, int]] = ..., + ) -> AST: ... + +else: + @overload + def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: Literal["exec"] = ...) -> Module: ... + @overload + def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: str = ...) -> AST: ... + +def copy_location(new_node: _T, old_node: AST) -> _T: ... +def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... +def fix_missing_locations(node: _T) -> _T: ... +def get_docstring(node: AST, clean: bool = ...) -> str: ... +def increment_lineno(node: _T, n: int = ...) -> _T: ... +def iter_child_nodes(node: AST) -> Iterator[AST]: ... +def iter_fields(node: AST) -> Iterator[_typing.Tuple[str, Any]]: ... +def literal_eval(node_or_string: Union[str, AST]) -> Any: ... +def get_source_segment(source: str, node: AST, *, padded: bool = ...) -> Optional[str]: ... +def walk(node: AST) -> Iterator[AST]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/__init__.pyi new file mode 100644 index 00000000..57747efb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/__init__.pyi @@ -0,0 +1,139 @@ +import sys +from typing import Type + +from asyncio.coroutines import ( + coroutine as coroutine, + iscoroutinefunction as iscoroutinefunction, + iscoroutine as iscoroutine, +) +from asyncio.protocols import ( + BaseProtocol as BaseProtocol, + Protocol as Protocol, + DatagramProtocol as DatagramProtocol, + SubprocessProtocol as SubprocessProtocol, +) +from asyncio.streams import ( + StreamReader as StreamReader, + StreamWriter as StreamWriter, + StreamReaderProtocol as StreamReaderProtocol, + open_connection as open_connection, + start_server as start_server, +) +from asyncio.subprocess import ( + create_subprocess_exec as create_subprocess_exec, + create_subprocess_shell as create_subprocess_shell, +) +from asyncio.transports import ( + BaseTransport as BaseTransport, + ReadTransport as ReadTransport, + WriteTransport as WriteTransport, + Transport as Transport, + DatagramTransport as DatagramTransport, + SubprocessTransport as SubprocessTransport, +) +from asyncio.futures import ( + Future as Future, + wrap_future as wrap_future, +) +from asyncio.tasks import ( + FIRST_COMPLETED as FIRST_COMPLETED, + FIRST_EXCEPTION as FIRST_EXCEPTION, + ALL_COMPLETED as ALL_COMPLETED, + as_completed as as_completed, + ensure_future as ensure_future, + gather as gather, + run_coroutine_threadsafe as run_coroutine_threadsafe, + shield as shield, + sleep as sleep, + wait as wait, + wait_for as wait_for, + Task as Task, +) +from asyncio.base_events import ( + BaseEventLoop as BaseEventLoop, + Server as Server +) +from asyncio.events import ( + AbstractEventLoopPolicy as AbstractEventLoopPolicy, + AbstractEventLoop as AbstractEventLoop, + AbstractServer as AbstractServer, + Handle as Handle, + TimerHandle as TimerHandle, + get_event_loop_policy as get_event_loop_policy, + set_event_loop_policy as set_event_loop_policy, + get_event_loop as get_event_loop, + set_event_loop as set_event_loop, + new_event_loop as new_event_loop, + get_child_watcher as get_child_watcher, + set_child_watcher as set_child_watcher, +) +from asyncio.queues import ( + Queue as Queue, + PriorityQueue as PriorityQueue, + LifoQueue as LifoQueue, + QueueFull as QueueFull, + QueueEmpty as QueueEmpty, +) +from asyncio.locks import ( + Lock as Lock, + Event as Event, + Condition as Condition, + Semaphore as Semaphore, + BoundedSemaphore as BoundedSemaphore, +) + +from asyncio.futures import isfuture as isfuture +from asyncio.events import ( + _set_running_loop as _set_running_loop, + _get_running_loop as _get_running_loop, +) +if sys.platform == 'win32': + from asyncio.windows_events import * +else: + from asyncio.streams import ( + open_unix_connection as open_unix_connection, + start_unix_server as start_unix_server, + ) + DefaultEventLoopPolicy: Type[AbstractEventLoopPolicy] + +if sys.version_info >= (3, 7): + from asyncio.events import ( + get_running_loop as get_running_loop, + ) + from asyncio.tasks import ( + all_tasks as all_tasks, + create_task as create_task, + current_task as current_task, + ) + from asyncio.runners import ( + run as run, + ) + +if sys.platform != 'win32': + # This is already imported above on Windows. + SelectorEventLoop: Type[AbstractEventLoop] + +# TODO: AbstractChildWatcher (UNIX only) + +if sys.version_info >= (3, 8): + from asyncio.exceptions import ( + CancelledError as CancelledError, + IncompleteReadError as IncompleteReadError, + InvalidStateError as InvalidStateError, + LimitOverrunError as LimitOverrunError, + SendfileNotAvailableError as SendfileNotAvailableError, + TimeoutError as TimeoutError, + ) +else: + from asyncio.events import ( + SendfileNotAvailableError as SendfileNotAvailableError + ) + from asyncio.futures import ( + CancelledError as CancelledError, + TimeoutError as TimeoutError, + InvalidStateError as InvalidStateError, + ) + from asyncio.streams import ( + IncompleteReadError as IncompleteReadError, + LimitOverrunError as LimitOverrunError, + ) diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/base_events.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/base_events.pyi new file mode 100644 index 00000000..3041c289 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/base_events.pyi @@ -0,0 +1,212 @@ +import selectors +from socket import socket, _Address, _RetAddress +import ssl +import sys +from typing import Any, Awaitable, Callable, Dict, Generator, IO, List, Optional, Sequence, Tuple, TypeVar, Union, overload +from abc import ABCMeta +from asyncio.futures import Future +from asyncio.events import AbstractEventLoop, AbstractServer, Handle, TimerHandle +from asyncio.protocols import BaseProtocol +from asyncio.tasks import Task +from asyncio.transports import BaseTransport + +if sys.version_info >= (3, 7): + from contextvars import Context + +_T = TypeVar('_T') +_Context = Dict[str, Any] +_ExceptionHandler = Callable[[AbstractEventLoop, _Context], Any] +_ProtocolFactory = Callable[[], BaseProtocol] +_SSLContext = Union[bool, None, ssl.SSLContext] +_TransProtPair = Tuple[BaseTransport, BaseProtocol] + +class Server(AbstractServer): ... + +class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta): + def run_forever(self) -> None: ... + + # Can't use a union, see mypy issue # 1873. + @overload + def run_until_complete(self, future: Generator[Any, None, _T]) -> _T: ... + @overload + def run_until_complete(self, future: Awaitable[_T]) -> _T: ... + + def stop(self) -> None: ... + def is_running(self) -> bool: ... + def is_closed(self) -> bool: ... + def close(self) -> None: ... + if sys.version_info >= (3, 6): + async def shutdown_asyncgens(self) -> None: ... + # Methods scheduling callbacks. All these return Handles. + if sys.version_info >= (3, 7): + def call_soon(self, callback: Callable[..., Any], *args: Any, context: Optional[Context] = ...) -> Handle: ... + def call_later( + self, delay: float, callback: Callable[..., Any], *args: Any, context: Optional[Context] = ..., + ) -> TimerHandle: ... + def call_at( + self, when: float, callback: Callable[..., Any], *args: Any, context: Optional[Context] = ..., + ) -> TimerHandle: ... + else: + def call_soon(self, callback: Callable[..., Any], *args: Any) -> Handle: ... + def call_later(self, delay: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ... + def call_at(self, when: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ... + def time(self) -> float: ... + # Future methods + def create_future(self) -> Future[Any]: ... + # Tasks methods + if sys.version_info >= (3, 8): + def create_task( + self, coro: Union[Awaitable[_T], Generator[Any, None, _T]], *, name: Optional[str] = ..., + ) -> Task[_T]: ... + else: + def create_task(self, coro: Union[Awaitable[_T], Generator[Any, None, _T]]) -> Task[_T]: ... + def set_task_factory(self, factory: Optional[Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]]]) -> None: ... + def get_task_factory(self) -> Optional[Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]]]: ... + # Methods for interacting with threads + if sys.version_info >= (3, 7): + def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any, context: Optional[Context] = ...) -> Handle: ... + else: + def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any) -> Handle: ... + async def run_in_executor(self, executor: Any, + func: Callable[..., _T], *args: Any) -> _T: ... + def set_default_executor(self, executor: Any) -> None: ... + # Network I/O methods returning Futures. + # TODO the "Tuple[Any, ...]" should be "Union[Tuple[str, int], Tuple[str, int, int, int]]" but that triggers + # https://github.com/python/mypy/issues/2509 + async def getaddrinfo(self, host: Optional[str], port: Union[str, int, None], *, + family: int = ..., type: int = ..., proto: int = ..., + flags: int = ...) -> List[Tuple[int, int, int, str, Tuple[Any, ...]]]: ... + async def getnameinfo(self, sockaddr: Tuple[Any, ...], flags: int = ...) -> Tuple[str, int]: ... + if sys.version_info >= (3, 8): + @overload + async def create_connection( + self, + protocol_factory: _ProtocolFactory, + host: str = ..., + port: int = ..., + *, + ssl: _SSLContext = ..., + family: int = ..., + proto: int = ..., + flags: int = ..., + sock: None = ..., + local_addr: Optional[str] = ..., + server_hostname: Optional[str] = ..., + ssl_handshake_timeout: Optional[float] = ..., + happy_eyeballs_delay: Optional[float] = ..., + interleave: Optional[int] = ..., + ) -> _TransProtPair: ... + @overload + async def create_connection( + self, + protocol_factory: _ProtocolFactory, + host: None = ..., + port: None = ..., + *, + ssl: _SSLContext = ..., + family: int = ..., + proto: int = ..., + flags: int = ..., + sock: socket, + local_addr: None = ..., + server_hostname: Optional[str] = ..., + ssl_handshake_timeout: Optional[float] = ..., + happy_eyeballs_delay: Optional[float] = ..., + interleave: Optional[int] = ..., + ) -> _TransProtPair: ... + elif sys.version_info >= (3, 7): + @overload + async def create_connection(self, protocol_factory: _ProtocolFactory, host: str = ..., port: int = ..., *, + ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., + sock: None = ..., local_addr: Optional[str] = ..., server_hostname: Optional[str] = ..., + ssl_handshake_timeout: Optional[float] = ...) -> _TransProtPair: ... + @overload + async def create_connection(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, + ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., + sock: socket, local_addr: None = ..., server_hostname: Optional[str] = ..., + ssl_handshake_timeout: Optional[float] = ...) -> _TransProtPair: ... + else: + @overload + async def create_connection(self, protocol_factory: _ProtocolFactory, host: str = ..., port: int = ..., *, + ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., sock: None = ..., + local_addr: Optional[str] = ..., server_hostname: Optional[str] = ...) -> _TransProtPair: ... + @overload + async def create_connection(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, + ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., sock: socket, + local_addr: None = ..., server_hostname: Optional[str] = ...) -> _TransProtPair: ... + if sys.version_info >= (3, 7): + async def sock_sendfile(self, sock: socket, file: IO[bytes], offset: int = ..., count: Optional[int] = ..., *, + fallback: bool = ...) -> int: ... + @overload + async def create_server(self, protocol_factory: _ProtocolFactory, host: Optional[Union[str, Sequence[str]]] = ..., + port: int = ..., *, family: int = ..., flags: int = ..., sock: None = ..., backlog: int = ..., + ssl: _SSLContext = ..., reuse_address: Optional[bool] = ..., reuse_port: Optional[bool] = ..., + ssl_handshake_timeout: Optional[float] = ..., start_serving: bool = ...) -> Server: ... + @overload + async def create_server(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, + family: int = ..., flags: int = ..., sock: socket = ..., backlog: int = ..., + ssl: _SSLContext = ..., reuse_address: Optional[bool] = ..., reuse_port: Optional[bool] = ..., + ssl_handshake_timeout: Optional[float] = ..., start_serving: bool = ...) -> Server: ... + async def connect_accepted_socket(self, protocol_factory: _ProtocolFactory, sock: socket, *, ssl: _SSLContext = ..., + ssl_handshake_timeout: Optional[float] = ...) -> _TransProtPair: ... + async def sendfile(self, transport: BaseTransport, file: IO[bytes], offset: int = ..., count: Optional[int] = ..., *, + fallback: bool = ...) -> int: ... + async def start_tls(self, transport: BaseTransport, protocol: BaseProtocol, sslcontext: ssl.SSLContext, *, + server_side: bool = ..., server_hostname: Optional[str] = ..., + ssl_handshake_timeout: Optional[float] = ...) -> BaseTransport: ... + else: + @overload + async def create_server(self, protocol_factory: _ProtocolFactory, host: Optional[Union[str, Sequence[str]]] = ..., port: int = ..., *, + family: int = ..., flags: int = ..., + sock: None = ..., backlog: int = ..., ssl: _SSLContext = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ...) -> Server: ... + @overload + async def create_server(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, + family: int = ..., flags: int = ..., + sock: socket, backlog: int = ..., ssl: _SSLContext = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ...) -> Server: ... + async def connect_accepted_socket(self, protocol_factory: _ProtocolFactory, sock: socket, *, ssl: _SSLContext = ...) -> _TransProtPair: ... + async def create_datagram_endpoint(self, protocol_factory: _ProtocolFactory, + local_addr: Optional[Tuple[str, int]] = ..., remote_addr: Optional[Tuple[str, int]] = ..., *, + family: int = ..., proto: int = ..., flags: int = ..., + reuse_address: Optional[bool] = ..., reuse_port: Optional[bool] = ..., + allow_broadcast: Optional[bool] = ..., + sock: Optional[socket] = ...) -> _TransProtPair: ... + # Pipes and subprocesses. + async def connect_read_pipe(self, protocol_factory: _ProtocolFactory, pipe: Any) -> _TransProtPair: ... + async def connect_write_pipe(self, protocol_factory: _ProtocolFactory, pipe: Any) -> _TransProtPair: ... + async def subprocess_shell(self, protocol_factory: _ProtocolFactory, cmd: Union[bytes, str], *, stdin: Any = ..., + stdout: Any = ..., stderr: Any = ..., + **kwargs: Any) -> _TransProtPair: ... + async def subprocess_exec(self, protocol_factory: _ProtocolFactory, *args: Any, stdin: Any = ..., + stdout: Any = ..., stderr: Any = ..., + **kwargs: Any) -> _TransProtPair: ... + def add_reader(self, fd: selectors._FileObject, callback: Callable[..., Any], *args: Any) -> None: ... + def remove_reader(self, fd: selectors._FileObject) -> None: ... + def add_writer(self, fd: selectors._FileObject, callback: Callable[..., Any], *args: Any) -> None: ... + def remove_writer(self, fd: selectors._FileObject) -> None: ... + # Completion based I/O methods returning Futures prior to 3.7 + if sys.version_info >= (3, 7): + async def sock_recv(self, sock: socket, nbytes: int) -> bytes: ... + async def sock_recv_into(self, sock: socket, buf: bytearray) -> int: ... + async def sock_sendall(self, sock: socket, data: bytes) -> None: ... + async def sock_connect(self, sock: socket, address: _Address) -> None: ... + async def sock_accept(self, sock: socket) -> Tuple[socket, _RetAddress]: ... + else: + def sock_recv(self, sock: socket, nbytes: int) -> Future[bytes]: ... + def sock_sendall(self, sock: socket, data: bytes) -> Future[None]: ... + def sock_connect(self, sock: socket, address: _Address) -> Future[None]: ... + def sock_accept(self, sock: socket) -> Future[Tuple[socket, _RetAddress]]: ... + # Signal handling. + def add_signal_handler(self, sig: int, callback: Callable[..., Any], *args: Any) -> None: ... + def remove_signal_handler(self, sig: int) -> None: ... + # Error handlers. + def set_exception_handler(self, handler: Optional[_ExceptionHandler]) -> None: ... + def get_exception_handler(self) -> Optional[_ExceptionHandler]: ... + def default_exception_handler(self, context: _Context) -> None: ... + def call_exception_handler(self, context: _Context) -> None: ... + # Debug flag management. + def get_debug(self) -> bool: ... + def set_debug(self, enabled: bool) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/constants.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/constants.pyi new file mode 100644 index 00000000..f15ea4fe --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/constants.pyi @@ -0,0 +1,13 @@ + +import enum + +LOG_THRESHOLD_FOR_CONNLOST_WRITES: int +ACCEPT_RETRY_DELAY: int +DEBUG_STACK_DEPTH: int +SSL_HANDSHAKE_TIMEOUT: float +SENDFILE_FALLBACK_READBUFFER_SIZE: int + +class _SendfileMode(enum.Enum): + UNSUPPORTED: int = ... + TRY_NATIVE: int = ... + FALLBACK: int = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/coroutines.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/coroutines.pyi new file mode 100644 index 00000000..f75dfe5f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/coroutines.pyi @@ -0,0 +1,7 @@ +from typing import Any, Callable, TypeVar + +_F = TypeVar('_F', bound=Callable[..., Any]) + +def coroutine(func: _F) -> _F: ... +def iscoroutinefunction(func: Callable[..., Any]) -> bool: ... +def iscoroutine(obj: Any) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/events.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/events.pyi new file mode 100644 index 00000000..84e61910 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/events.pyi @@ -0,0 +1,340 @@ +import selectors +from socket import socket, _Address, _RetAddress +import ssl +import sys +from typing import Any, Awaitable, Callable, Dict, Generator, IO, List, Optional, Sequence, Tuple, TypeVar, Union, overload +from abc import ABCMeta, abstractmethod +from asyncio.futures import Future +from asyncio.protocols import BaseProtocol +from asyncio.tasks import Task +from asyncio.transports import BaseTransport + +_T = TypeVar('_T') +_Context = Dict[str, Any] +_ExceptionHandler = Callable[[AbstractEventLoop, _Context], Any] +_ProtocolFactory = Callable[[], BaseProtocol] +_SSLContext = Union[bool, None, ssl.SSLContext] +_TransProtPair = Tuple[BaseTransport, BaseProtocol] + +class Handle: + _cancelled = False + _args: List[Any] + def __init__(self, callback: Callable[..., Any], args: List[Any], loop: AbstractEventLoop) -> None: ... + def __repr__(self) -> str: ... + def cancel(self) -> None: ... + def _run(self) -> None: ... + if sys.version_info >= (3, 7): + def cancelled(self) -> bool: ... + +class TimerHandle(Handle): + def __init__(self, when: float, callback: Callable[..., Any], args: List[Any], + loop: AbstractEventLoop) -> None: ... + def __hash__(self) -> int: ... + if sys.version_info >= (3, 7): + def when(self) -> float: ... + +class AbstractServer: + sockets: Optional[List[socket]] + def close(self) -> None: ... + if sys.version_info >= (3, 7): + async def __aenter__(self: _T) -> _T: ... + async def __aexit__(self, *exc: Any) -> None: ... + def get_loop(self) -> AbstractEventLoop: ... + def is_serving(self) -> bool: ... + async def start_serving(self) -> None: ... + async def serve_forever(self) -> None: ... + async def wait_closed(self) -> None: ... + +class AbstractEventLoop(metaclass=ABCMeta): + slow_callback_duration: float = ... + @abstractmethod + def run_forever(self) -> None: ... + + # Can't use a union, see mypy issue # 1873. + @overload + @abstractmethod + def run_until_complete(self, future: Generator[Any, None, _T]) -> _T: ... + @overload + @abstractmethod + def run_until_complete(self, future: Awaitable[_T]) -> _T: ... + + @abstractmethod + def stop(self) -> None: ... + @abstractmethod + def is_running(self) -> bool: ... + @abstractmethod + def is_closed(self) -> bool: ... + @abstractmethod + def close(self) -> None: ... + if sys.version_info >= (3, 6): + @abstractmethod + async def shutdown_asyncgens(self) -> None: ... + # Methods scheduling callbacks. All these return Handles. + @abstractmethod + def call_soon(self, callback: Callable[..., Any], *args: Any) -> Handle: ... + @abstractmethod + def call_later(self, delay: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ... + @abstractmethod + def call_at(self, when: float, callback: Callable[..., Any], *args: Any) -> TimerHandle: ... + @abstractmethod + def time(self) -> float: ... + # Future methods + @abstractmethod + def create_future(self) -> Future[Any]: ... + # Tasks methods + if sys.version_info >= (3, 8): + @abstractmethod + def create_task( + self, coro: Union[Awaitable[_T], Generator[Any, None, _T]], *, name: Optional[str] = ..., + ) -> Task[_T]: ... + else: + @abstractmethod + def create_task(self, coro: Union[Awaitable[_T], Generator[Any, None, _T]]) -> Task[_T]: ... + @abstractmethod + def set_task_factory(self, factory: Optional[Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]]]) -> None: ... + @abstractmethod + def get_task_factory(self) -> Optional[Callable[[AbstractEventLoop, Generator[Any, None, _T]], Future[_T]]]: ... + # Methods for interacting with threads + @abstractmethod + def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any) -> Handle: ... + @abstractmethod + async def run_in_executor(self, executor: Any, + func: Callable[..., _T], *args: Any) -> _T: ... + @abstractmethod + def set_default_executor(self, executor: Any) -> None: ... + # Network I/O methods returning Futures. + @abstractmethod + # TODO the "Tuple[Any, ...]" should be "Union[Tuple[str, int], Tuple[str, int, int, int]]" but that triggers + # https://github.com/python/mypy/issues/2509 + async def getaddrinfo(self, host: Optional[str], port: Union[str, int, None], *, + family: int = ..., type: int = ..., proto: int = ..., + flags: int = ...) -> List[Tuple[int, int, int, str, Tuple[Any, ...]]]: ... + @abstractmethod + async def getnameinfo(self, sockaddr: Tuple[Any, ...], flags: int = ...) -> Tuple[str, int]: ... + if sys.version_info >= (3, 8): + @overload + @abstractmethod + async def create_connection( + self, + protocol_factory: _ProtocolFactory, + host: str = ..., + port: int = ..., + *, + ssl: _SSLContext = ..., + family: int = ..., + proto: int = ..., + flags: int = ..., + sock: None = ..., + local_addr: Optional[str] = ..., + server_hostname: Optional[str] = ..., + ssl_handshake_timeout: Optional[float] = ..., + happy_eyeballs_delay: Optional[float] = ..., + interleave: Optional[int] = ..., + ) -> _TransProtPair: ... + @overload + @abstractmethod + async def create_connection( + self, + protocol_factory: _ProtocolFactory, + host: None = ..., + port: None = ..., + *, + ssl: _SSLContext = ..., + family: int = ..., + proto: int = ..., + flags: int = ..., + sock: socket, + local_addr: None = ..., + server_hostname: Optional[str] = ..., + ssl_handshake_timeout: Optional[float] = ..., + happy_eyeballs_delay: Optional[float] = ..., + interleave: Optional[int] = ..., + ) -> _TransProtPair: ... + elif sys.version_info >= (3, 7): + @overload + @abstractmethod + async def create_connection(self, protocol_factory: _ProtocolFactory, host: str = ..., port: int = ..., *, + ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., + sock: None = ..., local_addr: Optional[str] = ..., server_hostname: Optional[str] = ..., + ssl_handshake_timeout: Optional[float] = ...) -> _TransProtPair: ... + @overload + @abstractmethod + async def create_connection(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, + ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., + sock: socket, local_addr: None = ..., server_hostname: Optional[str] = ..., + ssl_handshake_timeout: Optional[float] = ...) -> _TransProtPair: ... + else: + @overload + @abstractmethod + async def create_connection(self, protocol_factory: _ProtocolFactory, host: str = ..., port: int = ..., *, + ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., sock: None = ..., + local_addr: Optional[str] = ..., server_hostname: Optional[str] = ...) -> _TransProtPair: ... + @overload + @abstractmethod + async def create_connection(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, + ssl: _SSLContext = ..., family: int = ..., proto: int = ..., flags: int = ..., sock: socket, + local_addr: None = ..., server_hostname: Optional[str] = ...) -> _TransProtPair: ... + if sys.version_info >= (3, 7): + @abstractmethod + async def sock_sendfile(self, sock: socket, file: IO[bytes], offset: int = ..., count: Optional[int] = ..., *, + fallback: bool = ...) -> int: ... + @overload + @abstractmethod + async def create_server(self, protocol_factory: _ProtocolFactory, host: Optional[Union[str, Sequence[str]]] = ..., + port: int = ..., *, family: int = ..., flags: int = ..., sock: None = ..., backlog: int = ..., + ssl: _SSLContext = ..., reuse_address: Optional[bool] = ..., reuse_port: Optional[bool] = ..., + ssl_handshake_timeout: Optional[float] = ..., start_serving: bool = ...) -> AbstractServer: ... + @overload + @abstractmethod + async def create_server(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, + family: int = ..., flags: int = ..., sock: socket = ..., backlog: int = ..., + ssl: _SSLContext = ..., reuse_address: Optional[bool] = ..., reuse_port: Optional[bool] = ..., + ssl_handshake_timeout: Optional[float] = ..., start_serving: bool = ...) -> AbstractServer: ... + @abstractmethod + async def create_unix_connection(self, protocol_factory: _ProtocolFactory, path: str, *, ssl: _SSLContext = ..., + sock: Optional[socket] = ..., server_hostname: str = ..., + ssl_handshake_timeout: Optional[float] = ...) -> _TransProtPair: ... + @abstractmethod + async def create_unix_server(self, protocol_factory: _ProtocolFactory, path: str, *, sock: Optional[socket] = ..., + backlog: int = ..., ssl: _SSLContext = ..., ssl_handshake_timeout: Optional[float] = ..., + start_serving: bool = ...) -> AbstractServer: ... + @abstractmethod + async def connect_accepted_socket(self, protocol_factory: _ProtocolFactory, sock: socket, *, ssl: _SSLContext = ..., + ssl_handshake_timeout: Optional[float] = ...) -> _TransProtPair: ... + @abstractmethod + async def sendfile(self, transport: BaseTransport, file: IO[bytes], offset: int = ..., count: Optional[int] = ..., *, + fallback: bool = ...) -> int: ... + @abstractmethod + async def start_tls(self, transport: BaseTransport, protocol: BaseProtocol, sslcontext: ssl.SSLContext, *, + server_side: bool = ..., server_hostname: Optional[str] = ..., + ssl_handshake_timeout: Optional[float] = ...) -> BaseTransport: ... + else: + @overload + @abstractmethod + async def create_server(self, protocol_factory: _ProtocolFactory, host: Optional[Union[str, Sequence[str]]] = ..., port: int = ..., *, + family: int = ..., flags: int = ..., + sock: None = ..., backlog: int = ..., ssl: _SSLContext = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ...) -> AbstractServer: ... + @overload + @abstractmethod + async def create_server(self, protocol_factory: _ProtocolFactory, host: None = ..., port: None = ..., *, + family: int = ..., flags: int = ..., + sock: socket, backlog: int = ..., ssl: _SSLContext = ..., + reuse_address: Optional[bool] = ..., + reuse_port: Optional[bool] = ...) -> AbstractServer: ... + @abstractmethod + async def create_unix_connection(self, protocol_factory: _ProtocolFactory, path: str, *, + ssl: _SSLContext = ..., sock: Optional[socket] = ..., + server_hostname: str = ...) -> _TransProtPair: ... + @abstractmethod + async def create_unix_server(self, protocol_factory: _ProtocolFactory, path: str, *, + sock: Optional[socket] = ..., backlog: int = ..., ssl: _SSLContext = ...) -> AbstractServer: ... + @abstractmethod + async def connect_accepted_socket(self, protocol_factory: _ProtocolFactory, sock: socket, *, ssl: _SSLContext = ...) -> _TransProtPair: ... + @abstractmethod + async def create_datagram_endpoint(self, protocol_factory: _ProtocolFactory, + local_addr: Optional[Tuple[str, int]] = ..., remote_addr: Optional[Tuple[str, int]] = ..., *, + family: int = ..., proto: int = ..., flags: int = ..., + reuse_address: Optional[bool] = ..., reuse_port: Optional[bool] = ..., + allow_broadcast: Optional[bool] = ..., + sock: Optional[socket] = ...) -> _TransProtPair: ... + # Pipes and subprocesses. + @abstractmethod + async def connect_read_pipe(self, protocol_factory: _ProtocolFactory, pipe: Any) -> _TransProtPair: ... + @abstractmethod + async def connect_write_pipe(self, protocol_factory: _ProtocolFactory, pipe: Any) -> _TransProtPair: ... + @abstractmethod + async def subprocess_shell(self, protocol_factory: _ProtocolFactory, cmd: Union[bytes, str], *, stdin: Any = ..., + stdout: Any = ..., stderr: Any = ..., + **kwargs: Any) -> _TransProtPair: ... + @abstractmethod + async def subprocess_exec(self, protocol_factory: _ProtocolFactory, *args: Any, stdin: Any = ..., + stdout: Any = ..., stderr: Any = ..., + **kwargs: Any) -> _TransProtPair: ... + @abstractmethod + def add_reader(self, fd: selectors._FileObject, callback: Callable[..., Any], *args: Any) -> None: ... + @abstractmethod + def remove_reader(self, fd: selectors._FileObject) -> None: ... + @abstractmethod + def add_writer(self, fd: selectors._FileObject, callback: Callable[..., Any], *args: Any) -> None: ... + @abstractmethod + def remove_writer(self, fd: selectors._FileObject) -> None: ... + # Completion based I/O methods returning Futures prior to 3.7 + if sys.version_info >= (3, 7): + @abstractmethod + async def sock_recv(self, sock: socket, nbytes: int) -> bytes: ... + @abstractmethod + async def sock_recv_into(self, sock: socket, buf: bytearray) -> int: ... + @abstractmethod + async def sock_sendall(self, sock: socket, data: bytes) -> None: ... + @abstractmethod + async def sock_connect(self, sock: socket, address: _Address) -> None: ... + @abstractmethod + async def sock_accept(self, sock: socket) -> Tuple[socket, _RetAddress]: ... + else: + @abstractmethod + def sock_recv(self, sock: socket, nbytes: int) -> Future[bytes]: ... + @abstractmethod + def sock_sendall(self, sock: socket, data: bytes) -> Future[None]: ... + @abstractmethod + def sock_connect(self, sock: socket, address: _Address) -> Future[None]: ... + @abstractmethod + def sock_accept(self, sock: socket) -> Future[Tuple[socket, _RetAddress]]: ... + # Signal handling. + @abstractmethod + def add_signal_handler(self, sig: int, callback: Callable[..., Any], *args: Any) -> None: ... + @abstractmethod + def remove_signal_handler(self, sig: int) -> None: ... + # Error handlers. + @abstractmethod + def set_exception_handler(self, handler: Optional[_ExceptionHandler]) -> None: ... + @abstractmethod + def get_exception_handler(self) -> Optional[_ExceptionHandler]: ... + @abstractmethod + def default_exception_handler(self, context: _Context) -> None: ... + @abstractmethod + def call_exception_handler(self, context: _Context) -> None: ... + # Debug flag management. + @abstractmethod + def get_debug(self) -> bool: ... + @abstractmethod + def set_debug(self, enabled: bool) -> None: ... + +class AbstractEventLoopPolicy(metaclass=ABCMeta): + @abstractmethod + def get_event_loop(self) -> AbstractEventLoop: ... + @abstractmethod + def set_event_loop(self, loop: Optional[AbstractEventLoop]) -> None: ... + @abstractmethod + def new_event_loop(self) -> AbstractEventLoop: ... + # Child processes handling (Unix only). + @abstractmethod + def get_child_watcher(self) -> Any: ... # TODO: unix_events.AbstractChildWatcher + @abstractmethod + def set_child_watcher(self, watcher: Any) -> None: ... # TODO: unix_events.AbstractChildWatcher + +class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy, metaclass=ABCMeta): + def __init__(self) -> None: ... + def get_event_loop(self) -> AbstractEventLoop: ... + def set_event_loop(self, loop: Optional[AbstractEventLoop]) -> None: ... + def new_event_loop(self) -> AbstractEventLoop: ... + +def get_event_loop_policy() -> AbstractEventLoopPolicy: ... +def set_event_loop_policy(policy: AbstractEventLoopPolicy) -> None: ... + +def get_event_loop() -> AbstractEventLoop: ... +def set_event_loop(loop: Optional[AbstractEventLoop]) -> None: ... +def new_event_loop() -> AbstractEventLoop: ... + +def get_child_watcher() -> Any: ... # TODO: unix_events.AbstractChildWatcher +def set_child_watcher(watcher: Any) -> None: ... # TODO: unix_events.AbstractChildWatcher + +def _set_running_loop(loop: Optional[AbstractEventLoop]) -> None: ... +def _get_running_loop() -> AbstractEventLoop: ... + +if sys.version_info >= (3, 7): + def get_running_loop() -> AbstractEventLoop: ... + +if sys.version_info < (3, 8): + class SendfileNotAvailableError(RuntimeError): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/exceptions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/exceptions.pyi new file mode 100644 index 00000000..ecec9560 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/exceptions.pyi @@ -0,0 +1,15 @@ +import sys +from typing import Optional + +if sys.version_info >= (3, 8): + class CancelledError(BaseException): ... + class TimeoutError(Exception): ... + class InvalidStateError(Exception): ... + class SendfileNotAvailableError(RuntimeError): ... + class IncompleteReadError(EOFError): + expected: Optional[int] + partial: bytes + def __init__(self, partial: bytes, expected: Optional[int]) -> None: ... + class LimitOverrunError(Exception): + consumed: int + def __init__(self, message: str, consumed: int) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/futures.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/futures.pyi new file mode 100644 index 00000000..824364a2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/futures.pyi @@ -0,0 +1,62 @@ +import sys +from typing import Any, Union, Callable, TypeVar, Type, List, Iterable, Generator, Awaitable, Optional, Tuple +from .events import AbstractEventLoop +from concurrent.futures import ( + Future as _ConcurrentFuture, + Error, +) + +if sys.version_info < (3, 8): + from concurrent.futures import CancelledError as CancelledError + from concurrent.futures import TimeoutError as TimeoutError + class InvalidStateError(Error): ... + +if sys.version_info >= (3, 7): + from contextvars import Context + +_T = TypeVar('_T') +_S = TypeVar('_S') + +class _TracebackLogger: + exc: BaseException + tb: List[str] + def __init__(self, exc: Any, loop: AbstractEventLoop) -> None: ... + def activate(self) -> None: ... + def clear(self) -> None: ... + def __del__(self) -> None: ... + +def isfuture(obj: object) -> bool: ... + +class Future(Awaitable[_T], Iterable[_T]): + _state: str + _exception: BaseException + _blocking = False + _log_traceback = False + _tb_logger: Type[_TracebackLogger] + def __init__(self, *, loop: Optional[AbstractEventLoop] = ...) -> None: ... + def __repr__(self) -> str: ... + def __del__(self) -> None: ... + if sys.version_info >= (3, 7): + def get_loop(self) -> AbstractEventLoop: ... + def _callbacks(self: _S) -> List[Tuple[Callable[[_S], Any], Context]]: ... + def add_done_callback(self: _S, __fn: Callable[[_S], Any], *, context: Optional[Context] = ...) -> None: ... + else: + @property + def _callbacks(self: _S) -> List[Callable[[_S], Any]]: ... + def add_done_callback(self: _S, __fn: Callable[[_S], Any]) -> None: ... + def cancel(self) -> bool: ... + def _schedule_callbacks(self) -> None: ... + def cancelled(self) -> bool: ... + def done(self) -> bool: ... + def result(self) -> _T: ... + def exception(self) -> BaseException: ... + def remove_done_callback(self: _S, fn: Callable[[_S], Any]) -> int: ... + def set_result(self, result: _T) -> None: ... + def set_exception(self, exception: Union[type, BaseException]) -> None: ... + def _copy_state(self, other: Any) -> None: ... + def __iter__(self) -> Generator[Any, None, _T]: ... + def __await__(self) -> Generator[Any, None, _T]: ... + @property + def _loop(self) -> AbstractEventLoop: ... + +def wrap_future(f: Union[_ConcurrentFuture[_T], Future[_T]], *, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/locks.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/locks.pyi new file mode 100644 index 00000000..19d47276 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/locks.pyi @@ -0,0 +1,51 @@ +from typing import Any, Callable, Type, TypeVar, Union, Optional, Awaitable + +from .events import AbstractEventLoop +from .futures import Future +from types import TracebackType + +_T = TypeVar('_T') + +class _ContextManager: + def __init__(self, lock: Union[Lock, Semaphore]) -> None: ... + def __enter__(self) -> object: ... + def __exit__(self, *args: Any) -> None: ... + +class _ContextManagerMixin(Future[_ContextManager]): + # Apparently this exists to *prohibit* use as a context manager. + def __enter__(self) -> object: ... + def __exit__(self, *args: Any) -> None: ... + def __aenter__(self) -> Awaitable[None]: ... + def __aexit__(self, exc_type: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[TracebackType]) -> Awaitable[None]: ... + +class Lock(_ContextManagerMixin): + def __init__(self, *, loop: Optional[AbstractEventLoop] = ...) -> None: ... + def locked(self) -> bool: ... + async def acquire(self) -> bool: ... + def release(self) -> None: ... + +class Event: + def __init__(self, *, loop: Optional[AbstractEventLoop] = ...) -> None: ... + def is_set(self) -> bool: ... + def set(self) -> None: ... + def clear(self) -> None: ... + async def wait(self) -> bool: ... + +class Condition(_ContextManagerMixin): + def __init__(self, lock: Optional[Lock] = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ... + def locked(self) -> bool: ... + async def acquire(self) -> bool: ... + def release(self) -> None: ... + async def wait(self) -> bool: ... + async def wait_for(self, predicate: Callable[[], _T]) -> _T: ... + def notify(self, n: int = ...) -> None: ... + def notify_all(self) -> None: ... + +class Semaphore(_ContextManagerMixin): + def __init__(self, value: int = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ... + def locked(self) -> bool: ... + async def acquire(self) -> bool: ... + def release(self) -> None: ... + +class BoundedSemaphore(Semaphore): + def __init__(self, value: int = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/proactor_events.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/proactor_events.pyi new file mode 100644 index 00000000..f7bc90db --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/proactor_events.pyi @@ -0,0 +1,80 @@ +import sys +from socket import socket +from typing import Any, Mapping, Optional, Union + +from . import base_events, constants, events, futures, streams, transports + +if sys.version_info >= (3, 7): + from os import PathLike + _Path = Union[str, PathLike[str]] +else: + _Path = str + +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + +class _ProactorBasePipeTransport(transports._FlowControlMixin, transports.BaseTransport): + + def __init__(self, loop: events.AbstractEventLoop, sock: socket, protocol: streams.StreamReaderProtocol, waiter: Optional[futures.Future[Any]] = ..., extra: Optional[Mapping[Any, Any]] = ..., server: Optional[events.AbstractServer] = ...) -> None: ... + def __repr__(self) -> str: ... + def __del__(self) -> None: ... + def get_write_buffer_size(self) -> int: ... + +class _ProactorReadPipeTransport(_ProactorBasePipeTransport, transports.ReadTransport): + + def __init__(self, loop: events.AbstractEventLoop, sock: socket, protocol: streams.StreamReaderProtocol, waiter: Optional[futures.Future[Any]] = ..., extra: Optional[Mapping[Any, Any]] = ..., server: Optional[events.AbstractServer] = ...) -> None: ... + +class _ProactorBaseWritePipeTransport(_ProactorBasePipeTransport, transports.WriteTransport): + + def __init__(self, loop: events.AbstractEventLoop, sock: socket, protocol: streams.StreamReaderProtocol, waiter: Optional[futures.Future[Any]] = ..., extra: Optional[Mapping[Any, Any]] = ..., server: Optional[events.AbstractServer] = ...) -> None: ... + +class _ProactorWritePipeTransport(_ProactorBaseWritePipeTransport): + + def __init__(self, loop: events.AbstractEventLoop, sock: socket, protocol: streams.StreamReaderProtocol, waiter: Optional[futures.Future[Any]] = ..., extra: Optional[Mapping[Any, Any]] = ..., server: Optional[events.AbstractServer] = ...) -> None: ... + +class _ProactorDuplexPipeTransport(_ProactorReadPipeTransport, _ProactorBaseWritePipeTransport, transports.Transport): ... + +class _ProactorSocketTransport(_ProactorReadPipeTransport, _ProactorBaseWritePipeTransport, transports.Transport): + + _sendfile_compatible: constants._SendfileMode = ... + + def __init__(self, loop: events.AbstractEventLoop, sock: socket, protocol: streams.StreamReaderProtocol, waiter: Optional[futures.Future[Any]] = ..., extra: Optional[Mapping[Any, Any]] = ..., server: Optional[events.AbstractServer] = ...) -> None: ... + def _set_extra(self, sock: socket) -> None: ... + def can_write_eof(self) -> Literal[True]: ... + def write_eof(self) -> None: ... + +class BaseProactorEventLoop(base_events.BaseEventLoop): + + def __init__(self, proactor: Any) -> None: ... + # The methods below don't actually exist directly, ProactorEventLoops do not implement them. However, they are + # needed to satisfy mypy + if sys.version_info >= (3, 7): + async def create_unix_connection( + self, + protocol_factory: events._ProtocolFactory, + path: _Path, + *, + ssl: events._SSLContext = ..., + sock: Optional[socket] = ..., + server_hostname: str = ..., + ssl_handshake_timeout: Optional[float] = ..., + ) -> events._TransProtPair: ... + async def create_unix_server( + self, + protocol_factory: events._ProtocolFactory, + path: _Path, + *, + sock: Optional[socket] = ..., + backlog: int = ..., + ssl: events._SSLContext = ..., + ssl_handshake_timeout: Optional[float] = ..., + start_serving: bool = ..., + ) -> events.AbstractServer: ... + else: + async def create_unix_connection(self, protocol_factory: events._ProtocolFactory, path: str, *, + ssl: events._SSLContext = ..., sock: Optional[socket] = ..., + server_hostname: str = ...) -> events._TransProtPair: ... + async def create_unix_server(self, protocol_factory: events._ProtocolFactory, path: str, *, + sock: Optional[socket] = ..., backlog: int = ..., ssl: events._SSLContext = ...) -> events.AbstractServer: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/protocols.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/protocols.pyi new file mode 100644 index 00000000..e80f238d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/protocols.pyi @@ -0,0 +1,25 @@ +from asyncio import transports +from typing import Optional, Text, Tuple, Union + +class BaseProtocol: + def connection_made(self, transport: transports.BaseTransport) -> None: ... + def connection_lost(self, exc: Optional[Exception]) -> None: ... + def pause_writing(self) -> None: ... + def resume_writing(self) -> None: ... + +class Protocol(BaseProtocol): + def data_received(self, data: bytes) -> None: ... + def eof_received(self) -> Optional[bool]: ... + +class BufferedProtocol(Protocol): + def get_buffer(self, sizehint: int) -> bytearray: ... + def buffer_updated(self, nbytes: int) -> None: ... + +class DatagramProtocol(BaseProtocol): + def datagram_received(self, data: Union[bytes, Text], addr: Tuple[str, int]) -> None: ... + def error_received(self, exc: Exception) -> None: ... + +class SubprocessProtocol(BaseProtocol): + def pipe_data_received(self, fd: int, data: Union[bytes, Text]) -> None: ... + def pipe_connection_lost(self, fd: int, exc: Optional[Exception]) -> None: ... + def process_exited(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/queues.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/queues.pyi new file mode 100644 index 00000000..420c67a9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/queues.pyi @@ -0,0 +1,35 @@ +from asyncio.events import AbstractEventLoop +from typing import Generic, TypeVar, Optional + +class QueueEmpty(Exception): ... +class QueueFull(Exception): ... + +_T = TypeVar('_T') + +class Queue(Generic[_T]): + def __init__(self, maxsize: int = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ... + def _init(self, maxsize: int) -> None: ... + def _get(self) -> _T: ... + def _put(self, item: _T) -> None: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + def _format(self) -> str: ... + def _consume_done_getters(self) -> None: ... + def _consume_done_putters(self) -> None: ... + def qsize(self) -> int: ... + @property + def maxsize(self) -> int: ... + def empty(self) -> bool: ... + def full(self) -> bool: ... + async def put(self, item: _T) -> None: ... + def put_nowait(self, item: _T) -> None: ... + async def get(self) -> _T: ... + def get_nowait(self) -> _T: ... + async def join(self) -> bool: ... + def task_done(self) -> None: ... + + +class PriorityQueue(Queue[_T]): ... + + +class LifoQueue(Queue[_T]): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/runners.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/runners.pyi new file mode 100644 index 00000000..7d8c28c0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/runners.pyi @@ -0,0 +1,9 @@ +import sys + + +if sys.version_info >= (3, 7): + from typing import Awaitable, TypeVar + + _T = TypeVar('_T') + + def run(main: Awaitable[_T], *, debug: bool = ...) -> _T: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/selector_events.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/selector_events.pyi new file mode 100644 index 00000000..7c3f74fc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/selector_events.pyi @@ -0,0 +1,44 @@ +import selectors +import sys +from socket import socket +from typing import Optional, Union + +from . import base_events, events + +if sys.version_info >= (3, 7): + from os import PathLike + _Path = Union[str, PathLike[str]] +else: + _Path = str + +class BaseSelectorEventLoop(base_events.BaseEventLoop): + + def __init__(self, selector: selectors.BaseSelector = ...) -> None: ... + if sys.version_info >= (3, 7): + async def create_unix_connection( + self, + protocol_factory: events._ProtocolFactory, + path: _Path, + *, + ssl: events._SSLContext = ..., + sock: Optional[socket] = ..., + server_hostname: str = ..., + ssl_handshake_timeout: Optional[float] = ..., + ) -> events._TransProtPair: ... + async def create_unix_server( + self, + protocol_factory: events._ProtocolFactory, + path: _Path, + *, + sock: Optional[socket] = ..., + backlog: int = ..., + ssl: events._SSLContext = ..., + ssl_handshake_timeout: Optional[float] = ..., + start_serving: bool = ..., + ) -> events.AbstractServer: ... + else: + async def create_unix_connection(self, protocol_factory: events._ProtocolFactory, path: str, *, + ssl: events._SSLContext = ..., sock: Optional[socket] = ..., + server_hostname: str = ...) -> events._TransProtPair: ... + async def create_unix_server(self, protocol_factory: events._ProtocolFactory, path: str, *, + sock: Optional[socket] = ..., backlog: int = ..., ssl: events._SSLContext = ...) -> events.AbstractServer: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/streams.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/streams.pyi new file mode 100644 index 00000000..e8517008 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/streams.pyi @@ -0,0 +1,108 @@ +import sys +from typing import Any, Awaitable, Callable, Iterable, Optional, Tuple, Union + +from . import events +from . import protocols +from . import transports + +_ClientConnectedCallback = Callable[[StreamReader, StreamWriter], Optional[Awaitable[None]]] + +if sys.version_info < (3, 8): + class IncompleteReadError(EOFError): + expected: Optional[int] + partial: bytes + def __init__(self, partial: bytes, expected: Optional[int]) -> None: ... + + class LimitOverrunError(Exception): + consumed: int + def __init__(self, message: str, consumed: int) -> None: ... + +async def open_connection( + host: str = ..., + port: Union[int, str] = ..., + *, + loop: Optional[events.AbstractEventLoop] = ..., + limit: int = ..., + ssl_handshake_timeout: Optional[float] = ..., + **kwds: Any +) -> Tuple[StreamReader, StreamWriter]: ... + +async def start_server( + client_connected_cb: _ClientConnectedCallback, + host: Optional[str] = ..., + port: Optional[Union[int, str]] = ..., + *, + loop: Optional[events.AbstractEventLoop] = ..., + limit: int = ..., + ssl_handshake_timeout: Optional[float] = ..., + **kwds: Any +) -> events.AbstractServer: ... + +if sys.platform != 'win32': + if sys.version_info >= (3, 7): + from os import PathLike + _PathType = Union[str, PathLike[str]] + else: + _PathType = str + + async def open_unix_connection( + path: _PathType = ..., + *, + loop: Optional[events.AbstractEventLoop] = ..., + limit: int = ..., + **kwds: Any + ) -> Tuple[StreamReader, StreamWriter]: ... + + async def start_unix_server( + client_connected_cb: _ClientConnectedCallback, + path: _PathType = ..., + *, + loop: Optional[events.AbstractEventLoop] = ..., + limit: int = ..., + **kwds: Any) -> events.AbstractServer: ... + +class FlowControlMixin(protocols.Protocol): ... + +class StreamReaderProtocol(FlowControlMixin, protocols.Protocol): + def __init__(self, + stream_reader: StreamReader, + client_connected_cb: _ClientConnectedCallback = ..., + loop: Optional[events.AbstractEventLoop] = ...) -> None: ... + def connection_made(self, transport: transports.BaseTransport) -> None: ... + def connection_lost(self, exc: Optional[Exception]) -> None: ... + def data_received(self, data: bytes) -> None: ... + def eof_received(self) -> bool: ... + +class StreamWriter: + def __init__(self, + transport: transports.BaseTransport, + protocol: protocols.BaseProtocol, + reader: Optional[StreamReader], + loop: events.AbstractEventLoop) -> None: ... + @property + def transport(self) -> transports.BaseTransport: ... + def write(self, data: bytes) -> None: ... + def writelines(self, data: Iterable[bytes]) -> None: ... + def write_eof(self) -> None: ... + def can_write_eof(self) -> bool: ... + def close(self) -> None: ... + if sys.version_info >= (3, 7): + def is_closing(self) -> bool: ... + async def wait_closed(self) -> None: ... + def get_extra_info(self, name: str, default: Any = ...) -> Any: ... + async def drain(self) -> None: ... + +class StreamReader: + def __init__(self, + limit: int = ..., + loop: Optional[events.AbstractEventLoop] = ...) -> None: ... + def exception(self) -> Exception: ... + def set_exception(self, exc: Exception) -> None: ... + def set_transport(self, transport: transports.BaseTransport) -> None: ... + def feed_eof(self) -> None: ... + def at_eof(self) -> bool: ... + def feed_data(self, data: bytes) -> None: ... + async def readline(self) -> bytes: ... + async def readuntil(self, separator: bytes = ...) -> bytes: ... + async def read(self, n: int = ...) -> bytes: ... + async def readexactly(self, n: int) -> bytes: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/subprocess.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/subprocess.pyi new file mode 100644 index 00000000..14137447 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/subprocess.pyi @@ -0,0 +1,60 @@ +from asyncio import events +from asyncio import protocols +from asyncio import streams +from asyncio import transports +from typing import Any, Optional, Text, Tuple, Union, IO + +PIPE: int +STDOUT: int +DEVNULL: int + +class SubprocessStreamProtocol(streams.FlowControlMixin, + protocols.SubprocessProtocol): + stdin: Optional[streams.StreamWriter] + stdout: Optional[streams.StreamReader] + stderr: Optional[streams.StreamReader] + def __init__(self, limit: int, loop: events.AbstractEventLoop) -> None: ... + def connection_made(self, transport: transports.BaseTransport) -> None: ... + def pipe_data_received(self, fd: int, data: Union[bytes, Text]) -> None: ... + def pipe_connection_lost(self, fd: int, exc: Optional[Exception]) -> None: ... + def process_exited(self) -> None: ... + + +class Process: + stdin: Optional[streams.StreamWriter] + stdout: Optional[streams.StreamReader] + stderr: Optional[streams.StreamReader] + pid: int + def __init__(self, + transport: transports.BaseTransport, + protocol: protocols.BaseProtocol, + loop: events.AbstractEventLoop) -> None: ... + @property + def returncode(self) -> int: ... + async def wait(self) -> int: ... + def send_signal(self, signal: int) -> None: ... + def terminate(self) -> None: ... + def kill(self) -> None: ... + async def communicate(self, input: Optional[bytes] = ...) -> Tuple[bytes, bytes]: ... + + +async def create_subprocess_shell( + *Args: Union[str, bytes], # Union used instead of AnyStr due to mypy issue #1236 + stdin: Union[int, IO[Any], None] = ..., + stdout: Union[int, IO[Any], None] = ..., + stderr: Union[int, IO[Any], None] = ..., + loop: events.AbstractEventLoop = ..., + limit: int = ..., + **kwds: Any +) -> Process: ... + +async def create_subprocess_exec( + program: Union[str, bytes], # Union used instead of AnyStr due to mypy issue #1236 + *args: Any, + stdin: Union[int, IO[Any], None] = ..., + stdout: Union[int, IO[Any], None] = ..., + stderr: Union[int, IO[Any], None] = ..., + loop: events.AbstractEventLoop = ..., + limit: int = ..., + **kwds: Any +) -> Process: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/tasks.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/tasks.pyi new file mode 100644 index 00000000..28614687 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/tasks.pyi @@ -0,0 +1,128 @@ +import concurrent.futures +import sys +from typing import ( + Any, TypeVar, Set, List, TextIO, Union, Tuple, Generic, Generator, Iterable, Awaitable, overload, Iterator, Optional, +) +from types import FrameType +from .events import AbstractEventLoop +from .futures import Future + +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + +_T = TypeVar('_T') +_T1 = TypeVar('_T1') +_T2 = TypeVar('_T2') +_T3 = TypeVar('_T3') +_T4 = TypeVar('_T4') +_T5 = TypeVar('_T5') +_FutureT = Union[Future[_T], Generator[Any, None, _T], Awaitable[_T]] + +FIRST_EXCEPTION: str +FIRST_COMPLETED: str +ALL_COMPLETED: str + +def as_completed(fs: Iterable[_FutureT[_T]], *, loop: Optional[AbstractEventLoop] = ..., + timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ... +def ensure_future(coro_or_future: _FutureT[_T], + *, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ... +# Prior to Python 3.7 'async' was an alias for 'ensure_future'. +# It became a keyword in 3.7. + +# `gather()` actually returns a list with length equal to the number +# of tasks passed; however, Tuple is used similar to the annotation for +# zip() because typing does not support variadic type variables. See +# typing PR #1550 for discussion. +@overload +def gather(coro_or_future1: _FutureT[_T1], + *, loop: Optional[AbstractEventLoop] = ..., return_exceptions: Literal[False] = ...) -> Future[Tuple[_T1]]: ... +@overload +def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], + *, loop: Optional[AbstractEventLoop] = ..., return_exceptions: Literal[False] = ...) -> Future[Tuple[_T1, _T2]]: ... +@overload +def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_or_future3: _FutureT[_T3], + *, loop: Optional[AbstractEventLoop] = ..., + return_exceptions: Literal[False] = ...) -> Future[Tuple[_T1, _T2, _T3]]: ... +@overload +def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_or_future3: _FutureT[_T3], + coro_or_future4: _FutureT[_T4], + *, loop: Optional[AbstractEventLoop] = ..., + return_exceptions: Literal[False] = ...) -> Future[Tuple[_T1, _T2, _T3, _T4]]: ... +@overload +def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_or_future3: _FutureT[_T3], + coro_or_future4: _FutureT[_T4], coro_or_future5: _FutureT[_T5], + *, loop: Optional[AbstractEventLoop] = ..., + return_exceptions: Literal[False] = ...) -> Future[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... +@overload +def gather(coro_or_future1: _FutureT[Any], coro_or_future2: _FutureT[Any], coro_or_future3: _FutureT[Any], + coro_or_future4: _FutureT[Any], coro_or_future5: _FutureT[Any], coro_or_future6: _FutureT[Any], + *coros_or_futures: _FutureT[Any], + loop: Optional[AbstractEventLoop] = ..., return_exceptions: bool = ...) -> Future[List[Any]]: ... +@overload +def gather(coro_or_future1: _FutureT[_T1], + *, loop: Optional[AbstractEventLoop] = ..., + return_exceptions: bool = ...) -> Future[Tuple[Union[_T1, BaseException]]]: ... +@overload +def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], + *, loop: Optional[AbstractEventLoop] = ..., + return_exceptions: bool = ...) -> Future[Tuple[Union[_T1, BaseException], Union[_T2, BaseException]]]: ... +@overload +def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_or_future3: _FutureT[_T3], + *, loop: Optional[AbstractEventLoop] = ..., return_exceptions: bool = ...) -> Future[ + Tuple[Union[_T1, BaseException], Union[_T2, BaseException], Union[_T3, BaseException]]]: ... +@overload +def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_or_future3: _FutureT[_T3], + coro_or_future4: _FutureT[_T4], + *, loop: Optional[AbstractEventLoop] = ..., return_exceptions: bool = ...) -> Future[ + Tuple[Union[_T1, BaseException], Union[_T2, BaseException], Union[_T3, BaseException], Union[_T4, BaseException]]]: ... +@overload +def gather(coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], coro_or_future3: _FutureT[_T3], + coro_or_future4: _FutureT[_T4], coro_or_future5: _FutureT[_T5], + *, loop: Optional[AbstractEventLoop] = ..., return_exceptions: bool = ...) -> Future[ + Tuple[Union[_T1, BaseException], Union[_T2, BaseException], Union[_T3, BaseException], Union[_T4, BaseException], Union[_T5, BaseException]]]: ... +def run_coroutine_threadsafe(coro: _FutureT[_T], + loop: AbstractEventLoop) -> concurrent.futures.Future[_T]: ... +def shield(arg: _FutureT[_T], *, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ... +def sleep(delay: float, result: _T = ..., loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ... +def wait(fs: Iterable[_FutureT[_T]], *, loop: Optional[AbstractEventLoop] = ..., timeout: Optional[float] = ..., + return_when: str = ...) -> Future[Tuple[Set[Future[_T]], Set[Future[_T]]]]: ... +def wait_for(fut: _FutureT[_T], timeout: Optional[float], + *, loop: Optional[AbstractEventLoop] = ...) -> Future[_T]: ... + +class Task(Future[_T], Generic[_T]): + @classmethod + def current_task(cls, loop: Optional[AbstractEventLoop] = ...) -> Task[Any]: ... + @classmethod + def all_tasks(cls, loop: Optional[AbstractEventLoop] = ...) -> Set[Task[Any]]: ... + if sys.version_info >= (3, 8): + def __init__( + self, + coro: Union[Generator[Any, None, _T], Awaitable[_T]], + *, + loop: AbstractEventLoop = ..., + name: Optional[str] = ..., + ) -> None: ... + else: + def __init__(self, coro: Union[Generator[Any, None, _T], Awaitable[_T]], *, loop: AbstractEventLoop = ...) -> None: ... + def __repr__(self) -> str: ... + if sys.version_info >= (3, 8): + def get_coro(self) -> Any: ... + def get_name(self) -> str: ... + def set_name(self, value: object) -> None: ... + def get_stack(self, *, limit: int = ...) -> List[FrameType]: ... + def print_stack(self, *, limit: int = ..., file: TextIO = ...) -> None: ... + def cancel(self) -> bool: ... + def _step(self, value: Any = ..., exc: Exception = ...) -> None: ... + def _wakeup(self, future: Future[Any]) -> None: ... + +if sys.version_info >= (3, 7): + def all_tasks(loop: Optional[AbstractEventLoop] = ...) -> Set[Task[Any]]: ... + if sys.version_info >= (3, 8): + def create_task( + coro: Union[Generator[Any, None, _T], Awaitable[_T]], *, name: Optional[str] = ..., + ) -> Task[Any]: ... + else: + def create_task(coro: Union[Generator[Any, None, _T], Awaitable[_T]]) -> Task[Any]: ... + def current_task(loop: Optional[AbstractEventLoop] = ...) -> Optional[Task[Any]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/transports.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/transports.pyi new file mode 100644 index 00000000..df80beb4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/transports.pyi @@ -0,0 +1,48 @@ +import sys +from typing import Any, Mapping, List, Optional, Tuple +from asyncio.protocols import BaseProtocol +from asyncio.events import AbstractEventLoop + +class BaseTransport: + def __init__(self, extra: Mapping[Any, Any] = ...) -> None: ... + def get_extra_info(self, name: Any, default: Any = ...) -> Any: ... + def is_closing(self) -> bool: ... + def close(self) -> None: ... + if sys.version_info >= (3, 5): + def set_protocol(self, protocol: BaseProtocol) -> None: ... + def get_protocol(self) -> BaseProtocol: ... + +class ReadTransport(BaseTransport): + if sys.version_info >= (3, 7): + def is_reading(self) -> bool: ... + def pause_reading(self) -> None: ... + def resume_reading(self) -> None: ... + +class WriteTransport(BaseTransport): + def set_write_buffer_limits( + self, high: int = ..., low: int = ... + ) -> None: ... + def get_write_buffer_size(self) -> int: ... + def write(self, data: Any) -> None: ... + def writelines(self, list_of_data: List[Any]) -> None: ... + def write_eof(self) -> None: ... + def can_write_eof(self) -> bool: ... + def abort(self) -> None: ... + +class Transport(ReadTransport, WriteTransport): ... + +class DatagramTransport(BaseTransport): + def sendto(self, data: Any, addr: Optional[Tuple[str, int]] = ...) -> None: ... + def abort(self) -> None: ... + +class SubprocessTransport(BaseTransport): + def get_pid(self) -> int: ... + def get_returncode(self) -> int: ... + def get_pipe_transport(self, fd: int) -> BaseTransport: ... + def send_signal(self, signal: int) -> int: ... + def terminate(self) -> None: ... + def kill(self) -> None: ... + +class _FlowControlMixin(Transport): + def __init__(self, extra: Optional[Mapping[Any, Any]] = ..., loop: Optional[AbstractEventLoop] = ...) -> None: ... + def get_write_buffer_limits(self) -> Tuple[int, int]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/windows_events.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/windows_events.pyi new file mode 100644 index 00000000..1933f52d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/windows_events.pyi @@ -0,0 +1,58 @@ + +from typing import Callable, Tuple, List, IO, Any, Optional +import socket +from . import proactor_events, events, futures, windows_utils, selector_events, streams + +NULL: int +INFINITE: int +ERROR_CONNECTION_REFUSED: int +ERROR_CONNECTION_ABORTED: int +CONNECT_PIPE_INIT_DELAY: float +CONNECT_PIPE_MAX_DELAY: float + +class PipeServer: + + def __init__(self, address: str) -> None: ... + def __del__(self) -> None: ... + def closed(self) -> bool: ... + def close(self) -> None: ... + +class _WindowsSelectorEventLoop(selector_events.BaseSelectorEventLoop): ... + +class ProactorEventLoop(proactor_events.BaseProactorEventLoop): + + def __init__(self, proactor: Optional[IocpProactor] = ...) -> None: ... + async def create_pipe_connection(self, protocol_factory: Callable[[], streams.StreamReaderProtocol], address: str) -> Tuple[proactor_events._ProactorDuplexPipeTransport, streams.StreamReaderProtocol]: ... + async def start_serving_pipe(self, protocol_factory: Callable[[], streams.StreamReaderProtocol], address: str) -> List[PipeServer]: ... + +class IocpProactor: + + def __init__(self, concurrency: int = ...) -> None: ... + def __repr__(self) -> str: ... + def __del__(self) -> None: ... + def set_loop(self, loop: events.AbstractEventLoop) -> None: ... + def select(self, timeout: Optional[int] = ...) -> List[futures.Future[Any]]: ... + def recv(self, conn: socket.socket, nbytes: int, flags: int = ...) -> futures.Future[bytes]: ... + def recv_into(self, conn: socket.socket, buf: socket._WriteBuffer, flags: int = ...) -> futures.Future[Any]: ... + def send(self, conn: socket.socket, buf: socket._WriteBuffer, flags: int = ...) -> futures.Future[Any]: ... + def accept(self, listener: socket.socket) -> futures.Future[Any]: ... + def connect(self, conn: socket.socket, address: bytes) -> futures.Future[Any]: ... + def sendfile(self, sock: socket.socket, file: IO[bytes], offset: int, count: int) -> futures.Future[Any]: ... + def accept_pipe(self, pipe: socket.socket) -> futures.Future[Any]: ... + async def connect_pipe(self, address: bytes) -> windows_utils.PipeHandle: ... + def wait_for_handle(self, handle: windows_utils.PipeHandle, timeout: int = ...) -> bool: ... + def close(self) -> None: ... + +SelectorEventLoop = _WindowsSelectorEventLoop + +class WindowsSelectorEventLoopPolicy(events.BaseDefaultEventLoopPolicy): + _loop_factory: events.AbstractEventLoop = ... + def get_child_watcher(self) -> Any: ... + def set_child_watcher(self, watcher: Any) -> None: ... + +class WindowsProactorEventLoopPolicy(events.BaseDefaultEventLoopPolicy): + _loop_factory: events.AbstractEventLoop = ... + def get_child_watcher(self) -> Any: ... + def set_child_watcher(self, watcher: Any) -> None: ... + +DefaultEventLoopPolicy = WindowsSelectorEventLoopPolicy diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/windows_utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/windows_utils.pyi new file mode 100644 index 00000000..f29703f0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/asyncio/windows_utils.pyi @@ -0,0 +1,21 @@ + +from typing import Tuple, Callable, Optional +from types import TracebackType + +BUFSIZE: int +PIPE: int +STDOUT: int + +def pipe(*, duplex: bool = ..., overlapped: Tuple[bool, bool] = ..., bufsize: int = ...) -> Tuple[int, int]: ... + +class PipeHandle: + + def __init__(self, handle: int) -> None: ... + def __repr__(self) -> str: ... + def __del__(self) -> None: ... + def __enter__(self) -> PipeHandle: ... + def __exit__(self, t: Optional[type], v: Optional[BaseException], tb: Optional[TracebackType]) -> None: ... + @property + def handle(self) -> int: ... + def fileno(self) -> int: ... + def close(self, *, CloseHandle: Callable[[int], None] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/atexit.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/atexit.pyi new file mode 100644 index 00000000..24f93899 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/atexit.pyi @@ -0,0 +1,9 @@ +"""Stub file for the 'atexit' module.""" + +from typing import Any, Callable + +def _clear() -> None: ... +def _ncallbacks() -> int: ... +def _run_exitfuncs() -> None: ... +def register(func: Callable[..., Any], *args: Any, **kwargs: Any) -> Callable[..., Any]: ... +def unregister(func: Callable[..., Any]) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/collections/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/collections/__init__.pyi new file mode 100644 index 00000000..400c3dc3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/collections/__init__.pyi @@ -0,0 +1,338 @@ +# These are not exported. +import sys +import typing +from typing import ( + TypeVar, Generic, Dict, overload, List, Tuple, + Any, Type, Optional, Union +) +# These are exported. +from . import abc + +from typing import ( + AsyncIterable as AsyncIterable, + AsyncIterator as AsyncIterator, + Awaitable as Awaitable, + Callable as Callable, + Container as Container, + Coroutine as Coroutine, + Hashable as Hashable, + Iterable as Iterable, + Iterator as Iterator, + Sized as Sized, + Generator as Generator, + ByteString as ByteString, + Reversible as Reversible, + Mapping as Mapping, + MappingView as MappingView, + ItemsView as ItemsView, + KeysView as KeysView, + ValuesView as ValuesView, + MutableMapping as MutableMapping, + Sequence as Sequence, + MutableSequence as MutableSequence, + MutableSet as MutableSet, + AbstractSet as Set, +) +if sys.version_info >= (3, 6): + from typing import ( + Collection as Collection, + AsyncGenerator as AsyncGenerator, + ) + +_S = TypeVar('_S') +_T = TypeVar('_T') +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') + + +# namedtuple is special-cased in the type checker; the initializer is ignored. +if sys.version_info >= (3, 7): + def namedtuple( + typename: str, + field_names: Union[str, Iterable[str]], + *, + rename: bool = ..., + module: Optional[str] = ..., + defaults: Optional[Iterable[Any]] = ..., + ) -> Type[Tuple[Any, ...]]: ... +elif sys.version_info >= (3, 6): + def namedtuple( + typename: str, + field_names: Union[str, Iterable[str]], + *, + verbose: bool = ..., + rename: bool = ..., + module: Optional[str] = ..., + ) -> Type[Tuple[Any, ...]]: ... +else: + def namedtuple( + typename: str, field_names: Union[str, Iterable[str]], verbose: bool = ..., rename: bool = ..., + ) -> Type[Tuple[Any, ...]]: ... + +class UserDict(MutableMapping[_KT, _VT]): + data: Dict[_KT, _VT] + def __init__(self, dict: Optional[Mapping[_KT, _VT]] = ..., **kwargs: _VT) -> None: ... + def __len__(self) -> int: ... + def __getitem__(self, key: _KT) -> _VT: ... + def __setitem__(self, key: _KT, item: _VT) -> None: ... + def __delitem__(self, key: _KT) -> None: ... + def __iter__(self) -> Iterator[_KT]: ... + def __contains__(self, key: object) -> bool: ... + def copy(self: _S) -> _S: ... + @classmethod + def fromkeys(cls: Type[_S], iterable: Iterable[_KT], value: Optional[_VT] = ...) -> _S: ... + +class UserList(MutableSequence[_T]): + data: List[_T] + def __init__(self, initlist: Optional[Iterable[_T]] = ...) -> None: ... + def __lt__(self, other: object) -> bool: ... + def __le__(self, other: object) -> bool: ... + def __gt__(self, other: object) -> bool: ... + def __ge__(self, other: object) -> bool: ... + def __contains__(self, item: object) -> bool: ... + def __len__(self) -> int: ... + @overload + def __getitem__(self, i: int) -> _T: ... + @overload + def __getitem__(self, i: slice) -> MutableSequence[_T]: ... + @overload + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + def __setitem__(self, i: slice, o: Iterable[_T]) -> None: ... + def __delitem__(self, i: Union[int, slice]) -> None: ... + def __add__(self: _S, other: Iterable[_T]) -> _S: ... + def __iadd__(self: _S, other: Iterable[_T]) -> _S: ... + def __mul__(self: _S, n: int) -> _S: ... + def __imul__(self: _S, n: int) -> _S: ... + def append(self, item: _T) -> None: ... + def insert(self, i: int, item: _T) -> None: ... + def pop(self, i: int = ...) -> _T: ... + def remove(self, item: _T) -> None: ... + def clear(self) -> None: ... + def copy(self: _S) -> _S: ... + def count(self, item: _T) -> int: ... + def index(self, item: _T, *args: Any) -> int: ... + def reverse(self) -> None: ... + def sort(self, *args: Any, **kwds: Any) -> None: ... + def extend(self, other: Iterable[_T]) -> None: ... + +_UserStringT = TypeVar('_UserStringT', bound=UserString) + +class UserString(Sequence[str]): + data: str + def __init__(self, seq: object) -> None: ... + def __int__(self) -> int: ... + def __float__(self) -> float: ... + def __complex__(self) -> complex: ... + def __getnewargs__(self) -> Tuple[str]: ... + def __lt__(self, string: Union[str, UserString]) -> bool: ... + def __le__(self, string: Union[str, UserString]) -> bool: ... + def __gt__(self, string: Union[str, UserString]) -> bool: ... + def __ge__(self, string: Union[str, UserString]) -> bool: ... + def __contains__(self, char: object) -> bool: ... + def __len__(self) -> int: ... + # It should return a str to implement Sequence correctly, but it doesn't. + def __getitem__(self: _UserStringT, i: Union[int, slice]) -> _UserStringT: ... # type: ignore + def __add__(self: _UserStringT, other: object) -> _UserStringT: ... + def __mul__(self: _UserStringT, n: int) -> _UserStringT: ... + def __mod__(self: _UserStringT, args: Any) -> _UserStringT: ... + def capitalize(self: _UserStringT) -> _UserStringT: ... + def casefold(self: _UserStringT) -> _UserStringT: ... + def center(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ... + def count(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... + def encode(self: _UserStringT, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UserStringT: ... + def endswith(self, suffix: Union[str, Tuple[str, ...]], start: int = ..., end: int = ...) -> bool: ... + def expandtabs(self: _UserStringT, tabsize: int = ...) -> _UserStringT: ... + def find(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... + def format(self, *args: Any, **kwds: Any) -> str: ... + def format_map(self, mapping: Mapping[str, Any]) -> str: ... + def index(self, sub: str, start: int = ..., end: int = ...) -> int: ... + def isalpha(self) -> bool: ... + def isalnum(self) -> bool: ... + def isdecimal(self) -> bool: ... + def isdigit(self) -> bool: ... + def isidentifier(self) -> bool: ... + def islower(self) -> bool: ... + def isnumeric(self) -> bool: ... + def isprintable(self) -> bool: ... + def isspace(self) -> bool: ... + def istitle(self) -> bool: ... + def isupper(self) -> bool: ... + def join(self, seq: Iterable[str]) -> str: ... + def ljust(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ... + def lower(self: _UserStringT) -> _UserStringT: ... + def lstrip(self: _UserStringT, chars: Optional[str] = ...) -> _UserStringT: ... + @staticmethod + @overload + def maketrans(x: Union[Dict[int, _T], Dict[str, _T], Dict[Union[str, int], _T]]) -> Dict[int, _T]: ... + @staticmethod + @overload + def maketrans(x: str, y: str, z: str = ...) -> Dict[int, Union[int, None]]: ... + def partition(self, sep: str) -> Tuple[str, str, str]: ... + def replace(self: _UserStringT, old: Union[str, UserString], new: Union[str, UserString], maxsplit: int = ...) -> _UserStringT: ... + def rfind(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... + def rindex(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... + def rjust(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ... + def rpartition(self, sep: str) -> Tuple[str, str, str]: ... + def rstrip(self: _UserStringT, chars: Optional[str] = ...) -> _UserStringT: ... + def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ... + def splitlines(self, keepends: bool = ...) -> List[str]: ... + def startswith(self, prefix: Union[str, Tuple[str, ...]], start: int = ..., end: int = ...) -> bool: ... + def strip(self: _UserStringT, chars: Optional[str] = ...) -> _UserStringT: ... + def swapcase(self: _UserStringT) -> _UserStringT: ... + def title(self: _UserStringT) -> _UserStringT: ... + def translate(self: _UserStringT, *args: Any) -> _UserStringT: ... + def upper(self: _UserStringT) -> _UserStringT: ... + def zfill(self: _UserStringT, width: int) -> _UserStringT: ... + + +# Technically, deque only derives from MutableSequence in 3.5 (before then, the insert and index +# methods did not exist). +# But in practice it's not worth losing sleep over. +class deque(MutableSequence[_T], Generic[_T]): + @property + def maxlen(self) -> Optional[int]: ... + def __init__(self, iterable: Iterable[_T] = ..., + maxlen: Optional[int] = ...) -> None: ... + def append(self, x: _T) -> None: ... + def appendleft(self, x: _T) -> None: ... + def clear(self) -> None: ... + def copy(self) -> deque[_T]: ... + def count(self, x: _T) -> int: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def extendleft(self, iterable: Iterable[_T]) -> None: ... + def insert(self, i: int, x: _T) -> None: ... + def index(self, x: _T, start: int = ..., stop: int = ...) -> int: ... + def pop(self, i: int = ...) -> _T: ... + def popleft(self) -> _T: ... + def remove(self, value: _T) -> None: ... + def reverse(self) -> None: ... + def rotate(self, n: int) -> None: ... + + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T]: ... + def __str__(self) -> str: ... + def __hash__(self) -> int: ... + + # These methods of deque don't really take slices, but we need to + # define them as taking a slice to satisfy MutableSequence. + @overload + def __getitem__(self, index: int) -> _T: ... + @overload + def __getitem__(self, s: slice) -> MutableSequence[_T]: ... + @overload + def __setitem__(self, i: int, x: _T) -> None: ... + @overload + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... + @overload + def __delitem__(self, i: int) -> None: ... + @overload + def __delitem__(self, s: slice) -> None: ... + + def __contains__(self, o: object) -> bool: ... + def __reversed__(self) -> Iterator[_T]: ... + + def __iadd__(self: _S, iterable: Iterable[_T]) -> _S: ... + + def __add__(self, other: deque[_T]) -> deque[_T]: ... + def __mul__(self, other: int) -> deque[_T]: ... + def __imul__(self, other: int) -> None: ... + +class Counter(Dict[_T, int], Generic[_T]): + @overload + def __init__(self, **kwargs: int) -> None: ... + @overload + def __init__(self, mapping: Mapping[_T, int]) -> None: ... + @overload + def __init__(self, iterable: Iterable[_T]) -> None: ... + def copy(self: _S) -> _S: ... + def elements(self) -> Iterator[_T]: ... + + def most_common(self, n: Optional[int] = ...) -> List[Tuple[_T, int]]: ... + + @overload + def subtract(self, __mapping: Mapping[_T, int]) -> None: ... + @overload + def subtract(self, iterable: Iterable[_T]) -> None: ... + + # The Iterable[Tuple[...]] argument type is not actually desirable + # (the tuples will be added as keys, breaking type safety) but + # it's included so that the signature is compatible with + # Dict.update. Not sure if we should use '# type: ignore' instead + # and omit the type from the union. + @overload + def update(self, __m: Mapping[_T, int], **kwargs: int) -> None: ... + @overload + def update(self, __m: Union[Iterable[_T], Iterable[Tuple[_T, int]]], **kwargs: int) -> None: ... + @overload + def update(self, **kwargs: int) -> None: ... + + def __add__(self, other: Counter[_T]) -> Counter[_T]: ... + def __sub__(self, other: Counter[_T]) -> Counter[_T]: ... + def __and__(self, other: Counter[_T]) -> Counter[_T]: ... + def __or__(self, other: Counter[_T]) -> Counter[_T]: ... + def __pos__(self) -> Counter[_T]: ... + def __neg__(self) -> Counter[_T]: ... + def __iadd__(self, other: Counter[_T]) -> Counter[_T]: ... + def __isub__(self, other: Counter[_T]) -> Counter[_T]: ... + def __iand__(self, other: Counter[_T]) -> Counter[_T]: ... + def __ior__(self, other: Counter[_T]) -> Counter[_T]: ... + +class _OrderedDictKeysView(KeysView[_KT], Reversible[_KT]): + def __reversed__(self) -> Iterator[_KT]: ... +class _OrderedDictItemsView(ItemsView[_KT, _VT], Reversible[Tuple[_KT, _VT]]): + def __reversed__(self) -> Iterator[Tuple[_KT, _VT]]: ... +class _OrderedDictValuesView(ValuesView[_VT], Reversible[_VT]): + def __reversed__(self) -> Iterator[_VT]: ... + +class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]): + def popitem(self, last: bool = ...) -> Tuple[_KT, _VT]: ... + def move_to_end(self, key: _KT, last: bool = ...) -> None: ... + def copy(self: _S) -> _S: ... + def __reversed__(self) -> Iterator[_KT]: ... + def keys(self) -> _OrderedDictKeysView[_KT]: ... + def items(self) -> _OrderedDictItemsView[_KT, _VT]: ... + def values(self) -> _OrderedDictValuesView[_VT]: ... + +class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]): + default_factory: Optional[Callable[[], _VT]] + + @overload + def __init__(self, **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]]) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + map: Mapping[_KT, _VT]) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + iterable: Iterable[Tuple[_KT, _VT]]) -> None: ... + @overload + def __init__(self, default_factory: Optional[Callable[[], _VT]], + iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + def __missing__(self, key: _KT) -> _VT: ... + # TODO __reversed__ + def copy(self: _S) -> _S: ... + +class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]): + def __init__(self, *maps: Mapping[_KT, _VT]) -> None: ... + + @property + def maps(self) -> List[Mapping[_KT, _VT]]: ... + + def new_child(self, m: Mapping[_KT, _VT] = ...) -> typing.ChainMap[_KT, _VT]: ... + + @property + def parents(self) -> typing.ChainMap[_KT, _VT]: ... + + def __setitem__(self, k: _KT, v: _VT) -> None: ... + def __delitem__(self, v: _KT) -> None: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __iter__(self) -> Iterator[_KT]: ... + def __len__(self) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/collections/abc.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/collections/abc.pyi new file mode 100644 index 00000000..11718438 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/collections/abc.pyi @@ -0,0 +1,36 @@ +# Stubs for collections.abc (introduced from Python 3.3) +# +# https://docs.python.org/3.3/whatsnew/3.3.html#collections +import sys + +from . import ( + AsyncIterable as AsyncIterable, + AsyncIterator as AsyncIterator, + Awaitable as Awaitable, + ByteString as ByteString, + Container as Container, + Coroutine as Coroutine, + Generator as Generator, + Hashable as Hashable, + Iterable as Iterable, + Iterator as Iterator, + Sized as Sized, + Callable as Callable, + Mapping as Mapping, + MutableMapping as MutableMapping, + Sequence as Sequence, + MutableSequence as MutableSequence, + Set as Set, + MutableSet as MutableSet, + MappingView as MappingView, + ItemsView as ItemsView, + KeysView as KeysView, + ValuesView as ValuesView, +) + +if sys.version_info >= (3, 6): + from . import ( + Collection as Collection, + Reversible as Reversible, + AsyncGenerator as AsyncGenerator, + ) diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/compileall.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/compileall.pyi new file mode 100644 index 00000000..72f5d4ca --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/compileall.pyi @@ -0,0 +1,77 @@ +# Stubs for compileall (Python 3) + +import os +import sys +from typing import Any, Optional, Union, Pattern + +if sys.version_info < (3, 6): + _Path = Union[str, bytes] + _SuccessType = bool +else: + _Path = Union[str, bytes, os.PathLike] + _SuccessType = int + +if sys.version_info >= (3, 7): + from py_compile import PycInvalidationMode + def compile_dir( + dir: _Path, + maxlevels: int = ..., + ddir: Optional[_Path] = ..., + force: bool = ..., + rx: Optional[Pattern[Any]] = ..., + quiet: int = ..., + legacy: bool = ..., + optimize: int = ..., + workers: int = ..., + invalidation_mode: Optional[PycInvalidationMode] = ..., + ) -> _SuccessType: ... + def compile_file( + fullname: _Path, + ddir: Optional[_Path] = ..., + force: bool = ..., + rx: Optional[Pattern[Any]] = ..., + quiet: int = ..., + legacy: bool = ..., + optimize: int = ..., + invalidation_mode: Optional[PycInvalidationMode] = ..., + ) -> _SuccessType: ... + def compile_path( + skip_curdir: bool = ..., + maxlevels: int = ..., + force: bool = ..., + quiet: int = ..., + legacy: bool = ..., + optimize: int = ..., + invalidation_mode: Optional[PycInvalidationMode] = ..., + ) -> _SuccessType: ... + +else: + # rx can be any object with a 'search' method; once we have Protocols we can change the type + def compile_dir( + dir: _Path, + maxlevels: int = ..., + ddir: Optional[_Path] = ..., + force: bool = ..., + rx: Optional[Pattern[Any]] = ..., + quiet: int = ..., + legacy: bool = ..., + optimize: int = ..., + workers: int = ..., + ) -> _SuccessType: ... + def compile_file( + fullname: _Path, + ddir: Optional[_Path] = ..., + force: bool = ..., + rx: Optional[Pattern[Any]] = ..., + quiet: int = ..., + legacy: bool = ..., + optimize: int = ..., + ) -> _SuccessType: ... + def compile_path( + skip_curdir: bool = ..., + maxlevels: int = ..., + force: bool = ..., + quiet: int = ..., + legacy: bool = ..., + optimize: int = ..., + ) -> _SuccessType: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/concurrent/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/concurrent/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/concurrent/futures/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/concurrent/futures/__init__.pyi new file mode 100644 index 00000000..4439dcad --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/concurrent/futures/__init__.pyi @@ -0,0 +1,3 @@ +from ._base import * # noqa: F403 +from .thread import * # noqa: F403 +from .process import * # noqa: F403 diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/concurrent/futures/_base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/concurrent/futures/_base.pyi new file mode 100644 index 00000000..00ff41d7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/concurrent/futures/_base.pyi @@ -0,0 +1,100 @@ +import threading +from logging import Logger +from typing import TypeVar, Generic, Any, Iterable, Iterator, Callable, Tuple, Optional, Set, List +from types import TracebackType +import sys + +FIRST_COMPLETED: str +FIRST_EXCEPTION: str +ALL_COMPLETED: str +PENDING: str +RUNNING: str +CANCELLED: str +CANCELLED_AND_NOTIFIED: str +FINISHED: str +LOGGER: Logger + +class Error(Exception): ... +class CancelledError(Error): ... +class TimeoutError(Error): ... + +if sys.version_info >= (3, 7): + class BrokenExecutor(RuntimeError): ... + +_T = TypeVar('_T') + +class Future(Generic[_T]): + def __init__(self) -> None: ... + def cancel(self) -> bool: ... + def cancelled(self) -> bool: ... + def running(self) -> bool: ... + def done(self) -> bool: ... + def add_done_callback(self, fn: Callable[[Future[_T]], Any]) -> None: ... + def result(self, timeout: Optional[float] = ...) -> _T: ... + def set_running_or_notify_cancel(self) -> bool: ... + def set_result(self, result: _T) -> None: ... + + if sys.version_info >= (3,): + def exception(self, timeout: Optional[float] = ...) -> Optional[BaseException]: ... + def set_exception(self, exception: Optional[BaseException]) -> None: ... + else: + def exception(self, timeout: Optional[float] = ...) -> Any: ... + def exception_info(self, timeout: Optional[float] = ...) -> Tuple[Any, Optional[TracebackType]]: ... + def set_exception(self, exception: Any) -> None: ... + def set_exception_info(self, exception: Any, traceback: Optional[TracebackType]) -> None: ... + + +class Executor: + def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ... + if sys.version_info >= (3, 5): + def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ..., + chunksize: int = ...) -> Iterator[_T]: ... + else: + def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ...,) -> Iterator[_T]: ... + def shutdown(self, wait: bool = ...) -> None: ... + def __enter__(self: _T) -> _T: ... + def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> Optional[bool]: ... + +def as_completed(fs: Iterable[Future[_T]], timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ... + +def wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...) -> Tuple[Set[Future[_T]], + Set[Future[_T]]]: ... + +class _Waiter: + event: threading.Event + finished_futures: List[Future[Any]] + def __init__(self) -> None: ... + def add_result(self, future: Future[Any]) -> None: ... + def add_exception(self, future: Future[Any]) -> None: ... + def add_cancelled(self, future: Future[Any]) -> None: ... + + +class _AsCompletedWaiter(_Waiter): + lock: threading.Lock + def __init__(self) -> None: ... + def add_result(self, future: Future[Any]) -> None: ... + def add_exception(self, future: Future[Any]) -> None: ... + def add_cancelled(self, future: Future[Any]) -> None: ... + + +class _FirstCompletedWaiter(_Waiter): + def add_result(self, future: Future[Any]) -> None: ... + def add_exception(self, future: Future[Any]) -> None: ... + def add_cancelled(self, future: Future[Any]) -> None: ... + + +class _AllCompletedWaiter(_Waiter): + num_pending_calls: int + stop_on_exception: bool + lock: threading.Lock + def __init__(self, num_pending_calls: int, stop_on_exception: bool) -> None: ... + def add_result(self, future: Future[Any]) -> None: ... + def add_exception(self, future: Future[Any]) -> None: ... + def add_cancelled(self, future: Future[Any]) -> None: ... + + +class _AcquireFutures: + futures: Iterable[Future[Any]] + def __init__(self, futures: Iterable[Future[Any]]) -> None: ... + def __enter__(self) -> None: ... + def __exit__(self, *args: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/concurrent/futures/process.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/concurrent/futures/process.pyi new file mode 100644 index 00000000..ca22879c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/concurrent/futures/process.pyi @@ -0,0 +1,20 @@ +from typing import Any, Callable, Optional, Tuple +from ._base import Executor +import sys + +EXTRA_QUEUED_CALLS: Any + +if sys.version_info >= (3,): + class BrokenProcessPool(RuntimeError): ... + +if sys.version_info >= (3, 7): + from multiprocessing.context import BaseContext + + class ProcessPoolExecutor(Executor): + def __init__(self, max_workers: Optional[int] = ..., + mp_context: Optional[BaseContext] = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Tuple[Any, ...] = ...) -> None: ... +else: + class ProcessPoolExecutor(Executor): + def __init__(self, max_workers: Optional[int] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/concurrent/futures/thread.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/concurrent/futures/thread.pyi new file mode 100644 index 00000000..82c8ddd0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/concurrent/futures/thread.pyi @@ -0,0 +1,30 @@ +from typing import Any, Callable, Iterable, Mapping, Optional, Tuple, TypeVar, Generic +from ._base import Executor, Future +import sys + +if sys.version_info >= (3, 7): + from ._base import BrokenExecutor + class BrokenThreadPool(BrokenExecutor): ... + +_S = TypeVar('_S') + +class ThreadPoolExecutor(Executor): + if sys.version_info >= (3, 7): + def __init__(self, max_workers: Optional[int] = ..., + thread_name_prefix: str = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Tuple[Any, ...] = ...) -> None: ... + elif sys.version_info >= (3, 6) or sys.version_info < (3,): + def __init__(self, max_workers: Optional[int] = ..., + thread_name_prefix: str = ...) -> None: ... + else: + def __init__(self, max_workers: Optional[int] = ...) -> None: ... + + +class _WorkItem(Generic[_S]): + future: Future[_S] + fn: Callable[..., _S] + args: Iterable[Any] + kwargs: Mapping[str, Any] + def __init__(self, future: Future[_S], fn: Callable[..., _S], args: Iterable[Any], kwargs: Mapping[str, Any]) -> None: ... + def run(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi new file mode 100644 index 00000000..24f81799 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/configparser.pyi @@ -0,0 +1,235 @@ +# Based on http://docs.python.org/3.5/library/configparser.html and on +# reading configparser.py. + +import sys +from typing import (AbstractSet, MutableMapping, Mapping, Dict, Sequence, List, + Union, Iterable, Iterator, Callable, Any, IO, overload, + Optional, Pattern, Type, TypeVar, ClassVar) +# Types only used in type comments only +from typing import Optional, Tuple # noqa + +if sys.version_info >= (3, 6): + from os import PathLike + +# Internal type aliases +_section = Mapping[str, str] +_parser = MutableMapping[str, _section] +_converter = Callable[[str], Any] +_converters = Dict[str, _converter] +_T = TypeVar('_T') + +if sys.version_info >= (3, 7): + _Path = Union[str, bytes, PathLike[str]] +elif sys.version_info >= (3, 6): + _Path = Union[str, PathLike[str]] +else: + _Path = str + +DEFAULTSECT: str +MAX_INTERPOLATION_DEPTH: int + +class Interpolation: + def before_get(self, parser: _parser, + section: str, + option: str, + value: str, + defaults: _section) -> str: ... + + def before_set(self, parser: _parser, + section: str, + option: str, + value: str) -> str: ... + + def before_read(self, parser: _parser, + section: str, + option: str, + value: str) -> str: ... + + def before_write(self, parser: _parser, + section: str, + option: str, + value: str) -> str: ... + + +class BasicInterpolation(Interpolation): ... +class ExtendedInterpolation(Interpolation): ... +class LegacyInterpolation(Interpolation): ... + + +class RawConfigParser(_parser): + BOOLEAN_STATES: ClassVar[Mapping[str, bool]] = ... # Undocumented + def __init__(self, + defaults: Optional[_section] = ..., + dict_type: Type[Mapping[str, str]] = ..., + allow_no_value: bool = ..., + *, + delimiters: Sequence[str] = ..., + comment_prefixes: Sequence[str] = ..., + inline_comment_prefixes: Optional[Sequence[str]] = ..., + strict: bool = ..., + empty_lines_in_values: bool = ..., + default_section: str = ..., + interpolation: Optional[Interpolation] = ...) -> None: ... + + def __len__(self) -> int: ... + + def __getitem__(self, section: str) -> SectionProxy: ... + + def __setitem__(self, section: str, options: _section) -> None: ... + + def __delitem__(self, section: str) -> None: ... + + def __iter__(self) -> Iterator[str]: ... + + def defaults(self) -> _section: ... + + def sections(self) -> List[str]: ... + + def add_section(self, section: str) -> None: ... + + def has_section(self, section: str) -> bool: ... + + def options(self, section: str) -> List[str]: ... + + def has_option(self, section: str, option: str) -> bool: ... + + def read(self, filenames: Union[_Path, Iterable[_Path]], + encoding: Optional[str] = ...) -> List[str]: ... + def read_file(self, f: Iterable[str], source: Optional[str] = ...) -> None: ... + def read_string(self, string: str, source: str = ...) -> None: ... + def read_dict(self, dictionary: Mapping[str, Mapping[str, Any]], + source: str = ...) -> None: ... + def readfp(self, fp: Iterable[str], filename: Optional[str] = ...) -> None: ... + + # These get* methods are partially applied (with the same names) in + # SectionProxy; the stubs should be kept updated together + def getint(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: int = ...) -> int: ... + + def getfloat(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: float = ...) -> float: ... + + def getboolean(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: bool = ...) -> bool: ... + + def _get_conv(self, section: str, option: str, conv: Callable[[str], _T], *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T = ...) -> _T: ... + + # This is incompatible with MutableMapping so we ignore the type + @overload # type: ignore + def get(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ...) -> str: ... + + @overload + def get(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T) -> Union[str, _T]: ... + + @overload + def items(self, *, raw: bool = ..., vars: Optional[_section] = ...) -> AbstractSet[Tuple[str, SectionProxy]]: ... + + @overload + def items(self, section: str, raw: bool = ..., vars: Optional[_section] = ...) -> List[Tuple[str, str]]: ... + + def set(self, section: str, option: str, value: str) -> None: ... + + def write(self, + fileobject: IO[str], + space_around_delimiters: bool = ...) -> None: ... + + def remove_option(self, section: str, option: str) -> bool: ... + + def remove_section(self, section: str) -> bool: ... + + def optionxform(self, option: str) -> str: ... + + +class ConfigParser(RawConfigParser): + def __init__(self, + defaults: Optional[_section] = ..., + dict_type: Type[Mapping[str, str]] = ..., + allow_no_value: bool = ..., + delimiters: Sequence[str] = ..., + comment_prefixes: Sequence[str] = ..., + inline_comment_prefixes: Optional[Sequence[str]] = ..., + strict: bool = ..., + empty_lines_in_values: bool = ..., + default_section: str = ..., + interpolation: Optional[Interpolation] = ..., + converters: _converters = ...) -> None: ... + +class SafeConfigParser(ConfigParser): ... + +class SectionProxy(MutableMapping[str, str]): + def __init__(self, parser: RawConfigParser, name: str) -> None: ... + def __getitem__(self, key: str) -> str: ... + def __setitem__(self, key: str, value: str) -> None: ... + def __delitem__(self, key: str) -> None: ... + def __contains__(self, key: object) -> bool: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[str]: ... + @property + def parser(self) -> RawConfigParser: ... + @property + def name(self) -> str: ... + def get(self, option: str, fallback: Optional[str] = ..., *, raw: bool = ..., vars: Optional[_section] = ..., **kwargs: Any) -> str: ... # type: ignore + + # These are partially-applied version of the methods with the same names in + # RawConfigParser; the stubs should be kept updated together + def getint(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: int = ...) -> int: ... + def getfloat(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: float = ...) -> float: ... + def getboolean(self, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: bool = ...) -> bool: ... + + # SectionProxy can have arbitrary attributes when custon converters are used + def __getattr__(self, key: str) -> Callable[..., Any]: ... + +class ConverterMapping(MutableMapping[str, Optional[_converter]]): + GETTERCRE: Pattern[Any] + def __init__(self, parser: RawConfigParser) -> None: ... + def __getitem__(self, key: str) -> _converter: ... + def __setitem__(self, key: str, value: Optional[_converter]) -> None: ... + def __delitem__(self, key: str) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + + +class Error(Exception): ... + + +class NoSectionError(Error): ... + + +class DuplicateSectionError(Error): + section: str + source: Optional[str] + lineno: Optional[int] + + +class DuplicateOptionError(Error): + section: str + option: str + source: Optional[str] + lineno: Optional[int] + + +class NoOptionError(Error): + section: str + option: str + + +class InterpolationError(Error): + section: str + option: str + + +class InterpolationDepthError(InterpolationError): ... + + +class InterpolationMissingOptionError(InterpolationError): + reference: str + + +class InterpolationSyntaxError(InterpolationError): ... + + +class ParsingError(Error): + source: str + errors: Sequence[Tuple[int, str]] + + +class MissingSectionHeaderError(ParsingError): + lineno: int + line: str diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/copyreg.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/copyreg.pyi new file mode 100644 index 00000000..a64a82c7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/copyreg.pyi @@ -0,0 +1,14 @@ + +from typing import TypeVar, Callable, Union, Tuple, Any, Optional, SupportsInt, Hashable, List + + +_Type = TypeVar("_Type", bound=type) +_Reduce = Union[Tuple[Callable[..., _Type], Tuple[Any, ...]], Tuple[Callable[..., _Type], Tuple[Any, ...], Optional[Any]]] + +__all__: List[str] + +def pickle(ob_type: _Type, pickle_function: Callable[[_Type], Union[str, _Reduce[_Type]]], constructor_ob: Optional[Callable[[_Reduce[_Type]], _Type]] = ...) -> None: ... +def constructor(object: Callable[[_Reduce[_Type]], _Type]) -> None: ... +def add_extension(module: Hashable, name: Hashable, code: SupportsInt) -> None: ... +def remove_extension(module: Hashable, name: Hashable, code: int) -> None: ... +def clear_extension_cache() -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/__init__.pyi new file mode 100644 index 00000000..a69f188d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/__init__.pyi @@ -0,0 +1,25 @@ +# Stubs for email (Python 3.4) + +from typing import Callable, IO +from email.message import Message +from email.policy import Policy + +def message_from_string(s: str, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ... +def message_from_bytes(s: bytes, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ... +def message_from_file(fp: IO[str], _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ... +def message_from_binary_file(fp: IO[bytes], _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ... + +# Names in __all__ with no definition: +# base64mime +# charset +# encoders +# errors +# feedparser +# generator +# header +# iterators +# message +# mime +# parser +# quoprimime +# utils diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/charset.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/charset.pyi new file mode 100644 index 00000000..3a6c19d1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/charset.pyi @@ -0,0 +1,31 @@ +# Stubs for email.charset (Python 3.4) + +from typing import List, Optional, Iterator, Any + +QP: int # undocumented +BASE64: int # undocumented +SHORTEST: int # undocumented + +class Charset: + input_charset: str + header_encoding: int + body_encoding: int + output_charset: Optional[str] + input_codec: Optional[str] + output_codec: Optional[str] + def __init__(self, input_charset: str = ...) -> None: ... + def get_body_encoding(self) -> str: ... + def get_output_charset(self) -> Optional[str]: ... + def header_encode(self, string: str) -> str: ... + def header_encode_lines(self, string: str, + maxlengths: Iterator[int]) -> List[str]: ... + def body_encode(self, string: str) -> str: ... + def __str__(self) -> str: ... + def __eq__(self, other: Any) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + +def add_charset(charset: str, header_enc: Optional[int] = ..., + body_enc: Optional[int] = ..., + output_charset: Optional[str] = ...) -> None: ... +def add_alias(alias: str, canonical: str) -> None: ... +def add_codec(charset: str, codecname: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/contentmanager.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/contentmanager.pyi new file mode 100644 index 00000000..ed55ef67 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/contentmanager.pyi @@ -0,0 +1,15 @@ +# Stubs for email.contentmanager (Python 3.4) + +from typing import Any, Callable +from email.message import Message + +class ContentManager: + def __init__(self) -> None: ... + def get_content(self, msg: Message, *args: Any, **kw: Any) -> Any: ... + def set_content(self, msg: Message, obj: Any, *args: Any, + **kw: Any) -> Any: ... + def add_get_handler(self, key: str, handler: Callable[..., Any]) -> None: ... + def add_set_handler(self, typekey: type, + handler: Callable[..., Any]) -> None: ... + +raw_data_manager: ContentManager diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/encoders.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/encoders.pyi new file mode 100644 index 00000000..bb5c84cb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/encoders.pyi @@ -0,0 +1,8 @@ +# Stubs for email.encoders (Python 3.4) + +from email.message import Message + +def encode_base64(msg: Message) -> None: ... +def encode_quopri(msg: Message) -> None: ... +def encode_7or8bit(msg: Message) -> None: ... +def encode_noop(msg: Message) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/errors.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/errors.pyi new file mode 100644 index 00000000..77d9902c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/errors.pyi @@ -0,0 +1,19 @@ +# Stubs for email.errors (Python 3.4) + +class MessageError(Exception): ... +class MessageParseError(MessageError): ... +class HeaderParseError(MessageParseError): ... +class BoundaryError(MessageParseError): ... +class MultipartConversionError(MessageError, TypeError): ... + +class MessageDefect(ValueError): ... +class NoBoundaryInMultipartDefect(MessageDefect): ... +class StartBoundaryNotFoundDefect(MessageDefect): ... +class FirstHeaderLineIsContinuationDefect(MessageDefect): ... +class MisplacedEnvelopeHeaderDefect(MessageDefect): ... +class MalformedHeaderDefect(MessageDefect): ... +class MultipartInvariantViolationDefect(MessageDefect): ... +class InvalidBase64PaddingDefect(MessageDefect): ... +class InvalidBase64CharactersDefect(MessageDefect): ... +class CloseBoundaryNotFoundDefect(MessageDefect): ... +class MissingHeaderBodySeparatorDefect(MessageDefect): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/feedparser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/feedparser.pyi new file mode 100644 index 00000000..facfd438 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/feedparser.pyi @@ -0,0 +1,17 @@ +# Stubs for email.feedparser (Python 3.4) + +from typing import Callable +from email.message import Message +from email.policy import Policy + +class FeedParser: + def __init__(self, _factory: Callable[[], Message] = ..., *, + policy: Policy = ...) -> None: ... + def feed(self, data: str) -> None: ... + def close(self) -> Message: ... + +class BytesFeedParser: + def __init__(self, _factory: Callable[[], Message] = ..., *, + policy: Policy = ...) -> None: ... + def feed(self, data: str) -> None: ... + def close(self) -> Message: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/generator.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/generator.pyi new file mode 100644 index 00000000..2cf3942d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/generator.pyi @@ -0,0 +1,27 @@ +# Stubs for email.generator (Python 3.4) + +from typing import BinaryIO, TextIO, Optional +from email.message import Message +from email.policy import Policy + +class Generator: + def clone(self, fp: TextIO) -> Generator: ... + def write(self, s: str) -> None: ... + def __init__(self, outfp: TextIO, mangle_from_: bool = ..., + maxheaderlen: int = ..., *, + policy: Policy = ...) -> None: ... + def flatten(self, msg: Message, unixfrom: bool = ..., + linesep: Optional[str] = ...) -> None: ... + +class BytesGenerator: + def clone(self, fp: BinaryIO) -> BytesGenerator: ... + def write(self, s: str) -> None: ... + def __init__(self, outfp: BinaryIO, mangle_from_: bool = ..., + maxheaderlen: int = ..., *, + policy: Policy = ...) -> None: ... + def flatten(self, msg: Message, unixfrom: bool = ..., + linesep: Optional[str] = ...) -> None: ... + +class DecodedGenerator(Generator): + def __init__(self, outfp: TextIO, mangle_from_: bool = ..., + maxheaderlen: int = ..., *, fmt: Optional[str] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/header.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/header.pyi new file mode 100644 index 00000000..21b99953 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/header.pyi @@ -0,0 +1,25 @@ +# Stubs for email.header (Python 3.4) + +from typing import Union, Optional, Any, List, Tuple +from email.charset import Charset + +class Header: + def __init__(self, s: Union[bytes, str, None] = ..., + charset: Union[Charset, str, None] = ..., + maxlinelen: Optional[int] = ..., + header_name: Optional[str] = ..., continuation_ws: str = ..., + errors: str = ...) -> None: ... + def append(self, s: Union[bytes, str], + charset: Union[Charset, str, None] = ..., + errors: str = ...) -> None: ... + def encode(self, splitchars: str = ..., maxlinelen: Optional[int] = ..., + linesep: str = ...) -> str: ... + def __str__(self) -> str: ... + def __eq__(self, other: Any) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + +def decode_header(header: Union[Header, str]) -> List[Tuple[bytes, Optional[str]]]: ... +def make_header(decoded_seq: List[Tuple[bytes, Optional[str]]], + maxlinelen: Optional[int] = ..., + header_name: Optional[str] = ..., + continuation_ws: str = ...) -> Header: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/headerregistry.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/headerregistry.pyi new file mode 100644 index 00000000..6af1abfb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/headerregistry.pyi @@ -0,0 +1,97 @@ +# Stubs for email.headerregistry (Python 3.4) + +from datetime import datetime as _datetime +from typing import Dict, Tuple, Optional, Any, Union, Mapping +from email.errors import MessageDefect +from email.policy import Policy + +class BaseHeader(str): + @property + def name(self) -> str: ... + @property + def defects(self) -> Tuple[MessageDefect, ...]: ... + @property + def max_count(self) -> Optional[int]: ... + def __new__(cls, name: str, value: Any) -> BaseHeader: ... + def init(self, *args: Any, **kw: Any) -> None: ... + def fold(self, *, policy: Policy) -> str: ... + +class UnstructuredHeader: + @classmethod + def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ... + +class UniqueUnstructuredHeader(UnstructuredHeader): ... + +class DateHeader: + datetime: _datetime + @classmethod + def parse(cls, string: Union[str, _datetime], + kwds: Dict[str, Any]) -> None: ... + +class UniqueDateHeader(DateHeader): ... + +class AddressHeader: + groups: Tuple[Group, ...] + addresses: Tuple[Address, ...] + @classmethod + def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ... + +class UniqueAddressHeader(AddressHeader): ... + +class SingleAddressHeader(AddressHeader): + @property + def address(self) -> Address: ... + +class UniqueSingleAddressHeader(SingleAddressHeader): ... + +class MIMEVersionHeader: + version: Optional[str] + major: Optional[int] + minor: Optional[int] + @classmethod + def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ... + +class ParameterizedMIMEHeader: + params: Mapping[str, Any] + @classmethod + def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ... + +class ContentTypeHeader(ParameterizedMIMEHeader): + content_type: str + maintype: str + subtype: str + +class ContentDispositionHeader(ParameterizedMIMEHeader): + content_disposition: str + +class ContentTransferEncodingHeader: + cte: str + @classmethod + def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ... + +class HeaderRegistry: + def __init__(self, base_class: BaseHeader = ..., + default_class: BaseHeader = ..., + use_default_map: bool = ...) -> None: ... + def map_to_type(self, name: str, cls: BaseHeader) -> None: ... + def __getitem__(self, name: str) -> BaseHeader: ... + def __call__(self, name: str, value: Any) -> BaseHeader: ... + +class Address: + display_name: str + username: str + domain: str + @property + def addr_spec(self) -> str: ... + def __init__(self, display_name: str = ..., + username: Optional[str] = ..., + domain: Optional[str] = ..., + addr_spec: Optional[str] = ...) -> None: ... + def __str__(self) -> str: ... + +class Group: + display_name: Optional[str] + addresses: Tuple[Address, ...] + def __init__(self, display_name: Optional[str] = ..., + addresses: Optional[Tuple[Address, ...]] = ...) -> None: ... + def __str__(self) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/iterators.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/iterators.pyi new file mode 100644 index 00000000..6a69f39c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/iterators.pyi @@ -0,0 +1,8 @@ +# Stubs for email.iterators (Python 3.4) + +from typing import Iterator, Optional +from email.message import Message + +def body_line_iterator(msg: Message, decode: bool = ...) -> Iterator[str]: ... +def typed_subpart_iterator(msg: Message, maintype: str = ..., + subtype: Optional[str] = ...) -> Iterator[str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/message.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/message.pyi new file mode 100644 index 00000000..85bba630 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/message.pyi @@ -0,0 +1,103 @@ +# Stubs for email.message (Python 3.4) + +from typing import ( + List, Optional, Union, Tuple, TypeVar, Generator, Sequence, Iterator, Any +) +from email.charset import Charset +from email.errors import MessageDefect +from email.header import Header +from email.policy import Policy +from email.contentmanager import ContentManager + +_T = TypeVar('_T') + +_PayloadType = Union[List[Message], str, bytes] +_CharsetType = Union[Charset, str, None] +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] +_ParamType = Union[str, Tuple[Optional[str], Optional[str], str]] +_HeaderType = Any + +class Message: + preamble: Optional[str] + epilogue: Optional[str] + defects: List[MessageDefect] + def __str__(self) -> str: ... + def is_multipart(self) -> bool: ... + def set_unixfrom(self, unixfrom: str) -> None: ... + def get_unixfrom(self) -> Optional[str]: ... + def attach(self, payload: Message) -> None: ... + def get_payload(self, i: int = ..., decode: bool = ...) -> Any: ... # returns Optional[_PayloadType] + def set_payload(self, payload: _PayloadType, + charset: _CharsetType = ...) -> None: ... + def set_charset(self, charset: _CharsetType) -> None: ... + def get_charset(self) -> _CharsetType: ... + def __len__(self) -> int: ... + def __contains__(self, name: str) -> bool: ... + def __getitem__(self, name: str) -> _HeaderType: ... + def __setitem__(self, name: str, val: _HeaderType) -> None: ... + def __delitem__(self, name: str) -> None: ... + def keys(self) -> List[str]: ... + def values(self) -> List[_HeaderType]: ... + def items(self) -> List[Tuple[str, _HeaderType]]: ... + def get(self, name: str, failobj: _T = ...) -> Union[_HeaderType, _T]: ... + def get_all(self, name: str, failobj: _T = ...) -> Union[List[_HeaderType], _T]: ... + def add_header(self, _name: str, _value: str, **_params: _ParamsType) -> None: ... + def replace_header(self, _name: str, _value: _HeaderType) -> None: ... + def get_content_type(self) -> str: ... + def get_content_maintype(self) -> str: ... + def get_content_subtype(self) -> str: ... + def get_default_type(self) -> str: ... + def set_default_type(self, ctype: str) -> None: ... + def get_params(self, failobj: _T = ..., header: str = ..., + unquote: bool = ...) -> Union[List[Tuple[str, str]], _T]: ... + def get_param(self, param: str, failobj: _T = ..., header: str = ..., + unquote: bool = ...) -> Union[_T, _ParamType]: ... + def del_param(self, param: str, header: str = ..., + requote: bool = ...) -> None: ... + def set_type(self, type: str, header: str = ..., + requote: bool = ...) -> None: ... + def get_filename(self, failobj: _T = ...) -> Union[_T, str]: ... + def get_boundary(self, failobj: _T = ...) -> Union[_T, str]: ... + def set_boundary(self, boundary: str) -> None: ... + def get_content_charset(self, failobj: _T = ...) -> Union[_T, str]: ... + def get_charsets(self, failobj: _T = ...) -> Union[_T, List[str]]: ... + def walk(self) -> Generator[Message, None, None]: ... + def get_content_disposition(self) -> Optional[str]: ... + def as_string(self, unixfrom: bool = ..., maxheaderlen: int = ..., + policy: Optional[Policy] = ...) -> str: ... + def as_bytes(self, unixfrom: bool = ..., + policy: Optional[Policy] = ...) -> bytes: ... + def __bytes__(self) -> bytes: ... + def set_param(self, param: str, value: str, header: str = ..., + requote: bool = ..., charset: str = ..., + language: str = ..., replace: bool = ...) -> None: ... + def __init__(self, policy: Policy = ...) -> None: ... + +class MIMEPart(Message): + def get_body(self, + preferencelist: Sequence[str] = ...) -> Optional[Message]: ... + def iter_attachments(self) -> Iterator[Message]: ... + def iter_parts(self) -> Iterator[Message]: ... + def get_content(self, *args: Any, + content_manager: Optional[ContentManager] = ..., + **kw: Any) -> Any: ... + def set_content(self, *args: Any, + content_manager: Optional[ContentManager] = ..., + **kw: Any) -> None: ... + def make_related(self, boundary: Optional[str] = ...) -> None: ... + def make_alternative(self, boundary: Optional[str] = ...) -> None: ... + def make_mixed(self, boundary: Optional[str] = ...) -> None: ... + def add_related(self, *args: Any, + content_manager: Optional[ContentManager] = ..., + **kw: Any) -> None: ... + def add_alternative(self, *args: Any, + content_manager: Optional[ContentManager] = ..., + **kw: Any) -> None: ... + def add_attachment(self, *args: Any, + content_manager: Optional[ContentManager] = ..., + **kw: Any) -> None: ... + def clear(self) -> None: ... + def clear_content(self) -> None: ... + def is_attachment(self) -> bool: ... + +class EmailMessage(MIMEPart): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/application.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/application.pyi new file mode 100644 index 00000000..1a40e281 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/application.pyi @@ -0,0 +1,11 @@ +# Stubs for email.mime.application (Python 3.4) + +from typing import Callable, Optional, Tuple, Union +from email.mime.nonmultipart import MIMENonMultipart + +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] + +class MIMEApplication(MIMENonMultipart): + def __init__(self, _data: Union[str, bytes], _subtype: str = ..., + _encoder: Callable[[MIMEApplication], None] = ..., + **_params: _ParamsType) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/audio.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/audio.pyi new file mode 100644 index 00000000..5bb57d3a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/audio.pyi @@ -0,0 +1,11 @@ +# Stubs for email.mime.audio (Python 3.4) + +from typing import Callable, Optional, Tuple, Union +from email.mime.nonmultipart import MIMENonMultipart + +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] + +class MIMEAudio(MIMENonMultipart): + def __init__(self, _audiodata: Union[str, bytes], _subtype: Optional[str] = ..., + _encoder: Callable[[MIMEAudio], None] = ..., + **_params: _ParamsType) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/base.pyi new file mode 100644 index 00000000..448d34be --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/base.pyi @@ -0,0 +1,10 @@ +# Stubs for email.mime.base (Python 3.4) + +from typing import Optional, Tuple, Union +import email.message + +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] + +class MIMEBase(email.message.Message): + def __init__(self, _maintype: str, _subtype: str, + **_params: _ParamsType) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/image.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/image.pyi new file mode 100644 index 00000000..d32d9ee6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/image.pyi @@ -0,0 +1,11 @@ +# Stubs for email.mime.image (Python 3.4) + +from typing import Callable, Optional, Tuple, Union +from email.mime.nonmultipart import MIMENonMultipart + +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] + +class MIMEImage(MIMENonMultipart): + def __init__(self, _imagedata: Union[str, bytes], _subtype: Optional[str] = ..., + _encoder: Callable[[MIMEImage], None] = ..., + **_params: _ParamsType) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/message.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/message.pyi new file mode 100644 index 00000000..561e8c35 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/message.pyi @@ -0,0 +1,7 @@ +# Stubs for email.mime.message (Python 3.4) + +from email.message import Message +from email.mime.nonmultipart import MIMENonMultipart + +class MIMEMessage(MIMENonMultipart): + def __init__(self, _msg: Message, _subtype: str = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/multipart.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/multipart.pyi new file mode 100644 index 00000000..ea5eba15 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/multipart.pyi @@ -0,0 +1,12 @@ +# Stubs for email.mime.multipart (Python 3.4) + +from typing import Optional, Sequence, Tuple, Union +from email.message import Message +from email.mime.base import MIMEBase + +_ParamsType = Union[str, None, Tuple[str, Optional[str], str]] + +class MIMEMultipart(MIMEBase): + def __init__(self, _subtype: str = ..., boundary: Optional[str] = ..., + _subparts: Optional[Sequence[Message]] = ..., + **_params: _ParamsType) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/nonmultipart.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/nonmultipart.pyi new file mode 100644 index 00000000..1fd3ea98 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/nonmultipart.pyi @@ -0,0 +1,5 @@ +# Stubs for email.mime.nonmultipart (Python 3.4) + +from email.mime.base import MIMEBase + +class MIMENonMultipart(MIMEBase): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/text.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/text.pyi new file mode 100644 index 00000000..73adaf5f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/mime/text.pyi @@ -0,0 +1,8 @@ +# Stubs for email.mime.text (Python 3.4) + +from typing import Optional +from email.mime.nonmultipart import MIMENonMultipart + +class MIMEText(MIMENonMultipart): + def __init__(self, _text: str, _subtype: str = ..., + _charset: Optional[str] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/parser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/parser.pyi new file mode 100644 index 00000000..89ca2774 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/parser.pyi @@ -0,0 +1,33 @@ +# Stubs for email.parser (Python 3.4) + +import email.feedparser +from email.message import Message +from email.policy import Policy +from typing import BinaryIO, Callable, TextIO + +FeedParser = email.feedparser.FeedParser +BytesFeedParser = email.feedparser.BytesFeedParser + +class Parser: + def __init__(self, _class: Callable[[], Message] = ..., *, + policy: Policy = ...) -> None: ... + def parse(self, fp: TextIO, headersonly: bool = ...) -> Message: ... + def parsestr(self, text: str, headersonly: bool = ...) -> Message: ... + +class HeaderParser(Parser): + def __init__(self, _class: Callable[[], Message] = ..., *, + policy: Policy = ...) -> None: ... + def parse(self, fp: TextIO, headersonly: bool = ...) -> Message: ... + def parsestr(self, text: str, headersonly: bool = ...) -> Message: ... + +class BytesHeaderParser(BytesParser): + def __init__(self, _class: Callable[[], Message] = ..., *, + policy: Policy = ...) -> None: ... + def parse(self, fp: BinaryIO, headersonly: bool = ...) -> Message: ... + def parsebytes(self, text: bytes, headersonly: bool = ...) -> Message: ... + +class BytesParser: + def __init__(self, _class: Callable[[], Message] = ..., *, + policy: Policy = ...) -> None: ... + def parse(self, fp: BinaryIO, headersonly: bool = ...) -> Message: ... + def parsebytes(self, text: bytes, headersonly: bool = ...) -> Message: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/policy.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/policy.pyi new file mode 100644 index 00000000..5f3b8977 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/policy.pyi @@ -0,0 +1,62 @@ +# Stubs for email.policy (Python 3.4) + +from abc import abstractmethod +from typing import Any, List, Optional, Tuple, Union, Callable +from email.message import Message +from email.errors import MessageDefect +from email.header import Header +from email.contentmanager import ContentManager + +class Policy: + max_line_length: Optional[int] + linesep: str + cte_type: str + raise_on_defect: bool + mange_from: bool + def __init__(self, **kw: Any) -> None: ... + def clone(self, **kw: Any) -> Policy: ... + def handle_defect(self, obj: Message, + defect: MessageDefect) -> None: ... + def register_defect(self, obj: Message, + defect: MessageDefect) -> None: ... + def header_max_count(self, name: str) -> Optional[int]: ... + @abstractmethod + def header_source_parse(self, sourcelines: List[str]) -> str: ... + @abstractmethod + def header_store_parse(self, name: str, + value: str) -> Tuple[str, str]: ... + @abstractmethod + def header_fetch_parse(self, name: str, + value: str) -> str: ... + @abstractmethod + def fold(self, name: str, value: str) -> str: ... + @abstractmethod + def fold_binary(self, name: str, value: str) -> bytes: ... + +class Compat32(Policy): + def header_source_parse(self, sourcelines: List[str]) -> str: ... + def header_store_parse(self, name: str, + value: str) -> Tuple[str, str]: ... + def header_fetch_parse(self, name: str, value: str) -> Union[str, Header]: ... # type: ignore + def fold(self, name: str, value: str) -> str: ... + def fold_binary(self, name: str, value: str) -> bytes: ... + +compat32: Compat32 + +class EmailPolicy(Policy): + utf8: bool + refold_source: str + header_factory: Callable[[str, str], str] + content_manager: ContentManager + def header_source_parse(self, sourcelines: List[str]) -> str: ... + def header_store_parse(self, name: str, + value: str) -> Tuple[str, str]: ... + def header_fetch_parse(self, name: str, value: str) -> str: ... + def fold(self, name: str, value: str) -> str: ... + def fold_binary(self, name: str, value: str) -> bytes: ... + +default: EmailPolicy +SMTP: EmailPolicy +SMTPUTF8: EmailPolicy +HTTP: EmailPolicy +strict: EmailPolicy diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/utils.pyi new file mode 100644 index 00000000..6c0a1831 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/email/utils.pyi @@ -0,0 +1,33 @@ +# Stubs for email.utils (Python 3.4) + +from typing import List, Optional, Tuple, Union +from email.charset import Charset +import datetime + +_ParamType = Union[str, Tuple[Optional[str], Optional[str], str]] +_PDTZ = Tuple[int, int, int, int, int, int, int, int, int, Optional[int]] + +def quote(str: str) -> str: ... +def unquote(str: str) -> str: ... +def parseaddr(address: Optional[str]) -> Tuple[str, str]: ... +def formataddr(pair: Tuple[Optional[str], str], + charset: Union[str, Charset] = ...) -> str: ... +def getaddresses(fieldvalues: List[str]) -> List[Tuple[str, str]]: ... +def parsedate(date: str) -> Optional[Tuple[int, int, int, int, int, int, int, int, int]]: ... +def parsedate_tz(date: str) -> Optional[_PDTZ]: ... +def parsedate_to_datetime(date: str) -> datetime.datetime: ... +def mktime_tz(tuple: _PDTZ) -> int: ... +def formatdate(timeval: Optional[float] = ..., localtime: bool = ..., + usegmt: bool = ...) -> str: ... +def format_datetime(dt: datetime.datetime, usegmt: bool = ...) -> str: ... +def localtime(dt: Optional[datetime.datetime] = ...) -> datetime.datetime: ... +def make_msgid(idstring: Optional[str] = ..., + domain: Optional[str] = ...) -> str: ... +def decode_rfc2231(s: str) -> Tuple[Optional[str], Optional[str], str]: ... +def encode_rfc2231(s: str, charset: Optional[str] = ..., + language: Optional[str] = ...) -> str: ... +def collapse_rfc2231_value(value: _ParamType, errors: str = ..., + fallback_charset: str = ...) -> str: ... +def decode_params( + params: List[Tuple[str, str]] +) -> List[Tuple[str, _ParamType]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/encodings/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/encodings/__init__.pyi new file mode 100644 index 00000000..0c050530 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/encodings/__init__.pyi @@ -0,0 +1,3 @@ +import codecs + +def search_function(encoding: str) -> codecs.CodecInfo: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/encodings/utf_8.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/encodings/utf_8.pyi new file mode 100644 index 00000000..d38bd58d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/encodings/utf_8.pyi @@ -0,0 +1,15 @@ +import codecs +from typing import Text, Tuple + +class IncrementalEncoder(codecs.IncrementalEncoder): + def encode(self, input: Text, final: bool = ...) -> bytes: ... + +class IncrementalDecoder(codecs.BufferedIncrementalDecoder): + def _buffer_decode(self, input: bytes, errors: str, final: bool) -> Tuple[Text, int]: ... + +class StreamWriter(codecs.StreamWriter): ... +class StreamReader(codecs.StreamReader): ... + +def getregentry() -> codecs.CodecInfo: ... +def encode(input: Text, errors: Text = ...) -> bytes: ... +def decode(input: bytes, errors: Text = ...) -> Text: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/enum.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/enum.pyi new file mode 100644 index 00000000..be22d386 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/enum.pyi @@ -0,0 +1,75 @@ +# NB: third_party/2/enum.pyi and stdlib/3.4/enum.pyi must remain consistent! +import sys +from typing import Any, Dict, Iterator, List, Mapping, Type, TypeVar, Union +from abc import ABCMeta + +_T = TypeVar('_T') +_S = TypeVar('_S', bound=Type[Enum]) + +# Note: EnumMeta actually subclasses type directly, not ABCMeta. +# This is a temporary workaround to allow multiple creation of enums with builtins +# such as str as mixins, which due to the handling of ABCs of builtin types, cause +# spurious inconsistent metaclass structure. See #1595. +# Structurally: Iterable[T], Reversible[T], Container[T] where T is the enum itself +class EnumMeta(ABCMeta): + def __iter__(self: Type[_T]) -> Iterator[_T]: ... + def __reversed__(self: Type[_T]) -> Iterator[_T]: ... + def __contains__(self: Type[_T], member: object) -> bool: ... + def __getitem__(self: Type[_T], name: str) -> _T: ... + @property + def __members__(self: Type[_T]) -> Mapping[str, _T]: ... + def __len__(self) -> int: ... + +class Enum(metaclass=EnumMeta): + name: str + value: Any + _name_: str + _value_: Any + _member_names_: List[str] # undocumented + _member_map_: Dict[str, Enum] # undocumented + _value2member_map_: Dict[int, Enum] # undocumented + if sys.version_info >= (3, 7): + _ignore_: Union[str, List[str]] + if sys.version_info >= (3, 6): + _order_: str + @classmethod + def _missing_(cls, value: object) -> Any: ... + @staticmethod + def _generate_next_value_(name: str, start: int, count: int, last_values: List[Any]) -> Any: ... + def __new__(cls: Type[_T], value: object) -> _T: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + def __dir__(self) -> List[str]: ... + def __format__(self, format_spec: str) -> str: ... + def __hash__(self) -> Any: ... + def __reduce_ex__(self, proto: object) -> Any: ... + +class IntEnum(int, Enum): + value: int + +def unique(enumeration: _S) -> _S: ... + +if sys.version_info >= (3, 6): + _auto_null: Any + + # subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto() + class auto(IntFlag): + value: Any + + class Flag(Enum): + def __contains__(self: _T, other: _T) -> bool: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + def __bool__(self) -> bool: ... + def __or__(self: _T, other: _T) -> _T: ... + def __and__(self: _T, other: _T) -> _T: ... + def __xor__(self: _T, other: _T) -> _T: ... + def __invert__(self: _T) -> _T: ... + + class IntFlag(int, Flag): + def __or__(self: _T, other: Union[int, _T]) -> _T: ... + def __and__(self: _T, other: Union[int, _T]) -> _T: ... + def __xor__(self: _T, other: Union[int, _T]) -> _T: ... + __ror__ = __or__ + __rand__ = __and__ + __rxor__ = __xor__ diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/faulthandler.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/faulthandler.pyi new file mode 100644 index 00000000..736a4539 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/faulthandler.pyi @@ -0,0 +1,17 @@ +import sys +from typing import Union, Protocol + +class _HasFileno(Protocol): + def fileno(self) -> int: ... + +_File = Union[_HasFileno, int] + +def cancel_dump_traceback_later() -> None: ... +def disable() -> None: ... +def dump_traceback(file: _File = ..., all_threads: bool = ...) -> None: ... +def dump_traceback_later(timeout: float, repeat: bool = ..., file: _File = ..., exit: bool = ...) -> None: ... +def enable(file: _File = ..., all_threads: bool = ...) -> None: ... +def is_enabled() -> bool: ... +if sys.platform != "win32": + def register(signum: int, file: _File = ..., all_threads: bool = ..., chain: bool = ...) -> None: ... + def unregister(signum: int) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/fcntl.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/fcntl.pyi new file mode 100644 index 00000000..fdcb4fcf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/fcntl.pyi @@ -0,0 +1,96 @@ +# Stubs for fcntl +from io import IOBase +from typing import Any, IO, Union + +FASYNC: int +FD_CLOEXEC: int +DN_ACCESS: int +DN_ATTRIB: int +DN_CREATE: int +DN_DELETE: int +DN_MODIFY: int +DN_MULTISHOT: int +DN_RENAME: int +F_DUPFD: int +F_DUPFD_CLOEXEC: int +F_FULLFSYNC: int +F_EXLCK: int +F_GETFD: int +F_GETFL: int +F_GETLEASE: int +F_GETLK: int +F_GETLK64: int +F_GETOWN: int +F_NOCACHE: int +F_GETSIG: int +F_NOTIFY: int +F_RDLCK: int +F_SETFD: int +F_SETFL: int +F_SETLEASE: int +F_SETLK: int +F_SETLK64: int +F_SETLKW: int +F_SETLKW64: int +F_SETOWN: int +F_SETSIG: int +F_SHLCK: int +F_UNLCK: int +F_WRLCK: int +I_ATMARK: int +I_CANPUT: int +I_CKBAND: int +I_FDINSERT: int +I_FIND: int +I_FLUSH: int +I_FLUSHBAND: int +I_GETBAND: int +I_GETCLTIME: int +I_GETSIG: int +I_GRDOPT: int +I_GWROPT: int +I_LINK: int +I_LIST: int +I_LOOK: int +I_NREAD: int +I_PEEK: int +I_PLINK: int +I_POP: int +I_PUNLINK: int +I_PUSH: int +I_RECVFD: int +I_SENDFD: int +I_SETCLTIME: int +I_SETSIG: int +I_SRDOPT: int +I_STR: int +I_SWROPT: int +I_UNLINK: int +LOCK_EX: int +LOCK_MAND: int +LOCK_NB: int +LOCK_READ: int +LOCK_RW: int +LOCK_SH: int +LOCK_UN: int +LOCK_WRITE: int + +_AnyFile = Union[int, IO[Any], IOBase] + +# TODO All these return either int or bytes depending on the value of +# cmd (not on the type of arg). +def fcntl(fd: _AnyFile, + cmd: int, + arg: Union[int, bytes] = ...) -> Any: ... +# TODO This function accepts any object supporting a buffer interface, +# as arg, is there a better way to express this than bytes? +def ioctl(fd: _AnyFile, + request: int, + arg: Union[int, bytes] = ..., + mutate_flag: bool = ...) -> Any: ... +def flock(fd: _AnyFile, operation: int) -> None: ... +def lockf(fd: _AnyFile, + cmd: int, + len: int = ..., + start: int = ..., + whence: int = ...) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/fnmatch.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/fnmatch.pyi new file mode 100644 index 00000000..4f99b4aa --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/fnmatch.pyi @@ -0,0 +1,11 @@ +# Stubs for fnmatch + +# Based on http://docs.python.org/3.2/library/fnmatch.html and +# python-lib/fnmatch.py + +from typing import Iterable, List, AnyStr + +def fnmatch(name: AnyStr, pat: AnyStr) -> bool: ... +def fnmatchcase(name: AnyStr, pat: AnyStr) -> bool: ... +def filter(names: Iterable[AnyStr], pat: AnyStr) -> List[AnyStr]: ... +def translate(pat: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/functools.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/functools.pyi new file mode 100644 index 00000000..a23ef6f5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/functools.pyi @@ -0,0 +1,89 @@ +import sys +from typing import Any, Callable, Generic, Dict, Iterable, Mapping, Optional, Sequence, Tuple, Type, TypeVar, NamedTuple, Union, overload + +_AnyCallable = Callable[..., Any] + +_T = TypeVar("_T") +_S = TypeVar("_S") + +@overload +def reduce(function: Callable[[_T, _S], _T], + sequence: Iterable[_S], initial: _T) -> _T: ... +@overload +def reduce(function: Callable[[_T, _T], _T], + sequence: Iterable[_T]) -> _T: ... + +class _CacheInfo(NamedTuple): + hits: int + misses: int + maxsize: int + currsize: int + +class _lru_cache_wrapper(Generic[_T]): + __wrapped__: Callable[..., _T] + def __call__(self, *args: Any, **kwargs: Any) -> _T: ... + def cache_info(self) -> _CacheInfo: ... + def cache_clear(self) -> None: ... + +if sys.version_info >= (3, 8): + @overload + def lru_cache(maxsize: Optional[int] = ..., typed: bool = ...) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ... + @overload + def lru_cache(maxsize: Callable[..., _T], typed: bool = ...) -> _lru_cache_wrapper[_T]: ... +else: + def lru_cache(maxsize: Optional[int] = ..., typed: bool = ...) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ... + +WRAPPER_ASSIGNMENTS: Sequence[str] +WRAPPER_UPDATES: Sequence[str] + +def update_wrapper(wrapper: _AnyCallable, wrapped: _AnyCallable, assigned: Sequence[str] = ..., + updated: Sequence[str] = ...) -> _AnyCallable: ... +def wraps(wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> Callable[[_AnyCallable], _AnyCallable]: ... +def total_ordering(cls: type) -> type: ... +def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], Any]: ... + +class partial(Generic[_T]): + func: Callable[..., _T] + args: Tuple[Any, ...] + keywords: Dict[str, Any] + def __init__(self, func: Callable[..., _T], *args: Any, **kwargs: Any) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> _T: ... + +# With protocols, this could change into a generic protocol that defines __get__ and returns _T +_Descriptor = Any + +class partialmethod(Generic[_T]): + func: Union[Callable[..., _T], _Descriptor] + args: Tuple[Any, ...] + keywords: Dict[str, Any] + + @overload + def __init__(self, func: Callable[..., _T], *args: Any, **keywords: Any) -> None: ... + @overload + def __init__(self, func: _Descriptor, *args: Any, **keywords: Any) -> None: ... + def __get__(self, obj: Any, cls: Type[Any]) -> Callable[..., _T]: ... + @property + def __isabstractmethod__(self) -> bool: ... + +class _SingleDispatchCallable(Generic[_T]): + registry: Mapping[Any, Callable[..., _T]] + def dispatch(self, cls: Any) -> Callable[..., _T]: ... + @overload + def register(self, cls: Any) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + @overload + def register(self, cls: Any, func: Callable[..., _T]) -> Callable[..., _T]: ... + def _clear_cache(self) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> _T: ... + +def singledispatch(func: Callable[..., _T]) -> _SingleDispatchCallable[_T]: ... + +if sys.version_info >= (3, 8): + class cached_property(Generic[_S, _T]): + func: Callable[[_S], _T] + attrname: Optional[str] + def __init__(self, func: Callable[[_S], _T]) -> None: ... + @overload + def __get__(self, instance: None, owner: Optional[Type[_S]] = ...) -> cached_property[_S, _T]: ... + @overload + def __get__(self, instance: _S, owner: Optional[Type[_S]] = ...) -> _T: ... + def __set_name__(self, owner: Type[_S], name: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/gc.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/gc.pyi new file mode 100644 index 00000000..b85e8f58 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/gc.pyi @@ -0,0 +1,32 @@ +# Stubs for gc + +import sys +from typing import Any, Dict, List, Optional, Tuple + + +DEBUG_COLLECTABLE: int +DEBUG_LEAK: int +DEBUG_SAVEALL: int +DEBUG_STATS: int +DEBUG_UNCOLLECTABLE: int +callbacks: List[Any] +garbage: List[Any] + +def collect(generations: int = ...) -> int: ... +def disable() -> None: ... +def enable() -> None: ... +def get_count() -> Tuple[int, int, int]: ... +def get_debug() -> int: ... +if sys.version_info >= (3, 8): + def get_objects(generation: Optional[int] = ...) -> List[Any]: ... +else: + def get_objects() -> List[Any]: ... +def get_referents(*objs: Any) -> List[Any]: ... +def get_referrers(*objs: Any) -> List[Any]: ... +def get_stats() -> List[Dict[str, Any]]: ... +def get_threshold() -> Tuple[int, int, int]: ... +def is_tracked(obj: Any) -> bool: ... +def isenabled() -> bool: ... +def set_debug(flags: int) -> None: ... +def set_threshold(threshold0: int, threshold1: int = ..., + threshold2: int = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/getopt.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/getopt.pyi new file mode 100644 index 00000000..0417a827 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/getopt.pyi @@ -0,0 +1,14 @@ +# Stubs for getopt + +# Based on http://docs.python.org/3.2/library/getopt.html + +from typing import List, Tuple + +def getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ... +def gnu_getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ... + +class GetoptError(Exception): + msg: str + opt: str + +error = GetoptError diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/getpass.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/getpass.pyi new file mode 100644 index 00000000..55a8433f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/getpass.pyi @@ -0,0 +1,12 @@ +# Stubs for getpass + +from typing import Optional, TextIO + + +def getpass(prompt: str = ..., stream: Optional[TextIO] = ...) -> str: ... + + +def getuser() -> str: ... + + +class GetPassWarning(UserWarning): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/gettext.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/gettext.pyi new file mode 100644 index 00000000..ad1ba3c8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/gettext.pyi @@ -0,0 +1,62 @@ +import sys +from typing import overload, Any, Container, IO, Iterable, Optional, Type, TypeVar + +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + +class NullTranslations: + def __init__(self, fp: IO[str] = ...) -> None: ... + def _parse(self, fp: IO[str]) -> None: ... + def add_fallback(self, fallback: NullTranslations) -> None: ... + def gettext(self, message: str) -> str: ... + def lgettext(self, message: str) -> str: ... + def ngettext(self, singular: str, plural: str, n: int) -> str: ... + def lngettext(self, singular: str, plural: str, n: int) -> str: ... + def pgettext(self, context: str, message: str) -> str: ... + def npgettext(self, context: str, msgid1: str, msgid2: str, n: int) -> str: ... + def info(self) -> Any: ... + def charset(self) -> Any: ... + def output_charset(self) -> Any: ... + def set_output_charset(self, charset: str) -> None: ... + def install(self, names: Optional[Container[str]] = ...) -> None: ... + +class GNUTranslations(NullTranslations): + LE_MAGIC: int + BE_MAGIC: int + +def find(domain: str, localedir: Optional[str] = ..., languages: Optional[Iterable[str]] = ..., + all: bool = ...) -> Any: ... + +_T = TypeVar('_T') +@overload +def translation(domain: str, localedir: Optional[str] = ..., languages: Optional[Iterable[str]] = ..., + class_: None = ..., fallback: bool = ..., codeset: Optional[str] = ...) -> NullTranslations: ... +@overload +def translation(domain: str, localedir: Optional[str] = ..., languages: Optional[Iterable[str]] = ..., + class_: Type[_T] = ..., fallback: Literal[False] = ..., codeset: Optional[str] = ...) -> _T: ... +@overload +def translation(domain: str, localedir: Optional[str] = ..., languages: Optional[Iterable[str]] = ..., + class_: Type[_T] = ..., fallback: Literal[True] = ..., codeset: Optional[str] = ...) -> Any: ... + +def install(domain: str, localedir: Optional[str] = ..., codeset: Optional[str] = ..., + names: Optional[Container[str]] = ...) -> None: ... + +def textdomain(domain: Optional[str] = ...) -> str: ... +def bindtextdomain(domain: str, localedir: Optional[str] = ...) -> str: ... +def bind_textdomain_codeset(domain: str, codeset: Optional[str] = ...) -> str: ... +def dgettext(domain: str, message: str) -> str: ... +def ldgettext(domain: str, message: str) -> str: ... +def dngettext(domain: str, singular: str, plural: str, n: int) -> str: ... +def ldngettext(domain: str, singular: str, plural: str, n: int) -> str: ... +def gettext(message: str) -> str: ... +def lgettext(message: str) -> str: ... +def ngettext(singular: str, plural: str, n: int) -> str: ... +def lngettext(singular: str, plural: str, n: int) -> str: ... +def pgettext(context: str, message: str) -> str: ... +def dpgettext(domain: str, context: str, message: str) -> str: ... +def npgettext(context: str, msgid1: str, msgid2: str, n: int) -> str: ... +def dnpgettext(domain: str, context: str, msgid1: str, msgid2: str, n: int) -> str: ... + +Catalog = translation diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/glob.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/glob.pyi new file mode 100644 index 00000000..5e73a797 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/glob.pyi @@ -0,0 +1,19 @@ +# Stubs for glob +# Based on http://docs.python.org/3/library/glob.html + +from typing import List, Iterator, AnyStr, Union +import sys + +if sys.version_info >= (3, 6): + def glob0(dirname: AnyStr, pattern: AnyStr) -> List[AnyStr]: ... +else: + def glob0(dirname: AnyStr, basename: AnyStr) -> List[AnyStr]: ... + +def glob1(dirname: AnyStr, pattern: AnyStr) -> List[AnyStr]: ... + +def glob(pathname: AnyStr, *, recursive: bool = ...) -> List[AnyStr]: ... +def iglob(pathname: AnyStr, *, recursive: bool = ...) -> Iterator[AnyStr]: ... + +def escape(pathname: AnyStr) -> AnyStr: ... + +def has_magic(s: Union[str, bytes]) -> bool: ... # undocumented diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/gzip.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/gzip.pyi new file mode 100644 index 00000000..ce8152c3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/gzip.pyi @@ -0,0 +1,53 @@ +from typing import Any, IO, Optional +from os.path import _PathType +import _compression +import sys +import zlib + +def open(filename, mode: str = ..., compresslevel: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ..., newline: Optional[str] = ...) -> IO[Any]: ... + +class _PaddedFile: + file: IO[bytes] + def __init__(self, f: IO[bytes], prepend: bytes = ...) -> None: ... + def read(self, size: int) -> bytes: ... + def prepend(self, prepend: bytes = ...) -> None: ... + def seek(self, off: int) -> int: ... + def seekable(self) -> bool: ... + +class GzipFile(_compression.BaseStream): + myfileobj: Optional[IO[bytes]] + mode: str + name: str + compress: zlib._Compress + fileobj: IO[bytes] + def __init__(self, filename: Optional[_PathType] = ..., mode: Optional[str] = ..., compresslevel: int = ..., fileobj: Optional[IO[bytes]] = ..., mtime: Optional[float] = ...) -> None: ... + @property + def filename(self) -> str: ... + @property + def mtime(self) -> Optional[int]: ... + crc: int + def write(self, data: bytes) -> int: ... + def read(self, size: Optional[int] = ...) -> bytes: ... + def read1(self, size: int = ...) -> bytes: ... + def peek(self, n: int) -> bytes: ... + @property + def closed(self) -> bool: ... + def close(self) -> None: ... + def flush(self, zlib_mode: int = ...) -> None: ... + def fileno(self) -> int: ... + def rewind(self) -> None: ... + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def seekable(self) -> bool: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def readline(self, size: int = ...) -> bytes: ... + +class _GzipReader(_compression.DecompressReader): + def __init__(self, fp: IO[bytes]) -> None: ... + def read(self, size: int = ...) -> bytes: ... + +if sys.version_info >= (3, 8): + def compress(data, compresslevel: int = ..., *, mtime: Optional[float] = ...) -> bytes: ... +else: + def compress(data, compresslevel: int = ...) -> bytes: ... +def decompress(data: bytes) -> bytes: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/hashlib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/hashlib.pyi new file mode 100644 index 00000000..616bb0fd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/hashlib.pyi @@ -0,0 +1,69 @@ +# Stubs for hashlib + +import sys +from typing import AbstractSet, Optional, Union + +_DataType = Union[bytes, bytearray, memoryview] + +class _Hash(object): + digest_size: int + block_size: int + + # [Python documentation note] Changed in version 3.4: The name attribute has + # been present in CPython since its inception, but until Python 3.4 was not + # formally specified, so may not exist on some platforms + name: str + + def __init__(self, data: _DataType = ...) -> None: ... + + def copy(self) -> _Hash: ... + def digest(self) -> bytes: ... + def hexdigest(self) -> str: ... + def update(self, arg: _DataType) -> None: ... + +def md5(arg: _DataType = ...) -> _Hash: ... +def sha1(arg: _DataType = ...) -> _Hash: ... +def sha224(arg: _DataType = ...) -> _Hash: ... +def sha256(arg: _DataType = ...) -> _Hash: ... +def sha384(arg: _DataType = ...) -> _Hash: ... +def sha512(arg: _DataType = ...) -> _Hash: ... + +def new(name: str, data: _DataType = ...) -> _Hash: ... + +algorithms_guaranteed: AbstractSet[str] +algorithms_available: AbstractSet[str] + +def pbkdf2_hmac(hash_name: str, password: _DataType, salt: _DataType, iterations: int, dklen: Optional[int] = ...) -> bytes: ... + +if sys.version_info >= (3, 6): + class _VarLenHash(object): + digest_size: int + block_size: int + name: str + + def __init__(self, data: _DataType = ...) -> None: ... + + def copy(self) -> _VarLenHash: ... + def digest(self, length: int) -> bytes: ... + def hexdigest(self, length: int) -> str: ... + def update(self, arg: _DataType) -> None: ... + + sha3_224 = _Hash + sha3_256 = _Hash + sha3_384 = _Hash + sha3_512 = _Hash + shake_128 = _VarLenHash + shake_256 = _VarLenHash + + def scrypt(password: _DataType, *, salt: _DataType, n: int, r: int, p: int, maxmem: int = ..., dklen: int = ...) -> bytes: ... + + class _BlakeHash(_Hash): + MAX_DIGEST_SIZE: int + MAX_KEY_SIZE: int + PERSON_SIZE: int + SALT_SIZE: int + + def __init__(self, data: _DataType = ..., digest_size: int = ..., key: _DataType = ..., salt: _DataType = ..., person: _DataType = ..., fanout: int = ..., depth: int = ..., leaf_size: int = ..., node_offset: int = ..., node_depth: int = ..., inner_size: int = ..., last_node: bool = ...) -> None: ... + + blake2b = _BlakeHash + blake2s = _BlakeHash diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/heapq.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/heapq.pyi new file mode 100644 index 00000000..8f703c58 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/heapq.pyi @@ -0,0 +1,18 @@ +# Stubs for heapq + +# Based on http://docs.python.org/3.2/library/heapq.html + +from typing import TypeVar, List, Iterable, Any, Callable, Optional + +_T = TypeVar('_T') + +def heappush(heap: List[_T], item: _T) -> None: ... +def heappop(heap: List[_T]) -> _T: ... +def heappushpop(heap: List[_T], item: _T) -> _T: ... +def heapify(x: List[_T]) -> None: ... +def heapreplace(heap: List[_T], item: _T) -> _T: ... +def merge(*iterables: Iterable[_T], key: Callable[[_T], Any] = ..., reverse: bool = ...) -> Iterable[_T]: ... +def nlargest(n: int, iterable: Iterable[_T], + key: Optional[Callable[[_T], Any]] = ...) -> List[_T]: ... +def nsmallest(n: int, iterable: Iterable[_T], + key: Callable[[_T], Any] = ...) -> List[_T]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/html/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/html/__init__.pyi new file mode 100644 index 00000000..af2a8002 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/html/__init__.pyi @@ -0,0 +1,4 @@ +from typing import AnyStr + +def escape(s: AnyStr, quote: bool = ...) -> AnyStr: ... +def unescape(s: AnyStr) -> AnyStr: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/html/entities.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/html/entities.pyi new file mode 100644 index 00000000..97d9b2d3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/html/entities.pyi @@ -0,0 +1,6 @@ +from typing import Dict + +name2codepoint: Dict[str, int] +html5: Dict[str, str] +codepoint2name: Dict[int, str] +entitydefs: Dict[str, str] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/html/parser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/html/parser.pyi new file mode 100644 index 00000000..4c037845 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/html/parser.pyi @@ -0,0 +1,23 @@ +from typing import List, Optional, Tuple +from _markupbase import ParserBase + +class HTMLParser(ParserBase): + def __init__(self, *, convert_charrefs: bool = ...) -> None: ... + def feed(self, feed: str) -> None: ... + def close(self) -> None: ... + def reset(self) -> None: ... + def getpos(self) -> Tuple[int, int]: ... + def get_starttag_text(self) -> Optional[str]: ... + + def handle_starttag(self, tag: str, + attrs: List[Tuple[str, Optional[str]]]) -> None: ... + def handle_endtag(self, tag: str) -> None: ... + def handle_startendtag(self, tag: str, + attrs: List[Tuple[str, Optional[str]]]) -> None: ... + def handle_data(self, data: str) -> None: ... + def handle_entityref(self, name: str) -> None: ... + def handle_charref(self, name: str) -> None: ... + def handle_comment(self, data: str) -> None: ... + def handle_decl(self, decl: str) -> None: ... + def handle_pi(self, data: str) -> None: ... + def unknown_decl(self, data: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/http/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/http/__init__.pyi new file mode 100644 index 00000000..8e12f799 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/http/__init__.pyi @@ -0,0 +1,67 @@ +import sys +from enum import IntEnum + +class HTTPStatus(IntEnum): + @property + def phrase(self) -> str: ... + @property + def description(self) -> str: ... + CONTINUE: int + SWITCHING_PROTOCOLS: int + PROCESSING: int + OK: int + CREATED: int + ACCEPTED: int + NON_AUTHORITATIVE_INFORMATION: int + NO_CONTENT: int + RESET_CONTENT: int + PARTIAL_CONTENT: int + MULTI_STATUS: int + ALREADY_REPORTED: int + IM_USED: int + MULTIPLE_CHOICES: int + MOVED_PERMANENTLY: int + FOUND: int + SEE_OTHER: int + NOT_MODIFIED: int + USE_PROXY: int + TEMPORARY_REDIRECT: int + PERMANENT_REDIRECT: int + BAD_REQUEST: int + UNAUTHORIZED: int + PAYMENT_REQUIRED: int + FORBIDDEN: int + NOT_FOUND: int + METHOD_NOT_ALLOWED: int + NOT_ACCEPTABLE: int + PROXY_AUTHENTICATION_REQUIRED: int + REQUEST_TIMEOUT: int + CONFLICT: int + GONE: int + LENGTH_REQUIRED: int + PRECONDITION_FAILED: int + REQUEST_ENTITY_TOO_LARGE: int + REQUEST_URI_TOO_LONG: int + UNSUPPORTED_MEDIA_TYPE: int + REQUESTED_RANGE_NOT_SATISFIABLE: int + EXPECTATION_FAILED: int + UNPROCESSABLE_ENTITY: int + LOCKED: int + FAILED_DEPENDENCY: int + UPGRADE_REQUIRED: int + PRECONDITION_REQUIRED: int + TOO_MANY_REQUESTS: int + REQUEST_HEADER_FIELDS_TOO_LARGE: int + INTERNAL_SERVER_ERROR: int + NOT_IMPLEMENTED: int + BAD_GATEWAY: int + SERVICE_UNAVAILABLE: int + GATEWAY_TIMEOUT: int + HTTP_VERSION_NOT_SUPPORTED: int + VARIANT_ALSO_NEGOTIATES: int + INSUFFICIENT_STORAGE: int + LOOP_DETECTED: int + NOT_EXTENDED: int + NETWORK_AUTHENTICATION_REQUIRED: int + if sys.version_info >= (3, 7): + MISDIRECTED_REQUEST: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/http/client.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/http/client.pyi new file mode 100644 index 00000000..02e8d700 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/http/client.pyi @@ -0,0 +1,200 @@ +from typing import ( + Any, Dict, IO, Iterable, List, Iterator, Mapping, Optional, + Protocol, Tuple, Type, TypeVar, + Union, + overload, + BinaryIO, +) +import email.message +import io +from socket import socket +import sys +import ssl +import types + +_DataType = Union[bytes, IO[Any], Iterable[bytes], str] +_T = TypeVar('_T') + +HTTP_PORT: int +HTTPS_PORT: int + +CONTINUE: int +SWITCHING_PROTOCOLS: int +PROCESSING: int + +OK: int +CREATED: int +ACCEPTED: int +NON_AUTHORITATIVE_INFORMATION: int +NO_CONTENT: int +RESET_CONTENT: int +PARTIAL_CONTENT: int +MULTI_STATUS: int +IM_USED: int + +MULTIPLE_CHOICES: int +MOVED_PERMANENTLY: int +FOUND: int +SEE_OTHER: int +NOT_MODIFIED: int +USE_PROXY: int +TEMPORARY_REDIRECT: int + +BAD_REQUEST: int +UNAUTHORIZED: int +PAYMENT_REQUIRED: int +FORBIDDEN: int +NOT_FOUND: int +METHOD_NOT_ALLOWED: int +NOT_ACCEPTABLE: int +PROXY_AUTHENTICATION_REQUIRED: int +REQUEST_TIMEOUT: int +CONFLICT: int +GONE: int +LENGTH_REQUIRED: int +PRECONDITION_FAILED: int +REQUEST_ENTITY_TOO_LARGE: int +REQUEST_URI_TOO_LONG: int +UNSUPPORTED_MEDIA_TYPE: int +REQUESTED_RANGE_NOT_SATISFIABLE: int +EXPECTATION_FAILED: int +UNPROCESSABLE_ENTITY: int +LOCKED: int +FAILED_DEPENDENCY: int +UPGRADE_REQUIRED: int +PRECONDITION_REQUIRED: int +TOO_MANY_REQUESTS: int +REQUEST_HEADER_FIELDS_TOO_LARGE: int + +INTERNAL_SERVER_ERROR: int +NOT_IMPLEMENTED: int +BAD_GATEWAY: int +SERVICE_UNAVAILABLE: int +GATEWAY_TIMEOUT: int +HTTP_VERSION_NOT_SUPPORTED: int +INSUFFICIENT_STORAGE: int +NOT_EXTENDED: int +NETWORK_AUTHENTICATION_REQUIRED: int + +responses: Dict[int, str] + +class HTTPMessage(email.message.Message): ... + +class HTTPResponse(io.BufferedIOBase, BinaryIO): + msg: HTTPMessage + headers: HTTPMessage + version: int + debuglevel: int + closed: bool + status: int + reason: str + def __init__(self, sock: socket, debuglevel: int = ..., + method: Optional[str] = ..., url: Optional[str] = ...) -> None: ... + def read(self, amt: Optional[int] = ...) -> bytes: ... + @overload + def getheader(self, name: str) -> Optional[str]: ... + @overload + def getheader(self, name: str, default: _T) -> Union[str, _T]: ... + def getheaders(self) -> List[Tuple[str, str]]: ... + def fileno(self) -> int: ... + def isclosed(self) -> bool: ... + def __iter__(self) -> Iterator[bytes]: ... + def __enter__(self) -> HTTPResponse: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[types.TracebackType]) -> Optional[bool]: ... + def info(self) -> email.message.Message: ... + def geturl(self) -> str: ... + def getcode(self) -> int: ... + def begin(self) -> None: ... + +# This is an API stub only for the class below, not a class itself. +# urllib.request uses it for a parameter. +class _HTTPConnectionProtocol(Protocol): + if sys.version_info >= (3, 7): + def __call__( + self, + host: str, + port: Optional[int] = ..., + timeout: float = ..., + source_address: Optional[Tuple[str, int]] = ..., + blocksize: int = ..., + ) -> HTTPConnection: ... + else: + def __call__( + self, host: str, port: Optional[int] = ..., timeout: float = ..., source_address: Optional[Tuple[str, int]] = ..., + ) -> HTTPConnection: ... + +class HTTPConnection: + timeout: float + host: str + port: int + sock: Any + if sys.version_info >= (3, 7): + def __init__( + self, + host: str, port: Optional[int] = ..., + timeout: float = ..., + source_address: Optional[Tuple[str, int]] = ..., blocksize: int = ... + ) -> None: ... + else: + def __init__( + self, + host: str, port: Optional[int] = ..., + timeout: float = ..., + source_address: Optional[Tuple[str, int]] = ... + ) -> None: ... + if sys.version_info >= (3, 6): + def request(self, method: str, url: str, + body: Optional[_DataType] = ..., + headers: Mapping[str, str] = ..., + *, encode_chunked: bool = ...) -> None: ... + else: + def request(self, method: str, url: str, + body: Optional[_DataType] = ..., + headers: Mapping[str, str] = ...) -> None: ... + def getresponse(self) -> HTTPResponse: ... + def set_debuglevel(self, level: int) -> None: ... + def set_tunnel(self, host: str, port: Optional[int] = ..., + headers: Optional[Mapping[str, str]] = ...) -> None: ... + def connect(self) -> None: ... + def close(self) -> None: ... + def putrequest(self, method: str, url: str, skip_host: bool = ..., + skip_accept_encoding: bool = ...) -> None: ... + def putheader(self, header: str, *argument: str) -> None: ... + if sys.version_info >= (3, 6): + def endheaders(self, message_body: Optional[_DataType] = ..., + *, encode_chunked: bool = ...) -> None: ... + else: + def endheaders(self, message_body: Optional[_DataType] = ...) -> None: ... + def send(self, data: _DataType) -> None: ... + +class HTTPSConnection(HTTPConnection): + def __init__(self, + host: str, port: Optional[int] = ..., + key_file: Optional[str] = ..., + cert_file: Optional[str] = ..., + timeout: float = ..., + source_address: Optional[Tuple[str, int]] = ..., + *, context: Optional[ssl.SSLContext] = ..., + check_hostname: Optional[bool] = ...) -> None: ... + +class HTTPException(Exception): ... +error = HTTPException + +class NotConnected(HTTPException): ... +class InvalidURL(HTTPException): ... +class UnknownProtocol(HTTPException): ... +class UnknownTransferEncoding(HTTPException): ... +class UnimplementedFileMode(HTTPException): ... +class IncompleteRead(HTTPException): ... + +class ImproperConnectionState(HTTPException): ... +class CannotSendRequest(ImproperConnectionState): ... +class CannotSendHeader(ImproperConnectionState): ... +class ResponseNotReady(ImproperConnectionState): ... + +class BadStatusLine(HTTPException): ... +class LineTooLong(HTTPException): ... + +class RemoteDisconnected(ConnectionResetError, BadStatusLine): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/http/cookiejar.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/http/cookiejar.pyi new file mode 100644 index 00000000..9e31fb99 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/http/cookiejar.pyi @@ -0,0 +1,116 @@ +from typing import Dict, Iterable, Iterator, Optional, Sequence, Tuple, TypeVar, Union, overload +from http.client import HTTPResponse +from urllib.request import Request + +_T = TypeVar('_T') + +class LoadError(OSError): ... + + +class CookieJar(Iterable[Cookie]): + def __init__(self, policy: Optional[CookiePolicy] = ...) -> None: ... + def add_cookie_header(self, request: Request) -> None: ... + def extract_cookies(self, response: HTTPResponse, + request: Request) -> None: ... + def set_policy(self, policy: CookiePolicy) -> None: ... + def make_cookies(self, response: HTTPResponse, + request: Request) -> Sequence[Cookie]: ... + def set_cookie(self, cookie: Cookie) -> None: ... + def set_cookie_if_ok(self, cookie: Cookie, + request: Request) -> None: ... + def clear(self, domain: str = ..., path: str = ..., + name: str = ...) -> None: ... + def clear_session_cookies(self) -> None: ... + def __iter__(self) -> Iterator[Cookie]: ... + def __len__(self) -> int: ... + +class FileCookieJar(CookieJar): + filename: str + delayload: bool + def __init__(self, filename: str = ..., delayload: bool = ..., + policy: Optional[CookiePolicy] = ...) -> None: ... + def save(self, filename: Optional[str] = ..., ignore_discard: bool = ..., + ignore_expires: bool = ...) -> None: ... + def load(self, filename: Optional[str] = ..., ignore_discard: bool = ..., + ignore_expires: bool = ...) -> None: ... + def revert(self, filename: Optional[str] = ..., ignore_discard: bool = ..., + ignore_expires: bool = ...) -> None: ... + +class MozillaCookieJar(FileCookieJar): ... + +class LWPCookieJar(FileCookieJar): + def as_lwp_str(self, ignore_discard: bool = ..., ignore_expires: bool = ...) -> str: ... # undocumented + +class CookiePolicy: + netscape: bool + rfc2965: bool + hide_cookie2: bool + def set_ok(self, cookie: Cookie, request: Request) -> bool: ... + def return_ok(self, cookie: Cookie, request: Request) -> bool: ... + def domain_return_ok(self, domain: str, request: Request) -> bool: ... + def path_return_ok(self, path: str, request: Request) -> bool: ... + + +class DefaultCookiePolicy(CookiePolicy): + rfc2109_as_netscape: bool + strict_domain: bool + strict_rfc2965_unverifiable: bool + strict_ns_unverifiable: bool + strict_ns_domain: int + strict_ns_set_initial_dollar: bool + strict_ns_set_path: bool + DomainStrictNoDots: int + DomainStrictNonDomain: int + DomainRFC2965Match: int + DomainLiberal: int + DomainStrict: int + def __init__(self, blocked_domains: Optional[Sequence[str]] = ..., + allowed_domains: Optional[Sequence[str]] = ..., + netscape: bool = ..., + rfc2965: bool = ..., + rfc2109_as_netscape: Optional[bool] = ..., + hide_cookie2: bool = ..., strict_domain: bool = ..., + strict_rfc2965_unverifiable: bool = ..., + strict_ns_unverifiable: bool = ..., + strict_ns_domain: int = ..., + strict_ns_set_initial_dollar: bool = ..., + strict_ns_set_path: bool = ...) -> None: ... + def blocked_domains(self) -> Tuple[str, ...]: ... + def set_blocked_domains(self, blocked_domains: Sequence[str]) -> None: ... + def is_blocked(self, domain: str) -> bool: ... + def allowed_domains(self) -> Optional[Tuple[str, ...]]: ... + def set_allowed_domains(self, allowed_domains: Optional[Sequence[str]]) -> None: ... + def is_not_allowed(self, domain: str) -> bool: ... + + +class Cookie: + version: Optional[int] + name: str + value: Optional[str] + port: Optional[str] + path: str + secure: bool + expires: Optional[int] + discard: bool + comment: Optional[str] + comment_url: Optional[str] + rfc2109: bool + port_specified: bool + domain: str # undocumented + domain_specified: bool + domain_initial_dot: bool + def __init__(self, version: Optional[int], name: str, value: Optional[str], # undocumented + port: Optional[str], port_specified: bool, + domain: str, domain_specified: bool, domain_initial_dot: bool, + path: str, path_specified: bool, + secure: bool, expires: Optional[int], discard: bool, + comment: Optional[str], comment_url: Optional[str], + rest: Dict[str, str], + rfc2109: bool = ...) -> None: ... + def has_nonstandard_attr(self, name: str) -> bool: ... + @overload + def get_nonstandard_attr(self, name: str) -> Optional[str]: ... + @overload + def get_nonstandard_attr(self, name: str, default: _T = ...) -> Union[str, _T]: ... + def set_nonstandard_attr(self, name: str, value: str) -> None: ... + def is_expired(self, now: int = ...) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/http/cookies.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/http/cookies.pyi new file mode 100644 index 00000000..886d3c71 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/http/cookies.pyi @@ -0,0 +1,31 @@ +# Stubs for http.cookies (Python 3.5) + +from typing import Generic, Dict, List, Mapping, Optional, TypeVar, Union, Any + +_DataType = Union[str, Mapping[str, Union[str, Morsel[Any]]]] +_T = TypeVar('_T') + +class CookieError(Exception): ... + +class Morsel(Dict[str, Any], Generic[_T]): + value: str + coded_value: _T + key: str + def set(self, key: str, val: str, coded_val: _T) -> None: ... + def isReservedKey(self, K: str) -> bool: ... + def output(self, attrs: Optional[List[str]] = ..., + header: str = ...) -> str: ... + def js_output(self, attrs: Optional[List[str]] = ...) -> str: ... + def OutputString(self, attrs: Optional[List[str]] = ...) -> str: ... + +class BaseCookie(Dict[str, Morsel[_T]], Generic[_T]): + def __init__(self, input: Optional[_DataType] = ...) -> None: ... + def value_decode(self, val: str) -> _T: ... + def value_encode(self, val: _T) -> str: ... + def output(self, attrs: Optional[List[str]] = ..., header: str = ..., + sep: str = ...) -> str: ... + def js_output(self, attrs: Optional[List[str]] = ...) -> str: ... + def load(self, rawdata: _DataType) -> None: ... + def __setitem__(self, key: str, value: Union[str, Morsel[_T]]) -> None: ... + +class SimpleCookie(BaseCookie[_T], Generic[_T]): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/http/server.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/http/server.pyi new file mode 100644 index 00000000..701199a7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/http/server.pyi @@ -0,0 +1,78 @@ +# Stubs for http.server (Python 3.4) + +import sys +from typing import Any, BinaryIO, Callable, ClassVar, Dict, List, Mapping, Optional, Sequence, Tuple, Union +import socketserver +import email.message + +if sys.version_info >= (3, 7): + from builtins import _PathLike + +class HTTPServer(socketserver.TCPServer): + server_name: str + server_port: int + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: Callable[..., BaseHTTPRequestHandler]) -> None: ... + +if sys.version_info >= (3, 7): + class ThreadingHTTPServer(socketserver.ThreadingMixIn, HTTPServer): + daemon_threads: bool # undocumented + +class BaseHTTPRequestHandler: + client_address: Tuple[str, int] + server: socketserver.BaseServer + close_connection: bool + requestline: str + command: str + path: str + request_version: str + headers: email.message.Message + rfile: BinaryIO + wfile: BinaryIO + server_version: str + sys_version: str + error_message_format: str + error_content_type: str + protocol_version: str + MessageClass: type + responses: Mapping[int, Tuple[str, str]] + weekdayname: ClassVar[Sequence[str]] = ... # Undocumented + monthname: ClassVar[Sequence[Optional[str]]] = ... # Undocumented + def __init__(self, request: bytes, client_address: Tuple[str, int], + server: socketserver.BaseServer) -> None: ... + def handle(self) -> None: ... + def handle_one_request(self) -> None: ... + def handle_expect_100(self) -> bool: ... + def send_error(self, code: int, message: Optional[str] = ..., + explain: Optional[str] = ...) -> None: ... + def send_response(self, code: int, + message: Optional[str] = ...) -> None: ... + def send_header(self, keyword: str, value: str) -> None: ... + def send_response_only(self, code: int, + message: Optional[str] = ...) -> None: ... + def end_headers(self) -> None: ... + def flush_headers(self) -> None: ... + def log_request(self, code: Union[int, str] = ..., + size: Union[int, str] = ...) -> None: ... + def log_error(self, format: str, *args: Any) -> None: ... + def log_message(self, format: str, *args: Any) -> None: ... + def version_string(self) -> str: ... + def date_time_string(self, timestamp: Optional[int] = ...) -> str: ... + def log_date_time_string(self) -> str: ... + def address_string(self) -> str: ... + def parse_request(self) -> bool: ... # Undocumented + +class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): + extensions_map: Dict[str, str] + if sys.version_info >= (3, 7): + def __init__(self, request: bytes, client_address: Tuple[str, int], + server: socketserver.BaseServer, directory: Optional[Union[str, _PathLike[str]]]) -> None: ... + else: + def __init__(self, request: bytes, client_address: Tuple[str, int], + server: socketserver.BaseServer) -> None: ... + def do_GET(self) -> None: ... + def do_HEAD(self) -> None: ... + +class CGIHTTPRequestHandler(SimpleHTTPRequestHandler): + cgi_directories: List[str] + def do_POST(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/imp.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/imp.pyi new file mode 100644 index 00000000..5f17fe5d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/imp.pyi @@ -0,0 +1,54 @@ +# Stubs for imp (Python 3.6) + +import os +import sys +import types +from typing import Any, IO, List, Optional, Tuple, TypeVar, Union + +from _imp import (lock_held as lock_held, acquire_lock as acquire_lock, release_lock as release_lock, + get_frozen_object as get_frozen_object, is_frozen_package as is_frozen_package, + init_frozen as init_frozen, is_builtin as is_builtin, is_frozen as is_frozen) + +from _imp import create_dynamic as create_dynamic + +_T = TypeVar('_T') + +if sys.version_info >= (3, 6): + _Path = Union[str, os.PathLike[str]] +else: + _Path = str + +SEARCH_ERROR: int +PY_SOURCE: int +PY_COMPILED: int +C_EXTENSION: int +PY_RESOURCE: int +PKG_DIRECTORY: int +C_BUILTIN: int +PY_FROZEN: int +PY_CODERESOURCE: int +IMP_HOOK: int + +def new_module(name: str) -> types.ModuleType: ... +def get_magic() -> bytes: ... +def get_tag() -> str: ... +def cache_from_source(path: _Path, debug_override: Optional[bool] = ...) -> str: ... +def source_from_cache(path: _Path) -> str: ... +def get_suffixes() -> List[Tuple[str, str, int]]: ... + +class NullImporter: + def __init__(self, path: _Path) -> None: ... + def find_module(self, fullname: Any) -> None: ... + +# PathLike doesn't work for the pathname argument here +def load_source(name: str, pathname: str, file: Optional[IO[Any]] = ...) -> types.ModuleType: ... +def load_compiled(name: str, pathname: str, file: Optional[IO[Any]] = ...) -> types.ModuleType: ... +def load_package(name: str, path: _Path) -> types.ModuleType: ... +def load_module(name: str, file: IO[Any], filename: str, details: Tuple[str, str, int]) -> types.ModuleType: ... +if sys.version_info >= (3, 6): + def find_module(name: str, path: Union[None, List[str], List[os.PathLike[str]], List[_Path]] = ...) -> Tuple[IO[Any], str, Tuple[str, str, int]]: ... +else: + def find_module(name: str, path: Optional[List[str]] = ...) -> Tuple[IO[Any], str, Tuple[str, str, int]]: ... +def reload(module: types.ModuleType) -> types.ModuleType: ... +def init_builtin(name: str) -> Optional[types.ModuleType]: ... +def load_dynamic(name: str, path: str, file: Optional[IO[Any]] = ...) -> types.ModuleType: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/importlib/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/importlib/__init__.pyi new file mode 100644 index 00000000..e44f4241 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/importlib/__init__.pyi @@ -0,0 +1,16 @@ +from importlib.abc import Loader +import types +from typing import Any, Mapping, Optional, Sequence + +def __import__(name: str, globals: Optional[Mapping[str, Any]] = ..., + locals: Optional[Mapping[str, Any]] = ..., + fromlist: Sequence[str] = ..., + level: int = ...) -> types.ModuleType: ... + +def import_module(name: str, package: Optional[str] = ...) -> types.ModuleType: ... + +def find_loader(name: str, path: Optional[str] = ...) -> Optional[Loader]: ... + +def invalidate_caches() -> None: ... + +def reload(module: types.ModuleType) -> types.ModuleType: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/importlib/abc.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/importlib/abc.pyi new file mode 100644 index 00000000..709ba44f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/importlib/abc.pyi @@ -0,0 +1,92 @@ +from abc import ABCMeta, abstractmethod +import os +import sys +import types +from typing import Any, IO, Iterator, Mapping, Optional, Sequence, Tuple, Union + +# Loader is exported from this module, but for circular import reasons +# exists in its own stub file (with ModuleSpec and ModuleType). +from _importlib_modulespec import Loader as Loader # Exported + +from _importlib_modulespec import ModuleSpec + +_Path = Union[bytes, str] + +class Finder(metaclass=ABCMeta): + ... + # Technically this class defines the following method, but its subclasses + # in this module violate its signature. Since this class is deprecated, it's + # easier to simply ignore that this method exists. + # @abstractmethod + # def find_module(self, fullname: str, + # path: Optional[Sequence[_Path]] = ...) -> Optional[Loader]: ... + +class ResourceLoader(Loader): + @abstractmethod + def get_data(self, path: _Path) -> bytes: ... + +class InspectLoader(Loader): + def is_package(self, fullname: str) -> bool: ... + def get_code(self, fullname: str) -> Optional[types.CodeType]: ... + def load_module(self, fullname: str) -> types.ModuleType: ... + @abstractmethod + def get_source(self, fullname: str) -> Optional[str]: ... + def exec_module(self, module: types.ModuleType) -> None: ... + @staticmethod + def source_to_code(data: Union[bytes, str], path: str = ...) -> types.CodeType: ... + +class ExecutionLoader(InspectLoader): + @abstractmethod + def get_filename(self, fullname: str) -> _Path: ... + def get_code(self, fullname: str) -> Optional[types.CodeType]: ... + +class SourceLoader(ResourceLoader, ExecutionLoader, metaclass=ABCMeta): + def path_mtime(self, path: _Path) -> float: ... + def set_data(self, path: _Path, data: bytes) -> None: ... + def get_source(self, fullname: str) -> Optional[str]: ... + def path_stats(self, path: _Path) -> Mapping[str, Any]: ... + + +class MetaPathFinder(Finder): + def find_module(self, fullname: str, + path: Optional[Sequence[_Path]]) -> Optional[Loader]: + ... + def invalidate_caches(self) -> None: ... + # Not defined on the actual class, but expected to exist. + def find_spec( + self, fullname: str, path: Optional[Sequence[_Path]], + target: Optional[types.ModuleType] = ... + ) -> Optional[ModuleSpec]: + ... + +class PathEntryFinder(Finder): + def find_module(self, fullname: str) -> Optional[Loader]: ... + def find_loader( + self, fullname: str + ) -> Tuple[Optional[Loader], Sequence[_Path]]: ... + def invalidate_caches(self) -> None: ... + # Not defined on the actual class, but expected to exist. + def find_spec( + self, fullname: str, + target: Optional[types.ModuleType] = ... + ) -> Optional[ModuleSpec]: ... + +class FileLoader(ResourceLoader, ExecutionLoader, metaclass=ABCMeta): + name: str + path: _Path + def __init__(self, fullname: str, path: _Path) -> None: ... + def get_data(self, path: _Path) -> bytes: ... + def get_filename(self, fullname: str) -> _Path: ... + +if sys.version_info >= (3, 7): + _PathLike = Union[bytes, str, os.PathLike[Any]] + + class ResourceReader(metaclass=ABCMeta): + @abstractmethod + def open_resource(self, resource: _PathLike) -> IO[bytes]: ... + @abstractmethod + def resource_path(self, resource: _PathLike) -> str: ... + @abstractmethod + def is_resource(self, name: str) -> bool: ... + @abstractmethod + def contents(self) -> Iterator[str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/importlib/machinery.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/importlib/machinery.pyi new file mode 100644 index 00000000..746c5026 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/importlib/machinery.pyi @@ -0,0 +1,115 @@ +import importlib.abc +import types +from typing import Any, Callable, List, Optional, Sequence, Tuple + +# ModuleSpec is exported from this module, but for circular import +# reasons exists in its own stub file (with Loader and ModuleType). +from _importlib_modulespec import ModuleSpec as ModuleSpec # Exported + +class BuiltinImporter(importlib.abc.MetaPathFinder, + importlib.abc.InspectLoader): + # MetaPathFinder + @classmethod + def find_module( + cls, fullname: str, + path: Optional[Sequence[importlib.abc._Path]] + ) -> Optional[importlib.abc.Loader]: + ... + @classmethod + def find_spec(cls, fullname: str, + path: Optional[Sequence[importlib.abc._Path]], + target: Optional[types.ModuleType] = ...) -> Optional[ModuleSpec]: + ... + # InspectLoader + @classmethod + def is_package(cls, fullname: str) -> bool: ... + @classmethod + def load_module(cls, fullname: str) -> types.ModuleType: ... + @classmethod + def get_code(cls, fullname: str) -> None: ... + @classmethod + def get_source(cls, fullname: str) -> None: ... + # Loader + @staticmethod + def module_repr(module: types.ModuleType) -> str: ... + @classmethod + def create_module(cls, spec: ModuleSpec) -> Optional[types.ModuleType]: ... + @classmethod + def exec_module(cls, module: types.ModuleType) -> None: ... + +class FrozenImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader): + # MetaPathFinder + @classmethod + def find_module( + cls, fullname: str, + path: Optional[Sequence[importlib.abc._Path]] + ) -> Optional[importlib.abc.Loader]: + ... + @classmethod + def find_spec(cls, fullname: str, + path: Optional[Sequence[importlib.abc._Path]], + target: Optional[types.ModuleType] = ...) -> Optional[ModuleSpec]: + ... + # InspectLoader + @classmethod + def is_package(cls, fullname: str) -> bool: ... + @classmethod + def load_module(cls, fullname: str) -> types.ModuleType: ... + @classmethod + def get_code(cls, fullname: str) -> None: ... + @classmethod + def get_source(cls, fullname: str) -> None: ... + # Loader + @staticmethod + def module_repr(module: types.ModuleType) -> str: ... + @classmethod + def create_module(cls, spec: ModuleSpec) -> Optional[types.ModuleType]: + ... + @staticmethod + def exec_module(module: types.ModuleType) -> None: ... + +class WindowsRegistryFinder(importlib.abc.MetaPathFinder): + @classmethod + def find_module( + cls, fullname: str, + path: Optional[Sequence[importlib.abc._Path]] + ) -> Optional[importlib.abc.Loader]: + ... + @classmethod + def find_spec(cls, fullname: str, + path: Optional[Sequence[importlib.abc._Path]], + target: Optional[types.ModuleType] = ...) -> Optional[ModuleSpec]: + ... + +class PathFinder(importlib.abc.MetaPathFinder): ... + +SOURCE_SUFFIXES: List[str] +DEBUG_BYTECODE_SUFFIXES: List[str] +OPTIMIZED_BYTECODE_SUFFIXES: List[str] +BYTECODE_SUFFIXES: List[str] +EXTENSION_SUFFIXES: List[str] + +def all_suffixes() -> List[str]: ... + +class FileFinder(importlib.abc.PathEntryFinder): + path: str + def __init__( + self, path: str, + *loader_details: Tuple[importlib.abc.Loader, List[str]] + ) -> None: ... + @classmethod + def path_hook( + cls, *loader_details: Tuple[importlib.abc.Loader, List[str]] + ) -> Callable[[str], importlib.abc.PathEntryFinder]: ... + +class SourceFileLoader(importlib.abc.FileLoader, + importlib.abc.SourceLoader): + ... + +class SourcelessFileLoader(importlib.abc.FileLoader, + importlib.abc.SourceLoader): + ... + +class ExtensionFileLoader(importlib.abc.ExecutionLoader): + def get_filename(self, fullname: str) -> importlib.abc._Path: ... + def get_source(self, fullname: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/importlib/metadata.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/importlib/metadata.pyi new file mode 100644 index 00000000..b3d01266 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/importlib/metadata.pyi @@ -0,0 +1,86 @@ +import abc +import os +import pathlib +import sys +from email.message import Message +from importlib.abc import MetaPathFinder +from pathlib import Path +from typing import Any, Dict, Iterable, List, NamedTuple, Optional, Tuple, Union, overload + +if sys.version_info >= (3, 8): + class PackageNotFoundError(ModuleNotFoundError): ... + class EntryPointBase(NamedTuple): + name: str + value: str + class EntryPoint(EntryPointBase): + def load(self) -> Any: ... # Callable[[], Any] or an importable module + @property + def extras(self) -> List[str]: ... + class PackagePath(pathlib.PurePosixPath): + def read_text(self, encoding: str = ...) -> str: ... + def read_binary(self) -> bytes: ... + def locate(self) -> os.PathLike[str]: ... + # The following attributes are not defined on PackagePath, but are dynamically added by Distribution.files: + hash: Optional[FileHash] + size: Optional[int] + dist: Distribution + class FileHash: + mode: str + value: str + def __init__(self, spec: str) -> None: ... + class Distribution: + @abc.abstractmethod + def read_text(self, filename: str) -> Optional[str]: ... + @abc.abstractmethod + def locate_file(self, path: Union[os.PathLike[str], str]) -> os.PathLike[str]: ... + @classmethod + def from_name(cls, name: str) -> Distribution: ... + @overload + @classmethod + def discover(cls, *, context: DistributionFinder.Context) -> Iterable[Distribution]: ... + @overload + @classmethod + def discover( + cls, *, context: None = ..., name: Optional[str] = ..., path: List[str] = ..., **kwargs: Any + ) -> Iterable[Distribution]: ... + @staticmethod + def at(path: Union[str, os.PathLike[str]]) -> PathDistribution: ... + @property + def metadata(self) -> Message: ... + @property + def version(self) -> str: ... + @property + def entry_points(self) -> List[EntryPoint]: ... + @property + def files(self) -> Optional[List[PackagePath]]: ... + @property + def requires(self) -> Optional[List[str]]: ... + class DistributionFinder(MetaPathFinder): + class Context: + name: Optional[str] + def __init__(self, *, name: Optional[str] = ..., path: List[str] = ..., **kwargs: Any) -> None: ... + @property + def path(self) -> List[str]: ... + @property + def pattern(self) -> str: ... + @abc.abstractmethod + def find_distributions(self, context: Context = ...) -> Iterable[Distribution]: ... + class MetadataPathFinder(DistributionFinder): + @classmethod + def find_distributions(cls, context: DistributionFinder.Context = ...) -> Iterable[PathDistribution]: ... + class PathDistribution(Distribution): + def __init__(self, path: Path) -> None: ... + def read_text(self, filename: Union[str, os.PathLike[str]]) -> str: ... + def locate_file(self, path: Union[str, os.PathLike[str]]) -> os.PathLike[str]: ... + def distribution(distribution_name: str) -> Distribution: ... + @overload + def distributions(*, context: DistributionFinder.Context) -> Iterable[Distribution]: ... + @overload + def distributions( + *, context: None = ..., name: Optional[str] = ..., path: List[str] = ..., **kwargs: Any + ) -> Iterable[Distribution]: ... + def metadata(distribution_name: str) -> Message: ... + def version(distribution_name: str) -> str: ... + def entry_points() -> Dict[str, Tuple[EntryPoint, ...]]: ... + def files(distribution_name: str) -> Optional[List[PackagePath]]: ... + def requires(distribution_name: str) -> Optional[List[str]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/importlib/resources.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/importlib/resources.pyi new file mode 100644 index 00000000..007477d5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/importlib/resources.pyi @@ -0,0 +1,25 @@ +import sys +# This is a >=3.7 module, so we conditionally include its source. +if sys.version_info >= (3, 7): + import os + + from pathlib import Path + from types import ModuleType + from typing import ContextManager, Iterator, Union, BinaryIO, TextIO + + Package = Union[str, ModuleType] + Resource = Union[str, os.PathLike] + + def open_binary(package: Package, resource: Resource) -> BinaryIO: ... + def open_text(package: Package, + resource: Resource, + encoding: str = ..., + errors: str = ...) -> TextIO: ... + def read_binary(package: Package, resource: Resource) -> bytes: ... + def read_text(package: Package, + resource: Resource, + encoding: str = ..., + errors: str = ...) -> str: ... + def path(package: Package, resource: Resource) -> ContextManager[Path]: ... + def is_resource(package: Package, name: str) -> bool: ... + def contents(package: Package) -> Iterator[str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/importlib/util.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/importlib/util.pyi new file mode 100644 index 00000000..878d0652 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/importlib/util.pyi @@ -0,0 +1,53 @@ +import importlib.abc +import importlib.machinery +import sys +import types +from typing import Any, Callable, List, Optional, Union + +def module_for_loader( + fxn: Callable[..., types.ModuleType] +) -> Callable[..., types.ModuleType]: ... +def set_loader( + fxn: Callable[..., types.ModuleType] +) -> Callable[..., types.ModuleType]: ... +def set_package( + fxn: Callable[..., types.ModuleType] +) -> Callable[..., types.ModuleType]: ... + +def resolve_name(name: str, package: str) -> str: ... + +MAGIC_NUMBER: bytes + +def cache_from_source(path: str, debug_override: Optional[bool] = ..., *, + optimization: Optional[Any] = ...) -> str: ... +def source_from_cache(path: str) -> str: ... +def decode_source(source_bytes: bytes) -> str: ... +def find_spec( + name: str, package: Optional[str] = ... +) -> Optional[importlib.machinery.ModuleSpec]: ... +def spec_from_loader( + name: str, loader: Optional[importlib.abc.Loader], *, + origin: Optional[str] = ..., loader_state: Optional[Any] = ..., + is_package: Optional[bool] = ... +) -> importlib.machinery.ModuleSpec: ... + +if sys.version_info >= (3, 6): + import os + _Path = Union[str, bytes, os.PathLike] +else: + _Path = str + +def spec_from_file_location( + name: str, location: _Path, *, + loader: Optional[importlib.abc.Loader] = ..., + submodule_search_locations: Optional[List[str]] = ... +) -> importlib.machinery.ModuleSpec: ... + +def module_from_spec(spec: importlib.machinery.ModuleSpec) -> types.ModuleType: ... + +class LazyLoader(importlib.abc.Loader): + def __init__(self, loader: importlib.abc.Loader) -> None: ... + @classmethod + def factory(cls, loader: importlib.abc.Loader) -> Callable[..., LazyLoader]: ... + def create_module(self, spec: importlib.machinery.ModuleSpec) -> Optional[types.ModuleType]: ... + def exec_module(self, module: types.ModuleType) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/inspect.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/inspect.pyi new file mode 100644 index 00000000..6c1afd5e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/inspect.pyi @@ -0,0 +1,313 @@ +import sys +from typing import (AbstractSet, Any, Callable, Dict, Generator, List, Mapping, + NamedTuple, Optional, Sequence, Tuple, Type, Union, + ) +from types import (CodeType, FrameType, FunctionType, MethodType, ModuleType, + TracebackType, + ) +from collections import OrderedDict + +# +# Types and members +# +class EndOfBlock(Exception): ... + +class BlockFinder: + indent: int + islambda: bool + started: bool + passline: bool + indecorator: bool + decoratorhasargs: bool + last: int + def tokeneater(self, type: int, token: str, srow_scol: Tuple[int, int], + erow_ecol: Tuple[int, int], line: str) -> None: ... + +CO_OPTIMIZED: int +CO_NEWLOCALS: int +CO_VARARGS: int +CO_VARKEYWORDS: int +CO_NESTED: int +CO_GENERATOR: int +CO_NOFREE: int +CO_COROUTINE: int +CO_ITERABLE_COROUTINE: int +if sys.version_info >= (3, 6): + CO_ASYNC_GENERATOR: int +TPFLAGS_IS_ABSTRACT: int + +if sys.version_info < (3, 6): + class ModuleInfo(NamedTuple): + name: str + suffix: str + mode: str + module_type: int + def getmoduleinfo(path: str) -> Optional[ModuleInfo]: ... + +def getmembers(object: object, + predicate: Optional[Callable[[Any], bool]] = ..., + ) -> List[Tuple[str, Any]]: ... +def getmodulename(path: str) -> Optional[str]: ... + +def ismodule(object: object) -> bool: ... +def isclass(object: object) -> bool: ... +def ismethod(object: object) -> bool: ... +def isfunction(object: object) -> bool: ... +def isgeneratorfunction(object: object) -> bool: ... +def isgenerator(object: object) -> bool: ... + +def iscoroutinefunction(object: object) -> bool: ... +def iscoroutine(object: object) -> bool: ... +def isawaitable(object: object) -> bool: ... +if sys.version_info >= (3, 6): + def isasyncgenfunction(object: object) -> bool: ... + def isasyncgen(object: object) -> bool: ... +def istraceback(object: object) -> bool: ... +def isframe(object: object) -> bool: ... +def iscode(object: object) -> bool: ... +def isbuiltin(object: object) -> bool: ... +def isroutine(object: object) -> bool: ... +def isabstract(object: object) -> bool: ... +def ismethoddescriptor(object: object) -> bool: ... +def isdatadescriptor(object: object) -> bool: ... +def isgetsetdescriptor(object: object) -> bool: ... +def ismemberdescriptor(object: object) -> bool: ... + + +# +# Retrieving source code +# +_SourceObjectType = Union[ModuleType, Type[Any], MethodType, FunctionType, TracebackType, FrameType, CodeType, Callable[..., Any]] + +def findsource(object: _SourceObjectType) -> Tuple[List[str], int]: ... +def getabsfile(object: _SourceObjectType) -> str: ... +def getblock(lines: Sequence[str]) -> Sequence[str]: ... +def getdoc(object: object) -> Optional[str]: ... +def getcomments(object: object) -> Optional[str]: ... +def getfile(object: _SourceObjectType) -> str: ... +def getmodule(object: object) -> Optional[ModuleType]: ... +def getsourcefile(object: _SourceObjectType) -> Optional[str]: ... +def getsourcelines(object: _SourceObjectType) -> Tuple[List[str], int]: ... +def getsource(object: _SourceObjectType) -> str: ... +def cleandoc(doc: str) -> str: ... +def indentsize(line: str) -> int: ... + + +# +# Introspecting callables with the Signature object +# +def signature(callable: Callable[..., Any], + *, + follow_wrapped: bool = ...) -> Signature: ... + +class Signature: + def __init__(self, + parameters: Optional[Sequence[Parameter]] = ..., + *, + return_annotation: Any = ...) -> None: ... + # TODO: can we be more specific here? + empty: object = ... + + parameters: Mapping[str, Parameter] + + # TODO: can we be more specific here? + return_annotation: Any + + def bind(self, *args: Any, **kwargs: Any) -> BoundArguments: ... + def bind_partial(self, *args: Any, **kwargs: Any) -> BoundArguments: ... + def replace(self, + *, + parameters: Optional[Sequence[Parameter]] = ..., + return_annotation: Any = ...) -> Signature: ... + + @classmethod + def from_callable(cls, obj: Callable[..., Any], *, follow_wrapped: bool = ...) -> Signature: ... + +# The name is the same as the enum's name in CPython +class _ParameterKind: ... + +class Parameter: + def __init__(self, + name: str, + kind: _ParameterKind, + *, + default: Any = ..., + annotation: Any = ...) -> None: ... + empty: Any = ... + name: str + default: Any + annotation: Any + + kind: _ParameterKind + POSITIONAL_ONLY: _ParameterKind = ... + POSITIONAL_OR_KEYWORD: _ParameterKind = ... + VAR_POSITIONAL: _ParameterKind = ... + KEYWORD_ONLY: _ParameterKind = ... + VAR_KEYWORD: _ParameterKind = ... + + def replace(self, + *, + name: Optional[str] = ..., + kind: Optional[_ParameterKind] = ..., + default: Any = ..., + annotation: Any = ...) -> Parameter: ... + +class BoundArguments: + arguments: OrderedDict[str, Any] + args: Tuple[Any, ...] + kwargs: Dict[str, Any] + signature: Signature + + def apply_defaults(self) -> None: ... + + +# +# Classes and functions +# + +# TODO: The actual return type should be List[_ClassTreeItem] but mypy doesn't +# seem to be supporting this at the moment: +# _ClassTreeItem = Union[List[_ClassTreeItem], Tuple[type, Tuple[type, ...]]] +def getclasstree(classes: List[type], unique: bool = ...) -> Any: ... + +class ArgSpec(NamedTuple): + args: List[str] + varargs: str + keywords: str + defaults: Tuple[Any, ...] + +class Arguments(NamedTuple): + args: List[str] + varargs: Optional[str] + varkw: Optional[str] + +def getargs(co: CodeType) -> Arguments: ... +def getargspec(func: object) -> ArgSpec: ... + +class FullArgSpec(NamedTuple): + args: List[str] + varargs: Optional[str] + varkw: Optional[str] + defaults: Optional[Tuple[Any, ...]] + kwonlyargs: List[str] + kwonlydefaults: Optional[Dict[str, Any]] + annotations: Dict[str, Any] + +def getfullargspec(func: object) -> FullArgSpec: ... + +class ArgInfo(NamedTuple): + args: List[str] + varargs: Optional[str] + keywords: Optional[str] + locals: Dict[str, Any] + +def getargvalues(frame: FrameType) -> ArgInfo: ... +def formatannotation(annotation: object, base_module: Optional[str] = ...) -> str: ... +def formatannotationrelativeto(object: object) -> Callable[[object], str]: ... +def formatargspec(args: List[str], + varargs: Optional[str] = ..., + varkw: Optional[str] = ..., + defaults: Optional[Tuple[Any, ...]] = ..., + kwonlyargs: Optional[List[str]] = ..., + kwonlydefaults: Optional[Dict[str, Any]] = ..., + annotations: Dict[str, Any] = ..., + formatarg: Callable[[str], str] = ..., + formatvarargs: Callable[[str], str] = ..., + formatvarkw: Callable[[str], str] = ..., + formatvalue: Callable[[Any], str] = ..., + formatreturns: Callable[[Any], str] = ..., + formatannotations: Callable[[Any], str] = ..., + ) -> str: ... +def formatargvalues(args: List[str], + varargs: Optional[str] = ..., + varkw: Optional[str] = ..., + locals: Optional[Dict[str, Any]] = ..., + formatarg: Optional[Callable[[str], str]] = ..., + formatvarargs: Optional[Callable[[str], str]] = ..., + formatvarkw: Optional[Callable[[str], str]] = ..., + formatvalue: Optional[Callable[[Any], str]] = ..., + ) -> str: ... +def getmro(cls: type) -> Tuple[type, ...]: ... + +def getcallargs(func: Callable[..., Any], + *args: Any, + **kwds: Any) -> Dict[str, Any]: ... + +class ClosureVars(NamedTuple): + nonlocals: Mapping[str, Any] + globals: Mapping[str, Any] + builtins: Mapping[str, Any] + unbound: AbstractSet[str] +def getclosurevars(func: Callable[..., Any]) -> ClosureVars: ... + +def unwrap(func: Callable[..., Any], + *, + stop: Optional[Callable[[Any], Any]] = ...) -> Any: ... + + +# +# The interpreter stack +# + +class Traceback(NamedTuple): + filename: str + lineno: int + function: str + code_context: Optional[List[str]] + index: Optional[int] # type: ignore + +class FrameInfo(NamedTuple): + frame: FrameType + filename: str + lineno: int + function: str + code_context: Optional[List[str]] + index: Optional[int] # type: ignore + +def getframeinfo(frame: Union[FrameType, TracebackType], context: int = ...) -> Traceback: ... +def getouterframes(frame: Any, context: int = ...) -> List[FrameInfo]: ... +def getinnerframes(traceback: TracebackType, context: int = ...) -> List[FrameInfo]: ... +def getlineno(frame: FrameType) -> int: ... +def currentframe() -> Optional[FrameType]: ... +def stack(context: int = ...) -> List[FrameInfo]: ... +def trace(context: int = ...) -> List[FrameInfo]: ... + +# +# Fetching attributes statically +# + +def getattr_static(obj: object, attr: str, default: Optional[Any] = ...) -> Any: ... + + +# +# Current State of Generators and Coroutines +# + +# TODO In the next two blocks of code, can we be more specific regarding the +# type of the "enums"? + +GEN_CREATED: str +GEN_RUNNING: str +GEN_SUSPENDED: str +GEN_CLOSED: str +def getgeneratorstate(generator: Generator[Any, Any, Any]) -> str: ... + +CORO_CREATED: str +CORO_RUNNING: str +CORO_SUSPENDED: str +CORO_CLOSED: str +# TODO can we be more specific than "object"? +def getcoroutinestate(coroutine: object) -> str: ... + +def getgeneratorlocals(generator: Generator[Any, Any, Any]) -> Dict[str, Any]: ... + +# TODO can we be more specific than "object"? +def getcoroutinelocals(coroutine: object) -> Dict[str, Any]: ... + +class Attribute(NamedTuple): + name: str + kind: str + defining_class: type + object: object + +def classify_class_attrs(cls: type) -> List[Attribute]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/io.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/io.pyi new file mode 100644 index 00000000..d835219d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/io.pyi @@ -0,0 +1,211 @@ +from typing import ( + List, BinaryIO, TextIO, Iterator, Union, Optional, Callable, Tuple, Type, Any, IO, Iterable +) +import builtins +import codecs +from mmap import mmap +from types import TracebackType +from typing import TypeVar + +_bytearray_like = Union[bytearray, mmap] + +DEFAULT_BUFFER_SIZE: int + +SEEK_SET: int +SEEK_CUR: int +SEEK_END: int + +_T = TypeVar('_T', bound=IOBase) + +open = builtins.open + +BlockingIOError = builtins.BlockingIOError +class UnsupportedOperation(OSError, ValueError): ... + +class IOBase: + def __iter__(self) -> Iterator[bytes]: ... + def __next__(self) -> bytes: ... + def __enter__(self: _T) -> _T: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> Optional[bool]: ... + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def readable(self) -> bool: ... + def readlines(self, hint: int = ...) -> List[bytes]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + def writelines(self, lines: Iterable[Union[bytes, bytearray]]) -> None: ... + def readline(self, size: int = ...) -> bytes: ... + def __del__(self) -> None: ... + @property + def closed(self) -> bool: ... + def _checkClosed(self, msg: Optional[str] = ...) -> None: ... # undocumented + +class RawIOBase(IOBase): + def readall(self) -> bytes: ... + def readinto(self, b: bytearray) -> Optional[int]: ... + def write(self, b: Union[bytes, bytearray]) -> Optional[int]: ... + def read(self, size: int = ...) -> Optional[bytes]: ... + +class BufferedIOBase(IOBase): + raw: RawIOBase # This is not part of the BufferedIOBase API and may not exist on some implementations. + def detach(self) -> RawIOBase: ... + def readinto(self, b: _bytearray_like) -> int: ... + def write(self, b: Union[bytes, bytearray]) -> int: ... + def readinto1(self, b: _bytearray_like) -> int: ... + def read(self, size: Optional[int] = ...) -> bytes: ... + def read1(self, size: int = ...) -> bytes: ... + + +class FileIO(RawIOBase): + mode: str + name: Union[int, str] + def __init__( + self, + file: Union[str, bytes, int], + mode: str = ..., + closefd: bool = ..., + opener: Optional[Callable[[Union[int, str], str], int]] = ... + ) -> None: ... + +# TODO should extend from BufferedIOBase +class BytesIO(BinaryIO): + def __init__(self, initial_bytes: bytes = ...) -> None: ... + # BytesIO does not contain a "name" field. This workaround is necessary + # to allow BytesIO sub-classes to add this field, as it is defined + # as a read-only property on IO[]. + name: Any + def getvalue(self) -> bytes: ... + def getbuffer(self) -> memoryview: ... + # copied from IOBase + def __iter__(self) -> Iterator[bytes]: ... + def __next__(self) -> bytes: ... + def __enter__(self) -> BytesIO: ... + def __exit__(self, t: Optional[Type[BaseException]] = ..., value: Optional[BaseException] = ..., + traceback: Optional[TracebackType] = ...) -> Optional[bool]: ... + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def readable(self) -> bool: ... + def readlines(self, hint: int = ...) -> List[bytes]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + # TODO should be the next line instead + # def writelines(self, lines: List[Union[bytes, bytearray]]) -> None: ... + def writelines(self, lines: Any) -> None: ... + def readline(self, size: int = ...) -> bytes: ... + def __del__(self) -> None: ... + closed: bool + # copied from BufferedIOBase + def detach(self) -> RawIOBase: ... + def readinto(self, b: _bytearray_like) -> int: ... + def write(self, b: Union[bytes, bytearray]) -> int: ... + def readinto1(self, b: _bytearray_like) -> int: ... + def read(self, size: Optional[int] = ...) -> bytes: ... + def read1(self, size: int = ...) -> bytes: ... + +class BufferedReader(BufferedIOBase): + def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... + def peek(self, size: int = ...) -> bytes: ... + +class BufferedWriter(BufferedIOBase): + def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... + def flush(self) -> None: ... + def write(self, b: Union[bytes, bytearray]) -> int: ... + +class BufferedRandom(BufferedReader, BufferedWriter): + def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + +class BufferedRWPair(BufferedIOBase): + def __init__(self, reader: RawIOBase, writer: RawIOBase, + buffer_size: int = ...) -> None: ... + + +class TextIOBase(IOBase): + encoding: str + errors: Optional[str] + newlines: Union[str, Tuple[str, ...], None] + def __iter__(self) -> Iterator[str]: ... # type: ignore + def __next__(self) -> str: ... # type: ignore + def detach(self) -> IOBase: ... + def write(self, s: str) -> int: ... + def writelines(self, lines: List[str]) -> None: ... # type: ignore + def readline(self, size: int = ...) -> str: ... # type: ignore + def readlines(self, hint: int = ...) -> List[str]: ... # type: ignore + def read(self, size: Optional[int] = ...) -> str: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + +# TODO should extend from TextIOBase +class TextIOWrapper(TextIO): + line_buffering: bool + # TODO uncomment after fixing mypy about using write_through + # def __init__(self, buffer: IO[bytes], encoding: str = ..., + # errors: Optional[str] = ..., newline: Optional[str] = ..., + # line_buffering: bool = ..., write_through: bool = ...) \ + # -> None: ... + def __init__( + self, + buffer: IO[bytes], + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., + line_buffering: bool = ..., + write_through: bool = ... + ) -> None: ... + # copied from IOBase + def __exit__(self, t: Optional[Type[BaseException]] = ..., value: Optional[BaseException] = ..., + traceback: Optional[TracebackType] = ...) -> Optional[bool]: ... + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def readable(self) -> bool: ... + def readlines(self, hint: int = ...) -> List[str]: ... + def seekable(self) -> bool: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + # TODO should be the next line instead + # def writelines(self, lines: List[str]) -> None: ... + def writelines(self, lines: Any) -> None: ... + def __del__(self) -> None: ... + closed: bool + # copied from TextIOBase + encoding: str + errors: Optional[str] + newlines: Union[str, Tuple[str, ...], None] + def __iter__(self) -> Iterator[str]: ... + def __next__(self) -> str: ... + def __enter__(self) -> TextIO: ... + def detach(self) -> IOBase: ... + def write(self, s: str) -> int: ... + def readline(self, size: int = ...) -> str: ... + def read(self, size: Optional[int] = ...) -> str: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + +class StringIO(TextIOWrapper): + def __init__(self, initial_value: str = ..., + newline: Optional[str] = ...) -> None: ... + # StringIO does not contain a "name" field. This workaround is necessary + # to allow StringIO sub-classes to add this field, as it is defined + # as a read-only property on IO[]. + name: Any + def getvalue(self) -> str: ... + def __enter__(self) -> StringIO: ... + +class IncrementalNewlineDecoder(codecs.IncrementalDecoder): + def __init__(self, decoder: Optional[codecs.IncrementalDecoder], + translate: bool, errors: str = ...) -> None: ... + def decode(self, input: Union[bytes, str], final: bool = ...) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/ipaddress.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/ipaddress.pyi new file mode 100644 index 00000000..6b6a45d1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/ipaddress.pyi @@ -0,0 +1,149 @@ +from typing import (Any, Container, Generic, Iterable, Iterator, Optional, + overload, SupportsInt, Text, Tuple, TypeVar) + +# Undocumented length constants +IPV4LENGTH: int +IPV6LENGTH: int + +_A = TypeVar("_A", IPv4Address, IPv6Address) +_N = TypeVar("_N", IPv4Network, IPv6Network) +_T = TypeVar("_T") + +def ip_address(address: object) -> Any: ... # morally Union[IPv4Address, IPv6Address] +def ip_network(address: object, strict: bool = ...) -> Any: ... # morally Union[IPv4Network, IPv6Network] +def ip_interface(address: object) -> Any: ... # morally Union[IPv4Interface, IPv6Interface] + +class _IPAddressBase: + def __eq__(self, other: Any) -> bool: ... + def __ge__(self: _T, other: _T) -> bool: ... + def __gt__(self: _T, other: _T) -> bool: ... + def __le__(self: _T, other: _T) -> bool: ... + def __lt__(self: _T, other: _T) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + @property + def compressed(self) -> Text: ... + @property + def exploded(self) -> Text: ... + @property + def reverse_pointer(self) -> Text: ... + @property + def version(self) -> int: ... + +class _BaseAddress(_IPAddressBase, SupportsInt): + def __init__(self, address: object) -> None: ... + def __add__(self: _T, other: int) -> _T: ... + def __hash__(self) -> int: ... + def __int__(self) -> int: ... + def __sub__(self: _T, other: int) -> _T: ... + @property + def is_global(self) -> bool: ... + @property + def is_link_local(self) -> bool: ... + @property + def is_loopback(self) -> bool: ... + @property + def is_multicast(self) -> bool: ... + @property + def is_private(self) -> bool: ... + @property + def is_reserved(self) -> bool: ... + @property + def is_unspecified(self) -> bool: ... + @property + def max_prefixlen(self) -> int: ... + @property + def packed(self) -> bytes: ... + +class _BaseNetwork(_IPAddressBase, Container[_A], Iterable[_A], Generic[_A]): + network_address: _A + netmask: _A + def __init__(self, address: object, strict: bool = ...) -> None: ... + def __contains__(self, other: Any) -> bool: ... + def __getitem__(self, n: int) -> _A: ... + def __iter__(self) -> Iterator[_A]: ... + def address_exclude(self: _T, other: _T) -> Iterator[_T]: ... + @property + def broadcast_address(self) -> _A: ... + def compare_networks(self: _T, other: _T) -> int: ... + def hosts(self) -> Iterator[_A]: ... + @property + def is_global(self) -> bool: ... + @property + def is_link_local(self) -> bool: ... + @property + def is_loopback(self) -> bool: ... + @property + def is_multicast(self) -> bool: ... + @property + def is_private(self) -> bool: ... + @property + def is_reserved(self) -> bool: ... + @property + def is_unspecified(self) -> bool: ... + @property + def max_prefixlen(self) -> int: ... + @property + def num_addresses(self) -> int: ... + def overlaps(self: _T, other: _T) -> bool: ... + @property + def prefixlen(self) -> int: ... + def subnets(self: _T, prefixlen_diff: int = ..., new_prefix: Optional[int] = ...) -> Iterator[_T]: ... + def supernet(self: _T, prefixlen_diff: int = ..., new_prefix: Optional[int] = ...) -> _T: ... + @property + def with_hostmask(self) -> Text: ... + @property + def with_netmask(self) -> Text: ... + @property + def with_prefixlen(self) -> Text: ... + @property + def hostmask(self) -> _A: ... + +class _BaseInterface(_BaseAddress, Generic[_A, _N]): + hostmask: _A + netmask: _A + network: _N + @property + def ip(self) -> _A: ... + @property + def with_hostmask(self) -> Text: ... + @property + def with_netmask(self) -> Text: ... + @property + def with_prefixlen(self) -> Text: ... + +class IPv4Address(_BaseAddress): ... +class IPv4Network(_BaseNetwork[IPv4Address]): ... +class IPv4Interface(IPv4Address, _BaseInterface[IPv4Address, IPv4Network]): ... + +class IPv6Address(_BaseAddress): + @property + def ipv4_mapped(self) -> Optional[IPv4Address]: ... + @property + def is_site_local(self) -> bool: ... + @property + def sixtofour(self) -> Optional[IPv4Address]: ... + @property + def teredo(self) -> Optional[Tuple[IPv4Address, IPv4Address]]: ... + +class IPv6Network(_BaseNetwork[IPv6Address]): + @property + def is_site_local(self) -> bool: ... + +class IPv6Interface(IPv6Address, _BaseInterface[IPv6Address, IPv6Network]): ... + +def v4_int_to_packed(address: int) -> bytes: ... +def v6_int_to_packed(address: int) -> bytes: ... +@overload +def summarize_address_range(first: IPv4Address, last: IPv4Address) -> Iterator[IPv4Network]: ... +@overload +def summarize_address_range(first: IPv6Address, last: IPv6Address) -> Iterator[IPv6Network]: ... +def collapse_addresses(addresses: Iterable[_N]) -> Iterator[_N]: ... +@overload +def get_mixed_type_key(obj: _A) -> Tuple[int, _A]: ... +@overload +def get_mixed_type_key(obj: IPv4Network) -> Tuple[int, IPv4Address, IPv4Address]: ... +@overload +def get_mixed_type_key(obj: IPv6Network) -> Tuple[int, IPv6Address, IPv6Address]: ... + +class AddressValueError(ValueError): ... +class NetmaskValueError(ValueError): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/itertools.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/itertools.pyi new file mode 100644 index 00000000..78149e2f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/itertools.pyi @@ -0,0 +1,117 @@ +# Stubs for itertools + +# Based on http://docs.python.org/3.2/library/itertools.html + +from typing import (Iterator, TypeVar, Iterable, overload, Any, Callable, Tuple, + Generic, Optional) +import sys + +_T = TypeVar('_T') +_S = TypeVar('_S') +_N = TypeVar('_N', int, float) +Predicate = Callable[[_T], object] + +def count(start: _N = ..., + step: _N = ...) -> Iterator[_N]: ... # more general types? +def cycle(iterable: Iterable[_T]) -> Iterator[_T]: ... + +@overload +def repeat(object: _T) -> Iterator[_T]: ... +@overload +def repeat(object: _T, times: int) -> Iterator[_T]: ... + +if sys.version_info >= (3, 8): + @overload + def accumulate(iterable: Iterable[_T], + func: Callable[[_T, _T], _T] = ...) -> Iterator[_T]: ... + @overload + def accumulate(iterable: Iterable[_T], + func: Callable[[_S, _T], _S], + initial: Optional[_S]) -> Iterator[_S]: ... +else: + def accumulate(iterable: Iterable[_T], + func: Callable[[_T, _T], _T] = ...) -> Iterator[_T]: ... + +class chain(Iterator[_T], Generic[_T]): + def __init__(self, *iterables: Iterable[_T]) -> None: ... + def __next__(self) -> _T: ... + def __iter__(self) -> Iterator[_T]: ... + @staticmethod + def from_iterable(iterable: Iterable[Iterable[_S]]) -> Iterator[_S]: ... + +def compress(data: Iterable[_T], selectors: Iterable[Any]) -> Iterator[_T]: ... +def dropwhile(predicate: Predicate[_T], + iterable: Iterable[_T]) -> Iterator[_T]: ... +def filterfalse(predicate: Optional[Predicate[_T]], + iterable: Iterable[_T]) -> Iterator[_T]: ... + +@overload +def groupby(iterable: Iterable[_T], key: None = ...) -> Iterator[Tuple[_T, Iterator[_T]]]: ... +@overload +def groupby(iterable: Iterable[_T], key: Callable[[_T], _S]) -> Iterator[Tuple[_S, Iterator[_T]]]: ... + +@overload +def islice(iterable: Iterable[_T], stop: Optional[int]) -> Iterator[_T]: ... +@overload +def islice(iterable: Iterable[_T], start: Optional[int], stop: Optional[int], + step: Optional[int] = ...) -> Iterator[_T]: ... + +def starmap(func: Callable[..., _S], iterable: Iterable[Iterable[Any]]) -> Iterator[_S]: ... +def takewhile(predicate: Predicate[_T], + iterable: Iterable[_T]) -> Iterator[_T]: ... +def tee(iterable: Iterable[_T], n: int = ...) -> Tuple[Iterator[_T], ...]: ... +def zip_longest(*p: Iterable[Any], + fillvalue: Any = ...) -> Iterator[Any]: ... + +_T1 = TypeVar('_T1') +_T2 = TypeVar('_T2') +_T3 = TypeVar('_T3') +_T4 = TypeVar('_T4') +_T5 = TypeVar('_T5') +_T6 = TypeVar('_T6') + +@overload +def product(iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4], + iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ... +@overload +def product(iter1: Iterable[_T1], + iter2: Iterable[_T2], + iter3: Iterable[_T3], + iter4: Iterable[_T4], + iter5: Iterable[_T5], + iter6: Iterable[_T6]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ... +@overload +def product(iter1: Iterable[Any], + iter2: Iterable[Any], + iter3: Iterable[Any], + iter4: Iterable[Any], + iter5: Iterable[Any], + iter6: Iterable[Any], + iter7: Iterable[Any], + *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ... +@overload +def product(*iterables: Iterable[Any], repeat: int = ...) -> Iterator[Tuple[Any, ...]]: ... + +def permutations(iterable: Iterable[_T], + r: Optional[int] = ...) -> Iterator[Tuple[_T, ...]]: ... +def combinations(iterable: Iterable[_T], + r: int) -> Iterator[Tuple[_T, ...]]: ... +def combinations_with_replacement(iterable: Iterable[_T], + r: int) -> Iterator[Tuple[_T, ...]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/json/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/json/__init__.pyi new file mode 100644 index 00000000..2f6374e3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/json/__init__.pyi @@ -0,0 +1,57 @@ +import sys +from typing import Any, IO, Optional, Tuple, Callable, Dict, List, Union, Protocol, Type + +from .decoder import JSONDecoder as JSONDecoder +from .encoder import JSONEncoder as JSONEncoder +from .decoder import JSONDecodeError as JSONDecodeError + +def dumps(obj: Any, + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + cls: Optional[Type[JSONEncoder]] = ..., + indent: Union[None, int, str] = ..., + separators: Optional[Tuple[str, str]] = ..., + default: Optional[Callable[[Any], Any]] = ..., + sort_keys: bool = ..., + **kwds: Any) -> str: ... + +def dump(obj: Any, + fp: IO[str], + skipkeys: bool = ..., + ensure_ascii: bool = ..., + check_circular: bool = ..., + allow_nan: bool = ..., + cls: Optional[Type[JSONEncoder]] = ..., + indent: Union[None, int, str] = ..., + separators: Optional[Tuple[str, str]] = ..., + default: Optional[Callable[[Any], Any]] = ..., + sort_keys: bool = ..., + **kwds: Any) -> None: ... + +if sys.version_info >= (3, 6): + _LoadsString = Union[str, bytes, bytearray] +else: + _LoadsString = str +def loads(s: _LoadsString, + encoding: Any = ..., # ignored and deprecated + cls: Optional[Type[JSONDecoder]] = ..., + object_hook: Optional[Callable[[Dict[Any, Any]], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., + **kwds: Any) -> Any: ... + +class _Reader(Protocol): + def read(self) -> _LoadsString: ... + +def load(fp: _Reader, + cls: Optional[Type[JSONDecoder]] = ..., + object_hook: Optional[Callable[[Dict[Any, Any]], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ..., + **kwds: Any) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/json/decoder.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/json/decoder.pyi new file mode 100644 index 00000000..d57a6a9f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/json/decoder.pyi @@ -0,0 +1,26 @@ +from typing import Any, Callable, Dict, List, Optional, Tuple + +class JSONDecodeError(ValueError): + msg: str + doc: str + pos: int + lineno: int + colno: int + def __init__(self, msg: str, doc: str, pos: int) -> None: ... + +class JSONDecoder: + object_hook: Callable[[Dict[str, Any]], Any] + parse_float: Callable[[str], Any] + parse_int: Callable[[str], Any] + parse_constant = ... # Callable[[str], Any] + strict: bool + object_pairs_hook: Callable[[List[Tuple[str, Any]]], Any] + + def __init__(self, object_hook: Optional[Callable[[Dict[str, Any]], Any]] = ..., + parse_float: Optional[Callable[[str], Any]] = ..., + parse_int: Optional[Callable[[str], Any]] = ..., + parse_constant: Optional[Callable[[str], Any]] = ..., + strict: bool = ..., + object_pairs_hook: Optional[Callable[[List[Tuple[str, Any]]], Any]] = ...) -> None: ... + def decode(self, s: str) -> Any: ... + def raw_decode(self, s: str, idx: int = ...) -> Tuple[Any, int]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/json/encoder.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/json/encoder.pyi new file mode 100644 index 00000000..63f5ffeb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/json/encoder.pyi @@ -0,0 +1,21 @@ +from typing import Any, Callable, Iterator, Optional, Tuple + +class JSONEncoder: + item_separator: str + key_separator: str + + skipkeys: bool + ensure_ascii: bool + check_circular: bool + allow_nan: bool + sort_keys: bool + indent: int + + def __init__(self, skipkeys: bool = ..., ensure_ascii: bool = ..., + check_circular: bool = ..., allow_nan: bool = ..., sort_keys: bool = ..., + indent: Optional[int] = ..., separators: Optional[Tuple[str, str]] = ..., + default: Optional[Callable[..., Any]] = ...) -> None: ... + + def default(self, o: Any) -> Any: ... + def encode(self, o: Any) -> str: ... + def iterencode(self, o: Any, _one_shot: bool = ...) -> Iterator[str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/lzma.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/lzma.pyi new file mode 100644 index 00000000..37009c81 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/lzma.pyi @@ -0,0 +1,106 @@ +import io +import sys +from typing import Any, IO, Mapping, Optional, Sequence, Union + +if sys.version_info >= (3, 6): + from os import PathLike + _PathOrFile = Union[str, bytes, IO[Any], PathLike[Any]] +else: + _PathOrFile = Union[str, bytes, IO[Any]] + +_FilterChain = Sequence[Mapping[str, Any]] + +FORMAT_AUTO: int +FORMAT_XZ: int +FORMAT_ALONE: int +FORMAT_RAW: int +CHECK_NONE: int +CHECK_CRC32: int +CHECK_CRC64: int +CHECK_SHA256: int +CHECK_ID_MAX: int +CHECK_UNKNOWN: int +FILTER_LZMA1: int +FILTER_LZMA2: int +FILTER_DELTA: int +FILTER_X86: int +FILTER_IA64: int +FILTER_ARM: int +FILTER_ARMTHUMB: int +FILTER_SPARC: int +FILTER_POWERPC: int +MF_HC3: int +MF_HC4: int +MF_BT2: int +MF_BT3: int +MF_BT4: int +MODE_FAST: int +MODE_NORMAL: int +PRESET_DEFAULT: int +PRESET_EXTREME: int + +# from _lzma.c +class LZMADecompressor(object): + def __init__(self, format: Optional[int] = ..., memlimit: Optional[int] = ..., filters: Optional[_FilterChain] = ...) -> None: ... + def decompress(self, data: bytes, max_length: int = ...) -> bytes: ... + @property + def check(self) -> int: ... + @property + def eof(self) -> bool: ... + @property + def unused_data(self) -> bytes: ... + @property + def needs_input(self) -> bool: ... + +# from _lzma.c +class LZMACompressor(object): + def __init__(self, + format: Optional[int] = ..., + check: int = ..., + preset: Optional[int] = ..., + filters: Optional[_FilterChain] = ...) -> None: ... + def compress(self, data: bytes) -> bytes: ... + def flush(self) -> bytes: ... + + +class LZMAError(Exception): ... + + +class LZMAFile(io.BufferedIOBase, IO[bytes]): # type: ignore # python/mypy#5027 + def __init__(self, + filename: Optional[_PathOrFile] = ..., + mode: str = ..., + *, + format: Optional[int] = ..., + check: int = ..., + preset: Optional[int] = ..., + filters: Optional[_FilterChain] = ...) -> None: ... + def close(self) -> None: ... + @property + def closed(self) -> bool: ... + def fileno(self) -> int: ... + def seekable(self) -> bool: ... + def readable(self) -> bool: ... + def writable(self) -> bool: ... + def peek(self, size: int = ...) -> bytes: ... + def read(self, size: Optional[int] = ...) -> bytes: ... + def read1(self, size: int = ...) -> bytes: ... + def readline(self, size: int = ...) -> bytes: ... + def write(self, data: bytes) -> int: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def tell(self) -> int: ... + + +def open(filename: _PathOrFile, + mode: str = ..., + *, + format: Optional[int] = ..., + check: int = ..., + preset: Optional[int] = ..., + filters: Optional[_FilterChain] = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ...) -> IO[Any]: ... +def compress(data: bytes, format: int = ..., check: int = ..., preset: Optional[int] = ..., filters: Optional[_FilterChain] = ...) -> bytes: ... +def decompress(data: bytes, format: int = ..., memlimit: Optional[int] = ..., filters: Optional[_FilterChain] = ...) -> bytes: ... +def is_check_supported(check: int) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/msvcrt.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/msvcrt.pyi new file mode 100644 index 00000000..6688c37c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/msvcrt.pyi @@ -0,0 +1,6 @@ +# Stubs for msvcrt + +# NOTE: These are incomplete! + +def get_osfhandle(file: int) -> int: ... +def open_osfhandle(handle: int, flags: int) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/__init__.pyi new file mode 100644 index 00000000..f797b548 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/__init__.pyi @@ -0,0 +1,84 @@ +# Stubs for multiprocessing + +import sys +from typing import Any, Callable, Iterable, Mapping, Optional, List, Union, Sequence, Tuple, Type, overload + +from ctypes import _CData +from logging import Logger +from multiprocessing import connection, pool, spawn, synchronize +from multiprocessing.context import ( + AuthenticationError as AuthenticationError, + BaseContext, + BufferTooShort as BufferTooShort, + Process as Process, + ProcessError as ProcessError, + TimeoutError as TimeoutError, +) +from multiprocessing.managers import SyncManager +from multiprocessing.process import active_children as active_children, current_process as current_process +from multiprocessing.queues import Queue as Queue, SimpleQueue as SimpleQueue, JoinableQueue as JoinableQueue +from multiprocessing.spawn import freeze_support as freeze_support +from multiprocessing.spawn import set_executable as set_executable + +if sys.version_info >= (3, 8): + from multiprocessing.process import parent_process as parent_process + +# N.B. The functions below are generated at runtime by partially applying +# multiprocessing.context.BaseContext's methods, so the two signatures should +# be identical (modulo self). + +# Sychronization primitives +_LockLike = Union[synchronize.Lock, synchronize.RLock] +def Barrier(parties: int, + action: Optional[Callable[..., Any]] = ..., + timeout: Optional[float] = ...) -> synchronize.Barrier: ... +def BoundedSemaphore(value: int = ...) -> synchronize.BoundedSemaphore: ... +def Condition(lock: Optional[_LockLike] = ...) -> synchronize.Condition: ... +def Event(lock: Optional[_LockLike] = ...) -> synchronize.Event: ... +def Lock() -> synchronize.Lock: ... +def RLock() -> synchronize.RLock: ... +def Semaphore(value: int = ...) -> synchronize.Semaphore: ... + +def Pipe(duplex: bool = ...) -> Tuple[connection.Connection, connection.Connection]: ... + +def Pool(processes: Optional[int] = ..., + initializer: Optional[Callable[..., Any]] = ..., + initargs: Iterable[Any] = ..., + maxtasksperchild: Optional[int] = ...) -> pool.Pool: ... + +class Array(): + value: Any = ... + + def __init__(self, typecode_or_type: Union[str, Type[_CData]], size_or_initializer: Union[int, Sequence[Any]], *, lock: Union[bool, _LockLike] = ...) -> None: ... + def acquire(self) -> bool: ... + def release(self) -> bool: ... + def get_lock(self) -> _LockLike: ... + def get_obj(self) -> Any: ... + + @overload + def __getitem__(self, key: int) -> Any: ... + @overload + def __getitem__(self, key: slice) -> List[Any]: ... + def __getslice__(self, start: int, stop: int) -> Any: ... + def __setitem__(self, key: int, value: Any) -> None: ... + + +class Value(): + value: Any = ... + def __init__(self, typecode_or_type: Union[str, Type[_CData]], *args: Any, lock: Union[bool, _LockLike] = ...) -> None: ... + def get_lock(self) -> _LockLike: ... + def get_obj(self) -> Any: ... + def acquire(self) -> bool: ... + def release(self) -> bool: ... + +# ----- multiprocessing function stubs ----- +def allow_connection_pickling() -> None: ... +def cpu_count() -> int: ... +def get_logger() -> Logger: ... +def log_to_stderr(level: Optional[Union[str, int]] = ...) -> Logger: ... +def Manager() -> SyncManager: ... +def set_forkserver_preload(module_names: List[str]) -> None: ... +def get_all_start_methods() -> List[str]: ... +def get_context(method: Optional[str] = ...) -> BaseContext: ... +def get_start_method(allow_none: bool = ...) -> Optional[str]: ... +def set_start_method(method: str, force: Optional[bool] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/connection.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/connection.pyi new file mode 100644 index 00000000..76bdca01 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/connection.pyi @@ -0,0 +1,48 @@ +from typing import Any, Iterable, List, Optional, Tuple, Type, Union +import socket +import sys +import types + +# https://docs.python.org/3/library/multiprocessing.html#address-formats +_Address = Union[str, Tuple[str, int]] + +class _ConnectionBase: + @property + def closed(self) -> bool: ... # undocumented + @property + def readable(self) -> bool: ... # undocumented + @property + def writable(self) -> bool: ... # undocumented + def fileno(self) -> int: ... + def close(self) -> None: ... + def send_bytes(self, + buf: bytes, + offset: int = ..., + size: Optional[int] = ...) -> None: ... + def send(self, obj: Any) -> None: ... + def recv_bytes(self, maxlength: Optional[int] = ...) -> bytes: ... + def recv_bytes_into(self, buf: Any, offset: int = ...) -> int: ... + def recv(self) -> Any: ... + def poll(self, timeout: Optional[float] = ...) -> bool: ... + +class Connection(_ConnectionBase): ... + +if sys.platform == "win32": + class PipeConnection(_ConnectionBase): ... + +class Listener: + def __init__(self, address: Optional[_Address] = ..., family: Optional[str] = ..., backlog: int = ..., authkey: Optional[bytes] = ...) -> None: ... + def accept(self) -> Connection: ... + def close(self) -> None: ... + @property + def address(self) -> _Address: ... + @property + def last_accepted(self) -> Optional[_Address]: ... + def __enter__(self) -> Listener: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_value: Optional[BaseException], exc_tb: Optional[types.TracebackType]) -> None: ... + +def deliver_challenge(connection: Connection, authkey: bytes) -> None: ... +def answer_challenge(connection: Connection, authkey: bytes) -> None: ... +def wait(object_list: Iterable[Union[Connection, socket.socket, int]], timeout: Optional[float] = ...) -> List[Union[Connection, socket.socket, int]]: ... +def Client(address: _Address, family: Optional[str] = ..., authkey: Optional[bytes] = ...) -> Connection: ... +def Pipe(duplex: bool = ...) -> Tuple[Connection, Connection]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/context.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/context.pyi new file mode 100644 index 00000000..627c760f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/context.pyi @@ -0,0 +1,162 @@ +# Stubs for multiprocessing.context + +from logging import Logger +import multiprocessing +from multiprocessing import synchronize +from multiprocessing import queues +from multiprocessing.process import BaseProcess +import sys +from typing import Any, Callable, Iterable, Optional, List, Mapping, Sequence, Type, Union + +_LockLike = Union[synchronize.Lock, synchronize.RLock] + +class ProcessError(Exception): ... + +class BufferTooShort(ProcessError): ... + +class TimeoutError(ProcessError): ... + +class AuthenticationError(ProcessError): ... + +class BaseContext(object): + ProcessError: Type[Exception] + BufferTooShort: Type[Exception] + TimeoutError: Type[Exception] + AuthenticationError: Type[Exception] + + # N.B. The methods below are applied at runtime to generate + # multiprocessing.*, so the signatures should be identical (modulo self). + + @staticmethod + def current_process() -> BaseProcess: ... + if sys.version_info >= (3, 8): + @staticmethod + def parent_process() -> Optional[BaseProcess]: ... + @staticmethod + def active_children() -> List[BaseProcess]: ... + def cpu_count(self) -> int: ... + # TODO: change return to SyncManager once a stub exists in multiprocessing.managers + def Manager(self) -> Any: ... + # TODO: change return to Pipe once a stub exists in multiprocessing.connection + def Pipe(self, duplex: bool = ...) -> Any: ... + + def Barrier(self, + parties: int, + action: Optional[Callable[..., Any]] = ..., + timeout: Optional[float] = ...) -> synchronize.Barrier: ... + def BoundedSemaphore(self, + value: int = ...) -> synchronize.BoundedSemaphore: ... + def Condition(self, + lock: Optional[_LockLike] = ...) -> synchronize.Condition: ... + def Event(self, lock: Optional[_LockLike] = ...) -> synchronize.Event: ... + def Lock(self) -> synchronize.Lock: ... + def RLock(self) -> synchronize.RLock: ... + def Semaphore(self, value: int = ...) -> synchronize.Semaphore: ... + + def Queue(self, maxsize: int = ...) -> queues.Queue[Any]: ... + def JoinableQueue(self, maxsize: int = ...) -> queues.JoinableQueue[Any]: ... + def SimpleQueue(self) -> queues.SimpleQueue[Any]: ... + def Pool( + self, + processes: Optional[int] = ..., + initializer: Optional[Callable[..., Any]] = ..., + initargs: Iterable[Any] = ..., + maxtasksperchild: Optional[int] = ... + ) -> multiprocessing.pool.Pool: ... + # TODO: typecode_or_type param is a ctype with a base class of _SimpleCData or array.typecode Need to figure out + # how to handle the ctype + # TODO: change return to RawValue once a stub exists in multiprocessing.sharedctypes + def RawValue(self, typecode_or_type: Any, *args: Any) -> Any: ... + # TODO: typecode_or_type param is a ctype with a base class of _SimpleCData or array.typecode Need to figure out + # how to handle the ctype + # TODO: change return to RawArray once a stub exists in multiprocessing.sharedctypes + def RawArray(self, typecode_or_type: Any, size_or_initializer: Union[int, Sequence[Any]]) -> Any: ... + # TODO: typecode_or_type param is a ctype with a base class of _SimpleCData or array.typecode Need to figure out + # how to handle the ctype + # TODO: change return to Value once a stub exists in multiprocessing.sharedctypes + def Value( + self, + typecode_or_type: Any, + *args: Any, + lock: bool = ... + ) -> Any: ... + # TODO: typecode_or_type param is a ctype with a base class of _SimpleCData or array.typecode Need to figure out + # how to handle the ctype + # TODO: change return to Array once a stub exists in multiprocessing.sharedctypes + def Array( + self, + typecode_or_type: Any, + size_or_initializer: Union[int, Sequence[Any]], + *, + lock: bool = ... + ) -> Any: ... + def freeze_support(self) -> None: ... + def get_logger(self) -> Logger: ... + def log_to_stderr(self, level: Optional[str] = ...) -> Logger: ... + def allow_connection_pickling(self) -> None: ... + def set_executable(self, executable: str) -> None: ... + def set_forkserver_preload(self, module_names: List[str]) -> None: ... + def get_context(self, method: Optional[str] = ...) -> BaseContext: ... + def get_start_method(self, allow_none: bool = ...) -> str: ... + def set_start_method(self, method: Optional[str], force: bool = ...) -> None: ... + @property + def reducer(self) -> str: ... + @reducer.setter + def reducer(self, reduction: str) -> None: ... + def _check_available(self) -> None: ... + +class Process(BaseProcess): + _start_method: Optional[str] + @staticmethod + def _Popen(process_obj: BaseProcess) -> DefaultContext: ... + +class DefaultContext(BaseContext): + Process: Type[multiprocessing.Process] + + def __init__(self, context: BaseContext) -> None: ... + def get_context(self, method: Optional[str] = ...) -> BaseContext: ... + def set_start_method(self, method: Optional[str], force: bool = ...) -> None: ... + def get_start_method(self, allow_none: bool = ...) -> str: ... + def get_all_start_methods(self) -> List[str]: ... + +if sys.platform != 'win32': + class ForkProcess(BaseProcess): + _start_method: str + @staticmethod + def _Popen(process_obj: BaseProcess) -> Any: ... + + class SpawnProcess(BaseProcess): + _start_method: str + @staticmethod + def _Popen(process_obj: BaseProcess) -> SpawnProcess: ... + + class ForkServerProcess(BaseProcess): + _start_method: str + @staticmethod + def _Popen(process_obj: BaseProcess) -> Any: ... + + class ForkContext(BaseContext): + _name: str + Process: Type[ForkProcess] + + class SpawnContext(BaseContext): + _name: str + Process: Type[SpawnProcess] + + class ForkServerContext(BaseContext): + _name: str + Process: Type[ForkServerProcess] +else: + class SpawnProcess(BaseProcess): + _start_method: str + @staticmethod + def _Popen(process_obj: BaseProcess) -> Any: ... + + class SpawnContext(BaseContext): + _name: str + Process: Type[SpawnProcess] + +def _force_start_method(method: str) -> None: ... +def get_spawning_popen() -> Optional[Any]: ... +def set_spawning_popen(popen: Any) -> None: ... +def assert_spawning(obj: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/__init__.pyi new file mode 100644 index 00000000..be7ebf99 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/__init__.pyi @@ -0,0 +1,44 @@ +from typing import Any, Optional, List + +import array +import threading +import weakref + +from queue import Queue as Queue + +JoinableQueue = Queue +Barrier = threading.Barrier +BoundedSemaphore = threading.BoundedSemaphore +Condition = threading.Condition +Event = threading.Event +Lock = threading.Lock +RLock = threading.RLock +Semaphore = threading.Semaphore + +class DummyProcess(threading.Thread): + _children: weakref.WeakKeyDictionary[Any, Any] + _parent: threading.Thread + _pid: None + _start_called: int + exitcode: Optional[int] + def __init__(self, group=..., target=..., name=..., args=..., kwargs=...) -> None: ... + +Process = DummyProcess + +class Namespace(object): + def __init__(self, **kwds) -> None: ... + +class Value(object): + _typecode: Any + _value: Any + value: Any + def __init__(self, typecode, value, lock=...) -> None: ... + + +def Array(typecode, sequence, lock=...) -> array.array[Any]: ... +def Manager() -> Any: ... +def Pool(processes=..., initializer=..., initargs=...) -> Any: ... +def active_children() -> List[Any]: ... +def current_process() -> threading.Thread: ... +def freeze_support() -> None: ... +def shutdown() -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/connection.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/connection.pyi new file mode 100644 index 00000000..d465a5b4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/dummy/connection.pyi @@ -0,0 +1,35 @@ +from typing import Any, List, Optional, Tuple, TypeVar + +from queue import Queue + +families: List[None] + +_TConnection = TypeVar('_TConnection', bound=Connection) +_TListener = TypeVar('_TListener', bound=Listener) + +class Connection(object): + _in: Any + _out: Any + recv: Any + recv_bytes: Any + send: Any + send_bytes: Any + def __enter__(self: _TConnection) -> _TConnection: ... + def __exit__(self, exc_type, exc_value, exc_tb) -> None: ... + def __init__(self, _in, _out) -> None: ... + def close(self) -> None: ... + def poll(self, timeout: float = ...) -> bool: ... + +class Listener(object): + _backlog_queue: Optional[Queue[Any]] + @property + def address(self) -> Optional[Queue[Any]]: ... + def __enter__(self: _TListener) -> _TListener: ... + def __exit__(self, exc_type, exc_value, exc_tb) -> None: ... + def __init__(self, address=..., family=..., backlog=...) -> None: ... + def accept(self) -> Connection: ... + def close(self) -> None: ... + + +def Client(address) -> Connection: ... +def Pipe(duplex: bool = ...) -> Tuple[Connection, Connection]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/managers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/managers.pyi new file mode 100644 index 00000000..151ade02 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/managers.pyi @@ -0,0 +1,80 @@ +# Stubs for multiprocessing.managers + +# NOTE: These are incomplete! + +import queue +import sys +import threading +from typing import ( + Any, Callable, ContextManager, Dict, Iterable, Generic, List, Mapping, Optional, + Sequence, Tuple, TypeVar, Union, +) +from .context import BaseContext + +if sys.version_info >= (3, 8): + from .shared_memory import ShareableList, SharedMemory, _SLT + +_T = TypeVar('_T') +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') + +class Namespace: ... + +_Namespace = Namespace + +class BaseProxy: ... + +class ValueProxy(BaseProxy, Generic[_T]): + def get(self) -> _T: ... + def set(self, value: _T) -> None: ... + value: _T + +# Returned by BaseManager.get_server() +class Server: + address: Any + def serve_forever(self) -> None: ... + +class BaseManager(ContextManager[BaseManager]): + def __init__( + self, + address: Optional[Any] = ..., + authkey: Optional[bytes] = ..., + serializer: str = ..., + ctx: Optional[BaseContext] = ..., + ) -> None: ... + def get_server(self) -> Server: ... + def connect(self) -> None: ... + def start(self, initializer: Optional[Callable[..., Any]] = ..., initargs: Iterable[Any] = ...) -> None: ... + def shutdown(self) -> None: ... # only available after start() was called + def join(self, timeout: Optional[float] = ...) -> None: ... # undocumented + @property + def address(self) -> Any: ... + @classmethod + def register(cls, typeid: str, callable: Optional[Callable[..., Any]] = ..., + proxytype: Any = ..., + exposed: Optional[Sequence[str]] = ..., + method_to_typeid: Optional[Mapping[str, str]] = ..., + create_method: bool = ...) -> None: ... + +class SyncManager(BaseManager, ContextManager[SyncManager]): + def BoundedSemaphore(self, value: Any = ...) -> threading.BoundedSemaphore: ... + def Condition(self, lock: Any = ...) -> threading.Condition: ... + def Event(self) -> threading.Event: ... + def Lock(self) -> threading.Lock: ... + def Namespace(self) -> _Namespace: ... + def Queue(self, maxsize: int = ...) -> queue.Queue[Any]: ... + def RLock(self) -> threading.RLock: ... + def Semaphore(self, value: Any = ...) -> threading.Semaphore: ... + def Array(self, typecode: Any, sequence: Sequence[_T]) -> Sequence[_T]: ... + def Value(self, typecode: Any, value: _T) -> ValueProxy[_T]: ... + def dict(self, sequence: Mapping[_KT, _VT] = ...) -> Dict[_KT, _VT]: ... + def list(self, sequence: Sequence[_T] = ...) -> List[_T]: ... + +class RemoteError(Exception): ... + +if sys.version_info >= (3, 8): + class SharedMemoryServer(Server): ... + class SharedMemoryManager(BaseManager): + def get_server(self) -> SharedMemoryServer: ... + def SharedMemory(self, size: int) -> SharedMemory: ... + def ShareableList(self, sequence: Optional[Iterable[_SLT]]) -> ShareableList[_SLT]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/pool.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/pool.pyi new file mode 100644 index 00000000..5d376443 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/pool.pyi @@ -0,0 +1,83 @@ +from typing import Any, Callable, ContextManager, Iterable, Mapping, Optional, List, TypeVar, Generic, Iterator + +_PT = TypeVar('_PT', bound=Pool) +_S = TypeVar('_S') +_T = TypeVar('_T') + +class ApplyResult(Generic[_T]): + def get(self, timeout: Optional[float] = ...) -> _T: ... + def wait(self, timeout: Optional[float] = ...) -> None: ... + def ready(self) -> bool: ... + def successful(self) -> bool: ... + +# alias created during issue #17805 +AsyncResult = ApplyResult + +class MapResult(ApplyResult[List[_T]]): ... + +class IMapIterator(Iterator[_T]): + def __iter__(self: _S) -> _S: ... + def next(self, timeout: Optional[float] = ...) -> _T: ... + def __next__(self, timeout: Optional[float] = ...) -> _T: ... + +class IMapUnorderedIterator(IMapIterator[_T]): ... + +class Pool(ContextManager[Pool]): + def __init__(self, processes: Optional[int] = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Iterable[Any] = ..., + maxtasksperchild: Optional[int] = ..., + context: Optional[Any] = ...) -> None: ... + def apply(self, + func: Callable[..., _T], + args: Iterable[Any] = ..., + kwds: Mapping[str, Any] = ...) -> _T: ... + def apply_async(self, + func: Callable[..., _T], + args: Iterable[Any] = ..., + kwds: Mapping[str, Any] = ..., + callback: Optional[Callable[[_T], None]] = ..., + error_callback: Optional[Callable[[BaseException], None]] = ...) -> AsyncResult[_T]: ... + def map(self, + func: Callable[[_S], _T], + iterable: Iterable[_S] = ..., + chunksize: Optional[int] = ...) -> List[_T]: ... + def map_async(self, func: Callable[[_S], _T], + iterable: Iterable[_S] = ..., + chunksize: Optional[int] = ..., + callback: Optional[Callable[[_T], None]] = ..., + error_callback: Optional[Callable[[BaseException], None]] = ...) -> MapResult[_T]: ... + def imap(self, + func: Callable[[_S], _T], + iterable: Iterable[_S] = ..., + chunksize: Optional[int] = ...) -> IMapIterator[_T]: ... + def imap_unordered(self, + func: Callable[[_S], _T], + iterable: Iterable[_S] = ..., + chunksize: Optional[int] = ...) -> IMapIterator[_T]: ... + def starmap(self, + func: Callable[..., _T], + iterable: Iterable[Iterable[Any]] = ..., + chunksize: Optional[int] = ...) -> List[_T]: ... + def starmap_async(self, + func: Callable[..., _T], + iterable: Iterable[Iterable[Any]] = ..., + chunksize: Optional[int] = ..., + callback: Optional[Callable[[_T], None]] = ..., + error_callback: Optional[Callable[[BaseException], None]] = ...) -> AsyncResult[List[_T]]: ... + def close(self) -> None: ... + def terminate(self) -> None: ... + def join(self) -> None: ... + def __enter__(self: _PT) -> _PT: ... + + +class ThreadPool(Pool, ContextManager[ThreadPool]): + + def __init__(self, processes: Optional[int] = ..., + initializer: Optional[Callable[..., Any]] = ..., + initargs: Iterable[Any] = ...) -> None: ... + +# undocumented +RUN: int +CLOSE: int +TERMINATE: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/process.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/process.pyi new file mode 100644 index 00000000..a979ee7b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/process.pyi @@ -0,0 +1,38 @@ +import sys +from typing import Any, Callable, List, Mapping, Optional, Tuple + +class BaseProcess: + name: str + daemon: bool + authkey: bytes + def __init__( + self, + group: None = ..., + target: Optional[Callable[..., Any]] = ..., + name: Optional[str] = ..., + args: Tuple[Any, ...] = ..., + kwargs: Mapping[str, Any] = ..., + *, + daemon: Optional[bool] = ..., + ) -> None: ... + def run(self) -> None: ... + def start(self) -> None: ... + def terminate(self) -> None: ... + if sys.version_info >= (3, 7): + def kill(self) -> None: ... + def close(self) -> None: ... + def join(self, timeout: Optional[float] = ...) -> None: ... + def is_alive(self) -> bool: ... + @property + def exitcode(self) -> Optional[int]: ... + @property + def ident(self) -> Optional[int]: ... + @property + def pid(self) -> Optional[int]: ... + @property + def sentinel(self) -> int: ... + +def current_process() -> BaseProcess: ... +def active_children() -> List[BaseProcess]: ... +if sys.version_info >= (3, 8): + def parent_process() -> Optional[BaseProcess]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/queues.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/queues.pyi new file mode 100644 index 00000000..c6dd0f20 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/queues.pyi @@ -0,0 +1,30 @@ +from typing import Any, Generic, Optional, TypeVar + +import queue + +_T = TypeVar('_T') + +class Queue(queue.Queue[_T]): + # FIXME: `ctx` is a circular dependency and it's not actually optional. + # It's marked as such to be able to use the generic Queue in __init__.pyi. + def __init__(self, maxsize: int = ..., *, ctx: Any = ...) -> None: ... + def get(self, block: bool = ..., timeout: Optional[float] = ...) -> _T: ... + def put(self, obj: _T, block: bool = ..., timeout: Optional[float] = ...) -> None: ... + def qsize(self) -> int: ... + def empty(self) -> bool: ... + def full(self) -> bool: ... + def put_nowait(self, item: _T) -> None: ... + def get_nowait(self) -> _T: ... + def close(self) -> None: ... + def join_thread(self) -> None: ... + def cancel_join_thread(self) -> None: ... + +class JoinableQueue(Queue[_T]): + def task_done(self) -> None: ... + def join(self) -> None: ... + +class SimpleQueue(Generic[_T]): + def __init__(self, *, ctx: Any = ...) -> None: ... + def empty(self) -> bool: ... + def get(self) -> _T: ... + def put(self, item: _T) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/shared_memory.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/shared_memory.pyi new file mode 100644 index 00000000..6a16a09a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/shared_memory.pyi @@ -0,0 +1,29 @@ +import sys +from typing import Generic, Iterable, Optional, Tuple, TypeVar + +_S = TypeVar("_S") +_SLT = TypeVar("_SLT", int, float, bool, str, bytes, None) + +if sys.version_info >= (3, 8): + class SharedMemory: + def __init__(self, name: Optional[str] = ..., create: bool = ..., size: int = ...) -> None: ... + @property + def buf(self) -> memoryview: ... + @property + def name(self) -> str: ... + @property + def size(self) -> int: ... + def close(self) -> None: ... + def unlink(self) -> None: ... + + class ShareableList(Generic[_SLT]): + shm: SharedMemory + def __init__(self, sequence: Optional[Iterable[_SLT]] = ..., *, name: Optional[str] = ...) -> None: ... + def __getitem__(self, position: int) -> _SLT: ... + def __setitem__(self, position: int, value: _SLT) -> None: ... + def __reduce__(self: _S) -> Tuple[_S, Tuple[_SLT, ...]]: ... + def __len__(self) -> int: ... + @property + def format(self) -> str: ... + def count(self, value: _SLT) -> int: ... + def index(self, value: _SLT) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/spawn.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/spawn.pyi new file mode 100644 index 00000000..9d170f6f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/spawn.pyi @@ -0,0 +1,18 @@ +from typing import Any, Dict, List, Mapping, Optional, Sequence +from types import ModuleType + +WINEXE: bool +WINSERVICE: bool + +def set_executable(exe: str) -> None: ... +def get_executable() -> str: ... +def is_forking(argv: Sequence[str]) -> bool: ... +def freeze_support() -> None: ... +def get_command_line(**kwds: Any) -> List[str]: ... +def spawn_main(pipe_handle: int, parent_pid: Optional[int] = ..., tracker_fd: Optional[int] = ...) -> None: ... +# undocumented +def _main(fd: int) -> Any: ... +def get_preparation_data(name: str) -> Dict[str, Any]: ... +old_main_modules: List[ModuleType] +def prepare(data: Mapping[str, Any]) -> None: ... +def import_main_path(main_path: str) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/synchronize.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/synchronize.pyi new file mode 100644 index 00000000..224485b3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/multiprocessing/synchronize.pyi @@ -0,0 +1,63 @@ +from typing import Any, Callable, ContextManager, Optional, Union + +from multiprocessing.context import BaseContext +import threading +import sys + +_LockLike = Union[Lock, RLock] + +class Barrier(threading.Barrier): + def __init__(self, + parties: int, + action: Optional[Callable[..., Any]] = ..., + timeout: Optional[float] = ..., + * + ctx: BaseContext) -> None: ... + +class BoundedSemaphore(Semaphore): + def __init__(self, value: int = ..., *, ctx: BaseContext) -> None: ... + +class Condition(ContextManager[bool]): + def __init__(self, + lock: Optional[_LockLike] = ..., + *, + ctx: BaseContext) -> None: ... + if sys.version_info >= (3, 7): + def notify(self, n: int = ...) -> None: ... + else: + def notify(self) -> None: ... + def notify_all(self) -> None: ... + def wait(self, timeout: Optional[float] = ...) -> bool: ... + def wait_for(self, + predicate: Callable[[], bool], + timeout: Optional[float] = ...) -> bool: ... + def acquire(self, + block: bool = ..., + timeout: Optional[float] = ...) -> bool: ... + def release(self) -> None: ... + +class Event(ContextManager[bool]): + def __init__(self, + lock: Optional[_LockLike] = ..., + *, + ctx: BaseContext) -> None: ... + def is_set(self) -> bool: ... + def set(self) -> None: ... + def clear(self) -> None: ... + def wait(self, timeout: Optional[float] = ...) -> bool: ... + +class Lock(SemLock): + def __init__(self, *, ctx: BaseContext) -> None: ... + +class RLock(SemLock): + def __init__(self, *, ctx: BaseContext) -> None: ... + +class Semaphore(SemLock): + def __init__(self, value: int = ..., *, ctx: BaseContext) -> None: ... + +# Not part of public API +class SemLock(ContextManager[bool]): + def acquire(self, + block: bool = ..., + timeout: Optional[float] = ...) -> bool: ... + def release(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/nntplib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/nntplib.pyi new file mode 100644 index 00000000..78b078cb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/nntplib.pyi @@ -0,0 +1,100 @@ +# Stubs for nntplib (Python 3) + +import datetime +import socket +import ssl +from typing import Any, Dict, IO, Iterable, List, NamedTuple, Optional, Tuple, TypeVar, Union + +_SelfT = TypeVar('_SelfT', bound=_NNTPBase) +_File = Union[IO[bytes], bytes, str, None] + + +class NNTPError(Exception): + response: str +class NNTPReplyError(NNTPError): ... +class NNTPTemporaryError(NNTPError): ... +class NNTPPermanentError(NNTPError): ... +class NNTPProtocolError(NNTPError): ... +class NNTPDataError(NNTPError): ... + +NNTP_PORT: int +NNTP_SSL_PORT: int + +class GroupInfo(NamedTuple): + group: str + last: str + first: str + flag: str +class ArticleInfo(NamedTuple): + number: int + message_id: str + lines: List[bytes] + +def decode_header(header_str: str) -> str: ... + +class _NNTPBase: + encoding: str + errors: str + + host: str + file: IO[bytes] + debugging: int + welcome: str + readermode_afterauth: bool + tls_on: bool + authenticated: bool + nntp_implementation: str + nntp_version: int + + def __init__(self, file: IO[bytes], host: str, + readermode: Optional[bool] = ..., timeout: float = ...) -> None: ... + def __enter__(self: _SelfT) -> _SelfT: ... + def __exit__(self, *args: Any) -> None: ... + def getwelcome(self) -> str: ... + def getcapabilities(self) -> Dict[str, List[str]]: ... + def set_debuglevel(self, level: int) -> None: ... + def debug(self, level: int) -> None: ... + def capabilities(self) -> Tuple[str, Dict[str, List[str]]]: ... + def newgroups(self, date: Union[datetime.date, datetime.datetime], *, file: _File = ...) -> Tuple[str, List[str]]: ... + def newnews(self, group: str, date: Union[datetime.date, datetime.datetime], *, file: _File = ...) -> Tuple[str, List[str]]: ... + def list(self, group_pattern: Optional[str] = ..., *, file: _File = ...) -> Tuple[str, List[str]]: ... + def description(self, group: str) -> str: ... + def descriptions(self, group_pattern: str) -> Tuple[str, Dict[str, str]]: ... + def group(self, name: str) -> Tuple[str, int, int, int, str]: ... + def help(self, *, file: _File = ...) -> Tuple[str, List[str]]: ... + def stat(self, message_spec: Any = ...) -> Tuple[str, int, str]: ... + def next(self) -> Tuple[str, int, str]: ... + def last(self) -> Tuple[str, int, str]: ... + def head(self, message_spec: Any = ..., *, file: _File = ...) -> Tuple[str, ArticleInfo]: ... + def body(self, message_spec: Any = ..., *, file: _File = ...) -> Tuple[str, ArticleInfo]: ... + def article(self, message_spec: Any = ..., *, file: _File = ...) -> Tuple[str, ArticleInfo]: ... + def slave(self) -> str: ... + def xhdr(self, hdr: str, str: Any, *, file: _File = ...) -> Tuple[str, List[str]]: ... + def xover(self, start: int, end: int, *, file: _File = ...) -> Tuple[str, List[Tuple[int, Dict[str, str]]]]: ... + def over(self, message_spec: Union[None, str, List[Any], Tuple[Any, ...]], *, file: _File = ...) -> Tuple[str, List[Tuple[int, Dict[str, str]]]]: ... + def xgtitle(self, group: str, *, file: _File = ...) -> Tuple[str, List[Tuple[str, str]]]: ... + def xpath(self, id: Any) -> Tuple[str, str]: ... + def date(self) -> Tuple[str, datetime.datetime]: ... + def post(self, data: Union[bytes, Iterable[bytes]]) -> str: ... + def ihave(self, message_id: Any, data: Union[bytes, Iterable[bytes]]) -> str: ... + def quit(self) -> str: ... + def login(self, user: Optional[str] = ..., password: Optional[str] = ..., usenetrc: bool = ...) -> None: ... + def starttls(self, ssl_context: Optional[ssl.SSLContext] = ...) -> None: ... + + +class NNTP(_NNTPBase): + port: int + sock: socket.socket + + def __init__(self, host: str, port: int = ..., user: Optional[str] = ..., password: Optional[str] = ..., + readermode: Optional[bool] = ..., usenetrc: bool = ..., + timeout: float = ...) -> None: ... + + +class NNTP_SSL(_NNTPBase): + sock: socket.socket + + def __init__(self, host: str, port: int = ..., user: Optional[str] = ..., password: Optional[str] = ..., + ssl_context: Optional[ssl.SSLContext] = ..., + readermode: Optional[bool] = ..., usenetrc: bool = ..., + timeout: float = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/nturl2path.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/nturl2path.pyi new file mode 100644 index 00000000..b8ad8d68 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/nturl2path.pyi @@ -0,0 +1,2 @@ +def url2pathname(url: str) -> str: ... +def pathname2url(p: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/os/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/os/__init__.pyi new file mode 100644 index 00000000..1b4b3c7b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/os/__init__.pyi @@ -0,0 +1,666 @@ +# Stubs for os +# Ron Murawski + +from io import TextIOWrapper as _TextIOWrapper +from posix import listdir as listdir, times_result +import sys +from typing import ( + Mapping, MutableMapping, Dict, List, Any, Tuple, Iterable, Iterator, NoReturn, overload, Union, AnyStr, + Optional, Generic, Set, Callable, Text, Sequence, NamedTuple, TypeVar, ContextManager +) + +# Re-exported names from other modules. +from builtins import OSError as error +from . import path as path + +_T = TypeVar('_T') + +# ----- os variables ----- + +supports_bytes_environ: bool + +supports_dir_fd: Set[Callable[..., Any]] +supports_fd: Set[Callable[..., Any]] +supports_effective_ids: Set[Callable[..., Any]] +supports_follow_symlinks: Set[Callable[..., Any]] + +if sys.platform != 'win32': + # Unix only + PRIO_PROCESS: int + PRIO_PGRP: int + PRIO_USER: int + + F_LOCK: int + F_TLOCK: int + F_ULOCK: int + F_TEST: int + + POSIX_FADV_NORMAL: int + POSIX_FADV_SEQUENTIAL: int + POSIX_FADV_RANDOM: int + POSIX_FADV_NOREUSE: int + POSIX_FADV_WILLNEED: int + POSIX_FADV_DONTNEED: int + + SF_NODISKIO: int + SF_MNOWAIT: int + SF_SYNC: int + + XATTR_SIZE_MAX: int # Linux only + XATTR_CREATE: int # Linux only + XATTR_REPLACE: int # Linux only + + P_PID: int + P_PGID: int + P_ALL: int + + WEXITED: int + WSTOPPED: int + WNOWAIT: int + + CLD_EXITED: int + CLD_DUMPED: int + CLD_TRAPPED: int + CLD_CONTINUED: int + + SCHED_OTHER: int # some flavors of Unix + SCHED_BATCH: int # some flavors of Unix + SCHED_IDLE: int # some flavors of Unix + SCHED_SPORADIC: int # some flavors of Unix + SCHED_FIFO: int # some flavors of Unix + SCHED_RR: int # some flavors of Unix + SCHED_RESET_ON_FORK: int # some flavors of Unix + +RTLD_LAZY: int +RTLD_NOW: int +RTLD_GLOBAL: int +RTLD_LOCAL: int +RTLD_NODELETE: int +RTLD_NOLOAD: int +RTLD_DEEPBIND: int + +SEEK_SET: int +SEEK_CUR: int +SEEK_END: int +if sys.platform != 'win32': + SEEK_DATA: int # some flavors of Unix + SEEK_HOLE: int # some flavors of Unix + +O_RDONLY: int +O_WRONLY: int +O_RDWR: int +O_APPEND: int +O_CREAT: int +O_EXCL: int +O_TRUNC: int +# We don't use sys.platform for O_* flags to denote platform-dependent APIs because some codes, +# including tests for mypy, use a more finer way than sys.platform before using these APIs +# See https://github.com/python/typeshed/pull/2286 for discussions +O_DSYNC: int # Unix only +O_RSYNC: int # Unix only +O_SYNC: int # Unix only +O_NDELAY: int # Unix only +O_NONBLOCK: int # Unix only +O_NOCTTY: int # Unix only +O_CLOEXEC: int # Unix only +O_SHLOCK: int # Unix only +O_EXLOCK: int # Unix only +O_BINARY: int # Windows only +O_NOINHERIT: int # Windows only +O_SHORT_LIVED: int # Windows only +O_TEMPORARY: int # Windows only +O_RANDOM: int # Windows only +O_SEQUENTIAL: int # Windows only +O_TEXT: int # Windows only +O_ASYNC: int # Gnu extension if in C library +O_DIRECT: int # Gnu extension if in C library +O_DIRECTORY: int # Gnu extension if in C library +O_NOFOLLOW: int # Gnu extension if in C library +O_NOATIME: int # Gnu extension if in C library +O_PATH: int # Gnu extension if in C library +O_TMPFILE: int # Gnu extension if in C library +O_LARGEFILE: int # Gnu extension if in C library + +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +linesep: str +devnull: str +name: str + +F_OK: int +R_OK: int +W_OK: int +X_OK: int + +class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]): + def copy(self) -> Dict[AnyStr, AnyStr]: ... + def __delitem__(self, key: AnyStr) -> None: ... + def __getitem__(self, key: AnyStr) -> AnyStr: ... + def __setitem__(self, key: AnyStr, value: AnyStr) -> None: ... + def __iter__(self) -> Iterator[AnyStr]: ... + def __len__(self) -> int: ... + +environ: _Environ[str] +environb: _Environ[bytes] + +if sys.platform != 'win32': + confstr_names: Dict[str, int] + pathconf_names: Dict[str, int] + sysconf_names: Dict[str, int] + + EX_OK: int + EX_USAGE: int + EX_DATAERR: int + EX_NOINPUT: int + EX_NOUSER: int + EX_NOHOST: int + EX_UNAVAILABLE: int + EX_SOFTWARE: int + EX_OSERR: int + EX_OSFILE: int + EX_CANTCREAT: int + EX_IOERR: int + EX_TEMPFAIL: int + EX_PROTOCOL: int + EX_NOPERM: int + EX_CONFIG: int + EX_NOTFOUND: int + +P_NOWAIT: int +P_NOWAITO: int +P_WAIT: int +if sys.platform == 'win32': + P_DETACH: int + P_OVERLAY: int + +# wait()/waitpid() options +if sys.platform != 'win32': + WNOHANG: int # Unix only + WCONTINUED: int # some Unix systems + WUNTRACED: int # Unix only + +TMP_MAX: int # Undocumented, but used by tempfile + +# ----- os classes (structures) ----- +class stat_result: + # For backward compatibility, the return value of stat() is also + # accessible as a tuple of at least 10 integers giving the most important + # (and portable) members of the stat structure, in the order st_mode, + # st_ino, st_dev, st_nlink, st_uid, st_gid, st_size, st_atime, st_mtime, + # st_ctime. More items may be added at the end by some implementations. + + st_mode: int # protection bits, + st_ino: int # inode number, + st_dev: int # device, + st_nlink: int # number of hard links, + st_uid: int # user id of owner, + st_gid: int # group id of owner, + st_size: int # size of file, in bytes, + st_atime: float # time of most recent access, + st_mtime: float # time of most recent content modification, + st_ctime: float # platform dependent (time of most recent metadata change on Unix, or the time of creation on Windows) + st_atime_ns: int # time of most recent access, in nanoseconds + st_mtime_ns: int # time of most recent content modification in nanoseconds + st_ctime_ns: int # platform dependent (time of most recent metadata change on Unix, or the time of creation on Windows) in nanoseconds + if sys.version_info >= (3, 8) and sys.platform == "win32": + st_reparse_tag: int + + def __getitem__(self, i: int) -> int: ... + + # not documented + def __init__(self, tuple: Tuple[int, ...]) -> None: ... + + # On some Unix systems (such as Linux), the following attributes may also + # be available: + st_blocks: int # number of blocks allocated for file + st_blksize: int # filesystem blocksize + st_rdev: int # type of device if an inode device + st_flags: int # user defined flags for file + + # On other Unix systems (such as FreeBSD), the following attributes may be + # available (but may be only filled out if root tries to use them): + st_gen: int # file generation number + st_birthtime: int # time of file creation + + # On Mac OS systems, the following attributes may also be available: + st_rsize: int + st_creator: int + st_type: int + +if sys.version_info >= (3, 6): + from builtins import _PathLike as PathLike # See comment in builtins + +_PathType = path._PathType +_FdOrPathType = Union[int, _PathType] + +if sys.version_info >= (3, 6): + class DirEntry(PathLike[AnyStr]): + # This is what the scandir interator yields + # The constructor is hidden + + name: AnyStr + path: AnyStr + def inode(self) -> int: ... + def is_dir(self, *, follow_symlinks: bool = ...) -> bool: ... + def is_file(self, *, follow_symlinks: bool = ...) -> bool: ... + def is_symlink(self) -> bool: ... + def stat(self, *, follow_symlinks: bool = ...) -> stat_result: ... + + def __fspath__(self) -> AnyStr: ... +else: + class DirEntry(Generic[AnyStr]): + # This is what the scandir interator yields + # The constructor is hidden + + name: AnyStr + path: AnyStr + def inode(self) -> int: ... + def is_dir(self, *, follow_symlinks: bool = ...) -> bool: ... + def is_file(self, *, follow_symlinks: bool = ...) -> bool: ... + def is_symlink(self) -> bool: ... + def stat(self, *, follow_symlinks: bool = ...) -> stat_result: ... + + +if sys.platform != 'win32': + class statvfs_result: # Unix only + f_bsize: int + f_frsize: int + f_blocks: int + f_bfree: int + f_bavail: int + f_files: int + f_ffree: int + f_favail: int + f_flag: int + f_namemax: int + +# ----- os function stubs ----- +if sys.version_info >= (3, 6): + def fsencode(filename: Union[str, bytes, PathLike[Any]]) -> bytes: ... +else: + def fsencode(filename: Union[str, bytes]) -> bytes: ... + +if sys.version_info >= (3, 6): + def fsdecode(filename: Union[str, bytes, PathLike[Any]]) -> str: ... +else: + def fsdecode(filename: Union[str, bytes]) -> str: ... + +if sys.version_info >= (3, 6): + @overload + def fspath(path: str) -> str: ... + @overload + def fspath(path: bytes) -> bytes: ... + @overload + def fspath(path: PathLike[Any]) -> Any: ... + +def get_exec_path(env: Optional[Mapping[str, str]] = ...) -> List[str]: ... +# NOTE: get_exec_path(): returns List[bytes] when env not None +def getlogin() -> str: ... +def getpid() -> int: ... +def getppid() -> int: ... +def strerror(code: int) -> str: ... +def umask(mask: int) -> int: ... + +if sys.platform != 'win32': + # Unix only + def ctermid() -> str: ... + def getegid() -> int: ... + def geteuid() -> int: ... + def getgid() -> int: ... + def getgrouplist(user: str, gid: int) -> List[int]: ... + def getgroups() -> List[int]: ... # Unix only, behaves differently on Mac + def initgroups(username: str, gid: int) -> None: ... + def getpgid(pid: int) -> int: ... + def getpgrp() -> int: ... + def getpriority(which: int, who: int) -> int: ... + def setpriority(which: int, who: int, priority: int) -> None: ... + def getresuid() -> Tuple[int, int, int]: ... + def getresgid() -> Tuple[int, int, int]: ... + def getuid() -> int: ... + def setegid(egid: int) -> None: ... + def seteuid(euid: int) -> None: ... + def setgid(gid: int) -> None: ... + def setgroups(groups: Sequence[int]) -> None: ... + def setpgrp() -> None: ... + def setpgid(pid: int, pgrp: int) -> None: ... + def setregid(rgid: int, egid: int) -> None: ... + def setresgid(rgid: int, egid: int, sgid: int) -> None: ... + def setresuid(ruid: int, euid: int, suid: int) -> None: ... + def setreuid(ruid: int, euid: int) -> None: ... + def getsid(pid: int) -> int: ... + def setsid() -> None: ... + def setuid(uid: int) -> None: ... + from posix import uname_result + def uname() -> uname_result: ... + +@overload +def getenv(key: Text) -> Optional[str]: ... +@overload +def getenv(key: Text, default: _T) -> Union[str, _T]: ... +def getenvb(key: bytes, default: bytes = ...) -> bytes: ... +def putenv(key: Union[bytes, Text], value: Union[bytes, Text]) -> None: ... +def unsetenv(key: Union[bytes, Text]) -> None: ... + +# Return IO or TextIO +def fdopen(fd: int, mode: str = ..., buffering: int = ..., encoding: Optional[str] = ..., + errors: str = ..., newline: str = ..., closefd: bool = ...) -> Any: ... +def close(fd: int) -> None: ... +def closerange(fd_low: int, fd_high: int) -> None: ... +def device_encoding(fd: int) -> Optional[str]: ... +def dup(fd: int) -> int: ... +if sys.version_info >= (3, 7): + def dup2(fd: int, fd2: int, inheritable: bool = ...) -> int: ... +else: + def dup2(fd: int, fd2: int, inheritable: bool = ...) -> None: ... +def fstat(fd: int) -> stat_result: ... +def fsync(fd: int) -> None: ... +def lseek(fd: int, pos: int, how: int) -> int: ... +def open(file: _PathType, flags: int, mode: int = ..., *, dir_fd: Optional[int] = ...) -> int: ... +def pipe() -> Tuple[int, int]: ... +def read(fd: int, n: int) -> bytes: ... + +if sys.platform != 'win32': + # Unix only + def fchmod(fd: int, mode: int) -> None: ... + def fchown(fd: int, uid: int, gid: int) -> None: ... + def fdatasync(fd: int) -> None: ... # Unix only, not Mac + def fpathconf(fd: int, name: Union[str, int]) -> int: ... + def fstatvfs(fd: int) -> statvfs_result: ... + def ftruncate(fd: int, length: int) -> None: ... + def get_blocking(fd: int) -> bool: ... + def set_blocking(fd: int, blocking: bool) -> None: ... + def isatty(fd: int) -> bool: ... + def lockf(__fd: int, __cmd: int, __length: int) -> None: ... + def openpty() -> Tuple[int, int]: ... # some flavors of Unix + def pipe2(flags: int) -> Tuple[int, int]: ... # some flavors of Unix + def posix_fallocate(fd: int, offset: int, length: int) -> None: ... + def posix_fadvise(fd: int, offset: int, length: int, advice: int) -> None: ... + def pread(fd: int, buffersize: int, offset: int) -> bytes: ... + def pwrite(fd: int, string: bytes, offset: int) -> int: ... + @overload + def sendfile(__out_fd: int, __in_fd: int, offset: Optional[int], count: int) -> int: ... + @overload + def sendfile(__out_fd: int, __in_fd: int, offset: int, count: int, + headers: Sequence[bytes] = ..., trailers: Sequence[bytes] = ..., flags: int = ...) -> int: ... # FreeBSD and Mac OS X only + def readv(fd: int, buffers: Sequence[bytearray]) -> int: ... + def writev(fd: int, buffers: Sequence[bytes]) -> int: ... + +class terminal_size(Tuple[int, int]): + columns: int + lines: int +def get_terminal_size(fd: int = ...) -> terminal_size: ... + +def get_inheritable(fd: int) -> bool: ... +def set_inheritable(fd: int, inheritable: bool) -> None: ... + +if sys.platform != 'win32': + # Unix only + def tcgetpgrp(fd: int) -> int: ... + def tcsetpgrp(fd: int, pg: int) -> None: ... + def ttyname(fd: int) -> str: ... +def write(fd: int, string: bytes) -> int: ... +def access( + path: _FdOrPathType, + mode: int, + *, + dir_fd: Optional[int] = ..., + effective_ids: bool = ..., + follow_symlinks: bool = ..., +) -> bool: ... +def chdir(path: _FdOrPathType) -> None: ... +def fchdir(fd: int) -> None: ... +def getcwd() -> str: ... +def getcwdb() -> bytes: ... +def chmod(path: _FdOrPathType, mode: int, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> None: ... +if sys.platform != 'win32': + def chflags(path: _PathType, flags: int, follow_symlinks: bool = ...) -> None: ... # some flavors of Unix + def chown(path: _FdOrPathType, uid: int, gid: int, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> None: ... # Unix only +if sys.platform != 'win32': + # Unix only + def chroot(path: _PathType) -> None: ... + def lchflags(path: _PathType, flags: int) -> None: ... + def lchmod(path: _PathType, mode: int) -> None: ... + def lchown(path: _PathType, uid: int, gid: int) -> None: ... +def link( + src: _PathType, + link_name: _PathType, + *, + src_dir_fd: Optional[int] = ..., + dst_dir_fd: Optional[int] = ..., + follow_symlinks: bool = ..., +) -> None: ... + +def lstat(path: _PathType, *, dir_fd: Optional[int] = ...) -> stat_result: ... +def mkdir(path: _PathType, mode: int = ..., *, dir_fd: Optional[int] = ...) -> None: ... +if sys.platform != 'win32': + def mkfifo(path: _PathType, mode: int = ..., *, dir_fd: Optional[int] = ...) -> None: ... # Unix only +def makedirs(name: _PathType, mode: int = ..., exist_ok: bool = ...) -> None: ... +def mknod(path: _PathType, mode: int = ..., device: int = ..., *, dir_fd: Optional[int] = ...) -> None: ... +def major(device: int) -> int: ... +def minor(device: int) -> int: ... +def makedev(major: int, minor: int) -> int: ... +if sys.platform != 'win32': + def pathconf(path: _FdOrPathType, name: Union[str, int]) -> int: ... # Unix only +if sys.version_info >= (3, 6): + def readlink(path: Union[AnyStr, PathLike[AnyStr]], *, dir_fd: Optional[int] = ...) -> AnyStr: ... +else: + def readlink(path: AnyStr, *, dir_fd: Optional[int] = ...) -> AnyStr: ... +def remove(path: _PathType, *, dir_fd: Optional[int] = ...) -> None: ... +def removedirs(name: _PathType) -> None: ... +def rename(src: _PathType, dst: _PathType, *, src_dir_fd: Optional[int] = ..., dst_dir_fd: Optional[int] = ...) -> None: ... +def renames(old: _PathType, new: _PathType) -> None: ... +def replace(src: _PathType, dst: _PathType, *, src_dir_fd: Optional[int] = ..., dst_dir_fd: Optional[int] = ...) -> None: ... +def rmdir(path: _PathType, *, dir_fd: Optional[int] = ...) -> None: ... +if sys.version_info >= (3, 7): + class _ScandirIterator(Iterator[DirEntry[AnyStr]], ContextManager[_ScandirIterator[AnyStr]]): + def __next__(self) -> DirEntry[AnyStr]: ... + def close(self) -> None: ... + @overload + def scandir() -> _ScandirIterator[str]: ... + @overload + def scandir(path: int) -> _ScandirIterator[str]: ... + @overload + def scandir(path: Union[AnyStr, PathLike[AnyStr]]) -> _ScandirIterator[AnyStr]: ... +elif sys.version_info >= (3, 6): + class _ScandirIterator(Iterator[DirEntry[AnyStr]], ContextManager[_ScandirIterator[AnyStr]]): + def __next__(self) -> DirEntry[AnyStr]: ... + def close(self) -> None: ... + @overload + def scandir() -> _ScandirIterator[str]: ... + @overload + def scandir(path: Union[AnyStr, PathLike[AnyStr]]) -> _ScandirIterator[AnyStr]: ... +else: + @overload + def scandir() -> Iterator[DirEntry[str]]: ... + @overload + def scandir(path: AnyStr) -> Iterator[DirEntry[AnyStr]]: ... +def stat(path: _FdOrPathType, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> stat_result: ... +if sys.version_info < (3, 7): + @overload + def stat_float_times() -> bool: ... + @overload + def stat_float_times(__newvalue: bool) -> None: ... +if sys.platform != 'win32': + def statvfs(path: _FdOrPathType) -> statvfs_result: ... # Unix only +def symlink( + source: _PathType, + link_name: _PathType, + target_is_directory: bool = ..., + *, + dir_fd: Optional[int] = ..., +) -> None: ... +if sys.platform != 'win32': + def sync() -> None: ... # Unix only +def truncate(path: _FdOrPathType, length: int) -> None: ... # Unix only up to version 3.4 +def unlink(path: _PathType, *, dir_fd: Optional[int] = ...) -> None: ... +def utime( + path: _FdOrPathType, + times: Optional[Union[Tuple[int, int], Tuple[float, float]]] = ..., + *, + ns: Tuple[int, int] = ..., + dir_fd: Optional[int] = ..., + follow_symlinks: bool = ..., +) -> None: ... + +_OnError = Callable[[OSError], Any] + +if sys.version_info >= (3, 6): + def walk(top: Union[AnyStr, PathLike[AnyStr]], topdown: bool = ..., + onerror: Optional[_OnError] = ..., + followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr], + List[AnyStr]]]: ... +else: + def walk(top: AnyStr, topdown: bool = ..., onerror: Optional[_OnError] = ..., + followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr], + List[AnyStr]]]: ... +if sys.platform != 'win32': + if sys.version_info >= (3, 7): + @overload + def fwalk(top: Union[str, PathLike[str]] = ..., topdown: bool = ..., + onerror: Optional[_OnError] = ..., *, follow_symlinks: bool = ..., + dir_fd: Optional[int] = ...) -> Iterator[Tuple[str, List[str], List[str], int]]: ... + @overload + def fwalk(top: bytes, topdown: bool = ..., + onerror: Optional[_OnError] = ..., *, follow_symlinks: bool = ..., + dir_fd: Optional[int] = ...) -> Iterator[Tuple[bytes, List[bytes], List[bytes], int]]: ... + elif sys.version_info >= (3, 6): + def fwalk(top: Union[str, PathLike[str]] = ..., topdown: bool = ..., + onerror: Optional[_OnError] = ..., *, follow_symlinks: bool = ..., + dir_fd: Optional[int] = ...) -> Iterator[Tuple[str, List[str], List[str], int]]: ... + else: + def fwalk(top: str = ..., topdown: bool = ..., + onerror: Optional[_OnError] = ..., *, follow_symlinks: bool = ..., + dir_fd: Optional[int] = ...) -> Iterator[Tuple[str, List[str], List[str], int]]: ... + def getxattr(path: _FdOrPathType, attribute: _PathType, *, follow_symlinks: bool = ...) -> bytes: ... # Linux only + def listxattr(path: _FdOrPathType, *, follow_symlinks: bool = ...) -> List[str]: ... # Linux only + def removexattr(path: _FdOrPathType, attribute: _PathType, *, follow_symlinks: bool = ...) -> None: ... # Linux only + def setxattr(path: _FdOrPathType, attribute: _PathType, value: bytes, flags: int = ..., *, + follow_symlinks: bool = ...) -> None: ... # Linux only + +def abort() -> NoReturn: ... +# These are defined as execl(file, *args) but the first *arg is mandatory. +def execl(file: _PathType, __arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> NoReturn: ... +def execlp(file: _PathType, __arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> NoReturn: ... + +# These are: execle(file, *args, env) but env is pulled from the last element of the args. +def execle(file: _PathType, __arg0: Union[bytes, Text], *args: Any) -> NoReturn: ... +def execlpe(file: _PathType, __arg0: Union[bytes, Text], *args: Any) -> NoReturn: ... + +# The docs say `args: tuple or list of strings` +# The implementation enforces tuple or list so we can't use Sequence. +_ExecVArgs = Union[Tuple[Union[bytes, Text], ...], List[bytes], List[Text], List[Union[bytes, Text]]] +_ExecEnv = Union[Mapping[bytes, Union[bytes, str]], Mapping[str, Union[bytes, str]]] +def execv(path: _PathType, args: _ExecVArgs) -> NoReturn: ... +def execve(path: _FdOrPathType, args: _ExecVArgs, env: _ExecEnv) -> NoReturn: ... +def execvp(file: _PathType, args: _ExecVArgs) -> NoReturn: ... +def execvpe(file: _PathType, args: _ExecVArgs, env: _ExecEnv) -> NoReturn: ... + +def _exit(n: int) -> NoReturn: ... +def kill(pid: int, sig: int) -> None: ... +if sys.platform != 'win32': + # Unix only + def fork() -> int: ... + def forkpty() -> Tuple[int, int]: ... # some flavors of Unix + def killpg(pgid: int, sig: int) -> None: ... + def nice(increment: int) -> int: ... + def plock(op: int) -> None: ... # ???op is int? + +class _wrap_close(_TextIOWrapper): + def close(self) -> Optional[int]: ... # type: ignore +def popen(command: str, mode: str = ..., buffering: int = ...) -> _wrap_close: ... + +def spawnl(mode: int, path: _PathType, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ... +def spawnle(mode: int, path: _PathType, arg0: Union[bytes, Text], + *args: Any) -> int: ... # Imprecise sig +def spawnv(mode: int, path: _PathType, args: List[Union[bytes, Text]]) -> int: ... +def spawnve(mode: int, path: _PathType, args: List[Union[bytes, Text]], + env: _ExecEnv) -> int: ... +def system(command: _PathType) -> int: ... +def times() -> times_result: ... +def waitpid(pid: int, options: int) -> Tuple[int, int]: ... + +if sys.platform == 'win32': + def startfile(path: _PathType, operation: Optional[str] = ...) -> None: ... +else: + # Unix only + def spawnlp(mode: int, file: _PathType, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ... + def spawnlpe(mode: int, file: _PathType, arg0: Union[bytes, Text], *args: Any) -> int: ... # Imprecise signature + def spawnvp(mode: int, file: _PathType, args: List[Union[bytes, Text]]) -> int: ... + def spawnvpe(mode: int, file: _PathType, args: List[Union[bytes, Text]], env: _ExecEnv) -> int: ... + def wait() -> Tuple[int, int]: ... # Unix only + from posix import waitid_result + def waitid(idtype: int, ident: int, options: int) -> waitid_result: ... + def wait3(options: int) -> Tuple[int, int, Any]: ... + def wait4(pid: int, options: int) -> Tuple[int, int, Any]: ... + def WCOREDUMP(status: int) -> bool: ... + def WIFCONTINUED(status: int) -> bool: ... + def WIFSTOPPED(status: int) -> bool: ... + def WIFSIGNALED(status: int) -> bool: ... + def WIFEXITED(status: int) -> bool: ... + def WEXITSTATUS(status: int) -> int: ... + def WSTOPSIG(status: int) -> int: ... + def WTERMSIG(status: int) -> int: ... + +if sys.platform != 'win32': + from posix import sched_param + def sched_get_priority_min(policy: int) -> int: ... # some flavors of Unix + def sched_get_priority_max(policy: int) -> int: ... # some flavors of Unix + def sched_setscheduler(pid: int, policy: int, param: sched_param) -> None: ... # some flavors of Unix + def sched_getscheduler(pid: int) -> int: ... # some flavors of Unix + def sched_setparam(pid: int, param: sched_param) -> None: ... # some flavors of Unix + def sched_getparam(pid: int) -> sched_param: ... # some flavors of Unix + def sched_rr_get_interval(pid: int) -> float: ... # some flavors of Unix + def sched_yield() -> None: ... # some flavors of Unix + def sched_setaffinity(pid: int, mask: Iterable[int]) -> None: ... # some flavors of Unix + def sched_getaffinity(pid: int) -> Set[int]: ... # some flavors of Unix + +def cpu_count() -> Optional[int]: ... +if sys.platform != 'win32': + # Unix only + def confstr(name: Union[str, int]) -> Optional[str]: ... + def getloadavg() -> Tuple[float, float, float]: ... + def sysconf(name: Union[str, int]) -> int: ... +if sys.version_info >= (3, 6): + def getrandom(size: int, flags: int = ...) -> bytes: ... + def urandom(size: int) -> bytes: ... +else: + def urandom(n: int) -> bytes: ... + +if sys.version_info >= (3, 7): + def register_at_fork(func: Callable[..., object], when: str) -> None: ... + +if sys.version_info >= (3, 8): + if sys.platform == "win32": + class _AddedDllDirectory: + path: Optional[str] + def close(self) -> None: ... + def __enter__(self: _T) -> _T: ... + def __exit__(self, *args: Any) -> None: ... + def add_dll_directory(path: str) -> _AddedDllDirectory: ... + if sys.platform == "linux": + MFD_CLOEXEC: int + MFD_ALLOW_SEALING: int + MFD_HUGETLB: int + MFD_HUGE_SHIFT: int + MFD_HUGE_MASK: int + MFD_HUGE_64KB: int + MFD_HUGE_512KB: int + MFD_HUGE_1MB: int + MFD_HUGE_2MB: int + MFD_HUGE_8MB: int + MFD_HUGE_16MB: int + MFD_HUGE_32MB: int + MFD_HUGE_256MB: int + MFD_HUGE_512MB: int + MFD_HUGE_1GB: int + MFD_HUGE_2GB: int + MFD_HUGE_16GB: int + def memfd_create(name: str, flags: int = ...) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/os/path.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/os/path.pyi new file mode 100644 index 00000000..42409c0e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/os/path.pyi @@ -0,0 +1,177 @@ +# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent! +# Stubs for os.path +# Ron Murawski + +import os +import sys +from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional + +_T = TypeVar('_T') + +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PathType = Union[bytes, Text, _PathLike] + _StrPath = Union[Text, _PathLike[Text]] + _BytesPath = Union[bytes, _PathLike[bytes]] +else: + _PathType = Union[bytes, Text] + _StrPath = Text + _BytesPath = bytes + +# ----- os.path variables ----- +supports_unicode_filenames: bool +# aliases (also in os) +curdir: str +pardir: str +sep: str +if sys.platform == 'win32': + altsep: str +else: + altsep: Optional[str] +extsep: str +pathsep: str +defpath: str +devnull: str + +# ----- os.path function stubs ----- +if sys.version_info >= (3, 6): + # Overloads are necessary to work around python/mypy#3644. + @overload + def abspath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def abspath(path: AnyStr) -> AnyStr: ... + @overload + def basename(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def basename(path: AnyStr) -> AnyStr: ... + @overload + def dirname(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def dirname(path: AnyStr) -> AnyStr: ... + @overload + def expanduser(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expanduser(path: AnyStr) -> AnyStr: ... + @overload + def expandvars(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def expandvars(path: AnyStr) -> AnyStr: ... + @overload + def normcase(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normcase(path: AnyStr) -> AnyStr: ... + @overload + def normpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + @overload + def realpath(path: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(path: AnyStr) -> AnyStr: ... + else: + @overload + def realpath(filename: _PathLike[AnyStr]) -> AnyStr: ... + @overload + def realpath(filename: AnyStr) -> AnyStr: ... + +else: + def abspath(path: AnyStr) -> AnyStr: ... + def basename(path: AnyStr) -> AnyStr: ... + def dirname(path: AnyStr) -> AnyStr: ... + def expanduser(path: AnyStr) -> AnyStr: ... + def expandvars(path: AnyStr) -> AnyStr: ... + def normcase(path: AnyStr) -> AnyStr: ... + def normpath(path: AnyStr) -> AnyStr: ... + if sys.platform == 'win32': + def realpath(path: AnyStr) -> AnyStr: ... + else: + def realpath(filename: AnyStr) -> AnyStr: ... + +if sys.version_info >= (3, 6): + # In reality it returns str for sequences of _StrPath and bytes for sequences + # of _BytesPath, but mypy does not accept such a signature. + def commonpath(paths: Sequence[_PathType]) -> Any: ... +elif sys.version_info >= (3, 5): + def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... + +# NOTE: Empty lists results in '' (str) regardless of contained type. +# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes +# So, fall back to Any +def commonprefix(list: Sequence[_PathType]) -> Any: ... + +if sys.version_info >= (3, 3): + def exists(path: Union[_PathType, int]) -> bool: ... +else: + def exists(path: _PathType) -> bool: ... +def lexists(path: _PathType) -> bool: ... + +# These return float if os.stat_float_times() == True, +# but int is a subclass of float. +def getatime(path: _PathType) -> float: ... +def getmtime(path: _PathType) -> float: ... +def getctime(path: _PathType) -> float: ... + +def getsize(path: _PathType) -> int: ... +def isabs(path: _PathType) -> bool: ... +def isfile(path: _PathType) -> bool: ... +def isdir(path: _PathType) -> bool: ... +def islink(path: _PathType) -> bool: ... +def ismount(path: _PathType) -> bool: ... + +if sys.version_info < (3, 0): + # Make sure signatures are disjunct, and allow combinations of bytes and unicode. + # (Since Python 2 allows that, too) + # Note that e.g. os.path.join("a", "b", "c", "d", u"e") will still result in + # a type error. + @overload + def join(__p1: bytes, *p: bytes) -> bytes: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ... + @overload + def join(__p1: Text, *p: _PathType) -> Text: ... +elif sys.version_info >= (3, 6): + # Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway. + @overload + def join(path: _StrPath, *paths: _StrPath) -> Text: ... + @overload + def join(path: _BytesPath, *paths: _BytesPath) -> bytes: ... +else: + def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... + +@overload +def relpath(path: _BytesPath, start: Optional[_BytesPath] = ...) -> bytes: ... +@overload +def relpath(path: _StrPath, start: Optional[_StrPath] = ...) -> Text: ... + +def samefile(path1: _PathType, path2: _PathType) -> bool: ... +def sameopenfile(fp1: int, fp2: int) -> bool: ... +def samestat(stat1: os.stat_result, stat2: os.stat_result) -> bool: ... + +if sys.version_info >= (3, 6): + @overload + def split(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ... + @overload + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... +else: + def split(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitdrive(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + def splitext(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... + +if sys.platform == 'win32': + def splitunc(path: AnyStr) -> Tuple[AnyStr, AnyStr]: ... # deprecated + +if sys.version_info < (3,): + def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/pathlib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/pathlib.pyi new file mode 100644 index 00000000..fb925e60 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/pathlib.pyi @@ -0,0 +1,135 @@ +from typing import Any, Generator, IO, Optional, Sequence, Tuple, Type, TypeVar, Union, List +from types import TracebackType +import os +import sys + +_P = TypeVar('_P', bound=PurePath) + +if sys.version_info >= (3, 6): + _PurePathBase = os.PathLike[str] +else: + _PurePathBase = object + +class PurePath(_PurePathBase): + parts: Tuple[str, ...] + drive: str + root: str + anchor: str + name: str + suffix: str + suffixes: List[str] + stem: str + if sys.version_info < (3, 5): + def __init__(self, *pathsegments: str) -> None: ... + elif sys.version_info < (3, 6): + def __new__(cls: Type[_P], *args: Union[str, PurePath]) -> _P: ... + else: + def __new__(cls: Type[_P], *args: Union[str, os.PathLike[str]]) -> _P: ... + def __hash__(self) -> int: ... + def __lt__(self, other: PurePath) -> bool: ... + def __le__(self, other: PurePath) -> bool: ... + def __gt__(self, other: PurePath) -> bool: ... + def __ge__(self, other: PurePath) -> bool: ... + if sys.version_info < (3, 6): + def __truediv__(self: _P, key: Union[str, PurePath]) -> _P: ... + def __rtruediv__(self: _P, key: Union[str, PurePath]) -> _P: ... + else: + def __truediv__(self: _P, key: Union[str, os.PathLike[str]]) -> _P: ... + def __rtruediv__(self: _P, key: Union[str, os.PathLike[str]]) -> _P: ... + if sys.version_info < (3,): + def __div__(self: _P, key: Union[str, PurePath]) -> _P: ... + def __bytes__(self) -> bytes: ... + def as_posix(self) -> str: ... + def as_uri(self) -> str: ... + def is_absolute(self) -> bool: ... + def is_reserved(self) -> bool: ... + def match(self, path_pattern: str) -> bool: ... + if sys.version_info < (3, 6): + def relative_to(self: _P, *other: Union[str, PurePath]) -> _P: ... + else: + def relative_to(self: _P, *other: Union[str, os.PathLike[str]]) -> _P: ... + def with_name(self: _P, name: str) -> _P: ... + def with_suffix(self: _P, suffix: str) -> _P: ... + if sys.version_info < (3, 6): + def joinpath(self: _P, *other: Union[str, PurePath]) -> _P: ... + else: + def joinpath(self: _P, *other: Union[str, os.PathLike[str]]) -> _P: ... + + @property + def parents(self: _P) -> Sequence[_P]: ... + @property + def parent(self: _P) -> _P: ... + +class PurePosixPath(PurePath): ... +class PureWindowsPath(PurePath): ... + +class Path(PurePath): + def __enter__(self) -> Path: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_value: Optional[BaseException], + traceback: Optional[TracebackType]) -> Optional[bool]: ... + @classmethod + def cwd(cls: Type[_P]) -> _P: ... + def stat(self) -> os.stat_result: ... + def chmod(self, mode: int) -> None: ... + def exists(self) -> bool: ... + def glob(self, pattern: str) -> Generator[Path, None, None]: ... + def group(self) -> str: ... + def is_dir(self) -> bool: ... + def is_file(self) -> bool: ... + def is_symlink(self) -> bool: ... + def is_socket(self) -> bool: ... + def is_fifo(self) -> bool: ... + def is_block_device(self) -> bool: ... + def is_char_device(self) -> bool: ... + def iterdir(self) -> Generator[Path, None, None]: ... + def lchmod(self, mode: int) -> None: ... + def lstat(self) -> os.stat_result: ... + if sys.version_info < (3, 5): + def mkdir(self, mode: int = ..., + parents: bool = ...) -> None: ... + else: + def mkdir(self, mode: int = ..., parents: bool = ..., + exist_ok: bool = ...) -> None: ... + def open(self, mode: str = ..., buffering: int = ..., + encoding: Optional[str] = ..., errors: Optional[str] = ..., + newline: Optional[str] = ...) -> IO[Any]: ... + def owner(self) -> str: ... + def rename(self, target: Union[str, PurePath]) -> None: ... + def replace(self, target: Union[str, PurePath]) -> None: ... + if sys.version_info < (3, 6): + def resolve(self: _P) -> _P: ... + else: + def resolve(self: _P, strict: bool = ...) -> _P: ... + def rglob(self, pattern: str) -> Generator[Path, None, None]: ... + def rmdir(self) -> None: ... + def symlink_to(self, target: Union[str, Path], + target_is_directory: bool = ...) -> None: ... + def touch(self, mode: int = ..., exist_ok: bool = ...) -> None: ... + def unlink(self) -> None: ... + + if sys.version_info >= (3, 5): + @classmethod + def home(cls: Type[_P]) -> _P: ... + if sys.version_info < (3, 6): + def __new__(cls: Type[_P], *args: Union[str, PurePath], + **kwargs: Any) -> _P: ... + else: + def __new__(cls: Type[_P], *args: Union[str, os.PathLike[str]], + **kwargs: Any) -> _P: ... + + def absolute(self: _P) -> _P: ... + def expanduser(self: _P) -> _P: ... + def read_bytes(self) -> bytes: ... + def read_text(self, encoding: Optional[str] = ..., + errors: Optional[str] = ...) -> str: ... + def samefile(self, other_path: Union[str, bytes, int, Path]) -> bool: ... + def write_bytes(self, data: bytes) -> int: ... + def write_text(self, data: str, encoding: Optional[str] = ..., + errors: Optional[str] = ...) -> int: ... + if sys.version_info >= (3, 8): + def link_to(self, target: Union[str, bytes, os.PathLike[str]]) -> None: ... + + +class PosixPath(Path, PurePosixPath): ... +class WindowsPath(Path, PureWindowsPath): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/pipes.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/pipes.pyi new file mode 100644 index 00000000..658373e4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/pipes.pyi @@ -0,0 +1,19 @@ +# Stubs for pipes + +# Based on http://docs.python.org/3.5/library/pipes.html + +import os + +class Template: + def __init__(self) -> None: ... + def reset(self) -> None: ... + def clone(self) -> Template: ... + def debug(self, flag: bool) -> None: ... + def append(self, cmd: str, kind: str) -> None: ... + def prepend(self, cmd: str, kind: str) -> None: ... + def open(self, file: str, rw: str) -> os._wrap_close: ... + def copy(self, file: str, rw: str) -> os._wrap_close: ... + +# Not documented, but widely used. +# Documented as shlex.quote since 3.3. +def quote(s: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/platform.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/platform.pyi new file mode 100644 index 00000000..858bb593 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/platform.pyi @@ -0,0 +1,39 @@ +# Stubs for platform (Python 3.5) + +from os import devnull as DEV_NULL +from typing import Tuple, NamedTuple + +def libc_ver(executable: str = ..., lib: str = ..., version: str = ..., chunksize: int = ...) -> Tuple[str, str]: ... +def linux_distribution(distname: str = ..., version: str = ..., id: str = ..., supported_dists: Tuple[str, ...] = ..., full_distribution_name: bool = ...) -> Tuple[str, str, str]: ... +def dist(distname: str = ..., version: str = ..., id: str = ..., supported_dists: Tuple[str, ...] = ...) -> Tuple[str, str, str]: ... +def win32_ver(release: str = ..., version: str = ..., csd: str = ..., ptype: str = ...) -> Tuple[str, str, str, str]: ... +def mac_ver(release: str = ..., versioninfo: Tuple[str, str, str] = ..., machine: str = ...) -> Tuple[str, Tuple[str, str, str], str]: ... +def java_ver(release: str = ..., vendor: str = ..., vminfo: Tuple[str, str, str] = ..., osinfo: Tuple[str, str, str] = ...) -> Tuple[str, str, Tuple[str, str, str], Tuple[str, str, str]]: ... +def system_alias(system: str, release: str, version: str) -> Tuple[str, str, str]: ... +def architecture(executable: str = ..., bits: str = ..., linkage: str = ...) -> Tuple[str, str]: ... + +class uname_result(NamedTuple): + system: str + node: str + release: str + version: str + machine: str + processor: str + +def uname() -> uname_result: ... +def system() -> str: ... +def node() -> str: ... +def release() -> str: ... +def version() -> str: ... +def machine() -> str: ... +def processor() -> str: ... + +def python_implementation() -> str: ... +def python_version() -> str: ... +def python_version_tuple() -> Tuple[str, str, str]: ... +def python_branch() -> str: ... +def python_revision() -> str: ... +def python_build() -> Tuple[str, str]: ... +def python_compiler() -> str: ... + +def platform(aliased: bool = ..., terse: bool = ...) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/posix.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/posix.pyi new file mode 100644 index 00000000..c6092ead --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/posix.pyi @@ -0,0 +1,126 @@ +# Stubs for posix + +# NOTE: These are incomplete! + +import sys +from typing import List, NamedTuple, Optional, overload + +from os import stat_result as stat_result + +if sys.version_info >= (3, 6): + from builtins import _PathLike # See comment in builtins + +class uname_result(NamedTuple): + sysname: str + nodename: str + release: str + version: str + machine: str + +class times_result(NamedTuple): + user: float + system: float + children_user: float + children_system: float + elapsed: float + +class waitid_result(NamedTuple): + si_pid: int + si_uid: int + si_signo: int + si_status: int + si_code: int + +class sched_param(NamedTuple): + sched_priority: int + +EX_CANTCREAT: int +EX_CONFIG: int +EX_DATAERR: int +EX_IOERR: int +EX_NOHOST: int +EX_NOINPUT: int +EX_NOPERM: int +EX_NOTFOUND: int +EX_NOUSER: int +EX_OK: int +EX_OSERR: int +EX_OSFILE: int +EX_PROTOCOL: int +EX_SOFTWARE: int +EX_TEMPFAIL: int +EX_UNAVAILABLE: int +EX_USAGE: int + +F_OK: int +R_OK: int +W_OK: int +X_OK: int + +if sys.version_info >= (3, 6): + GRND_NONBLOCK: int + GRND_RANDOM: int +NGROUPS_MAX: int + +O_APPEND: int +O_ACCMODE: int +O_ASYNC: int +O_CREAT: int +O_DIRECT: int +O_DIRECTORY: int +O_DSYNC: int +O_EXCL: int +O_LARGEFILE: int +O_NDELAY: int +O_NOATIME: int +O_NOCTTY: int +O_NOFOLLOW: int +O_NONBLOCK: int +O_RDONLY: int +O_RDWR: int +O_RSYNC: int +O_SYNC: int +O_TRUNC: int +O_WRONLY: int + +ST_APPEND: int +ST_MANDLOCK: int +ST_NOATIME: int +ST_NODEV: int +ST_NODIRATIME: int +ST_NOEXEC: int +ST_NOSUID: int +ST_RDONLY: int +ST_RELATIME: int +ST_SYNCHRONOUS: int +ST_WRITE: int + +TMP_MAX: int +WCONTINUED: int +WCOREDUMP: int +WEXITSTATUS: int +WIFCONTINUED: int +WIFEXITED: int +WIFSIGNALED: int +WIFSTOPPED: int +WNOHANG: int +WSTOPSIG: int +WTERMSIG: int +WUNTRACED: int + +if sys.version_info >= (3, 6): + @overload + def listdir(path: Optional[str] = ...) -> List[str]: ... + @overload + def listdir(path: bytes) -> List[bytes]: ... + @overload + def listdir(path: int) -> List[str]: ... + @overload + def listdir(path: _PathLike[str]) -> List[str]: ... +else: + @overload + def listdir(path: Optional[str] = ...) -> List[str]: ... + @overload + def listdir(path: bytes) -> List[bytes]: ... + @overload + def listdir(path: int) -> List[str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/queue.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/queue.pyi new file mode 100644 index 00000000..9647faf4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/queue.pyi @@ -0,0 +1,50 @@ +# Stubs for queue + +# NOTE: These are incomplete! + +from threading import Condition, Lock +from typing import Any, Deque, TypeVar, Generic, Optional +import sys + +_T = TypeVar('_T') + +class Empty(Exception): ... +class Full(Exception): ... + +class Queue(Generic[_T]): + maxsize: int + + mutex: Lock # undocumented + not_empty: Condition # undocumented + not_full: Condition # undocumented + all_tasks_done: Condition # undocumented + unfinished_tasks: int # undocumented + + queue: Deque[Any] # undocumented + def __init__(self, maxsize: int = ...) -> None: ... + def _init(self, maxsize: int) -> None: ... + def empty(self) -> bool: ... + def full(self) -> bool: ... + def get(self, block: bool = ..., timeout: Optional[float] = ...) -> _T: ... + def get_nowait(self) -> _T: ... + def _get(self) -> _T: ... + def put(self, item: _T, block: bool = ..., timeout: Optional[float] = ...) -> None: ... + def put_nowait(self, item: _T) -> None: ... + def _put(self, item: _T) -> None: ... + def join(self) -> None: ... + def qsize(self) -> int: ... + def _qsize(self) -> int: ... + def task_done(self) -> None: ... + +class PriorityQueue(Queue[_T]): ... +class LifoQueue(Queue[_T]): ... + +if sys.version_info >= (3, 7): + class SimpleQueue(Generic[_T]): + def __init__(self) -> None: ... + def empty(self) -> bool: ... + def get(self, block: bool = ..., timeout: Optional[float] = ...) -> _T: ... + def get_nowait(self) -> _T: ... + def put(self, item: _T, block: bool = ..., timeout: Optional[float] = ...) -> None: ... + def put_nowait(self, item: _T) -> None: ... + def qsize(self) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/random.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/random.pyi new file mode 100644 index 00000000..7fa0698a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/random.pyi @@ -0,0 +1,69 @@ +# Stubs for random +# Ron Murawski +# Updated by Jukka Lehtosalo + +# based on http://docs.python.org/3.2/library/random.html + +# ----- random classes ----- + +import _random +import sys +from typing import Any, TypeVar, Sequence, List, Callable, AbstractSet, Union, Optional, Tuple + +_T = TypeVar('_T') + +class Random(_random.Random): + def __init__(self, x: Any = ...) -> None: ... + def seed(self, a: Any = ..., version: int = ...) -> None: ... + def getstate(self) -> Tuple[Any, ...]: ... + def setstate(self, state: Tuple[Any, ...]) -> None: ... + def getrandbits(self, k: int) -> int: ... + def randrange(self, start: int, stop: Union[int, None] = ..., step: int = ...) -> int: ... + def randint(self, a: int, b: int) -> int: ... + def choice(self, seq: Sequence[_T]) -> _T: ... + if sys.version_info >= (3, 6): + def choices(self, population: Sequence[_T], weights: Optional[Sequence[float]] = ..., *, cum_weights: Optional[Sequence[float]] = ..., k: int = ...) -> List[_T]: ... + def shuffle(self, x: List[Any], random: Union[Callable[[], float], None] = ...) -> None: ... + def sample(self, population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ... + def random(self) -> float: ... + def uniform(self, a: float, b: float) -> float: ... + def triangular(self, low: float = ..., high: float = ..., mode: float = ...) -> float: ... + def betavariate(self, alpha: float, beta: float) -> float: ... + def expovariate(self, lambd: float) -> float: ... + def gammavariate(self, alpha: float, beta: float) -> float: ... + def gauss(self, mu: float, sigma: float) -> float: ... + def lognormvariate(self, mu: float, sigma: float) -> float: ... + def normalvariate(self, mu: float, sigma: float) -> float: ... + def vonmisesvariate(self, mu: float, kappa: float) -> float: ... + def paretovariate(self, alpha: float) -> float: ... + def weibullvariate(self, alpha: float, beta: float) -> float: ... + +# SystemRandom is not implemented for all OS's; good on Windows & Linux +class SystemRandom(Random): + ... + +# ----- random function stubs ----- +def seed(a: Any = ..., version: int = ...) -> None: ... +def getstate() -> object: ... +def setstate(state: object) -> None: ... +def getrandbits(k: int) -> int: ... +def randrange(start: int, stop: Union[None, int] = ..., step: int = ...) -> int: ... +def randint(a: int, b: int) -> int: ... +def choice(seq: Sequence[_T]) -> _T: ... +if sys.version_info >= (3, 6): + def choices(population: Sequence[_T], weights: Optional[Sequence[float]] = ..., *, cum_weights: Optional[Sequence[float]] = ..., k: int = ...) -> List[_T]: ... +def shuffle(x: List[Any], random: Union[Callable[[], float], None] = ...) -> None: ... +def sample(population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ... +def random() -> float: ... +def uniform(a: float, b: float) -> float: ... +def triangular(low: float = ..., high: float = ..., + mode: float = ...) -> float: ... +def betavariate(alpha: float, beta: float) -> float: ... +def expovariate(lambd: float) -> float: ... +def gammavariate(alpha: float, beta: float) -> float: ... +def gauss(mu: float, sigma: float) -> float: ... +def lognormvariate(mu: float, sigma: float) -> float: ... +def normalvariate(mu: float, sigma: float) -> float: ... +def vonmisesvariate(mu: float, kappa: float) -> float: ... +def paretovariate(alpha: float) -> float: ... +def weibullvariate(alpha: float, beta: float) -> float: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/re.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/re.pyi new file mode 100644 index 00000000..259f787c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/re.pyi @@ -0,0 +1,160 @@ +# Stubs for re +# Ron Murawski +# 'bytes' support added by Jukka Lehtosalo + +# based on: http://docs.python.org/3.2/library/re.html +# and http://hg.python.org/cpython/file/618ea5612e83/Lib/re.py + +import sys +from typing import ( + List, Iterator, overload, Callable, Tuple, + AnyStr, Any, Optional, Union +) + +# ----- re variables and constants ----- +if sys.version_info >= (3, 7): + from typing import Pattern as Pattern, Match as Match +else: + from typing import Pattern, Match + +if sys.version_info >= (3, 6): + import enum + class RegexFlag(enum.IntFlag): + A: int + ASCII: int + DEBUG: int + I: int + IGNORECASE: int + L: int + LOCALE: int + M: int + MULTILINE: int + S: int + DOTALL: int + X: int + VERBOSE: int + U: int + UNICODE: int + T: int + TEMPLATE: int + + A = RegexFlag.A + ASCII = RegexFlag.ASCII + DEBUG = RegexFlag.DEBUG + I = RegexFlag.I + IGNORECASE = RegexFlag.IGNORECASE + L = RegexFlag.L + LOCALE = RegexFlag.LOCALE + M = RegexFlag.M + MULTILINE = RegexFlag.MULTILINE + S = RegexFlag.S + DOTALL = RegexFlag.DOTALL + X = RegexFlag.X + VERBOSE = RegexFlag.VERBOSE + U = RegexFlag.U + UNICODE = RegexFlag.UNICODE + T = RegexFlag.T + TEMPLATE = RegexFlag.TEMPLATE + _FlagsType = Union[int, RegexFlag] +else: + A: int + ASCII: int + DEBUG: int + I: int + IGNORECASE: int + L: int + LOCALE: int + M: int + MULTILINE: int + S: int + DOTALL: int + X: int + VERBOSE: int + U: int + UNICODE: int + T: int + TEMPLATE: int + _FlagsType = int + +if sys.version_info < (3, 7): + # undocumented + _pattern_type: type + +class error(Exception): ... + +@overload +def compile(pattern: AnyStr, flags: _FlagsType = ...) -> Pattern[AnyStr]: ... +@overload +def compile(pattern: Pattern[AnyStr], flags: _FlagsType = ...) -> Pattern[AnyStr]: ... + +@overload +def search(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... +@overload +def search(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... + +@overload +def match(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... +@overload +def match(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... + +# New in Python 3.4 +@overload +def fullmatch(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... +@overload +def fullmatch(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ... + +@overload +def split(pattern: AnyStr, string: AnyStr, + maxsplit: int = ..., flags: _FlagsType = ...) -> List[AnyStr]: ... +@overload +def split(pattern: Pattern[AnyStr], string: AnyStr, + maxsplit: int = ..., flags: _FlagsType = ...) -> List[AnyStr]: ... + +@overload +def findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> List[Any]: ... +@overload +def findall(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> List[Any]: ... + +# Return an iterator yielding match objects over all non-overlapping matches +# for the RE pattern in string. The string is scanned left-to-right, and +# matches are returned in the order found. Empty matches are included in the +# result unless they touch the beginning of another match. +@overload +def finditer(pattern: AnyStr, string: AnyStr, + flags: _FlagsType = ...) -> Iterator[Match[AnyStr]]: ... +@overload +def finditer(pattern: Pattern[AnyStr], string: AnyStr, + flags: _FlagsType = ...) -> Iterator[Match[AnyStr]]: ... + +@overload +def sub(pattern: AnyStr, repl: AnyStr, string: AnyStr, count: int = ..., + flags: _FlagsType = ...) -> AnyStr: ... +@overload +def sub(pattern: AnyStr, repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., flags: _FlagsType = ...) -> AnyStr: ... +@overload +def sub(pattern: Pattern[AnyStr], repl: AnyStr, string: AnyStr, count: int = ..., + flags: _FlagsType = ...) -> AnyStr: ... +@overload +def sub(pattern: Pattern[AnyStr], repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., flags: _FlagsType = ...) -> AnyStr: ... + +@overload +def subn(pattern: AnyStr, repl: AnyStr, string: AnyStr, count: int = ..., + flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ... +@overload +def subn(pattern: AnyStr, repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., + flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ... +@overload +def subn(pattern: Pattern[AnyStr], repl: AnyStr, string: AnyStr, count: int = ..., + flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ... +@overload +def subn(pattern: Pattern[AnyStr], repl: Callable[[Match[AnyStr]], AnyStr], + string: AnyStr, count: int = ..., + flags: _FlagsType = ...) -> Tuple[AnyStr, int]: ... + +def escape(string: AnyStr) -> AnyStr: ... + +def purge() -> None: ... +def template(pattern: Union[AnyStr, Pattern[AnyStr]], flags: _FlagsType = ...) -> Pattern[AnyStr]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/reprlib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/reprlib.pyi new file mode 100644 index 00000000..7ff879bc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/reprlib.pyi @@ -0,0 +1,37 @@ +# Stubs for reprlib (Python 3) + +from array import array +from typing import Any, Callable, Deque, Dict, FrozenSet, List, Set, Tuple + +_ReprFunc = Callable[[Any], str] + +def recursive_repr(fillvalue: str = ...) -> Callable[[_ReprFunc], _ReprFunc]: ... + +class Repr: + maxlevel: int + maxdict: int + maxlist: int + maxtuple: int + maxset: int + maxfrozenset: int + maxdeque: int + maxarray: int + maxlong: int + maxstring: int + maxother: int + def __init__(self) -> None: ... + def repr(self, x: Any) -> str: ... + def repr1(self, x: Any, level: int) -> str: ... + def repr_tuple(self, x: Tuple[Any, ...], level: int) -> str: ... + def repr_list(self, x: List[Any], level: int) -> str: ... + def repr_array(self, x: array[Any], level: int) -> str: ... + def repr_set(self, x: Set[Any], level: int) -> str: ... + def repr_frozenset(self, x: FrozenSet[Any], level: int) -> str: ... + def repr_deque(self, x: Deque[Any], level: int) -> str: ... + def repr_dict(self, x: Dict[Any, Any], level: int) -> str: ... + def repr_str(self, x: str, level: int) -> str: ... + def repr_int(self, x: int, level: int) -> str: ... + def repr_instance(self, x: Any, level: int) -> str: ... + +aRepr: Repr +def repr(x: object) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/resource.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/resource.pyi new file mode 100644 index 00000000..b4a6829f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/resource.pyi @@ -0,0 +1,53 @@ +# Stubs for resource + +# NOTE: These are incomplete! + +from typing import Tuple, Optional, NamedTuple + +RLIMIT_AS: int +RLIMIT_CORE: int +RLIMIT_CPU: int +RLIMIT_DATA: int +RLIMIT_FSIZE: int +RLIMIT_MEMLOCK: int +RLIMIT_MSGQUEUE: int +RLIMIT_NICE: int +RLIMIT_NOFILE: int +RLIMIT_NPROC: int +RLIMIT_OFILE: int +RLIMIT_RSS: int +RLIMIT_RTPRIO: int +RLIMIT_RTTIME: int +RLIMIT_SIGPENDING: int +RLIMIT_STACK: int +RLIM_INFINITY: int +RUSAGE_CHILDREN: int +RUSAGE_SELF: int +RUSAGE_THREAD: int + +class _RUsage(NamedTuple): + ru_utime: float + ru_stime: float + ru_maxrss: int + ru_ixrss: int + ru_idrss: int + ru_isrss: int + ru_minflt: int + ru_majflt: int + ru_nswap: int + ru_inblock: int + ru_oublock: int + ru_msgsnd: int + ru_msgrcv: int + ru_nsignals: int + ru_nvcsw: int + ru_nivcsw: int + +def getpagesize() -> int: ... +def getrlimit(resource: int) -> Tuple[int, int]: ... +def getrusage(who: int) -> _RUsage: ... +def prlimit(pid: int, resource: int, limits: Optional[Tuple[int, int]]) -> Tuple[int, int]: ... +def setrlimit(resource: int, limits: Tuple[int, int]) -> None: ... + +# NOTE: This is an alias of OSError in Python 3.3. +class error(Exception): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/runpy.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/runpy.pyi new file mode 100644 index 00000000..654c53c8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/runpy.pyi @@ -0,0 +1,23 @@ +from types import ModuleType +from typing import Dict, Optional, Any + +class _TempModule: + mod_name: str = ... + module: ModuleType = ... + def __init__(self, mod_name): ... + def __enter__(self): ... + def __exit__(self, *args): ... + +class _ModifiedArgv0: + value: Any = ... + def __init__(self, value): ... + def __enter__(self): ... + def __exit__(self, *args): ... + +def run_module(mod_name: str, + init_globals: Optional[Dict[str, Any]] = ..., + run_name: Optional[str] = ..., + alter_sys: bool = ...): ... +def run_path(path_name: str, + init_globals: Optional[Dict[str, Any]] = ..., + run_name: str = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/selectors.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/selectors.pyi new file mode 100644 index 00000000..99e311da --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/selectors.pyi @@ -0,0 +1,84 @@ +# Stubs for selector +# See https://docs.python.org/3/library/selectors.html + +from abc import ABCMeta, abstractmethod +from typing import Any, List, Mapping, NamedTuple, Optional, Protocol, Tuple, Union + +class _HasFileno(Protocol): + def fileno(self) -> int: ... + +# Type aliases added mainly to preserve some context +_FileObject = Union[int, _HasFileno] +_FileDescriptor = int +_EventMask = int + +EVENT_READ: _EventMask +EVENT_WRITE: _EventMask + +class SelectorKey(NamedTuple): + fileobj: _FileObject + fd: _FileDescriptor + events: _EventMask + data: Any + +class BaseSelector(metaclass=ABCMeta): + @abstractmethod + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + + @abstractmethod + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + + def modify(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + + @abstractmethod + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + + def close(self) -> None: ... + + def get_key(self, fileobj: _FileObject) -> SelectorKey: ... + + @abstractmethod + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + + def __enter__(self) -> BaseSelector: ... + + def __exit__(self, *args: Any) -> None: ... + +class SelectSelector(BaseSelector): + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + +class PollSelector(BaseSelector): + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + +class EpollSelector(BaseSelector): + def fileno(self) -> int: ... + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + +class DevpollSelector(BaseSelector): + def fileno(self) -> int: ... + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + +class KqueueSelector(BaseSelector): + def fileno(self) -> int: ... + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... + +class DefaultSelector(BaseSelector): + def register(self, fileobj: _FileObject, events: _EventMask, data: Any = ...) -> SelectorKey: ... + def unregister(self, fileobj: _FileObject) -> SelectorKey: ... + def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ... + def get_map(self) -> Mapping[_FileObject, SelectorKey]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/shelve.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/shelve.pyi new file mode 100644 index 00000000..97a045e0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/shelve.pyi @@ -0,0 +1,31 @@ +from typing import Any, Dict, Iterator, Optional, Tuple +import collections + + +class Shelf(collections.MutableMapping[Any, Any]): + def __init__(self, dict: Dict[bytes, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ...) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + def __contains__(self, key: Any) -> bool: ... # key should be str, but it would conflict with superclass's type signature + def get(self, key: str, default: Any = ...) -> Any: ... + def __getitem__(self, key: str) -> Any: ... + def __setitem__(self, key: str, value: Any) -> None: ... + def __delitem__(self, key: str) -> None: ... + def __enter__(self) -> Shelf: ... + def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ... + def close(self) -> None: ... + def __del__(self) -> None: ... + def sync(self) -> None: ... + +class BsdDbShelf(Shelf): + def __init__(self, dict: Dict[bytes, Any], protocol: Optional[int] = ..., writeback: bool = ..., keyencoding: str = ...) -> None: ... + def set_location(self, key: Any) -> Tuple[str, Any]: ... + def next(self) -> Tuple[str, Any]: ... + def previous(self) -> Tuple[str, Any]: ... + def first(self) -> Tuple[str, Any]: ... + def last(self) -> Tuple[str, Any]: ... + +class DbfilenameShelf(Shelf): + def __init__(self, filename: str, flag: str = ..., protocol: Optional[int] = ..., writeback: bool = ...) -> None: ... + +def open(filename: str, flag: str = ..., protocol: Optional[int] = ..., writeback: bool = ...) -> DbfilenameShelf: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/shlex.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/shlex.pyi new file mode 100644 index 00000000..51ed42d9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/shlex.pyi @@ -0,0 +1,45 @@ +from typing import List, Tuple, Any, TextIO, Union, Optional, Iterable, TypeVar +import sys + +def split(s: str, comments: bool = ..., posix: bool = ...) -> List[str]: ... +if sys.version_info >= (3, 8): + def join(split_command: Iterable[str]) -> str: ... +def quote(s: str) -> str: ... + +_SLT = TypeVar('_SLT', bound=shlex) + +class shlex(Iterable[str]): + commenters: str + wordchars: str + whitespace: str + escape: str + quotes: str + escapedquotes: str + whitespace_split: bool + infile: str + instream: TextIO + source: str + debug: int + lineno: int + token: str + eof: str + if sys.version_info >= (3, 6): + punctuation_chars: str + + if sys.version_info >= (3, 6): + def __init__(self, instream: Union[str, TextIO] = ..., infile: Optional[str] = ..., + posix: bool = ..., punctuation_chars: Union[bool, str] = ...) -> None: ... + else: + def __init__(self, instream: Union[str, TextIO] = ..., infile: Optional[str] = ..., + posix: bool = ...) -> None: ... + def get_token(self) -> str: ... + def push_token(self, tok: str) -> None: ... + def read_token(self) -> str: ... + def sourcehook(self, filename: str) -> Tuple[str, TextIO]: ... + # TODO argument types + def push_source(self, newstream: Any, newfile: Any = ...) -> None: ... + def pop_source(self) -> None: ... + def error_leader(self, infile: str = ..., + lineno: int = ...) -> None: ... + def __iter__(self: _SLT) -> _SLT: ... + def __next__(self) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/signal.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/signal.pyi new file mode 100644 index 00000000..dd457d8c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/signal.pyi @@ -0,0 +1,148 @@ +"""Stub file for the 'signal' module.""" + +from enum import IntEnum +from typing import Any, Callable, Tuple, Union, Optional, Iterable, Set +from types import FrameType + +class ItimerError(IOError): ... + +ITIMER_PROF: int +ITIMER_REAL: int +ITIMER_VIRTUAL: int + +NSIG: int + +class Signals(IntEnum): + SIGABRT: int + SIGALRM: int + SIGBREAK: int # Windows + SIGBUS: int + SIGCHLD: int + SIGCLD: int + SIGCONT: int + SIGEMT: int + SIGFPE: int + SIGHUP: int + SIGILL: int + SIGINFO: int + SIGINT: int + SIGIO: int + SIGIOT: int + SIGKILL: int + SIGPIPE: int + SIGPOLL: int + SIGPROF: int + SIGPWR: int + SIGQUIT: int + SIGRTMAX: int + SIGRTMIN: int + SIGSEGV: int + SIGSTOP: int + SIGSYS: int + SIGTERM: int + SIGTRAP: int + SIGTSTP: int + SIGTTIN: int + SIGTTOU: int + SIGURG: int + SIGUSR1: int + SIGUSR2: int + SIGVTALRM: int + SIGWINCH: int + SIGXCPU: int + SIGXFSZ: int + +class Handlers(IntEnum): + SIG_DFL: int + SIG_IGN: int + +SIG_DFL = Handlers.SIG_DFL +SIG_IGN = Handlers.SIG_IGN + +class Sigmasks(IntEnum): + SIG_BLOCK: int + SIG_UNBLOCK: int + SIG_SETMASK: int + +SIG_BLOCK = Sigmasks.SIG_BLOCK +SIG_UNBLOCK = Sigmasks.SIG_UNBLOCK +SIG_SETMASK = Sigmasks.SIG_SETMASK + +_SIGNUM = Union[int, Signals] +_HANDLER = Union[Callable[[Signals, FrameType], None], int, Handlers, None] + +SIGABRT: Signals +SIGALRM: Signals +SIGBREAK: Signals # Windows +SIGBUS: Signals +SIGCHLD: Signals +SIGCLD: Signals +SIGCONT: Signals +SIGEMT: Signals +SIGFPE: Signals +SIGHUP: Signals +SIGILL: Signals +SIGINFO: Signals +SIGINT: Signals +SIGIO: Signals +SIGIOT: Signals +SIGKILL: Signals +SIGPIPE: Signals +SIGPOLL: Signals +SIGPROF: Signals +SIGPWR: Signals +SIGQUIT: Signals +SIGRTMAX: Signals +SIGRTMIN: Signals +SIGSEGV: Signals +SIGSTOP: Signals +SIGSYS: Signals +SIGTERM: Signals +SIGTRAP: Signals +SIGTSTP: Signals +SIGTTIN: Signals +SIGTTOU: Signals +SIGURG: Signals +SIGUSR1: Signals +SIGUSR2: Signals +SIGVTALRM: Signals +SIGWINCH: Signals +SIGXCPU: Signals +SIGXFSZ: Signals + +# Windows +CTRL_C_EVENT: int +CTRL_BREAK_EVENT: int + +class struct_siginfo(Tuple[int, int, int, int, int, int, int]): + def __init__(self, sequence: Iterable[int]) -> None: ... + @property + def si_signo(self) -> int: ... + @property + def si_code(self) -> int: ... + @property + def si_errno(self) -> int: ... + @property + def si_pid(self) -> int: ... + @property + def si_uid(self) -> int: ... + @property + def si_status(self) -> int: ... + @property + def si_band(self) -> int: ... + +def alarm(time: int) -> int: ... +def default_int_handler(signum: int, frame: FrameType) -> None: ... +def getitimer(which: int) -> Tuple[float, float]: ... +def getsignal(signalnum: _SIGNUM) -> _HANDLER: ... +def pause() -> None: ... +def pthread_kill(thread_id: int, signum: int) -> None: ... +def pthread_sigmask(how: int, mask: Iterable[int]) -> Set[_SIGNUM]: ... +def set_wakeup_fd(fd: int) -> int: ... +def setitimer(which: int, seconds: float, interval: float = ...) -> Tuple[float, float]: ... +def siginterrupt(signalnum: int, flag: bool) -> None: ... +def signal(signalnum: _SIGNUM, handler: _HANDLER) -> _HANDLER: ... +def sigpending() -> Any: ... +def sigtimedwait(sigset: Iterable[int], timeout: float) -> Optional[struct_siginfo]: ... +def sigwait(sigset: Iterable[int]) -> _SIGNUM: ... +def sigwaitinfo(sigset: Iterable[int]) -> struct_siginfo: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/smtplib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/smtplib.pyi new file mode 100644 index 00000000..60e3a35b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/smtplib.pyi @@ -0,0 +1,136 @@ +from email.message import Message as _Message +from socket import socket +from ssl import SSLContext +from types import TracebackType +from typing import Any, Dict, List, Optional, Sequence, Tuple, Union, Pattern, Type, Protocol, overload + +_Reply = Tuple[int, bytes] +_SendErrs = Dict[str, _Reply] +# Should match source_address for socket.create_connection +_SourceAddress = Tuple[Union[bytearray, bytes, str], int] + +SMTP_PORT: int +SMTP_SSL_PORT: int +CRLF: str +bCRLF: bytes + +OLDSTYLE_AUTH: Pattern[str] + +class SMTPException(OSError): ... +class SMTPNotSupportedError(SMTPException): ... +class SMTPServerDisconnected(SMTPException): ... + +class SMTPResponseException(SMTPException): + smtp_code: int + smtp_error: Union[bytes, str] + args: Union[Tuple[int, Union[bytes, str]], Tuple[int, bytes, str]] + def __init__(self, code: int, msg: Union[bytes, str]) -> None: ... + +class SMTPSenderRefused(SMTPResponseException): + smtp_code: int + smtp_error: bytes + sender: str + args: Tuple[int, bytes, str] + def __init__(self, code: int, msg: bytes, sender: str) -> None: ... + +class SMTPRecipientsRefused(SMTPException): + recipients: _SendErrs + args: Tuple[_SendErrs] + def __init__(self, recipients: _SendErrs) -> None: ... + +class SMTPDataError(SMTPResponseException): ... +class SMTPConnectError(SMTPResponseException): ... +class SMTPHeloError(SMTPResponseException): ... +class SMTPAuthenticationError(SMTPResponseException): ... + +def quoteaddr(addrstring: str) -> str: ... +def quotedata(data: str) -> str: ... + +class _AuthObject(Protocol): + @overload + def __call__(self, challenge: None = ...) -> Optional[str]: ... + @overload + def __call__(self, challenge: bytes) -> str: ... + +class SMTP: + debuglevel: int = ... + sock: Optional[socket] = ... + # Type of file should match what socket.makefile() returns + file: Optional[Any] = ... + helo_resp: Optional[bytes] = ... + ehlo_msg: str = ... + ehlo_resp: Optional[bytes] = ... + does_esmtp: bool = ... + default_port: int = ... + timeout: float + esmtp_features: Dict[str, str] + command_encoding: str + source_address: Optional[_SourceAddress] + local_hostname: str + def __init__(self, host: str = ..., port: int = ..., + local_hostname: Optional[str] = ..., timeout: float = ..., + source_address: Optional[_SourceAddress] = ...) -> None: ... + def __enter__(self) -> SMTP: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_value: Optional[BaseException], + tb: Optional[TracebackType]) -> None: ... + def set_debuglevel(self, debuglevel: int) -> None: ... + def connect(self, host: str = ..., port: int = ..., + source_address: Optional[_SourceAddress] = ...) -> _Reply: ... + def send(self, s: Union[bytes, str]) -> None: ... + def putcmd(self, cmd: str, args: str = ...) -> None: ... + def getreply(self) -> _Reply: ... + def docmd(self, cmd: str, args: str = ...) -> _Reply: ... + def helo(self, name: str = ...) -> _Reply: ... + def ehlo(self, name: str = ...) -> _Reply: ... + def has_extn(self, opt: str) -> bool: ... + def help(self, args: str = ...) -> bytes: ... + def rset(self) -> _Reply: ... + def noop(self) -> _Reply: ... + def mail(self, sender: str, options: Sequence[str] = ...) -> _Reply: ... + def rcpt(self, recip: str, options: Sequence[str] = ...) -> _Reply: ... + def data(self, msg: Union[bytes, str]) -> _Reply: ... + def verify(self, address: str) -> _Reply: ... + vrfy = verify + def expn(self, address: str) -> _Reply: ... + def ehlo_or_helo_if_needed(self) -> None: ... + user: str + password: str + def auth(self, mechanism: str, authobject: _AuthObject, *, initial_response_ok: bool = ...) -> _Reply: ... + @overload + def auth_cram_md5(self, challenge: None = ...) -> None: ... + @overload + def auth_cram_md5(self, challenge: bytes) -> str: ... + def auth_plain(self, challenge: Optional[bytes] = ...) -> str: ... + def auth_login(self, challenge: Optional[bytes] = ...) -> str: ... + def login(self, user: str, password: str, *, initial_response_ok: bool = ...) -> _Reply: ... + def starttls(self, keyfile: Optional[str] = ..., certfile: Optional[str] = ..., + context: Optional[SSLContext] = ...) -> _Reply: ... + def sendmail(self, from_addr: str, to_addrs: Union[str, Sequence[str]], + msg: Union[bytes, str], mail_options: Sequence[str] = ..., + rcpt_options: List[str] = ...) -> _SendErrs: ... + def send_message(self, msg: _Message, from_addr: Optional[str] = ..., + to_addrs: Optional[Union[str, Sequence[str]]] = ..., + mail_options: List[str] = ..., + rcpt_options: Sequence[str] = ...) -> _SendErrs: ... + def close(self) -> None: ... + def quit(self) -> _Reply: ... + +class SMTP_SSL(SMTP): + default_port: int = ... + keyfile: Optional[str] + certfile: Optional[str] + context: SSLContext + def __init__(self, host: str = ..., port: int = ..., + local_hostname: Optional[str] = ..., + keyfile: Optional[str] = ..., certfile: Optional[str] = ..., + timeout: float = ..., + source_address: Optional[_SourceAddress] = ..., + context: Optional[SSLContext] = ...) -> None: ... + +LMTP_PORT: int + +class LMTP(SMTP): + def __init__(self, host: str = ..., port: int = ..., + local_hostname: Optional[str] = ..., + source_address: Optional[_SourceAddress] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/socketserver.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/socketserver.pyi new file mode 100644 index 00000000..0b4d3a27 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/socketserver.pyi @@ -0,0 +1,99 @@ +# NB: SocketServer.pyi and socketserver.pyi must remain consistent! +# Stubs for socketserver + +from typing import Any, BinaryIO, Callable, Optional, Tuple, Type, Text, Union +from socket import SocketType +import sys +import types + +class BaseServer: + address_family: int + RequestHandlerClass: Callable[..., BaseRequestHandler] + server_address: Tuple[str, int] + socket: SocketType + allow_reuse_address: bool + request_queue_size: int + socket_type: int + timeout: Optional[float] + def __init__(self, server_address: Any, + RequestHandlerClass: Callable[..., BaseRequestHandler]) -> None: ... + def fileno(self) -> int: ... + def handle_request(self) -> None: ... + def serve_forever(self, poll_interval: float = ...) -> None: ... + def shutdown(self) -> None: ... + def server_close(self) -> None: ... + def finish_request(self, request: bytes, + client_address: Tuple[str, int]) -> None: ... + def get_request(self) -> None: ... + def handle_error(self, request: bytes, + client_address: Tuple[str, int]) -> None: ... + def handle_timeout(self) -> None: ... + def process_request(self, request: bytes, + client_address: Tuple[str, int]) -> None: ... + def server_activate(self) -> None: ... + def server_bind(self) -> None: ... + def verify_request(self, request: bytes, + client_address: Tuple[str, int]) -> bool: ... + if sys.version_info >= (3, 6): + def __enter__(self) -> BaseServer: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[types.TracebackType]) -> None: ... + if sys.version_info >= (3, 3): + def service_actions(self) -> None: ... + +class TCPServer(BaseServer): + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: Callable[..., BaseRequestHandler], + bind_and_activate: bool = ...) -> None: ... + +class UDPServer(BaseServer): + def __init__(self, server_address: Tuple[str, int], + RequestHandlerClass: Callable[..., BaseRequestHandler], + bind_and_activate: bool = ...) -> None: ... + +if sys.platform != 'win32': + class UnixStreamServer(BaseServer): + def __init__(self, server_address: Union[Text, bytes], + RequestHandlerClass: Callable[..., BaseRequestHandler], + bind_and_activate: bool = ...) -> None: ... + + class UnixDatagramServer(BaseServer): + def __init__(self, server_address: Union[Text, bytes], + RequestHandlerClass: Callable[..., BaseRequestHandler], + bind_and_activate: bool = ...) -> None: ... + +class ForkingMixIn: ... +class ThreadingMixIn: ... + +class ForkingTCPServer(ForkingMixIn, TCPServer): ... +class ForkingUDPServer(ForkingMixIn, UDPServer): ... +class ThreadingTCPServer(ThreadingMixIn, TCPServer): ... +class ThreadingUDPServer(ThreadingMixIn, UDPServer): ... +if sys.platform != 'win32': + class ThreadingUnixStreamServer(ThreadingMixIn, UnixStreamServer): ... + class ThreadingUnixDatagramServer(ThreadingMixIn, UnixDatagramServer): ... + + +class BaseRequestHandler: + # Those are technically of types, respectively: + # * Union[SocketType, Tuple[bytes, SocketType]] + # * Union[Tuple[str, int], str] + # But there are some concerns that having unions here would cause + # too much inconvenience to people using it (see + # https://github.com/python/typeshed/pull/384#issuecomment-234649696) + request: Any + client_address: Any + + server: BaseServer + def setup(self) -> None: ... + def handle(self) -> None: ... + def finish(self) -> None: ... + +class StreamRequestHandler(BaseRequestHandler): + rfile: BinaryIO + wfile: BinaryIO + +class DatagramRequestHandler(BaseRequestHandler): + rfile: BinaryIO + wfile: BinaryIO diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/spwd.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/spwd.pyi new file mode 100644 index 00000000..1fb972f6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/spwd.pyi @@ -0,0 +1,15 @@ +from typing import List, NamedTuple + +class struct_spwd(NamedTuple): + sp_namp: str + sp_pwdp: str + sp_lstchg: int + sp_min: int + sp_max: int + sp_warn: int + sp_inact: int + sp_expire: int + sp_flag: int + +def getspall() -> List[struct_spwd]: ... +def getspnam(name: str) -> struct_spwd: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/sre_constants.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/sre_constants.pyi new file mode 100644 index 00000000..85f50ca0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/sre_constants.pyi @@ -0,0 +1,114 @@ +# Source: https://github.com/python/cpython/blob/master/Lib/sre_constants.py + +from typing import Any, Dict, List, Optional, Union + +MAGIC: int + +class error(Exception): + msg: str + pattern: Optional[Union[str, bytes]] + pos: Optional[int] + lineno: int + colno: int + def __init__(self, msg: str, pattern: Union[str, bytes] = ..., pos: int = ...) -> None: ... + +class _NamedIntConstant(int): + name: Any + def __new__(cls, value: int, name: str): ... + +MAXREPEAT: _NamedIntConstant +OPCODES: List[_NamedIntConstant] +ATCODES: List[_NamedIntConstant] +CHCODES: List[_NamedIntConstant] +OP_IGNORE: Dict[_NamedIntConstant, _NamedIntConstant] +AT_MULTILINE: Dict[_NamedIntConstant, _NamedIntConstant] +AT_LOCALE: Dict[_NamedIntConstant, _NamedIntConstant] +AT_UNICODE: Dict[_NamedIntConstant, _NamedIntConstant] +CH_LOCALE: Dict[_NamedIntConstant, _NamedIntConstant] +CH_UNICODE: Dict[_NamedIntConstant, _NamedIntConstant] +SRE_FLAG_TEMPLATE: int +SRE_FLAG_IGNORECASE: int +SRE_FLAG_LOCALE: int +SRE_FLAG_MULTILINE: int +SRE_FLAG_DOTALL: int +SRE_FLAG_UNICODE: int +SRE_FLAG_VERBOSE: int +SRE_FLAG_DEBUG: int +SRE_FLAG_ASCII: int +SRE_INFO_PREFIX: int +SRE_INFO_LITERAL: int +SRE_INFO_CHARSET: int + + +# Stubgen above; manually defined constants below (dynamic at runtime) + +# from OPCODES +FAILURE: _NamedIntConstant +SUCCESS: _NamedIntConstant +ANY: _NamedIntConstant +ANY_ALL: _NamedIntConstant +ASSERT: _NamedIntConstant +ASSERT_NOT: _NamedIntConstant +AT: _NamedIntConstant +BRANCH: _NamedIntConstant +CALL: _NamedIntConstant +CATEGORY: _NamedIntConstant +CHARSET: _NamedIntConstant +BIGCHARSET: _NamedIntConstant +GROUPREF: _NamedIntConstant +GROUPREF_EXISTS: _NamedIntConstant +GROUPREF_IGNORE: _NamedIntConstant +IN: _NamedIntConstant +IN_IGNORE: _NamedIntConstant +INFO: _NamedIntConstant +JUMP: _NamedIntConstant +LITERAL: _NamedIntConstant +LITERAL_IGNORE: _NamedIntConstant +MARK: _NamedIntConstant +MAX_UNTIL: _NamedIntConstant +MIN_UNTIL: _NamedIntConstant +NOT_LITERAL: _NamedIntConstant +NOT_LITERAL_IGNORE: _NamedIntConstant +NEGATE: _NamedIntConstant +RANGE: _NamedIntConstant +REPEAT: _NamedIntConstant +REPEAT_ONE: _NamedIntConstant +SUBPATTERN: _NamedIntConstant +MIN_REPEAT_ONE: _NamedIntConstant +RANGE_IGNORE: _NamedIntConstant +MIN_REPEAT: _NamedIntConstant +MAX_REPEAT: _NamedIntConstant + +# from ATCODES +AT_BEGINNING: _NamedIntConstant +AT_BEGINNING_LINE: _NamedIntConstant +AT_BEGINNING_STRING: _NamedIntConstant +AT_BOUNDARY: _NamedIntConstant +AT_NON_BOUNDARY: _NamedIntConstant +AT_END: _NamedIntConstant +AT_END_LINE: _NamedIntConstant +AT_END_STRING: _NamedIntConstant +AT_LOC_BOUNDARY: _NamedIntConstant +AT_LOC_NON_BOUNDARY: _NamedIntConstant +AT_UNI_BOUNDARY: _NamedIntConstant +AT_UNI_NON_BOUNDARY: _NamedIntConstant + +# from CHCODES +CATEGORY_DIGIT: _NamedIntConstant +CATEGORY_NOT_DIGIT: _NamedIntConstant +CATEGORY_SPACE: _NamedIntConstant +CATEGORY_NOT_SPACE: _NamedIntConstant +CATEGORY_WORD: _NamedIntConstant +CATEGORY_NOT_WORD: _NamedIntConstant +CATEGORY_LINEBREAK: _NamedIntConstant +CATEGORY_NOT_LINEBREAK: _NamedIntConstant +CATEGORY_LOC_WORD: _NamedIntConstant +CATEGORY_LOC_NOT_WORD: _NamedIntConstant +CATEGORY_UNI_DIGIT: _NamedIntConstant +CATEGORY_UNI_NOT_DIGIT: _NamedIntConstant +CATEGORY_UNI_SPACE: _NamedIntConstant +CATEGORY_UNI_NOT_SPACE: _NamedIntConstant +CATEGORY_UNI_WORD: _NamedIntConstant +CATEGORY_UNI_NOT_WORD: _NamedIntConstant +CATEGORY_UNI_LINEBREAK: _NamedIntConstant +CATEGORY_UNI_NOT_LINEBREAK: _NamedIntConstant diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/sre_parse.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/sre_parse.pyi new file mode 100644 index 00000000..175fb54c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/sre_parse.pyi @@ -0,0 +1,97 @@ +# Source: https://github.com/python/cpython/blob/master/Lib/sre_parse.py + +from typing import ( + Any, Dict, FrozenSet, Iterable, List, Match, + Optional, Pattern as _Pattern, Tuple, Union +) +import sys +from sre_constants import _NamedIntConstant as NIC, error as _Error + +SPECIAL_CHARS: str +REPEAT_CHARS: str +DIGITS: FrozenSet[str] +OCTDIGITS: FrozenSet[str] +HEXDIGITS: FrozenSet[str] +ASCIILETTERS: FrozenSet[str] +WHITESPACE: FrozenSet[str] +ESCAPES: Dict[str, Tuple[NIC, int]] +CATEGORIES: Dict[str, Union[Tuple[NIC, NIC], Tuple[NIC, List[Tuple[NIC, NIC]]]]] +FLAGS: Dict[str, int] +GLOBAL_FLAGS: int + +class Verbose(Exception): ... + +class _State: + flags: int + groupdict: Dict[str, int] + groupwidths: List[Optional[int]] + lookbehindgroups: Optional[int] + def __init__(self) -> None: ... + @property + def groups(self) -> int: ... + def opengroup(self, name: str = ...) -> int: ... + def closegroup(self, gid: int, p: SubPattern) -> None: ... + def checkgroup(self, gid: int) -> bool: ... + def checklookbehindgroup(self, gid: int, source: Tokenizer) -> None: ... + +if sys.version_info >= (3, 8): + State = _State +else: + Pattern = _State + + +_OpSubpatternType = Tuple[Optional[int], int, int, SubPattern] +_OpGroupRefExistsType = Tuple[int, SubPattern, SubPattern] +_OpInType = List[Tuple[NIC, int]] +_OpBranchType = Tuple[None, List[SubPattern]] +_AvType = Union[_OpInType, _OpBranchType, Iterable[SubPattern], _OpGroupRefExistsType, _OpSubpatternType] +_CodeType = Tuple[NIC, _AvType] + + +class SubPattern: + data: List[_CodeType] + width: Optional[int] + + if sys.version_info >= (3, 8): + state: State + def __init__(self, state: State, data: List[_CodeType] = ...) -> None: ... + else: + pattern: Pattern + def __init__(self, pattern: Pattern, data: List[_CodeType] = ...) -> None: ... + + def dump(self, level: int = ...) -> None: ... + def __len__(self) -> int: ... + def __delitem__(self, index: Union[int, slice]) -> None: ... + def __getitem__(self, index: Union[int, slice]) -> Union[SubPattern, _CodeType]: ... + def __setitem__(self, index: Union[int, slice], code: _CodeType) -> None: ... + def insert(self, index: int, code: _CodeType) -> None: ... + def append(self, code: _CodeType) -> None: ... + def getwidth(self) -> int: ... + + +class Tokenizer: + istext: bool + string: Any + decoded_string: str + index: int + next: Optional[str] + def __init__(self, string: Any) -> None: ... + def match(self, char: str) -> bool: ... + def get(self) -> Optional[str]: ... + def getwhile(self, n: int, charset: Iterable[str]) -> str: ... + def getuntil(self, terminator: str) -> str: ... + @property + def pos(self) -> int: ... + def tell(self) -> int: ... + def seek(self, index: int) -> None: ... + def error(self, msg: str, offset: int = ...) -> _Error: ... + +def fix_flags(src: Union[str, bytes], flag: int) -> int: ... +_TemplateType = Tuple[List[Tuple[int, int]], List[str]] +if sys.version_info >= (3, 8): + def parse(str: str, flags: int = ..., state: State = ...) -> SubPattern: ... + def parse_template(source: str, state: _Pattern[Any]) -> _TemplateType: ... +else: + def parse(str: str, flags: int = ..., pattern: Pattern = ...) -> SubPattern: ... + def parse_template(source: str, pattern: _Pattern[Any]) -> _TemplateType: ... +def expand_template(template: _TemplateType, match: Match[Any]) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/stat.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/stat.pyi new file mode 100644 index 00000000..b8cff23c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/stat.pyi @@ -0,0 +1,97 @@ +# Stubs for stat + +# Based on http://docs.python.org/3.2/library/stat.html + +import sys + +def S_ISDIR(mode: int) -> bool: ... +def S_ISCHR(mode: int) -> bool: ... +def S_ISBLK(mode: int) -> bool: ... +def S_ISREG(mode: int) -> bool: ... +def S_ISFIFO(mode: int) -> bool: ... +def S_ISLNK(mode: int) -> bool: ... +def S_ISSOCK(mode: int) -> bool: ... + +def S_IMODE(mode: int) -> int: ... +def S_IFMT(mode: int) -> int: ... + +def filemode(mode: int) -> str: ... + +ST_MODE: int +ST_INO: int +ST_DEV: int +ST_NLINK: int +ST_UID: int +ST_GID: int +ST_SIZE: int +ST_ATIME: int +ST_MTIME: int +ST_CTIME: int + +S_IFSOCK: int +S_IFLNK: int +S_IFREG: int +S_IFBLK: int +S_IFDIR: int +S_IFCHR: int +S_IFIFO: int +S_ISUID: int +S_ISGID: int +S_ISVTX: int + +S_IRWXU: int +S_IRUSR: int +S_IWUSR: int +S_IXUSR: int + +S_IRWXG: int +S_IRGRP: int +S_IWGRP: int +S_IXGRP: int + +S_IRWXO: int +S_IROTH: int +S_IWOTH: int +S_IXOTH: int + +S_ENFMT: int +S_IREAD: int +S_IWRITE: int +S_IEXEC: int + +UF_NODUMP: int +UF_IMMUTABLE: int +UF_APPEND: int +UF_OPAQUE: int +UF_NOUNLINK: int +if sys.platform == 'darwin': + UF_COMPRESSED: int # OS X 10.6+ only + UF_HIDDEN: int # OX X 10.5+ only +SF_ARCHIVED: int +SF_IMMUTABLE: int +SF_APPEND: int +SF_NOUNLINK: int +SF_SNAPSHOT: int + +FILE_ATTRIBUTE_ARCHIVE: int +FILE_ATTRIBUTE_COMPRESSED: int +FILE_ATTRIBUTE_DEVICE: int +FILE_ATTRIBUTE_DIRECTORY: int +FILE_ATTRIBUTE_ENCRYPTED: int +FILE_ATTRIBUTE_HIDDEN: int +FILE_ATTRIBUTE_INTEGRITY_STREAM: int +FILE_ATTRIBUTE_NORMAL: int +FILE_ATTRIBUTE_NOT_CONTENT_INDEXED: int +FILE_ATTRIBUTE_NO_SCRUB_DATA: int +FILE_ATTRIBUTE_OFFLINE: int +FILE_ATTRIBUTE_READONLY: int +FILE_ATTRIBUTE_REPARSE_POINT: int +FILE_ATTRIBUTE_SPARSE_FILE: int +FILE_ATTRIBUTE_SYSTEM: int +FILE_ATTRIBUTE_TEMPORARY: int +FILE_ATTRIBUTE_VIRTUAL: int + +if sys.platform == "win32" and sys.version_info >= (3, 8): + IO_REPARSE_TAG_SYMLINK: int + IO_REPARSE_TAG_MOUNT_POINT: int + IO_REPARSE_TAG_APPEXECLINK: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/statistics.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/statistics.pyi new file mode 100644 index 00000000..3181044e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/statistics.pyi @@ -0,0 +1,64 @@ +# Stubs for statistics + +from decimal import Decimal +from fractions import Fraction +import sys +from typing import Any, Iterable, List, Optional, SupportsFloat, Type, TypeVar, Union + +_T = TypeVar("_T") +# Most functions in this module accept homogeneous collections of one of these types +_Number = TypeVar('_Number', float, Decimal, Fraction) + +class StatisticsError(ValueError): ... + +if sys.version_info >= (3, 8): + def fmean(data: Iterable[SupportsFloat]) -> float: ... + def geometric_mean(data: Iterable[SupportsFloat]) -> float: ... +def mean(data: Iterable[_Number]) -> _Number: ... +if sys.version_info >= (3, 6): + def harmonic_mean(data: Iterable[_Number]) -> _Number: ... +def median(data: Iterable[_Number]) -> _Number: ... +def median_low(data: Iterable[_Number]) -> _Number: ... +def median_high(data: Iterable[_Number]) -> _Number: ... +def median_grouped(data: Iterable[_Number]) -> _Number: ... +def mode(data: Iterable[_Number]) -> _Number: ... +if sys.version_info >= (3, 8): + def multimode(data: Iterable[_T]) -> List[_T]: ... +def pstdev(data: Iterable[_Number], mu: Optional[_Number] = ...) -> _Number: ... +def pvariance(data: Iterable[_Number], mu: Optional[_Number] = ...) -> _Number: ... +if sys.version_info >= (3, 8): + def quantiles(data: Iterable[_Number], *, n: int = ..., method: str = ...) -> List[_Number]: ... +def stdev(data: Iterable[_Number], xbar: Optional[_Number] = ...) -> _Number: ... +def variance(data: Iterable[_Number], xbar: Optional[_Number] = ...) -> _Number: ... + +if sys.version_info >= (3, 8): + class NormalDist: + def __init__(self, mu: float = ..., sigma: float = ...) -> None: ... + @property + def mean(self) -> float: ... + @property + def median(self) -> float: ... + @property + def mode(self) -> float: ... + @property + def stdev(self) -> float: ... + @property + def variance(self) -> float: ... + @classmethod + def from_samples(cls: Type[_T], data: Iterable[SupportsFloat]) -> _T: ... + def samples(self, n: int, *, seed: Optional[Any]) -> List[float]: ... + def pdf(self, x: float) -> float: ... + def cdf(self, x: float) -> float: ... + def inv_cdf(self, p: float) -> float: ... + def overlap(self, other: NormalDist) -> float: ... + def quantiles(self, n: int = ...) -> List[float]: ... + def __add__(self, x2: Union[float, NormalDist]) -> NormalDist: ... + def __sub__(self, x2: Union[float, NormalDist]) -> NormalDist: ... + def __mul__(self, x2: float) -> NormalDist: ... + def __truediv__(self, x2: float) -> NormalDist: ... + def __pos__(self) -> NormalDist: ... + def __neg__(self) -> NormalDist: ... + __radd__ = __add__ + def __rsub__(self, x2: Union[float, NormalDist]) -> NormalDist: ... + __rmul__ = __mul__ + def __hash__(self) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/string.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/string.pyi new file mode 100644 index 00000000..6427a76d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/string.pyi @@ -0,0 +1,39 @@ +# Stubs for string + +# Based on http://docs.python.org/3.2/library/string.html + +from typing import Mapping, Sequence, Any, Optional, Union, Tuple, Iterable + +ascii_letters: str +ascii_lowercase: str +ascii_uppercase: str +digits: str +hexdigits: str +octdigits: str +punctuation: str +printable: str +whitespace: str + +def capwords(s: str, sep: str = ...) -> str: ... + +class Template: + template: str + + def __init__(self, template: str) -> None: ... + def substitute(self, mapping: Mapping[str, object] = ..., **kwds: object) -> str: ... + def safe_substitute(self, mapping: Mapping[str, object] = ..., + **kwds: object) -> str: ... + +# TODO(MichalPokorny): This is probably badly and/or loosely typed. +class Formatter: + def format(self, format_string: str, *args: Any, **kwargs: Any) -> str: ... + def vformat(self, format_string: str, args: Sequence[Any], + kwargs: Mapping[str, Any]) -> str: ... + def parse(self, format_string: str) -> Iterable[Tuple[str, Optional[str], Optional[str], Optional[str]]]: ... + def get_field(self, field_name: str, args: Sequence[Any], + kwargs: Mapping[str, Any]) -> Any: ... + def get_value(self, key: Union[int, str], args: Sequence[Any], kwargs: Mapping[str, Any]) -> Any: ... + def check_unused_args(self, used_args: Sequence[Union[int, str]], args: Sequence[Any], + kwargs: Mapping[str, Any]) -> None: ... + def format_field(self, value: Any, format_spec: str) -> Any: ... + def convert_field(self, value: Any, conversion: str) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/subprocess.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/subprocess.pyi new file mode 100644 index 00000000..2fd8b5ba --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/subprocess.pyi @@ -0,0 +1,1208 @@ +# Stubs for subprocess + +# Based on http://docs.python.org/3.6/library/subprocess.html +import sys +from typing import Sequence, Any, Mapping, Callable, Tuple, IO, Optional, Union, Type, Text, Generic, TypeVar, AnyStr, overload +from types import TracebackType + +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + +# We prefer to annotate inputs to methods (eg subprocess.check_call) with these +# union types. +# For outputs we use laborious literal based overloads to try to determine +# which specific return types to use, and prefer to fall back to Any when +# this does not work, so the caller does not have to use an assertion to confirm +# which type. +# +# For example: +# +# try: +# x = subprocess.check_output(["ls", "-l"]) +# reveal_type(x) # bytes, based on the overloads +# except TimeoutError as e: +# reveal_type(e.cmd) # Any, but morally is _CMD +_FILE = Union[None, int, IO[Any]] +_TXT = Union[bytes, Text] +if sys.version_info >= (3, 6): + from builtins import _PathLike + _PATH = Union[bytes, Text, _PathLike] +else: + _PATH = Union[bytes, Text] +# Python 3.6 does't support _CMD being a single PathLike. +# See: https://bugs.python.org/issue31961 +_CMD = Union[_TXT, Sequence[_PATH]] +_ENV = Union[Mapping[bytes, _TXT], Mapping[Text, _TXT]] + +_S = TypeVar('_S') +_T = TypeVar('_T') + +class CompletedProcess(Generic[_T]): + # morally: _CMD + args: Any + returncode: int + # These are really both Optional, but requiring checks would be tedious + # and writing all the overloads would be horrific. + stdout: _T + stderr: _T + def __init__(self, args: _CMD, returncode: int, stdout: Optional[_T] = ..., stderr: Optional[_T] = ...) -> None: ... + def check_returncode(self) -> None: ... + +if sys.version_info >= (3, 7): + # Nearly the same args as for 3.6, except for capture_output and text + @overload + def run( + args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + capture_output: bool = ..., + check: bool = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + input: Optional[str] = ..., + text: Literal[True], + timeout: Optional[float] = ..., + ) -> CompletedProcess[str]: ... + @overload + def run( + args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + capture_output: bool = ..., + check: bool = ..., + encoding: str, + errors: Optional[str] = ..., + input: Optional[str] = ..., + text: Optional[bool] = ..., + timeout: Optional[float] = ..., + ) -> CompletedProcess[str]: ... + @overload + def run( + args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + capture_output: bool = ..., + check: bool = ..., + encoding: Optional[str] = ..., + errors: str, + input: Optional[str] = ..., + text: Optional[bool] = ..., + timeout: Optional[float] = ..., + ) -> CompletedProcess[str]: ... + @overload + def run( + args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + *, + universal_newlines: Literal[True], + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + # where the *real* keyword only args start + capture_output: bool = ..., + check: bool = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + input: Optional[str] = ..., + text: Optional[bool] = ..., + timeout: Optional[float] = ..., + ) -> CompletedProcess[str]: ... + @overload + def run( + args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: Literal[False] = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + capture_output: bool = ..., + check: bool = ..., + encoding: None = ..., + errors: None = ..., + input: Optional[bytes] = ..., + text: Literal[None, False] = ..., + timeout: Optional[float] = ..., + ) -> CompletedProcess[bytes]: ... + @overload + def run( + args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + capture_output: bool = ..., + check: bool = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + input: Optional[_TXT] = ..., + text: Optional[bool] = ..., + timeout: Optional[float] = ..., + ) -> CompletedProcess[Any]: ... +elif sys.version_info >= (3, 6): + # Nearly same args as Popen.__init__ except for timeout, input, and check + @overload + def run( + args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + check: bool = ..., + encoding: str, + errors: Optional[str] = ..., + input: Optional[str] = ..., + timeout: Optional[float] = ..., + ) -> CompletedProcess[str]: ... + @overload + def run( + args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + check: bool = ..., + encoding: Optional[str] = ..., + errors: str, + input: Optional[str] = ..., + timeout: Optional[float] = ..., + ) -> CompletedProcess[str]: ... + @overload + def run( + args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + *, + universal_newlines: Literal[True], + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + # where the *real* keyword only args start + check: bool = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + input: Optional[str] = ..., + timeout: Optional[float] = ..., + ) -> CompletedProcess[str]: ... + @overload + def run( + args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: Literal[False] = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + check: bool = ..., + encoding: None = ..., + errors: None = ..., + input: Optional[bytes] = ..., + timeout: Optional[float] = ..., + ) -> CompletedProcess[bytes]: ... + @overload + def run( + args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + check: bool = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + input: Optional[_TXT] = ..., + timeout: Optional[float] = ..., + ) -> CompletedProcess[Any]: ... +else: + # Nearly same args as Popen.__init__ except for timeout, input, and check + @overload + def run( + args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + *, + universal_newlines: Literal[True], + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + # where the *real* keyword only args start + check: bool = ..., + input: Optional[str] = ..., + timeout: Optional[float] = ..., + ) -> CompletedProcess[str]: ... + @overload + def run( + args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: Literal[False] = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + check: bool = ..., + input: Optional[bytes] = ..., + timeout: Optional[float] = ..., + ) -> CompletedProcess[bytes]: ... + @overload + def run( + args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + check: bool = ..., + input: Optional[_TXT] = ..., + timeout: Optional[float] = ..., + ) -> CompletedProcess[Any]: ... + +# Same args as Popen.__init__ +def call(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + timeout: Optional[float] = ...) -> int: ... + +# Same args as Popen.__init__ +def check_call(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stdout: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + timeout: Optional[float] = ...) -> int: ... + +if sys.version_info >= (3, 7): + # 3.7 added text + @overload + def check_output(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: Optional[float] = ..., + input: _TXT = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + text: Literal[True], + ) -> str: ... + @overload + def check_output(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: Optional[float] = ..., + input: _TXT = ..., + encoding: str, + errors: Optional[str] = ..., + text: Optional[bool] = ..., + ) -> str: ... + @overload + def check_output(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: Optional[float] = ..., + input: _TXT = ..., + encoding: Optional[str] = ..., + errors: str, + text: Optional[bool] = ..., + ) -> str: ... + @overload + def check_output(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + *, + universal_newlines: Literal[True], + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + # where the real keyword only ones start + timeout: Optional[float] = ..., + input: _TXT = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + text: Optional[bool] = ..., + ) -> str: ... + @overload + def check_output(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: Literal[False] = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: Optional[float] = ..., + input: _TXT = ..., + encoding: None = ..., + errors: None = ..., + text: Literal[None, False] = ..., + ) -> bytes: ... + @overload + def check_output(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: Optional[float] = ..., + input: _TXT = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + text: Optional[bool] = ..., + ) -> Any: ... # morally: -> _TXT +elif sys.version_info >= (3, 6): + # 3.6 added encoding and errors + @overload + def check_output(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: Optional[float] = ..., + input: _TXT = ..., + encoding: str, + errors: Optional[str] = ..., + ) -> str: ... + @overload + def check_output(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: Optional[float] = ..., + input: _TXT = ..., + encoding: Optional[str] = ..., + errors: str, + ) -> str: ... + @overload + def check_output(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + universal_newlines: Literal[True], + timeout: Optional[float] = ..., + input: _TXT = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + ) -> str: ... + @overload + def check_output(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: Literal[False] = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: Optional[float] = ..., + input: _TXT = ..., + encoding: None = ..., + errors: None = ..., + ) -> bytes: ... + @overload + def check_output(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + timeout: Optional[float] = ..., + input: _TXT = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + ) -> Any: ... # morally: -> _TXT +else: + @overload + def check_output(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + timeout: Optional[float] = ..., + input: _TXT = ..., + *, + universal_newlines: Literal[True], + ) -> str: ... + @overload + def check_output(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: Literal[False] = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + timeout: Optional[float] = ..., + input: _TXT = ..., + ) -> bytes: ... + @overload + def check_output(args: _CMD, + bufsize: int = ..., + executable: _PATH = ..., + stdin: _FILE = ..., + stderr: _FILE = ..., + preexec_fn: Callable[[], Any] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Any = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + timeout: Optional[float] = ..., + input: _TXT = ..., + ) -> Any: ... # morally: -> _TXT + + +PIPE: int +STDOUT: int +DEVNULL: int +class SubprocessError(Exception): ... +class TimeoutExpired(SubprocessError): + def __init__(self, cmd: _CMD, timeout: float, output: Optional[_TXT] = ..., stderr: Optional[_TXT] = ...) -> None: ... + # morally: _CMD + cmd: Any + timeout: float + # morally: Optional[_TXT] + output: Any + stdout: Any + stderr: Any + + +class CalledProcessError(Exception): + returncode: int + # morally: _CMD + cmd: Any + # morally: Optional[_TXT] + output: Any + + # morally: Optional[_TXT] + stdout: Any + stderr: Any + + def __init__(self, + returncode: int, + cmd: _CMD, + output: Optional[_TXT] = ..., + stderr: Optional[_TXT] = ...) -> None: ... + +class Popen(Generic[AnyStr]): + args: _CMD + stdin: IO[AnyStr] + stdout: IO[AnyStr] + stderr: IO[AnyStr] + pid: int + returncode: int + + # Technically it is wrong that Popen provides __new__ instead of __init__ + # but this shouldn't come up hopefully? + + if sys.version_info >= (3, 7): + # text is added in 3.7 + @overload + def __new__(cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[_PATH] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + text: Optional[bool] = ..., + encoding: str, + errors: Optional[str] = ...) -> Popen[str]: ... + @overload + def __new__(cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[_PATH] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + text: Optional[bool] = ..., + encoding: Optional[str] = ..., + errors: str) -> Popen[str]: ... + @overload + def __new__(cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[_PATH] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + *, + universal_newlines: Literal[True], + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + # where the *real* keyword only args start + text: Optional[bool] = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ...) -> Popen[str]: ... + @overload + def __new__(cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[_PATH] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + text: Literal[True], + encoding: Optional[str] = ..., + errors: Optional[str] = ...) -> Popen[str]: ... + @overload + def __new__(cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[_PATH] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: Literal[False] = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + text: Literal[None, False] = ..., + encoding: None = ..., + errors: None = ...) -> Popen[bytes]: ... + @overload + def __new__(cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[_PATH] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + text: Optional[bool] = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ...) -> Popen[Any]: ... + elif sys.version_info >= (3, 6): + @overload + def __new__(cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[_PATH] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + encoding: str, + errors: Optional[str] = ...) -> Popen[str]: ... + @overload + def __new__(cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[_PATH] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + encoding: Optional[str] = ..., + errors: str) -> Popen[str]: ... + @overload + def __new__(cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[_PATH] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + *, + universal_newlines: Literal[True], + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + # where the *real* keyword only args start + encoding: Optional[str] = ..., + errors: Optional[str] = ...) -> Popen[str]: ... + @overload + def __new__(cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[_PATH] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: Literal[False] = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + encoding: None = ..., + errors: None = ...) -> Popen[bytes]: ... + @overload + def __new__(cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[_PATH] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ..., + *, + encoding: Optional[str] = ..., + errors: Optional[str] = ...) -> Popen[Any]: ... + else: + @overload + def __new__(cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[_PATH] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + *, + universal_newlines: Literal[True], + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ...) -> Popen[str]: ... + @overload + def __new__(cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[_PATH] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + *, + universal_newlines: Literal[False] = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ...) -> Popen[bytes]: ... + @overload + def __new__(cls, + args: _CMD, + bufsize: int = ..., + executable: Optional[_PATH] = ..., + stdin: Optional[_FILE] = ..., + stdout: Optional[_FILE] = ..., + stderr: Optional[_FILE] = ..., + preexec_fn: Optional[Callable[[], Any]] = ..., + close_fds: bool = ..., + shell: bool = ..., + cwd: Optional[_PATH] = ..., + env: Optional[_ENV] = ..., + universal_newlines: bool = ..., + startupinfo: Optional[Any] = ..., + creationflags: int = ..., + restore_signals: bool = ..., + start_new_session: bool = ..., + pass_fds: Any = ...) -> Popen[Any]: ... + + def poll(self) -> int: ... + def wait(self, timeout: Optional[float] = ...) -> int: ... + # Return str/bytes + def communicate(self, + input: Optional[AnyStr] = ..., + timeout: Optional[float] = ..., + # morally this should be optional + ) -> Tuple[AnyStr, AnyStr]: ... + def send_signal(self, signal: int) -> None: ... + def terminate(self) -> None: ... + def kill(self) -> None: ... + def __enter__(self: _S) -> _S: ... + def __exit__(self, type: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType]) -> None: ... + +# The result really is always a str. +def getstatusoutput(cmd: _TXT) -> Tuple[int, str]: ... +def getoutput(cmd: _TXT) -> str: ... + +def list2cmdline(seq: Sequence[str]) -> str: ... # undocumented + +if sys.platform == 'win32': + class STARTUPINFO: + if sys.version_info >= (3, 7): + def __init__(self, *, dwFlags: int = ..., hStdInput: Optional[Any] = ..., hStdOutput: Optional[Any] = ..., hStdError: Optional[Any] = ..., wShowWindow: int = ..., lpAttributeList: Optional[Mapping[str, Any]] = ...) -> None: ... + dwFlags: int + hStdInput: Optional[Any] + hStdOutput: Optional[Any] + hStdError: Optional[Any] + wShowWindow: int + if sys.version_info >= (3, 7): + lpAttributeList: Mapping[str, Any] + + STD_INPUT_HANDLE: Any + STD_OUTPUT_HANDLE: Any + STD_ERROR_HANDLE: Any + SW_HIDE: int + STARTF_USESTDHANDLES: int + STARTF_USESHOWWINDOW: int + CREATE_NEW_CONSOLE: int + CREATE_NEW_PROCESS_GROUP: int + if sys.version_info >= (3, 7): + ABOVE_NORMAL_PRIORITY_CLASS: int + BELOW_NORMAL_PRIORITY_CLASS: int + HIGH_PRIORITY_CLASS: int + IDLE_PRIORITY_CLASS: int + NORMAL_PRIORITY_CLASS: int + REALTIME_PRIORITY_CLASS: int + CREATE_NO_WINDOW: int + DETACHED_PROCESS: int + CREATE_DEFAULT_ERROR_MODE: int + CREATE_BREAKAWAY_FROM_JOB: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/symbol.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/symbol.pyi new file mode 100644 index 00000000..59be5776 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/symbol.pyi @@ -0,0 +1,94 @@ +# Stubs for symbol (Python 3) + +import sys +from typing import Dict + +single_input: int +file_input: int +eval_input: int +decorator: int +decorators: int +decorated: int +async_funcdef: int +funcdef: int +parameters: int +typedargslist: int +tfpdef: int +varargslist: int +vfpdef: int +stmt: int +simple_stmt: int +small_stmt: int +expr_stmt: int +if sys.version_info >= (3, 6): + annassign: int +testlist_star_expr: int +augassign: int +del_stmt: int +pass_stmt: int +flow_stmt: int +break_stmt: int +continue_stmt: int +return_stmt: int +yield_stmt: int +raise_stmt: int +import_stmt: int +import_name: int +import_from: int +import_as_name: int +dotted_as_name: int +import_as_names: int +dotted_as_names: int +dotted_name: int +global_stmt: int +nonlocal_stmt: int +assert_stmt: int +compound_stmt: int +async_stmt: int +if_stmt: int +while_stmt: int +for_stmt: int +try_stmt: int +with_stmt: int +with_item: int +except_clause: int +suite: int +test: int +test_nocond: int +lambdef: int +lambdef_nocond: int +or_test: int +and_test: int +not_test: int +comparison: int +comp_op: int +star_expr: int +expr: int +xor_expr: int +and_expr: int +shift_expr: int +arith_expr: int +term: int +factor: int +power: int +atom_expr: int +atom: int +testlist_comp: int +trailer: int +subscriptlist: int +subscript: int +sliceop: int +exprlist: int +testlist: int +dictorsetmaker: int +classdef: int +arglist: int +argument: int +comp_iter: int +comp_for: int +comp_if: int +encoding_decl: int +yield_expr: int +yield_arg: int + +sym_name: Dict[int, str] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/sys.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/sys.pyi new file mode 100644 index 00000000..3d17a55c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/sys.pyi @@ -0,0 +1,213 @@ +# Stubs for sys +# Ron Murawski + +# based on http://docs.python.org/3.2/library/sys.html + +from typing import ( + List, NoReturn, Sequence, Any, Dict, Tuple, TextIO, overload, Optional, + Union, TypeVar, Callable, Type +) +import sys +from types import FrameType, ModuleType, TracebackType + +from importlib.abc import MetaPathFinder + +_T = TypeVar('_T') + +# The following type alias are stub-only and do not exist during runtime +_ExcInfo = Tuple[Type[BaseException], BaseException, TracebackType] +_OptExcInfo = Union[_ExcInfo, Tuple[None, None, None]] + +# ----- sys variables ----- +abiflags: str +argv: List[str] +base_exec_prefix: str +base_prefix: str +byteorder: str +builtin_module_names: Sequence[str] # actually a tuple of strings +copyright: str +# dllhandle = 0 # Windows only +dont_write_bytecode: bool +__displayhook__: Any # contains the original value of displayhook +__excepthook__: Any # contains the original value of excepthook +exec_prefix: str +executable: str +float_repr_style: str +hexversion: int +last_type: Optional[Type[BaseException]] +last_value: Optional[BaseException] +last_traceback: Optional[TracebackType] +maxsize: int +maxunicode: int +meta_path: List[MetaPathFinder] +modules: Dict[str, ModuleType] +path: List[str] +path_hooks: List[Any] # TODO precise type; function, path to finder +path_importer_cache: Dict[str, Any] # TODO precise type +platform: str +prefix: str +if sys.version_info >= (3, 8): + pycache_prefix: Optional[str] +ps1: str +ps2: str +stdin: TextIO +stdout: TextIO +stderr: TextIO +__stdin__: TextIO +__stdout__: TextIO +__stderr__: TextIO +tracebacklimit: int +version: str +api_version: int +warnoptions: Any +# Each entry is a tuple of the form (action, message, category, module, +# lineno) +# winver = '' # Windows only +_xoptions: Dict[Any, Any] + + +flags: _flags +class _flags: + debug: int + division_warning: int + inspect: int + interactive: int + optimize: int + dont_write_bytecode: int + no_user_site: int + no_site: int + ignore_environment: int + verbose: int + bytes_warning: int + quiet: int + hash_randomization: int + if sys.version_info >= (3, 7): + dev_mode: int + utf8_mode: int + +float_info: _float_info +class _float_info: + epsilon: float # DBL_EPSILON + dig: int # DBL_DIG + mant_dig: int # DBL_MANT_DIG + max: float # DBL_MAX + max_exp: int # DBL_MAX_EXP + max_10_exp: int # DBL_MAX_10_EXP + min: float # DBL_MIN + min_exp: int # DBL_MIN_EXP + min_10_exp: int # DBL_MIN_10_EXP + radix: int # FLT_RADIX + rounds: int # FLT_ROUNDS + +hash_info: _hash_info +class _hash_info: + width: int + modulus: int + inf: int + nan: int + imag: int + +implementation: _implementation +class _implementation: + name: str + version: _version_info + hexversion: int + cache_tag: str + +int_info: _int_info +class _int_info: + bits_per_digit: int + sizeof_digit: int + +class _version_info(Tuple[int, int, int, str, int]): + major: int + minor: int + micro: int + releaselevel: str + serial: int +version_info: _version_info + +def call_tracing(fn: Callable[..., _T], args: Any) -> _T: ... +def _clear_type_cache() -> None: ... +def _current_frames() -> Dict[int, Any]: ... +def _debugmallocstats() -> None: ... +def displayhook(value: Optional[int]) -> None: ... +def excepthook(type_: Type[BaseException], value: BaseException, + traceback: TracebackType) -> None: ... +def exc_info() -> _OptExcInfo: ... +# sys.exit() accepts an optional argument of anything printable +def exit(arg: object = ...) -> NoReturn: ... +def getcheckinterval() -> int: ... # deprecated +def getdefaultencoding() -> str: ... +if sys.platform != 'win32': + # Unix only + def getdlopenflags() -> int: ... +def getfilesystemencoding() -> str: ... +def getrefcount(arg: Any) -> int: ... +def getrecursionlimit() -> int: ... + +@overload +def getsizeof(obj: object) -> int: ... +@overload +def getsizeof(obj: object, default: int) -> int: ... + +def getswitchinterval() -> float: ... + +@overload +def _getframe() -> FrameType: ... +@overload +def _getframe(depth: int) -> FrameType: ... + +_ProfileFunc = Callable[[FrameType, str, Any], Any] +def getprofile() -> Optional[_ProfileFunc]: ... +def setprofile(profilefunc: Optional[_ProfileFunc]) -> None: ... + +_TraceFunc = Callable[[FrameType, str, Any], Optional[Callable[[FrameType, str, Any], Any]]] +def gettrace() -> Optional[_TraceFunc]: ... +def settrace(tracefunc: Optional[_TraceFunc]) -> None: ... + + +class _WinVersion(Tuple[int, int, int, int, + str, int, int, int, int, + Tuple[int, int, int]]): + major: int + minor: int + build: int + platform: int + service_pack: str + service_pack_minor: int + service_pack_major: int + suite_mast: int + product_type: int + platform_version: Tuple[int, int, int] + + +def getwindowsversion() -> _WinVersion: ... # Windows only + +def intern(string: str) -> str: ... + +def is_finalizing() -> bool: ... + +if sys.version_info >= (3, 7): + __breakpointhook__: Any # contains the original value of breakpointhook + def breakpointhook(*args: Any, **kwargs: Any) -> Any: ... + +def setcheckinterval(interval: int) -> None: ... # deprecated +def setdlopenflags(n: int) -> None: ... # Linux only +def setrecursionlimit(limit: int) -> None: ... +def setswitchinterval(interval: float) -> None: ... +def settscdump(on_flag: bool) -> None: ... + +def gettotalrefcount() -> int: ... # Debug builds only + +if sys.version_info >= (3, 8): + # not exported by sys + class UnraisableHookArgs: + exc_type: Type[BaseException] + exc_value: Optional[BaseException] + exc_traceback: Optional[TracebackType] + err_msg: Optional[str] + object: Optional[object] + unraisablehook: Callable[[UnraisableHookArgs], Any] + def addaudithook(hook: Callable[[str, Tuple[Any, ...]], Any]) -> None: ... + def audit(__event: str, *args: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tempfile.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tempfile.pyi new file mode 100644 index 00000000..6ee70d11 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tempfile.pyi @@ -0,0 +1,180 @@ +# Stubs for tempfile +# Ron Murawski + +# based on http://docs.python.org/3.3/library/tempfile.html + +import os +import sys +from types import TracebackType +from typing import Any, AnyStr, Generic, IO, Iterable, Iterator, List, Optional, overload, Tuple, Type, TypeVar, Union + +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + +# global variables +TMP_MAX: int +tempdir: Optional[str] +template: str + +_S = TypeVar("_S") +_T = TypeVar("_T") # for pytype, define typevar in same file as alias +if sys.version_info >= (3, 6): + _DirT = Union[_T, os.PathLike[_T]] +else: + _DirT = Union[_T] + +@overload +def TemporaryFile( + mode: Literal["r", "w", "a", "x", "r+", "w+", "a+", "x+", "rt", "wt", "at", "xt", "r+t", "w+t", "a+t", "x+t"], + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[AnyStr] = ..., + prefix: Optional[AnyStr] = ..., + dir: Optional[_DirT[AnyStr]] = ..., +) -> IO[str]: ... +@overload +def TemporaryFile( + mode: Literal["rb", "wb", "ab", "xb", "r+b", "w+b", "a+b", "x+b"] = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[AnyStr] = ..., + prefix: Optional[AnyStr] = ..., + dir: Optional[_DirT[AnyStr]] = ..., +) -> IO[bytes]: ... +@overload +def TemporaryFile( + mode: str = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[AnyStr] = ..., + prefix: Optional[AnyStr] = ..., + dir: Optional[_DirT[AnyStr]] = ..., +) -> IO[Any]: ... +@overload +def NamedTemporaryFile( + mode: Literal["r", "w", "a", "x", "r+", "w+", "a+", "x+", "rt", "wt", "at", "xt", "r+t", "w+t", "a+t", "x+t"], + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[AnyStr] = ..., + prefix: Optional[AnyStr] = ..., + dir: Optional[_DirT[AnyStr]] = ..., + delete: bool = ..., +) -> IO[str]: ... +@overload +def NamedTemporaryFile( + mode: Literal["rb", "wb", "ab", "xb", "r+b", "w+b", "a+b", "x+b"] = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[AnyStr] = ..., + prefix: Optional[AnyStr] = ..., + dir: Optional[_DirT[AnyStr]] = ..., + delete: bool = ..., +) -> IO[bytes]: ... +@overload +def NamedTemporaryFile( + mode: str = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[AnyStr] = ..., + prefix: Optional[AnyStr] = ..., + dir: Optional[_DirT[AnyStr]] = ..., + delete: bool = ..., +) -> IO[Any]: ... + +# It does not actually derive from IO[AnyStr], but it does implement the +# protocol. +class SpooledTemporaryFile(IO[AnyStr]): + # bytes needs to go first, as default mode is to open as bytes + @overload + def __init__( + self: SpooledTemporaryFile[bytes], + max_size: int = ..., + mode: Literal["rb", "wb", "ab", "xb", "r+b", "w+b", "a+b", "x+b"] = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[str] = ..., + prefix: Optional[str] = ..., + dir: Optional[str] = ..., + ) -> None: ... + @overload + def __init__( + self: SpooledTemporaryFile[str], + max_size: int = ..., + mode: Literal["r", "w", "a", "x", "r+", "w+", "a+", "x+", "rt", "wt", "at", "xt", "r+t", "w+t", "a+t", "x+t"] = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[str] = ..., + prefix: Optional[str] = ..., + dir: Optional[str] = ..., + ) -> None: ... + @overload + def __init__( + self, + max_size: int = ..., + mode: str = ..., + buffering: int = ..., + encoding: Optional[str] = ..., + newline: Optional[str] = ..., + suffix: Optional[str] = ..., + prefix: Optional[str] = ..., + dir: Optional[str] = ..., + ) -> None: ... + def rollover(self) -> None: ... + def __enter__(self: _S) -> _S: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> Optional[bool]: ... + # These methods are copied from the abstract methods of IO, because + # SpooledTemporaryFile implements IO. + # See also https://github.com/python/typeshed/pull/2452#issuecomment-420657918. + def close(self) -> None: ... + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def read(self, n: int = ...) -> AnyStr: ... + def readable(self) -> bool: ... + def readline(self, limit: int = ...) -> AnyStr: ... + def readlines(self, hint: int = ...) -> List[AnyStr]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + def write(self, s: AnyStr) -> int: ... + def writelines(self, lines: Iterable[AnyStr]) -> None: ... + def __next__(self) -> AnyStr: ... + def __iter__(self) -> Iterator[AnyStr]: ... + +class TemporaryDirectory(Generic[AnyStr]): + name: str + def __init__( + self, suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ..., dir: Optional[_DirT[AnyStr]] = ... + ) -> None: ... + def cleanup(self) -> None: ... + def __enter__(self) -> AnyStr: ... + def __exit__( + self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType] + ) -> None: ... + +def mkstemp( + suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ..., dir: Optional[_DirT[AnyStr]] = ..., text: bool = ... +) -> Tuple[int, AnyStr]: ... +@overload +def mkdtemp() -> str: ... +@overload +def mkdtemp(suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ..., dir: Optional[_DirT[AnyStr]] = ...) -> AnyStr: ... +def mktemp(suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ..., dir: Optional[_DirT[AnyStr]] = ...) -> AnyStr: ... +def gettempdirb() -> bytes: ... +def gettempprefixb() -> bytes: ... +def gettempdir() -> str: ... +def gettempprefix() -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/textwrap.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/textwrap.pyi new file mode 100644 index 00000000..f61f975b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/textwrap.pyi @@ -0,0 +1,113 @@ +from typing import Callable, List, Optional, Dict, Pattern + +class TextWrapper: + width: int = ... + initial_indent: str = ... + subsequent_indent: str = ... + expand_tabs: bool = ... + replace_whitespace: bool = ... + fix_sentence_endings: bool = ... + drop_whitespace: bool = ... + break_long_words: bool = ... + break_on_hyphens: bool = ... + tabsize: int = ... + max_lines: Optional[int] = ... + placeholder: str = ... + + # Attributes not present in documentation + sentence_end_re: Pattern[str] = ... + wordsep_re: Pattern[str] = ... + wordsep_simple_re: Pattern[str] = ... + whitespace_trans: str = ... + unicode_whitespace_trans: Dict[int, int] = ... + uspace: int = ... + x: int = ... + + def __init__( + self, + width: int = ..., + initial_indent: str = ..., + subsequent_indent: str = ..., + expand_tabs: bool = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + drop_whitespace: bool = ..., + break_on_hyphens: bool = ..., + tabsize: int = ..., + *, + max_lines: Optional[int] = ..., + placeholder: str = ...) -> None: + ... + + # Private methods *are* part of the documented API for subclasses. + def _munge_whitespace(self, text: str) -> str: ... + def _split(self, text: str) -> List[str]: ... + def _fix_sentence_endings(self, chunks: List[str]) -> None: ... + def _handle_long_word(self, reversed_chunks: List[str], cur_line: List[str], cur_len: int, width: int) -> None: ... + def _wrap_chunks(self, chunks: List[str]) -> List[str]: ... + def _split_chunks(self, text: str) -> List[str]: ... + + def wrap(self, text: str) -> List[str]: ... + def fill(self, text: str) -> str: ... + + +def wrap( + text: str = ..., + width: int = ..., + *, + initial_indent: str = ..., + subsequent_indent: str = ..., + expand_tabs: bool = ..., + tabsize: int = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + break_on_hyphens: bool = ..., + drop_whitespace: bool = ..., + max_lines: int = ..., + placeholder: str = ... +) -> List[str]: + ... + +def fill( + text: str, + width: int = ..., + *, + initial_indent: str = ..., + subsequent_indent: str = ..., + expand_tabs: bool = ..., + tabsize: int = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + break_on_hyphens: bool = ..., + drop_whitespace: bool = ..., + max_lines: int = ..., + placeholder: str = ... +) -> str: + ... + +def shorten( + text: str, + width: int, + *, + initial_indent: str = ..., + subsequent_indent: str = ..., + expand_tabs: bool = ..., + tabsize: int = ..., + replace_whitespace: bool = ..., + fix_sentence_endings: bool = ..., + break_long_words: bool = ..., + break_on_hyphens: bool = ..., + drop_whitespace: bool = ..., + # Omit `max_lines: int = None`, it is forced to 1 here. + placeholder: str = ... +) -> str: + ... + +def dedent(text: str) -> str: + ... + +def indent(text: str, prefix: str, predicate: Callable[[str], bool] = ...) -> str: + ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/__init__.pyi new file mode 100644 index 00000000..157ad296 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/__init__.pyi @@ -0,0 +1,674 @@ +import sys +from types import TracebackType +from typing import Any, Optional, Dict, Callable, Tuple, Type, Union +from tkinter.constants import * # noqa: F403 + +TclError: Any +wantobjects: Any +TkVersion: Any +TclVersion: Any +READABLE: Any +WRITABLE: Any +EXCEPTION: Any + +class Event: ... + +def NoDefaultRoot(): ... + +class Variable: + def __init__(self, master: Optional[Any] = ..., value: Optional[Any] = ..., name: Optional[Any] = ...): ... + def __del__(self): ... + def set(self, value): ... + initialize: Any + def get(self): ... + def trace_variable(self, mode, callback): ... + trace: Any + def trace_vdelete(self, mode, cbname): ... + def trace_vinfo(self): ... + def __eq__(self, other): ... + +class StringVar(Variable): + def __init__(self, master: Optional[Any] = ..., value: Optional[Any] = ..., name: Optional[Any] = ...): ... + def get(self): ... + +class IntVar(Variable): + def __init__(self, master: Optional[Any] = ..., value: Optional[Any] = ..., name: Optional[Any] = ...): ... + def get(self): ... + +class DoubleVar(Variable): + def __init__(self, master: Optional[Any] = ..., value: Optional[Any] = ..., name: Optional[Any] = ...): ... + def get(self): ... + +class BooleanVar(Variable): + def __init__(self, master: Optional[Any] = ..., value: Optional[Any] = ..., name: Optional[Any] = ...): ... + def set(self, value): ... + initialize: Any + def get(self): ... + +def mainloop(n: int = ...): ... + +getint: Any +getdouble: Any + +def getboolean(s): ... + +class Misc: + def destroy(self): ... + def deletecommand(self, name): ... + def tk_strictMotif(self, boolean: Optional[Any] = ...): ... + def tk_bisque(self): ... + def tk_setPalette(self, *args, **kw): ... + def tk_menuBar(self, *args): ... + def wait_variable(self, name: str = ...): ... + waitvar: Any + def wait_window(self, window: Optional[Any] = ...): ... + def wait_visibility(self, window: Optional[Any] = ...): ... + def setvar(self, name: str = ..., value: str = ...): ... + def getvar(self, name: str = ...): ... + def getint(self, s): ... + def getdouble(self, s): ... + def getboolean(self, s): ... + def focus_set(self): ... + focus: Any + def focus_force(self): ... + def focus_get(self): ... + def focus_displayof(self): ... + def focus_lastfor(self): ... + def tk_focusFollowsMouse(self): ... + def tk_focusNext(self): ... + def tk_focusPrev(self): ... + def after(self, ms, func: Optional[Any] = ..., *args): ... + def after_idle(self, func, *args): ... + def after_cancel(self, id): ... + def bell(self, displayof: int = ...): ... + def clipboard_get(self, **kw): ... + def clipboard_clear(self, **kw): ... + def clipboard_append(self, string, **kw): ... + def grab_current(self): ... + def grab_release(self): ... + def grab_set(self): ... + def grab_set_global(self): ... + def grab_status(self): ... + def option_add(self, pattern, value, priority: Optional[Any] = ...): ... + def option_clear(self): ... + def option_get(self, name, className): ... + def option_readfile(self, fileName, priority: Optional[Any] = ...): ... + def selection_clear(self, **kw): ... + def selection_get(self, **kw): ... + def selection_handle(self, command, **kw): ... + def selection_own(self, **kw): ... + def selection_own_get(self, **kw): ... + def send(self, interp, cmd, *args): ... + def lower(self, belowThis: Optional[Any] = ...): ... + def tkraise(self, aboveThis: Optional[Any] = ...): ... + lift: Any + def winfo_atom(self, name, displayof: int = ...): ... + def winfo_atomname(self, id, displayof: int = ...): ... + def winfo_cells(self): ... + def winfo_children(self): ... + def winfo_class(self): ... + def winfo_colormapfull(self): ... + def winfo_containing(self, rootX, rootY, displayof: int = ...): ... + def winfo_depth(self): ... + def winfo_exists(self): ... + def winfo_fpixels(self, number): ... + def winfo_geometry(self): ... + def winfo_height(self): ... + def winfo_id(self): ... + def winfo_interps(self, displayof: int = ...): ... + def winfo_ismapped(self): ... + def winfo_manager(self): ... + def winfo_name(self): ... + def winfo_parent(self): ... + def winfo_pathname(self, id, displayof: int = ...): ... + def winfo_pixels(self, number): ... + def winfo_pointerx(self): ... + def winfo_pointerxy(self): ... + def winfo_pointery(self): ... + def winfo_reqheight(self): ... + def winfo_reqwidth(self): ... + def winfo_rgb(self, color): ... + def winfo_rootx(self): ... + def winfo_rooty(self): ... + def winfo_screen(self): ... + def winfo_screencells(self): ... + def winfo_screendepth(self): ... + def winfo_screenheight(self): ... + def winfo_screenmmheight(self): ... + def winfo_screenmmwidth(self): ... + def winfo_screenvisual(self): ... + def winfo_screenwidth(self): ... + def winfo_server(self): ... + def winfo_toplevel(self): ... + def winfo_viewable(self): ... + def winfo_visual(self): ... + def winfo_visualid(self): ... + def winfo_visualsavailable(self, includeids: int = ...): ... + def winfo_vrootheight(self): ... + def winfo_vrootwidth(self): ... + def winfo_vrootx(self): ... + def winfo_vrooty(self): ... + def winfo_width(self): ... + def winfo_x(self): ... + def winfo_y(self): ... + def update(self): ... + def update_idletasks(self): ... + def bindtags(self, tagList: Optional[Any] = ...): ... + def bind(self, sequence: Optional[Any] = ..., func: Optional[Any] = ..., add: Optional[Any] = ...): ... + def unbind(self, sequence, funcid: Optional[Any] = ...): ... + def bind_all(self, sequence: Optional[Any] = ..., func: Optional[Any] = ..., add: Optional[Any] = ...): ... + def unbind_all(self, sequence): ... + def bind_class(self, className, sequence: Optional[Any] = ..., func: Optional[Any] = ..., add: Optional[Any] = ...): ... + def unbind_class(self, className, sequence): ... + def mainloop(self, n: int = ...): ... + def quit(self): ... + def nametowidget(self, name): ... + register: Any + def configure(self, cnf: Optional[Any] = ..., **kw): ... + config: Any + def cget(self, key): ... + __getitem__: Any + def __setitem__(self, key, value): ... + def keys(self): ... + def pack_propagate(self, flag=...): ... + propagate: Any + def pack_slaves(self): ... + slaves: Any + def place_slaves(self): ... + def grid_anchor(self, anchor: Optional[Any] = ...): ... + anchor: Any + def grid_bbox(self, column: Optional[Any] = ..., row: Optional[Any] = ..., col2: Optional[Any] = ..., + row2: Optional[Any] = ...): ... + bbox: Any + def grid_columnconfigure(self, index, cnf=..., **kw): ... + columnconfigure: Any + def grid_location(self, x, y): ... + def grid_propagate(self, flag=...): ... + def grid_rowconfigure(self, index, cnf=..., **kw): ... + rowconfigure: Any + def grid_size(self): ... + size: Any + def grid_slaves(self, row: Optional[Any] = ..., column: Optional[Any] = ...): ... + def event_add(self, virtual, *sequences): ... + def event_delete(self, virtual, *sequences): ... + def event_generate(self, sequence, **kw): ... + def event_info(self, virtual: Optional[Any] = ...): ... + def image_names(self): ... + def image_types(self): ... + +class CallWrapper: + func: Any + subst: Any + widget: Any + def __init__(self, func, subst, widget): ... + def __call__(self, *args): ... + +class XView: + def xview(self, *args): ... + def xview_moveto(self, fraction): ... + def xview_scroll(self, number, what): ... + +class YView: + def yview(self, *args): ... + def yview_moveto(self, fraction): ... + def yview_scroll(self, number, what): ... + +class Wm: + def wm_aspect(self, minNumer: Optional[Any] = ..., minDenom: Optional[Any] = ..., maxNumer: Optional[Any] = ..., + maxDenom: Optional[Any] = ...): ... + aspect: Any + def wm_attributes(self, *args): ... + attributes: Any + def wm_client(self, name: Optional[Any] = ...): ... + client: Any + def wm_colormapwindows(self, *wlist): ... + colormapwindows: Any + def wm_command(self, value: Optional[Any] = ...): ... + command: Any + def wm_deiconify(self): ... + deiconify: Any + def wm_focusmodel(self, model: Optional[Any] = ...): ... + focusmodel: Any + def wm_forget(self, window): ... + forget: Any + def wm_frame(self): ... + frame: Any + def wm_geometry(self, newGeometry: Optional[Any] = ...): ... + geometry: Any + def wm_grid(self, baseWidth: Optional[Any] = ..., baseHeight: Optional[Any] = ..., widthInc: Optional[Any] = ..., + heightInc: Optional[Any] = ...): ... + grid: Any + def wm_group(self, pathName: Optional[Any] = ...): ... + group: Any + def wm_iconbitmap(self, bitmap: Optional[Any] = ..., default: Optional[Any] = ...): ... + iconbitmap: Any + def wm_iconify(self): ... + iconify: Any + def wm_iconmask(self, bitmap: Optional[Any] = ...): ... + iconmask: Any + def wm_iconname(self, newName: Optional[Any] = ...): ... + iconname: Any + def wm_iconphoto(self, default: bool = ..., *args): ... + iconphoto: Any + def wm_iconposition(self, x: Optional[Any] = ..., y: Optional[Any] = ...): ... + iconposition: Any + def wm_iconwindow(self, pathName: Optional[Any] = ...): ... + iconwindow: Any + def wm_manage(self, widget): ... + manage: Any + def wm_maxsize(self, width: Optional[Any] = ..., height: Optional[Any] = ...): ... + maxsize: Any + def wm_minsize(self, width: Optional[Any] = ..., height: Optional[Any] = ...): ... + minsize: Any + def wm_overrideredirect(self, boolean: Optional[Any] = ...): ... + overrideredirect: Any + def wm_positionfrom(self, who: Optional[Any] = ...): ... + positionfrom: Any + def wm_protocol(self, name: Optional[Any] = ..., func: Optional[Any] = ...): ... + protocol: Any + def wm_resizable(self, width: Optional[Any] = ..., height: Optional[Any] = ...): ... + resizable: Any + def wm_sizefrom(self, who: Optional[Any] = ...): ... + sizefrom: Any + def wm_state(self, newstate: Optional[Any] = ...): ... + state: Any + def wm_title(self, string: Optional[Any] = ...): ... + title: Any + def wm_transient(self, master: Optional[Any] = ...): ... + transient: Any + def wm_withdraw(self): ... + withdraw: Any + +class Tk(Misc, Wm): + master: Optional[Any] + children: Dict[str, Any] + tk: Any + def __init__(self, screenName: Optional[str] = ..., baseName: Optional[str] = ..., className: str = ..., useTk: bool = ..., + sync: bool = ..., use: Optional[str] = ...) -> None: ... + def loadtk(self) -> None: ... + def destroy(self) -> None: ... + def readprofile(self, baseName: str, className: str) -> None: ... + report_callback_exception: Callable[[Type[BaseException], BaseException, TracebackType], Any] + def __getattr__(self, attr: str) -> Any: ... + +def Tcl(screenName: Optional[Any] = ..., baseName: Optional[Any] = ..., className: str = ..., useTk: bool = ...): ... + +class Pack: + def pack_configure(self, cnf=..., **kw): ... + pack: Any + def pack_forget(self): ... + forget: Any + def pack_info(self): ... + info: Any + propagate: Any + slaves: Any + +class Place: + def place_configure(self, cnf=..., **kw): ... + place: Any + def place_forget(self): ... + forget: Any + def place_info(self): ... + info: Any + slaves: Any + +class Grid: + def grid_configure(self, cnf=..., **kw): ... + grid: Any + bbox: Any + columnconfigure: Any + def grid_forget(self): ... + forget: Any + def grid_remove(self): ... + def grid_info(self): ... + info: Any + location: Any + propagate: Any + rowconfigure: Any + size: Any + slaves: Any + +class BaseWidget(Misc): + widgetName: Any + def __init__(self, master, widgetName, cnf=..., kw=..., extra=...): ... + def destroy(self): ... + +class Widget(BaseWidget, Pack, Place, Grid): ... + +class Toplevel(BaseWidget, Wm): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + +class Button(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def flash(self): ... + def invoke(self): ... + +class Canvas(Widget, XView, YView): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def addtag(self, *args): ... + def addtag_above(self, newtag, tagOrId): ... + def addtag_all(self, newtag): ... + def addtag_below(self, newtag, tagOrId): ... + def addtag_closest(self, newtag, x, y, halo: Optional[Any] = ..., start: Optional[Any] = ...): ... + def addtag_enclosed(self, newtag, x1, y1, x2, y2): ... + def addtag_overlapping(self, newtag, x1, y1, x2, y2): ... + def addtag_withtag(self, newtag, tagOrId): ... + def bbox(self, *args): ... + def tag_unbind(self, tagOrId, sequence, funcid: Optional[Any] = ...): ... + def tag_bind(self, tagOrId, sequence: Optional[Any] = ..., func: Optional[Any] = ..., add: Optional[Any] = ...): ... + def canvasx(self, screenx, gridspacing: Optional[Any] = ...): ... + def canvasy(self, screeny, gridspacing: Optional[Any] = ...): ... + def coords(self, *args): ... + def create_arc(self, *args, **kw): ... + def create_bitmap(self, *args, **kw): ... + def create_image(self, *args, **kw): ... + def create_line(self, *args, **kw): ... + def create_oval(self, *args, **kw): ... + def create_polygon(self, *args, **kw): ... + def create_rectangle(self, *args, **kw): ... + def create_text(self, *args, **kw): ... + def create_window(self, *args, **kw): ... + def dchars(self, *args): ... + def delete(self, *args): ... + def dtag(self, *args): ... + def find(self, *args): ... + def find_above(self, tagOrId): ... + def find_all(self): ... + def find_below(self, tagOrId): ... + def find_closest(self, x, y, halo: Optional[Any] = ..., start: Optional[Any] = ...): ... + def find_enclosed(self, x1, y1, x2, y2): ... + def find_overlapping(self, x1, y1, x2, y2): ... + def find_withtag(self, tagOrId): ... + def focus(self, *args): ... + def gettags(self, *args): ... + def icursor(self, *args): ... + def index(self, *args): ... + def insert(self, *args): ... + def itemcget(self, tagOrId, option): ... + def itemconfigure(self, tagOrId, cnf: Optional[Any] = ..., **kw): ... + itemconfig: Any + def tag_lower(self, *args): ... + lower: Any + def move(self, *args): ... + if sys.version_info >= (3, 8): + def moveto(self, tagOrId: Union[int, str], x: str = ..., y: str = ...) -> None: ... + def postscript(self, cnf=..., **kw): ... + def tag_raise(self, *args): ... + lift: Any + def scale(self, *args): ... + def scan_mark(self, x, y): ... + def scan_dragto(self, x, y, gain: int = ...): ... + def select_adjust(self, tagOrId, index): ... + def select_clear(self): ... + def select_from(self, tagOrId, index): ... + def select_item(self): ... + def select_to(self, tagOrId, index): ... + def type(self, tagOrId): ... + +class Checkbutton(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def deselect(self): ... + def flash(self): ... + def invoke(self): ... + def select(self): ... + def toggle(self): ... + +class Entry(Widget, XView): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def delete(self, first, last: Optional[Any] = ...): ... + def get(self): ... + def icursor(self, index): ... + def index(self, index): ... + def insert(self, index, string): ... + def scan_mark(self, x): ... + def scan_dragto(self, x): ... + def selection_adjust(self, index): ... + select_adjust: Any + def selection_clear(self): ... + select_clear: Any + def selection_from(self, index): ... + select_from: Any + def selection_present(self): ... + select_present: Any + def selection_range(self, start, end): ... + select_range: Any + def selection_to(self, index): ... + select_to: Any + +class Frame(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + +class Label(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + +class Listbox(Widget, XView, YView): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def activate(self, index): ... + def bbox(self, index): ... + def curselection(self): ... + def delete(self, first, last: Optional[Any] = ...): ... + def get(self, first, last: Optional[Any] = ...): ... + def index(self, index): ... + def insert(self, index, *elements): ... + def nearest(self, y): ... + def scan_mark(self, x, y): ... + def scan_dragto(self, x, y): ... + def see(self, index): ... + def selection_anchor(self, index): ... + select_anchor: Any + def selection_clear(self, first, last: Optional[Any] = ...): ... # type: ignore + select_clear: Any + def selection_includes(self, index): ... + select_includes: Any + def selection_set(self, first, last: Optional[Any] = ...): ... + select_set: Any + def size(self): ... + def itemcget(self, index, option): ... + def itemconfigure(self, index, cnf: Optional[Any] = ..., **kw): ... + itemconfig: Any + +class Menu(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def tk_popup(self, x, y, entry: str = ...): ... + def tk_bindForTraversal(self): ... + def activate(self, index): ... + def add(self, itemType, cnf=..., **kw): ... + def add_cascade(self, cnf=..., **kw): ... + def add_checkbutton(self, cnf=..., **kw): ... + def add_command(self, cnf=..., **kw): ... + def add_radiobutton(self, cnf=..., **kw): ... + def add_separator(self, cnf=..., **kw): ... + def insert(self, index, itemType, cnf=..., **kw): ... + def insert_cascade(self, index, cnf=..., **kw): ... + def insert_checkbutton(self, index, cnf=..., **kw): ... + def insert_command(self, index, cnf=..., **kw): ... + def insert_radiobutton(self, index, cnf=..., **kw): ... + def insert_separator(self, index, cnf=..., **kw): ... + def delete(self, index1, index2: Optional[Any] = ...): ... + def entrycget(self, index, option): ... + def entryconfigure(self, index, cnf: Optional[Any] = ..., **kw): ... + entryconfig: Any + def index(self, index): ... + def invoke(self, index): ... + def post(self, x, y): ... + def type(self, index): ... + def unpost(self): ... + def xposition(self, index): ... + def yposition(self, index): ... + +class Menubutton(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + +class Message(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + +class Radiobutton(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def deselect(self): ... + def flash(self): ... + def invoke(self): ... + def select(self): ... + +class Scale(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def get(self): ... + def set(self, value): ... + def coords(self, value: Optional[Any] = ...): ... + def identify(self, x, y): ... + +class Scrollbar(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def activate(self, index: Optional[Any] = ...): ... + def delta(self, deltax, deltay): ... + def fraction(self, x, y): ... + def identify(self, x, y): ... + def get(self): ... + def set(self, first, last): ... + +class Text(Widget, XView, YView): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def bbox(self, index): ... + def compare(self, index1, op, index2): ... + def count(self, index1, index2, *args): ... + def debug(self, boolean: Optional[Any] = ...): ... + def delete(self, index1, index2: Optional[Any] = ...): ... + def dlineinfo(self, index): ... + def dump(self, index1, index2: Optional[Any] = ..., command: Optional[Any] = ..., **kw): ... + def edit(self, *args): ... + def edit_modified(self, arg: Optional[Any] = ...): ... + def edit_redo(self): ... + def edit_reset(self): ... + def edit_separator(self): ... + def edit_undo(self): ... + def get(self, index1, index2: Optional[Any] = ...): ... + def image_cget(self, index, option): ... + def image_configure(self, index, cnf: Optional[Any] = ..., **kw): ... + def image_create(self, index, cnf=..., **kw): ... + def image_names(self): ... + def index(self, index): ... + def insert(self, index, chars, *args): ... + def mark_gravity(self, markName, direction: Optional[Any] = ...): ... + def mark_names(self): ... + def mark_set(self, markName, index): ... + def mark_unset(self, *markNames): ... + def mark_next(self, index): ... + def mark_previous(self, index): ... + def peer_create(self, newPathName, cnf=..., **kw): ... + def peer_names(self): ... + def replace(self, index1, index2, chars, *args): ... + def scan_mark(self, x, y): ... + def scan_dragto(self, x, y): ... + def search(self, pattern, index, stopindex: Optional[Any] = ..., forwards: Optional[Any] = ..., + backwards: Optional[Any] = ..., exact: Optional[Any] = ..., regexp: Optional[Any] = ..., + nocase: Optional[Any] = ..., count: Optional[Any] = ..., elide: Optional[Any] = ...): ... + def see(self, index): ... + def tag_add(self, tagName, index1, *args): ... + def tag_unbind(self, tagName, sequence, funcid: Optional[Any] = ...): ... + def tag_bind(self, tagName, sequence, func, add: Optional[Any] = ...): ... + def tag_cget(self, tagName, option): ... + def tag_configure(self, tagName, cnf: Optional[Any] = ..., **kw): ... + tag_config: Any + def tag_delete(self, *tagNames): ... + def tag_lower(self, tagName, belowThis: Optional[Any] = ...): ... + def tag_names(self, index: Optional[Any] = ...): ... + def tag_nextrange(self, tagName, index1, index2: Optional[Any] = ...): ... + def tag_prevrange(self, tagName, index1, index2: Optional[Any] = ...): ... + def tag_raise(self, tagName, aboveThis: Optional[Any] = ...): ... + def tag_ranges(self, tagName): ... + def tag_remove(self, tagName, index1, index2: Optional[Any] = ...): ... + def window_cget(self, index, option): ... + def window_configure(self, index, cnf: Optional[Any] = ..., **kw): ... + window_config: Any + def window_create(self, index, cnf=..., **kw): ... + def window_names(self): ... + def yview_pickplace(self, *what): ... + +class _setit: + def __init__(self, var, value, callback: Optional[Any] = ...): ... + def __call__(self, *args): ... + +class OptionMenu(Menubutton): + widgetName: Any + menuname: Any + def __init__(self, master, variable, value, *values, **kwargs): ... + def __getitem__(self, name): ... + def destroy(self): ... + +class Image: + name: Any + tk: Any + def __init__(self, imgtype, name: Optional[Any] = ..., cnf=..., master: Optional[Any] = ..., **kw): ... + def __del__(self): ... + def __setitem__(self, key, value): ... + def __getitem__(self, key): ... + def configure(self, **kw): ... + config: Any + def height(self): ... + def type(self): ... + def width(self): ... + +class PhotoImage(Image): + def __init__(self, name: Optional[Any] = ..., cnf=..., master: Optional[Any] = ..., **kw): ... + def blank(self): ... + def cget(self, option): ... + def __getitem__(self, key): ... + def copy(self): ... + def zoom(self, x, y: str = ...): ... + def subsample(self, x, y: str = ...): ... + def get(self, x, y): ... + def put(self, data, to: Optional[Any] = ...): ... + def write(self, filename, format: Optional[Any] = ..., from_coords: Optional[Any] = ...): ... + if sys.version_info >= (3, 8): + def transparency_get(self, x: int, y: int) -> bool: ... + def transparency_set(self, x: int, y: int, boolean: bool) -> None: ... + +class BitmapImage(Image): + def __init__(self, name: Optional[Any] = ..., cnf=..., master: Optional[Any] = ..., **kw): ... + +def image_names(): ... +def image_types(): ... + +class Spinbox(Widget, XView): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def bbox(self, index): ... + def delete(self, first, last: Optional[Any] = ...): ... + def get(self): ... + def icursor(self, index): ... + def identify(self, x, y): ... + def index(self, index): ... + def insert(self, index, s): ... + def invoke(self, element): ... + def scan(self, *args): ... + def scan_mark(self, x): ... + def scan_dragto(self, x): ... + def selection(self, *args: Any) -> Tuple[int, ...]: ... + def selection_adjust(self, index): ... + def selection_clear(self): ... + def selection_element(self, element: Optional[Any] = ...): ... + if sys.version_info >= (3, 8): + def selection_from(self, index: int) -> None: ... + def selection_present(self) -> None: ... + def selection_range(self, start: int, end: int) -> None: ... + def selection_to(self, index: int) -> None: ... + +class LabelFrame(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + +class PanedWindow(Widget): + def __init__(self, master: Optional[Any] = ..., cnf=..., **kw): ... + def add(self, child, **kw): ... + def remove(self, child): ... + forget: Any + def identify(self, x, y): ... + def proxy(self, *args): ... + def proxy_coord(self): ... + def proxy_forget(self): ... + def proxy_place(self, x, y): ... + def sash(self, *args): ... + def sash_coord(self, index): ... + def sash_mark(self, index): ... + def sash_place(self, index, x, y): ... + def panecget(self, child, option): ... + def paneconfigure(self, tagOrId, cnf: Optional[Any] = ..., **kw): ... + paneconfig: Any + def panes(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/commondialog.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/commondialog.pyi new file mode 100644 index 00000000..d6a8a0d1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/commondialog.pyi @@ -0,0 +1,8 @@ +from typing import Any, Mapping, Optional + +class Dialog: + command: Optional[Any] = ... + master: Optional[Any] = ... + options: Mapping[str, Any] = ... + def __init__(self, master: Optional[Any] = ..., **options) -> None: ... + def show(self, **options) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/constants.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/constants.pyi new file mode 100644 index 00000000..e21a93e6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/constants.pyi @@ -0,0 +1,79 @@ +from typing import Any + +NO: Any +YES: Any +TRUE: Any +FALSE: Any +ON: Any +OFF: Any +N: Any +S: Any +W: Any +E: Any +NW: Any +SW: Any +NE: Any +SE: Any +NS: Any +EW: Any +NSEW: Any +CENTER: Any +NONE: Any +X: Any +Y: Any +BOTH: Any +LEFT: Any +TOP: Any +RIGHT: Any +BOTTOM: Any +RAISED: Any +SUNKEN: Any +FLAT: Any +RIDGE: Any +GROOVE: Any +SOLID: Any +HORIZONTAL: Any +VERTICAL: Any +NUMERIC: Any +CHAR: Any +WORD: Any +BASELINE: Any +INSIDE: Any +OUTSIDE: Any +SEL: Any +SEL_FIRST: Any +SEL_LAST: Any +END: Any +INSERT: Any +CURRENT: Any +ANCHOR: Any +ALL: Any +NORMAL: Any +DISABLED: Any +ACTIVE: Any +HIDDEN: Any +CASCADE: Any +CHECKBUTTON: Any +COMMAND: Any +RADIOBUTTON: Any +SEPARATOR: Any +SINGLE: Any +BROWSE: Any +MULTIPLE: Any +EXTENDED: Any +DOTBOX: Any +UNDERLINE: Any +PIESLICE: Any +CHORD: Any +ARC: Any +FIRST: Any +LAST: Any +BUTT: Any +PROJECTING: Any +ROUND: Any +BEVEL: Any +MITER: Any +MOVETO: Any +SCROLL: Any +UNITS: Any +PAGES: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/dialog.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/dialog.pyi new file mode 100644 index 00000000..3136f21e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/dialog.pyi @@ -0,0 +1,10 @@ +from typing import Any, Mapping, Optional +from tkinter import Widget + +DIALOG_ICON: str + +class Dialog(Widget): + widgetName: str = ... + num: int = ... + def __init__(self, master: Optional[Any] = ..., cnf: Mapping[str, Any] = ..., **kw) -> None: ... + def destroy(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/filedialog.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/filedialog.pyi new file mode 100644 index 00000000..6d5f1651 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/filedialog.pyi @@ -0,0 +1,65 @@ +from typing import Any, Dict, Optional, Tuple +from tkinter import Button, commondialog, Entry, Frame, Listbox, Scrollbar, Toplevel + +dialogstates: Dict[Any, Tuple[Any, Any]] + +class FileDialog: + title: str = ... + master: Any = ... + directory: Optional[Any] = ... + top: Toplevel = ... + botframe: Frame = ... + selection: Entry = ... + filter: Entry = ... + midframe: Entry = ... + filesbar: Scrollbar = ... + files: Listbox = ... + dirsbar: Scrollbar = ... + dirs: Listbox = ... + ok_button: Button = ... + filter_button: Button = ... + cancel_button: Button = ... + def __init__(self, master, title: Optional[Any] = ...) -> None: ... # title is usually a str or None, but e.g. int doesn't raise en exception either + how: Optional[Any] = ... + def go(self, dir_or_file: Any = ..., pattern: str = ..., default: str = ..., key: Optional[Any] = ...): ... + def quit(self, how: Optional[Any] = ...) -> None: ... + def dirs_double_event(self, event) -> None: ... + def dirs_select_event(self, event) -> None: ... + def files_double_event(self, event) -> None: ... + def files_select_event(self, event) -> None: ... + def ok_event(self, event) -> None: ... + def ok_command(self) -> None: ... + def filter_command(self, event: Optional[Any] = ...) -> None: ... + def get_filter(self): ... + def get_selection(self): ... + def cancel_command(self, event: Optional[Any] = ...) -> None: ... + def set_filter(self, dir, pat) -> None: ... + def set_selection(self, file) -> None: ... + +class LoadFileDialog(FileDialog): + title: str = ... + def ok_command(self) -> None: ... + +class SaveFileDialog(FileDialog): + title: str = ... + def ok_command(self): ... + +class _Dialog(commondialog.Dialog): ... + +class Open(_Dialog): + command: str = ... + +class SaveAs(_Dialog): + command: str = ... + +class Directory(commondialog.Dialog): + command: str = ... + +def askopenfilename(**options): ... +def asksaveasfilename(**options): ... +def askopenfilenames(**options): ... +def askopenfile(mode: str = ..., **options): ... +def askopenfiles(mode: str = ..., **options): ... +def asksaveasfile(mode: str = ..., **options): ... +def askdirectory(**options): ... +def test() -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/messagebox.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/messagebox.pyi new file mode 100644 index 00000000..b44e6608 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/messagebox.pyi @@ -0,0 +1,31 @@ +from tkinter.commondialog import Dialog +from typing import Any, Optional + +ERROR: str +INFO: str +QUESTION: str +WARNING: str +ABORTRETRYIGNORE: str +OK: str +OKCANCEL: str +RETRYCANCEL: str +YESNO: str +YESNOCANCEL: str +ABORT: str +RETRY: str +IGNORE: str +CANCEL: str +YES: str +NO: str + +class Message(Dialog): + command: str = ... + +def showinfo(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> str: ... +def showwarning(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> str: ... +def showerror(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> str: ... +def askquestion(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> str: ... +def askokcancel(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> bool: ... +def askyesno(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> bool: ... +def askyesnocancel(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> Optional[bool]: ... +def askretrycancel(title: Optional[str] = ..., message: Optional[str] = ..., **options: Any) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/ttk.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/ttk.pyi new file mode 100644 index 00000000..755fb252 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tkinter/ttk.pyi @@ -0,0 +1,163 @@ +import sys +from typing import Any, List, Optional +import tkinter + +def tclobjs_to_py(adict): ... +def setup_master(master: Optional[Any] = ...): ... + +class Style: + master: Any + tk: Any + def __init__(self, master: Optional[Any] = ...): ... + def configure(self, style, query_opt: Optional[Any] = ..., **kw): ... + def map(self, style, query_opt: Optional[Any] = ..., **kw): ... + def lookup(self, style, option, state: Optional[Any] = ..., default: Optional[Any] = ...): ... + def layout(self, style, layoutspec: Optional[Any] = ...): ... + def element_create(self, elementname, etype, *args, **kw): ... + def element_names(self): ... + def element_options(self, elementname): ... + def theme_create(self, themename, parent: Optional[Any] = ..., settings: Optional[Any] = ...): ... + def theme_settings(self, themename, settings): ... + def theme_names(self): ... + def theme_use(self, themename: Optional[Any] = ...): ... + +class Widget(tkinter.Widget): + def __init__(self, master, widgetname, kw: Optional[Any] = ...): ... + def identify(self, x, y): ... + def instate(self, statespec, callback: Optional[Any] = ..., *args, **kw): ... + def state(self, statespec: Optional[Any] = ...): ... + +class Button(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def invoke(self): ... + +class Checkbutton(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def invoke(self): ... + +class Entry(Widget, tkinter.Entry): + def __init__(self, master: Optional[Any] = ..., widget: Optional[Any] = ..., **kw): ... + def bbox(self, index): ... + def identify(self, x, y): ... + def validate(self): ... + +class Combobox(Entry): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def current(self, newindex: Optional[Any] = ...): ... + def set(self, value): ... + +class Frame(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +class Label(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +class Labelframe(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +LabelFrame: Any + +class Menubutton(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +class Notebook(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def add(self, child, **kw): ... + def forget(self, tab_id): ... + def hide(self, tab_id): ... + def identify(self, x, y): ... + def index(self, tab_id): ... + def insert(self, pos, child, **kw): ... + def select(self, tab_id: Optional[Any] = ...): ... + def tab(self, tab_id, option: Optional[Any] = ..., **kw): ... + def tabs(self): ... + def enable_traversal(self): ... + +class Panedwindow(Widget, tkinter.PanedWindow): + def __init__(self, master: Optional[Any] = ..., **kw): ... + forget: Any + def insert(self, pos, child, **kw): ... + def pane(self, pane, option: Optional[Any] = ..., **kw): ... + def sashpos(self, index, newpos: Optional[Any] = ...): ... + +PanedWindow: Any + +class Progressbar(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def start(self, interval: Optional[Any] = ...): ... + def step(self, amount: Optional[Any] = ...): ... + def stop(self): ... + +class Radiobutton(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def invoke(self): ... + +class Scale(Widget, tkinter.Scale): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def configure(self, cnf: Optional[Any] = ..., **kw): ... + def get(self, x: Optional[Any] = ..., y: Optional[Any] = ...): ... + +class Scrollbar(Widget, tkinter.Scrollbar): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +class Separator(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +class Sizegrip(Widget): + def __init__(self, master: Optional[Any] = ..., **kw): ... + +if sys.version_info >= (3, 7): + class Spinbox(Entry): + def __init__(self, master: Any = ..., **kw: Any) -> None: ... + def set(self, value: Any) -> None: ... + +class Treeview(Widget, tkinter.XView, tkinter.YView): + def __init__(self, master: Optional[Any] = ..., **kw): ... + def bbox(self, item, column: Optional[Any] = ...): ... + def get_children(self, item: Optional[Any] = ...): ... + def set_children(self, item, *newchildren): ... + def column(self, column, option: Optional[Any] = ..., **kw): ... + def delete(self, *items): ... + def detach(self, *items): ... + def exists(self, item): ... + def focus(self, item: Optional[Any] = ...): ... + def heading(self, column, option: Optional[Any] = ..., **kw): ... + def identify(self, component, x, y): ... + def identify_row(self, y): ... + def identify_column(self, x): ... + def identify_region(self, x, y): ... + def identify_element(self, x, y): ... + def index(self, item): ... + def insert(self, parent, index, iid: Optional[Any] = ..., **kw): ... + def item(self, item, option: Optional[Any] = ..., **kw): ... + def move(self, item, parent, index): ... + reattach: Any + def next(self, item): ... + def parent(self, item): ... + def prev(self, item): ... + def see(self, item): ... + if sys.version_info >= (3, 8): + def selection(self) -> List[Any]: ... + else: + def selection(self, selop: Optional[Any] = ..., items: Optional[Any] = ...) -> List[Any]: ... + def selection_set(self, items): ... + def selection_add(self, items): ... + def selection_remove(self, items): ... + def selection_toggle(self, items): ... + def set(self, item, column: Optional[Any] = ..., value: Optional[Any] = ...): ... + def tag_bind(self, tagname, sequence: Optional[Any] = ..., callback: Optional[Any] = ...): ... + def tag_configure(self, tagname, option: Optional[Any] = ..., **kw): ... + def tag_has(self, tagname, item: Optional[Any] = ...): ... + +class LabeledScale(Frame): + label: Any + scale: Any + def __init__(self, master: Optional[Any] = ..., variable: Optional[Any] = ..., from_: int = ..., to: int = ..., **kw): ... + def destroy(self): ... + value: Any + +class OptionMenu(Menubutton): + def __init__(self, master, variable, default: Optional[Any] = ..., *values, **kwargs): ... + def __getitem__(self, item): ... + def set_menu(self, default: Optional[Any] = ..., *values): ... + def destroy(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tokenize.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tokenize.pyi new file mode 100644 index 00000000..54684f3b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tokenize.pyi @@ -0,0 +1,114 @@ +from typing import Any, Callable, Generator, Iterable, List, NamedTuple, Optional, Union, Sequence, TextIO, Tuple +from builtins import open as _builtin_open +import sys +from token import * # noqa: F403 + +if sys.version_info < (3, 7): + COMMENT: int + NL: int + ENCODING: int + +_Position = Tuple[int, int] + +class _TokenInfo(NamedTuple): + type: int + string: str + start: _Position + end: _Position + line: str + +class TokenInfo(_TokenInfo): + @property + def exact_type(self) -> int: ... + +# Backwards compatible tokens can be sequences of a shorter length too +_Token = Union[TokenInfo, Sequence[Union[int, str, _Position]]] + +class TokenError(Exception): ... +class StopTokenizing(Exception): ... + +class Untokenizer: + tokens: List[str] + prev_row: int + prev_col: int + encoding: Optional[str] + def __init__(self) -> None: ... + def add_whitespace(self, start: _Position) -> None: ... + def untokenize(self, iterable: Iterable[_Token]) -> str: ... + def compat(self, token: Sequence[Union[int, str]], iterable: Iterable[_Token]) -> None: ... + +def untokenize(iterable: Iterable[_Token]) -> Any: ... +def detect_encoding(readline: Callable[[], bytes]) -> Tuple[str, Sequence[bytes]]: ... +def tokenize(readline: Callable[[], bytes]) -> Generator[TokenInfo, None, None]: ... +def generate_tokens(readline: Callable[[], str]) -> Generator[TokenInfo, None, None]: ... # undocumented + +if sys.version_info >= (3, 6): + from os import PathLike + def open(filename: Union[str, bytes, int, PathLike[Any]]) -> TextIO: ... +else: + def open(filename: Union[str, bytes, int]) -> TextIO: ... + +# Names in __all__ with no definition: +# AMPER +# AMPEREQUAL +# ASYNC +# AT +# ATEQUAL +# AWAIT +# CIRCUMFLEX +# CIRCUMFLEXEQUAL +# COLON +# COMMA +# DEDENT +# DOT +# DOUBLESLASH +# DOUBLESLASHEQUAL +# DOUBLESTAR +# DOUBLESTAREQUAL +# ELLIPSIS +# ENDMARKER +# EQEQUAL +# EQUAL +# ERRORTOKEN +# GREATER +# GREATEREQUAL +# INDENT +# ISEOF +# ISNONTERMINAL +# ISTERMINAL +# LBRACE +# LEFTSHIFT +# LEFTSHIFTEQUAL +# LESS +# LESSEQUAL +# LPAR +# LSQB +# MINEQUAL +# MINUS +# NAME +# NEWLINE +# NOTEQUAL +# NT_OFFSET +# NUMBER +# N_TOKENS +# OP +# PERCENT +# PERCENTEQUAL +# PLUS +# PLUSEQUAL +# RARROW +# RBRACE +# RIGHTSHIFT +# RIGHTSHIFTEQUAL +# RPAR +# RSQB +# SEMI +# SLASH +# SLASHEQUAL +# STAR +# STAREQUAL +# STRING +# TILDE +# VBAR +# VBAREQUAL +# tok_name diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tracemalloc.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tracemalloc.pyi new file mode 100644 index 00000000..8758cc67 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/tracemalloc.pyi @@ -0,0 +1,70 @@ +# Stubs for tracemalloc (Python 3.4+) + +import sys +from typing import List, Optional, Sequence, Tuple, Union, overload + +def clear_traces() -> None: ... +def get_object_traceback(obj: object) -> Optional[Traceback]: ... +def get_traceback_limit() -> int: ... +def get_traced_memory() -> Tuple[int, int]: ... +def get_tracemalloc_memory() -> int: ... +def is_tracing() -> bool: ... +def start(nframe: int = ...) -> None: ... +def stop() -> None: ... +def take_snapshot() -> Snapshot: ... + +if sys.version_info >= (3, 6): + class DomainFilter: + inclusive: bool + domain: int + def __init__(self, inclusive: bool, domain: int) -> None: ... + +class Filter: + if sys.version_info >= (3, 6): + domain: Optional[int] + inclusive: bool + lineno: Optional[int] + filename_pattern: str + all_frames: bool + def __init__(self, inclusive: bool, filename_pattern: str, lineno: Optional[int] = ..., all_frames: bool = ..., domain: Optional[int] = ...) -> None: ... + +class Frame: + filename: str + lineno: int + +class Snapshot: + def compare_to(self, old_snapshot: Snapshot, key_type: str, cumulative: bool = ...) -> List[StatisticDiff]: ... + def dump(self, filename: str) -> None: ... + if sys.version_info >= (3, 6): + def filter_traces(self, filters: Sequence[Union[DomainFilter, Filter]]) -> Snapshot: ... + else: + def filter_traces(self, filters: Sequence[Filter]) -> Snapshot: ... + @classmethod + def load(cls, filename: str) -> Snapshot: ... + def statistics(self, key_type: str, cumulative: bool = ...) -> List[Statistic]: ... + traceback_limit: int + traces: Sequence[Trace] + +class Statistic: + count: int + size: int + traceback: Traceback + +class StatisticDiff: + count: int + count_diff: int + size: int + size_diff: int + traceback: Traceback + +class Trace: + size: int + traceback: Traceback + +class Traceback(Sequence[Frame]): + def format(self, limit: Optional[int] = ...) -> List[str]: ... + @overload + def __getitem__(self, i: int) -> Frame: ... + @overload + def __getitem__(self, s: slice) -> Sequence[Frame]: ... + def __len__(self) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/types.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/types.pyi new file mode 100644 index 00000000..b8f7d925 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/types.pyi @@ -0,0 +1,288 @@ +# Stubs for types +# Note, all classes "defined" here require special handling. + +# TODO parts of this should be conditional on version + +import sys +from typing import ( + Any, Awaitable, Callable, Dict, Generic, Iterator, Mapping, Optional, Tuple, TypeVar, + Union, overload, Type, Iterable +) + +# ModuleType is exported from this module, but for circular import +# reasons exists in its own stub file (with ModuleSpec and Loader). +from _importlib_modulespec import ModuleType as ModuleType # Exported + +_T = TypeVar('_T') +_T_co = TypeVar('_T_co', covariant=True) +_T_contra = TypeVar('_T_contra', contravariant=True) +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') + +class _Cell: + cell_contents: Any + +class FunctionType: + __closure__: Optional[Tuple[_Cell, ...]] + __code__: CodeType + __defaults__: Optional[Tuple[Any, ...]] + __dict__: Dict[str, Any] + __globals__: Dict[str, Any] + __name__: str + __qualname__: str + __annotations__: Dict[str, Any] + __kwdefaults__: Dict[str, Any] + def __init__(self, code: CodeType, globals: Dict[str, Any], name: Optional[str] = ..., argdefs: Optional[Tuple[object, ...]] = ..., closure: Optional[Tuple[_Cell, ...]] = ...) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def __get__(self, obj: Optional[object], type: Optional[type]) -> MethodType: ... +LambdaType = FunctionType + +class CodeType: + """Create a code object. Not for the faint of heart.""" + co_argcount: int + if sys.version_info >= (3, 8): + co_posonlyargcount: int + co_kwonlyargcount: int + co_nlocals: int + co_stacksize: int + co_flags: int + co_code: bytes + co_consts: Tuple[Any, ...] + co_names: Tuple[str, ...] + co_varnames: Tuple[str, ...] + co_filename: str + co_name: str + co_firstlineno: int + co_lnotab: bytes + co_freevars: Tuple[str, ...] + co_cellvars: Tuple[str, ...] + if sys.version_info >= (3, 8): + def __init__( + self, + argcount: int, + posonlyargcount: int, + kwonlyargcount: int, + nlocals: int, + stacksize: int, + flags: int, + codestring: bytes, + constants: Tuple[Any, ...], + names: Tuple[str, ...], + varnames: Tuple[str, ...], + filename: str, + name: str, + firstlineno: int, + lnotab: bytes, + freevars: Tuple[str, ...] = ..., + cellvars: Tuple[str, ...] = ..., + ) -> None: ... + else: + def __init__( + self, + argcount: int, + kwonlyargcount: int, + nlocals: int, + stacksize: int, + flags: int, + codestring: bytes, + constants: Tuple[Any, ...], + names: Tuple[str, ...], + varnames: Tuple[str, ...], + filename: str, + name: str, + firstlineno: int, + lnotab: bytes, + freevars: Tuple[str, ...] = ..., + cellvars: Tuple[str, ...] = ..., + ) -> None: ... + if sys.version_info >= (3, 8): + def replace( + self, + *, + co_argcount: int = ..., + co_posonlyargcount: int = ..., + co_kwonlyargcount: int = ..., + co_nlocals: int = ..., + co_stacksize: int = ..., + co_flags: int = ..., + co_firstlineno: int = ..., + co_code: bytes = ..., + co_consts: Tuple[Any, ...] = ..., + co_names: Tuple[str, ...] = ..., + co_varnames: Tuple[str, ...] = ..., + co_freevars: Tuple[str, ...] = ..., + co_cellvars: Tuple[str, ...] = ..., + co_filename: str = ..., + co_name: str = ..., + co_lnotab: bytes = ..., + ) -> CodeType: ... + +class MappingProxyType(Mapping[_KT, _VT], Generic[_KT, _VT]): + def __init__(self, mapping: Mapping[_KT, _VT]) -> None: ... + def __getitem__(self, k: _KT) -> _VT: ... + def __iter__(self) -> Iterator[_KT]: ... + def __len__(self) -> int: ... + def copy(self) -> Mapping[_KT, _VT]: ... + +class SimpleNamespace: + def __init__(self, **kwargs: Any) -> None: ... + def __getattribute__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any) -> None: ... + def __delattr__(self, name: str) -> None: ... + +class GeneratorType: + gi_code: CodeType + gi_frame: FrameType + gi_running: bool + gi_yieldfrom: Optional[GeneratorType] + def __iter__(self) -> GeneratorType: ... + def __next__(self) -> Any: ... + def close(self) -> None: ... + def send(self, arg: Any) -> Any: ... + @overload + def throw(self, val: BaseException) -> Any: ... + @overload + def throw(self, typ: type, val: BaseException = ..., tb: TracebackType = ...) -> Any: ... + +if sys.version_info >= (3, 6): + class AsyncGeneratorType(Generic[_T_co, _T_contra]): + ag_await: Optional[Awaitable[Any]] + ag_frame: FrameType + ag_running: bool + ag_code: CodeType + def __aiter__(self) -> Awaitable[AsyncGeneratorType[_T_co, _T_contra]]: ... + def __anext__(self) -> Awaitable[_T_co]: ... + def asend(self, val: _T_contra) -> Awaitable[_T_co]: ... + @overload + def athrow(self, val: BaseException) -> Awaitable[_T_co]: ... + @overload + def athrow(self, typ: Type[BaseException], val: BaseException, tb: TracebackType = ...) -> Awaitable[_T_co]: ... + def aclose(self) -> Awaitable[None]: ... + +class CoroutineType: + cr_await: Optional[Any] + cr_code: CodeType + cr_frame: FrameType + cr_running: bool + def close(self) -> None: ... + def send(self, arg: Any) -> Any: ... + @overload + def throw(self, val: BaseException) -> Any: ... + @overload + def throw(self, typ: type, val: BaseException = ..., tb: TracebackType = ...) -> Any: ... + +class _StaticFunctionType: + """Fictional type to correct the type of MethodType.__func__. + + FunctionType is a descriptor, so mypy follows the descriptor protocol and + converts MethodType.__func__ back to MethodType (the return type of + FunctionType.__get__). But this is actually a special case; MethodType is + implemented in C and its attribute access doesn't go through + __getattribute__. + + By wrapping FunctionType in _StaticFunctionType, we get the right result; + similar to wrapping a function in staticmethod() at runtime to prevent it + being bound as a method. + """ + def __get__(self, obj: Optional[object], type: Optional[type]) -> FunctionType: ... + +class MethodType: + __func__: _StaticFunctionType + __self__: object + __name__: str + __qualname__: str + def __init__(self, func: Callable[..., Any], obj: object) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... +class BuiltinFunctionType: + __self__: Union[object, ModuleType] + __name__: str + __qualname__: str + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... +BuiltinMethodType = BuiltinFunctionType + +if sys.version_info >= (3, 7): + class WrapperDescriptorType: + __name__: str + __qualname__: str + __objclass__: type + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def __get__(self, obj: Any, type: type = ...) -> Any: ... + + class MethodWrapperType: + __self__: object + __name__: str + __qualname__: str + __objclass__: type + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def __eq__(self, other: Any) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + + class MethodDescriptorType: + __name__: str + __qualname__: str + __objclass__: type + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def __get__(self, obj: Any, type: type = ...) -> Any: ... + + class ClassMethodDescriptorType: + __name__: str + __qualname__: str + __objclass__: type + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def __get__(self, obj: Any, type: type = ...) -> Any: ... + + +class TracebackType: + if sys.version_info >= (3, 7): + def __init__(self, tb_next: Optional[TracebackType], tb_frame: FrameType, tb_lasti: int, tb_lineno: int) -> None: ... + tb_next: Optional[TracebackType] + else: + @property + def tb_next(self) -> Optional[TracebackType]: ... + # the rest are read-only even in 3.7 + @property + def tb_frame(self) -> FrameType: ... + @property + def tb_lasti(self) -> int: ... + @property + def tb_lineno(self) -> int: ... + +class FrameType: + f_back: FrameType + f_builtins: Dict[str, Any] + f_code: CodeType + f_globals: Dict[str, Any] + f_lasti: int + f_lineno: int + f_locals: Dict[str, Any] + f_trace: Callable[[], None] + if sys.version_info >= (3, 7): + f_trace_lines: bool + f_trace_opcodes: bool + + def clear(self) -> None: ... + +class GetSetDescriptorType: + __name__: str + __objclass__: type + def __get__(self, obj: Any, type: type = ...) -> Any: ... + def __set__(self, obj: Any) -> None: ... + def __delete__(self, obj: Any) -> None: ... +class MemberDescriptorType: + __name__: str + __objclass__: type + def __get__(self, obj: Any, type: type = ...) -> Any: ... + def __set__(self, obj: Any) -> None: ... + def __delete__(self, obj: Any) -> None: ... + +if sys.version_info >= (3, 7): + def new_class(name: str, bases: Iterable[object] = ..., kwds: Dict[str, Any] = ..., exec_body: Callable[[Dict[str, Any]], None] = ...) -> type: ... + def resolve_bases(bases: Iterable[object]) -> Tuple[Any, ...]: ... +else: + def new_class(name: str, bases: Tuple[type, ...] = ..., kwds: Dict[str, Any] = ..., exec_body: Callable[[Dict[str, Any]], None] = ...) -> type: ... +def prepare_class(name: str, bases: Tuple[type, ...] = ..., kwds: Dict[str, Any] = ...) -> Tuple[type, Dict[str, Any], Dict[str, Any]]: ... + +# Actually a different type, but `property` is special and we want that too. +DynamicClassAttribute = property + +def coroutine(f: Callable[..., Any]) -> CoroutineType: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/typing.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/typing.pyi new file mode 100644 index 00000000..96eaeecc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/typing.pyi @@ -0,0 +1,645 @@ +# Stubs for typing + +import sys +from abc import abstractmethod, ABCMeta +from types import CodeType, FrameType, TracebackType +import collections # Needed by aliases like DefaultDict, see mypy issue 2986 + +# Definitions of special type checking related constructs. Their definitions +# are not used, so their value does not matter. + +overload = object() +Any = object() +TypeVar = object() +_promote = object() + +class _SpecialForm: + def __getitem__(self, typeargs: Any) -> Any: ... + +Tuple: _SpecialForm = ... +Generic: _SpecialForm = ... +Protocol: _SpecialForm = ... +Callable: _SpecialForm = ... +Type: _SpecialForm = ... +ClassVar: _SpecialForm = ... +if sys.version_info >= (3, 8): + Final: _SpecialForm = ... + _F = TypeVar('_F', bound=Callable[..., Any]) + def final(f: _F) -> _F: ... + Literal: _SpecialForm = ... + # TypedDict is a (non-subscriptable) special form. + TypedDict: object + +class GenericMeta(type): ... + +# Return type that indicates a function does not return. +# This type is equivalent to the None type, but the no-op Union is necessary to +# distinguish the None type from the None value. +NoReturn = Union[None] + +# These type variables are used by the container types. +_T = TypeVar('_T') +_S = TypeVar('_S') +_KT = TypeVar('_KT') # Key type. +_VT = TypeVar('_VT') # Value type. +_T_co = TypeVar('_T_co', covariant=True) # Any type covariant containers. +_V_co = TypeVar('_V_co', covariant=True) # Any type covariant containers. +_KT_co = TypeVar('_KT_co', covariant=True) # Key type covariant containers. +_VT_co = TypeVar('_VT_co', covariant=True) # Value type covariant containers. +_T_contra = TypeVar('_T_contra', contravariant=True) # Ditto contravariant. +_TC = TypeVar('_TC', bound=Type[object]) +_C = TypeVar("_C", bound=Callable[..., Any]) + +no_type_check = object() +def no_type_check_decorator(decorator: _C) -> _C: ... + +# Type aliases and type constructors + +class TypeAlias: + # Class for defining generic aliases for library types. + def __init__(self, target_type: type) -> None: ... + def __getitem__(self, typeargs: Any) -> Any: ... + +Union = TypeAlias(object) +Optional = TypeAlias(object) +List = TypeAlias(object) +Dict = TypeAlias(object) +DefaultDict = TypeAlias(object) +Set = TypeAlias(object) +FrozenSet = TypeAlias(object) +Counter = TypeAlias(object) +Deque = TypeAlias(object) +ChainMap = TypeAlias(object) + +if sys.version_info >= (3, 7): + OrderedDict = TypeAlias(object) + +# Predefined type variables. +AnyStr = TypeVar('AnyStr', str, bytes) + +# Abstract base classes. + +def runtime_checkable(cls: _TC) -> _TC: ... + +@runtime_checkable +class SupportsInt(Protocol, metaclass=ABCMeta): + @abstractmethod + def __int__(self) -> int: ... + +@runtime_checkable +class SupportsFloat(Protocol, metaclass=ABCMeta): + @abstractmethod + def __float__(self) -> float: ... + +@runtime_checkable +class SupportsComplex(Protocol, metaclass=ABCMeta): + @abstractmethod + def __complex__(self) -> complex: ... + +@runtime_checkable +class SupportsBytes(Protocol, metaclass=ABCMeta): + @abstractmethod + def __bytes__(self) -> bytes: ... + +if sys.version_info >= (3, 8): + @runtime_checkable + class SupportsIndex(Protocol, metaclass=ABCMeta): + @abstractmethod + def __index__(self) -> int: ... + +@runtime_checkable +class SupportsAbs(Protocol[_T_co]): + @abstractmethod + def __abs__(self) -> _T_co: ... + +@runtime_checkable +class SupportsRound(Protocol[_T_co]): + @overload + @abstractmethod + def __round__(self) -> int: ... + @overload + @abstractmethod + def __round__(self, ndigits: int) -> _T_co: ... + +@runtime_checkable +class Reversible(Protocol[_T_co]): + @abstractmethod + def __reversed__(self) -> Iterator[_T_co]: ... + +@runtime_checkable +class Sized(Protocol, metaclass=ABCMeta): + @abstractmethod + def __len__(self) -> int: ... + +@runtime_checkable +class Hashable(Protocol, metaclass=ABCMeta): + # TODO: This is special, in that a subclass of a hashable class may not be hashable + # (for example, list vs. object). It's not obvious how to represent this. This class + # is currently mostly useless for static checking. + @abstractmethod + def __hash__(self) -> int: ... + +@runtime_checkable +class Iterable(Protocol[_T_co]): + @abstractmethod + def __iter__(self) -> Iterator[_T_co]: ... + +@runtime_checkable +class Iterator(Iterable[_T_co], Protocol[_T_co]): + @abstractmethod + def __next__(self) -> _T_co: ... + def __iter__(self) -> Iterator[_T_co]: ... + +class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]): + @abstractmethod + def __next__(self) -> _T_co: ... + + @abstractmethod + def send(self, value: _T_contra) -> _T_co: ... + + @abstractmethod + def throw(self, typ: Type[BaseException], val: Optional[BaseException] = ..., + tb: Optional[TracebackType] = ...) -> _T_co: ... + + @abstractmethod + def close(self) -> None: ... + + @abstractmethod + def __iter__(self) -> Generator[_T_co, _T_contra, _V_co]: ... + + @property + def gi_code(self) -> CodeType: ... + @property + def gi_frame(self) -> FrameType: ... + @property + def gi_running(self) -> bool: ... + @property + def gi_yieldfrom(self) -> Optional[Generator[Any, Any, Any]]: ... + +@runtime_checkable +class Awaitable(Protocol[_T_co]): + @abstractmethod + def __await__(self) -> Generator[Any, None, _T_co]: ... + +class Coroutine(Awaitable[_V_co], Generic[_T_co, _T_contra, _V_co]): + @property + def cr_await(self) -> Optional[Any]: ... + @property + def cr_code(self) -> CodeType: ... + @property + def cr_frame(self) -> FrameType: ... + @property + def cr_running(self) -> bool: ... + + @abstractmethod + def send(self, value: _T_contra) -> _T_co: ... + + @abstractmethod + def throw(self, typ: Type[BaseException], val: Optional[BaseException] = ..., + tb: Optional[TracebackType] = ...) -> _T_co: ... + + @abstractmethod + def close(self) -> None: ... + + +# NOTE: This type does not exist in typing.py or PEP 484. +# The parameters correspond to Generator, but the 4th is the original type. +class AwaitableGenerator(Awaitable[_V_co], Generator[_T_co, _T_contra, _V_co], + Generic[_T_co, _T_contra, _V_co, _S], metaclass=ABCMeta): ... + +@runtime_checkable +class AsyncIterable(Protocol[_T_co]): + @abstractmethod + def __aiter__(self) -> AsyncIterator[_T_co]: ... + +@runtime_checkable +class AsyncIterator(AsyncIterable[_T_co], + Protocol[_T_co]): + @abstractmethod + def __anext__(self) -> Awaitable[_T_co]: ... + def __aiter__(self) -> AsyncIterator[_T_co]: ... + +if sys.version_info >= (3, 6): + class AsyncGenerator(AsyncIterator[_T_co], Generic[_T_co, _T_contra]): + @abstractmethod + def __anext__(self) -> Awaitable[_T_co]: ... + + @abstractmethod + def asend(self, value: _T_contra) -> Awaitable[_T_co]: ... + + @abstractmethod + def athrow(self, typ: Type[BaseException], val: Optional[BaseException] = ..., + tb: Any = ...) -> Awaitable[_T_co]: ... + + @abstractmethod + def aclose(self) -> Awaitable[None]: ... + + @abstractmethod + def __aiter__(self) -> AsyncGenerator[_T_co, _T_contra]: ... + + @property + def ag_await(self) -> Any: ... + @property + def ag_code(self) -> CodeType: ... + @property + def ag_frame(self) -> FrameType: ... + @property + def ag_running(self) -> bool: ... + +@runtime_checkable +class Container(Protocol[_T_co]): + @abstractmethod + def __contains__(self, __x: object) -> bool: ... + + +if sys.version_info >= (3, 6): + @runtime_checkable + class Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]): + # Implement Sized (but don't have it as a base class). + @abstractmethod + def __len__(self) -> int: ... + + _Collection = Collection +else: + @runtime_checkable + class _Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]): + # Implement Sized (but don't have it as a base class). + @abstractmethod + def __len__(self) -> int: ... + +class Sequence(_Collection[_T_co], Reversible[_T_co], Generic[_T_co]): + @overload + @abstractmethod + def __getitem__(self, i: int) -> _T_co: ... + @overload + @abstractmethod + def __getitem__(self, s: slice) -> Sequence[_T_co]: ... + # Mixin methods + def index(self, x: Any, start: int = ..., end: int = ...) -> int: ... + def count(self, x: Any) -> int: ... + def __contains__(self, x: object) -> bool: ... + def __iter__(self) -> Iterator[_T_co]: ... + def __reversed__(self) -> Iterator[_T_co]: ... + +class MutableSequence(Sequence[_T], Generic[_T]): + @abstractmethod + def insert(self, index: int, object: _T) -> None: ... + @overload + @abstractmethod + def __getitem__(self, i: int) -> _T: ... + @overload + @abstractmethod + def __getitem__(self, s: slice) -> MutableSequence[_T]: ... + @overload + @abstractmethod + def __setitem__(self, i: int, o: _T) -> None: ... + @overload + @abstractmethod + def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ... + @overload + @abstractmethod + def __delitem__(self, i: int) -> None: ... + @overload + @abstractmethod + def __delitem__(self, i: slice) -> None: ... + # Mixin methods + def append(self, object: _T) -> None: ... + def clear(self) -> None: ... + def extend(self, iterable: Iterable[_T]) -> None: ... + def reverse(self) -> None: ... + def pop(self, index: int = ...) -> _T: ... + def remove(self, object: _T) -> None: ... + def __iadd__(self, x: Iterable[_T]) -> MutableSequence[_T]: ... + +class AbstractSet(_Collection[_T_co], Generic[_T_co]): + @abstractmethod + def __contains__(self, x: object) -> bool: ... + # Mixin methods + def __le__(self, s: AbstractSet[Any]) -> bool: ... + def __lt__(self, s: AbstractSet[Any]) -> bool: ... + def __gt__(self, s: AbstractSet[Any]) -> bool: ... + def __ge__(self, s: AbstractSet[Any]) -> bool: ... + def __and__(self, s: AbstractSet[Any]) -> AbstractSet[_T_co]: ... + def __or__(self, s: AbstractSet[_T]) -> AbstractSet[Union[_T_co, _T]]: ... + def __sub__(self, s: AbstractSet[Any]) -> AbstractSet[_T_co]: ... + def __xor__(self, s: AbstractSet[_T]) -> AbstractSet[Union[_T_co, _T]]: ... + def isdisjoint(self, s: Iterable[Any]) -> bool: ... + +class MutableSet(AbstractSet[_T], Generic[_T]): + @abstractmethod + def add(self, x: _T) -> None: ... + @abstractmethod + def discard(self, x: _T) -> None: ... + # Mixin methods + def clear(self) -> None: ... + def pop(self) -> _T: ... + def remove(self, element: _T) -> None: ... + def __ior__(self, s: AbstractSet[_S]) -> MutableSet[Union[_T, _S]]: ... + def __iand__(self, s: AbstractSet[Any]) -> MutableSet[_T]: ... + def __ixor__(self, s: AbstractSet[_S]) -> MutableSet[Union[_T, _S]]: ... + def __isub__(self, s: AbstractSet[Any]) -> MutableSet[_T]: ... + +class MappingView: + def __len__(self) -> int: ... + +class ItemsView(MappingView, AbstractSet[Tuple[_KT_co, _VT_co]], Generic[_KT_co, _VT_co]): + def __and__(self, o: Iterable[Any]) -> Set[Tuple[_KT_co, _VT_co]]: ... + def __rand__(self, o: Iterable[_T]) -> Set[_T]: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[Tuple[_KT_co, _VT_co]]: ... + if sys.version_info >= (3, 8): + def __reversed__(self) -> Iterator[Tuple[_KT_co, _VT_co]]: ... + def __or__(self, o: Iterable[_T]) -> Set[Union[Tuple[_KT_co, _VT_co], _T]]: ... + def __ror__(self, o: Iterable[_T]) -> Set[Union[Tuple[_KT_co, _VT_co], _T]]: ... + def __sub__(self, o: Iterable[Any]) -> Set[Tuple[_KT_co, _VT_co]]: ... + def __rsub__(self, o: Iterable[_T]) -> Set[_T]: ... + def __xor__(self, o: Iterable[_T]) -> Set[Union[Tuple[_KT_co, _VT_co], _T]]: ... + def __rxor__(self, o: Iterable[_T]) -> Set[Union[Tuple[_KT_co, _VT_co], _T]]: ... + +class KeysView(MappingView, AbstractSet[_KT_co], Generic[_KT_co]): + def __and__(self, o: Iterable[Any]) -> Set[_KT_co]: ... + def __rand__(self, o: Iterable[_T]) -> Set[_T]: ... + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_KT_co]: ... + if sys.version_info >= (3, 8): + def __reversed__(self) -> Iterator[_KT_co]: ... + def __or__(self, o: Iterable[_T]) -> Set[Union[_KT_co, _T]]: ... + def __ror__(self, o: Iterable[_T]) -> Set[Union[_KT_co, _T]]: ... + def __sub__(self, o: Iterable[Any]) -> Set[_KT_co]: ... + def __rsub__(self, o: Iterable[_T]) -> Set[_T]: ... + def __xor__(self, o: Iterable[_T]) -> Set[Union[_KT_co, _T]]: ... + def __rxor__(self, o: Iterable[_T]) -> Set[Union[_KT_co, _T]]: ... + +class ValuesView(MappingView, Iterable[_VT_co], Generic[_VT_co]): + def __contains__(self, o: object) -> bool: ... + def __iter__(self) -> Iterator[_VT_co]: ... + if sys.version_info >= (3, 8): + def __reversed__(self) -> Iterator[_VT_co]: ... + +@runtime_checkable +class ContextManager(Protocol[_T_co]): + def __enter__(self) -> _T_co: ... + def __exit__(self, __exc_type: Optional[Type[BaseException]], + __exc_value: Optional[BaseException], + __traceback: Optional[TracebackType]) -> Optional[bool]: ... + +@runtime_checkable +class AsyncContextManager(Protocol[_T_co]): + def __aenter__(self) -> Awaitable[_T_co]: ... + def __aexit__( + self, + exc_type: Optional[Type[BaseException]], + exc_value: Optional[BaseException], + traceback: Optional[TracebackType], + ) -> Awaitable[Optional[bool]]: ... + +class Mapping(_Collection[_KT], Generic[_KT, _VT_co]): + # TODO: We wish the key type could also be covariant, but that doesn't work, + # see discussion in https: //github.com/python/typing/pull/273. + @abstractmethod + def __getitem__(self, k: _KT) -> _VT_co: + ... + # Mixin methods + @overload + def get(self, k: _KT) -> Optional[_VT_co]: ... + @overload + def get(self, k: _KT, default: Union[_VT_co, _T]) -> Union[_VT_co, _T]: ... + def items(self) -> AbstractSet[Tuple[_KT, _VT_co]]: ... + def keys(self) -> AbstractSet[_KT]: ... + def values(self) -> ValuesView[_VT_co]: ... + def __contains__(self, o: object) -> bool: ... + +class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]): + @abstractmethod + def __setitem__(self, k: _KT, v: _VT) -> None: ... + @abstractmethod + def __delitem__(self, v: _KT) -> None: ... + + def clear(self) -> None: ... + @overload + def pop(self, k: _KT) -> _VT: ... + @overload + def pop(self, k: _KT, default: Union[_VT, _T] = ...) -> Union[_VT, _T]: ... + def popitem(self) -> Tuple[_KT, _VT]: ... + def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ... + # 'update' used to take a Union, but using overloading is better. + # The second overloaded type here is a bit too general, because + # Mapping[Tuple[_KT, _VT], W] is a subclass of Iterable[Tuple[_KT, _VT]], + # but will always have the behavior of the first overloaded type + # at runtime, leading to keys of a mix of types _KT and Tuple[_KT, _VT]. + # We don't currently have any way of forcing all Mappings to use + # the first overload, but by using overloading rather than a Union, + # mypy will commit to using the first overload when the argument is + # known to be a Mapping with unknown type parameters, which is closer + # to the behavior we want. See mypy issue #1430. + @overload + def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + @overload + def update(self, **kwargs: _VT) -> None: ... + +Text = str + +TYPE_CHECKING = True + +class IO(Iterator[AnyStr], Generic[AnyStr]): + # TODO detach + # TODO use abstract properties + @property + def mode(self) -> str: ... + @property + def name(self) -> str: ... + @abstractmethod + def close(self) -> None: ... + @property + def closed(self) -> bool: ... + @abstractmethod + def fileno(self) -> int: ... + @abstractmethod + def flush(self) -> None: ... + @abstractmethod + def isatty(self) -> bool: ... + # TODO what if n is None? + @abstractmethod + def read(self, n: int = ...) -> AnyStr: ... + @abstractmethod + def readable(self) -> bool: ... + @abstractmethod + def readline(self, limit: int = ...) -> AnyStr: ... + @abstractmethod + def readlines(self, hint: int = ...) -> list[AnyStr]: ... + @abstractmethod + def seek(self, offset: int, whence: int = ...) -> int: ... + @abstractmethod + def seekable(self) -> bool: ... + @abstractmethod + def tell(self) -> int: ... + @abstractmethod + def truncate(self, size: Optional[int] = ...) -> int: ... + @abstractmethod + def writable(self) -> bool: ... + # TODO buffer objects + @abstractmethod + def write(self, s: AnyStr) -> int: ... + @abstractmethod + def writelines(self, lines: Iterable[AnyStr]) -> None: ... + + @abstractmethod + def __next__(self) -> AnyStr: ... + @abstractmethod + def __iter__(self) -> Iterator[AnyStr]: ... + @abstractmethod + def __enter__(self) -> IO[AnyStr]: ... + @abstractmethod + def __exit__(self, t: Optional[Type[BaseException]], value: Optional[BaseException], + traceback: Optional[TracebackType]) -> Optional[bool]: ... + +class BinaryIO(IO[bytes]): + # TODO readinto + # TODO read1? + # TODO peek? + @overload + @abstractmethod + def write(self, s: bytearray) -> int: ... + @overload + @abstractmethod + def write(self, s: bytes) -> int: ... + + @abstractmethod + def __enter__(self) -> BinaryIO: ... + +class TextIO(IO[str]): + # TODO use abstractproperty + @property + def buffer(self) -> BinaryIO: ... + @property + def encoding(self) -> str: ... + @property + def errors(self) -> Optional[str]: ... + @property + def line_buffering(self) -> int: ... # int on PyPy, bool on CPython + @property + def newlines(self) -> Any: ... # None, str or tuple + @abstractmethod + def __enter__(self) -> TextIO: ... + +class ByteString(Sequence[int], metaclass=ABCMeta): ... + +class Match(Generic[AnyStr]): + pos: int + endpos: int + lastindex: Optional[int] + lastgroup: Optional[AnyStr] + string: AnyStr + + # The regular expression object whose match() or search() method produced + # this match instance. + re: Pattern[AnyStr] + + def expand(self, template: AnyStr) -> AnyStr: ... + + # TODO: The return for a group may be None, except if __group is 0 or not given. + @overload + def group(self, __group: Union[str, int] = ...) -> AnyStr: ... + @overload + def group( + self, + __group1: Union[str, int], + __group2: Union[str, int], + *groups: Union[str, int], + ) -> Tuple[AnyStr, ...]: ... + + def groups(self, default: AnyStr = ...) -> Sequence[AnyStr]: ... + def groupdict(self, default: AnyStr = ...) -> dict[str, AnyStr]: ... + def start(self, group: Union[int, str] = ...) -> int: ... + def end(self, group: Union[int, str] = ...) -> int: ... + def span(self, group: Union[int, str] = ...) -> Tuple[int, int]: ... + @property + def regs(self) -> Tuple[Tuple[int, int], ...]: ... # undocumented + if sys.version_info >= (3, 6): + def __getitem__(self, g: Union[int, str]) -> AnyStr: ... + +class Pattern(Generic[AnyStr]): + flags: int + groupindex: Mapping[str, int] + groups: int + pattern: AnyStr + + def search(self, string: AnyStr, pos: int = ..., + endpos: int = ...) -> Optional[Match[AnyStr]]: ... + def match(self, string: AnyStr, pos: int = ..., + endpos: int = ...) -> Optional[Match[AnyStr]]: ... + # New in Python 3.4 + def fullmatch(self, string: AnyStr, pos: int = ..., + endpos: int = ...) -> Optional[Match[AnyStr]]: ... + def split(self, string: AnyStr, maxsplit: int = ...) -> list[AnyStr]: ... + def findall(self, string: AnyStr, pos: int = ..., + endpos: int = ...) -> list[Any]: ... + def finditer(self, string: AnyStr, pos: int = ..., + endpos: int = ...) -> Iterator[Match[AnyStr]]: ... + + @overload + def sub(self, repl: AnyStr, string: AnyStr, + count: int = ...) -> AnyStr: ... + @overload + def sub(self, repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, + count: int = ...) -> AnyStr: ... + + @overload + def subn(self, repl: AnyStr, string: AnyStr, + count: int = ...) -> Tuple[AnyStr, int]: ... + @overload + def subn(self, repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, + count: int = ...) -> Tuple[AnyStr, int]: ... + +# Functions + +def get_type_hints( + obj: Callable[..., Any], globalns: Optional[Dict[str, Any]] = ..., localns: Optional[Dict[str, Any]] = ..., +) -> Dict[str, Any]: ... +if sys.version_info >= (3, 8): + def get_origin(tp: Any) -> Optional[Any]: ... + def get_args(tp: Any) -> Tuple[Any, ...]: ... + +@overload +def cast(tp: Type[_T], obj: Any) -> _T: ... +@overload +def cast(tp: str, obj: Any) -> Any: ... + +# Type constructors + +# NamedTuple is special-cased in the type checker +class NamedTuple(Tuple[Any, ...]): + _field_types: collections.OrderedDict[str, Type[Any]] + _field_defaults: Dict[str, Any] = ... + _fields: Tuple[str, ...] + _source: str + + def __init__(self, typename: str, fields: Iterable[Tuple[str, Any]] = ..., + **kwargs: Any) -> None: ... + + @classmethod + def _make(cls: Type[_T], iterable: Iterable[Any]) -> _T: ... + + if sys.version_info >= (3, 8): + def _asdict(self) -> Dict[str, Any]: ... + else: + def _asdict(self) -> collections.OrderedDict[str, Any]: ... + def _replace(self: _T, **kwargs: Any) -> _T: ... + +# Internal mypy fallback type for all typed dicts (does not exist at runtime) +class _TypedDict(Mapping[str, object], metaclass=ABCMeta): + def copy(self: _T) -> _T: ... + # Using NoReturn so that only calls using mypy plugin hook that specialize the signature + # can go through. + def setdefault(self, k: NoReturn, default: object) -> object: ... + # Mypy plugin hook for 'pop' expects that 'default' has a type variable type. + def pop(self, k: NoReturn, default: _T = ...) -> object: ... + def update(self: _T, __m: _T) -> None: ... + def __delitem__(self, k: NoReturn) -> None: ... + +def NewType(name: str, tp: Type[_T]) -> Type[_T]: ... + +# This itself is only available during type checking +def type_check_only(func_or_cls: _C) -> _C: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/__init__.pyi new file mode 100644 index 00000000..01f0dbb1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/__init__.pyi @@ -0,0 +1,32 @@ +# Stubs for unittest + +from typing import Iterable, List, Optional, Type, Union +from types import ModuleType + +from unittest.async_case import * +from unittest.case import * +from unittest.loader import * +from unittest.result import * +from unittest.runner import * +from unittest.signals import * +from unittest.suite import * + + +# not really documented +class TestProgram: + result: TestResult + def runTests(self) -> None: ... # undocumented + + +def main(module: Union[None, str, ModuleType] = ..., + defaultTest: Union[str, Iterable[str], None] = ..., + argv: Optional[List[str]] = ..., + testRunner: Union[Type[TestRunner], TestRunner, None] = ..., + testLoader: TestLoader = ..., exit: bool = ..., verbosity: int = ..., + failfast: Optional[bool] = ..., catchbreak: Optional[bool] = ..., + buffer: Optional[bool] = ..., + warnings: Optional[str] = ...) -> TestProgram: ... + + +def load_tests(loader: TestLoader, tests: TestSuite, + pattern: Optional[str]) -> TestSuite: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/async_case.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/async_case.pyi new file mode 100644 index 00000000..23e1c005 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/async_case.pyi @@ -0,0 +1,9 @@ +import sys +from typing import Any, Awaitable, Callable +from .case import TestCase + +if sys.version_info >= (3, 8): + class IsolatedAsyncioTestCase(TestCase): + async def asyncSetUp(self) -> None: ... + async def asyncTearDown(self) -> None: ... + def addAsyncCleanup(self, __func: Callable[..., Awaitable[Any]], *args: Any, **kwargs: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/case.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/case.pyi new file mode 100644 index 00000000..3a17a3a9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/case.pyi @@ -0,0 +1,248 @@ +import datetime +import logging +import sys +import unittest.result +from types import TracebackType +from typing import ( + Any, AnyStr, Callable, Container, ContextManager, Dict, FrozenSet, Generic, + Iterable, List, Mapping, NoReturn, Optional, overload, Pattern, Sequence, + Set, Tuple, Type, TypeVar, Union, +) + +_E = TypeVar('_E', bound=BaseException) +_FT = TypeVar('_FT', bound=Callable[..., Any]) + +if sys.version_info >= (3, 8): + def addModuleCleanup(__function: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ... + def doModuleCleanups() -> None: ... + +def expectedFailure(func: _FT) -> _FT: ... +def skip(reason: str) -> Callable[[_FT], _FT]: ... +def skipIf(condition: object, reason: str) -> Callable[[_FT], _FT]: ... +def skipUnless(condition: object, reason: str) -> Callable[[_FT], _FT]: ... + + +class SkipTest(Exception): + def __init__(self, reason: str) -> None: ... + + +class TestCase: + failureException: Type[BaseException] + longMessage: bool + maxDiff: Optional[int] + # undocumented + _testMethodName: str + # undocumented + _testMethodDoc: str + def __init__(self, methodName: str = ...) -> None: ... + def setUp(self) -> None: ... + def tearDown(self) -> None: ... + @classmethod + def setUpClass(cls) -> None: ... + @classmethod + def tearDownClass(cls) -> None: ... + def run(self, result: Optional[unittest.result.TestResult] = ...) -> Optional[unittest.result.TestResult]: ... + def __call__(self, result: Optional[unittest.result.TestResult] = ...) -> Optional[unittest.result.TestResult]: ... + def skipTest(self, reason: Any) -> None: ... + def subTest(self, msg: Any = ..., **params: Any) -> ContextManager[None]: ... + def debug(self) -> None: ... + def _addSkip( + self, result: unittest.result.TestResult, test_case: unittest.case.TestCase, reason: str + ) -> None: ... + def assertEqual(self, first: Any, second: Any, msg: Any = ...) -> None: ... + def assertNotEqual(self, first: Any, second: Any, + msg: Any = ...) -> None: ... + def assertTrue(self, expr: Any, msg: Any = ...) -> None: ... + def assertFalse(self, expr: Any, msg: Any = ...) -> None: ... + def assertIs(self, expr1: Any, expr2: Any, msg: Any = ...) -> None: ... + def assertIsNot(self, expr1: Any, expr2: Any, msg: Any = ...) -> None: ... + def assertIsNone(self, obj: Any, msg: Any = ...) -> None: ... + def assertIsNotNone(self, obj: Any, msg: Any = ...) -> None: ... + def assertIn(self, member: Any, + container: Union[Iterable[Any], Container[Any]], + msg: Any = ...) -> None: ... + def assertNotIn(self, member: Any, + container: Union[Iterable[Any], Container[Any]], + msg: Any = ...) -> None: ... + def assertIsInstance(self, obj: Any, + cls: Union[type, Tuple[type, ...]], + msg: Any = ...) -> None: ... + def assertNotIsInstance(self, obj: Any, + cls: Union[type, Tuple[type, ...]], + msg: Any = ...) -> None: ... + def assertGreater(self, a: Any, b: Any, msg: Any = ...) -> None: ... + def assertGreaterEqual(self, a: Any, b: Any, msg: Any = ...) -> None: ... + def assertLess(self, a: Any, b: Any, msg: Any = ...) -> None: ... + def assertLessEqual(self, a: Any, b: Any, msg: Any = ...) -> None: ... + @overload + def assertRaises(self, # type: ignore + expected_exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]], + callable: Callable[..., Any], + *args: Any, **kwargs: Any) -> None: ... + @overload + def assertRaises(self, + expected_exception: Union[Type[_E], Tuple[Type[_E], ...]], + msg: Any = ...) -> _AssertRaisesContext[_E]: ... + @overload + def assertRaisesRegex(self, # type: ignore + expected_exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]], + expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], + callable: Callable[..., Any], + *args: Any, **kwargs: Any) -> None: ... + @overload + def assertRaisesRegex(self, + expected_exception: Union[Type[_E], Tuple[Type[_E], ...]], + expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], + msg: Any = ...) -> _AssertRaisesContext[_E]: ... + @overload + def assertWarns(self, # type: ignore + expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], + callable: Callable[..., Any], + *args: Any, **kwargs: Any) -> None: ... + @overload + def assertWarns(self, + expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], + msg: Any = ...) -> _AssertWarnsContext: ... + @overload + def assertWarnsRegex(self, # type: ignore + expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], + expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], + callable: Callable[..., Any], + *args: Any, **kwargs: Any) -> None: ... + @overload + def assertWarnsRegex(self, + expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], + expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], + msg: Any = ...) -> _AssertWarnsContext: ... + def assertLogs( + self, logger: Optional[Union[str, logging.Logger]] = ..., + level: Union[int, str, None] = ... + ) -> _AssertLogsContext: ... + @overload + def assertAlmostEqual(self, first: float, second: float, places: int = ..., + msg: Any = ..., delta: float = ...) -> None: ... + @overload + def assertAlmostEqual(self, first: datetime.datetime, second: datetime.datetime, + places: int = ..., msg: Any = ..., + delta: datetime.timedelta = ...) -> None: ... + @overload + def assertNotAlmostEqual(self, first: float, second: float, *, + msg: Any = ...) -> None: ... + @overload + def assertNotAlmostEqual(self, first: float, second: float, + places: int = ..., msg: Any = ...) -> None: ... + @overload + def assertNotAlmostEqual(self, first: float, second: float, *, + msg: Any = ..., delta: float = ...) -> None: ... + @overload + def assertNotAlmostEqual(self, first: datetime.datetime, second: datetime.datetime, + places: int = ..., msg: Any = ..., + delta: datetime.timedelta = ...) -> None: ... + def assertRegex(self, text: AnyStr, expected_regex: Union[AnyStr, Pattern[AnyStr]], + msg: Any = ...) -> None: ... + def assertNotRegex(self, text: AnyStr, unexpected_regex: Union[AnyStr, Pattern[AnyStr]], + msg: Any = ...) -> None: ... + def assertCountEqual(self, first: Iterable[Any], second: Iterable[Any], + msg: Any = ...) -> None: ... + def addTypeEqualityFunc(self, typeobj: Type[Any], + function: Callable[..., None]) -> None: ... + def assertMultiLineEqual(self, first: str, second: str, + msg: Any = ...) -> None: ... + def assertSequenceEqual(self, seq1: Sequence[Any], seq2: Sequence[Any], + msg: Any = ..., + seq_type: Type[Sequence[Any]] = ...) -> None: ... + def assertListEqual(self, list1: List[Any], list2: List[Any], + msg: Any = ...) -> None: ... + def assertTupleEqual(self, tuple1: Tuple[Any, ...], tuple2: Tuple[Any, ...], + msg: Any = ...) -> None: ... + def assertSetEqual(self, set1: Union[Set[Any], FrozenSet[Any]], + set2: Union[Set[Any], FrozenSet[Any]], msg: Any = ...) -> None: ... + def assertDictEqual(self, d1: Dict[Any, Any], d2: Dict[Any, Any], + msg: Any = ...) -> None: ... + def fail(self, msg: Any = ...) -> NoReturn: ... + def countTestCases(self) -> int: ... + def defaultTestResult(self) -> unittest.result.TestResult: ... + def id(self) -> str: ... + def shortDescription(self) -> Optional[str]: ... + def addCleanup(self, function: Callable[..., Any], *args: Any, + **kwargs: Any) -> None: ... + def doCleanups(self) -> None: ... + if sys.version_info >= (3, 8): + @classmethod + def addClassCleanup(cls, __function: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ... + @classmethod + def doClassCleanups(cls) -> None: ... + def _formatMessage(self, msg: Optional[str], standardMsg: str) -> str: ... # undocumented + def _getAssertEqualityFunc(self, first: Any, second: Any) -> Callable[..., None]: ... # undocumented + # below is deprecated + def failUnlessEqual(self, first: Any, second: Any, + msg: Any = ...) -> None: ... + def assertEquals(self, first: Any, second: Any, msg: Any = ...) -> None: ... + def failIfEqual(self, first: Any, second: Any, msg: Any = ...) -> None: ... + def assertNotEquals(self, first: Any, second: Any, + msg: Any = ...) -> None: ... + def failUnless(self, expr: bool, msg: Any = ...) -> None: ... + def assert_(self, expr: bool, msg: Any = ...) -> None: ... + def failIf(self, expr: bool, msg: Any = ...) -> None: ... + @overload + def failUnlessRaises(self, # type: ignore + exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]], + callable: Callable[..., Any] = ..., + *args: Any, **kwargs: Any) -> None: ... + @overload + def failUnlessRaises(self, + exception: Union[Type[_E], Tuple[Type[_E], ...]], + msg: Any = ...) -> _AssertRaisesContext[_E]: ... + def failUnlessAlmostEqual(self, first: float, second: float, + places: int = ..., msg: Any = ...) -> None: ... + def assertAlmostEquals(self, first: float, second: float, places: int = ..., + msg: Any = ..., delta: float = ...) -> None: ... + def failIfAlmostEqual(self, first: float, second: float, places: int = ..., + msg: Any = ...) -> None: ... + def assertNotAlmostEquals(self, first: float, second: float, + places: int = ..., msg: Any = ..., + delta: float = ...) -> None: ... + def assertRegexpMatches(self, text: AnyStr, regex: Union[AnyStr, Pattern[AnyStr]], + msg: Any = ...) -> None: ... + @overload + def assertRaisesRegexp(self, # type: ignore + exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]], + expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], + callable: Callable[..., Any], + *args: Any, **kwargs: Any) -> None: ... + @overload + def assertRaisesRegexp(self, + exception: Union[Type[_E], Tuple[Type[_E], ...]], + expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]], + msg: Any = ...) -> _AssertRaisesContext[_E]: ... + def assertDictContainsSubset(self, + expected: Mapping[Any, Any], + actual: Mapping[Any, Any], + msg: object = ...) -> None: ... + +class FunctionTestCase(TestCase): + def __init__(self, testFunc: Callable[[], None], + setUp: Optional[Callable[[], None]] = ..., + tearDown: Optional[Callable[[], None]] = ..., + description: Optional[str] = ...) -> None: ... + +class _AssertRaisesContext(Generic[_E]): + exception: _E + def __enter__(self) -> _AssertRaisesContext[_E]: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> bool: ... + +class _AssertWarnsContext: + warning: Warning + filename: str + lineno: int + def __enter__(self) -> _AssertWarnsContext: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> None: ... + +class _AssertLogsContext: + records: List[logging.LogRecord] + output: List[str] + def __enter__(self) -> _AssertLogsContext: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> Optional[bool]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/loader.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/loader.pyi new file mode 100644 index 00000000..2371778f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/loader.pyi @@ -0,0 +1,25 @@ +import unittest.case +import unittest.suite +import unittest.result +from types import ModuleType +from typing import Any, Callable, List, Optional, Sequence, Type + + +class TestLoader: + errors: List[Type[BaseException]] + testMethodPrefix: str + sortTestMethodsUsing: Callable[[str, str], bool] + suiteClass: Callable[[List[unittest.case.TestCase]], unittest.suite.TestSuite] + def loadTestsFromTestCase(self, + testCaseClass: Type[unittest.case.TestCase]) -> unittest.suite.TestSuite: ... + def loadTestsFromModule(self, module: ModuleType, *, pattern: Any = ...) -> unittest.suite.TestSuite: ... + def loadTestsFromName(self, name: str, + module: Optional[ModuleType] = ...) -> unittest.suite.TestSuite: ... + def loadTestsFromNames(self, names: Sequence[str], + module: Optional[ModuleType] = ...) -> unittest.suite.TestSuite: ... + def getTestCaseNames(self, + testCaseClass: Type[unittest.case.TestCase]) -> Sequence[str]: ... + def discover(self, start_dir: str, pattern: str = ..., + top_level_dir: Optional[str] = ...) -> unittest.suite.TestSuite: ... + +defaultTestLoader: TestLoader diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/mock.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/mock.pyi new file mode 100644 index 00000000..396d806b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/mock.pyi @@ -0,0 +1,150 @@ +# Stubs for mock + +import sys +from typing import Any, List, Optional, Text, Tuple, Type, TypeVar + +_T = TypeVar("_T") + +FILTER_DIR: Any + +class _slotted: ... + +class _SentinelObject: + name: Any + def __init__(self, name: Any) -> None: ... + +class _Sentinel: + def __init__(self) -> None: ... + def __getattr__(self, name: str) -> Any: ... + +sentinel: Any +DEFAULT: Any + +class _CallList(List[_T]): + def __contains__(self, value: Any) -> bool: ... + +class _MockIter: + obj: Any + def __init__(self, obj: Any) -> None: ... + def __iter__(self) -> Any: ... + def __next__(self) -> Any: ... + +class Base: + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + +# TODO: Defining this and other mock classes as classes in this stub causes +# many false positives with mypy and production code. See if we can +# improve mypy somehow and use a class with an "Any" base class. +NonCallableMock = Any + +class CallableMixin(Base): + side_effect: Any + def __init__(self, spec: Optional[Any] = ..., side_effect: Optional[Any] = ..., return_value: Any = ..., wraps: Optional[Any] = ..., name: Optional[Any] = ..., spec_set: Optional[Any] = ..., parent: Optional[Any] = ..., _spec_state: Optional[Any] = ..., _new_name: Any = ..., _new_parent: Optional[Any] = ..., **kwargs: Any) -> None: ... + def __call__(_mock_self, *args: Any, **kwargs: Any) -> Any: ... + +Mock = Any + +class _patch: + attribute_name: Any + getter: Any + attribute: Any + new: Any + new_callable: Any + spec: Any + create: bool + has_local: Any + spec_set: Any + autospec: Any + kwargs: Any + additional_patchers: Any + def __init__(self, getter: Any, attribute: Any, new: Any, spec: Any, create: Any, spec_set: Any, autospec: Any, new_callable: Any, kwargs: Any) -> None: ... + def copy(self) -> Any: ... + def __call__(self, func: Any) -> Any: ... + def decorate_class(self, klass: Any) -> Any: ... + def decorate_callable(self, func: Any) -> Any: ... + def get_original(self) -> Any: ... + target: Any + temp_original: Any + is_local: Any + def __enter__(self) -> Any: ... + def __exit__(self, *exc_info: Any) -> Any: ... + def start(self) -> Any: ... + def stop(self) -> Any: ... + +class _patch_dict: + in_dict: Any + values: Any + clear: Any + def __init__(self, in_dict: Any, values: Any = ..., clear: Any = ..., **kwargs: Any) -> None: ... + def __call__(self, f: Any) -> Any: ... + def decorate_class(self, klass: Any) -> Any: ... + def __enter__(self) -> Any: ... + def __exit__(self, *args: Any) -> Any: ... + start: Any + stop: Any + +class _patcher: + TEST_PREFIX: str + dict: Type[_patch_dict] + def __call__(self, target: Any, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... + def object(self, target: Any, attribute: Text, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... + def multiple(self, target: Any, spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... + def stopall(self) -> None: ... + +patch: _patcher + +class MagicMixin: + def __init__(self, *args: Any, **kw: Any) -> None: ... + +NonCallableMagicMock = Any +MagicMock = Any +if sys.version_info >= (3, 8): + AsyncMock = Any + +class MagicProxy: + name: Any + parent: Any + def __init__(self, name: Any, parent: Any) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def create_mock(self) -> Any: ... + def __get__(self, obj: Any, _type: Optional[Any] = ...) -> Any: ... + +class _ANY: + def __eq__(self, other: Any) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + +ANY: Any + +class _Call(Tuple[Any, ...]): + def __new__(cls, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ...) -> Any: ... + name: Any + parent: Any + from_kall: Any + def __init__(self, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ...) -> None: ... + def __eq__(self, other: Any) -> bool: ... + __ne__: Any + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def __getattr__(self, attr: Any) -> Any: ... + def count(self, *args: Any, **kwargs: Any) -> Any: ... + def index(self, *args: Any, **kwargs: Any) -> Any: ... + def call_list(self) -> Any: ... + +call: Any + +def create_autospec(spec: Any, spec_set: Any = ..., instance: Any = ..., _parent: Optional[Any] = ..., _name: Optional[Any] = ..., **kwargs: Any) -> Any: ... + +class _SpecState: + spec: Any + ids: Any + spec_set: Any + parent: Any + instance: Any + name: Any + def __init__(self, spec: Any, spec_set: Any = ..., parent: Optional[Any] = ..., name: Optional[Any] = ..., ids: Optional[Any] = ..., instance: Any = ...) -> None: ... + +def mock_open(mock: Optional[Any] = ..., read_data: Any = ...) -> Any: ... + +PropertyMock = Any + +if sys.version_info >= (3, 7): + def seal(mock: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/result.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/result.pyi new file mode 100644 index 00000000..6ce685a2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/result.pyi @@ -0,0 +1,36 @@ +from typing import List, Optional, Tuple, Type +from types import TracebackType +import unittest.case + + +_SysExcInfoType = Tuple[Optional[Type[BaseException]], + Optional[BaseException], + Optional[TracebackType]] + + +class TestResult: + errors: List[Tuple[unittest.case.TestCase, str]] + failures: List[Tuple[unittest.case.TestCase, str]] + skipped: List[Tuple[unittest.case.TestCase, str]] + expectedFailures: List[Tuple[unittest.case.TestCase, str]] + unexpectedSuccesses: List[unittest.case.TestCase] + shouldStop: bool + testsRun: int + buffer: bool + failfast: bool + tb_locals: bool + def wasSuccessful(self) -> bool: ... + def stop(self) -> None: ... + def startTest(self, test: unittest.case.TestCase) -> None: ... + def stopTest(self, test: unittest.case.TestCase) -> None: ... + def startTestRun(self) -> None: ... + def stopTestRun(self) -> None: ... + def addError(self, test: unittest.case.TestCase, err: _SysExcInfoType) -> None: ... + def addFailure(self, test: unittest.case.TestCase, err: _SysExcInfoType) -> None: ... + def addSuccess(self, test: unittest.case.TestCase) -> None: ... + def addSkip(self, test: unittest.case.TestCase, reason: str) -> None: ... + def addExpectedFailure(self, test: unittest.case.TestCase, + err: _SysExcInfoType) -> None: ... + def addUnexpectedSuccess(self, test: unittest.case.TestCase) -> None: ... + def addSubTest(self, test: unittest.case.TestCase, subtest: unittest.case.TestCase, + outcome: Optional[_SysExcInfoType]) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/runner.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/runner.pyi new file mode 100644 index 00000000..95199b2c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/runner.pyi @@ -0,0 +1,37 @@ +from typing import Callable, Optional, TextIO, Tuple, Type, Union +import unittest.case +import unittest.result +import unittest.suite + + +_ResultClassType = Callable[[TextIO, bool, int], unittest.result.TestResult] + + +class TextTestResult(unittest.result.TestResult): + separator1: str + separator2: str + def __init__(self, stream: TextIO, descriptions: bool, + verbosity: int) -> None: ... + def getDescription(self, test: unittest.case.TestCase) -> str: ... + def printErrors(self) -> None: ... + def printErrorList(self, flavour: str, errors: Tuple[unittest.case.TestCase, str]) -> None: ... + + +class TestRunner: + def run(self, test: Union[unittest.suite.TestSuite, unittest.case.TestCase]) -> unittest.result.TestResult: ... + + +class TextTestRunner(TestRunner): + def __init__( + self, + stream: Optional[TextIO] = ..., + descriptions: bool = ..., + verbosity: int = ..., + failfast: bool = ..., + buffer: bool = ..., + resultclass: Optional[_ResultClassType] = ..., + warnings: Optional[Type[Warning]] = ..., + *, + tb_locals: bool = ..., + ) -> None: ... + def _makeResult(self) -> unittest.result.TestResult: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/signals.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/signals.pyi new file mode 100644 index 00000000..a4616b77 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/signals.pyi @@ -0,0 +1,14 @@ +from typing import Any, Callable, overload, TypeVar +import unittest.result + + +_F = TypeVar('_F', bound=Callable[..., Any]) + + +def installHandler() -> None: ... +def registerResult(result: unittest.result.TestResult) -> None: ... +def removeResult(result: unittest.result.TestResult) -> bool: ... +@overload +def removeHandler() -> None: ... +@overload +def removeHandler(function: _F) -> _F: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/suite.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/suite.pyi new file mode 100644 index 00000000..54e9e69e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/suite.pyi @@ -0,0 +1,22 @@ +from typing import Iterable, Iterator, List, Union +import unittest.case +import unittest.result + + +_TestType = Union[unittest.case.TestCase, TestSuite] + + +class BaseTestSuite(Iterable[_TestType]): + _tests: List[unittest.case.TestCase] + _removed_tests: int + def __init__(self, tests: Iterable[_TestType] = ...) -> None: ... + def __call__(self, result: unittest.result.TestResult) -> unittest.result.TestResult: ... + def addTest(self, test: _TestType) -> None: ... + def addTests(self, tests: Iterable[_TestType]) -> None: ... + def run(self, result: unittest.result.TestResult) -> unittest.result.TestResult: ... + def debug(self) -> None: ... + def countTestCases(self) -> int: ... + def __iter__(self) -> Iterator[_TestType]: ... + + +class TestSuite(BaseTestSuite): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/util.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/util.pyi new file mode 100644 index 00000000..9b56f8bb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/unittest/util.pyi @@ -0,0 +1,22 @@ +# undocumented +from typing import Any, List, Sequence, Tuple, TypeVar + +_T = TypeVar('_T') +_Mismatch = Tuple[_T, _T, int] + +_MAX_LENGTH: int +_PLACEHOLDER_LEN: int +_MIN_BEGIN_LEN: int +_MIN_END_LEN: int +_MIN_COMMON_LEN: int +_MIN_DIFF_LEN: int + +def _shorten(s: str, prefixlen: int, suffixlen: int) -> str: ... +def _common_shorten_repr(*args: str) -> Tuple[str]: ... +def safe_repr(obj: object, short: bool = ...) -> str: ... +def strclass(cls: type) -> str: ... +def sorted_list_difference(expected: Sequence[_T], actual: Sequence[_T]) -> Tuple[List[_T], List[_T]]: ... +def unorderable_list_difference(expected: Sequence[_T], actual: Sequence[_T]) -> Tuple[List[_T], List[_T]]: ... +def three_way_cmp(x: Any, y: Any) -> int: ... +def _count_diff_all_purpose(actual: Sequence[_T], expected: Sequence[_T]) -> List[_Mismatch[_T]]: ... +def _count_diff_hashable(actual: Sequence[_T], expected: Sequence[_T]) -> List[_Mismatch[_T]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/urllib/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/urllib/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/urllib/error.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/urllib/error.pyi new file mode 100644 index 00000000..16ceae8f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/urllib/error.pyi @@ -0,0 +1,11 @@ +from typing import Dict, Union +from urllib.response import addinfourl + +# Stubs for urllib.error + +class URLError(IOError): + reason: Union[str, BaseException] +class HTTPError(URLError, addinfourl): + code: int + def __init__(self, url, code, msg, hdrs, fp) -> None: ... +class ContentTooShortError(URLError): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/urllib/parse.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/urllib/parse.pyi new file mode 100644 index 00000000..0564a825 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/urllib/parse.pyi @@ -0,0 +1,144 @@ +# Stubs for urllib.parse +from typing import Any, List, Dict, Tuple, AnyStr, Generic, overload, Sequence, Mapping, Union, NamedTuple, Callable, Optional + +_Str = Union[bytes, str] + + +uses_relative: List[str] +uses_netloc: List[str] +uses_params: List[str] +non_hierarchical: List[str] +uses_query: List[str] +uses_fragment: List[str] +scheme_chars: str +MAX_CACHE_SIZE: int + +class _ResultMixinBase(Generic[AnyStr]): + def geturl(self) -> AnyStr: ... + +class _ResultMixinStr(_ResultMixinBase[str]): + def encode(self, encoding: str = ..., errors: str = ...) -> _ResultMixinBytes: ... + + +class _ResultMixinBytes(_ResultMixinBase[str]): + def decode(self, encoding: str = ..., errors: str = ...) -> _ResultMixinStr: ... + + +class _NetlocResultMixinBase(Generic[AnyStr]): + username: Optional[AnyStr] + password: Optional[AnyStr] + hostname: Optional[AnyStr] + port: Optional[int] + +class _NetlocResultMixinStr(_NetlocResultMixinBase[str], _ResultMixinStr): ... + +class _NetlocResultMixinBytes(_NetlocResultMixinBase[bytes], _ResultMixinBytes): ... + +class _DefragResultBase(Tuple[Any, ...], Generic[AnyStr]): + url: AnyStr + fragment: AnyStr + + +class _SplitResultBase(NamedTuple): + scheme: str + netloc: str + path: str + query: str + fragment: str +class _SplitResultBytesBase(NamedTuple): + scheme: bytes + netloc: bytes + path: bytes + query: bytes + fragment: bytes + +class _ParseResultBase(NamedTuple): + scheme: str + netloc: str + path: str + params: str + query: str + fragment: str +class _ParseResultBytesBase(NamedTuple): + scheme: bytes + netloc: bytes + path: bytes + params: bytes + query: bytes + fragment: bytes + +# Structured result objects for string data +class DefragResult(_DefragResultBase[str], _ResultMixinStr): ... + +class SplitResult(_SplitResultBase, _NetlocResultMixinStr): ... + +class ParseResult(_ParseResultBase, _NetlocResultMixinStr): ... + +# Structured result objects for bytes data +class DefragResultBytes(_DefragResultBase[bytes], _ResultMixinBytes): ... + +class SplitResultBytes(_SplitResultBytesBase, _NetlocResultMixinBytes): ... + +class ParseResultBytes(_ParseResultBytesBase, _NetlocResultMixinBytes): ... + + +def parse_qs(qs: Optional[AnyStr], keep_blank_values: bool = ..., strict_parsing: bool = ..., encoding: str = ..., errors: str = ...) -> Dict[AnyStr, List[AnyStr]]: ... + +def parse_qsl(qs: Optional[AnyStr], keep_blank_values: bool = ..., strict_parsing: bool = ..., encoding: str = ..., errors: str = ...) -> List[Tuple[AnyStr, AnyStr]]: ... + + +@overload +def quote(string: str, safe: _Str = ..., encoding: str = ..., errors: str = ...) -> str: ... +@overload +def quote(string: bytes, safe: _Str = ...) -> str: ... + +def quote_from_bytes(bs: bytes, safe: _Str = ...) -> str: ... + +@overload +def quote_plus(string: str, safe: _Str = ..., encoding: str = ..., errors: str = ...) -> str: ... +@overload +def quote_plus(string: bytes, safe: _Str = ...) -> str: ... + +def unquote(string: str, encoding: str = ..., errors: str = ...) -> str: ... + +def unquote_to_bytes(string: _Str) -> bytes: ... + +def unquote_plus(string: str, encoding: str = ..., errors: str = ...) -> str: ... + +@overload +def urldefrag(url: str) -> DefragResult: ... +@overload +def urldefrag(url: Optional[bytes]) -> DefragResultBytes: ... + +def urlencode( + query: Union[Mapping[Any, Any], Mapping[Any, Sequence[Any]], Sequence[Tuple[Any, Any]], Sequence[Tuple[Any, Sequence[Any]]]], + doseq: bool = ..., + safe: AnyStr = ..., + encoding: str = ..., + errors: str = ..., + quote_via: Callable[[str, AnyStr, str, str], str] = ..., +) -> str: ... + +def urljoin(base: AnyStr, url: Optional[AnyStr], allow_fragments: bool = ...) -> AnyStr: ... + +@overload +def urlparse(url: str, scheme: Optional[str] = ..., allow_fragments: bool = ...) -> ParseResult: ... +@overload +def urlparse(url: Optional[bytes], scheme: Optional[bytes] = ..., allow_fragments: bool = ...) -> ParseResultBytes: ... + +@overload +def urlsplit(url: str, scheme: Optional[str] = ..., allow_fragments: bool = ...) -> SplitResult: ... +@overload +def urlsplit(url: Optional[bytes], scheme: Optional[bytes] = ..., allow_fragments: bool = ...) -> SplitResultBytes: ... + +@overload +def urlunparse( + components: Tuple[Optional[AnyStr], Optional[AnyStr], Optional[AnyStr], Optional[AnyStr], Optional[AnyStr], Optional[AnyStr]] +) -> AnyStr: ... +@overload +def urlunparse(components: Sequence[Optional[AnyStr]]) -> AnyStr: ... + +@overload +def urlunsplit(components: Tuple[Optional[AnyStr], Optional[AnyStr], Optional[AnyStr], Optional[AnyStr], Optional[AnyStr]]) -> AnyStr: ... +@overload +def urlunsplit(components: Sequence[Optional[AnyStr]]) -> AnyStr: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/urllib/request.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/urllib/request.pyi new file mode 100644 index 00000000..7dd954d4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/urllib/request.pyi @@ -0,0 +1,226 @@ +# Stubs for urllib.request (Python 3.4) + +from typing import ( + Any, Callable, ClassVar, Dict, List, IO, Mapping, Optional, Sequence, Tuple, + TypeVar, Union, overload, NoReturn, +) +from http.client import HTTPResponse, HTTPMessage, _HTTPConnectionProtocol +from http.cookiejar import CookieJar +from email.message import Message +from urllib.response import addinfourl +import ssl +import sys +import os + +_T = TypeVar('_T') +_UrlopenRet = Any + +class _HTTPResponse(HTTPResponse): + url: str + msg: str # type: ignore + +def urlopen( + url: Union[str, Request], data: Optional[bytes] = ..., + timeout: Optional[float] = ..., *, cafile: Optional[str] = ..., + capath: Optional[str] = ..., cadefault: bool = ..., + context: Optional[ssl.SSLContext] = ... +) -> _UrlopenRet: ... +def install_opener(opener: OpenerDirector) -> None: ... +def build_opener( + *handlers: Union[BaseHandler, Callable[[], BaseHandler]] +) -> OpenerDirector: ... +def url2pathname(path: str) -> str: ... +def pathname2url(path: str) -> str: ... +def getproxies() -> Dict[str, str]: ... +def parse_http_list(s: str) -> List[str]: ... +def parse_keqv_list(l: List[str]) -> Dict[str, str]: ... +def proxy_bypass(host: str) -> Any: ... # Undocumented + +class Request: + @property + def full_url(self) -> str: ... + @full_url.setter + def full_url(self, value: str) -> None: ... + @full_url.deleter + def full_url(self) -> None: ... + type: str + host: str + origin_req_host: str + selector: str + data: Optional[bytes] + headers: Dict[str, str] + unverifiable: bool + method: Optional[str] + def __init__(self, url: str, data: Optional[bytes] = ..., + headers: Dict[str, str] = ..., origin_req_host: Optional[str] = ..., + unverifiable: bool = ..., method: Optional[str] = ...) -> None: ... + def get_method(self) -> str: ... + def add_header(self, key: str, val: str) -> None: ... + def add_unredirected_header(self, key: str, val: str) -> None: ... + def has_header(self, header_name: str) -> bool: ... + def remove_header(self, header_name: str) -> None: ... + def get_full_url(self) -> str: ... + def set_proxy(self, host: str, type: str) -> None: ... + @overload + def get_header(self, header_name: str) -> Optional[str]: ... + @overload + def get_header(self, header_name: str, default: _T) -> Union[str, _T]: ... + def header_items(self) -> List[Tuple[str, str]]: ... + +class OpenerDirector: + addheaders: List[Tuple[str, str]] + def add_handler(self, handler: BaseHandler) -> None: ... + def open(self, url: Union[str, Request], data: Optional[bytes] = ..., + timeout: Optional[float] = ...) -> _UrlopenRet: ... + def error(self, proto: str, *args: Any) -> _UrlopenRet: ... + + +class BaseHandler: + handler_order: ClassVar[int] + parent: OpenerDirector + def add_parent(self, parent: OpenerDirector) -> None: ... + def close(self) -> None: ... + def http_error_nnn(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> _UrlopenRet: ... + +class HTTPDefaultErrorHandler(BaseHandler): ... + +class HTTPRedirectHandler(BaseHandler): + def redirect_request(self, req: Request, fp: IO[str], code: int, msg: str, + hdrs: Mapping[str, str], + newurl: str) -> Optional[Request]: ... + def http_error_301(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + def http_error_302(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + def http_error_303(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + def http_error_307(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + +class HTTPCookieProcessor(BaseHandler): + cookiejar: CookieJar + def __init__(self, cookiejar: Optional[CookieJar] = ...) -> None: ... + +class ProxyHandler(BaseHandler): + def __init__(self, proxies: Optional[Dict[str, str]] = ...) -> None: ... + # TODO add a method for every (common) proxy protocol + +class HTTPPasswordMgr: + def add_password(self, realm: str, uri: Union[str, Sequence[str]], + user: str, passwd: str) -> None: ... + def find_user_password(self, realm: str, authuri: str) -> Tuple[Optional[str], Optional[str]]: ... + +class HTTPPasswordMgrWithDefaultRealm(HTTPPasswordMgr): + def add_password(self, realm: str, uri: Union[str, Sequence[str]], + user: str, passwd: str) -> None: ... + def find_user_password(self, realm: str, authuri: str) -> Tuple[Optional[str], Optional[str]]: ... + +class HTTPPasswordMgrWithPriorAuth(HTTPPasswordMgrWithDefaultRealm): + def add_password( + self, + realm: str, + uri: Union[str, Sequence[str]], + user: str, + passwd: str, + is_authenticated: bool = ..., + ) -> None: ... + def update_authenticated(self, uri: Union[str, Sequence[str]], is_authenticated: bool = ...) -> None: ... + def is_authenticated(self, authuri: str) -> bool: ... + +class AbstractBasicAuthHandler: + def __init__(self, + password_mgr: Optional[HTTPPasswordMgr] = ...) -> None: ... + def http_error_auth_reqed(self, authreq: str, host: str, req: Request, + headers: Mapping[str, str]) -> None: ... + +class HTTPBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): + def http_error_401(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + +class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): + def http_error_407(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + +class AbstractDigestAuthHandler: + def __init__(self, passwd: Optional[HTTPPasswordMgr] = ...) -> None: ... + def reset_retry_count(self) -> None: ... + def http_error_auth_reqed(self, auth_header: str, host: str, req: Request, + headers: Mapping[str, str]) -> None: ... + def retry_http_digest_auth(self, req: Request, auth: str) -> Optional[_UrlopenRet]: ... + def get_cnonce(self, nonce: str) -> str: ... + def get_authorization(self, req: Request, chal: Mapping[str, str]) -> str: ... + def get_algorithm_impls(self, algorithm: str) -> Tuple[Callable[[str], str], Callable[[str, str], str]]: ... + def get_entity_digest(self, data: Optional[bytes], chal: Mapping[str, str]) -> Optional[str]: ... + +class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): + def http_error_401(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + +class ProxyDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): + def http_error_407(self, req: Request, fp: IO[str], code: int, msg: int, + hdrs: Mapping[str, str]) -> Optional[_UrlopenRet]: ... + +class AbstractHTTPHandler(BaseHandler): # undocumented + def __init__(self, debuglevel: int = ...) -> None: ... + def set_http_debuglevel(self, level: int) -> None: ... + def do_request_(self, request: Request) -> Request: ... + def do_open(self, + http_class: _HTTPConnectionProtocol, + req: Request, + **http_conn_args: Any) -> HTTPResponse: ... + +class HTTPHandler(AbstractHTTPHandler): + def http_open(self, req: Request) -> HTTPResponse: ... + def http_request(self, request: Request) -> Request: ... # undocumented + +class HTTPSHandler(AbstractHTTPHandler): + def __init__(self, debuglevel: int = ..., + context: Optional[ssl.SSLContext] = ..., + check_hostname: Optional[bool] = ...) -> None: ... + def https_open(self, req: Request) -> HTTPResponse: ... + def https_request(self, request: Request) -> Request: ... # undocumented + +class FileHandler(BaseHandler): + def file_open(self, req: Request) -> addinfourl: ... + +class DataHandler(BaseHandler): + def data_open(self, req: Request) -> addinfourl: ... + +class FTPHandler(BaseHandler): + def ftp_open(self, req: Request) -> addinfourl: ... + +class CacheFTPHandler(FTPHandler): + def setTimeout(self, t: float) -> None: ... + def setMaxConns(self, m: int) -> None: ... + +class UnknownHandler(BaseHandler): + def unknown_open(self, req: Request) -> NoReturn: ... + +class HTTPErrorProcessor(BaseHandler): + def http_response(self, request, response) -> _UrlopenRet: ... + def https_response(self, request, response) -> _UrlopenRet: ... + +if sys.version_info >= (3, 6): + def urlretrieve(url: str, filename: Optional[Union[str, os.PathLike[Any]]] = ..., + reporthook: Optional[Callable[[int, int, int], None]] = ..., + data: Optional[bytes] = ...) -> Tuple[str, HTTPMessage]: ... +else: + def urlretrieve(url: str, filename: Optional[str] = ..., + reporthook: Optional[Callable[[int, int, int], None]] = ..., + data: Optional[bytes] = ...) -> Tuple[str, HTTPMessage]: ... +def urlcleanup() -> None: ... + +class URLopener: + version: ClassVar[str] + def __init__(self, proxies: Optional[Dict[str, str]] = ..., + **x509: str) -> None: ... + def open(self, fullurl: str, data: Optional[bytes] = ...) -> _UrlopenRet: ... + def open_unknown(self, fullurl: str, + data: Optional[bytes] = ...) -> _UrlopenRet: ... + def retrieve(self, url: str, filename: Optional[str] = ..., + reporthook: Optional[Callable[[int, int, int], None]] = ..., + data: Optional[bytes] = ...) -> Tuple[str, Optional[Message]]: ... + +class FancyURLopener(URLopener): + def prompt_user_passwd(self, host: str, realm: str) -> Tuple[str, str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/urllib/response.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/urllib/response.pyi new file mode 100644 index 00000000..dca0efac --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/urllib/response.pyi @@ -0,0 +1,42 @@ +# private module, we only expose what's needed + +from typing import BinaryIO, Iterable, List, Mapping, Optional, Type, TypeVar +from email.message import Message +from types import TracebackType + +_AIUT = TypeVar("_AIUT", bound=addbase) + +class addbase(BinaryIO): + def __enter__(self: _AIUT) -> _AIUT: ... + def __exit__(self, type: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType]) -> None: ... + def __iter__(self: _AIUT) -> _AIUT: ... + def __next__(self) -> bytes: ... + def close(self) -> None: ... + # These methods don't actually exist, but the class inherits at runtime from + # tempfile._TemporaryFileWrapper, which uses __getattr__ to delegate to the + # underlying file object. To satisfy the BinaryIO interface, we pretend that this + # class has these additional methods. + def fileno(self) -> int: ... + def flush(self) -> None: ... + def isatty(self) -> bool: ... + def read(self, n: int = ...) -> bytes: ... + def readable(self) -> bool: ... + def readline(self, limit: int = ...) -> bytes: ... + def readlines(self, hint: int = ...) -> List[bytes]: ... + def seek(self, offset: int, whence: int = ...) -> int: ... + def seekable(self) -> bool: ... + def tell(self) -> int: ... + def truncate(self, size: Optional[int] = ...) -> int: ... + def writable(self) -> bool: ... + def write(self, s: bytes) -> int: ... + def writelines(self, lines: Iterable[bytes]) -> None: ... + +class addinfo(addbase): + headers: Message + def info(self) -> Message: ... + +class addinfourl(addinfo): + url: str + code: int + def geturl(self) -> str: ... + def getcode(self) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/urllib/robotparser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/urllib/robotparser.pyi new file mode 100644 index 00000000..2c5b657b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/urllib/robotparser.pyi @@ -0,0 +1,20 @@ +# Stubs for urllib.robotparser (Python 3.4) + +from typing import Iterable, NamedTuple, Optional +import sys + +class _RequestRate(NamedTuple): + requests: int + seconds: int + +class RobotFileParser: + def __init__(self, url: str = ...) -> None: ... + def set_url(self, url: str) -> None: ... + def read(self) -> None: ... + def parse(self, lines: Iterable[str]) -> None: ... + def can_fetch(self, user_agent: str, url: str) -> bool: ... + def mtime(self) -> int: ... + def modified(self) -> None: ... + if sys.version_info >= (3, 6): + def crawl_delay(self, useragent: str) -> Optional[str]: ... + def request_rate(self, useragent: str) -> Optional[_RequestRate]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/zipapp.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/zipapp.pyi new file mode 100644 index 00000000..b90b7559 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/stdlib/3/zipapp.pyi @@ -0,0 +1,16 @@ +# Stubs for zipapp (Python 3.5+) + +from pathlib import Path +import sys +from typing import BinaryIO, Callable, Optional, Union + +_Path = Union[str, Path, BinaryIO] + +class ZipAppError(Exception): ... + +if sys.version_info >= (3, 7): + def create_archive(source: _Path, target: Optional[_Path] = ..., interpreter: Optional[str] = ..., main: Optional[str] = ..., + filter: Optional[Callable[[Path], bool]] = ..., compressed: bool = ...) -> None: ... +else: + def create_archive(source: _Path, target: Optional[_Path] = ..., interpreter: Optional[str] = ..., main: Optional[str] = ...) -> None: ... +def get_interpreter(archive: _Path) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/OpenSSL/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/OpenSSL/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/OpenSSL/crypto.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/OpenSSL/crypto.pyi new file mode 100644 index 00000000..395e6309 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/OpenSSL/crypto.pyi @@ -0,0 +1,191 @@ +# Stubs for OpenSSL.crypto (Python 2) + +from typing import Any, Callable, Iterable, List, Optional, Set, Text, Tuple, Union + +from cryptography.hazmat.primitives.asymmetric import dsa, rsa +from datetime import datetime + +FILETYPE_PEM: int +FILETYPE_ASN1: int +FILETYPE_TEXT: int +TYPE_RSA: int +TYPE_DSA: int + +class Error(Exception): ... + +_Key = Union[rsa.RSAPublicKey, rsa.RSAPrivateKey, dsa.DSAPublicKey, dsa.DSAPrivateKey] + +class PKey: + def __init__(self) -> None: ... + def to_cryptography_key(self) -> _Key: ... + @classmethod + def from_cryptography_key(cls, crypto_key: _Key): ... + def generate_key(self, type: int, bits: int) -> None: ... + def check(self) -> bool: ... + def type(self) -> int: ... + def bits(self) -> int: ... + +class _EllipticCurve: + name: Text + +def get_elliptic_curves() -> Set[_EllipticCurve]: ... +def get_elliptic_curve(name: str) -> _EllipticCurve: ... + +class X509Name: + def __init__(self, name: X509Name) -> None: ... + countryName: Union[str, unicode] + stateOrProvinceName: Union[str, unicode] + localityName: Union[str, unicode] + organizationName: Union[str, unicode] + organizationalUnitName: Union[str, unicode] + commonName: Union[str, unicode] + emailAddress: Union[str, unicode] + C: Union[str, unicode] + ST: Union[str, unicode] + L: Union[str, unicode] + O: Union[str, unicode] + OU: Union[str, unicode] + CN: Union[str, unicode] + def hash(self) -> int: ... + def der(self) -> bytes: ... + def get_components(self) -> List[Tuple[str, str]]: ... + +class X509Extension: + def __init__(self, type_name: bytes, critical: bool, value: bytes, subject: Optional[X509] = ..., + issuer: Optional[X509] = ...) -> None: ... + def get_critical(self) -> bool: ... + def get_short_name(self) -> str: ... + def get_data(self) -> str: ... + +class X509Req: + def __init__(self) -> None: ... + def set_pubkey(self, pkey: PKey) -> None: ... + def get_pubkey(self) -> PKey: ... + def set_version(self, version: int) -> None: ... + def get_version(self) -> int: ... + def get_subject(self) -> X509Name: ... + def add_extensions(self, extensions: Iterable[X509Extension]) -> None: ... + def get_extensions(self) -> List[X509Extension]: ... + def sign(self, pkey: PKey, digest: str) -> None: ... + def verify(self, pkey: PKey) -> bool: ... + +class X509: + def __init__(self) -> None: ... + def set_version(self, version: int) -> None: ... + def get_version(self) -> int: ... + def get_pubkey(self) -> PKey: ... + def set_pubkey(self, pkey: PKey) -> None: ... + def sign(self, pkey: PKey, digest: str) -> None: ... + def get_signature_algorithm(self) -> str: ... + def digest(self, digest_name: str) -> str: ... + def subject_name_hash(self) -> str: ... + def set_serial_number(self, serial: int) -> None: ... + def get_serial_number(self) -> int: ... + def gmtime_adj_notAfter(self, amount: int) -> None: ... + def gmtime_adj_notBefore(self, amount: int) -> None: ... + def has_expired(self) -> bool: ... + def get_notBefore(self) -> str: ... + def set_notBefore(self, when: str) -> None: ... + def get_notAfter(self) -> str: ... + def set_notAfter(self, when: str) -> None: ... + def get_issuer(self) -> X509Name: ... + def set_issuer(self, issuer: X509Name) -> None: ... + def get_subject(self) -> X509Name: ... + def set_subject(self, subject: X509Name) -> None: ... + def get_extension_count(self) -> int: ... + def add_extensions(self, extensions: Iterable[X509Extension]) -> None: ... + def get_extension(self, index: int) -> X509Extension: ... + +class X509StoreFlags: + CRL_CHECK: int + CRL_CHECK_ALL: int + IGNORE_CRITICAL: int + X509_STRICT: int + ALLOW_PROXY_CERTS: int + POLICY_CHECK: int + EXPLICIT_POLICY: int + INHIBIT_MAP: int + NOTIFY_POLICY: int + CHECK_SS_SIGNATURE: int + CB_ISSUER_CHECK: int + +class X509Store: + def __init__(self) -> None: ... + def add_cert(self, cert: X509) -> None: ... + def add_crl(self, crl: CRL) -> None: ... + def set_flags(self, flags: int) -> None: ... + def set_time(self, vfy_time: datetime) -> None: ... + +class X509StoreContextError(Exception): + certificate: X509 + def __init__(self, message: str, certificate: X509) -> None: ... + +class X509StoreContext: + def __init__(self, store: X509Store, certificate: X509) -> None: ... + def set_store(self, store: X509Store) -> None: ... + def verify_certificate(self) -> None: ... + +def load_certificate(type: int, buffer: Union[str, unicode]) -> X509: ... +def dump_certificate(type: int, cert: X509) -> bytes: ... +def dump_publickey(type: int, pkey: PKey) -> bytes: ... +def dump_privatekey(type: int, pkey: PKey, cipher: Optional[str] = ..., + passphrase: Optional[Union[str, Callable[[int], int]]] = ...) -> bytes: ... + +class Revoked: + def __init__(self) -> None: ... + def set_serial(self, hex_str: str) -> None: ... + def get_serial(self) -> str: ... + def set_reason(self, reason: str) -> None: ... + def get_reason(self) -> str: ... + def all_reasons(self) -> List[str]: ... + def set_rev_date(self, when: str) -> None: ... + def get_rev_date(self) -> str: ... + +class CRL: + def __init__(self) -> None: ... + def get_revoked(self) -> Tuple[Revoked, ...]: ... + def add_revoked(self, revoked: Revoked) -> None: ... + def get_issuer(self) -> X509Name: ... + def set_version(self, version: int) -> None: ... + def set_lastUpdate(self, when: str) -> None: ... + def set_nextUpdate(self, when: str) -> None: ... + def sign(self, issuer_cert: X509, issuer_key: PKey, digest: str) -> None: ... + def export(self, cert: X509, key: PKey, type: int = ..., days: int = ..., digest: str = ...) -> bytes: ... + +class PKCS7: + def type_is_signed(self) -> bool: ... + def type_is_enveloped(self) -> bool: ... + def type_is_signedAndEnveloped(self) -> bool: ... + def type_is_data(self) -> bool: ... + def get_type_name(self) -> str: ... + +class PKCS12: + def __init__(self) -> None: ... + def get_certificate(self) -> X509: ... + def set_certificate(self, cert: X509) -> None: ... + def get_privatekey(self) -> PKey: ... + def set_privatekey(self, pkey: PKey) -> None: ... + def get_ca_certificates(self) -> Tuple[X509, ...]: ... + def set_ca_certificates(self, cacerts: Iterable[X509]) -> None: ... + def set_friendlyname(self, name: bytes) -> None: ... + def get_friendlyname(self) -> bytes: ... + def export(self, passphrase: Optional[str] = ..., iter: int = ..., maciter: int = ...): ... + +class NetscapeSPKI: + def __init__(self) -> None: ... + def sign(self, pkey: PKey, digest: str) -> None: ... + def verify(self, key: PKey) -> bool: ... + def b64_encode(self) -> str: ... + def get_pubkey(self) -> PKey: ... + def set_pubkey(self, pkey: PKey) -> None: ... + +def load_publickey(type: int, buffer: Union[str, unicode]) -> PKey: ... +def load_privatekey(type: int, buffer: bytes, passphrase: Optional[Union[str, Callable[[int], int]]] = ...): ... +def dump_certificate_request(type: int, req: X509Req): ... +def load_certificate_request(type, buffer: Union[str, unicode]) -> X509Req: ... +def sign(pkey: PKey, data: Union[str, unicode], digest: str) -> bytes: ... +def verify(cert: X509, signature: bytes, data: Union[str, unicode], digest: str) -> None: ... +def dump_crl(type: int, crl: CRL) -> bytes: ... +def load_crl(type: int, buffer: Union[str, unicode]) -> CRL: ... +def load_pkcs7_data(type: int, buffer: Union[str, unicode]) -> PKCS7: ... +def load_pkcs12(buffer: Union[str, unicode], passphrase: Optional[Union[str, Callable[[int], int]]] = ...) -> PKCS12: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/concurrent/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/concurrent/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/concurrent/futures/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/concurrent/futures/__init__.pyi new file mode 100644 index 00000000..4439dcad --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/concurrent/futures/__init__.pyi @@ -0,0 +1,3 @@ +from ._base import * # noqa: F403 +from .thread import * # noqa: F403 +from .process import * # noqa: F403 diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/concurrent/futures/_base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/concurrent/futures/_base.pyi new file mode 100644 index 00000000..00ff41d7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/concurrent/futures/_base.pyi @@ -0,0 +1,100 @@ +import threading +from logging import Logger +from typing import TypeVar, Generic, Any, Iterable, Iterator, Callable, Tuple, Optional, Set, List +from types import TracebackType +import sys + +FIRST_COMPLETED: str +FIRST_EXCEPTION: str +ALL_COMPLETED: str +PENDING: str +RUNNING: str +CANCELLED: str +CANCELLED_AND_NOTIFIED: str +FINISHED: str +LOGGER: Logger + +class Error(Exception): ... +class CancelledError(Error): ... +class TimeoutError(Error): ... + +if sys.version_info >= (3, 7): + class BrokenExecutor(RuntimeError): ... + +_T = TypeVar('_T') + +class Future(Generic[_T]): + def __init__(self) -> None: ... + def cancel(self) -> bool: ... + def cancelled(self) -> bool: ... + def running(self) -> bool: ... + def done(self) -> bool: ... + def add_done_callback(self, fn: Callable[[Future[_T]], Any]) -> None: ... + def result(self, timeout: Optional[float] = ...) -> _T: ... + def set_running_or_notify_cancel(self) -> bool: ... + def set_result(self, result: _T) -> None: ... + + if sys.version_info >= (3,): + def exception(self, timeout: Optional[float] = ...) -> Optional[BaseException]: ... + def set_exception(self, exception: Optional[BaseException]) -> None: ... + else: + def exception(self, timeout: Optional[float] = ...) -> Any: ... + def exception_info(self, timeout: Optional[float] = ...) -> Tuple[Any, Optional[TracebackType]]: ... + def set_exception(self, exception: Any) -> None: ... + def set_exception_info(self, exception: Any, traceback: Optional[TracebackType]) -> None: ... + + +class Executor: + def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ... + if sys.version_info >= (3, 5): + def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ..., + chunksize: int = ...) -> Iterator[_T]: ... + else: + def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ...,) -> Iterator[_T]: ... + def shutdown(self, wait: bool = ...) -> None: ... + def __enter__(self: _T) -> _T: ... + def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> Optional[bool]: ... + +def as_completed(fs: Iterable[Future[_T]], timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ... + +def wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...) -> Tuple[Set[Future[_T]], + Set[Future[_T]]]: ... + +class _Waiter: + event: threading.Event + finished_futures: List[Future[Any]] + def __init__(self) -> None: ... + def add_result(self, future: Future[Any]) -> None: ... + def add_exception(self, future: Future[Any]) -> None: ... + def add_cancelled(self, future: Future[Any]) -> None: ... + + +class _AsCompletedWaiter(_Waiter): + lock: threading.Lock + def __init__(self) -> None: ... + def add_result(self, future: Future[Any]) -> None: ... + def add_exception(self, future: Future[Any]) -> None: ... + def add_cancelled(self, future: Future[Any]) -> None: ... + + +class _FirstCompletedWaiter(_Waiter): + def add_result(self, future: Future[Any]) -> None: ... + def add_exception(self, future: Future[Any]) -> None: ... + def add_cancelled(self, future: Future[Any]) -> None: ... + + +class _AllCompletedWaiter(_Waiter): + num_pending_calls: int + stop_on_exception: bool + lock: threading.Lock + def __init__(self, num_pending_calls: int, stop_on_exception: bool) -> None: ... + def add_result(self, future: Future[Any]) -> None: ... + def add_exception(self, future: Future[Any]) -> None: ... + def add_cancelled(self, future: Future[Any]) -> None: ... + + +class _AcquireFutures: + futures: Iterable[Future[Any]] + def __init__(self, futures: Iterable[Future[Any]]) -> None: ... + def __enter__(self) -> None: ... + def __exit__(self, *args: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/concurrent/futures/process.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/concurrent/futures/process.pyi new file mode 100644 index 00000000..ca22879c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/concurrent/futures/process.pyi @@ -0,0 +1,20 @@ +from typing import Any, Callable, Optional, Tuple +from ._base import Executor +import sys + +EXTRA_QUEUED_CALLS: Any + +if sys.version_info >= (3,): + class BrokenProcessPool(RuntimeError): ... + +if sys.version_info >= (3, 7): + from multiprocessing.context import BaseContext + + class ProcessPoolExecutor(Executor): + def __init__(self, max_workers: Optional[int] = ..., + mp_context: Optional[BaseContext] = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Tuple[Any, ...] = ...) -> None: ... +else: + class ProcessPoolExecutor(Executor): + def __init__(self, max_workers: Optional[int] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/concurrent/futures/thread.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/concurrent/futures/thread.pyi new file mode 100644 index 00000000..82c8ddd0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/concurrent/futures/thread.pyi @@ -0,0 +1,30 @@ +from typing import Any, Callable, Iterable, Mapping, Optional, Tuple, TypeVar, Generic +from ._base import Executor, Future +import sys + +if sys.version_info >= (3, 7): + from ._base import BrokenExecutor + class BrokenThreadPool(BrokenExecutor): ... + +_S = TypeVar('_S') + +class ThreadPoolExecutor(Executor): + if sys.version_info >= (3, 7): + def __init__(self, max_workers: Optional[int] = ..., + thread_name_prefix: str = ..., + initializer: Optional[Callable[..., None]] = ..., + initargs: Tuple[Any, ...] = ...) -> None: ... + elif sys.version_info >= (3, 6) or sys.version_info < (3,): + def __init__(self, max_workers: Optional[int] = ..., + thread_name_prefix: str = ...) -> None: ... + else: + def __init__(self, max_workers: Optional[int] = ...) -> None: ... + + +class _WorkItem(Generic[_S]): + future: Future[_S] + fn: Callable[..., _S] + args: Iterable[Any] + kwargs: Mapping[str, Any] + def __init__(self, future: Future[_S], fn: Callable[..., _S], args: Iterable[Any], kwargs: Mapping[str, Any]) -> None: ... + def run(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/enum.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/enum.pyi new file mode 100644 index 00000000..be22d386 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/enum.pyi @@ -0,0 +1,75 @@ +# NB: third_party/2/enum.pyi and stdlib/3.4/enum.pyi must remain consistent! +import sys +from typing import Any, Dict, Iterator, List, Mapping, Type, TypeVar, Union +from abc import ABCMeta + +_T = TypeVar('_T') +_S = TypeVar('_S', bound=Type[Enum]) + +# Note: EnumMeta actually subclasses type directly, not ABCMeta. +# This is a temporary workaround to allow multiple creation of enums with builtins +# such as str as mixins, which due to the handling of ABCs of builtin types, cause +# spurious inconsistent metaclass structure. See #1595. +# Structurally: Iterable[T], Reversible[T], Container[T] where T is the enum itself +class EnumMeta(ABCMeta): + def __iter__(self: Type[_T]) -> Iterator[_T]: ... + def __reversed__(self: Type[_T]) -> Iterator[_T]: ... + def __contains__(self: Type[_T], member: object) -> bool: ... + def __getitem__(self: Type[_T], name: str) -> _T: ... + @property + def __members__(self: Type[_T]) -> Mapping[str, _T]: ... + def __len__(self) -> int: ... + +class Enum(metaclass=EnumMeta): + name: str + value: Any + _name_: str + _value_: Any + _member_names_: List[str] # undocumented + _member_map_: Dict[str, Enum] # undocumented + _value2member_map_: Dict[int, Enum] # undocumented + if sys.version_info >= (3, 7): + _ignore_: Union[str, List[str]] + if sys.version_info >= (3, 6): + _order_: str + @classmethod + def _missing_(cls, value: object) -> Any: ... + @staticmethod + def _generate_next_value_(name: str, start: int, count: int, last_values: List[Any]) -> Any: ... + def __new__(cls: Type[_T], value: object) -> _T: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + def __dir__(self) -> List[str]: ... + def __format__(self, format_spec: str) -> str: ... + def __hash__(self) -> Any: ... + def __reduce_ex__(self, proto: object) -> Any: ... + +class IntEnum(int, Enum): + value: int + +def unique(enumeration: _S) -> _S: ... + +if sys.version_info >= (3, 6): + _auto_null: Any + + # subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto() + class auto(IntFlag): + value: Any + + class Flag(Enum): + def __contains__(self: _T, other: _T) -> bool: ... + def __repr__(self) -> str: ... + def __str__(self) -> str: ... + def __bool__(self) -> bool: ... + def __or__(self: _T, other: _T) -> _T: ... + def __and__(self: _T, other: _T) -> _T: ... + def __xor__(self: _T, other: _T) -> _T: ... + def __invert__(self: _T) -> _T: ... + + class IntFlag(int, Flag): + def __or__(self: _T, other: Union[int, _T]) -> _T: ... + def __and__(self: _T, other: Union[int, _T]) -> _T: ... + def __xor__(self: _T, other: Union[int, _T]) -> _T: ... + __ror__ = __or__ + __rand__ = __and__ + __rxor__ = __xor__ diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/fb303/FacebookService.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/fb303/FacebookService.pyi new file mode 100644 index 00000000..ead5d24f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/fb303/FacebookService.pyi @@ -0,0 +1,297 @@ +from typing import Any +from thrift.Thrift import TProcessor # type: ignore + +fastbinary: Any + +class Iface: + def getName(self): ... + def getVersion(self): ... + def getStatus(self): ... + def getStatusDetails(self): ... + def getCounters(self): ... + def getCounter(self, key): ... + def setOption(self, key, value): ... + def getOption(self, key): ... + def getOptions(self): ... + def getCpuProfile(self, profileDurationInSec): ... + def aliveSince(self): ... + def reinitialize(self): ... + def shutdown(self): ... + +class Client(Iface): + def __init__(self, iprot, oprot=...) -> None: ... + def getName(self): ... + def send_getName(self): ... + def recv_getName(self): ... + def getVersion(self): ... + def send_getVersion(self): ... + def recv_getVersion(self): ... + def getStatus(self): ... + def send_getStatus(self): ... + def recv_getStatus(self): ... + def getStatusDetails(self): ... + def send_getStatusDetails(self): ... + def recv_getStatusDetails(self): ... + def getCounters(self): ... + def send_getCounters(self): ... + def recv_getCounters(self): ... + def getCounter(self, key): ... + def send_getCounter(self, key): ... + def recv_getCounter(self): ... + def setOption(self, key, value): ... + def send_setOption(self, key, value): ... + def recv_setOption(self): ... + def getOption(self, key): ... + def send_getOption(self, key): ... + def recv_getOption(self): ... + def getOptions(self): ... + def send_getOptions(self): ... + def recv_getOptions(self): ... + def getCpuProfile(self, profileDurationInSec): ... + def send_getCpuProfile(self, profileDurationInSec): ... + def recv_getCpuProfile(self): ... + def aliveSince(self): ... + def send_aliveSince(self): ... + def recv_aliveSince(self): ... + def reinitialize(self): ... + def send_reinitialize(self): ... + def shutdown(self): ... + def send_shutdown(self): ... + +class Processor(Iface, TProcessor): + def __init__(self, handler) -> None: ... + def process(self, iprot, oprot): ... + def process_getName(self, seqid, iprot, oprot): ... + def process_getVersion(self, seqid, iprot, oprot): ... + def process_getStatus(self, seqid, iprot, oprot): ... + def process_getStatusDetails(self, seqid, iprot, oprot): ... + def process_getCounters(self, seqid, iprot, oprot): ... + def process_getCounter(self, seqid, iprot, oprot): ... + def process_setOption(self, seqid, iprot, oprot): ... + def process_getOption(self, seqid, iprot, oprot): ... + def process_getOptions(self, seqid, iprot, oprot): ... + def process_getCpuProfile(self, seqid, iprot, oprot): ... + def process_aliveSince(self, seqid, iprot, oprot): ... + def process_reinitialize(self, seqid, iprot, oprot): ... + def process_shutdown(self, seqid, iprot, oprot): ... + +class getName_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getName_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getVersion_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getVersion_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getStatus_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getStatus_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getStatusDetails_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getStatusDetails_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getCounters_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getCounters_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getCounter_args: + thrift_spec: Any + key: Any + def __init__(self, key=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getCounter_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class setOption_args: + thrift_spec: Any + key: Any + value: Any + def __init__(self, key=..., value=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class setOption_result: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getOption_args: + thrift_spec: Any + key: Any + def __init__(self, key=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getOption_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getOptions_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getOptions_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getCpuProfile_args: + thrift_spec: Any + profileDurationInSec: Any + def __init__(self, profileDurationInSec=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class getCpuProfile_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class aliveSince_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class aliveSince_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class reinitialize_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class shutdown_args: + thrift_spec: Any + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/fb303/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/fb303/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/gflags.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/gflags.pyi new file mode 100644 index 00000000..88eb2578 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/gflags.pyi @@ -0,0 +1,242 @@ +from typing import Any, Callable, Dict, Iterable, IO, List, Optional, Sequence, Union +from types import ModuleType + +class Error(Exception): ... +FlagsError = Error + +class DuplicateFlag(FlagsError): ... + +class CantOpenFlagFileError(FlagsError): ... + +class DuplicateFlagCannotPropagateNoneToSwig(DuplicateFlag): ... + +class DuplicateFlagError(DuplicateFlag): + def __init__(self, flagname: str, flag_values: FlagValues, other_flag_values: FlagValues = ...) -> None: ... + +class IllegalFlagValueError(FlagsError): ... +IllegalFlagValue = IllegalFlagValueError + +class UnrecognizedFlag(FlagsError): ... + +class UnrecognizedFlagError(UnrecognizedFlag): + def __init__(self, flagname: str, flagvalue: str = ...) -> None: ... + +def get_help_width() -> int: ... +GetHelpWidth = get_help_width +def CutCommonSpacePrefix(text) -> str: ... +def text_wrap(text: str, length: int = ..., indent: str = ..., firstline_indent: str = ..., tabs: str = ...) -> str: ... +TextWrap = text_wrap +def doc_to_help(doc: str) -> str: ... +DocToHelp = doc_to_help + +class FlagValues: + def __init__(self) -> None: ... + def UseGnuGetOpt(self, use_gnu_getopt: bool = ...) -> None: ... + def is_gnu_getopt(self) -> bool: ... + IsGnuGetOpt = is_gnu_getopt + # TODO dict type + def FlagDict(self) -> Dict[Any, Any]: ... + def flags_by_module_dict(self) -> Dict[str, List[Flag]]: ... + FlagsByModuleDict = flags_by_module_dict + def flags_by_module_id_dict(self) -> Dict[int, List[Flag]]: ... + FlagsByModuleIdDict = flags_by_module_id_dict + def key_flags_by_module_dict(self) -> Dict[str, List[Flag]]: ... + KeyFlagsByModuleDict = key_flags_by_module_dict + def find_module_defining_flag(self, flagname: str, default: str = ...) -> str: ... + FindModuleDefiningFlag = find_module_defining_flag + def find_module_id_defining_flag(self, flagname: str, default: int = ...) -> int: ... + FindModuleIdDefiningFlag = find_module_id_defining_flag + def append_flag_values(self, flag_values: FlagValues) -> None: ... + AppendFlagValues = append_flag_values + def remove_flag_values(self, flag_values: FlagValues) -> None: ... + RemoveFlagValues = remove_flag_values + def __setitem__(self, name: str, flag: Flag) -> None: ... + def __getitem__(self, name: str) -> Flag: ... + def __getattr__(self, name: str) -> Any: ... + def __setattr__(self, name: str, value: Any): ... + def __delattr__(self, flag_name: str) -> None: ... + def set_default(self, name: str, value: Any) -> None: ... + SetDefault = set_default + def __contains__(self, name: str) -> bool: ... + has_key = __contains__ + def __iter__(self) -> Iterable[str]: ... + def __call__(self, argv: List[str], known_only: bool = ...) -> List[str]: ... + def reset(self) -> None: ... + Reset = reset + def RegisteredFlags(self) -> List[str]: ... + def flag_values_dict(self) -> Dict[str, Any]: ... + FlagValuesDict = flag_values_dict + def __str__(self) -> str: ... + def GetHelp(self, prefix: str = ...) -> str: ... + def module_help(self, module: Union[ModuleType, str]) -> str: ... + ModuleHelp = module_help + def main_module_help(self) -> str: ... + MainModuleHelp = main_module_help + def get(self, name: str, default: Any) -> Any: ... + def ShortestUniquePrefixes(self, fl: Dict[str, Flag]) -> Dict[str, str]: ... + def ExtractFilename(self, flagfile_str: str) -> str: ... + def read_flags_from_files(self, argv: List[str], force_gnu: bool = ...) -> List[str]: ... + ReadFlagsFromFiles = read_flags_from_files + def flags_into_string(self) -> str: ... + FlagsIntoString = flags_into_string + def append_flags_into_file(self, filename: str) -> None: ... + AppendFlagsIntoFile = append_flags_into_file + def write_help_in_xml_format(self, outfile: IO[str] = ...) -> None: ... + WriteHelpInXMLFormat = write_help_in_xml_format + # TODO validator: gflags_validators.Validator + def AddValidator(self, validator: Any) -> None: ... + +FLAGS: FlagValues + +class Flag: + name: str + default: Any + default_as_str: str + value: Any + help: str + short_name: str + boolean = False + present = False + parser: ArgumentParser + serializer: ArgumentSerializer + allow_override = False + + def __init__(self, parser: ArgumentParser, serializer: ArgumentSerializer, name: str, + default: Optional[str], help_string: str, short_name: str = ..., boolean: bool = ..., + allow_override: bool = ...) -> None: ... + def Parse(self, argument: Any) -> Any: ... + def Unparse(self) -> None: ... + def Serialize(self) -> str: ... + def SetDefault(self, value: Any) -> None: ... + def Type(self) -> str: ... + def WriteInfoInXMLFormat(self, outfile: IO[str], module_name: str, is_key: bool = ..., indent: str = ...) -> None: ... + +class ArgumentParser(object): + syntactic_help: str + # TODO what is this + def parse(self, argument: Any) -> Any: ... + Parser = parse + def flag_type(self) -> str: ... + Type = flag_type + def WriteCustomInfoInXMLFormat(self, outfile: IO[str], indent: str) -> None: ... + +class ArgumentSerializer: + def Serialize(self, value: Any) -> unicode: ... + +class ListSerializer(ArgumentSerializer): + def __init__(self, list_sep: str) -> None: ... + def Serialize(self, value: List[Any]) -> str: ... + +def register_validator(flag_name: str, + checker: Callable[[Any], bool], + message: str = ..., + flag_values: FlagValues = ...) -> None: ... +RegisterValidator = register_validator +def mark_flag_as_required(flag_name: str, flag_values: FlagValues = ...) -> None: ... +MarkFlagAsRequired = mark_flag_as_required + +def DEFINE(parser: ArgumentParser, name: str, default: Any, help: str, + flag_values: FlagValues = ..., serializer: ArgumentSerializer = ..., **args: Any) -> None: ... +def DEFINE_flag(flag: Flag, flag_values: FlagValues = ...) -> None: ... +def declare_key_flag(flag_name: str, flag_values: FlagValues = ...) -> None: ... +DECLARE_key_flag = declare_key_flag +def adopt_module_key_flags(module: ModuleType, flag_values: FlagValues = ...) -> None: ... +ADOPT_module_key_flags = adopt_module_key_flags +def DEFINE_string(name: str, default: Optional[str], help: str, flag_values: FlagValues = ..., **args: Any): ... + +class BooleanParser(ArgumentParser): + def Convert(self, argument: Any) -> bool: ... + def Parse(self, argument: Any) -> bool: ... + +class BooleanFlag(Flag): + def __init__(self, name: str, default: Optional[bool], help: str, short_name=..., **args: Any) -> None: ... + +def DEFINE_boolean(name: str, default: Optional[bool], help: str, flag_values: FlagValues = ..., **args: Any) -> None: ... + +DEFINE_bool = DEFINE_boolean + +class HelpFlag(BooleanFlag): + def __init__(self) -> None: ... + def Parse(self, arg: Any) -> None: ... + +class HelpXMLFlag(BooleanFlag): + def __init__(self) -> None: ... + def Parse(self, arg: Any) -> None: ... + +class HelpshortFlag(BooleanFlag): + def __init__(self) -> None: ... + def Parse(self, arg: Any) -> None: ... + +class NumericParser(ArgumentParser): + def IsOutsideBounds(self, val: float) -> bool: ... + def Parse(self, argument: Any) -> float: ... + def WriteCustomInfoInXMLFormat(self, outfile: IO[str], indent: str) -> None: ... + def Convert(self, argument: Any) -> Any: ... + +class FloatParser(NumericParser): + number_article: str + number_name: str + syntactic_help: str + def __init__(self, lower_bound: float = ..., upper_bound: float = ...) -> None: ... + def Convert(self, argument: Any) -> float: ... + +def DEFINE_float(name: str, default: Optional[float], help: str, lower_bound: float = ..., + upper_bound: float = ..., flag_values: FlagValues = ..., **args: Any) -> None: ... + +class IntegerParser(NumericParser): + number_article: str + number_name: str + syntactic_help: str + def __init__(self, lower_bound: int = ..., upper_bound: int = ...) -> None: ... + def Convert(self, argument: Any) -> int: ... + +def DEFINE_integer(name: str, default: Optional[int], help: str, lower_bound: int = ..., + upper_bound: int = ..., flag_values: FlagValues = ..., **args: Any) -> None: ... + +class EnumParser(ArgumentParser): + def __init__(self, enum_values: List[str]) -> None: ... + def Parse(self, argument: Any) -> Any: ... + +class EnumFlag(Flag): + def __init__(self, name: str, default: Optional[str], help: str, enum_values: List[str], + short_name: str, **args: Any) -> None: ... + +def DEFINE_enum(name: str, default: Optional[str], enum_values: List[str], help: str, + flag_values: FlagValues = ..., **args: Any) -> None: ... + +class BaseListParser(ArgumentParser): + def __init__(self, token: str = ..., name: str = ...) -> None: ... + def Parse(self, argument: Any) -> List[Any]: ... + +class ListParser(BaseListParser): + def __init__(self) -> None: ... + def WriteCustomInfoInXMLFormat(self, outfile: IO[str], indent: str): ... + +class WhitespaceSeparatedListParser(BaseListParser): + def __init__(self) -> None: ... + def WriteCustomInfoInXMLFormat(self, outfile: IO[str], indent: str): ... + +def DEFINE_list(name: str, default: Optional[List[str]], help: str, flag_values: FlagValues = ..., **args: Any) -> None: ... +def DEFINE_spaceseplist(name: str, default: Optional[List[str]], help: str, flag_values: FlagValues = ..., + **args: Any) -> None: ... + +class MultiFlag(Flag): + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def Parse(self, arguments: Any) -> None: ... + def Serialize(self) -> str: ... + +def DEFINE_multi_string(name: str, default: Optional[Union[str, List[str]]], help: str, + flag_values: FlagValues = ..., **args: Any) -> None: ... +DEFINE_multistring = DEFINE_multi_string + +def DEFINE_multi_integer(name: str, default: Optional[Union[int, List[int]]], help: str, lower_bound: int = ..., + upper_bound: int = ..., flag_values: FlagValues = ..., **args: Any) -> None: ... +DEFINE_multi_int = DEFINE_multi_integer + +def DEFINE_multi_float(name: str, default: Optional[Union[float, List[float]]], help: str, + lower_bound: float = ..., upper_bound: float = ..., + flag_values: FlagValues = ..., **args: Any) -> None: ... + +def DEFINE_multi_enum(name: str, default: Optional[Union[Sequence[str], str]], + enum_values: Sequence[str], help: str, + flag_values: FlagValues = ..., case_sensitive: bool = ..., **args: Any): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/ipaddress.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/ipaddress.pyi new file mode 100644 index 00000000..6b6a45d1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/ipaddress.pyi @@ -0,0 +1,149 @@ +from typing import (Any, Container, Generic, Iterable, Iterator, Optional, + overload, SupportsInt, Text, Tuple, TypeVar) + +# Undocumented length constants +IPV4LENGTH: int +IPV6LENGTH: int + +_A = TypeVar("_A", IPv4Address, IPv6Address) +_N = TypeVar("_N", IPv4Network, IPv6Network) +_T = TypeVar("_T") + +def ip_address(address: object) -> Any: ... # morally Union[IPv4Address, IPv6Address] +def ip_network(address: object, strict: bool = ...) -> Any: ... # morally Union[IPv4Network, IPv6Network] +def ip_interface(address: object) -> Any: ... # morally Union[IPv4Interface, IPv6Interface] + +class _IPAddressBase: + def __eq__(self, other: Any) -> bool: ... + def __ge__(self: _T, other: _T) -> bool: ... + def __gt__(self: _T, other: _T) -> bool: ... + def __le__(self: _T, other: _T) -> bool: ... + def __lt__(self: _T, other: _T) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + @property + def compressed(self) -> Text: ... + @property + def exploded(self) -> Text: ... + @property + def reverse_pointer(self) -> Text: ... + @property + def version(self) -> int: ... + +class _BaseAddress(_IPAddressBase, SupportsInt): + def __init__(self, address: object) -> None: ... + def __add__(self: _T, other: int) -> _T: ... + def __hash__(self) -> int: ... + def __int__(self) -> int: ... + def __sub__(self: _T, other: int) -> _T: ... + @property + def is_global(self) -> bool: ... + @property + def is_link_local(self) -> bool: ... + @property + def is_loopback(self) -> bool: ... + @property + def is_multicast(self) -> bool: ... + @property + def is_private(self) -> bool: ... + @property + def is_reserved(self) -> bool: ... + @property + def is_unspecified(self) -> bool: ... + @property + def max_prefixlen(self) -> int: ... + @property + def packed(self) -> bytes: ... + +class _BaseNetwork(_IPAddressBase, Container[_A], Iterable[_A], Generic[_A]): + network_address: _A + netmask: _A + def __init__(self, address: object, strict: bool = ...) -> None: ... + def __contains__(self, other: Any) -> bool: ... + def __getitem__(self, n: int) -> _A: ... + def __iter__(self) -> Iterator[_A]: ... + def address_exclude(self: _T, other: _T) -> Iterator[_T]: ... + @property + def broadcast_address(self) -> _A: ... + def compare_networks(self: _T, other: _T) -> int: ... + def hosts(self) -> Iterator[_A]: ... + @property + def is_global(self) -> bool: ... + @property + def is_link_local(self) -> bool: ... + @property + def is_loopback(self) -> bool: ... + @property + def is_multicast(self) -> bool: ... + @property + def is_private(self) -> bool: ... + @property + def is_reserved(self) -> bool: ... + @property + def is_unspecified(self) -> bool: ... + @property + def max_prefixlen(self) -> int: ... + @property + def num_addresses(self) -> int: ... + def overlaps(self: _T, other: _T) -> bool: ... + @property + def prefixlen(self) -> int: ... + def subnets(self: _T, prefixlen_diff: int = ..., new_prefix: Optional[int] = ...) -> Iterator[_T]: ... + def supernet(self: _T, prefixlen_diff: int = ..., new_prefix: Optional[int] = ...) -> _T: ... + @property + def with_hostmask(self) -> Text: ... + @property + def with_netmask(self) -> Text: ... + @property + def with_prefixlen(self) -> Text: ... + @property + def hostmask(self) -> _A: ... + +class _BaseInterface(_BaseAddress, Generic[_A, _N]): + hostmask: _A + netmask: _A + network: _N + @property + def ip(self) -> _A: ... + @property + def with_hostmask(self) -> Text: ... + @property + def with_netmask(self) -> Text: ... + @property + def with_prefixlen(self) -> Text: ... + +class IPv4Address(_BaseAddress): ... +class IPv4Network(_BaseNetwork[IPv4Address]): ... +class IPv4Interface(IPv4Address, _BaseInterface[IPv4Address, IPv4Network]): ... + +class IPv6Address(_BaseAddress): + @property + def ipv4_mapped(self) -> Optional[IPv4Address]: ... + @property + def is_site_local(self) -> bool: ... + @property + def sixtofour(self) -> Optional[IPv4Address]: ... + @property + def teredo(self) -> Optional[Tuple[IPv4Address, IPv4Address]]: ... + +class IPv6Network(_BaseNetwork[IPv6Address]): + @property + def is_site_local(self) -> bool: ... + +class IPv6Interface(IPv6Address, _BaseInterface[IPv6Address, IPv6Network]): ... + +def v4_int_to_packed(address: int) -> bytes: ... +def v6_int_to_packed(address: int) -> bytes: ... +@overload +def summarize_address_range(first: IPv4Address, last: IPv4Address) -> Iterator[IPv4Network]: ... +@overload +def summarize_address_range(first: IPv6Address, last: IPv6Address) -> Iterator[IPv6Network]: ... +def collapse_addresses(addresses: Iterable[_N]) -> Iterator[_N]: ... +@overload +def get_mixed_type_key(obj: _A) -> Tuple[int, _A]: ... +@overload +def get_mixed_type_key(obj: IPv4Network) -> Tuple[int, IPv4Address, IPv4Address]: ... +@overload +def get_mixed_type_key(obj: IPv6Network) -> Tuple[int, IPv6Address, IPv6Address]: ... + +class AddressValueError(ValueError): ... +class NetmaskValueError(ValueError): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/kazoo/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/kazoo/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/kazoo/client.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/kazoo/client.pyi new file mode 100644 index 00000000..0d3fc008 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/kazoo/client.pyi @@ -0,0 +1,97 @@ +from typing import Any + +string_types: Any +bytes_types: Any +LOST_STATES: Any +ENVI_VERSION: Any +ENVI_VERSION_KEY: Any +log: Any + +class KazooClient: + logger: Any + handler: Any + auth_data: Any + default_acl: Any + randomize_hosts: Any + hosts: Any + chroot: Any + state: Any + state_listeners: Any + read_only: Any + retry: Any + Barrier: Any + Counter: Any + DoubleBarrier: Any + ChildrenWatch: Any + DataWatch: Any + Election: Any + NonBlockingLease: Any + MultiNonBlockingLease: Any + Lock: Any + Party: Any + Queue: Any + LockingQueue: Any + SetPartitioner: Any + Semaphore: Any + ShallowParty: Any + def __init__(self, hosts=..., timeout=..., client_id=..., handler=..., default_acl=..., auth_data=..., read_only=..., + randomize_hosts=..., connection_retry=..., command_retry=..., logger=..., **kwargs) -> None: ... + @property + def client_state(self): ... + @property + def client_id(self): ... + @property + def connected(self): ... + def set_hosts(self, hosts, randomize_hosts=...): ... + def add_listener(self, listener): ... + def remove_listener(self, listener): ... + def start(self, timeout=...): ... + def start_async(self): ... + def stop(self): ... + def restart(self): ... + def close(self): ... + def command(self, cmd=...): ... + def server_version(self, retries=...): ... + def add_auth(self, scheme, credential): ... + def add_auth_async(self, scheme, credential): ... + def unchroot(self, path): ... + def sync_async(self, path): ... + def sync(self, path): ... + def create(self, path, value=..., acl=..., ephemeral=..., sequence=..., makepath=...): ... + def create_async(self, path, value=..., acl=..., ephemeral=..., sequence=..., makepath=...): ... + def ensure_path(self, path, acl=...): ... + def ensure_path_async(self, path, acl=...): ... + def exists(self, path, watch=...): ... + def exists_async(self, path, watch=...): ... + def get(self, path, watch=...): ... + def get_async(self, path, watch=...): ... + def get_children(self, path, watch=..., include_data=...): ... + def get_children_async(self, path, watch=..., include_data=...): ... + def get_acls(self, path): ... + def get_acls_async(self, path): ... + def set_acls(self, path, acls, version=...): ... + def set_acls_async(self, path, acls, version=...): ... + def set(self, path, value, version=...): ... + def set_async(self, path, value, version=...): ... + def transaction(self): ... + def delete(self, path, version=..., recursive=...): ... + def delete_async(self, path, version=...): ... + def reconfig(self, joining, leaving, new_members, from_config=...): ... + def reconfig_async(self, joining, leaving, new_members, from_config): ... + +class TransactionRequest: + client: Any + operations: Any + committed: Any + def __init__(self, client) -> None: ... + def create(self, path, value=..., acl=..., ephemeral=..., sequence=...): ... + def delete(self, path, version=...): ... + def set_data(self, path, value, version=...): ... + def check(self, path, version): ... + def commit_async(self): ... + def commit(self): ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, exc_tb): ... + +class KazooState: + ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/kazoo/exceptions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/kazoo/exceptions.pyi new file mode 100644 index 00000000..4dd76cca --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/kazoo/exceptions.pyi @@ -0,0 +1,58 @@ +from typing import Any + +class KazooException(Exception): ... +class ZookeeperError(KazooException): ... +class CancelledError(KazooException): ... +class ConfigurationError(KazooException): ... +class ZookeeperStoppedError(KazooException): ... +class ConnectionDropped(KazooException): ... +class LockTimeout(KazooException): ... +class WriterNotClosedException(KazooException): ... + +EXCEPTIONS: Any + +class RolledBackError(ZookeeperError): ... +class SystemZookeeperError(ZookeeperError): ... +class RuntimeInconsistency(ZookeeperError): ... +class DataInconsistency(ZookeeperError): ... +class ConnectionLoss(ZookeeperError): ... +class MarshallingError(ZookeeperError): ... +class UnimplementedError(ZookeeperError): ... +class OperationTimeoutError(ZookeeperError): ... +class BadArgumentsError(ZookeeperError): ... +class NewConfigNoQuorumError(ZookeeperError): ... +class ReconfigInProcessError(ZookeeperError): ... +class APIError(ZookeeperError): ... +class NoNodeError(ZookeeperError): ... +class NoAuthError(ZookeeperError): ... +class BadVersionError(ZookeeperError): ... +class NoChildrenForEphemeralsError(ZookeeperError): ... +class NodeExistsError(ZookeeperError): ... +class NotEmptyError(ZookeeperError): ... +class SessionExpiredError(ZookeeperError): ... +class InvalidCallbackError(ZookeeperError): ... +class InvalidACLError(ZookeeperError): ... +class AuthFailedError(ZookeeperError): ... +class SessionMovedError(ZookeeperError): ... +class NotReadOnlyCallError(ZookeeperError): ... +class ConnectionClosedError(SessionExpiredError): ... + +ConnectionLossException: Any +MarshallingErrorException: Any +SystemErrorException: Any +RuntimeInconsistencyException: Any +DataInconsistencyException: Any +UnimplementedException: Any +OperationTimeoutException: Any +BadArgumentsException: Any +ApiErrorException: Any +NoNodeException: Any +NoAuthException: Any +BadVersionException: Any +NoChildrenForEphemeralsException: Any +NodeExistsException: Any +InvalidACLException: Any +AuthFailedException: Any +NotEmptyException: Any +SessionExpiredException: Any +InvalidCallbackException: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/kazoo/recipe/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/kazoo/recipe/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/kazoo/recipe/watchers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/kazoo/recipe/watchers.pyi new file mode 100644 index 00000000..111a48c6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/kazoo/recipe/watchers.pyi @@ -0,0 +1,21 @@ +from typing import Any + +log: Any + +class DataWatch: + def __init__(self, client, path, func=..., *args, **kwargs) -> None: ... + def __call__(self, func): ... + +class ChildrenWatch: + def __init__(self, client, path, func=..., allow_session_lost=..., send_event=...) -> None: ... + def __call__(self, func): ... + +class PatientChildrenWatch: + client: Any + path: Any + children: Any + time_boundary: Any + children_changed: Any + def __init__(self, client, path, time_boundary=...) -> None: ... + asy: Any + def start(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/pathlib2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/pathlib2.pyi new file mode 100644 index 00000000..fb925e60 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/pathlib2.pyi @@ -0,0 +1,135 @@ +from typing import Any, Generator, IO, Optional, Sequence, Tuple, Type, TypeVar, Union, List +from types import TracebackType +import os +import sys + +_P = TypeVar('_P', bound=PurePath) + +if sys.version_info >= (3, 6): + _PurePathBase = os.PathLike[str] +else: + _PurePathBase = object + +class PurePath(_PurePathBase): + parts: Tuple[str, ...] + drive: str + root: str + anchor: str + name: str + suffix: str + suffixes: List[str] + stem: str + if sys.version_info < (3, 5): + def __init__(self, *pathsegments: str) -> None: ... + elif sys.version_info < (3, 6): + def __new__(cls: Type[_P], *args: Union[str, PurePath]) -> _P: ... + else: + def __new__(cls: Type[_P], *args: Union[str, os.PathLike[str]]) -> _P: ... + def __hash__(self) -> int: ... + def __lt__(self, other: PurePath) -> bool: ... + def __le__(self, other: PurePath) -> bool: ... + def __gt__(self, other: PurePath) -> bool: ... + def __ge__(self, other: PurePath) -> bool: ... + if sys.version_info < (3, 6): + def __truediv__(self: _P, key: Union[str, PurePath]) -> _P: ... + def __rtruediv__(self: _P, key: Union[str, PurePath]) -> _P: ... + else: + def __truediv__(self: _P, key: Union[str, os.PathLike[str]]) -> _P: ... + def __rtruediv__(self: _P, key: Union[str, os.PathLike[str]]) -> _P: ... + if sys.version_info < (3,): + def __div__(self: _P, key: Union[str, PurePath]) -> _P: ... + def __bytes__(self) -> bytes: ... + def as_posix(self) -> str: ... + def as_uri(self) -> str: ... + def is_absolute(self) -> bool: ... + def is_reserved(self) -> bool: ... + def match(self, path_pattern: str) -> bool: ... + if sys.version_info < (3, 6): + def relative_to(self: _P, *other: Union[str, PurePath]) -> _P: ... + else: + def relative_to(self: _P, *other: Union[str, os.PathLike[str]]) -> _P: ... + def with_name(self: _P, name: str) -> _P: ... + def with_suffix(self: _P, suffix: str) -> _P: ... + if sys.version_info < (3, 6): + def joinpath(self: _P, *other: Union[str, PurePath]) -> _P: ... + else: + def joinpath(self: _P, *other: Union[str, os.PathLike[str]]) -> _P: ... + + @property + def parents(self: _P) -> Sequence[_P]: ... + @property + def parent(self: _P) -> _P: ... + +class PurePosixPath(PurePath): ... +class PureWindowsPath(PurePath): ... + +class Path(PurePath): + def __enter__(self) -> Path: ... + def __exit__(self, exc_type: Optional[Type[BaseException]], + exc_value: Optional[BaseException], + traceback: Optional[TracebackType]) -> Optional[bool]: ... + @classmethod + def cwd(cls: Type[_P]) -> _P: ... + def stat(self) -> os.stat_result: ... + def chmod(self, mode: int) -> None: ... + def exists(self) -> bool: ... + def glob(self, pattern: str) -> Generator[Path, None, None]: ... + def group(self) -> str: ... + def is_dir(self) -> bool: ... + def is_file(self) -> bool: ... + def is_symlink(self) -> bool: ... + def is_socket(self) -> bool: ... + def is_fifo(self) -> bool: ... + def is_block_device(self) -> bool: ... + def is_char_device(self) -> bool: ... + def iterdir(self) -> Generator[Path, None, None]: ... + def lchmod(self, mode: int) -> None: ... + def lstat(self) -> os.stat_result: ... + if sys.version_info < (3, 5): + def mkdir(self, mode: int = ..., + parents: bool = ...) -> None: ... + else: + def mkdir(self, mode: int = ..., parents: bool = ..., + exist_ok: bool = ...) -> None: ... + def open(self, mode: str = ..., buffering: int = ..., + encoding: Optional[str] = ..., errors: Optional[str] = ..., + newline: Optional[str] = ...) -> IO[Any]: ... + def owner(self) -> str: ... + def rename(self, target: Union[str, PurePath]) -> None: ... + def replace(self, target: Union[str, PurePath]) -> None: ... + if sys.version_info < (3, 6): + def resolve(self: _P) -> _P: ... + else: + def resolve(self: _P, strict: bool = ...) -> _P: ... + def rglob(self, pattern: str) -> Generator[Path, None, None]: ... + def rmdir(self) -> None: ... + def symlink_to(self, target: Union[str, Path], + target_is_directory: bool = ...) -> None: ... + def touch(self, mode: int = ..., exist_ok: bool = ...) -> None: ... + def unlink(self) -> None: ... + + if sys.version_info >= (3, 5): + @classmethod + def home(cls: Type[_P]) -> _P: ... + if sys.version_info < (3, 6): + def __new__(cls: Type[_P], *args: Union[str, PurePath], + **kwargs: Any) -> _P: ... + else: + def __new__(cls: Type[_P], *args: Union[str, os.PathLike[str]], + **kwargs: Any) -> _P: ... + + def absolute(self: _P) -> _P: ... + def expanduser(self: _P) -> _P: ... + def read_bytes(self) -> bytes: ... + def read_text(self, encoding: Optional[str] = ..., + errors: Optional[str] = ...) -> str: ... + def samefile(self, other_path: Union[str, bytes, int, Path]) -> bool: ... + def write_bytes(self, data: bytes) -> int: ... + def write_text(self, data: str, encoding: Optional[str] = ..., + errors: Optional[str] = ...) -> int: ... + if sys.version_info >= (3, 8): + def link_to(self, target: Union[str, bytes, os.PathLike[str]]) -> None: ... + + +class PosixPath(Path, PurePosixPath): ... +class WindowsPath(Path, PureWindowsPath): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/pymssql.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/pymssql.pyi new file mode 100644 index 00000000..8e08ee35 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/pymssql.pyi @@ -0,0 +1,48 @@ +from datetime import datetime, date, time + +from typing import Any, Dict, Tuple, Iterable, List, Optional, Union, Sequence + +Scalar = Union[int, float, str, datetime, date, time] +Result = Union[Tuple[Scalar, ...], Dict[str, Scalar]] + +class Connection(object): + def __init__(self, user, password, host, database, timeout, + login_timeout, charset, as_dict) -> None: ... + def autocommit(self, status: bool) -> None: ... + def close(self) -> None: ... + def commit(self) -> None: ... + def cursor(self) -> Cursor: ... + def rollback(self) -> None: ... + +class Cursor(object): + def __init__(self) -> None: ... + def __iter__(self): ... + def __next__(self) -> Any: ... + def callproc(self, procname: str, **kwargs) -> None: ... + def close(self) -> None: ... + def execute(self, stmt: str, + params: Optional[Union[Scalar, Tuple[Scalar, ...], + Dict[str, Scalar]]]) -> None: ... + def executemany(self, stmt: str, + params: Optional[Sequence[Tuple[Scalar, ...]]]) -> None: ... + def fetchall(self) -> List[Result]: ... + def fetchmany(self, size: Optional[int]) -> List[Result]: ... + def fetchone(self) -> Result: ... + +def connect(server: Optional[str], + user: Optional[str], + password: Optional[str], + database: Optional[str], + timeout: Optional[int], + login_timeout: Optional[int], + charset: Optional[str], + as_dict: Optional[bool], + host: Optional[str], + appname: Optional[str], + port: Optional[str], + + conn_properties: Optional[Union[str, Sequence[str]]], + autocommit: Optional[bool], + tds_version: Optional[str]) -> Connection: ... +def get_max_connections() -> int: ... +def set_max_connections(n: int) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/routes/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/routes/__init__.pyi new file mode 100644 index 00000000..8a1261f5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/routes/__init__.pyi @@ -0,0 +1,15 @@ +from . import mapper +from . import util + +class _RequestConfig: + def __getattr__(self, name): ... + def __setattr__(self, name, value): ... + def __delattr__(self, name): ... + def load_wsgi_environ(self, environ): ... + +def request_config(original=...): ... + +Mapper = mapper.Mapper +redirect_to = util.redirect_to +url_for = util.url_for +URLGenerator = util.URLGenerator diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/routes/mapper.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/routes/mapper.pyi new file mode 100644 index 00000000..f834d084 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/routes/mapper.pyi @@ -0,0 +1,67 @@ +from typing import Any + +COLLECTION_ACTIONS: Any +MEMBER_ACTIONS: Any + +def strip_slashes(name): ... + +class SubMapperParent: + def submapper(self, **kargs): ... + def collection(self, collection_name, resource_name, path_prefix=..., member_prefix=..., controller=..., + collection_actions=..., member_actions=..., member_options=..., **kwargs): ... + +class SubMapper(SubMapperParent): + kwargs: Any + obj: Any + collection_name: Any + member: Any + resource_name: Any + formatted: Any + def __init__(self, obj, resource_name=..., collection_name=..., actions=..., formatted=..., **kwargs) -> None: ... + def connect(self, *args, **kwargs): ... + def link(self, rel=..., name=..., action=..., method=..., formatted=..., **kwargs): ... + def new(self, **kwargs): ... + def edit(self, **kwargs): ... + def action(self, name=..., action=..., method=..., formatted=..., **kwargs): ... + def index(self, name=..., **kwargs): ... + def show(self, name=..., **kwargs): ... + def create(self, **kwargs): ... + def update(self, **kwargs): ... + def delete(self, **kwargs): ... + def add_actions(self, actions): ... + def __enter__(self): ... + def __exit__(self, type, value, tb): ... + +class Mapper(SubMapperParent): + matchlist: Any + maxkeys: Any + minkeys: Any + urlcache: Any + prefix: Any + req_data: Any + directory: Any + always_scan: Any + controller_scan: Any + debug: Any + append_slash: Any + sub_domains: Any + sub_domains_ignore: Any + domain_match: Any + explicit: Any + encoding: Any + decode_errors: Any + hardcode_names: Any + minimization: Any + create_regs_lock: Any + def __init__(self, controller_scan=..., directory=..., always_scan=..., register=..., explicit=...) -> None: ... + environ: Any + def extend(self, routes, path_prefix=...): ... + def make_route(self, *args, **kargs): ... + def connect(self, *args, **kargs): ... + def create_regs(self, *args, **kwargs): ... + def match(self, url=..., environ=...): ... + def routematch(self, url=..., environ=...): ... + obj: Any + def generate(self, *args, **kargs): ... + def resource(self, member_name, collection_name, **kwargs): ... + def redirect(self, match_path, destination_path, *args, **kwargs): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/routes/util.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/routes/util.pyi new file mode 100644 index 00000000..e3be1d4b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/routes/util.pyi @@ -0,0 +1,20 @@ +from typing import Any + +class RoutesException(Exception): ... +class MatchException(RoutesException): ... +class GenerationException(RoutesException): ... + +def url_for(*args, **kargs): ... + +class URLGenerator: + mapper: Any + environ: Any + def __init__(self, mapper, environ) -> None: ... + def __call__(self, *args, **kargs): ... + def current(self, *args, **kwargs): ... + +def redirect_to(*args, **kargs): ... +def cache_hostinfo(environ): ... +def controller_scan(directory=...): ... +def as_unicode(value, encoding, errors=...): ... +def ascii_characters(string): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/scribe/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/scribe/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/scribe/scribe.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/scribe/scribe.pyi new file mode 100644 index 00000000..3530bf80 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/scribe/scribe.pyi @@ -0,0 +1,39 @@ +from typing import Any + +import fb303.FacebookService +from .ttypes import * # noqa: F403 +from thrift.Thrift import TProcessor # type: ignore # We don't have thrift stubs in typeshed + +class Iface(fb303.FacebookService.Iface): + def Log(self, messages): ... + +class Client(fb303.FacebookService.Client, Iface): + def __init__(self, iprot, oprot=...) -> None: ... + def Log(self, messages): ... + def send_Log(self, messages): ... + def recv_Log(self): ... + +class Processor(fb303.FacebookService.Processor, Iface, TProcessor): + def __init__(self, handler) -> None: ... + def process(self, iprot, oprot): ... + def process_Log(self, seqid, iprot, oprot): ... + +class Log_args: + thrift_spec: Any + messages: Any + def __init__(self, messages=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class Log_result: + thrift_spec: Any + success: Any + def __init__(self, success=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/scribe/ttypes.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/scribe/ttypes.pyi new file mode 100644 index 00000000..5bb7ded6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/scribe/ttypes.pyi @@ -0,0 +1,18 @@ +from typing import Any + +fastbinary: Any + +class ResultCode: + OK: Any + TRY_LATER: Any + +class LogEntry: + thrift_spec: Any + category: Any + message: Any + def __init__(self, category=..., message=...) -> None: ... + def read(self, iprot): ... + def write(self, oprot): ... + def validate(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/__init__.pyi new file mode 100644 index 00000000..3bed0500 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/__init__.pyi @@ -0,0 +1,96 @@ +# Stubs for six (Python 2.7) + +from __future__ import print_function + +import types +from typing import ( + Any, AnyStr, Callable, Dict, Iterable, Mapping, NoReturn, Optional, + Pattern, Text, Tuple, Type, TypeVar, Union, overload, ValuesView, KeysView, ItemsView, +) +import typing +import unittest + +# Exports +from __builtin__ import unichr as unichr +from StringIO import StringIO as StringIO, StringIO as BytesIO +from functools import wraps as wraps +from . import moves + + +_T = TypeVar('_T') +_K = TypeVar('_K') +_V = TypeVar('_V') + +# TODO make constant, then move this stub to 2and3 +# https://github.com/python/typeshed/issues/17 +PY2 = True +PY3 = False +PY34 = False + +string_types = (str, unicode) +integer_types = (int, long) +class_types = (type, types.ClassType) +text_type = unicode +binary_type = str + +MAXSIZE: int + +# def add_move +# def remove_move + +def advance_iterator(it: typing.Iterator[_T]) -> _T: ... +next = advance_iterator + +def callable(obj: object) -> bool: ... + +def get_unbound_function(unbound: types.MethodType) -> types.FunctionType: ... +def create_bound_method(func: types.FunctionType, obj: object) -> types.MethodType: ... +def create_unbound_method(func: types.FunctionType, cls: Union[type, types.ClassType]) -> types.MethodType: ... + +class Iterator: + def next(self) -> Any: ... + +def get_method_function(meth: types.MethodType) -> types.FunctionType: ... +def get_method_self(meth: types.MethodType) -> Optional[object]: ... +def get_function_closure(fun: types.FunctionType) -> Optional[Tuple[types._Cell, ...]]: ... +def get_function_code(fun: types.FunctionType) -> types.CodeType: ... +def get_function_defaults(fun: types.FunctionType) -> Optional[Tuple[Any, ...]]: ... +def get_function_globals(fun: types.FunctionType) -> Dict[str, Any]: ... + +def iterkeys(d: Mapping[_K, _V]) -> typing.Iterator[_K]: ... +def itervalues(d: Mapping[_K, _V]) -> typing.Iterator[_V]: ... +def iteritems(d: Mapping[_K, _V]) -> typing.Iterator[Tuple[_K, _V]]: ... +# def iterlists + +def viewkeys(d: Mapping[_K, _V]) -> KeysView[_K]: ... +def viewvalues(d: Mapping[_K, _V]) -> ValuesView[_V]: ... +def viewitems(d: Mapping[_K, _V]) -> ItemsView[_K, _V]: ... + +def b(s: str) -> binary_type: ... +def u(s: str) -> text_type: ... +int2byte = chr +def byte2int(bs: binary_type) -> int: ... +def indexbytes(buf: binary_type, i: int) -> int: ... +def iterbytes(buf: binary_type) -> typing.Iterator[int]: ... + +def assertCountEqual(self: unittest.TestCase, first: Iterable[_T], second: Iterable[_T], msg: str = ...) -> None: ... +@overload +def assertRaisesRegex(self: unittest.TestCase, msg: str = ...) -> Any: ... +@overload +def assertRaisesRegex(self: unittest.TestCase, callable_obj: Callable[..., Any], *args: Any, **kwargs: Any) -> Any: ... +def assertRegex(self: unittest.TestCase, text: AnyStr, expected_regex: Union[AnyStr, Pattern[AnyStr]], + msg: str = ...) -> None: ... + +def reraise(tp: Optional[Type[BaseException]], value: Optional[BaseException], + tb: Optional[types.TracebackType] = ...) -> NoReturn: ... +def exec_(_code_: Union[unicode, types.CodeType], _globs_: Dict[str, Any] = ..., _locs_: Dict[str, Any] = ...): ... +def raise_from(value: Union[BaseException, Type[BaseException]], from_value: Optional[BaseException]) -> NoReturn: ... + +print_ = print + +def with_metaclass(meta: type, *bases: type) -> type: ... +def add_metaclass(metaclass: type) -> Callable[[_T], _T]: ... +def ensure_binary(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> bytes: ... +def ensure_str(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> str: ... +def ensure_text(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> Text: ... +def python_2_unicode_compatible(klass: _T) -> _T: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/BaseHTTPServer.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/BaseHTTPServer.pyi new file mode 100644 index 00000000..16f7a9dc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/BaseHTTPServer.pyi @@ -0,0 +1 @@ +from BaseHTTPServer import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/CGIHTTPServer.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/CGIHTTPServer.pyi new file mode 100644 index 00000000..b39390c6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/CGIHTTPServer.pyi @@ -0,0 +1 @@ +from CGIHTTPServer import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/SimpleHTTPServer.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/SimpleHTTPServer.pyi new file mode 100644 index 00000000..97cfe771 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/SimpleHTTPServer.pyi @@ -0,0 +1 @@ +from SimpleHTTPServer import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/__init__.pyi new file mode 100644 index 00000000..2bc82cbc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/__init__.pyi @@ -0,0 +1,66 @@ +# Stubs for six.moves +# +# Note: Commented out items means they weren't implemented at the time. +# Uncomment them when the modules have been added to the typeshed. +from cStringIO import StringIO as cStringIO +from itertools import ifilter as filter +from itertools import ifilterfalse as filterfalse +from __builtin__ import raw_input as input +from __builtin__ import intern as intern +from itertools import imap as map +from os import getcwdu as getcwd +from os import getcwd as getcwdb +from __builtin__ import xrange as range +from __builtin__ import reload as reload_module +from __builtin__ import reduce as reduce +from pipes import quote as shlex_quote +from StringIO import StringIO as StringIO +from UserDict import UserDict as UserDict +from UserList import UserList as UserList +from UserString import UserString as UserString +from __builtin__ import xrange as xrange +from itertools import izip as zip +from itertools import izip_longest as zip_longest +import __builtin__ as builtins +from . import configparser +# import copy_reg as copyreg +# import gdbm as dbm_gnu +from . import _dummy_thread +from . import http_cookiejar +from . import http_cookies +from . import html_entities +from . import html_parser +from . import http_client +# import email.MIMEMultipart as email_mime_multipart +# import email.MIMENonMultipart as email_mime_nonmultipart +from . import email_mime_text +# import email.MIMEBase as email_mime_base +from . import BaseHTTPServer +from . import CGIHTTPServer +from . import SimpleHTTPServer +from . import cPickle +from . import queue +from . import reprlib +from . import socketserver +from . import _thread +# import Tkinter as tkinter +# import Dialog as tkinter_dialog +# import FileDialog as tkinter_filedialog +# import ScrolledText as tkinter_scrolledtext +# import SimpleDialog as tkinter_simpledialog +# import Tix as tkinter_tix +# import ttk as tkinter_ttk +# import Tkconstants as tkinter_constants +# import Tkdnd as tkinter_dnd +# import tkColorChooser as tkinter_colorchooser +# import tkCommonDialog as tkinter_commondialog +# import tkFileDialog as tkinter_tkfiledialog +# import tkFont as tkinter_font +# import tkMessageBox as tkinter_messagebox +# import tkSimpleDialog as tkinter_tksimpledialog +from . import urllib_parse +from . import urllib_error +from . import urllib +from . import urllib_robotparser +from . import xmlrpc_client +# import SimpleXMLRPCServer as xmlrpc_server diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/_dummy_thread.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/_dummy_thread.pyi new file mode 100644 index 00000000..3efe922c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/_dummy_thread.pyi @@ -0,0 +1 @@ +from dummy_thread import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/_thread.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/_thread.pyi new file mode 100644 index 00000000..b27f4c70 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/_thread.pyi @@ -0,0 +1 @@ +from thread import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/cPickle.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/cPickle.pyi new file mode 100644 index 00000000..ca829a75 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/cPickle.pyi @@ -0,0 +1 @@ +from cPickle import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/configparser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/configparser.pyi new file mode 100644 index 00000000..b2da53af --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/configparser.pyi @@ -0,0 +1 @@ +from ConfigParser import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_base.pyi new file mode 100644 index 00000000..4df155c9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_base.pyi @@ -0,0 +1 @@ +from email.mime.base import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_multipart.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_multipart.pyi new file mode 100644 index 00000000..4f312412 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_multipart.pyi @@ -0,0 +1 @@ +from email.mime.multipart import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_nonmultipart.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_nonmultipart.pyi new file mode 100644 index 00000000..c15c8c04 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_nonmultipart.pyi @@ -0,0 +1 @@ +from email.mime.nonmultipart import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_text.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_text.pyi new file mode 100644 index 00000000..214bf1e2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/email_mime_text.pyi @@ -0,0 +1 @@ +from email.MIMEText import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/html_entities.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/html_entities.pyi new file mode 100644 index 00000000..9e15d010 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/html_entities.pyi @@ -0,0 +1 @@ +from htmlentitydefs import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/html_parser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/html_parser.pyi new file mode 100644 index 00000000..984cee67 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/html_parser.pyi @@ -0,0 +1 @@ +from HTMLParser import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/http_client.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/http_client.pyi new file mode 100644 index 00000000..24ef0b4c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/http_client.pyi @@ -0,0 +1 @@ +from httplib import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/http_cookiejar.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/http_cookiejar.pyi new file mode 100644 index 00000000..1357ad3b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/http_cookiejar.pyi @@ -0,0 +1 @@ +from cookielib import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/http_cookies.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/http_cookies.pyi new file mode 100644 index 00000000..5115c0df --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/http_cookies.pyi @@ -0,0 +1 @@ +from Cookie import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/queue.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/queue.pyi new file mode 100644 index 00000000..7ce3ccb3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/queue.pyi @@ -0,0 +1 @@ +from Queue import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/reprlib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/reprlib.pyi new file mode 100644 index 00000000..40ad1038 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/reprlib.pyi @@ -0,0 +1 @@ +from repr import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/socketserver.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/socketserver.pyi new file mode 100644 index 00000000..c80a6e7b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/socketserver.pyi @@ -0,0 +1 @@ +from SocketServer import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib/__init__.pyi new file mode 100644 index 00000000..d08209c5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib/__init__.pyi @@ -0,0 +1,5 @@ +import six.moves.urllib.error as error +import six.moves.urllib.parse as parse +import six.moves.urllib.request as request +import six.moves.urllib.response as response +import six.moves.urllib.robotparser as robotparser diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib/error.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib/error.pyi new file mode 100644 index 00000000..044327ee --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib/error.pyi @@ -0,0 +1,3 @@ +from urllib2 import URLError as URLError +from urllib2 import HTTPError as HTTPError +from urllib import ContentTooShortError as ContentTooShortError diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib/parse.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib/parse.pyi new file mode 100644 index 00000000..4096c27f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib/parse.pyi @@ -0,0 +1,24 @@ +# Stubs for six.moves.urllib.parse +from urlparse import ParseResult as ParseResult +from urlparse import SplitResult as SplitResult +from urlparse import parse_qs as parse_qs +from urlparse import parse_qsl as parse_qsl +from urlparse import urldefrag as urldefrag +from urlparse import urljoin as urljoin +from urlparse import urlparse as urlparse +from urlparse import urlsplit as urlsplit +from urlparse import urlunparse as urlunparse +from urlparse import urlunsplit as urlunsplit +from urllib import quote as quote +from urllib import quote_plus as quote_plus +from urllib import unquote as unquote +from urllib import unquote_plus as unquote_plus +from urllib import urlencode as urlencode +from urllib import splitquery as splitquery +from urllib import splittag as splittag +from urllib import splituser as splituser +from urlparse import uses_fragment as uses_fragment +from urlparse import uses_netloc as uses_netloc +from urlparse import uses_params as uses_params +from urlparse import uses_query as uses_query +from urlparse import uses_relative as uses_relative diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib/request.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib/request.pyi new file mode 100644 index 00000000..6aadde16 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib/request.pyi @@ -0,0 +1,36 @@ +# Stubs for six.moves.urllib.request +from urllib2 import urlopen as urlopen +from urllib2 import install_opener as install_opener +from urllib2 import build_opener as build_opener +from urllib import pathname2url as pathname2url +from urllib import url2pathname as url2pathname +from urllib import getproxies as getproxies +from urllib2 import Request as Request +from urllib2 import OpenerDirector as OpenerDirector +from urllib2 import HTTPDefaultErrorHandler as HTTPDefaultErrorHandler +from urllib2 import HTTPRedirectHandler as HTTPRedirectHandler +from urllib2 import HTTPCookieProcessor as HTTPCookieProcessor +from urllib2 import ProxyHandler as ProxyHandler +from urllib2 import BaseHandler as BaseHandler +from urllib2 import HTTPPasswordMgr as HTTPPasswordMgr +from urllib2 import HTTPPasswordMgrWithDefaultRealm as HTTPPasswordMgrWithDefaultRealm +from urllib2 import AbstractBasicAuthHandler as AbstractBasicAuthHandler +from urllib2 import HTTPBasicAuthHandler as HTTPBasicAuthHandler +from urllib2 import ProxyBasicAuthHandler as ProxyBasicAuthHandler +from urllib2 import AbstractDigestAuthHandler as AbstractDigestAuthHandler +from urllib2 import HTTPDigestAuthHandler as HTTPDigestAuthHandler +from urllib2 import ProxyDigestAuthHandler as ProxyDigestAuthHandler +from urllib2 import HTTPHandler as HTTPHandler +from urllib2 import HTTPSHandler as HTTPSHandler +from urllib2 import FileHandler as FileHandler +from urllib2 import FTPHandler as FTPHandler +from urllib2 import CacheFTPHandler as CacheFTPHandler +from urllib2 import UnknownHandler as UnknownHandler +from urllib2 import HTTPErrorProcessor as HTTPErrorProcessor +from urllib import urlretrieve as urlretrieve +from urllib import urlcleanup as urlcleanup +from urllib import URLopener as URLopener +from urllib import FancyURLopener as FancyURLopener +from urllib import proxy_bypass as proxy_bypass +from urllib2 import parse_http_list as parse_http_list +from urllib2 import parse_keqv_list as parse_keqv_list diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib/response.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib/response.pyi new file mode 100644 index 00000000..83e117fb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib/response.pyi @@ -0,0 +1,5 @@ +# Stubs for six.moves.urllib.response +from urllib import addbase as addbase +from urllib import addclosehook as addclosehook +from urllib import addinfo as addinfo +from urllib import addinfourl as addinfourl diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib/robotparser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib/robotparser.pyi new file mode 100644 index 00000000..11eef504 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib/robotparser.pyi @@ -0,0 +1 @@ +from robotparser import RobotFileParser as RobotFileParser diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib_error.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib_error.pyi new file mode 100644 index 00000000..b5608125 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib_error.pyi @@ -0,0 +1 @@ +from .urllib.error import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib_parse.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib_parse.pyi new file mode 100644 index 00000000..bdb4d1c0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib_parse.pyi @@ -0,0 +1 @@ +from .urllib.parse import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib_request.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib_request.pyi new file mode 100644 index 00000000..dc03dcec --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib_request.pyi @@ -0,0 +1 @@ +from .urllib.request import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib_response.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib_response.pyi new file mode 100644 index 00000000..bbee5225 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib_response.pyi @@ -0,0 +1 @@ +from .urllib.response import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib_robotparser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib_robotparser.pyi new file mode 100644 index 00000000..ddb63b78 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/urllib_robotparser.pyi @@ -0,0 +1 @@ +from robotparser import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/xmlrpc_client.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/xmlrpc_client.pyi new file mode 100644 index 00000000..1b3bd746 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/six/moves/xmlrpc_client.pyi @@ -0,0 +1 @@ +from xmlrpclib import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/concurrent.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/concurrent.pyi new file mode 100644 index 00000000..91fc326f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/concurrent.pyi @@ -0,0 +1,43 @@ +from typing import Any + +futures: Any + +class ReturnValueIgnoredError(Exception): ... + +class _TracebackLogger: + exc_info: Any + formatted_tb: Any + def __init__(self, exc_info) -> None: ... + def activate(self): ... + def clear(self): ... + def __del__(self): ... + +class Future: + def __init__(self) -> None: ... + def cancel(self): ... + def cancelled(self): ... + def running(self): ... + def done(self): ... + def result(self, timeout=...): ... + def exception(self, timeout=...): ... + def add_done_callback(self, fn): ... + def set_result(self, result): ... + def set_exception(self, exception): ... + def exc_info(self): ... + def set_exc_info(self, exc_info): ... + def __del__(self): ... + +TracebackFuture: Any +FUTURES: Any + +def is_future(x): ... + +class DummyExecutor: + def submit(self, fn, *args, **kwargs): ... + def shutdown(self, wait=...): ... + +dummy_executor: Any + +def run_on_executor(*args, **kwargs): ... +def return_future(f): ... +def chain_future(a, b): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/gen.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/gen.pyi new file mode 100644 index 00000000..eac8278b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/gen.pyi @@ -0,0 +1,110 @@ +from typing import Any, Dict, NamedTuple, Tuple + +singledispatch: Any + +class KeyReuseError(Exception): ... +class UnknownKeyError(Exception): ... +class LeakedCallbackError(Exception): ... +class BadYieldError(Exception): ... +class ReturnValueIgnoredError(Exception): ... +class TimeoutError(Exception): ... + +def engine(func): ... +def coroutine(func, replace_callback=...): ... + +class Return(Exception): + value: Any + def __init__(self, value=...) -> None: ... + +class WaitIterator: + current_index: Any + def __init__(self, *args, **kwargs) -> None: ... + def done(self): ... + def next(self): ... + +class YieldPoint: + def start(self, runner): ... + def is_ready(self): ... + def get_result(self): ... + +class Callback(YieldPoint): + key: Any + def __init__(self, key) -> None: ... + runner: Any + def start(self, runner): ... + def is_ready(self): ... + def get_result(self): ... + +class Wait(YieldPoint): + key: Any + def __init__(self, key) -> None: ... + runner: Any + def start(self, runner): ... + def is_ready(self): ... + def get_result(self): ... + +class WaitAll(YieldPoint): + keys: Any + def __init__(self, keys) -> None: ... + runner: Any + def start(self, runner): ... + def is_ready(self): ... + def get_result(self): ... + +def Task(func, *args, **kwargs): ... + +class YieldFuture(YieldPoint): + future: Any + io_loop: Any + def __init__(self, future, io_loop=...) -> None: ... + runner: Any + key: Any + result_fn: Any + def start(self, runner): ... + def is_ready(self): ... + def get_result(self): ... + +class Multi(YieldPoint): + keys: Any + children: Any + unfinished_children: Any + quiet_exceptions: Any + def __init__(self, children, quiet_exceptions=...) -> None: ... + def start(self, runner): ... + def is_ready(self): ... + def get_result(self): ... + +def multi_future(children, quiet_exceptions=...): ... +def maybe_future(x): ... +def with_timeout(timeout, future, io_loop=..., quiet_exceptions=...): ... +def sleep(duration): ... + +moment: Any + +class Runner: + gen: Any + result_future: Any + future: Any + yield_point: Any + pending_callbacks: Any + results: Any + running: Any + finished: Any + had_exception: Any + io_loop: Any + stack_context_deactivate: Any + def __init__(self, gen, result_future, first_yielded) -> None: ... + def register_callback(self, key): ... + def is_ready(self, key): ... + def set_result(self, key, result): ... + def pop_result(self, key): ... + def run(self): ... + def handle_yield(self, yielded): ... + def result_callback(self, key): ... + def handle_exception(self, typ, value, tb): ... + +class Arguments(NamedTuple): + args: Tuple[str, ...] + kwargs: Dict[str, Any] + +def convert_yielded(yielded): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/httpclient.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/httpclient.pyi new file mode 100644 index 00000000..f1070933 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/httpclient.pyi @@ -0,0 +1,96 @@ +from typing import Any +from tornado.util import Configurable + +class HTTPClient: + def __init__(self, async_client_class=..., **kwargs) -> None: ... + def __del__(self): ... + def close(self): ... + def fetch(self, request, **kwargs): ... + +class AsyncHTTPClient(Configurable): + @classmethod + def configurable_base(cls): ... + @classmethod + def configurable_default(cls): ... + def __new__(cls, io_loop=..., force_instance=..., **kwargs): ... + io_loop: Any + defaults: Any + def initialize(self, io_loop, defaults=...): ... + def close(self): ... + def fetch(self, request, callback=..., raise_error=..., **kwargs): ... + def fetch_impl(self, request, callback): ... + @classmethod + def configure(cls, impl, **kwargs): ... + +class HTTPRequest: + proxy_host: Any + proxy_port: Any + proxy_username: Any + proxy_password: Any + url: Any + method: Any + body_producer: Any + auth_username: Any + auth_password: Any + auth_mode: Any + connect_timeout: Any + request_timeout: Any + follow_redirects: Any + max_redirects: Any + user_agent: Any + decompress_response: Any + network_interface: Any + streaming_callback: Any + header_callback: Any + prepare_curl_callback: Any + allow_nonstandard_methods: Any + validate_cert: Any + ca_certs: Any + allow_ipv6: Any + client_key: Any + client_cert: Any + ssl_options: Any + expect_100_continue: Any + start_time: Any + def __init__(self, url, method=..., headers=..., body=..., auth_username=..., auth_password=..., auth_mode=..., + connect_timeout=..., request_timeout=..., if_modified_since=..., follow_redirects=..., max_redirects=..., + user_agent=..., use_gzip=..., network_interface=..., streaming_callback=..., header_callback=..., + prepare_curl_callback=..., proxy_host=..., proxy_port=..., proxy_username=..., proxy_password=..., + allow_nonstandard_methods=..., validate_cert=..., ca_certs=..., allow_ipv6=..., client_key=..., client_cert=..., + body_producer=..., expect_100_continue=..., decompress_response=..., ssl_options=...) -> None: ... + @property + def headers(self): ... + @headers.setter + def headers(self, value): ... + @property + def body(self): ... + @body.setter + def body(self, value): ... + +class HTTPResponse: + request: Any + code: Any + reason: Any + headers: Any + buffer: Any + effective_url: Any + error: Any + request_time: Any + time_info: Any + def __init__(self, request, code, headers=..., buffer=..., effective_url=..., error=..., request_time=..., time_info=..., + reason=...) -> None: ... + body: Any + def rethrow(self): ... + +class HTTPError(Exception): + code: Any + response: Any + def __init__(self, code, message=..., response=...) -> None: ... + +class _RequestProxy: + request: Any + defaults: Any + def __init__(self, request, defaults) -> None: ... + def __getattr__(self, name): ... + +def main(): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/httpserver.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/httpserver.pyi new file mode 100644 index 00000000..9bcf99a8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/httpserver.pyi @@ -0,0 +1,43 @@ +from typing import Any +from tornado import httputil +from tornado.tcpserver import TCPServer +from tornado.util import Configurable + +class HTTPServer(TCPServer, Configurable, httputil.HTTPServerConnectionDelegate): + def __init__(self, *args, **kwargs) -> None: ... + request_callback: Any + no_keep_alive: Any + xheaders: Any + protocol: Any + conn_params: Any + def initialize(self, request_callback, no_keep_alive=..., io_loop=..., xheaders=..., ssl_options=..., protocol=..., + decompress_request=..., chunk_size=..., max_header_size=..., idle_connection_timeout=..., body_timeout=..., + max_body_size=..., max_buffer_size=...): ... + @classmethod + def configurable_base(cls): ... + @classmethod + def configurable_default(cls): ... + def close_all_connections(self): ... + def handle_stream(self, stream, address): ... + def start_request(self, server_conn, request_conn): ... + def on_close(self, server_conn): ... + +class _HTTPRequestContext: + address: Any + protocol: Any + address_family: Any + remote_ip: Any + def __init__(self, stream, address, protocol) -> None: ... + +class _ServerRequestAdapter(httputil.HTTPMessageDelegate): + server: Any + connection: Any + request: Any + delegate: Any + def __init__(self, server, server_conn, request_conn) -> None: ... + def headers_received(self, start_line, headers): ... + def data_received(self, chunk): ... + def finish(self): ... + def on_connection_close(self): ... + +HTTPRequest: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/httputil.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/httputil.pyi new file mode 100644 index 00000000..85a08ebc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/httputil.pyi @@ -0,0 +1,96 @@ +from typing import Any, Dict, NamedTuple + +from tornado.util import ObjectDict + +class SSLError(Exception): ... + +class _NormalizedHeaderCache(Dict[Any, Any]): + size: Any + queue: Any + def __init__(self, size) -> None: ... + def __missing__(self, key): ... + +class HTTPHeaders(Dict[Any, Any]): + def __init__(self, *args, **kwargs) -> None: ... + def add(self, name, value): ... + def get_list(self, name): ... + def get_all(self): ... + def parse_line(self, line): ... + @classmethod + def parse(cls, headers): ... + def __setitem__(self, name, value): ... + def __getitem__(self, name): ... + def __delitem__(self, name): ... + def __contains__(self, name): ... + def get(self, name, default=...): ... + def update(self, *args, **kwargs): ... + def copy(self): ... + __copy__: Any + def __deepcopy__(self, memo_dict): ... + +class HTTPServerRequest: + method: Any + uri: Any + version: Any + headers: Any + body: Any + remote_ip: Any + protocol: Any + host: Any + files: Any + connection: Any + arguments: Any + query_arguments: Any + body_arguments: Any + def __init__(self, method=..., uri=..., version=..., headers=..., body=..., host=..., files=..., connection=..., + start_line=...) -> None: ... + def supports_http_1_1(self): ... + @property + def cookies(self): ... + def write(self, chunk, callback=...): ... + def finish(self): ... + def full_url(self): ... + def request_time(self): ... + def get_ssl_certificate(self, binary_form=...): ... + +class HTTPInputError(Exception): ... +class HTTPOutputError(Exception): ... + +class HTTPServerConnectionDelegate: + def start_request(self, server_conn, request_conn): ... + def on_close(self, server_conn): ... + +class HTTPMessageDelegate: + def headers_received(self, start_line, headers): ... + def data_received(self, chunk): ... + def finish(self): ... + def on_connection_close(self): ... + +class HTTPConnection: + def write_headers(self, start_line, headers, chunk=..., callback=...): ... + def write(self, chunk, callback=...): ... + def finish(self): ... + +def url_concat(url, args): ... + +class HTTPFile(ObjectDict): ... + +def parse_body_arguments(content_type, body, arguments, files, headers=...): ... +def parse_multipart_form_data(boundary, data, arguments, files): ... +def format_timestamp(ts): ... + +class RequestStartLine(NamedTuple): + method: str + path: str + version: str + +def parse_request_start_line(line): ... + +class ResponseStartLine(NamedTuple): + version: str + code: str + reason: str + +def parse_response_start_line(line): ... +def doctests(): ... +def split_host_and_port(netloc): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/ioloop.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/ioloop.pyi new file mode 100644 index 00000000..92c3548e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/ioloop.pyi @@ -0,0 +1,84 @@ +from typing import Any +from tornado.util import Configurable + +signal: Any + +class TimeoutError(Exception): ... + +class IOLoop(Configurable): + NONE: Any + READ: Any + WRITE: Any + ERROR: Any + @staticmethod + def instance(): ... + @staticmethod + def initialized(): ... + def install(self): ... + @staticmethod + def clear_instance(): ... + @staticmethod + def current(instance=...): ... + def make_current(self): ... + @staticmethod + def clear_current(): ... + @classmethod + def configurable_base(cls): ... + @classmethod + def configurable_default(cls): ... + def initialize(self, make_current=...): ... + def close(self, all_fds=...): ... + def add_handler(self, fd, handler, events): ... + def update_handler(self, fd, events): ... + def remove_handler(self, fd): ... + def set_blocking_signal_threshold(self, seconds, action): ... + def set_blocking_log_threshold(self, seconds): ... + def log_stack(self, signal, frame): ... + def start(self): ... + def stop(self): ... + def run_sync(self, func, timeout=...): ... + def time(self): ... + def add_timeout(self, deadline, callback, *args, **kwargs): ... + def call_later(self, delay, callback, *args, **kwargs): ... + def call_at(self, when, callback, *args, **kwargs): ... + def remove_timeout(self, timeout): ... + def add_callback(self, callback, *args, **kwargs): ... + def add_callback_from_signal(self, callback, *args, **kwargs): ... + def spawn_callback(self, callback, *args, **kwargs): ... + def add_future(self, future, callback): ... + def handle_callback_exception(self, callback): ... + def split_fd(self, fd): ... + def close_fd(self, fd): ... + +class PollIOLoop(IOLoop): + time_func: Any + def initialize(self, impl, time_func=..., **kwargs): ... + def close(self, all_fds=...): ... + def add_handler(self, fd, handler, events): ... + def update_handler(self, fd, events): ... + def remove_handler(self, fd): ... + def set_blocking_signal_threshold(self, seconds, action): ... + def start(self): ... + def stop(self): ... + def time(self): ... + def call_at(self, deadline, callback, *args, **kwargs): ... + def remove_timeout(self, timeout): ... + def add_callback(self, callback, *args, **kwargs): ... + def add_callback_from_signal(self, callback, *args, **kwargs): ... + +class _Timeout: + deadline: Any + callback: Any + tiebreaker: Any + def __init__(self, deadline, callback, io_loop) -> None: ... + def __lt__(self, other): ... + def __le__(self, other): ... + +class PeriodicCallback: + callback: Any + callback_time: Any + io_loop: Any + def __init__(self, callback, callback_time, io_loop=...) -> None: ... + def start(self): ... + def stop(self): ... + def is_running(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/locks.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/locks.pyi new file mode 100644 index 00000000..723e9913 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/locks.pyi @@ -0,0 +1,45 @@ +from typing import Any, Optional + +class _TimeoutGarbageCollector: + def __init__(self): ... + +class Condition(_TimeoutGarbageCollector): + io_loop: Any + def __init__(self): ... + def wait(self, timeout: Optional[Any] = ...): ... + def notify(self, n: int = ...): ... + def notify_all(self): ... + +class Event: + def __init__(self): ... + def is_set(self): ... + def set(self): ... + def clear(self): ... + def wait(self, timeout: Optional[Any] = ...): ... + +class _ReleasingContextManager: + def __init__(self, obj): ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_val, exc_tb): ... + +class Semaphore(_TimeoutGarbageCollector): + def __init__(self, value: int = ...): ... + def release(self): ... + def acquire(self, timeout: Optional[Any] = ...): ... + def __enter__(self): ... + __exit__: Any + def __aenter__(self): ... + def __aexit__(self, typ, value, tb): ... + +class BoundedSemaphore(Semaphore): + def __init__(self, value: int = ...): ... + def release(self): ... + +class Lock: + def __init__(self): ... + def acquire(self, timeout: Optional[Any] = ...): ... + def release(self): ... + def __enter__(self): ... + __exit__: Any + def __aenter__(self): ... + def __aexit__(self, typ, value, tb): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/netutil.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/netutil.pyi new file mode 100644 index 00000000..53c8fc70 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/netutil.pyi @@ -0,0 +1,45 @@ +from typing import Any +from tornado.util import Configurable + +ssl: Any +certifi: Any +xrange: Any +ssl_match_hostname: Any +SSLCertificateError: Any + +def bind_sockets(port, address=..., family=..., backlog=..., flags=...): ... +def bind_unix_socket(file, mode=..., backlog=...): ... +def add_accept_handler(sock, callback, io_loop=...): ... +def is_valid_ip(ip): ... + +class Resolver(Configurable): + @classmethod + def configurable_base(cls): ... + @classmethod + def configurable_default(cls): ... + def resolve(self, host, port, family=..., callback=...): ... + def close(self): ... + +class ExecutorResolver(Resolver): + io_loop: Any + executor: Any + close_executor: Any + def initialize(self, io_loop=..., executor=..., close_executor=...): ... + def close(self): ... + def resolve(self, host, port, family=...): ... + +class BlockingResolver(ExecutorResolver): + def initialize(self, io_loop=...): ... + +class ThreadedResolver(ExecutorResolver): + def initialize(self, io_loop=..., num_threads=...): ... + +class OverrideResolver(Resolver): + resolver: Any + mapping: Any + def initialize(self, resolver, mapping): ... + def close(self): ... + def resolve(self, host, port, *args, **kwargs): ... + +def ssl_options_to_context(ssl_options): ... +def ssl_wrap_socket(socket, ssl_options, server_hostname=..., **kwargs): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/process.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/process.pyi new file mode 100644 index 00000000..c4674549 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/process.pyi @@ -0,0 +1,24 @@ +from typing import Any, Optional + +long = int +CalledProcessError: Any + +def cpu_count() -> int: ... +def fork_processes(num_processes, max_restarts: int = ...) -> Optional[int]: ... +def task_id() -> int: ... + +class Subprocess: + STREAM: Any = ... + io_loop: Any = ... + stdin: Any = ... + stdout: Any = ... + stderr: Any = ... + proc: Any = ... + returncode: Any = ... + def __init__(self, *args, **kwargs) -> None: ... + def set_exit_callback(self, callback): ... + def wait_for_exit(self, raise_error: bool = ...): ... + @classmethod + def initialize(cls, io_loop: Optional[Any] = ...): ... + @classmethod + def uninitialize(cls): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/tcpserver.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/tcpserver.pyi new file mode 100644 index 00000000..28fe6a4e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/tcpserver.pyi @@ -0,0 +1,17 @@ +from typing import Any + +ssl: Any + +class TCPServer: + io_loop: Any + ssl_options: Any + max_buffer_size: Any + read_chunk_size: Any + def __init__(self, io_loop=..., ssl_options=..., max_buffer_size=..., read_chunk_size=...) -> None: ... + def listen(self, port, address=...): ... + def add_sockets(self, sockets): ... + def add_socket(self, socket): ... + def bind(self, port, address=..., family=..., backlog=...): ... + def start(self, num_processes=...): ... + def stop(self): ... + def handle_stream(self, stream, address): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/testing.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/testing.pyi new file mode 100644 index 00000000..c1002581 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/testing.pyi @@ -0,0 +1,63 @@ +from typing import Any, Callable, Generator, Optional, overload +import unittest +import logging + +AsyncHTTPClient: Any +gen: Any +HTTPServer: Any +IOLoop: Any +netutil: Any +SimpleAsyncHTTPClient: Any + +def get_unused_port(): ... +def bind_unused_port(): ... + +class AsyncTestCase(unittest.TestCase): + def __init__(self, *args, **kwargs): ... + io_loop: Any + def setUp(self): ... + def tearDown(self): ... + def get_new_ioloop(self): ... + def run(self, result: Optional[Any] = ...): ... + def stop(self, _arg: Optional[Any] = ..., **kwargs): ... + def wait(self, condition: Optional[Any] = ..., timeout: float = ...): ... + +class AsyncHTTPTestCase(AsyncTestCase): + http_client: Any + http_server: Any + def setUp(self): ... + def get_http_client(self): ... + def get_http_server(self): ... + def get_app(self): ... + def fetch(self, path, **kwargs): ... + def get_httpserver_options(self): ... + def get_http_port(self): ... + def get_protocol(self): ... + def get_url(self, path): ... + def tearDown(self): ... + +class AsyncHTTPSTestCase(AsyncHTTPTestCase): + def get_http_client(self): ... + def get_httpserver_options(self): ... + def get_ssl_options(self): ... + def get_protocol(self): ... + +@overload +def gen_test(*, timeout: Optional[float] = ...) -> Callable[[Callable[..., Generator[Any, Any, Any]]], Callable[..., None]]: ... +@overload +def gen_test(func: Callable[..., Generator[Any, Any, Any]]) -> Callable[..., None]: ... + +class LogTrapTestCase(unittest.TestCase): + def run(self, result: Optional[Any] = ...): ... + +class ExpectLog(logging.Filter): + logger: Any + regex: Any + required: Any + matched: Any + def __init__(self, logger, regex, required: bool = ...): ... + def filter(self, record): ... + def __enter__(self): ... + def __exit__(self, typ, value, tb): ... + +def main(**kwargs): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/util.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/util.pyi new file mode 100644 index 00000000..8ebb0a1b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/util.pyi @@ -0,0 +1,46 @@ +from typing import Any, Dict + +xrange: Any + +class ObjectDict(Dict[Any, Any]): + def __getattr__(self, name): ... + def __setattr__(self, name, value): ... + +class GzipDecompressor: + decompressobj: Any + def __init__(self) -> None: ... + def decompress(self, value, max_length=...): ... + @property + def unconsumed_tail(self): ... + def flush(self): ... + +unicode_type: Any +basestring_type: Any + +def import_object(name): ... + +bytes_type: Any + +def errno_from_exception(e): ... + +class Configurable: + def __new__(cls, *args, **kwargs): ... + @classmethod + def configurable_base(cls): ... + @classmethod + def configurable_default(cls): ... + def initialize(self): ... + @classmethod + def configure(cls, impl, **kwargs): ... + @classmethod + def configured_class(cls): ... + +class ArgReplacer: + name: Any + arg_pos: Any + def __init__(self, func, name) -> None: ... + def get_old_value(self, args, kwargs, default=...): ... + def replace(self, new_value, args, kwargs): ... + +def timedelta_to_seconds(td): ... +def doctests(): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/web.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/web.pyi new file mode 100644 index 00000000..c63f414d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2/tornado/web.pyi @@ -0,0 +1,257 @@ +from typing import Any +from tornado import httputil + +MIN_SUPPORTED_SIGNED_VALUE_VERSION: Any +MAX_SUPPORTED_SIGNED_VALUE_VERSION: Any +DEFAULT_SIGNED_VALUE_VERSION: Any +DEFAULT_SIGNED_VALUE_MIN_VERSION: Any + +class RequestHandler: + SUPPORTED_METHODS: Any + application: Any + request: Any + path_args: Any + path_kwargs: Any + ui: Any + def __init__(self, application, request, **kwargs) -> None: ... + def initialize(self): ... + @property + def settings(self): ... + def head(self, *args, **kwargs): ... + def get(self, *args, **kwargs): ... + def post(self, *args, **kwargs): ... + def delete(self, *args, **kwargs): ... + def patch(self, *args, **kwargs): ... + def put(self, *args, **kwargs): ... + def options(self, *args, **kwargs): ... + def prepare(self): ... + def on_finish(self): ... + def on_connection_close(self): ... + def clear(self): ... + def set_default_headers(self): ... + def set_status(self, status_code, reason=...): ... + def get_status(self): ... + def set_header(self, name, value): ... + def add_header(self, name, value): ... + def clear_header(self, name): ... + def get_argument(self, name, default=..., strip=...): ... + def get_arguments(self, name, strip=...): ... + def get_body_argument(self, name, default=..., strip=...): ... + def get_body_arguments(self, name, strip=...): ... + def get_query_argument(self, name, default=..., strip=...): ... + def get_query_arguments(self, name, strip=...): ... + def decode_argument(self, value, name=...): ... + @property + def cookies(self): ... + def get_cookie(self, name, default=...): ... + def set_cookie(self, name, value, domain=..., expires=..., path=..., expires_days=..., **kwargs): ... + def clear_cookie(self, name, path=..., domain=...): ... + def clear_all_cookies(self, path=..., domain=...): ... + def set_secure_cookie(self, name, value, expires_days=..., version=..., **kwargs): ... + def create_signed_value(self, name, value, version=...): ... + def get_secure_cookie(self, name, value=..., max_age_days=..., min_version=...): ... + def get_secure_cookie_key_version(self, name, value=...): ... + def redirect(self, url, permanent=..., status=...): ... + def write(self, chunk): ... + def render(self, template_name, **kwargs): ... + def render_string(self, template_name, **kwargs): ... + def get_template_namespace(self): ... + def create_template_loader(self, template_path): ... + def flush(self, include_footers=..., callback=...): ... + def finish(self, chunk=...): ... + def send_error(self, status_code=..., **kwargs): ... + def write_error(self, status_code, **kwargs): ... + @property + def locale(self): ... + @locale.setter + def locale(self, value): ... + def get_user_locale(self): ... + def get_browser_locale(self, default=...): ... + @property + def current_user(self): ... + @current_user.setter + def current_user(self, value): ... + def get_current_user(self): ... + def get_login_url(self): ... + def get_template_path(self): ... + @property + def xsrf_token(self): ... + def check_xsrf_cookie(self): ... + def xsrf_form_html(self): ... + def static_url(self, path, include_host=..., **kwargs): ... + def require_setting(self, name, feature=...): ... + def reverse_url(self, name, *args): ... + def compute_etag(self): ... + def set_etag_header(self): ... + def check_etag_header(self): ... + def data_received(self, chunk): ... + def log_exception(self, typ, value, tb): ... + +def asynchronous(method): ... +def stream_request_body(cls): ... +def removeslash(method): ... +def addslash(method): ... + +class Application(httputil.HTTPServerConnectionDelegate): + transforms: Any + handlers: Any + named_handlers: Any + default_host: Any + settings: Any + ui_modules: Any + ui_methods: Any + def __init__(self, handlers=..., default_host=..., transforms=..., **settings) -> None: ... + def listen(self, port, address=..., **kwargs): ... + def add_handlers(self, host_pattern, host_handlers): ... + def add_transform(self, transform_class): ... + def start_request(self, server_conn, request_conn): ... + def __call__(self, request): ... + def reverse_url(self, name, *args): ... + def log_request(self, handler): ... + +class _RequestDispatcher(httputil.HTTPMessageDelegate): + application: Any + connection: Any + request: Any + chunks: Any + handler_class: Any + handler_kwargs: Any + path_args: Any + path_kwargs: Any + def __init__(self, application, connection) -> None: ... + def headers_received(self, start_line, headers): ... + stream_request_body: Any + def set_request(self, request): ... + def data_received(self, data): ... + def finish(self): ... + def on_connection_close(self): ... + handler: Any + def execute(self): ... + +class HTTPError(Exception): + status_code: Any + log_message: Any + args: Any + reason: Any + def __init__(self, status_code, log_message=..., *args, **kwargs) -> None: ... + +class Finish(Exception): ... + +class MissingArgumentError(HTTPError): + arg_name: Any + def __init__(self, arg_name) -> None: ... + +class ErrorHandler(RequestHandler): + def initialize(self, status_code): ... + def prepare(self): ... + def check_xsrf_cookie(self): ... + +class RedirectHandler(RequestHandler): + def initialize(self, url, permanent=...): ... + def get(self): ... + +class StaticFileHandler(RequestHandler): + CACHE_MAX_AGE: Any + root: Any + default_filename: Any + def initialize(self, path, default_filename=...): ... + @classmethod + def reset(cls): ... + def head(self, path): ... + path: Any + absolute_path: Any + modified: Any + def get(self, path, include_body=...): ... + def compute_etag(self): ... + def set_headers(self): ... + def should_return_304(self): ... + @classmethod + def get_absolute_path(cls, root, path): ... + def validate_absolute_path(self, root, absolute_path): ... + @classmethod + def get_content(cls, abspath, start=..., end=...): ... + @classmethod + def get_content_version(cls, abspath): ... + def get_content_size(self): ... + def get_modified_time(self): ... + def get_content_type(self): ... + def set_extra_headers(self, path): ... + def get_cache_time(self, path, modified, mime_type): ... + @classmethod + def make_static_url(cls, settings, path, include_version=...): ... + def parse_url_path(self, url_path): ... + @classmethod + def get_version(cls, settings, path): ... + +class FallbackHandler(RequestHandler): + fallback: Any + def initialize(self, fallback): ... + def prepare(self): ... + +class OutputTransform: + def __init__(self, request) -> None: ... + def transform_first_chunk(self, status_code, headers, chunk, finishing): ... + def transform_chunk(self, chunk, finishing): ... + +class GZipContentEncoding(OutputTransform): + CONTENT_TYPES: Any + MIN_LENGTH: Any + def __init__(self, request) -> None: ... + def transform_first_chunk(self, status_code, headers, chunk, finishing): ... + def transform_chunk(self, chunk, finishing): ... + +def authenticated(method): ... + +class UIModule: + handler: Any + request: Any + ui: Any + locale: Any + def __init__(self, handler) -> None: ... + @property + def current_user(self): ... + def render(self, *args, **kwargs): ... + def embedded_javascript(self): ... + def javascript_files(self): ... + def embedded_css(self): ... + def css_files(self): ... + def html_head(self): ... + def html_body(self): ... + def render_string(self, path, **kwargs): ... + +class _linkify(UIModule): + def render(self, text, **kwargs): ... + +class _xsrf_form_html(UIModule): + def render(self): ... + +class TemplateModule(UIModule): + def __init__(self, handler) -> None: ... + def render(self, path, **kwargs): ... + def embedded_javascript(self): ... + def javascript_files(self): ... + def embedded_css(self): ... + def css_files(self): ... + def html_head(self): ... + def html_body(self): ... + +class _UIModuleNamespace: + handler: Any + ui_modules: Any + def __init__(self, handler, ui_modules) -> None: ... + def __getitem__(self, key): ... + def __getattr__(self, key): ... + +class URLSpec: + regex: Any + handler_class: Any + kwargs: Any + name: Any + def __init__(self, pattern, handler, kwargs=..., name=...) -> None: ... + def reverse(self, *args): ... + +url: Any + +def create_signed_value(secret, name, value, version=..., clock=..., key_version=...): ... +def decode_signed_value(secret, name, value, max_age_days=..., clock=..., min_version=...): ... +def get_signature_key_version(value): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/AES.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/AES.pyi new file mode 100644 index 00000000..144ccfa0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/AES.pyi @@ -0,0 +1,19 @@ +from typing import Any, Union, Text +from .blockalgo import BlockAlgo + +__revision__: str + +class AESCipher(BlockAlgo): + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> AESCipher: ... + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int +block_size: int +key_size: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC2.pyi new file mode 100644 index 00000000..24a12ea1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC2.pyi @@ -0,0 +1,19 @@ +from typing import Any, Union, Text +from .blockalgo import BlockAlgo + +__revision__: str + +class RC2Cipher(BlockAlgo): + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> RC2Cipher: ... + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int +block_size: int +key_size: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC4.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC4.pyi new file mode 100644 index 00000000..109e2bfd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/ARC4.pyi @@ -0,0 +1,15 @@ +from typing import Any, Union, Text + +__revision__: str + +class ARC4Cipher: + block_size: int + key_size: int + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + def encrypt(self, plaintext): ... + def decrypt(self, ciphertext): ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> ARC4Cipher: ... + +block_size: int +key_size: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/Blowfish.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/Blowfish.pyi new file mode 100644 index 00000000..e29ca6b1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/Blowfish.pyi @@ -0,0 +1,19 @@ +from typing import Any, Union, Text +from .blockalgo import BlockAlgo + +__revision__: str + +class BlowfishCipher(BlockAlgo): + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> BlowfishCipher: ... + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int +block_size: int +key_size: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/CAST.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/CAST.pyi new file mode 100644 index 00000000..b2919193 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/CAST.pyi @@ -0,0 +1,19 @@ +from typing import Any, Union, Text +from .blockalgo import BlockAlgo + +__revision__: str + +class CAST128Cipher(BlockAlgo): + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> CAST128Cipher: ... + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int +block_size: int +key_size: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES.pyi new file mode 100644 index 00000000..30a40dd4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES.pyi @@ -0,0 +1,19 @@ +from typing import Any, Union, Text +from .blockalgo import BlockAlgo + +__revision__: str + +class DESCipher(BlockAlgo): + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> DESCipher: ... + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int +block_size: int +key_size: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES3.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES3.pyi new file mode 100644 index 00000000..59ccd8f2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/DES3.pyi @@ -0,0 +1,20 @@ +from typing import Any, Union, Text + +from .blockalgo import BlockAlgo + +__revision__: str + +class DES3Cipher(BlockAlgo): + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + +def new(key: Union[bytes, Text], *args, **kwargs) -> DES3Cipher: ... + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int +block_size: int +key_size: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_OAEP.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_OAEP.pyi new file mode 100644 index 00000000..50980a46 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_OAEP.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional, Union, Text + +from Crypto.PublicKey.RSA import _RSAobj + +class PKCS1OAEP_Cipher: + def __init__(self, key: _RSAobj, hashAlgo: Any, mgfunc: Any, label: Any) -> None: ... + def can_encrypt(self): ... + def can_decrypt(self): ... + def encrypt(self, message: Union[bytes, Text]) -> bytes: ... + def decrypt(self, ct: bytes) -> bytes: ... + + +def new(key: _RSAobj, hashAlgo: Optional[Any] = ..., mgfunc: Optional[Any] = ..., label: Any = ...) -> PKCS1OAEP_Cipher: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_v1_5.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_v1_5.pyi new file mode 100644 index 00000000..c2b9ea1a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/PKCS1_v1_5.pyi @@ -0,0 +1,13 @@ +from typing import Any, Union, Text + +from Crypto.PublicKey.RSA import _RSAobj + +class PKCS115_Cipher: + def __init__(self, key: _RSAobj) -> None: ... + def can_encrypt(self) -> bool: ... + def can_decrypt(self) -> bool: ... + rf: Any + def encrypt(self, message: Union[bytes, Text]) -> bytes: ... + def decrypt(self, ct: bytes, sentinel: Any) -> bytes: ... + +def new(key: _RSAobj) -> PKCS115_Cipher: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/XOR.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/XOR.pyi new file mode 100644 index 00000000..4c952c22 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/XOR.pyi @@ -0,0 +1,16 @@ +from typing import Any, Union, Text + +__revision__: str + +class XORCipher: + block_size: int + key_size: int + def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ... + def encrypt(self, plaintext: Union[bytes, Text]) -> bytes: ... + def decrypt(self, ciphertext: bytes) -> bytes: ... + + +def new(key: Union[bytes, Text], *args, **kwargs) -> XORCipher: ... + +block_size: int +key_size: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/__init__.pyi new file mode 100644 index 00000000..309f2746 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/__init__.pyi @@ -0,0 +1,11 @@ +# Names in __all__ with no definition: +# AES +# ARC2 +# ARC4 +# Blowfish +# CAST +# DES +# DES3 +# PKCS1_OAEP +# PKCS1_v1_5 +# XOR diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/blockalgo.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/blockalgo.pyi new file mode 100644 index 00000000..8286b7a3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Cipher/blockalgo.pyi @@ -0,0 +1,17 @@ +from typing import Any, Union, Text + +MODE_ECB: int +MODE_CBC: int +MODE_CFB: int +MODE_PGP: int +MODE_OFB: int +MODE_CTR: int +MODE_OPENPGP: int + +class BlockAlgo: + mode: int + block_size: int + IV: Any + def __init__(self, factory: Any, key: Union[bytes, Text], *args, **kwargs) -> None: ... + def encrypt(self, plaintext: Union[bytes, Text]) -> bytes: ... + def decrypt(self, ciphertext: bytes) -> bytes: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/HMAC.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/HMAC.pyi new file mode 100644 index 00000000..5e2337d1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/HMAC.pyi @@ -0,0 +1,16 @@ +from typing import Any, Optional + +digest_size: Any + +class HMAC: + digest_size: Any + digestmod: Any + outer: Any + inner: Any + def __init__(self, key, msg: Optional[Any] = ..., digestmod: Optional[Any] = ...) -> None: ... + def update(self, msg): ... + def copy(self): ... + def digest(self): ... + def hexdigest(self): ... + +def new(key, msg: Optional[Any] = ..., digestmod: Optional[Any] = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD2.pyi new file mode 100644 index 00000000..1575b114 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD2.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class MD2Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD4.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD4.pyi new file mode 100644 index 00000000..644b3bdb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD4.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class MD4Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD5.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD5.pyi new file mode 100644 index 00000000..52261ab3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/MD5.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class MD5Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/RIPEMD.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/RIPEMD.pyi new file mode 100644 index 00000000..3fe4ac53 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/RIPEMD.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class RIPEMD160Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA.pyi new file mode 100644 index 00000000..145abd89 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class SHA1Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA224.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA224.pyi new file mode 100644 index 00000000..fcd170fc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA224.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class SHA224Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA256.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA256.pyi new file mode 100644 index 00000000..2ee94720 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA256.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class SHA256Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA384.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA384.pyi new file mode 100644 index 00000000..ce63a32e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA384.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class SHA384Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA512.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA512.pyi new file mode 100644 index 00000000..c59eb765 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/SHA512.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional +from Crypto.Hash.hashalgo import HashAlgo + +class SHA512Hash(HashAlgo): + oid: Any + digest_size: int + block_size: int + def __init__(self, data: Optional[Any] = ...) -> None: ... + def new(self, data: Optional[Any] = ...): ... + +def new(data: Optional[Any] = ...): ... + +digest_size: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/__init__.pyi new file mode 100644 index 00000000..9af06f41 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/__init__.pyi @@ -0,0 +1,11 @@ +# Names in __all__ with no definition: +# HMAC +# MD2 +# MD4 +# MD5 +# RIPEMD +# SHA +# SHA224 +# SHA256 +# SHA384 +# SHA512 diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/hashalgo.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/hashalgo.pyi new file mode 100644 index 00000000..7c57e034 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Hash/hashalgo.pyi @@ -0,0 +1,11 @@ +from typing import Any, Optional + +class HashAlgo: + digest_size: Any + block_size: Any + def __init__(self, hashFactory, data: Optional[Any] = ...) -> None: ... + def update(self, data): ... + def digest(self): ... + def hexdigest(self): ... + def copy(self): ... + def new(self, data: Optional[Any] = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/AllOrNothing.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/AllOrNothing.pyi new file mode 100644 index 00000000..a7ae7d66 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/AllOrNothing.pyi @@ -0,0 +1,10 @@ +from typing import Any, Optional + +__revision__: str + +def isInt(x): ... + +class AllOrNothing: + def __init__(self, ciphermodule, mode: Optional[Any] = ..., IV: Optional[Any] = ...) -> None: ... + def digest(self, text): ... + def undigest(self, blocks): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/Chaffing.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/Chaffing.pyi new file mode 100644 index 00000000..d70e9f64 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/Chaffing.pyi @@ -0,0 +1,5 @@ +__revision__: str + +class Chaff: + def __init__(self, factor: float = ..., blocksper: int = ...) -> None: ... + def chaff(self, blocks): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/KDF.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/KDF.pyi new file mode 100644 index 00000000..a10d8399 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/KDF.pyi @@ -0,0 +1,7 @@ +from typing import Any, Optional +from Crypto.Hash import SHA as SHA1 + +__revision__: str + +def PBKDF1(password, salt, dkLen, count: int = ..., hashAlgo: Optional[Any] = ...): ... +def PBKDF2(password, salt, dkLen: int = ..., count: int = ..., prf: Optional[Any] = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/__init__.pyi new file mode 100644 index 00000000..e3744e5e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Protocol/__init__.pyi @@ -0,0 +1,4 @@ +# Names in __all__ with no definition: +# AllOrNothing +# Chaffing +# KDF diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/DSA.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/DSA.pyi new file mode 100644 index 00000000..bc48d230 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/DSA.pyi @@ -0,0 +1,27 @@ +from typing import Any, Optional +from .pubkey import pubkey + +class _DSAobj(pubkey): + keydata: Any + implementation: Any + key: Any + def __init__(self, implementation, key) -> None: ... + def __getattr__(self, attrname): ... + def sign(self, M, K): ... + def verify(self, M, signature): ... + def has_private(self): ... + def size(self): ... + def can_blind(self): ... + def can_encrypt(self): ... + def can_sign(self): ... + def publickey(self): ... + +class DSAImplementation: + error: Any + def __init__(self, **kwargs) -> None: ... + def generate(self, bits, randfunc: Optional[Any] = ..., progress_func: Optional[Any] = ...): ... + def construct(self, tup): ... + +generate: Any +construct: Any +error: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/ElGamal.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/ElGamal.pyi new file mode 100644 index 00000000..1a256a34 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/ElGamal.pyi @@ -0,0 +1,19 @@ +from typing import Any, Optional + +from Crypto.PublicKey.pubkey import pubkey +from Crypto.PublicKey.pubkey import * # noqa: F403 + +class error(Exception): ... + +def generate(bits, randfunc, progress_func: Optional[Any] = ...): ... +def construct(tup): ... + +class ElGamalobj(pubkey): + keydata: Any + def encrypt(self, plaintext, K): ... + def decrypt(self, ciphertext): ... + def sign(self, M, K): ... + def verify(self, M, signature): ... + def size(self): ... + def has_private(self): ... + def publickey(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/RSA.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/RSA.pyi new file mode 100644 index 00000000..5ce7b910 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/RSA.pyi @@ -0,0 +1,32 @@ +from typing import Any, Optional, Union, Text +from .pubkey import pubkey + +class _RSAobj(pubkey): + keydata: Any + implementation: Any + key: Any + def __init__(self, implementation, key, randfunc: Optional[Any] = ...) -> None: ... + def __getattr__(self, attrname): ... + def encrypt(self, plaintext, K): ... + def decrypt(self, ciphertext): ... + def sign(self, M, K): ... + def verify(self, M, signature): ... + def has_private(self): ... + def size(self): ... + def can_blind(self): ... + def can_encrypt(self): ... + def can_sign(self): ... + def publickey(self): ... + def exportKey(self, format: str = ..., passphrase: Optional[Any] = ..., pkcs: int = ...): ... + +class RSAImplementation: + error: Any + def __init__(self, **kwargs) -> None: ... + def generate(self, bits, randfunc: Optional[Any] = ..., progress_func: Optional[Any] = ..., e: int = ...): ... + def construct(self, tup): ... + def importKey(self, externKey: Any, passphrase: Union[None, bytes, Text] = ...) -> _RSAobj: ... + +generate: Any +construct: Any +importKey: Any +error: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/__init__.pyi new file mode 100644 index 00000000..36d9e943 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/__init__.pyi @@ -0,0 +1,4 @@ +# Names in __all__ with no definition: +# DSA +# ElGamal +# RSA diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/pubkey.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/pubkey.pyi new file mode 100644 index 00000000..b9281adb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/PublicKey/pubkey.pyi @@ -0,0 +1,21 @@ +from Crypto.Util.number import * # noqa: F403 + +__revision__: str + +class pubkey: + def __init__(self) -> None: ... + def encrypt(self, plaintext, K): ... + def decrypt(self, ciphertext): ... + def sign(self, M, K): ... + def verify(self, M, signature): ... + def validate(self, M, signature): ... + def blind(self, M, B): ... + def unblind(self, M, B): ... + def can_sign(self): ... + def can_encrypt(self): ... + def can_blind(self): ... + def size(self): ... + def has_private(self): ... + def publickey(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaAccumulator.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaAccumulator.pyi new file mode 100644 index 00000000..40149bf1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaAccumulator.pyi @@ -0,0 +1,25 @@ +from typing import Any + +__revision__: str + +class FortunaPool: + digest_size: Any + def __init__(self) -> None: ... + def append(self, data): ... + def digest(self): ... + def hexdigest(self): ... + length: int + def reset(self): ... + +def which_pools(r): ... + +class FortunaAccumulator: + min_pool_size: int + reseed_interval: float + reseed_count: int + generator: Any + last_reseed: Any + pools: Any + def __init__(self) -> None: ... + def random_data(self, bytes): ... + def add_random_event(self, source_number, pool_number, data): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaGenerator.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaGenerator.pyi new file mode 100644 index 00000000..047ac937 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/FortunaGenerator.pyi @@ -0,0 +1,16 @@ +from typing import Any + +__revision__: str + +class AESGenerator: + block_size: Any + key_size: int + max_blocks_per_request: Any + counter: Any + key: Any + block_size_shift: Any + blocks_per_key: Any + max_bytes_per_request: Any + def __init__(self) -> None: ... + def reseed(self, seed): ... + def pseudo_random_data(self, bytes): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/SHAd256.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/SHAd256.pyi new file mode 100644 index 00000000..1fbd51fe --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/SHAd256.pyi @@ -0,0 +1,13 @@ +from typing import Any, Optional + +class _SHAd256: + digest_size: Any + def __init__(self, internal_api_check, sha256_hash_obj) -> None: ... + def copy(self): ... + def digest(self): ... + def hexdigest(self): ... + def update(self, data): ... + +digest_size: Any + +def new(data: Optional[Any] = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/Fortuna/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/__init__.pyi new file mode 100644 index 00000000..d1f1427d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/__init__.pyi @@ -0,0 +1 @@ +__revision__: str diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/fallback.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/fallback.pyi new file mode 100644 index 00000000..72df987c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/fallback.pyi @@ -0,0 +1,5 @@ +from .rng_base import BaseRNG + +class PythonOSURandomRNG(BaseRNG): + name: str + def __init__(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/posix.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/posix.pyi new file mode 100644 index 00000000..bbaf7404 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/posix.pyi @@ -0,0 +1,6 @@ +from typing import Any, Optional +from .rng_base import BaseRNG + +class DevURandomRNG(BaseRNG): + name: str + def __init__(self, devname: Optional[Any] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/rng_base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/rng_base.pyi new file mode 100644 index 00000000..12e3d812 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/OSRNG/rng_base.pyi @@ -0,0 +1,11 @@ +__revision__: str + +class BaseRNG: + closed: bool + def __init__(self) -> None: ... + def __del__(self): ... + def __enter__(self): ... + def __exit__(self): ... + def close(self): ... + def flush(self): ... + def read(self, N: int = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/__init__.pyi new file mode 100644 index 00000000..f30acfd3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/__init__.pyi @@ -0,0 +1 @@ +def new(*args, **kwargs): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/random.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/random.pyi new file mode 100644 index 00000000..88ea62e3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Random/random.pyi @@ -0,0 +1,17 @@ +from typing import Any, Optional + +class StrongRandom: + def __init__(self, rng: Optional[Any] = ..., randfunc: Optional[Any] = ...) -> None: ... + def getrandbits(self, k): ... + def randrange(self, *args): ... + def randint(self, a, b): ... + def choice(self, seq): ... + def shuffle(self, x): ... + def sample(self, population, k): ... + +getrandbits: Any +randrange: Any +randint: Any +choice: Any +shuffle: Any +sample: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_PSS.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_PSS.pyi new file mode 100644 index 00000000..8341c2b4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_PSS.pyi @@ -0,0 +1,9 @@ +from typing import Any, Optional + +class PSS_SigScheme: + def __init__(self, key, mgfunc, saltLen) -> None: ... + def can_sign(self): ... + def sign(self, mhash): ... + def verify(self, mhash, S): ... + +def new(key, mgfunc: Optional[Any] = ..., saltLen: Optional[Any] = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_v1_5.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_v1_5.pyi new file mode 100644 index 00000000..4a2b2253 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/PKCS1_v1_5.pyi @@ -0,0 +1,7 @@ +class PKCS115_SigScheme: + def __init__(self, key) -> None: ... + def can_sign(self): ... + def sign(self, mhash): ... + def verify(self, mhash, S): ... + +def new(key): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/__init__.pyi new file mode 100644 index 00000000..560f06fd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Signature/__init__.pyi @@ -0,0 +1,3 @@ +# Names in __all__ with no definition: +# PKCS1_PSS +# PKCS1_v1_5 diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/Counter.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/Counter.pyi new file mode 100644 index 00000000..4aae7f26 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/Counter.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def new(nbits, prefix: Any = ..., suffix: Any = ..., initial_value: int = ..., overflow: int = ..., little_endian: bool = ..., allow_wraparound: bool = ..., disable_shortcut: bool = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/RFC1751.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/RFC1751.pyi new file mode 100644 index 00000000..e1e8f5ef --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/RFC1751.pyi @@ -0,0 +1,9 @@ +from typing import Any + +__revision__: str +binary: Any + +def key_to_english(key): ... +def english_to_key(s): ... + +wordlist: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/__init__.pyi new file mode 100644 index 00000000..17472995 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/__init__.pyi @@ -0,0 +1,6 @@ +# Names in __all__ with no definition: +# RFC1751 +# asn1 +# number +# randpool +# strxor diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/asn1.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/asn1.pyi new file mode 100644 index 00000000..03d4b29f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/asn1.pyi @@ -0,0 +1,45 @@ +from typing import Any, Optional + +class DerObject: + typeTags: Any + typeTag: Any + payload: Any + def __init__(self, ASN1Type: Optional[Any] = ..., payload: Any = ...) -> None: ... + def isType(self, ASN1Type): ... + def encode(self): ... + def decode(self, derEle, noLeftOvers: int = ...): ... + +class DerInteger(DerObject): + value: Any + def __init__(self, value: int = ...) -> None: ... + payload: Any + def encode(self): ... + def decode(self, derEle, noLeftOvers: int = ...): ... + +class DerSequence(DerObject): + def __init__(self, startSeq: Optional[Any] = ...) -> None: ... + def __delitem__(self, n): ... + def __getitem__(self, n): ... + def __setitem__(self, key, value): ... + def __setslice__(self, i, j, sequence): ... + def __delslice__(self, i, j): ... + def __getslice__(self, i, j): ... + def __len__(self): ... + def append(self, item): ... + def hasInts(self): ... + def hasOnlyInts(self): ... + payload: Any + def encode(self): ... + def decode(self, derEle, noLeftOvers: int = ...): ... + +class DerOctetString(DerObject): + payload: Any + def __init__(self, value: Any = ...) -> None: ... + def decode(self, derEle, noLeftOvers: int = ...): ... + +class DerNull(DerObject): + def __init__(self) -> None: ... + +class DerObjectId(DerObject): + def __init__(self) -> None: ... + def decode(self, derEle, noLeftOvers: int = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/number.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/number.pyi new file mode 100644 index 00000000..4ffbd032 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/number.pyi @@ -0,0 +1,22 @@ +from typing import Any, Optional +from warnings import warn as _warn + +__revision__: str +bignum: Any + +def size(N): ... +def getRandomNumber(N, randfunc: Optional[Any] = ...): ... +def getRandomInteger(N, randfunc: Optional[Any] = ...): ... +def getRandomRange(a, b, randfunc: Optional[Any] = ...): ... +def getRandomNBitInteger(N, randfunc: Optional[Any] = ...): ... +def GCD(x, y): ... +def inverse(u, v): ... +def getPrime(N, randfunc: Optional[Any] = ...): ... +def getStrongPrime(N, e: int = ..., false_positive_prob: float = ..., randfunc: Optional[Any] = ...): ... +def isPrime(N, false_positive_prob: float = ..., randfunc: Optional[Any] = ...): ... +def long_to_bytes(n, blocksize: int = ...): ... +def bytes_to_long(s): ... +def long2str(n, blocksize: int = ...): ... +def str2long(s): ... + +sieve_base: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/randpool.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/randpool.pyi new file mode 100644 index 00000000..4d90f920 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/randpool.pyi @@ -0,0 +1,16 @@ +from typing import Any, Optional + +__revision__: str + +class RandomPool: + bytes: Any + bits: Any + entropy: Any + def __init__(self, numbytes: int = ..., cipher: Optional[Any] = ..., hash: Optional[Any] = ..., file: Optional[Any] = ...) -> None: ... + def get_bytes(self, N): ... + def randomize(self, N: int = ...): ... + def stir(self, s: str = ...): ... + def stir_n(self, N: int = ...): ... + def add_event(self, s: str = ...): ... + def getBytes(self, N): ... + def addEvent(self, event, s: str = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/strxor.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/strxor.pyi new file mode 100644 index 00000000..cb6269bb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/Util/strxor.pyi @@ -0,0 +1,2 @@ +def strxor(*args, **kwargs): ... +def strxor_c(*args, **kwargs): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/__init__.pyi new file mode 100644 index 00000000..6d8e1248 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/__init__.pyi @@ -0,0 +1,7 @@ +# Names in __all__ with no definition: +# Cipher +# Hash +# Protocol +# PublicKey +# Signature +# Util diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/pct_warnings.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/pct_warnings.pyi new file mode 100644 index 00000000..b77e975b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/Crypto/pct_warnings.pyi @@ -0,0 +1,7 @@ +class CryptoWarning(Warning): ... +class CryptoDeprecationWarning(DeprecationWarning, CryptoWarning): ... +class CryptoRuntimeWarning(RuntimeWarning, CryptoWarning): ... +class RandomPool_DeprecationWarning(CryptoDeprecationWarning): ... +class ClockRewindWarning(CryptoRuntimeWarning): ... +class GetRandomNumber_DeprecationWarning(CryptoDeprecationWarning): ... +class PowmInsecureWarning(CryptoRuntimeWarning): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/atomicwrites/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/atomicwrites/__init__.pyi new file mode 100644 index 00000000..cecbd10b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/atomicwrites/__init__.pyi @@ -0,0 +1,15 @@ +from typing import Any, AnyStr, Callable, ContextManager, Generic, IO, Optional, Text, Type, Union + +def replace_atomic(src: AnyStr, dst: AnyStr) -> None: ... +def move_atomic(src: AnyStr, dst: AnyStr) -> None: ... +class AtomicWriter(object): + def __init__(self, path: Union[Text, bytes], mode: Text = ..., overwrite: bool = ...) -> None: ... + def open(self) -> ContextManager[IO[Any]]: ... + def _open(self, get_fileobject: Callable[..., IO[AnyStr]]) -> ContextManager[IO[AnyStr]]: ... + def get_fileobject(self, dir: Union[None, Text, bytes] = ..., **kwargs: Any) -> IO[Any]: ... + def sync(self, f: IO[Any]) -> None: ... + def commit(self, f: IO[Any]) -> None: ... + def rollback(self, f: IO[Any]) -> None: ... +def atomic_write( + path: Union[Text, bytes], writer_cls: Type[AtomicWriter] = ..., **cls_kwargs: object, +) -> ContextManager[IO[Any]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/attr/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/attr/__init__.pyi new file mode 100644 index 00000000..fcb93b18 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/attr/__init__.pyi @@ -0,0 +1,255 @@ +from typing import ( + Any, + Callable, + Dict, + Generic, + List, + Optional, + Sequence, + Mapping, + Tuple, + Type, + TypeVar, + Union, + overload, +) + +# `import X as X` is required to make these public +from . import exceptions as exceptions +from . import filters as filters +from . import converters as converters +from . import validators as validators + +_T = TypeVar("_T") +_C = TypeVar("_C", bound=type) + +_ValidatorType = Callable[[Any, Attribute[_T], _T], Any] +_ConverterType = Callable[[Any], _T] +_FilterType = Callable[[Attribute[_T], _T], bool] +# FIXME: in reality, if multiple validators are passed they must be in a list or tuple, +# but those are invariant and so would prevent subtypes of _ValidatorType from working +# when passed in a list or tuple. +_ValidatorArgType = Union[_ValidatorType[_T], Sequence[_ValidatorType[_T]]] + +# _make -- + +NOTHING: object + +# NOTE: Factory lies about its return type to make this possible: `x: List[int] = Factory(list)` +# Work around mypy issue #4554 in the common case by using an overload. +@overload +def Factory(factory: Callable[[], _T]) -> _T: ... +@overload +def Factory( + factory: Union[Callable[[Any], _T], Callable[[], _T]], + takes_self: bool = ..., +) -> _T: ... + +class Attribute(Generic[_T]): + name: str + default: Optional[_T] + validator: Optional[_ValidatorType[_T]] + repr: bool + cmp: bool + hash: Optional[bool] + init: bool + converter: Optional[_ConverterType[_T]] + metadata: Dict[Any, Any] + type: Optional[Type[_T]] + kw_only: bool + def __lt__(self, x: Attribute[_T]) -> bool: ... + def __le__(self, x: Attribute[_T]) -> bool: ... + def __gt__(self, x: Attribute[_T]) -> bool: ... + def __ge__(self, x: Attribute[_T]) -> bool: ... + +# NOTE: We had several choices for the annotation to use for type arg: +# 1) Type[_T] +# - Pros: Handles simple cases correctly +# - Cons: Might produce less informative errors in the case of conflicting TypeVars +# e.g. `attr.ib(default='bad', type=int)` +# 2) Callable[..., _T] +# - Pros: Better error messages than #1 for conflicting TypeVars +# - Cons: Terrible error messages for validator checks. +# e.g. attr.ib(type=int, validator=validate_str) +# -> error: Cannot infer function type argument +# 3) type (and do all of the work in the mypy plugin) +# - Pros: Simple here, and we could customize the plugin with our own errors. +# - Cons: Would need to write mypy plugin code to handle all the cases. +# We chose option #1. + +# `attr` lies about its return type to make the following possible: +# attr() -> Any +# attr(8) -> int +# attr(validator=) -> Whatever the callable expects. +# This makes this type of assignments possible: +# x: int = attr(8) +# +# This form catches explicit None or no default but with no other arguments returns Any. +@overload +def attrib( + default: None = ..., + validator: None = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + convert: None = ..., + metadata: Optional[Mapping[Any, Any]] = ..., + type: None = ..., + converter: None = ..., + factory: None = ..., + kw_only: bool = ..., +) -> Any: ... + +# This form catches an explicit None or no default and infers the type from the other arguments. +@overload +def attrib( + default: None = ..., + validator: Optional[_ValidatorArgType[_T]] = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + convert: Optional[_ConverterType[_T]] = ..., + metadata: Optional[Mapping[Any, Any]] = ..., + type: Optional[Type[_T]] = ..., + converter: Optional[_ConverterType[_T]] = ..., + factory: Optional[Callable[[], _T]] = ..., + kw_only: bool = ..., +) -> _T: ... + +# This form catches an explicit default argument. +@overload +def attrib( + default: _T, + validator: Optional[_ValidatorArgType[_T]] = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + convert: Optional[_ConverterType[_T]] = ..., + metadata: Optional[Mapping[Any, Any]] = ..., + type: Optional[Type[_T]] = ..., + converter: Optional[_ConverterType[_T]] = ..., + factory: Optional[Callable[[], _T]] = ..., + kw_only: bool = ..., +) -> _T: ... + +# This form covers type=non-Type: e.g. forward references (str), Any +@overload +def attrib( + default: Optional[_T] = ..., + validator: Optional[_ValidatorArgType[_T]] = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + convert: Optional[_ConverterType[_T]] = ..., + metadata: Optional[Mapping[Any, Any]] = ..., + type: object = ..., + converter: Optional[_ConverterType[_T]] = ..., + factory: Optional[Callable[[], _T]] = ..., + kw_only: bool = ..., +) -> Any: ... +@overload +def attrs( + maybe_cls: _C, + these: Optional[Dict[str, Any]] = ..., + repr_ns: Optional[str] = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + slots: bool = ..., + frozen: bool = ..., + weakref_slot: bool = ..., + str: bool = ..., + auto_attribs: bool = ..., + kw_only: bool = ..., + cache_hash: bool = ..., + auto_exc: bool = ..., +) -> _C: ... +@overload +def attrs( + maybe_cls: None = ..., + these: Optional[Dict[str, Any]] = ..., + repr_ns: Optional[str] = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + slots: bool = ..., + frozen: bool = ..., + weakref_slot: bool = ..., + str: bool = ..., + auto_attribs: bool = ..., + kw_only: bool = ..., + cache_hash: bool = ..., + auto_exc: bool = ..., +) -> Callable[[_C], _C]: ... + +# TODO: add support for returning NamedTuple from the mypy plugin +class _Fields(Tuple[Attribute[Any], ...]): + def __getattr__(self, name: str) -> Attribute[Any]: ... + +def fields(cls: type) -> _Fields: ... +def fields_dict(cls: type) -> Dict[str, Attribute[Any]]: ... +def validate(inst: Any) -> None: ... + +# TODO: add support for returning a proper attrs class from the mypy plugin +# we use Any instead of _CountingAttr so that e.g. `make_class('Foo', [attr.ib()])` is valid +def make_class( + name: str, + attrs: Union[List[str], Tuple[str, ...], Dict[str, Any]], + bases: Tuple[type, ...] = ..., + repr_ns: Optional[str] = ..., + repr: bool = ..., + cmp: bool = ..., + hash: Optional[bool] = ..., + init: bool = ..., + slots: bool = ..., + frozen: bool = ..., + weakref_slot: bool = ..., + str: bool = ..., + auto_attribs: bool = ..., + kw_only: bool = ..., + cache_hash: bool = ..., + auto_exc: bool = ..., +) -> type: ... + +# _funcs -- + +# TODO: add support for returning TypedDict from the mypy plugin +# FIXME: asdict/astuple do not honor their factory args. waiting on one of these: +# https://github.com/python/mypy/issues/4236 +# https://github.com/python/typing/issues/253 +def asdict( + inst: Any, + recurse: bool = ..., + filter: Optional[_FilterType[Any]] = ..., + dict_factory: Type[Mapping[Any, Any]] = ..., + retain_collection_types: bool = ..., +) -> Dict[str, Any]: ... + +# TODO: add support for returning NamedTuple from the mypy plugin +def astuple( + inst: Any, + recurse: bool = ..., + filter: Optional[_FilterType[Any]] = ..., + tuple_factory: Type[Sequence[Any]] = ..., + retain_collection_types: bool = ..., +) -> Tuple[Any, ...]: ... +def has(cls: type) -> bool: ... +def assoc(inst: _T, **changes: Any) -> _T: ... +def evolve(inst: _T, **changes: Any) -> _T: ... + +# _config -- + +def set_run_validators(run: bool) -> None: ... +def get_run_validators() -> bool: ... + +# aliases -- + +s = attributes = attrs +ib = attr = attrib +dataclass = attrs # Technically, partial(attrs, auto_attribs=True) ;) diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/attr/converters.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/attr/converters.pyi new file mode 100644 index 00000000..63b2a386 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/attr/converters.pyi @@ -0,0 +1,12 @@ +from typing import TypeVar, Optional, Callable, overload +from . import _ConverterType + +_T = TypeVar("_T") + +def optional( + converter: _ConverterType[_T] +) -> _ConverterType[Optional[_T]]: ... +@overload +def default_if_none(default: _T) -> _ConverterType[_T]: ... +@overload +def default_if_none(*, factory: Callable[[], _T]) -> _ConverterType[_T]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/attr/exceptions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/attr/exceptions.pyi new file mode 100644 index 00000000..48fffcc1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/attr/exceptions.pyi @@ -0,0 +1,7 @@ +class FrozenInstanceError(AttributeError): + msg: str = ... + +class AttrsAttributeNotFoundError(ValueError): ... +class NotAnAttrsClassError(ValueError): ... +class DefaultAlreadySetError(RuntimeError): ... +class UnannotatedAttributeError(RuntimeError): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/attr/filters.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/attr/filters.pyi new file mode 100644 index 00000000..68368fe2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/attr/filters.pyi @@ -0,0 +1,5 @@ +from typing import Union, Any +from . import Attribute, _FilterType + +def include(*what: Union[type, Attribute[Any]]) -> _FilterType[Any]: ... +def exclude(*what: Union[type, Attribute[Any]]) -> _FilterType[Any]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/attr/validators.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/attr/validators.pyi new file mode 100644 index 00000000..01af0684 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/attr/validators.pyi @@ -0,0 +1,24 @@ +from typing import Container, List, Union, TypeVar, Type, Any, Optional, Tuple +from . import _ValidatorType + +_T = TypeVar("_T") + +def instance_of( + type: Union[Tuple[Type[_T], ...], Type[_T]] +) -> _ValidatorType[_T]: ... +def provides(interface: Any) -> _ValidatorType[Any]: ... +def optional( + validator: Union[_ValidatorType[_T], List[_ValidatorType[_T]]] +) -> _ValidatorType[Optional[_T]]: ... +def in_(options: Container[_T]) -> _ValidatorType[_T]: ... +def and_(*validators: _ValidatorType[_T]) -> _ValidatorType[_T]: ... +def deep_iterable( + member_validator: _ValidatorType[_T], + iterable_validator: Optional[_ValidatorType[_T]], +) -> _ValidatorType[_T]: ... +def deep_mapping( + key_validator: _ValidatorType[_T], + value_validator: _ValidatorType[_T], + mapping_validator: Optional[_ValidatorType[_T]], +) -> _ValidatorType[_T]: ... +def is_callable() -> _ValidatorType[_T]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/backports/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/backports/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/backports/ssl_match_hostname.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/backports/ssl_match_hostname.pyi new file mode 100644 index 00000000..c2199801 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/backports/ssl_match_hostname.pyi @@ -0,0 +1,3 @@ +class CertificateError(ValueError): ... + +def match_hostname(cert, hostname): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/backports_abc.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/backports_abc.pyi new file mode 100644 index 00000000..b48ae336 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/backports_abc.pyi @@ -0,0 +1,15 @@ +from typing import Any + +def mk_gen(): ... +def mk_awaitable(): ... +def mk_coroutine(): ... + +Generator: Any +Awaitable: Any +Coroutine: Any + +def isawaitable(obj): ... + +PATCHED: Any + +def patch(patch_inspect: bool = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/bleach/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/bleach/__init__.pyi new file mode 100644 index 00000000..3a1ad2c4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/bleach/__init__.pyi @@ -0,0 +1,32 @@ +from typing import Any, Container, Iterable, Optional, Text + +from bleach.linkifier import DEFAULT_CALLBACKS as DEFAULT_CALLBACKS, Linker as Linker +from bleach.sanitizer import ( + ALLOWED_ATTRIBUTES as ALLOWED_ATTRIBUTES, + ALLOWED_PROTOCOLS as ALLOWED_PROTOCOLS, + ALLOWED_STYLES as ALLOWED_STYLES, + ALLOWED_TAGS as ALLOWED_TAGS, + Cleaner as Cleaner, +) + +from .linkifier import _Callback + +__releasedate__: Text +__version__: Text +VERSION: Any # packaging.version.Version + +def clean( + text: Text, + tags: Container[Text] = ..., + attributes: Any = ..., + styles: Container[Text] = ..., + protocols: Container[Text] = ..., + strip: bool = ..., + strip_comments: bool = ..., +) -> Text: ... +def linkify( + text: Text, + callbacks: Iterable[_Callback] = ..., + skip_tags: Optional[Container[Text]] = ..., + parse_email: bool = ..., +) -> Text: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/bleach/callbacks.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/bleach/callbacks.pyi new file mode 100644 index 00000000..25c5c01e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/bleach/callbacks.pyi @@ -0,0 +1,6 @@ +from typing import MutableMapping, Any, Text + +_Attrs = MutableMapping[Any, Text] + +def nofollow(attrs: _Attrs, new: bool = ...) -> _Attrs: ... +def target_blank(attrs: _Attrs, new: bool = ...) -> _Attrs: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/bleach/linkifier.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/bleach/linkifier.pyi new file mode 100644 index 00000000..f6ef3cea --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/bleach/linkifier.pyi @@ -0,0 +1,31 @@ +from typing import Any, Container, Iterable, List, MutableMapping, Optional, Pattern, Protocol, Text + +_Attrs = MutableMapping[Any, Text] + +class _Callback(Protocol): + def __call__(self, attrs: _Attrs, new: bool = ...) -> _Attrs: ... + +DEFAULT_CALLBACKS: List[_Callback] + +TLDS: List[Text] + +def build_url_re(tlds: Iterable[Text] = ..., protocols: Iterable[Text] = ...) -> Pattern[Text]: ... + +URL_RE: Pattern[Text] +PROTO_RE: Pattern[Text] +EMAIL_RE: Pattern[Text] + +class Linker(object): + def __init__( + self, + callbacks: Iterable[_Callback] = ..., + skip_tags: Optional[Container[Text]] = ..., + parse_email: bool = ..., + url_re: Pattern[Text] = ..., + email_re: Pattern[Text] = ..., + recognized_tags: Optional[Container[Text]] = ..., + ) -> None: ... + def linkify(self, text: Text) -> Text: ... + +class LinkifyFilter(object): # TODO: derives from html5lib.Filter + def __getattr__(self, item: str) -> Any: ... # incomplete diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/bleach/sanitizer.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/bleach/sanitizer.pyi new file mode 100644 index 00000000..c6a7283c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/bleach/sanitizer.pyi @@ -0,0 +1,34 @@ +from typing import Any, Callable, Container, Dict, Iterable, List, Optional, Pattern, Text, Type, Union + +ALLOWED_TAGS: List[Text] +ALLOWED_ATTRIBUTES: Dict[Text, List[Text]] +ALLOWED_STYLES: List[Text] +ALLOWED_PROTOCOLS: List[Text] + +INVISIBLE_CHARACTERS: Text +INVISIBLE_CHARACTERS_RE: Pattern[Text] +INVISIBLE_REPLACEMENT_CHAR: Text + +# A html5lib Filter class +_Filter = Any + +class Cleaner(object): + def __init__( + self, + tags: Container[Text] = ..., + attributes: Any = ..., + styles: Container[Text] = ..., + protocols: Container[Text] = ..., + strip: bool = ..., + strip_comments: bool = ..., + filters: Optional[Iterable[_Filter]] = ..., + ) -> None: ... + def clean(self, text: Text) -> Text: ... + +_AttributeFilter = Callable[[Text, Text, Text], bool] +_AttributeDict = Dict[Text, Union[Container[Text], _AttributeFilter]] + +def attribute_filter_factory(attributes: Union[_AttributeFilter, _AttributeDict, Container[Text]]) -> _AttributeFilter: ... + +class BleachSanitizerFilter(object): # TODO: derives from html5lib.sanitizer.Filter + def __getattr__(self, item: str) -> Any: ... # incomplete diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/bleach/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/bleach/utils.pyi new file mode 100644 index 00000000..984c554b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/bleach/utils.pyi @@ -0,0 +1,8 @@ +from collections import OrderedDict +from typing import overload, Mapping, Any, Text + +@overload +def alphabetize_attributes(attrs: None) -> None: ... +@overload +def alphabetize_attributes(attrs: Mapping[Any, Text]) -> OrderedDict[Any, Text]: ... +def force_unicode(text: Text) -> Text: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/__init__.pyi new file mode 100644 index 00000000..8426785a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/__init__.pyi @@ -0,0 +1,76 @@ +from typing import Any, Optional, Text +import logging + +from .s3.connection import S3Connection + +Version: Any +UserAgent: Any +config: Any +BUCKET_NAME_RE: Any +TOO_LONG_DNS_NAME_COMP: Any +GENERATION_RE: Any +VERSION_RE: Any +ENDPOINTS_PATH: Any + +def init_logging(): ... + +class NullHandler(logging.Handler): + def emit(self, record): ... + +log: Any +perflog: Any + +def set_file_logger(name, filepath, level: Any = ..., format_string: Optional[Any] = ...): ... +def set_stream_logger(name, level: Any = ..., format_string: Optional[Any] = ...): ... +def connect_sqs(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_s3(aws_access_key_id: Optional[Text] = ..., aws_secret_access_key: Optional[Text] = ..., **kwargs) -> S3Connection: ... +def connect_gs(gs_access_key_id: Optional[Any] = ..., gs_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_ec2(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_elb(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_autoscale(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudwatch(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_sdb(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_fps(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_mturk(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudfront(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_vpc(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_rds(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_rds2(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_emr(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_sns(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_iam(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_route53(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudformation(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_euca(host: Optional[Any] = ..., aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., port: int = ..., path: str = ..., is_secure: bool = ..., **kwargs): ... +def connect_glacier(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_ec2_endpoint(url, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_walrus(host: Optional[Any] = ..., aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., port: int = ..., path: str = ..., is_secure: bool = ..., **kwargs): ... +def connect_ses(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_sts(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_ia(ia_access_key_id: Optional[Any] = ..., ia_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., **kwargs): ... +def connect_dynamodb(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_swf(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudsearch(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudsearch2(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., sign_request: bool = ..., **kwargs): ... +def connect_cloudsearchdomain(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_beanstalk(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_elastictranscoder(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_opsworks(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_redshift(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_support(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudtrail(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_directconnect(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_kinesis(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_logs(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_route53domains(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cognito_identity(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cognito_sync(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_kms(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_awslambda(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_codedeploy(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_configservice(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_cloudhsm(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_ec2containerservice(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def connect_machinelearning(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ... +def storage_uri(uri_str, default_scheme: str = ..., debug: int = ..., validate: bool = ..., bucket_storage_uri_class: Any = ..., suppress_consec_slashes: bool = ..., is_latest: bool = ...): ... +def storage_uri_for_key(key): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/auth.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/auth.pyi new file mode 100644 index 00000000..033d1d79 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/auth.pyi @@ -0,0 +1,108 @@ +from typing import Any, Optional +from boto.auth_handler import AuthHandler + +SIGV4_DETECT: Any + +class HmacKeys: + host: Any + def __init__(self, host, config, provider) -> None: ... + def update_provider(self, provider): ... + def algorithm(self): ... + def sign_string(self, string_to_sign): ... + +class AnonAuthHandler(AuthHandler, HmacKeys): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def add_auth(self, http_request, **kwargs): ... + +class HmacAuthV1Handler(AuthHandler, HmacKeys): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def update_provider(self, provider): ... + def add_auth(self, http_request, **kwargs): ... + +class HmacAuthV2Handler(AuthHandler, HmacKeys): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def update_provider(self, provider): ... + def add_auth(self, http_request, **kwargs): ... + +class HmacAuthV3Handler(AuthHandler, HmacKeys): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def add_auth(self, http_request, **kwargs): ... + +class HmacAuthV3HTTPHandler(AuthHandler, HmacKeys): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def headers_to_sign(self, http_request): ... + def canonical_headers(self, headers_to_sign): ... + def string_to_sign(self, http_request): ... + def add_auth(self, req, **kwargs): ... + +class HmacAuthV4Handler(AuthHandler, HmacKeys): + capability: Any + service_name: Any + region_name: Any + def __init__(self, host, config, provider, service_name: Optional[Any] = ..., region_name: Optional[Any] = ...) -> None: ... + def headers_to_sign(self, http_request): ... + def host_header(self, host, http_request): ... + def query_string(self, http_request): ... + def canonical_query_string(self, http_request): ... + def canonical_headers(self, headers_to_sign): ... + def signed_headers(self, headers_to_sign): ... + def canonical_uri(self, http_request): ... + def payload(self, http_request): ... + def canonical_request(self, http_request): ... + def scope(self, http_request): ... + def split_host_parts(self, host): ... + def determine_region_name(self, host): ... + def determine_service_name(self, host): ... + def credential_scope(self, http_request): ... + def string_to_sign(self, http_request, canonical_request): ... + def signature(self, http_request, string_to_sign): ... + def add_auth(self, req, **kwargs): ... + +class S3HmacAuthV4Handler(HmacAuthV4Handler, AuthHandler): + capability: Any + region_name: Any + def __init__(self, *args, **kwargs) -> None: ... + def clean_region_name(self, region_name): ... + def canonical_uri(self, http_request): ... + def canonical_query_string(self, http_request): ... + def host_header(self, host, http_request): ... + def headers_to_sign(self, http_request): ... + def determine_region_name(self, host): ... + def determine_service_name(self, host): ... + def mangle_path_and_params(self, req): ... + def payload(self, http_request): ... + def add_auth(self, req, **kwargs): ... + def presign(self, req, expires, iso_date: Optional[Any] = ...): ... + +class STSAnonHandler(AuthHandler): + capability: Any + def add_auth(self, http_request, **kwargs): ... + +class QuerySignatureHelper(HmacKeys): + def add_auth(self, http_request, **kwargs): ... + +class QuerySignatureV0AuthHandler(QuerySignatureHelper, AuthHandler): + SignatureVersion: int + capability: Any + +class QuerySignatureV1AuthHandler(QuerySignatureHelper, AuthHandler): + SignatureVersion: int + capability: Any + def __init__(self, *args, **kw) -> None: ... + +class QuerySignatureV2AuthHandler(QuerySignatureHelper, AuthHandler): + SignatureVersion: int + capability: Any + +class POSTPathQSV2AuthHandler(QuerySignatureV2AuthHandler, AuthHandler): + capability: Any + def add_auth(self, req, **kwargs): ... + +def get_auth_handler(host, config, provider, requested_capability: Optional[Any] = ...): ... +def detect_potential_sigv4(func): ... +def detect_potential_s3sigv4(func): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/auth_handler.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/auth_handler.pyi new file mode 100644 index 00000000..018e6d1d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/auth_handler.pyi @@ -0,0 +1,9 @@ +from typing import Any +from boto.plugin import Plugin + +class NotReadyToAuthenticate(Exception): ... + +class AuthHandler(Plugin): + capability: Any + def __init__(self, host, config, provider) -> None: ... + def add_auth(self, http_request): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/compat.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/compat.pyi new file mode 100644 index 00000000..ce997030 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/compat.pyi @@ -0,0 +1,17 @@ +import sys + +from typing import Any +from base64 import encodestring as encodebytes + +from six.moves import http_client + +expanduser: Any + +if sys.version_info >= (3, 0): + StandardError = Exception +else: + from __builtin__ import StandardError as StandardError + +long_type: Any +unquote_str: Any +parse_qs_safe: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/connection.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/connection.pyi new file mode 100644 index 00000000..820d6e3a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/connection.pyi @@ -0,0 +1,115 @@ +from typing import Any, Dict, Optional, Text +from six.moves import http_client + +HAVE_HTTPS_CONNECTION: bool +ON_APP_ENGINE: Any +PORTS_BY_SECURITY: Any +DEFAULT_CA_CERTS_FILE: Any + +class HostConnectionPool: + queue: Any + def __init__(self) -> None: ... + def size(self): ... + def put(self, conn): ... + def get(self): ... + def clean(self): ... + +class ConnectionPool: + CLEAN_INTERVAL: float + STALE_DURATION: float + host_to_pool: Any + last_clean_time: float + mutex: Any + def __init__(self) -> None: ... + def size(self): ... + def get_http_connection(self, host, port, is_secure): ... + def put_http_connection(self, host, port, is_secure, conn): ... + def clean(self): ... + +class HTTPRequest: + method: Any + protocol: Any + host: Any + port: Any + path: Any + auth_path: Any + params: Any + headers: Any + body: Any + def __init__(self, method, protocol, host, port, path, auth_path, params, headers, body) -> None: ... + def authorize(self, connection, **kwargs): ... + +class HTTPResponse(http_client.HTTPResponse): + def __init__(self, *args, **kwargs) -> None: ... + def read(self, amt: Optional[Any] = ...): ... + +class AWSAuthConnection: + suppress_consec_slashes: Any + num_retries: int + is_secure: Any + https_validate_certificates: Any + ca_certificates_file: Any + port: Any + http_exceptions: Any + http_unretryable_exceptions: Any + socket_exception_values: Any + https_connection_factory: Any + protocol: str + host: Any + path: Any + debug: Any + host_header: Any + http_connection_kwargs: Any + provider: Any + auth_service_name: Any + request_hook: Any + def __init__(self, host, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., port: Optional[Any] = ..., proxy: Optional[Any] = ..., proxy_port: Optional[Any] = ..., proxy_user: Optional[Any] = ..., proxy_pass: Optional[Any] = ..., debug: int = ..., https_connection_factory: Optional[Any] = ..., path: str = ..., provider: str = ..., security_token: Optional[Any] = ..., suppress_consec_slashes: bool = ..., validate_certs: bool = ..., profile_name: Optional[Any] = ...) -> None: ... + auth_region_name: Any + @property + def connection(self): ... + @property + def aws_access_key_id(self): ... + @property + def gs_access_key_id(self) -> Any: ... + access_key: Any + @property + def aws_secret_access_key(self): ... + @property + def gs_secret_access_key(self): ... + secret_key: Any + @property + def profile_name(self): ... + def get_path(self, path: str = ...): ... + def server_name(self, port: Optional[Any] = ...): ... + proxy: Any + proxy_port: Any + proxy_user: Any + proxy_pass: Any + no_proxy: Any + use_proxy: Any + def handle_proxy(self, proxy, proxy_port, proxy_user, proxy_pass): ... + def get_http_connection(self, host, port, is_secure): ... + def skip_proxy(self, host): ... + def new_http_connection(self, host, port, is_secure): ... + def put_http_connection(self, host, port, is_secure, connection): ... + def proxy_ssl(self, host: Optional[Any] = ..., port: Optional[Any] = ...): ... + def prefix_proxy_to_path(self, path, host: Optional[Any] = ...): ... + def get_proxy_auth_header(self): ... + def get_proxy_url_with_auth(self): ... + def set_host_header(self, request): ... + def set_request_hook(self, hook): ... + def build_base_http_request(self, method, path, auth_path, params: Optional[Any] = ..., headers: Optional[Any] = ..., data: str = ..., host: Optional[Any] = ...): ... + def make_request(self, method, path, headers: Optional[Any] = ..., data: str = ..., host: Optional[Any] = ..., auth_path: Optional[Any] = ..., sender: Optional[Any] = ..., override_num_retries: Optional[Any] = ..., params: Optional[Any] = ..., retry_handler: Optional[Any] = ...): ... + def close(self): ... + +class AWSQueryConnection(AWSAuthConnection): + APIVersion: str + ResponseError: Any + def __init__(self, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., port: Optional[Any] = ..., proxy: Optional[Any] = ..., proxy_port: Optional[Any] = ..., proxy_user: Optional[Any] = ..., proxy_pass: Optional[Any] = ..., host: Optional[Any] = ..., debug: int = ..., https_connection_factory: Optional[Any] = ..., path: str = ..., security_token: Optional[Any] = ..., validate_certs: bool = ..., profile_name: Optional[Any] = ..., provider: str = ...) -> None: ... + def get_utf8_value(self, value): ... + def make_request(self, action, params: Optional[Any] = ..., path: str = ..., verb: str = ..., *args, **kwargs): ... # type: ignore # https://github.com/python/mypy/issues/1237 + def build_list_params(self, params, items, label): ... + def build_complex_list_params(self, params, items, label, names): ... + def get_list(self, action, params, markers, path: str = ..., parent: Optional[Any] = ..., verb: str = ...): ... + def get_object(self, action, params, cls, path: str = ..., parent: Optional[Any] = ..., verb: str = ...): ... + def get_status(self, action, params, path: str = ..., parent: Optional[Any] = ..., verb: str = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/ec2/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/ec2/__init__.pyi new file mode 100644 index 00000000..d671c904 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/ec2/__init__.pyi @@ -0,0 +1,7 @@ +from typing import Any + +RegionData: Any + +def regions(**kw_params): ... +def connect_to_region(region_name, **kw_params): ... +def get_region(region_name, **kw_params): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/elb/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/elb/__init__.pyi new file mode 100644 index 00000000..16cf5b48 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/elb/__init__.pyi @@ -0,0 +1,39 @@ +from typing import Any +from boto.connection import AWSQueryConnection + +RegionData: Any + +def regions(): ... +def connect_to_region(region_name, **kw_params): ... + +class ELBConnection(AWSQueryConnection): + APIVersion: Any + DefaultRegionName: Any + DefaultRegionEndpoint: Any + region: Any + def __init__(self, aws_access_key_id=..., aws_secret_access_key=..., is_secure=..., port=..., proxy=..., proxy_port=..., proxy_user=..., proxy_pass=..., debug=..., https_connection_factory=..., region=..., path=..., security_token=..., validate_certs=..., profile_name=...) -> None: ... + def build_list_params(self, params, items, label): ... + def get_all_load_balancers(self, load_balancer_names=..., marker=...): ... + def create_load_balancer(self, name, zones, listeners=..., subnets=..., security_groups=..., scheme=..., complex_listeners=...): ... + def create_load_balancer_listeners(self, name, listeners=..., complex_listeners=...): ... + def delete_load_balancer(self, name): ... + def delete_load_balancer_listeners(self, name, ports): ... + def enable_availability_zones(self, load_balancer_name, zones_to_add): ... + def disable_availability_zones(self, load_balancer_name, zones_to_remove): ... + def modify_lb_attribute(self, load_balancer_name, attribute, value): ... + def get_all_lb_attributes(self, load_balancer_name): ... + def get_lb_attribute(self, load_balancer_name, attribute): ... + def register_instances(self, load_balancer_name, instances): ... + def deregister_instances(self, load_balancer_name, instances): ... + def describe_instance_health(self, load_balancer_name, instances=...): ... + def configure_health_check(self, name, health_check): ... + def set_lb_listener_SSL_certificate(self, lb_name, lb_port, ssl_certificate_id): ... + def create_app_cookie_stickiness_policy(self, name, lb_name, policy_name): ... + def create_lb_cookie_stickiness_policy(self, cookie_expiration_period, lb_name, policy_name): ... + def create_lb_policy(self, lb_name, policy_name, policy_type, policy_attributes): ... + def delete_lb_policy(self, lb_name, policy_name): ... + def set_lb_policies_of_listener(self, lb_name, lb_port, policies): ... + def set_lb_policies_of_backend_server(self, lb_name, instance_port, policies): ... + def apply_security_groups_to_lb(self, name, security_groups): ... + def attach_lb_to_subnets(self, name, subnets): ... + def detach_lb_from_subnets(self, name, subnets): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/exception.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/exception.pyi new file mode 100644 index 00000000..e83a0740 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/exception.pyi @@ -0,0 +1,146 @@ +from typing import Any, Optional +from boto.compat import StandardError + +class BotoClientError(StandardError): + reason: Any + def __init__(self, reason, *args) -> None: ... + +class SDBPersistenceError(StandardError): ... +class StoragePermissionsError(BotoClientError): ... +class S3PermissionsError(StoragePermissionsError): ... +class GSPermissionsError(StoragePermissionsError): ... + +class BotoServerError(StandardError): + status: Any + reason: Any + body: Any + request_id: Any + error_code: Any + message: str + box_usage: Any + def __init__(self, status, reason, body: Optional[Any] = ..., *args) -> None: ... + def __getattr__(self, name): ... + def __setattr__(self, name, value): ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class ConsoleOutput: + parent: Any + instance_id: Any + timestamp: Any + comment: Any + output: Any + def __init__(self, parent: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class StorageCreateError(BotoServerError): + bucket: Any + def __init__(self, status, reason, body: Optional[Any] = ...) -> None: ... + def endElement(self, name, value, connection): ... + +class S3CreateError(StorageCreateError): ... +class GSCreateError(StorageCreateError): ... +class StorageCopyError(BotoServerError): ... +class S3CopyError(StorageCopyError): ... +class GSCopyError(StorageCopyError): ... + +class SQSError(BotoServerError): + detail: Any + type: Any + def __init__(self, status, reason, body: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class SQSDecodeError(BotoClientError): + message: Any + def __init__(self, reason, message) -> None: ... + +class StorageResponseError(BotoServerError): + resource: Any + def __init__(self, status, reason, body: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class S3ResponseError(StorageResponseError): ... +class GSResponseError(StorageResponseError): ... + +class EC2ResponseError(BotoServerError): + errors: Any + def __init__(self, status, reason, body: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + request_id: Any + def endElement(self, name, value, connection): ... + +class JSONResponseError(BotoServerError): + status: Any + reason: Any + body: Any + error_message: Any + error_code: Any + def __init__(self, status, reason, body: Optional[Any] = ..., *args) -> None: ... + +class DynamoDBResponseError(JSONResponseError): ... +class SWFResponseError(JSONResponseError): ... +class EmrResponseError(BotoServerError): ... + +class _EC2Error: + connection: Any + error_code: Any + error_message: Any + def __init__(self, connection: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class SDBResponseError(BotoServerError): ... +class AWSConnectionError(BotoClientError): ... +class StorageDataError(BotoClientError): ... +class S3DataError(StorageDataError): ... +class GSDataError(StorageDataError): ... + +class InvalidUriError(Exception): + message: Any + def __init__(self, message) -> None: ... + +class InvalidAclError(Exception): + message: Any + def __init__(self, message) -> None: ... + +class InvalidCorsError(Exception): + message: Any + def __init__(self, message) -> None: ... + +class NoAuthHandlerFound(Exception): ... + +class InvalidLifecycleConfigError(Exception): + message: Any + def __init__(self, message) -> None: ... + +class ResumableTransferDisposition: + START_OVER: str + WAIT_BEFORE_RETRY: str + ABORT_CUR_PROCESS: str + ABORT: str + +class ResumableUploadException(Exception): + message: Any + disposition: Any + def __init__(self, message, disposition) -> None: ... + +class ResumableDownloadException(Exception): + message: Any + disposition: Any + def __init__(self, message, disposition) -> None: ... + +class TooManyRecordsException(Exception): + message: Any + def __init__(self, message) -> None: ... + +class PleaseRetryException(Exception): + message: Any + response: Any + def __init__(self, message, response: Optional[Any] = ...) -> None: ... + +class InvalidInstanceMetadataError(Exception): + MSG: str + def __init__(self, msg) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/kms/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/kms/__init__.pyi new file mode 100644 index 00000000..41fff607 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/kms/__init__.pyi @@ -0,0 +1,5 @@ +from typing import List +import boto.regioninfo + +def regions() -> List[boto.regioninfo.RegionInfo]: ... +def connect_to_region(region_name, **kw_params): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/kms/exceptions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/kms/exceptions.pyi new file mode 100644 index 00000000..5ac2ecd2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/kms/exceptions.pyi @@ -0,0 +1,17 @@ +from boto.exception import BotoServerError + +class InvalidGrantTokenException(BotoServerError): ... +class DisabledException(BotoServerError): ... +class LimitExceededException(BotoServerError): ... +class DependencyTimeoutException(BotoServerError): ... +class InvalidMarkerException(BotoServerError): ... +class AlreadyExistsException(BotoServerError): ... +class InvalidCiphertextException(BotoServerError): ... +class KeyUnavailableException(BotoServerError): ... +class InvalidAliasNameException(BotoServerError): ... +class UnsupportedOperationException(BotoServerError): ... +class InvalidArnException(BotoServerError): ... +class KMSInternalException(BotoServerError): ... +class InvalidKeyUsageException(BotoServerError): ... +class MalformedPolicyDocumentException(BotoServerError): ... +class NotFoundException(BotoServerError): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/kms/layer1.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/kms/layer1.pyi new file mode 100644 index 00000000..f48ce665 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/kms/layer1.pyi @@ -0,0 +1,37 @@ +from typing import Any, Dict, List, Mapping, Optional, Type +from boto.connection import AWSQueryConnection + +class KMSConnection(AWSQueryConnection): + APIVersion: str + DefaultRegionName: str + DefaultRegionEndpoint: str + ServiceName: str + TargetPrefix: str + ResponseError: Type[Exception] + region: Any + def __init__(self, **kwargs) -> None: ... + def create_alias(self, alias_name: str, target_key_id: str) -> Optional[Dict[str, Any]]: ... + def create_grant(self, key_id: str, grantee_principal: str, retiring_principal: Optional[str] = ..., operations: Optional[List[str]] = ..., constraints: Optional[Dict[str, Dict[str, str]]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def create_key(self, policy: Optional[str] = ..., description: Optional[str] = ..., key_usage: Optional[str] = ...) -> Optional[Dict[str, Any]]: ... + def decrypt(self, ciphertext_blob: bytes, encryption_context: Optional[Mapping[str, Any]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def delete_alias(self, alias_name: str) -> Optional[Dict[str, Any]]: ... + def describe_key(self, key_id: str) -> Optional[Dict[str, Any]]: ... + def disable_key(self, key_id: str) -> Optional[Dict[str, Any]]: ... + def disable_key_rotation(self, key_id: str) -> Optional[Dict[str, Any]]: ... + def enable_key(self, key_id: str) -> Optional[Dict[str, Any]]: ... + def enable_key_rotation(self, key_id: str) -> Optional[Dict[str, Any]]: ... + def encrypt(self, key_id: str, plaintext: bytes, encryption_context: Optional[Mapping[str, Any]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def generate_data_key(self, key_id: str, encryption_context: Optional[Mapping[str, Any]] = ..., number_of_bytes: Optional[int] = ..., key_spec: Optional[str] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def generate_data_key_without_plaintext(self, key_id: str, encryption_context: Optional[Mapping[str, Any]] = ..., key_spec: Optional[str] = ..., number_of_bytes: Optional[int] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def generate_random(self, number_of_bytes: Optional[int] = ...) -> Optional[Dict[str, Any]]: ... + def get_key_policy(self, key_id: str, policy_name: str) -> Optional[Dict[str, Any]]: ... + def get_key_rotation_status(self, key_id: str) -> Optional[Dict[str, Any]]: ... + def list_aliases(self, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ... + def list_grants(self, key_id: str, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ... + def list_key_policies(self, key_id: str, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ... + def list_keys(self, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ... + def put_key_policy(self, key_id: str, policy_name: str, policy: str) -> Optional[Dict[str, Any]]: ... + def re_encrypt(self, ciphertext_blob: bytes, destination_key_id: str, source_encryption_context: Optional[Mapping[str, Any]] = ..., destination_encryption_context: Optional[Mapping[str, Any]] = ..., grant_tokens: Optional[List[str]] = ...) -> Optional[Dict[str, Any]]: ... + def retire_grant(self, grant_token: str) -> Optional[Dict[str, Any]]: ... + def revoke_grant(self, key_id: str, grant_id: str) -> Optional[Dict[str, Any]]: ... + def update_key_description(self, key_id: str, description: str) -> Optional[Dict[str, Any]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/plugin.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/plugin.pyi new file mode 100644 index 00000000..e7d5f1bc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/plugin.pyi @@ -0,0 +1,9 @@ +from typing import Any, Optional + +class Plugin: + capability: Any + @classmethod + def is_capable(cls, requested_capability): ... + +def get_plugin(cls, requested_capability: Optional[Any] = ...): ... +def load_plugins(config): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/regioninfo.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/regioninfo.pyi new file mode 100644 index 00000000..525b5655 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/regioninfo.pyi @@ -0,0 +1,16 @@ +from typing import Any, Optional + +def load_endpoint_json(path): ... +def merge_endpoints(defaults, additions): ... +def load_regions(): ... +def get_regions(service_name, region_cls: Optional[Any] = ..., connection_cls: Optional[Any] = ...): ... + +class RegionInfo: + connection: Any + name: Any + endpoint: Any + connection_cls: Any + def __init__(self, connection: Optional[Any] = ..., name: Optional[Any] = ..., endpoint: Optional[Any] = ..., connection_cls: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def connect(self, **kw_params): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/__init__.pyi new file mode 100644 index 00000000..d88955e0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/__init__.pyi @@ -0,0 +1,14 @@ +from typing import Optional + +from .connection import S3Connection + +from boto.connection import AWSAuthConnection +from boto.regioninfo import RegionInfo + +from typing import List, Type, Text + +class S3RegionInfo(RegionInfo): + def connect(self, name: Optional[Text] = ..., endpoint: Optional[str] = ..., connection_cls: Optional[Type[AWSAuthConnection]] = ..., **kw_params) -> S3Connection: ... + +def regions() -> List[S3RegionInfo]: ... +def connect_to_region(region_name: Text, **kw_params): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/acl.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/acl.pyi new file mode 100644 index 00000000..168f914a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/acl.pyi @@ -0,0 +1,39 @@ +from .connection import S3Connection +from .user import User +from typing import Any, Dict, Optional, List, Text, Union + +CannedACLStrings: List[str] + +class Policy: + parent: Any + namespace: Any + acl: ACL + def __init__(self, parent: Optional[Any] = ...) -> None: ... + owner: User + def startElement(self, name: Text, attrs: Dict[str, Any], connection: S3Connection) -> Union[None, User, ACL]: ... + def endElement(self, name: Text, value: Any, connection: S3Connection) -> None: ... + def to_xml(self) -> str: ... + +class ACL: + policy: Policy + grants: List[Grant] + def __init__(self, policy: Optional[Policy] = ...) -> None: ... + def add_grant(self, grant: Grant) -> None: ... + def add_email_grant(self, permission: Text, email_address: Text) -> None: ... + def add_user_grant(self, permission: Text, user_id: Text, display_name: Optional[Text] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name: Text, value: Any, connection: S3Connection) -> None: ... + def to_xml(self) -> str: ... + +class Grant: + NameSpace: Text + permission: Text + id: Text + display_name: Text + uri: Text + email_address: Text + type: Text + def __init__(self, permission: Optional[Text] = ..., type: Optional[Text] = ..., id: Optional[Text] = ..., display_name: Optional[Text] = ..., uri: Optional[Text] = ..., email_address: Optional[Text] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name: Text, value: Any, connection: S3Connection) -> None: ... + def to_xml(self) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucket.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucket.pyi new file mode 100644 index 00000000..daed5021 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucket.pyi @@ -0,0 +1,94 @@ +from .bucketlistresultset import BucketListResultSet +from .connection import S3Connection +from .key import Key + +from typing import Any, Dict, Optional, Text, Type, List + +class S3WebsiteEndpointTranslate: + trans_region: Dict[str, str] + @classmethod + def translate_region(self, reg: Text) -> str: ... + +S3Permissions: List[str] + +class Bucket: + LoggingGroup: str + BucketPaymentBody: str + VersioningBody: str + VersionRE: str + MFADeleteRE: str + name: Text + connection: S3Connection + key_class: Type[Key] + def __init__(self, connection: Optional[S3Connection] = ..., name: Optional[Text] = ..., key_class: Type[Key] = ...) -> None: ... + def __iter__(self): ... + def __contains__(self, key_name) -> bool: ... + def startElement(self, name, attrs, connection): ... + creation_date: Any + def endElement(self, name, value, connection): ... + def set_key_class(self, key_class): ... + def lookup(self, key_name, headers: Optional[Dict[Text, Text]] = ...): ... + def get_key(self, key_name, headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., response_headers: Optional[Dict[Text, Text]] = ..., validate: bool = ...) -> Key: ... + def list(self, prefix: Text = ..., delimiter: Text = ..., marker: Text = ..., headers: Optional[Dict[Text, Text]] = ..., encoding_type: Optional[Any] = ...) -> BucketListResultSet: ... + def list_versions(self, prefix: str = ..., delimiter: str = ..., key_marker: str = ..., version_id_marker: str = ..., headers: Optional[Dict[Text, Text]] = ..., encoding_type: Optional[Text] = ...) -> BucketListResultSet: ... + def list_multipart_uploads(self, key_marker: str = ..., upload_id_marker: str = ..., headers: Optional[Dict[Text, Text]] = ..., encoding_type: Optional[Any] = ...): ... + def validate_kwarg_names(self, kwargs, names): ... + def get_all_keys(self, headers: Optional[Dict[Text, Text]] = ..., **params): ... + def get_all_versions(self, headers: Optional[Dict[Text, Text]] = ..., **params): ... + def validate_get_all_versions_params(self, params): ... + def get_all_multipart_uploads(self, headers: Optional[Dict[Text, Text]] = ..., **params): ... + def new_key(self, key_name: Optional[Any] = ...): ... + def generate_url(self, expires_in, method: str = ..., headers: Optional[Dict[Text, Text]] = ..., force_http: bool = ..., response_headers: Optional[Dict[Text, Text]] = ..., expires_in_absolute: bool = ...): ... + def delete_keys(self, keys, quiet: bool = ..., mfa_token: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def delete_key(self, key_name, headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., mfa_token: Optional[Any] = ...): ... + def copy_key(self, new_key_name, src_bucket_name, src_key_name, metadata: Optional[Any] = ..., src_version_id: Optional[Any] = ..., storage_class: str = ..., preserve_acl: bool = ..., encrypt_key: bool = ..., headers: Optional[Dict[Text, Text]] = ..., query_args: Optional[Any] = ...): ... + def set_canned_acl(self, acl_str, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def get_xml_acl(self, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def set_xml_acl(self, acl_str, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., query_args: str = ...): ... + def set_acl(self, acl_or_str, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def get_acl(self, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def set_subresource(self, subresource, value, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def get_subresource(self, subresource, key_name: str = ..., headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ...): ... + def make_public(self, recursive: bool = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def add_email_grant(self, permission, email_address, recursive: bool = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def add_user_grant(self, permission, user_id, recursive: bool = ..., headers: Optional[Dict[Text, Text]] = ..., display_name: Optional[Any] = ...): ... + def list_grants(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_location(self): ... + def set_xml_logging(self, logging_str, headers: Optional[Dict[Text, Text]] = ...): ... + def enable_logging(self, target_bucket, target_prefix: str = ..., grants: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def disable_logging(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_logging_status(self, headers: Optional[Dict[Text, Text]] = ...): ... + def set_as_logging_target(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_request_payment(self, headers: Optional[Dict[Text, Text]] = ...): ... + def set_request_payment(self, payer: str = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def configure_versioning(self, versioning, mfa_delete: bool = ..., mfa_token: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def get_versioning_status(self, headers: Optional[Dict[Text, Text]] = ...): ... + def configure_lifecycle(self, lifecycle_config, headers: Optional[Dict[Text, Text]] = ...): ... + def get_lifecycle_config(self, headers: Optional[Dict[Text, Text]] = ...): ... + def delete_lifecycle_configuration(self, headers: Optional[Dict[Text, Text]] = ...): ... + def configure_website(self, suffix: Optional[Any] = ..., error_key: Optional[Any] = ..., redirect_all_requests_to: Optional[Any] = ..., routing_rules: Optional[Any] = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def set_website_configuration(self, config, headers: Optional[Dict[Text, Text]] = ...): ... + def set_website_configuration_xml(self, xml, headers: Optional[Dict[Text, Text]] = ...): ... + def get_website_configuration(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_website_configuration_obj(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_website_configuration_with_xml(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_website_configuration_xml(self, headers: Optional[Dict[Text, Text]] = ...): ... + def delete_website_configuration(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_website_endpoint(self): ... + def get_policy(self, headers: Optional[Dict[Text, Text]] = ...): ... + def set_policy(self, policy, headers: Optional[Dict[Text, Text]] = ...): ... + def delete_policy(self, headers: Optional[Dict[Text, Text]] = ...): ... + def set_cors_xml(self, cors_xml, headers: Optional[Dict[Text, Text]] = ...): ... + def set_cors(self, cors_config, headers: Optional[Dict[Text, Text]] = ...): ... + def get_cors_xml(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_cors(self, headers: Optional[Dict[Text, Text]] = ...): ... + def delete_cors(self, headers: Optional[Dict[Text, Text]] = ...): ... + def initiate_multipart_upload(self, key_name, headers: Optional[Dict[Text, Text]] = ..., reduced_redundancy: bool = ..., metadata: Optional[Any] = ..., encrypt_key: bool = ..., policy: Optional[Any] = ...): ... + def complete_multipart_upload(self, key_name, upload_id, xml_body, headers: Optional[Dict[Text, Text]] = ...): ... + def cancel_multipart_upload(self, key_name, upload_id, headers: Optional[Dict[Text, Text]] = ...): ... + def delete(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_tags(self): ... + def get_xml_tags(self): ... + def set_xml_tags(self, tag_str, headers: Optional[Dict[Text, Text]] = ..., query_args: str = ...): ... + def set_tags(self, tags, headers: Optional[Dict[Text, Text]] = ...): ... + def delete_tags(self, headers: Optional[Dict[Text, Text]] = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlistresultset.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlistresultset.pyi new file mode 100644 index 00000000..b33d84d9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlistresultset.pyi @@ -0,0 +1,40 @@ +from .bucket import Bucket +from .key import Key + +from typing import Any, Iterable, Iterator, Optional + +def bucket_lister(bucket, prefix: str = ..., delimiter: str = ..., marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...): ... + +class BucketListResultSet(Iterable[Key]): + bucket: Any + prefix: Any + delimiter: Any + marker: Any + headers: Any + encoding_type: Any + def __init__(self, bucket: Optional[Any] = ..., prefix: str = ..., delimiter: str = ..., marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...) -> None: ... + def __iter__(self) -> Iterator[Key]: ... + +def versioned_bucket_lister(bucket, prefix: str = ..., delimiter: str = ..., key_marker: str = ..., version_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...): ... + +class VersionedBucketListResultSet: + bucket: Any + prefix: Any + delimiter: Any + key_marker: Any + version_id_marker: Any + headers: Any + encoding_type: Any + def __init__(self, bucket: Optional[Any] = ..., prefix: str = ..., delimiter: str = ..., key_marker: str = ..., version_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...) -> None: ... + def __iter__(self) -> Iterator[Key]: ... + +def multipart_upload_lister(bucket, key_marker: str = ..., upload_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...): ... + +class MultiPartUploadListResultSet: + bucket: Any + key_marker: Any + upload_id_marker: Any + headers: Any + encoding_type: Any + def __init__(self, bucket: Optional[Any] = ..., key_marker: str = ..., upload_id_marker: str = ..., headers: Optional[Any] = ..., encoding_type: Optional[Any] = ...) -> None: ... + def __iter__(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlogging.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlogging.pyi new file mode 100644 index 00000000..4eaa1abc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/bucketlogging.pyi @@ -0,0 +1,11 @@ +from typing import Any, Optional + +class BucketLogging: + target: Any + prefix: Any + grants: Any + def __init__(self, target: Optional[Any] = ..., prefix: Optional[Any] = ..., grants: Optional[Any] = ...) -> None: ... + def add_grant(self, grant): ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/connection.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/connection.pyi new file mode 100644 index 00000000..9148e683 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/connection.pyi @@ -0,0 +1,67 @@ +from .bucket import Bucket + +from typing import Any, Dict, Optional, Text, Type +from boto.connection import AWSAuthConnection +from boto.exception import BotoClientError + +def check_lowercase_bucketname(n): ... +def assert_case_insensitive(f): ... + +class _CallingFormat: + def get_bucket_server(self, server, bucket): ... + def build_url_base(self, connection, protocol, server, bucket, key: str = ...): ... + def build_host(self, server, bucket): ... + def build_auth_path(self, bucket, key: str = ...): ... + def build_path_base(self, bucket, key: str = ...): ... + +class SubdomainCallingFormat(_CallingFormat): + def get_bucket_server(self, server, bucket): ... + +class VHostCallingFormat(_CallingFormat): + def get_bucket_server(self, server, bucket): ... + +class OrdinaryCallingFormat(_CallingFormat): + def get_bucket_server(self, server, bucket): ... + def build_path_base(self, bucket, key: str = ...): ... + +class ProtocolIndependentOrdinaryCallingFormat(OrdinaryCallingFormat): + def build_url_base(self, connection, protocol, server, bucket, key: str = ...): ... + +class Location: + DEFAULT: str + EU: str + EUCentral1: str + USWest: str + USWest2: str + SAEast: str + APNortheast: str + APSoutheast: str + APSoutheast2: str + CNNorth1: str + +class NoHostProvided: ... +class HostRequiredError(BotoClientError): ... + +class S3Connection(AWSAuthConnection): + DefaultHost: Any + DefaultCallingFormat: Any + QueryString: str + calling_format: Any + bucket_class: Type[Bucket] + anon: Any + def __init__(self, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., port: Optional[Any] = ..., proxy: Optional[Any] = ..., proxy_port: Optional[Any] = ..., proxy_user: Optional[Any] = ..., proxy_pass: Optional[Any] = ..., host: Any = ..., debug: int = ..., https_connection_factory: Optional[Any] = ..., calling_format: Any = ..., path: str = ..., provider: str = ..., bucket_class: Type[Bucket] = ..., security_token: Optional[Any] = ..., suppress_consec_slashes: bool = ..., anon: bool = ..., validate_certs: Optional[Any] = ..., profile_name: Optional[Any] = ...) -> None: ... + def __iter__(self): ... + def __contains__(self, bucket_name): ... + def set_bucket_class(self, bucket_class: Type[Bucket]) -> None: ... + def build_post_policy(self, expiration_time, conditions): ... + def build_post_form_args(self, bucket_name, key, expires_in: int = ..., acl: Optional[Any] = ..., success_action_redirect: Optional[Any] = ..., max_content_length: Optional[Any] = ..., http_method: str = ..., fields: Optional[Any] = ..., conditions: Optional[Any] = ..., storage_class: str = ..., server_side_encryption: Optional[Any] = ...): ... + def generate_url_sigv4(self, expires_in, method, bucket: str = ..., key: str = ..., headers: Optional[Dict[Text, Text]] = ..., force_http: bool = ..., response_headers: Optional[Dict[Text, Text]] = ..., version_id: Optional[Any] = ..., iso_date: Optional[Any] = ...): ... + def generate_url(self, expires_in, method, bucket: str = ..., key: str = ..., headers: Optional[Dict[Text, Text]] = ..., query_auth: bool = ..., force_http: bool = ..., response_headers: Optional[Dict[Text, Text]] = ..., expires_in_absolute: bool = ..., version_id: Optional[Any] = ...): ... + def get_all_buckets(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_canonical_user_id(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_bucket(self, bucket_name: Text, validate: bool = ..., headers: Optional[Dict[Text, Text]] = ...) -> Bucket: ... + def head_bucket(self, bucket_name, headers: Optional[Dict[Text, Text]] = ...): ... + def lookup(self, bucket_name, validate: bool = ..., headers: Optional[Dict[Text, Text]] = ...): ... + def create_bucket(self, bucket_name, headers: Optional[Dict[Text, Text]] = ..., location: Any = ..., policy: Optional[Any] = ...): ... + def delete_bucket(self, bucket, headers: Optional[Dict[Text, Text]] = ...): ... + def make_request(self, method, bucket: str = ..., key: str = ..., headers: Optional[Any] = ..., data: str = ..., query_args: Optional[Any] = ..., sender: Optional[Any] = ..., override_num_retries: Optional[Any] = ..., retry_handler: Optional[Any] = ..., *args, **kwargs): ... # type: ignore # https://github.com/python/mypy/issues/1237 diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/cors.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/cors.pyi new file mode 100644 index 00000000..af34ab81 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/cors.pyi @@ -0,0 +1,19 @@ +from typing import Any, List, Optional + +class CORSRule: + allowed_method: Any + allowed_origin: Any + id: Any + allowed_header: Any + max_age_seconds: Any + expose_header: Any + def __init__(self, allowed_method: Optional[Any] = ..., allowed_origin: Optional[Any] = ..., id: Optional[Any] = ..., allowed_header: Optional[Any] = ..., max_age_seconds: Optional[Any] = ..., expose_header: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self) -> str: ... + +class CORSConfiguration(List[CORSRule]): + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self) -> str: ... + def add_rule(self, allowed_method, allowed_origin, id: Optional[Any] = ..., allowed_header: Optional[Any] = ..., max_age_seconds: Optional[Any] = ..., expose_header: Optional[Any] = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/deletemarker.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/deletemarker.pyi new file mode 100644 index 00000000..b2955c01 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/deletemarker.pyi @@ -0,0 +1,12 @@ +from typing import Any, Optional + +class DeleteMarker: + bucket: Any + name: Any + version_id: Any + is_latest: bool + last_modified: Any + owner: Any + def __init__(self, bucket: Optional[Any] = ..., name: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/key.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/key.pyi new file mode 100644 index 00000000..4200e7ab --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/key.pyi @@ -0,0 +1,232 @@ +from typing import Any, Callable, Dict, Optional, Text, Union, overload + +class Key: + DefaultContentType: str + RestoreBody: str + BufferSize: Any + base_user_settable_fields: Any + base_fields: Any + bucket: Any + name: str + metadata: Any + cache_control: Any + content_type: Any + content_encoding: Any + content_disposition: Any + content_language: Any + filename: Any + etag: Any + is_latest: bool + last_modified: Any + owner: Any + path: Any + resp: Any + mode: Any + size: Any + version_id: Any + source_version_id: Any + delete_marker: bool + encrypted: Any + ongoing_restore: Any + expiry_date: Any + local_hashes: Any + def __init__(self, bucket: Optional[Any] = ..., name: Optional[Any] = ...) -> None: ... + def __iter__(self): ... + @property + def provider(self): ... + key: Any + md5: Any + base64md5: Any + storage_class: Any + def get_md5_from_hexdigest(self, md5_hexdigest): ... + def handle_encryption_headers(self, resp): ... + def handle_version_headers(self, resp, force: bool = ...): ... + def handle_restore_headers(self, response): ... + def handle_addl_headers(self, headers): ... + def open_read( + self, + headers: Optional[Dict[Text, Text]] = ..., + query_args: str = ..., + override_num_retries: Optional[Any] = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + ): ... + def open_write(self, headers: Optional[Dict[Text, Text]] = ..., override_num_retries: Optional[Any] = ...): ... + def open( + self, + mode: str = ..., + headers: Optional[Dict[Text, Text]] = ..., + query_args: Optional[Any] = ..., + override_num_retries: Optional[Any] = ..., + ): ... + closed: bool + def close(self, fast: bool = ...): ... + def next(self): ... + __next__: Any + def read(self, size: int = ...): ... + def change_storage_class(self, new_storage_class, dst_bucket: Optional[Any] = ..., validate_dst_bucket: bool = ...): ... + def copy( + self, + dst_bucket, + dst_key, + metadata: Optional[Any] = ..., + reduced_redundancy: bool = ..., + preserve_acl: bool = ..., + encrypt_key: bool = ..., + validate_dst_bucket: bool = ..., + ): ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def exists(self, headers: Optional[Dict[Text, Text]] = ...): ... + def delete(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_metadata(self, name): ... + def set_metadata(self, name, value): ... + def update_metadata(self, d): ... + def set_acl(self, acl_str, headers: Optional[Dict[Text, Text]] = ...): ... + def get_acl(self, headers: Optional[Dict[Text, Text]] = ...): ... + def get_xml_acl(self, headers: Optional[Dict[Text, Text]] = ...): ... + def set_xml_acl(self, acl_str, headers: Optional[Dict[Text, Text]] = ...): ... + def set_canned_acl(self, acl_str, headers: Optional[Dict[Text, Text]] = ...): ... + def get_redirect(self): ... + def set_redirect(self, redirect_location, headers: Optional[Dict[Text, Text]] = ...): ... + def make_public(self, headers: Optional[Dict[Text, Text]] = ...): ... + def generate_url( + self, + expires_in, + method: str = ..., + headers: Optional[Dict[Text, Text]] = ..., + query_auth: bool = ..., + force_http: bool = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + expires_in_absolute: bool = ..., + version_id: Optional[Any] = ..., + policy: Optional[Any] = ..., + reduced_redundancy: bool = ..., + encrypt_key: bool = ..., + ): ... + def send_file( + self, + fp, + headers: Optional[Dict[Text, Text]] = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + query_args: Optional[Any] = ..., + chunked_transfer: bool = ..., + size: Optional[Any] = ..., + ): ... + def should_retry(self, response, chunked_transfer: bool = ...): ... + def compute_md5(self, fp, size: Optional[Any] = ...): ... + def set_contents_from_stream( + self, + fp, + headers: Optional[Dict[Text, Text]] = ..., + replace: bool = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + policy: Optional[Any] = ..., + reduced_redundancy: bool = ..., + query_args: Optional[Any] = ..., + size: Optional[Any] = ..., + ): ... + def set_contents_from_file( + self, + fp, + headers: Optional[Dict[Text, Text]] = ..., + replace: bool = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + policy: Optional[Any] = ..., + md5: Optional[Any] = ..., + reduced_redundancy: bool = ..., + query_args: Optional[Any] = ..., + encrypt_key: bool = ..., + size: Optional[Any] = ..., + rewind: bool = ..., + ): ... + def set_contents_from_filename( + self, + filename, + headers: Optional[Dict[Text, Text]] = ..., + replace: bool = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + policy: Optional[Any] = ..., + md5: Optional[Any] = ..., + reduced_redundancy: bool = ..., + encrypt_key: bool = ..., + ): ... + def set_contents_from_string( + self, + string_data: Union[Text, bytes], + headers: Optional[Dict[Text, Text]] = ..., + replace: bool = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + policy: Optional[Any] = ..., + md5: Optional[Any] = ..., + reduced_redundancy: bool = ..., + encrypt_key: bool = ..., + ) -> None: ... + def get_file( + self, + fp, + headers: Optional[Dict[Text, Text]] = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + torrent: bool = ..., + version_id: Optional[Any] = ..., + override_num_retries: Optional[Any] = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + ): ... + def get_torrent_file( + self, fp, headers: Optional[Dict[Text, Text]] = ..., cb: Optional[Callable[[int, int], Any]] = ..., num_cb: int = ... + ): ... + def get_contents_to_file( + self, + fp, + headers: Optional[Dict[Text, Text]] = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + torrent: bool = ..., + version_id: Optional[Any] = ..., + res_download_handler: Optional[Any] = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + ): ... + def get_contents_to_filename( + self, + filename, + headers: Optional[Dict[Text, Text]] = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + torrent: bool = ..., + version_id: Optional[Any] = ..., + res_download_handler: Optional[Any] = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + ): ... + @overload + def get_contents_as_string( + self, + headers: Optional[Dict[Text, Text]] = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + torrent: bool = ..., + version_id: Optional[Any] = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + encoding: None = ..., + ) -> bytes: ... + @overload + def get_contents_as_string( + self, + headers: Optional[Dict[Text, Text]] = ..., + cb: Optional[Callable[[int, int], Any]] = ..., + num_cb: int = ..., + torrent: bool = ..., + version_id: Optional[Any] = ..., + response_headers: Optional[Dict[Text, Text]] = ..., + *, encoding: Text, + ) -> Text: ... + def add_email_grant(self, permission, email_address, headers: Optional[Dict[Text, Text]] = ...): ... + def add_user_grant( + self, permission, user_id, headers: Optional[Dict[Text, Text]] = ..., display_name: Optional[Any] = ... + ): ... + def set_remote_metadata(self, metadata_plus, metadata_minus, preserve_acl, headers: Optional[Dict[Text, Text]] = ...): ... + def restore(self, days, headers: Optional[Dict[Text, Text]] = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/keyfile.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/keyfile.pyi new file mode 100644 index 00000000..121da165 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/keyfile.pyi @@ -0,0 +1,29 @@ +from typing import Any + +class KeyFile: + key: Any + location: int + closed: bool + softspace: int + mode: str + encoding: str + errors: str + newlines: str + name: Any + def __init__(self, key) -> None: ... + def tell(self): ... + def seek(self, pos, whence: Any = ...): ... + def read(self, size): ... + def close(self): ... + def isatty(self): ... + def getkey(self): ... + def write(self, buf): ... + def fileno(self): ... + def flush(self): ... + def next(self): ... + def readinto(self): ... + def readline(self): ... + def readlines(self): ... + def truncate(self): ... + def writelines(self): ... + def xreadlines(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/lifecycle.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/lifecycle.pyi new file mode 100644 index 00000000..fb42bb20 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/lifecycle.pyi @@ -0,0 +1,51 @@ +from typing import Any, List, Optional + +class Rule: + id: Any + prefix: Any + status: Any + expiration: Any + transition: Any + def __init__(self, id: Optional[Any] = ..., prefix: Optional[Any] = ..., status: Optional[Any] = ..., expiration: Optional[Any] = ..., transition: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + +class Expiration: + days: Any + date: Any + def __init__(self, days: Optional[Any] = ..., date: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + +class Transition: + days: Any + date: Any + storage_class: Any + def __init__(self, days: Optional[Any] = ..., date: Optional[Any] = ..., storage_class: Optional[Any] = ...) -> None: ... + def to_xml(self): ... + +class Transitions(List[Transition]): + transition_properties: int + current_transition_property: int + temp_days: Any + temp_date: Any + temp_storage_class: Any + def __init__(self) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + def add_transition(self, days: Optional[Any] = ..., date: Optional[Any] = ..., storage_class: Optional[Any] = ...): ... + @property + def days(self): ... + @property + def date(self): ... + @property + def storage_class(self): ... + +class Lifecycle(List[Rule]): + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + def add_rule(self, id: Optional[Any] = ..., prefix: str = ..., status: str = ..., expiration: Optional[Any] = ..., transition: Optional[Any] = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/multidelete.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/multidelete.pyi new file mode 100644 index 00000000..fa0c8dd3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/multidelete.pyi @@ -0,0 +1,27 @@ +from typing import Any, Optional + +class Deleted: + key: Any + version_id: Any + delete_marker: Any + delete_marker_version_id: Any + def __init__(self, key: Optional[Any] = ..., version_id: Optional[Any] = ..., delete_marker: bool = ..., delete_marker_version_id: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class Error: + key: Any + version_id: Any + code: Any + message: Any + def __init__(self, key: Optional[Any] = ..., version_id: Optional[Any] = ..., code: Optional[Any] = ..., message: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class MultiDeleteResult: + bucket: Any + deleted: Any + errors: Any + def __init__(self, bucket: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/multipart.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/multipart.pyi new file mode 100644 index 00000000..8463c4dd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/multipart.pyi @@ -0,0 +1,49 @@ +from typing import Any, Optional + +class CompleteMultiPartUpload: + bucket: Any + location: Any + bucket_name: Any + key_name: Any + etag: Any + version_id: Any + encrypted: Any + def __init__(self, bucket: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +class Part: + bucket: Any + part_number: Any + last_modified: Any + etag: Any + size: Any + def __init__(self, bucket: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + +def part_lister(mpupload, part_number_marker: Optional[Any] = ...): ... + +class MultiPartUpload: + bucket: Any + bucket_name: Any + key_name: Any + id: Any + initiator: Any + owner: Any + storage_class: Any + initiated: Any + part_number_marker: Any + next_part_number_marker: Any + max_parts: Any + is_truncated: bool + def __init__(self, bucket: Optional[Any] = ...) -> None: ... + def __iter__(self): ... + def to_xml(self): ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def get_all_parts(self, max_parts: Optional[Any] = ..., part_number_marker: Optional[Any] = ..., encoding_type: Optional[Any] = ...): ... + def upload_part_from_file(self, fp, part_num, headers: Optional[Any] = ..., replace: bool = ..., cb: Optional[Any] = ..., num_cb: int = ..., md5: Optional[Any] = ..., size: Optional[Any] = ...): ... + def copy_part_from_key(self, src_bucket_name, src_key_name, part_num, start: Optional[Any] = ..., end: Optional[Any] = ..., src_version_id: Optional[Any] = ..., headers: Optional[Any] = ...): ... + def complete_upload(self): ... + def cancel_upload(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/prefix.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/prefix.pyi new file mode 100644 index 00000000..de8f3a34 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/prefix.pyi @@ -0,0 +1,10 @@ +from typing import Any, Optional + +class Prefix: + bucket: Any + name: Any + def __init__(self, bucket: Optional[Any] = ..., name: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + @property + def provider(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/tagging.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/tagging.pyi new file mode 100644 index 00000000..15553e7c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/tagging.pyi @@ -0,0 +1,22 @@ +from typing import Any, List, Optional + +class Tag: + key: Any + value: Any + def __init__(self, key: Optional[Any] = ..., value: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + def __eq__(self, other): ... + +class TagSet(List[Tag]): + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def add_tag(self, key, value): ... + def to_xml(self): ... + +class Tags(List[TagSet]): + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + def add_tag_set(self, tag_set): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/user.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/user.pyi new file mode 100644 index 00000000..c5cc11c6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/user.pyi @@ -0,0 +1,10 @@ +from typing import Any, Optional + +class User: + type: Any + id: Any + display_name: Any + def __init__(self, parent: Optional[Any] = ..., id: str = ..., display_name: str = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self, element_name: str = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/website.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/website.pyi new file mode 100644 index 00000000..6bc90471 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/s3/website.pyi @@ -0,0 +1,62 @@ +from typing import Any, List, Optional + +def tag(key, value): ... + +class WebsiteConfiguration: + suffix: Any + error_key: Any + redirect_all_requests_to: Any + routing_rules: Any + def __init__(self, suffix: Optional[Any] = ..., error_key: Optional[Any] = ..., redirect_all_requests_to: Optional[Any] = ..., routing_rules: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + +class _XMLKeyValue: + translator: Any + container: Any + def __init__(self, translator, container: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + +class RedirectLocation(_XMLKeyValue): + TRANSLATOR: Any + hostname: Any + protocol: Any + def __init__(self, hostname: Optional[Any] = ..., protocol: Optional[Any] = ...) -> None: ... + def to_xml(self): ... + +class RoutingRules(List[RoutingRule]): + def add_rule(self, rule: RoutingRule) -> RoutingRules: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + +class RoutingRule: + condition: Any + redirect: Any + def __init__(self, condition: Optional[Any] = ..., redirect: Optional[Any] = ...) -> None: ... + def startElement(self, name, attrs, connection): ... + def endElement(self, name, value, connection): ... + def to_xml(self): ... + @classmethod + def when(cls, key_prefix: Optional[Any] = ..., http_error_code: Optional[Any] = ...): ... + def then_redirect(self, hostname: Optional[Any] = ..., protocol: Optional[Any] = ..., replace_key: Optional[Any] = ..., replace_key_prefix: Optional[Any] = ..., http_redirect_code: Optional[Any] = ...): ... + +class Condition(_XMLKeyValue): + TRANSLATOR: Any + key_prefix: Any + http_error_code: Any + def __init__(self, key_prefix: Optional[Any] = ..., http_error_code: Optional[Any] = ...) -> None: ... + def to_xml(self): ... + +class Redirect(_XMLKeyValue): + TRANSLATOR: Any + hostname: Any + protocol: Any + replace_key: Any + replace_key_prefix: Any + http_redirect_code: Any + def __init__(self, hostname: Optional[Any] = ..., protocol: Optional[Any] = ..., replace_key: Optional[Any] = ..., replace_key_prefix: Optional[Any] = ..., http_redirect_code: Optional[Any] = ...) -> None: ... + def to_xml(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/utils.pyi new file mode 100644 index 00000000..7c927d83 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/boto/utils.pyi @@ -0,0 +1,239 @@ +import datetime +import logging.handlers +import subprocess +import sys +import time + +import boto.connection +from typing import ( + Any, + Callable, + ContextManager, + Dict, + IO, + Iterable, + List, + Mapping, + Optional, + Sequence, + Tuple, + Type, + TypeVar, + Union, +) + +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') + +if sys.version_info >= (3,): + # TODO move _StringIO definition into boto.compat once stubs exist and rename to StringIO + import io + _StringIO = io.StringIO + + from hashlib import _Hash + _HashType = _Hash + + from email.message import Message as _Message +else: + # TODO move _StringIO definition into boto.compat once stubs exist and rename to StringIO + import StringIO + _StringIO = StringIO.StringIO[Any] + + from hashlib import _hash + _HashType = _hash + + # TODO use email.message.Message once stubs exist + _Message = Any + +_Provider = Any # TODO replace this with boto.provider.Provider once stubs exist +_LockType = Any # TODO replace this with _thread.LockType once stubs exist + + +JSONDecodeError: Type[ValueError] +qsa_of_interest: List[str] + + +def unquote_v(nv: str) -> Union[str, Tuple[str, str]]: ... +def canonical_string( + method: str, + path: str, + headers: Mapping[str, Optional[str]], + expires: Optional[int] = ..., + provider: Optional[_Provider] = ..., +) -> str: ... +def merge_meta( + headers: Mapping[str, str], + metadata: Mapping[str, str], + provider: Optional[_Provider] = ..., +) -> Mapping[str, str]: ... +def get_aws_metadata( + headers: Mapping[str, str], + provider: Optional[_Provider] = ..., +) -> Mapping[str, str]: ... +def retry_url( + url: str, + retry_on_404: bool = ..., + num_retries: int = ..., + timeout: Optional[int] = ..., +) -> str: ... + +class LazyLoadMetadata(Dict[_KT, _VT]): + def __init__( + self, + url: str, + num_retries: int, + timeout: Optional[int] = ..., + ) -> None: ... + +def get_instance_metadata( + version: str = ..., + url: str = ..., + data: str = ..., + timeout: Optional[int] = ..., + num_retries: int = ..., +) -> Optional[LazyLoadMetadata[Any, Any]]: ... +def get_instance_identity( + version: str = ..., + url: str = ..., + timeout: Optional[int] = ..., + num_retries: int = ..., +) -> Optional[Mapping[str, Any]]: ... +def get_instance_userdata( + version: str = ..., + sep: Optional[str] = ..., + url: str = ..., + timeout: Optional[int] = ..., + num_retries: int = ..., +) -> Mapping[str, str]: ... + +ISO8601: str +ISO8601_MS: str +RFC1123: str +LOCALE_LOCK: _LockType + +def setlocale(name: Union[str, Tuple[str, str]]) -> ContextManager[str]: ... +def get_ts(ts: Optional[time.struct_time] = ...) -> str: ... +def parse_ts(ts: str) -> datetime.datetime: ... +def find_class(module_name: str, class_name: Optional[str] = ...) -> Optional[Type[Any]]: ... +def update_dme(username: str, password: str, dme_id: str, ip_address: str) -> str: ... +def fetch_file( + uri: str, + file: Optional[IO[str]] = ..., + username: Optional[str] = ..., + password: Optional[str] = ..., +) -> Optional[IO[str]]: ... + +class ShellCommand: + exit_code: int + command: subprocess._CMD + log_fp: _StringIO + wait: bool + fail_fast: bool + + def __init__( + self, + command: subprocess._CMD, + wait: bool = ..., + fail_fast: bool = ..., + cwd: Optional[subprocess._TXT] = ..., + ) -> None: ... + + process: subprocess.Popen[Any] + + def run(self, cwd: Optional[subprocess._CMD] = ...) -> Optional[int]: ... + def setReadOnly(self, value) -> None: ... + def getStatus(self) -> Optional[int]: ... + + status: Optional[int] + + def getOutput(self) -> str: ... + + output: str + +class AuthSMTPHandler(logging.handlers.SMTPHandler): + username: str + password: str + def __init__( + self, + mailhost: str, + username: str, + password: str, + fromaddr: str, + toaddrs: Sequence[str], + subject: str, + ) -> None: ... + +class LRUCache(Dict[_KT, _VT]): + class _Item: + previous: Optional[LRUCache._Item] + next: Optional[LRUCache._Item] + key = ... + value = ... + def __init__(self, key, value) -> None: ... + + _dict: Dict[_KT, LRUCache._Item] + capacity: int + head: Optional[LRUCache._Item] + tail: Optional[LRUCache._Item] + + def __init__(self, capacity: int) -> None: ... + + +# This exists to work around Password.str's name shadowing the str type +_str = str + +class Password: + hashfunc: Callable[[bytes], _HashType] + str: Optional[_str] + + def __init__( + self, + str: Optional[_str] = ..., + hashfunc: Optional[Callable[[bytes], _HashType]] = ..., + ) -> None: ... + def set(self, value: Union[bytes, _str]) -> None: ... + def __eq__(self, other: Any) -> bool: ... + def __len__(self) -> int: ... + +def notify( + subject: str, + body: Optional[str] = ..., + html_body: Optional[Union[Sequence[str], str]] = ..., + to_string: Optional[str] = ..., + attachments: Optional[Iterable[_Message]] = ..., + append_instance_id: bool = ..., +) -> None: ... +def get_utf8_value(value: str) -> bytes: ... +def mklist(value: Any) -> List[Any]: ... +def pythonize_name(name: str) -> str: ... +def write_mime_multipart( + content: List[Tuple[str, str]], + compress: bool = ..., + deftype: str = ..., + delimiter: str = ..., +) -> str: ... +def guess_mime_type(content: str, deftype: str) -> str: ... +def compute_md5( + fp: IO[Any], + buf_size: int = ..., + size: Optional[int] = ..., +) -> Tuple[str, str, int]: ... +def compute_hash( + fp: IO[Any], + buf_size: int = ..., + size: Optional[int] = ..., + hash_algorithm: Any = ..., +) -> Tuple[str, str, int]: ... +def find_matching_headers(name: str, headers: Mapping[str, Optional[str]]) -> List[str]: ... +def merge_headers_by_name(name: str, headers: Mapping[str, Optional[str]]) -> str: ... + +class RequestHook: + def handle_request_data( + self, + request: boto.connection.HTTPRequest, + response: boto.connection.HTTPResponse, + error: bool = ..., + ) -> Any: ... + +def host_is_ipv6(hostname: str) -> bool: ... +def parse_host(hostname: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/certifi.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/certifi.pyi new file mode 100644 index 00000000..b4b5ba7d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/certifi.pyi @@ -0,0 +1 @@ +def where() -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/characteristic/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/characteristic/__init__.pyi new file mode 100644 index 00000000..61c8c8a1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/characteristic/__init__.pyi @@ -0,0 +1,34 @@ +from typing import Sequence, Callable, Union, Any, Optional, AnyStr, TypeVar, Type, Dict + +def with_repr(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ... +def with_cmp(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ... +def with_init(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ... +def immutable(attrs: Sequence[Union[AnyStr, Attribute]]) -> Callable[..., Any]: ... + +def strip_leading_underscores(attribute_name: AnyStr) -> AnyStr: ... + +NOTHING = Any + +_T = TypeVar('_T') + +def attributes( + attrs: Sequence[Union[AnyStr, Attribute]], + apply_with_cmp: bool = ..., + apply_with_init: bool = ..., + apply_with_repr: bool = ..., + apply_immutable: bool = ..., + store_attributes: Optional[Callable[[type, Attribute], Any]] = ..., + **kw: Optional[Dict[Any, Any]]) -> Callable[[Type[_T]], Type[_T]]: ... + +class Attribute: + def __init__( + self, + name: AnyStr, + exclude_from_cmp: bool = ..., + exclude_from_init: bool = ..., + exclude_from_repr: bool = ..., + exclude_from_immutable: bool = ..., + default_value: Any = ..., + default_factory: Optional[Callable[[None], Any]] = ..., + instance_of: Optional[Any] = ..., + init_aliaser: Optional[Callable[[AnyStr], AnyStr]] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/__init__.pyi new file mode 100644 index 00000000..11eaa870 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/__init__.pyi @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +""" + click + ~~~~~ + + Click is a simple Python module that wraps the stdlib's optparse to make + writing command line scripts fun. Unlike other modules, it's based around + a simple API that does not come with too much magic and is composable. + + In case optparse ever gets removed from the stdlib, it will be shipped by + this module. + + :copyright: (c) 2014 by Armin Ronacher. + :license: BSD, see LICENSE for more details. +""" + +# Core classes +from .core import ( + Context as Context, + BaseCommand as BaseCommand, + Command as Command, + MultiCommand as MultiCommand, + Group as Group, + CommandCollection as CommandCollection, + Parameter as Parameter, + Option as Option, + Argument as Argument, +) + +# Globals +from .globals import get_current_context as get_current_context + +# Decorators +from .decorators import ( + pass_context as pass_context, + pass_obj as pass_obj, + make_pass_decorator as make_pass_decorator, + command as command, + group as group, + argument as argument, + option as option, + confirmation_option as confirmation_option, + password_option as password_option, + version_option as version_option, + help_option as help_option, +) + +# Types +from .types import ( + ParamType as ParamType, + File as File, + FloatRange as FloatRange, + DateTime as DateTime, + Path as Path, + Choice as Choice, + IntRange as IntRange, + Tuple as Tuple, + STRING as STRING, + INT as INT, + FLOAT as FLOAT, + BOOL as BOOL, + UUID as UUID, + UNPROCESSED as UNPROCESSED, +) + +# Utilities +from .utils import ( + echo as echo, + get_binary_stream as get_binary_stream, + get_text_stream as get_text_stream, + open_file as open_file, + format_filename as format_filename, + get_app_dir as get_app_dir, + get_os_args as get_os_args, +) + +# Terminal functions +from .termui import ( + prompt as prompt, + confirm as confirm, + get_terminal_size as get_terminal_size, + echo_via_pager as echo_via_pager, + progressbar as progressbar, + clear as clear, + style as style, + unstyle as unstyle, + secho as secho, + edit as edit, + launch as launch, + getchar as getchar, + pause as pause, +) + +# Exceptions +from .exceptions import ( + ClickException as ClickException, + UsageError as UsageError, + BadParameter as BadParameter, + FileError as FileError, + Abort as Abort, + NoSuchOption as NoSuchOption, + BadOptionUsage as BadOptionUsage, + BadArgumentUsage as BadArgumentUsage, + MissingParameter as MissingParameter, +) + +# Formatting +from .formatting import HelpFormatter as HelpFormatter, wrap_text as wrap_text + +# Parsing +from .parser import OptionParser as OptionParser + +# Controls if click should emit the warning about the use of unicode +# literals. +disable_unicode_literals_warning: bool + + +__version__: str diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/_termui_impl.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/_termui_impl.pyi new file mode 100644 index 00000000..f938c1c9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/_termui_impl.pyi @@ -0,0 +1,14 @@ +from typing import ContextManager, Iterator, Generic, TypeVar, Optional + +_T = TypeVar("_T") + +class ProgressBar(object, Generic[_T]): + def update(self, n_steps: int) -> None: ... + def finish(self) -> None: ... + def __enter__(self) -> ProgressBar[_T]: ... + def __exit__(self, exc_type, exc_value, tb) -> None: ... + def __iter__(self) -> ProgressBar[_T]: ... + def next(self) -> _T: ... + def __next__(self) -> _T: ... + length: Optional[int] + label: str diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/core.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/core.pyi new file mode 100644 index 00000000..b084f3d5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/core.pyi @@ -0,0 +1,480 @@ +from typing import ( + Any, + Callable, + ContextManager, + Dict, + Generator, + Iterable, + List, + Mapping, + NoReturn, + Optional, + Sequence, + Set, + Tuple, + TypeVar, + Union, +) + +from click.formatting import HelpFormatter +from click.parser import OptionParser + +_CC = TypeVar("_CC", bound=Callable[[], Any]) + +def invoke_param_callback( + callback: Callable[[Context, Parameter, Optional[str]], Any], + ctx: Context, + param: Parameter, + value: Optional[str] +) -> Any: + ... + + +def augment_usage_errors( + ctx: Context, param: Optional[Parameter] = ... +) -> ContextManager[None]: + ... + + +def iter_params_for_processing( + invocation_order: Sequence[Parameter], + declaration_order: Iterable[Parameter], +) -> Iterable[Parameter]: + ... + + +class Context: + parent: Optional[Context] + command: Command + info_name: Optional[str] + params: Dict[Any, Any] + args: List[str] + protected_args: List[str] + obj: Any + default_map: Optional[Mapping[str, Any]] + invoked_subcommand: Optional[str] + terminal_width: Optional[int] + max_content_width: Optional[int] + allow_extra_args: bool + allow_interspersed_args: bool + ignore_unknown_options: bool + help_option_names: List[str] + token_normalize_func: Optional[Callable[[str], str]] + resilient_parsing: bool + auto_envvar_prefix: Optional[str] + color: Optional[bool] + _meta: Dict[str, Any] + _close_callbacks: List[Any] + _depth: int + + def __init__( + self, + command: Command, + parent: Optional[Context] = ..., + info_name: Optional[str] = ..., + obj: Optional[Any] = ..., + auto_envvar_prefix: Optional[str] = ..., + default_map: Optional[Mapping[str, Any]] = ..., + terminal_width: Optional[int] = ..., + max_content_width: Optional[int] = ..., + resilient_parsing: bool = ..., + allow_extra_args: Optional[bool] = ..., + allow_interspersed_args: Optional[bool] = ..., + ignore_unknown_options: Optional[bool] = ..., + help_option_names: Optional[List[str]] = ..., + token_normalize_func: Optional[Callable[[str], str]] = ..., + color: Optional[bool] = ... + ) -> None: + ... + + @property + def meta(self) -> Dict[str, Any]: + ... + + @property + def command_path(self) -> str: + ... + + def scope(self, cleanup: bool = ...) -> ContextManager[Context]: + ... + + def make_formatter(self) -> HelpFormatter: + ... + + def call_on_close(self, f: _CC) -> _CC: ... + + def close(self) -> None: + ... + + def find_root(self) -> Context: + ... + + def find_object(self, object_type: type) -> Any: + ... + + def ensure_object(self, object_type: type) -> Any: + ... + + def lookup_default(self, name: str) -> Any: + ... + + def fail(self, message: str) -> NoReturn: + ... + + def abort(self) -> NoReturn: + ... + + def exit(self, code: Union[int, str] = ...) -> NoReturn: + ... + + def get_usage(self) -> str: + ... + + def get_help(self) -> str: + ... + + def invoke(self, callback: Union[Command, Callable[..., Any]], *args, **kwargs) -> Any: ... + def forward(self, callback: Union[Command, Callable[..., Any]], *args, **kwargs) -> Any: ... + +class BaseCommand: + allow_extra_args: bool + allow_interspersed_args: bool + ignore_unknown_options: bool + name: str + context_settings: Dict[Any, Any] + def __init__(self, name: str, context_settings: Optional[Dict[Any, Any]] = ...) -> None: ... + + def get_usage(self, ctx: Context) -> str: + ... + + def get_help(self, ctx: Context) -> str: + ... + + def make_context( + self, info_name: str, args: List[str], parent: Optional[Context] = ..., **extra + ) -> Context: + ... + + def parse_args(self, ctx: Context, args: List[str]) -> List[str]: + ... + + def invoke(self, ctx: Context) -> Any: + ... + + def main( + self, + args: Optional[List[str]] = ..., + prog_name: Optional[str] = ..., + complete_var: Optional[str] = ..., + standalone_mode: bool = ..., + **extra + ) -> Any: + ... + + def __call__(self, *args, **kwargs) -> Any: + ... + + +class Command(BaseCommand): + callback: Optional[Callable[..., Any]] + params: List[Parameter] + help: Optional[str] + epilog: Optional[str] + short_help: Optional[str] + options_metavar: str + add_help_option: bool + hidden: bool + deprecated: bool + + def __init__( + self, + name: str, + context_settings: Optional[Dict[Any, Any]] = ..., + callback: Optional[Callable[..., Any]] = ..., + params: Optional[List[Parameter]] = ..., + help: Optional[str] = ..., + epilog: Optional[str] = ..., + short_help: Optional[str] = ..., + options_metavar: str = ..., + add_help_option: bool = ..., + hidden: bool = ..., + deprecated: bool = ..., + ) -> None: + ... + + def get_params(self, ctx: Context) -> List[Parameter]: + ... + + def format_usage( + self, + ctx: Context, + formatter: HelpFormatter + ) -> None: + ... + + def collect_usage_pieces(self, ctx: Context) -> List[str]: + ... + + def get_help_option_names(self, ctx: Context) -> Set[str]: + ... + + def get_help_option(self, ctx: Context) -> Optional[Option]: + ... + + def make_parser(self, ctx: Context) -> OptionParser: + ... + + def get_short_help_str(self, limit: int = ...) -> str: + ... + + def format_help(self, ctx: Context, formatter: HelpFormatter) -> None: + ... + + def format_help_text(self, ctx: Context, formatter: HelpFormatter) -> None: + ... + + def format_options(self, ctx: Context, formatter: HelpFormatter) -> None: + ... + + def format_epilog(self, ctx: Context, formatter: HelpFormatter) -> None: + ... + + +_T = TypeVar('_T') +_F = TypeVar('_F', bound=Callable[..., Any]) + + +class MultiCommand(Command): + no_args_is_help: bool + invoke_without_command: bool + subcommand_metavar: str + chain: bool + result_callback: Callable[..., Any] + + def __init__( + self, + name: Optional[str] = ..., + invoke_without_command: bool = ..., + no_args_is_help: Optional[bool] = ..., + subcommand_metavar: Optional[str] = ..., + chain: bool = ..., + result_callback: Optional[Callable[..., Any]] = ..., + **attrs + ) -> None: + ... + + def resultcallback( + self, replace: bool = ... + ) -> Callable[[_F], _F]: + ... + + def format_commands(self, ctx: Context, formatter: HelpFormatter) -> None: + ... + + def resolve_command( + self, ctx: Context, args: List[str] + ) -> Tuple[str, Command, List[str]]: + ... + + def get_command(self, ctx: Context, cmd_name: str) -> Optional[Command]: + ... + + def list_commands(self, ctx: Context) -> Iterable[str]: + ... + + +class Group(MultiCommand): + commands: Dict[str, Command] + + def __init__( + self, name: Optional[str] = ..., commands: Optional[Dict[str, Command]] = ..., **attrs + ) -> None: + ... + + def add_command(self, cmd: Command, name: Optional[str] = ...): + ... + + def command(self, *args, **kwargs) -> Callable[[Callable[..., Any]], Command]: ... + def group(self, *args, **kwargs) -> Callable[[Callable[..., Any]], Group]: ... + + +class CommandCollection(MultiCommand): + sources: List[MultiCommand] + + def __init__( + self, name: Optional[str] = ..., sources: Optional[List[MultiCommand]] = ..., **attrs + ) -> None: + ... + + def add_source(self, multi_cmd: MultiCommand) -> None: + ... + + +class _ParamType: + name: str + is_composite: bool + envvar_list_splitter: Optional[str] + + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> Any: + ... + + def get_metavar(self, param: Parameter) -> str: + ... + + def get_missing_message(self, param: Parameter) -> str: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> Any: + ... + + def split_envvar_value(self, rv: str) -> List[str]: + ... + + def fail(self, message: str, param: Optional[Parameter] = ..., ctx: Optional[Context] = ...) -> NoReturn: + ... + + +# This type is here to resolve https://github.com/python/mypy/issues/5275 +_ConvertibleType = Union[type, _ParamType, Tuple[Union[type, _ParamType], ...], + Callable[[str], Any], Callable[[Optional[str]], Any]] + + +class Parameter: + param_type_name: str + name: str + opts: List[str] + secondary_opts: List[str] + type: _ParamType + required: bool + callback: Optional[Callable[[Context, Parameter, str], Any]] + nargs: int + multiple: bool + expose_value: bool + default: Any + is_eager: bool + metavar: Optional[str] + envvar: Union[str, List[str], None] + + def __init__( + self, + param_decls: Optional[List[str]] = ..., + type: Optional[_ConvertibleType] = ..., + required: bool = ..., + default: Optional[Any] = ..., + callback: Optional[Callable[[Context, Parameter, str], Any]] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ... + ) -> None: + ... + + @property + def human_readable_name(self) -> str: + ... + + def make_metavar(self) -> str: + ... + + def get_default(self, ctx: Context) -> Any: + ... + + def add_to_parser(self, parser: OptionParser, ctx: Context) -> None: + ... + + def consume_value(self, ctx: Context, opts: Dict[str, Any]) -> Any: + ... + + def type_cast_value(self, ctx: Context, value: Any) -> Any: + ... + + def process_value(self, ctx: Context, value: Any) -> Any: + ... + + def value_is_missing(self, value: Any) -> bool: + ... + + def full_process_value(self, ctx: Context, value: Any) -> Any: + ... + + def resolve_envvar_value(self, ctx: Context) -> str: + ... + + def value_from_envvar(self, ctx: Context) -> Union[str, List[str]]: + ... + + def handle_parse_result( + self, ctx: Context, opts: Dict[str, Any], args: List[str] + ) -> Tuple[Any, List[str]]: + ... + + def get_help_record(self, ctx: Context) -> Tuple[str, str]: + ... + + def get_usage_pieces(self, ctx: Context) -> List[str]: + ... + + def get_error_hint(self, ctx: Context) -> str: + ... + + +class Option(Parameter): + prompt: str # sic + confirmation_prompt: bool + hide_input: bool + is_flag: bool + flag_value: Any + is_bool_flag: bool + count: bool + multiple: bool + allow_from_autoenv: bool + help: Optional[str] + hidden: bool + show_default: bool + show_choices: bool + show_envvar: bool + + def __init__( + self, + param_decls: Optional[List[str]] = ..., + show_default: bool = ..., + prompt: Union[bool, str] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: Optional[bool] = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Optional[_ConvertibleType] = ..., + help: Optional[str] = ..., + hidden: bool = ..., + show_choices: bool = ..., + show_envvar: bool = ..., + **attrs + ) -> None: + ... + + def prompt_for_value(self, ctx: Context) -> Any: + ... + + +class Argument(Parameter): + def __init__( + self, + param_decls: Optional[List[str]] = ..., + required: Optional[bool] = ..., + **attrs + ) -> None: + ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/decorators.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/decorators.pyi new file mode 100644 index 00000000..2df9506a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/decorators.pyi @@ -0,0 +1,332 @@ +from distutils.version import Version +from typing import Any, Callable, Dict, List, Optional, Tuple, Type, TypeVar, Union, Text, overload + +from click.core import Command, Group, Argument, Option, Parameter, Context, _ConvertibleType + +_T = TypeVar('_T') +_F = TypeVar('_F', bound=Callable[..., Any]) + +# Until https://github.com/python/mypy/issues/3924 is fixed you can't do the following: +# _Decorator = Callable[[_F], _F] + +_Callback = Callable[ + [Context, Union[Option, Parameter], Any], + Any +] + +def pass_context(_T) -> _T: + ... + + +def pass_obj(_T) -> _T: + ... + + +def make_pass_decorator( + object_type: type, ensure: bool = ... +) -> Callable[[_T], _T]: + ... + + +# NOTE: Decorators below have **attrs converted to concrete constructor +# arguments from core.pyi to help with type checking. + +def command( + name: Optional[str] = ..., + cls: Optional[Type[Command]] = ..., + # Command + context_settings: Optional[Dict[Any, Any]] = ..., + help: Optional[str] = ..., + epilog: Optional[str] = ..., + short_help: Optional[str] = ..., + options_metavar: str = ..., + add_help_option: bool = ..., + hidden: bool = ..., + deprecated: bool = ..., +) -> Callable[[Callable[..., Any]], Command]: ... + +# This inherits attrs from Group, MultiCommand and Command. + +def group( + name: Optional[str] = ..., + cls: Type[Command] = ..., + # Group + commands: Optional[Dict[str, Command]] = ..., + # MultiCommand + invoke_without_command: bool = ..., + no_args_is_help: Optional[bool] = ..., + subcommand_metavar: Optional[str] = ..., + chain: bool = ..., + result_callback: Optional[Callable[..., Any]] = ..., + # Command + help: Optional[str] = ..., + epilog: Optional[str] = ..., + short_help: Optional[str] = ..., + options_metavar: str = ..., + add_help_option: bool = ..., + hidden: bool = ..., + deprecated: bool = ..., + # User-defined + **kwargs: Any, +) -> Callable[[Callable[..., Any]], Group]: ... + +def argument( + *param_decls: str, + cls: Type[Argument] = ..., + # Argument + required: Optional[bool] = ..., + # Parameter + type: Optional[_ConvertibleType] = ..., + default: Optional[Any] = ..., + callback: Optional[_Callback] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ..., + autocompletion: Optional[Callable[[Any, List[str], str], List[Union[str, Tuple[str, str]]]]] = ..., +) -> Callable[[_F], _F]: + ... + + +@overload +def option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: Union[bool, Text] = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: Optional[bool] = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Optional[_ConvertibleType] = ..., + help: Optional[str] = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + required: bool = ..., + callback: Optional[_Callback] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ..., + # User-defined + **kwargs: Any, +) -> Callable[[_F], _F]: + ... + + +@overload +def option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: Union[bool, Text] = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: Optional[bool] = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: _T = ..., + help: Optional[str] = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + required: bool = ..., + callback: Optional[Callable[[Context, Union[Option, Parameter], Union[bool, int, str]], _T]] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ..., + # User-defined + **kwargs: Any, +) -> Callable[[_F], _F]: + ... + + +@overload +def option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: Union[bool, Text] = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: Optional[bool] = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Type[str] = ..., + help: Optional[str] = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + required: bool = ..., + callback: Callable[[Context, Union[Option, Parameter], str], Any] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ..., + # User-defined + **kwargs: Any, +) -> Callable[[_F], _F]: + ... + + +@overload +def option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: Union[bool, Text] = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: Optional[bool] = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Type[int] = ..., + help: Optional[str] = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + required: bool = ..., + callback: Callable[[Context, Union[Option, Parameter], int], Any] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ..., + # User-defined + **kwargs: Any, +) -> Callable[[_F], _F]: + ... + + +def confirmation_option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: Union[bool, Text] = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: bool = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Optional[_ConvertibleType] = ..., + help: str = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + callback: Optional[_Callback] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ... +) -> Callable[[_F], _F]: + ... + + +def password_option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: Union[bool, Text] = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: Optional[bool] = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Optional[_ConvertibleType] = ..., + help: Optional[str] = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + callback: Optional[_Callback] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ... +) -> Callable[[_F], _F]: + ... + + +def version_option( + version: Optional[Union[str, Version]] = ..., + *param_decls: str, + cls: Type[Option] = ..., + # Option + prog_name: Optional[str] = ..., + message: Optional[str] = ..., + show_default: Union[bool, Text] = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: bool = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Optional[_ConvertibleType] = ..., + help: str = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + callback: Optional[_Callback] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ... +) -> Callable[[_F], _F]: + ... + + +def help_option( + *param_decls: str, + cls: Type[Option] = ..., + # Option + show_default: Union[bool, Text] = ..., + prompt: Union[bool, Text] = ..., + confirmation_prompt: bool = ..., + hide_input: bool = ..., + is_flag: bool = ..., + flag_value: Optional[Any] = ..., + multiple: bool = ..., + count: bool = ..., + allow_from_autoenv: bool = ..., + type: Optional[_ConvertibleType] = ..., + help: str = ..., + show_choices: bool = ..., + # Parameter + default: Optional[Any] = ..., + callback: Optional[_Callback] = ..., + nargs: Optional[int] = ..., + metavar: Optional[str] = ..., + expose_value: bool = ..., + is_eager: bool = ..., + envvar: Optional[Union[str, List[str]]] = ... +) -> Callable[[_F], _F]: + ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/exceptions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/exceptions.pyi new file mode 100644 index 00000000..3f0dda36 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/exceptions.pyi @@ -0,0 +1,93 @@ +from typing import IO, List, Optional, Any + +from click.core import Context, Parameter + + +class ClickException(Exception): + exit_code: int + message: str + + def __init__(self, message: str) -> None: + ... + + def format_message(self) -> str: + ... + + def show(self, file: Optional[Any] = ...) -> None: + ... + + +class UsageError(ClickException): + ctx: Optional[Context] + + def __init__(self, message: str, ctx: Optional[Context] = ...) -> None: ... + def show(self, file: Optional[IO[Any]] = ...) -> None: ... + + +class BadParameter(UsageError): + param: Optional[Parameter] + param_hint: Optional[str] + + def __init__( + self, + message: str, + ctx: Optional[Context] = ..., + param: Optional[Parameter] = ..., + param_hint: Optional[str] = ... + ) -> None: + ... + + +class MissingParameter(BadParameter): + param_type: str # valid values: 'parameter', 'option', 'argument' + + def __init__( + self, + message: Optional[str] = ..., + ctx: Optional[Context] = ..., + param: Optional[Parameter] = ..., + param_hint: Optional[str] = ..., + param_type: Optional[str] = ... + ) -> None: + ... + + +class NoSuchOption(UsageError): + option_name: str + possibilities: Optional[List[str]] + + def __init__( + self, + option_name: str, + message: Optional[str] = ..., + possibilities: Optional[List[str]] = ..., + ctx: Optional[Context] = ... + ) -> None: + ... + + +class BadOptionUsage(UsageError): + def __init__(self, option_name: str, message: str, ctx: Optional[Context] = ...) -> None: + ... + + +class BadArgumentUsage(UsageError): + def __init__(self, message: str, ctx: Optional[Context] = ...) -> None: + ... + + +class FileError(ClickException): + ui_filename: str + filename: str + + def __init__(self, filename: str, hint: Optional[str] = ...) -> None: + ... + + +class Abort(RuntimeError): + ... + + +class Exit(RuntimeError): + def __init__(self, code: int = ...) -> None: + ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/formatting.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/formatting.pyi new file mode 100644 index 00000000..bcd3048e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/formatting.pyi @@ -0,0 +1,86 @@ +from typing import ContextManager, Generator, Iterable, List, Optional, Tuple + + +FORCED_WIDTH: Optional[int] + + +def measure_table(rows: Iterable[Iterable[str]]) -> Tuple[int, ...]: + ... + + +def iter_rows( + rows: Iterable[Iterable[str]], col_count: int +) -> Generator[Tuple[str, ...], None, None]: + ... + + +def wrap_text( + text: str, + width: int = ..., + initial_indent: str = ..., + subsequent_indent: str = ..., + preserve_paragraphs: bool = ... +) -> str: + ... + + +class HelpFormatter: + indent_increment: int + width: Optional[int] + current_indent: int + buffer: List[str] + + def __init__( + self, + indent_increment: int = ..., + width: Optional[int] = ..., + max_width: Optional[int] = ..., + ) -> None: + ... + + def write(self, string: str) -> None: + ... + + def indent(self) -> None: + ... + + def dedent(self) -> None: + ... + + def write_usage( + self, + prog: str, + args: str = ..., + prefix: str = ..., + ): + ... + + def write_heading(self, heading: str) -> None: + ... + + def write_paragraph(self) -> None: + ... + + def write_text(self, text: str) -> None: + ... + + def write_dl( + self, + rows: Iterable[Iterable[str]], + col_max: int = ..., + col_spacing: int = ..., + ) -> None: + ... + + def section(self, name) -> ContextManager[None]: + ... + + def indentation(self) -> ContextManager[None]: + ... + + def getvalue(self) -> str: + ... + + +def join_options(options: List[str]) -> Tuple[str, bool]: + ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/globals.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/globals.pyi new file mode 100644 index 00000000..11adce3f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/globals.pyi @@ -0,0 +1,18 @@ +from click.core import Context +from typing import Optional + + +def get_current_context(silent: bool = ...) -> Context: + ... + + +def push_context(ctx: Context) -> None: + ... + + +def pop_context() -> None: + ... + + +def resolve_color_default(color: Optional[bool] = ...) -> Optional[bool]: + ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/parser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/parser.pyi new file mode 100644 index 00000000..d790bacb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/parser.pyi @@ -0,0 +1,104 @@ +from typing import Any, Dict, Iterable, List, Optional, Set, Tuple + +from click.core import Context + + +def _unpack_args( + args: Iterable[str], nargs_spec: Iterable[int] +) -> Tuple[Tuple[Optional[Tuple[str, ...]], ...], List[str]]: + ... + + +def split_opt(opt: str) -> Tuple[str, str]: + ... + + +def normalize_opt(opt: str, ctx: Context) -> str: + ... + + +def split_arg_string(string: str) -> List[str]: + ... + + +class Option: + dest: str + action: str + nargs: int + const: Any + obj: Any + prefixes: Set[str] + _short_opts: List[str] + _long_opts: List[str] + + def __init__( + self, + opts: Iterable[str], + dest: str, + action: Optional[str] = ..., + nargs: int = ..., + const: Optional[Any] = ..., + obj: Optional[Any] = ... + ) -> None: + ... + + @property + def takes_value(self) -> bool: + ... + + def process(self, value: Any, state: ParsingState) -> None: + ... + + +class Argument: + dest: str + nargs: int + obj: Any + + def __init__(self, dest: str, nargs: int = ..., obj: Optional[Any] = ...) -> None: + ... + + def process(self, value: Any, state: ParsingState) -> None: + ... + + +class ParsingState: + opts: Dict[str, Any] + largs: List[str] + rargs: List[str] + order: List[Any] + + def __init__(self, rargs: List[str]) -> None: + ... + + +class OptionParser: + ctx: Optional[Context] + allow_interspersed_args: bool + ignore_unknown_options: bool + _short_opt: Dict[str, Option] + _long_opt: Dict[str, Option] + _opt_prefixes: Set[str] + _args: List[Argument] + + def __init__(self, ctx: Optional[Context] = ...) -> None: + ... + + def add_option( + self, + opts: Iterable[str], + dest: str, + action: Optional[str] = ..., + nargs: int = ..., + const: Optional[Any] = ..., + obj: Optional[Any] = ... + ) -> None: + ... + + def add_argument(self, dest: str, nargs: int = ..., obj: Optional[Any] = ...) -> None: + ... + + def parse_args( + self, args: List[str] + ) -> Tuple[Dict[str, Any], List[str], List[Any]]: + ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/termui.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/termui.pyi new file mode 100644 index 00000000..87e9bdcc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/termui.pyi @@ -0,0 +1,174 @@ +from typing import ( + Any, + Callable, + Generator, + Iterable, + IO, + List, + Optional, + Text, + overload, + Text, + Tuple, + TypeVar, + Union, +) + +from click.core import _ConvertibleType +from click._termui_impl import ProgressBar as _ProgressBar + + +def hidden_prompt_func(prompt: str) -> str: + ... + + +def _build_prompt( + text: str, + suffix: str, + show_default: bool = ..., + default: Optional[str] = ..., +) -> str: + ... + + +def prompt( + text: str, + default: Optional[str] = ..., + hide_input: bool = ..., + confirmation_prompt: bool = ..., + type: Optional[_ConvertibleType] = ..., + value_proc: Optional[Callable[[Optional[str]], Any]] = ..., + prompt_suffix: str = ..., + show_default: bool = ..., + err: bool = ..., + show_choices: bool = ..., +) -> Any: + ... + + +def confirm( + text: str, + default: bool = ..., + abort: bool = ..., + prompt_suffix: str = ..., + show_default: bool = ..., + err: bool = ..., +) -> bool: + ... + + +def get_terminal_size() -> Tuple[int, int]: + ... + + +def echo_via_pager( + text_or_generator: Union[str, Iterable[str], Callable[[], Generator[str, None, None]]], + color: Optional[bool] = ..., +) -> None: + ... + + +_T = TypeVar('_T') + +@overload +def progressbar( + iterable: Iterable[_T], + length: Optional[int] = ..., + label: Optional[str] = ..., + show_eta: bool = ..., + show_percent: Optional[bool] = ..., + show_pos: bool = ..., + item_show_func: Optional[Callable[[_T], str]] = ..., + fill_char: str = ..., + empty_char: str = ..., + bar_template: str = ..., + info_sep: str = ..., + width: int = ..., + file: Optional[IO[Any]] = ..., + color: Optional[bool] = ..., +) -> _ProgressBar[_T]: + ... + +@overload +def progressbar( + iterable: None = ..., + length: Optional[int] = ..., + label: Optional[str] = ..., + show_eta: bool = ..., + show_percent: Optional[bool] = ..., + show_pos: bool = ..., + item_show_func: Optional[Callable[[_T], str]] = ..., + fill_char: str = ..., + empty_char: str = ..., + bar_template: str = ..., + info_sep: str = ..., + width: int = ..., + file: Optional[IO[Any]] = ..., + color: Optional[bool] = ..., +) -> _ProgressBar[int]: + ... + +def clear() -> None: + ... + + +def style( + text: Text, + fg: Optional[str] = ..., + bg: Optional[str] = ..., + bold: Optional[bool] = ..., + dim: Optional[bool] = ..., + underline: Optional[bool] = ..., + blink: Optional[bool] = ..., + reverse: Optional[bool] = ..., + reset: bool = ..., +) -> str: + ... + + +def unstyle(text: Text) -> str: + ... + + +# Styling options copied from style() for nicer type checking. +def secho( + message: Optional[str] = ..., + file: Optional[IO[Any]] = ..., + nl: bool = ..., + err: bool = ..., + color: Optional[bool] = ..., + fg: Optional[str] = ..., + bg: Optional[str] = ..., + bold: Optional[bool] = ..., + dim: Optional[bool] = ..., + underline: Optional[bool] = ..., + blink: Optional[bool] = ..., + reverse: Optional[bool] = ..., + reset: bool = ..., +): + ... + + +def edit( + text: Optional[str] = ..., + editor: Optional[str] = ..., + env: Optional[str] = ..., + require_save: bool = ..., + extension: str = ..., + filename: Optional[str] = ..., +) -> str: + ... + + +def launch(url: str, wait: bool = ..., locate: bool = ...) -> int: + ... + + +def getchar(echo: bool = ...) -> Text: + ... + + +def pause( + info: str = ..., err: bool = ... +) -> None: + ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/testing.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/testing.pyi new file mode 100644 index 00000000..bd24c9be --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/testing.pyi @@ -0,0 +1,74 @@ +from typing import (IO, Any, BinaryIO, ContextManager, Dict, Iterable, List, + Mapping, Optional, Text, Tuple, Union) + +from .core import BaseCommand + +clickpkg: Any + +class EchoingStdin: + def __init__(self, input: BinaryIO, output: BinaryIO) -> None: ... + def __getattr__(self, x: str) -> Any: ... + def read(self, n: int = ...) -> bytes: ... + def readline(self, n: int = ...) -> bytes: ... + def readlines(self) -> List[bytes]: ... + def __iter__(self) -> Iterable[bytes]: ... + +def make_input_stream(input: Optional[Union[bytes, Text, IO[Any]]], charset: Text) -> BinaryIO: ... + +class Result: + runner: CliRunner + exit_code: int + exception: Any + exc_info: Optional[Any] + stdout_bytes: bytes + stderr_bytes: bytes + def __init__( + self, + runner: CliRunner, + stdout_bytes: bytes, + stderr_bytes: bytes, + exit_code: int, + exception: Any, + exc_info: Optional[Any] = ..., + ) -> None: ... + @property + def output(self) -> Text: ... + @property + def stdout(self) -> Text: ... + @property + def stderr(self) -> Text: ... + +class CliRunner: + charset: str + env: Mapping[str, str] + echo_stdin: bool + mix_stderr: bool + + def __init__( + self, + charset: Optional[Text] = ..., + env: Optional[Mapping[str, str]] = ..., + echo_stdin: bool = ..., + mix_stderr: bool = ..., + ) -> None: + ... + def get_default_prog_name(self, cli: BaseCommand) -> str: ... + def make_env(self, overrides: Optional[Mapping[str, str]] = ...) -> Dict[str, str]: ... + def isolation( + self, + input: Optional[Union[bytes, Text, IO[Any]]] = ..., + env: Optional[Mapping[str, str]] = ..., + color: bool = ..., + ) -> ContextManager[BinaryIO]: ... + def invoke( + self, + cli: BaseCommand, + args: Optional[Union[str, Iterable[str]]] = ..., + input: Optional[Union[bytes, Text, IO[Any]]] = ..., + env: Optional[Mapping[str, str]] = ..., + catch_exceptions: bool = ..., + color: bool = ..., + **extra: Any, + ) -> Result: + ... + def isolated_filesystem(self) -> ContextManager[str]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/types.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/types.pyi new file mode 100644 index 00000000..cf37a738 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/types.pyi @@ -0,0 +1,255 @@ +from typing import Any, Callable, Generic, IO, Iterable, List, Optional, TypeVar, Union, Tuple as _PyTuple, Type +import datetime +import uuid + +from click.core import Context, Parameter, _ParamType as ParamType, _ConvertibleType + +class BoolParamType(ParamType): + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> bool: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> bool: + ... + + +class CompositeParamType(ParamType): + arity: int + + +class Choice(ParamType): + choices: Iterable[str] + def __init__( + self, + choices: Iterable[str], + case_sensitive: bool = ..., + ) -> None: + ... + + +class DateTime(ParamType): + def __init__( + self, + formats: Optional[List[str]] = ..., + ) -> None: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> datetime.datetime: + ... + + +class FloatParamType(ParamType): + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> float: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> float: + ... + + +class FloatRange(FloatParamType): + def __init__( + self, + min: Optional[float] = ..., + max: Optional[float] = ..., + clamp: bool = ..., + ) -> None: + ... + +class File(ParamType): + def __init__( + self, + mode: str = ..., + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + lazy: Optional[bool] = ..., + atomic: Optional[bool] = ..., + ) -> None: ... + def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...) -> IO[Any]: ... + def convert(self, value: str, param: Optional[Parameter], ctx: Optional[Context]) -> IO[Any]: ... + def resolve_lazy_flag(self, value: str) -> bool: ... + +_F = TypeVar('_F') # result of the function +_Func = Callable[[Optional[str]], _F] + + +class FuncParamType(ParamType, Generic[_F]): + func: _Func[_F] + + def __init__(self, func: _Func[_F]) -> None: ... + + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> _F: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> _F: + ... + + +class IntParamType(ParamType): + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> int: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> int: + ... + + +class IntRange(IntParamType): + def __init__( + self, min: Optional[int] = ..., max: Optional[int] = ..., clamp: bool = ... + ) -> None: + ... + + +_PathType = TypeVar('_PathType', str, bytes) + + +class Path(ParamType): + def __init__( + self, + exists: bool = ..., + file_okay: bool = ..., + dir_okay: bool = ..., + writable: bool = ..., + readable: bool = ..., + resolve_path: bool = ..., + allow_dash: bool = ..., + path_type: Optional[Type[_PathType]] = ..., + ) -> None: + ... + + def coerce_path_result(self, rv: Union[str, bytes]) -> _PathType: + ... + + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> _PathType: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> _PathType: + ... + +class StringParamType(ParamType): + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> str: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> str: + ... + + +class Tuple(CompositeParamType): + types: List[ParamType] + + def __init__(self, types: Iterable[Any]) -> None: + ... + + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> Tuple: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> Tuple: + ... + + +class UnprocessedParamType(ParamType): + ... + + +class UUIDParameterType(ParamType): + def __call__( + self, + value: Optional[str], + param: Optional[Parameter] = ..., + ctx: Optional[Context] = ..., + ) -> uuid.UUID: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> uuid.UUID: + ... + + +def convert_type(ty: Optional[_ConvertibleType], default: Optional[Any] = ...) -> ParamType: + ... + +# parameter type shortcuts + +BOOL: BoolParamType +FLOAT: FloatParamType +INT: IntParamType +STRING: StringParamType +UNPROCESSED: UnprocessedParamType +UUID: UUIDParameterType diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/utils.pyi new file mode 100644 index 00000000..d4fc17e9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/click/utils.pyi @@ -0,0 +1,88 @@ +from typing import Any, AnyStr, Callable, Generic, Iterator, IO, List, Optional, TypeVar, Union, Text + +_T = TypeVar('_T') + + +def _posixify(name: str) -> str: + ... + + +def safecall(func: _T) -> _T: + ... + + +def make_str(value: Any) -> str: + ... + + +def make_default_short_help(help: str, max_length: int = ...): + ... + + +class LazyFile(object): + name: str + mode: str + encoding: Optional[str] + errors: str + atomic: bool + + def __init__( + self, + filename: str, + mode: str = ..., + encoding: Optional[str] = ..., + errors: str = ..., + atomic: bool = ... + ) -> None: ... + def open(self) -> IO[Any]: ... + def close(self) -> None: ... + def close_intelligently(self) -> None: ... + def __enter__(self) -> LazyFile: ... + def __exit__(self, exc_type, exc_value, tb): ... + def __iter__(self) -> Iterator[Any]: ... + +class KeepOpenFile(Generic[AnyStr]): + _file: IO[AnyStr] + def __init__(self, file: IO[AnyStr]) -> None: ... + def __enter__(self) -> KeepOpenFile[AnyStr]: ... + def __exit__(self, exc_type, exc_value, tb): ... + def __iter__(self) -> Iterator[AnyStr]: ... + +def echo( + message: object = ..., + file: Optional[IO[Text]] = ..., + nl: bool = ..., + err: bool = ..., + color: Optional[bool] = ..., +) -> None: + ... + + +def get_binary_stream(name: str) -> IO[bytes]: + ... + + +def get_text_stream( + name: str, encoding: Optional[str] = ..., errors: str = ... +) -> IO[str]: + ... + +def open_file( + filename: str, + mode: str = ..., + encoding: Optional[str] = ..., + errors: str = ..., + lazy: bool = ..., + atomic: bool = ... +) -> Any: ... # really Union[IO, LazyFile, KeepOpenFile] +def get_os_args() -> List[str]: + ... + +def format_filename(filename: str, shorten: bool = ...) -> str: + ... + + +def get_app_dir( + app_name: str, roaming: bool = ..., force_posix: bool = ... +) -> str: + ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/croniter.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/croniter.pyi new file mode 100644 index 00000000..0d01b7e0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/croniter.pyi @@ -0,0 +1,41 @@ +import datetime +from typing import Any, Dict, Iterator, List, Optional, Text, Tuple, Type, TypeVar, Union + +_RetType = Union[Type[float], Type[datetime.datetime]] +_SelfT = TypeVar('_SelfT', bound=croniter) + +class CroniterError(ValueError): ... +class CroniterBadCronError(CroniterError): ... +class CroniterBadDateError(CroniterError): ... +class CroniterNotAlphaError(CroniterError): ... + +class croniter(Iterator[Any]): + MONTHS_IN_YEAR: int + RANGES: Tuple[Tuple[int, int], ...] + DAYS: Tuple[int, ...] + ALPHACONV: Tuple[Dict[str, Any], ...] + LOWMAP: Tuple[Dict[int, Any], ...] + bad_length: str + tzinfo: Optional[datetime.tzinfo] + cur: float + expanded: List[List[str]] + start_time: float + dst_start_time: float + nth_weekday_of_month: Dict[str, Any] + def __init__(self, expr_format: Text, start_time: Optional[Union[float, datetime.datetime]] = ..., ret_type: Optional[_RetType] = ...) -> None: ... + # Most return value depend on ret_type, which can be passed in both as a method argument and as + # a constructor argument. + def get_next(self, ret_type: Optional[_RetType] = ...) -> Any: ... + def get_prev(self, ret_type: Optional[_RetType] = ...) -> Any: ... + def get_current(self, ret_type: Optional[_RetType] = ...) -> Any: ... + def __iter__(self: _SelfT) -> _SelfT: ... + def __next__(self, ret_type: Optional[_RetType] = ...) -> Any: ... + def next(self, ret_type: Optional[_RetType] = ...) -> Any: ... + def all_next(self, ret_type: Optional[_RetType] = ...) -> Iterator[Any]: ... + def all_prev(self, ret_type: Optional[_RetType] = ...) -> Iterator[Any]: ... + def iter(self, ret_type: Optional[_RetType] = ...) -> Iterator[Any]: ... + def is_leap(self, year: int) -> bool: ... + @classmethod + def expand(cls, expr_format: Text) -> Tuple[List[List[str]], Dict[str, Any]]: ... + @classmethod + def is_valid(cls, expression: Text) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/exceptions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/exceptions.pyi new file mode 100644 index 00000000..48041a80 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/exceptions.pyi @@ -0,0 +1,7 @@ +class AlreadyFinalized(Exception): ... +class AlreadyUpdated(Exception): ... +class InvalidKey(Exception): ... +class InvalidSignature(Exception): ... +class InvalidTag(Exception): ... +class NotYetFinalized(Exception): ... +class UnsupportedAlgorithm(Exception): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/fernet.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/fernet.pyi new file mode 100644 index 00000000..8ce2d793 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/fernet.pyi @@ -0,0 +1,17 @@ +from typing import List, Optional + +class InvalidToken(Exception): ... + +class Fernet(object): + def __init__(self, key: bytes) -> None: ... + def decrypt(self, token: bytes, ttl: Optional[int] = ...) -> bytes: ... + def encrypt(self, data: bytes) -> bytes: ... + def extract_timestamp(self, token: bytes) -> int: ... + @classmethod + def generate_key(cls) -> bytes: ... + +class MultiFernet(object): + def __init__(self, fernets: List[Fernet]) -> None: ... + def decrypt(self, token: bytes, ttl: Optional[int] = ...) -> bytes: ... + def encrypt(self, data: bytes) -> bytes: ... + def rotate(self, msg: bytes) -> bytes: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/__init__.pyi new file mode 100644 index 00000000..e27843e5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/__init__.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/backends/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/backends/__init__.pyi new file mode 100644 index 00000000..4e6d67af --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/backends/__init__.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def default_backend() -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/backends/interfaces.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/backends/interfaces.pyi new file mode 100644 index 00000000..14bc3f38 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/backends/interfaces.pyi @@ -0,0 +1,196 @@ +from abc import ABCMeta, abstractmethod +from typing import Any, Optional, Union + +from cryptography.hazmat.primitives.asymmetric.dh import ( + DHParameterNumbers, + DHParameters, + DHPrivateKey, + DHPrivateNumbers, + DHPublicKey, + DHPublicNumbers, +) +from cryptography.hazmat.primitives.asymmetric.dsa import ( + DSAParameterNumbers, + DSAParameters, + DSAPrivateKey, + DSAPrivateNumbers, + DSAPublicKey, + DSAPublicNumbers, +) +from cryptography.hazmat.primitives.asymmetric.ec import ( + EllipticCurve, + EllipticCurvePrivateKey, + EllipticCurvePrivateNumbers, + EllipticCurvePublicKey, + EllipticCurvePublicNumbers, + EllipticCurveSignatureAlgorithm, +) +from cryptography.hazmat.primitives.asymmetric.padding import AsymmetricPadding +from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKey, RSAPrivateNumbers, RSAPublicKey, RSAPublicNumbers +from cryptography.hazmat.primitives.ciphers import BlockCipherAlgorithm, CipherAlgorithm, CipherContext +from cryptography.hazmat.primitives.ciphers.modes import Mode +from cryptography.hazmat.primitives.hashes import HashAlgorithm, HashContext +from cryptography.x509 import ( + Certificate, + CertificateBuilder, + CertificateRevocationList, + CertificateRevocationListBuilder, + CertificateSigningRequest, + CertificateSigningRequestBuilder, + Name, + RevokedCertificate, + RevokedCertificateBuilder, +) + +class CipherBackend(metaclass=ABCMeta): + @abstractmethod + def cipher_supported(self, cipher: CipherAlgorithm, mode: Mode) -> bool: ... + @abstractmethod + def create_symmetric_encryption_ctx(self, cipher: CipherAlgorithm, mode: Mode) -> CipherContext: ... + @abstractmethod + def create_symmetric_decryption_ctx(self, cipher: CipherAlgorithm, mode: Mode) -> CipherContext: ... + +class CMACBackend(metaclass=ABCMeta): + @abstractmethod + def cmac_algorithm_supported(self, algorithm: BlockCipherAlgorithm) -> bool: ... + @abstractmethod + def create_cmac_ctx(self, algorithm: BlockCipherAlgorithm) -> Any: ... + +class DERSerializationBackend(metaclass=ABCMeta): + @abstractmethod + def load_der_parameters(self, data: bytes) -> Any: ... + @abstractmethod + def load_der_private_key(self, data: bytes, password: Optional[bytes]) -> Any: ... + @abstractmethod + def load_der_public_key(self, data: bytes) -> Any: ... + +class DHBackend(metaclass=ABCMeta): + @abstractmethod + def dh_parameters_supported(self, p: int, g: int, q: Optional[int]) -> bool: ... + @abstractmethod + def dh_x942_serialization_supported(self) -> bool: ... + @abstractmethod + def generate_dh_parameters(self, generator: int, key_size: int) -> DHParameters: ... + @abstractmethod + def generate_dh_private_key(self, parameters: DHParameters) -> DHPrivateKey: ... + @abstractmethod + def generate_dh_private_key_and_parameters(self, generator: int, key_size: int) -> DHPrivateKey: ... + @abstractmethod + def load_dh_parameter_numbers(self, numbers: DHParameterNumbers) -> DHParameters: ... + @abstractmethod + def load_dh_private_numbers(self, numbers: DHPrivateNumbers) -> DHPrivateKey: ... + @abstractmethod + def load_dh_public_numbers(self, numbers: DHPublicNumbers) -> DHPublicKey: ... + +class DSABackend(metaclass=ABCMeta): + @abstractmethod + def dsa_hash_supported(self, algorithm: HashAlgorithm) -> bool: ... + @abstractmethod + def dsa_parameters_supported(self, p: int, q: int, g: int) -> bool: ... + @abstractmethod + def generate_dsa_parameters(self, key_size: int) -> DSAParameters: ... + @abstractmethod + def generate_dsa_private_key(self, parameters: DSAParameters) -> DSAPrivateKey: ... + @abstractmethod + def generate_dsa_private_key_and_parameters(self, key_size: int) -> DSAPrivateKey: ... + @abstractmethod + def load_dsa_parameter_numbers(self, numbers: DSAParameterNumbers) -> DSAParameters: ... + @abstractmethod + def load_dsa_private_numbers(self, numbers: DSAPrivateNumbers) -> DSAPrivateKey: ... + @abstractmethod + def load_dsa_public_numbers(self, numbers: DSAPublicNumbers) -> DSAPublicKey: ... + +class EllipticCurveBackend(metaclass=ABCMeta): + @abstractmethod + def derive_elliptic_curve_private_key(self, private_value: int, curve: EllipticCurve) -> EllipticCurvePrivateKey: ... + @abstractmethod + def elliptic_curve_signature_algorithm_supported( + self, signature_algorithm: EllipticCurveSignatureAlgorithm, curve: EllipticCurve + ) -> bool: ... + @abstractmethod + def elliptic_curve_supported(self, curve: EllipticCurve) -> bool: ... + @abstractmethod + def generate_elliptic_curve_private_key(self, curve: EllipticCurve) -> EllipticCurvePrivateKey: ... + @abstractmethod + def load_elliptic_curve_private_numbers(self, numbers: EllipticCurvePrivateNumbers) -> EllipticCurvePrivateKey: ... + @abstractmethod + def load_elliptic_curve_public_numbers(self, numbers: EllipticCurvePublicNumbers) -> EllipticCurvePublicKey: ... + +class HMACBackend(metaclass=ABCMeta): + @abstractmethod + def create_hmac_ctx(self, key: bytes, algorithm: HashAlgorithm) -> HashContext: ... + @abstractmethod + def cmac_algorithm_supported(self, algorithm: HashAlgorithm) -> bool: ... + +class HashBackend(metaclass=ABCMeta): + @abstractmethod + def create_hash_ctx(self, algorithm: HashAlgorithm) -> HashContext: ... + @abstractmethod + def hash_supported(self, algorithm: HashAlgorithm) -> bool: ... + +class PBKDF2HMACBackend(metaclass=ABCMeta): + @abstractmethod + def derive_pbkdf2_hmac( + self, algorithm: HashAlgorithm, length: int, salt: bytes, iterations: int, key_material: bytes + ) -> bytes: ... + @abstractmethod + def pbkdf2_hmac_supported(self, algorithm: HashAlgorithm) -> bool: ... + +class PEMSerializationBackend(metaclass=ABCMeta): + @abstractmethod + def load_pem_parameters(self, data: bytes) -> Any: ... + @abstractmethod + def load_pem_private_key(self, data: bytes, password: Optional[bytes]) -> Any: ... + @abstractmethod + def load_pem_public_key(self, data: bytes) -> Any: ... + +class RSABackend(metaclass=ABCMeta): + @abstractmethod + def generate_rsa_parameters_supported(self, public_exponent: int, key_size: int) -> bool: ... + @abstractmethod + def generate_rsa_private_key(self, public_exponent: int, key_size: int) -> RSAPrivateKey: ... + @abstractmethod + def load_rsa_public_numbers(self, numbers: RSAPublicNumbers) -> RSAPublicKey: ... + @abstractmethod + def load_rsa_private_numbers(self, numbers: RSAPrivateNumbers) -> RSAPrivateKey: ... + @abstractmethod + def rsa_padding_supported(self, padding: AsymmetricPadding) -> bool: ... + +class ScryptBackend(metaclass=ABCMeta): + @abstractmethod + def derive_scrypt(self, key_material: bytes, salt: bytes, length: int, n: int, r: int, p: int) -> bytes: ... + +class X509Backend(metaclass=ABCMeta): + @abstractmethod + def create_x509_certificate( + self, + builder: CertificateBuilder, + private_key: Union[DSAPrivateKey, EllipticCurvePrivateKey, RSAPrivateKey], + algorithm: HashAlgorithm, + ) -> Certificate: ... + @abstractmethod + def create_x509_crl( + self, + builder: CertificateRevocationListBuilder, + private_key: Union[DSAPrivateKey, EllipticCurvePrivateKey, RSAPrivateKey], + algorithm: HashAlgorithm, + ) -> CertificateRevocationList: ... + @abstractmethod + def create_x509_csr( + self, + builder: CertificateSigningRequestBuilder, + private_key: Union[DSAPrivateKey, EllipticCurvePrivateKey, RSAPrivateKey], + algorithm: HashAlgorithm, + ) -> CertificateSigningRequest: ... + @abstractmethod + def create_x509_revoked_certificate(self, builder: RevokedCertificateBuilder) -> RevokedCertificate: ... + @abstractmethod + def load_der_x509_certificate(self, data: bytes) -> Certificate: ... + @abstractmethod + def load_der_x509_csr(self, data: bytes) -> CertificateSigningRequest: ... + @abstractmethod + def load_pem_x509_certificate(self, data: bytes) -> Certificate: ... + @abstractmethod + def load_pem_x509_csr(self, data: bytes) -> CertificateSigningRequest: ... + @abstractmethod + def x509_name_bytes(self, name: Name) -> bytes: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/bindings/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/bindings/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/bindings/openssl/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/bindings/openssl/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/bindings/openssl/binding.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/bindings/openssl/binding.pyi new file mode 100644 index 00000000..9fd46444 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/bindings/openssl/binding.pyi @@ -0,0 +1,6 @@ +from typing import Any, Optional + +class Binding(object): + ffi: Optional[Any] + lib: Optional[Any] + def init_static_locks(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/__init__.pyi new file mode 100644 index 00000000..e27843e5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/__init__.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/__init__.pyi new file mode 100644 index 00000000..e27843e5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/__init__.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name: str) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/dh.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/dh.pyi new file mode 100644 index 00000000..aa657e27 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/dh.pyi @@ -0,0 +1,77 @@ +from abc import ABCMeta, abstractmethod +from typing import Optional + +from cryptography.hazmat.backends.interfaces import DHBackend +from cryptography.hazmat.primitives.serialization import ( + Encoding, + KeySerializationEncryption, + ParameterFormat, + PrivateFormat, + PublicFormat, +) + +class DHParameters(metaclass=ABCMeta): + @abstractmethod + def generate_private_key(self) -> DHPrivateKey: ... + @abstractmethod + def parameter_bytes(self, encoding: Encoding, format: ParameterFormat) -> bytes: ... + @abstractmethod + def parameter_numbers(self) -> DHParameterNumbers: ... + +DHParametersWithSerialization = DHParameters + +class DHParameterNumbers(object): + @property + def p(self) -> int: ... + @property + def g(self) -> int: ... + @property + def q(self) -> int: ... + def __init__(self, p: int, g: int, q: Optional[int]) -> None: ... + def parameters(self, backend: DHBackend) -> DHParameters: ... + +class DHPrivateKey(metaclass=ABCMeta): + key_size: int + @abstractmethod + def exchange(self, peer_public_key: DHPublicKey) -> bytes: ... + @abstractmethod + def parameters(self) -> DHParameters: ... + @abstractmethod + def public_key(self) -> DHPublicKey: ... + +class DHPrivateKeyWithSerialization(DHPrivateKey): + @abstractmethod + def private_bytes( + self, encoding: Encoding, format: PrivateFormat, encryption_algorithm: KeySerializationEncryption + ) -> bytes: ... + @abstractmethod + def private_numbers(self) -> DHPrivateNumbers: ... + +class DHPrivateNumbers(object): + @property + def public_numbers(self) -> DHPublicNumbers: ... + @property + def x(self) -> int: ... + def __init__(self, x: int, public_numbers: DHPublicNumbers) -> None: ... + def private_key(self, backend: DHBackend) -> DHPrivateKey: ... + +class DHPublicKey(metaclass=ABCMeta): + @property + @abstractmethod + def key_size(self) -> int: ... + @abstractmethod + def parameters(self) -> DHParameters: ... + @abstractmethod + def public_bytes(self, encoding: Encoding, format: PublicFormat) -> bytes: ... + @abstractmethod + def public_numbers(self) -> DHPublicNumbers: ... + +DHPublicKeyWithSerialization = DHPublicKey + +class DHPublicNumbers(object): + @property + def parameter_numbers(self) -> DHParameterNumbers: ... + @property + def y(self) -> int: ... + def __init__(self, y: int, parameter_numbers: DHParameterNumbers) -> None: ... + def public_key(self, backend: DHBackend) -> DHPublicKey: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/dsa.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/dsa.pyi new file mode 100644 index 00000000..ba957813 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/dsa.pyi @@ -0,0 +1,79 @@ +from abc import ABCMeta, abstractmethod + +from typing import Union + +from cryptography.hazmat.backends.interfaces import DSABackend +from cryptography.hazmat.primitives.asymmetric import AsymmetricVerificationContext +from cryptography.hazmat.primitives.asymmetric.utils import Prehashed +from cryptography.hazmat.primitives.hashes import HashAlgorithm +from cryptography.hazmat.primitives.serialization import Encoding, KeySerializationEncryption, PrivateFormat, PublicFormat + +class DSAParameters(metaclass=ABCMeta): + @abstractmethod + def generate_private_key(self) -> DSAPrivateKey: ... + +class DSAParametersWithNumbers(DSAParameters): + @abstractmethod + def parameter_numbers(self) -> DSAParameterNumbers: ... + +class DSAParameterNumbers(object): + @property + def p(self) -> int: ... + @property + def q(self) -> int: ... + @property + def g(self) -> int: ... + def __init__(self, p: int, q: int, g: int) -> None: ... + def parameters(self, backend: DSABackend) -> DSAParameters: ... + +class DSAPrivateKey(metaclass=ABCMeta): + @property + @abstractmethod + def key_size(self) -> int: ... + @abstractmethod + def parameters(self) -> DSAParameters: ... + @abstractmethod + def public_key(self) -> DSAPublicKey: ... + @abstractmethod + def sign(self, data: bytes, algorithm: Union[HashAlgorithm, Prehashed]) -> bytes: ... + +class DSAPrivateKeyWithSerialization(DSAPrivateKey): + @abstractmethod + def private_bytes( + self, encoding: Encoding, format: PrivateFormat, encryption_algorithm: KeySerializationEncryption + ) -> bytes: ... + @abstractmethod + def private_numbers(self) -> DSAPrivateNumbers: ... + +class DSAPrivateNumbers(object): + @property + def x(self) -> int: ... + @property + def public_numbers(self) -> DSAPublicNumbers: ... + def __init__(self, x: int, public_numbers: DSAPublicNumbers) -> None: ... + +class DSAPublicKey(metaclass=ABCMeta): + @property + @abstractmethod + def key_size(self) -> int: ... + @abstractmethod + def public_bytes(self, encoding: Encoding, format: PublicFormat) -> bytes: ... + @abstractmethod + def public_numbers(self) -> DSAPublicNumbers: ... + @abstractmethod + def verifier(self, signature: bytes, + signature_algorithm: Union[HashAlgorithm, Prehashed]) -> AsymmetricVerificationContext: ... + @abstractmethod + def verify(self, signature: bytes, data: bytes, algorithm: Union[HashAlgorithm, Prehashed]) -> None: ... + +DSAPublicKeyWithSerialization = DSAPublicKey + +class DSAPublicNumbers(object): + @property + def y(self) -> int: ... + @property + def parameter_numbers(self) -> DSAParameterNumbers: ... + def __init__(self, y: int, parameter_numbers: DSAParameterNumbers) -> None: ... + +def generate_parameters(key_size: int, backend: DSABackend) -> DSAParameters: ... +def generate_private_key(key_size: int, backend: DSABackend) -> DSAPrivateKey: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ec.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ec.pyi new file mode 100644 index 00000000..af2893e8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ec.pyi @@ -0,0 +1,230 @@ +from abc import ABCMeta, abstractmethod +from typing import ClassVar, Union + +from cryptography.hazmat.backends.interfaces import EllipticCurveBackend +from cryptography.hazmat.primitives.asymmetric.utils import Prehashed +from cryptography.hazmat.primitives.asymmetric import AsymmetricVerificationContext +from cryptography.hazmat.primitives.hashes import HashAlgorithm +from cryptography.hazmat.primitives.serialization import Encoding, KeySerializationEncryption, PrivateFormat, PublicFormat +from cryptography.x509 import ObjectIdentifier + +class EllipticCurve(metaclass=ABCMeta): + @property + @abstractmethod + def key_size(self) -> int: ... + @property + @abstractmethod + def name(self) -> str: ... + +class BrainpoolP256R1(EllipticCurve): + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class BrainpoolP384R1(EllipticCurve): + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class BrainpoolP512R1(EllipticCurve): + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class SECP192R1(EllipticCurve): + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class SECP224R1(EllipticCurve): + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class SECP256K1(EllipticCurve): + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class SECP256R1(EllipticCurve): + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class SECP384R1(EllipticCurve): + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class SECP521R1(EllipticCurve): + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class SECT163K1(EllipticCurve): + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class SECT163R2(EllipticCurve): + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class SECT233K1(EllipticCurve): + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class SECT233R1(EllipticCurve): + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class SECT283K1(EllipticCurve): + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class SECT283R1(EllipticCurve): + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class SECT409K1(EllipticCurve): + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class SECT409R1(EllipticCurve): + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class SECT571K1(EllipticCurve): + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class SECT571R1(EllipticCurve): + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class EllipticCurveOID(object): + SECP192R1: ClassVar[ObjectIdentifier] + SECP224R1: ClassVar[ObjectIdentifier] + SECP256K1: ClassVar[ObjectIdentifier] + SECP256R1: ClassVar[ObjectIdentifier] + SECP384R1: ClassVar[ObjectIdentifier] + SECP521R1: ClassVar[ObjectIdentifier] + BRAINPOOLP256R1: ClassVar[ObjectIdentifier] + BRAINPOOLP384R1: ClassVar[ObjectIdentifier] + BRAINPOOLP512R1: ClassVar[ObjectIdentifier] + SECT163K1: ClassVar[ObjectIdentifier] + SECT163R2: ClassVar[ObjectIdentifier] + SECT233K1: ClassVar[ObjectIdentifier] + SECT233R1: ClassVar[ObjectIdentifier] + SECT283K1: ClassVar[ObjectIdentifier] + SECT283R1: ClassVar[ObjectIdentifier] + SECT409K1: ClassVar[ObjectIdentifier] + SECT409R1: ClassVar[ObjectIdentifier] + SECT571K1: ClassVar[ObjectIdentifier] + SECT571R1: ClassVar[ObjectIdentifier] + +class EllipticCurvePrivateKey(metaclass=ABCMeta): + @property + @abstractmethod + def curve(self) -> EllipticCurve: ... + @property + @abstractmethod + def key_size(self) -> int: ... + @abstractmethod + def exchange(self, algorithm: ECDH, peer_public_key: EllipticCurvePublicKey) -> bytes: ... + @abstractmethod + def public_key(self) -> EllipticCurvePublicKey: ... + @abstractmethod + def sign(self, data: bytes, signature_algorithm: EllipticCurveSignatureAlgorithm) -> bytes: ... + +class EllipticCurvePrivateKeyWithSerialization(EllipticCurvePrivateKey): + @abstractmethod + def private_bytes( + self, encoding: Encoding, format: PrivateFormat, encryption_algorithm: KeySerializationEncryption + ) -> bytes: ... + @abstractmethod + def private_numbers(self) -> EllipticCurvePrivateNumbers: ... + +class EllipticCurvePrivateNumbers(object): + @property + def private_value(self) -> int: ... + @property + def public_numbers(self) -> EllipticCurvePublicNumbers: ... + def __init__(self, private_value: int, public_numbers: EllipticCurvePublicNumbers) -> None: ... + def private_key(self, backend: EllipticCurveBackend) -> EllipticCurvePrivateKey: ... + +class EllipticCurvePublicKey(metaclass=ABCMeta): + @property + @abstractmethod + def curve(self) -> EllipticCurve: ... + @property + @abstractmethod + def key_size(self) -> int: ... + @classmethod + def from_encoded_point(cls, curve: EllipticCurve, data: bytes) -> EllipticCurvePublicKey: ... + @abstractmethod + def public_bytes(self, encoding: Encoding, format: PublicFormat) -> bytes: ... + @abstractmethod + def public_numbers(self) -> EllipticCurvePublicNumbers: ... + @abstractmethod + def verifier(self, signature: bytes, signature_algorithm: EllipticCurveSignatureAlgorithm) -> AsymmetricVerificationContext: ... + @abstractmethod + def verify(self, signature: bytes, data: bytes, signature_algorithm: EllipticCurveSignatureAlgorithm) -> None: ... + +EllipticCurvePublicKeyWithSerialization = EllipticCurvePublicKey + +class EllipticCurvePublicNumbers(object): + @property + def curve(self) -> EllipticCurve: ... + @property + def x(self) -> int: ... + @property + def y(self) -> int: ... + def __init__(self, x: int, y: int, curve: EllipticCurve) -> None: ... + @classmethod + def from_encoded_point(cls, curve: EllipticCurve, data: bytes) -> EllipticCurvePublicNumbers: ... + def public_key(self, backend: EllipticCurveBackend) -> EllipticCurvePublicKey: ... + +class EllipticCurveSignatureAlgorithm(metaclass=ABCMeta): + @property + @abstractmethod + def algorithm(self) -> Union[HashAlgorithm, Prehashed]: ... + +class ECDH(object): ... + +class ECDSA(EllipticCurveSignatureAlgorithm): + def __init__(self, algorithm: HashAlgorithm): ... + @property + def algorithm(self) -> Union[HashAlgorithm, Prehashed]: ... + +def derive_private_key(private_value: int, curve: EllipticCurve, backend: EllipticCurveBackend) -> EllipticCurvePrivateKey: ... +def generate_private_key(curve: EllipticCurve, backend: EllipticCurveBackend) -> EllipticCurvePrivateKey: ... +def get_curve_for_oid(oid: ObjectIdentifier) -> EllipticCurve: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ed25519.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ed25519.pyi new file mode 100644 index 00000000..518d2d6b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ed25519.pyi @@ -0,0 +1,25 @@ +from abc import ABCMeta, abstractmethod + +from cryptography.hazmat.primitives.serialization import Encoding, KeySerializationEncryption, PrivateFormat, PublicFormat + +class Ed25519PrivateKey(metaclass=ABCMeta): + @classmethod + def generate(cls) -> Ed25519PrivateKey: ... + @classmethod + def from_private_bytes(cls, data: bytes) -> Ed25519PrivateKey: ... + @abstractmethod + def private_bytes( + self, encoding: Encoding, format: PrivateFormat, encryption_algorithm: KeySerializationEncryption + ) -> bytes: ... + @abstractmethod + def public_key(self) -> Ed25519PublicKey: ... + @abstractmethod + def sign(self, data: bytes) -> bytes: ... + +class Ed25519PublicKey(metaclass=ABCMeta): + @classmethod + def from_public_bytes(cls, data: bytes) -> Ed25519PublicKey: ... + @abstractmethod + def public_bytes(self, encoding: Encoding, format: PublicFormat) -> bytes: ... + @abstractmethod + def verify(self, signature: bytes, data: bytes) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ed448.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ed448.pyi new file mode 100644 index 00000000..fa43fc1b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/ed448.pyi @@ -0,0 +1,25 @@ +from abc import ABCMeta, abstractmethod + +from cryptography.hazmat.primitives.serialization import Encoding, KeySerializationEncryption, PrivateFormat, PublicFormat + +class Ed448PrivateKey(metaclass=ABCMeta): + @classmethod + def generate(cls) -> Ed448PrivateKey: ... + @classmethod + def from_private_bytes(cls, data: bytes) -> Ed448PrivateKey: ... + @abstractmethod + def private_bytes( + self, encoding: Encoding, format: PrivateFormat, encryption_algorithm: KeySerializationEncryption + ) -> bytes: ... + @abstractmethod + def public_key(self) -> Ed448PublicKey: ... + @abstractmethod + def sign(self, data: bytes) -> bytes: ... + +class Ed448PublicKey(metaclass=ABCMeta): + @classmethod + def from_public_bytes(cls, data: bytes) -> Ed448PublicKey: ... + @abstractmethod + def public_bytes(self, encoding: Encoding, format: PublicFormat) -> bytes: ... + @abstractmethod + def verify(self, signature: bytes, data: bytes) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/padding.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/padding.pyi new file mode 100644 index 00000000..233cf4fd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/padding.pyi @@ -0,0 +1,27 @@ +from abc import ABCMeta, abstractmethod +from typing import ClassVar, Optional, Union + +from cryptography.hazmat.primitives.hashes import HashAlgorithm + +class AsymmetricPadding(metaclass=ABCMeta): + @property + @abstractmethod + def name(self) -> str: ... + +class MGF1(object): + def __init__(self, algorithm: HashAlgorithm) -> None: ... + +class OAEP(AsymmetricPadding): + def __init__(self, mgf: MGF1, algorithm: HashAlgorithm, label: Optional[bytes]) -> None: ... + @property + def name(self) -> str: ... + +class PKCS1v15(AsymmetricPadding): + @property + def name(self) -> str: ... + +class PSS(AsymmetricPadding): + MAX_LENGTH: ClassVar[object] + def __init__(self, mgf: MGF1, salt_length: Union[int, object]) -> None: ... + @property + def name(self) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/rsa.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/rsa.pyi new file mode 100644 index 00000000..30604dbe --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/rsa.pyi @@ -0,0 +1,79 @@ +from abc import ABCMeta, abstractmethod +from typing import Tuple, Union + +from cryptography.hazmat.backends.interfaces import RSABackend +from cryptography.hazmat.primitives.asymmetric import AsymmetricVerificationContext +from cryptography.hazmat.primitives.asymmetric.padding import AsymmetricPadding +from cryptography.hazmat.primitives.asymmetric.utils import Prehashed +from cryptography.hazmat.primitives.hashes import HashAlgorithm +from cryptography.hazmat.primitives.serialization import Encoding, KeySerializationEncryption, PrivateFormat, PublicFormat + +class RSAPrivateKey(metaclass=ABCMeta): + @property + @abstractmethod + def key_size(self) -> int: ... + @abstractmethod + def decrypt(self, ciphertext: bytes, padding: AsymmetricPadding) -> bytes: ... + @abstractmethod + def public_key(self) -> RSAPublicKey: ... + @abstractmethod + def sign(self, data: bytes, padding: AsymmetricPadding, algorithm: Union[HashAlgorithm, Prehashed]) -> bytes: ... + +class RSAPrivateKeyWithSerialization(RSAPrivateKey): + @abstractmethod + def private_bytes( + self, encoding: Encoding, format: PrivateFormat, encryption_algorithm: KeySerializationEncryption + ) -> bytes: ... + @abstractmethod + def private_numbers(self) -> RSAPrivateNumbers: ... + +class RSAPublicKey(metaclass=ABCMeta): + @property + @abstractmethod + def key_size(self) -> int: ... + @abstractmethod + def encrypt(self, plaintext: bytes, padding: AsymmetricPadding) -> bytes: ... + @abstractmethod + def public_bytes(self, encoding: Encoding, format: PublicFormat) -> bytes: ... + @abstractmethod + def public_numbers(self) -> RSAPublicNumbers: ... + @abstractmethod + def verifier(self, signature: bytes, padding: AsymmetricPadding, + algorithm: Union[HashAlgorithm, Prehashed]) -> AsymmetricVerificationContext: ... + @abstractmethod + def verify(self, signature: bytes, data: bytes, padding: AsymmetricPadding, + algorithm: Union[HashAlgorithm, Prehashed]) -> None: ... + +RSAPublicKeyWithSerialization = RSAPublicKey + +def generate_private_key(public_exponent: int, key_size: int, backend: RSABackend) -> RSAPrivateKeyWithSerialization: ... +def rsa_crt_iqmp(p: int, q: int) -> int: ... +def rsa_crt_dmp1(private_exponent: int, p: int) -> int: ... +def rsa_crt_dmq1(private_exponent: int, q: int) -> int: ... +def rsa_recover_prime_factors(n: int, e: int, d: int) -> Tuple[int, int]: ... + +class RSAPrivateNumbers(object): + def __init__(self, p: int, q: int, d: int, dmp1: int, dmq1: int, iqmp: int, public_numbers: RSAPublicNumbers) -> None: ... + @property + def p(self) -> int: ... + @property + def q(self) -> int: ... + @property + def d(self) -> int: ... + @property + def dmp1(self) -> int: ... + @property + def dmq1(self) -> int: ... + @property + def iqmp(self) -> int: ... + @property + def public_numbers(self) -> RSAPublicNumbers: ... + def private_key(self, backend) -> RSAPrivateKey: ... + +class RSAPublicNumbers(object): + def __init__(self, e: int, n: int) -> None: ... + @property + def p(self) -> int: ... + @property + def q(self) -> int: ... + def public_key(self, backend) -> RSAPublicKey: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/utils.pyi new file mode 100644 index 00000000..136d270d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/utils.pyi @@ -0,0 +1,6 @@ +from typing import Tuple + +def decode_dss_signature(signature: bytes) -> Tuple[int, int]: ... +def encode_dss_signature(r: int, s: int) -> bytes: ... + +class Prehashed(object): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/x25519.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/x25519.pyi new file mode 100644 index 00000000..245878df --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/x25519.pyi @@ -0,0 +1,23 @@ +from abc import ABCMeta, abstractmethod + +from cryptography.hazmat.primitives.serialization import Encoding, KeySerializationEncryption, PrivateFormat, PublicFormat + +class X25519PrivateKey(metaclass=ABCMeta): + @classmethod + def from_private_bytes(cls, data: bytes) -> X25519PrivateKey: ... + @classmethod + def generate(cls) -> X25519PrivateKey: ... + @abstractmethod + def exchange(self, peer_public_key: X25519PublicKey) -> bytes: ... + @abstractmethod + def private_bytes( + self, encoding: Encoding, format: PrivateFormat, encryption_algorithm: KeySerializationEncryption + ) -> bytes: ... + @abstractmethod + def public_key(self) -> X25519PublicKey: ... + +class X25519PublicKey(metaclass=ABCMeta): + @classmethod + def from_public_bytes(cls, data: bytes) -> X25519PublicKey: ... + @abstractmethod + def public_bytes(self, encoding: Encoding, format: PublicFormat) -> bytes: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/x448.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/x448.pyi new file mode 100644 index 00000000..a4620e51 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/asymmetric/x448.pyi @@ -0,0 +1,23 @@ +from abc import ABCMeta, abstractmethod + +from cryptography.hazmat.primitives.serialization import Encoding, KeySerializationEncryption, PrivateFormat, PublicFormat + +class X448PrivateKey(metaclass=ABCMeta): + @classmethod + def from_private_bytes(cls, data: bytes) -> X448PrivateKey: ... + @classmethod + def generate(cls) -> X448PrivateKey: ... + @abstractmethod + def exchange(self, peer_public_key: X448PublicKey) -> bytes: ... + @abstractmethod + def private_bytes( + self, encoding: Encoding, format: PrivateFormat, encryption_algorithm: KeySerializationEncryption + ) -> bytes: ... + @abstractmethod + def public_key(self) -> X448PublicKey: ... + +class X448PublicKey(metaclass=ABCMeta): + @classmethod + def from_public_bytes(cls, data: bytes) -> X448PublicKey: ... + @abstractmethod + def public_bytes(self, encoding: Encoding, format: PublicFormat) -> bytes: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/__init__.pyi new file mode 100644 index 00000000..547a288d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/__init__.pyi @@ -0,0 +1,43 @@ +from abc import ABCMeta, abstractmethod + +from cryptography.hazmat.backends.interfaces import CipherBackend +from cryptography.hazmat.primitives.ciphers.modes import Mode + +class AEADCipherContext(metaclass=ABCMeta): + @abstractmethod + def authenticate_additional_data(self, data: bytes) -> None: ... + +class AEADDecryptionContext(metaclass=ABCMeta): + @abstractmethod + def finalize_with_tag(self, tag: bytes) -> bytes: ... + +class AEADEncryptionContext(metaclass=ABCMeta): + @property + @abstractmethod + def tag(self) -> bytes: ... + +class BlockCipherAlgorithm(metaclass=ABCMeta): + @property + @abstractmethod + def block_size(self) -> int: ... + +class Cipher(object): + def __init__(self, algorithm: CipherAlgorithm, mode: Mode, backend: CipherBackend) -> None: ... + def decryptor(self) -> CipherContext: ... + def encryptor(self) -> CipherContext: ... + +class CipherAlgorithm(metaclass=ABCMeta): + @property + @abstractmethod + def key_size(self) -> int: ... + @property + @abstractmethod + def name(self) -> str: ... + +class CipherContext(metaclass=ABCMeta): + @abstractmethod + def finalize(self) -> bytes: ... + @abstractmethod + def update(self, data: bytes) -> bytes: ... + @abstractmethod + def update_into(self, data: bytes, buf) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/aead.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/aead.pyi new file mode 100644 index 00000000..68b3dc19 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/aead.pyi @@ -0,0 +1,22 @@ +from typing import Optional + +class AESCCM(object): + def __init__(self, key: bytes, tag_length: Optional[int]) -> None: ... + def decrypt(self, nonce: bytes, data: bytes, associated_data: Optional[bytes]) -> bytes: ... + def encrypt(self, nonce: bytes, data: bytes, associated_data: Optional[bytes]) -> bytes: ... + @classmethod + def generate_key(cls, bit_length: int) -> bytes: ... + +class AESGCM(object): + def __init__(self, key: bytes) -> None: ... + def decrypt(self, nonce: bytes, data: bytes, associated_data: Optional[bytes]) -> bytes: ... + def encrypt(self, nonce: bytes, data: bytes, associated_data: Optional[bytes]) -> bytes: ... + @classmethod + def generate_key(cls, bit_length: int) -> bytes: ... + +class ChaCha20Poly1305(object): + def __init__(self, key: bytes) -> None: ... + def decrypt(self, nonce: bytes, data: bytes, associated_data: Optional[bytes]) -> bytes: ... + def encrypt(self, nonce: bytes, data: bytes, associated_data: Optional[bytes]) -> bytes: ... + @classmethod + def generate_key(cls) -> bytes: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/algorithms.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/algorithms.pyi new file mode 100644 index 00000000..41940d54 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/algorithms.pyi @@ -0,0 +1,79 @@ +from cryptography.hazmat.primitives.ciphers import BlockCipherAlgorithm, CipherAlgorithm +from cryptography.hazmat.primitives.ciphers.modes import ModeWithNonce + +class AES(BlockCipherAlgorithm, CipherAlgorithm): + def __init__(self, key: bytes) -> None: ... + @property + def block_size(self) -> int: ... + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class ARC4(CipherAlgorithm): + def __init__(self, key: bytes) -> None: ... + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class Blowfish(BlockCipherAlgorithm, CipherAlgorithm): + def __init__(self, key: bytes) -> None: ... + @property + def block_size(self) -> int: ... + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class Camelia(BlockCipherAlgorithm, CipherAlgorithm): + def __init__(self, key: bytes) -> None: ... + @property + def block_size(self) -> int: ... + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class CAST5(BlockCipherAlgorithm, CipherAlgorithm): + def __init__(self, key: bytes) -> None: ... + @property + def block_size(self) -> int: ... + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class ChaCha20(CipherAlgorithm, ModeWithNonce): + def __init__(self, key: bytes, nonce: bytes) -> None: ... + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + @property + def nonce(self) -> bytes: ... + +class IDEA(CipherAlgorithm): + def __init__(self, key: bytes) -> None: ... + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class SEED(BlockCipherAlgorithm, CipherAlgorithm): + def __init__(self, key: bytes) -> None: ... + @property + def block_size(self) -> int: ... + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... + +class TripleDES(BlockCipherAlgorithm, CipherAlgorithm): + def __init__(self, key: bytes) -> None: ... + @property + def block_size(self) -> int: ... + @property + def key_size(self) -> int: ... + @property + def name(self) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/modes.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/modes.pyi new file mode 100644 index 00000000..633f3b16 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/ciphers/modes.pyi @@ -0,0 +1,94 @@ +from abc import ABCMeta, abstractmethod +from typing import Optional + +from cryptography.hazmat.primitives.ciphers import CipherAlgorithm + +class Mode(metaclass=ABCMeta): + @property + @abstractmethod + def name(self) -> str: ... + @abstractmethod + def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ... + +class ModeWithAuthenticationTag(metaclass=ABCMeta): + @property + @abstractmethod + def tag(self) -> bytes: ... + +class ModeWithInitializationVector(metaclass=ABCMeta): + @property + @abstractmethod + def initialization_vector(self) -> bytes: ... + +class ModeWithNonce(metaclass=ABCMeta): + @property + @abstractmethod + def nonce(self) -> bytes: ... + +class ModeWithTweak(metaclass=ABCMeta): + @property + @abstractmethod + def tweak(self) -> bytes: ... + +class CBC(Mode, ModeWithInitializationVector): + def __init__(self, initialization_vector: bytes) -> None: ... + @property + def initialization_vector(self) -> bytes: ... + @property + def name(self) -> str: ... + def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ... + +class CTR(Mode, ModeWithNonce): + def __init__(self, nonce: bytes) -> None: ... + @property + def name(self) -> str: ... + @property + def nonce(self) -> bytes: ... + def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ... + +class CFB(Mode, ModeWithInitializationVector): + def __init__(self, initialization_vector: bytes) -> None: ... + @property + def initialization_vector(self) -> bytes: ... + @property + def name(self) -> str: ... + def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ... + +class CFB8(Mode, ModeWithInitializationVector): + def __init__(self, initialization_vector: bytes) -> None: ... + @property + def initialization_vector(self) -> bytes: ... + @property + def name(self) -> str: ... + def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ... + +class ECB(Mode): + @property + def name(self) -> str: ... + def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ... + +class GCM(Mode, ModeWithInitializationVector, ModeWithAuthenticationTag): + def __init__(self, initialization_vector: bytes, tag: Optional[bytes], min_tag_length: Optional[int]) -> None: ... + @property + def initialization_vector(self) -> bytes: ... + @property + def name(self) -> str: ... + @property + def tag(self) -> bytes: ... + def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ... + +class OFB(Mode, ModeWithInitializationVector): + def __init__(self, initialization_vector: bytes) -> None: ... + @property + def initialization_vector(self) -> bytes: ... + @property + def name(self) -> str: ... + def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ... + +class XTS(Mode, ModeWithTweak): + def __init__(self, tweak: bytes) -> None: ... + @property + def name(self) -> str: ... + @property + def tweak(self) -> bytes: ... + def validate_for_algorithm(self, algorithm: CipherAlgorithm) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/cmac.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/cmac.pyi new file mode 100644 index 00000000..8a2b4635 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/cmac.pyi @@ -0,0 +1,9 @@ +from cryptography.hazmat.backends.interfaces import CMACBackend +from cryptography.hazmat.primitives.ciphers import BlockCipherAlgorithm + +class CMAC(object): + def __init__(self, algorithm: BlockCipherAlgorithm, backend: CMACBackend) -> None: ... + def copy(self) -> CMAC: ... + def finalize(self) -> bytes: ... + def update(self, data: bytes) -> None: ... + def verify(self, signature: bytes) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/constant_time.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/constant_time.pyi new file mode 100644 index 00000000..9a0733e6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/constant_time.pyi @@ -0,0 +1 @@ +def bytes_eq(a: bytes, b: bytes) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/hashes.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/hashes.pyi new file mode 100644 index 00000000..2b62df92 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/hashes.pyi @@ -0,0 +1,43 @@ +from abc import ABCMeta, abstractmethod + +from cryptography.hazmat.backends.interfaces import HashBackend + +class HashAlgorithm(metaclass=ABCMeta): + digest_size: int + name: str + +class HashContext(metaclass=ABCMeta): + algorithm: HashAlgorithm + @abstractmethod + def copy(self) -> HashContext: ... + @abstractmethod + def finalize(self) -> bytes: ... + @abstractmethod + def update(self, data: bytes) -> None: ... + +class BLAKE2b(HashAlgorithm): ... +class BLAKE2s(HashAlgorithm): ... +class MD5(HashAlgorithm): ... +class SHA1(HashAlgorithm): ... +class SHA224(HashAlgorithm): ... +class SHA256(HashAlgorithm): ... +class SHA384(HashAlgorithm): ... +class SHA3_224(HashAlgorithm): ... +class SHA3_256(HashAlgorithm): ... +class SHA3_384(HashAlgorithm): ... +class SHA3_512(HashAlgorithm): ... +class SHA512(HashAlgorithm): ... +class SHA512_224(HashAlgorithm): ... +class SHA512_256(HashAlgorithm): ... + +class SHAKE128(HashAlgorithm): + def __init__(self, digest_size: int) -> None: ... + +class SHAKE256(HashAlgorithm): + def __init__(self, digest_size: int) -> None: ... + +class Hash(HashContext): + def __init__(self, algorithm: HashAlgorithm, backend: HashBackend): ... + def copy(self) -> Hash: ... + def finalize(self) -> bytes: ... + def update(self, data: bytes) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/hmac.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/hmac.pyi new file mode 100644 index 00000000..200f719a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/hmac.pyi @@ -0,0 +1,9 @@ +from cryptography.hazmat.backends.interfaces import HMACBackend +from cryptography.hazmat.primitives.hashes import HashAlgorithm + +class HMAC(object): + def __init__(self, key: bytes, algorithm: HashAlgorithm, backend: HMACBackend) -> None: ... + def copy(self) -> HMAC: ... + def finalize(self) -> bytes: ... + def update(self, msg: bytes) -> None: ... + def verify(self, signature: bytes) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/__init__.pyi new file mode 100644 index 00000000..549ca912 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/__init__.pyi @@ -0,0 +1,7 @@ +from abc import ABCMeta, abstractmethod + +class KeyDerivationFunction(metaclass=ABCMeta): + @abstractmethod + def derive(self, key_material: bytes) -> bytes: ... + @abstractmethod + def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/concatkdf.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/concatkdf.pyi new file mode 100644 index 00000000..a995a5fa --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/concatkdf.pyi @@ -0,0 +1,17 @@ +from typing import Optional + +from cryptography.hazmat.backends.interfaces import HashBackend, HMACBackend +from cryptography.hazmat.primitives.hashes import HashAlgorithm +from cryptography.hazmat.primitives.kdf import KeyDerivationFunction + +class ConcatKDFHash(KeyDerivationFunction): + def __init__(self, algorithm: HashAlgorithm, length: int, otherinfo: Optional[bytes], backend: HashBackend): ... + def derive(self, key_material: bytes) -> bytes: ... + def verify(self, key_material: bytes, expected_key: bytes) -> None: ... + +class ConcatKDFHMAC(KeyDerivationFunction): + def __init__( + self, algorithm: HashAlgorithm, length: int, salt: Optional[bytes], otherinfo: Optional[bytes], backend: HMACBackend + ): ... + def derive(self, key_material: bytes) -> bytes: ... + def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/hkdf.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/hkdf.pyi new file mode 100644 index 00000000..112a7307 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/hkdf.pyi @@ -0,0 +1,17 @@ +from typing import Optional + +from cryptography.hazmat.backends.interfaces import HMACBackend +from cryptography.hazmat.primitives.hashes import HashAlgorithm +from cryptography.hazmat.primitives.kdf import KeyDerivationFunction + +class HKDF(KeyDerivationFunction): + def __init__( + self, algorithm: HashAlgorithm, length: int, salt: Optional[bytes], info: Optional[bytes], backend: HMACBackend + ): ... + def derive(self, key_material: bytes) -> bytes: ... + def verify(self, key_material: bytes, expected_key: bytes) -> None: ... + +class HKDFExpand(KeyDerivationFunction): + def __init__(self, algorithm: HashAlgorithm, length: int, info: Optional[bytes], backend: HMACBackend): ... + def derive(self, key_material: bytes) -> bytes: ... + def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/kbkdf.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/kbkdf.pyi new file mode 100644 index 00000000..a96c34c9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/kbkdf.pyi @@ -0,0 +1,30 @@ +from enum import Enum +from typing import Optional + +from cryptography.hazmat.backends.interfaces import HMACBackend +from cryptography.hazmat.primitives.hashes import HashAlgorithm +from cryptography.hazmat.primitives.kdf import KeyDerivationFunction + +class Mode(Enum): + CounterMode: str + +class CounterLocation(Enum): + BeforeFixed: str + AfterFixed: str + +class KBKDFHMAC(KeyDerivationFunction): + def __init__( + self, + algorithm: HashAlgorithm, + mode: Mode, + length: int, + rlen: int, + llen: int, + location: CounterLocation, + label: Optional[bytes], + context: Optional[bytes], + fixed: Optional[bytes], + backend: HMACBackend, + ): ... + def derive(self, key_material: bytes) -> bytes: ... + def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/pbkdf2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/pbkdf2.pyi new file mode 100644 index 00000000..5e217bf8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/pbkdf2.pyi @@ -0,0 +1,8 @@ +from cryptography.hazmat.backends.interfaces import PBKDF2HMACBackend +from cryptography.hazmat.primitives.hashes import HashAlgorithm +from cryptography.hazmat.primitives.kdf import KeyDerivationFunction + +class PBKDF2HMAC(KeyDerivationFunction): + def __init__(self, algorithm: HashAlgorithm, length: int, salt: bytes, iterations: int, backend: PBKDF2HMACBackend): ... + def derive(self, key_material: bytes) -> bytes: ... + def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/scrypt.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/scrypt.pyi new file mode 100644 index 00000000..a0880292 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/scrypt.pyi @@ -0,0 +1,7 @@ +from cryptography.hazmat.backends.interfaces import ScryptBackend +from cryptography.hazmat.primitives.kdf import KeyDerivationFunction + +class Scrypt(KeyDerivationFunction): + def __init__(self, salt: bytes, length: int, n: int, r: int, p: int, backend: ScryptBackend): ... + def derive(self, key_material: bytes) -> bytes: ... + def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/x963kdf.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/x963kdf.pyi new file mode 100644 index 00000000..324bc179 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/kdf/x963kdf.pyi @@ -0,0 +1,10 @@ +from typing import Optional + +from cryptography.hazmat.backends.interfaces import HashBackend +from cryptography.hazmat.primitives.hashes import HashAlgorithm +from cryptography.hazmat.primitives.kdf import KeyDerivationFunction + +class X963KDF(KeyDerivationFunction): + def __init__(self, algorithm: HashAlgorithm, length: int, sharedinfo: Optional[bytes], backend: HashBackend): ... + def derive(self, key_material: bytes) -> bytes: ... + def verify(self, key_material: bytes, expected_key: bytes) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/keywrap.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/keywrap.pyi new file mode 100644 index 00000000..b26f1fb8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/keywrap.pyi @@ -0,0 +1,8 @@ +from cryptography.hazmat.backends.interfaces import CipherBackend + +def aes_key_wrap(wrapping_key: bytes, key_to_wrap: bytes, backend: CipherBackend) -> bytes: ... +def aes_key_wrap_with_padding(wrapping_key: bytes, key_to_wrap: bytes, backend: CipherBackend) -> bytes: ... +def aes_key_unwrap(wrapping_key: bytes, wrapped_key: bytes, backend: CipherBackend) -> bytes: ... +def aes_key_unwrap_with_padding(wrapping_key: bytes, wrapped_key: bytes, backend: CipherBackend) -> bytes: ... + +class InvalidUnwrap(Exception): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/padding.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/padding.pyi new file mode 100644 index 00000000..7a9d5a8e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/padding.pyi @@ -0,0 +1,17 @@ +from abc import ABCMeta, abstractmethod + +class PaddingContext(metaclass=ABCMeta): + @abstractmethod + def finalize(self) -> bytes: ... + @abstractmethod + def update(self, data: bytes) -> bytes: ... + +class ANSIX923(object): + def __init__(self, block_size: int) -> None: ... + def padder(self) -> PaddingContext: ... + def unpadder(self) -> PaddingContext: ... + +class PKCS7(object): + def __init__(self, block_size: int) -> None: ... + def padder(self) -> PaddingContext: ... + def unpadder(self) -> PaddingContext: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/poly1305.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/poly1305.pyi new file mode 100644 index 00000000..f8cb5304 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/poly1305.pyi @@ -0,0 +1,12 @@ +from cryptography.hazmat.backends.interfaces import HMACBackend +from cryptography.hazmat.primitives.hashes import HashAlgorithm + +class Poly1305(object): + def __init__(self, key: bytes) -> None: ... + def finalize(self) -> bytes: ... + @classmethod + def generate_tag(cls, key: bytes, data: bytes) -> bytes: ... + def update(self, data: bytes) -> None: ... + def verify(self, tag: bytes) -> None: ... + @classmethod + def verify_tag(cls, key: bytes, data: bytes, tag: bytes) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/serialization/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/serialization/__init__.pyi new file mode 100644 index 00000000..10304878 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/serialization/__init__.pyi @@ -0,0 +1,40 @@ +from abc import ABCMeta +from enum import Enum +from typing import Optional + +def load_pem_private_key(data: bytes, password: Optional[bytes], backend): ... +def load_pem_public_key(data: bytes, backend): ... +def load_der_private_key(data: bytes, password: Optional[bytes], backend): ... +def load_der_public_key(data: bytes, backend): ... +def load_ssh_public_key(data: bytes, backend): ... + +class Encoding(Enum): + PEM: str + DER: str + OpenSSH: str + Raw: str + X962: str + +class PrivateFormat(Enum): + PKCS8: str + TraditionalOpenSSL: str + Raw: str + +class PublicFormat(Enum): + SubjectPublicKeyInfo: str + PKCS1: str + OpenSSH: str + Raw: str + CompressedPoint: str + UncompressedPoint: str + +class ParameterFormat(Enum): + PKCS3: str + +class KeySerializationEncryption(metaclass=ABCMeta): ... + +class BestAvailableEncryption(KeySerializationEncryption): + password: bytes + def __init__(self, password: bytes) -> None: ... + +class NoEncryption(KeySerializationEncryption): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/serialization/pkcs12.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/serialization/pkcs12.pyi new file mode 100644 index 00000000..d903ae47 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/serialization/pkcs12.pyi @@ -0,0 +1,3 @@ +from typing import Optional + +def load_key_and_certificates(data: bytes, password: Optional[bytes], backend): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/__init__.pyi new file mode 100644 index 00000000..eff812f2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/__init__.pyi @@ -0,0 +1 @@ +class InvalidToken(Exception): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/hotp.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/hotp.pyi new file mode 100644 index 00000000..e83c3ac9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/hotp.pyi @@ -0,0 +1,12 @@ +from typing import Optional + +from cryptography.hazmat.backends.interfaces import HMACBackend +from cryptography.hazmat.primitives.hashes import HashAlgorithm + +class HOTP(object): + def __init__( + self, key: bytes, length: int, algorithm: HashAlgorithm, backend: HMACBackend, enforce_key_length: bool = ... + ): ... + def generate(self, counter: int) -> bytes: ... + def get_provisioning_uri(self, account_name: str, counter: int, issuer: Optional[str]) -> str: ... + def verify(self, hotp: bytes, counter: int) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/totp.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/totp.pyi new file mode 100644 index 00000000..306bfe1c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/hazmat/primitives/twofactor/totp.pyi @@ -0,0 +1,18 @@ +from typing import Optional + +from cryptography.hazmat.backends.interfaces import HMACBackend +from cryptography.hazmat.primitives.hashes import HashAlgorithm + +class TOTP(object): + def __init__( + self, + key: bytes, + length: int, + algorithm: HashAlgorithm, + time_step: int, + backend: HMACBackend, + enforce_key_length: bool = ..., + ): ... + def generate(self, time: int) -> bytes: ... + def get_provisioning_uri(self, account_name: str, issuer: Optional[str]) -> str: ... + def verify(self, totp: bytes, time: int) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/x509.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/x509.pyi new file mode 100644 index 00000000..d851d3f6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/cryptography/x509.pyi @@ -0,0 +1,299 @@ +import datetime +from abc import ABCMeta, abstractmethod +from enum import Enum +from ipaddress import IPv4Address, IPv4Network, IPv6Address, IPv6Network +from typing import Any, ClassVar, Generator, List, Optional, Union, Text, Iterable, Sequence, Type + +from cryptography.hazmat.backends.interfaces import X509Backend +from cryptography.hazmat.primitives.asymmetric.dsa import DSAPrivateKey, DSAPublicKey +from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurvePrivateKey, EllipticCurvePublicKey +from cryptography.hazmat.primitives.asymmetric.ed448 import Ed448PrivateKey, Ed448PublicKey +from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey, Ed25519PublicKey +from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKey, RSAPublicKey +from cryptography.hazmat.primitives.hashes import HashAlgorithm +from cryptography.hazmat.primitives.serialization import Encoding + +class ObjectIdentifier(object): + def __init__(self, dotted_string: str) -> None: ... + def dotted_string(self) -> str: ... + +class CRLEntryExtensionOID(object): + CERTIFICATE_ISSUER: ClassVar[ObjectIdentifier] + CRL_REASON: ClassVar[ObjectIdentifier] + INVALIDITY_DATE: ClassVar[ObjectIdentifier] + +class ExtensionOID(object): + AUTHORITY_INFORMATION_ACCESS: ClassVar[ObjectIdentifier] + AUTHORITY_KEY_IDENTIFIER: ClassVar[ObjectIdentifier] + BASIC_CONSTRAINTS: ClassVar[ObjectIdentifier] + CERTIFICATE_POLICIES: ClassVar[ObjectIdentifier] + CRL_DISTRIBUTION_POINTS: ClassVar[ObjectIdentifier] + CRL_NUMBER: ClassVar[ObjectIdentifier] + DELTA_CRL_INDICATOR: ClassVar[ObjectIdentifier] + EXTENDED_KEY_USAGE: ClassVar[ObjectIdentifier] + FRESHEST_CRL: ClassVar[ObjectIdentifier] + INHIBIT_ANY_POLICY: ClassVar[ObjectIdentifier] + ISSUER_ALTERNATIVE_NAME: ClassVar[ObjectIdentifier] + ISSUING_DISTRIBUTION_POINT: ClassVar[ObjectIdentifier] + KEY_USAGE: ClassVar[ObjectIdentifier] + NAME_CONSTRAINTS: ClassVar[ObjectIdentifier] + OCSP_NO_CHECK: ClassVar[ObjectIdentifier] + POLICY_CONSTRAINTS: ClassVar[ObjectIdentifier] + POLICY_MAPPINGS: ClassVar[ObjectIdentifier] + PRECERT_POISON: ClassVar[ObjectIdentifier] + PRECERT_SIGNED_CERTIFICATE_TIMESTAMPS: ClassVar[ObjectIdentifier] + SUBJECT_ALTERNATIVE_NAME: ClassVar[ObjectIdentifier] + SUBJECT_DIRECTORY_ATTRIBUTES: ClassVar[ObjectIdentifier] + SUBJECT_INFORMATION_ACCESS: ClassVar[ObjectIdentifier] + SUBJECT_KEY_IDENTIFIER: ClassVar[ObjectIdentifier] + TLS_FEATURE: ClassVar[ObjectIdentifier] + +class NameOID(object): + BUSINESS_CATEGORY: ClassVar[ObjectIdentifier] + COMMON_NAME: ClassVar[ObjectIdentifier] + COUNTRY_NAME: ClassVar[ObjectIdentifier] + DN_QUALIFIER: ClassVar[ObjectIdentifier] + DOMAIN_COMPONENT: ClassVar[ObjectIdentifier] + EMAIL_ADDRESS: ClassVar[ObjectIdentifier] + GENERATION_QUALIFIER: ClassVar[ObjectIdentifier] + GIVEN_NAME: ClassVar[ObjectIdentifier] + JURISDICTION_COUNTRY_NAME: ClassVar[ObjectIdentifier] + JURISDICTION_LOCALITY_NAME: ClassVar[ObjectIdentifier] + JURISDICTION_STATE_OR_PROVINCE_NAME: ClassVar[ObjectIdentifier] + LOCALITY_NAME: ClassVar[ObjectIdentifier] + ORGANIZATIONAL_UNIT_NAME: ClassVar[ObjectIdentifier] + ORGANIZATION_NAME: ClassVar[ObjectIdentifier] + POSTAL_ADDRESS: ClassVar[ObjectIdentifier] + POSTAL_CODE: ClassVar[ObjectIdentifier] + PSEUDONYM: ClassVar[ObjectIdentifier] + SERIAL_NUMBER: ClassVar[ObjectIdentifier] + STATE_OR_PROVINCE_NAME: ClassVar[ObjectIdentifier] + STREET_ADDRESS: ClassVar[ObjectIdentifier] + SURNAME: ClassVar[ObjectIdentifier] + TITLE: ClassVar[ObjectIdentifier] + USER_ID: ClassVar[ObjectIdentifier] + X500_UNIQUE_IDENTIFIER: ClassVar[ObjectIdentifier] + +class OCSPExtensionOID(object): + NONCE: ClassVar[ObjectIdentifier] + +class SignatureAlgorithmOID(object): + DSA_WITH_SHA1: ClassVar[ObjectIdentifier] + DSA_WITH_SHA224: ClassVar[ObjectIdentifier] + DSA_WITH_SHA256: ClassVar[ObjectIdentifier] + ECDSA_WITH_SHA1: ClassVar[ObjectIdentifier] + ECDSA_WITH_SHA224: ClassVar[ObjectIdentifier] + ECDSA_WITH_SHA256: ClassVar[ObjectIdentifier] + ECDSA_WITH_SHA384: ClassVar[ObjectIdentifier] + ECDSA_WITH_SHA512: ClassVar[ObjectIdentifier] + ED25519: ClassVar[ObjectIdentifier] + ED448: ClassVar[ObjectIdentifier] + RSASSA_PSS: ClassVar[ObjectIdentifier] + RSA_WITH_MD5: ClassVar[ObjectIdentifier] + RSA_WITH_SHA1: ClassVar[ObjectIdentifier] + RSA_WITH_SHA224: ClassVar[ObjectIdentifier] + RSA_WITH_SHA256: ClassVar[ObjectIdentifier] + RSA_WITH_SHA384: ClassVar[ObjectIdentifier] + RSA_WITH_SHA512: ClassVar[ObjectIdentifier] + +class NameAttribute(object): + oid: ObjectIdentifier + value: Text + def __init__(self, oid: ObjectIdentifier, value: Text) -> None: ... + def rfc4514_string(self) -> str: ... + +class RelativeDistinguishedName(object): + def __init__(self, attributes: List[NameAttribute]) -> None: ... + def __iter__(self) -> Generator[NameAttribute, None, None]: ... + def get_attributes_for_oid(self, oid: ObjectIdentifier) -> List[NameAttribute]: ... + def rfc4514_string(self) -> str: ... + +class Name(object): + rdns: List[RelativeDistinguishedName] + def __init__(self, attributes: Sequence[Union[NameAttribute, RelativeDistinguishedName]]) -> None: ... + def __iter__(self) -> Generator[NameAttribute, None, None]: ... + def __len__(self) -> int: ... + def get_attributes_for_oid(self, oid: ObjectIdentifier) -> List[NameAttribute]: ... + def public_bytes(self, backend: X509Backend) -> bytes: ... + def rfc4514_string(self) -> str: ... + +class Version(Enum): + v1: int + v3: int + +class Certificate(metaclass=ABCMeta): + extensions: Extensions + issuer: Name + not_valid_after: datetime.datetime + not_valid_before: datetime.datetime + serial_number: int + signature: bytes + signature_algorithm_oid: ObjectIdentifier + signature_hash_algorithm: HashAlgorithm + tbs_certificate_bytes: bytes + subject: Name + version: Version + @abstractmethod + def fingerprint(self, algorithm: HashAlgorithm) -> bytes: ... + @abstractmethod + def public_bytes(self, encoding: Encoding) -> bytes: ... + @abstractmethod + def public_key(self) -> Union[DSAPublicKey, Ed25519PublicKey, Ed448PublicKey, EllipticCurvePublicKey, RSAPublicKey]: ... + +class CertificateBuilder(object): + def __init__(self, issuer_name: Optional[Name] = ..., subject_name: Optional[Name] = ..., + public_key: Union[DSAPublicKey, Ed25519PublicKey, Ed448PublicKey, EllipticCurvePublicKey, RSAPublicKey, None] = ..., + serial_number: Optional[int] = ..., + not_valid_before: Optional[datetime.datetime] = ..., + not_valid_after: Optional[datetime.datetime] = ..., + extensions: Optional[Iterable[ExtensionType]] = ...) -> None: ... + def add_extension(self, extension: ExtensionType, critical: bool) -> CertificateBuilder: ... + def issuer_name(self, name: Name) -> CertificateBuilder: ... + def not_valid_after(self, time: datetime.datetime) -> CertificateBuilder: ... + def not_valid_before(self, time: datetime.datetime) -> CertificateBuilder: ... + def public_key( + self, public_key: Union[DSAPublicKey, Ed25519PublicKey, Ed448PublicKey, EllipticCurvePublicKey, RSAPublicKey] + ) -> CertificateBuilder: ... + def serial_number(self, serial_number: int) -> CertificateBuilder: ... + def sign( + self, + private_key: Union[DSAPrivateKey, Ed25519PrivateKey, Ed448PrivateKey, EllipticCurvePrivateKey, RSAPrivateKey], + algorithm: Optional[HashAlgorithm], + backend: X509Backend, + ) -> Certificate: ... + def subject_name(self, name: Name) -> CertificateBuilder: ... + +class CertificateRevocationList(metaclass=ABCMeta): + extensions: Extensions + issuer: Name + last_update: datetime.datetime + next_update: datetime.datetime + signature: bytes + signature_algorithm_oid: ObjectIdentifier + signature_hash_algorithm: HashAlgorithm + tbs_certlist_bytes: bytes + @abstractmethod + def fingerprint(self, algorithm: HashAlgorithm) -> bytes: ... + @abstractmethod + def get_revoked_certificate_by_serial_number(self, serial_number: int) -> RevokedCertificate: ... + @abstractmethod + def is_signature_valid( + self, public_key: Union[DSAPublicKey, Ed25519PublicKey, Ed448PublicKey, EllipticCurvePublicKey, RSAPublicKey] + ) -> bool: ... + @abstractmethod + def public_bytes(self, encoding: Encoding) -> bytes: ... + +class CertificateRevocationListBuilder(object): + def add_extension(self, extension: ExtensionType, critical: bool) -> CertificateRevocationListBuilder: ... + def add_revoked_certificate(self, revoked_certificate: RevokedCertificate) -> CertificateRevocationListBuilder: ... + def issuer_name(self, name: Name) -> CertificateRevocationListBuilder: ... + def last_update(self, time: datetime.datetime) -> CertificateRevocationListBuilder: ... + def next_update(self, time: datetime.datetime) -> CertificateRevocationListBuilder: ... + def sign( + self, + private_key: Union[DSAPrivateKey, Ed25519PrivateKey, Ed448PrivateKey, EllipticCurvePrivateKey, RSAPrivateKey], + algorithm: Optional[HashAlgorithm], + backend: X509Backend, + ) -> CertificateRevocationList: ... + +class CertificateSigningRequest(metaclass=ABCMeta): + extensions: Extensions + is_signature_valid: bool + signature: bytes + signature_algorithm_oid: ObjectIdentifier + signature_hash_algorithm: HashAlgorithm + subject: Name + tbs_certrequest_bytes: bytes + @abstractmethod + def public_bytes(self, encoding: Encoding) -> bytes: ... + @abstractmethod + def public_key(self) -> Union[DSAPublicKey, Ed25519PublicKey, Ed448PublicKey, EllipticCurvePublicKey, RSAPublicKey]: ... + +class CertificateSigningRequestBuilder(object): + def add_extension(self, extension: ExtensionType, critical: bool) -> CertificateSigningRequestBuilder: ... + def subject_name(self, name: Name) -> CertificateSigningRequestBuilder: ... + def sign( + self, + private_key: Union[DSAPrivateKey, Ed25519PrivateKey, Ed448PrivateKey, EllipticCurvePrivateKey, RSAPrivateKey], + algorithm: Optional[HashAlgorithm], + backend: X509Backend, + ) -> CertificateSigningRequest: ... + +class RevokedCertificate(metaclass=ABCMeta): + extensions: Extensions + revocation_date: datetime.datetime + serial_number: int + +class RevokedCertificateBuilder(object): + def add_extension(self, extension: ExtensionType, critical: bool) -> RevokedCertificateBuilder: ... + def build(self, backend: X509Backend) -> RevokedCertificate: ... + def revocation_date(self, time: datetime.datetime) -> RevokedCertificateBuilder: ... + def serial_number(self, serial_number: int) -> RevokedCertificateBuilder: ... + +# General Name Classes + +class GeneralName(metaclass=ABCMeta): + value: Any + +class DirectoryName(GeneralName): + value: Name + def __init__(self, value: Name) -> None: ... + +class DNSName(GeneralName): + value: Text + def __init__(self, value: Text) -> None: ... + +class IPAddress(GeneralName): + value: Union[IPv4Address, IPv6Address, IPv4Network, IPv6Network] + def __init__(self, value: Union[IPv4Address, IPv6Address, IPv4Network, IPv6Network]) -> None: ... + +class OtherName(GeneralName): + type_id: ObjectIdentifier + value: bytes + def __init__(self, type_id: ObjectIdentifier, value: bytes) -> None: ... + +class RegisteredID(GeneralName): + value: ObjectIdentifier + def __init__(self, value: ObjectIdentifier) -> None: ... + +class RFC822Name(GeneralName): + value: Text + def __init__(self, value: Text) -> None: ... + +class UniformResourceIdentifier(GeneralName): + value: Text + def __init__(self, value: Text) -> None: ... + +# X.509 Extensions + +class Extension(object): + critical: bool + oid: ExtensionOID + value: ExtensionType + +class ExtensionType(metaclass=ABCMeta): + oid: ExtensionOID + +class Extensions(object): + def __init__(self, general_names: List[Extension]) -> None: ... + def __iter__(self) -> Generator[Extension, None, None]: ... + def get_extension_for_oid(self, oid: ObjectIdentifier) -> Extension: ... + def get_extension_for_class(self, extclass: Type[ExtensionType]) -> Extension: ... + +class IssuerAlternativeName(ExtensionType): + def __init__(self, general_names: List[GeneralName]) -> None: ... + def __iter__(self) -> Generator[GeneralName, None, None]: ... + def get_values_for_type(self, type: Type[GeneralName]) -> List[Any]: ... + +class SubjectAlternativeName(ExtensionType): + def __init__(self, general_names: List[GeneralName]) -> None: ... + def __iter__(self) -> Generator[GeneralName, None, None]: ... + def get_values_for_type(self, type: Type[GeneralName]) -> List[Any]: ... + +def load_der_x509_certificate(data: bytes, backend: X509Backend) -> Certificate: ... +def load_pem_x509_certificate(data: bytes, backend: X509Backend) -> Certificate: ... +def load_der_x509_crl(data: bytes, backend: X509Backend) -> CertificateRevocationList: ... +def load_pem_x509_crl(data: bytes, backend: X509Backend) -> CertificateRevocationList: ... +def load_der_x509_csr(data: bytes, backend: X509Backend) -> CertificateSigningRequest: ... +def load_pem_x509_csr(data: bytes, backend: X509Backend) -> CertificateSigningRequest: ... +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/_common.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/_common.pyi new file mode 100644 index 00000000..7f1b2395 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/_common.pyi @@ -0,0 +1,17 @@ +from typing import Optional, TypeVar + +_T = TypeVar("_T") + +class weekday(object): + def __init__(self, weekday: int, n: Optional[int] = ...) -> None: ... + + def __call__(self: _T, n: int) -> _T: ... + + def __eq__(self, other) -> bool: ... + + def __repr__(self) -> str: ... + + def __hash__(self) -> int: ... + + weekday: int + n: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/parser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/parser.pyi new file mode 100644 index 00000000..045a7934 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/parser.pyi @@ -0,0 +1,46 @@ +from typing import List, Tuple, Optional, Callable, Union, IO, Any, Dict, Mapping, Text +from datetime import datetime, tzinfo + +_FileOrStr = Union[bytes, Text, IO[str], IO[Any]] + + +class parserinfo(object): + JUMP: List[str] + WEEKDAYS: List[Tuple[str, str]] + MONTHS: List[Tuple[str, str]] + HMS: List[Tuple[str, str, str]] + AMPM: List[Tuple[str, str]] + UTCZONE: List[str] + PERTAIN: List[str] + TZOFFSET: Dict[str, int] + + def __init__(self, dayfirst: bool = ..., yearfirst: bool = ...) -> None: ... + def jump(self, name: Text) -> bool: ... + def weekday(self, name: Text) -> Optional[int]: ... + def month(self, name: Text) -> Optional[int]: ... + def hms(self, name: Text) -> Optional[int]: ... + def ampm(self, name: Text) -> Optional[int]: ... + def pertain(self, name: Text) -> bool: ... + def utczone(self, name: Text) -> bool: ... + def tzoffset(self, name: Text) -> Optional[int]: ... + def convertyear(self, year: int) -> int: ... + def validate(self, res: datetime) -> bool: ... + +class parser(object): + def __init__(self, info: Optional[parserinfo] = ...) -> None: ... + def parse(self, timestr: _FileOrStr, + default: Optional[datetime] = ..., + ignoretz: bool = ..., tzinfos: Optional[Mapping[Text, tzinfo]] = ..., + **kwargs: Any) -> datetime: ... + +def isoparse(dt_str: Union[str, bytes, IO[str], IO[bytes]]) -> datetime: ... + +DEFAULTPARSER: parser +def parse(timestr: _FileOrStr, parserinfo: Optional[parserinfo] = ..., **kwargs: Any) -> datetime: ... +class _tzparser: ... + +DEFAULTTZPARSER: _tzparser + +class InvalidDatetimeError(ValueError): ... +class InvalidDateError(InvalidDatetimeError): ... +class InvalidTimeError(InvalidDatetimeError): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/relativedelta.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/relativedelta.pyi new file mode 100644 index 00000000..40ee586f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/relativedelta.pyi @@ -0,0 +1,91 @@ +from typing import overload, Any, List, Optional, SupportsFloat, TypeVar, Union +from datetime import date, datetime, timedelta + +from ._common import weekday + + +_SelfT = TypeVar('_SelfT', bound=relativedelta) +_DateT = TypeVar('_DateT', date, datetime) +# Work around attribute and type having the same name. +_weekday = weekday + +MO: weekday +TU: weekday +WE: weekday +TH: weekday +FR: weekday +SA: weekday +SU: weekday + + +class relativedelta(object): + years: int + months: int + days: int + leapdays: int + hours: int + minutes: int + seconds: int + microseconds: int + year: Optional[int] + month: Optional[int] + weekday: Optional[_weekday] + day: Optional[int] + hour: Optional[int] + minute: Optional[int] + second: Optional[int] + microsecond: Optional[int] + def __init__(self, + dt1: Optional[date] = ..., + dt2: Optional[date] = ..., + years: Optional[int] = ..., months: Optional[int] = ..., + days: Optional[int] = ..., leapdays: Optional[int] = ..., + weeks: Optional[int] = ..., + hours: Optional[int] = ..., minutes: Optional[int] = ..., + seconds: Optional[int] = ..., microseconds: Optional[int] = ..., + year: Optional[int] = ..., month: Optional[int] = ..., + day: Optional[int] = ..., + weekday: Optional[Union[int, _weekday]] = ..., + yearday: Optional[int] = ..., + nlyearday: Optional[int] = ..., + hour: Optional[int] = ..., minute: Optional[int] = ..., + second: Optional[int] = ..., + microsecond: Optional[int] = ...) -> None: ... + @property + def weeks(self) -> int: ... + @weeks.setter + def weeks(self, value: int) -> None: ... + def normalized(self: _SelfT) -> _SelfT: ... + # TODO: use Union when mypy will handle it properly in overloaded operator + # methods (#2129, #1442, #1264 in mypy) + @overload + def __add__(self: _SelfT, other: relativedelta) -> _SelfT: ... + @overload + def __add__(self: _SelfT, other: timedelta) -> _SelfT: ... + @overload + def __add__(self, other: _DateT) -> _DateT: ... + @overload + def __radd__(self: _SelfT, other: relativedelta) -> _SelfT: ... + @overload + def __radd__(self: _SelfT, other: timedelta) -> _SelfT: ... + @overload + def __radd__(self, other: _DateT) -> _DateT: ... + @overload + def __rsub__(self: _SelfT, other: relativedelta) -> _SelfT: ... + @overload + def __rsub__(self: _SelfT, other: timedelta) -> _SelfT: ... + @overload + def __rsub__(self, other: _DateT) -> _DateT: ... + def __sub__(self: _SelfT, other: relativedelta) -> _SelfT: ... + def __neg__(self: _SelfT) -> _SelfT: ... + def __bool__(self) -> bool: ... + def __nonzero__(self) -> bool: ... + def __mul__(self: _SelfT, other: SupportsFloat) -> _SelfT: ... + def __rmul__(self: _SelfT, other: SupportsFloat) -> _SelfT: ... + def __eq__(self, other) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def __div__(self: _SelfT, other: SupportsFloat) -> _SelfT: ... + def __truediv__(self: _SelfT, other: SupportsFloat) -> _SelfT: ... + def __repr__(self) -> str: ... + def __abs__(self: _SelfT) -> _SelfT: ... + def __hash__(self) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/rrule.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/rrule.pyi new file mode 100644 index 00000000..a459abe3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/rrule.pyi @@ -0,0 +1,103 @@ +from ._common import weekday as weekdaybase +from typing import Any, Iterable, Optional, Union +import datetime + +YEARLY: int +MONTHLY: int +WEEKLY: int +DAILY: int +HOURLY: int +MINUTELY: int +SECONDLY: int + +class weekday(weekdaybase): + ... + +MO: weekday +TU: weekday +WE: weekday +TH: weekday +FR: weekday +SA: weekday +SU: weekday + +class rrulebase: + def __init__(self, cache: bool = ...) -> None: ... + def __iter__(self): ... + def __getitem__(self, item): ... + def __contains__(self, item): ... + def count(self): ... + def before(self, dt, inc: bool = ...): ... + def after(self, dt, inc: bool = ...): ... + def xafter(self, dt, count: Optional[Any] = ..., inc: bool = ...): ... + def between(self, after, before, inc: bool = ..., count: int = ...): ... + +class rrule(rrulebase): + def __init__(self, + freq, + dtstart: Optional[datetime.date] = ..., + interval: int = ..., + wkst: Optional[Union[weekday, int]] = ..., + count: Optional[int] = ..., + until: Optional[Union[datetime.date, int]] = ..., + bysetpos: Optional[Union[int, Iterable[int]]] = ..., + bymonth: Optional[Union[int, Iterable[int]]] = ..., + bymonthday: Optional[Union[int, Iterable[int]]] = ..., + byyearday: Optional[Union[int, Iterable[int]]] = ..., + byeaster: Optional[Union[int, Iterable[int]]] = ..., + byweekno: Optional[Union[int, Iterable[int]]] = ..., + byweekday: Optional[Union[int, weekday, Iterable[int], Iterable[weekday]]] = ..., + byhour: Optional[Union[int, Iterable[int]]] = ..., + byminute: Optional[Union[int, Iterable[int]]] = ..., + bysecond: Optional[Union[int, Iterable[int]]] = ..., + cache: bool = ...) -> None: ... + def replace(self, **kwargs): ... + +class _iterinfo: + rrule: Any = ... + def __init__(self, rrule) -> None: ... + yearlen: int = ... + nextyearlen: int = ... + yearordinal: int = ... + yearweekday: int = ... + mmask: Any = ... + mdaymask: Any = ... + nmdaymask: Any = ... + wdaymask: Any = ... + mrange: Any = ... + wnomask: Any = ... + nwdaymask: Any = ... + eastermask: Any = ... + lastyear: int = ... + lastmonth: int = ... + def rebuild(self, year, month): ... + def ydayset(self, year, month, day): ... + def mdayset(self, year, month, day): ... + def wdayset(self, year, month, day): ... + def ddayset(self, year, month, day): ... + def htimeset(self, hour, minute, second): ... + def mtimeset(self, hour, minute, second): ... + def stimeset(self, hour, minute, second): ... + +class rruleset(rrulebase): + class _genitem: + dt: Any = ... + genlist: Any = ... + gen: Any = ... + def __init__(self, genlist, gen) -> None: ... + def __next__(self): ... + next: Any = ... + def __lt__(self, other): ... + def __gt__(self, other): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __init__(self, cache: bool = ...) -> None: ... + def rrule(self, rrule): ... + def rdate(self, rdate): ... + def exrule(self, exrule): ... + def exdate(self, exdate): ... + +class _rrulestr: + def __call__(self, s, **kwargs): ... + +rrulestr: _rrulestr diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/__init__.pyi new file mode 100644 index 00000000..5a5e45fe --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/__init__.pyi @@ -0,0 +1,15 @@ +from .tz import ( + tzutc as tzutc, + tzoffset as tzoffset, + tzlocal as tzlocal, + tzfile as tzfile, + tzrange as tzrange, + tzstr as tzstr, + tzical as tzical, + gettz as gettz, + datetime_exists as datetime_exists, + datetime_ambiguous as datetime_ambiguous, + resolve_imaginary as resolve_imaginary, +) + +UTC: tzutc diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/_common.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/_common.pyi new file mode 100644 index 00000000..32b06ed2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/_common.pyi @@ -0,0 +1,24 @@ +from typing import Any, Optional +from datetime import datetime, tzinfo, timedelta + +def tzname_in_python2(namefunc): ... +def enfold(dt: datetime, fold: int = ...): ... + +class _DatetimeWithFold(datetime): + @property + def fold(self): ... + +class _tzinfo(tzinfo): + def is_ambiguous(self, dt: datetime) -> bool: ... + def fromutc(self, dt: datetime) -> datetime: ... + +class tzrangebase(_tzinfo): + def __init__(self) -> None: ... + def utcoffset(self, dt: Optional[datetime]) -> Optional[timedelta]: ... + def dst(self, dt: Optional[datetime]) -> Optional[timedelta]: ... + def tzname(self, dt: Optional[datetime]) -> str: ... + def fromutc(self, dt: datetime) -> datetime: ... + def is_ambiguous(self, dt: datetime) -> bool: ... + __hash__: Any + def __ne__(self, other): ... + __reduce__: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/tz.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/tz.pyi new file mode 100644 index 00000000..71395070 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/tz/tz.pyi @@ -0,0 +1,96 @@ +from typing import Any, Optional, Union, IO, Text, Tuple, List +import datetime +from ._common import tzname_in_python2 as tzname_in_python2, _tzinfo as _tzinfo +from ._common import tzrangebase as tzrangebase, enfold as enfold +from ..relativedelta import relativedelta + +_FileObj = Union[str, Text, IO[str], IO[Text]] + +ZERO: datetime.timedelta +EPOCH: datetime.datetime +EPOCHORDINAL: int + +class tzutc(datetime.tzinfo): + def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def dst(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def tzname(self, dt: Optional[datetime.datetime]) -> str: ... + def is_ambiguous(self, dt: Optional[datetime.datetime]) -> bool: ... + def __eq__(self, other): ... + __hash__: Any + def __ne__(self, other): ... + __reduce__: Any + +class tzoffset(datetime.tzinfo): + def __init__(self, name, offset) -> None: ... + def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def dst(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def is_ambiguous(self, dt: Optional[datetime.datetime]) -> bool: ... + def tzname(self, dt: Optional[datetime.datetime]) -> str: ... + def __eq__(self, other): ... + __hash__: Any + def __ne__(self, other): ... + __reduce__: Any + + @classmethod + def instance(cls, name, offset) -> tzoffset: ... + +class tzlocal(_tzinfo): + def __init__(self) -> None: ... + def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def dst(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def tzname(self, dt: Optional[datetime.datetime]) -> str: ... + def is_ambiguous(self, dt: Optional[datetime.datetime]) -> bool: ... + def __eq__(self, other): ... + __hash__: Any + def __ne__(self, other): ... + __reduce__: Any + +class _ttinfo: + def __init__(self) -> None: ... + def __eq__(self, other): ... + __hash__: Any + def __ne__(self, other): ... + +class tzfile(_tzinfo): + def __init__(self, fileobj: _FileObj, filename: Optional[Text] = ...) -> None: ... + def is_ambiguous(self, dt: Optional[datetime.datetime], idx: Optional[int] = ...) -> bool: ... + def utcoffset(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def dst(self, dt: Optional[datetime.datetime]) -> Optional[datetime.timedelta]: ... + def tzname(self, dt: Optional[datetime.datetime]) -> str: ... + def __eq__(self, other): ... + __hash__: Any + def __ne__(self, other): ... + def __reduce__(self): ... + def __reduce_ex__(self, protocol): ... + +class tzrange(tzrangebase): + hasdst: bool + def __init__(self, stdabbr: Text, stdoffset: Union[int, datetime.timedelta, None] = ..., dstabbr: Optional[Text] = ..., dstoffset: Union[int, datetime.timedelta, None] = ..., start: Optional[relativedelta] = ..., end: Optional[relativedelta] = ...) -> None: ... + def transitions(self, year: int) -> Tuple[datetime.datetime, datetime.datetime]: ... + def __eq__(self, other): ... + +class tzstr(tzrange): + hasdst: bool + def __init__(self, s: Union[bytes, _FileObj], posix_offset: bool = ...) -> None: ... + + @classmethod + def instance(cls, name, offset) -> tzoffset: ... + +class tzical: + def __init__(self, fileobj: _FileObj) -> None: ... + def keys(self): ... + def get(self, tzid: Optional[Any] = ...): ... + +TZFILES: List[str] +TZPATHS: List[str] + +def datetime_exists(dt: datetime.datetime, tz: Optional[datetime.tzinfo] = ...) -> bool: ... +def datetime_ambiguous(dt: datetime.datetime, tz: Optional[datetime.tzinfo] = ...) -> bool: ... +def resolve_imaginary(dt: datetime.datetime) -> datetime.datetime: ... + + +class _GetTZ: + def __call__(self, name: Optional[Text] = ...) -> Optional[datetime.tzinfo]: ... + def nocache(self, name: Optional[Text]) -> Optional[datetime.tzinfo]: ... + +gettz: _GetTZ diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/utils.pyi new file mode 100644 index 00000000..b722053e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/dateutil/utils.pyi @@ -0,0 +1,7 @@ +from typing import Optional +from datetime import datetime, tzinfo, timedelta + + +def default_tzinfo(dt: datetime, tzinfo: tzinfo) -> datetime: ... +def today(tzinfo: Optional[tzinfo] = ...) -> datetime: ... +def within_delta(dt1: datetime, dt2: datetime, delta: timedelta) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/decorator.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/decorator.pyi new file mode 100644 index 00000000..adf5ebe7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/decorator.pyi @@ -0,0 +1,84 @@ +import sys +from typing import Any, Callable, Dict, Iterator, List, NamedTuple, Optional, Pattern, Text, Tuple, TypeVar + +_C = TypeVar("_C", bound=Callable[..., Any]) +_Func = TypeVar("_Func", bound=Callable[..., Any]) +_T = TypeVar("_T") + +def get_init(cls): ... + +if sys.version_info >= (3,): + from inspect import iscoroutinefunction as iscoroutinefunction + from inspect import getfullargspec as getfullargspec +else: + class FullArgSpec(NamedTuple): + args: List[str] + varargs: Optional[str] + varkw: Optional[str] + defaults: Tuple[Any, ...] + kwonlyargs: List[str] + kwonlydefaults: Dict[str, Any] + annotations: Dict[str, Any] + def iscoroutinefunction(f: Callable[..., Any]) -> bool: ... + def getfullargspec(func: Any) -> FullArgSpec: ... + +if sys.version_info >= (3, 2): + from contextlib import _GeneratorContextManager +else: + from contextlib import GeneratorContextManager as _GeneratorContextManager + +DEF: Pattern[str] + +class FunctionMaker(object): + args: List[Text] + varargs: Optional[Text] + varkw: Optional[Text] + defaults: Tuple[Any, ...] + kwonlyargs: List[Text] + kwonlydefaults: Optional[Text] + shortsignature: Optional[Text] + name: Text + doc: Optional[Text] + module: Optional[Text] + annotations: Dict[Text, Any] + signature: Text + dict: Dict[Text, Any] + def __init__( + self, + func: Optional[Callable[..., Any]] = ..., + name: Optional[Text] = ..., + signature: Optional[Text] = ..., + defaults: Optional[Tuple[Any, ...]] = ..., + doc: Optional[Text] = ..., + module: Optional[Text] = ..., + funcdict: Optional[Dict[Text, Any]] = ... + ) -> None: ... + def update(self, func: Any, **kw: Any) -> None: ... + def make( + self, + src_templ: Text, + evaldict: Optional[Dict[Text, Any]] = ..., + addsource: bool = ..., + **attrs: Any + ) -> Callable[..., Any]: ... + @classmethod + def create( + cls, + obj: Any, + body: Text, + evaldict: Dict[Text, Any], + defaults: Optional[Tuple[Any, ...]] = ..., + doc: Optional[Text] = ..., + module: Optional[Text] = ..., + addsource: bool = ..., + **attrs: Any + ) -> Callable[..., Any]: ... + +def decorate(func: _Func, caller: Callable[..., Any], extras: Any = ...) -> _Func: ... +def decorator(caller: Callable[..., Any], _func: Optional[Callable[..., Any]] = ...) -> Callable[[Callable[..., Any]], Callable[..., Any]]: ... + +class ContextManager(_GeneratorContextManager[_T]): + def __call__(self, func: _C) -> _C: ... + +def contextmanager(func: Callable[..., Iterator[_T]]) -> Callable[..., ContextManager[_T]]: ... +def dispatch_on(*dispatch_args: Any) -> Callable[[Callable[..., Any]], Callable[..., Any]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/emoji.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/emoji.pyi new file mode 100644 index 00000000..695018e5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/emoji.pyi @@ -0,0 +1,18 @@ +from typing import Tuple, Pattern, List, Dict, Union, Text + +_DEFAULT_DELIMITER: str + +def emojize( + string: str, + use_aliases: bool = ..., + delimiters: Tuple[str, str] = ... +) -> str: ... + +def demojize( + string: str, + delimiters: Tuple[str, str] = ... +) -> str: ... + +def get_emoji_regexp() -> Pattern[Text]: ... + +def emoji_lis(string: str) -> List[Dict[str, Union[int, str]]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/first.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/first.pyi new file mode 100644 index 00000000..f03f3a35 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/first.pyi @@ -0,0 +1,13 @@ +from typing import Any, Callable, Iterable, Optional, overload, TypeVar, Union + +_T = TypeVar('_T') +_S = TypeVar('_S') + +@overload +def first(iterable: Iterable[_T]) -> Optional[_T]: ... +@overload +def first(iterable: Iterable[_T], default: _S) -> Union[_T, _S]: ... +@overload +def first(iterable: Iterable[_T], default: _S, key: Optional[Callable[[_T], Any]]) -> Union[_T, _S]: ... +@overload +def first(iterable: Iterable[_T], *, key: Optional[Callable[[_T], Any]]) -> Optional[_T]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/__init__.pyi new file mode 100644 index 00000000..caeac5e2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/__init__.pyi @@ -0,0 +1,45 @@ +# Stubs for flask (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .app import Flask as Flask +from .blueprints import Blueprint as Blueprint +from .config import Config as Config +from .ctx import after_this_request as after_this_request +from .ctx import copy_current_request_context as copy_current_request_context +from .ctx import has_app_context as has_app_context +from .ctx import has_request_context as has_request_context +from .globals import current_app as current_app +from .globals import g as g +from .globals import request as request +from .globals import session as session +from .helpers import flash as flash +from .helpers import get_flashed_messages as get_flashed_messages +from .helpers import get_template_attribute as get_template_attribute +from .helpers import make_response as make_response +from .helpers import safe_join as safe_join +from .helpers import send_file as send_file +from .helpers import send_from_directory as send_from_directory +from .helpers import stream_with_context as stream_with_context +from .helpers import url_for as url_for +from .json import jsonify as jsonify +from .signals import appcontext_popped as appcontext_popped +from .signals import appcontext_pushed as appcontext_pushed +from .signals import appcontext_tearing_down as appcontext_tearing_down +from .signals import before_render_template as before_render_template +from .signals import got_request_exception as got_request_exception +from .signals import message_flashed as message_flashed +from .signals import request_finished as request_finished +from .signals import request_started as request_started +from .signals import request_tearing_down as request_tearing_down +from .signals import signals_available as signals_available +from .signals import template_rendered as template_rendered +from .templating import render_template as render_template +from .templating import render_template_string as render_template_string +from .wrappers import Request as Request +from .wrappers import Response as Response + +from werkzeug.exceptions import abort as abort +from werkzeug.utils import redirect as redirect +from jinja2 import Markup as Markup +from jinja2 import escape as escape diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/app.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/app.pyi new file mode 100644 index 00000000..654d41c1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/app.pyi @@ -0,0 +1,186 @@ +# Stubs for flask.app (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .blueprints import Blueprint +from .config import Config, ConfigAttribute +from .ctx import AppContext, RequestContext, _AppCtxGlobals +from .globals import _request_ctx_stack, g, request, session +from .helpers import _PackageBoundObject, find_package, get_debug_flag, get_env, get_flashed_messages, get_load_dotenv, locked_cached_property, url_for +from .logging import create_logger +from .sessions import SecureCookieSessionInterface +from .signals import appcontext_tearing_down, got_request_exception, request_finished, request_started, request_tearing_down +from .templating import DispatchingJinjaLoader, Environment +from .wrappers import Request, Response +from .testing import FlaskClient +from types import TracebackType +from typing import ( + Any, + Callable, + ContextManager, + Dict, + List, + Optional, + Type, + TypeVar, + Union, + Text, + Tuple, + NoReturn, + Iterable, + ByteString +) +from datetime import timedelta + +def setupmethod(f: Any): ... + +_T = TypeVar('_T') + + +_ExcInfo = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]] +_StartResponse = Callable[[str, List[Tuple[str, str]], Optional[_ExcInfo]], Callable[[bytes], Any]] +_WSGICallable = Callable[[Dict[Text, Any], _StartResponse], Iterable[bytes]] + +_Status = Union[str, int] +_Headers = Union[Dict[Any, Any], List[Tuple[Any, Any]]] +_Body = Union[Text, ByteString, Dict[Text, Any], Response, _WSGICallable] +_ViewFuncReturnType = Union[ + _Body, + Tuple[_Body, _Status, _Headers], + Tuple[_Body, _Status], + Tuple[_Body, _Headers], +] + +_ViewFunc = Union[ + Callable[..., NoReturn], + Callable[..., _ViewFuncReturnType], +] +_VT = TypeVar('_VT', bound=_ViewFunc) + + +class Flask(_PackageBoundObject): + request_class: type = ... + response_class: type = ... + jinja_environment: type = ... + app_ctx_globals_class: type = ... + config_class: Type[Config] = ... + testing: Any = ... + secret_key: Union[Text, bytes, None] = ... + session_cookie_name: Any = ... + permanent_session_lifetime: timedelta = ... + send_file_max_age_default: timedelta = ... + use_x_sendfile: Any = ... + json_encoder: Any = ... + json_decoder: Any = ... + jinja_options: Any = ... + default_config: Any = ... + url_rule_class: type = ... + test_client_class: type = ... + test_cli_runner_class: type = ... + session_interface: Any = ... + import_name: str = ... + template_folder: str = ... + root_path: Optional[Union[str, Text]] = ... + static_url_path: Any = ... + static_folder: Optional[str] = ... + instance_path: Union[str, Text] = ... + config: Config = ... + view_functions: Any = ... + error_handler_spec: Any = ... + url_build_error_handlers: Any = ... + before_request_funcs: Dict[Optional[str], List[Callable[[], Any]]] = ... + before_first_request_funcs: List[Callable[[], None]] = ... + after_request_funcs: Dict[Optional[str], List[Callable[[Response], Response]]] = ... + teardown_request_funcs: Dict[Optional[str], List[Callable[[Optional[Exception]], Any]]] = ... + teardown_appcontext_funcs: List[Callable[[Optional[Exception]], Any]] = ... + url_value_preprocessors: Any = ... + url_default_functions: Any = ... + template_context_processors: Any = ... + shell_context_processors: Any = ... + blueprints: Any = ... + extensions: Any = ... + url_map: Any = ... + subdomain_matching: Any = ... + cli: Any = ... + def __init__(self, import_name: str, static_url_path: Optional[str] = ..., static_folder: Optional[str] = ..., static_host: Optional[str] = ..., host_matching: bool = ..., subdomain_matching: bool = ..., template_folder: str = ..., instance_path: Optional[str] = ..., instance_relative_config: bool = ..., root_path: Optional[str] = ...) -> None: ... + @property + def name(self) -> str: ... + @property + def propagate_exceptions(self) -> bool: ... + @property + def preserve_context_on_exception(self): ... + @property + def logger(self): ... + @property + def jinja_env(self): ... + @property + def got_first_request(self) -> bool: ... + def make_config(self, instance_relative: bool = ...): ... + def auto_find_instance_path(self): ... + def open_instance_resource(self, resource: Union[str, Text], mode: str = ...): ... + templates_auto_reload: Any = ... + def create_jinja_environment(self): ... + def create_global_jinja_loader(self): ... + def select_jinja_autoescape(self, filename: Any): ... + def update_template_context(self, context: Any) -> None: ... + def make_shell_context(self): ... + env: Optional[str] = ... + debug: bool = ... + def run(self, host: Optional[str] = ..., port: Optional[Union[int, str]] = ..., debug: Optional[bool] = ..., load_dotenv: bool = ..., **options: Any) -> None: ... + def test_client(self, use_cookies: bool = ..., **kwargs: Any) -> FlaskClient[Response]: ... + def test_cli_runner(self, **kwargs: Any): ... + def open_session(self, request: Any): ... + def save_session(self, session: Any, response: Any): ... + def make_null_session(self): ... + def register_blueprint(self, blueprint: Blueprint, **options: Any) -> None: ... + def iter_blueprints(self): ... + def add_url_rule(self, rule: str, endpoint: Optional[str] = ..., view_func: _ViewFunc = ..., provide_automatic_options: Optional[bool] = ..., **options: Any) -> None: ... + def route(self, rule: str, **options: Any) -> Callable[[_VT], _VT]: ... + def endpoint(self, endpoint: str) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def errorhandler(self, code_or_exception: Union[int, Type[Exception]]) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def register_error_handler(self, code_or_exception: Union[int, Type[Exception]], f: Callable[..., Any]) -> None: ... + def template_filter(self, name: Optional[Any] = ...): ... + def add_template_filter(self, f: Any, name: Optional[Any] = ...) -> None: ... + def template_test(self, name: Optional[Any] = ...): ... + def add_template_test(self, f: Any, name: Optional[Any] = ...) -> None: ... + def template_global(self, name: Optional[Any] = ...): ... + def add_template_global(self, f: Any, name: Optional[Any] = ...) -> None: ... + def before_request(self, f: Callable[[], _T]) -> Callable[[], _T]: ... + def before_first_request(self, f: Callable[[], _T]) -> Callable[[], _T]: ... + def after_request(self, f: Callable[[Response], Response]) -> Callable[[Response], Response]: ... + def teardown_request(self, f: Callable[[Optional[Exception]], _T]) -> Callable[[Optional[Exception]], _T]: ... + def teardown_appcontext(self, f: Callable[[Optional[Exception]], _T]) -> Callable[[Optional[Exception]], _T]: ... + def context_processor(self, f: Any): ... + def shell_context_processor(self, f: Any): ... + def url_value_preprocessor(self, f: Any): ... + def url_defaults(self, f: Any): ... + def handle_http_exception(self, e: Any): ... + def trap_http_exception(self, e: Any): ... + def handle_user_exception(self, e: Any): ... + def handle_exception(self, e: Any): ... + def log_exception(self, exc_info: Any) -> None: ... + def raise_routing_exception(self, request: Any) -> None: ... + def dispatch_request(self): ... + def full_dispatch_request(self): ... + def finalize_request(self, rv: Any, from_error_handler: bool = ...): ... + def try_trigger_before_first_request_functions(self): ... + def make_default_options_response(self): ... + def should_ignore_error(self, error: Any): ... + def make_response(self, rv: Any): ... + def create_url_adapter(self, request: Any): ... + def inject_url_defaults(self, endpoint: Any, values: Any) -> None: ... + def handle_url_build_error(self, error: Any, endpoint: Any, values: Any): ... + def preprocess_request(self): ... + def process_response(self, response: Any): ... + def do_teardown_request(self, exc: Any = ...) -> None: ... + def do_teardown_appcontext(self, exc: Any = ...) -> None: ... + def app_context(self): ... + def request_context(self, environ: Any): ... + def test_request_context(self, *args: Any, **kwargs: Any) -> ContextManager[RequestContext]: ... + def wsgi_app(self, environ: Any, start_response: Any): ... + def __call__(self, environ: Any, start_response: Any): ... + + # These are not preset at runtime but we add them since monkeypatching this + # class is quite common. + def __setattr__(self, name: str, value: Any): ... + def __getattr__(self, name: str): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/blueprints.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/blueprints.pyi new file mode 100644 index 00000000..d534ac8a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/blueprints.pyi @@ -0,0 +1,66 @@ +# Stubs for flask.blueprints (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .helpers import _PackageBoundObject +from .app import _ViewFunc +from typing import Any, Callable, Optional, Type, TypeVar, Union + +_T = TypeVar('_T') +_VT = TypeVar('_VT', bound=_ViewFunc) + +class BlueprintSetupState: + app: Any = ... + blueprint: Any = ... + options: Any = ... + first_registration: Any = ... + subdomain: Any = ... + url_prefix: Any = ... + url_defaults: Any = ... + def __init__(self, blueprint: Any, app: Any, options: Any, first_registration: Any) -> None: ... + def add_url_rule(self, rule: str, endpoint: Optional[str] = ..., view_func: _ViewFunc = ..., **options: Any) -> None: ... + +class Blueprint(_PackageBoundObject): + warn_on_modifications: bool = ... + json_encoder: Any = ... + json_decoder: Any = ... + import_name: str = ... + template_folder: Optional[str] = ... + root_path: str = ... + name: str = ... + url_prefix: Optional[str] = ... + subdomain: Optional[str] = ... + static_folder: Optional[str] = ... + static_url_path: Optional[str] = ... + deferred_functions: Any = ... + url_values_defaults: Any = ... + def __init__(self, name: str, import_name: str, static_folder: Optional[str] = ..., static_url_path: Optional[str] = ..., template_folder: Optional[str] = ..., url_prefix: Optional[str] = ..., subdomain: Optional[str] = ..., url_defaults: Optional[Any] = ..., root_path: Optional[str] = ...) -> None: ... + def record(self, func: Any) -> None: ... + def record_once(self, func: Any): ... + def make_setup_state(self, app: Any, options: Any, first_registration: bool = ...): ... + def register(self, app: Any, options: Any, first_registration: bool = ...) -> None: ... + def route(self, rule: str, **options: Any) -> Callable[[_VT], _VT]: ... + def add_url_rule(self, rule: str, endpoint: Optional[str] = ..., view_func: _ViewFunc = ..., **options: Any) -> None: ... + def endpoint(self, endpoint: str) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def app_template_filter(self, name: Optional[Any] = ...): ... + def add_app_template_filter(self, f: Any, name: Optional[Any] = ...) -> None: ... + def app_template_test(self, name: Optional[Any] = ...): ... + def add_app_template_test(self, f: Any, name: Optional[Any] = ...) -> None: ... + def app_template_global(self, name: Optional[Any] = ...): ... + def add_app_template_global(self, f: Any, name: Optional[Any] = ...) -> None: ... + def before_request(self, f: Any): ... + def before_app_request(self, f: Any): ... + def before_app_first_request(self, f: Any): ... + def after_request(self, f: Any): ... + def after_app_request(self, f: Any): ... + def teardown_request(self, f: Any): ... + def teardown_app_request(self, f: Any): ... + def context_processor(self, f: Any): ... + def app_context_processor(self, f: Any): ... + def app_errorhandler(self, code: Any): ... + def url_value_preprocessor(self, f: Any): ... + def url_defaults(self, f: Any): ... + def app_url_value_preprocessor(self, f: Any): ... + def app_url_defaults(self, f: Any): ... + def errorhandler(self, code_or_exception: Union[int, Type[Exception]]) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def register_error_handler(self, code_or_exception: Union[int, Type[Exception]], f: Callable[..., Any]) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/cli.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/cli.pyi new file mode 100644 index 00000000..15d3243f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/cli.pyi @@ -0,0 +1,64 @@ +# Stubs for flask.cli (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +import click +from .globals import current_app +from .helpers import get_debug_flag, get_env, get_load_dotenv +from typing import Any, Optional + +class NoAppException(click.UsageError): ... + +def find_best_app(script_info: Any, module: Any): ... +def call_factory(script_info: Any, app_factory: Any, arguments: Any = ...): ... +def find_app_by_string(script_info: Any, module: Any, app_name: Any): ... +def prepare_import(path: Any): ... +def locate_app(script_info: Any, module_name: Any, app_name: Any, raise_if_not_found: bool = ...): ... +def get_version(ctx: Any, param: Any, value: Any): ... + +version_option: Any + +class DispatchingApp: + loader: Any = ... + def __init__(self, loader: Any, use_eager_loading: bool = ...) -> None: ... + def __call__(self, environ: Any, start_response: Any): ... + +class ScriptInfo: + app_import_path: Any = ... + create_app: Any = ... + data: Any = ... + def __init__(self, app_import_path: Optional[Any] = ..., create_app: Optional[Any] = ...) -> None: ... + def load_app(self): ... + +pass_script_info: Any + +def with_appcontext(f: Any): ... + +class AppGroup(click.Group): + def command(self, *args: Any, **kwargs: Any): ... + def group(self, *args: Any, **kwargs: Any): ... + +class FlaskGroup(AppGroup): + create_app: Any = ... + load_dotenv: Any = ... + def __init__(self, add_default_commands: bool = ..., create_app: Optional[Any] = ..., add_version_option: bool = ..., load_dotenv: bool = ..., **extra: Any) -> None: ... + def get_command(self, ctx: Any, name: Any): ... + def list_commands(self, ctx: Any): ... + def main(self, *args: Any, **kwargs: Any): ... + +def load_dotenv(path: Optional[Any] = ...): ... +def show_server_banner(env: Any, debug: Any, app_import_path: Any, eager_loading: Any): ... + +class CertParamType(click.ParamType): + name: str = ... + path_type: Any = ... + def __init__(self) -> None: ... + def convert(self, value: Any, param: Any, ctx: Any): ... + +def run_command(info: Any, host: Any, port: Any, reload: Any, debugger: Any, eager_loading: Any, with_threads: Any, cert: Any) -> None: ... +def shell_command() -> None: ... +def routes_command(sort: Any, all_methods: Any): ... + +cli: Any + +def main(as_module: bool = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/config.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/config.pyi new file mode 100644 index 00000000..6b925e72 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/config.pyi @@ -0,0 +1,22 @@ +# Stubs for flask.config (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any, Optional, Dict + +class ConfigAttribute: + __name__: Any = ... + get_converter: Any = ... + def __init__(self, name: Any, get_converter: Optional[Any] = ...) -> None: ... + def __get__(self, obj: Any, type: Optional[Any] = ...): ... + def __set__(self, obj: Any, value: Any) -> None: ... + +class Config(Dict[str, Any]): + root_path: Any = ... + def __init__(self, root_path: Any, defaults: Optional[Any] = ...) -> None: ... + def from_envvar(self, variable_name: Any, silent: bool = ...): ... + def from_pyfile(self, filename: Any, silent: bool = ...): ... + def from_object(self, obj: Any) -> None: ... + def from_json(self, filename: Any, silent: bool = ...): ... + def from_mapping(self, *mapping: Any, **kwargs: Any): ... + def get_namespace(self, namespace: Any, lowercase: bool = ..., trim_namespace: bool = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/ctx.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/ctx.pyi new file mode 100644 index 00000000..09fdea3a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/ctx.pyi @@ -0,0 +1,46 @@ +# Stubs for flask.ctx (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .globals import _app_ctx_stack, _request_ctx_stack +from .signals import appcontext_popped, appcontext_pushed +from typing import Any, Optional + +class _AppCtxGlobals: + def get(self, name: Any, default: Optional[Any] = ...): ... + def pop(self, name: Any, default: Any = ...): ... + def setdefault(self, name: Any, default: Optional[Any] = ...): ... + def __contains__(self, item: Any): ... + def __iter__(self): ... + +def after_this_request(f: Any): ... +def copy_current_request_context(f: Any): ... +def has_request_context(): ... +def has_app_context(): ... + +class AppContext: + app: Any = ... + url_adapter: Any = ... + g: Any = ... + def __init__(self, app: Any) -> None: ... + def push(self) -> None: ... + def pop(self, exc: Any = ...) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type: Any, exc_value: Any, tb: Any) -> None: ... + +class RequestContext: + app: Any = ... + request: Any = ... + url_adapter: Any = ... + flashes: Any = ... + session: Any = ... + preserved: bool = ... + def __init__(self, app: Any, environ: Any, request: Optional[Any] = ...) -> None: ... + g: Any = ... + def copy(self): ... + def match_request(self) -> None: ... + def push(self) -> None: ... + def pop(self, exc: Any = ...) -> None: ... + def auto_pop(self, exc: Any) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type: Any, exc_value: Any, tb: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/debughelpers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/debughelpers.pyi new file mode 100644 index 00000000..5a4cbea0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/debughelpers.pyi @@ -0,0 +1,21 @@ +# Stubs for flask.debughelpers (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .app import Flask +from .blueprints import Blueprint +from .globals import _request_ctx_stack +from typing import Any + +class UnexpectedUnicodeError(AssertionError, UnicodeError): ... + +class DebugFilesKeyError(KeyError, AssertionError): + msg: Any = ... + def __init__(self, request: Any, key: Any) -> None: ... + +class FormDataRoutingRedirect(AssertionError): + def __init__(self, request: Any) -> None: ... + +def attach_enctype_error_multidict(request: Any): ... +def explain_template_loading_attempts(app: Any, template: Any, attempts: Any) -> None: ... +def explain_ignored_app_run() -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/globals.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/globals.pyi new file mode 100644 index 00000000..8ce1caf1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/globals.pyi @@ -0,0 +1,18 @@ +# Stubs for flask.globals (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .app import Flask +from .wrappers import Request +from typing import Any +from werkzeug.local import LocalStack + +class _FlaskLocalProxy(Flask): + def _get_current_object(self) -> Flask: ... + +_request_ctx_stack: LocalStack +_app_ctx_stack: LocalStack +current_app: _FlaskLocalProxy +request: Request +session: Any +g: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/helpers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/helpers.pyi new file mode 100644 index 00000000..726f8a03 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/helpers.pyi @@ -0,0 +1,48 @@ +# Stubs for flask.helpers (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .globals import _app_ctx_stack, _request_ctx_stack, current_app, request, session +from .signals import message_flashed +from typing import Any, Optional + +def get_env(): ... +def get_debug_flag(): ... +def get_load_dotenv(default: bool = ...): ... +def stream_with_context(generator_or_function: Any): ... +def make_response(*args: Any): ... +def url_for(endpoint: Any, **values: Any): ... +def get_template_attribute(template_name: Any, attribute: Any): ... +def flash(message: Any, category: str = ...) -> None: ... +def get_flashed_messages(with_categories: bool = ..., category_filter: Any = ...): ... +def send_file(filename_or_fp: Any, mimetype: Optional[Any] = ..., as_attachment: bool = ..., attachment_filename: Optional[Any] = ..., add_etags: bool = ..., cache_timeout: Optional[Any] = ..., conditional: bool = ..., last_modified: Optional[Any] = ...): ... +def safe_join(directory: Any, *pathnames: Any): ... +def send_from_directory(directory: Any, filename: Any, **options: Any): ... +def get_root_path(import_name: Any): ... +def find_package(import_name: Any): ... + +class locked_cached_property: + __name__: Any = ... + __module__: Any = ... + __doc__: Any = ... + func: Any = ... + lock: Any = ... + def __init__(self, func: Any, name: Optional[Any] = ..., doc: Optional[Any] = ...) -> None: ... + def __get__(self, obj: Any, type: Optional[Any] = ...): ... + +class _PackageBoundObject: + import_name: Any = ... + template_folder: Any = ... + root_path: Any = ... + def __init__(self, import_name: Any, template_folder: Optional[Any] = ..., root_path: Optional[Any] = ...) -> None: ... + static_folder: Any = ... + static_url_path: Any = ... + @property + def has_static_folder(self): ... + def jinja_loader(self): ... + def get_send_file_max_age(self, filename: Any): ... + def send_static_file(self, filename: Any): ... + def open_resource(self, resource: Any, mode: str = ...): ... + +def total_seconds(td: Any): ... +def is_ip(value: Any): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/json/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/json/__init__.pyi new file mode 100644 index 00000000..f2dea4d1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/json/__init__.pyi @@ -0,0 +1,19 @@ +# Stubs for flask.json (Python 3.6) +import json as _json +from typing import Any +from jinja2 import Markup + +class JSONEncoder(_json.JSONEncoder): + def default(self, o: Any): ... + +class JSONDecoder(_json.JSONDecoder): ... + +def detect_encoding(data: bytes) -> str: ... # undocumented +def dumps(obj: Any, **kwargs: Any): ... +def dump(obj: Any, fp: Any, **kwargs: Any) -> None: ... +def loads(s: Any, **kwargs: Any): ... +def load(fp: Any, **kwargs: Any): ... +def htmlsafe_dumps(obj: Any, **kwargs: Any): ... +def htmlsafe_dump(obj: Any, fp: Any, **kwargs: Any) -> None: ... +def jsonify(*args: Any, **kwargs: Any): ... +def tojson_filter(obj: Any, **kwargs: Any) -> Markup: ... # undocumented diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/json/tag.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/json/tag.pyi new file mode 100644 index 00000000..b1648dc7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/json/tag.pyi @@ -0,0 +1,71 @@ +# Stubs for flask.json.tag (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any, Optional + +class JSONTag: + key: Any = ... + serializer: Any = ... + def __init__(self, serializer: Any) -> None: ... + def check(self, value: Any) -> None: ... + def to_json(self, value: Any) -> None: ... + def to_python(self, value: Any) -> None: ... + def tag(self, value: Any): ... + +class TagDict(JSONTag): + key: str = ... + def check(self, value: Any): ... + def to_json(self, value: Any): ... + def to_python(self, value: Any): ... + +class PassDict(JSONTag): + def check(self, value: Any): ... + def to_json(self, value: Any): ... + tag: Any = ... + +class TagTuple(JSONTag): + key: str = ... + def check(self, value: Any): ... + def to_json(self, value: Any): ... + def to_python(self, value: Any): ... + +class PassList(JSONTag): + def check(self, value: Any): ... + def to_json(self, value: Any): ... + tag: Any = ... + +class TagBytes(JSONTag): + key: str = ... + def check(self, value: Any): ... + def to_json(self, value: Any): ... + def to_python(self, value: Any): ... + +class TagMarkup(JSONTag): + key: str = ... + def check(self, value: Any): ... + def to_json(self, value: Any): ... + def to_python(self, value: Any): ... + +class TagUUID(JSONTag): + key: str = ... + def check(self, value: Any): ... + def to_json(self, value: Any): ... + def to_python(self, value: Any): ... + +class TagDateTime(JSONTag): + key: str = ... + def check(self, value: Any): ... + def to_json(self, value: Any): ... + def to_python(self, value: Any): ... + +class TaggedJSONSerializer: + default_tags: Any = ... + tags: Any = ... + order: Any = ... + def __init__(self) -> None: ... + def register(self, tag_class: Any, force: bool = ..., index: Optional[Any] = ...) -> None: ... + def tag(self, value: Any): ... + def untag(self, value: Any): ... + def dumps(self, value: Any): ... + def loads(self, value: Any): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/logging.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/logging.pyi new file mode 100644 index 00000000..e43d51d8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/logging.pyi @@ -0,0 +1,13 @@ +# Stubs for flask.logging (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .globals import request +from typing import Any + +def wsgi_errors_stream(): ... +def has_level_handler(logger: Any): ... + +default_handler: Any + +def create_logger(app: Any): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/sessions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/sessions.pyi new file mode 100644 index 00000000..aa6cb6ef --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/sessions.pyi @@ -0,0 +1,60 @@ +# Stubs for flask.sessions (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from abc import ABCMeta +from typing import Any, MutableMapping, Optional +from werkzeug.datastructures import CallbackDict + +class SessionMixin(MutableMapping[str, Any], metaclass=ABCMeta): + @property + def permanent(self): ... + @permanent.setter + def permanent(self, value: Any) -> None: ... + new: bool = ... + modified: bool = ... + accessed: bool = ... + +class SecureCookieSession(CallbackDict[str, Any], SessionMixin): + modified: bool = ... + accessed: bool = ... + def __init__(self, initial: Optional[Any] = ...) -> None: ... + def __getitem__(self, key: Any): ... + def get(self, key: Any, default: Optional[Any] = ...): ... + def setdefault(self, key: Any, default: Optional[Any] = ...): ... + +class NullSession(SecureCookieSession): + __setitem__: Any = ... + __delitem__: Any = ... + clear: Any = ... + pop: Any = ... + popitem: Any = ... + update: Any = ... + setdefault: Any = ... + +class SessionInterface: + null_session_class: Any = ... + pickle_based: bool = ... + def make_null_session(self, app: Any): ... + def is_null_session(self, obj: Any): ... + def get_cookie_domain(self, app: Any): ... + def get_cookie_path(self, app: Any): ... + def get_cookie_httponly(self, app: Any): ... + def get_cookie_secure(self, app: Any): ... + def get_cookie_samesite(self, app: Any): ... + def get_expiration_time(self, app: Any, session: Any): ... + def should_set_cookie(self, app: Any, session: Any): ... + def open_session(self, app: Any, request: Any) -> None: ... + def save_session(self, app: Any, session: Any, response: Any) -> None: ... + +session_json_serializer: Any + +class SecureCookieSessionInterface(SessionInterface): + salt: str = ... + digest_method: Any = ... + key_derivation: str = ... + serializer: Any = ... + session_class: Any = ... + def get_signing_serializer(self, app: Any): ... + def open_session(self, app: Any, request: Any): ... + def save_session(self, app: Any, session: Any, response: Any): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/signals.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/signals.pyi new file mode 100644 index 00000000..0aa7ac32 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/signals.pyi @@ -0,0 +1,33 @@ +# Stubs for flask.signals (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any, Optional + +signals_available: bool + +class Namespace: + def signal(self, name: Any, doc: Optional[Any] = ...): ... + +class _FakeSignal: + name: Any = ... + __doc__: Any = ... + def __init__(self, name: Any, doc: Optional[Any] = ...) -> None: ... + send: Any = ... + connect: Any = ... + disconnect: Any = ... + has_receivers_for: Any = ... + receivers_for: Any = ... + temporarily_connected_to: Any = ... + connected_to: Any = ... + +template_rendered: Any +before_render_template: Any +request_started: Any +request_finished: Any +request_tearing_down: Any +got_request_exception: Any +appcontext_tearing_down: Any +appcontext_pushed: Any +appcontext_popped: Any +message_flashed: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/templating.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/templating.pyi new file mode 100644 index 00000000..87d77152 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/templating.pyi @@ -0,0 +1,24 @@ +# Stubs for flask.templating (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .globals import _app_ctx_stack, _request_ctx_stack +from .signals import before_render_template, template_rendered +from jinja2 import BaseLoader, Environment as BaseEnvironment +from typing import Any, Text, Iterable, Union + +class Environment(BaseEnvironment): + app: Any = ... + def __init__(self, app: Any, **options: Any) -> None: ... + +class DispatchingJinjaLoader(BaseLoader): + app: Any = ... + def __init__(self, app: Any) -> None: ... + def get_source(self, environment: Any, template: Any): ... + def list_templates(self): ... + +def render_template( + template_name_or_list: Union[Text, Iterable[Text]], + **context: Any +) -> Text: ... +def render_template_string(source: Text, **context: Any) -> Text: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/testing.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/testing.pyi new file mode 100644 index 00000000..45a0065b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/testing.pyi @@ -0,0 +1,38 @@ +# Stubs for flask.testing (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from click import BaseCommand +from click.testing import CliRunner, Result +from typing import Any, IO, Iterable, Mapping, Optional, Text, TypeVar, Union +from werkzeug.test import Client + +def make_test_environ_builder(app: Any, path: str = ..., base_url: Optional[Any] = ..., subdomain: Optional[Any] = ..., url_scheme: Optional[Any] = ..., *args: Any, **kwargs: Any): ... + +# Response type for the client below. +# By default _R is Tuple[Iterable[Any], Union[Text, int], werkzeug.datastructures.Headers], however +# most commonly it is wrapped in a Reponse object. +_R = TypeVar('_R') + +class FlaskClient(Client[_R]): + preserve_context: bool = ... + environ_base: Any = ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def session_transaction(self, *args: Any, **kwargs: Any) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type: Any, exc_value: Any, tb: Any) -> None: ... + +class FlaskCliRunner(CliRunner): + app: Any = ... + def __init__(self, app: Any, **kwargs: Any) -> None: ... + def invoke( + self, + cli: Optional[BaseCommand] = ..., + args: Optional[Union[str, Iterable[str]]] = ..., + input: Optional[Union[bytes, IO[Any], Text]] = ..., + env: Optional[Mapping[str, str]] = ..., + catch_exceptions: bool = ..., + color: bool = ..., + **extra: Any, + ) -> Result: + ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/views.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/views.pyi new file mode 100644 index 00000000..a2637b3b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/views.pyi @@ -0,0 +1,22 @@ +# Stubs for flask.views (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from .globals import request +from typing import Any + +http_method_funcs: Any + +class View: + methods: Any = ... + provide_automatic_options: Any = ... + decorators: Any = ... + def dispatch_request(self, *args: Any, **kwargs: Any) -> Any: ... + @classmethod + def as_view(cls, name: Any, *class_args: Any, **class_kwargs: Any): ... + +class MethodViewType(type): + def __init__(self, name: Any, bases: Any, d: Any) -> None: ... + +class MethodView(View, metaclass=MethodViewType): + def dispatch_request(self, *args: Any, **kwargs: Any) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/wrappers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/wrappers.pyi new file mode 100644 index 00000000..df8869e0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/flask/wrappers.pyi @@ -0,0 +1,35 @@ +# Stubs for flask.wrappers (Python 3.6) +# +# NOTE: This dynamically typed stub was automatically generated by stubgen. + +from typing import Any, Dict, Optional +from werkzeug.exceptions import HTTPException +from werkzeug.routing import Rule +from werkzeug.wrappers import Request as RequestBase, Response as ResponseBase + +class JSONMixin: + @property + def is_json(self) -> bool: ... + @property + def json(self): ... + def get_json(self, force: bool = ..., silent: bool = ..., cache: bool = ...): ... + def on_json_loading_failed(self, e: Any) -> None: ... + +class Request(RequestBase, JSONMixin): + url_rule: Optional[Rule] = ... + view_args: Dict[str, Any] = ... + routing_exception: Optional[HTTPException] = ... + # Request is making the max_content_length readonly, where it was not the + # case in its supertype. + # We would require something like https://github.com/python/typing/issues/241 + @property + def max_content_length(self) -> Optional[int]: ... # type: ignore + @property + def endpoint(self) -> Optional[str]: ... + @property + def blueprint(self) -> Optional[str]: ... + +class Response(ResponseBase, JSONMixin): + default_mimetype: str = ... + @property + def max_cookie_size(self) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/geoip2/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/geoip2/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/geoip2/database.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/geoip2/database.pyi new file mode 100644 index 00000000..7a899116 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/geoip2/database.pyi @@ -0,0 +1,22 @@ +from types import TracebackType +from typing import Optional, Sequence, Text, Type + +from maxminddb.reader import Metadata +from geoip2.models import AnonymousIP, ASN, City, ConnectionType, Country, Domain, Enterprise, ISP + +_Locales = Optional[Sequence[Text]] + +class Reader: + def __init__(self, filename: Text, locales: _Locales = ..., mode: int = ...) -> None: ... + def __enter__(self) -> Reader: ... + def __exit__(self, exc_type: Optional[Type[BaseException]] = ..., exc_val: Optional[BaseException] = ..., exc_tb: Optional[TracebackType] = ...) -> None: ... + def country(self, ip_address: Text) -> Country: ... + def city(self, ip_address: Text) -> City: ... + def anonymous_ip(self, ip_address: Text) -> AnonymousIP: ... + def asn(self, ip_address: Text) -> ASN: ... + def connection_type(self, ip_address: Text) -> ConnectionType: ... + def domain(self, ip_address: Text) -> Domain: ... + def enterprise(self, ip_address: Text) -> Enterprise: ... + def isp(self, ip_address: Text) -> ISP: ... + def metadata(self) -> Metadata: ... + def close(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/geoip2/errors.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/geoip2/errors.pyi new file mode 100644 index 00000000..d5b703c3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/geoip2/errors.pyi @@ -0,0 +1,18 @@ +from typing import Optional, Text + +class GeoIP2Error(RuntimeError): ... + +class AddressNotFoundError(GeoIP2Error): ... + +class AuthenticationError(GeoIP2Error): ... + +class HTTPError(GeoIP2Error): + http_status: Optional[int] + uri: Optional[Text] + def __init__(self, message: Text, http_status: Optional[int] = ..., uri: Optional[Text] = ...) -> None: ... + +class InvalidRequestError(GeoIP2Error): ... + +class OutOfQueriesError(GeoIP2Error): ... + +class PermissionRequiredError(GeoIP2Error): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/geoip2/mixins.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/geoip2/mixins.pyi new file mode 100644 index 00000000..8c683c26 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/geoip2/mixins.pyi @@ -0,0 +1,3 @@ +class SimpleEquality: + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/geoip2/models.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/geoip2/models.pyi new file mode 100644 index 00000000..d9330ef8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/geoip2/models.pyi @@ -0,0 +1,65 @@ +from typing import Any, Mapping, Optional, Sequence, Text + +from geoip2 import records + +from geoip2.mixins import SimpleEquality + +_Locales = Optional[Sequence[Text]] +_RawResponse = Mapping[Text, Mapping[Text, Any]] + +class Country(SimpleEquality): + continent: records.Continent + country: records.Country + registered_country: records.Country + represented_country: records.RepresentedCountry + maxmind: records.MaxMind + traits: records.Traits + raw: _RawResponse + def __init__(self, raw_response: _RawResponse, locales: _Locales = ...) -> None: ... + +class City(Country): + city: records.City + location: records.Location + postal: records.Postal + subdivisions: records.Subdivisions + def __init__(self, raw_response: _RawResponse, locales: _Locales = ...) -> None: ... + +class Insights(City): ... + +class Enterprise(City): ... + +class SimpleModel(SimpleEquality): ... + +class AnonymousIP(SimpleModel): + is_anonymous: bool + is_anonymous_vpn: bool + is_hosting_provider: bool + is_public_proxy: bool + is_tor_exit_node: bool + ip_address: Optional[Text] + raw: _RawResponse + def __init__(self, raw: _RawResponse) -> None: ... + +class ASN(SimpleModel): + autonomous_system_number: Optional[int] + autonomous_system_organization: Optional[Text] + ip_address: Optional[Text] + raw: _RawResponse + def __init__(self, raw: _RawResponse) -> None: ... + +class ConnectionType(SimpleModel): + connection_type: Optional[Text] + ip_address: Optional[Text] + raw: _RawResponse + def __init__(self, raw: _RawResponse) -> None: ... + +class Domain(SimpleModel): + domain: Optional[Text] + ip_address: Optional[Text] + raw: Optional[Text] + def __init__(self, raw: _RawResponse) -> None: ... + +class ISP(ASN): + isp: Optional[Text] + organization: Optional[Text] + def __init__(self, raw: _RawResponse) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/geoip2/records.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/geoip2/records.pyi new file mode 100644 index 00000000..0d90b18c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/geoip2/records.pyi @@ -0,0 +1,83 @@ +from typing import Any, Mapping, Optional, Sequence, Text, Tuple + +from geoip2.mixins import SimpleEquality + +_Locales = Optional[Sequence[Text]] +_Names = Mapping[Text, Text] + +class Record(SimpleEquality): + def __init__(self, **kwargs: Any) -> None: ... + def __setattr__(self, name: Text, value: Any) -> None: ... + +class PlaceRecord(Record): + def __init__(self, locales: _Locales = ..., **kwargs: Any) -> None: ... + @property + def name(self) -> Text: ... + +class City(PlaceRecord): + confidence: int + geoname_id: int + names: _Names + +class Continent(PlaceRecord): + code: Text + geoname_id: int + names: _Names + +class Country(PlaceRecord): + confidence: int + geoname_id: int + is_in_european_union: bool + iso_code: Text + names: _Names + def __init__(self, locales: _Locales = ..., **kwargs: Any) -> None: ... + +class RepresentedCountry(Country): + type: Text + +class Location(Record): + average_income: int + accuracy_radius: int + latitude: float + longitude: float + metro_code: int + population_density: int + time_zone: Text + +class MaxMind(Record): + queries_remaining: int + +class Postal(Record): + code: Text + confidence: int + +class Subdivision(PlaceRecord): + confidence: int + geoname_id: int + iso_code: Text + names: _Names + +class Subdivisions(Tuple[Subdivision]): + def __new__(cls, locales: _Locales, *subdivisions: Subdivision) -> Subdivisions: ... + def __init__(self, locales: _Locales, *subdivisions: Subdivision) -> None: ... + @property + def most_specific(self) -> Subdivision: ... + +class Traits(Record): + autonomous_system_number: int + autonomous_system_organization: Text + connection_type: Text + domain: Text + ip_address: Text + is_anonymous: bool + is_anonymous_proxy: bool + is_anonymous_vpn: bool + is_hosting_provider: bool + is_legitimate_proxy: bool + is_public_proxy: bool + is_satellite_provider: bool + is_tor_exit_node: bool + isp: Text + organization: Text + user_type: Text + def __init__(self, **kwargs: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/__init__.pyi new file mode 100644 index 00000000..aae1f931 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/__init__.pyi @@ -0,0 +1 @@ +__version__: bytes diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_pb2.pyi new file mode 100644 index 00000000..4b868072 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_pb2.pyi @@ -0,0 +1,9 @@ +from google.protobuf.message import Message +from google.protobuf.internal import well_known_types + +from typing import Optional, Text + +class Any(Message, well_known_types.Any_): + type_url: Text + value: bytes + def __init__(self, type_url: Optional[Text] = ..., value: Optional[bytes] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_test_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_test_pb2.pyi new file mode 100644 index 00000000..67985f5e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/any_test_pb2.pyi @@ -0,0 +1,14 @@ +from google.protobuf.any_pb2 import Any +from google.protobuf.internal.containers import RepeatedCompositeFieldContainer +from google.protobuf.message import Message +from typing import Iterable, Optional + +class TestAny(Message): + int32_value: int + @property + def any_value(self) -> Any: ... + @property + def repeated_any_value(self) -> RepeatedCompositeFieldContainer[Any]: ... + def __init__( + self, int32_value: Optional[int] = ..., any_value: Optional[Any] = ..., repeated_any_value: Optional[Iterable[Any]] = ... + ) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/api_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/api_pb2.pyi new file mode 100644 index 00000000..f1f76548 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/api_pb2.pyi @@ -0,0 +1,53 @@ +from google.protobuf.internal.containers import RepeatedCompositeFieldContainer +from google.protobuf.message import Message +from google.protobuf.source_context_pb2 import SourceContext +from google.protobuf.type_pb2 import Option, Syntax +from typing import Iterable, Optional, Text + +class Api(Message): + name: Text + version: Text + syntax: Syntax + @property + def methods(self) -> RepeatedCompositeFieldContainer[Method]: ... + @property + def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + @property + def source_context(self) -> SourceContext: ... + @property + def mixins(self) -> RepeatedCompositeFieldContainer[Mixin]: ... + def __init__( + self, + name: Optional[Text] = ..., + methods: Optional[Iterable[Method]] = ..., + options: Optional[Iterable[Option]] = ..., + version: Optional[Text] = ..., + source_context: Optional[SourceContext] = ..., + mixins: Optional[Iterable[Mixin]] = ..., + syntax: Optional[Syntax] = ..., + ) -> None: ... + +class Method(Message): + name: Text + request_type_url: Text + request_streaming: bool + response_type_url: Text + response_streaming: bool + syntax: Syntax + @property + def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + def __init__( + self, + name: Optional[Text] = ..., + request_type_url: Optional[Text] = ..., + request_streaming: Optional[bool] = ..., + response_type_url: Optional[Text] = ..., + response_streaming: Optional[bool] = ..., + options: Optional[Iterable[Option]] = ..., + syntax: Optional[Syntax] = ..., + ) -> None: ... + +class Mixin(Message): + name: Text + root: Text + def __init__(self, name: Optional[Text] = ..., root: Optional[Text] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi new file mode 100644 index 00000000..7ed1a665 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi @@ -0,0 +1,41 @@ +from google.protobuf.descriptor_pb2 import FileDescriptorProto +from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer +from google.protobuf.message import Message +from typing import Iterable, Optional, Text + +class Version(Message): + major: int + minor: int + patch: int + suffix: Text + def __init__( + self, major: Optional[int] = ..., minor: Optional[int] = ..., patch: Optional[int] = ..., suffix: Optional[Text] = ... + ) -> None: ... + +class CodeGeneratorRequest(Message): + file_to_generate: RepeatedScalarFieldContainer[Text] + parameter: Text + @property + def proto_file(self) -> RepeatedCompositeFieldContainer[FileDescriptorProto]: ... + @property + def compiler_version(self) -> Version: ... + def __init__( + self, + file_to_generate: Optional[Iterable[Text]] = ..., + parameter: Optional[Text] = ..., + proto_file: Optional[Iterable[FileDescriptorProto]] = ..., + compiler_version: Optional[Version] = ..., + ) -> None: ... + +class CodeGeneratorResponse(Message): + class File(Message): + name: Text + insertion_point: Text + content: Text + def __init__( + self, name: Optional[Text] = ..., insertion_point: Optional[Text] = ..., content: Optional[Text] = ... + ) -> None: ... + error: Text + @property + def file(self) -> RepeatedCompositeFieldContainer[CodeGeneratorResponse.File]: ... + def __init__(self, error: Optional[Text] = ..., file: Optional[Iterable[CodeGeneratorResponse.File]] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor.pyi new file mode 100644 index 00000000..39d08aba --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor.pyi @@ -0,0 +1,286 @@ +from typing import Any + +from .message import Message +from .descriptor_pb2 import ( + EnumOptions, + EnumValueOptions, + FieldOptions, + FileOptions, + MessageOptions, + MethodOptions, + OneofOptions, + ServiceOptions, +) + +class Error(Exception): ... +class TypeTransformationError(Error): ... + +class DescriptorMetaclass(type): + def __instancecheck__(self, obj): ... + +class DescriptorBase(metaclass=DescriptorMetaclass): + has_options: Any + def __init__(self, options, options_class_name) -> None: ... + def GetOptions(self): ... + +class _NestedDescriptorBase(DescriptorBase): + name: Any + full_name: Any + file: Any + containing_type: Any + def __init__( + self, options, options_class_name, name, full_name, file, containing_type, serialized_start=..., serialized_end=... + ) -> None: ... + def GetTopLevelContainingType(self): ... + def CopyToProto(self, proto): ... + +class Descriptor(_NestedDescriptorBase): + def __new__( + cls, + name, + full_name, + filename, + containing_type, + fields, + nested_types, + enum_types, + extensions, + options=..., + is_extendable=..., + extension_ranges=..., + oneofs=..., + file=..., + serialized_start=..., + serialized_end=..., + syntax=..., + ): ... + fields: Any + fields_by_number: Any + fields_by_name: Any + nested_types: Any + nested_types_by_name: Any + enum_types: Any + enum_types_by_name: Any + enum_values_by_name: Any + extensions: Any + extensions_by_name: Any + is_extendable: Any + extension_ranges: Any + oneofs: Any + oneofs_by_name: Any + syntax: Any + def __init__( + self, + name, + full_name, + filename, + containing_type, + fields, + nested_types, + enum_types, + extensions, + options=..., + is_extendable=..., + extension_ranges=..., + oneofs=..., + file=..., + serialized_start=..., + serialized_end=..., + syntax=..., + ) -> None: ... + def EnumValueName(self, enum, value): ... + def CopyToProto(self, proto): ... + def GetOptions(self) -> MessageOptions: ... + +class FieldDescriptor(DescriptorBase): + TYPE_DOUBLE: Any + TYPE_FLOAT: Any + TYPE_INT64: Any + TYPE_UINT64: Any + TYPE_INT32: Any + TYPE_FIXED64: Any + TYPE_FIXED32: Any + TYPE_BOOL: Any + TYPE_STRING: Any + TYPE_GROUP: Any + TYPE_MESSAGE: Any + TYPE_BYTES: Any + TYPE_UINT32: Any + TYPE_ENUM: Any + TYPE_SFIXED32: Any + TYPE_SFIXED64: Any + TYPE_SINT32: Any + TYPE_SINT64: Any + MAX_TYPE: Any + CPPTYPE_INT32: Any + CPPTYPE_INT64: Any + CPPTYPE_UINT32: Any + CPPTYPE_UINT64: Any + CPPTYPE_DOUBLE: Any + CPPTYPE_FLOAT: Any + CPPTYPE_BOOL: Any + CPPTYPE_ENUM: Any + CPPTYPE_STRING: Any + CPPTYPE_MESSAGE: Any + MAX_CPPTYPE: Any + LABEL_OPTIONAL: Any + LABEL_REQUIRED: Any + LABEL_REPEATED: Any + MAX_LABEL: Any + MAX_FIELD_NUMBER: Any + FIRST_RESERVED_FIELD_NUMBER: Any + LAST_RESERVED_FIELD_NUMBER: Any + def __new__( + cls, + name, + full_name, + index, + number, + type, + cpp_type, + label, + default_value, + message_type, + enum_type, + containing_type, + is_extension, + extension_scope, + options=..., + file=..., + has_default_value=..., + containing_oneof=..., + ): ... + name: Any + full_name: Any + index: Any + number: Any + type: Any + cpp_type: Any + label: Any + has_default_value: Any + default_value: Any + containing_type: Any + message_type: Any + enum_type: Any + is_extension: Any + extension_scope: Any + containing_oneof: Any + def __init__( + self, + name, + full_name, + index, + number, + type, + cpp_type, + label, + default_value, + message_type, + enum_type, + containing_type, + is_extension, + extension_scope, + options=..., + file=..., + has_default_value=..., + containing_oneof=..., + ) -> None: ... + @staticmethod + def ProtoTypeToCppProtoType(proto_type): ... + def GetOptions(self) -> FieldOptions: ... + +class EnumDescriptor(_NestedDescriptorBase): + def __new__( + cls, + name, + full_name, + filename, + values, + containing_type=..., + options=..., + file=..., + serialized_start=..., + serialized_end=..., + ): ... + values: Any + values_by_name: Any + values_by_number: Any + def __init__( + self, + name, + full_name, + filename, + values, + containing_type=..., + options=..., + file=..., + serialized_start=..., + serialized_end=..., + ) -> None: ... + def CopyToProto(self, proto): ... + def GetOptions(self) -> EnumOptions: ... + +class EnumValueDescriptor(DescriptorBase): + def __new__(cls, name, index, number, type=..., options=...): ... + name: Any + index: Any + number: Any + type: Any + def __init__(self, name, index, number, type=..., options=...) -> None: ... + def GetOptions(self) -> EnumValueOptions: ... + +class OneofDescriptor: + def __new__(cls, name, full_name, index, containing_type, fields): ... + name: Any + full_name: Any + index: Any + containing_type: Any + fields: Any + def __init__(self, name, full_name, index, containing_type, fields) -> None: ... + def GetOptions(self) -> OneofOptions: ... + +class ServiceDescriptor(_NestedDescriptorBase): + index: Any + methods: Any + methods_by_name: Any + def __init__( + self, name, full_name, index, methods, options=..., file=..., serialized_start=..., serialized_end=... + ) -> None: ... + def FindMethodByName(self, name): ... + def CopyToProto(self, proto): ... + def GetOptions(self) -> ServiceOptions: ... + +class MethodDescriptor(DescriptorBase): + name: Any + full_name: Any + index: Any + containing_service: Any + input_type: Any + output_type: Any + def __init__(self, name, full_name, index, containing_service, input_type, output_type, options=...) -> None: ... + def GetOptions(self) -> MethodOptions: ... + +class FileDescriptor(DescriptorBase): + def __new__( + cls, name, package, options=..., serialized_pb=..., dependencies=..., public_dependencies=..., syntax=..., pool=... + ): ... + _options: Any + pool: Any + message_types_by_name: Any + name: Any + package: Any + syntax: Any + serialized_pb: Any + enum_types_by_name: Any + extensions_by_name: Any + services_by_name: Any + dependencies: Any + public_dependencies: Any + def __init__( + self, name, package, options=..., serialized_pb=..., dependencies=..., public_dependencies=..., syntax=..., pool=... + ) -> None: ... + def CopyToProto(self, proto): ... + def GetOptions(self) -> FileOptions: ... + +def MakeDescriptor(desc_proto, package=..., build_file_if_cpp=..., syntax=...): ... +def _ParseOptions(message: Message, string: bytes) -> Message: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pb2.pyi new file mode 100644 index 00000000..4588c1bc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pb2.pyi @@ -0,0 +1,471 @@ +from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer +from google.protobuf.message import Message +from typing import Iterable, List, Optional, Text, Tuple, cast + +class FileDescriptorSet(Message): + @property + def file(self) -> RepeatedCompositeFieldContainer[FileDescriptorProto]: ... + def __init__(self, file: Optional[Iterable[FileDescriptorProto]] = ...) -> None: ... + +class FileDescriptorProto(Message): + name: Text + package: Text + dependency: RepeatedScalarFieldContainer[Text] + public_dependency: RepeatedScalarFieldContainer[int] + weak_dependency: RepeatedScalarFieldContainer[int] + syntax: Text + @property + def message_type(self) -> RepeatedCompositeFieldContainer[DescriptorProto]: ... + @property + def enum_type(self) -> RepeatedCompositeFieldContainer[EnumDescriptorProto]: ... + @property + def service(self) -> RepeatedCompositeFieldContainer[ServiceDescriptorProto]: ... + @property + def extension(self) -> RepeatedCompositeFieldContainer[FieldDescriptorProto]: ... + @property + def options(self) -> FileOptions: ... + @property + def source_code_info(self) -> SourceCodeInfo: ... + def __init__( + self, + name: Optional[Text] = ..., + package: Optional[Text] = ..., + dependency: Optional[Iterable[Text]] = ..., + public_dependency: Optional[Iterable[int]] = ..., + weak_dependency: Optional[Iterable[int]] = ..., + message_type: Optional[Iterable[DescriptorProto]] = ..., + enum_type: Optional[Iterable[EnumDescriptorProto]] = ..., + service: Optional[Iterable[ServiceDescriptorProto]] = ..., + extension: Optional[Iterable[FieldDescriptorProto]] = ..., + options: Optional[FileOptions] = ..., + source_code_info: Optional[SourceCodeInfo] = ..., + syntax: Optional[Text] = ..., + ) -> None: ... + +class DescriptorProto(Message): + class ExtensionRange(Message): + start: int + end: int + @property + def options(self) -> ExtensionRangeOptions: ... + def __init__( + self, start: Optional[int] = ..., end: Optional[int] = ..., options: Optional[ExtensionRangeOptions] = ... + ) -> None: ... + class ReservedRange(Message): + start: int + end: int + def __init__(self, start: Optional[int] = ..., end: Optional[int] = ...) -> None: ... + name: Text + reserved_name: RepeatedScalarFieldContainer[Text] + @property + def field(self) -> RepeatedCompositeFieldContainer[FieldDescriptorProto]: ... + @property + def extension(self) -> RepeatedCompositeFieldContainer[FieldDescriptorProto]: ... + @property + def nested_type(self) -> RepeatedCompositeFieldContainer[DescriptorProto]: ... + @property + def enum_type(self) -> RepeatedCompositeFieldContainer[EnumDescriptorProto]: ... + @property + def extension_range(self) -> RepeatedCompositeFieldContainer[DescriptorProto.ExtensionRange]: ... + @property + def oneof_decl(self) -> RepeatedCompositeFieldContainer[OneofDescriptorProto]: ... + @property + def options(self) -> MessageOptions: ... + @property + def reserved_range(self) -> RepeatedCompositeFieldContainer[DescriptorProto.ReservedRange]: ... + def __init__( + self, + name: Optional[Text] = ..., + field: Optional[Iterable[FieldDescriptorProto]] = ..., + extension: Optional[Iterable[FieldDescriptorProto]] = ..., + nested_type: Optional[Iterable[DescriptorProto]] = ..., + enum_type: Optional[Iterable[EnumDescriptorProto]] = ..., + extension_range: Optional[Iterable[DescriptorProto.ExtensionRange]] = ..., + oneof_decl: Optional[Iterable[OneofDescriptorProto]] = ..., + options: Optional[MessageOptions] = ..., + reserved_range: Optional[Iterable[DescriptorProto.ReservedRange]] = ..., + reserved_name: Optional[Iterable[Text]] = ..., + ) -> None: ... + +class ExtensionRangeOptions(Message): + @property + def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + def __init__(self, uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...) -> None: ... + +class FieldDescriptorProto(Message): + class Type(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> FieldDescriptorProto.Type: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[FieldDescriptorProto.Type]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, FieldDescriptorProto.Type]]: ... + TYPE_DOUBLE: FieldDescriptorProto.Type + TYPE_FLOAT: FieldDescriptorProto.Type + TYPE_INT64: FieldDescriptorProto.Type + TYPE_UINT64: FieldDescriptorProto.Type + TYPE_INT32: FieldDescriptorProto.Type + TYPE_FIXED64: FieldDescriptorProto.Type + TYPE_FIXED32: FieldDescriptorProto.Type + TYPE_BOOL: FieldDescriptorProto.Type + TYPE_STRING: FieldDescriptorProto.Type + TYPE_GROUP: FieldDescriptorProto.Type + TYPE_MESSAGE: FieldDescriptorProto.Type + TYPE_BYTES: FieldDescriptorProto.Type + TYPE_UINT32: FieldDescriptorProto.Type + TYPE_ENUM: FieldDescriptorProto.Type + TYPE_SFIXED32: FieldDescriptorProto.Type + TYPE_SFIXED64: FieldDescriptorProto.Type + TYPE_SINT32: FieldDescriptorProto.Type + TYPE_SINT64: FieldDescriptorProto.Type + class Label(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> FieldDescriptorProto.Label: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[FieldDescriptorProto.Label]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, FieldDescriptorProto.Label]]: ... + LABEL_OPTIONAL: FieldDescriptorProto.Label + LABEL_REQUIRED: FieldDescriptorProto.Label + LABEL_REPEATED: FieldDescriptorProto.Label + name: Text + number: int + label: FieldDescriptorProto.Label + type: FieldDescriptorProto.Type + type_name: Text + extendee: Text + default_value: Text + oneof_index: int + json_name: Text + @property + def options(self) -> FieldOptions: ... + def __init__( + self, + name: Optional[Text] = ..., + number: Optional[int] = ..., + label: Optional[FieldDescriptorProto.Label] = ..., + type: Optional[FieldDescriptorProto.Type] = ..., + type_name: Optional[Text] = ..., + extendee: Optional[Text] = ..., + default_value: Optional[Text] = ..., + oneof_index: Optional[int] = ..., + json_name: Optional[Text] = ..., + options: Optional[FieldOptions] = ..., + ) -> None: ... + +class OneofDescriptorProto(Message): + name: Text + @property + def options(self) -> OneofOptions: ... + def __init__(self, name: Optional[Text] = ..., options: Optional[OneofOptions] = ...) -> None: ... + +class EnumDescriptorProto(Message): + class EnumReservedRange(Message): + start: int + end: int + def __init__(self, start: Optional[int] = ..., end: Optional[int] = ...) -> None: ... + name: Text + reserved_name: RepeatedScalarFieldContainer[Text] + @property + def value(self) -> RepeatedCompositeFieldContainer[EnumValueDescriptorProto]: ... + @property + def options(self) -> EnumOptions: ... + @property + def reserved_range(self) -> RepeatedCompositeFieldContainer[EnumDescriptorProto.EnumReservedRange]: ... + def __init__( + self, + name: Optional[Text] = ..., + value: Optional[Iterable[EnumValueDescriptorProto]] = ..., + options: Optional[EnumOptions] = ..., + reserved_range: Optional[Iterable[EnumDescriptorProto.EnumReservedRange]] = ..., + reserved_name: Optional[Iterable[Text]] = ..., + ) -> None: ... + +class EnumValueDescriptorProto(Message): + name: Text + number: int + @property + def options(self) -> EnumValueOptions: ... + def __init__( + self, name: Optional[Text] = ..., number: Optional[int] = ..., options: Optional[EnumValueOptions] = ... + ) -> None: ... + +class ServiceDescriptorProto(Message): + name: Text + @property + def method(self) -> RepeatedCompositeFieldContainer[MethodDescriptorProto]: ... + @property + def options(self) -> ServiceOptions: ... + def __init__( + self, + name: Optional[Text] = ..., + method: Optional[Iterable[MethodDescriptorProto]] = ..., + options: Optional[ServiceOptions] = ..., + ) -> None: ... + +class MethodDescriptorProto(Message): + name: Text + input_type: Text + output_type: Text + client_streaming: bool + server_streaming: bool + @property + def options(self) -> MethodOptions: ... + def __init__( + self, + name: Optional[Text] = ..., + input_type: Optional[Text] = ..., + output_type: Optional[Text] = ..., + options: Optional[MethodOptions] = ..., + client_streaming: Optional[bool] = ..., + server_streaming: Optional[bool] = ..., + ) -> None: ... + +class FileOptions(Message): + class OptimizeMode(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> FileOptions.OptimizeMode: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[FileOptions.OptimizeMode]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, FileOptions.OptimizeMode]]: ... + SPEED: FileOptions.OptimizeMode + CODE_SIZE: FileOptions.OptimizeMode + LITE_RUNTIME: FileOptions.OptimizeMode + java_package: Text + java_outer_classname: Text + java_multiple_files: bool + java_generate_equals_and_hash: bool + java_string_check_utf8: bool + optimize_for: FileOptions.OptimizeMode + go_package: Text + cc_generic_services: bool + java_generic_services: bool + py_generic_services: bool + php_generic_services: bool + deprecated: bool + cc_enable_arenas: bool + objc_class_prefix: Text + csharp_namespace: Text + swift_prefix: Text + php_class_prefix: Text + php_namespace: Text + @property + def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + def __init__( + self, + java_package: Optional[Text] = ..., + java_outer_classname: Optional[Text] = ..., + java_multiple_files: Optional[bool] = ..., + java_generate_equals_and_hash: Optional[bool] = ..., + java_string_check_utf8: Optional[bool] = ..., + optimize_for: Optional[FileOptions.OptimizeMode] = ..., + go_package: Optional[Text] = ..., + cc_generic_services: Optional[bool] = ..., + java_generic_services: Optional[bool] = ..., + py_generic_services: Optional[bool] = ..., + php_generic_services: Optional[bool] = ..., + deprecated: Optional[bool] = ..., + cc_enable_arenas: Optional[bool] = ..., + objc_class_prefix: Optional[Text] = ..., + csharp_namespace: Optional[Text] = ..., + swift_prefix: Optional[Text] = ..., + php_class_prefix: Optional[Text] = ..., + php_namespace: Optional[Text] = ..., + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + +class MessageOptions(Message): + message_set_wire_format: bool + no_standard_descriptor_accessor: bool + deprecated: bool + map_entry: bool + @property + def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + def __init__( + self, + message_set_wire_format: Optional[bool] = ..., + no_standard_descriptor_accessor: Optional[bool] = ..., + deprecated: Optional[bool] = ..., + map_entry: Optional[bool] = ..., + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + +class FieldOptions(Message): + class CType(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> FieldOptions.CType: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[FieldOptions.CType]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, FieldOptions.CType]]: ... + STRING: FieldOptions.CType + CORD: FieldOptions.CType + STRING_PIECE: FieldOptions.CType + class JSType(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> FieldOptions.JSType: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[FieldOptions.JSType]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, FieldOptions.JSType]]: ... + JS_NORMAL: FieldOptions.JSType + JS_STRING: FieldOptions.JSType + JS_NUMBER: FieldOptions.JSType + ctype: FieldOptions.CType + packed: bool + jstype: FieldOptions.JSType + lazy: bool + deprecated: bool + weak: bool + @property + def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + def __init__( + self, + ctype: Optional[FieldOptions.CType] = ..., + packed: Optional[bool] = ..., + jstype: Optional[FieldOptions.JSType] = ..., + lazy: Optional[bool] = ..., + deprecated: Optional[bool] = ..., + weak: Optional[bool] = ..., + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + +class OneofOptions(Message): + @property + def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + def __init__(self, uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...) -> None: ... + +class EnumOptions(Message): + allow_alias: bool + deprecated: bool + @property + def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + def __init__( + self, + allow_alias: Optional[bool] = ..., + deprecated: Optional[bool] = ..., + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + +class EnumValueOptions(Message): + deprecated: bool + @property + def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + def __init__( + self, deprecated: Optional[bool] = ..., uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ... + ) -> None: ... + +class ServiceOptions(Message): + deprecated: bool + @property + def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + def __init__( + self, deprecated: Optional[bool] = ..., uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ... + ) -> None: ... + +class MethodOptions(Message): + class IdempotencyLevel(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> MethodOptions.IdempotencyLevel: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[MethodOptions.IdempotencyLevel]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, MethodOptions.IdempotencyLevel]]: ... + IDEMPOTENCY_UNKNOWN: MethodOptions.IdempotencyLevel + NO_SIDE_EFFECTS: MethodOptions.IdempotencyLevel + IDEMPOTENT: MethodOptions.IdempotencyLevel + deprecated: bool + idempotency_level: MethodOptions.IdempotencyLevel + @property + def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ... + def __init__( + self, + deprecated: Optional[bool] = ..., + idempotency_level: Optional[MethodOptions.IdempotencyLevel] = ..., + uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ..., + ) -> None: ... + +class UninterpretedOption(Message): + class NamePart(Message): + name_part: Text + is_extension: bool + def __init__(self, name_part: Text, is_extension: bool) -> None: ... + identifier_value: Text + positive_int_value: int + negative_int_value: int + double_value: float + string_value: bytes + aggregate_value: Text + @property + def name(self) -> RepeatedCompositeFieldContainer[UninterpretedOption.NamePart]: ... + def __init__( + self, + name: Optional[Iterable[UninterpretedOption.NamePart]] = ..., + identifier_value: Optional[Text] = ..., + positive_int_value: Optional[int] = ..., + negative_int_value: Optional[int] = ..., + double_value: Optional[float] = ..., + string_value: Optional[bytes] = ..., + aggregate_value: Optional[Text] = ..., + ) -> None: ... + +class SourceCodeInfo(Message): + class Location(Message): + path: RepeatedScalarFieldContainer[int] + span: RepeatedScalarFieldContainer[int] + leading_comments: Text + trailing_comments: Text + leading_detached_comments: RepeatedScalarFieldContainer[Text] + def __init__( + self, + path: Optional[Iterable[int]] = ..., + span: Optional[Iterable[int]] = ..., + leading_comments: Optional[Text] = ..., + trailing_comments: Optional[Text] = ..., + leading_detached_comments: Optional[Iterable[Text]] = ..., + ) -> None: ... + @property + def location(self) -> RepeatedCompositeFieldContainer[SourceCodeInfo.Location]: ... + def __init__(self, location: Optional[Iterable[SourceCodeInfo.Location]] = ...) -> None: ... + +class GeneratedCodeInfo(Message): + class Annotation(Message): + path: RepeatedScalarFieldContainer[int] + source_file: Text + begin: int + end: int + def __init__( + self, + path: Optional[Iterable[int]] = ..., + source_file: Optional[Text] = ..., + begin: Optional[int] = ..., + end: Optional[int] = ..., + ) -> None: ... + @property + def annotation(self) -> RepeatedCompositeFieldContainer[GeneratedCodeInfo.Annotation]: ... + def __init__(self, annotation: Optional[Iterable[GeneratedCodeInfo.Annotation]] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pool.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pool.pyi new file mode 100644 index 00000000..f1ade526 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/descriptor_pool.pyi @@ -0,0 +1,18 @@ +from typing import Any, Optional + +class DescriptorPool: + def __new__(cls, descriptor_db: Optional[Any] = ...): ... + def __init__(self, descriptor_db: Optional[Any] = ...) -> None: ... + def Add(self, file_desc_proto): ... + def AddSerializedFile(self, serialized_file_desc_proto): ... + def AddDescriptor(self, desc): ... + def AddEnumDescriptor(self, enum_desc): ... + def AddFileDescriptor(self, file_desc): ... + def FindFileByName(self, file_name): ... + def FindFileContainingSymbol(self, symbol): ... + def FindMessageTypeByName(self, full_name): ... + def FindEnumTypeByName(self, full_name): ... + def FindFieldByName(self, full_name): ... + def FindExtensionByName(self, full_name): ... + +def Default(): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/duration_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/duration_pb2.pyi new file mode 100644 index 00000000..a7e4bf3c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/duration_pb2.pyi @@ -0,0 +1,9 @@ +from google.protobuf.message import Message +from google.protobuf.internal import well_known_types + +from typing import Optional + +class Duration(Message, well_known_types.Duration): + seconds: int + nanos: int + def __init__(self, seconds: Optional[int] = ..., nanos: Optional[int] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/empty_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/empty_pb2.pyi new file mode 100644 index 00000000..7046e643 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/empty_pb2.pyi @@ -0,0 +1,4 @@ +from google.protobuf.message import Message + +class Empty(Message): + def __init__(self,) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/field_mask_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/field_mask_pb2.pyi new file mode 100644 index 00000000..11855196 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/field_mask_pb2.pyi @@ -0,0 +1,9 @@ +from google.protobuf.internal.containers import RepeatedScalarFieldContainer +from google.protobuf.internal import well_known_types + +from google.protobuf.message import Message +from typing import Iterable, Optional, Text + +class FieldMask(Message, well_known_types.FieldMask): + paths: RepeatedScalarFieldContainer[Text] + def __init__(self, paths: Optional[Iterable[Text]] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/containers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/containers.pyi new file mode 100644 index 00000000..fc97c733 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/containers.pyi @@ -0,0 +1,56 @@ +from google.protobuf.descriptor import Descriptor +from google.protobuf.internal.message_listener import MessageListener +from google.protobuf.message import Message +from typing import Sequence, TypeVar, Generic, Any, Iterator, Iterable, Union, Optional, Callable, overload, List + +_T = TypeVar("_T") + +class BaseContainer(Sequence[_T]): + def __init__(self, message_listener: MessageListener) -> None: ... + def __len__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __repr__(self) -> str: ... + def sort(self, *, key: Optional[Callable[[_T], Any]] = ..., reverse: bool = ...) -> None: ... + @overload + def __getitem__(self, key: int) -> _T: ... + @overload + def __getitem__(self, key: slice) -> List[_T]: ... + +class RepeatedScalarFieldContainer(BaseContainer[_T]): + def __init__(self, message_listener: MessageListener, message_descriptor: Descriptor) -> None: ... + def append(self, value: _T) -> None: ... + def insert(self, key: int, value: _T) -> None: ... + def extend(self, elem_seq: Optional[Iterable[_T]]) -> None: ... + def MergeFrom(self, other: RepeatedScalarFieldContainer[_T]) -> None: ... + def remove(self, elem: _T) -> None: ... + def pop(self, key: int = ...) -> _T: ... + @overload + def __setitem__(self, key: int, value: _T) -> None: ... + @overload + def __setitem__(self, key: slice, value: Iterable[_T]) -> None: ... + def __getslice__(self, start: int, stop: int) -> List[_T]: ... + def __setslice__(self, start: int, stop: int, values: Iterable[_T]) -> None: ... + def __delitem__(self, key: Union[int, slice]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + +class RepeatedCompositeFieldContainer(BaseContainer[_T]): + def __init__(self, message_listener: MessageListener, type_checker: Any) -> None: ... + def add(self, **kwargs: Any) -> _T: ... + def append(self, value: _T) -> None: ... + def insert(self, key: int, value: _T) -> None: ... + def extend(self, elem_seq: Iterable[_T]) -> None: ... + def MergeFrom(self, other: RepeatedCompositeFieldContainer[_T]) -> None: ... + def remove(self, elem: _T) -> None: ... + def pop(self, key: int = ...) -> _T: ... + def __getslice__(self, start: int, stop: int) -> List[_T]: ... + def __delitem__(self, key: Union[int, slice]) -> None: ... + def __delslice__(self, start: int, stop: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + +# Classes not yet typed +class Mapping(Any): ... +class MutableMapping(Mapping): ... +class ScalarMap(MutableMapping): ... +class MessageMap(MutableMapping): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/decoder.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/decoder.pyi new file mode 100644 index 00000000..24774ee2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/decoder.pyi @@ -0,0 +1,30 @@ +from typing import Any + +def ReadTag(buffer, pos): ... +def EnumDecoder(field_number, is_repeated, is_packed, key, new_default): ... + +Int32Decoder: Any +Int64Decoder: Any +UInt32Decoder: Any +UInt64Decoder: Any +SInt32Decoder: Any +SInt64Decoder: Any +Fixed32Decoder: Any +Fixed64Decoder: Any +SFixed32Decoder: Any +SFixed64Decoder: Any +FloatDecoder: Any +DoubleDecoder: Any +BoolDecoder: Any + +def StringDecoder(field_number, is_repeated, is_packed, key, new_default): ... +def BytesDecoder(field_number, is_repeated, is_packed, key, new_default): ... +def GroupDecoder(field_number, is_repeated, is_packed, key, new_default): ... +def MessageDecoder(field_number, is_repeated, is_packed, key, new_default): ... + +MESSAGE_SET_ITEM_TAG: Any + +def MessageSetItemDecoder(extensions_by_number): ... +def MapDecoder(field_descriptor, new_default, is_message_map): ... + +SkipField: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/encoder.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/encoder.pyi new file mode 100644 index 00000000..7a7923fe --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/encoder.pyi @@ -0,0 +1,34 @@ +from typing import Any + +Int32Sizer: Any +UInt32Sizer: Any +SInt32Sizer: Any +Fixed32Sizer: Any +Fixed64Sizer: Any +BoolSizer: Any + +def StringSizer(field_number, is_repeated, is_packed): ... +def BytesSizer(field_number, is_repeated, is_packed): ... +def GroupSizer(field_number, is_repeated, is_packed): ... +def MessageSizer(field_number, is_repeated, is_packed): ... +def MessageSetItemSizer(field_number): ... +def MapSizer(field_descriptor): ... +def TagBytes(field_number, wire_type): ... + +Int32Encoder: Any +UInt32Encoder: Any +SInt32Encoder: Any +Fixed32Encoder: Any +Fixed64Encoder: Any +SFixed32Encoder: Any +SFixed64Encoder: Any +FloatEncoder: Any +DoubleEncoder: Any + +def BoolEncoder(field_number, is_repeated, is_packed): ... +def StringEncoder(field_number, is_repeated, is_packed): ... +def BytesEncoder(field_number, is_repeated, is_packed): ... +def GroupEncoder(field_number, is_repeated, is_packed): ... +def MessageEncoder(field_number, is_repeated, is_packed): ... +def MessageSetItemEncoder(field_number): ... +def MapEncoder(field_descriptor): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi new file mode 100644 index 00000000..174002d7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi @@ -0,0 +1,10 @@ +from typing import Any, List, Tuple + +class EnumTypeWrapper(object): + def __init__(self, enum_type: Any) -> None: ... + def Name(self, number: int) -> bytes: ... + def Value(self, name: bytes) -> int: ... + def keys(self) -> List[bytes]: ... + def values(self) -> List[int]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, int]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/message_listener.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/message_listener.pyi new file mode 100644 index 00000000..e8d33a5a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/message_listener.pyi @@ -0,0 +1,5 @@ +class MessageListener(object): + def Modified(self) -> None: ... + +class NullMessageListener(MessageListener): + def Modified(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/well_known_types.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/well_known_types.pyi new file mode 100644 index 00000000..fc0344f7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/well_known_types.pyi @@ -0,0 +1,94 @@ +from typing import Any, Optional +from datetime import datetime + +class Error(Exception): ... +class ParseError(Error): ... + +# This is named 'Any' in the original, but that conflicts with typing.Any, +# and we really only need this file to mix in. +class Any_: + type_url: Any = ... + value: Any = ... + def Pack(self, msg: Any, type_url_prefix: bytes = ..., deterministic: Optional[Any] = ...) -> None: ... + def Unpack(self, msg: Any): ... + def TypeName(self): ... + def Is(self, descriptor: Any): ... + +class Timestamp: + def ToJsonString(self) -> str: ... + seconds: Any = ... + nanos: Any = ... + def FromJsonString(self, value: Any) -> None: ... + def GetCurrentTime(self) -> None: ... + def ToNanoseconds(self): ... + def ToMicroseconds(self): ... + def ToMilliseconds(self): ... + def ToSeconds(self): ... + def FromNanoseconds(self, nanos: Any) -> None: ... + def FromMicroseconds(self, micros: Any) -> None: ... + def FromMilliseconds(self, millis: Any) -> None: ... + def FromSeconds(self, seconds: Any) -> None: ... + def ToDatetime(self) -> datetime: ... + def FromDatetime(self, dt: datetime) -> None: ... + +class Duration: + def ToJsonString(self) -> str: ... + seconds: Any = ... + nanos: Any = ... + def FromJsonString(self, value: Any) -> None: ... + def ToNanoseconds(self): ... + def ToMicroseconds(self): ... + def ToMilliseconds(self): ... + def ToSeconds(self): ... + def FromNanoseconds(self, nanos: Any) -> None: ... + def FromMicroseconds(self, micros: Any) -> None: ... + def FromMilliseconds(self, millis: Any) -> None: ... + def FromSeconds(self, seconds: Any) -> None: ... + def ToTimedelta(self): ... + def FromTimedelta(self, td: Any) -> None: ... + +class FieldMask: + def ToJsonString(self) -> str: ... + def FromJsonString(self, value: Any) -> None: ... + def IsValidForDescriptor(self, message_descriptor: Any): ... + def AllFieldsFromDescriptor(self, message_descriptor: Any) -> None: ... + def CanonicalFormFromMask(self, mask: Any) -> None: ... + def Union(self, mask1: Any, mask2: Any) -> None: ... + def Intersect(self, mask1: Any, mask2: Any) -> None: ... + def MergeMessage( + self, source: Any, destination: Any, replace_message_field: bool = ..., replace_repeated_field: bool = ... + ) -> None: ... + +class _FieldMaskTree: + def __init__(self, field_mask: Optional[Any] = ...) -> None: ... + def MergeFromFieldMask(self, field_mask: Any) -> None: ... + def AddPath(self, path: Any): ... + def ToFieldMask(self, field_mask: Any) -> None: ... + def IntersectPath(self, path: Any, intersection: Any): ... + def AddLeafNodes(self, prefix: Any, node: Any) -> None: ... + def MergeMessage(self, source: Any, destination: Any, replace_message: Any, replace_repeated: Any) -> None: ... + +class Struct: + def __getitem__(self, key: Any): ... + def __contains__(self, item: Any): ... + def __setitem__(self, key: Any, value: Any) -> None: ... + def __delitem__(self, key: Any) -> None: ... + def __len__(self): ... + def __iter__(self): ... + def keys(self): ... + def values(self): ... + def items(self): ... + def get_or_create_list(self, key: Any): ... + def get_or_create_struct(self, key: Any): ... + def update(self, dictionary: Any) -> None: ... + +class ListValue: + def __len__(self): ... + def append(self, value: Any) -> None: ... + def extend(self, elem_seq: Any) -> None: ... + def __getitem__(self, index: Any): ... + def __setitem__(self, index: Any, value: Any) -> None: ... + def __delitem__(self, key: Any) -> None: ... + def items(self) -> None: ... + def add_struct(self): ... + def add_list(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/wire_format.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/wire_format.pyi new file mode 100644 index 00000000..3dcbd043 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/internal/wire_format.pyi @@ -0,0 +1,50 @@ +from typing import Any + +TAG_TYPE_BITS: Any +TAG_TYPE_MASK: Any +WIRETYPE_VARINT: Any +WIRETYPE_FIXED64: Any +WIRETYPE_LENGTH_DELIMITED: Any +WIRETYPE_START_GROUP: Any +WIRETYPE_END_GROUP: Any +WIRETYPE_FIXED32: Any +INT32_MAX: Any +INT32_MIN: Any +UINT32_MAX: Any +INT64_MAX: Any +INT64_MIN: Any +UINT64_MAX: Any +FORMAT_UINT32_LITTLE_ENDIAN: Any +FORMAT_UINT64_LITTLE_ENDIAN: Any +FORMAT_FLOAT_LITTLE_ENDIAN: Any +FORMAT_DOUBLE_LITTLE_ENDIAN: Any + +def PackTag(field_number, wire_type): ... +def UnpackTag(tag): ... +def ZigZagEncode(value): ... +def ZigZagDecode(value): ... +def Int32ByteSize(field_number, int32): ... +def Int32ByteSizeNoTag(int32): ... +def Int64ByteSize(field_number, int64): ... +def UInt32ByteSize(field_number, uint32): ... +def UInt64ByteSize(field_number, uint64): ... +def SInt32ByteSize(field_number, int32): ... +def SInt64ByteSize(field_number, int64): ... +def Fixed32ByteSize(field_number, fixed32): ... +def Fixed64ByteSize(field_number, fixed64): ... +def SFixed32ByteSize(field_number, sfixed32): ... +def SFixed64ByteSize(field_number, sfixed64): ... +def FloatByteSize(field_number, flt): ... +def DoubleByteSize(field_number, double): ... +def BoolByteSize(field_number, b): ... +def EnumByteSize(field_number, enum): ... +def StringByteSize(field_number, string): ... +def BytesByteSize(field_number, b): ... +def GroupByteSize(field_number, message): ... +def MessageByteSize(field_number, message): ... +def MessageSetItemByteSize(field_number, msg): ... +def TagByteSize(field_number): ... + +NON_PACKABLE_TYPES: Any + +def IsTypePackable(field_type): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/json_format.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/json_format.pyi new file mode 100644 index 00000000..89024438 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/json_format.pyi @@ -0,0 +1,26 @@ +import sys +from typing import Any, Dict, Text, TypeVar, Union +from google.protobuf.message import Message + +_MessageVar = TypeVar("_MessageVar", bound=Message) + +class Error(Exception): ... +class ParseError(Error): ... +class SerializeToJsonError(Error): ... + +def MessageToJson( + message: Message, + including_default_value_fields: bool = ..., + preserving_proto_field_name: bool = ..., + indent: int = ..., + sort_keys: bool = ..., + use_integers_for_enums: bool = ..., +) -> str: ... +def MessageToDict( + message: Message, + including_default_value_fields: bool = ..., + preserving_proto_field_name: bool = ..., + use_integers_for_enums: bool = ..., +) -> Dict[Text, Any]: ... +def Parse(text: Union[bytes, Text], message: _MessageVar, ignore_unknown_fields: bool = ...) -> _MessageVar: ... +def ParseDict(js_dict: Any, message: _MessageVar, ignore_unknown_fields: bool = ...) -> _MessageVar: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_proto2_unittest_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_proto2_unittest_pb2.pyi new file mode 100644 index 00000000..71abad99 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_proto2_unittest_pb2.pyi @@ -0,0 +1,198 @@ +from google.protobuf.message import Message +from google.protobuf.unittest_import_pb2 import ImportEnumForMap +from typing import List, Mapping, MutableMapping, Optional, Text, Tuple, cast + +class Proto2MapEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> Proto2MapEnum: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[Proto2MapEnum]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, Proto2MapEnum]]: ... + +PROTO2_MAP_ENUM_FOO: Proto2MapEnum +PROTO2_MAP_ENUM_BAR: Proto2MapEnum +PROTO2_MAP_ENUM_BAZ: Proto2MapEnum + +class Proto2MapEnumPlusExtra(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> Proto2MapEnumPlusExtra: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[Proto2MapEnumPlusExtra]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, Proto2MapEnumPlusExtra]]: ... + +E_PROTO2_MAP_ENUM_FOO: Proto2MapEnumPlusExtra +E_PROTO2_MAP_ENUM_BAR: Proto2MapEnumPlusExtra +E_PROTO2_MAP_ENUM_BAZ: Proto2MapEnumPlusExtra +E_PROTO2_MAP_ENUM_EXTRA: Proto2MapEnumPlusExtra + +class TestEnumMap(Message): + class KnownMapFieldEntry(Message): + key: int + value: Proto2MapEnum + def __init__(self, key: Optional[int] = ..., value: Optional[Proto2MapEnum] = ...) -> None: ... + class UnknownMapFieldEntry(Message): + key: int + value: Proto2MapEnum + def __init__(self, key: Optional[int] = ..., value: Optional[Proto2MapEnum] = ...) -> None: ... + @property + def known_map_field(self) -> MutableMapping[int, Proto2MapEnum]: ... + @property + def unknown_map_field(self) -> MutableMapping[int, Proto2MapEnum]: ... + def __init__( + self, + known_map_field: Optional[Mapping[int, Proto2MapEnum]] = ..., + unknown_map_field: Optional[Mapping[int, Proto2MapEnum]] = ..., + ) -> None: ... + +class TestEnumMapPlusExtra(Message): + class KnownMapFieldEntry(Message): + key: int + value: Proto2MapEnumPlusExtra + def __init__(self, key: Optional[int] = ..., value: Optional[Proto2MapEnumPlusExtra] = ...) -> None: ... + class UnknownMapFieldEntry(Message): + key: int + value: Proto2MapEnumPlusExtra + def __init__(self, key: Optional[int] = ..., value: Optional[Proto2MapEnumPlusExtra] = ...) -> None: ... + @property + def known_map_field(self) -> MutableMapping[int, Proto2MapEnumPlusExtra]: ... + @property + def unknown_map_field(self) -> MutableMapping[int, Proto2MapEnumPlusExtra]: ... + def __init__( + self, + known_map_field: Optional[Mapping[int, Proto2MapEnumPlusExtra]] = ..., + unknown_map_field: Optional[Mapping[int, Proto2MapEnumPlusExtra]] = ..., + ) -> None: ... + +class TestImportEnumMap(Message): + class ImportEnumAmpEntry(Message): + key: int + value: ImportEnumForMap + def __init__(self, key: Optional[int] = ..., value: Optional[ImportEnumForMap] = ...) -> None: ... + @property + def import_enum_amp(self) -> MutableMapping[int, ImportEnumForMap]: ... + def __init__(self, import_enum_amp: Optional[Mapping[int, ImportEnumForMap]] = ...) -> None: ... + +class TestIntIntMap(Message): + class MEntry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + @property + def m(self) -> MutableMapping[int, int]: ... + def __init__(self, m: Optional[Mapping[int, int]] = ...) -> None: ... + +class TestMaps(Message): + class MInt32Entry(Message): + key: int + @property + def value(self) -> TestIntIntMap: ... + def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... + class MInt64Entry(Message): + key: int + @property + def value(self) -> TestIntIntMap: ... + def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... + class MUint32Entry(Message): + key: int + @property + def value(self) -> TestIntIntMap: ... + def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... + class MUint64Entry(Message): + key: int + @property + def value(self) -> TestIntIntMap: ... + def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... + class MSint32Entry(Message): + key: int + @property + def value(self) -> TestIntIntMap: ... + def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... + class MSint64Entry(Message): + key: int + @property + def value(self) -> TestIntIntMap: ... + def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... + class MFixed32Entry(Message): + key: int + @property + def value(self) -> TestIntIntMap: ... + def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... + class MFixed64Entry(Message): + key: int + @property + def value(self) -> TestIntIntMap: ... + def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... + class MSfixed32Entry(Message): + key: int + @property + def value(self) -> TestIntIntMap: ... + def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... + class MSfixed64Entry(Message): + key: int + @property + def value(self) -> TestIntIntMap: ... + def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... + class MBoolEntry(Message): + key: bool + @property + def value(self) -> TestIntIntMap: ... + def __init__(self, key: Optional[bool] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... + class MStringEntry(Message): + key: Text + @property + def value(self) -> TestIntIntMap: ... + def __init__(self, key: Optional[Text] = ..., value: Optional[TestIntIntMap] = ...) -> None: ... + @property + def m_int32(self) -> MutableMapping[int, TestIntIntMap]: ... + @property + def m_int64(self) -> MutableMapping[int, TestIntIntMap]: ... + @property + def m_uint32(self) -> MutableMapping[int, TestIntIntMap]: ... + @property + def m_uint64(self) -> MutableMapping[int, TestIntIntMap]: ... + @property + def m_sint32(self) -> MutableMapping[int, TestIntIntMap]: ... + @property + def m_sint64(self) -> MutableMapping[int, TestIntIntMap]: ... + @property + def m_fixed32(self) -> MutableMapping[int, TestIntIntMap]: ... + @property + def m_fixed64(self) -> MutableMapping[int, TestIntIntMap]: ... + @property + def m_sfixed32(self) -> MutableMapping[int, TestIntIntMap]: ... + @property + def m_sfixed64(self) -> MutableMapping[int, TestIntIntMap]: ... + @property + def m_bool(self) -> MutableMapping[bool, TestIntIntMap]: ... + @property + def m_string(self) -> MutableMapping[Text, TestIntIntMap]: ... + def __init__( + self, + m_int32: Optional[Mapping[int, TestIntIntMap]] = ..., + m_int64: Optional[Mapping[int, TestIntIntMap]] = ..., + m_uint32: Optional[Mapping[int, TestIntIntMap]] = ..., + m_uint64: Optional[Mapping[int, TestIntIntMap]] = ..., + m_sint32: Optional[Mapping[int, TestIntIntMap]] = ..., + m_sint64: Optional[Mapping[int, TestIntIntMap]] = ..., + m_fixed32: Optional[Mapping[int, TestIntIntMap]] = ..., + m_fixed64: Optional[Mapping[int, TestIntIntMap]] = ..., + m_sfixed32: Optional[Mapping[int, TestIntIntMap]] = ..., + m_sfixed64: Optional[Mapping[int, TestIntIntMap]] = ..., + m_bool: Optional[Mapping[bool, TestIntIntMap]] = ..., + m_string: Optional[Mapping[Text, TestIntIntMap]] = ..., + ) -> None: ... + +class TestSubmessageMaps(Message): + @property + def m(self) -> TestMaps: ... + def __init__(self, m: Optional[TestMaps] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_unittest_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_unittest_pb2.pyi new file mode 100644 index 00000000..e802bb76 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/map_unittest_pb2.pyi @@ -0,0 +1,375 @@ +from google.protobuf.message import Message +from google.protobuf.unittest_no_arena_pb2 import ForeignMessage +from google.protobuf.unittest_pb2 import ForeignMessage as ForeignMessage1, TestAllTypes, TestRequired +from typing import List, Mapping, MutableMapping, Optional, Text, Tuple, cast + +class MapEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> MapEnum: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[MapEnum]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, MapEnum]]: ... + +MAP_ENUM_FOO: MapEnum +MAP_ENUM_BAR: MapEnum +MAP_ENUM_BAZ: MapEnum + +class TestMap(Message): + class MapInt32Int32Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapInt64Int64Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapUint32Uint32Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapUint64Uint64Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapSint32Sint32Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapSint64Sint64Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapFixed32Fixed32Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapFixed64Fixed64Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapSfixed32Sfixed32Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapSfixed64Sfixed64Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapInt32FloatEntry(Message): + key: int + value: float + def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ... + class MapInt32DoubleEntry(Message): + key: int + value: float + def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ... + class MapBoolBoolEntry(Message): + key: bool + value: bool + def __init__(self, key: Optional[bool] = ..., value: Optional[bool] = ...) -> None: ... + class MapStringStringEntry(Message): + key: Text + value: Text + def __init__(self, key: Optional[Text] = ..., value: Optional[Text] = ...) -> None: ... + class MapInt32BytesEntry(Message): + key: int + value: bytes + def __init__(self, key: Optional[int] = ..., value: Optional[bytes] = ...) -> None: ... + class MapInt32EnumEntry(Message): + key: int + value: MapEnum + def __init__(self, key: Optional[int] = ..., value: Optional[MapEnum] = ...) -> None: ... + class MapInt32ForeignMessageEntry(Message): + key: int + @property + def value(self) -> ForeignMessage1: ... + def __init__(self, key: Optional[int] = ..., value: Optional[ForeignMessage1] = ...) -> None: ... + class MapStringForeignMessageEntry(Message): + key: Text + @property + def value(self) -> ForeignMessage1: ... + def __init__(self, key: Optional[Text] = ..., value: Optional[ForeignMessage1] = ...) -> None: ... + class MapInt32AllTypesEntry(Message): + key: int + @property + def value(self) -> TestAllTypes: ... + def __init__(self, key: Optional[int] = ..., value: Optional[TestAllTypes] = ...) -> None: ... + @property + def map_int32_int32(self) -> MutableMapping[int, int]: ... + @property + def map_int64_int64(self) -> MutableMapping[int, int]: ... + @property + def map_uint32_uint32(self) -> MutableMapping[int, int]: ... + @property + def map_uint64_uint64(self) -> MutableMapping[int, int]: ... + @property + def map_sint32_sint32(self) -> MutableMapping[int, int]: ... + @property + def map_sint64_sint64(self) -> MutableMapping[int, int]: ... + @property + def map_fixed32_fixed32(self) -> MutableMapping[int, int]: ... + @property + def map_fixed64_fixed64(self) -> MutableMapping[int, int]: ... + @property + def map_sfixed32_sfixed32(self) -> MutableMapping[int, int]: ... + @property + def map_sfixed64_sfixed64(self) -> MutableMapping[int, int]: ... + @property + def map_int32_float(self) -> MutableMapping[int, float]: ... + @property + def map_int32_double(self) -> MutableMapping[int, float]: ... + @property + def map_bool_bool(self) -> MutableMapping[bool, bool]: ... + @property + def map_string_string(self) -> MutableMapping[Text, Text]: ... + @property + def map_int32_bytes(self) -> MutableMapping[int, bytes]: ... + @property + def map_int32_enum(self) -> MutableMapping[int, MapEnum]: ... + @property + def map_int32_foreign_message(self) -> MutableMapping[int, ForeignMessage1]: ... + @property + def map_string_foreign_message(self) -> MutableMapping[Text, ForeignMessage1]: ... + @property + def map_int32_all_types(self) -> MutableMapping[int, TestAllTypes]: ... + def __init__( + self, + map_int32_int32: Optional[Mapping[int, int]] = ..., + map_int64_int64: Optional[Mapping[int, int]] = ..., + map_uint32_uint32: Optional[Mapping[int, int]] = ..., + map_uint64_uint64: Optional[Mapping[int, int]] = ..., + map_sint32_sint32: Optional[Mapping[int, int]] = ..., + map_sint64_sint64: Optional[Mapping[int, int]] = ..., + map_fixed32_fixed32: Optional[Mapping[int, int]] = ..., + map_fixed64_fixed64: Optional[Mapping[int, int]] = ..., + map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ..., + map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ..., + map_int32_float: Optional[Mapping[int, float]] = ..., + map_int32_double: Optional[Mapping[int, float]] = ..., + map_bool_bool: Optional[Mapping[bool, bool]] = ..., + map_string_string: Optional[Mapping[Text, Text]] = ..., + map_int32_bytes: Optional[Mapping[int, bytes]] = ..., + map_int32_enum: Optional[Mapping[int, MapEnum]] = ..., + map_int32_foreign_message: Optional[Mapping[int, ForeignMessage1]] = ..., + map_string_foreign_message: Optional[Mapping[Text, ForeignMessage1]] = ..., + map_int32_all_types: Optional[Mapping[int, TestAllTypes]] = ..., + ) -> None: ... + +class TestMapSubmessage(Message): + @property + def test_map(self) -> TestMap: ... + def __init__(self, test_map: Optional[TestMap] = ...) -> None: ... + +class TestMessageMap(Message): + class MapInt32MessageEntry(Message): + key: int + @property + def value(self) -> TestAllTypes: ... + def __init__(self, key: Optional[int] = ..., value: Optional[TestAllTypes] = ...) -> None: ... + @property + def map_int32_message(self) -> MutableMapping[int, TestAllTypes]: ... + def __init__(self, map_int32_message: Optional[Mapping[int, TestAllTypes]] = ...) -> None: ... + +class TestSameTypeMap(Message): + class Map1Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class Map2Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + @property + def map1(self) -> MutableMapping[int, int]: ... + @property + def map2(self) -> MutableMapping[int, int]: ... + def __init__(self, map1: Optional[Mapping[int, int]] = ..., map2: Optional[Mapping[int, int]] = ...) -> None: ... + +class TestRequiredMessageMap(Message): + class MapFieldEntry(Message): + key: int + @property + def value(self) -> TestRequired: ... + def __init__(self, key: Optional[int] = ..., value: Optional[TestRequired] = ...) -> None: ... + @property + def map_field(self) -> MutableMapping[int, TestRequired]: ... + def __init__(self, map_field: Optional[Mapping[int, TestRequired]] = ...) -> None: ... + +class TestArenaMap(Message): + class MapInt32Int32Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapInt64Int64Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapUint32Uint32Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapUint64Uint64Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapSint32Sint32Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapSint64Sint64Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapFixed32Fixed32Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapFixed64Fixed64Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapSfixed32Sfixed32Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapSfixed64Sfixed64Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapInt32FloatEntry(Message): + key: int + value: float + def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ... + class MapInt32DoubleEntry(Message): + key: int + value: float + def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ... + class MapBoolBoolEntry(Message): + key: bool + value: bool + def __init__(self, key: Optional[bool] = ..., value: Optional[bool] = ...) -> None: ... + class MapStringStringEntry(Message): + key: Text + value: Text + def __init__(self, key: Optional[Text] = ..., value: Optional[Text] = ...) -> None: ... + class MapInt32BytesEntry(Message): + key: int + value: bytes + def __init__(self, key: Optional[int] = ..., value: Optional[bytes] = ...) -> None: ... + class MapInt32EnumEntry(Message): + key: int + value: MapEnum + def __init__(self, key: Optional[int] = ..., value: Optional[MapEnum] = ...) -> None: ... + class MapInt32ForeignMessageEntry(Message): + key: int + @property + def value(self) -> ForeignMessage1: ... + def __init__(self, key: Optional[int] = ..., value: Optional[ForeignMessage1] = ...) -> None: ... + class MapInt32ForeignMessageNoArenaEntry(Message): + key: int + @property + def value(self) -> ForeignMessage: ... + def __init__(self, key: Optional[int] = ..., value: Optional[ForeignMessage] = ...) -> None: ... + @property + def map_int32_int32(self) -> MutableMapping[int, int]: ... + @property + def map_int64_int64(self) -> MutableMapping[int, int]: ... + @property + def map_uint32_uint32(self) -> MutableMapping[int, int]: ... + @property + def map_uint64_uint64(self) -> MutableMapping[int, int]: ... + @property + def map_sint32_sint32(self) -> MutableMapping[int, int]: ... + @property + def map_sint64_sint64(self) -> MutableMapping[int, int]: ... + @property + def map_fixed32_fixed32(self) -> MutableMapping[int, int]: ... + @property + def map_fixed64_fixed64(self) -> MutableMapping[int, int]: ... + @property + def map_sfixed32_sfixed32(self) -> MutableMapping[int, int]: ... + @property + def map_sfixed64_sfixed64(self) -> MutableMapping[int, int]: ... + @property + def map_int32_float(self) -> MutableMapping[int, float]: ... + @property + def map_int32_double(self) -> MutableMapping[int, float]: ... + @property + def map_bool_bool(self) -> MutableMapping[bool, bool]: ... + @property + def map_string_string(self) -> MutableMapping[Text, Text]: ... + @property + def map_int32_bytes(self) -> MutableMapping[int, bytes]: ... + @property + def map_int32_enum(self) -> MutableMapping[int, MapEnum]: ... + @property + def map_int32_foreign_message(self) -> MutableMapping[int, ForeignMessage1]: ... + @property + def map_int32_foreign_message_no_arena(self) -> MutableMapping[int, ForeignMessage]: ... + def __init__( + self, + map_int32_int32: Optional[Mapping[int, int]] = ..., + map_int64_int64: Optional[Mapping[int, int]] = ..., + map_uint32_uint32: Optional[Mapping[int, int]] = ..., + map_uint64_uint64: Optional[Mapping[int, int]] = ..., + map_sint32_sint32: Optional[Mapping[int, int]] = ..., + map_sint64_sint64: Optional[Mapping[int, int]] = ..., + map_fixed32_fixed32: Optional[Mapping[int, int]] = ..., + map_fixed64_fixed64: Optional[Mapping[int, int]] = ..., + map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ..., + map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ..., + map_int32_float: Optional[Mapping[int, float]] = ..., + map_int32_double: Optional[Mapping[int, float]] = ..., + map_bool_bool: Optional[Mapping[bool, bool]] = ..., + map_string_string: Optional[Mapping[Text, Text]] = ..., + map_int32_bytes: Optional[Mapping[int, bytes]] = ..., + map_int32_enum: Optional[Mapping[int, MapEnum]] = ..., + map_int32_foreign_message: Optional[Mapping[int, ForeignMessage1]] = ..., + map_int32_foreign_message_no_arena: Optional[Mapping[int, ForeignMessage]] = ..., + ) -> None: ... + +class MessageContainingEnumCalledType(Message): + class Type(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> MessageContainingEnumCalledType.Type: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[MessageContainingEnumCalledType.Type]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, MessageContainingEnumCalledType.Type]]: ... + TYPE_FOO: MessageContainingEnumCalledType.Type + class TypeEntry(Message): + key: Text + @property + def value(self) -> MessageContainingEnumCalledType: ... + def __init__(self, key: Optional[Text] = ..., value: Optional[MessageContainingEnumCalledType] = ...) -> None: ... + @property + def type(self) -> MutableMapping[Text, MessageContainingEnumCalledType]: ... + def __init__(self, type: Optional[Mapping[Text, MessageContainingEnumCalledType]] = ...) -> None: ... + +class MessageContainingMapCalledEntry(Message): + class EntryEntry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + @property + def entry(self) -> MutableMapping[int, int]: ... + def __init__(self, entry: Optional[Mapping[int, int]] = ...) -> None: ... + +class TestRecursiveMapMessage(Message): + class AEntry(Message): + key: Text + @property + def value(self) -> TestRecursiveMapMessage: ... + def __init__(self, key: Optional[Text] = ..., value: Optional[TestRecursiveMapMessage] = ...) -> None: ... + @property + def a(self) -> MutableMapping[Text, TestRecursiveMapMessage]: ... + def __init__(self, a: Optional[Mapping[Text, TestRecursiveMapMessage]] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message.pyi new file mode 100644 index 00000000..215fb2b4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message.pyi @@ -0,0 +1,52 @@ +import sys + +from typing import Any, Sequence, Optional, Tuple, Type, TypeVar, Union + +from .descriptor import DescriptorBase, FieldDescriptor + +class Error(Exception): ... +class DecodeError(Error): ... +class EncodeError(Error): ... + +class _ExtensionDict: + def __getitem__(self, extension_handle: DescriptorBase) -> Any: ... + def __setitem__(self, extension_handle: DescriptorBase, value: Any) -> None: ... + +_T = TypeVar("_T") + +if sys.version_info < (3,): + _Serialized = Union[bytes, buffer, unicode] +else: + _Serialized = bytes + +class Message: + DESCRIPTOR: Any + def __deepcopy__(self, memo=...): ... + def __eq__(self, other_msg): ... + def __ne__(self, other_msg): ... + def MergeFrom(self, other_msg: Message) -> None: ... + def CopyFrom(self, other_msg: Message) -> None: ... + def Clear(self) -> None: ... + def SetInParent(self) -> None: ... + def IsInitialized(self) -> bool: ... + def MergeFromString(self, serialized: _Serialized) -> int: ... + def ParseFromString(self, serialized: _Serialized) -> None: ... + def SerializeToString(self, deterministic: bool = ...) -> bytes: ... + def SerializePartialToString(self, deterministic: bool = ...) -> bytes: ... + def ListFields(self) -> Sequence[Tuple[FieldDescriptor, Any]]: ... + def HasExtension(self, extension_handle): ... + def ClearExtension(self, extension_handle): ... + def ByteSize(self) -> int: ... + @classmethod + def FromString(cls: Type[_T], s: _Serialized) -> _T: ... + @property + def Extensions(self) -> _ExtensionDict: ... + # Intentionally left out typing on these three methods, because they are + # stringly typed and it is not useful to call them on a Message directly. + # We prefer more specific typing on individual subclasses of Message + # See https://github.com/dropbox/mypy-protobuf/issues/62 for details + def HasField(self, field_name: Any) -> bool: ... + def ClearField(self, field_name: Any) -> None: ... + def WhichOneof(self, oneof_group: Any) -> Any: ... + # TODO: check kwargs + def __init__(self, **kwargs) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message_factory.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message_factory.pyi new file mode 100644 index 00000000..ad31e22f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/message_factory.pyi @@ -0,0 +1,13 @@ +from typing import Any, Dict, Iterable, Optional, Type + +from .message import Message +from .descriptor import Descriptor +from .descriptor_pool import DescriptorPool + +class MessageFactory: + pool: Any + def __init__(self, pool: Optional[DescriptorPool] = ...) -> None: ... + def GetPrototype(self, descriptor: Descriptor) -> Type[Message]: ... + def GetMessages(self, files: Iterable[bytes]) -> Dict[bytes, Type[Message]]: ... + +def GetMessages(file_protos: Iterable[bytes]) -> Dict[bytes, Type[Message]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/reflection.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/reflection.pyi new file mode 100644 index 00000000..3ca50552 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/reflection.pyi @@ -0,0 +1,6 @@ +class GeneratedProtocolMessageType(type): + def __new__(cls, name, bases, dictionary): ... + def __init__(self, name, bases, dictionary) -> None: ... + +def ParseMessage(descriptor, byte_str): ... +def MakeClass(descriptor): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/service.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/service.pyi new file mode 100644 index 00000000..4874d535 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/service.pyi @@ -0,0 +1,39 @@ +from concurrent.futures import Future +from typing import Callable, Optional, Text, Type + +from google.protobuf.descriptor import MethodDescriptor, ServiceDescriptor +from google.protobuf.message import Message + +class RpcException(Exception): ... + +class Service: + @staticmethod + def GetDescriptor() -> ServiceDescriptor: ... + def CallMethod( + self, + method_descriptor: MethodDescriptor, + rpc_controller: RpcController, + request: Message, + done: Optional[Callable[[Message], None]], + ) -> Optional[Future[Message]]: ... + def GetRequestClass(self, method_descriptor: MethodDescriptor) -> Type[Message]: ... + def GetResponseClass(self, method_descriptor: MethodDescriptor) -> Type[Message]: ... + +class RpcController: + def Reset(self) -> None: ... + def Failed(self) -> bool: ... + def ErrorText(self) -> Optional[Text]: ... + def StartCancel(self) -> None: ... + def SetFailed(self, reason: Text) -> None: ... + def IsCanceled(self) -> bool: ... + def NotifyOnCancel(self, callback: Callable[[], None]) -> None: ... + +class RpcChannel: + def CallMethod( + self, + method_descriptor: MethodDescriptor, + rpc_controller: RpcController, + request: Message, + response_class: Type[Message], + done: Optional[Callable[[Message], None]], + ) -> Optional[Future[Message]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/source_context_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/source_context_pb2.pyi new file mode 100644 index 00000000..5d5cc8b7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/source_context_pb2.pyi @@ -0,0 +1,6 @@ +from google.protobuf.message import Message +from typing import Optional, Text + +class SourceContext(Message): + file_name: Text + def __init__(self, file_name: Optional[Text] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/struct_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/struct_pb2.pyi new file mode 100644 index 00000000..18a67215 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/struct_pb2.pyi @@ -0,0 +1,55 @@ +from google.protobuf.internal.containers import RepeatedCompositeFieldContainer +from google.protobuf.internal import well_known_types + +from google.protobuf.message import Message +from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, cast + +class NullValue(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> NullValue: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[NullValue]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, NullValue]]: ... + +NULL_VALUE: NullValue + +class Struct(Message, well_known_types.Struct): + class FieldsEntry(Message): + key: Text + @property + def value(self) -> Value: ... + def __init__(self, key: Optional[Text] = ..., value: Optional[Value] = ...) -> None: ... + @property + def fields(self) -> MutableMapping[Text, Value]: ... + def __init__(self, fields: Optional[Mapping[Text, Value]] = ...) -> None: ... + +class _Value(Message): + null_value: NullValue + number_value: float + string_value: Text + bool_value: bool + @property + def struct_value(self) -> Struct: ... + @property + def list_value(self) -> ListValue: ... + def __init__( + self, + null_value: Optional[NullValue] = ..., + number_value: Optional[float] = ..., + string_value: Optional[Text] = ..., + bool_value: Optional[bool] = ..., + struct_value: Optional[Struct] = ..., + list_value: Optional[ListValue] = ..., + ) -> None: ... + +Value = _Value + +class ListValue(Message, well_known_types.ListValue): + @property + def values(self) -> RepeatedCompositeFieldContainer[Value]: ... + def __init__(self, values: Optional[Iterable[Value]] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/symbol_database.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/symbol_database.pyi new file mode 100644 index 00000000..477d80e9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/symbol_database.pyi @@ -0,0 +1,14 @@ +from typing import Dict, Iterable, Type + +from .descriptor import EnumDescriptor, FileDescriptor +from .message import Message +from .message_factory import MessageFactory + +class SymbolDatabase(MessageFactory): + def RegisterMessage(self, message: Type[Message]) -> Type[Message]: ... + def RegisterEnumDescriptor(self, enum_descriptor: Type[EnumDescriptor]) -> EnumDescriptor: ... + def RegisterFileDescriptor(self, file_descriptor: Type[FileDescriptor]) -> FileDescriptor: ... + def GetSymbol(self, symbol: bytes) -> Type[Message]: ... + def GetMessages(self, files: Iterable[bytes]) -> Dict[bytes, Type[Message]]: ... + +def Default(): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto2_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto2_pb2.pyi new file mode 100644 index 00000000..1795f81d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto2_pb2.pyi @@ -0,0 +1,345 @@ +from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer +from google.protobuf.message import Message +import builtins +from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, cast + +class ForeignEnumProto2(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> ForeignEnumProto2: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[ForeignEnumProto2]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, ForeignEnumProto2]]: ... + +FOREIGN_FOO: ForeignEnumProto2 +FOREIGN_BAR: ForeignEnumProto2 +FOREIGN_BAZ: ForeignEnumProto2 + +class TestAllTypesProto2(Message): + class NestedEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> TestAllTypesProto2.NestedEnum: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[TestAllTypesProto2.NestedEnum]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, TestAllTypesProto2.NestedEnum]]: ... + FOO: TestAllTypesProto2.NestedEnum + BAR: TestAllTypesProto2.NestedEnum + BAZ: TestAllTypesProto2.NestedEnum + NEG: TestAllTypesProto2.NestedEnum + class NestedMessage(Message): + a: int + @property + def corecursive(self) -> TestAllTypesProto2: ... + def __init__(self, a: Optional[int] = ..., corecursive: Optional[TestAllTypesProto2] = ...) -> None: ... + class MapInt32Int32Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapInt64Int64Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapUint32Uint32Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapUint64Uint64Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapSint32Sint32Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapSint64Sint64Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapFixed32Fixed32Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapFixed64Fixed64Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapSfixed32Sfixed32Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapSfixed64Sfixed64Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapInt32FloatEntry(Message): + key: int + value: float + def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ... + class MapInt32DoubleEntry(Message): + key: int + value: float + def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ... + class MapBoolBoolEntry(Message): + key: bool + value: bool + def __init__(self, key: Optional[bool] = ..., value: Optional[bool] = ...) -> None: ... + class MapStringStringEntry(Message): + key: Text + value: Text + def __init__(self, key: Optional[Text] = ..., value: Optional[Text] = ...) -> None: ... + class MapStringBytesEntry(Message): + key: Text + value: bytes + def __init__(self, key: Optional[Text] = ..., value: Optional[bytes] = ...) -> None: ... + class MapStringNestedMessageEntry(Message): + key: Text + @property + def value(self) -> TestAllTypesProto2.NestedMessage: ... + def __init__(self, key: Optional[Text] = ..., value: Optional[TestAllTypesProto2.NestedMessage] = ...) -> None: ... + class MapStringForeignMessageEntry(Message): + key: Text + @property + def value(self) -> ForeignMessageProto2: ... + def __init__(self, key: Optional[Text] = ..., value: Optional[ForeignMessageProto2] = ...) -> None: ... + class MapStringNestedEnumEntry(Message): + key: Text + value: TestAllTypesProto2.NestedEnum + def __init__(self, key: Optional[Text] = ..., value: Optional[TestAllTypesProto2.NestedEnum] = ...) -> None: ... + class MapStringForeignEnumEntry(Message): + key: Text + value: ForeignEnumProto2 + def __init__(self, key: Optional[Text] = ..., value: Optional[ForeignEnumProto2] = ...) -> None: ... + class Data(Message): + group_int32: int + group_uint32: int + def __init__(self, group_int32: Optional[int] = ..., group_uint32: Optional[int] = ...) -> None: ... + class MessageSetCorrect(Message): + def __init__(self,) -> None: ... + class MessageSetCorrectExtension1(Message): + bytes: Text + def __init__(self, bytes: Optional[Text] = ...) -> None: ... + class MessageSetCorrectExtension2(Message): + i: int + def __init__(self, i: Optional[int] = ...) -> None: ... + optional_int32: int + optional_int64: int + optional_uint32: int + optional_uint64: int + optional_sint32: int + optional_sint64: int + optional_fixed32: int + optional_fixed64: int + optional_sfixed32: int + optional_sfixed64: int + optional_float: float + optional_double: float + optional_bool: bool + optional_string: Text + optional_bytes: bytes + optional_nested_enum: TestAllTypesProto2.NestedEnum + optional_foreign_enum: ForeignEnumProto2 + optional_string_piece: Text + optional_cord: Text + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_uint32: RepeatedScalarFieldContainer[int] + repeated_uint64: RepeatedScalarFieldContainer[int] + repeated_sint32: RepeatedScalarFieldContainer[int] + repeated_sint64: RepeatedScalarFieldContainer[int] + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_sfixed32: RepeatedScalarFieldContainer[int] + repeated_sfixed64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_double: RepeatedScalarFieldContainer[float] + repeated_bool: RepeatedScalarFieldContainer[bool] + repeated_string: RepeatedScalarFieldContainer[Text] + repeated_bytes: RepeatedScalarFieldContainer[bytes] + repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypesProto2.NestedEnum] + repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnumProto2] + repeated_string_piece: RepeatedScalarFieldContainer[Text] + repeated_cord: RepeatedScalarFieldContainer[Text] + oneof_uint32: int + oneof_string: Text + oneof_bytes: bytes + oneof_bool: bool + oneof_uint64: int + oneof_float: float + oneof_double: float + oneof_enum: TestAllTypesProto2.NestedEnum + fieldname1: int + field_name2: int + _field_name3: int + field__name4_: int + field0name5: int + field_0_name6: int + fieldName7: int + FieldName8: int + field_Name9: int + Field_Name10: int + FIELD_NAME11: int + FIELD_name12: int + __field_name13: int + __Field_name14: int + field__name15: int + field__Name16: int + field_name17__: int + Field_name18__: int + @property + def optional_nested_message(self) -> TestAllTypesProto2.NestedMessage: ... + @property + def optional_foreign_message(self) -> ForeignMessageProto2: ... + @property + def recursive_message(self) -> TestAllTypesProto2: ... + @property + def repeated_nested_message(self) -> RepeatedCompositeFieldContainer[TestAllTypesProto2.NestedMessage]: ... + @property + def repeated_foreign_message(self) -> RepeatedCompositeFieldContainer[ForeignMessageProto2]: ... + @property + def map_int32_int32(self) -> MutableMapping[int, int]: ... + @property + def map_int64_int64(self) -> MutableMapping[int, int]: ... + @property + def map_uint32_uint32(self) -> MutableMapping[int, int]: ... + @property + def map_uint64_uint64(self) -> MutableMapping[int, int]: ... + @property + def map_sint32_sint32(self) -> MutableMapping[int, int]: ... + @property + def map_sint64_sint64(self) -> MutableMapping[int, int]: ... + @property + def map_fixed32_fixed32(self) -> MutableMapping[int, int]: ... + @property + def map_fixed64_fixed64(self) -> MutableMapping[int, int]: ... + @property + def map_sfixed32_sfixed32(self) -> MutableMapping[int, int]: ... + @property + def map_sfixed64_sfixed64(self) -> MutableMapping[int, int]: ... + @property + def map_int32_float(self) -> MutableMapping[int, float]: ... + @property + def map_int32_double(self) -> MutableMapping[int, float]: ... + @property + def map_bool_bool(self) -> MutableMapping[bool, bool]: ... + @property + def map_string_string(self) -> MutableMapping[Text, Text]: ... + @property + def map_string_bytes(self) -> MutableMapping[Text, bytes]: ... + @property + def map_string_nested_message(self) -> MutableMapping[Text, TestAllTypesProto2.NestedMessage]: ... + @property + def map_string_foreign_message(self) -> MutableMapping[Text, ForeignMessageProto2]: ... + @property + def map_string_nested_enum(self) -> MutableMapping[Text, TestAllTypesProto2.NestedEnum]: ... + @property + def map_string_foreign_enum(self) -> MutableMapping[Text, ForeignEnumProto2]: ... + @property + def oneof_nested_message(self) -> TestAllTypesProto2.NestedMessage: ... + @property + def data(self) -> TestAllTypesProto2.Data: ... + def __init__( + self, + optional_int32: Optional[int] = ..., + optional_int64: Optional[int] = ..., + optional_uint32: Optional[int] = ..., + optional_uint64: Optional[int] = ..., + optional_sint32: Optional[int] = ..., + optional_sint64: Optional[int] = ..., + optional_fixed32: Optional[int] = ..., + optional_fixed64: Optional[int] = ..., + optional_sfixed32: Optional[int] = ..., + optional_sfixed64: Optional[int] = ..., + optional_float: Optional[float] = ..., + optional_double: Optional[float] = ..., + optional_bool: Optional[bool] = ..., + optional_string: Optional[Text] = ..., + optional_bytes: Optional[bytes] = ..., + optional_nested_message: Optional[TestAllTypesProto2.NestedMessage] = ..., + optional_foreign_message: Optional[ForeignMessageProto2] = ..., + optional_nested_enum: Optional[TestAllTypesProto2.NestedEnum] = ..., + optional_foreign_enum: Optional[ForeignEnumProto2] = ..., + optional_string_piece: Optional[Text] = ..., + optional_cord: Optional[Text] = ..., + recursive_message: Optional[TestAllTypesProto2] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_uint32: Optional[Iterable[int]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + repeated_sint32: Optional[Iterable[int]] = ..., + repeated_sint64: Optional[Iterable[int]] = ..., + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_sfixed32: Optional[Iterable[int]] = ..., + repeated_sfixed64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_double: Optional[Iterable[float]] = ..., + repeated_bool: Optional[Iterable[bool]] = ..., + repeated_string: Optional[Iterable[Text]] = ..., + repeated_bytes: Optional[Iterable[bytes]] = ..., + repeated_nested_message: Optional[Iterable[TestAllTypesProto2.NestedMessage]] = ..., + repeated_foreign_message: Optional[Iterable[ForeignMessageProto2]] = ..., + repeated_nested_enum: Optional[Iterable[TestAllTypesProto2.NestedEnum]] = ..., + repeated_foreign_enum: Optional[Iterable[ForeignEnumProto2]] = ..., + repeated_string_piece: Optional[Iterable[Text]] = ..., + repeated_cord: Optional[Iterable[Text]] = ..., + map_int32_int32: Optional[Mapping[int, int]] = ..., + map_int64_int64: Optional[Mapping[int, int]] = ..., + map_uint32_uint32: Optional[Mapping[int, int]] = ..., + map_uint64_uint64: Optional[Mapping[int, int]] = ..., + map_sint32_sint32: Optional[Mapping[int, int]] = ..., + map_sint64_sint64: Optional[Mapping[int, int]] = ..., + map_fixed32_fixed32: Optional[Mapping[int, int]] = ..., + map_fixed64_fixed64: Optional[Mapping[int, int]] = ..., + map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ..., + map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ..., + map_int32_float: Optional[Mapping[int, float]] = ..., + map_int32_double: Optional[Mapping[int, float]] = ..., + map_bool_bool: Optional[Mapping[bool, bool]] = ..., + map_string_string: Optional[Mapping[Text, Text]] = ..., + map_string_bytes: Optional[Mapping[Text, bytes]] = ..., + map_string_nested_message: Optional[Mapping[Text, TestAllTypesProto2.NestedMessage]] = ..., + map_string_foreign_message: Optional[Mapping[Text, ForeignMessageProto2]] = ..., + map_string_nested_enum: Optional[Mapping[Text, TestAllTypesProto2.NestedEnum]] = ..., + map_string_foreign_enum: Optional[Mapping[Text, ForeignEnumProto2]] = ..., + oneof_uint32: Optional[int] = ..., + oneof_nested_message: Optional[TestAllTypesProto2.NestedMessage] = ..., + oneof_string: Optional[Text] = ..., + oneof_bytes: Optional[bytes] = ..., + oneof_bool: Optional[bool] = ..., + oneof_uint64: Optional[int] = ..., + oneof_float: Optional[float] = ..., + oneof_double: Optional[float] = ..., + oneof_enum: Optional[TestAllTypesProto2.NestedEnum] = ..., + data: Optional[TestAllTypesProto2.Data] = ..., + fieldname1: Optional[int] = ..., + field_name2: Optional[int] = ..., + _field_name3: Optional[int] = ..., + field__name4_: Optional[int] = ..., + field0name5: Optional[int] = ..., + field_0_name6: Optional[int] = ..., + fieldName7: Optional[int] = ..., + FieldName8: Optional[int] = ..., + field_Name9: Optional[int] = ..., + Field_Name10: Optional[int] = ..., + FIELD_NAME11: Optional[int] = ..., + FIELD_name12: Optional[int] = ..., + __field_name13: Optional[int] = ..., + __Field_name14: Optional[int] = ..., + field__name15: Optional[int] = ..., + field__Name16: Optional[int] = ..., + field_name17__: Optional[int] = ..., + Field_name18__: Optional[int] = ..., + ) -> None: ... + +class ForeignMessageProto2(Message): + c: int + def __init__(self, c: Optional[int] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto3_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto3_pb2.pyi new file mode 100644 index 00000000..d9f01cec --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/test_messages_proto3_pb2.pyi @@ -0,0 +1,435 @@ +from google.protobuf.any_pb2 import Any +from google.protobuf.duration_pb2 import Duration +from google.protobuf.field_mask_pb2 import FieldMask +from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer +from google.protobuf.message import Message +from google.protobuf.struct_pb2 import Struct, Value +from google.protobuf.timestamp_pb2 import Timestamp +from google.protobuf.wrappers_pb2 import ( + BoolValue, + BytesValue, + DoubleValue, + FloatValue, + Int32Value, + Int64Value, + StringValue, + UInt32Value, + UInt64Value, +) +from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, cast + +class ForeignEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> ForeignEnum: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[ForeignEnum]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ... + +FOREIGN_FOO: ForeignEnum +FOREIGN_BAR: ForeignEnum +FOREIGN_BAZ: ForeignEnum + +class TestAllTypesProto3(Message): + class NestedEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> TestAllTypesProto3.NestedEnum: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[TestAllTypesProto3.NestedEnum]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, TestAllTypesProto3.NestedEnum]]: ... + FOO: TestAllTypesProto3.NestedEnum + BAR: TestAllTypesProto3.NestedEnum + BAZ: TestAllTypesProto3.NestedEnum + NEG: TestAllTypesProto3.NestedEnum + class NestedMessage(Message): + a: int + @property + def corecursive(self) -> TestAllTypesProto3: ... + def __init__(self, a: Optional[int] = ..., corecursive: Optional[TestAllTypesProto3] = ...) -> None: ... + class MapInt32Int32Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapInt64Int64Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapUint32Uint32Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapUint64Uint64Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapSint32Sint32Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapSint64Sint64Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapFixed32Fixed32Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapFixed64Fixed64Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapSfixed32Sfixed32Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapSfixed64Sfixed64Entry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class MapInt32FloatEntry(Message): + key: int + value: float + def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ... + class MapInt32DoubleEntry(Message): + key: int + value: float + def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ... + class MapBoolBoolEntry(Message): + key: bool + value: bool + def __init__(self, key: Optional[bool] = ..., value: Optional[bool] = ...) -> None: ... + class MapStringStringEntry(Message): + key: Text + value: Text + def __init__(self, key: Optional[Text] = ..., value: Optional[Text] = ...) -> None: ... + class MapStringBytesEntry(Message): + key: Text + value: bytes + def __init__(self, key: Optional[Text] = ..., value: Optional[bytes] = ...) -> None: ... + class MapStringNestedMessageEntry(Message): + key: Text + @property + def value(self) -> TestAllTypesProto3.NestedMessage: ... + def __init__(self, key: Optional[Text] = ..., value: Optional[TestAllTypesProto3.NestedMessage] = ...) -> None: ... + class MapStringForeignMessageEntry(Message): + key: Text + @property + def value(self) -> ForeignMessage: ... + def __init__(self, key: Optional[Text] = ..., value: Optional[ForeignMessage] = ...) -> None: ... + class MapStringNestedEnumEntry(Message): + key: Text + value: TestAllTypesProto3.NestedEnum + def __init__(self, key: Optional[Text] = ..., value: Optional[TestAllTypesProto3.NestedEnum] = ...) -> None: ... + class MapStringForeignEnumEntry(Message): + key: Text + value: ForeignEnum + def __init__(self, key: Optional[Text] = ..., value: Optional[ForeignEnum] = ...) -> None: ... + optional_int32: int + optional_int64: int + optional_uint32: int + optional_uint64: int + optional_sint32: int + optional_sint64: int + optional_fixed32: int + optional_fixed64: int + optional_sfixed32: int + optional_sfixed64: int + optional_float: float + optional_double: float + optional_bool: bool + optional_string: Text + optional_bytes: bytes + optional_nested_enum: TestAllTypesProto3.NestedEnum + optional_foreign_enum: ForeignEnum + optional_string_piece: Text + optional_cord: Text + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_uint32: RepeatedScalarFieldContainer[int] + repeated_uint64: RepeatedScalarFieldContainer[int] + repeated_sint32: RepeatedScalarFieldContainer[int] + repeated_sint64: RepeatedScalarFieldContainer[int] + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_sfixed32: RepeatedScalarFieldContainer[int] + repeated_sfixed64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_double: RepeatedScalarFieldContainer[float] + repeated_bool: RepeatedScalarFieldContainer[bool] + repeated_string: RepeatedScalarFieldContainer[Text] + repeated_bytes: RepeatedScalarFieldContainer[bytes] + repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypesProto3.NestedEnum] + repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnum] + repeated_string_piece: RepeatedScalarFieldContainer[Text] + repeated_cord: RepeatedScalarFieldContainer[Text] + oneof_uint32: int + oneof_string: Text + oneof_bytes: bytes + oneof_bool: bool + oneof_uint64: int + oneof_float: float + oneof_double: float + oneof_enum: TestAllTypesProto3.NestedEnum + fieldname1: int + field_name2: int + _field_name3: int + field__name4_: int + field0name5: int + field_0_name6: int + fieldName7: int + FieldName8: int + field_Name9: int + Field_Name10: int + FIELD_NAME11: int + FIELD_name12: int + __field_name13: int + __Field_name14: int + field__name15: int + field__Name16: int + field_name17__: int + Field_name18__: int + @property + def optional_nested_message(self) -> TestAllTypesProto3.NestedMessage: ... + @property + def optional_foreign_message(self) -> ForeignMessage: ... + @property + def recursive_message(self) -> TestAllTypesProto3: ... + @property + def repeated_nested_message(self) -> RepeatedCompositeFieldContainer[TestAllTypesProto3.NestedMessage]: ... + @property + def repeated_foreign_message(self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... + @property + def map_int32_int32(self) -> MutableMapping[int, int]: ... + @property + def map_int64_int64(self) -> MutableMapping[int, int]: ... + @property + def map_uint32_uint32(self) -> MutableMapping[int, int]: ... + @property + def map_uint64_uint64(self) -> MutableMapping[int, int]: ... + @property + def map_sint32_sint32(self) -> MutableMapping[int, int]: ... + @property + def map_sint64_sint64(self) -> MutableMapping[int, int]: ... + @property + def map_fixed32_fixed32(self) -> MutableMapping[int, int]: ... + @property + def map_fixed64_fixed64(self) -> MutableMapping[int, int]: ... + @property + def map_sfixed32_sfixed32(self) -> MutableMapping[int, int]: ... + @property + def map_sfixed64_sfixed64(self) -> MutableMapping[int, int]: ... + @property + def map_int32_float(self) -> MutableMapping[int, float]: ... + @property + def map_int32_double(self) -> MutableMapping[int, float]: ... + @property + def map_bool_bool(self) -> MutableMapping[bool, bool]: ... + @property + def map_string_string(self) -> MutableMapping[Text, Text]: ... + @property + def map_string_bytes(self) -> MutableMapping[Text, bytes]: ... + @property + def map_string_nested_message(self) -> MutableMapping[Text, TestAllTypesProto3.NestedMessage]: ... + @property + def map_string_foreign_message(self) -> MutableMapping[Text, ForeignMessage]: ... + @property + def map_string_nested_enum(self) -> MutableMapping[Text, TestAllTypesProto3.NestedEnum]: ... + @property + def map_string_foreign_enum(self) -> MutableMapping[Text, ForeignEnum]: ... + @property + def oneof_nested_message(self) -> TestAllTypesProto3.NestedMessage: ... + @property + def optional_bool_wrapper(self) -> BoolValue: ... + @property + def optional_int32_wrapper(self) -> Int32Value: ... + @property + def optional_int64_wrapper(self) -> Int64Value: ... + @property + def optional_uint32_wrapper(self) -> UInt32Value: ... + @property + def optional_uint64_wrapper(self) -> UInt64Value: ... + @property + def optional_float_wrapper(self) -> FloatValue: ... + @property + def optional_double_wrapper(self) -> DoubleValue: ... + @property + def optional_string_wrapper(self) -> StringValue: ... + @property + def optional_bytes_wrapper(self) -> BytesValue: ... + @property + def repeated_bool_wrapper(self) -> RepeatedCompositeFieldContainer[BoolValue]: ... + @property + def repeated_int32_wrapper(self) -> RepeatedCompositeFieldContainer[Int32Value]: ... + @property + def repeated_int64_wrapper(self) -> RepeatedCompositeFieldContainer[Int64Value]: ... + @property + def repeated_uint32_wrapper(self) -> RepeatedCompositeFieldContainer[UInt32Value]: ... + @property + def repeated_uint64_wrapper(self) -> RepeatedCompositeFieldContainer[UInt64Value]: ... + @property + def repeated_float_wrapper(self) -> RepeatedCompositeFieldContainer[FloatValue]: ... + @property + def repeated_double_wrapper(self) -> RepeatedCompositeFieldContainer[DoubleValue]: ... + @property + def repeated_string_wrapper(self) -> RepeatedCompositeFieldContainer[StringValue]: ... + @property + def repeated_bytes_wrapper(self) -> RepeatedCompositeFieldContainer[BytesValue]: ... + @property + def optional_duration(self) -> Duration: ... + @property + def optional_timestamp(self) -> Timestamp: ... + @property + def optional_field_mask(self) -> FieldMask: ... + @property + def optional_struct(self) -> Struct: ... + @property + def optional_any(self) -> Any: ... + @property + def optional_value(self) -> Value: ... + @property + def repeated_duration(self) -> RepeatedCompositeFieldContainer[Duration]: ... + @property + def repeated_timestamp(self) -> RepeatedCompositeFieldContainer[Timestamp]: ... + @property + def repeated_fieldmask(self) -> RepeatedCompositeFieldContainer[FieldMask]: ... + @property + def repeated_struct(self) -> RepeatedCompositeFieldContainer[Struct]: ... + @property + def repeated_any(self) -> RepeatedCompositeFieldContainer[Any]: ... + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[Value]: ... + def __init__( + self, + optional_int32: Optional[int] = ..., + optional_int64: Optional[int] = ..., + optional_uint32: Optional[int] = ..., + optional_uint64: Optional[int] = ..., + optional_sint32: Optional[int] = ..., + optional_sint64: Optional[int] = ..., + optional_fixed32: Optional[int] = ..., + optional_fixed64: Optional[int] = ..., + optional_sfixed32: Optional[int] = ..., + optional_sfixed64: Optional[int] = ..., + optional_float: Optional[float] = ..., + optional_double: Optional[float] = ..., + optional_bool: Optional[bool] = ..., + optional_string: Optional[Text] = ..., + optional_bytes: Optional[bytes] = ..., + optional_nested_message: Optional[TestAllTypesProto3.NestedMessage] = ..., + optional_foreign_message: Optional[ForeignMessage] = ..., + optional_nested_enum: Optional[TestAllTypesProto3.NestedEnum] = ..., + optional_foreign_enum: Optional[ForeignEnum] = ..., + optional_string_piece: Optional[Text] = ..., + optional_cord: Optional[Text] = ..., + recursive_message: Optional[TestAllTypesProto3] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_uint32: Optional[Iterable[int]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + repeated_sint32: Optional[Iterable[int]] = ..., + repeated_sint64: Optional[Iterable[int]] = ..., + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_sfixed32: Optional[Iterable[int]] = ..., + repeated_sfixed64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_double: Optional[Iterable[float]] = ..., + repeated_bool: Optional[Iterable[bool]] = ..., + repeated_string: Optional[Iterable[Text]] = ..., + repeated_bytes: Optional[Iterable[bytes]] = ..., + repeated_nested_message: Optional[Iterable[TestAllTypesProto3.NestedMessage]] = ..., + repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ..., + repeated_nested_enum: Optional[Iterable[TestAllTypesProto3.NestedEnum]] = ..., + repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ..., + repeated_string_piece: Optional[Iterable[Text]] = ..., + repeated_cord: Optional[Iterable[Text]] = ..., + map_int32_int32: Optional[Mapping[int, int]] = ..., + map_int64_int64: Optional[Mapping[int, int]] = ..., + map_uint32_uint32: Optional[Mapping[int, int]] = ..., + map_uint64_uint64: Optional[Mapping[int, int]] = ..., + map_sint32_sint32: Optional[Mapping[int, int]] = ..., + map_sint64_sint64: Optional[Mapping[int, int]] = ..., + map_fixed32_fixed32: Optional[Mapping[int, int]] = ..., + map_fixed64_fixed64: Optional[Mapping[int, int]] = ..., + map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ..., + map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ..., + map_int32_float: Optional[Mapping[int, float]] = ..., + map_int32_double: Optional[Mapping[int, float]] = ..., + map_bool_bool: Optional[Mapping[bool, bool]] = ..., + map_string_string: Optional[Mapping[Text, Text]] = ..., + map_string_bytes: Optional[Mapping[Text, bytes]] = ..., + map_string_nested_message: Optional[Mapping[Text, TestAllTypesProto3.NestedMessage]] = ..., + map_string_foreign_message: Optional[Mapping[Text, ForeignMessage]] = ..., + map_string_nested_enum: Optional[Mapping[Text, TestAllTypesProto3.NestedEnum]] = ..., + map_string_foreign_enum: Optional[Mapping[Text, ForeignEnum]] = ..., + oneof_uint32: Optional[int] = ..., + oneof_nested_message: Optional[TestAllTypesProto3.NestedMessage] = ..., + oneof_string: Optional[Text] = ..., + oneof_bytes: Optional[bytes] = ..., + oneof_bool: Optional[bool] = ..., + oneof_uint64: Optional[int] = ..., + oneof_float: Optional[float] = ..., + oneof_double: Optional[float] = ..., + oneof_enum: Optional[TestAllTypesProto3.NestedEnum] = ..., + optional_bool_wrapper: Optional[BoolValue] = ..., + optional_int32_wrapper: Optional[Int32Value] = ..., + optional_int64_wrapper: Optional[Int64Value] = ..., + optional_uint32_wrapper: Optional[UInt32Value] = ..., + optional_uint64_wrapper: Optional[UInt64Value] = ..., + optional_float_wrapper: Optional[FloatValue] = ..., + optional_double_wrapper: Optional[DoubleValue] = ..., + optional_string_wrapper: Optional[StringValue] = ..., + optional_bytes_wrapper: Optional[BytesValue] = ..., + repeated_bool_wrapper: Optional[Iterable[BoolValue]] = ..., + repeated_int32_wrapper: Optional[Iterable[Int32Value]] = ..., + repeated_int64_wrapper: Optional[Iterable[Int64Value]] = ..., + repeated_uint32_wrapper: Optional[Iterable[UInt32Value]] = ..., + repeated_uint64_wrapper: Optional[Iterable[UInt64Value]] = ..., + repeated_float_wrapper: Optional[Iterable[FloatValue]] = ..., + repeated_double_wrapper: Optional[Iterable[DoubleValue]] = ..., + repeated_string_wrapper: Optional[Iterable[StringValue]] = ..., + repeated_bytes_wrapper: Optional[Iterable[BytesValue]] = ..., + optional_duration: Optional[Duration] = ..., + optional_timestamp: Optional[Timestamp] = ..., + optional_field_mask: Optional[FieldMask] = ..., + optional_struct: Optional[Struct] = ..., + optional_any: Optional[Any] = ..., + optional_value: Optional[Value] = ..., + repeated_duration: Optional[Iterable[Duration]] = ..., + repeated_timestamp: Optional[Iterable[Timestamp]] = ..., + repeated_fieldmask: Optional[Iterable[FieldMask]] = ..., + repeated_struct: Optional[Iterable[Struct]] = ..., + repeated_any: Optional[Iterable[Any]] = ..., + repeated_value: Optional[Iterable[Value]] = ..., + fieldname1: Optional[int] = ..., + field_name2: Optional[int] = ..., + _field_name3: Optional[int] = ..., + field__name4_: Optional[int] = ..., + field0name5: Optional[int] = ..., + field_0_name6: Optional[int] = ..., + fieldName7: Optional[int] = ..., + FieldName8: Optional[int] = ..., + field_Name9: Optional[int] = ..., + Field_Name10: Optional[int] = ..., + FIELD_NAME11: Optional[int] = ..., + FIELD_name12: Optional[int] = ..., + __field_name13: Optional[int] = ..., + __Field_name14: Optional[int] = ..., + field__name15: Optional[int] = ..., + field__Name16: Optional[int] = ..., + field_name17__: Optional[int] = ..., + Field_name18__: Optional[int] = ..., + ) -> None: ... + +class ForeignMessage(Message): + c: int + def __init__(self, c: Optional[int] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/timestamp_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/timestamp_pb2.pyi new file mode 100644 index 00000000..c34570c6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/timestamp_pb2.pyi @@ -0,0 +1,9 @@ +from google.protobuf.message import Message +from google.protobuf.internal import well_known_types + +from typing import Optional + +class Timestamp(Message, well_known_types.Timestamp): + seconds: int + nanos: int + def __init__(self, seconds: Optional[int] = ..., nanos: Optional[int] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/type_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/type_pb2.pyi new file mode 100644 index 00000000..40c8633a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/type_pb2.pyi @@ -0,0 +1,144 @@ +from google.protobuf.any_pb2 import Any +from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer +from google.protobuf.message import Message +from google.protobuf.source_context_pb2 import SourceContext +from typing import Iterable, List, Optional, Text, Tuple, cast + +class Syntax(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> Syntax: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[Syntax]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, Syntax]]: ... + +SYNTAX_PROTO2: Syntax +SYNTAX_PROTO3: Syntax + +class Type(Message): + name: Text + oneofs: RepeatedScalarFieldContainer[Text] + syntax: Syntax + @property + def fields(self) -> RepeatedCompositeFieldContainer[Field]: ... + @property + def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + @property + def source_context(self) -> SourceContext: ... + def __init__( + self, + name: Optional[Text] = ..., + fields: Optional[Iterable[Field]] = ..., + oneofs: Optional[Iterable[Text]] = ..., + options: Optional[Iterable[Option]] = ..., + source_context: Optional[SourceContext] = ..., + syntax: Optional[Syntax] = ..., + ) -> None: ... + +class Field(Message): + class Kind(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> Field.Kind: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[Field.Kind]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, Field.Kind]]: ... + TYPE_UNKNOWN: Field.Kind + TYPE_DOUBLE: Field.Kind + TYPE_FLOAT: Field.Kind + TYPE_INT64: Field.Kind + TYPE_UINT64: Field.Kind + TYPE_INT32: Field.Kind + TYPE_FIXED64: Field.Kind + TYPE_FIXED32: Field.Kind + TYPE_BOOL: Field.Kind + TYPE_STRING: Field.Kind + TYPE_GROUP: Field.Kind + TYPE_MESSAGE: Field.Kind + TYPE_BYTES: Field.Kind + TYPE_UINT32: Field.Kind + TYPE_ENUM: Field.Kind + TYPE_SFIXED32: Field.Kind + TYPE_SFIXED64: Field.Kind + TYPE_SINT32: Field.Kind + TYPE_SINT64: Field.Kind + class Cardinality(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> Field.Cardinality: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[Field.Cardinality]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, Field.Cardinality]]: ... + CARDINALITY_UNKNOWN: Field.Cardinality + CARDINALITY_OPTIONAL: Field.Cardinality + CARDINALITY_REQUIRED: Field.Cardinality + CARDINALITY_REPEATED: Field.Cardinality + kind: Field.Kind + cardinality: Field.Cardinality + number: int + name: Text + type_url: Text + oneof_index: int + packed: bool + json_name: Text + default_value: Text + @property + def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + def __init__( + self, + kind: Optional[Field.Kind] = ..., + cardinality: Optional[Field.Cardinality] = ..., + number: Optional[int] = ..., + name: Optional[Text] = ..., + type_url: Optional[Text] = ..., + oneof_index: Optional[int] = ..., + packed: Optional[bool] = ..., + options: Optional[Iterable[Option]] = ..., + json_name: Optional[Text] = ..., + default_value: Optional[Text] = ..., + ) -> None: ... + +class Enum(Message): + name: Text + syntax: Syntax + @property + def enumvalue(self) -> RepeatedCompositeFieldContainer[EnumValue]: ... + @property + def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + @property + def source_context(self) -> SourceContext: ... + def __init__( + self, + name: Optional[Text] = ..., + enumvalue: Optional[Iterable[EnumValue]] = ..., + options: Optional[Iterable[Option]] = ..., + source_context: Optional[SourceContext] = ..., + syntax: Optional[Syntax] = ..., + ) -> None: ... + +class EnumValue(Message): + name: Text + number: int + @property + def options(self) -> RepeatedCompositeFieldContainer[Option]: ... + def __init__( + self, name: Optional[Text] = ..., number: Optional[int] = ..., options: Optional[Iterable[Option]] = ... + ) -> None: ... + +class Option(Message): + name: Text + @property + def value(self) -> Any: ... + def __init__(self, name: Optional[Text] = ..., value: Optional[Any] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_arena_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_arena_pb2.pyi new file mode 100644 index 00000000..8be9db18 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_arena_pb2.pyi @@ -0,0 +1,19 @@ +from google.protobuf.internal.containers import RepeatedCompositeFieldContainer +from google.protobuf.message import Message +from google.protobuf.unittest_no_arena_import_pb2 import ImportNoArenaNestedMessage +from typing import Iterable, Optional + +class NestedMessage(Message): + d: int + def __init__(self, d: Optional[int] = ...) -> None: ... + +class ArenaMessage(Message): + @property + def repeated_nested_message(self) -> RepeatedCompositeFieldContainer[NestedMessage]: ... + @property + def repeated_import_no_arena_message(self) -> RepeatedCompositeFieldContainer[ImportNoArenaNestedMessage]: ... + def __init__( + self, + repeated_nested_message: Optional[Iterable[NestedMessage]] = ..., + repeated_import_no_arena_message: Optional[Iterable[ImportNoArenaNestedMessage]] = ..., + ) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_custom_options_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_custom_options_pb2.pyi new file mode 100644 index 00000000..83c710db --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_custom_options_pb2.pyi @@ -0,0 +1,226 @@ +from google.protobuf.descriptor_pb2 import FileOptions +from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer +from google.protobuf.message import Message +from typing import Iterable, List, Optional, Text, Tuple, cast + +class MethodOpt1(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> MethodOpt1: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[MethodOpt1]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, MethodOpt1]]: ... + +METHODOPT1_VAL1: MethodOpt1 +METHODOPT1_VAL2: MethodOpt1 + +class AggregateEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> AggregateEnum: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[AggregateEnum]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, AggregateEnum]]: ... + +VALUE: AggregateEnum + +class TestMessageWithCustomOptions(Message): + class AnEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> TestMessageWithCustomOptions.AnEnum: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[TestMessageWithCustomOptions.AnEnum]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, TestMessageWithCustomOptions.AnEnum]]: ... + ANENUM_VAL1: TestMessageWithCustomOptions.AnEnum + ANENUM_VAL2: TestMessageWithCustomOptions.AnEnum + field1: Text + oneof_field: int + def __init__(self, field1: Optional[Text] = ..., oneof_field: Optional[int] = ...) -> None: ... + +class CustomOptionFooRequest(Message): + def __init__(self,) -> None: ... + +class CustomOptionFooResponse(Message): + def __init__(self,) -> None: ... + +class CustomOptionFooClientMessage(Message): + def __init__(self,) -> None: ... + +class CustomOptionFooServerMessage(Message): + def __init__(self,) -> None: ... + +class DummyMessageContainingEnum(Message): + class TestEnumType(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> DummyMessageContainingEnum.TestEnumType: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[DummyMessageContainingEnum.TestEnumType]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, DummyMessageContainingEnum.TestEnumType]]: ... + TEST_OPTION_ENUM_TYPE1: DummyMessageContainingEnum.TestEnumType + TEST_OPTION_ENUM_TYPE2: DummyMessageContainingEnum.TestEnumType + def __init__(self,) -> None: ... + +class DummyMessageInvalidAsOptionType(Message): + def __init__(self,) -> None: ... + +class CustomOptionMinIntegerValues(Message): + def __init__(self,) -> None: ... + +class CustomOptionMaxIntegerValues(Message): + def __init__(self,) -> None: ... + +class CustomOptionOtherValues(Message): + def __init__(self,) -> None: ... + +class SettingRealsFromPositiveInts(Message): + def __init__(self,) -> None: ... + +class SettingRealsFromNegativeInts(Message): + def __init__(self,) -> None: ... + +class ComplexOptionType1(Message): + foo: int + foo2: int + foo3: int + foo4: RepeatedScalarFieldContainer[int] + def __init__( + self, foo: Optional[int] = ..., foo2: Optional[int] = ..., foo3: Optional[int] = ..., foo4: Optional[Iterable[int]] = ... + ) -> None: ... + +class ComplexOptionType2(Message): + class ComplexOptionType4(Message): + waldo: int + def __init__(self, waldo: Optional[int] = ...) -> None: ... + baz: int + @property + def bar(self) -> ComplexOptionType1: ... + @property + def fred(self) -> ComplexOptionType2.ComplexOptionType4: ... + @property + def barney(self) -> RepeatedCompositeFieldContainer[ComplexOptionType2.ComplexOptionType4]: ... + def __init__( + self, + bar: Optional[ComplexOptionType1] = ..., + baz: Optional[int] = ..., + fred: Optional[ComplexOptionType2.ComplexOptionType4] = ..., + barney: Optional[Iterable[ComplexOptionType2.ComplexOptionType4]] = ..., + ) -> None: ... + +class ComplexOptionType3(Message): + class ComplexOptionType5(Message): + plugh: int + def __init__(self, plugh: Optional[int] = ...) -> None: ... + qux: int + @property + def complexoptiontype5(self) -> ComplexOptionType3.ComplexOptionType5: ... + def __init__( + self, qux: Optional[int] = ..., complexoptiontype5: Optional[ComplexOptionType3.ComplexOptionType5] = ... + ) -> None: ... + +class ComplexOpt6(Message): + xyzzy: int + def __init__(self, xyzzy: Optional[int] = ...) -> None: ... + +class VariousComplexOptions(Message): + def __init__(self,) -> None: ... + +class AggregateMessageSet(Message): + def __init__(self,) -> None: ... + +class AggregateMessageSetElement(Message): + s: Text + def __init__(self, s: Optional[Text] = ...) -> None: ... + +class Aggregate(Message): + i: int + s: Text + @property + def sub(self) -> Aggregate: ... + @property + def file(self) -> FileOptions: ... + @property + def mset(self) -> AggregateMessageSet: ... + def __init__( + self, + i: Optional[int] = ..., + s: Optional[Text] = ..., + sub: Optional[Aggregate] = ..., + file: Optional[FileOptions] = ..., + mset: Optional[AggregateMessageSet] = ..., + ) -> None: ... + +class AggregateMessage(Message): + fieldname: int + def __init__(self, fieldname: Optional[int] = ...) -> None: ... + +class NestedOptionType(Message): + class NestedEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> NestedOptionType.NestedEnum: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[NestedOptionType.NestedEnum]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, NestedOptionType.NestedEnum]]: ... + NESTED_ENUM_VALUE: NestedOptionType.NestedEnum + class NestedMessage(Message): + nested_field: int + def __init__(self, nested_field: Optional[int] = ...) -> None: ... + def __init__(self,) -> None: ... + +class OldOptionType(Message): + class TestEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> OldOptionType.TestEnum: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[OldOptionType.TestEnum]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, OldOptionType.TestEnum]]: ... + OLD_VALUE: OldOptionType.TestEnum + value: OldOptionType.TestEnum + def __init__(self, value: OldOptionType.TestEnum) -> None: ... + +class NewOptionType(Message): + class TestEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> NewOptionType.TestEnum: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[NewOptionType.TestEnum]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, NewOptionType.TestEnum]]: ... + OLD_VALUE: NewOptionType.TestEnum + NEW_VALUE: NewOptionType.TestEnum + value: NewOptionType.TestEnum + def __init__(self, value: NewOptionType.TestEnum) -> None: ... + +class TestMessageWithRequiredEnumOption(Message): + def __init__(self,) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_pb2.pyi new file mode 100644 index 00000000..3d4b91cf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_pb2.pyi @@ -0,0 +1,38 @@ +from google.protobuf.message import Message +from typing import List, Optional, Tuple, cast + +class ImportEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> ImportEnum: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[ImportEnum]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, ImportEnum]]: ... + +IMPORT_FOO: ImportEnum +IMPORT_BAR: ImportEnum +IMPORT_BAZ: ImportEnum + +class ImportEnumForMap(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> ImportEnumForMap: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[ImportEnumForMap]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, ImportEnumForMap]]: ... + +UNKNOWN: ImportEnumForMap +FOO: ImportEnumForMap +BAR: ImportEnumForMap + +class ImportMessage(Message): + d: int + def __init__(self, d: Optional[int] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_public_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_public_pb2.pyi new file mode 100644 index 00000000..db231560 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_import_public_pb2.pyi @@ -0,0 +1,6 @@ +from google.protobuf.message import Message +from typing import Optional + +class PublicImportMessage(Message): + e: int + def __init__(self, e: Optional[int] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_pb2.pyi new file mode 100644 index 00000000..60a204c2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_pb2.pyi @@ -0,0 +1,27 @@ +from google.protobuf.internal.containers import RepeatedCompositeFieldContainer +from google.protobuf.message import Message +from google.protobuf.unittest_mset_wire_format_pb2 import TestMessageSet +import builtins +from typing import Iterable, Optional, Text + +class TestMessageSetContainer(Message): + @property + def message_set(self) -> TestMessageSet: ... + def __init__(self, message_set: Optional[TestMessageSet] = ...) -> None: ... + +class TestMessageSetExtension1(Message): + i: int + def __init__(self, i: Optional[int] = ...) -> None: ... + +class TestMessageSetExtension2(Message): + str: Text + def __init__(self, bytes: Optional[Text] = ...) -> None: ... + +class RawMessageSet(Message): + class Item(Message): + type_id: int + message: bytes + def __init__(self, type_id: int, message: bytes) -> None: ... + @property + def item(self) -> RepeatedCompositeFieldContainer[RawMessageSet.Item]: ... + def __init__(self, item: Optional[Iterable[RawMessageSet.Item]] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_wire_format_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_wire_format_pb2.pyi new file mode 100644 index 00000000..2414cd08 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_mset_wire_format_pb2.pyi @@ -0,0 +1,10 @@ +from google.protobuf.message import Message +from typing import Optional + +class TestMessageSet(Message): + def __init__(self,) -> None: ... + +class TestMessageSetWireFormatContainer(Message): + @property + def message_set(self) -> TestMessageSet: ... + def __init__(self, message_set: Optional[TestMessageSet] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_import_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_import_pb2.pyi new file mode 100644 index 00000000..e3032a68 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_import_pb2.pyi @@ -0,0 +1,6 @@ +from google.protobuf.message import Message +from typing import Optional + +class ImportNoArenaNestedMessage(Message): + d: int + def __init__(self, d: Optional[int] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_pb2.pyi new file mode 100644 index 00000000..57c40294 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_arena_pb2.pyi @@ -0,0 +1,225 @@ +from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer +from google.protobuf.message import Message +from google.protobuf.unittest_arena_pb2 import ArenaMessage +from google.protobuf.unittest_import_pb2 import ImportEnum, ImportMessage +from google.protobuf.unittest_import_public_pb2 import PublicImportMessage +from typing import Iterable, List, Optional, Text, Tuple, cast + +class ForeignEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> ForeignEnum: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[ForeignEnum]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ... + +FOREIGN_FOO: ForeignEnum +FOREIGN_BAR: ForeignEnum +FOREIGN_BAZ: ForeignEnum + +class TestAllTypes(Message): + class NestedEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> TestAllTypes.NestedEnum: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[TestAllTypes.NestedEnum]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, TestAllTypes.NestedEnum]]: ... + FOO: TestAllTypes.NestedEnum + BAR: TestAllTypes.NestedEnum + BAZ: TestAllTypes.NestedEnum + NEG: TestAllTypes.NestedEnum + class NestedMessage(Message): + bb: int + def __init__(self, bb: Optional[int] = ...) -> None: ... + class OptionalGroup(Message): + a: int + def __init__(self, a: Optional[int] = ...) -> None: ... + class RepeatedGroup(Message): + a: int + def __init__(self, a: Optional[int] = ...) -> None: ... + optional_int32: int + optional_int64: int + optional_uint32: int + optional_uint64: int + optional_sint32: int + optional_sint64: int + optional_fixed32: int + optional_fixed64: int + optional_sfixed32: int + optional_sfixed64: int + optional_float: float + optional_double: float + optional_bool: bool + optional_string: Text + optional_bytes: bytes + optional_nested_enum: TestAllTypes.NestedEnum + optional_foreign_enum: ForeignEnum + optional_import_enum: ImportEnum + optional_string_piece: Text + optional_cord: Text + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_uint32: RepeatedScalarFieldContainer[int] + repeated_uint64: RepeatedScalarFieldContainer[int] + repeated_sint32: RepeatedScalarFieldContainer[int] + repeated_sint64: RepeatedScalarFieldContainer[int] + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_sfixed32: RepeatedScalarFieldContainer[int] + repeated_sfixed64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_double: RepeatedScalarFieldContainer[float] + repeated_bool: RepeatedScalarFieldContainer[bool] + repeated_string: RepeatedScalarFieldContainer[Text] + repeated_bytes: RepeatedScalarFieldContainer[bytes] + repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum] + repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnum] + repeated_import_enum: RepeatedScalarFieldContainer[ImportEnum] + repeated_string_piece: RepeatedScalarFieldContainer[Text] + repeated_cord: RepeatedScalarFieldContainer[Text] + default_int32: int + default_int64: int + default_uint32: int + default_uint64: int + default_sint32: int + default_sint64: int + default_fixed32: int + default_fixed64: int + default_sfixed32: int + default_sfixed64: int + default_float: float + default_double: float + default_bool: bool + default_string: Text + default_bytes: bytes + default_nested_enum: TestAllTypes.NestedEnum + default_foreign_enum: ForeignEnum + default_import_enum: ImportEnum + default_string_piece: Text + default_cord: Text + oneof_uint32: int + oneof_string: Text + oneof_bytes: bytes + @property + def optionalgroup(self) -> TestAllTypes.OptionalGroup: ... + @property + def optional_nested_message(self) -> TestAllTypes.NestedMessage: ... + @property + def optional_foreign_message(self) -> ForeignMessage: ... + @property + def optional_import_message(self) -> ImportMessage: ... + @property + def optional_public_import_message(self) -> PublicImportMessage: ... + @property + def optional_message(self) -> TestAllTypes.NestedMessage: ... + @property + def repeatedgroup(self) -> RepeatedCompositeFieldContainer[TestAllTypes.RepeatedGroup]: ... + @property + def repeated_nested_message(self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... + @property + def repeated_foreign_message(self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... + @property + def repeated_import_message(self) -> RepeatedCompositeFieldContainer[ImportMessage]: ... + @property + def repeated_lazy_message(self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... + @property + def oneof_nested_message(self) -> TestAllTypes.NestedMessage: ... + @property + def lazy_oneof_nested_message(self) -> TestAllTypes.NestedMessage: ... + def __init__( + self, + optional_int32: Optional[int] = ..., + optional_int64: Optional[int] = ..., + optional_uint32: Optional[int] = ..., + optional_uint64: Optional[int] = ..., + optional_sint32: Optional[int] = ..., + optional_sint64: Optional[int] = ..., + optional_fixed32: Optional[int] = ..., + optional_fixed64: Optional[int] = ..., + optional_sfixed32: Optional[int] = ..., + optional_sfixed64: Optional[int] = ..., + optional_float: Optional[float] = ..., + optional_double: Optional[float] = ..., + optional_bool: Optional[bool] = ..., + optional_string: Optional[Text] = ..., + optional_bytes: Optional[bytes] = ..., + optionalgroup: Optional[TestAllTypes.OptionalGroup] = ..., + optional_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + optional_foreign_message: Optional[ForeignMessage] = ..., + optional_import_message: Optional[ImportMessage] = ..., + optional_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., + optional_foreign_enum: Optional[ForeignEnum] = ..., + optional_import_enum: Optional[ImportEnum] = ..., + optional_string_piece: Optional[Text] = ..., + optional_cord: Optional[Text] = ..., + optional_public_import_message: Optional[PublicImportMessage] = ..., + optional_message: Optional[TestAllTypes.NestedMessage] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_uint32: Optional[Iterable[int]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + repeated_sint32: Optional[Iterable[int]] = ..., + repeated_sint64: Optional[Iterable[int]] = ..., + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_sfixed32: Optional[Iterable[int]] = ..., + repeated_sfixed64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_double: Optional[Iterable[float]] = ..., + repeated_bool: Optional[Iterable[bool]] = ..., + repeated_string: Optional[Iterable[Text]] = ..., + repeated_bytes: Optional[Iterable[bytes]] = ..., + repeatedgroup: Optional[Iterable[TestAllTypes.RepeatedGroup]] = ..., + repeated_nested_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., + repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ..., + repeated_import_message: Optional[Iterable[ImportMessage]] = ..., + repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ..., + repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ..., + repeated_import_enum: Optional[Iterable[ImportEnum]] = ..., + repeated_string_piece: Optional[Iterable[Text]] = ..., + repeated_cord: Optional[Iterable[Text]] = ..., + repeated_lazy_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., + default_int32: Optional[int] = ..., + default_int64: Optional[int] = ..., + default_uint32: Optional[int] = ..., + default_uint64: Optional[int] = ..., + default_sint32: Optional[int] = ..., + default_sint64: Optional[int] = ..., + default_fixed32: Optional[int] = ..., + default_fixed64: Optional[int] = ..., + default_sfixed32: Optional[int] = ..., + default_sfixed64: Optional[int] = ..., + default_float: Optional[float] = ..., + default_double: Optional[float] = ..., + default_bool: Optional[bool] = ..., + default_string: Optional[Text] = ..., + default_bytes: Optional[bytes] = ..., + default_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., + default_foreign_enum: Optional[ForeignEnum] = ..., + default_import_enum: Optional[ImportEnum] = ..., + default_string_piece: Optional[Text] = ..., + default_cord: Optional[Text] = ..., + oneof_uint32: Optional[int] = ..., + oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + oneof_string: Optional[Text] = ..., + oneof_bytes: Optional[bytes] = ..., + lazy_oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + ) -> None: ... + +class ForeignMessage(Message): + c: int + def __init__(self, c: Optional[int] = ...) -> None: ... + +class TestNoArenaMessage(Message): + @property + def arena_message(self) -> ArenaMessage: ... + def __init__(self, arena_message: Optional[ArenaMessage] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_generic_services_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_generic_services_pb2.pyi new file mode 100644 index 00000000..2a9b7ae1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_no_generic_services_pb2.pyi @@ -0,0 +1,20 @@ +from google.protobuf.message import Message +from typing import List, Optional, Tuple, cast + +class TestEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> TestEnum: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[TestEnum]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, TestEnum]]: ... + +FOO: TestEnum + +class TestMessage(Message): + a: int + def __init__(self, a: Optional[int] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_pb2.pyi new file mode 100644 index 00000000..26bc9173 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_pb2.pyi @@ -0,0 +1,1083 @@ +from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer +from google.protobuf.message import Message +from google.protobuf.unittest_import_pb2 import ImportEnum, ImportMessage +from google.protobuf.unittest_import_public_pb2 import PublicImportMessage +from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, cast + +class ForeignEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> ForeignEnum: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[ForeignEnum]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ... + +FOREIGN_FOO: ForeignEnum +FOREIGN_BAR: ForeignEnum +FOREIGN_BAZ: ForeignEnum + +class TestEnumWithDupValue(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> TestEnumWithDupValue: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[TestEnumWithDupValue]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, TestEnumWithDupValue]]: ... + +FOO1: TestEnumWithDupValue +BAR1: TestEnumWithDupValue +BAZ: TestEnumWithDupValue +FOO2: TestEnumWithDupValue +BAR2: TestEnumWithDupValue + +class TestSparseEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> TestSparseEnum: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[TestSparseEnum]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, TestSparseEnum]]: ... + +SPARSE_A: TestSparseEnum +SPARSE_B: TestSparseEnum +SPARSE_C: TestSparseEnum +SPARSE_D: TestSparseEnum +SPARSE_E: TestSparseEnum +SPARSE_F: TestSparseEnum +SPARSE_G: TestSparseEnum + +class TestAllTypes(Message): + class NestedEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> TestAllTypes.NestedEnum: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[TestAllTypes.NestedEnum]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, TestAllTypes.NestedEnum]]: ... + FOO: TestAllTypes.NestedEnum + BAR: TestAllTypes.NestedEnum + BAZ: TestAllTypes.NestedEnum + NEG: TestAllTypes.NestedEnum + class NestedMessage(Message): + bb: int + def __init__(self, bb: Optional[int] = ...) -> None: ... + class OptionalGroup(Message): + a: int + def __init__(self, a: Optional[int] = ...) -> None: ... + class RepeatedGroup(Message): + a: int + def __init__(self, a: Optional[int] = ...) -> None: ... + optional_int32: int + optional_int64: int + optional_uint32: int + optional_uint64: int + optional_sint32: int + optional_sint64: int + optional_fixed32: int + optional_fixed64: int + optional_sfixed32: int + optional_sfixed64: int + optional_float: float + optional_double: float + optional_bool: bool + optional_string: Text + optional_bytes: bytes + optional_nested_enum: TestAllTypes.NestedEnum + optional_foreign_enum: ForeignEnum + optional_import_enum: ImportEnum + optional_string_piece: Text + optional_cord: Text + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_uint32: RepeatedScalarFieldContainer[int] + repeated_uint64: RepeatedScalarFieldContainer[int] + repeated_sint32: RepeatedScalarFieldContainer[int] + repeated_sint64: RepeatedScalarFieldContainer[int] + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_sfixed32: RepeatedScalarFieldContainer[int] + repeated_sfixed64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_double: RepeatedScalarFieldContainer[float] + repeated_bool: RepeatedScalarFieldContainer[bool] + repeated_string: RepeatedScalarFieldContainer[Text] + repeated_bytes: RepeatedScalarFieldContainer[bytes] + repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum] + repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnum] + repeated_import_enum: RepeatedScalarFieldContainer[ImportEnum] + repeated_string_piece: RepeatedScalarFieldContainer[Text] + repeated_cord: RepeatedScalarFieldContainer[Text] + default_int32: int + default_int64: int + default_uint32: int + default_uint64: int + default_sint32: int + default_sint64: int + default_fixed32: int + default_fixed64: int + default_sfixed32: int + default_sfixed64: int + default_float: float + default_double: float + default_bool: bool + default_string: Text + default_bytes: bytes + default_nested_enum: TestAllTypes.NestedEnum + default_foreign_enum: ForeignEnum + default_import_enum: ImportEnum + default_string_piece: Text + default_cord: Text + oneof_uint32: int + oneof_string: Text + oneof_bytes: bytes + @property + def optionalgroup(self) -> TestAllTypes.OptionalGroup: ... + @property + def optional_nested_message(self) -> TestAllTypes.NestedMessage: ... + @property + def optional_foreign_message(self) -> ForeignMessage: ... + @property + def optional_import_message(self) -> ImportMessage: ... + @property + def optional_public_import_message(self) -> PublicImportMessage: ... + @property + def optional_lazy_message(self) -> TestAllTypes.NestedMessage: ... + @property + def repeatedgroup(self) -> RepeatedCompositeFieldContainer[TestAllTypes.RepeatedGroup]: ... + @property + def repeated_nested_message(self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... + @property + def repeated_foreign_message(self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... + @property + def repeated_import_message(self) -> RepeatedCompositeFieldContainer[ImportMessage]: ... + @property + def repeated_lazy_message(self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... + @property + def oneof_nested_message(self) -> TestAllTypes.NestedMessage: ... + def __init__( + self, + optional_int32: Optional[int] = ..., + optional_int64: Optional[int] = ..., + optional_uint32: Optional[int] = ..., + optional_uint64: Optional[int] = ..., + optional_sint32: Optional[int] = ..., + optional_sint64: Optional[int] = ..., + optional_fixed32: Optional[int] = ..., + optional_fixed64: Optional[int] = ..., + optional_sfixed32: Optional[int] = ..., + optional_sfixed64: Optional[int] = ..., + optional_float: Optional[float] = ..., + optional_double: Optional[float] = ..., + optional_bool: Optional[bool] = ..., + optional_string: Optional[Text] = ..., + optional_bytes: Optional[bytes] = ..., + optionalgroup: Optional[TestAllTypes.OptionalGroup] = ..., + optional_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + optional_foreign_message: Optional[ForeignMessage] = ..., + optional_import_message: Optional[ImportMessage] = ..., + optional_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., + optional_foreign_enum: Optional[ForeignEnum] = ..., + optional_import_enum: Optional[ImportEnum] = ..., + optional_string_piece: Optional[Text] = ..., + optional_cord: Optional[Text] = ..., + optional_public_import_message: Optional[PublicImportMessage] = ..., + optional_lazy_message: Optional[TestAllTypes.NestedMessage] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_uint32: Optional[Iterable[int]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + repeated_sint32: Optional[Iterable[int]] = ..., + repeated_sint64: Optional[Iterable[int]] = ..., + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_sfixed32: Optional[Iterable[int]] = ..., + repeated_sfixed64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_double: Optional[Iterable[float]] = ..., + repeated_bool: Optional[Iterable[bool]] = ..., + repeated_string: Optional[Iterable[Text]] = ..., + repeated_bytes: Optional[Iterable[bytes]] = ..., + repeatedgroup: Optional[Iterable[TestAllTypes.RepeatedGroup]] = ..., + repeated_nested_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., + repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ..., + repeated_import_message: Optional[Iterable[ImportMessage]] = ..., + repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ..., + repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ..., + repeated_import_enum: Optional[Iterable[ImportEnum]] = ..., + repeated_string_piece: Optional[Iterable[Text]] = ..., + repeated_cord: Optional[Iterable[Text]] = ..., + repeated_lazy_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., + default_int32: Optional[int] = ..., + default_int64: Optional[int] = ..., + default_uint32: Optional[int] = ..., + default_uint64: Optional[int] = ..., + default_sint32: Optional[int] = ..., + default_sint64: Optional[int] = ..., + default_fixed32: Optional[int] = ..., + default_fixed64: Optional[int] = ..., + default_sfixed32: Optional[int] = ..., + default_sfixed64: Optional[int] = ..., + default_float: Optional[float] = ..., + default_double: Optional[float] = ..., + default_bool: Optional[bool] = ..., + default_string: Optional[Text] = ..., + default_bytes: Optional[bytes] = ..., + default_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., + default_foreign_enum: Optional[ForeignEnum] = ..., + default_import_enum: Optional[ImportEnum] = ..., + default_string_piece: Optional[Text] = ..., + default_cord: Optional[Text] = ..., + oneof_uint32: Optional[int] = ..., + oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + oneof_string: Optional[Text] = ..., + oneof_bytes: Optional[bytes] = ..., + ) -> None: ... + +class NestedTestAllTypes(Message): + @property + def child(self) -> NestedTestAllTypes: ... + @property + def payload(self) -> TestAllTypes: ... + @property + def repeated_child(self) -> RepeatedCompositeFieldContainer[NestedTestAllTypes]: ... + def __init__( + self, + child: Optional[NestedTestAllTypes] = ..., + payload: Optional[TestAllTypes] = ..., + repeated_child: Optional[Iterable[NestedTestAllTypes]] = ..., + ) -> None: ... + +class TestDeprecatedFields(Message): + deprecated_int32: int + deprecated_int32_in_oneof: int + def __init__(self, deprecated_int32: Optional[int] = ..., deprecated_int32_in_oneof: Optional[int] = ...) -> None: ... + +class TestDeprecatedMessage(Message): + def __init__(self,) -> None: ... + +class ForeignMessage(Message): + c: int + d: int + def __init__(self, c: Optional[int] = ..., d: Optional[int] = ...) -> None: ... + +class TestReservedFields(Message): + def __init__(self,) -> None: ... + +class TestAllExtensions(Message): + def __init__(self,) -> None: ... + +class OptionalGroup_extension(Message): + a: int + def __init__(self, a: Optional[int] = ...) -> None: ... + +class RepeatedGroup_extension(Message): + a: int + def __init__(self, a: Optional[int] = ...) -> None: ... + +class TestGroup(Message): + class OptionalGroup(Message): + a: int + def __init__(self, a: Optional[int] = ...) -> None: ... + optional_foreign_enum: ForeignEnum + @property + def optionalgroup(self) -> TestGroup.OptionalGroup: ... + def __init__( + self, optionalgroup: Optional[TestGroup.OptionalGroup] = ..., optional_foreign_enum: Optional[ForeignEnum] = ... + ) -> None: ... + +class TestGroupExtension(Message): + def __init__(self,) -> None: ... + +class TestNestedExtension(Message): + class OptionalGroup_extension(Message): + a: int + def __init__(self, a: Optional[int] = ...) -> None: ... + def __init__(self,) -> None: ... + +class TestRequired(Message): + a: int + dummy2: int + b: int + dummy4: int + dummy5: int + dummy6: int + dummy7: int + dummy8: int + dummy9: int + dummy10: int + dummy11: int + dummy12: int + dummy13: int + dummy14: int + dummy15: int + dummy16: int + dummy17: int + dummy18: int + dummy19: int + dummy20: int + dummy21: int + dummy22: int + dummy23: int + dummy24: int + dummy25: int + dummy26: int + dummy27: int + dummy28: int + dummy29: int + dummy30: int + dummy31: int + dummy32: int + c: int + def __init__( + self, + a: int, + b: int, + c: int, + dummy2: Optional[int] = ..., + dummy4: Optional[int] = ..., + dummy5: Optional[int] = ..., + dummy6: Optional[int] = ..., + dummy7: Optional[int] = ..., + dummy8: Optional[int] = ..., + dummy9: Optional[int] = ..., + dummy10: Optional[int] = ..., + dummy11: Optional[int] = ..., + dummy12: Optional[int] = ..., + dummy13: Optional[int] = ..., + dummy14: Optional[int] = ..., + dummy15: Optional[int] = ..., + dummy16: Optional[int] = ..., + dummy17: Optional[int] = ..., + dummy18: Optional[int] = ..., + dummy19: Optional[int] = ..., + dummy20: Optional[int] = ..., + dummy21: Optional[int] = ..., + dummy22: Optional[int] = ..., + dummy23: Optional[int] = ..., + dummy24: Optional[int] = ..., + dummy25: Optional[int] = ..., + dummy26: Optional[int] = ..., + dummy27: Optional[int] = ..., + dummy28: Optional[int] = ..., + dummy29: Optional[int] = ..., + dummy30: Optional[int] = ..., + dummy31: Optional[int] = ..., + dummy32: Optional[int] = ..., + ) -> None: ... + +class TestRequiredForeign(Message): + dummy: int + @property + def optional_message(self) -> TestRequired: ... + @property + def repeated_message(self) -> RepeatedCompositeFieldContainer[TestRequired]: ... + def __init__( + self, + optional_message: Optional[TestRequired] = ..., + repeated_message: Optional[Iterable[TestRequired]] = ..., + dummy: Optional[int] = ..., + ) -> None: ... + +class TestRequiredMessage(Message): + @property + def optional_message(self) -> TestRequired: ... + @property + def repeated_message(self) -> RepeatedCompositeFieldContainer[TestRequired]: ... + @property + def required_message(self) -> TestRequired: ... + def __init__( + self, + required_message: TestRequired, + optional_message: Optional[TestRequired] = ..., + repeated_message: Optional[Iterable[TestRequired]] = ..., + ) -> None: ... + +class TestForeignNested(Message): + @property + def foreign_nested(self) -> TestAllTypes.NestedMessage: ... + def __init__(self, foreign_nested: Optional[TestAllTypes.NestedMessage] = ...) -> None: ... + +class TestEmptyMessage(Message): + def __init__(self,) -> None: ... + +class TestEmptyMessageWithExtensions(Message): + def __init__(self,) -> None: ... + +class TestMultipleExtensionRanges(Message): + def __init__(self,) -> None: ... + +class TestReallyLargeTagNumber(Message): + a: int + bb: int + def __init__(self, a: Optional[int] = ..., bb: Optional[int] = ...) -> None: ... + +class TestRecursiveMessage(Message): + i: int + @property + def a(self) -> TestRecursiveMessage: ... + def __init__(self, a: Optional[TestRecursiveMessage] = ..., i: Optional[int] = ...) -> None: ... + +class TestMutualRecursionA(Message): + class SubMessage(Message): + @property + def b(self) -> TestMutualRecursionB: ... + def __init__(self, b: Optional[TestMutualRecursionB] = ...) -> None: ... + class SubGroup(Message): + @property + def sub_message(self) -> TestMutualRecursionA.SubMessage: ... + @property + def not_in_this_scc(self) -> TestAllTypes: ... + def __init__( + self, sub_message: Optional[TestMutualRecursionA.SubMessage] = ..., not_in_this_scc: Optional[TestAllTypes] = ... + ) -> None: ... + @property + def bb(self) -> TestMutualRecursionB: ... + @property + def subgroup(self) -> TestMutualRecursionA.SubGroup: ... + def __init__( + self, bb: Optional[TestMutualRecursionB] = ..., subgroup: Optional[TestMutualRecursionA.SubGroup] = ... + ) -> None: ... + +class TestMutualRecursionB(Message): + optional_int32: int + @property + def a(self) -> TestMutualRecursionA: ... + def __init__(self, a: Optional[TestMutualRecursionA] = ..., optional_int32: Optional[int] = ...) -> None: ... + +class TestIsInitialized(Message): + class SubMessage(Message): + class SubGroup(Message): + i: int + def __init__(self, i: int) -> None: ... + @property + def subgroup(self) -> TestIsInitialized.SubMessage.SubGroup: ... + def __init__(self, subgroup: Optional[TestIsInitialized.SubMessage.SubGroup] = ...) -> None: ... + @property + def sub_message(self) -> TestIsInitialized.SubMessage: ... + def __init__(self, sub_message: Optional[TestIsInitialized.SubMessage] = ...) -> None: ... + +class TestDupFieldNumber(Message): + class Foo(Message): + a: int + def __init__(self, a: Optional[int] = ...) -> None: ... + class Bar(Message): + a: int + def __init__(self, a: Optional[int] = ...) -> None: ... + a: int + @property + def foo(self) -> TestDupFieldNumber.Foo: ... + @property + def bar(self) -> TestDupFieldNumber.Bar: ... + def __init__( + self, a: Optional[int] = ..., foo: Optional[TestDupFieldNumber.Foo] = ..., bar: Optional[TestDupFieldNumber.Bar] = ... + ) -> None: ... + +class TestEagerMessage(Message): + @property + def sub_message(self) -> TestAllTypes: ... + def __init__(self, sub_message: Optional[TestAllTypes] = ...) -> None: ... + +class TestLazyMessage(Message): + @property + def sub_message(self) -> TestAllTypes: ... + def __init__(self, sub_message: Optional[TestAllTypes] = ...) -> None: ... + +class TestNestedMessageHasBits(Message): + class NestedMessage(Message): + nestedmessage_repeated_int32: RepeatedScalarFieldContainer[int] + @property + def nestedmessage_repeated_foreignmessage(self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... + def __init__( + self, + nestedmessage_repeated_int32: Optional[Iterable[int]] = ..., + nestedmessage_repeated_foreignmessage: Optional[Iterable[ForeignMessage]] = ..., + ) -> None: ... + @property + def optional_nested_message(self) -> TestNestedMessageHasBits.NestedMessage: ... + def __init__(self, optional_nested_message: Optional[TestNestedMessageHasBits.NestedMessage] = ...) -> None: ... + +class TestCamelCaseFieldNames(Message): + PrimitiveField: int + StringField: Text + EnumField: ForeignEnum + StringPieceField: Text + CordField: Text + RepeatedPrimitiveField: RepeatedScalarFieldContainer[int] + RepeatedStringField: RepeatedScalarFieldContainer[Text] + RepeatedEnumField: RepeatedScalarFieldContainer[ForeignEnum] + RepeatedStringPieceField: RepeatedScalarFieldContainer[Text] + RepeatedCordField: RepeatedScalarFieldContainer[Text] + @property + def MessageField(self) -> ForeignMessage: ... + @property + def RepeatedMessageField(self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... + def __init__( + self, + PrimitiveField: Optional[int] = ..., + StringField: Optional[Text] = ..., + EnumField: Optional[ForeignEnum] = ..., + MessageField: Optional[ForeignMessage] = ..., + StringPieceField: Optional[Text] = ..., + CordField: Optional[Text] = ..., + RepeatedPrimitiveField: Optional[Iterable[int]] = ..., + RepeatedStringField: Optional[Iterable[Text]] = ..., + RepeatedEnumField: Optional[Iterable[ForeignEnum]] = ..., + RepeatedMessageField: Optional[Iterable[ForeignMessage]] = ..., + RepeatedStringPieceField: Optional[Iterable[Text]] = ..., + RepeatedCordField: Optional[Iterable[Text]] = ..., + ) -> None: ... + +class TestFieldOrderings(Message): + class NestedMessage(Message): + oo: int + bb: int + def __init__(self, oo: Optional[int] = ..., bb: Optional[int] = ...) -> None: ... + my_string: Text + my_int: int + my_float: float + @property + def optional_nested_message(self) -> TestFieldOrderings.NestedMessage: ... + def __init__( + self, + my_string: Optional[Text] = ..., + my_int: Optional[int] = ..., + my_float: Optional[float] = ..., + optional_nested_message: Optional[TestFieldOrderings.NestedMessage] = ..., + ) -> None: ... + +class TestExtensionOrderings1(Message): + my_string: Text + def __init__(self, my_string: Optional[Text] = ...) -> None: ... + +class TestExtensionOrderings2(Message): + class TestExtensionOrderings3(Message): + my_string: Text + def __init__(self, my_string: Optional[Text] = ...) -> None: ... + my_string: Text + def __init__(self, my_string: Optional[Text] = ...) -> None: ... + +class TestExtremeDefaultValues(Message): + escaped_bytes: bytes + large_uint32: int + large_uint64: int + small_int32: int + small_int64: int + really_small_int32: int + really_small_int64: int + utf8_string: Text + zero_float: float + one_float: float + small_float: float + negative_one_float: float + negative_float: float + large_float: float + small_negative_float: float + inf_double: float + neg_inf_double: float + nan_double: float + inf_float: float + neg_inf_float: float + nan_float: float + cpp_trigraph: Text + string_with_zero: Text + bytes_with_zero: bytes + string_piece_with_zero: Text + cord_with_zero: Text + replacement_string: Text + def __init__( + self, + escaped_bytes: Optional[bytes] = ..., + large_uint32: Optional[int] = ..., + large_uint64: Optional[int] = ..., + small_int32: Optional[int] = ..., + small_int64: Optional[int] = ..., + really_small_int32: Optional[int] = ..., + really_small_int64: Optional[int] = ..., + utf8_string: Optional[Text] = ..., + zero_float: Optional[float] = ..., + one_float: Optional[float] = ..., + small_float: Optional[float] = ..., + negative_one_float: Optional[float] = ..., + negative_float: Optional[float] = ..., + large_float: Optional[float] = ..., + small_negative_float: Optional[float] = ..., + inf_double: Optional[float] = ..., + neg_inf_double: Optional[float] = ..., + nan_double: Optional[float] = ..., + inf_float: Optional[float] = ..., + neg_inf_float: Optional[float] = ..., + nan_float: Optional[float] = ..., + cpp_trigraph: Optional[Text] = ..., + string_with_zero: Optional[Text] = ..., + bytes_with_zero: Optional[bytes] = ..., + string_piece_with_zero: Optional[Text] = ..., + cord_with_zero: Optional[Text] = ..., + replacement_string: Optional[Text] = ..., + ) -> None: ... + +class SparseEnumMessage(Message): + sparse_enum: TestSparseEnum + def __init__(self, sparse_enum: Optional[TestSparseEnum] = ...) -> None: ... + +class OneString(Message): + data: Text + def __init__(self, data: Optional[Text] = ...) -> None: ... + +class MoreString(Message): + data: RepeatedScalarFieldContainer[Text] + def __init__(self, data: Optional[Iterable[Text]] = ...) -> None: ... + +class OneBytes(Message): + data: bytes + def __init__(self, data: Optional[bytes] = ...) -> None: ... + +class MoreBytes(Message): + data: RepeatedScalarFieldContainer[bytes] + def __init__(self, data: Optional[Iterable[bytes]] = ...) -> None: ... + +class Int32Message(Message): + data: int + def __init__(self, data: Optional[int] = ...) -> None: ... + +class Uint32Message(Message): + data: int + def __init__(self, data: Optional[int] = ...) -> None: ... + +class Int64Message(Message): + data: int + def __init__(self, data: Optional[int] = ...) -> None: ... + +class Uint64Message(Message): + data: int + def __init__(self, data: Optional[int] = ...) -> None: ... + +class BoolMessage(Message): + data: bool + def __init__(self, data: Optional[bool] = ...) -> None: ... + +class TestOneof(Message): + class FooGroup(Message): + a: int + b: Text + def __init__(self, a: Optional[int] = ..., b: Optional[Text] = ...) -> None: ... + foo_int: int + foo_string: Text + @property + def foo_message(self) -> TestAllTypes: ... + @property + def foogroup(self) -> TestOneof.FooGroup: ... + def __init__( + self, + foo_int: Optional[int] = ..., + foo_string: Optional[Text] = ..., + foo_message: Optional[TestAllTypes] = ..., + foogroup: Optional[TestOneof.FooGroup] = ..., + ) -> None: ... + +class TestOneofBackwardsCompatible(Message): + class FooGroup(Message): + a: int + b: Text + def __init__(self, a: Optional[int] = ..., b: Optional[Text] = ...) -> None: ... + foo_int: int + foo_string: Text + @property + def foo_message(self) -> TestAllTypes: ... + @property + def foogroup(self) -> TestOneofBackwardsCompatible.FooGroup: ... + def __init__( + self, + foo_int: Optional[int] = ..., + foo_string: Optional[Text] = ..., + foo_message: Optional[TestAllTypes] = ..., + foogroup: Optional[TestOneofBackwardsCompatible.FooGroup] = ..., + ) -> None: ... + +class TestOneof2(Message): + class NestedEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> TestOneof2.NestedEnum: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[TestOneof2.NestedEnum]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, TestOneof2.NestedEnum]]: ... + FOO: TestOneof2.NestedEnum + BAR: TestOneof2.NestedEnum + BAZ: TestOneof2.NestedEnum + class FooGroup(Message): + a: int + b: Text + def __init__(self, a: Optional[int] = ..., b: Optional[Text] = ...) -> None: ... + class NestedMessage(Message): + qux_int: int + corge_int: RepeatedScalarFieldContainer[int] + def __init__(self, qux_int: Optional[int] = ..., corge_int: Optional[Iterable[int]] = ...) -> None: ... + foo_int: int + foo_string: Text + foo_cord: Text + foo_string_piece: Text + foo_bytes: bytes + foo_enum: TestOneof2.NestedEnum + bar_int: int + bar_string: Text + bar_cord: Text + bar_string_piece: Text + bar_bytes: bytes + bar_enum: TestOneof2.NestedEnum + baz_int: int + baz_string: Text + @property + def foo_message(self) -> TestOneof2.NestedMessage: ... + @property + def foogroup(self) -> TestOneof2.FooGroup: ... + @property + def foo_lazy_message(self) -> TestOneof2.NestedMessage: ... + def __init__( + self, + foo_int: Optional[int] = ..., + foo_string: Optional[Text] = ..., + foo_cord: Optional[Text] = ..., + foo_string_piece: Optional[Text] = ..., + foo_bytes: Optional[bytes] = ..., + foo_enum: Optional[TestOneof2.NestedEnum] = ..., + foo_message: Optional[TestOneof2.NestedMessage] = ..., + foogroup: Optional[TestOneof2.FooGroup] = ..., + foo_lazy_message: Optional[TestOneof2.NestedMessage] = ..., + bar_int: Optional[int] = ..., + bar_string: Optional[Text] = ..., + bar_cord: Optional[Text] = ..., + bar_string_piece: Optional[Text] = ..., + bar_bytes: Optional[bytes] = ..., + bar_enum: Optional[TestOneof2.NestedEnum] = ..., + baz_int: Optional[int] = ..., + baz_string: Optional[Text] = ..., + ) -> None: ... + +class TestRequiredOneof(Message): + class NestedMessage(Message): + required_double: float + def __init__(self, required_double: float) -> None: ... + foo_int: int + foo_string: Text + @property + def foo_message(self) -> TestRequiredOneof.NestedMessage: ... + def __init__( + self, + foo_int: Optional[int] = ..., + foo_string: Optional[Text] = ..., + foo_message: Optional[TestRequiredOneof.NestedMessage] = ..., + ) -> None: ... + +class TestPackedTypes(Message): + packed_int32: RepeatedScalarFieldContainer[int] + packed_int64: RepeatedScalarFieldContainer[int] + packed_uint32: RepeatedScalarFieldContainer[int] + packed_uint64: RepeatedScalarFieldContainer[int] + packed_sint32: RepeatedScalarFieldContainer[int] + packed_sint64: RepeatedScalarFieldContainer[int] + packed_fixed32: RepeatedScalarFieldContainer[int] + packed_fixed64: RepeatedScalarFieldContainer[int] + packed_sfixed32: RepeatedScalarFieldContainer[int] + packed_sfixed64: RepeatedScalarFieldContainer[int] + packed_float: RepeatedScalarFieldContainer[float] + packed_double: RepeatedScalarFieldContainer[float] + packed_bool: RepeatedScalarFieldContainer[bool] + packed_enum: RepeatedScalarFieldContainer[ForeignEnum] + def __init__( + self, + packed_int32: Optional[Iterable[int]] = ..., + packed_int64: Optional[Iterable[int]] = ..., + packed_uint32: Optional[Iterable[int]] = ..., + packed_uint64: Optional[Iterable[int]] = ..., + packed_sint32: Optional[Iterable[int]] = ..., + packed_sint64: Optional[Iterable[int]] = ..., + packed_fixed32: Optional[Iterable[int]] = ..., + packed_fixed64: Optional[Iterable[int]] = ..., + packed_sfixed32: Optional[Iterable[int]] = ..., + packed_sfixed64: Optional[Iterable[int]] = ..., + packed_float: Optional[Iterable[float]] = ..., + packed_double: Optional[Iterable[float]] = ..., + packed_bool: Optional[Iterable[bool]] = ..., + packed_enum: Optional[Iterable[ForeignEnum]] = ..., + ) -> None: ... + +class TestUnpackedTypes(Message): + unpacked_int32: RepeatedScalarFieldContainer[int] + unpacked_int64: RepeatedScalarFieldContainer[int] + unpacked_uint32: RepeatedScalarFieldContainer[int] + unpacked_uint64: RepeatedScalarFieldContainer[int] + unpacked_sint32: RepeatedScalarFieldContainer[int] + unpacked_sint64: RepeatedScalarFieldContainer[int] + unpacked_fixed32: RepeatedScalarFieldContainer[int] + unpacked_fixed64: RepeatedScalarFieldContainer[int] + unpacked_sfixed32: RepeatedScalarFieldContainer[int] + unpacked_sfixed64: RepeatedScalarFieldContainer[int] + unpacked_float: RepeatedScalarFieldContainer[float] + unpacked_double: RepeatedScalarFieldContainer[float] + unpacked_bool: RepeatedScalarFieldContainer[bool] + unpacked_enum: RepeatedScalarFieldContainer[ForeignEnum] + def __init__( + self, + unpacked_int32: Optional[Iterable[int]] = ..., + unpacked_int64: Optional[Iterable[int]] = ..., + unpacked_uint32: Optional[Iterable[int]] = ..., + unpacked_uint64: Optional[Iterable[int]] = ..., + unpacked_sint32: Optional[Iterable[int]] = ..., + unpacked_sint64: Optional[Iterable[int]] = ..., + unpacked_fixed32: Optional[Iterable[int]] = ..., + unpacked_fixed64: Optional[Iterable[int]] = ..., + unpacked_sfixed32: Optional[Iterable[int]] = ..., + unpacked_sfixed64: Optional[Iterable[int]] = ..., + unpacked_float: Optional[Iterable[float]] = ..., + unpacked_double: Optional[Iterable[float]] = ..., + unpacked_bool: Optional[Iterable[bool]] = ..., + unpacked_enum: Optional[Iterable[ForeignEnum]] = ..., + ) -> None: ... + +class TestPackedExtensions(Message): + def __init__(self,) -> None: ... + +class TestUnpackedExtensions(Message): + def __init__(self,) -> None: ... + +class TestDynamicExtensions(Message): + class DynamicEnumType(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> TestDynamicExtensions.DynamicEnumType: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[TestDynamicExtensions.DynamicEnumType]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, TestDynamicExtensions.DynamicEnumType]]: ... + DYNAMIC_FOO: TestDynamicExtensions.DynamicEnumType + DYNAMIC_BAR: TestDynamicExtensions.DynamicEnumType + DYNAMIC_BAZ: TestDynamicExtensions.DynamicEnumType + class DynamicMessageType(Message): + dynamic_field: int + def __init__(self, dynamic_field: Optional[int] = ...) -> None: ... + scalar_extension: int + enum_extension: ForeignEnum + dynamic_enum_extension: TestDynamicExtensions.DynamicEnumType + repeated_extension: RepeatedScalarFieldContainer[Text] + packed_extension: RepeatedScalarFieldContainer[int] + @property + def message_extension(self) -> ForeignMessage: ... + @property + def dynamic_message_extension(self) -> TestDynamicExtensions.DynamicMessageType: ... + def __init__( + self, + scalar_extension: Optional[int] = ..., + enum_extension: Optional[ForeignEnum] = ..., + dynamic_enum_extension: Optional[TestDynamicExtensions.DynamicEnumType] = ..., + message_extension: Optional[ForeignMessage] = ..., + dynamic_message_extension: Optional[TestDynamicExtensions.DynamicMessageType] = ..., + repeated_extension: Optional[Iterable[Text]] = ..., + packed_extension: Optional[Iterable[int]] = ..., + ) -> None: ... + +class TestRepeatedScalarDifferentTagSizes(Message): + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_uint64: RepeatedScalarFieldContainer[int] + def __init__( + self, + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + ) -> None: ... + +class TestParsingMerge(Message): + class RepeatedFieldsGenerator(Message): + class Group1(Message): + @property + def field1(self) -> TestAllTypes: ... + def __init__(self, field1: Optional[TestAllTypes] = ...) -> None: ... + class Group2(Message): + @property + def field1(self) -> TestAllTypes: ... + def __init__(self, field1: Optional[TestAllTypes] = ...) -> None: ... + @property + def field1(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... + @property + def field2(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... + @property + def field3(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... + @property + def group1(self) -> RepeatedCompositeFieldContainer[TestParsingMerge.RepeatedFieldsGenerator.Group1]: ... + @property + def group2(self) -> RepeatedCompositeFieldContainer[TestParsingMerge.RepeatedFieldsGenerator.Group2]: ... + @property + def ext1(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... + @property + def ext2(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... + def __init__( + self, + field1: Optional[Iterable[TestAllTypes]] = ..., + field2: Optional[Iterable[TestAllTypes]] = ..., + field3: Optional[Iterable[TestAllTypes]] = ..., + group1: Optional[Iterable[TestParsingMerge.RepeatedFieldsGenerator.Group1]] = ..., + group2: Optional[Iterable[TestParsingMerge.RepeatedFieldsGenerator.Group2]] = ..., + ext1: Optional[Iterable[TestAllTypes]] = ..., + ext2: Optional[Iterable[TestAllTypes]] = ..., + ) -> None: ... + class OptionalGroup(Message): + @property + def optional_group_all_types(self) -> TestAllTypes: ... + def __init__(self, optional_group_all_types: Optional[TestAllTypes] = ...) -> None: ... + class RepeatedGroup(Message): + @property + def repeated_group_all_types(self) -> TestAllTypes: ... + def __init__(self, repeated_group_all_types: Optional[TestAllTypes] = ...) -> None: ... + @property + def required_all_types(self) -> TestAllTypes: ... + @property + def optional_all_types(self) -> TestAllTypes: ... + @property + def repeated_all_types(self) -> RepeatedCompositeFieldContainer[TestAllTypes]: ... + @property + def optionalgroup(self) -> TestParsingMerge.OptionalGroup: ... + @property + def repeatedgroup(self) -> RepeatedCompositeFieldContainer[TestParsingMerge.RepeatedGroup]: ... + def __init__( + self, + required_all_types: TestAllTypes, + optional_all_types: Optional[TestAllTypes] = ..., + repeated_all_types: Optional[Iterable[TestAllTypes]] = ..., + optionalgroup: Optional[TestParsingMerge.OptionalGroup] = ..., + repeatedgroup: Optional[Iterable[TestParsingMerge.RepeatedGroup]] = ..., + ) -> None: ... + +class TestCommentInjectionMessage(Message): + a: Text + def __init__(self, a: Optional[Text] = ...) -> None: ... + +class FooRequest(Message): + def __init__(self,) -> None: ... + +class FooResponse(Message): + def __init__(self,) -> None: ... + +class FooClientMessage(Message): + def __init__(self,) -> None: ... + +class FooServerMessage(Message): + def __init__(self,) -> None: ... + +class BarRequest(Message): + def __init__(self,) -> None: ... + +class BarResponse(Message): + def __init__(self,) -> None: ... + +class TestJsonName(Message): + field_name1: int + fieldName2: int + FieldName3: int + _field_name4: int + FIELD_NAME5: int + field_name6: int + def __init__( + self, + field_name1: Optional[int] = ..., + fieldName2: Optional[int] = ..., + FieldName3: Optional[int] = ..., + _field_name4: Optional[int] = ..., + FIELD_NAME5: Optional[int] = ..., + field_name6: Optional[int] = ..., + ) -> None: ... + +class TestHugeFieldNumbers(Message): + class OptionalGroup(Message): + group_a: int + def __init__(self, group_a: Optional[int] = ...) -> None: ... + class StringStringMapEntry(Message): + key: Text + value: Text + def __init__(self, key: Optional[Text] = ..., value: Optional[Text] = ...) -> None: ... + optional_int32: int + fixed_32: int + repeated_int32: RepeatedScalarFieldContainer[int] + packed_int32: RepeatedScalarFieldContainer[int] + optional_enum: ForeignEnum + optional_string: Text + optional_bytes: bytes + oneof_uint32: int + oneof_string: Text + oneof_bytes: bytes + @property + def optional_message(self) -> ForeignMessage: ... + @property + def optionalgroup(self) -> TestHugeFieldNumbers.OptionalGroup: ... + @property + def string_string_map(self) -> MutableMapping[Text, Text]: ... + @property + def oneof_test_all_types(self) -> TestAllTypes: ... + def __init__( + self, + optional_int32: Optional[int] = ..., + fixed_32: Optional[int] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + packed_int32: Optional[Iterable[int]] = ..., + optional_enum: Optional[ForeignEnum] = ..., + optional_string: Optional[Text] = ..., + optional_bytes: Optional[bytes] = ..., + optional_message: Optional[ForeignMessage] = ..., + optionalgroup: Optional[TestHugeFieldNumbers.OptionalGroup] = ..., + string_string_map: Optional[Mapping[Text, Text]] = ..., + oneof_uint32: Optional[int] = ..., + oneof_test_all_types: Optional[TestAllTypes] = ..., + oneof_string: Optional[Text] = ..., + oneof_bytes: Optional[bytes] = ..., + ) -> None: ... + +class TestExtensionInsideTable(Message): + field1: int + field2: int + field3: int + field4: int + field6: int + field7: int + field8: int + field9: int + field10: int + def __init__( + self, + field1: Optional[int] = ..., + field2: Optional[int] = ..., + field3: Optional[int] = ..., + field4: Optional[int] = ..., + field6: Optional[int] = ..., + field7: Optional[int] = ..., + field8: Optional[int] = ..., + field9: Optional[int] = ..., + field10: Optional[int] = ..., + ) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_proto3_arena_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_proto3_arena_pb2.pyi new file mode 100644 index 00000000..4fe5ea6e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/unittest_proto3_arena_pb2.pyi @@ -0,0 +1,248 @@ +from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer +from google.protobuf.message import Message +from google.protobuf.unittest_import_pb2 import ImportMessage +from google.protobuf.unittest_import_public_pb2 import PublicImportMessage +from typing import Iterable, List, Optional, Text, Tuple, cast + +class ForeignEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> ForeignEnum: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[ForeignEnum]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ... + +FOREIGN_ZERO: ForeignEnum +FOREIGN_FOO: ForeignEnum +FOREIGN_BAR: ForeignEnum +FOREIGN_BAZ: ForeignEnum + +class TestAllTypes(Message): + class NestedEnum(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> TestAllTypes.NestedEnum: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[TestAllTypes.NestedEnum]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, TestAllTypes.NestedEnum]]: ... + ZERO: TestAllTypes.NestedEnum + FOO: TestAllTypes.NestedEnum + BAR: TestAllTypes.NestedEnum + BAZ: TestAllTypes.NestedEnum + NEG: TestAllTypes.NestedEnum + class NestedMessage(Message): + bb: int + def __init__(self, bb: Optional[int] = ...) -> None: ... + optional_int32: int + optional_int64: int + optional_uint32: int + optional_uint64: int + optional_sint32: int + optional_sint64: int + optional_fixed32: int + optional_fixed64: int + optional_sfixed32: int + optional_sfixed64: int + optional_float: float + optional_double: float + optional_bool: bool + optional_string: Text + optional_bytes: bytes + optional_nested_enum: TestAllTypes.NestedEnum + optional_foreign_enum: ForeignEnum + optional_string_piece: Text + optional_cord: Text + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_uint32: RepeatedScalarFieldContainer[int] + repeated_uint64: RepeatedScalarFieldContainer[int] + repeated_sint32: RepeatedScalarFieldContainer[int] + repeated_sint64: RepeatedScalarFieldContainer[int] + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_sfixed32: RepeatedScalarFieldContainer[int] + repeated_sfixed64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_double: RepeatedScalarFieldContainer[float] + repeated_bool: RepeatedScalarFieldContainer[bool] + repeated_string: RepeatedScalarFieldContainer[Text] + repeated_bytes: RepeatedScalarFieldContainer[bytes] + repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum] + repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnum] + repeated_string_piece: RepeatedScalarFieldContainer[Text] + repeated_cord: RepeatedScalarFieldContainer[Text] + oneof_uint32: int + oneof_string: Text + oneof_bytes: bytes + @property + def optional_nested_message(self) -> TestAllTypes.NestedMessage: ... + @property + def optional_foreign_message(self) -> ForeignMessage: ... + @property + def optional_import_message(self) -> ImportMessage: ... + @property + def optional_public_import_message(self) -> PublicImportMessage: ... + @property + def optional_lazy_message(self) -> TestAllTypes.NestedMessage: ... + @property + def optional_lazy_import_message(self) -> ImportMessage: ... + @property + def repeated_nested_message(self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... + @property + def repeated_foreign_message(self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ... + @property + def repeated_import_message(self) -> RepeatedCompositeFieldContainer[ImportMessage]: ... + @property + def repeated_lazy_message(self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ... + @property + def oneof_nested_message(self) -> TestAllTypes.NestedMessage: ... + def __init__( + self, + optional_int32: Optional[int] = ..., + optional_int64: Optional[int] = ..., + optional_uint32: Optional[int] = ..., + optional_uint64: Optional[int] = ..., + optional_sint32: Optional[int] = ..., + optional_sint64: Optional[int] = ..., + optional_fixed32: Optional[int] = ..., + optional_fixed64: Optional[int] = ..., + optional_sfixed32: Optional[int] = ..., + optional_sfixed64: Optional[int] = ..., + optional_float: Optional[float] = ..., + optional_double: Optional[float] = ..., + optional_bool: Optional[bool] = ..., + optional_string: Optional[Text] = ..., + optional_bytes: Optional[bytes] = ..., + optional_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + optional_foreign_message: Optional[ForeignMessage] = ..., + optional_import_message: Optional[ImportMessage] = ..., + optional_nested_enum: Optional[TestAllTypes.NestedEnum] = ..., + optional_foreign_enum: Optional[ForeignEnum] = ..., + optional_string_piece: Optional[Text] = ..., + optional_cord: Optional[Text] = ..., + optional_public_import_message: Optional[PublicImportMessage] = ..., + optional_lazy_message: Optional[TestAllTypes.NestedMessage] = ..., + optional_lazy_import_message: Optional[ImportMessage] = ..., + repeated_int32: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_uint32: Optional[Iterable[int]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + repeated_sint32: Optional[Iterable[int]] = ..., + repeated_sint64: Optional[Iterable[int]] = ..., + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_sfixed32: Optional[Iterable[int]] = ..., + repeated_sfixed64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_double: Optional[Iterable[float]] = ..., + repeated_bool: Optional[Iterable[bool]] = ..., + repeated_string: Optional[Iterable[Text]] = ..., + repeated_bytes: Optional[Iterable[bytes]] = ..., + repeated_nested_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., + repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ..., + repeated_import_message: Optional[Iterable[ImportMessage]] = ..., + repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ..., + repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ..., + repeated_string_piece: Optional[Iterable[Text]] = ..., + repeated_cord: Optional[Iterable[Text]] = ..., + repeated_lazy_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ..., + oneof_uint32: Optional[int] = ..., + oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ..., + oneof_string: Optional[Text] = ..., + oneof_bytes: Optional[bytes] = ..., + ) -> None: ... + +class TestPackedTypes(Message): + packed_int32: RepeatedScalarFieldContainer[int] + packed_int64: RepeatedScalarFieldContainer[int] + packed_uint32: RepeatedScalarFieldContainer[int] + packed_uint64: RepeatedScalarFieldContainer[int] + packed_sint32: RepeatedScalarFieldContainer[int] + packed_sint64: RepeatedScalarFieldContainer[int] + packed_fixed32: RepeatedScalarFieldContainer[int] + packed_fixed64: RepeatedScalarFieldContainer[int] + packed_sfixed32: RepeatedScalarFieldContainer[int] + packed_sfixed64: RepeatedScalarFieldContainer[int] + packed_float: RepeatedScalarFieldContainer[float] + packed_double: RepeatedScalarFieldContainer[float] + packed_bool: RepeatedScalarFieldContainer[bool] + packed_enum: RepeatedScalarFieldContainer[ForeignEnum] + def __init__( + self, + packed_int32: Optional[Iterable[int]] = ..., + packed_int64: Optional[Iterable[int]] = ..., + packed_uint32: Optional[Iterable[int]] = ..., + packed_uint64: Optional[Iterable[int]] = ..., + packed_sint32: Optional[Iterable[int]] = ..., + packed_sint64: Optional[Iterable[int]] = ..., + packed_fixed32: Optional[Iterable[int]] = ..., + packed_fixed64: Optional[Iterable[int]] = ..., + packed_sfixed32: Optional[Iterable[int]] = ..., + packed_sfixed64: Optional[Iterable[int]] = ..., + packed_float: Optional[Iterable[float]] = ..., + packed_double: Optional[Iterable[float]] = ..., + packed_bool: Optional[Iterable[bool]] = ..., + packed_enum: Optional[Iterable[ForeignEnum]] = ..., + ) -> None: ... + +class TestUnpackedTypes(Message): + repeated_int32: RepeatedScalarFieldContainer[int] + repeated_int64: RepeatedScalarFieldContainer[int] + repeated_uint32: RepeatedScalarFieldContainer[int] + repeated_uint64: RepeatedScalarFieldContainer[int] + repeated_sint32: RepeatedScalarFieldContainer[int] + repeated_sint64: RepeatedScalarFieldContainer[int] + repeated_fixed32: RepeatedScalarFieldContainer[int] + repeated_fixed64: RepeatedScalarFieldContainer[int] + repeated_sfixed32: RepeatedScalarFieldContainer[int] + repeated_sfixed64: RepeatedScalarFieldContainer[int] + repeated_float: RepeatedScalarFieldContainer[float] + repeated_double: RepeatedScalarFieldContainer[float] + repeated_bool: RepeatedScalarFieldContainer[bool] + repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum] + def __init__( + self, + repeated_int32: Optional[Iterable[int]] = ..., + repeated_int64: Optional[Iterable[int]] = ..., + repeated_uint32: Optional[Iterable[int]] = ..., + repeated_uint64: Optional[Iterable[int]] = ..., + repeated_sint32: Optional[Iterable[int]] = ..., + repeated_sint64: Optional[Iterable[int]] = ..., + repeated_fixed32: Optional[Iterable[int]] = ..., + repeated_fixed64: Optional[Iterable[int]] = ..., + repeated_sfixed32: Optional[Iterable[int]] = ..., + repeated_sfixed64: Optional[Iterable[int]] = ..., + repeated_float: Optional[Iterable[float]] = ..., + repeated_double: Optional[Iterable[float]] = ..., + repeated_bool: Optional[Iterable[bool]] = ..., + repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ..., + ) -> None: ... + +class NestedTestAllTypes(Message): + @property + def child(self) -> NestedTestAllTypes: ... + @property + def payload(self) -> TestAllTypes: ... + @property + def repeated_child(self) -> RepeatedCompositeFieldContainer[NestedTestAllTypes]: ... + def __init__( + self, + child: Optional[NestedTestAllTypes] = ..., + payload: Optional[TestAllTypes] = ..., + repeated_child: Optional[Iterable[NestedTestAllTypes]] = ..., + ) -> None: ... + +class ForeignMessage(Message): + c: int + def __init__(self, c: Optional[int] = ...) -> None: ... + +class TestEmptyMessage(Message): + def __init__(self,) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/json_format_proto3_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/json_format_proto3_pb2.pyi new file mode 100644 index 00000000..f4be1b9d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/util/json_format_proto3_pb2.pyi @@ -0,0 +1,341 @@ +from google.protobuf.any_pb2 import Any +from google.protobuf.duration_pb2 import Duration +from google.protobuf.field_mask_pb2 import FieldMask +from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer +from google.protobuf.message import Message +from google.protobuf.struct_pb2 import ListValue, Struct, Value +from google.protobuf.timestamp_pb2 import Timestamp +from google.protobuf.unittest_pb2 import TestAllExtensions +from google.protobuf.wrappers_pb2 import ( + BoolValue, + BytesValue, + DoubleValue, + FloatValue, + Int32Value, + Int64Value, + StringValue, + UInt32Value, + UInt64Value, +) +from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, cast + +class EnumType(int): + @classmethod + def Name(cls, number: int) -> bytes: ... + @classmethod + def Value(cls, name: bytes) -> EnumType: ... + @classmethod + def keys(cls) -> List[bytes]: ... + @classmethod + def values(cls) -> List[EnumType]: ... + @classmethod + def items(cls) -> List[Tuple[bytes, EnumType]]: ... + +FOO: EnumType +BAR: EnumType + +class MessageType(Message): + value: int + def __init__(self, value: Optional[int] = ...) -> None: ... + +class TestMessage(Message): + bool_value: bool + int32_value: int + int64_value: int + uint32_value: int + uint64_value: int + float_value: float + double_value: float + string_value: Text + bytes_value: bytes + enum_value: EnumType + repeated_bool_value: RepeatedScalarFieldContainer[bool] + repeated_int32_value: RepeatedScalarFieldContainer[int] + repeated_int64_value: RepeatedScalarFieldContainer[int] + repeated_uint32_value: RepeatedScalarFieldContainer[int] + repeated_uint64_value: RepeatedScalarFieldContainer[int] + repeated_float_value: RepeatedScalarFieldContainer[float] + repeated_double_value: RepeatedScalarFieldContainer[float] + repeated_string_value: RepeatedScalarFieldContainer[Text] + repeated_bytes_value: RepeatedScalarFieldContainer[bytes] + repeated_enum_value: RepeatedScalarFieldContainer[EnumType] + @property + def message_value(self) -> MessageType: ... + @property + def repeated_message_value(self) -> RepeatedCompositeFieldContainer[MessageType]: ... + def __init__( + self, + bool_value: Optional[bool] = ..., + int32_value: Optional[int] = ..., + int64_value: Optional[int] = ..., + uint32_value: Optional[int] = ..., + uint64_value: Optional[int] = ..., + float_value: Optional[float] = ..., + double_value: Optional[float] = ..., + string_value: Optional[Text] = ..., + bytes_value: Optional[bytes] = ..., + enum_value: Optional[EnumType] = ..., + message_value: Optional[MessageType] = ..., + repeated_bool_value: Optional[Iterable[bool]] = ..., + repeated_int32_value: Optional[Iterable[int]] = ..., + repeated_int64_value: Optional[Iterable[int]] = ..., + repeated_uint32_value: Optional[Iterable[int]] = ..., + repeated_uint64_value: Optional[Iterable[int]] = ..., + repeated_float_value: Optional[Iterable[float]] = ..., + repeated_double_value: Optional[Iterable[float]] = ..., + repeated_string_value: Optional[Iterable[Text]] = ..., + repeated_bytes_value: Optional[Iterable[bytes]] = ..., + repeated_enum_value: Optional[Iterable[EnumType]] = ..., + repeated_message_value: Optional[Iterable[MessageType]] = ..., + ) -> None: ... + +class TestOneof(Message): + oneof_int32_value: int + oneof_string_value: Text + oneof_bytes_value: bytes + oneof_enum_value: EnumType + @property + def oneof_message_value(self) -> MessageType: ... + def __init__( + self, + oneof_int32_value: Optional[int] = ..., + oneof_string_value: Optional[Text] = ..., + oneof_bytes_value: Optional[bytes] = ..., + oneof_enum_value: Optional[EnumType] = ..., + oneof_message_value: Optional[MessageType] = ..., + ) -> None: ... + +class TestMap(Message): + class BoolMapEntry(Message): + key: bool + value: int + def __init__(self, key: Optional[bool] = ..., value: Optional[int] = ...) -> None: ... + class Int32MapEntry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class Int64MapEntry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class Uint32MapEntry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class Uint64MapEntry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class StringMapEntry(Message): + key: Text + value: int + def __init__(self, key: Optional[Text] = ..., value: Optional[int] = ...) -> None: ... + @property + def bool_map(self) -> MutableMapping[bool, int]: ... + @property + def int32_map(self) -> MutableMapping[int, int]: ... + @property + def int64_map(self) -> MutableMapping[int, int]: ... + @property + def uint32_map(self) -> MutableMapping[int, int]: ... + @property + def uint64_map(self) -> MutableMapping[int, int]: ... + @property + def string_map(self) -> MutableMapping[Text, int]: ... + def __init__( + self, + bool_map: Optional[Mapping[bool, int]] = ..., + int32_map: Optional[Mapping[int, int]] = ..., + int64_map: Optional[Mapping[int, int]] = ..., + uint32_map: Optional[Mapping[int, int]] = ..., + uint64_map: Optional[Mapping[int, int]] = ..., + string_map: Optional[Mapping[Text, int]] = ..., + ) -> None: ... + +class TestNestedMap(Message): + class BoolMapEntry(Message): + key: bool + value: int + def __init__(self, key: Optional[bool] = ..., value: Optional[int] = ...) -> None: ... + class Int32MapEntry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class Int64MapEntry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class Uint32MapEntry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class Uint64MapEntry(Message): + key: int + value: int + def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ... + class StringMapEntry(Message): + key: Text + value: int + def __init__(self, key: Optional[Text] = ..., value: Optional[int] = ...) -> None: ... + class MapMapEntry(Message): + key: Text + @property + def value(self) -> TestNestedMap: ... + def __init__(self, key: Optional[Text] = ..., value: Optional[TestNestedMap] = ...) -> None: ... + @property + def bool_map(self) -> MutableMapping[bool, int]: ... + @property + def int32_map(self) -> MutableMapping[int, int]: ... + @property + def int64_map(self) -> MutableMapping[int, int]: ... + @property + def uint32_map(self) -> MutableMapping[int, int]: ... + @property + def uint64_map(self) -> MutableMapping[int, int]: ... + @property + def string_map(self) -> MutableMapping[Text, int]: ... + @property + def map_map(self) -> MutableMapping[Text, TestNestedMap]: ... + def __init__( + self, + bool_map: Optional[Mapping[bool, int]] = ..., + int32_map: Optional[Mapping[int, int]] = ..., + int64_map: Optional[Mapping[int, int]] = ..., + uint32_map: Optional[Mapping[int, int]] = ..., + uint64_map: Optional[Mapping[int, int]] = ..., + string_map: Optional[Mapping[Text, int]] = ..., + map_map: Optional[Mapping[Text, TestNestedMap]] = ..., + ) -> None: ... + +class TestWrapper(Message): + @property + def bool_value(self) -> BoolValue: ... + @property + def int32_value(self) -> Int32Value: ... + @property + def int64_value(self) -> Int64Value: ... + @property + def uint32_value(self) -> UInt32Value: ... + @property + def uint64_value(self) -> UInt64Value: ... + @property + def float_value(self) -> FloatValue: ... + @property + def double_value(self) -> DoubleValue: ... + @property + def string_value(self) -> StringValue: ... + @property + def bytes_value(self) -> BytesValue: ... + @property + def repeated_bool_value(self) -> RepeatedCompositeFieldContainer[BoolValue]: ... + @property + def repeated_int32_value(self) -> RepeatedCompositeFieldContainer[Int32Value]: ... + @property + def repeated_int64_value(self) -> RepeatedCompositeFieldContainer[Int64Value]: ... + @property + def repeated_uint32_value(self) -> RepeatedCompositeFieldContainer[UInt32Value]: ... + @property + def repeated_uint64_value(self) -> RepeatedCompositeFieldContainer[UInt64Value]: ... + @property + def repeated_float_value(self) -> RepeatedCompositeFieldContainer[FloatValue]: ... + @property + def repeated_double_value(self) -> RepeatedCompositeFieldContainer[DoubleValue]: ... + @property + def repeated_string_value(self) -> RepeatedCompositeFieldContainer[StringValue]: ... + @property + def repeated_bytes_value(self) -> RepeatedCompositeFieldContainer[BytesValue]: ... + def __init__( + self, + bool_value: Optional[BoolValue] = ..., + int32_value: Optional[Int32Value] = ..., + int64_value: Optional[Int64Value] = ..., + uint32_value: Optional[UInt32Value] = ..., + uint64_value: Optional[UInt64Value] = ..., + float_value: Optional[FloatValue] = ..., + double_value: Optional[DoubleValue] = ..., + string_value: Optional[StringValue] = ..., + bytes_value: Optional[BytesValue] = ..., + repeated_bool_value: Optional[Iterable[BoolValue]] = ..., + repeated_int32_value: Optional[Iterable[Int32Value]] = ..., + repeated_int64_value: Optional[Iterable[Int64Value]] = ..., + repeated_uint32_value: Optional[Iterable[UInt32Value]] = ..., + repeated_uint64_value: Optional[Iterable[UInt64Value]] = ..., + repeated_float_value: Optional[Iterable[FloatValue]] = ..., + repeated_double_value: Optional[Iterable[DoubleValue]] = ..., + repeated_string_value: Optional[Iterable[StringValue]] = ..., + repeated_bytes_value: Optional[Iterable[BytesValue]] = ..., + ) -> None: ... + +class TestTimestamp(Message): + @property + def value(self) -> Timestamp: ... + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[Timestamp]: ... + def __init__(self, value: Optional[Timestamp] = ..., repeated_value: Optional[Iterable[Timestamp]] = ...) -> None: ... + +class TestDuration(Message): + @property + def value(self) -> Duration: ... + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[Duration]: ... + def __init__(self, value: Optional[Duration] = ..., repeated_value: Optional[Iterable[Duration]] = ...) -> None: ... + +class TestFieldMask(Message): + @property + def value(self) -> FieldMask: ... + def __init__(self, value: Optional[FieldMask] = ...) -> None: ... + +class TestStruct(Message): + @property + def value(self) -> Struct: ... + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[Struct]: ... + def __init__(self, value: Optional[Struct] = ..., repeated_value: Optional[Iterable[Struct]] = ...) -> None: ... + +class TestAny(Message): + @property + def value(self) -> Any: ... + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[Any]: ... + def __init__(self, value: Optional[Any] = ..., repeated_value: Optional[Iterable[Any]] = ...) -> None: ... + +class TestValue(Message): + @property + def value(self) -> Value: ... + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[Value]: ... + def __init__(self, value: Optional[Value] = ..., repeated_value: Optional[Iterable[Value]] = ...) -> None: ... + +class TestListValue(Message): + @property + def value(self) -> ListValue: ... + @property + def repeated_value(self) -> RepeatedCompositeFieldContainer[ListValue]: ... + def __init__(self, value: Optional[ListValue] = ..., repeated_value: Optional[Iterable[ListValue]] = ...) -> None: ... + +class TestBoolValue(Message): + class BoolMapEntry(Message): + key: bool + value: int + def __init__(self, key: Optional[bool] = ..., value: Optional[int] = ...) -> None: ... + bool_value: bool + @property + def bool_map(self) -> MutableMapping[bool, int]: ... + def __init__(self, bool_value: Optional[bool] = ..., bool_map: Optional[Mapping[bool, int]] = ...) -> None: ... + +class TestCustomJsonName(Message): + value: int + def __init__(self, value: Optional[int] = ...) -> None: ... + +class TestExtensions(Message): + @property + def extensions(self) -> TestAllExtensions: ... + def __init__(self, extensions: Optional[TestAllExtensions] = ...) -> None: ... + +class TestEnumValue(Message): + enum_value1: EnumType + enum_value2: EnumType + enum_value3: EnumType + def __init__( + self, enum_value1: Optional[EnumType] = ..., enum_value2: Optional[EnumType] = ..., enum_value3: Optional[EnumType] = ... + ) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/wrappers_pb2.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/wrappers_pb2.pyi new file mode 100644 index 00000000..342d0e04 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/google/protobuf/wrappers_pb2.pyi @@ -0,0 +1,38 @@ +from google.protobuf.message import Message +from typing import Optional, Text + +class DoubleValue(Message): + value: float + def __init__(self, value: Optional[float] = ...) -> None: ... + +class FloatValue(Message): + value: float + def __init__(self, value: Optional[float] = ...) -> None: ... + +class Int64Value(Message): + value: int + def __init__(self, value: Optional[int] = ...) -> None: ... + +class UInt64Value(Message): + value: int + def __init__(self, value: Optional[int] = ...) -> None: ... + +class Int32Value(Message): + value: int + def __init__(self, value: Optional[int] = ...) -> None: ... + +class UInt32Value(Message): + value: int + def __init__(self, value: Optional[int] = ...) -> None: ... + +class BoolValue(Message): + value: bool + def __init__(self, value: Optional[bool] = ...) -> None: ... + +class StringValue(Message): + value: Text + def __init__(self, value: Optional[Text] = ...) -> None: ... + +class BytesValue(Message): + value: bytes + def __init__(self, value: Optional[bytes] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/itsdangerous.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/itsdangerous.pyi new file mode 100644 index 00000000..6e627c77 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/itsdangerous.pyi @@ -0,0 +1,153 @@ +from datetime import datetime +from typing import Any, Callable, IO, Mapping, MutableMapping, Optional, Tuple, Union, Text, Generator + +_serializer = Any # must be an object that has "dumps" and "loads" attributes (e.g. the json module) + +def want_bytes(s: Union[Text, bytes], encoding: Text = ..., errors: Text = ...) -> bytes: ... + +class BadData(Exception): + message: str + def __init__(self, message: str) -> None: ... + +class BadPayload(BadData): + original_error: Optional[Exception] + def __init__(self, message: str, original_error: Optional[Exception] = ...) -> None: ... + +class BadSignature(BadData): + payload: Optional[Any] + def __init__(self, message: str, payload: Optional[Any] = ...) -> None: ... + +class BadTimeSignature(BadSignature): + date_signed: Optional[int] + def __init__(self, message: str, payload: Optional[Any] = ..., date_signed: Optional[int] = ...) -> None: ... + +class BadHeader(BadSignature): + header: Any + original_error: Any + def __init__(self, message, payload: Optional[Any] = ..., header: Optional[Any] = ..., original_error: Optional[Any] = ...) -> None: ... + +class SignatureExpired(BadTimeSignature): ... + +def base64_encode(string: Union[Text, bytes]) -> bytes: ... +def base64_decode(string: Union[Text, bytes]) -> bytes: ... + +class SigningAlgorithm(object): + def get_signature(self, key: bytes, value: bytes) -> bytes: ... + def verify_signature(self, key: bytes, value: bytes, sig: bytes) -> bool: ... + +class NoneAlgorithm(SigningAlgorithm): + def get_signature(self, key: bytes, value: bytes) -> bytes: ... + +class HMACAlgorithm(SigningAlgorithm): + default_digest_method: Callable[..., Any] + digest_method: Callable[..., Any] + def __init__(self, digest_method: Optional[Callable[..., Any]] = ...) -> None: ... + def get_signature(self, key: bytes, value: bytes) -> bytes: ... + +class Signer(object): + default_digest_method: Callable[..., Any] = ... + default_key_derivation: str = ... + + secret_key: bytes + sep: bytes + salt: Union[Text, bytes] + key_derivation: str + digest_method: Callable[..., Any] + algorithm: SigningAlgorithm + + def __init__(self, + secret_key: Union[Text, bytes], + salt: Optional[Union[Text, bytes]] = ..., + sep: Optional[Union[Text, bytes]] = ..., + key_derivation: Optional[str] = ..., + digest_method: Optional[Callable[..., Any]] = ..., + algorithm: Optional[SigningAlgorithm] = ...) -> None: ... + def derive_key(self) -> bytes: ... + def get_signature(self, value: Union[Text, bytes]) -> bytes: ... + def sign(self, value: Union[Text, bytes]) -> bytes: ... + def verify_signature(self, value: bytes, sig: Union[Text, bytes]) -> bool: ... + def unsign(self, signed_value: Union[Text, bytes]) -> bytes: ... + def validate(self, signed_value: Union[Text, bytes]) -> bool: ... + +class TimestampSigner(Signer): + def get_timestamp(self) -> int: ... + def timestamp_to_datetime(self, ts: float) -> datetime: ... + def sign(self, value: Union[Text, bytes]) -> bytes: ... + def unsign(self, value: Union[Text, bytes], max_age: Optional[int] = ..., + return_timestamp: bool = ...) -> Any: ... # morally -> Union[bytes, Tuple[bytes, datetime]] + def validate(self, signed_value: Union[Text, bytes], max_age: Optional[int] = ...) -> bool: ... + +class Serializer(object): + default_serializer: _serializer = ... + default_signer: Callable[..., Signer] = ... + + secret_key: bytes + salt: bytes + serializer: _serializer + is_text_serializer: bool + signer: Callable[..., Signer] + signer_kwargs: MutableMapping[str, Any] + + def __init__(self, secret_key: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., + serializer: Optional[_serializer] = ..., signer: Optional[Callable[..., Signer]] = ..., + signer_kwargs: Optional[MutableMapping[str, Any]] = ...) -> None: ... + def load_payload(self, payload: bytes, serializer: Optional[_serializer] = ...) -> Any: ... + def dump_payload(self, obj: Any) -> bytes: ... + def make_signer(self, salt: Optional[Union[Text, bytes]] = ...) -> Signer: ... + def iter_unsigners(self, salt: Optional[Union[Text, bytes]] = ...) -> Generator[Any, None, None]: ... + def dumps(self, obj: Any, salt: Optional[Union[Text, bytes]] = ...) -> Any: ... # morally -> Union[str, bytes] + def dump(self, obj: Any, f: IO[Any], salt: Optional[Union[Text, bytes]] = ...) -> None: ... + def loads(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ...) -> Any: ... + def load(self, f: IO[Any], salt: Optional[Union[Text, bytes]] = ...): ... + def loads_unsafe(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ...) -> Tuple[bool, Optional[Any]]: ... + def load_unsafe(self, f: IO[Any], salt: Optional[Union[Text, bytes]] = ...) -> Tuple[bool, Optional[Any]]: ... + +class TimedSerializer(Serializer): + def loads(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., max_age: Optional[int] = ..., + return_timestamp: bool = ...) -> Any: ... # morally -> Union[Any, Tuple[Any, datetime]] + def loads_unsafe(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., + max_age: Optional[int] = ...) -> Tuple[bool, Any]: ... + +class JSONWebSignatureSerializer(Serializer): + jws_algorithms: MutableMapping[Text, SigningAlgorithm] = ... + default_algorithm: Text = ... + default_serializer: Any = ... + + algorithm_name: Text + algorithm: SigningAlgorithm + + def __init__(self, secret_key: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., + serializer: Optional[_serializer] = ..., signer: Optional[Callable[..., Signer]] = ..., + signer_kwargs: Optional[MutableMapping[str, Any]] = ..., algorithm_name: Optional[Text] = ...) -> None: ... + def load_payload(self, payload: Union[Text, bytes], serializer: Optional[_serializer] = ..., + return_header: bool = ...) -> Any: ... # morally -> Union[Any, Tuple[Any, MutableMapping[str, Any]]] + def dump_payload(self, header: Mapping[str, Any], obj: Any) -> bytes: ... # type: ignore + def make_algorithm(self, algorithm_name: Text) -> SigningAlgorithm: ... + def make_signer(self, salt: Optional[Union[Text, bytes]] = ..., algorithm: SigningAlgorithm = ...) -> Signer: ... + def make_header(self, header_fields: Optional[Mapping[str, Any]]) -> MutableMapping[str, Any]: ... + def dumps(self, obj: Any, salt: Optional[Union[Text, bytes]] = ..., + header_fields: Optional[Mapping[str, Any]] = ...) -> bytes: ... + def loads(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., + return_header: bool = ...) -> Any: ... # morally -> Union[Any, Tuple[Any, MutableMapping[str, Any]]] + def loads_unsafe(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., + return_header: bool = ...) -> Tuple[bool, Any]: ... + +class TimedJSONWebSignatureSerializer(JSONWebSignatureSerializer): + DEFAULT_EXPIRES_IN: int = ... + expires_in: int + def __init__(self, secret_key: Union[Text, bytes], expires_in: Optional[int] = ..., salt: Optional[Union[Text, bytes]] = ..., + serializer: Optional[_serializer] = ..., signer: Optional[Callable[..., Signer]] = ..., + signer_kwargs: Optional[MutableMapping[str, Any]] = ..., algorithm_name: Optional[Text] = ...) -> None: ... + def make_header(self, header_fields: Optional[Mapping[str, Any]]) -> MutableMapping[str, Any]: ... + def loads(self, s: Union[Text, bytes], salt: Optional[Union[Text, bytes]] = ..., + return_header: bool = ...) -> Any: ... # morally -> Union[Any, Tuple[Any, MutableMapping[str, Any]]] + def get_issue_date(self, header: Mapping[str, Any]) -> Optional[datetime]: ... + def now(self) -> int: ... + +class _URLSafeSerializerMixin(object): + default_serializer: _serializer = ... + def load_payload(self, payload: bytes, serializer: Optional[_serializer] = ...) -> Any: ... + def dump_payload(self, obj: Any) -> bytes: ... + +class URLSafeSerializer(_URLSafeSerializerMixin, Serializer): ... +class URLSafeTimedSerializer(_URLSafeSerializerMixin, TimedSerializer): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/__init__.pyi new file mode 100644 index 00000000..063f73d8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/__init__.pyi @@ -0,0 +1,7 @@ +from jinja2.environment import Environment as Environment, Template as Template +from jinja2.loaders import BaseLoader as BaseLoader, FileSystemLoader as FileSystemLoader, PackageLoader as PackageLoader, DictLoader as DictLoader, FunctionLoader as FunctionLoader, PrefixLoader as PrefixLoader, ChoiceLoader as ChoiceLoader, ModuleLoader as ModuleLoader +from jinja2.bccache import BytecodeCache as BytecodeCache, FileSystemBytecodeCache as FileSystemBytecodeCache, MemcachedBytecodeCache as MemcachedBytecodeCache +from jinja2.runtime import Undefined as Undefined, DebugUndefined as DebugUndefined, StrictUndefined as StrictUndefined, make_logging_undefined as make_logging_undefined +from jinja2.exceptions import TemplateError as TemplateError, UndefinedError as UndefinedError, TemplateNotFound as TemplateNotFound, TemplatesNotFound as TemplatesNotFound, TemplateSyntaxError as TemplateSyntaxError, TemplateAssertionError as TemplateAssertionError +from jinja2.filters import environmentfilter as environmentfilter, contextfilter as contextfilter, evalcontextfilter as evalcontextfilter +from jinja2.utils import Markup as Markup, escape as escape, clear_caches as clear_caches, environmentfunction as environmentfunction, evalcontextfunction as evalcontextfunction, contextfunction as contextfunction, is_undefined as is_undefined, select_autoescape as select_autoescape diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/_compat.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/_compat.pyi new file mode 100644 index 00000000..1e37a7ab --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/_compat.pyi @@ -0,0 +1,34 @@ +from typing import Any, Optional +import sys + +if sys.version_info[0] >= 3: + from io import BytesIO + from urllib.parse import quote_from_bytes as url_quote +else: + from cStringIO import StringIO as BytesIO + from urllib import quote as url_quote + +PY2: Any +PYPY: Any +unichr: Any +range_type: Any +text_type: Any +string_types: Any +integer_types: Any +iterkeys: Any +itervalues: Any +iteritems: Any +NativeStringIO: Any + +def reraise(tp, value, tb: Optional[Any] = ...): ... + +ifilter: Any +imap: Any +izip: Any +intern: Any +implements_iterator: Any +implements_to_string: Any +encode_filename: Any +get_next: Any + +def with_metaclass(meta, *bases): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/_stringdefs.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/_stringdefs.pyi new file mode 100644 index 00000000..060f8881 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/_stringdefs.pyi @@ -0,0 +1,40 @@ +from typing import Any + +Cc: str +Cf: str +Cn: str +Co: str +Cs: Any +Ll: str +Lm: str +Lo: str +Lt: str +Lu: str +Mc: str +Me: str +Mn: str +Nd: str +Nl: str +No: str +Pc: str +Pd: str +Pe: str +Pf: str +Pi: str +Po: str +Ps: str +Sc: str +Sk: str +Sm: str +So: str +Zl: str +Zp: str +Zs: str +cats: Any + +def combine(*args): ... + +xid_start: str +xid_continue: str + +def allexcept(*args): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/bccache.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/bccache.pyi new file mode 100644 index 00000000..754736a6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/bccache.pyi @@ -0,0 +1,44 @@ +from typing import Any, Optional + +marshal_dump: Any +marshal_load: Any +bc_version: int +bc_magic: Any + +class Bucket: + environment: Any + key: Any + checksum: Any + def __init__(self, environment, key, checksum) -> None: ... + code: Any + def reset(self): ... + def load_bytecode(self, f): ... + def write_bytecode(self, f): ... + def bytecode_from_string(self, string): ... + def bytecode_to_string(self): ... + +class BytecodeCache: + def load_bytecode(self, bucket): ... + def dump_bytecode(self, bucket): ... + def clear(self): ... + def get_cache_key(self, name, filename: Optional[Any] = ...): ... + def get_source_checksum(self, source): ... + def get_bucket(self, environment, name, filename, source): ... + def set_bucket(self, bucket): ... + +class FileSystemBytecodeCache(BytecodeCache): + directory: Any + pattern: Any + def __init__(self, directory: Optional[Any] = ..., pattern: str = ...) -> None: ... + def load_bytecode(self, bucket): ... + def dump_bytecode(self, bucket): ... + def clear(self): ... + +class MemcachedBytecodeCache(BytecodeCache): + client: Any + prefix: Any + timeout: Any + ignore_memcache_errors: Any + def __init__(self, client, prefix: str = ..., timeout: Optional[Any] = ..., ignore_memcache_errors: bool = ...) -> None: ... + def load_bytecode(self, bucket): ... + def dump_bytecode(self, bucket): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/compiler.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/compiler.pyi new file mode 100644 index 00000000..7b1a5377 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/compiler.pyi @@ -0,0 +1,176 @@ +from typing import Any, Optional +from keyword import iskeyword as is_python_keyword +from jinja2.visitor import NodeVisitor + +operators: Any +dict_item_iter: str + +unoptimize_before_dead_code: bool + +def generate(node, environment, name, filename, stream: Optional[Any] = ..., defer_init: bool = ...): ... +def has_safe_repr(value): ... +def find_undeclared(nodes, names): ... + +class Identifiers: + declared: Any + outer_undeclared: Any + undeclared: Any + declared_locally: Any + declared_parameter: Any + def __init__(self) -> None: ... + def add_special(self, name): ... + def is_declared(self, name): ... + def copy(self): ... + +class Frame: + eval_ctx: Any + identifiers: Any + toplevel: bool + rootlevel: bool + require_output_check: Any + buffer: Any + block: Any + assigned_names: Any + parent: Any + def __init__(self, eval_ctx, parent: Optional[Any] = ...) -> None: ... + def copy(self): ... + def inspect(self, nodes): ... + def find_shadowed(self, extra: Any = ...): ... + def inner(self): ... + def soft(self): ... + __copy__: Any + +class VisitorExit(RuntimeError): ... + +class DependencyFinderVisitor(NodeVisitor): + filters: Any + tests: Any + def __init__(self) -> None: ... + def visit_Filter(self, node): ... + def visit_Test(self, node): ... + def visit_Block(self, node): ... + +class UndeclaredNameVisitor(NodeVisitor): + names: Any + undeclared: Any + def __init__(self, names) -> None: ... + def visit_Name(self, node): ... + def visit_Block(self, node): ... + +class FrameIdentifierVisitor(NodeVisitor): + identifiers: Any + def __init__(self, identifiers) -> None: ... + def visit_Name(self, node): ... + def visit_If(self, node): ... + def visit_Macro(self, node): ... + def visit_Import(self, node): ... + def visit_FromImport(self, node): ... + def visit_Assign(self, node): ... + def visit_For(self, node): ... + def visit_CallBlock(self, node): ... + def visit_FilterBlock(self, node): ... + def visit_AssignBlock(self, node): ... + def visit_Scope(self, node): ... + def visit_Block(self, node): ... + +class CompilerExit(Exception): ... + +class CodeGenerator(NodeVisitor): + environment: Any + name: Any + filename: Any + stream: Any + created_block_context: bool + defer_init: Any + import_aliases: Any + blocks: Any + extends_so_far: int + has_known_extends: bool + code_lineno: int + tests: Any + filters: Any + debug_info: Any + def __init__(self, environment, name, filename, stream: Optional[Any] = ..., defer_init: bool = ...) -> None: ... + def fail(self, msg, lineno): ... + def temporary_identifier(self): ... + def buffer(self, frame): ... + def return_buffer_contents(self, frame): ... + def indent(self): ... + def outdent(self, step: int = ...): ... + def start_write(self, frame, node: Optional[Any] = ...): ... + def end_write(self, frame): ... + def simple_write(self, s, frame, node: Optional[Any] = ...): ... + def blockvisit(self, nodes, frame): ... + def write(self, x): ... + def writeline(self, x, node: Optional[Any] = ..., extra: int = ...): ... + def newline(self, node: Optional[Any] = ..., extra: int = ...): ... + def signature(self, node, frame, extra_kwargs: Optional[Any] = ...): ... + def pull_locals(self, frame): ... + def pull_dependencies(self, nodes): ... + def unoptimize_scope(self, frame): ... + def push_scope(self, frame, extra_vars: Any = ...): ... + def pop_scope(self, aliases, frame): ... + def function_scoping(self, node, frame, children: Optional[Any] = ..., find_special: bool = ...): ... + def macro_body(self, node, frame, children: Optional[Any] = ...): ... + def macro_def(self, node, frame): ... + def position(self, node): ... + def visit_Template(self, node, frame: Optional[Any] = ...): ... + def visit_Block(self, node, frame): ... + def visit_Extends(self, node, frame): ... + def visit_Include(self, node, frame): ... + def visit_Import(self, node, frame): ... + def visit_FromImport(self, node, frame): ... + def visit_For(self, node, frame): ... + def visit_If(self, node, frame): ... + def visit_Macro(self, node, frame): ... + def visit_CallBlock(self, node, frame): ... + def visit_FilterBlock(self, node, frame): ... + def visit_ExprStmt(self, node, frame): ... + def visit_Output(self, node, frame): ... + def make_assignment_frame(self, frame): ... + def export_assigned_vars(self, frame, assignment_frame): ... + def visit_Assign(self, node, frame): ... + def visit_AssignBlock(self, node, frame): ... + def visit_Name(self, node, frame): ... + def visit_Const(self, node, frame): ... + def visit_TemplateData(self, node, frame): ... + def visit_Tuple(self, node, frame): ... + def visit_List(self, node, frame): ... + def visit_Dict(self, node, frame): ... + def binop(self, interceptable: bool = ...): ... + def uaop(self, interceptable: bool = ...): ... + visit_Add: Any + visit_Sub: Any + visit_Mul: Any + visit_Div: Any + visit_FloorDiv: Any + visit_Pow: Any + visit_Mod: Any + visit_And: Any + visit_Or: Any + visit_Pos: Any + visit_Neg: Any + visit_Not: Any + def visit_Concat(self, node, frame): ... + def visit_Compare(self, node, frame): ... + def visit_Operand(self, node, frame): ... + def visit_Getattr(self, node, frame): ... + def visit_Getitem(self, node, frame): ... + def visit_Slice(self, node, frame): ... + def visit_Filter(self, node, frame): ... + def visit_Test(self, node, frame): ... + def visit_CondExpr(self, node, frame): ... + def visit_Call(self, node, frame, forward_caller: bool = ...): ... + def visit_Keyword(self, node, frame): ... + def visit_MarkSafe(self, node, frame): ... + def visit_MarkSafeIfAutoescape(self, node, frame): ... + def visit_EnvironmentAttribute(self, node, frame): ... + def visit_ExtensionAttribute(self, node, frame): ... + def visit_ImportedName(self, node, frame): ... + def visit_InternalName(self, node, frame): ... + def visit_ContextReference(self, node, frame): ... + def visit_Continue(self, node, frame): ... + def visit_Break(self, node, frame): ... + def visit_Scope(self, node, frame): ... + def visit_EvalContextModifier(self, node, frame): ... + def visit_ScopedEvalContextModifier(self, node, frame): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/constants.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/constants.pyi new file mode 100644 index 00000000..55ea3ea5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/constants.pyi @@ -0,0 +1 @@ +LOREM_IPSUM_WORDS: str diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/debug.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/debug.pyi new file mode 100644 index 00000000..f495a4d9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/debug.pyi @@ -0,0 +1,37 @@ +from typing import Any, Optional + +tproxy: Any +raise_helper: str + +class TracebackFrameProxy: + tb: Any + def __init__(self, tb) -> None: ... + @property + def tb_next(self): ... + def set_next(self, next): ... + @property + def is_jinja_frame(self): ... + def __getattr__(self, name): ... + +def make_frame_proxy(frame): ... + +class ProcessedTraceback: + exc_type: Any + exc_value: Any + frames: Any + def __init__(self, exc_type, exc_value, frames) -> None: ... + def render_as_text(self, limit: Optional[Any] = ...): ... + def render_as_html(self, full: bool = ...): ... + @property + def is_template_syntax_error(self): ... + @property + def exc_info(self): ... + @property + def standard_exc_info(self): ... + +def make_traceback(exc_info, source_hint: Optional[Any] = ...): ... +def translate_syntax_error(error, source: Optional[Any] = ...): ... +def translate_exception(exc_info, initial_skip: int = ...): ... +def fake_exc_info(exc_info, filename, lineno): ... + +tb_set_next: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/defaults.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/defaults.pyi new file mode 100644 index 00000000..e89d3ce3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/defaults.pyi @@ -0,0 +1,21 @@ +from typing import Any +from jinja2.filters import FILTERS as DEFAULT_FILTERS +from jinja2.tests import TESTS as DEFAULT_TESTS + +BLOCK_START_STRING: str +BLOCK_END_STRING: str +VARIABLE_START_STRING: str +VARIABLE_END_STRING: str +COMMENT_START_STRING: str +COMMENT_END_STRING: str +LINE_STATEMENT_PREFIX: Any +LINE_COMMENT_PREFIX: Any +TRIM_BLOCKS: bool +LSTRIP_BLOCKS: bool +NEWLINE_SEQUENCE: str +KEEP_TRAILING_NEWLINE: bool +DEFAULT_NAMESPACE: Any + +# Names in __all__ with no definition: +# DEFAULT_FILTERS +# DEFAULT_TESTS diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/environment.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/environment.pyi new file mode 100644 index 00000000..29704c60 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/environment.pyi @@ -0,0 +1,169 @@ +import sys +from typing import Any, Callable, Dict, Iterator, List, Optional, Text, Type, Union + +from .bccache import BytecodeCache +from .loaders import BaseLoader +from .runtime import Context, Undefined + +if sys.version_info >= (3, 6): + from typing import Awaitable, AsyncIterator + +def get_spontaneous_environment(*args): ... +def create_cache(size): ... +def copy_cache(cache): ... +def load_extensions(environment, extensions): ... + +class Environment: + sandboxed: bool + overlayed: bool + linked_to: Any + shared: bool + exception_handler: Any + exception_formatter: Any + code_generator_class: Any + context_class: Any + block_start_string: Text + block_end_string: Text + variable_start_string: Text + variable_end_string: Text + comment_start_string: Text + comment_end_string: Text + line_statement_prefix: Text + line_comment_prefix: Text + trim_blocks: bool + lstrip_blocks: Any + newline_sequence: Text + keep_trailing_newline: bool + undefined: Type[Undefined] + optimized: bool + finalize: Callable[..., Any] + autoescape: Any + filters: Any + tests: Any + globals: Dict[str, Any] + loader: BaseLoader + cache: Any + bytecode_cache: BytecodeCache + auto_reload: bool + extensions: List[Any] + def __init__( + self, + block_start_string: Text = ..., + block_end_string: Text = ..., + variable_start_string: Text = ..., + variable_end_string: Text = ..., + comment_start_string: Any = ..., + comment_end_string: Text = ..., + line_statement_prefix: Text = ..., + line_comment_prefix: Text = ..., + trim_blocks: bool = ..., + lstrip_blocks: bool = ..., + newline_sequence: Text = ..., + keep_trailing_newline: bool = ..., + extensions: List[Any] = ..., + optimized: bool = ..., + undefined: Type[Undefined] = ..., + finalize: Optional[Callable[..., Any]] = ..., + autoescape: Union[bool, Callable[[str], bool]] = ..., + loader: Optional[BaseLoader] = ..., + cache_size: int = ..., + auto_reload: bool = ..., + bytecode_cache: Optional[BytecodeCache] = ..., + enable_async: bool = ..., + ) -> None: ... + def add_extension(self, extension): ... + def extend(self, **attributes): ... + def overlay( + self, + block_start_string: Text = ..., + block_end_string: Text = ..., + variable_start_string: Text = ..., + variable_end_string: Text = ..., + comment_start_string: Any = ..., + comment_end_string: Text = ..., + line_statement_prefix: Text = ..., + line_comment_prefix: Text = ..., + trim_blocks: bool = ..., + lstrip_blocks: bool = ..., + extensions: List[Any] = ..., + optimized: bool = ..., + undefined: Type[Undefined] = ..., + finalize: Callable[..., Any] = ..., + autoescape: bool = ..., + loader: Optional[BaseLoader] = ..., + cache_size: int = ..., + auto_reload: bool = ..., + bytecode_cache: Optional[BytecodeCache] = ..., + ): ... + lexer: Any + def iter_extensions(self): ... + def getitem(self, obj, argument): ... + def getattr(self, obj, attribute): ... + def call_filter(self, name, value, args: Optional[Any] = ..., kwargs: Optional[Any] = ..., context: Optional[Any] = ..., eval_ctx: Optional[Any] = ...): ... + def call_test(self, name, value, args: Optional[Any] = ..., kwargs: Optional[Any] = ...): ... + def parse(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ...): ... + def lex(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ...): ... + def preprocess(self, source: Text, name: Optional[Any] = ..., filename: Optional[Any] = ...): ... + def compile(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ..., raw: bool = ..., defer_init: bool = ...): ... + def compile_expression(self, source: Text, undefined_to_none: bool = ...): ... + def compile_templates(self, target, extensions: Optional[Any] = ..., filter_func: Optional[Any] = ..., zip: str = ..., log_function: Optional[Any] = ..., ignore_errors: bool = ..., py_compile: bool = ...): ... + def list_templates(self, extensions: Optional[Any] = ..., filter_func: Optional[Any] = ...): ... + def handle_exception(self, exc_info: Optional[Any] = ..., rendered: bool = ..., source_hint: Optional[Any] = ...): ... + def join_path(self, template: Union[Template, Text], parent: Text) -> Text: ... + def get_template(self, name: Union[Template, Text], parent: Optional[Text] = ..., globals: Optional[Any] = ...) -> Template: ... + def select_template(self, names: List[Union[Template, Text]], parent: Optional[Text] = ..., globals: Optional[Dict[str, Any]] = ...) -> Template: ... + def get_or_select_template(self, template_name_or_list: Union[Union[Template, Text], List[Union[Template, Text]]], parent: Optional[Text] = ..., globals: Optional[Dict[str, Any]] = ...) -> Template: ... + def from_string(self, source: Text, globals: Optional[Dict[str, Any]] = ..., template_class: Optional[Type[Template]] = ...) -> Template: ... + def make_globals(self, d: Optional[Dict[str, Any]]) -> Dict[str, Any]: ... + + # Frequently added extensions are included here: + # from InternationalizationExtension: + def install_gettext_translations(self, translations: Any, newstyle: Optional[bool]): ... + def install_null_translations(self, newstyle: Optional[bool]): ... + def install_gettext_callables(self, gettext: Callable[..., Any], ngettext: Callable[..., Any], newstyle: Optional[bool]): ... + def uninstall_gettext_translations(self, translations: Any): ... + def extract_translations(self, source: Any, gettext_functions: Any): ... + newstyle_gettext: bool + +class Template: + def __new__(cls, source, block_start_string: Any = ..., block_end_string: Any = ..., variable_start_string: Any = ..., variable_end_string: Any = ..., comment_start_string: Any = ..., comment_end_string: Any = ..., line_statement_prefix: Any = ..., line_comment_prefix: Any = ..., trim_blocks: Any = ..., lstrip_blocks: Any = ..., newline_sequence: Any = ..., keep_trailing_newline: Any = ..., extensions: Any = ..., optimized: bool = ..., undefined: Any = ..., finalize: Optional[Any] = ..., autoescape: bool = ...): ... + environment: Environment = ... + @classmethod + def from_code(cls, environment, code, globals, uptodate: Optional[Any] = ...): ... + @classmethod + def from_module_dict(cls, environment, module_dict, globals): ... + def render(self, *args, **kwargs) -> Text: ... + def stream(self, *args, **kwargs) -> TemplateStream: ... + def generate(self, *args, **kwargs) -> Iterator[Text]: ... + def new_context(self, vars: Optional[Dict[str, Any]] = ..., shared: bool = ..., locals: Optional[Dict[str, Any]] = ...) -> Context: ... + def make_module(self, vars: Optional[Dict[str, Any]] = ..., shared: bool = ..., locals: Optional[Dict[str, Any]] = ...) -> Context: ... + @property + def module(self) -> Any: ... + def get_corresponding_lineno(self, lineno): ... + @property + def is_up_to_date(self) -> bool: ... + @property + def debug_info(self): ... + + if sys.version_info >= (3, 6): + def render_async(self, *args, **kwargs) -> Awaitable[Text]: ... + def generate_async(self, *args, **kwargs) -> AsyncIterator[Text]: ... + + +class TemplateModule: + __name__: Any + def __init__(self, template, context) -> None: ... + def __html__(self): ... + +class TemplateExpression: + def __init__(self, template, undefined_to_none) -> None: ... + def __call__(self, *args, **kwargs): ... + +class TemplateStream: + def __init__(self, gen) -> None: ... + def dump(self, fp, encoding: Optional[Text] = ..., errors: Text = ...): ... + buffered: bool + def disable_buffering(self) -> None: ... + def enable_buffering(self, size: int = ...) -> None: ... + def __iter__(self): ... + def __next__(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/exceptions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/exceptions.pyi new file mode 100644 index 00000000..8f6be75c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/exceptions.pyi @@ -0,0 +1,31 @@ +from typing import Any, Optional, Text + +class TemplateError(Exception): + def __init__(self, message: Optional[Text] = ...) -> None: ... + @property + def message(self): ... + def __unicode__(self): ... + +class TemplateNotFound(IOError, LookupError, TemplateError): + message: Any + name: Any + templates: Any + def __init__(self, name, message: Optional[Text] = ...) -> None: ... + +class TemplatesNotFound(TemplateNotFound): + templates: Any + def __init__(self, names: Any = ..., message: Optional[Text] = ...) -> None: ... + +class TemplateSyntaxError(TemplateError): + lineno: int + name: Text + filename: Text + source: Text + translated: bool + def __init__(self, message: Text, lineno: int, name: Optional[Text] = ..., filename: Optional[Text] = ...) -> None: ... + +class TemplateAssertionError(TemplateSyntaxError): ... +class TemplateRuntimeError(TemplateError): ... +class UndefinedError(TemplateRuntimeError): ... +class SecurityError(TemplateRuntimeError): ... +class FilterArgumentError(TemplateRuntimeError): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/ext.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/ext.pyi new file mode 100644 index 00000000..28358603 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/ext.pyi @@ -0,0 +1,58 @@ +from typing import Any, Optional + +GETTEXT_FUNCTIONS: Any + +class ExtensionRegistry(type): + def __new__(cls, name, bases, d): ... + +class Extension: + tags: Any + priority: int + environment: Any + def __init__(self, environment) -> None: ... + def bind(self, environment): ... + def preprocess(self, source, name, filename: Optional[Any] = ...): ... + def filter_stream(self, stream): ... + def parse(self, parser): ... + def attr(self, name, lineno: Optional[Any] = ...): ... + def call_method(self, name, args: Optional[Any] = ..., kwargs: Optional[Any] = ..., dyn_args: Optional[Any] = ..., dyn_kwargs: Optional[Any] = ..., lineno: Optional[Any] = ...): ... + +class InternationalizationExtension(Extension): + tags: Any + def __init__(self, environment) -> None: ... + def parse(self, parser): ... + +class ExprStmtExtension(Extension): + tags: Any + def parse(self, parser): ... + +class LoopControlExtension(Extension): + tags: Any + def parse(self, parser): ... + +class WithExtension(Extension): + tags: Any + def parse(self, parser): ... + +class AutoEscapeExtension(Extension): + tags: Any + def parse(self, parser): ... + +def extract_from_ast(node, gettext_functions: Any = ..., babel_style: bool = ...): ... + +class _CommentFinder: + tokens: Any + comment_tags: Any + offset: int + last_lineno: int + def __init__(self, tokens, comment_tags) -> None: ... + def find_backwards(self, offset): ... + def find_comments(self, lineno): ... + +def babel_extract(fileobj, keywords, comment_tags, options): ... + +i18n: Any +do: Any +loopcontrols: Any +with_: Any +autoescape: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/filters.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/filters.pyi new file mode 100644 index 00000000..8f0fb210 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/filters.pyi @@ -0,0 +1,56 @@ +from typing import Any, NamedTuple, Optional + +def contextfilter(f): ... +def evalcontextfilter(f): ... +def environmentfilter(f): ... +def make_attrgetter(environment, attribute): ... +def do_forceescape(value): ... +def do_urlencode(value): ... +def do_replace(eval_ctx, s, old, new, count: Optional[Any] = ...): ... +def do_upper(s): ... +def do_lower(s): ... +def do_xmlattr(_eval_ctx, d, autospace: bool = ...): ... +def do_capitalize(s): ... +def do_title(s): ... +def do_dictsort(value, case_sensitive: bool = ..., by: str = ...): ... +def do_sort(environment, value, reverse: bool = ..., case_sensitive: bool = ..., attribute: Optional[Any] = ...): ... +def do_default(value, default_value: str = ..., boolean: bool = ...): ... +def do_join(eval_ctx, value, d: str = ..., attribute: Optional[Any] = ...): ... +def do_center(value, width: int = ...): ... +def do_first(environment, seq): ... +def do_last(environment, seq): ... +def do_random(environment, seq): ... +def do_filesizeformat(value, binary: bool = ...): ... +def do_pprint(value, verbose: bool = ...): ... +def do_urlize(eval_ctx, value, trim_url_limit: Optional[Any] = ..., nofollow: bool = ..., target: Optional[Any] = ...): ... +def do_indent(s, width: int = ..., indentfirst: bool = ...): ... +def do_truncate(s, length: int = ..., killwords: bool = ..., end: str = ...): ... +def do_wordwrap(environment, s, width: int = ..., break_long_words: bool = ..., wrapstring: Optional[Any] = ...): ... +def do_wordcount(s): ... +def do_int(value, default: int = ..., base: int = ...): ... +def do_float(value, default: float = ...): ... +def do_format(value, *args, **kwargs): ... +def do_trim(value): ... +def do_striptags(value): ... +def do_slice(value, slices, fill_with: Optional[Any] = ...): ... +def do_batch(value, linecount, fill_with: Optional[Any] = ...): ... +def do_round(value, precision: int = ..., method: str = ...): ... +def do_groupby(environment, value, attribute): ... + +class _GroupTuple(NamedTuple): + grouper: Any + list: Any + +def do_sum(environment, iterable, attribute: Optional[Any] = ..., start: int = ...): ... +def do_list(value): ... +def do_mark_safe(value): ... +def do_mark_unsafe(value): ... +def do_reverse(value): ... +def do_attr(environment, obj, name): ... +def do_map(*args, **kwargs): ... +def do_select(*args, **kwargs): ... +def do_reject(*args, **kwargs): ... +def do_selectattr(*args, **kwargs): ... +def do_rejectattr(*args, **kwargs): ... + +FILTERS: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/lexer.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/lexer.pyi new file mode 100644 index 00000000..88d80e69 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/lexer.pyi @@ -0,0 +1,117 @@ +from typing import Any, Optional, Tuple + +whitespace_re: Any +string_re: Any +integer_re: Any +name_re: Any +float_re: Any +newline_re: Any +TOKEN_ADD: Any +TOKEN_ASSIGN: Any +TOKEN_COLON: Any +TOKEN_COMMA: Any +TOKEN_DIV: Any +TOKEN_DOT: Any +TOKEN_EQ: Any +TOKEN_FLOORDIV: Any +TOKEN_GT: Any +TOKEN_GTEQ: Any +TOKEN_LBRACE: Any +TOKEN_LBRACKET: Any +TOKEN_LPAREN: Any +TOKEN_LT: Any +TOKEN_LTEQ: Any +TOKEN_MOD: Any +TOKEN_MUL: Any +TOKEN_NE: Any +TOKEN_PIPE: Any +TOKEN_POW: Any +TOKEN_RBRACE: Any +TOKEN_RBRACKET: Any +TOKEN_RPAREN: Any +TOKEN_SEMICOLON: Any +TOKEN_SUB: Any +TOKEN_TILDE: Any +TOKEN_WHITESPACE: Any +TOKEN_FLOAT: Any +TOKEN_INTEGER: Any +TOKEN_NAME: Any +TOKEN_STRING: Any +TOKEN_OPERATOR: Any +TOKEN_BLOCK_BEGIN: Any +TOKEN_BLOCK_END: Any +TOKEN_VARIABLE_BEGIN: Any +TOKEN_VARIABLE_END: Any +TOKEN_RAW_BEGIN: Any +TOKEN_RAW_END: Any +TOKEN_COMMENT_BEGIN: Any +TOKEN_COMMENT_END: Any +TOKEN_COMMENT: Any +TOKEN_LINESTATEMENT_BEGIN: Any +TOKEN_LINESTATEMENT_END: Any +TOKEN_LINECOMMENT_BEGIN: Any +TOKEN_LINECOMMENT_END: Any +TOKEN_LINECOMMENT: Any +TOKEN_DATA: Any +TOKEN_INITIAL: Any +TOKEN_EOF: Any +operators: Any +reverse_operators: Any +operator_re: Any +ignored_tokens: Any +ignore_if_empty: Any + +def describe_token(token): ... +def describe_token_expr(expr): ... +def count_newlines(value): ... +def compile_rules(environment): ... + +class Failure: + message: Any + error_class: Any + def __init__(self, message, cls: Any = ...) -> None: ... + def __call__(self, lineno, filename): ... + +class Token(Tuple[int, Any, Any]): + lineno: Any + type: Any + value: Any + def __new__(cls, lineno, type, value): ... + def test(self, expr): ... + def test_any(self, *iterable): ... + +class TokenStreamIterator: + stream: Any + def __init__(self, stream) -> None: ... + def __iter__(self): ... + def __next__(self): ... + +class TokenStream: + name: Any + filename: Any + closed: bool + current: Any + def __init__(self, generator, name, filename) -> None: ... + def __iter__(self): ... + def __bool__(self): ... + __nonzero__: Any + eos: Any + def push(self, token): ... + def look(self): ... + def skip(self, n: int = ...): ... + def next_if(self, expr): ... + def skip_if(self, expr): ... + def __next__(self): ... + def close(self): ... + def expect(self, expr): ... + +def get_lexer(environment): ... + +class Lexer: + newline_sequence: Any + keep_trailing_newline: Any + rules: Any + def __init__(self, environment) -> None: ... + def tokenize(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ..., state: Optional[Any] = ...): ... + def wrap(self, stream, name: Optional[Any] = ..., filename: Optional[Any] = ...): ... + def tokeniter(self, source, name, filename: Optional[Any] = ..., state: Optional[Any] = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/loaders.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/loaders.pyi new file mode 100644 index 00000000..95a8e3e9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/loaders.pyi @@ -0,0 +1,72 @@ +from typing import Any, Callable, Iterable, List, Optional, Text, Tuple, Union +from types import ModuleType + +from .environment import Environment + +def split_template_path(template: Text) -> List[Text]: ... + +class BaseLoader: + has_source_access: bool + def get_source(self, environment, template): ... + def list_templates(self): ... + def load(self, environment, name, globals: Optional[Any] = ...): ... + +class FileSystemLoader(BaseLoader): + searchpath: Text + encoding: Any + followlinks: Any + def __init__(self, searchpath: Union[Text, Iterable[Text]], encoding: Text = ..., followlinks: bool = ...) -> None: ... + def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable[..., Any]]: ... + def list_templates(self): ... + +class PackageLoader(BaseLoader): + encoding: Text + manager: Any + filesystem_bound: Any + provider: Any + package_path: Any + def __init__(self, package_name: Text, package_path: Text = ..., encoding: Text = ...) -> None: ... + def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable[..., Any]]: ... + def list_templates(self): ... + +class DictLoader(BaseLoader): + mapping: Any + def __init__(self, mapping) -> None: ... + def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable[..., Any]]: ... + def list_templates(self): ... + +class FunctionLoader(BaseLoader): + load_func: Any + def __init__(self, load_func) -> None: ... + def get_source( + self, environment: Environment, template: Text, + ) -> Tuple[Text, Optional[Text], Optional[Callable[..., Any]]]: ... + +class PrefixLoader(BaseLoader): + mapping: Any + delimiter: Any + def __init__(self, mapping, delimiter: str = ...) -> None: ... + def get_loader(self, template): ... + def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable[..., Any]]: ... + def load(self, environment, name, globals: Optional[Any] = ...): ... + def list_templates(self): ... + +class ChoiceLoader(BaseLoader): + loaders: Any + def __init__(self, loaders) -> None: ... + def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable[..., Any]]: ... + def load(self, environment, name, globals: Optional[Any] = ...): ... + def list_templates(self): ... + +class _TemplateModule(ModuleType): ... + +class ModuleLoader(BaseLoader): + has_source_access: bool + module: Any + package_name: Any + def __init__(self, path) -> None: ... + @staticmethod + def get_template_key(name): ... + @staticmethod + def get_module_filename(name): ... + def load(self, environment, name, globals: Optional[Any] = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/meta.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/meta.pyi new file mode 100644 index 00000000..46ca83b6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/meta.pyi @@ -0,0 +1,11 @@ +from typing import Any +from jinja2.compiler import CodeGenerator + +class TrackingCodeGenerator(CodeGenerator): + undeclared_identifiers: Any + def __init__(self, environment) -> None: ... + def write(self, x): ... + def pull_locals(self, frame): ... + +def find_undeclared_variables(ast): ... +def find_referenced_templates(ast): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/nodes.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/nodes.pyi new file mode 100644 index 00000000..4fb410d5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/nodes.pyi @@ -0,0 +1,250 @@ +from typing import Any, Optional + +class Impossible(Exception): ... + +class NodeType(type): + def __new__(cls, name, bases, d): ... + +class EvalContext: + environment: Any + autoescape: Any + volatile: bool + def __init__(self, environment, template_name: Optional[Any] = ...) -> None: ... + def save(self): ... + def revert(self, old): ... + +def get_eval_context(node, ctx): ... + +class Node: + fields: Any + attributes: Any + abstract: bool + def __init__(self, *fields, **attributes) -> None: ... + def iter_fields(self, exclude: Optional[Any] = ..., only: Optional[Any] = ...): ... + def iter_child_nodes(self, exclude: Optional[Any] = ..., only: Optional[Any] = ...): ... + def find(self, node_type): ... + def find_all(self, node_type): ... + def set_ctx(self, ctx): ... + def set_lineno(self, lineno, override: bool = ...): ... + def set_environment(self, environment): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + __hash__: Any + +class Stmt(Node): + abstract: bool + +class Helper(Node): + abstract: bool + +class Template(Node): + fields: Any + +class Output(Stmt): + fields: Any + +class Extends(Stmt): + fields: Any + +class For(Stmt): + fields: Any + +class If(Stmt): + fields: Any + +class Macro(Stmt): + fields: Any + +class CallBlock(Stmt): + fields: Any + +class FilterBlock(Stmt): + fields: Any + +class Block(Stmt): + fields: Any + +class Include(Stmt): + fields: Any + +class Import(Stmt): + fields: Any + +class FromImport(Stmt): + fields: Any + +class ExprStmt(Stmt): + fields: Any + +class Assign(Stmt): + fields: Any + +class AssignBlock(Stmt): + fields: Any + +class Expr(Node): + abstract: bool + def as_const(self, eval_ctx: Optional[Any] = ...): ... + def can_assign(self): ... + +class BinExpr(Expr): + fields: Any + operator: Any + abstract: bool + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class UnaryExpr(Expr): + fields: Any + operator: Any + abstract: bool + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Name(Expr): + fields: Any + def can_assign(self): ... + +class Literal(Expr): + abstract: bool + +class Const(Literal): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + @classmethod + def from_untrusted(cls, value, lineno: Optional[Any] = ..., environment: Optional[Any] = ...): ... + +class TemplateData(Literal): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Tuple(Literal): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + def can_assign(self): ... + +class List(Literal): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Dict(Literal): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Pair(Helper): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Keyword(Helper): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class CondExpr(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Filter(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Test(Expr): + fields: Any + +class Call(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Getitem(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + def can_assign(self): ... + +class Getattr(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + def can_assign(self): ... + +class Slice(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Concat(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Compare(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Operand(Helper): + fields: Any + +class Mul(BinExpr): + operator: str + +class Div(BinExpr): + operator: str + +class FloorDiv(BinExpr): + operator: str + +class Add(BinExpr): + operator: str + +class Sub(BinExpr): + operator: str + +class Mod(BinExpr): + operator: str + +class Pow(BinExpr): + operator: str + +class And(BinExpr): + operator: str + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Or(BinExpr): + operator: str + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class Not(UnaryExpr): + operator: str + +class Neg(UnaryExpr): + operator: str + +class Pos(UnaryExpr): + operator: str + +class EnvironmentAttribute(Expr): + fields: Any + +class ExtensionAttribute(Expr): + fields: Any + +class ImportedName(Expr): + fields: Any + +class InternalName(Expr): + fields: Any + def __init__(self) -> None: ... + +class MarkSafe(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class MarkSafeIfAutoescape(Expr): + fields: Any + def as_const(self, eval_ctx: Optional[Any] = ...): ... + +class ContextReference(Expr): ... +class Continue(Stmt): ... +class Break(Stmt): ... + +class Scope(Stmt): + fields: Any + +class EvalContextModifier(Stmt): + fields: Any + +class ScopedEvalContextModifier(EvalContextModifier): + fields: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/optimizer.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/optimizer.pyi new file mode 100644 index 00000000..b55b08aa --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/optimizer.pyi @@ -0,0 +1,29 @@ +from typing import Any +from jinja2.visitor import NodeTransformer + +def optimize(node, environment): ... + +class Optimizer(NodeTransformer): + environment: Any + def __init__(self, environment) -> None: ... + def visit_If(self, node): ... + def fold(self, node): ... + visit_Add: Any + visit_Sub: Any + visit_Mul: Any + visit_Div: Any + visit_FloorDiv: Any + visit_Pow: Any + visit_Mod: Any + visit_And: Any + visit_Or: Any + visit_Pos: Any + visit_Neg: Any + visit_Not: Any + visit_Compare: Any + visit_Getitem: Any + visit_Getattr: Any + visit_Call: Any + visit_Filter: Any + visit_Test: Any + visit_CondExpr: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/parser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/parser.pyi new file mode 100644 index 00000000..a16ae8d0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/parser.pyi @@ -0,0 +1,60 @@ +from typing import Any, Optional + +class Parser: + environment: Any + stream: Any + name: Any + filename: Any + closed: bool + extensions: Any + def __init__(self, environment, source, name: Optional[Any] = ..., filename: Optional[Any] = ..., state: Optional[Any] = ...) -> None: ... + def fail(self, msg, lineno: Optional[Any] = ..., exc: Any = ...): ... + def fail_unknown_tag(self, name, lineno: Optional[Any] = ...): ... + def fail_eof(self, end_tokens: Optional[Any] = ..., lineno: Optional[Any] = ...): ... + def is_tuple_end(self, extra_end_rules: Optional[Any] = ...): ... + def free_identifier(self, lineno: Optional[Any] = ...): ... + def parse_statement(self): ... + def parse_statements(self, end_tokens, drop_needle: bool = ...): ... + def parse_set(self): ... + def parse_for(self): ... + def parse_if(self): ... + def parse_block(self): ... + def parse_extends(self): ... + def parse_import_context(self, node, default): ... + def parse_include(self): ... + def parse_import(self): ... + def parse_from(self): ... + def parse_signature(self, node): ... + def parse_call_block(self): ... + def parse_filter_block(self): ... + def parse_macro(self): ... + def parse_print(self): ... + def parse_assign_target(self, with_tuple: bool = ..., name_only: bool = ..., extra_end_rules: Optional[Any] = ...): ... + def parse_expression(self, with_condexpr: bool = ...): ... + def parse_condexpr(self): ... + def parse_or(self): ... + def parse_and(self): ... + def parse_not(self): ... + def parse_compare(self): ... + def parse_add(self): ... + def parse_sub(self): ... + def parse_concat(self): ... + def parse_mul(self): ... + def parse_div(self): ... + def parse_floordiv(self): ... + def parse_mod(self): ... + def parse_pow(self): ... + def parse_unary(self, with_filter: bool = ...): ... + def parse_primary(self): ... + def parse_tuple(self, simplified: bool = ..., with_condexpr: bool = ..., extra_end_rules: Optional[Any] = ..., explicit_parentheses: bool = ...): ... + def parse_list(self): ... + def parse_dict(self): ... + def parse_postfix(self, node): ... + def parse_filter_expr(self, node): ... + def parse_subscript(self, node): ... + def parse_subscribed(self): ... + def parse_call(self, node): ... + def parse_filter(self, node, start_inline: bool = ...): ... + def parse_test(self, node): ... + def subparse(self, end_tokens: Optional[Any] = ...): ... + def parse(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/runtime.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/runtime.pyi new file mode 100644 index 00000000..271c0eff --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/runtime.pyi @@ -0,0 +1,130 @@ +from typing import Any, Dict, Optional, Text, Union +from jinja2.utils import Markup as Markup, escape as escape, missing as missing, concat as concat +from jinja2.exceptions import TemplateRuntimeError as TemplateRuntimeError, TemplateNotFound as TemplateNotFound + +from jinja2.environment import Environment + +to_string: Any +identity: Any + +def markup_join(seq): ... +def unicode_join(seq): ... + +class TemplateReference: + def __init__(self, context) -> None: ... + def __getitem__(self, name): ... + +class Context: + parent: Union[Context, Dict[str, Any]] + vars: Dict[str, Any] + environment: Environment + eval_ctx: Any + exported_vars: Any + name: Text + blocks: Dict[str, Any] + def __init__(self, environment: Environment, parent: Union[Context, Dict[str, Any]], name: Text, blocks: Dict[str, Any]) -> None: ... + def super(self, name, current): ... + def get(self, key, default: Optional[Any] = ...): ... + def resolve(self, key): ... + def get_exported(self): ... + def get_all(self): ... + def call(__self, __obj, *args, **kwargs): ... + def derived(self, locals: Optional[Any] = ...): ... + keys: Any + values: Any + items: Any + iterkeys: Any + itervalues: Any + iteritems: Any + def __contains__(self, name): ... + def __getitem__(self, key): ... + +class BlockReference: + name: Any + def __init__(self, name, context, stack, depth) -> None: ... + @property + def super(self): ... + def __call__(self): ... + +class LoopContext: + index0: int + depth0: Any + def __init__(self, iterable, recurse: Optional[Any] = ..., depth0: int = ...) -> None: ... + def cycle(self, *args): ... + first: Any + last: Any + index: Any + revindex: Any + revindex0: Any + depth: Any + def __len__(self): ... + def __iter__(self): ... + def loop(self, iterable): ... + __call__: Any + @property + def length(self): ... + +class LoopContextIterator: + context: Any + def __init__(self, context) -> None: ... + def __iter__(self): ... + def __next__(self): ... + +class Macro: + name: Any + arguments: Any + defaults: Any + catch_kwargs: Any + catch_varargs: Any + caller: Any + def __init__(self, environment, func, name, arguments, defaults, catch_kwargs, catch_varargs, caller) -> None: ... + def __call__(self, *args, **kwargs): ... + +class Undefined: + def __init__(self, hint: Optional[Any] = ..., obj: Any = ..., name: Optional[Any] = ..., exc: Any = ...) -> None: ... + def __getattr__(self, name): ... + __add__: Any + __radd__: Any + __mul__: Any + __rmul__: Any + __div__: Any + __rdiv__: Any + __truediv__: Any + __rtruediv__: Any + __floordiv__: Any + __rfloordiv__: Any + __mod__: Any + __rmod__: Any + __pos__: Any + __neg__: Any + __call__: Any + __getitem__: Any + __lt__: Any + __le__: Any + __gt__: Any + __ge__: Any + __int__: Any + __float__: Any + __complex__: Any + __pow__: Any + __rpow__: Any + def __eq__(self, other): ... + def __ne__(self, other): ... + def __hash__(self): ... + def __len__(self): ... + def __iter__(self): ... + def __nonzero__(self): ... + __bool__: Any + +def make_logging_undefined(logger: Optional[Any] = ..., base: Optional[Any] = ...): ... + +class DebugUndefined(Undefined): ... + +class StrictUndefined(Undefined): + __iter__: Any + __len__: Any + __nonzero__: Any + __eq__: Any + __ne__: Any + __bool__: Any + __hash__: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/sandbox.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/sandbox.pyi new file mode 100644 index 00000000..518deca5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/sandbox.pyi @@ -0,0 +1,34 @@ +from typing import Any +from jinja2.environment import Environment + +MAX_RANGE: int +UNSAFE_FUNCTION_ATTRIBUTES: Any +UNSAFE_METHOD_ATTRIBUTES: Any +UNSAFE_GENERATOR_ATTRIBUTES: Any + +def safe_range(*args): ... +def unsafe(f): ... +def is_internal_attribute(obj, attr): ... +def modifies_known_mutable(obj, attr): ... + +class SandboxedEnvironment(Environment): + sandboxed: bool + default_binop_table: Any + default_unop_table: Any + intercepted_binops: Any + intercepted_unops: Any + def intercept_unop(self, operator): ... + binop_table: Any + unop_table: Any + def __init__(self, *args, **kwargs) -> None: ... + def is_safe_attribute(self, obj, attr, value): ... + def is_safe_callable(self, obj): ... + def call_binop(self, context, operator, left, right): ... + def call_unop(self, context, operator, arg): ... + def getitem(self, obj, argument): ... + def getattr(self, obj, attribute): ... + def unsafe_undefined(self, obj, attribute): ... + def call(__self, __context, __obj, *args, **kwargs): ... + +class ImmutableSandboxedEnvironment(SandboxedEnvironment): + def is_safe_attribute(self, obj, attr, value): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/tests.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/tests.pyi new file mode 100644 index 00000000..2645fe9f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/tests.pyi @@ -0,0 +1,24 @@ +from typing import Any + +number_re: Any +regex_type: Any +test_callable: Any + +def test_odd(value): ... +def test_even(value): ... +def test_divisibleby(value, num): ... +def test_defined(value): ... +def test_undefined(value): ... +def test_none(value): ... +def test_lower(value): ... +def test_upper(value): ... +def test_string(value): ... +def test_mapping(value): ... +def test_number(value): ... +def test_sequence(value): ... +def test_equalto(value, other): ... +def test_sameas(value, other): ... +def test_iterable(value): ... +def test_escaped(value): ... + +TESTS: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/utils.pyi new file mode 100644 index 00000000..bf5ff835 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/utils.pyi @@ -0,0 +1,61 @@ +from typing import Any, Callable, Iterable, Optional + +from markupsafe import Markup as Markup, escape as escape, soft_unicode as soft_unicode + +missing: Any +internal_code: Any +concat: Any + +def contextfunction(f): ... +def evalcontextfunction(f): ... +def environmentfunction(f): ... +def internalcode(f): ... +def is_undefined(obj): ... +def select_autoescape(enabled_extensions: Iterable[str] = ..., disabled_extensions: Iterable[str] = ..., default_for_string: bool = ..., default: bool = ...) -> Callable[[str], bool]: ... +def consume(iterable): ... +def clear_caches(): ... +def import_string(import_name, silent: bool = ...): ... +def open_if_exists(filename, mode: str = ...): ... +def object_type_repr(obj): ... +def pformat(obj, verbose: bool = ...): ... +def urlize(text, trim_url_limit: Optional[Any] = ..., nofollow: bool = ..., target: Optional[Any] = ...): ... +def generate_lorem_ipsum(n: int = ..., html: bool = ..., min: int = ..., max: int = ...): ... +def unicode_urlencode(obj, charset: str = ..., for_qs: bool = ...): ... + +class LRUCache: + capacity: Any + def __init__(self, capacity) -> None: ... + def __getnewargs__(self): ... + def copy(self): ... + def get(self, key, default: Optional[Any] = ...): ... + def setdefault(self, key, default: Optional[Any] = ...): ... + def clear(self): ... + def __contains__(self, key): ... + def __len__(self): ... + def __getitem__(self, key): ... + def __setitem__(self, key, value): ... + def __delitem__(self, key): ... + def items(self): ... + def iteritems(self): ... + def values(self): ... + def itervalue(self): ... + def keys(self): ... + def iterkeys(self): ... + __iter__: Any + def __reversed__(self): ... + __copy__: Any + +class Cycler: + items: Any + def __init__(self, *items) -> None: ... + pos: int + def reset(self): ... + @property + def current(self): ... + def __next__(self): ... + +class Joiner: + sep: Any + used: bool + def __init__(self, sep: str = ...) -> None: ... + def __call__(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/visitor.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/visitor.pyi new file mode 100644 index 00000000..ef34328d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/jinja2/visitor.pyi @@ -0,0 +1,8 @@ +class NodeVisitor: + def get_visitor(self, node): ... + def visit(self, node, *args, **kwargs): ... + def generic_visit(self, node, *args, **kwargs): ... + +class NodeTransformer(NodeVisitor): + def generic_visit(self, node, *args, **kwargs): ... + def visit_list(self, node, *args, **kwargs): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/markupsafe/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/markupsafe/__init__.pyi new file mode 100644 index 00000000..6bedd247 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/markupsafe/__init__.pyi @@ -0,0 +1,53 @@ +import sys + +from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence, Text, Tuple, Union +from collections import Mapping +from markupsafe._compat import text_type +import string +from markupsafe._native import escape as escape, escape_silent as escape_silent, soft_unicode as soft_unicode + +class Markup(text_type): + def __new__(cls, base: Text = ..., encoding: Optional[Text] = ..., errors: Text = ...) -> Markup: ... + def __html__(self) -> Markup: ... + def __add__(self, other: text_type) -> Markup: ... + def __radd__(self, other: text_type) -> Markup: ... + def __mul__(self, num: int) -> Markup: ... + def __rmul__(self, num: int) -> Markup: ... + def __mod__(self, *args: Any) -> Markup: ... + def join(self, seq: Iterable[text_type]): ... + def split(self, sep: Optional[text_type] = ..., maxsplit: int = ...) -> List[text_type]: ... + def rsplit(self, sep: Optional[text_type] = ..., maxsplit: int = ...) -> List[text_type]: ... + def splitlines(self, keepends: bool = ...) -> List[text_type]: ... + def unescape(self) -> Text: ... + def striptags(self) -> Text: ... + @classmethod + def escape(cls, s: text_type) -> Markup: ... + def partition(self, sep: text_type) -> Tuple[Markup, Markup, Markup]: ... + def rpartition(self, sep: text_type) -> Tuple[Markup, Markup, Markup]: ... + def format(self, *args, **kwargs) -> Markup: ... + def __html_format__(self, format_spec) -> Markup: ... + def __getslice__(self, start: int, stop: int) -> Markup: ... + def __getitem__(self, i: Union[int, slice]) -> Markup: ... + def capitalize(self) -> Markup: ... + def title(self) -> Markup: ... + def lower(self) -> Markup: ... + def upper(self) -> Markup: ... + def swapcase(self) -> Markup: ... + def replace(self, old: text_type, new: text_type, count: int = ...) -> Markup: ... + def ljust(self, width: int, fillchar: text_type = ...) -> Markup: ... + def rjust(self, width: int, fillchar: text_type = ...) -> Markup: ... + def lstrip(self, chars: Optional[text_type] = ...) -> Markup: ... + def rstrip(self, chars: Optional[text_type] = ...) -> Markup: ... + def strip(self, chars: Optional[text_type] = ...) -> Markup: ... + def center(self, width: int, fillchar: text_type = ...) -> Markup: ... + def zfill(self, width: int) -> Markup: ... + def translate(self, table: Union[Mapping[int, Union[int, text_type, None]], Sequence[Union[int, text_type, None]]]) -> Markup: ... + def expandtabs(self, tabsize: int = ...) -> Markup: ... + +class EscapeFormatter(string.Formatter): + escape: Callable[[text_type], Markup] + def __init__(self, escape: Callable[[text_type], Markup]) -> None: ... + def format_field(self, value: text_type, format_spec: text_type) -> Markup: ... + +if sys.version_info >= (3,): + soft_str = soft_unicode diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/markupsafe/_compat.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/markupsafe/_compat.pyi new file mode 100644 index 00000000..9ca94010 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/markupsafe/_compat.pyi @@ -0,0 +1,19 @@ +import sys + +from typing import Any, Iterator, Mapping, Text, Tuple, TypeVar + +_K = TypeVar('_K') +_V = TypeVar('_V') + +PY2: bool +def iteritems(d: Mapping[_K, _V]) -> Iterator[Tuple[_K, _V]]: ... +if sys.version_info >= (3,): + text_type = str + string_types = str, + unichr = chr + int_types = int, +else: + from __builtin__ import unichr as unichr + text_type = unicode + string_types = (str, unicode) + int_types = (int, long) diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/markupsafe/_constants.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/markupsafe/_constants.pyi new file mode 100644 index 00000000..a0d67ed7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/markupsafe/_constants.pyi @@ -0,0 +1,3 @@ +from typing import Any, Dict, Text + +HTML_ENTITIES: Dict[Text, int] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/markupsafe/_native.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/markupsafe/_native.pyi new file mode 100644 index 00000000..ecf20c60 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/markupsafe/_native.pyi @@ -0,0 +1,7 @@ +from . import Markup +from ._compat import text_type, string_types +from typing import Union, Text + +def escape(s: Union[Markup, Text]) -> Markup: ... +def escape_silent(s: Union[None, Markup, Text]) -> Markup: ... +def soft_unicode(s: Text) -> text_type: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/markupsafe/_speedups.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/markupsafe/_speedups.pyi new file mode 100644 index 00000000..ecf20c60 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/markupsafe/_speedups.pyi @@ -0,0 +1,7 @@ +from . import Markup +from ._compat import text_type, string_types +from typing import Union, Text + +def escape(s: Union[Markup, Text]) -> Markup: ... +def escape_silent(s: Union[None, Markup, Text]) -> Markup: ... +def soft_unicode(s: Text) -> text_type: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/__init__.pyi new file mode 100644 index 00000000..fe20a1f4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/__init__.pyi @@ -0,0 +1,7 @@ +from typing import Text + +from maxminddb import reader + +def open_database(database: Text, mode: int = ...) -> reader.Reader: ... + +def Reader(database: Text) -> reader.Reader: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/compat.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/compat.pyi new file mode 100644 index 00000000..ca8e3ab2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/compat.pyi @@ -0,0 +1,8 @@ +from ipaddress import IPv4Address, IPv6Address + +from typing import Any + +def compat_ip_address(address: object) -> Any: ... +def int_from_byte(x: int) -> int: ... +def int_from_bytes(x: bytes) -> int: ... +def byte_from_int(x: int) -> bytes: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/const.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/const.pyi new file mode 100644 index 00000000..e1cff069 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/const.pyi @@ -0,0 +1,6 @@ +MODE_AUTO: int = ... +MODE_MMAP_EXT: int = ... +MODE_MMAP: int = ... +MODE_FILE: int = ... +MODE_MEMORY: int = ... +MODE_FD: int = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/decoder.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/decoder.pyi new file mode 100644 index 00000000..e2bc38ad --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/decoder.pyi @@ -0,0 +1,5 @@ +from typing import Any, Tuple + +class Decoder: + def __init__(self, database_buffer: bytes, pointer_base: int = ..., pointer_test: bool = ...) -> None: ... + def decode(self, offset: int) -> Tuple[Any, int]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/errors.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/errors.pyi new file mode 100644 index 00000000..e98b5560 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/errors.pyi @@ -0,0 +1 @@ +class InvalidDatabaseError(RuntimeError): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/extension.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/extension.pyi new file mode 100644 index 00000000..de4423c3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/extension.pyi @@ -0,0 +1,33 @@ +from typing import Any, Mapping, Sequence, Text + +from maxminddb.errors import InvalidDatabaseError as InvalidDatabaseError + +class Reader: + closed: bool = ... + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + def close(self, *args: Any, **kwargs: Any) -> Any: ... + def get(self, *args: Any, **kwargs: Any) -> Any: ... + def metadata(self, *args: Any, **kwargs: Any) -> Any: ... + def __enter__(self, *args: Any, **kwargs: Any) -> Any: ... + def __exit__(self, *args: Any, **kwargs: Any) -> Any: ... + +class extension: + @property + def node_count(self) -> int: ... + @property + def record_size(self) -> int: ... + @property + def ip_version(self) -> int: ... + @property + def database_type(self) -> Text: ... + @property + def languages(self) -> Sequence[Text]: ... + @property + def binary_format_major_version(self) -> int: ... + @property + def binary_format_minor_version(self) -> int: ... + @property + def build_epoch(self) -> int: ... + @property + def description(self) -> Mapping[Text, Text]: ... + def __init__(self, **kwargs: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/reader.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/reader.pyi new file mode 100644 index 00000000..882a4987 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/maxminddb/reader.pyi @@ -0,0 +1,30 @@ +from ipaddress import IPv4Address, IPv6Address + +from types import TracebackType +from typing import Any, Mapping, Optional, Sequence, Text, Tuple, Type, Union + +class Reader: + closed: bool = ... + def __init__(self, database: bytes, mode: int = ...) -> None: ... + def metadata(self) -> Metadata: ... + def get(self, ip_address: Union[Text, IPv4Address, IPv6Address]) -> Optional[Any]: ... + def get_with_prefix_len(self, ip_address: Union[Text, IPv4Address, IPv6Address]) -> Tuple[Optional[Any], int]: ... + def close(self) -> None: ... + def __enter__(self) -> Reader: ... + def __exit__(self, exc_type: Optional[Type[BaseException]] = ..., exc_val: Optional[BaseException] = ..., exc_tb: Optional[TracebackType] = ...) -> None: ... + +class Metadata: + node_count: int = ... + record_size: int = ... + ip_version: int = ... + database_type: Text = ... + languages: Sequence[Text] = ... + binary_format_major_version: int = ... + binary_format_minor_version: int = ... + build_epoch: int = ... + description: Mapping[Text, Text] = ... + def __init__(self, **kwargs: Any) -> None: ... + @property + def node_byte_size(self) -> int: ... + @property + def search_tree_size(self) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/mock.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/mock.pyi new file mode 100644 index 00000000..396d806b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/mock.pyi @@ -0,0 +1,150 @@ +# Stubs for mock + +import sys +from typing import Any, List, Optional, Text, Tuple, Type, TypeVar + +_T = TypeVar("_T") + +FILTER_DIR: Any + +class _slotted: ... + +class _SentinelObject: + name: Any + def __init__(self, name: Any) -> None: ... + +class _Sentinel: + def __init__(self) -> None: ... + def __getattr__(self, name: str) -> Any: ... + +sentinel: Any +DEFAULT: Any + +class _CallList(List[_T]): + def __contains__(self, value: Any) -> bool: ... + +class _MockIter: + obj: Any + def __init__(self, obj: Any) -> None: ... + def __iter__(self) -> Any: ... + def __next__(self) -> Any: ... + +class Base: + def __init__(self, *args: Any, **kwargs: Any) -> None: ... + +# TODO: Defining this and other mock classes as classes in this stub causes +# many false positives with mypy and production code. See if we can +# improve mypy somehow and use a class with an "Any" base class. +NonCallableMock = Any + +class CallableMixin(Base): + side_effect: Any + def __init__(self, spec: Optional[Any] = ..., side_effect: Optional[Any] = ..., return_value: Any = ..., wraps: Optional[Any] = ..., name: Optional[Any] = ..., spec_set: Optional[Any] = ..., parent: Optional[Any] = ..., _spec_state: Optional[Any] = ..., _new_name: Any = ..., _new_parent: Optional[Any] = ..., **kwargs: Any) -> None: ... + def __call__(_mock_self, *args: Any, **kwargs: Any) -> Any: ... + +Mock = Any + +class _patch: + attribute_name: Any + getter: Any + attribute: Any + new: Any + new_callable: Any + spec: Any + create: bool + has_local: Any + spec_set: Any + autospec: Any + kwargs: Any + additional_patchers: Any + def __init__(self, getter: Any, attribute: Any, new: Any, spec: Any, create: Any, spec_set: Any, autospec: Any, new_callable: Any, kwargs: Any) -> None: ... + def copy(self) -> Any: ... + def __call__(self, func: Any) -> Any: ... + def decorate_class(self, klass: Any) -> Any: ... + def decorate_callable(self, func: Any) -> Any: ... + def get_original(self) -> Any: ... + target: Any + temp_original: Any + is_local: Any + def __enter__(self) -> Any: ... + def __exit__(self, *exc_info: Any) -> Any: ... + def start(self) -> Any: ... + def stop(self) -> Any: ... + +class _patch_dict: + in_dict: Any + values: Any + clear: Any + def __init__(self, in_dict: Any, values: Any = ..., clear: Any = ..., **kwargs: Any) -> None: ... + def __call__(self, f: Any) -> Any: ... + def decorate_class(self, klass: Any) -> Any: ... + def __enter__(self) -> Any: ... + def __exit__(self, *args: Any) -> Any: ... + start: Any + stop: Any + +class _patcher: + TEST_PREFIX: str + dict: Type[_patch_dict] + def __call__(self, target: Any, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... + def object(self, target: Any, attribute: Text, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... + def multiple(self, target: Any, spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ... + def stopall(self) -> None: ... + +patch: _patcher + +class MagicMixin: + def __init__(self, *args: Any, **kw: Any) -> None: ... + +NonCallableMagicMock = Any +MagicMock = Any +if sys.version_info >= (3, 8): + AsyncMock = Any + +class MagicProxy: + name: Any + parent: Any + def __init__(self, name: Any, parent: Any) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def create_mock(self) -> Any: ... + def __get__(self, obj: Any, _type: Optional[Any] = ...) -> Any: ... + +class _ANY: + def __eq__(self, other: Any) -> bool: ... + def __ne__(self, other: Any) -> bool: ... + +ANY: Any + +class _Call(Tuple[Any, ...]): + def __new__(cls, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ...) -> Any: ... + name: Any + parent: Any + from_kall: Any + def __init__(self, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ...) -> None: ... + def __eq__(self, other: Any) -> bool: ... + __ne__: Any + def __call__(self, *args: Any, **kwargs: Any) -> Any: ... + def __getattr__(self, attr: Any) -> Any: ... + def count(self, *args: Any, **kwargs: Any) -> Any: ... + def index(self, *args: Any, **kwargs: Any) -> Any: ... + def call_list(self) -> Any: ... + +call: Any + +def create_autospec(spec: Any, spec_set: Any = ..., instance: Any = ..., _parent: Optional[Any] = ..., _name: Optional[Any] = ..., **kwargs: Any) -> Any: ... + +class _SpecState: + spec: Any + ids: Any + spec_set: Any + parent: Any + instance: Any + name: Any + def __init__(self, spec: Any, spec_set: Any = ..., parent: Optional[Any] = ..., name: Optional[Any] = ..., ids: Optional[Any] = ..., instance: Any = ...) -> None: ... + +def mock_open(mock: Optional[Any] = ..., read_data: Any = ...) -> Any: ... + +PropertyMock = Any + +if sys.version_info >= (3, 7): + def seal(mock: Any) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/mypy_extensions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/mypy_extensions.pyi new file mode 100644 index 00000000..19d99cc9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/mypy_extensions.pyi @@ -0,0 +1,47 @@ +import abc +import sys +from typing import ( + Dict, Type, TypeVar, Optional, Union, Any, Generic, Mapping, ItemsView, KeysView, ValuesView, + Callable, +) + +_T = TypeVar('_T') +_U = TypeVar('_U') + +# Internal mypy fallback type for all typed dicts (does not exist at runtime) +class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): + def copy(self: _T) -> _T: ... + # Using NoReturn so that only calls using mypy plugin hook that specialize the signature + # can go through. + def setdefault(self, k: NoReturn, default: object) -> object: ... + # Mypy plugin hook for 'pop' expects that 'default' has a type variable type. + def pop(self, k: NoReturn, default: _T = ...) -> object: ... + def update(self: _T, __m: _T) -> None: ... + if sys.version_info < (3, 0): + def has_key(self, k: str) -> bool: ... + def viewitems(self) -> ItemsView[str, object]: ... + def viewkeys(self) -> KeysView[str]: ... + def viewvalues(self) -> ValuesView[object]: ... + def __delitem__(self, k: NoReturn) -> None: ... + +def TypedDict(typename: str, fields: Dict[str, Type[_T]], total: bool = ...) -> Type[Dict[str, Any]]: ... + +def Arg(type: _T = ..., name: Optional[str] = ...) -> _T: ... +def DefaultArg(type: _T = ..., name: Optional[str] = ...) -> _T: ... +def NamedArg(type: _T = ..., name: Optional[str] = ...) -> _T: ... +def DefaultNamedArg(type: _T = ..., name: Optional[str] = ...) -> _T: ... +def VarArg(type: _T = ...) -> _T: ... +def KwArg(type: _T = ...) -> _T: ... + +# Return type that indicates a function does not return. +# This type is equivalent to the None type, but the no-op Union is necessary to +# distinguish the None type from the None value. +NoReturn = Union[None] # Deprecated: Use typing.NoReturn instead. + +# This is intended as a class decorator, but mypy rejects abstract classes +# when a Type[_T] is expected, so we can't give it the type we want +def trait(cls: Any) -> Any: ... + +def mypyc_attr(*attrs: str, **kwattrs: object) -> Callable[[_T], _T]: ... + +class FlexibleAlias(Generic[_T, _U]): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pycurl.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pycurl.pyi new file mode 100644 index 00000000..ec70d764 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pycurl.pyi @@ -0,0 +1,604 @@ +# TODO(MichalPokorny): more precise types + +from typing import Any, List, Tuple + +GLOBAL_ACK_EINTR: int +GLOBAL_ALL: int +GLOBAL_DEFAULT: int +GLOBAL_NOTHING: int +GLOBAL_SSL: int +GLOBAL_WIN32: int + +def global_init(option: int) -> None: ... +def global_cleanup() -> None: ... + +version: str + +def version_info() -> Tuple[int, str, int, str, int, str, int, str, Tuple[str, ...], Any, int, Any]: ... + +class error(Exception): ... + +class Curl(object): + def close(self) -> None: ... + def setopt(self, option: int, value: Any) -> None: ... + def perform(self) -> None: ... + def getinfo(self, info: Any) -> Any: ... + def reset(self) -> None: ... + def unsetopt(self, option: int) -> Any: ... + def pause(self, bitmask: Any) -> Any: ... + def errstr(self) -> str: ... + + # TODO(MichalPokorny): wat? + USERPWD: int + +class CurlMulti(object): + def close(self) -> None: ... + def add_handle(self, obj: Curl) -> None: ... + def remove_handle(self, obj: Curl) -> None: ... + def perform(self) -> Tuple[Any, int]: ... + def fdset(self) -> Tuple[List[Any], List[Any], List[Any]]: ... + def select(self, timeout: float = ...) -> int: ... + def info_read(self, max_objects: int = ...) -> Tuple[int, List[Any], List[Any]]: ... + +class CurlShare(object): + def close(self) -> None: ... + def setopt(self, option: int, value: Any) -> Any: ... + +ACCEPTTIMEOUT_MS: int +ACCEPT_ENCODING: int +ADDRESS_SCOPE: int +APPCONNECT_TIME: int +APPEND: int +AUTOREFERER: int +BUFFERSIZE: int +CAINFO: int +CAPATH: int +CLOSESOCKETFUNCTION: int +COMPILE_DATE: str +COMPILE_LIBCURL_VERSION_NUM: int +COMPILE_PY_VERSION_HEX: int +CONDITION_UNMET: int +CONNECTTIMEOUT: int +CONNECTTIMEOUT_MS: int +CONNECT_ONLY: int +CONNECT_TIME: int +CONTENT_LENGTH_DOWNLOAD: int +CONTENT_LENGTH_UPLOAD: int +CONTENT_TYPE: int +COOKIE: int +COOKIEFILE: int +COOKIEJAR: int +COOKIELIST: int +COOKIESESSION: int +COPYPOSTFIELDS: int +CRLF: int +CRLFILE: int +CSELECT_ERR: int +CSELECT_IN: int +CSELECT_OUT: int +CURL_HTTP_VERSION_1_0: int +CURL_HTTP_VERSION_1_1: int +CURL_HTTP_VERSION_2: int +CURL_HTTP_VERSION_2_0: int +CURL_HTTP_VERSION_LAST: int +CURL_HTTP_VERSION_NONE: int +CUSTOMREQUEST: int +DEBUGFUNCTION: int +DIRLISTONLY: int +DNS_CACHE_TIMEOUT: int +DNS_SERVERS: int +DNS_USE_GLOBAL_CACHE: int +EFFECTIVE_URL: int +EGDSOCKET: int +ENCODING: int +EXPECT_100_TIMEOUT_MS: int +FAILONERROR: int +FILE: int +FOLLOWLOCATION: int +FORBID_REUSE: int +FORM_BUFFER: int +FORM_BUFFERPTR: int +FORM_CONTENTS: int +FORM_CONTENTTYPE: int +FORM_FILE: int +FORM_FILENAME: int +FRESH_CONNECT: int +FTPAPPEND: int +FTPAUTH_DEFAULT: int +FTPAUTH_SSL: int +FTPAUTH_TLS: int +FTPLISTONLY: int +FTPMETHOD_DEFAULT: int +FTPMETHOD_MULTICWD: int +FTPMETHOD_NOCWD: int +FTPMETHOD_SINGLECWD: int +FTPPORT: int +FTPSSLAUTH: int +FTPSSL_ALL: int +FTPSSL_CONTROL: int +FTPSSL_NONE: int +FTPSSL_TRY: int +FTP_ACCOUNT: int +FTP_ALTERNATIVE_TO_USER: int +FTP_CREATE_MISSING_DIRS: int +FTP_ENTRY_PATH: int +FTP_FILEMETHOD: int +FTP_RESPONSE_TIMEOUT: int +FTP_SKIP_PASV_IP: int +FTP_SSL: int +FTP_SSL_CCC: int +FTP_USE_EPRT: int +FTP_USE_EPSV: int +FTP_USE_PRET: int +GSSAPI_DELEGATION: int +GSSAPI_DELEGATION_FLAG: int +GSSAPI_DELEGATION_NONE: int +GSSAPI_DELEGATION_POLICY_FLAG: int +HEADER: int +HEADERFUNCTION: int +HEADEROPT: int +HEADER_SEPARATE: int +HEADER_SIZE: int +HEADER_UNIFIED: int +HTTP200ALIASES: int +HTTPAUTH: int +HTTPAUTH_ANY: int +HTTPAUTH_ANYSAFE: int +HTTPAUTH_AVAIL: int +HTTPAUTH_BASIC: int +HTTPAUTH_DIGEST: int +HTTPAUTH_DIGEST_IE: int +HTTPAUTH_GSSNEGOTIATE: int +HTTPAUTH_NEGOTIATE: int +HTTPAUTH_NONE: int +HTTPAUTH_NTLM: int +HTTPAUTH_NTLM_WB: int +HTTPAUTH_ONLY: int +HTTPGET: int +HTTPHEADER: int +HTTPPOST: int +HTTPPROXYTUNNEL: int +HTTP_CODE: int +HTTP_CONNECTCODE: int +HTTP_CONTENT_DECODING: int +HTTP_TRANSFER_DECODING: int +HTTP_VERSION: int +IGNORE_CONTENT_LENGTH: int +INFILE: int +INFILESIZE: int +INFILESIZE_LARGE: int +INFOTYPE_DATA_IN: int +INFOTYPE_DATA_OUT: int +INFOTYPE_HEADER_IN: int +INFOTYPE_HEADER_OUT: int +INFOTYPE_SSL_DATA_IN: int +INFOTYPE_SSL_DATA_OUT: int +INFOTYPE_TEXT: int +INFO_CERTINFO: int +INFO_COOKIELIST: int +INFO_FILETIME: int +INFO_RTSP_CLIENT_CSEQ: int +INFO_RTSP_CSEQ_RECV: int +INFO_RTSP_SERVER_CSEQ: int +INFO_RTSP_SESSION_ID: int +INTERFACE: int +IOCMD_NOP: int +IOCMD_RESTARTREAD: int +IOCTLDATA: int +IOCTLFUNCTION: int +IOE_FAILRESTART: int +IOE_OK: int +IOE_UNKNOWNCMD: int +IPRESOLVE: int +IPRESOLVE_V4: int +IPRESOLVE_V6: int +IPRESOLVE_WHATEVER: int +ISSUERCERT: int +KEYPASSWD: int +KHMATCH_MISMATCH: int +KHMATCH_MISSING: int +KHMATCH_OK: int +KHSTAT_DEFER: int +KHSTAT_FINE: int +KHSTAT_FINE_ADD_TO_FILE: int +KHSTAT_REJECT: int +KHTYPE_DSS: int +KHTYPE_RSA: int +KHTYPE_RSA1: int +KHTYPE_UNKNOWN: int +KRB4LEVEL: int +KRBLEVEL: int +LASTSOCKET: int +LOCALPORT: int +LOCALPORTRANGE: int +LOCAL_IP: int +LOCAL_PORT: int +LOCK_DATA_COOKIE: int +LOCK_DATA_DNS: int +LOCK_DATA_SSL_SESSION: int +LOGIN_OPTIONS: int +LOW_SPEED_LIMIT: int +LOW_SPEED_TIME: int +MAIL_AUTH: int +MAIL_FROM: int +MAIL_RCPT: int +MAXCONNECTS: int +MAXFILESIZE: int +MAXFILESIZE_LARGE: int +MAXREDIRS: int +MAX_RECV_SPEED_LARGE: int +MAX_SEND_SPEED_LARGE: int +M_CHUNK_LENGTH_PENALTY_SIZE: int +M_CONTENT_LENGTH_PENALTY_SIZE: int +M_MAXCONNECTS: int +M_MAX_HOST_CONNECTIONS: int +M_MAX_PIPELINE_LENGTH: int +M_MAX_TOTAL_CONNECTIONS: int +M_PIPELINING: int +M_PIPELINING_SERVER_BL: int +M_PIPELINING_SITE_BL: int +M_SOCKETFUNCTION: int +M_TIMERFUNCTION: int +NAMELOOKUP_TIME: int +NETRC: int +NETRC_FILE: int +NETRC_IGNORED: int +NETRC_OPTIONAL: int +NETRC_REQUIRED: int +NEW_DIRECTORY_PERMS: int +NEW_FILE_PERMS: int +NOBODY: int +NOPROGRESS: int +NOPROXY: int +NOSIGNAL: int +NUM_CONNECTS: int +OPENSOCKETFUNCTION: int +OPT_CERTINFO: int +OPT_FILETIME: int +OS_ERRNO: int +PASSWORD: int +PATH_AS_IS: int +PAUSE_ALL: int +PAUSE_CONT: int +PAUSE_RECV: int +PAUSE_SEND: int +PINNEDPUBLICKEY: int +PIPEWAIT: int +PIPE_HTTP1: int +PIPE_MULTIPLEX: int +PIPE_NOTHING: int +POLL_IN: int +POLL_INOUT: int +POLL_NONE: int +POLL_OUT: int +POLL_REMOVE: int +PORT: int +POST: int +POST301: int +POSTFIELDS: int +POSTFIELDSIZE: int +POSTFIELDSIZE_LARGE: int +POSTQUOTE: int +POSTREDIR: int +PREQUOTE: int +PRETRANSFER_TIME: int +PRIMARY_IP: int +PRIMARY_PORT: int +PROGRESSFUNCTION: int +PROTOCOLS: int +PROTO_ALL: int +PROTO_DICT: int +PROTO_FILE: int +PROTO_FTP: int +PROTO_FTPS: int +PROTO_GOPHER: int +PROTO_HTTP: int +PROTO_HTTPS: int +PROTO_IMAP: int +PROTO_IMAPS: int +PROTO_LDAP: int +PROTO_LDAPS: int +PROTO_POP3: int +PROTO_POP3S: int +PROTO_RTMP: int +PROTO_RTMPE: int +PROTO_RTMPS: int +PROTO_RTMPT: int +PROTO_RTMPTE: int +PROTO_RTMPTS: int +PROTO_RTSP: int +PROTO_SCP: int +PROTO_SFTP: int +PROTO_SMB: int +PROTO_SMBS: int +PROTO_SMTP: int +PROTO_SMTPS: int +PROTO_TELNET: int +PROTO_TFTP: int +PROXY: int +PROXYAUTH: int +PROXYAUTH_AVAIL: int +PROXYHEADER: int +PROXYPASSWORD: int +PROXYPORT: int +PROXYTYPE: int +PROXYTYPE_HTTP: int +PROXYTYPE_HTTP_1_0: int +PROXYTYPE_SOCKS4: int +PROXYTYPE_SOCKS4A: int +PROXYTYPE_SOCKS5: int +PROXYTYPE_SOCKS5_HOSTNAME: int +PROXYUSERNAME: int +PROXYUSERPWD: int +PROXY_SERVICE_NAME: int +PROXY_TRANSFER_MODE: int +PUT: int +QUOTE: int +RANDOM_FILE: int +RANGE: int +READDATA: int +READFUNCTION: int +READFUNC_ABORT: int +READFUNC_PAUSE: int +REDIRECT_COUNT: int +REDIRECT_TIME: int +REDIRECT_URL: int +REDIR_POST_301: int +REDIR_POST_302: int +REDIR_POST_303: int +REDIR_POST_ALL: int +REDIR_PROTOCOLS: int +REFERER: int +REQUEST_SIZE: int +RESOLVE: int +RESPONSE_CODE: int +RESUME_FROM: int +RESUME_FROM_LARGE: int +SASL_IR: int +SEEKFUNCTION: int +SEEKFUNC_CANTSEEK: int +SEEKFUNC_FAIL: int +SEEKFUNC_OK: int +SERVICE_NAME: int +SHARE: int +SH_SHARE: int +SH_UNSHARE: int +SIZE_DOWNLOAD: int +SIZE_UPLOAD: int +SOCKET_TIMEOUT: int +SOCKOPTFUNCTION: int +SOCKOPT_ALREADY_CONNECTED: int +SOCKOPT_ERROR: int +SOCKOPT_OK: int +SOCKS5_GSSAPI_NEC: int +SOCKS5_GSSAPI_SERVICE: int +SOCKTYPE_ACCEPT: int +SOCKTYPE_IPCXN: int +SPEED_DOWNLOAD: int +SPEED_UPLOAD: int +SSH_AUTH_ANY: int +SSH_AUTH_DEFAULT: int +SSH_AUTH_HOST: int +SSH_AUTH_KEYBOARD: int +SSH_AUTH_NONE: int +SSH_AUTH_PASSWORD: int +SSH_AUTH_PUBLICKEY: int +SSH_AUTH_TYPES: int +SSH_HOST_PUBLIC_KEY_MD5: int +SSH_KEYFUNCTION: int +SSH_KNOWNHOSTS: int +SSH_PRIVATE_KEYFILE: int +SSH_PUBLIC_KEYFILE: int +SSLCERT: int +SSLCERTPASSWD: int +SSLCERTTYPE: int +SSLENGINE: int +SSLENGINE_DEFAULT: int +SSLKEY: int +SSLKEYPASSWD: int +SSLKEYTYPE: int +SSLOPT_ALLOW_BEAST: int +SSLVERSION: int +SSLVERSION_DEFAULT: int +SSLVERSION_SSLv2: int +SSLVERSION_SSLv3: int +SSLVERSION_TLSv1: int +SSLVERSION_TLSv1_0: int +SSLVERSION_TLSv1_1: int +SSLVERSION_TLSv1_2: int +SSL_CIPHER_LIST: int +SSL_ENABLE_ALPN: int +SSL_ENABLE_NPN: int +SSL_ENGINES: int +SSL_FALSESTART: int +SSL_OPTIONS: int +SSL_SESSIONID_CACHE: int +SSL_VERIFYHOST: int +SSL_VERIFYPEER: int +SSL_VERIFYRESULT: int +SSL_VERIFYSTATUS: int +STARTTRANSFER_TIME: int +STDERR: int +TCP_KEEPALIVE: int +TCP_KEEPIDLE: int +TCP_KEEPINTVL: int +TCP_NODELAY: int +TELNETOPTIONS: int +TFTP_BLKSIZE: int +TIMECONDITION: int +TIMECONDITION_IFMODSINCE: int +TIMECONDITION_IFUNMODSINCE: int +TIMECONDITION_LASTMOD: int +TIMECONDITION_NONE: int +TIMEOUT: int +TIMEOUT_MS: int +TIMEVALUE: int +TLSAUTH_PASSWORD: int +TLSAUTH_TYPE: int +TLSAUTH_USERNAME: int +TOTAL_TIME: int +TRANSFERTEXT: int +TRANSFER_ENCODING: int +UNIX_SOCKET_PATH: int +UNRESTRICTED_AUTH: int +UPLOAD: int +URL: int +USERAGENT: int +USERNAME: int +USERPWD: int +USESSL_ALL: int +USESSL_CONTROL: int +USESSL_NONE: int +USESSL_TRY: int +USE_SSL: int +VERBOSE: int +VERSION_ASYNCHDNS: int +VERSION_CONV: int +VERSION_CURLDEBUG: int +VERSION_DEBUG: int +VERSION_GSSAPI: int +VERSION_GSSNEGOTIATE: int +VERSION_HTTP2: int +VERSION_IDN: int +VERSION_IPV6: int +VERSION_KERBEROS4: int +VERSION_KERBEROS5: int +VERSION_LARGEFILE: int +VERSION_LIBZ: int +VERSION_NTLM: int +VERSION_NTLM_WB: int +VERSION_SPNEGO: int +VERSION_SSL: int +VERSION_SSPI: int +VERSION_TLSAUTH_SRP: int +VERSION_UNIX_SOCKETS: int +WILDCARDMATCH: int +WRITEDATA: int +WRITEFUNCTION: int +WRITEFUNC_PAUSE: int +WRITEHEADER: int +XFERINFOFUNCTION: int +XOAUTH2_BEARER: int + +E_ABORTED_BY_CALLBACK: int +E_AGAIN: int +E_ALREADY_COMPLETE: int +E_BAD_CALLING_ORDER: int +E_BAD_CONTENT_ENCODING: int +E_BAD_DOWNLOAD_RESUME: int +E_BAD_FUNCTION_ARGUMENT: int +E_BAD_PASSWORD_ENTERED: int +E_CALL_MULTI_PERFORM: int +E_CHUNK_FAILED: int +E_CONV_FAILED: int +E_CONV_REQD: int +E_COULDNT_CONNECT: int +E_COULDNT_RESOLVE_HOST: int +E_COULDNT_RESOLVE_PROXY: int +E_FAILED_INIT: int +E_FILESIZE_EXCEEDED: int +E_FILE_COULDNT_READ_FILE: int +E_FTP_ACCEPT_FAILED: int +E_FTP_ACCEPT_TIMEOUT: int +E_FTP_ACCESS_DENIED: int +E_FTP_BAD_DOWNLOAD_RESUME: int +E_FTP_BAD_FILE_LIST: int +E_FTP_CANT_GET_HOST: int +E_FTP_CANT_RECONNECT: int +E_FTP_COULDNT_GET_SIZE: int +E_FTP_COULDNT_RETR_FILE: int +E_FTP_COULDNT_SET_ASCII: int +E_FTP_COULDNT_SET_BINARY: int +E_FTP_COULDNT_SET_TYPE: int +E_FTP_COULDNT_STOR_FILE: int +E_FTP_COULDNT_USE_REST: int +E_FTP_PARTIAL_FILE: int +E_FTP_PORT_FAILED: int +E_FTP_PRET_FAILED: int +E_FTP_QUOTE_ERROR: int +E_FTP_SSL_FAILED: int +E_FTP_USER_PASSWORD_INCORRECT: int +E_FTP_WEIRD_227_FORMAT: int +E_FTP_WEIRD_PASS_REPLY: int +E_FTP_WEIRD_PASV_REPLY: int +E_FTP_WEIRD_SERVER_REPLY: int +E_FTP_WEIRD_USER_REPLY: int +E_FTP_WRITE_ERROR: int +E_FUNCTION_NOT_FOUND: int +E_GOT_NOTHING: int +E_HTTP2: int +E_HTTP_NOT_FOUND: int +E_HTTP_PORT_FAILED: int +E_HTTP_POST_ERROR: int +E_HTTP_RANGE_ERROR: int +E_HTTP_RETURNED_ERROR: int +E_INTERFACE_FAILED: int +E_LDAP_CANNOT_BIND: int +E_LDAP_INVALID_URL: int +E_LDAP_SEARCH_FAILED: int +E_LIBRARY_NOT_FOUND: int +E_LOGIN_DENIED: int +E_MALFORMAT_USER: int +E_MULTI_ADDED_ALREADY: int +E_MULTI_BAD_EASY_HANDLE: int +E_MULTI_BAD_HANDLE: int +E_MULTI_BAD_SOCKET: int +E_MULTI_CALL_MULTI_PERFORM: int +E_MULTI_CALL_MULTI_SOCKET: int +E_MULTI_INTERNAL_ERROR: int +E_MULTI_OK: int +E_MULTI_OUT_OF_MEMORY: int +E_MULTI_UNKNOWN_OPTION: int +E_NOT_BUILT_IN: int +E_NO_CONNECTION_AVAILABLE: int +E_OK: int +E_OPERATION_TIMEDOUT: int +E_OPERATION_TIMEOUTED: int +E_OUT_OF_MEMORY: int +E_PARTIAL_FILE: int +E_PEER_FAILED_VERIFICATION: int +E_QUOTE_ERROR: int +E_RANGE_ERROR: int +E_READ_ERROR: int +E_RECV_ERROR: int +E_REMOTE_ACCESS_DENIED: int +E_REMOTE_DISK_FULL: int +E_REMOTE_FILE_EXISTS: int +E_REMOTE_FILE_NOT_FOUND: int +E_RTSP_CSEQ_ERROR: int +E_RTSP_SESSION_ERROR: int +E_SEND_ERROR: int +E_SEND_FAIL_REWIND: int +E_SHARE_IN_USE: int +E_SSH: int +E_SSL_CACERT: int +E_SSL_CACERT_BADFILE: int +E_SSL_CERTPROBLEM: int +E_SSL_CIPHER: int +E_SSL_CONNECT_ERROR: int +E_SSL_CRL_BADFILE: int +E_SSL_ENGINE_INITFAILED: int +E_SSL_ENGINE_NOTFOUND: int +E_SSL_ENGINE_SETFAILED: int +E_SSL_INVALIDCERTSTATUS: int +E_SSL_ISSUER_ERROR: int +E_SSL_PEER_CERTIFICATE: int +E_SSL_PINNEDPUBKEYNOTMATCH: int +E_SSL_SHUTDOWN_FAILED: int +E_TELNET_OPTION_SYNTAX: int +E_TFTP_DISKFULL: int +E_TFTP_EXISTS: int +E_TFTP_ILLEGAL: int +E_TFTP_NOSUCHUSER: int +E_TFTP_NOTFOUND: int +E_TFTP_PERM: int +E_TFTP_UNKNOWNID: int +E_TOO_MANY_REDIRECTS: int +E_UNKNOWN_OPTION: int +E_UNKNOWN_TELNET_OPTION: int +E_UNSUPPORTED_PROTOCOL: int +E_UPLOAD_FAILED: int +E_URL_MALFORMAT: int +E_URL_MALFORMAT_USER: int +E_USE_SSL_FAILED: int +E_WRITE_ERROR: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/__init__.pyi new file mode 100644 index 00000000..523c6014 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/__init__.pyi @@ -0,0 +1,61 @@ +import sys +from typing import Union, Tuple, Callable, FrozenSet + +from .connections import Connection as _Connection +from .constants import FIELD_TYPE as FIELD_TYPE +from .converters import escape_dict as escape_dict, escape_sequence as escape_sequence, escape_string as escape_string +from .err import ( + Warning as Warning, + Error as Error, + InterfaceError as InterfaceError, + DataError as DataError, + DatabaseError as DatabaseError, + OperationalError as OperationalError, + IntegrityError as IntegrityError, + InternalError as InternalError, + NotSupportedError as NotSupportedError, + ProgrammingError as ProgrammingError, + MySQLError as MySQLError, +) +from .times import ( + Date as Date, + Time as Time, + Timestamp as Timestamp, + DateFromTicks as DateFromTicks, + TimeFromTicks as TimeFromTicks, + TimestampFromTicks as TimestampFromTicks, +) + +threadsafety: int +apilevel: str +paramstyle: str + +class DBAPISet(FrozenSet[int]): + def __ne__(self, other) -> bool: ... + def __eq__(self, other) -> bool: ... + def __hash__(self) -> int: ... + +STRING: DBAPISet +BINARY: DBAPISet +NUMBER: DBAPISet +DATE: DBAPISet +TIME: DBAPISet +TIMESTAMP: DBAPISet +DATETIME: DBAPISet +ROWID: DBAPISet + +if sys.version_info >= (3, 0): + def Binary(x) -> bytes: ... +else: + def Binary(x) -> bytearray: ... +def Connect(*args, **kwargs) -> _Connection: ... +def get_client_info() -> str: ... + +connect: Callable[..., _Connection] +Connection: Callable[..., _Connection] +__version__: str +version_info: Tuple[int, int, int, str, int] +NULL: str + +def thread_safe() -> bool: ... +def install_as_MySQLdb() -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/charset.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/charset.pyi new file mode 100644 index 00000000..c47679a7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/charset.pyi @@ -0,0 +1,16 @@ +from typing import Any + +MBLENGTH: Any + +class Charset: + is_default: Any + def __init__(self, id, name, collation, is_default): ... + +class Charsets: + def __init__(self): ... + def add(self, c): ... + def by_id(self, id): ... + def by_name(self, name): ... + +def charset_by_name(name): ... +def charset_by_id(id): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/connections.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/connections.pyi new file mode 100644 index 00000000..47e00a47 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/connections.pyi @@ -0,0 +1,145 @@ +from typing import Any, Optional, Type +from .charset import MBLENGTH as MBLENGTH, charset_by_name as charset_by_name, charset_by_id as charset_by_id +from .cursors import Cursor as Cursor +from .constants import FIELD_TYPE as FIELD_TYPE, FLAG as FLAG +from .constants import SERVER_STATUS as SERVER_STATUS +from .constants import CLIENT as CLIENT +from .constants import COMMAND as COMMAND +from .util import join_bytes as join_bytes, byte2int as byte2int, int2byte as int2byte +from .converters import escape_item as escape_item, encoders as encoders, decoders as decoders +from .err import raise_mysql_exception as raise_mysql_exception, Warning as Warning, Error as Error, InterfaceError as InterfaceError, DataError as DataError, DatabaseError as DatabaseError, OperationalError as OperationalError, IntegrityError as IntegrityError, InternalError as InternalError, NotSupportedError as NotSupportedError, ProgrammingError as ProgrammingError + +sha_new: Any +SSL_ENABLED: Any +DEFAULT_USER: Any +DEBUG: Any +NULL_COLUMN: Any +UNSIGNED_CHAR_COLUMN: Any +UNSIGNED_SHORT_COLUMN: Any +UNSIGNED_INT24_COLUMN: Any +UNSIGNED_INT64_COLUMN: Any +UNSIGNED_CHAR_LENGTH: Any +UNSIGNED_SHORT_LENGTH: Any +UNSIGNED_INT24_LENGTH: Any +UNSIGNED_INT64_LENGTH: Any +DEFAULT_CHARSET: Any + +def dump_packet(data): ... + +SCRAMBLE_LENGTH_323: Any + +class RandStruct_323: + max_value: Any + seed1: Any + seed2: Any + def __init__(self, seed1, seed2): ... + def my_rnd(self): ... + +def pack_int24(n): ... +def unpack_uint16(n): ... +def unpack_int24(n): ... +def unpack_int32(n): ... +def unpack_int64(n): ... +def defaulterrorhandler(connection, cursor, errorclass, errorvalue): ... + +class MysqlPacket: + connection: Any + def __init__(self, connection): ... + def packet_number(self): ... + def get_all_data(self): ... + def read(self, size): ... + def read_all(self): ... + def advance(self, length): ... + def rewind(self, position: int = ...): ... + def peek(self, size): ... + def get_bytes(self, position, length: int = ...): ... + def read_length_coded_binary(self): ... + def read_length_coded_string(self): ... + def is_ok_packet(self): ... + def is_eof_packet(self): ... + def is_resultset_packet(self): ... + def is_error_packet(self): ... + def check_error(self): ... + def dump(self): ... + +class FieldDescriptorPacket(MysqlPacket): + def __init__(self, *args): ... + def description(self): ... + def get_column_length(self): ... + +class Connection: + errorhandler: Any + ssl: Any + host: Any + port: Any + user: Any + password: Any + db: Any + unix_socket: Any + charset: Any + use_unicode: Any + client_flag: Any + cursorclass: Any + connect_timeout: Any + messages: Any + encoders: Any + decoders: Any + host_info: Any + def __init__(self, host: str = ..., user: Optional[Any] = ..., passwd: str = ..., db: Optional[Any] = ..., + port: int = ..., unix_socket: Optional[Any] = ..., charset: str = ..., sql_mode: Optional[Any] = ..., + read_default_file: Optional[Any] = ..., conv=..., use_unicode: Optional[Any] = ..., client_flag: int = ..., + cursorclass=..., init_command: Optional[Any] = ..., connect_timeout: Optional[Any] = ..., + ssl: Optional[Any] = ..., read_default_group: Optional[Any] = ..., compress: Optional[Any] = ..., + named_pipe: Optional[Any] = ...): ... + socket: Any + rfile: Any + wfile: Any + def close(self) -> None: ... + def autocommit(self, value): ... + def commit(self): ... + def begin(self) -> None: ... + def rollback(self): ... + def escape(self, obj): ... + def literal(self, obj): ... + def cursor(self, cursor: Optional[Type[Cursor]] = ...) -> Cursor: ... + def __enter__(self): ... + def __exit__(self, exc, value, traceback): ... + def query(self, sql): ... + def next_result(self, unbuffered: bool = ...): ... + def affected_rows(self): ... + def kill(self, thread_id): ... + def ping(self, reconnect: bool = ...): ... + def set_charset(self, charset): ... + def read_packet(self, packet_type=...): ... + def insert_id(self): ... + def thread_id(self): ... + def character_set_name(self): ... + def get_host_info(self): ... + def get_proto_info(self): ... + def get_server_info(self): ... + def show_warnings(self): ... + Warning: Any + Error: Any + InterfaceError: Any + DatabaseError: Any + DataError: Any + OperationalError: Any + IntegrityError: Any + InternalError: Any + ProgrammingError: Any + NotSupportedError: Any + +class MySQLResult: + connection: Any + affected_rows: Any + insert_id: Any + server_status: Any + warning_count: Any + message: Any + field_count: Any + description: Any + rows: Any + has_next: Any + def __init__(self, connection): ... + first_packet: Any + def read(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/CLIENT.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/CLIENT.pyi new file mode 100644 index 00000000..ac8fb551 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/CLIENT.pyi @@ -0,0 +1,18 @@ +LONG_PASSWORD: int +FOUND_ROWS: int +LONG_FLAG: int +CONNECT_WITH_DB: int +NO_SCHEMA: int +COMPRESS: int +ODBC: int +LOCAL_FILES: int +IGNORE_SPACE: int +PROTOCOL_41: int +INTERACTIVE: int +SSL: int +IGNORE_SIGPIPE: int +TRANSACTIONS: int +SECURE_CONNECTION: int +MULTI_STATEMENTS: int +MULTI_RESULTS: int +CAPABILITIES: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/COMMAND.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/COMMAND.pyi new file mode 100644 index 00000000..1163e6b4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/COMMAND.pyi @@ -0,0 +1,22 @@ +COM_SLEEP: int +COM_QUIT: int +COM_INIT_DB: int +COM_QUERY: int +COM_FIELD_LIST: int +COM_CREATE_DB: int +COM_DROP_DB: int +COM_REFRESH: int +COM_SHUTDOWN: int +COM_STATISTICS: int +COM_PROCESS_INFO: int +COM_CONNECT: int +COM_PROCESS_KILL: int +COM_DEBUG: int +COM_PING: int +COM_TIME: int +COM_DELAYED_INSERT: int +COM_CHANGE_USER: int +COM_BINLOG_DUMP: int +COM_TABLE_DUMP: int +COM_CONNECT_OUT: int +COM_REGISTER_SLAVE: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/ER.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/ER.pyi new file mode 100644 index 00000000..5f0a432e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/ER.pyi @@ -0,0 +1,471 @@ +ERROR_FIRST: int +HASHCHK: int +NISAMCHK: int +NO: int +YES: int +CANT_CREATE_FILE: int +CANT_CREATE_TABLE: int +CANT_CREATE_DB: int +DB_CREATE_EXISTS: int +DB_DROP_EXISTS: int +DB_DROP_DELETE: int +DB_DROP_RMDIR: int +CANT_DELETE_FILE: int +CANT_FIND_SYSTEM_REC: int +CANT_GET_STAT: int +CANT_GET_WD: int +CANT_LOCK: int +CANT_OPEN_FILE: int +FILE_NOT_FOUND: int +CANT_READ_DIR: int +CANT_SET_WD: int +CHECKREAD: int +DISK_FULL: int +DUP_KEY: int +ERROR_ON_CLOSE: int +ERROR_ON_READ: int +ERROR_ON_RENAME: int +ERROR_ON_WRITE: int +FILE_USED: int +FILSORT_ABORT: int +FORM_NOT_FOUND: int +GET_ERRNO: int +ILLEGAL_HA: int +KEY_NOT_FOUND: int +NOT_FORM_FILE: int +NOT_KEYFILE: int +OLD_KEYFILE: int +OPEN_AS_READONLY: int +OUTOFMEMORY: int +OUT_OF_SORTMEMORY: int +UNEXPECTED_EOF: int +CON_COUNT_ERROR: int +OUT_OF_RESOURCES: int +BAD_HOST_ERROR: int +HANDSHAKE_ERROR: int +DBACCESS_DENIED_ERROR: int +ACCESS_DENIED_ERROR: int +NO_DB_ERROR: int +UNKNOWN_COM_ERROR: int +BAD_NULL_ERROR: int +BAD_DB_ERROR: int +TABLE_EXISTS_ERROR: int +BAD_TABLE_ERROR: int +NON_UNIQ_ERROR: int +SERVER_SHUTDOWN: int +BAD_FIELD_ERROR: int +WRONG_FIELD_WITH_GROUP: int +WRONG_GROUP_FIELD: int +WRONG_SUM_SELECT: int +WRONG_VALUE_COUNT: int +TOO_LONG_IDENT: int +DUP_FIELDNAME: int +DUP_KEYNAME: int +DUP_ENTRY: int +WRONG_FIELD_SPEC: int +PARSE_ERROR: int +EMPTY_QUERY: int +NONUNIQ_TABLE: int +INVALID_DEFAULT: int +MULTIPLE_PRI_KEY: int +TOO_MANY_KEYS: int +TOO_MANY_KEY_PARTS: int +TOO_LONG_KEY: int +KEY_COLUMN_DOES_NOT_EXITS: int +BLOB_USED_AS_KEY: int +TOO_BIG_FIELDLENGTH: int +WRONG_AUTO_KEY: int +READY: int +NORMAL_SHUTDOWN: int +GOT_SIGNAL: int +SHUTDOWN_COMPLETE: int +FORCING_CLOSE: int +IPSOCK_ERROR: int +NO_SUCH_INDEX: int +WRONG_FIELD_TERMINATORS: int +BLOBS_AND_NO_TERMINATED: int +TEXTFILE_NOT_READABLE: int +FILE_EXISTS_ERROR: int +LOAD_INFO: int +ALTER_INFO: int +WRONG_SUB_KEY: int +CANT_REMOVE_ALL_FIELDS: int +CANT_DROP_FIELD_OR_KEY: int +INSERT_INFO: int +UPDATE_TABLE_USED: int +NO_SUCH_THREAD: int +KILL_DENIED_ERROR: int +NO_TABLES_USED: int +TOO_BIG_SET: int +NO_UNIQUE_LOGFILE: int +TABLE_NOT_LOCKED_FOR_WRITE: int +TABLE_NOT_LOCKED: int +BLOB_CANT_HAVE_DEFAULT: int +WRONG_DB_NAME: int +WRONG_TABLE_NAME: int +TOO_BIG_SELECT: int +UNKNOWN_ERROR: int +UNKNOWN_PROCEDURE: int +WRONG_PARAMCOUNT_TO_PROCEDURE: int +WRONG_PARAMETERS_TO_PROCEDURE: int +UNKNOWN_TABLE: int +FIELD_SPECIFIED_TWICE: int +INVALID_GROUP_FUNC_USE: int +UNSUPPORTED_EXTENSION: int +TABLE_MUST_HAVE_COLUMNS: int +RECORD_FILE_FULL: int +UNKNOWN_CHARACTER_SET: int +TOO_MANY_TABLES: int +TOO_MANY_FIELDS: int +TOO_BIG_ROWSIZE: int +STACK_OVERRUN: int +WRONG_OUTER_JOIN: int +NULL_COLUMN_IN_INDEX: int +CANT_FIND_UDF: int +CANT_INITIALIZE_UDF: int +UDF_NO_PATHS: int +UDF_EXISTS: int +CANT_OPEN_LIBRARY: int +CANT_FIND_DL_ENTRY: int +FUNCTION_NOT_DEFINED: int +HOST_IS_BLOCKED: int +HOST_NOT_PRIVILEGED: int +PASSWORD_ANONYMOUS_USER: int +PASSWORD_NOT_ALLOWED: int +PASSWORD_NO_MATCH: int +UPDATE_INFO: int +CANT_CREATE_THREAD: int +WRONG_VALUE_COUNT_ON_ROW: int +CANT_REOPEN_TABLE: int +INVALID_USE_OF_NULL: int +REGEXP_ERROR: int +MIX_OF_GROUP_FUNC_AND_FIELDS: int +NONEXISTING_GRANT: int +TABLEACCESS_DENIED_ERROR: int +COLUMNACCESS_DENIED_ERROR: int +ILLEGAL_GRANT_FOR_TABLE: int +GRANT_WRONG_HOST_OR_USER: int +NO_SUCH_TABLE: int +NONEXISTING_TABLE_GRANT: int +NOT_ALLOWED_COMMAND: int +SYNTAX_ERROR: int +DELAYED_CANT_CHANGE_LOCK: int +TOO_MANY_DELAYED_THREADS: int +ABORTING_CONNECTION: int +NET_PACKET_TOO_LARGE: int +NET_READ_ERROR_FROM_PIPE: int +NET_FCNTL_ERROR: int +NET_PACKETS_OUT_OF_ORDER: int +NET_UNCOMPRESS_ERROR: int +NET_READ_ERROR: int +NET_READ_INTERRUPTED: int +NET_ERROR_ON_WRITE: int +NET_WRITE_INTERRUPTED: int +TOO_LONG_STRING: int +TABLE_CANT_HANDLE_BLOB: int +TABLE_CANT_HANDLE_AUTO_INCREMENT: int +DELAYED_INSERT_TABLE_LOCKED: int +WRONG_COLUMN_NAME: int +WRONG_KEY_COLUMN: int +WRONG_MRG_TABLE: int +DUP_UNIQUE: int +BLOB_KEY_WITHOUT_LENGTH: int +PRIMARY_CANT_HAVE_NULL: int +TOO_MANY_ROWS: int +REQUIRES_PRIMARY_KEY: int +NO_RAID_COMPILED: int +UPDATE_WITHOUT_KEY_IN_SAFE_MODE: int +KEY_DOES_NOT_EXITS: int +CHECK_NO_SUCH_TABLE: int +CHECK_NOT_IMPLEMENTED: int +CANT_DO_THIS_DURING_AN_TRANSACTION: int +ERROR_DURING_COMMIT: int +ERROR_DURING_ROLLBACK: int +ERROR_DURING_FLUSH_LOGS: int +ERROR_DURING_CHECKPOINT: int +NEW_ABORTING_CONNECTION: int +DUMP_NOT_IMPLEMENTED: int +FLUSH_MASTER_BINLOG_CLOSED: int +INDEX_REBUILD: int +MASTER: int +MASTER_NET_READ: int +MASTER_NET_WRITE: int +FT_MATCHING_KEY_NOT_FOUND: int +LOCK_OR_ACTIVE_TRANSACTION: int +UNKNOWN_SYSTEM_VARIABLE: int +CRASHED_ON_USAGE: int +CRASHED_ON_REPAIR: int +WARNING_NOT_COMPLETE_ROLLBACK: int +TRANS_CACHE_FULL: int +SLAVE_MUST_STOP: int +SLAVE_NOT_RUNNING: int +BAD_SLAVE: int +MASTER_INFO: int +SLAVE_THREAD: int +TOO_MANY_USER_CONNECTIONS: int +SET_CONSTANTS_ONLY: int +LOCK_WAIT_TIMEOUT: int +LOCK_TABLE_FULL: int +READ_ONLY_TRANSACTION: int +DROP_DB_WITH_READ_LOCK: int +CREATE_DB_WITH_READ_LOCK: int +WRONG_ARGUMENTS: int +NO_PERMISSION_TO_CREATE_USER: int +UNION_TABLES_IN_DIFFERENT_DIR: int +LOCK_DEADLOCK: int +TABLE_CANT_HANDLE_FT: int +CANNOT_ADD_FOREIGN: int +NO_REFERENCED_ROW: int +ROW_IS_REFERENCED: int +CONNECT_TO_MASTER: int +QUERY_ON_MASTER: int +ERROR_WHEN_EXECUTING_COMMAND: int +WRONG_USAGE: int +WRONG_NUMBER_OF_COLUMNS_IN_SELECT: int +CANT_UPDATE_WITH_READLOCK: int +MIXING_NOT_ALLOWED: int +DUP_ARGUMENT: int +USER_LIMIT_REACHED: int +SPECIFIC_ACCESS_DENIED_ERROR: int +LOCAL_VARIABLE: int +GLOBAL_VARIABLE: int +NO_DEFAULT: int +WRONG_VALUE_FOR_VAR: int +WRONG_TYPE_FOR_VAR: int +VAR_CANT_BE_READ: int +CANT_USE_OPTION_HERE: int +NOT_SUPPORTED_YET: int +MASTER_FATAL_ERROR_READING_BINLOG: int +SLAVE_IGNORED_TABLE: int +INCORRECT_GLOBAL_LOCAL_VAR: int +WRONG_FK_DEF: int +KEY_REF_DO_NOT_MATCH_TABLE_REF: int +OPERAND_COLUMNS: int +SUBQUERY_NO_1_ROW: int +UNKNOWN_STMT_HANDLER: int +CORRUPT_HELP_DB: int +CYCLIC_REFERENCE: int +AUTO_CONVERT: int +ILLEGAL_REFERENCE: int +DERIVED_MUST_HAVE_ALIAS: int +SELECT_REDUCED: int +TABLENAME_NOT_ALLOWED_HERE: int +NOT_SUPPORTED_AUTH_MODE: int +SPATIAL_CANT_HAVE_NULL: int +COLLATION_CHARSET_MISMATCH: int +SLAVE_WAS_RUNNING: int +SLAVE_WAS_NOT_RUNNING: int +TOO_BIG_FOR_UNCOMPRESS: int +ZLIB_Z_MEM_ERROR: int +ZLIB_Z_BUF_ERROR: int +ZLIB_Z_DATA_ERROR: int +CUT_VALUE_GROUP_CONCAT: int +WARN_TOO_FEW_RECORDS: int +WARN_TOO_MANY_RECORDS: int +WARN_NULL_TO_NOTNULL: int +WARN_DATA_OUT_OF_RANGE: int +WARN_DATA_TRUNCATED: int +WARN_USING_OTHER_HANDLER: int +CANT_AGGREGATE_2COLLATIONS: int +DROP_USER: int +REVOKE_GRANTS: int +CANT_AGGREGATE_3COLLATIONS: int +CANT_AGGREGATE_NCOLLATIONS: int +VARIABLE_IS_NOT_STRUCT: int +UNKNOWN_COLLATION: int +SLAVE_IGNORED_SSL_PARAMS: int +SERVER_IS_IN_SECURE_AUTH_MODE: int +WARN_FIELD_RESOLVED: int +BAD_SLAVE_UNTIL_COND: int +MISSING_SKIP_SLAVE: int +UNTIL_COND_IGNORED: int +WRONG_NAME_FOR_INDEX: int +WRONG_NAME_FOR_CATALOG: int +WARN_QC_RESIZE: int +BAD_FT_COLUMN: int +UNKNOWN_KEY_CACHE: int +WARN_HOSTNAME_WONT_WORK: int +UNKNOWN_STORAGE_ENGINE: int +WARN_DEPRECATED_SYNTAX: int +NON_UPDATABLE_TABLE: int +FEATURE_DISABLED: int +OPTION_PREVENTS_STATEMENT: int +DUPLICATED_VALUE_IN_TYPE: int +TRUNCATED_WRONG_VALUE: int +TOO_MUCH_AUTO_TIMESTAMP_COLS: int +INVALID_ON_UPDATE: int +UNSUPPORTED_PS: int +GET_ERRMSG: int +GET_TEMPORARY_ERRMSG: int +UNKNOWN_TIME_ZONE: int +WARN_INVALID_TIMESTAMP: int +INVALID_CHARACTER_STRING: int +WARN_ALLOWED_PACKET_OVERFLOWED: int +CONFLICTING_DECLARATIONS: int +SP_NO_RECURSIVE_CREATE: int +SP_ALREADY_EXISTS: int +SP_DOES_NOT_EXIST: int +SP_DROP_FAILED: int +SP_STORE_FAILED: int +SP_LILABEL_MISMATCH: int +SP_LABEL_REDEFINE: int +SP_LABEL_MISMATCH: int +SP_UNINIT_VAR: int +SP_BADSELECT: int +SP_BADRETURN: int +SP_BADSTATEMENT: int +UPDATE_LOG_DEPRECATED_IGNORED: int +UPDATE_LOG_DEPRECATED_TRANSLATED: int +QUERY_INTERRUPTED: int +SP_WRONG_NO_OF_ARGS: int +SP_COND_MISMATCH: int +SP_NORETURN: int +SP_NORETURNEND: int +SP_BAD_CURSOR_QUERY: int +SP_BAD_CURSOR_SELECT: int +SP_CURSOR_MISMATCH: int +SP_CURSOR_ALREADY_OPEN: int +SP_CURSOR_NOT_OPEN: int +SP_UNDECLARED_VAR: int +SP_WRONG_NO_OF_FETCH_ARGS: int +SP_FETCH_NO_DATA: int +SP_DUP_PARAM: int +SP_DUP_VAR: int +SP_DUP_COND: int +SP_DUP_CURS: int +SP_CANT_ALTER: int +SP_SUBSELECT_NYI: int +STMT_NOT_ALLOWED_IN_SF_OR_TRG: int +SP_VARCOND_AFTER_CURSHNDLR: int +SP_CURSOR_AFTER_HANDLER: int +SP_CASE_NOT_FOUND: int +FPARSER_TOO_BIG_FILE: int +FPARSER_BAD_HEADER: int +FPARSER_EOF_IN_COMMENT: int +FPARSER_ERROR_IN_PARAMETER: int +FPARSER_EOF_IN_UNKNOWN_PARAMETER: int +VIEW_NO_EXPLAIN: int +FRM_UNKNOWN_TYPE: int +WRONG_OBJECT: int +NONUPDATEABLE_COLUMN: int +VIEW_SELECT_DERIVED: int +VIEW_SELECT_CLAUSE: int +VIEW_SELECT_VARIABLE: int +VIEW_SELECT_TMPTABLE: int +VIEW_WRONG_LIST: int +WARN_VIEW_MERGE: int +WARN_VIEW_WITHOUT_KEY: int +VIEW_INVALID: int +SP_NO_DROP_SP: int +SP_GOTO_IN_HNDLR: int +TRG_ALREADY_EXISTS: int +TRG_DOES_NOT_EXIST: int +TRG_ON_VIEW_OR_TEMP_TABLE: int +TRG_CANT_CHANGE_ROW: int +TRG_NO_SUCH_ROW_IN_TRG: int +NO_DEFAULT_FOR_FIELD: int +DIVISION_BY_ZERO: int +TRUNCATED_WRONG_VALUE_FOR_FIELD: int +ILLEGAL_VALUE_FOR_TYPE: int +VIEW_NONUPD_CHECK: int +VIEW_CHECK_FAILED: int +PROCACCESS_DENIED_ERROR: int +RELAY_LOG_FAIL: int +PASSWD_LENGTH: int +UNKNOWN_TARGET_BINLOG: int +IO_ERR_LOG_INDEX_READ: int +BINLOG_PURGE_PROHIBITED: int +FSEEK_FAIL: int +BINLOG_PURGE_FATAL_ERR: int +LOG_IN_USE: int +LOG_PURGE_UNKNOWN_ERR: int +RELAY_LOG_INIT: int +NO_BINARY_LOGGING: int +RESERVED_SYNTAX: int +WSAS_FAILED: int +DIFF_GROUPS_PROC: int +NO_GROUP_FOR_PROC: int +ORDER_WITH_PROC: int +LOGGING_PROHIBIT_CHANGING_OF: int +NO_FILE_MAPPING: int +WRONG_MAGIC: int +PS_MANY_PARAM: int +KEY_PART_0: int +VIEW_CHECKSUM: int +VIEW_MULTIUPDATE: int +VIEW_NO_INSERT_FIELD_LIST: int +VIEW_DELETE_MERGE_VIEW: int +CANNOT_USER: int +XAER_NOTA: int +XAER_INVAL: int +XAER_RMFAIL: int +XAER_OUTSIDE: int +XAER_RMERR: int +XA_RBROLLBACK: int +NONEXISTING_PROC_GRANT: int +PROC_AUTO_GRANT_FAIL: int +PROC_AUTO_REVOKE_FAIL: int +DATA_TOO_LONG: int +SP_BAD_SQLSTATE: int +STARTUP: int +LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR: int +CANT_CREATE_USER_WITH_GRANT: int +WRONG_VALUE_FOR_TYPE: int +TABLE_DEF_CHANGED: int +SP_DUP_HANDLER: int +SP_NOT_VAR_ARG: int +SP_NO_RETSET: int +CANT_CREATE_GEOMETRY_OBJECT: int +FAILED_ROUTINE_BREAK_BINLOG: int +BINLOG_UNSAFE_ROUTINE: int +BINLOG_CREATE_ROUTINE_NEED_SUPER: int +EXEC_STMT_WITH_OPEN_CURSOR: int +STMT_HAS_NO_OPEN_CURSOR: int +COMMIT_NOT_ALLOWED_IN_SF_OR_TRG: int +NO_DEFAULT_FOR_VIEW_FIELD: int +SP_NO_RECURSION: int +TOO_BIG_SCALE: int +TOO_BIG_PRECISION: int +M_BIGGER_THAN_D: int +WRONG_LOCK_OF_SYSTEM_TABLE: int +CONNECT_TO_FOREIGN_DATA_SOURCE: int +QUERY_ON_FOREIGN_DATA_SOURCE: int +FOREIGN_DATA_SOURCE_DOESNT_EXIST: int +FOREIGN_DATA_STRING_INVALID_CANT_CREATE: int +FOREIGN_DATA_STRING_INVALID: int +CANT_CREATE_FEDERATED_TABLE: int +TRG_IN_WRONG_SCHEMA: int +STACK_OVERRUN_NEED_MORE: int +TOO_LONG_BODY: int +WARN_CANT_DROP_DEFAULT_KEYCACHE: int +TOO_BIG_DISPLAYWIDTH: int +XAER_DUPID: int +DATETIME_FUNCTION_OVERFLOW: int +CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG: int +VIEW_PREVENT_UPDATE: int +PS_NO_RECURSION: int +SP_CANT_SET_AUTOCOMMIT: int +MALFORMED_DEFINER: int +VIEW_FRM_NO_USER: int +VIEW_OTHER_USER: int +NO_SUCH_USER: int +FORBID_SCHEMA_CHANGE: int +ROW_IS_REFERENCED_2: int +NO_REFERENCED_ROW_2: int +SP_BAD_VAR_SHADOW: int +TRG_NO_DEFINER: int +OLD_FILE_FORMAT: int +SP_RECURSION_LIMIT: int +SP_PROC_TABLE_CORRUPT: int +SP_WRONG_NAME: int +TABLE_NEEDS_UPGRADE: int +SP_NO_AGGREGATE: int +MAX_PREPARED_STMT_COUNT_REACHED: int +VIEW_RECURSIVE: int +NON_GROUPING_FIELD_USED: int +TABLE_CANT_HANDLE_SPKEYS: int +NO_TRIGGERS_ON_SYSTEM_SCHEMA: int +USERNAME: int +HOSTNAME: int +WRONG_STRING_LENGTH: int +ERROR_LAST: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FIELD_TYPE.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FIELD_TYPE.pyi new file mode 100644 index 00000000..f1938b00 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FIELD_TYPE.pyi @@ -0,0 +1,29 @@ +DECIMAL: int +TINY: int +SHORT: int +LONG: int +FLOAT: int +DOUBLE: int +NULL: int +TIMESTAMP: int +LONGLONG: int +INT24: int +DATE: int +TIME: int +DATETIME: int +YEAR: int +NEWDATE: int +VARCHAR: int +BIT: int +NEWDECIMAL: int +ENUM: int +SET: int +TINY_BLOB: int +MEDIUM_BLOB: int +LONG_BLOB: int +BLOB: int +VAR_STRING: int +STRING: int +GEOMETRY: int +CHAR: int +INTERVAL: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FLAG.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FLAG.pyi new file mode 100644 index 00000000..04b99fad --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/FLAG.pyi @@ -0,0 +1,17 @@ +from typing import Any + +NOT_NULL: Any +PRI_KEY: Any +UNIQUE_KEY: Any +MULTIPLE_KEY: Any +BLOB: Any +UNSIGNED: Any +ZEROFILL: Any +BINARY: Any +ENUM: Any +AUTO_INCREMENT: Any +TIMESTAMP: Any +SET: Any +PART_KEY: Any +GROUP: Any +UNIQUE: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/SERVER_STATUS.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/SERVER_STATUS.pyi new file mode 100644 index 00000000..437b8936 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/SERVER_STATUS.pyi @@ -0,0 +1,10 @@ +SERVER_STATUS_IN_TRANS: int +SERVER_STATUS_AUTOCOMMIT: int +SERVER_MORE_RESULTS_EXISTS: int +SERVER_QUERY_NO_GOOD_INDEX_USED: int +SERVER_QUERY_NO_INDEX_USED: int +SERVER_STATUS_CURSOR_EXISTS: int +SERVER_STATUS_LAST_ROW_SENT: int +SERVER_STATUS_DB_DROPPED: int +SERVER_STATUS_NO_BACKSLASH_ESCAPES: int +SERVER_STATUS_METADATA_CHANGED: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/constants/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/converters.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/converters.pyi new file mode 100644 index 00000000..fdd76022 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/converters.pyi @@ -0,0 +1,46 @@ +from typing import Any +from .constants import FIELD_TYPE as FIELD_TYPE, FLAG as FLAG +from .charset import charset_by_id as charset_by_id + +PYTHON3: Any +ESCAPE_REGEX: Any +ESCAPE_MAP: Any + +def escape_item(val, charset): ... +def escape_dict(val, charset): ... +def escape_sequence(val, charset): ... +def escape_set(val, charset): ... +def escape_bool(value): ... +def escape_object(value): ... + +escape_int: Any + +escape_long: Any + +def escape_float(value): ... +def escape_string(value): ... +def escape_unicode(value): ... +def escape_None(value): ... +def escape_timedelta(obj): ... +def escape_time(obj): ... +def escape_datetime(obj): ... +def escape_date(obj): ... +def escape_struct_time(obj): ... +def convert_datetime(connection, field, obj): ... +def convert_timedelta(connection, field, obj): ... +def convert_time(connection, field, obj): ... +def convert_date(connection, field, obj): ... +def convert_mysql_timestamp(connection, field, timestamp): ... +def convert_set(s): ... +def convert_bit(connection, field, b): ... +def convert_characters(connection, field, data): ... +def convert_int(connection, field, data): ... +def convert_long(connection, field, data): ... +def convert_float(connection, field, data): ... + +encoders: Any +decoders: Any +conversions: Any + +def convert_decimal(connection, field, data): ... +def escape_decimal(obj): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/cursors.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/cursors.pyi new file mode 100644 index 00000000..48119ccd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/cursors.pyi @@ -0,0 +1,50 @@ +from typing import Any, Dict, Iterator, List, Optional, Text, Tuple, TypeVar, Union + +from .connections import Connection + +Gen = Union[Tuple[Any, ...], Dict[str, Any]] +_SelfT = TypeVar("_SelfT") + +class Cursor: + connection: Connection + description: Tuple[Text, ...] + rownumber: int + rowcount: int + arraysize: int + messages: Any + errorhandler: Any + lastrowid: int + def __init__(self, connection: Connection) -> None: ... + def __del__(self) -> None: ... + def close(self) -> None: ... + def setinputsizes(self, *args): ... + def setoutputsizes(self, *args): ... + def nextset(self): ... + def execute(self, query: str, args: Optional[Any] = ...) -> int: ... + def executemany(self, query: str, args) -> int: ... + def callproc(self, procname, args=...): ... + def fetchone(self) -> Optional[Gen]: ... + def fetchmany(self, size: Optional[int] = ...) -> Union[Optional[Gen], List[Gen]]: ... + def fetchall(self) -> Optional[Tuple[Gen, ...]]: ... + def scroll(self, value: int, mode: str = ...): ... + def __iter__(self): ... + def __enter__(self: _SelfT) -> _SelfT: ... + def __exit__(self, *exc_info: Any) -> None: ... + +class DictCursor(Cursor): + def fetchone(self) -> Optional[Dict[str, Any]]: ... + def fetchmany(self, size: Optional[int] = ...) -> Optional[Tuple[Dict[str, Any], ...]]: ... + def fetchall(self) -> Optional[Tuple[Dict[str, Any], ...]]: ... + +class DictCursorMixin: + dict_type: Any + +class SSCursor(Cursor): + # fetchall return type is incompatible with the supertype. + def fetchall(self) -> List[Gen]: ... # type: ignore + def fetchall_unbuffered(self) -> Iterator[Tuple[Gen, ...]]: ... + def __iter__(self) -> Iterator[Tuple[Gen, ...]]: ... + def fetchmany(self, size: Optional[int] = ...) -> List[Gen]: ... + def scroll(self, value: int, mode: str = ...) -> None: ... + +class SSDictCursor(DictCursorMixin, SSCursor): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/err.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/err.pyi new file mode 100644 index 00000000..b237af9a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/err.pyi @@ -0,0 +1,18 @@ +from typing import Dict, NoReturn, Type +from .constants import ER as ER + +class MySQLError(Exception): ... +class Warning(MySQLError): ... +class Error(MySQLError): ... +class InterfaceError(Error): ... +class DatabaseError(Error): ... +class DataError(DatabaseError): ... +class OperationalError(DatabaseError): ... +class IntegrityError(DatabaseError): ... +class InternalError(DatabaseError): ... +class ProgrammingError(DatabaseError): ... +class NotSupportedError(DatabaseError): ... + +error_map: Dict[int, Type[DatabaseError]] + +def raise_mysql_exception(data) -> NoReturn: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/times.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/times.pyi new file mode 100644 index 00000000..c798e654 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/times.pyi @@ -0,0 +1,10 @@ +from typing import Any + +Date: Any +Time: Any +TimeDelta: Any +Timestamp: Any + +def DateFromTicks(ticks): ... +def TimeFromTicks(ticks): ... +def TimestampFromTicks(ticks): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/util.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/util.pyi new file mode 100644 index 00000000..3d9a65b4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pymysql/util.pyi @@ -0,0 +1,3 @@ +def byte2int(b): ... +def int2byte(i): ... +def join_bytes(bs): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/__init__.pyi new file mode 100644 index 00000000..83e691d7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/__init__.pyi @@ -0,0 +1 @@ +__license__: str diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/attributes.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/attributes.pyi new file mode 100644 index 00000000..a2e5088c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/attributes.pyi @@ -0,0 +1,96 @@ +from typing import Any, Callable, Dict, Generic, Iterable, List, Mapping, Optional, Text, Type, TypeVar, Union, Set + +from datetime import datetime + +_T = TypeVar('_T') +_KT = TypeVar('_KT') +_VT = TypeVar('_VT') +_MT = TypeVar('_MT', bound=MapAttribute[Any, Any]) + +class Attribute(Generic[_T]): + attr_name: Optional[Text] + attr_type: Text + null: bool + default: Any + is_hash_key: bool + is_range_key: bool + def __init__(self, hash_key: bool = ..., range_key: bool = ..., null: Optional[bool] = ..., default: Optional[Union[_T, Callable[..., _T]]] = ..., attr_name: Optional[Text] = ...) -> None: ... + def __set__(self, instance: Any, value: Optional[_T]) -> None: ... + def serialize(self, value: Any) -> Any: ... + def deserialize(self, value: Any) -> Any: ... + def get_value(self, value: Any) -> Any: ... + def between(self, lower: Any, upper: Any) -> Any: ... + def is_in(self, *values: Any) -> Any: ... + def exists(self) -> Any: ... + def does_not_exist(self) -> Any: ... + def is_type(self) -> Any: ... + def startswith(self, prefix: str) -> Any: ... + def contains(self, item: Any) -> Any: ... + def append(self, other: Any) -> Any: ... + def prepend(self, other: Any) -> Any: ... + def set(self, value: Any) -> Any: ... + def remove(self) -> Any: ... + def add(self, *values: Any) -> Any: ... + def delete(self, *values: Any) -> Any: ... + +class SetMixin(object): + def serialize(self, value): ... + def deserialize(self, value): ... + +class BinaryAttribute(Attribute[bytes]): + def __get__(self, instance: Any, owner: Any) -> bytes: ... + +class BinarySetAttribute(SetMixin, Attribute[Set[bytes]]): + def __get__(self, instance: Any, owner: Any) -> Set[bytes]: ... + +class UnicodeSetAttribute(SetMixin, Attribute[Set[Text]]): + def element_serialize(self, value: Any) -> Any: ... + def element_deserialize(self, value: Any) -> Any: ... + def __get__(self, instance: Any, owner: Any) -> Set[Text]: ... + +class UnicodeAttribute(Attribute[Text]): + def __get__(self, instance: Any, owner: Any) -> Text: ... + +class JSONAttribute(Attribute[Any]): + def __get__(self, instance: Any, owner: Any) -> Any: ... + +class LegacyBooleanAttribute(Attribute[bool]): + def __get__(self, instance: Any, owner: Any) -> bool: ... + +class BooleanAttribute(Attribute[bool]): + def __get__(self, instance: Any, owner: Any) -> bool: ... + +class NumberSetAttribute(SetMixin, Attribute[Set[float]]): + def __get__(self, instance: Any, owner: Any) -> Set[float]: ... + +class NumberAttribute(Attribute[float]): + def __get__(self, instance: Any, owner: Any) -> float: ... + +class UTCDateTimeAttribute(Attribute[datetime]): + def __get__(self, instance: Any, owner: Any) -> datetime: ... + +class NullAttribute(Attribute[None]): + def __get__(self, instance: Any, owner: Any) -> None: ... + +class MapAttributeMeta(type): + def __init__(self, name, bases, attrs) -> None: ... + +class MapAttribute(Generic[_KT, _VT], Attribute[Mapping[_KT, _VT]], metaclass=MapAttributeMeta): + attribute_values: Any + def __init__(self, hash_key: bool = ..., range_key: bool = ..., null: Optional[bool] = ..., default: Optional[Union[Any, Callable[..., Any]]] = ..., attr_name: Optional[Text] = ..., **attrs) -> None: ... + def __iter__(self) -> Iterable[_VT]: ... + def __getattr__(self, attr: str) -> _VT: ... + def __getitem__(self, item: _KT) -> _VT: ... + def __set__(self, instance: Any, value: Union[None, MapAttribute[_KT, _VT], Mapping[_KT, _VT]]) -> None: ... + def __get__(self: _MT, instance: Any, owner: Any) -> _MT: ... + def is_type_safe(self, key: Any, value: Any) -> bool: ... + def validate(self) -> bool: ... + +class ListAttribute(Generic[_T], Attribute[List[_T]]): + element_type: Any + def __init__(self, hash_key: bool = ..., range_key: bool = ..., null: Optional[bool] = ..., default: Optional[Union[Any, Callable[..., Any]]] = ..., attr_name: Optional[Text] = ..., of: Optional[Type[_T]] = ...) -> None: ... + def __get__(self, instance: Any, owner: Any) -> List[_T]: ... + +DESERIALIZE_CLASS_MAP: Dict[Text, Attribute[Any]] +SERIALIZE_CLASS_MAP: Dict[Type[Any], Attribute[Any]] +SERIALIZE_KEY_MAP: Dict[Type[Any], Text] diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/__init__.pyi new file mode 100644 index 00000000..1860736b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/__init__.pyi @@ -0,0 +1,2 @@ +from pynamodb.connection.base import Connection as Connection +from pynamodb.connection.table import TableConnection as TableConnection diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/base.pyi new file mode 100644 index 00000000..71c9d74f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/base.pyi @@ -0,0 +1,78 @@ +from typing import Any, Dict, Optional, Text + +BOTOCORE_EXCEPTIONS: Any +log: Any + +class MetaTable: + data: Dict[Any, Any] + def __init__(self, data: Dict[Any, Any]) -> None: ... + @property + def range_keyname(self) -> Optional[Text]: ... + @property + def hash_keyname(self) -> Text: ... + def get_index_hash_keyname(self, index_name: Text) -> Optional[Text]: ... + def get_item_attribute_map(self, attributes, item_key: Any = ..., pythonic_key: bool = ...): ... + def get_attribute_type(self, attribute_name, value: Optional[Any] = ...): ... + def get_identifier_map(self, hash_key, range_key: Optional[Any] = ..., key: Any = ...): ... + def get_exclusive_start_key_map(self, exclusive_start_key): ... + +class Connection: + host: Any + region: Any + session_cls: Any + def __init__(self, region: Optional[Any] = ..., host: Optional[Any] = ..., session_cls: Optional[Any] = ..., + request_timeout_seconds: Optional[Any] = ..., max_retry_attempts: Optional[Any] = ..., + base_backoff_ms: Optional[Any] = ...) -> None: ... + def dispatch(self, operation_name, operation_kwargs): ... + @property + def session(self): ... + @property + def requests_session(self): ... + @property + def client(self): ... + def get_meta_table(self, table_name: Text, refresh: bool = ...): ... + def create_table(self, table_name: Text, attribute_definitions: Optional[Any] = ..., key_schema: Optional[Any] = ..., + read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ..., + global_secondary_indexes: Optional[Any] = ..., local_secondary_indexes: Optional[Any] = ..., + stream_specification: Optional[Any] = ...): ... + def delete_table(self, table_name: Text): ... + def update_table(self, table_name: Text, read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ..., + global_secondary_index_updates: Optional[Any] = ...): ... + def list_tables(self, exclusive_start_table_name: Optional[Any] = ..., limit: Optional[Any] = ...): ... + def describe_table(self, table_name: Text): ... + def get_conditional_operator(self, operator): ... + def get_item_attribute_map(self, table_name: Text, attributes, item_key: Any = ..., pythonic_key: bool = ...): ... + def get_expected_map(self, table_name: Text, expected): ... + def parse_attribute(self, attribute, return_type: bool = ...): ... + def get_attribute_type(self, table_name: Text, attribute_name, value: Optional[Any] = ...): ... + def get_identifier_map(self, table_name: Text, hash_key, range_key: Optional[Any] = ..., key: Any = ...): ... + def get_query_filter_map(self, table_name: Text, query_filters): ... + def get_consumed_capacity_map(self, return_consumed_capacity): ... + def get_return_values_map(self, return_values): ... + def get_item_collection_map(self, return_item_collection_metrics): ... + def get_exclusive_start_key_map(self, table_name: Text, exclusive_start_key): ... + def delete_item(self, table_name: Text, hash_key, range_key: Optional[Any] = ..., expected: Optional[Any] = ..., + conditional_operator: Optional[Any] = ..., return_values: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... + def update_item(self, table_name: Text, hash_key, range_key: Optional[Any] = ..., attribute_updates: Optional[Any] = ..., + expected: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., + conditional_operator: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ..., + return_values: Optional[Any] = ...): ... + def put_item(self, table_name: Text, hash_key, range_key: Optional[Any] = ..., attributes: Optional[Any] = ..., + expected: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., return_values: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... + def batch_write_item(self, table_name: Text, put_items: Optional[Any] = ..., delete_items: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... + def batch_get_item(self, table_name: Text, keys, consistent_read: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., attributes_to_get: Optional[Any] = ...): ... + def get_item(self, table_name: Text, hash_key, range_key: Optional[Any] = ..., consistent_read: bool = ..., + attributes_to_get: Optional[Any] = ...): ... + def scan(self, table_name: Text, attributes_to_get: Optional[Any] = ..., limit: Optional[Any] = ..., + conditional_operator: Optional[Any] = ..., scan_filter: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., exclusive_start_key: Optional[Any] = ..., + segment: Optional[Any] = ..., total_segments: Optional[Any] = ...): ... + def query(self, table_name: Text, hash_key, attributes_to_get: Optional[Any] = ..., consistent_read: bool = ..., + exclusive_start_key: Optional[Any] = ..., index_name: Optional[Any] = ..., key_conditions: Optional[Any] = ..., + query_filters: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., limit: Optional[Any] = ..., + return_consumed_capacity: Optional[Any] = ..., scan_index_forward: Optional[Any] = ..., + select: Optional[Any] = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/table.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/table.pyi new file mode 100644 index 00000000..0f820af9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/table.pyi @@ -0,0 +1,18 @@ +from typing import Any, Optional + +class TableConnection: + table_name: Any + connection: Any + def __init__(self, table_name, region: Optional[Any] = ..., host: Optional[Any] = ..., session_cls: Optional[Any] = ..., request_timeout_seconds: Optional[Any] = ..., max_retry_attempts: Optional[Any] = ..., base_backoff_ms: Optional[Any] = ...) -> None: ... + def delete_item(self, hash_key, range_key: Optional[Any] = ..., expected: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., return_values: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... + def update_item(self, hash_key, range_key: Optional[Any] = ..., attribute_updates: Optional[Any] = ..., expected: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ..., return_values: Optional[Any] = ...): ... + def put_item(self, hash_key, range_key: Optional[Any] = ..., attributes: Optional[Any] = ..., expected: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., return_values: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... + def batch_write_item(self, put_items: Optional[Any] = ..., delete_items: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., return_item_collection_metrics: Optional[Any] = ...): ... + def batch_get_item(self, keys, consistent_read: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., attributes_to_get: Optional[Any] = ...): ... + def get_item(self, hash_key, range_key: Optional[Any] = ..., consistent_read: bool = ..., attributes_to_get: Optional[Any] = ...): ... + def scan(self, attributes_to_get: Optional[Any] = ..., limit: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., scan_filter: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., segment: Optional[Any] = ..., total_segments: Optional[Any] = ..., exclusive_start_key: Optional[Any] = ...): ... + def query(self, hash_key, attributes_to_get: Optional[Any] = ..., consistent_read: bool = ..., exclusive_start_key: Optional[Any] = ..., index_name: Optional[Any] = ..., key_conditions: Optional[Any] = ..., query_filters: Optional[Any] = ..., limit: Optional[Any] = ..., return_consumed_capacity: Optional[Any] = ..., scan_index_forward: Optional[Any] = ..., conditional_operator: Optional[Any] = ..., select: Optional[Any] = ...): ... + def describe_table(self): ... + def delete_table(self): ... + def update_table(self, read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ..., global_secondary_index_updates: Optional[Any] = ...): ... + def create_table(self, attribute_definitions: Optional[Any] = ..., key_schema: Optional[Any] = ..., read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ..., global_secondary_indexes: Optional[Any] = ..., local_secondary_indexes: Optional[Any] = ..., stream_specification: Optional[Any] = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/util.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/util.pyi new file mode 100644 index 00000000..20635c69 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/connection/util.pyi @@ -0,0 +1,3 @@ +from typing import Text + +def pythonic(var_name: Text) -> Text: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/constants.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/constants.pyi new file mode 100644 index 00000000..7c26cd61 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/constants.pyi @@ -0,0 +1,166 @@ +from typing import Any + +BATCH_WRITE_ITEM: str +DESCRIBE_TABLE: str +BATCH_GET_ITEM: str +CREATE_TABLE: str +UPDATE_TABLE: str +DELETE_TABLE: str +LIST_TABLES: str +UPDATE_ITEM: str +DELETE_ITEM: str +GET_ITEM: str +PUT_ITEM: str +QUERY: str +SCAN: str +GLOBAL_SECONDARY_INDEX_UPDATES: str +RETURN_ITEM_COLL_METRICS: str +EXCLUSIVE_START_TABLE_NAME: str +RETURN_CONSUMED_CAPACITY: str +COMPARISON_OPERATOR: str +SCAN_INDEX_FORWARD: str +ATTR_DEFINITIONS: str +ATTR_VALUE_LIST: str +TABLE_DESCRIPTION: str +UNPROCESSED_KEYS: str +UNPROCESSED_ITEMS: str +CONSISTENT_READ: str +DELETE_REQUEST: str +RETURN_VALUES: str +REQUEST_ITEMS: str +ATTRS_TO_GET: str +ATTR_UPDATES: str +TABLE_STATUS: str +SCAN_FILTER: str +TABLE_NAME: str +KEY_SCHEMA: str +ATTR_NAME: str +ATTR_TYPE: str +ITEM_COUNT: str +CAMEL_COUNT: str +PUT_REQUEST: str +INDEX_NAME: str +ATTRIBUTES: str +TABLE_KEY: str +RESPONSES: str +RANGE_KEY: str +KEY_TYPE: str +ACTION: str +UPDATE: str +EXISTS: str +SELECT: str +ACTIVE: str +LIMIT: str +ITEMS: str +ITEM: str +KEYS: str +UTC: str +KEY: str +DEFAULT_ENCODING: str +DEFAULT_REGION: str +DATETIME_FORMAT: str +SERVICE_NAME: str +HTTP_OK: int +HTTP_BAD_REQUEST: int +PROVISIONED_THROUGHPUT: str +READ_CAPACITY_UNITS: str +WRITE_CAPACITY_UNITS: str +STRING_SHORT: str +STRING_SET_SHORT: str +NUMBER_SHORT: str +NUMBER_SET_SHORT: str +BINARY_SHORT: str +BINARY_SET_SHORT: str +MAP_SHORT: str +LIST_SHORT: str +BOOLEAN: str +BOOLEAN_SHORT: str +STRING: str +STRING_SET: str +NUMBER: str +NUMBER_SET: str +BINARY: str +BINARY_SET: str +MAP: str +LIST: str +SHORT_ATTR_TYPES: Any +ATTR_TYPE_MAP: Any +LOCAL_SECONDARY_INDEX: str +LOCAL_SECONDARY_INDEXES: str +GLOBAL_SECONDARY_INDEX: str +GLOBAL_SECONDARY_INDEXES: str +PROJECTION: str +PROJECTION_TYPE: str +NON_KEY_ATTRIBUTES: str +KEYS_ONLY: str +ALL: str +INCLUDE: str +STREAM_VIEW_TYPE: str +STREAM_SPECIFICATION: str +STREAM_ENABLED: str +STREAM_NEW_IMAGE: str +STREAM_OLD_IMAGE: str +STREAM_NEW_AND_OLD_IMAGE: str +STREAM_KEYS_ONLY: str +EXCLUSIVE_START_KEY: str +LAST_EVALUATED_KEY: str +QUERY_FILTER: str +BEGINS_WITH: str +BETWEEN: str +EQ: str +NE: str +LE: str +LT: str +GE: str +GT: str +IN: str +KEY_CONDITIONS: str +COMPARISON_OPERATOR_VALUES: Any +QUERY_OPERATOR_MAP: Any +NOT_NULL: str +NULL: str +CONTAINS: str +NOT_CONTAINS: str +ALL_ATTRIBUTES: str +ALL_PROJECTED_ATTRIBUTES: str +SPECIFIC_ATTRIBUTES: str +COUNT: str +SELECT_VALUES: Any +SCAN_OPERATOR_MAP: Any +QUERY_FILTER_OPERATOR_MAP: Any +DELETE_FILTER_OPERATOR_MAP: Any +UPDATE_FILTER_OPERATOR_MAP: Any +PUT_FILTER_OPERATOR_MAP: Any +SEGMENT: str +TOTAL_SEGMENTS: str +SCAN_FILTER_VALUES: Any +QUERY_FILTER_VALUES: Any +DELETE_FILTER_VALUES: Any +VALUE: str +EXPECTED: str +CONSUMED_CAPACITY: str +CAPACITY_UNITS: str +INDEXES: str +TOTAL: str +NONE: str +RETURN_CONSUMED_CAPACITY_VALUES: Any +SIZE: str +RETURN_ITEM_COLL_METRICS_VALUES: Any +ALL_OLD: str +UPDATED_OLD: str +ALL_NEW: str +UPDATED_NEW: str +RETURN_VALUES_VALUES: Any +PUT: str +DELETE: str +ADD: str +ATTR_UPDATE_ACTIONS: Any +BATCH_GET_PAGE_LIMIT: int +BATCH_WRITE_PAGE_LIMIT: int +META_CLASS_NAME: str +REGION: str +HOST: str +CONDITIONAL_OPERATOR: str +AND: str +OR: str +CONDITIONAL_OPERATORS: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/exceptions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/exceptions.pyi new file mode 100644 index 00000000..728db4a7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/exceptions.pyi @@ -0,0 +1,23 @@ +from typing import Any, Optional, Text + +class PynamoDBException(Exception): + msg: str + cause: Any + def __init__(self, msg: Optional[Text] = ..., cause: Optional[Exception] = ...) -> None: ... + +class PynamoDBConnectionError(PynamoDBException): ... +class DeleteError(PynamoDBConnectionError): ... +class QueryError(PynamoDBConnectionError): ... +class ScanError(PynamoDBConnectionError): ... +class PutError(PynamoDBConnectionError): ... +class UpdateError(PynamoDBConnectionError): ... +class GetError(PynamoDBConnectionError): ... +class TableError(PynamoDBConnectionError): ... +class DoesNotExist(PynamoDBException): ... + +class TableDoesNotExist(PynamoDBException): + def __init__(self, table_name) -> None: ... + +class VerboseClientError(Exception): + MSG_TEMPLATE: Any + def __init__(self, error_response, operation_name, verbose_properties: Optional[Any] = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/indexes.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/indexes.pyi new file mode 100644 index 00000000..66e8ae77 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/indexes.pyi @@ -0,0 +1,30 @@ +from typing import Any, Optional + +class IndexMeta(type): + def __init__(self, name, bases, attrs) -> None: ... + +class Index(metaclass=IndexMeta): + Meta: Any + def __init__(self) -> None: ... + @classmethod + def count(cls, hash_key, consistent_read: bool = ..., **filters) -> int: ... + @classmethod + def query(self, hash_key, scan_index_forward: Optional[Any] = ..., consistent_read: bool = ..., limit: Optional[Any] = ..., last_evaluated_key: Optional[Any] = ..., attributes_to_get: Optional[Any] = ..., **filters): ... + +class GlobalSecondaryIndex(Index): ... +class LocalSecondaryIndex(Index): ... + +class Projection(object): + projection_type: Any + non_key_attributes: Any + +class KeysOnlyProjection(Projection): + projection_type: Any + +class IncludeProjection(Projection): + projection_type: Any + non_key_attributes: Any + def __init__(self, non_attr_keys: Optional[Any] = ...) -> None: ... + +class AllProjection(Projection): + projection_type: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/models.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/models.pyi new file mode 100644 index 00000000..cf181395 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/models.pyi @@ -0,0 +1,107 @@ +from .attributes import Attribute +from .exceptions import DoesNotExist as DoesNotExist +from typing import Any, Dict, Generic, Iterable, Iterator, List, Optional, Sequence, Tuple, Type, TypeVar, Text, Union + +log: Any + +class DefaultMeta: ... + +class ResultSet(object): + results: Any + operation: Any + arguments: Any + def __init__(self, results, operation, arguments) -> None: ... + def __iter__(self): ... + +class MetaModel(type): + def __init__(self, name: Text, bases: Tuple[type, ...], attrs: Dict[Any, Any]) -> None: ... + +_T = TypeVar('_T', bound='Model') +KeyType = Union[Text, bytes, float, int, Tuple[Any, ...]] + +class Model(metaclass=MetaModel): + DoesNotExist = DoesNotExist + attribute_values: Dict[Text, Any] + def __init__(self, hash_key: Optional[KeyType] = ..., range_key: Optional[Any] = ..., **attrs) -> None: ... + @classmethod + def has_map_or_list_attributes(cls: Type[_T]) -> bool: ... + @classmethod + def batch_get(cls: Type[_T], items: Iterable[Union[KeyType, Iterable[KeyType]]], consistent_read: Optional[bool] = ..., attributes_to_get: Optional[Sequence[Text]] = ...) -> Iterator[_T]: ... + @classmethod + def batch_write(cls: Type[_T], auto_commit: bool = ...) -> BatchWrite[_T]: ... + def delete(self, condition: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., **expected_values) -> Any: ... + def update(self, attributes: Optional[Dict[Text, Dict[Text, Any]]] = ..., actions: Optional[List[Any]] = ..., condition: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., **expected_values) -> Any: ... + def update_item(self, attribute: Text, value: Optional[Any] = ..., action: Optional[Text] = ..., conditional_operator: Optional[Text] = ..., **expected_values): ... + def save(self, condition: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., **expected_values) -> Dict[str, Any]: ... + def refresh(self, consistent_read: bool = ...): ... + @classmethod + def get(cls: Type[_T], hash_key: KeyType, range_key: Optional[KeyType] = ..., consistent_read: bool = ...) -> _T: ... + @classmethod + def from_raw_data(cls: Type[_T], data) -> _T: ... + @classmethod + def count(cls: Type[_T], hash_key: Optional[KeyType] = ..., consistent_read: bool = ..., index_name: Optional[Text] = ..., limit: Optional[int] = ..., **filters) -> int: ... + @classmethod + def query(cls: Type[_T], hash_key: KeyType, consistent_read: bool = ..., index_name: Optional[Text] = ..., scan_index_forward: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., limit: Optional[int] = ..., last_evaluated_key: Optional[Any] = ..., attributes_to_get: Optional[Iterable[Text]] = ..., page_size: Optional[int] = ..., **filters) -> Iterator[_T]: ... + @classmethod + def rate_limited_scan( + cls: Type[_T], + # TODO: annotate Condition class + filter_condition: Optional[Any] = ..., + attributes_to_get: Optional[Sequence[Text]] = ..., + segment: Optional[int] = ..., + total_segments: Optional[int] = ..., + limit: Optional[int] = ..., + conditional_operator: Optional[Text] = ..., + last_evaluated_key: Optional[Any] = ..., + page_size: Optional[int] = ..., + timeout_seconds: Optional[int] = ..., + read_capacity_to_consume_per_second: int = ..., + allow_rate_limited_scan_without_consumed_capacity: Optional[bool] = ..., + max_sleep_between_retry: int = ..., + max_consecutive_exceptions: int = ..., + consistent_read: Optional[bool] = ..., + index_name: Optional[str] = ..., + **filters: Any + ) -> Iterator[_T]: ... + @classmethod + def scan(cls: Type[_T], segment: Optional[int] = ..., total_segments: Optional[int] = ..., limit: Optional[int] = ..., conditional_operator: Optional[Text] = ..., last_evaluated_key: Optional[Any] = ..., page_size: Optional[int] = ..., **filters) -> Iterator[_T]: ... + @classmethod + def exists(cls: Type[_T]) -> bool: ... + @classmethod + def delete_table(cls): ... + @classmethod + def describe_table(cls): ... + @classmethod + def create_table(cls: Type[_T], wait: bool = ..., read_capacity_units: Optional[Any] = ..., write_capacity_units: Optional[Any] = ...): ... + @classmethod + def dumps(cls): ... + @classmethod + def dump(cls, filename): ... + @classmethod + def loads(cls, data): ... + @classmethod + def load(cls, filename): ... + @classmethod + def add_throttle_record(cls, records): ... + @classmethod + def get_throttle(cls): ... + @classmethod + def get_attributes(cls) -> Dict[str, Attribute[Any]]: ... + @classmethod + def _get_attributes(cls) -> Dict[str, Attribute[Any]]: ... + +class ModelContextManager(Generic[_T]): + model: Type[_T] + auto_commit: bool + max_operations: int + pending_operations: List[Dict[Text, Any]] + def __init__(self, model: Type[_T], auto_commit: bool = ...) -> None: ... + def __enter__(self) -> ModelContextManager[_T]: ... + +class BatchWrite(Generic[_T], ModelContextManager[_T]): + def save(self, put_item: _T) -> None: ... + def delete(self, del_item: _T) -> None: ... + def __enter__(self) -> BatchWrite[_T]: ... + def __exit__(self, exc_type, exc_val, exc_tb) -> None: ... + pending_operations: Any + def commit(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/settings.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/settings.pyi new file mode 100644 index 00000000..76fc4172 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/settings.pyi @@ -0,0 +1,8 @@ +from typing import Any + +log: Any +default_settings_dict: Any +OVERRIDE_SETTINGS_PATH: Any +override_settings: Any + +def get_settings_value(key): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/throttle.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/throttle.pyi new file mode 100644 index 00000000..6948b689 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/throttle.pyi @@ -0,0 +1,19 @@ +from typing import Any, Optional + +log: Any + +class ThrottleBase: + capacity: Any + window: Any + records: Any + sleep_interval: Any + def __init__(self, capacity, window: int = ..., initial_sleep: Optional[Any] = ...) -> None: ... + def add_record(self, record): ... + def throttle(self): ... + +class NoThrottle(ThrottleBase): + def __init__(self) -> None: ... + def add_record(self, record): ... + +class Throttle(ThrottleBase): + def throttle(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/types.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/types.pyi new file mode 100644 index 00000000..14195f04 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pynamodb/types.pyi @@ -0,0 +1,5 @@ +STRING: str +NUMBER: str +BINARY: str +HASH: str +RANGE: str diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pyre_extensions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pyre_extensions.pyi new file mode 100644 index 00000000..742b8801 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pyre_extensions.pyi @@ -0,0 +1,7 @@ +from typing import Any, List, Optional, Type, TypeVar + +_T = TypeVar("_T") + +def none_throws(optional: Optional[_T], message: str = ...) -> _T: ... +def safe_cast(new_type: Type[_T], value: Any) -> _T: ... +def ParameterSpecification(__name: str) -> List[Type[Any]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pytz/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pytz/__init__.pyi new file mode 100644 index 00000000..2fa91d20 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/pytz/__init__.pyi @@ -0,0 +1,42 @@ +from typing import Optional, List, Set, Mapping, Union +import datetime + +class BaseTzInfo(datetime.tzinfo): + zone: str = ... + def localize(self, dt: datetime.datetime, is_dst: Optional[bool] = ...) -> datetime.datetime: ... + def normalize(self, dt: datetime.datetime) -> datetime.datetime: ... + +class _UTCclass(BaseTzInfo): + def tzname(self, dt: Optional[datetime.datetime]) -> str: ... + def utcoffset(self, dt: Optional[datetime.datetime]) -> datetime.timedelta: ... + def dst(self, dt: Optional[datetime.datetime]) -> datetime.timedelta: ... + +class _StaticTzInfo(BaseTzInfo): + def tzname(self, dt: Optional[datetime.datetime], is_dst: Optional[bool] = ...) -> str: ... + def utcoffset(self, dt: Optional[datetime.datetime], is_dst: Optional[bool] = ...) -> datetime.timedelta: ... + def dst(self, dt: Optional[datetime.datetime], is_dst: Optional[bool] = ...) -> datetime.timedelta: ... + +class _DstTzInfo(BaseTzInfo): + def tzname(self, dt: Optional[datetime.datetime], is_dst: Optional[bool] = ...) -> str: ... + def utcoffset(self, dt: Optional[datetime.datetime], is_dst: Optional[bool] = ...) -> Optional[datetime.timedelta]: ... + def dst(self, dt: Optional[datetime.datetime], is_dst: Optional[bool] = ...) -> Optional[datetime.timedelta]: ... + +class UnknownTimeZoneError(KeyError): ... +class InvalidTimeError(Exception): ... +class AmbiguousTimeError(InvalidTimeError): ... +class NonExistentTimeError(InvalidTimeError): ... + +utc: _UTCclass +UTC: _UTCclass +def timezone(zone: str) -> Union[_UTCclass, _StaticTzInfo, _DstTzInfo]: ... +def FixedOffset(offset: int) -> Union[_UTCclass, datetime.tzinfo]: ... + +all_timezones: List[str] +all_timezones_set: Set[str] +common_timezones: List[str] +common_timezones_set: Set[str] +country_timezones: Mapping[str, List[str]] +country_names: Mapping[str, str] +ZERO: datetime.timedelta +HOUR: datetime.timedelta +VERSION: str diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/redis/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/redis/__init__.pyi new file mode 100644 index 00000000..333de49b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/redis/__init__.pyi @@ -0,0 +1,24 @@ +from . import client +from . import connection +from . import utils +from . import exceptions + +Redis = client.Redis +StrictRedis = client.StrictRedis +BlockingConnectionPool = connection.BlockingConnectionPool +ConnectionPool = connection.ConnectionPool +Connection = connection.Connection +SSLConnection = connection.SSLConnection +UnixDomainSocketConnection = connection.UnixDomainSocketConnection +from_url = utils.from_url +AuthenticationError = exceptions.AuthenticationError +BusyLoadingError = exceptions.BusyLoadingError +ConnectionError = exceptions.ConnectionError +DataError = exceptions.DataError +InvalidResponse = exceptions.InvalidResponse +PubSubError = exceptions.PubSubError +ReadOnlyError = exceptions.ReadOnlyError +RedisError = exceptions.RedisError +ResponseError = exceptions.ResponseError +TimeoutError = exceptions.TimeoutError +WatchError = exceptions.WatchError diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/redis/client.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/redis/client.pyi new file mode 100644 index 00000000..6875ccf8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/redis/client.pyi @@ -0,0 +1,363 @@ +from datetime import timedelta +from typing import Any, Iterable, Text, Optional, Mapping, Tuple, Union, Callable, List, Dict + +from .connection import ConnectionPool + +SYM_EMPTY: Any + +def list_or_args(keys, args): ... +def timestamp_to_datetime(response): ... +def string_keys_to_dict(key_string, callback): ... +def dict_merge(*dicts): ... +def parse_debug_object(response): ... +def parse_object(response, infotype): ... +def parse_info(response): ... + +SENTINEL_STATE_TYPES: Any + +def parse_sentinel_state(item): ... +def parse_sentinel_master(response): ... +def parse_sentinel_masters(response): ... +def parse_sentinel_slaves_and_sentinels(response): ... +def parse_sentinel_get_master(response): ... +def pairs_to_dict(response): ... +def pairs_to_dict_typed(response, type_info): ... +def zset_score_pairs(response, **options): ... +def sort_return_tuples(response, **options): ... +def int_or_none(response): ... +def float_or_none(response): ... +def bool_ok(response): ... +def parse_client_list(response, **options): ... +def parse_config_get(response, **options): ... +def parse_scan(response, **options): ... +def parse_hscan(response, **options): ... +def parse_zscan(response, **options): ... +def parse_slowlog_get(response, **options): ... + +_Str = Union[bytes, float, int, Text] + +class Redis(object): + RESPONSE_CALLBACKS: Any + @classmethod + def from_url(cls, url: Text, db: Optional[int] = ..., **kwargs) -> Redis: ... + connection_pool: Any + response_callbacks: Any + def __init__( + self, + host: Text = ..., + port: int = ..., + db: int = ..., + password: Optional[Text] = ..., + socket_timeout: Optional[float] = ..., + socket_connect_timeout: Optional[float] = ..., + socket_keepalive: Optional[bool] = ..., + socket_keepalive_options: Optional[Mapping[str, Union[int, str]]] = ..., + connection_pool: Optional[ConnectionPool] = ..., + unix_socket_path: Optional[Text] = ..., + encoding: Text = ..., + encoding_errors: Text = ..., + charset: Optional[Text] = ..., + errors: Optional[Text] = ..., + decode_responses: bool = ..., + retry_on_timeout: bool = ..., + ssl: bool = ..., + ssl_keyfile: Optional[Text] = ..., + ssl_certfile: Optional[Text] = ..., + ssl_cert_reqs: Optional[Union[str, int]] = ..., + ssl_ca_certs: Optional[Text] = ..., + max_connections: Optional[int] = ..., + ) -> None: ... + def set_response_callback(self, command, callback): ... + def pipeline(self, transaction=..., shard_hint=...): ... + def transaction(self, func, *watches, **kwargs): ... + def lock(self, name, timeout=..., sleep=..., blocking_timeout=..., lock_class=..., thread_local=...): ... + def pubsub(self, shard_hint: Any = ..., ignore_subscribe_messages: bool = ...) -> PubSub: ... + def execute_command(self, *args, **options): ... + def parse_response(self, connection, command_name, **options): ... + def bgrewriteaof(self): ... + def bgsave(self): ... + def client_kill(self, address): ... + def client_list(self): ... + def client_getname(self): ... + def client_setname(self, name): ... + def config_get(self, pattern=...): ... + def config_set(self, name, value): ... + def config_resetstat(self): ... + def config_rewrite(self): ... + def dbsize(self) -> int: ... + def debug_object(self, key): ... + def echo(self, value): ... + def flushall(self) -> bool: ... + def flushdb(self) -> bool: ... + def info(self, section: Optional[Text] = ...) -> Mapping[str, Any]: ... + def lastsave(self): ... + def object(self, infotype, key): ... + def ping(self) -> bool: ... + def save(self) -> bool: ... + def sentinel(self, *args): ... + def sentinel_get_master_addr_by_name(self, service_name): ... + def sentinel_master(self, service_name): ... + def sentinel_masters(self): ... + def sentinel_monitor(self, name, ip, port, quorum): ... + def sentinel_remove(self, name): ... + def sentinel_sentinels(self, service_name): ... + def sentinel_set(self, name, option, value): ... + def sentinel_slaves(self, service_name): ... + def shutdown(self): ... + def slaveof(self, host=..., port=...): ... + def slowlog_get(self, num=...): ... + def slowlog_len(self): ... + def slowlog_reset(self): ... + def time(self): ... + def append(self, key, value): ... + def bitcount(self, key, start=..., end=...): ... + def bitop(self, operation, dest, *keys): ... + def bitpos(self, key, bit, start=..., end=...): ... + def decr(self, name, amount=...): ... + def delete(self, *names: Text): ... + def __delitem__(self, name): ... + def dump(self, name): ... + def exists(self, *names: Text) -> int: ... + __contains__: Any + def expire(self, name: Union[Text, bytes], time: Union[int, timedelta]) -> bool: ... + def expireat(self, name, when): ... + def get(self, name: Union[Text, bytes]) -> Optional[bytes]: ... + def __getitem__(self, name): ... + def getbit(self, name, offset): ... + def getrange(self, key, start, end): ... + def getset(self, name, value): ... + def incr(self, name, amount=...): ... + def incrby(self, name, amount=...): ... + def incrbyfloat(self, name, amount=...): ... + def keys(self, pattern=...): ... + def mget(self, keys, *args): ... + def mset(self, *args, **kwargs): ... + def msetnx(self, *args, **kwargs): ... + def move(self, name, db): ... + def persist(self, name): ... + def pexpire(self, name, time): ... + def pexpireat(self, name, when): ... + def psetex(self, name, time_ms, value): ... + def pttl(self, name): ... + def randomkey(self): ... + def rename(self, src, dst): ... + def renamenx(self, src, dst): ... + def restore(self, name, ttl, value): ... + def set( + self, + name: Union[Text, bytes], + value: _Str, + ex: Union[None, int, timedelta] = ..., + px: Union[None, int, timedelta] = ..., + nx: bool = ..., + xx: bool = ..., + ) -> Optional[bool]: ... + def __setitem__(self, name, value): ... + def setbit(self, name, offset, value): ... + def setex(self, name, time, value): ... + def setnx(self, name, value): ... + def setrange(self, name, offset, value): ... + def strlen(self, name): ... + def substr(self, name, start, end=...): ... + def ttl(self, name): ... + def type(self, name): ... + def watch(self, *names): ... + def unwatch(self): ... + def blpop(self, keys: Union[_Str, Iterable[_Str]], timeout: int = ...) -> Optional[Tuple[bytes, bytes]]: ... + def brpop(self, keys: Union[_Str, Iterable[_Str]], timeout: int = ...) -> Optional[Tuple[bytes, bytes]]: ... + def brpoplpush(self, src, dst, timeout=...): ... + def lindex(self, name, index): ... + def linsert(self, name, where, refvalue, value): ... + def llen(self, name): ... + def lpop(self, name): ... + def lpush(self, name: _Str, *values: _Str) -> int: ... + def lpushx(self, name, value): ... + def lrange(self, name, start, end): ... + def lrem(self, name, count, value): ... + def lset(self, name, index, value): ... + def ltrim(self, name, start, end): ... + def rpop(self, name): ... + def rpoplpush(self, src, dst): ... + def rpush(self, name: _Str, *values: _Str) -> int: ... + def rpushx(self, name, value): ... + def sort(self, name, start=..., num=..., by=..., get=..., desc=..., alpha=..., store=..., groups=...): ... + def scan(self, cursor: int = ..., match: Optional[Text] = ..., count: Optional[int] = ...) -> List[Text]: ... + def scan_iter(self, match: Optional[Text] = ..., count: Optional[int] = ...) -> List[Text]: ... + def sscan(self, name, cursor=..., match=..., count=...): ... + def sscan_iter(self, name, match=..., count=...): ... + def hscan(self, name, cursor=..., match=..., count=...): ... + def hscan_iter(self, name, match=..., count=...): ... + def zscan(self, name, cursor=..., match=..., count=..., score_cast_func=...): ... + def zscan_iter(self, name, match=..., count=..., score_cast_func=...): ... + def sadd(self, name, *values): ... + def scard(self, name): ... + def sdiff(self, keys, *args): ... + def sdiffstore(self, dest, keys, *args): ... + def sinter(self, keys, *args): ... + def sinterstore(self, dest, keys, *args): ... + def sismember(self, name, value): ... + def smembers(self, name): ... + def smove(self, src, dst, value): ... + def spop(self, name): ... + def srandmember(self, name, number=...): ... + def srem(self, name, *values): ... + def sunion(self, keys, *args): ... + def sunionstore(self, dest, keys, *args): ... + def xack(self, name, groupname, *ids): ... + def xadd(self, name, fields, id=..., maxlen=..., approximate=...): ... + def xclaim( + self, + name, + groupname, + consumername, + min_idle_time, + message_ids, + idle=..., + time=..., + retrycount=..., + force=..., + justid=..., + ): ... + def xdel(self, name, *ids): ... + def xgroup_create(self, name, groupname, id=..., mkstream=...): ... + def xgroup_delconsumer(self, name, groupname, consumername): ... + def xgroup_destroy(self, name, groupname): ... + def xgroup_setid(self, name, groupname, id): ... + def xinfo_consumers(self, name, groupname): ... + def xinfo_groups(self, name): ... + def xinfo_stream(self, name): ... + def xlen(self, name): ... + def xpending(self, name, groupname): ... + def xpending_range(self, name, groupname, min, max, count, consumername=...): ... + def xrange(self, name, min=..., max=..., count=...): ... + def xread(self, streams, count=..., block=...): ... + def xreadgroup(self, groupname, consumername, streams, count=..., block=..., noack=...): ... + def xrevrange(self, name, max=..., min=..., count=...): ... + def xtrim(self, name, maxlen, approximate=...): ... + def zadd(self, name, mapping, nx: bool = ..., xx: bool = ..., ch: bool = ..., incr: bool = ...): ... + def zcard(self, name): ... + def zcount(self, name, min, max): ... + def zincrby(self, name, value, amount=...): ... + def zinterstore(self, dest, keys, aggregate=...): ... + def zlexcount(self, name, min, max): ... + def zrange(self, name, start, end, desc=..., withscores=..., score_cast_func=...): ... + def zrangebylex(self, name, min, max, start=..., num=...): ... + def zrangebyscore(self, name, min, max, start=..., num=..., withscores=..., score_cast_func=...): ... + def zrank(self, name, value): ... + def zrem(self, name, *values): ... + def zremrangebylex(self, name, min, max): ... + def zremrangebyrank(self, name, min, max): ... + def zremrangebyscore(self, name, min, max): ... + def zrevrange(self, name, start, end, withscores=..., score_cast_func=...): ... + def zrevrangebyscore(self, name, max, min, start=..., num=..., withscores=..., score_cast_func=...): ... + def zrevrank(self, name, value): ... + def zscore(self, name, value): ... + def zunionstore(self, dest, keys, aggregate=...): ... + def pfadd(self, name, *values): ... + def pfcount(self, name): ... + def pfmerge(self, dest, *sources): ... + def hdel(self, name, *keys): ... + def hexists(self, name, key): ... + def hget(self, name, key): ... + def hgetall(self, name): ... + def hincrby(self, name, key, amount=...): ... + def hincrbyfloat(self, name, key, amount=...): ... + def hkeys(self, name): ... + def hlen(self, name): ... + def hset(self, name, key, value): ... + def hsetnx(self, name, key, value): ... + def hmset(self, name, mapping): ... + def hmget(self, name, keys, *args): ... + def hvals(self, name): ... + def publish(self, channel: Text, message: _Str) -> int: ... + def eval(self, script, numkeys, *keys_and_args): ... + def evalsha(self, sha, numkeys, *keys_and_args): ... + def script_exists(self, *args): ... + def script_flush(self): ... + def script_kill(self): ... + def script_load(self, script): ... + def register_script(self, script): ... + def pubsub_channels(self, pattern: Text = ...) -> List[Text]: ... + def pubsub_numsub(self, *args: Text) -> List[Tuple[Text, int]]: ... + def pubsub_numpat(self) -> int: ... + def monitor(self) -> Monitor: ... + +StrictRedis = Redis + +class PubSub: + PUBLISH_MESSAGE_TYPES: Any + UNSUBSCRIBE_MESSAGE_TYPES: Any + connection_pool: Any + shard_hint: Any + ignore_subscribe_messages: Any + connection: Any + encoding: Any + encoding_errors: Any + decode_responses: Any + def __init__(self, connection_pool, shard_hint=..., ignore_subscribe_messages=...) -> None: ... + def __del__(self): ... + channels: Any + patterns: Any + def reset(self): ... + def close(self) -> None: ... + def on_connect(self, connection): ... + def encode(self, value): ... + @property + def subscribed(self): ... + def execute_command(self, *args, **kwargs): ... + def parse_response(self, block=...): ... + def psubscribe(self, *args: Text, **kwargs: Callable[[Any], None]): ... + def punsubscribe(self, *args: Text) -> None: ... + def subscribe(self, *args: Text, **kwargs: Callable[[Any], None]) -> None: ... + def unsubscribe(self, *args: Text) -> None: ... + def listen(self): ... + def get_message(self, ignore_subscribe_messages: bool = ..., timeout: float = ...) -> Optional[Dict[str, Any]]: ... + def handle_message(self, response, ignore_subscribe_messages: bool = ...) -> Optional[Dict[str, Any]]: ... + def run_in_thread(self, sleep_time=...): ... + +class BasePipeline: + UNWATCH_COMMANDS: Any + connection_pool: Any + connection: Any + response_callbacks: Any + transaction: Any + shard_hint: Any + watching: Any + def __init__(self, connection_pool, response_callbacks, transaction, shard_hint) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, traceback): ... + def __del__(self): ... + def __len__(self): ... + command_stack: Any + scripts: Any + explicit_transaction: Any + def reset(self): ... + def multi(self): ... + def execute_command(self, *args, **kwargs): ... + def immediate_execute_command(self, *args, **options): ... + def pipeline_execute_command(self, *args, **options): ... + def raise_first_error(self, commands, response): ... + def annotate_exception(self, exception, number, command): ... + def parse_response(self, connection, command_name, **options): ... + def load_scripts(self): ... + def execute(self, raise_on_error=...): ... + def watch(self, *names): ... + def unwatch(self): ... + def script_load_for_pipeline(self, script): ... + +class StrictPipeline(BasePipeline, StrictRedis): ... +class Pipeline(BasePipeline, Redis): ... + +class Script: + registered_client: Any + script: Any + sha: Any + def __init__(self, registered_client, script) -> None: ... + def __call__(self, keys=..., args=..., client=...): ... + +class Monitor(object): + def __init__(self, connection_pool) -> None: ... + def __enter__(self) -> Monitor: ... + def __exit__(self, *args: Any) -> None: ... + def next_command(self) -> Dict[Text, Any]: ... + def listen(self) -> Iterable[Dict[Text, Any]]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/redis/connection.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/redis/connection.pyi new file mode 100644 index 00000000..4086b6d9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/redis/connection.pyi @@ -0,0 +1,134 @@ +from typing import Any, Text, Optional + +ssl_available: Any +hiredis_version: Any +HIREDIS_SUPPORTS_CALLABLE_ERRORS: Any +HIREDIS_SUPPORTS_BYTE_BUFFER: Any +msg: Any +HIREDIS_USE_BYTE_BUFFER: Any +SYM_STAR: Any +SYM_DOLLAR: Any +SYM_CRLF: Any +SYM_EMPTY: Any +SERVER_CLOSED_CONNECTION_ERROR: Any + +class Token: + value: Any + def __init__(self, value) -> None: ... + +class BaseParser: + EXCEPTION_CLASSES: Any + def parse_error(self, response): ... + +class SocketBuffer: + socket_read_size: Any + bytes_written: Any + bytes_read: Any + def __init__(self, socket, socket_read_size) -> None: ... + @property + def length(self): ... + def read(self, length): ... + def readline(self): ... + def purge(self): ... + def close(self): ... + +class PythonParser(BaseParser): + encoding: Any + socket_read_size: Any + def __init__(self, socket_read_size) -> None: ... + def __del__(self): ... + def on_connect(self, connection): ... + def on_disconnect(self): ... + def can_read(self): ... + def read_response(self): ... + +class HiredisParser(BaseParser): + socket_read_size: Any + def __init__(self, socket_read_size) -> None: ... + def __del__(self): ... + def on_connect(self, connection): ... + def on_disconnect(self): ... + def can_read(self): ... + def read_response(self): ... + +DefaultParser: Any + +class Connection: + description_format: Any + pid: Any + host: Any + port: Any + db: Any + password: Any + socket_timeout: Any + socket_connect_timeout: Any + socket_keepalive: Any + socket_keepalive_options: Any + retry_on_timeout: Any + encoding: Any + encoding_errors: Any + decode_responses: Any + def __init__(self, host=..., port=..., db=..., password=..., socket_timeout=..., socket_connect_timeout=..., + socket_keepalive=..., socket_keepalive_options=..., retry_on_timeout=..., encoding=..., encoding_errors=..., + decode_responses=..., parser_class=..., socket_read_size=...) -> None: ... + def __del__(self): ... + def register_connect_callback(self, callback): ... + def clear_connect_callbacks(self): ... + def connect(self): ... + def on_connect(self): ... + def disconnect(self): ... + def send_packed_command(self, command): ... + def send_command(self, *args): ... + def can_read(self): ... + def read_response(self): ... + def encode(self, value): ... + def pack_command(self, *args): ... + def pack_commands(self, commands): ... + +class SSLConnection(Connection): + description_format: Any + keyfile: Any + certfile: Any + cert_reqs: Any + ca_certs: Any + def __init__(self, ssl_keyfile=..., ssl_certfile=..., ssl_cert_reqs=..., ssl_ca_certs=..., **kwargs) -> None: ... + +class UnixDomainSocketConnection(Connection): + description_format: Any + pid: Any + path: Any + db: Any + password: Any + socket_timeout: Any + retry_on_timeout: Any + encoding: Any + encoding_errors: Any + decode_responses: Any + def __init__(self, path=..., db=..., password=..., socket_timeout=..., encoding=..., encoding_errors=..., + decode_responses=..., retry_on_timeout=..., parser_class=..., socket_read_size=...) -> None: ... + +class ConnectionPool: + @classmethod + def from_url(cls, url: Text, db: Optional[int] = ..., **kwargs) -> ConnectionPool: ... + connection_class: Any + connection_kwargs: Any + max_connections: Any + def __init__(self, connection_class=..., max_connections=..., **connection_kwargs) -> None: ... + pid: Any + def reset(self): ... + def get_connection(self, command_name, *keys, **options): ... + def make_connection(self): ... + def release(self, connection): ... + def disconnect(self): ... + +class BlockingConnectionPool(ConnectionPool): + queue_class: Any + timeout: Any + def __init__(self, max_connections=..., timeout=..., connection_class=..., queue_class=..., **connection_kwargs) -> None: ... + pid: Any + pool: Any + def reset(self): ... + def make_connection(self): ... + def get_connection(self, command_name, *keys, **options): ... + def release(self, connection): ... + def disconnect(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/redis/exceptions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/redis/exceptions.pyi new file mode 100644 index 00000000..e0cd08a8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/redis/exceptions.pyi @@ -0,0 +1,17 @@ +class RedisError(Exception): ... + +def __unicode__(self): ... + +class AuthenticationError(RedisError): ... +class ConnectionError(RedisError): ... +class TimeoutError(RedisError): ... +class BusyLoadingError(ConnectionError): ... +class InvalidResponse(RedisError): ... +class ResponseError(RedisError): ... +class DataError(RedisError): ... +class PubSubError(RedisError): ... +class WatchError(RedisError): ... +class NoScriptError(ResponseError): ... +class ExecAbortError(ResponseError): ... +class ReadOnlyError(ResponseError): ... +class LockError(RedisError, ValueError): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/redis/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/redis/utils.pyi new file mode 100644 index 00000000..9559abbc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/redis/utils.pyi @@ -0,0 +1,8 @@ +from typing import Any + +HIREDIS_AVAILABLE: Any + +def from_url(url, db=..., **kwargs): ... +def pipeline(redis_obj): ... + +class dummy: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/__init__.pyi new file mode 100644 index 00000000..7705d78b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/__init__.pyi @@ -0,0 +1,40 @@ +# Stubs for requests (based on version 2.6.0, Python 3) + +from typing import Any +from . import models +from . import api +from . import sessions +from . import status_codes +from . import exceptions +from . import packages +import logging + +__title__: Any +__build__: Any +__license__: Any +__copyright__: Any +__version__: Any + +Request = models.Request +Response = models.Response +PreparedRequest = models.PreparedRequest +request = api.request +get = api.get +head = api.head +post = api.post +patch = api.patch +put = api.put +delete = api.delete +options = api.options +session = sessions.session +Session = sessions.Session +codes = status_codes.codes +RequestException = exceptions.RequestException +Timeout = exceptions.Timeout +URLRequired = exceptions.URLRequired +TooManyRedirects = exceptions.TooManyRedirects +HTTPError = exceptions.HTTPError +ConnectionError = exceptions.ConnectionError + +class NullHandler(logging.Handler): + def emit(self, record): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/adapters.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/adapters.pyi new file mode 100644 index 00000000..19005675 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/adapters.pyi @@ -0,0 +1,79 @@ +# Stubs for requests.adapters (Python 3) + +from typing import Any, Container, Union, Text, Tuple, Optional, Mapping +from . import models +from .packages.urllib3 import poolmanager +from .packages.urllib3 import response +from .packages.urllib3.util import retry +from . import compat +from . import utils +from . import structures +from .packages.urllib3 import exceptions as urllib3_exceptions +from . import cookies +from . import exceptions +from . import auth + +PreparedRequest = models.PreparedRequest +Response = models.Response +PoolManager = poolmanager.PoolManager +proxy_from_url = poolmanager.proxy_from_url +HTTPResponse = response.HTTPResponse +Retry = retry.Retry +DEFAULT_CA_BUNDLE_PATH = utils.DEFAULT_CA_BUNDLE_PATH +get_encoding_from_headers = utils.get_encoding_from_headers +prepend_scheme_if_needed = utils.prepend_scheme_if_needed +get_auth_from_url = utils.get_auth_from_url +urldefragauth = utils.urldefragauth +CaseInsensitiveDict = structures.CaseInsensitiveDict +ConnectTimeoutError = urllib3_exceptions.ConnectTimeoutError +MaxRetryError = urllib3_exceptions.MaxRetryError +ProtocolError = urllib3_exceptions.ProtocolError +ReadTimeoutError = urllib3_exceptions.ReadTimeoutError +ResponseError = urllib3_exceptions.ResponseError +extract_cookies_to_jar = cookies.extract_cookies_to_jar +ConnectionError = exceptions.ConnectionError +ConnectTimeout = exceptions.ConnectTimeout +ReadTimeout = exceptions.ReadTimeout +SSLError = exceptions.SSLError +ProxyError = exceptions.ProxyError +RetryError = exceptions.RetryError + +DEFAULT_POOLBLOCK: Any +DEFAULT_POOLSIZE: Any +DEFAULT_RETRIES: Any + +class BaseAdapter: + def __init__(self) -> None: ... + def send(self, + request: PreparedRequest, + stream: bool = ..., + timeout: Union[None, float, Tuple[float, float]] = ..., + verify: Union[bool, str] = ..., + cert: Union[None, Union[bytes, Text], Container[Union[bytes, Text]]] = ..., + proxies: Optional[Mapping[str, str]] = ...) -> Response: ... + def close(self) -> None: ... + +class HTTPAdapter(BaseAdapter): + __attrs__: Any + max_retries: Any + config: Any + proxy_manager: Any + def __init__(self, pool_connections=..., pool_maxsize=..., max_retries=..., + pool_block=...) -> None: ... + poolmanager: Any + def init_poolmanager(self, connections, maxsize, block=..., **pool_kwargs): ... + def proxy_manager_for(self, proxy, **proxy_kwargs): ... + def cert_verify(self, conn, url, verify, cert): ... + def build_response(self, req, resp): ... + def get_connection(self, url, proxies=...): ... + def close(self): ... + def request_url(self, request, proxies): ... + def add_headers(self, request, **kwargs): ... + def proxy_headers(self, proxy): ... + def send(self, + request: PreparedRequest, + stream: bool = ..., + timeout: Union[None, float, Tuple[float, float]] = ..., + verify: Union[bool, str] = ..., + cert: Union[None, Union[bytes, Text], Container[Union[bytes, Text]]] = ..., + proxies: Optional[Mapping[str, str]] = ...) -> Response: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/api.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/api.pyi new file mode 100644 index 00000000..1f994aa9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/api.pyi @@ -0,0 +1,32 @@ +# Stubs for requests.api (Python 3) + +import sys +from typing import Optional, Union, Any, Iterable, Mapping, MutableMapping, Tuple, IO, Text + +from .models import Response +from .sessions import _Data + +_ParamsMappingValueType = Union[Text, bytes, int, float, Iterable[Union[Text, bytes, int, float]]] + +def request(method: str, url: str, **kwargs) -> Response: ... +def get( + url: Union[Text, bytes], + params: Optional[ + Union[ + Mapping[Union[Text, bytes, int, float], _ParamsMappingValueType], + Union[Text, bytes], + Tuple[Union[Text, bytes, int, float], _ParamsMappingValueType], + Mapping[Text, _ParamsMappingValueType], + Mapping[bytes, _ParamsMappingValueType], + Mapping[int, _ParamsMappingValueType], + Mapping[float, _ParamsMappingValueType], + ] + ] = ..., + **kwargs, +) -> Response: ... +def options(url: Union[Text, bytes], **kwargs) -> Response: ... +def head(url: Union[Text, bytes], **kwargs) -> Response: ... +def post(url: Union[Text, bytes], data: _Data = ..., json=..., **kwargs) -> Response: ... +def put(url: Union[Text, bytes], data: _Data = ..., json=..., **kwargs) -> Response: ... +def patch(url: Union[Text, bytes], data: _Data = ..., json=..., **kwargs) -> Response: ... +def delete(url: Union[Text, bytes], **kwargs) -> Response: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/auth.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/auth.pyi new file mode 100644 index 00000000..48d4b08c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/auth.pyi @@ -0,0 +1,44 @@ +# Stubs for requests.auth (Python 3) + +from typing import Any, Text, Union +from . import compat +from . import cookies +from . import models +from . import utils +from . import status_codes + +extract_cookies_to_jar = cookies.extract_cookies_to_jar +parse_dict_header = utils.parse_dict_header +to_native_string = utils.to_native_string +codes = status_codes.codes + +CONTENT_TYPE_FORM_URLENCODED: Any +CONTENT_TYPE_MULTI_PART: Any + +def _basic_auth_str(username: Union[bytes, Text], password: Union[bytes, Text]) -> str: ... + +class AuthBase: + def __call__(self, r: models.PreparedRequest) -> models.PreparedRequest: ... + +class HTTPBasicAuth(AuthBase): + username: Any + password: Any + def __init__(self, username, password) -> None: ... + def __call__(self, r): ... + +class HTTPProxyAuth(HTTPBasicAuth): + def __call__(self, r): ... + +class HTTPDigestAuth(AuthBase): + username: Any + password: Any + last_nonce: Any + nonce_count: Any + chal: Any + pos: Any + num_401_calls: Any + def __init__(self, username, password) -> None: ... + def build_digest_header(self, method, url): ... + def handle_redirect(self, r, **kwargs): ... + def handle_401(self, r, **kwargs): ... + def __call__(self, r): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/compat.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/compat.pyi new file mode 100644 index 00000000..63b92f6f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/compat.pyi @@ -0,0 +1,6 @@ +# Stubs for requests.compat (Python 3.4) + +from typing import Any +import collections + +OrderedDict = collections.OrderedDict diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/cookies.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/cookies.pyi new file mode 100644 index 00000000..cf25c255 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/cookies.pyi @@ -0,0 +1,67 @@ +# Stubs for requests.cookies (Python 3) + +import sys +from typing import Any, MutableMapping +import collections +from . import compat + +if sys.version_info < (3, 0): + from cookielib import CookieJar +else: + from http.cookiejar import CookieJar + +class MockRequest: + type: Any + def __init__(self, request) -> None: ... + def get_type(self): ... + def get_host(self): ... + def get_origin_req_host(self): ... + def get_full_url(self): ... + def is_unverifiable(self): ... + def has_header(self, name): ... + def get_header(self, name, default=...): ... + def add_header(self, key, val): ... + def add_unredirected_header(self, name, value): ... + def get_new_headers(self): ... + @property + def unverifiable(self): ... + @property + def origin_req_host(self): ... + @property + def host(self): ... + +class MockResponse: + def __init__(self, headers) -> None: ... + def info(self): ... + def getheaders(self, name): ... + +def extract_cookies_to_jar(jar, request, response): ... +def get_cookie_header(jar, request): ... +def remove_cookie_by_name(cookiejar, name, domain=..., path=...): ... + +class CookieConflictError(RuntimeError): ... + +class RequestsCookieJar(CookieJar, MutableMapping[Any, Any]): + def get(self, name, default=..., domain=..., path=...): ... + def set(self, name, value, **kwargs): ... + def iterkeys(self): ... + def keys(self): ... + def itervalues(self): ... + def values(self): ... + def iteritems(self): ... + def items(self): ... + def list_domains(self): ... + def list_paths(self): ... + def multiple_domains(self): ... + def get_dict(self, domain=..., path=...): ... + def __getitem__(self, name): ... + def __setitem__(self, name, value): ... + def __delitem__(self, name): ... + def set_cookie(self, cookie, *args, **kwargs): ... + def update(self, other): ... + def copy(self): ... + +def create_cookie(name, value, **kwargs): ... +def morsel_to_cookie(morsel): ... +def cookiejar_from_dict(cookie_dict, cookiejar=..., overwrite=...): ... +def merge_cookies(cookiejar, cookies): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/exceptions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/exceptions.pyi new file mode 100644 index 00000000..36696928 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/exceptions.pyi @@ -0,0 +1,26 @@ +# Stubs for requests.exceptions (Python 3) + +from typing import Any +from .packages.urllib3.exceptions import HTTPError as BaseHTTPError + +class RequestException(IOError): + response: Any + request: Any + def __init__(self, *args, **kwargs) -> None: ... + +class HTTPError(RequestException): ... +class ConnectionError(RequestException): ... +class ProxyError(ConnectionError): ... +class SSLError(ConnectionError): ... +class Timeout(RequestException): ... +class ConnectTimeout(ConnectionError, Timeout): ... +class ReadTimeout(Timeout): ... +class URLRequired(RequestException): ... +class TooManyRedirects(RequestException): ... +class MissingSchema(RequestException, ValueError): ... +class InvalidSchema(RequestException, ValueError): ... +class InvalidURL(RequestException, ValueError): ... +class ChunkedEncodingError(RequestException): ... +class ContentDecodingError(RequestException, BaseHTTPError): ... +class StreamConsumedError(RequestException, TypeError): ... +class RetryError(RequestException): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/hooks.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/hooks.pyi new file mode 100644 index 00000000..278076ad --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/hooks.pyi @@ -0,0 +1,8 @@ +# Stubs for requests.hooks (Python 3) + +from typing import Any + +HOOKS: Any + +def default_hooks(): ... +def dispatch_hook(key, hooks, hook_data, **kwargs): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/models.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/models.pyi new file mode 100644 index 00000000..ee98344c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/models.pyi @@ -0,0 +1,144 @@ +# Stubs for requests.models (Python 3) + +from typing import (Any, Dict, Iterator, List, MutableMapping, Optional, Text, + Union) +import datetime +import types + +from . import hooks +from . import structures +from . import auth +from . import cookies +from .cookies import RequestsCookieJar +from .packages.urllib3 import fields +from .packages.urllib3 import filepost +from .packages.urllib3 import util +from .packages.urllib3 import exceptions as urllib3_exceptions +from . import exceptions +from . import utils +from . import compat +from . import status_codes + + +default_hooks = hooks.default_hooks +CaseInsensitiveDict = structures.CaseInsensitiveDict +HTTPBasicAuth = auth.HTTPBasicAuth +cookiejar_from_dict = cookies.cookiejar_from_dict +get_cookie_header = cookies.get_cookie_header +RequestField = fields.RequestField +encode_multipart_formdata = filepost.encode_multipart_formdata +parse_url = util.parse_url +DecodeError = urllib3_exceptions.DecodeError +ReadTimeoutError = urllib3_exceptions.ReadTimeoutError +ProtocolError = urllib3_exceptions.ProtocolError +LocationParseError = urllib3_exceptions.LocationParseError +HTTPError = exceptions.HTTPError +MissingSchema = exceptions.MissingSchema +InvalidURL = exceptions.InvalidURL +ChunkedEncodingError = exceptions.ChunkedEncodingError +ContentDecodingError = exceptions.ContentDecodingError +ConnectionError = exceptions.ConnectionError +StreamConsumedError = exceptions.StreamConsumedError +guess_filename = utils.guess_filename +get_auth_from_url = utils.get_auth_from_url +requote_uri = utils.requote_uri +stream_decode_response_unicode = utils.stream_decode_response_unicode +to_key_val_list = utils.to_key_val_list +parse_header_links = utils.parse_header_links +iter_slices = utils.iter_slices +guess_json_utf = utils.guess_json_utf +super_len = utils.super_len +to_native_string = utils.to_native_string +codes = status_codes.codes + +REDIRECT_STATI: Any +DEFAULT_REDIRECT_LIMIT: Any +CONTENT_CHUNK_SIZE: Any +ITER_CHUNK_SIZE: Any +json_dumps: Any + +class RequestEncodingMixin: + @property + def path_url(self): ... + +class RequestHooksMixin: + def register_hook(self, event, hook): ... + def deregister_hook(self, event, hook): ... + +class Request(RequestHooksMixin): + hooks: Any + method: Any + url: Any + headers: Any + files: Any + data: Any + json: Any + params: Any + auth: Any + cookies: Any + def __init__(self, method=..., url=..., headers=..., files=..., data=..., params=..., + auth=..., cookies=..., hooks=..., json=...) -> None: ... + def prepare(self): ... + +class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): + method: Optional[Union[str, Text]] + url: Optional[Union[str, Text]] + headers: CaseInsensitiveDict[str] + body: Optional[Union[bytes, Text]] + hooks: Any + def __init__(self) -> None: ... + def prepare(self, method=..., url=..., headers=..., files=..., data=..., params=..., + auth=..., cookies=..., hooks=..., json=...): ... + def copy(self): ... + def prepare_method(self, method): ... + def prepare_url(self, url, params): ... + def prepare_headers(self, headers): ... + def prepare_body(self, data, files, json=...): ... + def prepare_content_length(self, body): ... + def prepare_auth(self, auth, url=...): ... + def prepare_cookies(self, cookies): ... + def prepare_hooks(self, hooks): ... + +class Response: + __attrs__: Any + status_code: int + headers: MutableMapping[str, str] + raw: Any + url: str + encoding: str + history: List[Response] + reason: str + cookies: RequestsCookieJar + elapsed: datetime.timedelta + request: PreparedRequest + def __init__(self) -> None: ... + def __bool__(self) -> bool: ... + def __nonzero__(self) -> bool: ... + def __iter__(self) -> Iterator[bytes]: ... + def __enter__(self) -> Response: ... + def __exit__(self, *args: Any) -> None: ... + @property + def next(self) -> Optional[PreparedRequest]: ... + @property + def ok(self) -> bool: ... + @property + def is_redirect(self) -> bool: ... + @property + def is_permanent_redirect(self) -> bool: ... + @property + def apparent_encoding(self) -> str: ... + def iter_content(self, chunk_size: Optional[int] = ..., + decode_unicode: bool = ...) -> Iterator[Any]: ... + def iter_lines(self, + chunk_size: Optional[int] = ..., + decode_unicode: bool = ..., + delimiter: Union[Text, bytes] = ...) -> Iterator[Any]: ... + @property + def content(self) -> bytes: ... + @property + def text(self) -> str: ... + def json(self, **kwargs) -> Any: ... + @property + def links(self) -> Dict[Any, Any]: ... + def raise_for_status(self) -> None: ... + def close(self) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/__init__.pyi new file mode 100644 index 00000000..b50dba35 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/__init__.pyi @@ -0,0 +1,4 @@ +class VendorAlias: + def __init__(self, package_names) -> None: ... + def find_module(self, fullname, path=...): ... + def load_module(self, name): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/__init__.pyi new file mode 100644 index 00000000..f575800c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/__init__.pyi @@ -0,0 +1,31 @@ +from typing import Any +from . import connectionpool +from . import filepost +from . import poolmanager +from . import response +from .util import request as _request +from .util import url +from .util import timeout +from .util import retry +import logging + +__license__: Any + +HTTPConnectionPool = connectionpool.HTTPConnectionPool +HTTPSConnectionPool = connectionpool.HTTPSConnectionPool +connection_from_url = connectionpool.connection_from_url +encode_multipart_formdata = filepost.encode_multipart_formdata +PoolManager = poolmanager.PoolManager +ProxyManager = poolmanager.ProxyManager +proxy_from_url = poolmanager.proxy_from_url +HTTPResponse = response.HTTPResponse +make_headers = _request.make_headers +get_host = url.get_host +Timeout = timeout.Timeout +Retry = retry.Retry + +class NullHandler(logging.Handler): + def emit(self, record): ... + +def add_stderr_logger(level=...): ... +def disable_warnings(category=...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/_collections.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/_collections.pyi new file mode 100644 index 00000000..b9f1f443 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/_collections.pyi @@ -0,0 +1,52 @@ +from typing import Any, NoReturn, TypeVar +from collections import MutableMapping + +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") + +class RLock: + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, traceback): ... + +class RecentlyUsedContainer(MutableMapping[_KT, _VT]): + ContainerCls: Any + dispose_func: Any + lock: Any + def __init__(self, maxsize=..., dispose_func=...) -> None: ... + def __getitem__(self, key): ... + def __setitem__(self, key, value): ... + def __delitem__(self, key): ... + def __len__(self): ... + def __iter__(self): ... + def clear(self): ... + def keys(self): ... + +class HTTPHeaderDict(MutableMapping[str, str]): + def __init__(self, headers=..., **kwargs) -> None: ... + def __setitem__(self, key, val): ... + def __getitem__(self, key): ... + def __delitem__(self, key): ... + def __contains__(self, key): ... + def __eq__(self, other): ... + def __iter__(self) -> NoReturn: ... + def __len__(self) -> int: ... + def __ne__(self, other): ... + values: Any + get: Any + update: Any + iterkeys: Any + itervalues: Any + def pop(self, key, default=...): ... + def discard(self, key): ... + def add(self, key, val): ... + def extend(self, *args, **kwargs): ... + def getlist(self, key): ... + getheaders: Any + getallmatchingheaders: Any + iget: Any + def copy(self): ... + def iteritems(self): ... + def itermerged(self): ... + def items(self): ... + @classmethod + def from_httplib(cls, message, duplicates=...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connection.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connection.pyi new file mode 100644 index 00000000..99af0278 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connection.pyi @@ -0,0 +1,71 @@ +# Stubs for requests.packages.urllib3.connection (Python 3.4) + +import sys +from typing import Any +from . import packages +import ssl +from . import exceptions +from .packages import ssl_match_hostname +from .util import ssl_ +from . import util + +if sys.version_info < (3, 0): + from httplib import HTTPConnection as _HTTPConnection + from httplib import HTTPException as HTTPException + + class ConnectionError(Exception): ... +else: + from http.client import HTTPConnection as _HTTPConnection + from http.client import HTTPException as HTTPException + from builtins import ConnectionError as ConnectionError + + +class DummyConnection: ... + +BaseSSLError = ssl.SSLError + +ConnectTimeoutError = exceptions.ConnectTimeoutError +SystemTimeWarning = exceptions.SystemTimeWarning +SecurityWarning = exceptions.SecurityWarning +match_hostname = ssl_match_hostname.match_hostname +resolve_cert_reqs = ssl_.resolve_cert_reqs +resolve_ssl_version = ssl_.resolve_ssl_version +ssl_wrap_socket = ssl_.ssl_wrap_socket +assert_fingerprint = ssl_.assert_fingerprint +connection = util.connection + +port_by_scheme: Any +RECENT_DATE: Any + +class HTTPConnection(_HTTPConnection): + default_port: Any + default_socket_options: Any + is_verified: Any + source_address: Any + socket_options: Any + def __init__(self, *args, **kw) -> None: ... + def connect(self): ... + +class HTTPSConnection(HTTPConnection): + default_port: Any + key_file: Any + cert_file: Any + def __init__(self, host, port=..., key_file=..., cert_file=..., strict=..., timeout=..., **kw) -> None: ... + sock: Any + def connect(self): ... + +class VerifiedHTTPSConnection(HTTPSConnection): + cert_reqs: Any + ca_certs: Any + ssl_version: Any + assert_fingerprint: Any + key_file: Any + cert_file: Any + assert_hostname: Any + def set_cert(self, key_file=..., cert_file=..., cert_reqs=..., ca_certs=..., assert_hostname=..., assert_fingerprint=...): ... + sock: Any + auto_open: Any + is_verified: Any + def connect(self): ... + +UnverifiedHTTPSConnection = HTTPSConnection diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connectionpool.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connectionpool.pyi new file mode 100644 index 00000000..a4e8ac1f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/connectionpool.pyi @@ -0,0 +1,85 @@ +from typing import Any +from . import exceptions +from .packages import ssl_match_hostname +from . import packages +from .connection import ( + HTTPException as HTTPException, + BaseSSLError as BaseSSLError, + ConnectionError as ConnectionError, +) +from . import request +from . import response +from . import connection +from .util import connection as _connection +from .util import retry +from .util import timeout +from .util import url + +ClosedPoolError = exceptions.ClosedPoolError +ProtocolError = exceptions.ProtocolError +EmptyPoolError = exceptions.EmptyPoolError +HostChangedError = exceptions.HostChangedError +LocationValueError = exceptions.LocationValueError +MaxRetryError = exceptions.MaxRetryError +ProxyError = exceptions.ProxyError +ReadTimeoutError = exceptions.ReadTimeoutError +SSLError = exceptions.SSLError +TimeoutError = exceptions.TimeoutError +InsecureRequestWarning = exceptions.InsecureRequestWarning +CertificateError = ssl_match_hostname.CertificateError +port_by_scheme = connection.port_by_scheme +DummyConnection = connection.DummyConnection +HTTPConnection = connection.HTTPConnection +HTTPSConnection = connection.HTTPSConnection +VerifiedHTTPSConnection = connection.VerifiedHTTPSConnection +RequestMethods = request.RequestMethods +HTTPResponse = response.HTTPResponse +is_connection_dropped = _connection.is_connection_dropped +Retry = retry.Retry +Timeout = timeout.Timeout +get_host = url.get_host + +xrange: Any +log: Any + +class ConnectionPool: + scheme: Any + QueueCls: Any + host: Any + port: Any + def __init__(self, host, port=...) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_val, exc_tb): ... + def close(self): ... + +class HTTPConnectionPool(ConnectionPool, RequestMethods): + scheme: Any + ConnectionCls: Any + strict: Any + timeout: Any + retries: Any + pool: Any + block: Any + proxy: Any + proxy_headers: Any + num_connections: Any + num_requests: Any + conn_kw: Any + def __init__(self, host, port=..., strict=..., timeout=..., maxsize=..., block=..., headers=..., retries=..., _proxy=..., _proxy_headers=..., **conn_kw) -> None: ... + def close(self): ... + def is_same_host(self, url): ... + def urlopen(self, method, url, body=..., headers=..., retries=..., redirect=..., assert_same_host=..., timeout=..., pool_timeout=..., release_conn=..., **response_kw): ... + +class HTTPSConnectionPool(HTTPConnectionPool): + scheme: Any + ConnectionCls: Any + key_file: Any + cert_file: Any + cert_reqs: Any + ca_certs: Any + ssl_version: Any + assert_hostname: Any + assert_fingerprint: Any + def __init__(self, host, port=..., strict=..., timeout=..., maxsize=..., block=..., headers=..., retries=..., _proxy=..., _proxy_headers=..., key_file=..., cert_file=..., cert_reqs=..., ca_certs=..., ssl_version=..., assert_hostname=..., assert_fingerprint=..., **conn_kw) -> None: ... + +def connection_from_url(url, **kw): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/contrib/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/contrib/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/exceptions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/exceptions.pyi new file mode 100644 index 00000000..ddb4e83b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/exceptions.pyi @@ -0,0 +1,50 @@ +from typing import Any + +class HTTPError(Exception): ... +class HTTPWarning(Warning): ... + +class PoolError(HTTPError): + pool: Any + def __init__(self, pool, message) -> None: ... + def __reduce__(self): ... + +class RequestError(PoolError): + url: Any + def __init__(self, pool, url, message) -> None: ... + def __reduce__(self): ... + +class SSLError(HTTPError): ... +class ProxyError(HTTPError): ... +class DecodeError(HTTPError): ... +class ProtocolError(HTTPError): ... + +ConnectionError: Any + +class MaxRetryError(RequestError): + reason: Any + def __init__(self, pool, url, reason=...) -> None: ... + +class HostChangedError(RequestError): + retries: Any + def __init__(self, pool, url, retries=...) -> None: ... + +class TimeoutStateError(HTTPError): ... +class TimeoutError(HTTPError): ... +class ReadTimeoutError(TimeoutError, RequestError): ... +class ConnectTimeoutError(TimeoutError): ... +class EmptyPoolError(PoolError): ... +class ClosedPoolError(PoolError): ... +class LocationValueError(ValueError, HTTPError): ... + +class LocationParseError(LocationValueError): + location: Any + def __init__(self, location) -> None: ... + +class ResponseError(HTTPError): + GENERIC_ERROR: Any + SPECIFIC_ERROR: Any + +class SecurityWarning(HTTPWarning): ... +class InsecureRequestWarning(SecurityWarning): ... +class SystemTimeWarning(SecurityWarning): ... +class InsecurePlatformWarning(SecurityWarning): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/fields.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/fields.pyi new file mode 100644 index 00000000..9d691dcf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/fields.pyi @@ -0,0 +1,16 @@ +# Stubs for requests.packages.urllib3.fields (Python 3.4) + +from typing import Any +from . import packages + +def guess_content_type(filename, default=...): ... +def format_header_param(name, value): ... + +class RequestField: + data: Any + headers: Any + def __init__(self, name, data, filename=..., headers=...) -> None: ... + @classmethod + def from_tuples(cls, fieldname, value): ... + def render_headers(self): ... + def make_multipart(self, content_disposition=..., content_type=..., content_location=...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/filepost.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/filepost.pyi new file mode 100644 index 00000000..afcc837b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/filepost.pyi @@ -0,0 +1,15 @@ +from typing import Any +from . import packages +# from .packages import six +from . import fields + +# six = packages.six +# b = six.b +RequestField = fields.RequestField + +writer: Any + +def choose_boundary(): ... +def iter_field_objects(fields): ... +def iter_fields(fields): ... +def encode_multipart_formdata(fields, boundary=...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi new file mode 100644 index 00000000..1915c0e5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi @@ -0,0 +1,4 @@ +import ssl + +CertificateError = ssl.CertificateError +match_hostname = ssl.match_hostname diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi new file mode 100644 index 00000000..c2199801 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi @@ -0,0 +1,3 @@ +class CertificateError(ValueError): ... + +def match_hostname(cert, hostname): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/poolmanager.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/poolmanager.pyi new file mode 100644 index 00000000..9568488f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/poolmanager.pyi @@ -0,0 +1,27 @@ +from typing import Any +from .request import RequestMethods + +class PoolManager(RequestMethods): + proxy: Any + connection_pool_kw: Any + pools: Any + def __init__(self, num_pools=..., headers=..., **connection_pool_kw) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_val, exc_tb): ... + def clear(self): ... + def connection_from_host(self, host, port=..., scheme=...): ... + def connection_from_url(self, url): ... + # TODO: This was the original signature -- copied another one from base class to fix complaint. + # def urlopen(self, method, url, redirect=True, **kw): ... + def urlopen(self, method, url, body=..., headers=..., encode_multipart=..., multipart_boundary=..., **kw): ... + +class ProxyManager(PoolManager): + proxy: Any + proxy_headers: Any + def __init__(self, proxy_url, num_pools=..., headers=..., proxy_headers=..., **connection_pool_kw) -> None: ... + def connection_from_host(self, host, port=..., scheme=...): ... + # TODO: This was the original signature -- copied another one from base class to fix complaint. + # def urlopen(self, method, url, redirect=True, **kw): ... + def urlopen(self, method, url, body=..., headers=..., encode_multipart=..., multipart_boundary=..., **kw): ... + +def proxy_from_url(url, **kw): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/request.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/request.pyi new file mode 100644 index 00000000..fd79126d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/request.pyi @@ -0,0 +1,9 @@ +from typing import Any + +class RequestMethods: + headers: Any + def __init__(self, headers=...) -> None: ... + def urlopen(self, method, url, body=..., headers=..., encode_multipart=..., multipart_boundary=..., **kw): ... + def request(self, method, url, fields=..., headers=..., **urlopen_kw): ... + def request_encode_url(self, method, url, fields=..., **urlopen_kw): ... + def request_encode_body(self, method, url, fields=..., headers=..., encode_multipart=..., multipart_boundary=..., **urlopen_kw): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/response.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/response.pyi new file mode 100644 index 00000000..de0aa330 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/response.pyi @@ -0,0 +1,53 @@ +from typing import Any +import io +from . import _collections +from . import exceptions +from .connection import HTTPException as HTTPException, BaseSSLError as BaseSSLError +from .util import response + +HTTPHeaderDict = _collections.HTTPHeaderDict +ProtocolError = exceptions.ProtocolError +DecodeError = exceptions.DecodeError +ReadTimeoutError = exceptions.ReadTimeoutError +binary_type = bytes # six.binary_type +PY3 = True # six.PY3 +is_fp_closed = response.is_fp_closed + +class DeflateDecoder: + def __init__(self) -> None: ... + def __getattr__(self, name): ... + def decompress(self, data): ... + +class GzipDecoder: + def __init__(self) -> None: ... + def __getattr__(self, name): ... + def decompress(self, data): ... + +class HTTPResponse(io.IOBase): + CONTENT_DECODERS: Any + REDIRECT_STATUSES: Any + headers: Any + status: Any + version: Any + reason: Any + strict: Any + decode_content: Any + def __init__(self, body=..., headers=..., status=..., version=..., reason=..., strict=..., preload_content=..., decode_content=..., original_response=..., pool=..., connection=...) -> None: ... + def get_redirect_location(self): ... + def release_conn(self): ... + @property + def data(self): ... + def tell(self): ... + def read(self, amt=..., decode_content=..., cache_content=...): ... + def stream(self, amt=..., decode_content=...): ... + @classmethod + def from_httplib(cls, r, **response_kw): ... + def getheaders(self): ... + def getheader(self, name, default=...): ... + def close(self): ... + @property + def closed(self): ... + def fileno(self): ... + def flush(self): ... + def readable(self): ... + def readinto(self, b): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/__init__.pyi new file mode 100644 index 00000000..53bdac9b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/__init__.pyi @@ -0,0 +1,25 @@ +from . import connection +from . import request +from . import response +from . import ssl_ +from . import timeout +from . import retry +from . import url +import ssl + +is_connection_dropped = connection.is_connection_dropped +make_headers = request.make_headers +is_fp_closed = response.is_fp_closed +SSLContext = ssl.SSLContext +HAS_SNI = ssl_.HAS_SNI +assert_fingerprint = ssl_.assert_fingerprint +resolve_cert_reqs = ssl_.resolve_cert_reqs +resolve_ssl_version = ssl_.resolve_ssl_version +ssl_wrap_socket = ssl_.ssl_wrap_socket +current_time = timeout.current_time +Timeout = timeout.Timeout +Retry = retry.Retry +get_host = url.get_host +parse_url = url.parse_url +split_first = url.split_first +Url = url.Url diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/connection.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/connection.pyi new file mode 100644 index 00000000..db77bd00 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/connection.pyi @@ -0,0 +1,8 @@ +from typing import Any + +poll: Any +select: Any +HAS_IPV6: bool + +def is_connection_dropped(conn): ... +def create_connection(address, timeout=..., source_address=..., socket_options=...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/request.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/request.pyi new file mode 100644 index 00000000..a7e112f1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/request.pyi @@ -0,0 +1,8 @@ +from typing import Any +# from ..packages import six + +# b = six.b + +ACCEPT_ENCODING: Any + +def make_headers(keep_alive=..., accept_encoding=..., user_agent=..., basic_auth=..., proxy_basic_auth=..., disable_cache=...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/response.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/response.pyi new file mode 100644 index 00000000..30463da4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/response.pyi @@ -0,0 +1 @@ +def is_fp_closed(obj): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/retry.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/retry.pyi new file mode 100644 index 00000000..c7c21786 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/retry.pyi @@ -0,0 +1,32 @@ +from typing import Any +from .. import exceptions +from .. import packages + +ConnectTimeoutError = exceptions.ConnectTimeoutError +MaxRetryError = exceptions.MaxRetryError +ProtocolError = exceptions.ProtocolError +ReadTimeoutError = exceptions.ReadTimeoutError +ResponseError = exceptions.ResponseError + +log: Any + +class Retry: + DEFAULT_METHOD_WHITELIST: Any + BACKOFF_MAX: Any + total: Any + connect: Any + read: Any + redirect: Any + status_forcelist: Any + method_whitelist: Any + backoff_factor: Any + raise_on_redirect: Any + def __init__(self, total=..., connect=..., read=..., redirect=..., method_whitelist=..., status_forcelist=..., backoff_factor=..., raise_on_redirect=..., _observed_errors=...) -> None: ... + def new(self, **kw): ... + @classmethod + def from_int(cls, retries, redirect=..., default=...): ... + def get_backoff_time(self): ... + def sleep(self): ... + def is_forced_retry(self, method, status_code): ... + def is_exhausted(self): ... + def increment(self, method=..., url=..., response=..., error=..., _pool=..., _stacktrace=...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/ssl_.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/ssl_.pyi new file mode 100644 index 00000000..fe1a3a0d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/ssl_.pyi @@ -0,0 +1,20 @@ +from typing import Any +from .. import exceptions +import ssl + +SSLError = exceptions.SSLError +InsecurePlatformWarning = exceptions.InsecurePlatformWarning +SSLContext = ssl.SSLContext + +HAS_SNI: Any +create_default_context: Any +OP_NO_SSLv2: Any +OP_NO_SSLv3: Any +OP_NO_COMPRESSION: Any + +def assert_fingerprint(cert, fingerprint): ... +def resolve_cert_reqs(candidate): ... +def resolve_ssl_version(candidate): ... +def create_urllib3_context(ssl_version=..., cert_reqs=..., options=..., ciphers=...): ... +def ssl_wrap_socket(sock, keyfile=..., certfile=..., cert_reqs=..., ca_certs=..., + server_hostname=..., ssl_version=..., ciphers=..., ssl_context=...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/timeout.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/timeout.pyi new file mode 100644 index 00000000..0f3c97ca --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/timeout.pyi @@ -0,0 +1,20 @@ +from typing import Any +from .. import exceptions + +TimeoutStateError = exceptions.TimeoutStateError + +def current_time(): ... + +class Timeout: + DEFAULT_TIMEOUT: Any + total: Any + def __init__(self, total=..., connect=..., read=...) -> None: ... + @classmethod + def from_float(cls, timeout): ... + def clone(self): ... + def start_connect(self): ... + def get_connect_duration(self): ... + @property + def connect_timeout(self): ... + @property + def read_timeout(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/url.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/url.pyi new file mode 100644 index 00000000..0e40ba5a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/packages/urllib3/util/url.pyi @@ -0,0 +1,22 @@ +from typing import Any +from .. import exceptions + +LocationParseError = exceptions.LocationParseError + +url_attrs: Any + +class Url: + slots: Any + def __new__(cls, scheme=..., auth=..., host=..., port=..., path=..., query=..., fragment=...): ... + @property + def hostname(self): ... + @property + def request_uri(self): ... + @property + def netloc(self): ... + @property + def url(self): ... + +def split_first(s, delims): ... +def parse_url(url): ... +def get_host(url): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/sessions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/sessions.pyi new file mode 100644 index 00000000..f09dbec2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/sessions.pyi @@ -0,0 +1,113 @@ +# Stubs for requests.sessions (Python 3) + +from typing import Any, Union, List, MutableMapping, Text, Optional, IO, Tuple, Callable, Iterable +from . import adapters +from . import auth as _auth +from . import compat +from . import cookies +from . import models +from .models import Response +from . import hooks +from . import utils +from . import exceptions +from .packages.urllib3 import _collections +from . import structures +from . import status_codes + +BaseAdapter = adapters.BaseAdapter +OrderedDict = compat.OrderedDict +cookiejar_from_dict = cookies.cookiejar_from_dict +extract_cookies_to_jar = cookies.extract_cookies_to_jar +RequestsCookieJar = cookies.RequestsCookieJar +merge_cookies = cookies.merge_cookies +Request = models.Request +PreparedRequest = models.PreparedRequest +DEFAULT_REDIRECT_LIMIT = models.DEFAULT_REDIRECT_LIMIT +default_hooks = hooks.default_hooks +dispatch_hook = hooks.dispatch_hook +to_key_val_list = utils.to_key_val_list +default_headers = utils.default_headers +to_native_string = utils.to_native_string +TooManyRedirects = exceptions.TooManyRedirects +InvalidSchema = exceptions.InvalidSchema +ChunkedEncodingError = exceptions.ChunkedEncodingError +ContentDecodingError = exceptions.ContentDecodingError +RecentlyUsedContainer = _collections.RecentlyUsedContainer +CaseInsensitiveDict = structures.CaseInsensitiveDict +HTTPAdapter = adapters.HTTPAdapter +requote_uri = utils.requote_uri +get_environ_proxies = utils.get_environ_proxies +get_netrc_auth = utils.get_netrc_auth +should_bypass_proxies = utils.should_bypass_proxies +get_auth_from_url = utils.get_auth_from_url +codes = status_codes.codes +REDIRECT_STATI = models.REDIRECT_STATI + +REDIRECT_CACHE_SIZE: Any + +def merge_setting(request_setting, session_setting, dict_class=...): ... +def merge_hooks(request_hooks, session_hooks, dict_class=...): ... + +class SessionRedirectMixin: + def resolve_redirects(self, resp, req, stream=..., timeout=..., verify=..., cert=..., + proxies=...): ... + def rebuild_auth(self, prepared_request, response): ... + def rebuild_proxies(self, prepared_request, proxies): ... + +_Data = Union[None, Text, bytes, MutableMapping[str, Any], MutableMapping[Text, Any], Iterable[Tuple[Text, Optional[Text]]], IO] + +_Hook = Callable[[Response], Any] +_Hooks = MutableMapping[Text, List[_Hook]] +_HooksInput = MutableMapping[Text, Union[Iterable[_Hook], _Hook]] + +class Session(SessionRedirectMixin): + __attrs__: Any + headers: CaseInsensitiveDict[Text] + auth: Union[None, Tuple[Text, Text], _auth.AuthBase, Callable[[Request], Request]] + proxies: MutableMapping[Text, Text] + hooks: _Hooks + params: Union[bytes, MutableMapping[Text, Text]] + stream: bool + verify: Union[None, bool, Text] + cert: Union[None, Text, Tuple[Text, Text]] + max_redirects: int + trust_env: bool + cookies: RequestsCookieJar + adapters: MutableMapping[Any, Any] + redirect_cache: RecentlyUsedContainer[Any, Any] + def __init__(self) -> None: ... + def __enter__(self) -> Session: ... + def __exit__(self, *args) -> None: ... + def prepare_request(self, request): ... + def request(self, method: str, url: Union[str, bytes, Text], + params: Union[None, bytes, MutableMapping[Text, Text]] = ..., + data: _Data = ..., + headers: Optional[MutableMapping[Text, Text]] = ..., + cookies: Union[None, RequestsCookieJar, MutableMapping[Text, Text]] = ..., + files: Optional[MutableMapping[Text, IO[Any]]] = ..., + auth: Union[None, Tuple[Text, Text], _auth.AuthBase, Callable[[Request], Request]] = ..., + timeout: Union[None, float, Tuple[float, float]] = ..., + allow_redirects: Optional[bool] = ..., + proxies: Optional[MutableMapping[Text, Text]] = ..., + hooks: Optional[_HooksInput] = ..., + stream: Optional[bool] = ..., + verify: Union[None, bool, Text] = ..., + cert: Union[Text, Tuple[Text, Text], None] = ..., + json: Optional[Any] = ..., + ) -> Response: ... + def get(self, url: Union[Text, bytes], **kwargs) -> Response: ... + def options(self, url: Union[Text, bytes], **kwargs) -> Response: ... + def head(self, url: Union[Text, bytes], **kwargs) -> Response: ... + def post(self, url: Union[Text, bytes], data: _Data = ..., json: Optional[Any] = ..., **kwargs) -> Response: ... + def put(self, url: Union[Text, bytes], data: _Data = ..., **kwargs) -> Response: ... + def patch(self, url: Union[Text, bytes], data: _Data = ..., **kwargs) -> Response: ... + def delete(self, url: Union[Text, bytes], **kwargs) -> Response: ... + def send(self, request, **kwargs): ... + def merge_environment_settings(self, url, proxies, stream, verify, cert): ... + def get_adapter(self, url): ... + def close(self) -> None: ... + def mount(self, prefix: + Union[Text, bytes], + adapter: BaseAdapter) -> None: ... + +def session() -> Session: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/status_codes.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/status_codes.pyi new file mode 100644 index 00000000..f9bf820a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/status_codes.pyi @@ -0,0 +1,4 @@ +from typing import Any +from .structures import LookupDict + +codes: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/structures.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/structures.pyi new file mode 100644 index 00000000..0ef19936 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/structures.pyi @@ -0,0 +1,20 @@ +from typing import Any, Dict, Iterable, Iterator, Mapping, MutableMapping, Optional, Tuple, TypeVar, Union, Generic + +_VT = TypeVar('_VT') + +class CaseInsensitiveDict(MutableMapping[str, _VT], Generic[_VT]): + def __init__(self, data: Optional[Union[Mapping[str, _VT], Iterable[Tuple[str, _VT]]]] = ..., **kwargs: _VT) -> None: ... + def lower_items(self) -> Iterator[Tuple[str, _VT]]: ... + def __setitem__(self, key: str, value: _VT) -> None: ... + def __getitem__(self, key: str) -> _VT: ... + def __delitem__(self, key: str) -> None: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + def copy(self) -> CaseInsensitiveDict[_VT]: ... + +class LookupDict(Dict[str, _VT]): + name: Any + def __init__(self, name: Any = ...) -> None: ... + def __getitem__(self, key: str) -> Optional[_VT]: ... # type: ignore + def __getattr__(self, attr: str) -> _VT: ... + def __setattr__(self, attr: str, value: _VT) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/utils.pyi new file mode 100644 index 00000000..396a3740 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/requests/utils.pyi @@ -0,0 +1,53 @@ +# Stubs for requests.utils (Python 3) + +from typing import Any +from . import compat +from . import cookies +from . import structures +from . import exceptions + +OrderedDict = compat.OrderedDict +RequestsCookieJar = cookies.RequestsCookieJar +cookiejar_from_dict = cookies.cookiejar_from_dict +CaseInsensitiveDict = structures.CaseInsensitiveDict +InvalidURL = exceptions.InvalidURL + +NETRC_FILES: Any +DEFAULT_CA_BUNDLE_PATH: Any + +def dict_to_sequence(d): ... +def super_len(o): ... +def get_netrc_auth(url): ... +def guess_filename(obj): ... +def from_key_val_list(value): ... +def to_key_val_list(value): ... +def parse_list_header(value): ... +def parse_dict_header(value): ... +def unquote_header_value(value, is_filename=...): ... +def dict_from_cookiejar(cj): ... +def add_dict_to_cookiejar(cj, cookie_dict): ... +def get_encodings_from_content(content): ... +def get_encoding_from_headers(headers): ... +def stream_decode_response_unicode(iterator, r): ... +def iter_slices(string, slice_length): ... +def get_unicode_from_response(r): ... + +UNRESERVED_SET: Any + +def unquote_unreserved(uri): ... +def requote_uri(uri): ... +def address_in_network(ip, net): ... +def dotted_netmask(mask): ... +def is_ipv4_address(string_ip): ... +def is_valid_cidr(string_network): ... +def set_environ(env_name, value): ... +def should_bypass_proxies(url): ... +def get_environ_proxies(url): ... +def default_user_agent(name=...): ... +def default_headers(): ... +def parse_header_links(value): ... +def guess_json_utf(data): ... +def prepend_scheme_if_needed(url, new_scheme): ... +def get_auth_from_url(url): ... +def to_native_string(string, encoding=...): ... +def urldefragauth(url): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/simplejson/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/simplejson/__init__.pyi new file mode 100644 index 00000000..6221b4ef --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/simplejson/__init__.pyi @@ -0,0 +1,13 @@ +from typing import Any, IO, Text, Union + +from simplejson.scanner import JSONDecodeError as JSONDecodeError +from simplejson.decoder import JSONDecoder as JSONDecoder +from simplejson.encoder import JSONEncoder as JSONEncoder, JSONEncoderForHTML as JSONEncoderForHTML + +_LoadsString = Union[Text, bytes, bytearray] + + +def dumps(obj: Any, *args: Any, **kwds: Any) -> str: ... +def dump(obj: Any, fp: IO[str], *args: Any, **kwds: Any) -> None: ... +def loads(s: _LoadsString, **kwds: Any) -> Any: ... +def load(fp: IO[str], **kwds: Any) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/simplejson/decoder.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/simplejson/decoder.pyi new file mode 100644 index 00000000..59111ce6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/simplejson/decoder.pyi @@ -0,0 +1,6 @@ +from typing import Any, Match + +class JSONDecoder(object): + def __init__(self, **kwargs): ... + def decode(self, s: str, _w: Match[str], _PY3: bool): ... + def raw_decode(self, s: str, idx: int, _w: Match[str], _PY3: bool): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/simplejson/encoder.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/simplejson/encoder.pyi new file mode 100644 index 00000000..0e318066 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/simplejson/encoder.pyi @@ -0,0 +1,9 @@ +from typing import Any, IO + +class JSONEncoder(object): + def __init__(self, *args, **kwargs): ... + def encode(self, o: Any): ... + def default(self, o: Any): ... + def iterencode(self, o: Any, _one_shot: bool): ... + +class JSONEncoderForHTML(JSONEncoder): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/simplejson/scanner.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/simplejson/scanner.pyi new file mode 100644 index 00000000..5de484a0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/simplejson/scanner.pyi @@ -0,0 +1,11 @@ +from typing import Optional + +class JSONDecodeError(ValueError): + msg: str = ... + doc: str = ... + pos: int = ... + end: Optional[int] = ... + lineno: int = ... + colno: int = ... + endlineno: Optional[int] = ... + endcolno: Optional[int] = ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/singledispatch.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/singledispatch.pyi new file mode 100644 index 00000000..e89ac121 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/singledispatch.pyi @@ -0,0 +1,17 @@ +from typing import Any, Callable, Generic, Mapping, Optional, TypeVar, overload + + +_T = TypeVar("_T") + + +class _SingleDispatchCallable(Generic[_T]): + registry: Mapping[Any, Callable[..., _T]] + def dispatch(self, cls: Any) -> Callable[..., _T]: ... + @overload + def register(self, cls: Any) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + @overload + def register(self, cls: Any, func: Callable[..., _T]) -> Callable[..., _T]: ... + def _clear_cache(self) -> None: ... + def __call__(self, *args: Any, **kwargs: Any) -> _T: ... + +def singledispatch(func: Callable[..., _T]) -> _SingleDispatchCallable[_T]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/tabulate.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/tabulate.pyi new file mode 100644 index 00000000..c3abb2f1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/tabulate.pyi @@ -0,0 +1,44 @@ +# Stub for tabulate: https://github.com/astanin/python-tabulate +from typing import Any, Callable, Container, Iterable, List, Mapping, NamedTuple, Optional, Sequence, Union + +PRESERVE_WHITESPACE: bool +WIDE_CHARS_MODE: bool +tabulate_formats: List[str] + +class Line(NamedTuple): + begin: str + hline: str + sep: str + end: str + +class DataRow(NamedTuple): + begin: str + sep: str + end: str + +_TableFormatLine = Union[None, Line, Callable[[List[int], List[str]], str]] +_TableFormatRow = Union[None, DataRow, Callable[[List[Any], List[int], List[str]], str]] + +class TableFormat(NamedTuple): + lineabove: _TableFormatLine + linebelowheader: _TableFormatLine + linebetweenrows: _TableFormatLine + linebelow: _TableFormatLine + headerrow: _TableFormatRow + datarow: _TableFormatRow + padding: int + with_header_hide: Optional[Container[str]] + +def simple_separated_format(separator: str) -> TableFormat: ... +def tabulate( + tabular_data: Union[Mapping[str, Iterable[Any]], Iterable[Iterable[Any]]], + headers: Union[str, Sequence[str]] = ..., + tablefmt: Union[str, TableFormat] = ..., + floatfmt: Union[str, Iterable[str]] = ..., + numalign: Optional[str] = ..., + stralign: Optional[str] = ..., + missingval: Union[str, Iterable[str]] = ..., + showindex: Union[str, bool, Iterable[Any]] = ..., + disable_numparse: Union[bool, Iterable[int]] = ..., + colalign: Optional[Iterable[Optional[str]]] = ..., +) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/termcolor.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/termcolor.pyi new file mode 100644 index 00000000..e1ad18b8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/termcolor.pyi @@ -0,0 +1,21 @@ +# Stub for termcolor: https://pypi.python.org/pypi/termcolor +from typing import Any, Iterable, Optional, Text + + +def colored( + text: Text, + color: Optional[Text] = ..., + on_color: Optional[Text] = ..., + attrs: Optional[Iterable[Text]] = ..., +) -> Text: + ... + + +def cprint( + text: Text, + color: Optional[Text] = ..., + on_color: Optional[Text] = ..., + attrs: Optional[Iterable[Text]] = ..., + **kwargs: Any, +) -> None: + ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/toml.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/toml.pyi new file mode 100644 index 00000000..2639178e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/toml.pyi @@ -0,0 +1,24 @@ +from typing import Any, IO, List, Mapping, MutableMapping, Optional, Protocol, Text, Type, Union +import datetime +import sys + +if sys.version_info >= (3, 4): + import pathlib + if sys.version_info >= (3, 6): + import os + _PathLike = Union[Text, pathlib.PurePath, os.PathLike] + else: + _PathLike = Union[Text, pathlib.PurePath] +else: + _PathLike = Text + +class _Writable(Protocol): + def write(self, obj: str) -> Any: ... + +class TomlDecodeError(Exception): ... + +def load(f: Union[_PathLike, List[Text], IO[str]], _dict: Type[MutableMapping[str, Any]] = ...) -> MutableMapping[str, Any]: ... +def loads(s: Text, _dict: Type[MutableMapping[str, Any]] = ...) -> MutableMapping[str, Any]: ... + +def dump(o: Mapping[str, Any], f: _Writable) -> str: ... +def dumps(o: Mapping[str, Any]) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/typing_extensions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/typing_extensions.pyi new file mode 100644 index 00000000..edf40d67 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/typing_extensions.pyi @@ -0,0 +1,69 @@ +import abc +import sys +from typing import Callable +from typing import ClassVar as ClassVar +from typing import ContextManager as ContextManager +from typing import Counter as Counter +from typing import DefaultDict as DefaultDict +from typing import Deque as Deque +from typing import NewType as NewType +from typing import NoReturn as NoReturn +from typing import overload as overload +from typing import Text as Text +from typing import Type as Type +from typing import TYPE_CHECKING as TYPE_CHECKING +from typing import TypeVar, Any, Mapping, ItemsView, KeysView, Optional, ValuesView, Dict, Type + +_T = TypeVar('_T') +_F = TypeVar('_F', bound=Callable[..., Any]) +_TC = TypeVar('_TC', bound=Type[object]) +class _SpecialForm: + def __getitem__(self, typeargs: Any) -> Any: ... +def runtime_checkable(cls: _TC) -> _TC: ... +# This alias for above is kept here for backwards compatibility. +runtime = runtime_checkable +Protocol: _SpecialForm = ... +Final: _SpecialForm = ... +def final(f: _F) -> _F: ... +Literal: _SpecialForm = ... +def IntVar(__name: str) -> Any: ... # returns a new TypeVar + +# Internal mypy fallback type for all typed dicts (does not exist at runtime) +class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): + def copy(self: _T) -> _T: ... + # Using NoReturn so that only calls using mypy plugin hook that specialize the signature + # can go through. + def setdefault(self, k: NoReturn, default: object) -> object: ... + # Mypy plugin hook for 'pop' expects that 'default' has a type variable type. + def pop(self, k: NoReturn, default: _T = ...) -> object: ... + def update(self: _T, __m: _T) -> None: ... + if sys.version_info < (3, 0): + def has_key(self, k: str) -> bool: ... + def viewitems(self) -> ItemsView[str, object]: ... + def viewkeys(self) -> KeysView[str]: ... + def viewvalues(self) -> ValuesView[object]: ... + def __delitem__(self, k: NoReturn) -> None: ... + +# TypedDict is a (non-subscriptable) special form. +TypedDict: object = ... + +if sys.version_info >= (3, 3): + from typing import ChainMap as ChainMap + +if sys.version_info >= (3, 5): + from typing import AsyncIterable as AsyncIterable + from typing import AsyncIterator as AsyncIterator + from typing import AsyncContextManager as AsyncContextManager + from typing import Awaitable as Awaitable + from typing import Coroutine as Coroutine + +if sys.version_info >= (3, 6): + from typing import AsyncGenerator as AsyncGenerator + +def get_type_hints( + obj: Callable[..., Any], globalns: Optional[Dict[str, Any]] = ..., localns: Optional[Dict[str, Any]] = ..., + include_extras: bool = ... +) -> Dict[str, Any]: ... + +Annotated: _SpecialForm = ... +_AnnotatedAlias: Any = ... # undocumented diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/ujson.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/ujson.pyi new file mode 100644 index 00000000..7e006592 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/ujson.pyi @@ -0,0 +1,51 @@ +# Stubs for ujson +# See: https://pypi.python.org/pypi/ujson +from typing import Any, AnyStr, IO, Optional + +__version__: str + +def encode( + obj: Any, + ensure_ascii: bool = ..., + double_precision: int = ..., + encode_html_chars: bool = ..., + escape_forward_slashes: bool = ..., + sort_keys: bool = ..., + indent: int = ..., +) -> str: ... + +def dumps( + obj: Any, + ensure_ascii: bool = ..., + double_precision: int = ..., + encode_html_chars: bool = ..., + escape_forward_slashes: bool = ..., + sort_keys: bool = ..., + indent: int = ..., +) -> str: ... + +def dump( + obj: Any, + fp: IO[str], + ensure_ascii: bool = ..., + double_precision: int = ..., + encode_html_chars: bool = ..., + escape_forward_slashes: bool = ..., + sort_keys: bool = ..., + indent: int = ..., +) -> None: ... + +def decode( + s: AnyStr, + precise_float: bool = ..., +) -> Any: ... + +def loads( + s: AnyStr, + precise_float: bool = ..., +) -> Any: ... + +def load( + fp: IO[AnyStr], + precise_float: bool = ..., +) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/__init__.pyi new file mode 100644 index 00000000..2de398a8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/__init__.pyi @@ -0,0 +1,150 @@ +from types import ModuleType +from typing import Any + +from werkzeug import _internal +from werkzeug import datastructures +from werkzeug import debug +from werkzeug import exceptions +from werkzeug import formparser +from werkzeug import http +from werkzeug import local +from werkzeug import security +from werkzeug import serving +from werkzeug import test +from werkzeug import testapp +from werkzeug import urls +from werkzeug import useragents +from werkzeug import utils +from werkzeug import wrappers +from werkzeug import wsgi + +class module(ModuleType): + def __getattr__(self, name): ... + def __dir__(self): ... + + +__version__: Any + +run_simple = serving.run_simple +test_app = testapp.test_app +UserAgent = useragents.UserAgent +_easteregg = _internal._easteregg +DebuggedApplication = debug.DebuggedApplication +MultiDict = datastructures.MultiDict +CombinedMultiDict = datastructures.CombinedMultiDict +Headers = datastructures.Headers +EnvironHeaders = datastructures.EnvironHeaders +ImmutableList = datastructures.ImmutableList +ImmutableDict = datastructures.ImmutableDict +ImmutableMultiDict = datastructures.ImmutableMultiDict +TypeConversionDict = datastructures.TypeConversionDict +ImmutableTypeConversionDict = datastructures.ImmutableTypeConversionDict +Accept = datastructures.Accept +MIMEAccept = datastructures.MIMEAccept +CharsetAccept = datastructures.CharsetAccept +LanguageAccept = datastructures.LanguageAccept +RequestCacheControl = datastructures.RequestCacheControl +ResponseCacheControl = datastructures.ResponseCacheControl +ETags = datastructures.ETags +HeaderSet = datastructures.HeaderSet +WWWAuthenticate = datastructures.WWWAuthenticate +Authorization = datastructures.Authorization +FileMultiDict = datastructures.FileMultiDict +CallbackDict = datastructures.CallbackDict +FileStorage = datastructures.FileStorage +OrderedMultiDict = datastructures.OrderedMultiDict +ImmutableOrderedMultiDict = datastructures.ImmutableOrderedMultiDict +escape = utils.escape +environ_property = utils.environ_property +append_slash_redirect = utils.append_slash_redirect +redirect = utils.redirect +cached_property = utils.cached_property +import_string = utils.import_string +dump_cookie = http.dump_cookie +parse_cookie = http.parse_cookie +unescape = utils.unescape +format_string = utils.format_string +find_modules = utils.find_modules +header_property = utils.header_property +html = utils.html +xhtml = utils.xhtml +HTMLBuilder = utils.HTMLBuilder +validate_arguments = utils.validate_arguments +ArgumentValidationError = utils.ArgumentValidationError +bind_arguments = utils.bind_arguments +secure_filename = utils.secure_filename +BaseResponse = wrappers.BaseResponse +BaseRequest = wrappers.BaseRequest +Request = wrappers.Request +Response = wrappers.Response +AcceptMixin = wrappers.AcceptMixin +ETagRequestMixin = wrappers.ETagRequestMixin +ETagResponseMixin = wrappers.ETagResponseMixin +ResponseStreamMixin = wrappers.ResponseStreamMixin +CommonResponseDescriptorsMixin = wrappers.CommonResponseDescriptorsMixin +UserAgentMixin = wrappers.UserAgentMixin +AuthorizationMixin = wrappers.AuthorizationMixin +WWWAuthenticateMixin = wrappers.WWWAuthenticateMixin +CommonRequestDescriptorsMixin = wrappers.CommonRequestDescriptorsMixin +Local = local.Local +LocalManager = local.LocalManager +LocalProxy = local.LocalProxy +LocalStack = local.LocalStack +release_local = local.release_local +generate_password_hash = security.generate_password_hash +check_password_hash = security.check_password_hash +Client = test.Client +EnvironBuilder = test.EnvironBuilder +create_environ = test.create_environ +run_wsgi_app = test.run_wsgi_app +get_current_url = wsgi.get_current_url +get_host = wsgi.get_host +pop_path_info = wsgi.pop_path_info +peek_path_info = wsgi.peek_path_info +SharedDataMiddleware = wsgi.SharedDataMiddleware +DispatcherMiddleware = wsgi.DispatcherMiddleware +ClosingIterator = wsgi.ClosingIterator +FileWrapper = wsgi.FileWrapper +make_line_iter = wsgi.make_line_iter +LimitedStream = wsgi.LimitedStream +responder = wsgi.responder +wrap_file = wsgi.wrap_file +extract_path_info = wsgi.extract_path_info +parse_etags = http.parse_etags +parse_date = http.parse_date +http_date = http.http_date +cookie_date = http.cookie_date +parse_cache_control_header = http.parse_cache_control_header +is_resource_modified = http.is_resource_modified +parse_accept_header = http.parse_accept_header +parse_set_header = http.parse_set_header +quote_etag = http.quote_etag +unquote_etag = http.unquote_etag +generate_etag = http.generate_etag +dump_header = http.dump_header +parse_list_header = http.parse_list_header +parse_dict_header = http.parse_dict_header +parse_authorization_header = http.parse_authorization_header +parse_www_authenticate_header = http.parse_www_authenticate_header +remove_entity_headers = http.remove_entity_headers +is_entity_header = http.is_entity_header +remove_hop_by_hop_headers = http.remove_hop_by_hop_headers +parse_options_header = http.parse_options_header +dump_options_header = http.dump_options_header +is_hop_by_hop_header = http.is_hop_by_hop_header +unquote_header_value = http.unquote_header_value +quote_header_value = http.quote_header_value +HTTP_STATUS_CODES = http.HTTP_STATUS_CODES +url_decode = urls.url_decode +url_encode = urls.url_encode +url_quote = urls.url_quote +url_quote_plus = urls.url_quote_plus +url_unquote = urls.url_unquote +url_unquote_plus = urls.url_unquote_plus +url_fix = urls.url_fix +Href = urls.Href +iri_to_uri = urls.iri_to_uri +uri_to_iri = urls.uri_to_iri +parse_form_data = formparser.parse_form_data +abort = exceptions.Aborter +Aborter = exceptions.Aborter diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/_compat.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/_compat.pyi new file mode 100644 index 00000000..bc4340dc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/_compat.pyi @@ -0,0 +1,48 @@ +import sys +from typing import Any, Optional, Text + +if sys.version_info < (3,): + import StringIO as BytesIO +else: + from io import StringIO as BytesIO + +PY2: Any +WIN: Any +unichr: Any +text_type: Any +string_types: Any +integer_types: Any +iterkeys: Any +itervalues: Any +iteritems: Any +iterlists: Any +iterlistvalues: Any +int_to_byte: Any +iter_bytes: Any + +def fix_tuple_repr(obj): ... +def implements_iterator(cls): ... +def implements_to_string(cls): ... +def native_string_result(func): ... +def implements_bool(cls): ... + +range_type: Any +NativeStringIO: Any + +def make_literal_wrapper(reference): ... +def normalize_string_tuple(tup): ... +def try_coerce_native(s): ... + +wsgi_get_bytes: Any + +def wsgi_decoding_dance(s, charset: Text = ..., errors: Text = ...): ... +def wsgi_encoding_dance(s, charset: Text = ..., errors: Text = ...): ... +def to_bytes(x, charset: Text = ..., errors: Text = ...): ... +def to_native(x, charset: Text = ..., errors: Text = ...): ... +def reraise(tp, value, tb: Optional[Any] = ...): ... + +imap: Any +izip: Any +ifilter: Any + +def to_unicode(x, charset: Text = ..., errors: Text = ..., allow_none_charset: bool = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/_internal.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/_internal.pyi new file mode 100644 index 00000000..64f63a1d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/_internal.pyi @@ -0,0 +1,19 @@ +from typing import Any, Optional + +class _Missing: + def __reduce__(self): ... + +class _DictAccessorProperty: + read_only: Any + name: Any + default: Any + load_func: Any + dump_func: Any + __doc__: Any + def __init__(self, name, default: Optional[Any] = ..., load_func: Optional[Any] = ..., dump_func: Optional[Any] = ..., + read_only: Optional[Any] = ..., doc: Optional[Any] = ...): ... + def __get__(self, obj, type: Optional[Any] = ...): ... + def __set__(self, obj, value): ... + def __delete__(self, obj): ... + +def _easteregg(app: Optional[Any] = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/_reloader.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/_reloader.pyi new file mode 100644 index 00000000..be23222f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/_reloader.pyi @@ -0,0 +1,29 @@ +from typing import Any, Optional + +class ReloaderLoop: + name: Any + extra_files: Any + interval: float + def __init__(self, extra_files: Optional[Any] = ..., interval: float = ...): ... + def run(self): ... + def restart_with_reloader(self): ... + def trigger_reload(self, filename): ... + def log_reload(self, filename): ... + +class StatReloaderLoop(ReloaderLoop): + name: Any + def run(self): ... + +class WatchdogReloaderLoop(ReloaderLoop): + observable_paths: Any + name: Any + observer_class: Any + event_handler: Any + should_reload: Any + def __init__(self, *args, **kwargs): ... + def trigger_reload(self, filename): ... + def run(self): ... + +reloader_loops: Any + +def run_with_reloader(main_func, extra_files: Optional[Any] = ..., interval: float = ..., reloader_type: str = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/atom.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/atom.pyi new file mode 100644 index 00000000..d02a4829 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/atom.pyi @@ -0,0 +1,50 @@ +from typing import Any, Optional + +XHTML_NAMESPACE: Any + +def format_iso8601(obj): ... + +class AtomFeed: + default_generator: Any + title: Any + title_type: Any + url: Any + feed_url: Any + id: Any + updated: Any + author: Any + icon: Any + logo: Any + rights: Any + rights_type: Any + subtitle: Any + subtitle_type: Any + generator: Any + links: Any + entries: Any + def __init__(self, title: Optional[Any] = ..., entries: Optional[Any] = ..., **kwargs): ... + def add(self, *args, **kwargs): ... + def generate(self): ... + def to_string(self): ... + def get_response(self): ... + def __call__(self, environ, start_response): ... + +class FeedEntry: + title: Any + title_type: Any + content: Any + content_type: Any + url: Any + id: Any + updated: Any + summary: Any + summary_type: Any + author: Any + published: Any + rights: Any + links: Any + categories: Any + xml_base: Any + def __init__(self, title: Optional[Any] = ..., content: Optional[Any] = ..., feed_url: Optional[Any] = ..., **kwargs): ... + def generate(self): ... + def to_string(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/cache.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/cache.pyi new file mode 100644 index 00000000..9ef76dae --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/cache.pyi @@ -0,0 +1,84 @@ +from typing import Any, Optional + +class BaseCache: + default_timeout: float + def __init__(self, default_timeout: float = ...): ... + def get(self, key): ... + def delete(self, key): ... + def get_many(self, *keys): ... + def get_dict(self, *keys): ... + def set(self, key, value, timeout: Optional[float] = ...): ... + def add(self, key, value, timeout: Optional[float] = ...): ... + def set_many(self, mapping, timeout: Optional[float] = ...): ... + def delete_many(self, *keys): ... + def has(self, key): ... + def clear(self): ... + def inc(self, key, delta=...): ... + def dec(self, key, delta=...): ... + +class NullCache(BaseCache): ... + +class SimpleCache(BaseCache): + clear: Any + def __init__(self, threshold: int = ..., default_timeout: float = ...): ... + def get(self, key): ... + def set(self, key, value, timeout: Optional[float] = ...): ... + def add(self, key, value, timeout: Optional[float] = ...): ... + def delete(self, key): ... + def has(self, key): ... + +class MemcachedCache(BaseCache): + key_prefix: Any + def __init__(self, servers: Optional[Any] = ..., default_timeout: float = ..., key_prefix: Optional[Any] = ...): ... + def get(self, key): ... + def get_dict(self, *keys): ... + def add(self, key, value, timeout: Optional[float] = ...): ... + def set(self, key, value, timeout: Optional[float] = ...): ... + def get_many(self, *keys): ... + def set_many(self, mapping, timeout: Optional[float] = ...): ... + def delete(self, key): ... + def delete_many(self, *keys): ... + def has(self, key): ... + def clear(self): ... + def inc(self, key, delta=...): ... + def dec(self, key, delta=...): ... + def import_preferred_memcache_lib(self, servers): ... + +GAEMemcachedCache: Any + +class RedisCache(BaseCache): + key_prefix: Any + def __init__(self, host: str = ..., port: int = ..., password: Optional[Any] = ..., db: int = ..., + default_timeout: float = ..., key_prefix: Optional[Any] = ..., **kwargs): ... + def dump_object(self, value): ... + def load_object(self, value): ... + def get(self, key): ... + def get_many(self, *keys): ... + def set(self, key, value, timeout: Optional[float] = ...): ... + def add(self, key, value, timeout: Optional[float] = ...): ... + def set_many(self, mapping, timeout: Optional[float] = ...): ... + def delete(self, key): ... + def delete_many(self, *keys): ... + def has(self, key): ... + def clear(self): ... + def inc(self, key, delta=...): ... + def dec(self, key, delta=...): ... + +class FileSystemCache(BaseCache): + def __init__(self, cache_dir, threshold: int = ..., default_timeout: float = ..., mode: int = ...): ... + def clear(self): ... + def get(self, key): ... + def add(self, key, value, timeout: Optional[float] = ...): ... + def set(self, key, value, timeout: Optional[float] = ...): ... + def delete(self, key): ... + def has(self, key): ... + +class UWSGICache(BaseCache): + cache: Any + def __init__(self, default_timeout: float = ..., cache: str = ...): ... + def get(self, key): ... + def delete(self, key): ... + def set(self, key, value, timeout: Optional[float] = ...): ... + def add(self, key, value, timeout: Optional[float] = ...): ... + def clear(self): ... + def has(self, key): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/fixers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/fixers.pyi new file mode 100644 index 00000000..0593d9d8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/fixers.pyi @@ -0,0 +1,35 @@ +from typing import Any, Iterable, List, Mapping, Optional, Sequence, Set, Text +from wsgiref.types import WSGIApplication, WSGIEnvironment, StartResponse + +from ..middleware.proxy_fix import ProxyFix as ProxyFix + +class CGIRootFix(object): + app: WSGIApplication + app_root: Text + def __init__(self, app: WSGIApplication, app_root: Text = ...) -> None: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... + +class LighttpdCGIRootFix(CGIRootFix): ... + +class PathInfoFromRequestUriFix(object): + app: WSGIApplication + def __init__(self, app: WSGIApplication) -> None: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... + +class HeaderRewriterFix(object): + app: WSGIApplication + remove_headers: Set[Text] + add_headers: List[Text] + def __init__( + self, app: WSGIApplication, remove_headers: Optional[Iterable[Text]] = ..., add_headers: Optional[Iterable[Text]] = ..., + ) -> None: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... + +class InternetExplorerFix(object): + app: WSGIApplication + fix_vary: bool + fix_attach: bool + def __init__(self, app: WSGIApplication, fix_vary: bool = ..., fix_attach: bool = ...) -> None: ... + def fix_headers(self, environ: WSGIEnvironment, headers: Mapping[str, str], status: Optional[Any] = ...) -> None: ... + def run_fixed(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/iterio.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/iterio.pyi new file mode 100644 index 00000000..c7ce70cd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/iterio.pyi @@ -0,0 +1,39 @@ +from typing import Any, Optional, Text, Union + +greenlet: Any + +class IterIO: + def __new__(cls, obj, sentinel: Union[Text, bytes] = ...): ... + def __iter__(self): ... + def tell(self): ... + def isatty(self): ... + def seek(self, pos, mode: int = ...): ... + def truncate(self, size: Optional[Any] = ...): ... + def write(self, s): ... + def writelines(self, list): ... + def read(self, n: int = ...): ... + def readlines(self, sizehint: int = ...): ... + def readline(self, length: Optional[Any] = ...): ... + def flush(self): ... + def __next__(self): ... + +class IterI(IterIO): + sentinel: Any + def __new__(cls, func, sentinel: Union[Text, bytes] = ...): ... + closed: Any + def close(self): ... + def write(self, s): ... + def writelines(self, list): ... + def flush(self): ... + +class IterO(IterIO): + sentinel: Any + closed: Any + pos: Any + def __new__(cls, gen, sentinel: Union[Text, bytes] = ...): ... + def __iter__(self): ... + def close(self): ... + def seek(self, pos, mode: int = ...): ... + def read(self, n: int = ...): ... + def readline(self, length: Optional[Any] = ...): ... + def readlines(self, sizehint: int = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/jsrouting.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/jsrouting.pyi new file mode 100644 index 00000000..46f1972d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/jsrouting.pyi @@ -0,0 +1,10 @@ +from typing import Any + +def dumps(*args): ... +def render_template(name_parts, rules, converters): ... +def generate_map(map, name: str = ...): ... +def generate_adapter(adapter, name: str = ..., map_name: str = ...): ... +def js_to_url_function(converter): ... +def NumberConverter_js_to_url(conv): ... + +js_to_url_functions: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/limiter.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/limiter.pyi new file mode 100644 index 00000000..0734a242 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/limiter.pyi @@ -0,0 +1,7 @@ +from typing import Any + +class StreamLimitMiddleware: + app: Any + maximum_size: Any + def __init__(self, app, maximum_size=...): ... + def __call__(self, environ, start_response): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/lint.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/lint.pyi new file mode 100644 index 00000000..9a25daf5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/lint.pyi @@ -0,0 +1 @@ +from ..middleware.lint import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/profiler.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/profiler.pyi new file mode 100644 index 00000000..61608db9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/profiler.pyi @@ -0,0 +1,14 @@ +from typing import Any, AnyStr, Generic, Optional, Protocol, Tuple, TypeVar + +from ..middleware.profiler import * + +_T = TypeVar("_T") +_T_contra = TypeVar("_T_contra", contravariant=True) + +class _Writable(Protocol[_T_contra]): + def write(self, __s: _T_contra) -> Any: ... + +class MergeStream(Generic[_T]): + streams: Tuple[_Writable[_T], ...] + def __init__(self, *streams: _Writable[_T]) -> None: ... + def write(self, data: _T) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/securecookie.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/securecookie.pyi new file mode 100644 index 00000000..667d4558 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/securecookie.pyi @@ -0,0 +1,28 @@ +from typing import Any, Optional +from hmac import new as hmac +from hashlib import sha1 as _default_hash +from werkzeug.contrib.sessions import ModificationTrackingDict + +class UnquoteError(Exception): ... + +class SecureCookie(ModificationTrackingDict[Any, Any]): + hash_method: Any + serialization_method: Any + quote_base64: Any + secret_key: Any + new: Any + def __init__(self, data: Optional[Any] = ..., secret_key: Optional[Any] = ..., new: bool = ...): ... + @property + def should_save(self): ... + @classmethod + def quote(cls, value): ... + @classmethod + def unquote(cls, value): ... + def serialize(self, expires: Optional[Any] = ...): ... + @classmethod + def unserialize(cls, string, secret_key): ... + @classmethod + def load_cookie(cls, request, key: str = ..., secret_key: Optional[Any] = ...): ... + def save_cookie(self, response, key: str = ..., expires: Optional[Any] = ..., session_expires: Optional[Any] = ..., + max_age: Optional[Any] = ..., path: str = ..., domain: Optional[Any] = ..., secure: Optional[Any] = ..., + httponly: bool = ..., force: bool = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/sessions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/sessions.pyi new file mode 100644 index 00000000..ab09b979 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/sessions.pyi @@ -0,0 +1,60 @@ +from typing import Any, Optional, Text, TypeVar +from werkzeug.datastructures import CallbackDict + +_K = TypeVar("_K") +_V = TypeVar("_V") + +def generate_key(salt: Optional[Any] = ...): ... + +class ModificationTrackingDict(CallbackDict[_K, _V]): + modified: Any + def __init__(self, *args, **kwargs): ... + def copy(self): ... + def __copy__(self): ... + +class Session(ModificationTrackingDict[_K, _V]): + sid: Any + new: Any + def __init__(self, data, sid, new: bool = ...): ... + @property + def should_save(self): ... + +class SessionStore: + session_class: Any + def __init__(self, session_class: Optional[Any] = ...): ... + def is_valid_key(self, key): ... + def generate_key(self, salt: Optional[Any] = ...): ... + def new(self): ... + def save(self, session): ... + def save_if_modified(self, session): ... + def delete(self, session): ... + def get(self, sid): ... + +class FilesystemSessionStore(SessionStore): + path: Any + filename_template: str + renew_missing: Any + mode: Any + def __init__(self, path: Optional[Any] = ..., filename_template: Text = ..., session_class: Optional[Any] = ..., + renew_missing: bool = ..., mode: int = ...): ... + def get_session_filename(self, sid): ... + def save(self, session): ... + def delete(self, session): ... + def get(self, sid): ... + def list(self): ... + +class SessionMiddleware: + app: Any + store: Any + cookie_name: Any + cookie_age: Any + cookie_expires: Any + cookie_path: Any + cookie_domain: Any + cookie_secure: Any + cookie_httponly: Any + environ_key: Any + def __init__(self, app, store, cookie_name: str = ..., cookie_age: Optional[Any] = ..., cookie_expires: Optional[Any] = ..., + cookie_path: str = ..., cookie_domain: Optional[Any] = ..., cookie_secure: Optional[Any] = ..., + cookie_httponly: bool = ..., environ_key: str = ...): ... + def __call__(self, environ, start_response): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/testtools.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/testtools.pyi new file mode 100644 index 00000000..860ebb7a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/testtools.pyi @@ -0,0 +1,9 @@ +from typing import Any +from werkzeug.wrappers import Response + +class ContentAccessors: + def xml(self): ... + def lxml(self): ... + def json(self): ... + +class TestResponse(Response, ContentAccessors): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/wrappers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/wrappers.pyi new file mode 100644 index 00000000..683eda0f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/contrib/wrappers.pyi @@ -0,0 +1,27 @@ +from typing import Any + +def is_known_charset(charset): ... + +class JSONRequestMixin: + def json(self): ... + +class ProtobufRequestMixin: + protobuf_check_initialization: Any + def parse_protobuf(self, proto_type): ... + +class RoutingArgsRequestMixin: + routing_args: Any + routing_vars: Any + +class ReverseSlashBehaviorRequestMixin: + def path(self): ... + def script_root(self): ... + +class DynamicCharsetRequestMixin: + default_charset: Any + def unknown_charset(self, charset): ... + def charset(self): ... + +class DynamicCharsetResponseMixin: + default_charset: Any + charset: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/datastructures.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/datastructures.pyi new file mode 100644 index 00000000..a727df6b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/datastructures.pyi @@ -0,0 +1,461 @@ +import collections +from typing import ( + Any, + Callable, + Container, + Dict, + Generic, + IO, + Iterable, + Iterator, + List, + Mapping, + MutableSet, + NoReturn, + Optional, + Protocol, + Text, + Tuple, + Type, + TypeVar, + Union, + overload, +) + +_K = TypeVar("_K") +_V = TypeVar("_V") +_R = TypeVar("_R") +_D = TypeVar("_D") + +def is_immutable(self) -> NoReturn: ... +def iter_multi_items(mapping): ... +def native_itermethods(names): ... + +class ImmutableListMixin(object, Generic[_V]): + def __hash__(self) -> int: ... + def __reduce_ex__(self: _D, protocol) -> Tuple[Type[_D], List[_V]]: ... + def __delitem__(self, key: _V) -> NoReturn: ... + def __iadd__(self, other: Any) -> NoReturn: ... + def __imul__(self, other: Any) -> NoReturn: ... + def __setitem__(self, key: str, value: Any) -> NoReturn: ... + def append(self, item: Any) -> NoReturn: ... + def remove(self, item: Any) -> NoReturn: ... + def extend(self, iterable: Any) -> NoReturn: ... + def insert(self, pos: int, value: Any) -> NoReturn: ... + def pop(self, index: int = ...) -> NoReturn: ... + def reverse(self) -> NoReturn: ... + def sort(self, cmp: Optional[Any] = ..., key: Optional[Any] = ..., reverse: Optional[Any] = ...) -> NoReturn: ... + +class ImmutableList(ImmutableListMixin[_V], List[_V]): ... # type: ignore + +class ImmutableDictMixin(object): + @classmethod + def fromkeys(cls, *args, **kwargs): ... + def __reduce_ex__(self, protocol): ... + def __hash__(self) -> int: ... + def setdefault(self, key, default: Optional[Any] = ...): ... + def update(self, *args, **kwargs): ... + def pop(self, key, default: Optional[Any] = ...): ... + def popitem(self): ... + def __setitem__(self, key, value): ... + def __delitem__(self, key): ... + def clear(self): ... + +class ImmutableMultiDictMixin(ImmutableDictMixin): + def __reduce_ex__(self, protocol): ... + def add(self, key, value): ... + def popitemlist(self): ... + def poplist(self, key): ... + def setlist(self, key, new_list): ... + def setlistdefault(self, key, default_list: Optional[Any] = ...): ... + +class UpdateDictMixin(object): + on_update: Any + def setdefault(self, key, default: Optional[Any] = ...): ... + def pop(self, key, default=...): ... + __setitem__: Any + __delitem__: Any + clear: Any + popitem: Any + update: Any + +class TypeConversionDict(Dict[_K, _V]): + @overload + def get(self, key: _K, *, type: None = ...) -> Optional[_V]: ... + @overload + def get(self, key: _K, default: _D, type: None = ...) -> Union[_V, _D]: ... + @overload + def get(self, key: _K, *, type: Callable[[_V], _R]) -> Optional[_R]: ... + @overload + def get(self, key: _K, default: _D, type: Callable[[_V], _R]) -> Union[_R, _D]: ... + +class ImmutableTypeConversionDict(ImmutableDictMixin, TypeConversionDict[_K, _V]): # type: ignore + def copy(self) -> TypeConversionDict[_K, _V]: ... + def __copy__(self) -> ImmutableTypeConversionDict[_K, _V]: ... + +class ViewItems: + def __init__(self, multi_dict, method, repr_name, *a, **kw): ... + def __iter__(self): ... + +class MultiDict(TypeConversionDict[_K, _V]): + def __init__(self, mapping: Optional[Any] = ...): ... + def __getitem__(self, key): ... + def __setitem__(self, key, value): ... + def add(self, key, value): ... + def getlist(self, key, type: Optional[Any] = ...): ... + def setlist(self, key, new_list): ... + def setdefault(self, key, default: Optional[Any] = ...): ... + def setlistdefault(self, key, default_list: Optional[Any] = ...): ... + def items(self, multi: bool = ...): ... + def lists(self): ... + def keys(self): ... + __iter__: Any + def values(self): ... + def listvalues(self): ... + def copy(self): ... + def deepcopy(self, memo: Optional[Any] = ...): ... + def to_dict(self, flat: bool = ...): ... + def update(self, other_dict): ... + def pop(self, key, default=...): ... + def popitem(self): ... + def poplist(self, key): ... + def popitemlist(self): ... + def __copy__(self): ... + def __deepcopy__(self, memo): ... + +class _omd_bucket: + prev: Any + key: Any + value: Any + next: Any + def __init__(self, omd, key, value): ... + def unlink(self, omd): ... + +class OrderedMultiDict(MultiDict[_K, _V]): + def __init__(self, mapping: Optional[Any] = ...): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + def __reduce_ex__(self, protocol): ... + def __getitem__(self, key): ... + def __setitem__(self, key, value): ... + def __delitem__(self, key): ... + def keys(self): ... + __iter__: Any + def values(self): ... + def items(self, multi: bool = ...): ... + def lists(self): ... + def listvalues(self): ... + def add(self, key, value): ... + def getlist(self, key, type: Optional[Any] = ...): ... + def setlist(self, key, new_list): ... + def setlistdefault(self, key, default_list: Optional[Any] = ...): ... + def update(self, mapping): ... + def poplist(self, key): ... + def pop(self, key, default=...): ... + def popitem(self): ... + def popitemlist(self): ... + +class Headers(object): + def __init__(self, defaults: Optional[Any] = ...): ... + def __getitem__(self, key, _get_mode: bool = ...): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + @overload + def get(self, key: str, *, type: None = ...) -> Optional[str]: ... + @overload + def get(self, key: str, default: _D, type: None = ...) -> Union[str, _D]: ... + @overload + def get(self, key: str, *, type: Callable[[str], _R]) -> Optional[_R]: ... + @overload + def get(self, key: str, default: _D, type: Callable[[str], _R]) -> Union[_R, _D]: ... + @overload + def get(self, key: str, *, as_bytes: bool) -> Any: ... + @overload + def get(self, key: str, *, type: None, as_bytes: bool) -> Any: ... + @overload + def get(self, key: str, *, type: Callable[[Any], _R], as_bytes: bool) -> Optional[_R]: ... + @overload + def get(self, key: str, default: Any, type: None, as_bytes: bool) -> Any: ... + @overload + def get(self, key: str, default: _D, type: Callable[[Any], _R], as_bytes: bool) -> Union[_R, _D]: ... + def getlist(self, key, type: Optional[Any] = ..., as_bytes: bool = ...): ... + def get_all(self, name): ... + def items(self, lower: bool = ...): ... + def keys(self, lower: bool = ...): ... + def values(self): ... + def extend(self, iterable): ... + def __delitem__(self, key: Any) -> None: ... + def remove(self, key): ... + def pop(self, **kwargs): ... + def popitem(self): ... + def __contains__(self, key): ... + has_key: Any + def __iter__(self): ... + def __len__(self): ... + def add(self, _key, _value, **kw): ... + def add_header(self, _key, _value, **_kw): ... + def clear(self): ... + def set(self, _key, _value, **kw): ... + def setdefault(self, key, value): ... + def __setitem__(self, key, value): ... + def to_list(self, charset: Text = ...): ... + def to_wsgi_list(self): ... + def copy(self): ... + def __copy__(self): ... + +class ImmutableHeadersMixin: + def __delitem__(self, key: str) -> None: ... + def __setitem__(self, key, value): ... + set: Any + def add(self, *args, **kwargs): ... + remove: Any + add_header: Any + def extend(self, iterable): ... + def insert(self, pos, value): ... + def pop(self, **kwargs): ... + def popitem(self): ... + def setdefault(self, key, default): ... + +class EnvironHeaders(ImmutableHeadersMixin, Headers): + environ: Any + def __init__(self, environ): ... + def __eq__(self, other): ... + def __getitem__(self, key, _get_mode: bool = ...): ... + def __len__(self): ... + def __iter__(self): ... + def copy(self): ... + +class CombinedMultiDict(ImmutableMultiDictMixin, MultiDict[_K, _V]): # type: ignore + def __reduce_ex__(self, protocol): ... + dicts: Any + def __init__(self, dicts: Optional[Any] = ...): ... + @classmethod + def fromkeys(cls): ... + def __getitem__(self, key): ... + def get(self, key, default: Optional[Any] = ..., type: Optional[Any] = ...): ... + def getlist(self, key, type: Optional[Any] = ...): ... + def keys(self): ... + __iter__: Any + def items(self, multi: bool = ...): ... + def values(self): ... + def lists(self): ... + def listvalues(self): ... + def copy(self): ... + def to_dict(self, flat: bool = ...): ... + def __len__(self): ... + def __contains__(self, key): ... + has_key: Any + +class FileMultiDict(MultiDict[_K, _V]): + def add_file(self, name, file, filename: Optional[Any] = ..., content_type: Optional[Any] = ...): ... + +class ImmutableDict(ImmutableDictMixin, Dict[_K, _V]): # type: ignore + def copy(self): ... + def __copy__(self): ... + +class ImmutableMultiDict(ImmutableMultiDictMixin, MultiDict[_K, _V]): # type: ignore + def copy(self): ... + def __copy__(self): ... + +class ImmutableOrderedMultiDict(ImmutableMultiDictMixin, OrderedMultiDict[_K, _V]): # type: ignore + def copy(self): ... + def __copy__(self): ... + +class Accept(ImmutableList[Tuple[str, float]]): + provided: bool + def __init__(self, values: Union[None, Accept, Iterable[Tuple[str, float]]] = ...) -> None: ... + @overload + def __getitem__(self, key: int) -> Tuple[str, float]: ... + @overload + def __getitem__(self, s: slice) -> List[Tuple[str, float]]: ... + @overload + def __getitem__(self, key: str) -> float: ... + def quality(self, key: str) -> float: ... + def __contains__(self, value: str) -> bool: ... # type: ignore + def index(self, key: Union[str, Tuple[str, float]]) -> int: ... # type: ignore + def find(self, key: Union[str, Tuple[str, float]]) -> int: ... + def values(self) -> Iterator[str]: ... + def to_header(self) -> str: ... + @overload + def best_match(self, matches: Iterable[str], default: None = ...) -> Optional[str]: ... + @overload + def best_match(self, matches: Iterable[str], default: _D) -> Union[str, _D]: ... + @property + def best(self) -> Optional[str]: ... + +class MIMEAccept(Accept): + @property + def accept_html(self) -> bool: ... + @property + def accept_xhtml(self) -> bool: ... + @property + def accept_json(self) -> bool: ... + +class LanguageAccept(Accept): ... +class CharsetAccept(Accept): ... + +def cache_property(key, empty, type): ... + +class _CacheControl(UpdateDictMixin, Dict[str, Any]): + no_cache: Any + no_store: Any + max_age: Any + no_transform: Any + on_update: Any + provided: Any + def __init__(self, values=..., on_update: Optional[Any] = ...): ... + def to_header(self): ... + +class RequestCacheControl(ImmutableDictMixin, _CacheControl): # type: ignore + max_stale: Any + min_fresh: Any + no_transform: Any + only_if_cached: Any + +class ResponseCacheControl(_CacheControl): + public: Any + private: Any + must_revalidate: Any + proxy_revalidate: Any + s_maxage: Any + +class CallbackDict(UpdateDictMixin, Dict[_K, _V]): + on_update: Any + def __init__(self, initial: Optional[Any] = ..., on_update: Optional[Any] = ...): ... + +class HeaderSet(MutableSet[str]): + on_update: Any + def __init__(self, headers: Optional[Any] = ..., on_update: Optional[Any] = ...): ... + def add(self, header): ... + def remove(self, header): ... + def update(self, iterable): ... + def discard(self, header): ... + def find(self, header): ... + def index(self, header): ... + def clear(self): ... + def as_set(self, preserve_casing: bool = ...): ... + def to_header(self): ... + def __getitem__(self, idx): ... + def __delitem__(self, idx): ... + def __setitem__(self, idx, value): ... + def __contains__(self, header): ... + def __len__(self): ... + def __iter__(self): ... + def __nonzero__(self): ... + +class ETags(Container[str], Iterable[str]): + star_tag: Any + def __init__(self, strong_etags: Optional[Any] = ..., weak_etags: Optional[Any] = ..., star_tag: bool = ...): ... + def as_set(self, include_weak: bool = ...): ... + def is_weak(self, etag): ... + def contains_weak(self, etag): ... + def contains(self, etag): ... + def contains_raw(self, etag): ... + def to_header(self): ... + def __call__(self, etag: Optional[Any] = ..., data: Optional[Any] = ..., include_weak: bool = ...): ... + def __bool__(self): ... + __nonzero__: Any + def __iter__(self): ... + def __contains__(self, etag): ... + +class IfRange: + etag: Any + date: Any + def __init__(self, etag: Optional[Any] = ..., date: Optional[Any] = ...): ... + def to_header(self): ... + +class Range: + units: Any + ranges: Any + def __init__(self, units, ranges): ... + def range_for_length(self, length): ... + def make_content_range(self, length): ... + def to_header(self): ... + def to_content_range_header(self, length): ... + +class ContentRange: + on_update: Any + units: Optional[str] + start: Any + stop: Any + length: Any + def __init__(self, units: Optional[str], start, stop, length: Optional[Any] = ..., on_update: Optional[Any] = ...): ... + def set(self, start, stop, length: Optional[Any] = ..., units: Optional[str] = ...): ... + def unset(self) -> None: ... + def to_header(self): ... + def __nonzero__(self): ... + __bool__: Any + +class Authorization(ImmutableDictMixin, Dict[str, Any]): # type: ignore + type: str + def __init__(self, auth_type: str, data: Optional[Mapping[str, Any]] = ...) -> None: ... + @property + def username(self) -> Optional[str]: ... + @property + def password(self) -> Optional[str]: ... + @property + def realm(self) -> Optional[str]: ... + @property + def nonce(self) -> Optional[str]: ... + @property + def uri(self) -> Optional[str]: ... + @property + def nc(self) -> Optional[str]: ... + @property + def cnonce(self) -> Optional[str]: ... + @property + def response(self) -> Optional[str]: ... + @property + def opaque(self) -> Optional[str]: ... + @property + def qop(self) -> Optional[str]: ... + +class WWWAuthenticate(UpdateDictMixin, Dict[str, Any]): + on_update: Any + def __init__(self, auth_type: Optional[Any] = ..., values: Optional[Any] = ..., on_update: Optional[Any] = ...): ... + def set_basic(self, realm: str = ...): ... + def set_digest(self, realm, nonce, qop=..., opaque: Optional[Any] = ..., algorithm: Optional[Any] = ..., + stale: bool = ...): ... + def to_header(self): ... + @staticmethod + def auth_property(name, doc: Optional[Any] = ...): ... + type: Any + realm: Any + domain: Any + nonce: Any + opaque: Any + algorithm: Any + qop: Any + stale: Any + +class _Writer(Protocol): + def write(self, data: bytes) -> Any: ... + +class FileStorage(object): + name: Optional[Text] + stream: IO[bytes] + filename: Optional[Text] + headers: Headers + def __init__( + self, + stream: Optional[IO[bytes]] = ..., + filename: Union[None, Text, bytes] = ..., + name: Optional[Text] = ..., + content_type: Optional[Text] = ..., + content_length: Optional[int] = ..., + headers: Optional[Headers] = ..., + ): ... + @property + def content_type(self) -> Optional[Text]: ... + @property + def content_length(self) -> int: ... + @property + def mimetype(self) -> str: ... + @property + def mimetype_params(self) -> Dict[str, str]: ... + def save(self, dst: Union[Text, _Writer], buffer_size: int = ...): ... + def close(self) -> None: ... + def __nonzero__(self) -> bool: ... + def __bool__(self) -> bool: ... + def __getattr__(self, name: Text) -> Any: ... + def __iter__(self) -> Iterator[bytes]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/__init__.pyi new file mode 100644 index 00000000..d920ed0d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/__init__.pyi @@ -0,0 +1,41 @@ +from typing import Any, Optional +from werkzeug.wrappers import BaseRequest as Request, BaseResponse as Response + +PIN_TIME: Any + +def hash_pin(pin): ... +def get_machine_id(): ... + +class _ConsoleFrame: + console: Any + id: Any + def __init__(self, namespace): ... + +def get_pin_and_cookie_name(app): ... + +class DebuggedApplication: + app: Any + evalex: Any + frames: Any + tracebacks: Any + request_key: Any + console_path: Any + console_init_func: Any + show_hidden_frames: Any + secret: Any + pin_logging: Any + pin: Any + def __init__(self, app, evalex: bool = ..., request_key: str = ..., console_path: str = ..., + console_init_func: Optional[Any] = ..., show_hidden_frames: bool = ..., lodgeit_url: Optional[Any] = ..., + pin_security: bool = ..., pin_logging: bool = ...): ... + @property + def pin_cookie_name(self): ... + def debug_application(self, environ, start_response): ... + def execute_command(self, request, command, frame): ... + def display_console(self, request): ... + def paste_traceback(self, request, traceback): ... + def get_resource(self, request, filename): ... + def check_pin_trust(self, environ): ... + def pin_auth(self, request): ... + def log_pin_request(self): ... + def __call__(self, environ, start_response): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/console.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/console.pyi new file mode 100644 index 00000000..0323377b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/console.pyi @@ -0,0 +1,44 @@ +from typing import Any, Optional +import code + +class HTMLStringO: + def __init__(self): ... + def isatty(self): ... + def close(self): ... + def flush(self): ... + def seek(self, n, mode: int = ...): ... + def readline(self): ... + def reset(self): ... + def write(self, x): ... + def writelines(self, x): ... + +class ThreadedStream: + @staticmethod + def push(): ... + @staticmethod + def fetch(): ... + @staticmethod + def displayhook(obj): ... + def __setattr__(self, name, value): ... + def __dir__(self): ... + def __getattribute__(self, name): ... + +class _ConsoleLoader: + def __init__(self): ... + def register(self, code, source): ... + def get_source_by_code(self, code): ... + +class _InteractiveConsole(code.InteractiveInterpreter): + globals: Any + more: Any + buffer: Any + def __init__(self, globals, locals): ... + def runsource(self, source): ... + def runcode(self, code): ... + def showtraceback(self): ... + def showsyntaxerror(self, filename: Optional[Any] = ...): ... + def write(self, data): ... + +class Console: + def __init__(self, globals: Optional[Any] = ..., locals: Optional[Any] = ...): ... + def eval(self, code): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/repr.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/repr.pyi new file mode 100644 index 00000000..49559197 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/repr.pyi @@ -0,0 +1,33 @@ +from typing import Any, Optional + +deque: Any +missing: Any +RegexType: Any +HELP_HTML: Any +OBJECT_DUMP_HTML: Any + +def debug_repr(obj): ... +def dump(obj=...): ... + +class _Helper: + def __call__(self, topic: Optional[Any] = ...): ... + +helper: Any + +class DebugReprGenerator: + def __init__(self): ... + list_repr: Any + tuple_repr: Any + set_repr: Any + frozenset_repr: Any + deque_repr: Any + def regex_repr(self, obj): ... + def string_repr(self, obj, limit: int = ...): ... + def dict_repr(self, d, recursive, limit: int = ...): ... + def object_repr(self, obj): ... + def dispatch_repr(self, obj, recursive): ... + def fallback_repr(self): ... + def repr(self, obj): ... + def dump_object(self, obj): ... + def dump_locals(self, d): ... + def render_object_dump(self, items, title, repr: Optional[Any] = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/tbtools.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/tbtools.pyi new file mode 100644 index 00000000..90beed9d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/debug/tbtools.pyi @@ -0,0 +1,63 @@ +from typing import Any, Optional + +UTF8_COOKIE: Any +system_exceptions: Any +HEADER: Any +FOOTER: Any +PAGE_HTML: Any +CONSOLE_HTML: Any +SUMMARY_HTML: Any +FRAME_HTML: Any +SOURCE_LINE_HTML: Any + +def render_console_html(secret, evalex_trusted: bool = ...): ... +def get_current_traceback(ignore_system_exceptions: bool = ..., show_hidden_frames: bool = ..., skip: int = ...): ... + +class Line: + lineno: Any + code: Any + in_frame: Any + current: Any + def __init__(self, lineno, code): ... + def classes(self): ... + def render(self): ... + +class Traceback: + exc_type: Any + exc_value: Any + exception_type: Any + frames: Any + def __init__(self, exc_type, exc_value, tb): ... + def filter_hidden_frames(self): ... + def is_syntax_error(self): ... + def exception(self): ... + def log(self, logfile: Optional[Any] = ...): ... + def paste(self): ... + def render_summary(self, include_title: bool = ...): ... + def render_full(self, evalex: bool = ..., secret: Optional[Any] = ..., evalex_trusted: bool = ...): ... + def generate_plaintext_traceback(self): ... + def plaintext(self): ... + id: Any + +class Frame: + lineno: Any + function_name: Any + locals: Any + globals: Any + filename: Any + module: Any + loader: Any + code: Any + hide: Any + info: Any + def __init__(self, exc_type, exc_value, tb): ... + def render(self): ... + def render_line_context(self): ... + def get_annotated_lines(self): ... + def eval(self, code, mode: str = ...): ... + def sourcelines(self): ... + def get_context_lines(self, context: int = ...): ... + @property + def current_line(self): ... + def console(self): ... + id: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/exceptions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/exceptions.pyi new file mode 100644 index 00000000..36b14ee8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/exceptions.pyi @@ -0,0 +1,170 @@ +from typing import Any, Dict, Tuple, List, Text, NoReturn, Optional, Protocol, Type, Union, Iterable + +from wsgiref.types import WSGIEnvironment, StartResponse +from werkzeug.wrappers import Response + +class _EnvironContainer(Protocol): + @property + def environ(self) -> WSGIEnvironment: ... + +class HTTPException(Exception): + code: Optional[int] + description: Optional[Text] + response: Optional[Response] + def __init__(self, description: Optional[Text] = ..., response: Optional[Response] = ...) -> None: ... + @classmethod + def wrap(cls, exception: Type[Exception], name: Optional[str] = ...) -> Any: ... + @property + def name(self) -> str: ... + def get_description(self, environ: Optional[WSGIEnvironment] = ...) -> Text: ... + def get_body(self, environ: Optional[WSGIEnvironment] = ...) -> Text: ... + def get_headers(self, environ: Optional[WSGIEnvironment] = ...) -> List[Tuple[str, str]]: ... + def get_response(self, environ: Optional[Union[WSGIEnvironment, _EnvironContainer]] = ...) -> Response: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... + +default_exceptions: Dict[int, Type[HTTPException]] + +class BadRequest(HTTPException): + code: int + description: Text + +class ClientDisconnected(BadRequest): ... +class SecurityError(BadRequest): ... +class BadHost(BadRequest): ... + +class Unauthorized(HTTPException): + code: int + description: Text + www_authenticate: Optional[Iterable[object]] + def __init__( + self, + description: Optional[Text] = ..., + response: Optional[Response] = ..., + www_authenticate: Union[None, Tuple[object, ...], List[object], object] = ..., + ) -> None: ... + +class Forbidden(HTTPException): + code: int + description: Text + +class NotFound(HTTPException): + code: int + description: Text + +class MethodNotAllowed(HTTPException): + code: int + description: Text + valid_methods: Any + def __init__(self, valid_methods: Optional[Any] = ..., description: Optional[Any] = ...): ... + +class NotAcceptable(HTTPException): + code: int + description: Text + +class RequestTimeout(HTTPException): + code: int + description: Text + +class Conflict(HTTPException): + code: int + description: Text + +class Gone(HTTPException): + code: int + description: Text + +class LengthRequired(HTTPException): + code: int + description: Text + +class PreconditionFailed(HTTPException): + code: int + description: Text + +class RequestEntityTooLarge(HTTPException): + code: int + description: Text + +class RequestURITooLarge(HTTPException): + code: int + description: Text + +class UnsupportedMediaType(HTTPException): + code: int + description: Text + +class RequestedRangeNotSatisfiable(HTTPException): + code: int + description: Text + length: Any + units: str + def __init__(self, length: Optional[Any] = ..., units: str = ..., description: Optional[Any] = ...): ... + +class ExpectationFailed(HTTPException): + code: int + description: Text + +class ImATeapot(HTTPException): + code: int + description: Text + +class UnprocessableEntity(HTTPException): + code: int + description: Text + +class Locked(HTTPException): + code: int + description: Text + +class FailedDependency(HTTPException): + code: int + description: Text + +class PreconditionRequired(HTTPException): + code: int + description: Text + +class TooManyRequests(HTTPException): + code: int + description: Text + +class RequestHeaderFieldsTooLarge(HTTPException): + code: int + description: Text + +class UnavailableForLegalReasons(HTTPException): + code: int + description: Text + +class InternalServerError(HTTPException): + code: int + description: Text + +class NotImplemented(HTTPException): + code: int + description: Text + +class BadGateway(HTTPException): + code: int + description: Text + +class ServiceUnavailable(HTTPException): + code: int + description: Text + +class GatewayTimeout(HTTPException): + code: int + description: Text + +class HTTPVersionNotSupported(HTTPException): + code: int + description: Text + +class Aborter: + mapping: Any + def __init__(self, mapping: Optional[Any] = ..., extra: Optional[Any] = ...) -> None: ... + def __call__(self, code: Union[int, Response], *args: Any, **kwargs: Any) -> NoReturn: ... + +def abort(status: Union[int, Response], *args: Any, **kwargs: Any) -> NoReturn: ... + +class BadRequestKeyError(BadRequest, KeyError): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/filesystem.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/filesystem.pyi new file mode 100644 index 00000000..58695fa2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/filesystem.pyi @@ -0,0 +1,7 @@ +from typing import Any + +has_likely_buggy_unicode_filesystem: Any + +class BrokenFilesystemWarning(RuntimeWarning, UnicodeWarning): ... + +def get_filesystem_encoding(): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/formparser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/formparser.pyi new file mode 100644 index 00000000..8f0b5525 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/formparser.pyi @@ -0,0 +1,87 @@ +from typing import Any, Optional, Text, Tuple, Callable, Iterable, TypeVar, NoReturn, Protocol, IO, Generator, Dict, Mapping, Union +from wsgiref.types import WSGIEnvironment + +from .datastructures import Headers + +_Dict = Any +_ParseFunc = Callable[[IO[bytes], str, Optional[int], Mapping[str, str]], Tuple[IO[bytes], _Dict, _Dict]] + +_F = TypeVar("_F", bound=Callable[..., Any]) + +class _StreamFactory(Protocol): + def __call__( + self, total_content_length: Optional[int], filename: str, content_type: str, content_length: Optional[int] = ..., + ) -> IO[bytes]: ... + +def default_stream_factory( + total_content_length: Optional[int], filename: str, content_type: str, content_length: Optional[int] = ..., +) -> IO[bytes]: ... +def parse_form_data( + environ: WSGIEnvironment, + stream_factory: Optional[_StreamFactory] = ..., + charset: Text = ..., + errors: Text = ..., + max_form_memory_size: Optional[int] = ..., + max_content_length: Optional[int] = ..., + cls: Optional[Callable[[], _Dict]] = ..., + silent: bool = ..., +) -> Tuple[IO[bytes], _Dict, _Dict]: ... +def exhaust_stream(f: _F) -> _F: ... + +class FormDataParser(object): + stream_factory: _StreamFactory + charset: Text + errors: Text + max_form_memory_size: Optional[int] + max_content_length: Optional[int] + cls: Callable[[], _Dict] + silent: bool + def __init__( + self, + stream_factory: Optional[_StreamFactory] = ..., + charset: Text = ..., + errors: Text = ..., + max_form_memory_size: Optional[int] = ..., + max_content_length: Optional[int] = ..., + cls: Optional[Callable[[], _Dict]] = ..., + silent: bool = ..., + ) -> None: ... + def get_parse_func(self, mimetype: str, options: Any) -> Optional[_ParseFunc]: ... + def parse_from_environ(self, environ: WSGIEnvironment) -> Tuple[IO[bytes], _Dict, _Dict]: ... + def parse( + self, stream: IO[bytes], mimetype: Text, content_length: Optional[int], options: Optional[Mapping[str, str]] = ..., + ) -> Tuple[IO[bytes], _Dict, _Dict]: ... + parse_functions: Dict[Text, _ParseFunc] + +def is_valid_multipart_boundary(boundary: str) -> bool: ... +def parse_multipart_headers(iterable: Iterable[Union[Text, bytes]]) -> Headers: ... + +class MultiPartParser(object): + charset: Text + errors: Text + max_form_memory_size: Optional[int] + stream_factory: _StreamFactory + cls: Callable[[], _Dict] + buffer_size: int + def __init__( + self, + stream_factory: Optional[_StreamFactory] = ..., + charset: Text = ..., + errors: Text = ..., + max_form_memory_size: Optional[int] = ..., + cls: Optional[Callable[[], _Dict]] = ..., + buffer_size: int = ..., + ) -> None: ... + def fail(self, message: Text) -> NoReturn: ... + def get_part_encoding(self, headers: Mapping[str, str]) -> Optional[str]: ... + def get_part_charset(self, headers: Mapping[str, str]) -> Text: ... + def start_file_streaming( + self, filename: Union[Text, bytes], headers: Mapping[str, str], total_content_length: Optional[int], + ) -> Tuple[Text, IO[bytes]]: ... + def in_memory_threshold_reached(self, bytes: Any) -> NoReturn: ... + def validate_boundary(self, boundary: Optional[str]) -> None: ... + def parse_lines( + self, file: Any, boundary: bytes, content_length: int, cap_at_buffer: bool = ..., + ) -> Generator[Tuple[str, Any], None, None]: ... + def parse_parts(self, file: Any, boundary: bytes, content_length: int) -> Generator[Tuple[str, Any], None, None]: ... + def parse(self, file: Any, boundary: bytes, content_length: int) -> Tuple[_Dict, _Dict]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/http.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/http.pyi new file mode 100644 index 00000000..bdda6d2c --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/http.pyi @@ -0,0 +1,92 @@ +import sys +from datetime import datetime, timedelta +from typing import ( + Dict, Text, Union, Tuple, Any, Optional, Mapping, Iterable, Callable, List, Type, + TypeVar, Protocol, overload, SupportsInt, +) +from wsgiref.types import WSGIEnvironment + +from .datastructures import ( + Headers, Accept, RequestCacheControl, HeaderSet, Authorization, WWWAuthenticate, + IfRange, Range, ContentRange, ETags, TypeConversionDict, +) + +if sys.version_info < (3,): + _Str = TypeVar('_Str', str, unicode) + _ToBytes = Union[bytes, bytearray, buffer, unicode] + _ETagData = Union[str, unicode, bytearray, buffer, memoryview] +else: + _Str = str + _ToBytes = Union[bytes, bytearray, memoryview, str] + _ETagData = Union[bytes, bytearray, memoryview] + +_T = TypeVar("_T") +_U = TypeVar("_U") + +HTTP_STATUS_CODES: Dict[int, str] + +def wsgi_to_bytes(data: Union[bytes, Text]) -> bytes: ... +def bytes_to_wsgi(data: bytes) -> str: ... +def quote_header_value(value: Any, extra_chars: str = ..., allow_token: bool = ...) -> str: ... +def unquote_header_value(value: _Str, is_filename: bool = ...) -> _Str: ... +def dump_options_header(header: Optional[_Str], options: Mapping[_Str, Any]) -> _Str: ... +def dump_header(iterable: Union[Iterable[Any], Dict[_Str, Any]], allow_token: bool = ...) -> _Str: ... +def parse_list_header(value: _Str) -> List[_Str]: ... +@overload +def parse_dict_header(value: Union[bytes, Text]) -> Dict[Text, Optional[Text]]: ... +@overload +def parse_dict_header(value: Union[bytes, Text], cls: Type[_T]) -> _T: ... +@overload +def parse_options_header(value: None, multiple: bool = ...) -> Tuple[str, Dict[str, Optional[str]]]: ... +@overload +def parse_options_header(value: _Str) -> Tuple[_Str, Dict[_Str, Optional[_Str]]]: ... +# actually returns Tuple[_Str, Dict[_Str, Optional[_Str]], ...] +@overload +def parse_options_header(value: _Str, multiple: bool = ...) -> Tuple[Any, ...]: ... +@overload +def parse_accept_header(value: Optional[Text]) -> Accept: ... +@overload +def parse_accept_header(value: Optional[_Str], cls: Callable[[Optional[List[Tuple[str, float]]]], _T]) -> _T: ... +@overload +def parse_cache_control_header(value: Union[None, bytes, Text], + on_update: Optional[Callable[[RequestCacheControl], Any]] = ...) -> RequestCacheControl: ... +@overload +def parse_cache_control_header(value: Union[None, bytes, Text], on_update: _T, + cls: Callable[[Dict[Text, Optional[Text]], _T], _U]) -> _U: ... +@overload +def parse_cache_control_header(value: Union[None, bytes, Text], *, + cls: Callable[[Dict[Text, Optional[Text]], None], _U]) -> _U: ... +def parse_set_header(value: Text, on_update: Optional[Callable[[HeaderSet], Any]] = ...) -> HeaderSet: ... +def parse_authorization_header(value: Union[None, bytes, Text]) -> Optional[Authorization]: ... +def parse_www_authenticate_header(value: Union[None, bytes, Text], + on_update: Optional[Callable[[WWWAuthenticate], Any]] = ...) -> WWWAuthenticate: ... +def parse_if_range_header(value: Optional[Text]) -> IfRange: ... +def parse_range_header(value: Optional[Text], make_inclusive: bool = ...) -> Optional[Range]: ... +def parse_content_range_header(value: Optional[Text], + on_update: Optional[Callable[[ContentRange], Any]] = ...) -> Optional[ContentRange]: ... +def quote_etag(etag: _Str, weak: bool = ...) -> _Str: ... +def unquote_etag(etag: Optional[_Str]) -> Tuple[Optional[_Str], Optional[_Str]]: ... +def parse_etags(value: Optional[Text]) -> ETags: ... +def generate_etag(data: _ETagData) -> str: ... +def parse_date(value: Optional[str]) -> Optional[datetime]: ... +def cookie_date(expires: Union[None, float, datetime] = ...) -> str: ... +def http_date(timestamp: Union[None, float, datetime] = ...) -> str: ... +def parse_age(value: Optional[SupportsInt] = ...) -> Optional[timedelta]: ... +def dump_age(age: Union[None, timedelta, SupportsInt]) -> Optional[str]: ... +def is_resource_modified(environ: WSGIEnvironment, etag: Optional[Text] = ..., data: Optional[_ETagData] = ..., + last_modified: Union[None, Text, datetime] = ..., ignore_if_range: bool = ...) -> bool: ... +def remove_entity_headers(headers: Union[List[Tuple[Text, Text]], Headers], allowed: Iterable[Text] = ...) -> None: ... +def remove_hop_by_hop_headers(headers: Union[List[Tuple[Text, Text]], Headers]) -> None: ... +def is_entity_header(header: Text) -> bool: ... +def is_hop_by_hop_header(header: Text) -> bool: ... +@overload +def parse_cookie(header: Union[None, WSGIEnvironment, Text, bytes], charset: Text = ..., + errors: Text = ...) -> TypeConversionDict[Any, Any]: ... +@overload +def parse_cookie(header: Union[None, WSGIEnvironment, Text, bytes], charset: Text = ..., + errors: Text = ..., cls: Optional[Callable[[Iterable[Tuple[Text, Text]]], _T]] = ...) -> _T: ... +def dump_cookie(key: _ToBytes, value: _ToBytes = ..., max_age: Union[None, float, timedelta] = ..., + expires: Union[None, Text, float, datetime] = ..., path: Union[None, Tuple[Any, ...], str, bytes] = ..., + domain: Union[None, str, bytes] = ..., secure: bool = ..., httponly: bool = ..., charset: Text = ..., + sync_expires: bool = ...) -> str: ... +def is_byte_range_valid(start: Optional[int], stop: Optional[int], length: Optional[int]) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/local.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/local.pyi new file mode 100644 index 00000000..0fe642d8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/local.pyi @@ -0,0 +1,100 @@ +from typing import Any, Optional + +def release_local(local): ... + +class Local: + def __init__(self): ... + def __iter__(self): ... + def __call__(self, proxy): ... + def __release_local__(self): ... + def __getattr__(self, name): ... + def __setattr__(self, name, value): ... + def __delattr__(self, name): ... + +class LocalStack: + def __init__(self): ... + def __release_local__(self): ... + def _get__ident_func__(self): ... + def _set__ident_func__(self, value): ... + __ident_func__: Any + def __call__(self): ... + def push(self, obj): ... + def pop(self): ... + @property + def top(self): ... + +class LocalManager: + locals: Any + ident_func: Any + def __init__(self, locals: Optional[Any] = ..., ident_func: Optional[Any] = ...): ... + def get_ident(self): ... + def cleanup(self): ... + def make_middleware(self, app): ... + def middleware(self, func): ... + +class LocalProxy: + def __init__(self, local, name: Optional[Any] = ...): ... + @property + def __dict__(self): ... + def __bool__(self): ... + def __unicode__(self): ... + def __dir__(self): ... + def __getattr__(self, name): ... + def __setitem__(self, key, value): ... + def __delitem__(self, key): ... + __getslice__: Any + def __setslice__(self, i, j, seq): ... + def __delslice__(self, i, j): ... + __setattr__: Any + __delattr__: Any + __lt__: Any + __le__: Any + __eq__: Any + __ne__: Any + __gt__: Any + __ge__: Any + __cmp__: Any + __hash__: Any + __call__: Any + __len__: Any + __getitem__: Any + __iter__: Any + __contains__: Any + __add__: Any + __sub__: Any + __mul__: Any + __floordiv__: Any + __mod__: Any + __divmod__: Any + __pow__: Any + __lshift__: Any + __rshift__: Any + __and__: Any + __xor__: Any + __or__: Any + __div__: Any + __truediv__: Any + __neg__: Any + __pos__: Any + __abs__: Any + __invert__: Any + __complex__: Any + __int__: Any + __long__: Any + __float__: Any + __oct__: Any + __hex__: Any + __index__: Any + __coerce__: Any + __enter__: Any + __exit__: Any + __radd__: Any + __rsub__: Any + __rmul__: Any + __rdiv__: Any + __rtruediv__: Any + __rfloordiv__: Any + __rmod__: Any + __rdivmod__: Any + __copy__: Any + __deepcopy__: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/dispatcher.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/dispatcher.pyi new file mode 100644 index 00000000..f107c435 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/dispatcher.pyi @@ -0,0 +1,8 @@ +from typing import Any, Iterable, Mapping, Optional, Text +from wsgiref.types import StartResponse, WSGIApplication, WSGIEnvironment + +class DispatcherMiddleware(object): + app: WSGIApplication + mounts: Mapping[Text, WSGIApplication] + def __init__(self, app: WSGIApplication, mounts: Optional[Mapping[Text, WSGIApplication]] = ...) -> None: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/http_proxy.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/http_proxy.pyi new file mode 100644 index 00000000..4056cacc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/http_proxy.pyi @@ -0,0 +1,18 @@ +from typing import Any, Dict, Iterable, Mapping, MutableMapping, Text +from wsgiref.types import StartResponse, WSGIApplication, WSGIEnvironment + +_Opts = Mapping[Text, Any] +_MutableOpts = MutableMapping[Text, Any] + +class ProxyMiddleware(object): + app: WSGIApplication + targets: Dict[Text, _MutableOpts] + def __init__( + self, + app: WSGIApplication, + targets: Mapping[Text, _MutableOpts], + chunk_size: int = ..., + timeout: int = ..., + ) -> None: ... + def proxy_to(self, opts: _Opts, path: Text, prefix: Text) -> WSGIApplication: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/lint.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/lint.pyi new file mode 100644 index 00000000..95922cc4 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/lint.pyi @@ -0,0 +1,67 @@ +import sys +from typing import Any, Iterable, Iterator, List, Mapping, Optional, Protocol, Tuple +from wsgiref.types import StartResponse, WSGIApplication, WSGIEnvironment + +from ..datastructures import Headers + +class WSGIWarning(Warning): ... +class HTTPWarning(Warning): ... + +def check_string(context: str, obj: object, stacklevel: int = ...) -> None: ... + +class _Readable(Protocol): + def read(self, __size: int = ...) -> bytes: ... + def readline(self, __size: int = ...) -> bytes: ... + def __iter__(self) -> Iterator[bytes]: ... + def close(self) -> Any: ... + +class InputStream(object): + def __init__(self, stream: _Readable) -> None: ... + def read(self, __size: int = ...) -> bytes: ... + def readline(self, __size: int = ...) -> bytes: ... + def __iter__(self) -> Iterator[bytes]: ... + def close(self) -> None: ... + +class _FullyWritable(Protocol): + def write(self, __s: str) -> Any: ... + def flush(self) -> Any: ... + def close(self) -> Any: ... + +class ErrorStream(object): + def __init__(self, stream: _FullyWritable) -> None: ... + def write(self, s: str) -> None: ... + def flush(self) -> None: ... + def writelines(self, seq: Iterable[str]) -> None: ... + def close(self) -> None: ... + +class _Writable(Protocol): + def write(self, __s: str) -> Any: ... + +class GuardedWrite(object): + def __init__(self, write: _Writable, chunks: List[int]) -> None: ... + def __call__(self, s: str) -> None: ... + +class GuardedIterator(object): + closed: bool + headers_set: bool + chunks: List[int] + def __init__(self, iterator: Iterable[str], headers_set: bool, chunks: List[int]) -> None: ... + def __iter__(self) -> GuardedIterator: ... + if sys.version_info < (3,): + def next(self) -> str: ... + else: + def __next__(self) -> str: ... + def close(self) -> None: ... + +class LintMiddleware(object): + def __init__(self, app: WSGIApplication) -> None: ... + def check_environ(self, environ: WSGIEnvironment) -> None: ... + def check_start_response( + self, + status: str, + headers: List[Tuple[str, str]], + exc_info: Optional[Tuple[Any, ...]], + ) -> Tuple[int, Headers]: ... + def check_headers(self, headers: Mapping[str, str]) -> None: ... + def check_iterator(self, app_iter: Iterable[bytes]) -> None: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> GuardedIterator: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/profiler.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/profiler.pyi new file mode 100644 index 00000000..75051220 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/profiler.pyi @@ -0,0 +1,14 @@ +from typing import IO, Iterable, List, Optional, Text, Tuple, Union +from wsgiref.types import StartResponse, WSGIApplication, WSGIEnvironment + +class ProfilerMiddleware(object): + def __init__( + self, + app: WSGIApplication, + stream: IO[str] = ..., + sort_by: Tuple[Text, Text] = ..., + restrictions: Iterable[Union[str, float]] = ..., + profile_dir: Optional[Text] = ..., + filename_format: Text = ..., + ) -> None: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> List[bytes]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/proxy_fix.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/proxy_fix.pyi new file mode 100644 index 00000000..764fc6f0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/proxy_fix.pyi @@ -0,0 +1,23 @@ +from typing import Iterable, Optional +from wsgiref.types import StartResponse, WSGIApplication, WSGIEnvironment + +class ProxyFix(object): + app: WSGIApplication + x_for: int + x_proto: int + x_host: int + x_port: int + x_prefix: int + num_proxies: int + def __init__( + self, + app: WSGIApplication, + num_proxies: Optional[int] = ..., + x_for: int = ..., + x_proto: int = ..., + x_host: int = ..., + x_port: int = ..., + x_prefix: int = ..., + ) -> None: ... + def get_remote_addr(self, forwarded_for: Iterable[str]) -> Optional[str]: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/shared_data.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/shared_data.pyi new file mode 100644 index 00000000..d1284e83 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/middleware/shared_data.pyi @@ -0,0 +1,29 @@ +import datetime +from typing import Callable, IO, Iterable, List, Mapping, Optional, Text, Tuple, Union +from wsgiref.types import StartResponse, WSGIApplication, WSGIEnvironment + +_V = Union[Tuple[Text, Text], Text] + +_Opener = Callable[[], Tuple[IO[bytes], datetime.datetime, int]] +_Loader = Callable[[Optional[Text]], Union[Tuple[None, None], Tuple[Text, _Opener]]] + +class SharedDataMiddleware(object): + app: WSGIApplication + exports: List[Tuple[Text, _Loader]] + cache: bool + cache_timeout: float + def __init__( + self, + app: WSGIApplication, + exports: Union[Mapping[Text, _V], Iterable[Tuple[Text, _V]]], + disallow: Optional[Text] = ..., + cache: bool = ..., + cache_timeout: float = ..., + fallback_mimetype: Text = ..., + ) -> None: ... + def is_allowed(self, filename: Text) -> bool: ... + def get_file_loader(self, filename: Text) -> _Loader: ... + def get_package_loader(self, package: Text, package_path: Text) -> _Loader: ... + def get_directory_loader(self, directory: Text) -> _Loader: ... + def generate_etag(self, mtime: datetime.datetime, file_size: int, real_filename: Union[Text, bytes]) -> str: ... + def __call__(self, environment: WSGIEnvironment, start_response: StartResponse) -> WSGIApplication: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/posixemulation.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/posixemulation.pyi new file mode 100644 index 00000000..f6669294 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/posixemulation.pyi @@ -0,0 +1,7 @@ +from typing import Any +from ._compat import to_unicode as to_unicode +from .filesystem import get_filesystem_encoding as get_filesystem_encoding + +can_rename_open_file: Any + +def rename(src, dst): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/routing.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/routing.pyi new file mode 100644 index 00000000..347af55b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/routing.pyi @@ -0,0 +1,189 @@ +from typing import Any, Optional, Text +from werkzeug.exceptions import HTTPException + +def parse_converter_args(argstr): ... +def parse_rule(rule): ... + +class RoutingException(Exception): ... + +class RequestRedirect(HTTPException, RoutingException): + code: Any + new_url: Any + def __init__(self, new_url): ... + def get_response(self, environ): ... + +class RequestSlash(RoutingException): ... + +class RequestAliasRedirect(RoutingException): + matched_values: Any + def __init__(self, matched_values): ... + +class BuildError(RoutingException, LookupError): + endpoint: Any + values: Any + method: Any + adapter: Optional[MapAdapter] + def __init__(self, endpoint, values, method, adapter: Optional[MapAdapter] = ...) -> None: ... + @property + def suggested(self) -> Optional[Rule]: ... + def closest_rule(self, adapter: Optional[MapAdapter]) -> Optional[Rule]: ... + +class ValidationError(ValueError): ... + +class RuleFactory: + def get_rules(self, map): ... + +class Subdomain(RuleFactory): + subdomain: Any + rules: Any + def __init__(self, subdomain, rules): ... + def get_rules(self, map): ... + +class Submount(RuleFactory): + path: Any + rules: Any + def __init__(self, path, rules): ... + def get_rules(self, map): ... + +class EndpointPrefix(RuleFactory): + prefix: Any + rules: Any + def __init__(self, prefix, rules): ... + def get_rules(self, map): ... + +class RuleTemplate: + rules: Any + def __init__(self, rules): ... + def __call__(self, *args, **kwargs): ... + +class RuleTemplateFactory(RuleFactory): + rules: Any + context: Any + def __init__(self, rules, context): ... + def get_rules(self, map): ... + +class Rule(RuleFactory): + rule: Any + is_leaf: Any + map: Any + strict_slashes: Any + subdomain: Any + host: Any + defaults: Any + build_only: Any + alias: Any + methods: Any + endpoint: Any + redirect_to: Any + arguments: Any + def __init__(self, string, defaults: Optional[Any] = ..., subdomain: Optional[Any] = ..., methods: Optional[Any] = ..., + build_only: bool = ..., endpoint: Optional[Any] = ..., strict_slashes: Optional[Any] = ..., + redirect_to: Optional[Any] = ..., alias: bool = ..., host: Optional[Any] = ...): ... + def empty(self): ... + def get_empty_kwargs(self): ... + def get_rules(self, map): ... + def refresh(self): ... + def bind(self, map, rebind: bool = ...): ... + def get_converter(self, variable_name, converter_name, args, kwargs): ... + def compile(self): ... + def match(self, path, method: Optional[Any] = ...): ... + def build(self, values, append_unknown: bool = ...): ... + def provides_defaults_for(self, rule): ... + def suitable_for(self, values, method: Optional[Any] = ...): ... + def match_compare_key(self): ... + def build_compare_key(self): ... + def __eq__(self, other): ... + def __ne__(self, other): ... + +class BaseConverter: + regex: Any + weight: Any + map: Any + def __init__(self, map): ... + def to_python(self, value): ... + def to_url(self, value): ... + +class UnicodeConverter(BaseConverter): + regex: Any + def __init__(self, map, minlength: int = ..., maxlength: Optional[Any] = ..., length: Optional[Any] = ...): ... + +class AnyConverter(BaseConverter): + regex: Any + def __init__(self, map, *items): ... + +class PathConverter(BaseConverter): + regex: Any + weight: Any + +class NumberConverter(BaseConverter): + weight: Any + fixed_digits: Any + min: Any + max: Any + def __init__(self, map, fixed_digits: int = ..., min: Optional[Any] = ..., max: Optional[Any] = ...): ... + def to_python(self, value): ... + def to_url(self, value): ... + +class IntegerConverter(NumberConverter): + regex: Any + num_convert: Any + +class FloatConverter(NumberConverter): + regex: Any + num_convert: Any + def __init__(self, map, min: Optional[Any] = ..., max: Optional[Any] = ...): ... + +class UUIDConverter(BaseConverter): + regex: Any + def to_python(self, value): ... + def to_url(self, value): ... + +DEFAULT_CONVERTERS: Any + +class Map: + default_converters: Any + default_subdomain: Any + charset: Text + encoding_errors: Text + strict_slashes: Any + redirect_defaults: Any + host_matching: Any + converters: Any + sort_parameters: Any + sort_key: Any + def __init__(self, rules: Optional[Any] = ..., default_subdomain: str = ..., charset: Text = ..., + strict_slashes: bool = ..., redirect_defaults: bool = ..., converters: Optional[Any] = ..., + sort_parameters: bool = ..., sort_key: Optional[Any] = ..., encoding_errors: Text = ..., + host_matching: bool = ...): ... + def is_endpoint_expecting(self, endpoint, *arguments): ... + def iter_rules(self, endpoint: Optional[Any] = ...): ... + def add(self, rulefactory): ... + def bind(self, server_name, script_name: Optional[Any] = ..., subdomain: Optional[Any] = ..., url_scheme: str = ..., + default_method: str = ..., path_info: Optional[Any] = ..., query_args: Optional[Any] = ...): ... + def bind_to_environ(self, environ, server_name: Optional[Any] = ..., subdomain: Optional[Any] = ...): ... + def update(self): ... + +class MapAdapter: + map: Any + server_name: Any + script_name: Any + subdomain: Any + url_scheme: Any + path_info: Any + default_method: Any + query_args: Any + def __init__(self, map, server_name, script_name, subdomain, url_scheme, path_info, default_method, + query_args: Optional[Any] = ...): ... + def dispatch(self, view_func, path_info: Optional[Any] = ..., method: Optional[Any] = ..., + catch_http_exceptions: bool = ...): ... + def match(self, path_info: Optional[Any] = ..., method: Optional[Any] = ..., return_rule: bool = ..., + query_args: Optional[Any] = ...): ... + def test(self, path_info: Optional[Any] = ..., method: Optional[Any] = ...): ... + def allowed_methods(self, path_info: Optional[Any] = ...): ... + def get_host(self, domain_part): ... + def get_default_redirect(self, rule, method, values, query_args): ... + def encode_query_args(self, query_args): ... + def make_redirect_url(self, path_info, query_args: Optional[Any] = ..., domain_part: Optional[Any] = ...): ... + def make_alias_redirect_url(self, path, endpoint, values, method, query_args): ... + def build(self, endpoint, values: Optional[Any] = ..., method: Optional[Any] = ..., force_external: bool = ..., + append_unknown: bool = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/script.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/script.pyi new file mode 100644 index 00000000..b9db97a0 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/script.pyi @@ -0,0 +1,14 @@ +from typing import Any, Optional + +argument_types: Any +converters: Any + +def run(namespace: Optional[Any] = ..., action_prefix: str = ..., args: Optional[Any] = ...): ... +def fail(message, code: int = ...): ... +def find_actions(namespace, action_prefix): ... +def print_usage(actions): ... +def analyse_action(func): ... +def make_shell(init_func: Optional[Any] = ..., banner: Optional[Any] = ..., use_ipython: bool = ...): ... +def make_runserver(app_factory, hostname: str = ..., port: int = ..., use_reloader: bool = ..., use_debugger: bool = ..., + use_evalex: bool = ..., threaded: bool = ..., processes: int = ..., static_files: Optional[Any] = ..., + extra_files: Optional[Any] = ..., ssl_context: Optional[Any] = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/security.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/security.pyi new file mode 100644 index 00000000..fcb2652f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/security.pyi @@ -0,0 +1,12 @@ +from typing import Any, Optional + +SALT_CHARS: Any +DEFAULT_PBKDF2_ITERATIONS: Any + +def pbkdf2_hex(data, salt, iterations=..., keylen: Optional[Any] = ..., hashfunc: Optional[Any] = ...): ... +def pbkdf2_bin(data, salt, iterations=..., keylen: Optional[Any] = ..., hashfunc: Optional[Any] = ...): ... +def safe_str_cmp(a, b): ... +def gen_salt(length): ... +def generate_password_hash(password, method: str = ..., salt_length: int = ...): ... +def check_password_hash(pwhash, password): ... +def safe_join(directory, filename): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/serving.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/serving.pyi new file mode 100644 index 00000000..54bce978 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/serving.pyi @@ -0,0 +1,93 @@ +import sys +from typing import Any, Optional + +if sys.version_info < (3,): + from SocketServer import ThreadingMixIn, ForkingMixIn + from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler +else: + from socketserver import ThreadingMixIn, ForkingMixIn + from http.server import HTTPServer, BaseHTTPRequestHandler + +class _SslDummy: + def __getattr__(self, name): ... + +ssl: Any +LISTEN_QUEUE: Any +can_open_by_fd: Any + +class WSGIRequestHandler(BaseHTTPRequestHandler): + @property + def server_version(self): ... + def make_environ(self): ... + environ: Any + close_connection: Any + def run_wsgi(self): ... + def handle(self): ... + def initiate_shutdown(self): ... + def connection_dropped(self, error, environ: Optional[Any] = ...): ... + raw_requestline: Any + def handle_one_request(self): ... + def send_response(self, code, message: Optional[Any] = ...): ... + def version_string(self): ... + def address_string(self): ... + def port_integer(self): ... + def log_request(self, code: object = ..., size: object = ...) -> None: ... + def log_error(self, *args): ... + def log_message(self, format, *args): ... + def log(self, type, message, *args): ... + +BaseRequestHandler: Any + +def generate_adhoc_ssl_pair(cn: Optional[Any] = ...): ... +def make_ssl_devcert(base_path, host: Optional[Any] = ..., cn: Optional[Any] = ...): ... +def generate_adhoc_ssl_context(): ... +def load_ssl_context(cert_file, pkey_file: Optional[Any] = ..., protocol: Optional[Any] = ...): ... + +class _SSLContext: + def __init__(self, protocol): ... + def load_cert_chain(self, certfile, keyfile: Optional[Any] = ..., password: Optional[Any] = ...): ... + def wrap_socket(self, sock, **kwargs): ... + +def is_ssl_error(error: Optional[Any] = ...): ... +def select_ip_version(host, port): ... + +class BaseWSGIServer(HTTPServer): + multithread: Any + multiprocess: Any + request_queue_size: Any + address_family: Any + app: Any + passthrough_errors: Any + shutdown_signal: Any + host: Any + port: Any + socket: Any + server_address: Any + ssl_context: Any + def __init__(self, host, port, app, handler: Optional[Any] = ..., passthrough_errors: bool = ..., + ssl_context: Optional[Any] = ..., fd: Optional[Any] = ...): ... + def log(self, type, message, *args): ... + def serve_forever(self): ... + def handle_error(self, request, client_address): ... + def get_request(self): ... + +class ThreadedWSGIServer(ThreadingMixIn, BaseWSGIServer): + multithread: Any + daemon_threads: Any + +class ForkingWSGIServer(ForkingMixIn, BaseWSGIServer): + multiprocess: Any + max_children: Any + def __init__(self, host, port, app, processes: int = ..., handler: Optional[Any] = ..., passthrough_errors: bool = ..., + ssl_context: Optional[Any] = ..., fd: Optional[Any] = ...): ... + +def make_server(host: Optional[Any] = ..., port: Optional[Any] = ..., app: Optional[Any] = ..., threaded: bool = ..., + processes: int = ..., request_handler: Optional[Any] = ..., passthrough_errors: bool = ..., + ssl_context: Optional[Any] = ..., fd: Optional[Any] = ...): ... +def is_running_from_reloader(): ... +def run_simple(hostname, port, application, use_reloader: bool = ..., use_debugger: bool = ..., use_evalex: bool = ..., + extra_files: Optional[Any] = ..., reloader_interval: int = ..., reloader_type: str = ..., threaded: bool = ..., + processes: int = ..., request_handler: Optional[Any] = ..., static_files: Optional[Any] = ..., + passthrough_errors: bool = ..., ssl_context: Optional[Any] = ...): ... +def run_with_reloader(*args, **kwargs): ... +def main(): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/test.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/test.pyi new file mode 100644 index 00000000..764b76d8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/test.pyi @@ -0,0 +1,154 @@ +import sys +from wsgiref.types import WSGIEnvironment +from typing import Any, Generic, Optional, Text, Tuple, Type, TypeVar, overload +from typing_extensions import Literal + +if sys.version_info < (3,): + from urllib2 import Request as U2Request + from cookielib import CookieJar +else: + from urllib.request import Request as U2Request + from http.cookiejar import CookieJar + +def stream_encode_multipart(values, use_tempfile: int = ..., threshold=..., boundary: Optional[Any] = ..., + charset: Text = ...): ... +def encode_multipart(values, boundary: Optional[Any] = ..., charset: Text = ...): ... +def File(fd, filename: Optional[Any] = ..., mimetype: Optional[Any] = ...): ... + +class _TestCookieHeaders: + headers: Any + def __init__(self, headers): ... + def getheaders(self, name): ... + def get_all(self, name, default: Optional[Any] = ...): ... + +class _TestCookieResponse: + headers: Any + def __init__(self, headers): ... + def info(self): ... + +class _TestCookieJar(CookieJar): + def inject_wsgi(self, environ): ... + def extract_wsgi(self, environ, headers): ... + +class EnvironBuilder: + server_protocol: Any + wsgi_version: Any + request_class: Any + charset: Text + path: Any + base_url: Any + query_string: Any + args: Any + method: Any + headers: Any + content_type: Any + errors_stream: Any + multithread: Any + multiprocess: Any + run_once: Any + environ_base: Any + environ_overrides: Any + input_stream: Any + content_length: Any + closed: Any + def __init__(self, path: str = ..., base_url: Optional[Any] = ..., query_string: Optional[Any] = ..., + method: str = ..., input_stream: Optional[Any] = ..., content_type: Optional[Any] = ..., + content_length: Optional[Any] = ..., errors_stream: Optional[Any] = ..., multithread: bool = ..., + multiprocess: bool = ..., run_once: bool = ..., headers: Optional[Any] = ..., data: Optional[Any] = ..., + environ_base: Optional[Any] = ..., environ_overrides: Optional[Any] = ..., charset: Text = ...): ... + form: Any + files: Any + @property + def server_name(self): ... + @property + def server_port(self): ... + def __del__(self): ... + def close(self): ... + def get_environ(self): ... + def get_request(self, cls: Optional[Any] = ...): ... + +class ClientRedirectError(Exception): ... + +# Response type for the client below. +# By default _R is Tuple[Iterable[Any], Union[Text, int], datastructures.Headers] +_R = TypeVar('_R') + +class Client(Generic[_R]): + application: Any + response_wrapper: Optional[Type[_R]] + cookie_jar: Any + allow_subdomain_redirects: Any + def __init__(self, application, response_wrapper: Optional[Type[_R]] = ..., use_cookies: bool = ..., + allow_subdomain_redirects: bool = ...): ... + def set_cookie(self, server_name, key, value: str = ..., max_age: Optional[Any] = ..., expires: Optional[Any] = ..., + path: str = ..., domain: Optional[Any] = ..., secure: Optional[Any] = ..., httponly: bool = ..., + charset: Text = ...): ... + def delete_cookie(self, server_name, key, path: str = ..., domain: Optional[Any] = ...): ... + def run_wsgi_app(self, environ, buffered: bool = ...): ... + def resolve_redirect(self, response, new_location, environ, buffered: bool = ...): ... + + @overload + def open(self, *args, as_tuple: Literal[True], **kwargs) -> Tuple[WSGIEnvironment, _R]: ... + @overload + def open(self, *args, as_tuple: Literal[False] = ..., **kwargs) -> _R: ... + @overload + def open(self, *args, as_tuple: bool, **kwargs) -> Any: ... + + @overload + def get(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ... + @overload + def get(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ... + @overload + def get(self, *args, as_tuple: bool, **kw) -> Any: ... + + @overload + def patch(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ... + @overload + def patch(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ... + @overload + def patch(self, *args, as_tuple: bool, **kw) -> Any: ... + + @overload + def post(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ... + @overload + def post(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ... + @overload + def post(self, *args, as_tuple: bool, **kw) -> Any: ... + + @overload + def head(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ... + @overload + def head(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ... + @overload + def head(self, *args, as_tuple: bool, **kw) -> Any: ... + + @overload + def put(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ... + @overload + def put(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ... + @overload + def put(self, *args, as_tuple: bool, **kw) -> Any: ... + + @overload + def delete(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ... + @overload + def delete(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ... + @overload + def delete(self, *args, as_tuple: bool, **kw) -> Any: ... + + @overload + def options(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ... + @overload + def options(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ... + @overload + def options(self, *args, as_tuple: bool, **kw) -> Any: ... + + @overload + def trace(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ... + @overload + def trace(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ... + @overload + def trace(self, *args, as_tuple: bool, **kw) -> Any: ... + +def create_environ(*args, **kwargs): ... +def run_wsgi_app(app, environ, buffered: bool = ...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/testapp.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/testapp.pyi new file mode 100644 index 00000000..e45ea4a3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/testapp.pyi @@ -0,0 +1,9 @@ +from typing import Any +from werkzeug.wrappers import BaseRequest as Request, BaseResponse as Response + +logo: Any +TEMPLATE: Any + +def iter_sys_path(): ... +def render_testapp(req): ... +def test_app(environ, start_response): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/urls.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/urls.pyi new file mode 100644 index 00000000..2853e46e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/urls.pyi @@ -0,0 +1,71 @@ +from typing import Any, NamedTuple, Optional, Text + +class _URLTuple(NamedTuple): + scheme: Any + netloc: Any + path: Any + query: Any + fragment: Any + +class BaseURL(_URLTuple): + def replace(self, **kwargs): ... + @property + def host(self): ... + @property + def ascii_host(self): ... + @property + def port(self): ... + @property + def auth(self): ... + @property + def username(self): ... + @property + def raw_username(self): ... + @property + def password(self): ... + @property + def raw_password(self): ... + def decode_query(self, *args, **kwargs): ... + def join(self, *args, **kwargs): ... + def to_url(self): ... + def decode_netloc(self): ... + def to_uri_tuple(self): ... + def to_iri_tuple(self): ... + def get_file_location(self, pathformat: Optional[Any] = ...): ... + +class URL(BaseURL): + def encode_netloc(self): ... + def encode(self, charset: Text = ..., errors: Text = ...): ... + +class BytesURL(BaseURL): + def encode_netloc(self): ... + def decode(self, charset: Text = ..., errors: Text = ...): ... + +def url_parse(url, scheme: Optional[Any] = ..., allow_fragments: bool = ...): ... +def url_quote(string, charset: Text = ..., errors: Text = ..., safe: str = ..., unsafe: str = ...): ... +def url_quote_plus(string, charset: Text = ..., errors: Text = ..., safe: str = ...): ... +def url_unparse(components): ... +def url_unquote(string, charset: Text = ..., errors: Text = ..., unsafe: str = ...): ... +def url_unquote_plus(s, charset: Text = ..., errors: Text = ...): ... +def url_fix(s, charset: Text = ...): ... +def uri_to_iri(uri, charset: Text = ..., errors: Text = ...): ... +def iri_to_uri(iri, charset: Text = ..., errors: Text = ..., safe_conversion: bool = ...): ... +def url_decode(s, charset: Text = ..., decode_keys: bool = ..., include_empty: bool = ..., errors: Text = ..., + separator: str = ..., cls: Optional[Any] = ...): ... +def url_decode_stream(stream, charset: Text = ..., decode_keys: bool = ..., include_empty: bool = ..., errors: Text = ..., + separator: str = ..., cls: Optional[Any] = ..., limit: Optional[Any] = ..., + return_iterator: bool = ...): ... +def url_encode(obj, charset: Text = ..., encode_keys: bool = ..., sort: bool = ..., key: Optional[Any] = ..., + separator: bytes = ...): ... +def url_encode_stream(obj, stream: Optional[Any] = ..., charset: Text = ..., encode_keys: bool = ..., sort: bool = ..., + key: Optional[Any] = ..., separator: bytes = ...): ... +def url_join(base, url, allow_fragments: bool = ...): ... + +class Href: + base: Any + charset: Text + sort: Any + key: Any + def __init__(self, base: str = ..., charset: Text = ..., sort: bool = ..., key: Optional[Any] = ...): ... + def __getattr__(self, name): ... + def __call__(self, *path, **query): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/useragents.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/useragents.pyi new file mode 100644 index 00000000..c7e8363d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/useragents.pyi @@ -0,0 +1,14 @@ +from typing import Any + +class UserAgentParser: + platforms: Any + browsers: Any + def __init__(self): ... + def __call__(self, user_agent): ... + +class UserAgent: + string: Any + def __init__(self, environ_or_string): ... + def to_header(self): ... + def __nonzero__(self): ... + __bool__: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/utils.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/utils.pyi new file mode 100644 index 00000000..92465efd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/utils.pyi @@ -0,0 +1,58 @@ +from typing import Any, Optional, overload, Type, TypeVar +from werkzeug._internal import _DictAccessorProperty +from werkzeug.wrappers import Response + +class cached_property(property): + __name__: Any + __module__: Any + __doc__: Any + func: Any + def __init__(self, func, name: Optional[Any] = ..., doc: Optional[Any] = ...): ... + def __set__(self, obj, value): ... + def __get__(self, obj, type: Optional[Any] = ...): ... + +class environ_property(_DictAccessorProperty): + read_only: Any + def lookup(self, obj): ... + +class header_property(_DictAccessorProperty): + def lookup(self, obj): ... + +class HTMLBuilder: + def __init__(self, dialect): ... + def __call__(self, s): ... + def __getattr__(self, tag): ... + +html: Any +xhtml: Any + +def get_content_type(mimetype, charset): ... +def format_string(string, context): ... +def secure_filename(filename): ... +def escape(s, quote: Optional[Any] = ...): ... +def unescape(s): ... + +# 'redirect' returns a werkzeug Response, unless you give it +# another Response type to use instead. +_RC = TypeVar("_RC", bound=Response) +@overload +def redirect(location, code: int = ..., Response: None = ...) -> Response: ... +@overload +def redirect(location, code: int = ..., Response: Type[_RC] = ...) -> _RC: ... + +def append_slash_redirect(environ, code: int = ...): ... +def import_string(import_name, silent: bool = ...): ... +def find_modules(import_path, include_packages: bool = ..., recursive: bool = ...): ... +def validate_arguments(func, args, kwargs, drop_extra: bool = ...): ... +def bind_arguments(func, args, kwargs): ... + +class ArgumentValidationError(ValueError): + missing: Any + extra: Any + extra_positional: Any + def __init__(self, missing: Optional[Any] = ..., extra: Optional[Any] = ..., extra_positional: Optional[Any] = ...): ... + +class ImportStringError(ImportError): + import_name: Any + exception: Any + def __init__(self, import_name, exception): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/wrappers.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/wrappers.pyi new file mode 100644 index 00000000..c1635b9f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/wrappers.pyi @@ -0,0 +1,266 @@ +import sys +from datetime import datetime +from typing import ( + Any, Callable, Iterable, Iterator, Mapping, MutableMapping, Optional, Sequence, Text, Tuple, Type, TypeVar, Union, overload +) +from wsgiref.types import WSGIEnvironment, InputStream + +from .datastructures import ( + Authorization, CombinedMultiDict, EnvironHeaders, Headers, ImmutableMultiDict, + MultiDict, ImmutableTypeConversionDict, HeaderSet, + Accept, MIMEAccept, CharsetAccept, LanguageAccept, +) +from .useragents import UserAgent + +if sys.version_info >= (3, 8): + from typing import Literal +else: + from typing_extensions import Literal + +class BaseRequest: + charset: str + encoding_errors: str + max_content_length: Optional[int] + max_form_memory_size: int + parameter_storage_class: Type[Any] + list_storage_class: Type[Any] + dict_storage_class: Type[Any] + form_data_parser_class: Type[Any] + trusted_hosts: Optional[Sequence[Text]] + disable_data_descriptor: Any + environ: WSGIEnvironment = ... + shallow: Any + def __init__(self, environ: WSGIEnvironment, populate_request: bool = ..., shallow: bool = ...) -> None: ... + @property + def url_charset(self) -> str: ... + @classmethod + def from_values(cls, *args, **kwargs) -> BaseRequest: ... + @classmethod + def application(cls, f): ... + @property + def want_form_data_parsed(self): ... + def make_form_data_parser(self): ... + def close(self) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, tb): ... + @property + def stream(self) -> InputStream: ... + input_stream: InputStream + args: ImmutableMultiDict[Any, Any] + @property + def data(self) -> bytes: ... + @overload + def get_data(self, cache: bool = ..., as_text: Literal[False] = ..., parse_form_data: bool = ...) -> bytes: ... + @overload + def get_data(self, cache: bool, as_text: Literal[True], parse_form_data: bool = ...) -> Text: ... + @overload + def get_data(self, *, as_text: Literal[True], parse_form_data: bool = ...) -> Text: ... + @overload + def get_data(self, cache: bool, as_text: bool, parse_form_data: bool = ...) -> Any: ... + @overload + def get_data(self, *, as_text: bool, parse_form_data: bool = ...) -> Any: ... + form: ImmutableMultiDict[Any, Any] + values: CombinedMultiDict[Any, Any] + files: MultiDict[Any, Any] + @property + def cookies(self) -> ImmutableTypeConversionDict[str, str]: ... + headers: EnvironHeaders + path: Text + full_path: Text + script_root: Text + url: Text + base_url: Text + url_root: Text + host_url: Text + host: Text + query_string: bytes + method: Text + @property + def access_route(self) -> Sequence[str]: ... + @property + def remote_addr(self) -> str: ... + remote_user: Text + scheme: str + is_xhr: bool + is_secure: bool + is_multithread: bool + is_multiprocess: bool + is_run_once: bool + + # These are not preset at runtime but we add them since monkeypatching this + # class is quite common. + def __setattr__(self, name: str, value: Any): ... + def __getattr__(self, name: str): ... + +_OnCloseT = TypeVar('_OnCloseT', bound=Callable[[], Any]) +_SelfT = TypeVar('_SelfT', bound=BaseResponse) + +class BaseResponse: + charset: str + default_status: int + default_mimetype: str + implicit_sequence_conversion: bool + autocorrect_location_header: bool + automatically_set_content_length: bool + headers: Headers + status_code: int + status: str + direct_passthrough: bool + response: Iterable[bytes] + def __init__(self, response: Optional[Union[str, bytes, bytearray, Iterable[str], Iterable[bytes]]] = ..., + status: Optional[Union[Text, int]] = ..., + headers: Optional[Union[Headers, + Mapping[Text, Text], + Sequence[Tuple[Text, Text]]]] = ..., + mimetype: Optional[Text] = ..., + content_type: Optional[Text] = ..., + direct_passthrough: bool = ...) -> None: ... + def call_on_close(self, func: _OnCloseT) -> _OnCloseT: ... + @classmethod + def force_type(cls: Type[_SelfT], response: object, environ: Optional[WSGIEnvironment] = ...) -> _SelfT: ... + @classmethod + def from_app(cls: Type[_SelfT], app: Any, environ: WSGIEnvironment, buffered: bool = ...) -> _SelfT: ... + @overload + def get_data(self, as_text: Literal[False] = ...) -> bytes: ... + @overload + def get_data(self, as_text: Literal[True]) -> Text: ... + @overload + def get_data(self, as_text: bool) -> Any: ... + def set_data(self, value: Union[bytes, Text]) -> None: ... + data: Any + def calculate_content_length(self) -> Optional[int]: ... + def make_sequence(self) -> None: ... + def iter_encoded(self) -> Iterator[bytes]: ... + def set_cookie(self, key, value: str = ..., max_age: Optional[Any] = ..., expires: Optional[Any] = ..., + path: str = ..., domain: Optional[Any] = ..., secure: bool = ..., httponly: bool = ...): ... + def delete_cookie(self, key, path: str = ..., domain: Optional[Any] = ...): ... + @property + def is_streamed(self) -> bool: ... + @property + def is_sequence(self) -> bool: ... + def close(self) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_value, tb): ... + # The no_etag argument if fictional, but required for compatibility with + # ETagResponseMixin + def freeze(self, no_etag: bool = ...) -> None: ... + def get_wsgi_headers(self, environ): ... + def get_app_iter(self, environ): ... + def get_wsgi_response(self, environ): ... + def __call__(self, environ, start_response): ... + +class AcceptMixin(object): + @property + def accept_mimetypes(self) -> MIMEAccept: ... + @property + def accept_charsets(self) -> CharsetAccept: ... + @property + def accept_encodings(self) -> Accept: ... + @property + def accept_languages(self) -> LanguageAccept: ... + +class ETagRequestMixin: + @property + def cache_control(self): ... + @property + def if_match(self): ... + @property + def if_none_match(self): ... + @property + def if_modified_since(self): ... + @property + def if_unmodified_since(self): ... + @property + def if_range(self): ... + @property + def range(self): ... + +class UserAgentMixin: + @property + def user_agent(self) -> UserAgent: ... + +class AuthorizationMixin: + @property + def authorization(self) -> Optional[Authorization]: ... + +class StreamOnlyMixin: + disable_data_descriptor: Any + want_form_data_parsed: Any + +class ETagResponseMixin: + @property + def cache_control(self): ... + status_code: Any + def make_conditional(self, request_or_environ, accept_ranges: bool = ..., complete_length: Optional[Any] = ...): ... + def add_etag(self, overwrite: bool = ..., weak: bool = ...): ... + def set_etag(self, etag, weak: bool = ...): ... + def get_etag(self): ... + def freeze(self, no_etag: bool = ...) -> None: ... + accept_ranges: Any + content_range: Any + +class ResponseStream: + mode: Any + response: Any + closed: Any + def __init__(self, response): ... + def write(self, value): ... + def writelines(self, seq): ... + def close(self): ... + def flush(self): ... + def isatty(self): ... + @property + def encoding(self): ... + +class ResponseStreamMixin: + @property + def stream(self) -> ResponseStream: ... + +class CommonRequestDescriptorsMixin: + @property + def content_type(self) -> Optional[str]: ... + @property + def content_length(self) -> Optional[int]: ... + @property + def content_encoding(self) -> Optional[str]: ... + @property + def content_md5(self) -> Optional[str]: ... + @property + def referrer(self) -> Optional[str]: ... + @property + def date(self) -> Optional[datetime]: ... + @property + def max_forwards(self) -> Optional[int]: ... + @property + def mimetype(self) -> str: ... + @property + def mimetype_params(self) -> Mapping[str, str]: ... + @property + def pragma(self) -> HeaderSet: ... + +class CommonResponseDescriptorsMixin: + mimetype: Optional[str] = ... + @property + def mimetype_params(self) -> MutableMapping[str, str]: ... + location: Optional[str] = ... + age: Any = ... # get: Optional[datetime.timedelta] + content_type: Optional[str] = ... + content_length: Optional[int] = ... + content_location: Optional[str] = ... + content_encoding: Optional[str] = ... + content_md5: Optional[str] = ... + date: Any = ... # get: Optional[datetime.datetime] + expires: Any = ... # get: Optional[datetime.datetime] + last_modified: Any = ... # get: Optional[datetime.datetime] + retry_after: Any = ... # get: Optional[datetime.datetime] + vary: Optional[str] = ... + content_language: Optional[str] = ... + allow: Optional[str] = ... + +class WWWAuthenticateMixin: + @property + def www_authenticate(self): ... + +class Request(BaseRequest, AcceptMixin, ETagRequestMixin, UserAgentMixin, AuthorizationMixin, CommonRequestDescriptorsMixin): ... +class PlainRequest(StreamOnlyMixin, Request): ... +class Response(BaseResponse, ETagResponseMixin, ResponseStreamMixin, CommonResponseDescriptorsMixin, WWWAuthenticateMixin): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/wsgi.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/wsgi.pyi new file mode 100644 index 00000000..c7863cdd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/werkzeug/wsgi.pyi @@ -0,0 +1,74 @@ +from typing import Any, Optional, Protocol, Iterable, Text +from wsgiref.types import WSGIEnvironment, InputStream + +from .middleware.dispatcher import DispatcherMiddleware as DispatcherMiddleware +from .middleware.http_proxy import ProxyMiddleware as ProxyMiddleware +from .middleware.shared_data import SharedDataMiddleware as SharedDataMiddleware + +def responder(f): ... +def get_current_url(environ, root_only: bool = ..., strip_querystring: bool = ..., host_only: bool = ..., + trusted_hosts: Optional[Any] = ...): ... +def host_is_trusted(hostname, trusted_list): ... +def get_host(environ, trusted_hosts: Optional[Any] = ...): ... +def get_content_length(environ: WSGIEnvironment) -> Optional[int]: ... +def get_input_stream(environ: WSGIEnvironment, safe_fallback: bool = ...) -> InputStream: ... +def get_query_string(environ): ... +def get_path_info(environ, charset: Text = ..., errors: Text = ...): ... +def get_script_name(environ, charset: Text = ..., errors: Text = ...): ... +def pop_path_info(environ, charset: Text = ..., errors: Text = ...): ... +def peek_path_info(environ, charset: Text = ..., errors: Text = ...): ... +def extract_path_info(environ_or_baseurl, path_or_url, charset: Text = ..., errors: Text = ..., + collapse_http_schemes: bool = ...): ... + +class ClosingIterator: + def __init__(self, iterable, callbacks: Optional[Any] = ...): ... + def __iter__(self): ... + def __next__(self): ... + def close(self): ... + +class _Readable(Protocol): + def read(self, size: int = ...) -> bytes: ... + +def wrap_file(environ: WSGIEnvironment, file: _Readable, buffer_size: int = ...) -> Iterable[bytes]: ... + +class FileWrapper: + file: _Readable + buffer_size: int + def __init__(self, file: _Readable, buffer_size: int = ...) -> None: ... + def close(self) -> None: ... + def seekable(self) -> bool: ... + def seek(self, offset: int, whence: int = ...) -> None: ... + def tell(self) -> Optional[int]: ... + def __iter__(self) -> FileWrapper: ... + def __next__(self) -> bytes: ... + +class _RangeWrapper: + iterable: Any + byte_range: Any + start_byte: Any + end_byte: Any + read_length: Any + seekable: Any + end_reached: Any + def __init__(self, iterable, start_byte: int = ..., byte_range: Optional[Any] = ...): ... + def __iter__(self): ... + def __next__(self): ... + def close(self): ... + +def make_line_iter(stream, limit: Optional[Any] = ..., buffer_size=..., cap_at_buffer: bool = ...): ... +def make_chunk_iter(stream, separator, limit: Optional[Any] = ..., buffer_size=..., cap_at_buffer: bool = ...): ... + +class LimitedStream: + limit: Any + def __init__(self, stream, limit): ... + def __iter__(self): ... + @property + def is_exhausted(self): ... + def on_exhausted(self): ... + def on_disconnect(self): ... + def exhaust(self, chunk_size=...): ... + def read(self, size: Optional[Any] = ...): ... + def readline(self, size: Optional[Any] = ...): ... + def readlines(self, size: Optional[Any] = ...): ... + def tell(self): ... + def __next__(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/__init__.pyi new file mode 100644 index 00000000..4a221883 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/__init__.pyi @@ -0,0 +1,82 @@ +from typing import Any, IO, Iterator, Optional, overload, Sequence, Text, Union +import sys +from yaml.error import * # noqa: F403 +from yaml.tokens import * # noqa: F403 +from yaml.events import * # noqa: F403 +from yaml.nodes import * # noqa: F403 +from yaml.loader import * # noqa: F403 +from yaml.dumper import * # noqa: F403 +from . import resolver # Help mypy a bit; this is implied by loader and dumper +from .cyaml import * + +if sys.version_info < (3,): + _Str = Union[Text, str] +else: + _Str = str +# FIXME: the functions really return py2:unicode/py3:str if encoding is None, otherwise py2:str/py3:bytes. Waiting for python/mypy#5621 +_Yaml = Any + +__with_libyaml__: Any +__version__: str + +def scan(stream, Loader=...): ... +def parse(stream, Loader=...): ... +def compose(stream, Loader=...): ... +def compose_all(stream, Loader=...): ... +def load(stream: Union[bytes, IO[bytes], str, IO[str]], Loader=...) -> Any: ... +def load_all(stream: Union[bytes, IO[bytes], str, IO[str]], Loader=...) -> Iterator[Any]: ... +def full_load(stream: Union[bytes, IO[bytes], str, IO[str]]) -> Any: ... +def full_load_all(stream: Union[bytes, IO[bytes], str, IO[str]]) -> Iterator[Any]: ... +def safe_load(stream: Union[bytes, IO[bytes], str, IO[str]]) -> Any: ... +def safe_load_all(stream: Union[bytes, IO[bytes], str, IO[str]]) -> Iterator[Any]: ... +def emit(events, stream=..., Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=...): ... + +@overload +def serialize_all(nodes, stream: IO[str], Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... +@overload +def serialize_all(nodes, stream: None = ..., Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=...) -> _Yaml: ... + +@overload +def serialize(node, stream: IO[str], Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... +@overload +def serialize(node, stream: None = ..., Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=...) -> _Yaml: ... + +@overload +def dump_all(documents: Sequence[Any], stream: IO[str], Dumper=..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> None: ... +@overload +def dump_all(documents: Sequence[Any], stream: None = ..., Dumper=..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> _Yaml: ... + +@overload +def dump(data: Any, stream: IO[str], Dumper=..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> None: ... +@overload +def dump(data: Any, stream: None = ..., Dumper=..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> _Yaml: ... + +@overload +def safe_dump_all(documents: Sequence[Any], stream: IO[str], default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> None: ... +@overload +def safe_dump_all(documents: Sequence[Any], stream: None = ..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> _Yaml: ... + +@overload +def safe_dump(data: Any, stream: IO[str], default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> None: ... +@overload +def safe_dump(data: Any, stream: None = ..., default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding: Optional[_Str] = ..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> _Yaml: ... + +def add_implicit_resolver(tag, regexp, first=..., Loader=..., Dumper=...): ... +def add_path_resolver(tag, path, kind=..., Loader=..., Dumper=...): ... +def add_constructor(tag, constructor, Loader=...): ... +def add_multi_constructor(tag_prefix, multi_constructor, Loader=...): ... +def add_representer(data_type, representer, Dumper=...): ... +def add_multi_representer(data_type, multi_representer, Dumper=...): ... + +class YAMLObjectMetaclass(type): + def __init__(self, name, bases, kwds) -> None: ... + +class YAMLObject(metaclass=YAMLObjectMetaclass): + yaml_loader: Any + yaml_dumper: Any + yaml_tag: Any + yaml_flow_style: Any + @classmethod + def from_yaml(cls, loader, node): ... + @classmethod + def to_yaml(cls, dumper, data): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/composer.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/composer.pyi new file mode 100644 index 00000000..f1e2c03a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/composer.pyi @@ -0,0 +1,17 @@ +from typing import Any +from yaml.error import Mark, YAMLError, MarkedYAMLError +from yaml.nodes import Node, ScalarNode, CollectionNode, SequenceNode, MappingNode + +class ComposerError(MarkedYAMLError): ... + +class Composer: + anchors: Any + def __init__(self) -> None: ... + def check_node(self): ... + def get_node(self): ... + def get_single_node(self): ... + def compose_document(self): ... + def compose_node(self, parent, index): ... + def compose_scalar_node(self, anchor): ... + def compose_sequence_node(self, anchor): ... + def compose_mapping_node(self, anchor): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/constructor.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/constructor.pyi new file mode 100644 index 00000000..1c3d9986 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/constructor.pyi @@ -0,0 +1,85 @@ +from yaml.error import Mark, YAMLError, MarkedYAMLError +from yaml.nodes import Node, ScalarNode, CollectionNode, SequenceNode, MappingNode + +from typing import Any + +class ConstructorError(MarkedYAMLError): ... + +class BaseConstructor: + yaml_constructors: Any + yaml_multi_constructors: Any + constructed_objects: Any + recursive_objects: Any + state_generators: Any + deep_construct: Any + def __init__(self) -> None: ... + def check_data(self): ... + def get_data(self): ... + def get_single_data(self): ... + def construct_document(self, node): ... + def construct_object(self, node, deep=...): ... + def construct_scalar(self, node): ... + def construct_sequence(self, node, deep=...): ... + def construct_mapping(self, node, deep=...): ... + def construct_pairs(self, node, deep=...): ... + @classmethod + def add_constructor(cls, tag, constructor): ... + @classmethod + def add_multi_constructor(cls, tag_prefix, multi_constructor): ... + +class SafeConstructor(BaseConstructor): + def construct_scalar(self, node): ... + def flatten_mapping(self, node): ... + def construct_mapping(self, node, deep=...): ... + def construct_yaml_null(self, node): ... + bool_values: Any + def construct_yaml_bool(self, node): ... + def construct_yaml_int(self, node): ... + inf_value: Any + nan_value: Any + def construct_yaml_float(self, node): ... + def construct_yaml_binary(self, node): ... + timestamp_regexp: Any + def construct_yaml_timestamp(self, node): ... + def construct_yaml_omap(self, node): ... + def construct_yaml_pairs(self, node): ... + def construct_yaml_set(self, node): ... + def construct_yaml_str(self, node): ... + def construct_yaml_seq(self, node): ... + def construct_yaml_map(self, node): ... + def construct_yaml_object(self, node, cls): ... + def construct_undefined(self, node): ... + +class FullConstructor(SafeConstructor): + def construct_python_str(self, node): ... + def construct_python_unicode(self, node): ... + def construct_python_bytes(self, node): ... + def construct_python_long(self, node): ... + def construct_python_complex(self, node): ... + def construct_python_tuple(self, node): ... + def find_python_module(self, name, mark, unsafe=...): ... + def find_python_name(self, name, mark, unsafe=...): ... + def construct_python_name(self, suffix, node): ... + def construct_python_module(self, suffix, node): ... + def make_python_instance(self, suffix, node, args=..., kwds=..., newobj=..., unsafe=...): ... + def set_python_instance_state(self, instance, state): ... + def construct_python_object(self, suffix, node): ... + def construct_python_object_apply(self, suffix, node, newobj=...): ... + def construct_python_object_new(self, suffix, node): ... + +class Constructor(SafeConstructor): + def construct_python_str(self, node): ... + def construct_python_unicode(self, node): ... + def construct_python_long(self, node): ... + def construct_python_complex(self, node): ... + def construct_python_tuple(self, node): ... + def find_python_module(self, name, mark): ... + def find_python_name(self, name, mark): ... + def construct_python_name(self, suffix, node): ... + def construct_python_module(self, suffix, node): ... + class classobj: ... + def make_python_instance(self, suffix, node, args=..., kwds=..., newobj=...): ... + def set_python_instance_state(self, instance, state): ... + def construct_python_object(self, suffix, node): ... + def construct_python_object_apply(self, suffix, node, newobj=...): ... + def construct_python_object_new(self, suffix, node): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/cyaml.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/cyaml.pyi new file mode 100644 index 00000000..0eef8159 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/cyaml.pyi @@ -0,0 +1,47 @@ +from typing import Any, IO, Mapping, Optional, Sequence, Text, Union +from typing_extensions import Protocol + +from yaml.constructor import BaseConstructor, Constructor, SafeConstructor +from yaml.representer import BaseRepresenter, Representer, SafeRepresenter +from yaml.resolver import BaseResolver, Resolver +from yaml.serializer import Serializer + +class _Readable(Protocol): + def read(self, size: int) -> Union[Text, bytes]: ... + +class CParser: + def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ... + +class CBaseLoader(CParser, BaseConstructor, BaseResolver): + def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ... + +class CLoader(CParser, SafeConstructor, Resolver): + def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ... + +class CSafeLoader(CParser, SafeConstructor, Resolver): + def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ... + +class CDangerLoader(CParser, Constructor, Resolver): ... # undocumented + +class CEmitter(object): + def __init__(self, stream: IO[Any], canonical: Optional[Any] = ..., + indent: Optional[int] = ..., width: Optional[int] = ..., + allow_unicode: Optional[Any] = ..., line_break: Optional[str] = ..., + encoding: Optional[Text] = ..., explicit_start: Optional[Any] = ..., + explicit_end: Optional[Any] = ..., version: Optional[Sequence[int]] = ..., + tags: Optional[Mapping[Text, Text]] = ...) -> None: ... + +class CBaseDumper(CEmitter, BaseRepresenter, BaseResolver): + def __init__(self, stream: IO[Any], default_style: Optional[str] = ..., + default_flow_style: Optional[bool] = ..., canonical: Optional[Any] = ..., + indent: Optional[int] = ..., width: Optional[int] = ..., + allow_unicode: Optional[Any] = ..., line_break: Optional[str] = ..., + encoding: Optional[Text] = ..., explicit_start: Optional[Any] = ..., + explicit_end: Optional[Any] = ..., version: Optional[Sequence[int]] = ..., + tags: Optional[Mapping[Text, Text]] = ...) -> None: ... + +class CDumper(CEmitter, SafeRepresenter, Resolver): ... + +CSafeDumper = CDumper + +class CDangerDumper(CEmitter, Serializer, Representer, Resolver): ... # undocumented diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/dumper.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/dumper.pyi new file mode 100644 index 00000000..e2613ef5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/dumper.pyi @@ -0,0 +1,13 @@ +from yaml.emitter import Emitter +from yaml.serializer import Serializer +from yaml.representer import BaseRepresenter, Representer, SafeRepresenter +from yaml.resolver import BaseResolver, Resolver + +class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver): + def __init__(self, stream, default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> None: ... + +class SafeDumper(Emitter, Serializer, SafeRepresenter, Resolver): + def __init__(self, stream, default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> None: ... + +class Dumper(Emitter, Serializer, Representer, Resolver): + def __init__(self, stream, default_style=..., default_flow_style=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=..., encoding=..., explicit_start=..., explicit_end=..., version=..., tags=..., sort_keys: bool = ...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/emitter.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/emitter.pyi new file mode 100644 index 00000000..5ca9cbb6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/emitter.pyi @@ -0,0 +1,106 @@ +from typing import Any +from yaml.error import YAMLError + +class EmitterError(YAMLError): ... + +class ScalarAnalysis: + scalar: Any + empty: Any + multiline: Any + allow_flow_plain: Any + allow_block_plain: Any + allow_single_quoted: Any + allow_double_quoted: Any + allow_block: Any + def __init__(self, scalar, empty, multiline, allow_flow_plain, allow_block_plain, allow_single_quoted, allow_double_quoted, allow_block) -> None: ... + +class Emitter: + DEFAULT_TAG_PREFIXES: Any + stream: Any + encoding: Any + states: Any + state: Any + events: Any + event: Any + indents: Any + indent: Any + flow_level: Any + root_context: Any + sequence_context: Any + mapping_context: Any + simple_key_context: Any + line: Any + column: Any + whitespace: Any + indention: Any + open_ended: Any + canonical: Any + allow_unicode: Any + best_indent: Any + best_width: Any + best_line_break: Any + tag_prefixes: Any + prepared_anchor: Any + prepared_tag: Any + analysis: Any + style: Any + def __init__(self, stream, canonical=..., indent=..., width=..., allow_unicode=..., line_break=...) -> None: ... + def dispose(self): ... + def emit(self, event): ... + def need_more_events(self): ... + def need_events(self, count): ... + def increase_indent(self, flow=..., indentless=...): ... + def expect_stream_start(self): ... + def expect_nothing(self): ... + def expect_first_document_start(self): ... + def expect_document_start(self, first=...): ... + def expect_document_end(self): ... + def expect_document_root(self): ... + def expect_node(self, root=..., sequence=..., mapping=..., simple_key=...): ... + def expect_alias(self): ... + def expect_scalar(self): ... + def expect_flow_sequence(self): ... + def expect_first_flow_sequence_item(self): ... + def expect_flow_sequence_item(self): ... + def expect_flow_mapping(self): ... + def expect_first_flow_mapping_key(self): ... + def expect_flow_mapping_key(self): ... + def expect_flow_mapping_simple_value(self): ... + def expect_flow_mapping_value(self): ... + def expect_block_sequence(self): ... + def expect_first_block_sequence_item(self): ... + def expect_block_sequence_item(self, first=...): ... + def expect_block_mapping(self): ... + def expect_first_block_mapping_key(self): ... + def expect_block_mapping_key(self, first=...): ... + def expect_block_mapping_simple_value(self): ... + def expect_block_mapping_value(self): ... + def check_empty_sequence(self): ... + def check_empty_mapping(self): ... + def check_empty_document(self): ... + def check_simple_key(self): ... + def process_anchor(self, indicator): ... + def process_tag(self): ... + def choose_scalar_style(self): ... + def process_scalar(self): ... + def prepare_version(self, version): ... + def prepare_tag_handle(self, handle): ... + def prepare_tag_prefix(self, prefix): ... + def prepare_tag(self, tag): ... + def prepare_anchor(self, anchor): ... + def analyze_scalar(self, scalar): ... + def flush_stream(self): ... + def write_stream_start(self): ... + def write_stream_end(self): ... + def write_indicator(self, indicator, need_whitespace, whitespace=..., indention=...): ... + def write_indent(self): ... + def write_line_break(self, data=...): ... + def write_version_directive(self, version_text): ... + def write_tag_directive(self, handle_text, prefix_text): ... + def write_single_quoted(self, text, split=...): ... + ESCAPE_REPLACEMENTS: Any + def write_double_quoted(self, text, split=...): ... + def determine_block_hints(self, text): ... + def write_folded(self, text): ... + def write_literal(self, text): ... + def write_plain(self, text, split=...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/error.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/error.pyi new file mode 100644 index 00000000..e567dd04 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/error.pyi @@ -0,0 +1,21 @@ +from typing import Any + +class Mark: + name: Any + index: Any + line: Any + column: Any + buffer: Any + pointer: Any + def __init__(self, name, index, line, column, buffer, pointer) -> None: ... + def get_snippet(self, indent=..., max_length=...): ... + +class YAMLError(Exception): ... + +class MarkedYAMLError(YAMLError): + context: Any + context_mark: Any + problem: Any + problem_mark: Any + note: Any + def __init__(self, context=..., context_mark=..., problem=..., problem_mark=..., note=...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/events.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/events.pyi new file mode 100644 index 00000000..7096d157 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/events.pyi @@ -0,0 +1,62 @@ +from typing import Any + +class Event: + start_mark: Any + end_mark: Any + def __init__(self, start_mark=..., end_mark=...) -> None: ... + +class NodeEvent(Event): + anchor: Any + start_mark: Any + end_mark: Any + def __init__(self, anchor, start_mark=..., end_mark=...) -> None: ... + +class CollectionStartEvent(NodeEvent): + anchor: Any + tag: Any + implicit: Any + start_mark: Any + end_mark: Any + flow_style: Any + def __init__(self, anchor, tag, implicit, start_mark=..., end_mark=..., flow_style=...) -> None: ... + +class CollectionEndEvent(Event): ... + +class StreamStartEvent(Event): + start_mark: Any + end_mark: Any + encoding: Any + def __init__(self, start_mark=..., end_mark=..., encoding=...) -> None: ... + +class StreamEndEvent(Event): ... + +class DocumentStartEvent(Event): + start_mark: Any + end_mark: Any + explicit: Any + version: Any + tags: Any + def __init__(self, start_mark=..., end_mark=..., explicit=..., version=..., tags=...) -> None: ... + +class DocumentEndEvent(Event): + start_mark: Any + end_mark: Any + explicit: Any + def __init__(self, start_mark=..., end_mark=..., explicit=...) -> None: ... + +class AliasEvent(NodeEvent): ... + +class ScalarEvent(NodeEvent): + anchor: Any + tag: Any + implicit: Any + value: Any + start_mark: Any + end_mark: Any + style: Any + def __init__(self, anchor, tag, implicit, value, start_mark=..., end_mark=..., style=...) -> None: ... + +class SequenceStartEvent(CollectionStartEvent): ... +class SequenceEndEvent(CollectionEndEvent): ... +class MappingStartEvent(CollectionStartEvent): ... +class MappingEndEvent(CollectionEndEvent): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/loader.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/loader.pyi new file mode 100644 index 00000000..15c3a50d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/loader.pyi @@ -0,0 +1,18 @@ +from yaml.reader import Reader +from yaml.scanner import Scanner +from yaml.parser import Parser +from yaml.composer import Composer +from yaml.constructor import BaseConstructor, FullConstructor, SafeConstructor, Constructor +from yaml.resolver import BaseResolver, Resolver + +class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver): + def __init__(self, stream) -> None: ... + +class FullLoader(Reader, Scanner, Parser, Composer, FullConstructor, Resolver): + def __init__(self, stream) -> None: ... + +class SafeLoader(Reader, Scanner, Parser, Composer, SafeConstructor, Resolver): + def __init__(self, stream) -> None: ... + +class Loader(Reader, Scanner, Parser, Composer, Constructor, Resolver): + def __init__(self, stream) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/nodes.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/nodes.pyi new file mode 100644 index 00000000..f31fa7de --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/nodes.pyi @@ -0,0 +1,31 @@ +from typing import Any + +class Node: + tag: Any + value: Any + start_mark: Any + end_mark: Any + def __init__(self, tag, value, start_mark, end_mark) -> None: ... + +class ScalarNode(Node): + id: Any + tag: Any + value: Any + start_mark: Any + end_mark: Any + style: Any + def __init__(self, tag, value, start_mark=..., end_mark=..., style=...) -> None: ... + +class CollectionNode(Node): + tag: Any + value: Any + start_mark: Any + end_mark: Any + flow_style: Any + def __init__(self, tag, value, start_mark=..., end_mark=..., flow_style=...) -> None: ... + +class SequenceNode(CollectionNode): + id: Any + +class MappingNode(CollectionNode): + id: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/parser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/parser.pyi new file mode 100644 index 00000000..4253e117 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/parser.pyi @@ -0,0 +1,44 @@ +from typing import Any +from yaml.error import MarkedYAMLError + +class ParserError(MarkedYAMLError): ... + +class Parser: + DEFAULT_TAGS: Any + current_event: Any + yaml_version: Any + tag_handles: Any + states: Any + marks: Any + state: Any + def __init__(self) -> None: ... + def dispose(self): ... + def check_event(self, *choices): ... + def peek_event(self): ... + def get_event(self): ... + def parse_stream_start(self): ... + def parse_implicit_document_start(self): ... + def parse_document_start(self): ... + def parse_document_end(self): ... + def parse_document_content(self): ... + def process_directives(self): ... + def parse_block_node(self): ... + def parse_flow_node(self): ... + def parse_block_node_or_indentless_sequence(self): ... + def parse_node(self, block=..., indentless_sequence=...): ... + def parse_block_sequence_first_entry(self): ... + def parse_block_sequence_entry(self): ... + def parse_indentless_sequence_entry(self): ... + def parse_block_mapping_first_key(self): ... + def parse_block_mapping_key(self): ... + def parse_block_mapping_value(self): ... + def parse_flow_sequence_first_entry(self): ... + def parse_flow_sequence_entry(self, first=...): ... + def parse_flow_sequence_entry_mapping_key(self): ... + def parse_flow_sequence_entry_mapping_value(self): ... + def parse_flow_sequence_entry_mapping_end(self): ... + def parse_flow_mapping_first_key(self): ... + def parse_flow_mapping_key(self, first=...): ... + def parse_flow_mapping_value(self): ... + def parse_flow_mapping_empty_value(self): ... + def process_empty_scalar(self, mark): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/reader.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/reader.pyi new file mode 100644 index 00000000..05adf0cd --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/reader.pyi @@ -0,0 +1,34 @@ +from typing import Any +from yaml.error import YAMLError + +class ReaderError(YAMLError): + name: Any + character: Any + position: Any + encoding: Any + reason: Any + def __init__(self, name, position, character, encoding, reason) -> None: ... + +class Reader: + name: Any + stream: Any + stream_pointer: Any + eof: Any + buffer: Any + pointer: Any + raw_buffer: Any + raw_decode: Any + encoding: Any + index: Any + line: Any + column: Any + def __init__(self, stream) -> None: ... + def peek(self, index=...): ... + def prefix(self, length=...): ... + def forward(self, length=...): ... + def get_mark(self): ... + def determine_encoding(self): ... + NON_PRINTABLE: Any + def check_printable(self, data): ... + def update(self, length): ... + def update_raw(self, size=...): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/representer.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/representer.pyi new file mode 100644 index 00000000..eca81cf1 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/representer.pyi @@ -0,0 +1,55 @@ +from typing import Any +from yaml.error import YAMLError + +class RepresenterError(YAMLError): ... + +class BaseRepresenter: + yaml_representers: Any + yaml_multi_representers: Any + default_style: Any + default_flow_style: Any + sort_keys: bool + represented_objects: Any + object_keeper: Any + alias_key: Any + def __init__(self, default_style=..., default_flow_style=..., sort_keys: bool = ...) -> None: ... + def represent(self, data): ... + def get_classobj_bases(self, cls): ... + def represent_data(self, data): ... + @classmethod + def add_representer(cls, data_type, representer): ... + @classmethod + def add_multi_representer(cls, data_type, representer): ... + def represent_scalar(self, tag, value, style=...): ... + def represent_sequence(self, tag, sequence, flow_style=...): ... + def represent_mapping(self, tag, mapping, flow_style=...): ... + def ignore_aliases(self, data): ... + +class SafeRepresenter(BaseRepresenter): + def ignore_aliases(self, data): ... + def represent_none(self, data): ... + def represent_str(self, data): ... + def represent_unicode(self, data): ... + def represent_bool(self, data): ... + def represent_int(self, data): ... + def represent_long(self, data): ... + inf_value: Any + def represent_float(self, data): ... + def represent_list(self, data): ... + def represent_dict(self, data): ... + def represent_set(self, data): ... + def represent_date(self, data): ... + def represent_datetime(self, data): ... + def represent_yaml_object(self, tag, data, cls, flow_style=...): ... + def represent_undefined(self, data): ... + +class Representer(SafeRepresenter): + def represent_str(self, data): ... + def represent_unicode(self, data): ... + def represent_long(self, data): ... + def represent_complex(self, data): ... + def represent_tuple(self, data): ... + def represent_name(self, data): ... + def represent_module(self, data): ... + def represent_instance(self, data): ... + def represent_object(self, data): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/resolver.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/resolver.pyi new file mode 100644 index 00000000..72975609 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/resolver.pyi @@ -0,0 +1,24 @@ +from typing import Any +from yaml.error import YAMLError + +class ResolverError(YAMLError): ... + +class BaseResolver: + DEFAULT_SCALAR_TAG: Any + DEFAULT_SEQUENCE_TAG: Any + DEFAULT_MAPPING_TAG: Any + yaml_implicit_resolvers: Any + yaml_path_resolvers: Any + resolver_exact_paths: Any + resolver_prefix_paths: Any + def __init__(self) -> None: ... + @classmethod + def add_implicit_resolver(cls, tag, regexp, first): ... + @classmethod + def add_path_resolver(cls, tag, path, kind=...): ... + def descend_resolver(self, current_node, current_index): ... + def ascend_resolver(self): ... + def check_resolver_prefix(self, depth, path, kind, current_node, current_index): ... + def resolve(self, kind, value, implicit): ... + +class Resolver(BaseResolver): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/scanner.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/scanner.pyi new file mode 100644 index 00000000..33f45dac --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/scanner.pyi @@ -0,0 +1,96 @@ +from typing import Any +from yaml.error import MarkedYAMLError + +class ScannerError(MarkedYAMLError): ... + +class SimpleKey: + token_number: Any + required: Any + index: Any + line: Any + column: Any + mark: Any + def __init__(self, token_number, required, index, line, column, mark) -> None: ... + +class Scanner: + done: Any + flow_level: Any + tokens: Any + tokens_taken: Any + indent: Any + indents: Any + allow_simple_key: Any + possible_simple_keys: Any + def __init__(self) -> None: ... + def check_token(self, *choices): ... + def peek_token(self): ... + def get_token(self): ... + def need_more_tokens(self): ... + def fetch_more_tokens(self): ... + def next_possible_simple_key(self): ... + def stale_possible_simple_keys(self): ... + def save_possible_simple_key(self): ... + def remove_possible_simple_key(self): ... + def unwind_indent(self, column): ... + def add_indent(self, column): ... + def fetch_stream_start(self): ... + def fetch_stream_end(self): ... + def fetch_directive(self): ... + def fetch_document_start(self): ... + def fetch_document_end(self): ... + def fetch_document_indicator(self, TokenClass): ... + def fetch_flow_sequence_start(self): ... + def fetch_flow_mapping_start(self): ... + def fetch_flow_collection_start(self, TokenClass): ... + def fetch_flow_sequence_end(self): ... + def fetch_flow_mapping_end(self): ... + def fetch_flow_collection_end(self, TokenClass): ... + def fetch_flow_entry(self): ... + def fetch_block_entry(self): ... + def fetch_key(self): ... + def fetch_value(self): ... + def fetch_alias(self): ... + def fetch_anchor(self): ... + def fetch_tag(self): ... + def fetch_literal(self): ... + def fetch_folded(self): ... + def fetch_block_scalar(self, style): ... + def fetch_single(self): ... + def fetch_double(self): ... + def fetch_flow_scalar(self, style): ... + def fetch_plain(self): ... + def check_directive(self): ... + def check_document_start(self): ... + def check_document_end(self): ... + def check_block_entry(self): ... + def check_key(self): ... + def check_value(self): ... + def check_plain(self): ... + def scan_to_next_token(self): ... + def scan_directive(self): ... + def scan_directive_name(self, start_mark): ... + def scan_yaml_directive_value(self, start_mark): ... + def scan_yaml_directive_number(self, start_mark): ... + def scan_tag_directive_value(self, start_mark): ... + def scan_tag_directive_handle(self, start_mark): ... + def scan_tag_directive_prefix(self, start_mark): ... + def scan_directive_ignored_line(self, start_mark): ... + def scan_anchor(self, TokenClass): ... + def scan_tag(self): ... + def scan_block_scalar(self, style): ... + def scan_block_scalar_indicators(self, start_mark): ... + def scan_block_scalar_ignored_line(self, start_mark): ... + def scan_block_scalar_indentation(self): ... + def scan_block_scalar_breaks(self, indent): ... + def scan_flow_scalar(self, style): ... + ESCAPE_REPLACEMENTS: Any + ESCAPE_CODES: Any + def scan_flow_scalar_non_spaces(self, double, start_mark): ... + def scan_flow_scalar_spaces(self, double, start_mark): ... + def scan_flow_scalar_breaks(self, double, start_mark): ... + def scan_plain(self): ... + def scan_plain_spaces(self, indent, start_mark): ... + def scan_tag_handle(self, name, start_mark): ... + def scan_tag_uri(self, name, start_mark): ... + def scan_uri_escapes(self, name, start_mark): ... + def scan_line_break(self): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/serializer.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/serializer.pyi new file mode 100644 index 00000000..0c169e86 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/serializer.pyi @@ -0,0 +1,23 @@ +from typing import Any +from yaml.error import YAMLError + +class SerializerError(YAMLError): ... + +class Serializer: + ANCHOR_TEMPLATE: Any + use_encoding: Any + use_explicit_start: Any + use_explicit_end: Any + use_version: Any + use_tags: Any + serialized_nodes: Any + anchors: Any + last_anchor_id: Any + closed: Any + def __init__(self, encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ... + def open(self): ... + def close(self): ... + def serialize(self, node): ... + def anchor_node(self, node): ... + def generate_anchor(self, node): ... + def serialize_node(self, node, parent, index): ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/tokens.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/tokens.pyi new file mode 100644 index 00000000..b258ec7b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/2and3/yaml/tokens.pyi @@ -0,0 +1,93 @@ +from typing import Any + +class Token: + start_mark: Any + end_mark: Any + def __init__(self, start_mark, end_mark) -> None: ... + +class DirectiveToken(Token): + id: Any + name: Any + value: Any + start_mark: Any + end_mark: Any + def __init__(self, name, value, start_mark, end_mark) -> None: ... + +class DocumentStartToken(Token): + id: Any + +class DocumentEndToken(Token): + id: Any + +class StreamStartToken(Token): + id: Any + start_mark: Any + end_mark: Any + encoding: Any + def __init__(self, start_mark=..., end_mark=..., encoding=...) -> None: ... + +class StreamEndToken(Token): + id: Any + +class BlockSequenceStartToken(Token): + id: Any + +class BlockMappingStartToken(Token): + id: Any + +class BlockEndToken(Token): + id: Any + +class FlowSequenceStartToken(Token): + id: Any + +class FlowMappingStartToken(Token): + id: Any + +class FlowSequenceEndToken(Token): + id: Any + +class FlowMappingEndToken(Token): + id: Any + +class KeyToken(Token): + id: Any + +class ValueToken(Token): + id: Any + +class BlockEntryToken(Token): + id: Any + +class FlowEntryToken(Token): + id: Any + +class AliasToken(Token): + id: Any + value: Any + start_mark: Any + end_mark: Any + def __init__(self, value, start_mark, end_mark) -> None: ... + +class AnchorToken(Token): + id: Any + value: Any + start_mark: Any + end_mark: Any + def __init__(self, value, start_mark, end_mark) -> None: ... + +class TagToken(Token): + id: Any + value: Any + start_mark: Any + end_mark: Any + def __init__(self, value, start_mark, end_mark) -> None: ... + +class ScalarToken(Token): + id: Any + value: Any + plain: Any + start_mark: Any + end_mark: Any + style: Any + def __init__(self, value, plain, start_mark, end_mark, style=...) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/contextvars.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/contextvars.pyi new file mode 100644 index 00000000..a90c2a8b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/contextvars.pyi @@ -0,0 +1,30 @@ +from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar + +_T = TypeVar('_T') + +class ContextVar(Generic[_T]): + def __init__(self, name: str, *, default: _T = ...) -> None: ... + @property + def name(self) -> str: ... + def get(self, default: _T = ...) -> _T: ... + def set(self, value: _T) -> Token[_T]: ... + def reset(self, token: Token[_T]) -> None: ... + +class Token(Generic[_T]): + @property + def var(self) -> ContextVar[_T]: ... + @property + def old_value(self) -> Any: ... # returns either _T or MISSING, but that's hard to express + MISSING: ClassVar[object] + +def copy_context() -> Context: ... + +# It doesn't make sense to make this generic, because for most Contexts each ContextVar will have +# a different value. +class Context(Mapping[ContextVar[Any], Any]): + def __init__(self) -> None: ... + def run(self, callable: Callable[..., _T], *args: Any, **kwargs: Any) -> _T: ... + def copy(self) -> Context: ... + def __getitem__(self, key: ContextVar[Any]) -> Any: ... + def __iter__(self) -> Iterator[ContextVar[Any]]: ... + def __len__(self) -> int: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/dataclasses.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/dataclasses.pyi new file mode 100644 index 00000000..e3bf1d13 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/dataclasses.pyi @@ -0,0 +1,71 @@ +from typing import overload, Any, Callable, Dict, Generic, Iterable, List, Mapping, Optional, Tuple, Type, TypeVar, Union + + +_T = TypeVar('_T') + +class _MISSING_TYPE: ... +MISSING: _MISSING_TYPE + +@overload +def asdict(obj: Any) -> Dict[str, Any]: ... +@overload +def asdict(obj: Any, *, dict_factory: Callable[[List[Tuple[str, Any]]], _T]) -> _T: ... + +@overload +def astuple(obj: Any) -> Tuple[Any, ...]: ... +@overload +def astuple(obj: Any, *, tuple_factory: Callable[[List[Any]], _T]) -> _T: ... + + +@overload +def dataclass(_cls: Type[_T]) -> Type[_T]: ... + +@overload +def dataclass(*, init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., + unsafe_hash: bool = ..., frozen: bool = ...) -> Callable[[Type[_T]], Type[_T]]: ... + + +class Field(Generic[_T]): + name: str + type: Type[_T] + default: _T + default_factory: Callable[[], _T] + repr: bool + hash: Optional[bool] + init: bool + compare: bool + metadata: Mapping[str, Any] + + +# NOTE: Actual return type is 'Field[_T]', but we want to help type checkers +# to understand the magic that happens at runtime. +@overload # `default` and `default_factory` are optional and mutually exclusive. +def field(*, default: _T, + init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ...) -> _T: ... + +@overload +def field(*, default_factory: Callable[[], _T], + init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ...) -> _T: ... + +@overload +def field(*, + init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ..., + metadata: Optional[Mapping[str, Any]] = ...) -> Any: ... + + +def fields(class_or_instance: Any) -> Tuple[Field[Any], ...]: ... + +def is_dataclass(obj: Any) -> bool: ... + +class FrozenInstanceError(AttributeError): ... + +class InitVar(Generic[_T]): ... + +def make_dataclass(cls_name: str, fields: Iterable[Union[str, Tuple[str, type], Tuple[str, type, Field[Any]]]], *, + bases: Tuple[type, ...] = ..., namespace: Optional[Dict[str, Any]] = ..., + init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., hash: bool = ..., + frozen: bool = ...): ... + +def replace(obj: _T, **changes: Any) -> _T: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/__init__.pyi new file mode 100644 index 00000000..024e962b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/__init__.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/examples.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/examples.pyi new file mode 100644 index 00000000..ec73a299 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/examples.pyi @@ -0,0 +1,5 @@ +from typing import Any + +html_parts: Any + +def __getattr__(name) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/nodes.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/nodes.pyi new file mode 100644 index 00000000..382112bf --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/nodes.pyi @@ -0,0 +1,10 @@ +from typing import Any, List + +class reference: + def __init__(self, + rawsource: str = ..., + text: str = ..., + *children: List[Any], + **attributes) -> None: ... + +def __getattr__(name) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/parsers/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/parsers/__init__.pyi new file mode 100644 index 00000000..024e962b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/parsers/__init__.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/__init__.pyi new file mode 100644 index 00000000..024e962b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/__init__.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/nodes.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/nodes.pyi new file mode 100644 index 00000000..024e962b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/nodes.pyi @@ -0,0 +1,3 @@ +from typing import Any + +def __getattr__(name) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/roles.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/roles.pyi new file mode 100644 index 00000000..622db836 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/roles.pyi @@ -0,0 +1,13 @@ +import docutils.nodes +import docutils.parsers.rst.states + +from typing import Callable, Any, List, Dict, Tuple + +_RoleFn = Callable[ + [str, str, str, int, docutils.parsers.rst.states.Inliner, Dict[str, Any], List[str]], + Tuple[List[docutils.nodes.reference], List[docutils.nodes.reference]], +] + +def register_local_role(name: str, role_fn: _RoleFn) -> None: ... + +def __getattr__(name: str) -> Any: ... # incomplete diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/states.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/states.pyi new file mode 100644 index 00000000..ac00fe1b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/docutils/parsers/rst/states.pyi @@ -0,0 +1,8 @@ +import typing +from typing import Any + +class Inliner: + def __init__(self) -> None: + ... + +def __getattr__(name) -> Any: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/jwt/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/jwt/__init__.pyi new file mode 100644 index 00000000..c868ea09 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/jwt/__init__.pyi @@ -0,0 +1,43 @@ +from typing import Mapping, Any, Optional, Union, Dict + +from . import algorithms +from cryptography.hazmat.primitives.asymmetric import rsa + + +def decode(jwt: Union[str, bytes], key: Union[str, bytes, rsa.RSAPublicKey, rsa.RSAPrivateKey] = ..., + verify: bool = ..., algorithms: Optional[Any] = ..., + options: Optional[Mapping[Any, Any]] = ..., + **kwargs: Any) -> Dict[str, Any]: ... + +def encode(payload: Mapping[str, Any], key: Union[str, bytes, rsa.RSAPublicKey, rsa.RSAPrivateKey], + algorithm: str = ..., headers: Optional[Mapping[str, Any]] = ..., + json_encoder: Optional[Any] = ...) -> bytes: ... + +def register_algorithm(alg_id: str, alg_obj: algorithms.Algorithm[Any]) -> None: ... +def unregister_algorithm(alg_id: str) -> None: ... + +class PyJWTError(Exception): ... +class InvalidTokenError(PyJWTError): ... +class DecodeError(InvalidTokenError): ... +class ExpiredSignatureError(InvalidTokenError): ... +class InvalidAudienceError(InvalidTokenError): ... +class InvalidIssuerError(InvalidTokenError): ... +class InvalidIssuedAtError(InvalidTokenError): ... +class ImmatureSignatureError(InvalidTokenError): ... +class InvalidKeyError(PyJWTError): ... +class InvalidAlgorithmError(InvalidTokenError): ... +class MissingRequiredClaimError(InvalidTokenError): ... +class InvalidSignatureError(DecodeError): ... + +# Compatibility aliases (deprecated) +ExpiredSignature = ExpiredSignatureError +InvalidAudience = InvalidAudienceError +InvalidIssuer = InvalidIssuerError + +# These aren't actually documented, but the package +# exports them in __init__.py, so we should at least +# make sure that mypy doesn't raise spurious errors +# if they're used. +get_unverified_header: Any +PyJWT: Any +PyJWS: Any diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/jwt/algorithms.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/jwt/algorithms.pyi new file mode 100644 index 00000000..a93f44f5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/jwt/algorithms.pyi @@ -0,0 +1,82 @@ +import sys +from hashlib import _Hash +from typing import Any, Set, Dict, Optional, ClassVar, Union, Generic, TypeVar + +requires_cryptography = Set[str] + +def get_default_algorithms() -> Dict[str, Algorithm[Any]]: ... + +_K = TypeVar("_K") + +class Algorithm(Generic[_K]): + def prepare_key(self, key: _K) -> _K: ... + def sign(self, msg: bytes, key: _K) -> bytes: ... + def verify(self, msg: bytes, key: _K, sig: bytes) -> bool: ... + @staticmethod + def to_jwk(key_obj: _K) -> str: ... + @staticmethod + def from_jwk(jwk: str) -> _K: ... + +class NoneAlgorithm(Algorithm[None]): + def prepare_key(self, key: Optional[str]) -> None: ... + +class _HashAlg: + def __call__(self, arg: Union[bytes, bytearray, memoryview] = ...) -> _Hash: ... + +if sys.version_info >= (3, 6): + _LoadsString = Union[str, bytes, bytearray] +else: + _LoadsString = str + +class HMACAlgorithm(Algorithm[bytes]): + SHA256: ClassVar[_HashAlg] + SHA384: ClassVar[_HashAlg] + SHA512: ClassVar[_HashAlg] + hash_alg: _HashAlg + def __init__(self, _HashAlg) -> None: ... + def prepare_key(self, key: Union[str, bytes]) -> bytes: ... + @staticmethod + def to_jwk(key_obj: Union[str, bytes]) -> str: ... + @staticmethod + def from_jwk(jwk: _LoadsString) -> bytes: ... + +# Only defined if cryptography is installed. Types should be tightened when +# cryptography gets type hints. +# See https://github.com/python/typeshed/issues/2542 +class RSAAlgorithm(Algorithm[Any]): + SHA256: ClassVar[Any] + SHA384: ClassVar[Any] + SHA512: ClassVar[Any] + hash_alg: Any + def __init__(self, hash_alg: Any) -> None: ... + def prepare_key(self, key: Any) -> Any: ... + @staticmethod + def to_jwk(key_obj: Any) -> str: ... + @staticmethod + def from_jwk(jwk: _LoadsString) -> Any: ... + def sign(self, msg: bytes, key: Any) -> bytes: ... + def verify(self, msg: bytes, key: Any, sig: bytes) -> bool: ... + +# Only defined if cryptography is installed. Types should be tightened when +# cryptography gets type hints. +# See https://github.com/python/typeshed/issues/2542 +class ECAlgorithm(Algorithm[Any]): + SHA256: ClassVar[Any] + SHA384: ClassVar[Any] + SHA512: ClassVar[Any] + hash_alg: Any + def __init__(self, hash_alg: Any) -> None: ... + def prepare_key(self, key: Any) -> Any: ... + @staticmethod + def to_jwk(key_obj: Any) -> str: ... + @staticmethod + def from_jwk(jwk: _LoadsString) -> Any: ... + def sign(self, msg: bytes, key: Any) -> bytes: ... + def verify(self, msg: bytes, key: Any, sig: bytes) -> bool: ... + +# Only defined if cryptography is installed. Types should be tightened when +# cryptography gets type hints. +# See https://github.com/python/typeshed/issues/2542 +class RSAPSSAlgorithm(RSAAlgorithm): + def sign(self, msg: bytes, key: Any) -> bytes: ... + def verify(self, msg: bytes, key: Any, sig: bytes) -> bool: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/jwt/contrib/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/jwt/contrib/__init__.pyi new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/__init__.pyi new file mode 100644 index 00000000..b2bb1f64 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/__init__.pyi @@ -0,0 +1 @@ +from hashlib import _Hash as _HashAlg diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/py_ecdsa.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/py_ecdsa.pyi new file mode 100644 index 00000000..93f0e1a2 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/py_ecdsa.pyi @@ -0,0 +1,10 @@ +from typing import Any +from jwt.algorithms import Algorithm + +from . import _HashAlg + +class ECAlgorithm(Algorithm[Any]): + SHA256: _HashAlg + SHA384: _HashAlg + SHA512: _HashAlg + def __init__(self, hash_alg: _HashAlg) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/pycrypto.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/pycrypto.pyi new file mode 100644 index 00000000..a86233fc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/jwt/contrib/algorithms/pycrypto.pyi @@ -0,0 +1,10 @@ +from typing import Any +from jwt.algorithms import Algorithm + +from . import _HashAlg + +class RSAAlgorithm(Algorithm[Any]): + SHA256: _HashAlg + SHA384: _HashAlg + SHA512: _HashAlg + def __init__(self, hash_alg: _HashAlg) -> None: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/orjson.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/orjson.pyi new file mode 100644 index 00000000..b7187721 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/orjson.pyi @@ -0,0 +1,20 @@ +# https://github.com/ijl/orjson/blob/master/orjson.pyi + +from typing import Any, Callable, Optional, Union + +__version__ = str + +def dumps( + __obj: Any, + default: Optional[Callable[[Any], Any]] = ..., + option: Optional[int] = ..., +) -> bytes: ... +def loads(__obj: Union[bytes, bytearray, str]) -> Any: ... + +class JSONDecodeError(ValueError): ... +class JSONEncodeError(TypeError): ... + +OPT_SERIALIZE_DATACLASS: int +OPT_NAIVE_UTC: int +OPT_OMIT_MICROSECONDS: int +OPT_STRICT_INTEGER: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/pkg_resources/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/pkg_resources/__init__.pyi new file mode 100644 index 00000000..0b6eb3af --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/pkg_resources/__init__.pyi @@ -0,0 +1,265 @@ +# Stubs for pkg_resources (Python 3.4) + +from typing import Any, Callable, Dict, IO, Iterable, Generator, Optional, Sequence, Tuple, List, Set, Union, TypeVar, overload +from abc import ABCMeta +import importlib.abc +import types +import zipimport + +_T = TypeVar("_T") +_NestedStr = Union[str, Iterable[Union[str, Iterable[Any]]]] +_InstallerType = Callable[[Requirement], Optional[Distribution]] +_EPDistType = Union[Distribution, Requirement, str] +_MetadataType = Optional[IResourceProvider] +_PkgReqType = Union[str, Requirement] +_DistFinderType = Callable[[str, _Importer, bool], Generator[Distribution, None, None]] +_NSHandlerType = Callable[[_Importer, str, str, types.ModuleType], str] + +def declare_namespace(name: str) -> None: ... +def fixup_namespace_packages(path_item: str) -> None: ... + +class WorkingSet: + entries: List[str] + def __init__(self, entries: Optional[Iterable[str]] = ...) -> None: ... + def require(self, *requirements: _NestedStr) -> Sequence[Distribution]: ... + def run_script(self, requires: str, script_name: str) -> None: ... + def iter_entry_points(self, group: str, name: Optional[str] = ...) -> Generator[EntryPoint, None, None]: ... + def add_entry(self, entry: str) -> None: ... + def __contains__(self, dist: Distribution) -> bool: ... + def __iter__(self) -> Generator[Distribution, None, None]: ... + def find(self, req: Requirement) -> Optional[Distribution]: ... + def resolve( + self, requirements: Sequence[Requirement], env: Optional[Environment] = ..., installer: Optional[_InstallerType] = ... + ) -> List[Distribution]: ... + def add(self, dist: Distribution, entry: Optional[str] = ..., insert: bool = ..., replace: bool = ...) -> None: ... + def subscribe(self, callback: Callable[[Distribution], None]) -> None: ... + def find_plugins( + self, plugin_env: Environment, full_env: Optional[Environment] = ..., fallback: bool = ... + ) -> Tuple[List[Distribution], Dict[Distribution, Exception]]: ... + +working_set: WorkingSet + +def require(*requirements: Union[str, Sequence[str]]) -> Sequence[Distribution]: ... +def run_script(requires: str, script_name: str) -> None: ... +def iter_entry_points(group: str, name: Optional[str] = ...) -> Generator[EntryPoint, None, None]: ... +def add_activation_listener(callback: Callable[[Distribution], None]) -> None: ... + +class Environment: + def __init__( + self, search_path: Optional[Sequence[str]] = ..., platform: Optional[str] = ..., python: Optional[str] = ... + ) -> None: ... + def __getitem__(self, project_name: str) -> List[Distribution]: ... + def __iter__(self) -> Generator[str, None, None]: ... + def add(self, dist: Distribution) -> None: ... + def remove(self, dist: Distribution) -> None: ... + def can_add(self, dist: Distribution) -> bool: ... + def __add__(self, other: Union[Distribution, Environment]) -> Environment: ... + def __iadd__(self, other: Union[Distribution, Environment]) -> Environment: ... + @overload + def best_match(self, req: Requirement, working_set: WorkingSet) -> Distribution: ... + @overload + def best_match(self, req: Requirement, working_set: WorkingSet, installer: Callable[[Requirement], _T] = ...) -> _T: ... + @overload + def obtain(self, requirement: Requirement) -> None: ... + @overload + def obtain(self, requirement: Requirement, installer: Callable[[Requirement], _T] = ...) -> _T: ... + def scan(self, search_path: Optional[Sequence[str]] = ...) -> None: ... + +def parse_requirements(strs: Union[str, Iterable[str]]) -> Generator[Requirement, None, None]: ... + +class Requirement: + unsafe_name: str + project_name: str + key: str + extras: Tuple[str, ...] + specs: List[Tuple[str, str]] + # TODO: change this to Optional[packaging.markers.Marker] once we can import + # packaging.markers + marker: Optional[Any] + @staticmethod + def parse(s: Union[str, Iterable[str]]) -> Requirement: ... + def __contains__(self, item: Union[Distribution, str, Tuple[str, ...]]) -> bool: ... + def __eq__(self, other_requirement: Any) -> bool: ... + +def load_entry_point(dist: _EPDistType, group: str, name: str) -> None: ... +def get_entry_info(dist: _EPDistType, group: str, name: str) -> Optional[EntryPoint]: ... +@overload +def get_entry_map(dist: _EPDistType) -> Dict[str, Dict[str, EntryPoint]]: ... +@overload +def get_entry_map(dist: _EPDistType, group: str) -> Dict[str, EntryPoint]: ... + +class EntryPoint: + name: str + module_name: str + attrs: Tuple[str, ...] + extras: Tuple[str, ...] + dist: Optional[Distribution] + def __init__( + self, + name: str, + module_name: str, + attrs: Tuple[str, ...] = ..., + extras: Tuple[str, ...] = ..., + dist: Optional[Distribution] = ..., + ) -> None: ... + @classmethod + def parse(cls, src: str, dist: Optional[Distribution] = ...) -> EntryPoint: ... + @classmethod + def parse_group( + cls, group: str, lines: Union[str, Sequence[str]], dist: Optional[Distribution] = ... + ) -> Dict[str, EntryPoint]: ... + @classmethod + def parse_map( + cls, data: Union[Dict[str, Union[str, Sequence[str]]], str, Sequence[str]], dist: Optional[Distribution] = ... + ) -> Dict[str, EntryPoint]: ... + def load(self, require: bool = ..., env: Optional[Environment] = ..., installer: Optional[_InstallerType] = ...) -> Any: ... + def require(self, env: Optional[Environment] = ..., installer: Optional[_InstallerType] = ...) -> None: ... + def resolve(self) -> Any: ... + +def find_distributions(path_item: str, only: bool = ...) -> Generator[Distribution, None, None]: ... +def get_distribution(dist: Union[Requirement, str, Distribution]) -> Distribution: ... + +class Distribution(IResourceProvider, IMetadataProvider): + PKG_INFO: str + location: str + project_name: str + key: str + extras: List[str] + version: str + parsed_version: Tuple[str, ...] + py_version: str + platform: Optional[str] + precedence: int + def __init__( + self, + location: Optional[str] = ..., + metadata: Optional[str] = ..., + project_name: Optional[str] = ..., + version: Optional[str] = ..., + py_version: str = ..., + platform: Optional[str] = ..., + precedence: int = ..., + ) -> None: ... + @classmethod + def from_location( + cls, location: str, basename: str, metadata: Optional[str] = ..., **kw: Union[str, None, int] + ) -> Distribution: ... + @classmethod + def from_filename(cls, filename: str, metadata: Optional[str] = ..., **kw: Union[str, None, int]) -> Distribution: ... + def activate(self, path: Optional[List[str]] = ...) -> None: ... + def as_requirement(self) -> Requirement: ... + def requires(self, extras: Tuple[str, ...] = ...) -> List[Requirement]: ... + def clone(self, **kw: Union[str, int, None]) -> Requirement: ... + def egg_name(self) -> str: ... + def __cmp__(self, other: Any) -> bool: ... + def get_entry_info(self, group: str, name: str) -> Optional[EntryPoint]: ... + @overload + def get_entry_map(self) -> Dict[str, Dict[str, EntryPoint]]: ... + @overload + def get_entry_map(self, group: str) -> Dict[str, EntryPoint]: ... + def load_entry_point(self, group: str, name: str) -> None: ... + +EGG_DIST: int +BINARY_DIST: int +SOURCE_DIST: int +CHECKOUT_DIST: int +DEVELOP_DIST: int + +def resource_exists(package_or_requirement: _PkgReqType, resource_name: str) -> bool: ... +def resource_stream(package_or_requirement: _PkgReqType, resource_name: str) -> IO[bytes]: ... +def resource_string(package_or_requirement: _PkgReqType, resource_name: str) -> bytes: ... +def resource_isdir(package_or_requirement: _PkgReqType, resource_name: str) -> bool: ... +def resource_listdir(package_or_requirement: _PkgReqType, resource_name: str) -> List[str]: ... +def resource_filename(package_or_requirement: _PkgReqType, resource_name: str) -> str: ... +def set_extraction_path(path: str) -> None: ... +def cleanup_resources(force: bool = ...) -> List[str]: ... + +class IResourceManager: + def resource_exists(self, package_or_requirement: _PkgReqType, resource_name: str) -> bool: ... + def resource_stream(self, package_or_requirement: _PkgReqType, resource_name: str) -> IO[bytes]: ... + def resource_string(self, package_or_requirement: _PkgReqType, resource_name: str) -> bytes: ... + def resource_isdir(self, package_or_requirement: _PkgReqType, resource_name: str) -> bool: ... + def resource_listdir(self, package_or_requirement: _PkgReqType, resource_name: str) -> List[str]: ... + def resource_filename(self, package_or_requirement: _PkgReqType, resource_name: str) -> str: ... + def set_extraction_path(self, path: str) -> None: ... + def cleanup_resources(self, force: bool = ...) -> List[str]: ... + def get_cache_path(self, archive_name: str, names: Tuple[str, ...] = ...) -> str: ... + def extraction_error(self) -> None: ... + def postprocess(self, tempname: str, filename: str) -> None: ... + +@overload +def get_provider(package_or_requirement: str) -> IResourceProvider: ... +@overload +def get_provider(package_or_requirement: Requirement) -> Distribution: ... + +class IMetadataProvider: + def has_metadata(self, name: str) -> bool: ... + def metadata_isdir(self, name: str) -> bool: ... + def metadata_listdir(self, name: str) -> List[str]: ... + def get_metadata(self, name: str) -> str: ... + def get_metadata_lines(self, name: str) -> Generator[str, None, None]: ... + def run_script(self, script_name: str, namespace: Dict[str, Any]) -> None: ... + +class ResolutionError(Exception): ... +class DistributionNotFound(ResolutionError): ... + +class VersionConflict(ResolutionError): + @property + def dist(self) -> Any: ... + @property + def req(self) -> Any: ... + def report(self) -> str: ... + def with_context(self, required_by: Dict[str, Any]) -> VersionConflict: ... + +class ContextualVersionConflict(VersionConflict): + @property + def required_by(self) -> Set[Any]: ... + +class UnknownExtra(ResolutionError): ... + +class ExtractionError(Exception): + manager: IResourceManager + cache_path: str + original_error: Exception + +class _Importer(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader, metaclass=ABCMeta): ... + +def register_finder(importer_type: type, distribution_finder: _DistFinderType) -> None: ... +def register_loader_type(loader_type: type, provider_factory: Callable[[types.ModuleType], IResourceProvider]) -> None: ... +def register_namespace_handler(importer_type: type, namespace_handler: _NSHandlerType) -> None: ... + +class IResourceProvider(IMetadataProvider): ... +class NullProvider: ... +class EggProvider(NullProvider): ... +class DefaultProvider(EggProvider): ... + +class PathMetadata(DefaultProvider, IResourceProvider): + def __init__(self, path: str, egg_info: str) -> None: ... + +class ZipProvider(EggProvider): ... + +class EggMetadata(ZipProvider, IResourceProvider): + def __init__(self, zipimporter: zipimport.zipimporter) -> None: ... + +class EmptyProvider(NullProvider): ... + +empty_provider: EmptyProvider + +class FileMetadata(EmptyProvider, IResourceProvider): + def __init__(self, path_to_pkg_info: str) -> None: ... + +def parse_version(v: str) -> Tuple[str, ...]: ... +def yield_lines(strs: _NestedStr) -> Generator[str, None, None]: ... +def split_sections(strs: _NestedStr) -> Generator[Tuple[Optional[str], str], None, None]: ... +def safe_name(name: str) -> str: ... +def safe_version(version: str) -> str: ... +def safe_extra(extra: str) -> str: ... +def to_filename(name_or_version: str) -> str: ... +def get_build_platform() -> str: ... +def get_platform() -> str: ... +def get_supported_platform() -> str: ... +def compatible_platforms(provided: Optional[str], required: Optional[str]) -> bool: ... +def get_default_cache() -> str: ... +def get_importer(path_item: str) -> _Importer: ... +def ensure_directory(path: str) -> None: ... +def normalize_path(filename: str) -> str: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/pkg_resources/py31compat.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/pkg_resources/py31compat.pyi new file mode 100644 index 00000000..aefe1130 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/pkg_resources/py31compat.pyi @@ -0,0 +1,7 @@ +from typing import Text +import os +import sys + +needs_makedirs: bool + +makedirs = os.makedirs diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/__init__.pyi new file mode 100644 index 00000000..b785eaca --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/__init__.pyi @@ -0,0 +1,108 @@ +# Stubs for six (Python 3.5) + +from __future__ import print_function + +from typing import ( + Any, + AnyStr, + Callable, + Dict, + ItemsView, + Iterable, + KeysView, + Mapping, + NoReturn, + Optional, + Pattern, + Text, + Tuple, + Type, + TypeVar, + Union, + ValuesView, + overload, +) +import types +import typing +import unittest + +# Exports +from io import StringIO as StringIO, BytesIO as BytesIO +from builtins import next as next +from functools import wraps as wraps +from . import moves + +_T = TypeVar('_T') +_K = TypeVar('_K') +_V = TypeVar('_V') + +# TODO make constant, then move this stub to 2and3 +# https://github.com/python/typeshed/issues/17 +PY2 = False +PY3 = True +PY34: bool + +string_types = str, +integer_types = int, +class_types = type, +text_type = str +binary_type = bytes + +MAXSIZE: int + +# def add_move +# def remove_move + +def callable(obj: object) -> bool: ... + +def get_unbound_function(unbound: types.FunctionType) -> types.FunctionType: ... +def create_bound_method(func: types.FunctionType, obj: object) -> types.MethodType: ... +def create_unbound_method(func: types.FunctionType, cls: type) -> types.FunctionType: ... + +Iterator = object + +def get_method_function(meth: types.MethodType) -> types.FunctionType: ... +def get_method_self(meth: types.MethodType) -> Optional[object]: ... +def get_function_closure(fun: types.FunctionType) -> Optional[Tuple[types._Cell, ...]]: ... +def get_function_code(fun: types.FunctionType) -> types.CodeType: ... +def get_function_defaults(fun: types.FunctionType) -> Optional[Tuple[Any, ...]]: ... +def get_function_globals(fun: types.FunctionType) -> Dict[str, Any]: ... + +def iterkeys(d: Mapping[_K, _V]) -> typing.Iterator[_K]: ... +def itervalues(d: Mapping[_K, _V]) -> typing.Iterator[_V]: ... +def iteritems(d: Mapping[_K, _V]) -> typing.Iterator[Tuple[_K, _V]]: ... +# def iterlists + +def viewkeys(d: Mapping[_K, _V]) -> KeysView[_K]: ... +def viewvalues(d: Mapping[_K, _V]) -> ValuesView[_V]: ... +def viewitems(d: Mapping[_K, _V]) -> ItemsView[_K, _V]: ... + +def b(s: str) -> binary_type: ... +def u(s: str) -> text_type: ... + +unichr = chr +def int2byte(i: int) -> bytes: ... +def byte2int(bs: binary_type) -> int: ... +def indexbytes(buf: binary_type, i: int) -> int: ... +def iterbytes(buf: binary_type) -> typing.Iterator[int]: ... + +def assertCountEqual(self: unittest.TestCase, first: Iterable[_T], second: Iterable[_T], msg: Optional[str] = ...) -> None: ... +@overload +def assertRaisesRegex(self: unittest.TestCase, msg: Optional[str] = ...) -> Any: ... +@overload +def assertRaisesRegex(self: unittest.TestCase, callable_obj: Callable[..., Any], *args: Any, **kwargs: Any) -> Any: ... +def assertRegex(self: unittest.TestCase, text: AnyStr, expected_regex: Union[AnyStr, Pattern[AnyStr]], msg: Optional[str] = ...) -> None: ... + +exec_ = exec + +def reraise(tp: Optional[Type[BaseException]], value: Optional[BaseException], tb: Optional[types.TracebackType] = ...) -> NoReturn: ... +def raise_from(value: Union[BaseException, Type[BaseException]], from_value: Optional[BaseException]) -> NoReturn: ... + +print_ = print + +def with_metaclass(meta: type, *bases: type) -> type: ... +def add_metaclass(metaclass: type) -> Callable[[_T], _T]: ... +def ensure_binary(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> bytes: ... +def ensure_str(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> str: ... +def ensure_text(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> Text: ... +def python_2_unicode_compatible(klass: _T) -> _T: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/BaseHTTPServer.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/BaseHTTPServer.pyi new file mode 100644 index 00000000..0e1ad713 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/BaseHTTPServer.pyi @@ -0,0 +1 @@ +from http.server import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/CGIHTTPServer.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/CGIHTTPServer.pyi new file mode 100644 index 00000000..0e1ad713 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/CGIHTTPServer.pyi @@ -0,0 +1 @@ +from http.server import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/SimpleHTTPServer.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/SimpleHTTPServer.pyi new file mode 100644 index 00000000..0e1ad713 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/SimpleHTTPServer.pyi @@ -0,0 +1 @@ +from http.server import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/__init__.pyi new file mode 100644 index 00000000..3d6efced --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/__init__.pyi @@ -0,0 +1,69 @@ +# Stubs for six.moves +# +# Note: Commented out items means they weren't implemented at the time. +# Uncomment them when the modules have been added to the typeshed. +import sys + +from io import StringIO as cStringIO +from builtins import filter as filter +from itertools import filterfalse as filterfalse +from builtins import input as input +from sys import intern as intern +from builtins import map as map +from os import getcwd as getcwd +from os import getcwdb as getcwdb +from builtins import range as range +from functools import reduce as reduce +from shlex import quote as shlex_quote +from io import StringIO as StringIO +from collections import UserDict as UserDict +from collections import UserList as UserList +from collections import UserString as UserString +from builtins import range as xrange +from builtins import zip as zip +from itertools import zip_longest as zip_longest +from . import builtins +from . import configparser +# import copyreg as copyreg +# import dbm.gnu as dbm_gnu +from . import _dummy_thread +from . import http_cookiejar +from . import http_cookies +from . import html_entities +from . import html_parser +from . import http_client +from . import email_mime_multipart +from . import email_mime_nonmultipart +from . import email_mime_text +from . import email_mime_base +from . import BaseHTTPServer +from . import CGIHTTPServer +from . import SimpleHTTPServer +from . import cPickle +from . import queue +from . import reprlib +from . import socketserver +from . import _thread +from . import tkinter +from . import tkinter_dialog +from . import tkinter_filedialog +# import tkinter.scrolledtext as tkinter_scrolledtext +# import tkinter.simpledialog as tkinter_simpledialog +# import tkinter.tix as tkinter_tix +from . import tkinter_ttk +from . import tkinter_constants +# import tkinter.dnd as tkinter_dnd +# import tkinter.colorchooser as tkinter_colorchooser +from . import tkinter_commondialog +from . import tkinter_tkfiledialog +# import tkinter.font as tkinter_font +# import tkinter.messagebox as tkinter_messagebox +# import tkinter.simpledialog as tkinter_tksimpledialog +from . import urllib_parse +from . import urllib_error +from . import urllib +from . import urllib_robotparser +# import xmlrpc.client as xmlrpc_client +# import xmlrpc.server as xmlrpc_server + +from importlib import reload as reload_module diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/_dummy_thread.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/_dummy_thread.pyi new file mode 100644 index 00000000..24879612 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/_dummy_thread.pyi @@ -0,0 +1 @@ +from _dummy_thread import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/_thread.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/_thread.pyi new file mode 100644 index 00000000..25952a61 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/_thread.pyi @@ -0,0 +1 @@ +from _thread import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/builtins.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/builtins.pyi new file mode 100644 index 00000000..9596ba03 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/builtins.pyi @@ -0,0 +1 @@ +from builtins import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/cPickle.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/cPickle.pyi new file mode 100644 index 00000000..2b944b59 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/cPickle.pyi @@ -0,0 +1 @@ +from pickle import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/configparser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/configparser.pyi new file mode 100644 index 00000000..044861ce --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/configparser.pyi @@ -0,0 +1 @@ +from configparser import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_base.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_base.pyi new file mode 100644 index 00000000..4df155c9 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_base.pyi @@ -0,0 +1 @@ +from email.mime.base import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_multipart.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_multipart.pyi new file mode 100644 index 00000000..4f312412 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_multipart.pyi @@ -0,0 +1 @@ +from email.mime.multipart import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_nonmultipart.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_nonmultipart.pyi new file mode 100644 index 00000000..c15c8c04 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_nonmultipart.pyi @@ -0,0 +1 @@ +from email.mime.nonmultipart import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_text.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_text.pyi new file mode 100644 index 00000000..51e14738 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/email_mime_text.pyi @@ -0,0 +1 @@ +from email.mime.text import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/html_entities.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/html_entities.pyi new file mode 100644 index 00000000..c1244ddb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/html_entities.pyi @@ -0,0 +1 @@ +from html.entities import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/html_parser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/html_parser.pyi new file mode 100644 index 00000000..6db6dd83 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/html_parser.pyi @@ -0,0 +1 @@ +from html.parser import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/http_client.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/http_client.pyi new file mode 100644 index 00000000..36d29b95 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/http_client.pyi @@ -0,0 +1 @@ +from http.client import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/http_cookiejar.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/http_cookiejar.pyi new file mode 100644 index 00000000..88a1aed6 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/http_cookiejar.pyi @@ -0,0 +1 @@ +from http.cookiejar import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/http_cookies.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/http_cookies.pyi new file mode 100644 index 00000000..9c59a539 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/http_cookies.pyi @@ -0,0 +1 @@ +from http.cookies import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/queue.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/queue.pyi new file mode 100644 index 00000000..fe7be53a --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/queue.pyi @@ -0,0 +1 @@ +from queue import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/reprlib.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/reprlib.pyi new file mode 100644 index 00000000..c329846f --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/reprlib.pyi @@ -0,0 +1 @@ +from reprlib import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/socketserver.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/socketserver.pyi new file mode 100644 index 00000000..6101c8bb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/socketserver.pyi @@ -0,0 +1 @@ +from socketserver import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter.pyi new file mode 100644 index 00000000..fc4d53a5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter.pyi @@ -0,0 +1 @@ +from tkinter import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_commondialog.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_commondialog.pyi new file mode 100644 index 00000000..34eb4196 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_commondialog.pyi @@ -0,0 +1 @@ +from tkinter.commondialog import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_constants.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_constants.pyi new file mode 100644 index 00000000..3c04f6d8 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_constants.pyi @@ -0,0 +1 @@ +from tkinter.constants import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_dialog.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_dialog.pyi new file mode 100644 index 00000000..0da73c27 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_dialog.pyi @@ -0,0 +1 @@ +from tkinter.dialog import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_filedialog.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_filedialog.pyi new file mode 100644 index 00000000..c4cc7c48 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_filedialog.pyi @@ -0,0 +1 @@ +from tkinter.filedialog import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_tkfiledialog.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_tkfiledialog.pyi new file mode 100644 index 00000000..c4cc7c48 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_tkfiledialog.pyi @@ -0,0 +1 @@ +from tkinter.filedialog import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_ttk.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_ttk.pyi new file mode 100644 index 00000000..14576f61 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/tkinter_ttk.pyi @@ -0,0 +1 @@ +from tkinter.ttk import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib/__init__.pyi new file mode 100644 index 00000000..d08209c5 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib/__init__.pyi @@ -0,0 +1,5 @@ +import six.moves.urllib.error as error +import six.moves.urllib.parse as parse +import six.moves.urllib.request as request +import six.moves.urllib.response as response +import six.moves.urllib.robotparser as robotparser diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib/error.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib/error.pyi new file mode 100644 index 00000000..83f0d22d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib/error.pyi @@ -0,0 +1,3 @@ +from urllib.error import URLError as URLError +from urllib.error import HTTPError as HTTPError +from urllib.error import ContentTooShortError as ContentTooShortError diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib/parse.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib/parse.pyi new file mode 100644 index 00000000..265660d3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib/parse.pyi @@ -0,0 +1,28 @@ +# Stubs for six.moves.urllib.parse +# +# Note: Commented out items means they weren't implemented at the time. +# Uncomment them when the modules have been added to the typeshed. +from urllib.parse import ParseResult as ParseResult +from urllib.parse import SplitResult as SplitResult +from urllib.parse import parse_qs as parse_qs +from urllib.parse import parse_qsl as parse_qsl +from urllib.parse import urldefrag as urldefrag +from urllib.parse import urljoin as urljoin +from urllib.parse import urlparse as urlparse +from urllib.parse import urlsplit as urlsplit +from urllib.parse import urlunparse as urlunparse +from urllib.parse import urlunsplit as urlunsplit +from urllib.parse import quote as quote +from urllib.parse import quote_plus as quote_plus +from urllib.parse import unquote as unquote +from urllib.parse import unquote_plus as unquote_plus +from urllib.parse import unquote_to_bytes as unquote_to_bytes +from urllib.parse import urlencode as urlencode +# from urllib.parse import splitquery as splitquery +# from urllib.parse import splittag as splittag +# from urllib.parse import splituser as splituser +from urllib.parse import uses_fragment as uses_fragment +from urllib.parse import uses_netloc as uses_netloc +from urllib.parse import uses_params as uses_params +from urllib.parse import uses_query as uses_query +from urllib.parse import uses_relative as uses_relative diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib/request.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib/request.pyi new file mode 100644 index 00000000..b01dea74 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib/request.pyi @@ -0,0 +1,39 @@ +# Stubs for six.moves.urllib.request +# +# Note: Commented out items means they weren't implemented at the time. +# Uncomment them when the modules have been added to the typeshed. +from urllib.request import urlopen as urlopen +from urllib.request import install_opener as install_opener +from urllib.request import build_opener as build_opener +from urllib.request import pathname2url as pathname2url +from urllib.request import url2pathname as url2pathname +from urllib.request import getproxies as getproxies +from urllib.request import Request as Request +from urllib.request import OpenerDirector as OpenerDirector +from urllib.request import HTTPDefaultErrorHandler as HTTPDefaultErrorHandler +from urllib.request import HTTPRedirectHandler as HTTPRedirectHandler +from urllib.request import HTTPCookieProcessor as HTTPCookieProcessor +from urllib.request import ProxyHandler as ProxyHandler +from urllib.request import BaseHandler as BaseHandler +from urllib.request import HTTPPasswordMgr as HTTPPasswordMgr +from urllib.request import HTTPPasswordMgrWithDefaultRealm as HTTPPasswordMgrWithDefaultRealm +from urllib.request import AbstractBasicAuthHandler as AbstractBasicAuthHandler +from urllib.request import HTTPBasicAuthHandler as HTTPBasicAuthHandler +from urllib.request import ProxyBasicAuthHandler as ProxyBasicAuthHandler +from urllib.request import AbstractDigestAuthHandler as AbstractDigestAuthHandler +from urllib.request import HTTPDigestAuthHandler as HTTPDigestAuthHandler +from urllib.request import ProxyDigestAuthHandler as ProxyDigestAuthHandler +from urllib.request import HTTPHandler as HTTPHandler +from urllib.request import HTTPSHandler as HTTPSHandler +from urllib.request import FileHandler as FileHandler +from urllib.request import FTPHandler as FTPHandler +from urllib.request import CacheFTPHandler as CacheFTPHandler +from urllib.request import UnknownHandler as UnknownHandler +from urllib.request import HTTPErrorProcessor as HTTPErrorProcessor +from urllib.request import urlretrieve as urlretrieve +from urllib.request import urlcleanup as urlcleanup +from urllib.request import URLopener as URLopener +from urllib.request import FancyURLopener as FancyURLopener +# from urllib.request import proxy_bypass as proxy_bypass +from urllib.request import parse_http_list as parse_http_list +from urllib.request import parse_keqv_list as parse_keqv_list diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib/response.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib/response.pyi new file mode 100644 index 00000000..9f681ea3 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib/response.pyi @@ -0,0 +1,8 @@ +# Stubs for six.moves.urllib.response +# +# Note: Commented out items means they weren't implemented at the time. +# Uncomment them when the modules have been added to the typeshed. +# from urllib.response import addbase as addbase +# from urllib.response import addclosehook as addclosehook +# from urllib.response import addinfo as addinfo +from urllib.response import addinfourl as addinfourl diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib/robotparser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib/robotparser.pyi new file mode 100644 index 00000000..bccda14b --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib/robotparser.pyi @@ -0,0 +1 @@ +from urllib.robotparser import RobotFileParser as RobotFileParser diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib_error.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib_error.pyi new file mode 100644 index 00000000..27200722 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib_error.pyi @@ -0,0 +1 @@ +from urllib.error import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib_parse.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib_parse.pyi new file mode 100644 index 00000000..b557bbbb --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib_parse.pyi @@ -0,0 +1 @@ +from urllib.parse import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib_request.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib_request.pyi new file mode 100644 index 00000000..dc03dcec --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib_request.pyi @@ -0,0 +1 @@ +from .urllib.request import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib_response.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib_response.pyi new file mode 100644 index 00000000..bbee5225 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib_response.pyi @@ -0,0 +1 @@ +from .urllib.response import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib_robotparser.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib_robotparser.pyi new file mode 100644 index 00000000..bbf5c3ce --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/six/moves/urllib_robotparser.pyi @@ -0,0 +1 @@ +from urllib.robotparser import * diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/typed_ast/__init__.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/typed_ast/__init__.pyi new file mode 100644 index 00000000..f260032d --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/typed_ast/__init__.pyi @@ -0,0 +1,2 @@ +# This module is a fork of the CPython 2 and 3 ast modules with PEP 484 support. +# See: https://github.com/python/typed_ast diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/typed_ast/ast27.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/typed_ast/ast27.pyi new file mode 100644 index 00000000..c5643422 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/typed_ast/ast27.pyi @@ -0,0 +1,361 @@ +import typing +from typing import Any, Optional, Union, Generic, Iterator + +class NodeVisitor(): + def visit(self, node: AST) -> Any: ... + def generic_visit(self, node: AST) -> None: ... + +class NodeTransformer(NodeVisitor): + def generic_visit(self, node: AST) -> None: ... + +def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: str = ...) -> AST: ... +def copy_location(new_node: AST, old_node: AST) -> AST: ... +def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... +def fix_missing_locations(node: AST) -> AST: ... +def get_docstring(node: AST, clean: bool = ...) -> Optional[bytes]: ... +def increment_lineno(node: AST, n: int = ...) -> AST: ... +def iter_child_nodes(node: AST) -> Iterator[AST]: ... +def iter_fields(node: AST) -> Iterator[typing.Tuple[str, Any]]: ... +def literal_eval(node_or_string: Union[str, AST]) -> Any: ... +def walk(node: AST) -> Iterator[AST]: ... + +PyCF_ONLY_AST: int + +# ast classes + +identifier = str + +class AST: + _attributes: typing.Tuple[str, ...] + _fields: typing.Tuple[str, ...] + def __init__(self, *args, **kwargs) -> None: ... + +class mod(AST): + ... + +class Module(mod): + body: typing.List[stmt] + type_ignores: typing.List[TypeIgnore] + +class Interactive(mod): + body: typing.List[stmt] + +class Expression(mod): + body: expr + +class FunctionType(mod): + argtypes: typing.List[expr] + returns: expr + +class Suite(mod): + body: typing.List[stmt] + + +class stmt(AST): + lineno: int + col_offset: int + +class FunctionDef(stmt): + name: identifier + args: arguments + body: typing.List[stmt] + decorator_list: typing.List[expr] + type_comment: Optional[str] + +class ClassDef(stmt): + name: identifier + bases: typing.List[expr] + body: typing.List[stmt] + decorator_list: typing.List[expr] + +class Return(stmt): + value: Optional[expr] + +class Delete(stmt): + targets: typing.List[expr] + +class Assign(stmt): + targets: typing.List[expr] + value: expr + type_comment: Optional[str] + +class AugAssign(stmt): + target: expr + op: operator + value: expr + +class Print(stmt): + dest: Optional[expr] + values: typing.List[expr] + nl: bool + +class For(stmt): + target: expr + iter: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + type_comment: Optional[str] + +class While(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class If(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class With(stmt): + context_expr: expr + optional_vars: Optional[expr] + body: typing.List[stmt] + type_comment: Optional[str] + +class Raise(stmt): + type: Optional[expr] + inst: Optional[expr] + tback: Optional[expr] + +class TryExcept(stmt): + body: typing.List[stmt] + handlers: typing.List[ExceptHandler] + orelse: typing.List[stmt] + +class TryFinally(stmt): + body: typing.List[stmt] + finalbody: typing.List[stmt] + +class Assert(stmt): + test: expr + msg: Optional[expr] + +class Import(stmt): + names: typing.List[alias] + +class ImportFrom(stmt): + module: Optional[identifier] + names: typing.List[alias] + level: Optional[int] + +class Exec(stmt): + body: expr + globals: Optional[expr] + locals: Optional[expr] + +class Global(stmt): + names: typing.List[identifier] + +class Expr(stmt): + value: expr + +class Pass(stmt): ... +class Break(stmt): ... +class Continue(stmt): ... + + +class slice(AST): + ... + +_slice = slice # this lets us type the variable named 'slice' below + +class Slice(slice): + lower: Optional[expr] + upper: Optional[expr] + step: Optional[expr] + +class ExtSlice(slice): + dims: typing.List[slice] + +class Index(slice): + value: expr + +class Ellipsis(slice): ... + + +class expr(AST): + lineno: int + col_offset: int + +class BoolOp(expr): + op: boolop + values: typing.List[expr] + +class BinOp(expr): + left: expr + op: operator + right: expr + +class UnaryOp(expr): + op: unaryop + operand: expr + +class Lambda(expr): + args: arguments + body: expr + +class IfExp(expr): + test: expr + body: expr + orelse: expr + +class Dict(expr): + keys: typing.List[expr] + values: typing.List[expr] + +class Set(expr): + elts: typing.List[expr] + +class ListComp(expr): + elt: expr + generators: typing.List[comprehension] + +class SetComp(expr): + elt: expr + generators: typing.List[comprehension] + +class DictComp(expr): + key: expr + value: expr + generators: typing.List[comprehension] + +class GeneratorExp(expr): + elt: expr + generators: typing.List[comprehension] + +class Yield(expr): + value: Optional[expr] + +class Compare(expr): + left: expr + ops: typing.List[cmpop] + comparators: typing.List[expr] + +class Call(expr): + func: expr + args: typing.List[expr] + keywords: typing.List[keyword] + starargs: Optional[expr] + kwargs: Optional[expr] + +class Repr(expr): + value: expr + +class Num(expr): + n: Union[int, float, complex] + +class Str(expr): + s: bytes + kind: str + +class Attribute(expr): + value: expr + attr: identifier + ctx: expr_context + +class Subscript(expr): + value: expr + slice: _slice + ctx: expr_context + +class Name(expr): + id: identifier + ctx: expr_context + +class List(expr): + elts: typing.List[expr] + ctx: expr_context + +class Tuple(expr): + elts: typing.List[expr] + ctx: expr_context + + +class expr_context(AST): + ... + +class AugLoad(expr_context): ... +class AugStore(expr_context): ... +class Del(expr_context): ... +class Load(expr_context): ... +class Param(expr_context): ... +class Store(expr_context): ... + + +class boolop(AST): + ... + +class And(boolop): ... +class Or(boolop): ... + +class operator(AST): + ... + +class Add(operator): ... +class BitAnd(operator): ... +class BitOr(operator): ... +class BitXor(operator): ... +class Div(operator): ... +class FloorDiv(operator): ... +class LShift(operator): ... +class Mod(operator): ... +class Mult(operator): ... +class Pow(operator): ... +class RShift(operator): ... +class Sub(operator): ... + +class unaryop(AST): + ... + +class Invert(unaryop): ... +class Not(unaryop): ... +class UAdd(unaryop): ... +class USub(unaryop): ... + +class cmpop(AST): + ... + +class Eq(cmpop): ... +class Gt(cmpop): ... +class GtE(cmpop): ... +class In(cmpop): ... +class Is(cmpop): ... +class IsNot(cmpop): ... +class Lt(cmpop): ... +class LtE(cmpop): ... +class NotEq(cmpop): ... +class NotIn(cmpop): ... + + +class comprehension(AST): + target: expr + iter: expr + ifs: typing.List[expr] + + +class ExceptHandler(AST): + type: Optional[expr] + name: Optional[expr] + body: typing.List[stmt] + lineno: int + col_offset: int + + +class arguments(AST): + args: typing.List[expr] + vararg: Optional[identifier] + kwarg: Optional[identifier] + defaults: typing.List[expr] + type_comments: typing.List[Optional[str]] + +class keyword(AST): + arg: identifier + value: expr + +class alias(AST): + name: identifier + asname: Optional[identifier] + + +class TypeIgnore(AST): + lineno: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/typed_ast/ast3.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/typed_ast/ast3.pyi new file mode 100644 index 00000000..1962b463 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/typed_ast/ast3.pyi @@ -0,0 +1,413 @@ +import typing +from typing import Any, Optional, Union, Generic, Iterator + +class NodeVisitor(): + def visit(self, node: AST) -> Any: ... + def generic_visit(self, node: AST) -> None: ... + +class NodeTransformer(NodeVisitor): + def generic_visit(self, node: AST) -> None: ... + +def parse(source: Union[str, bytes], + filename: Union[str, bytes] = ..., + mode: str = ..., + feature_version: int = ...) -> AST: ... +def copy_location(new_node: AST, old_node: AST) -> AST: ... +def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... +def fix_missing_locations(node: AST) -> AST: ... +def get_docstring(node: AST, clean: bool = ...) -> str: ... +def increment_lineno(node: AST, n: int = ...) -> AST: ... +def iter_child_nodes(node: AST) -> Iterator[AST]: ... +def iter_fields(node: AST) -> Iterator[typing.Tuple[str, Any]]: ... +def literal_eval(node_or_string: Union[str, AST]) -> Any: ... +def walk(node: AST) -> Iterator[AST]: ... + +PyCF_ONLY_AST: int + +# ast classes + +identifier = str + +class AST: + _attributes: typing.Tuple[str, ...] + _fields: typing.Tuple[str, ...] + def __init__(self, *args, **kwargs) -> None: ... + +class mod(AST): + ... + +class Module(mod): + body: typing.List[stmt] + type_ignores: typing.List[TypeIgnore] + +class Interactive(mod): + body: typing.List[stmt] + +class Expression(mod): + body: expr + +class FunctionType(mod): + argtypes: typing.List[expr] + returns: expr + +class Suite(mod): + body: typing.List[stmt] + + +class stmt(AST): + lineno: int + col_offset: int + +class FunctionDef(stmt): + name: identifier + args: arguments + body: typing.List[stmt] + decorator_list: typing.List[expr] + returns: Optional[expr] + type_comment: Optional[str] + +class AsyncFunctionDef(stmt): + name: identifier + args: arguments + body: typing.List[stmt] + decorator_list: typing.List[expr] + returns: Optional[expr] + type_comment: Optional[str] + +class ClassDef(stmt): + name: identifier + bases: typing.List[expr] + keywords: typing.List[keyword] + body: typing.List[stmt] + decorator_list: typing.List[expr] + +class Return(stmt): + value: Optional[expr] + +class Delete(stmt): + targets: typing.List[expr] + +class Assign(stmt): + targets: typing.List[expr] + value: expr + type_comment: Optional[str] + +class AugAssign(stmt): + target: expr + op: operator + value: expr + +class AnnAssign(stmt): + target: expr + annotation: expr + value: Optional[expr] + simple: int + +class For(stmt): + target: expr + iter: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + type_comment: Optional[str] + +class AsyncFor(stmt): + target: expr + iter: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + type_comment: Optional[str] + +class While(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class If(stmt): + test: expr + body: typing.List[stmt] + orelse: typing.List[stmt] + +class With(stmt): + items: typing.List[withitem] + body: typing.List[stmt] + type_comment: Optional[str] + +class AsyncWith(stmt): + items: typing.List[withitem] + body: typing.List[stmt] + type_comment: Optional[str] + +class Raise(stmt): + exc: Optional[expr] + cause: Optional[expr] + +class Try(stmt): + body: typing.List[stmt] + handlers: typing.List[ExceptHandler] + orelse: typing.List[stmt] + finalbody: typing.List[stmt] + +class Assert(stmt): + test: expr + msg: Optional[expr] + +class Import(stmt): + names: typing.List[alias] + +class ImportFrom(stmt): + module: Optional[identifier] + names: typing.List[alias] + level: Optional[int] + +class Global(stmt): + names: typing.List[identifier] + +class Nonlocal(stmt): + names: typing.List[identifier] + +class Expr(stmt): + value: expr + +class Pass(stmt): ... +class Break(stmt): ... +class Continue(stmt): ... + + +class slice(AST): + ... + +_slice = slice # this lets us type the variable named 'slice' below + +class Slice(slice): + lower: Optional[expr] + upper: Optional[expr] + step: Optional[expr] + +class ExtSlice(slice): + dims: typing.List[slice] + +class Index(slice): + value: expr + + +class expr(AST): + lineno: int + col_offset: int + +class BoolOp(expr): + op: boolop + values: typing.List[expr] + +class BinOp(expr): + left: expr + op: operator + right: expr + +class UnaryOp(expr): + op: unaryop + operand: expr + +class Lambda(expr): + args: arguments + body: expr + +class IfExp(expr): + test: expr + body: expr + orelse: expr + +class Dict(expr): + keys: typing.List[expr] + values: typing.List[expr] + +class Set(expr): + elts: typing.List[expr] + +class ListComp(expr): + elt: expr + generators: typing.List[comprehension] + +class SetComp(expr): + elt: expr + generators: typing.List[comprehension] + +class DictComp(expr): + key: expr + value: expr + generators: typing.List[comprehension] + +class GeneratorExp(expr): + elt: expr + generators: typing.List[comprehension] + +class Await(expr): + value: expr + +class Yield(expr): + value: Optional[expr] + +class YieldFrom(expr): + value: expr + +class Compare(expr): + left: expr + ops: typing.List[cmpop] + comparators: typing.List[expr] + +class Call(expr): + func: expr + args: typing.List[expr] + keywords: typing.List[keyword] + +class Num(expr): + n: Union[float, int, complex] + +class Str(expr): + s: str + kind: str + +class FormattedValue(expr): + value: expr + conversion: typing.Optional[int] + format_spec: typing.Optional[expr] + +class JoinedStr(expr): + values: typing.List[expr] + +class Bytes(expr): + s: bytes + +class NameConstant(expr): + value: Any + +class Ellipsis(expr): ... + +class Attribute(expr): + value: expr + attr: identifier + ctx: expr_context + +class Subscript(expr): + value: expr + slice: _slice + ctx: expr_context + +class Starred(expr): + value: expr + ctx: expr_context + +class Name(expr): + id: identifier + ctx: expr_context + +class List(expr): + elts: typing.List[expr] + ctx: expr_context + +class Tuple(expr): + elts: typing.List[expr] + ctx: expr_context + + +class expr_context(AST): + ... + +class AugLoad(expr_context): ... +class AugStore(expr_context): ... +class Del(expr_context): ... +class Load(expr_context): ... +class Param(expr_context): ... +class Store(expr_context): ... + + +class boolop(AST): + ... + +class And(boolop): ... +class Or(boolop): ... + +class operator(AST): + ... + +class Add(operator): ... +class BitAnd(operator): ... +class BitOr(operator): ... +class BitXor(operator): ... +class Div(operator): ... +class FloorDiv(operator): ... +class LShift(operator): ... +class Mod(operator): ... +class Mult(operator): ... +class MatMult(operator): ... +class Pow(operator): ... +class RShift(operator): ... +class Sub(operator): ... + +class unaryop(AST): + ... + +class Invert(unaryop): ... +class Not(unaryop): ... +class UAdd(unaryop): ... +class USub(unaryop): ... + +class cmpop(AST): + ... + +class Eq(cmpop): ... +class Gt(cmpop): ... +class GtE(cmpop): ... +class In(cmpop): ... +class Is(cmpop): ... +class IsNot(cmpop): ... +class Lt(cmpop): ... +class LtE(cmpop): ... +class NotEq(cmpop): ... +class NotIn(cmpop): ... + + +class comprehension(AST): + target: expr + iter: expr + ifs: typing.List[expr] + is_async: int + + +class ExceptHandler(AST): + type: Optional[expr] + name: Optional[identifier] + body: typing.List[stmt] + lineno: int + col_offset: int + + +class arguments(AST): + args: typing.List[arg] + vararg: Optional[arg] + kwonlyargs: typing.List[arg] + kw_defaults: typing.List[expr] + kwarg: Optional[arg] + defaults: typing.List[expr] + +class arg(AST): + arg: identifier + annotation: Optional[expr] + lineno: int + col_offset: int + type_comment: typing.Optional[str] + +class keyword(AST): + arg: Optional[identifier] + value: expr + +class alias(AST): + name: identifier + asname: Optional[identifier] + +class withitem(AST): + context_expr: expr + optional_vars: Optional[expr] + + +class TypeIgnore(AST): + lineno: int diff --git a/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/typed_ast/conversions.pyi b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/typed_ast/conversions.pyi new file mode 100644 index 00000000..d5f18299 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/third_party/typeshed/third_party/3/typed_ast/conversions.pyi @@ -0,0 +1,4 @@ +from . import ast27 +from . import ast3 + +def py2to3(ast: ast27.AST) -> ast3.AST: ... diff --git a/.venv/lib/python3.8/site-packages/jedi/utils.py b/.venv/lib/python3.8/site-packages/jedi/utils.py new file mode 100644 index 00000000..9d675174 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jedi/utils.py @@ -0,0 +1,135 @@ +""" +Utilities for end-users. +""" + +from __future__ import absolute_import +import __main__ +from collections import namedtuple +import logging +import traceback +import re +import os +import sys + +from jedi import Interpreter + + +READLINE_DEBUG = False + + +def setup_readline(namespace_module=__main__, fuzzy=False): + """ + This function sets up :mod:`readline` to use Jedi in a Python interactive + shell. + + If you want to use a custom ``PYTHONSTARTUP`` file (typically + ``$HOME/.pythonrc.py``), you can add this piece of code:: + + try: + from jedi.utils import setup_readline + except ImportError: + # Fallback to the stdlib readline completer if it is installed. + # Taken from http://docs.python.org/2/library/rlcompleter.html + print("Jedi is not installed, falling back to readline") + try: + import readline + import rlcompleter + readline.parse_and_bind("tab: complete") + except ImportError: + print("Readline is not installed either. No tab completion is enabled.") + else: + setup_readline() + + This will fallback to the readline completer if Jedi is not installed. + The readline completer will only complete names in the global namespace, + so for example:: + + ran + + will complete to ``range``. + + With Jedi the following code:: + + range(10).cou + + will complete to ``range(10).count``, this does not work with the default + cPython :mod:`readline` completer. + + You will also need to add ``export PYTHONSTARTUP=$HOME/.pythonrc.py`` to + your shell profile (usually ``.bash_profile`` or ``.profile`` if you use + bash). + """ + if READLINE_DEBUG: + logging.basicConfig( + filename='/tmp/jedi.log', + filemode='a', + level=logging.DEBUG + ) + + class JediRL(object): + def complete(self, text, state): + """ + This complete stuff is pretty weird, a generator would make + a lot more sense, but probably due to backwards compatibility + this is still the way how it works. + + The only important part is stuff in the ``state == 0`` flow, + everything else has been copied from the ``rlcompleter`` std. + library module. + """ + if state == 0: + sys.path.insert(0, os.getcwd()) + # Calling python doesn't have a path, so add to sys.path. + try: + logging.debug("Start REPL completion: " + repr(text)) + interpreter = Interpreter(text, [namespace_module.__dict__]) + + completions = interpreter.complete(fuzzy=fuzzy) + logging.debug("REPL completions: %s", completions) + + self.matches = [ + text[:len(text) - c._like_name_length] + c.name_with_symbols + for c in completions + ] + except: + logging.error("REPL Completion error:\n" + traceback.format_exc()) + raise + finally: + sys.path.pop(0) + try: + return self.matches[state] + except IndexError: + return None + + try: + # Need to import this one as well to make sure it's executed before + # this code. This didn't use to be an issue until 3.3. Starting with + # 3.4 this is different, it always overwrites the completer if it's not + # already imported here. + import rlcompleter # noqa: F401 + import readline + except ImportError: + print("Jedi: Module readline not available.") + else: + readline.set_completer(JediRL().complete) + readline.parse_and_bind("tab: complete") + # jedi itself does the case matching + readline.parse_and_bind("set completion-ignore-case on") + # because it's easier to hit the tab just once + readline.parse_and_bind("set show-all-if-unmodified") + readline.parse_and_bind("set show-all-if-ambiguous on") + # don't repeat all the things written in the readline all the time + readline.parse_and_bind("set completion-prefix-display-length 2") + # No delimiters, Jedi handles that. + readline.set_completer_delims('') + + +def version_info(): + """ + Returns a namedtuple of Jedi's version, similar to Python's + ``sys.version_info``. + """ + Version = namedtuple('Version', 'major, minor, micro') + from jedi import __version__ + tupl = re.findall(r'[a-z]+|\d+', __version__) + return Version(*[x if i == 3 else int(x) for i, x in enumerate(tupl)]) diff --git a/.venv/lib/python3.8/site-packages/jinja2/__init__.py b/.venv/lib/python3.8/site-packages/jinja2/__init__.py new file mode 100644 index 00000000..1229ba42 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jinja2/__init__.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +"""Jinja is a template engine written in pure Python. It provides a +non-XML syntax that supports inline expressions and an optional +sandboxed environment. +""" +from markupsafe import escape +from markupsafe import Markup + +from .bccache import BytecodeCache +from .bccache import FileSystemBytecodeCache +from .bccache import MemcachedBytecodeCache +from .environment import Environment +from .environment import Template +from .exceptions import TemplateAssertionError +from .exceptions import TemplateError +from .exceptions import TemplateNotFound +from .exceptions import TemplateRuntimeError +from .exceptions import TemplatesNotFound +from .exceptions import TemplateSyntaxError +from .exceptions import UndefinedError +from .filters import contextfilter +from .filters import environmentfilter +from .filters import evalcontextfilter +from .loaders import BaseLoader +from .loaders import ChoiceLoader +from .loaders import DictLoader +from .loaders import FileSystemLoader +from .loaders import FunctionLoader +from .loaders import ModuleLoader +from .loaders import PackageLoader +from .loaders import PrefixLoader +from .runtime import ChainableUndefined +from .runtime import DebugUndefined +from .runtime import make_logging_undefined +from .runtime import StrictUndefined +from .runtime import Undefined +from .utils import clear_caches +from .utils import contextfunction +from .utils import environmentfunction +from .utils import evalcontextfunction +from .utils import is_undefined +from .utils import select_autoescape + +__version__ = "2.11.2" diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/__init__.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..f156a04a Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/__init__.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/_compat.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/_compat.cpython-38.pyc new file mode 100644 index 00000000..a4f83f6b Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/_compat.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/_identifier.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/_identifier.cpython-38.pyc new file mode 100644 index 00000000..ba59bd83 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/_identifier.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/asyncfilters.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/asyncfilters.cpython-38.pyc new file mode 100644 index 00000000..97efc86b Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/asyncfilters.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/asyncsupport.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/asyncsupport.cpython-38.pyc new file mode 100644 index 00000000..744612f0 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/asyncsupport.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/bccache.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/bccache.cpython-38.pyc new file mode 100644 index 00000000..cd470490 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/bccache.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/compiler.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/compiler.cpython-38.pyc new file mode 100644 index 00000000..81c4b173 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/compiler.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/constants.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/constants.cpython-38.pyc new file mode 100644 index 00000000..6e5d8041 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/constants.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/debug.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/debug.cpython-38.pyc new file mode 100644 index 00000000..73f0702c Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/debug.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/defaults.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/defaults.cpython-38.pyc new file mode 100644 index 00000000..9a1362a4 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/defaults.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/environment.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/environment.cpython-38.pyc new file mode 100644 index 00000000..520b6d50 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/environment.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/exceptions.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/exceptions.cpython-38.pyc new file mode 100644 index 00000000..bbe94ac8 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/exceptions.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/ext.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/ext.cpython-38.pyc new file mode 100644 index 00000000..24f4c373 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/ext.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/filters.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/filters.cpython-38.pyc new file mode 100644 index 00000000..15439e07 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/filters.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/idtracking.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/idtracking.cpython-38.pyc new file mode 100644 index 00000000..03b83b2f Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/idtracking.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/lexer.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/lexer.cpython-38.pyc new file mode 100644 index 00000000..d106357d Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/lexer.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/loaders.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/loaders.cpython-38.pyc new file mode 100644 index 00000000..2790061d Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/loaders.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/meta.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/meta.cpython-38.pyc new file mode 100644 index 00000000..9d8bf157 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/meta.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/nativetypes.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/nativetypes.cpython-38.pyc new file mode 100644 index 00000000..4ba3b5d6 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/nativetypes.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/nodes.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/nodes.cpython-38.pyc new file mode 100644 index 00000000..c16d9bb7 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/nodes.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/optimizer.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/optimizer.cpython-38.pyc new file mode 100644 index 00000000..292da507 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/optimizer.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/parser.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/parser.cpython-38.pyc new file mode 100644 index 00000000..31a32e3a Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/parser.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/runtime.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/runtime.cpython-38.pyc new file mode 100644 index 00000000..2798c25f Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/runtime.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/sandbox.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/sandbox.cpython-38.pyc new file mode 100644 index 00000000..2e698aae Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/sandbox.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/tests.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/tests.cpython-38.pyc new file mode 100644 index 00000000..b1d5a333 Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/tests.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/utils.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/utils.cpython-38.pyc new file mode 100644 index 00000000..b1e5822d Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/utils.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/__pycache__/visitor.cpython-38.pyc b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/visitor.cpython-38.pyc new file mode 100644 index 00000000..7320ebff Binary files /dev/null and b/.venv/lib/python3.8/site-packages/jinja2/__pycache__/visitor.cpython-38.pyc differ diff --git a/.venv/lib/python3.8/site-packages/jinja2/_compat.py b/.venv/lib/python3.8/site-packages/jinja2/_compat.py new file mode 100644 index 00000000..1f044954 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jinja2/_compat.py @@ -0,0 +1,132 @@ +# -*- coding: utf-8 -*- +# flake8: noqa +import marshal +import sys + +PY2 = sys.version_info[0] == 2 +PYPY = hasattr(sys, "pypy_translation_info") +_identity = lambda x: x + +if not PY2: + unichr = chr + range_type = range + text_type = str + string_types = (str,) + integer_types = (int,) + + iterkeys = lambda d: iter(d.keys()) + itervalues = lambda d: iter(d.values()) + iteritems = lambda d: iter(d.items()) + + import pickle + from io import BytesIO, StringIO + + NativeStringIO = StringIO + + def reraise(tp, value, tb=None): + if value.__traceback__ is not tb: + raise value.with_traceback(tb) + raise value + + ifilter = filter + imap = map + izip = zip + intern = sys.intern + + implements_iterator = _identity + implements_to_string = _identity + encode_filename = _identity + + marshal_dump = marshal.dump + marshal_load = marshal.load + +else: + unichr = unichr + text_type = unicode + range_type = xrange + string_types = (str, unicode) + integer_types = (int, long) + + iterkeys = lambda d: d.iterkeys() + itervalues = lambda d: d.itervalues() + iteritems = lambda d: d.iteritems() + + import cPickle as pickle + from cStringIO import StringIO as BytesIO, StringIO + + NativeStringIO = BytesIO + + exec("def reraise(tp, value, tb=None):\n raise tp, value, tb") + + from itertools import imap, izip, ifilter + + intern = intern + + def implements_iterator(cls): + cls.next = cls.__next__ + del cls.__next__ + return cls + + def implements_to_string(cls): + cls.__unicode__ = cls.__str__ + cls.__str__ = lambda x: x.__unicode__().encode("utf-8") + return cls + + def encode_filename(filename): + if isinstance(filename, unicode): + return filename.encode("utf-8") + return filename + + def marshal_dump(code, f): + if isinstance(f, file): + marshal.dump(code, f) + else: + f.write(marshal.dumps(code)) + + def marshal_load(f): + if isinstance(f, file): + return marshal.load(f) + return marshal.loads(f.read()) + + +def with_metaclass(meta, *bases): + """Create a base class with a metaclass.""" + # This requires a bit of explanation: the basic idea is to make a + # dummy metaclass for one level of class instantiation that replaces + # itself with the actual metaclass. + class metaclass(type): + def __new__(cls, name, this_bases, d): + return meta(name, bases, d) + + return type.__new__(metaclass, "temporary_class", (), {}) + + +try: + from urllib.parse import quote_from_bytes as url_quote +except ImportError: + from urllib import quote as url_quote + + +try: + from collections import abc +except ImportError: + import collections as abc + + +try: + from os import fspath +except ImportError: + try: + from pathlib import PurePath + except ImportError: + PurePath = None + + def fspath(path): + if hasattr(path, "__fspath__"): + return path.__fspath__() + + # Python 3.5 doesn't have __fspath__ yet, use str. + if PurePath is not None and isinstance(path, PurePath): + return str(path) + + return path diff --git a/.venv/lib/python3.8/site-packages/jinja2/_identifier.py b/.venv/lib/python3.8/site-packages/jinja2/_identifier.py new file mode 100644 index 00000000..224d5449 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jinja2/_identifier.py @@ -0,0 +1,6 @@ +import re + +# generated by scripts/generate_identifier_pattern.py +pattern = re.compile( + r"[\w·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣔ-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఀ-ఃా-ౄె-ైొ-్ౕౖౢౣಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝᠋-᠍ᢅᢆᢩᤠ-ᤫᤰ-᤻ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼᪰-᪽ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-ᮭ᯦-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰℘℮⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣠-꣱ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꧥꨩ-ꨶꩃꩌꩍꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭ﬞ︀-️︠-︯︳︴﹍-﹏_𐇽𐋠𐍶-𐍺𐨁-𐨃𐨅𐨆𐨌-𐨏𐨸-𐨿𐨺𐫦𐫥𑀀-𑀂𑀸-𑁆𑁿-𑂂𑂰-𑂺𑄀-𑄂𑄧-𑅳𑄴𑆀-𑆂𑆳-𑇊𑇀-𑇌𑈬-𑈷𑈾𑋟-𑋪𑌀-𑌃𑌼𑌾-𑍄𑍇𑍈𑍋-𑍍𑍗𑍢𑍣𑍦-𑍬𑍰-𑍴𑐵-𑑆𑒰-𑓃𑖯-𑖵𑖸-𑗀𑗜𑗝𑘰-𑙀𑚫-𑚷𑜝-𑜫𑰯-𑰶𑰸-𑰿𑲒-𑲧𑲩-𑲶𖫰-𖫴𖬰-𖬶𖽑-𖽾𖾏-𖾒𛲝𛲞𝅥-𝅩𝅭-𝅲𝅻-𝆂𝆅-𝆋𝆪-𝆭𝉂-𝉄𝨀-𝨶𝨻-𝩬𝩵𝪄𝪛-𝪟𝪡-𝪯𞀀-𞀆𞀈-𞀘𞀛-𞀡𞀣𞀤𞀦-𞣐𞀪-𞣖𞥄-𞥊󠄀-󠇯]+" # noqa: B950 +) diff --git a/.venv/lib/python3.8/site-packages/jinja2/asyncfilters.py b/.venv/lib/python3.8/site-packages/jinja2/asyncfilters.py new file mode 100644 index 00000000..3d98dbcc --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jinja2/asyncfilters.py @@ -0,0 +1,158 @@ +from functools import wraps + +from . import filters +from .asyncsupport import auto_aiter +from .asyncsupport import auto_await + + +async def auto_to_seq(value): + seq = [] + if hasattr(value, "__aiter__"): + async for item in value: + seq.append(item) + else: + for item in value: + seq.append(item) + return seq + + +async def async_select_or_reject(args, kwargs, modfunc, lookup_attr): + seq, func = filters.prepare_select_or_reject(args, kwargs, modfunc, lookup_attr) + if seq: + async for item in auto_aiter(seq): + if func(item): + yield item + + +def dualfilter(normal_filter, async_filter): + wrap_evalctx = False + if getattr(normal_filter, "environmentfilter", False) is True: + + def is_async(args): + return args[0].is_async + + wrap_evalctx = False + else: + has_evalctxfilter = getattr(normal_filter, "evalcontextfilter", False) is True + has_ctxfilter = getattr(normal_filter, "contextfilter", False) is True + wrap_evalctx = not has_evalctxfilter and not has_ctxfilter + + def is_async(args): + return args[0].environment.is_async + + @wraps(normal_filter) + def wrapper(*args, **kwargs): + b = is_async(args) + if wrap_evalctx: + args = args[1:] + if b: + return async_filter(*args, **kwargs) + return normal_filter(*args, **kwargs) + + if wrap_evalctx: + wrapper.evalcontextfilter = True + + wrapper.asyncfiltervariant = True + + return wrapper + + +def asyncfiltervariant(original): + def decorator(f): + return dualfilter(original, f) + + return decorator + + +@asyncfiltervariant(filters.do_first) +async def do_first(environment, seq): + try: + return await auto_aiter(seq).__anext__() + except StopAsyncIteration: + return environment.undefined("No first item, sequence was empty.") + + +@asyncfiltervariant(filters.do_groupby) +async def do_groupby(environment, value, attribute): + expr = filters.make_attrgetter(environment, attribute) + return [ + filters._GroupTuple(key, await auto_to_seq(values)) + for key, values in filters.groupby( + sorted(await auto_to_seq(value), key=expr), expr + ) + ] + + +@asyncfiltervariant(filters.do_join) +async def do_join(eval_ctx, value, d=u"", attribute=None): + return filters.do_join(eval_ctx, await auto_to_seq(value), d, attribute) + + +@asyncfiltervariant(filters.do_list) +async def do_list(value): + return await auto_to_seq(value) + + +@asyncfiltervariant(filters.do_reject) +async def do_reject(*args, **kwargs): + return async_select_or_reject(args, kwargs, lambda x: not x, False) + + +@asyncfiltervariant(filters.do_rejectattr) +async def do_rejectattr(*args, **kwargs): + return async_select_or_reject(args, kwargs, lambda x: not x, True) + + +@asyncfiltervariant(filters.do_select) +async def do_select(*args, **kwargs): + return async_select_or_reject(args, kwargs, lambda x: x, False) + + +@asyncfiltervariant(filters.do_selectattr) +async def do_selectattr(*args, **kwargs): + return async_select_or_reject(args, kwargs, lambda x: x, True) + + +@asyncfiltervariant(filters.do_map) +async def do_map(*args, **kwargs): + seq, func = filters.prepare_map(args, kwargs) + if seq: + async for item in auto_aiter(seq): + yield await auto_await(func(item)) + + +@asyncfiltervariant(filters.do_sum) +async def do_sum(environment, iterable, attribute=None, start=0): + rv = start + if attribute is not None: + func = filters.make_attrgetter(environment, attribute) + else: + + def func(x): + return x + + async for item in auto_aiter(iterable): + rv += func(item) + return rv + + +@asyncfiltervariant(filters.do_slice) +async def do_slice(value, slices, fill_with=None): + return filters.do_slice(await auto_to_seq(value), slices, fill_with) + + +ASYNC_FILTERS = { + "first": do_first, + "groupby": do_groupby, + "join": do_join, + "list": do_list, + # we intentionally do not support do_last because that would be + # ridiculous + "reject": do_reject, + "rejectattr": do_rejectattr, + "map": do_map, + "select": do_select, + "selectattr": do_selectattr, + "sum": do_sum, + "slice": do_slice, +} diff --git a/.venv/lib/python3.8/site-packages/jinja2/asyncsupport.py b/.venv/lib/python3.8/site-packages/jinja2/asyncsupport.py new file mode 100644 index 00000000..78ba3739 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jinja2/asyncsupport.py @@ -0,0 +1,264 @@ +# -*- coding: utf-8 -*- +"""The code for async support. Importing this patches Jinja on supported +Python versions. +""" +import asyncio +import inspect +from functools import update_wrapper + +from markupsafe import Markup + +from .environment import TemplateModule +from .runtime import LoopContext +from .utils import concat +from .utils import internalcode +from .utils import missing + + +async def concat_async(async_gen): + rv = [] + + async def collect(): + async for event in async_gen: + rv.append(event) + + await collect() + return concat(rv) + + +async def generate_async(self, *args, **kwargs): + vars = dict(*args, **kwargs) + try: + async for event in self.root_render_func(self.new_context(vars)): + yield event + except Exception: + yield self.environment.handle_exception() + + +def wrap_generate_func(original_generate): + def _convert_generator(self, loop, args, kwargs): + async_gen = self.generate_async(*args, **kwargs) + try: + while 1: + yield loop.run_until_complete(async_gen.__anext__()) + except StopAsyncIteration: + pass + + def generate(self, *args, **kwargs): + if not self.environment.is_async: + return original_generate(self, *args, **kwargs) + return _convert_generator(self, asyncio.get_event_loop(), args, kwargs) + + return update_wrapper(generate, original_generate) + + +async def render_async(self, *args, **kwargs): + if not self.environment.is_async: + raise RuntimeError("The environment was not created with async mode enabled.") + + vars = dict(*args, **kwargs) + ctx = self.new_context(vars) + + try: + return await concat_async(self.root_render_func(ctx)) + except Exception: + return self.environment.handle_exception() + + +def wrap_render_func(original_render): + def render(self, *args, **kwargs): + if not self.environment.is_async: + return original_render(self, *args, **kwargs) + loop = asyncio.get_event_loop() + return loop.run_until_complete(self.render_async(*args, **kwargs)) + + return update_wrapper(render, original_render) + + +def wrap_block_reference_call(original_call): + @internalcode + async def async_call(self): + rv = await concat_async(self._stack[self._depth](self._context)) + if self._context.eval_ctx.autoescape: + rv = Markup(rv) + return rv + + @internalcode + def __call__(self): + if not self._context.environment.is_async: + return original_call(self) + return async_call(self) + + return update_wrapper(__call__, original_call) + + +def wrap_macro_invoke(original_invoke): + @internalcode + async def async_invoke(self, arguments, autoescape): + rv = await self._func(*arguments) + if autoescape: + rv = Markup(rv) + return rv + + @internalcode + def _invoke(self, arguments, autoescape): + if not self._environment.is_async: + return original_invoke(self, arguments, autoescape) + return async_invoke(self, arguments, autoescape) + + return update_wrapper(_invoke, original_invoke) + + +@internalcode +async def get_default_module_async(self): + if self._module is not None: + return self._module + self._module = rv = await self.make_module_async() + return rv + + +def wrap_default_module(original_default_module): + @internalcode + def _get_default_module(self): + if self.environment.is_async: + raise RuntimeError("Template module attribute is unavailable in async mode") + return original_default_module(self) + + return _get_default_module + + +async def make_module_async(self, vars=None, shared=False, locals=None): + context = self.new_context(vars, shared, locals) + body_stream = [] + async for item in self.root_render_func(context): + body_stream.append(item) + return TemplateModule(self, context, body_stream) + + +def patch_template(): + from . import Template + + Template.generate = wrap_generate_func(Template.generate) + Template.generate_async = update_wrapper(generate_async, Template.generate_async) + Template.render_async = update_wrapper(render_async, Template.render_async) + Template.render = wrap_render_func(Template.render) + Template._get_default_module = wrap_default_module(Template._get_default_module) + Template._get_default_module_async = get_default_module_async + Template.make_module_async = update_wrapper( + make_module_async, Template.make_module_async + ) + + +def patch_runtime(): + from .runtime import BlockReference, Macro + + BlockReference.__call__ = wrap_block_reference_call(BlockReference.__call__) + Macro._invoke = wrap_macro_invoke(Macro._invoke) + + +def patch_filters(): + from .filters import FILTERS + from .asyncfilters import ASYNC_FILTERS + + FILTERS.update(ASYNC_FILTERS) + + +def patch_all(): + patch_template() + patch_runtime() + patch_filters() + + +async def auto_await(value): + if inspect.isawaitable(value): + return await value + return value + + +async def auto_aiter(iterable): + if hasattr(iterable, "__aiter__"): + async for item in iterable: + yield item + return + for item in iterable: + yield item + + +class AsyncLoopContext(LoopContext): + _to_iterator = staticmethod(auto_aiter) + + @property + async def length(self): + if self._length is not None: + return self._length + + try: + self._length = len(self._iterable) + except TypeError: + iterable = [x async for x in self._iterator] + self._iterator = self._to_iterator(iterable) + self._length = len(iterable) + self.index + (self._after is not missing) + + return self._length + + @property + async def revindex0(self): + return await self.length - self.index + + @property + async def revindex(self): + return await self.length - self.index0 + + async def _peek_next(self): + if self._after is not missing: + return self._after + + try: + self._after = await self._iterator.__anext__() + except StopAsyncIteration: + self._after = missing + + return self._after + + @property + async def last(self): + return await self._peek_next() is missing + + @property + async def nextitem(self): + rv = await self._peek_next() + + if rv is missing: + return self._undefined("there is no next item") + + return rv + + def __aiter__(self): + return self + + async def __anext__(self): + if self._after is not missing: + rv = self._after + self._after = missing + else: + rv = await self._iterator.__anext__() + + self.index0 += 1 + self._before = self._current + self._current = rv + return rv, self + + +async def make_async_loop_context(iterable, undefined, recurse=None, depth0=0): + import warnings + + warnings.warn( + "This template must be recompiled with at least Jinja 2.11, or" + " it will fail in 3.0.", + DeprecationWarning, + stacklevel=2, + ) + return AsyncLoopContext(iterable, undefined, recurse, depth0) + + +patch_all() diff --git a/.venv/lib/python3.8/site-packages/jinja2/bccache.py b/.venv/lib/python3.8/site-packages/jinja2/bccache.py new file mode 100644 index 00000000..9c066103 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jinja2/bccache.py @@ -0,0 +1,350 @@ +# -*- coding: utf-8 -*- +"""The optional bytecode cache system. This is useful if you have very +complex template situations and the compilation of all those templates +slows down your application too much. + +Situations where this is useful are often forking web applications that +are initialized on the first request. +""" +import errno +import fnmatch +import os +import stat +import sys +import tempfile +from hashlib import sha1 +from os import listdir +from os import path + +from ._compat import BytesIO +from ._compat import marshal_dump +from ._compat import marshal_load +from ._compat import pickle +from ._compat import text_type +from .utils import open_if_exists + +bc_version = 4 +# Magic bytes to identify Jinja bytecode cache files. Contains the +# Python major and minor version to avoid loading incompatible bytecode +# if a project upgrades its Python version. +bc_magic = ( + b"j2" + + pickle.dumps(bc_version, 2) + + pickle.dumps((sys.version_info[0] << 24) | sys.version_info[1], 2) +) + + +class Bucket(object): + """Buckets are used to store the bytecode for one template. It's created + and initialized by the bytecode cache and passed to the loading functions. + + The buckets get an internal checksum from the cache assigned and use this + to automatically reject outdated cache material. Individual bytecode + cache subclasses don't have to care about cache invalidation. + """ + + def __init__(self, environment, key, checksum): + self.environment = environment + self.key = key + self.checksum = checksum + self.reset() + + def reset(self): + """Resets the bucket (unloads the bytecode).""" + self.code = None + + def load_bytecode(self, f): + """Loads bytecode from a file or file like object.""" + # make sure the magic header is correct + magic = f.read(len(bc_magic)) + if magic != bc_magic: + self.reset() + return + # the source code of the file changed, we need to reload + checksum = pickle.load(f) + if self.checksum != checksum: + self.reset() + return + # if marshal_load fails then we need to reload + try: + self.code = marshal_load(f) + except (EOFError, ValueError, TypeError): + self.reset() + return + + def write_bytecode(self, f): + """Dump the bytecode into the file or file like object passed.""" + if self.code is None: + raise TypeError("can't write empty bucket") + f.write(bc_magic) + pickle.dump(self.checksum, f, 2) + marshal_dump(self.code, f) + + def bytecode_from_string(self, string): + """Load bytecode from a string.""" + self.load_bytecode(BytesIO(string)) + + def bytecode_to_string(self): + """Return the bytecode as string.""" + out = BytesIO() + self.write_bytecode(out) + return out.getvalue() + + +class BytecodeCache(object): + """To implement your own bytecode cache you have to subclass this class + and override :meth:`load_bytecode` and :meth:`dump_bytecode`. Both of + these methods are passed a :class:`~jinja2.bccache.Bucket`. + + A very basic bytecode cache that saves the bytecode on the file system:: + + from os import path + + class MyCache(BytecodeCache): + + def __init__(self, directory): + self.directory = directory + + def load_bytecode(self, bucket): + filename = path.join(self.directory, bucket.key) + if path.exists(filename): + with open(filename, 'rb') as f: + bucket.load_bytecode(f) + + def dump_bytecode(self, bucket): + filename = path.join(self.directory, bucket.key) + with open(filename, 'wb') as f: + bucket.write_bytecode(f) + + A more advanced version of a filesystem based bytecode cache is part of + Jinja. + """ + + def load_bytecode(self, bucket): + """Subclasses have to override this method to load bytecode into a + bucket. If they are not able to find code in the cache for the + bucket, it must not do anything. + """ + raise NotImplementedError() + + def dump_bytecode(self, bucket): + """Subclasses have to override this method to write the bytecode + from a bucket back to the cache. If it unable to do so it must not + fail silently but raise an exception. + """ + raise NotImplementedError() + + def clear(self): + """Clears the cache. This method is not used by Jinja but should be + implemented to allow applications to clear the bytecode cache used + by a particular environment. + """ + + def get_cache_key(self, name, filename=None): + """Returns the unique hash key for this template name.""" + hash = sha1(name.encode("utf-8")) + if filename is not None: + filename = "|" + filename + if isinstance(filename, text_type): + filename = filename.encode("utf-8") + hash.update(filename) + return hash.hexdigest() + + def get_source_checksum(self, source): + """Returns a checksum for the source.""" + return sha1(source.encode("utf-8")).hexdigest() + + def get_bucket(self, environment, name, filename, source): + """Return a cache bucket for the given template. All arguments are + mandatory but filename may be `None`. + """ + key = self.get_cache_key(name, filename) + checksum = self.get_source_checksum(source) + bucket = Bucket(environment, key, checksum) + self.load_bytecode(bucket) + return bucket + + def set_bucket(self, bucket): + """Put the bucket into the cache.""" + self.dump_bytecode(bucket) + + +class FileSystemBytecodeCache(BytecodeCache): + """A bytecode cache that stores bytecode on the filesystem. It accepts + two arguments: The directory where the cache items are stored and a + pattern string that is used to build the filename. + + If no directory is specified a default cache directory is selected. On + Windows the user's temp directory is used, on UNIX systems a directory + is created for the user in the system temp directory. + + The pattern can be used to have multiple separate caches operate on the + same directory. The default pattern is ``'__jinja2_%s.cache'``. ``%s`` + is replaced with the cache key. + + >>> bcc = FileSystemBytecodeCache('/tmp/jinja_cache', '%s.cache') + + This bytecode cache supports clearing of the cache using the clear method. + """ + + def __init__(self, directory=None, pattern="__jinja2_%s.cache"): + if directory is None: + directory = self._get_default_cache_dir() + self.directory = directory + self.pattern = pattern + + def _get_default_cache_dir(self): + def _unsafe_dir(): + raise RuntimeError( + "Cannot determine safe temp directory. You " + "need to explicitly provide one." + ) + + tmpdir = tempfile.gettempdir() + + # On windows the temporary directory is used specific unless + # explicitly forced otherwise. We can just use that. + if os.name == "nt": + return tmpdir + if not hasattr(os, "getuid"): + _unsafe_dir() + + dirname = "_jinja2-cache-%d" % os.getuid() + actual_dir = os.path.join(tmpdir, dirname) + + try: + os.mkdir(actual_dir, stat.S_IRWXU) + except OSError as e: + if e.errno != errno.EEXIST: + raise + try: + os.chmod(actual_dir, stat.S_IRWXU) + actual_dir_stat = os.lstat(actual_dir) + if ( + actual_dir_stat.st_uid != os.getuid() + or not stat.S_ISDIR(actual_dir_stat.st_mode) + or stat.S_IMODE(actual_dir_stat.st_mode) != stat.S_IRWXU + ): + _unsafe_dir() + except OSError as e: + if e.errno != errno.EEXIST: + raise + + actual_dir_stat = os.lstat(actual_dir) + if ( + actual_dir_stat.st_uid != os.getuid() + or not stat.S_ISDIR(actual_dir_stat.st_mode) + or stat.S_IMODE(actual_dir_stat.st_mode) != stat.S_IRWXU + ): + _unsafe_dir() + + return actual_dir + + def _get_cache_filename(self, bucket): + return path.join(self.directory, self.pattern % bucket.key) + + def load_bytecode(self, bucket): + f = open_if_exists(self._get_cache_filename(bucket), "rb") + if f is not None: + try: + bucket.load_bytecode(f) + finally: + f.close() + + def dump_bytecode(self, bucket): + f = open(self._get_cache_filename(bucket), "wb") + try: + bucket.write_bytecode(f) + finally: + f.close() + + def clear(self): + # imported lazily here because google app-engine doesn't support + # write access on the file system and the function does not exist + # normally. + from os import remove + + files = fnmatch.filter(listdir(self.directory), self.pattern % "*") + for filename in files: + try: + remove(path.join(self.directory, filename)) + except OSError: + pass + + +class MemcachedBytecodeCache(BytecodeCache): + """This class implements a bytecode cache that uses a memcache cache for + storing the information. It does not enforce a specific memcache library + (tummy's memcache or cmemcache) but will accept any class that provides + the minimal interface required. + + Libraries compatible with this class: + + - `cachelib `_ + - `python-memcached `_ + + (Unfortunately the django cache interface is not compatible because it + does not support storing binary data, only unicode. You can however pass + the underlying cache client to the bytecode cache which is available + as `django.core.cache.cache._client`.) + + The minimal interface for the client passed to the constructor is this: + + .. class:: MinimalClientInterface + + .. method:: set(key, value[, timeout]) + + Stores the bytecode in the cache. `value` is a string and + `timeout` the timeout of the key. If timeout is not provided + a default timeout or no timeout should be assumed, if it's + provided it's an integer with the number of seconds the cache + item should exist. + + .. method:: get(key) + + Returns the value for the cache key. If the item does not + exist in the cache the return value must be `None`. + + The other arguments to the constructor are the prefix for all keys that + is added before the actual cache key and the timeout for the bytecode in + the cache system. We recommend a high (or no) timeout. + + This bytecode cache does not support clearing of used items in the cache. + The clear method is a no-operation function. + + .. versionadded:: 2.7 + Added support for ignoring memcache errors through the + `ignore_memcache_errors` parameter. + """ + + def __init__( + self, + client, + prefix="jinja2/bytecode/", + timeout=None, + ignore_memcache_errors=True, + ): + self.client = client + self.prefix = prefix + self.timeout = timeout + self.ignore_memcache_errors = ignore_memcache_errors + + def load_bytecode(self, bucket): + try: + code = self.client.get(self.prefix + bucket.key) + except Exception: + if not self.ignore_memcache_errors: + raise + code = None + if code is not None: + bucket.bytecode_from_string(code) + + def dump_bytecode(self, bucket): + args = (self.prefix + bucket.key, bucket.bytecode_to_string()) + if self.timeout is not None: + args += (self.timeout,) + try: + self.client.set(*args) + except Exception: + if not self.ignore_memcache_errors: + raise diff --git a/.venv/lib/python3.8/site-packages/jinja2/compiler.py b/.venv/lib/python3.8/site-packages/jinja2/compiler.py new file mode 100644 index 00000000..63297b42 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jinja2/compiler.py @@ -0,0 +1,1843 @@ +# -*- coding: utf-8 -*- +"""Compiles nodes from the parser into Python code.""" +from collections import namedtuple +from functools import update_wrapper +from itertools import chain +from keyword import iskeyword as is_python_keyword + +from markupsafe import escape +from markupsafe import Markup + +from . import nodes +from ._compat import imap +from ._compat import iteritems +from ._compat import izip +from ._compat import NativeStringIO +from ._compat import range_type +from ._compat import string_types +from ._compat import text_type +from .exceptions import TemplateAssertionError +from .idtracking import Symbols +from .idtracking import VAR_LOAD_ALIAS +from .idtracking import VAR_LOAD_PARAMETER +from .idtracking import VAR_LOAD_RESOLVE +from .idtracking import VAR_LOAD_UNDEFINED +from .nodes import EvalContext +from .optimizer import Optimizer +from .utils import concat +from .visitor import NodeVisitor + +operators = { + "eq": "==", + "ne": "!=", + "gt": ">", + "gteq": ">=", + "lt": "<", + "lteq": "<=", + "in": "in", + "notin": "not in", +} + +# what method to iterate over items do we want to use for dict iteration +# in generated code? on 2.x let's go with iteritems, on 3.x with items +if hasattr(dict, "iteritems"): + dict_item_iter = "iteritems" +else: + dict_item_iter = "items" + +code_features = ["division"] + +# does this python version support generator stops? (PEP 0479) +try: + exec("from __future__ import generator_stop") + code_features.append("generator_stop") +except SyntaxError: + pass + +# does this python version support yield from? +try: + exec("def f(): yield from x()") +except SyntaxError: + supports_yield_from = False +else: + supports_yield_from = True + + +def optimizeconst(f): + def new_func(self, node, frame, **kwargs): + # Only optimize if the frame is not volatile + if self.optimized and not frame.eval_ctx.volatile: + new_node = self.optimizer.visit(node, frame.eval_ctx) + if new_node != node: + return self.visit(new_node, frame) + return f(self, node, frame, **kwargs) + + return update_wrapper(new_func, f) + + +def generate( + node, environment, name, filename, stream=None, defer_init=False, optimized=True +): + """Generate the python source for a node tree.""" + if not isinstance(node, nodes.Template): + raise TypeError("Can't compile non template nodes") + generator = environment.code_generator_class( + environment, name, filename, stream, defer_init, optimized + ) + generator.visit(node) + if stream is None: + return generator.stream.getvalue() + + +def has_safe_repr(value): + """Does the node have a safe representation?""" + if value is None or value is NotImplemented or value is Ellipsis: + return True + if type(value) in (bool, int, float, complex, range_type, Markup) + string_types: + return True + if type(value) in (tuple, list, set, frozenset): + for item in value: + if not has_safe_repr(item): + return False + return True + elif type(value) is dict: + for key, value in iteritems(value): + if not has_safe_repr(key): + return False + if not has_safe_repr(value): + return False + return True + return False + + +def find_undeclared(nodes, names): + """Check if the names passed are accessed undeclared. The return value + is a set of all the undeclared names from the sequence of names found. + """ + visitor = UndeclaredNameVisitor(names) + try: + for node in nodes: + visitor.visit(node) + except VisitorExit: + pass + return visitor.undeclared + + +class MacroRef(object): + def __init__(self, node): + self.node = node + self.accesses_caller = False + self.accesses_kwargs = False + self.accesses_varargs = False + + +class Frame(object): + """Holds compile time information for us.""" + + def __init__(self, eval_ctx, parent=None, level=None): + self.eval_ctx = eval_ctx + self.symbols = Symbols(parent and parent.symbols or None, level=level) + + # a toplevel frame is the root + soft frames such as if conditions. + self.toplevel = False + + # the root frame is basically just the outermost frame, so no if + # conditions. This information is used to optimize inheritance + # situations. + self.rootlevel = False + + # in some dynamic inheritance situations the compiler needs to add + # write tests around output statements. + self.require_output_check = parent and parent.require_output_check + + # inside some tags we are using a buffer rather than yield statements. + # this for example affects {% filter %} or {% macro %}. If a frame + # is buffered this variable points to the name of the list used as + # buffer. + self.buffer = None + + # the name of the block we're in, otherwise None. + self.block = parent and parent.block or None + + # the parent of this frame + self.parent = parent + + if parent is not None: + self.buffer = parent.buffer + + def copy(self): + """Create a copy of the current one.""" + rv = object.__new__(self.__class__) + rv.__dict__.update(self.__dict__) + rv.symbols = self.symbols.copy() + return rv + + def inner(self, isolated=False): + """Return an inner frame.""" + if isolated: + return Frame(self.eval_ctx, level=self.symbols.level + 1) + return Frame(self.eval_ctx, self) + + def soft(self): + """Return a soft frame. A soft frame may not be modified as + standalone thing as it shares the resources with the frame it + was created of, but it's not a rootlevel frame any longer. + + This is only used to implement if-statements. + """ + rv = self.copy() + rv.rootlevel = False + return rv + + __copy__ = copy + + +class VisitorExit(RuntimeError): + """Exception used by the `UndeclaredNameVisitor` to signal a stop.""" + + +class DependencyFinderVisitor(NodeVisitor): + """A visitor that collects filter and test calls.""" + + def __init__(self): + self.filters = set() + self.tests = set() + + def visit_Filter(self, node): + self.generic_visit(node) + self.filters.add(node.name) + + def visit_Test(self, node): + self.generic_visit(node) + self.tests.add(node.name) + + def visit_Block(self, node): + """Stop visiting at blocks.""" + + +class UndeclaredNameVisitor(NodeVisitor): + """A visitor that checks if a name is accessed without being + declared. This is different from the frame visitor as it will + not stop at closure frames. + """ + + def __init__(self, names): + self.names = set(names) + self.undeclared = set() + + def visit_Name(self, node): + if node.ctx == "load" and node.name in self.names: + self.undeclared.add(node.name) + if self.undeclared == self.names: + raise VisitorExit() + else: + self.names.discard(node.name) + + def visit_Block(self, node): + """Stop visiting a blocks.""" + + +class CompilerExit(Exception): + """Raised if the compiler encountered a situation where it just + doesn't make sense to further process the code. Any block that + raises such an exception is not further processed. + """ + + +class CodeGenerator(NodeVisitor): + def __init__( + self, environment, name, filename, stream=None, defer_init=False, optimized=True + ): + if stream is None: + stream = NativeStringIO() + self.environment = environment + self.name = name + self.filename = filename + self.stream = stream + self.created_block_context = False + self.defer_init = defer_init + self.optimized = optimized + if optimized: + self.optimizer = Optimizer(environment) + + # aliases for imports + self.import_aliases = {} + + # a registry for all blocks. Because blocks are moved out + # into the global python scope they are registered here + self.blocks = {} + + # the number of extends statements so far + self.extends_so_far = 0 + + # some templates have a rootlevel extends. In this case we + # can safely assume that we're a child template and do some + # more optimizations. + self.has_known_extends = False + + # the current line number + self.code_lineno = 1 + + # registry of all filters and tests (global, not block local) + self.tests = {} + self.filters = {} + + # the debug information + self.debug_info = [] + self._write_debug_info = None + + # the number of new lines before the next write() + self._new_lines = 0 + + # the line number of the last written statement + self._last_line = 0 + + # true if nothing was written so far. + self._first_write = True + + # used by the `temporary_identifier` method to get new + # unique, temporary identifier + self._last_identifier = 0 + + # the current indentation + self._indentation = 0 + + # Tracks toplevel assignments + self._assign_stack = [] + + # Tracks parameter definition blocks + self._param_def_block = [] + + # Tracks the current context. + self._context_reference_stack = ["context"] + + # -- Various compilation helpers + + def fail(self, msg, lineno): + """Fail with a :exc:`TemplateAssertionError`.""" + raise TemplateAssertionError(msg, lineno, self.name, self.filename) + + def temporary_identifier(self): + """Get a new unique identifier.""" + self._last_identifier += 1 + return "t_%d" % self._last_identifier + + def buffer(self, frame): + """Enable buffering for the frame from that point onwards.""" + frame.buffer = self.temporary_identifier() + self.writeline("%s = []" % frame.buffer) + + def return_buffer_contents(self, frame, force_unescaped=False): + """Return the buffer contents of the frame.""" + if not force_unescaped: + if frame.eval_ctx.volatile: + self.writeline("if context.eval_ctx.autoescape:") + self.indent() + self.writeline("return Markup(concat(%s))" % frame.buffer) + self.outdent() + self.writeline("else:") + self.indent() + self.writeline("return concat(%s)" % frame.buffer) + self.outdent() + return + elif frame.eval_ctx.autoescape: + self.writeline("return Markup(concat(%s))" % frame.buffer) + return + self.writeline("return concat(%s)" % frame.buffer) + + def indent(self): + """Indent by one.""" + self._indentation += 1 + + def outdent(self, step=1): + """Outdent by step.""" + self._indentation -= step + + def start_write(self, frame, node=None): + """Yield or write into the frame buffer.""" + if frame.buffer is None: + self.writeline("yield ", node) + else: + self.writeline("%s.append(" % frame.buffer, node) + + def end_write(self, frame): + """End the writing process started by `start_write`.""" + if frame.buffer is not None: + self.write(")") + + def simple_write(self, s, frame, node=None): + """Simple shortcut for start_write + write + end_write.""" + self.start_write(frame, node) + self.write(s) + self.end_write(frame) + + def blockvisit(self, nodes, frame): + """Visit a list of nodes as block in a frame. If the current frame + is no buffer a dummy ``if 0: yield None`` is written automatically. + """ + try: + self.writeline("pass") + for node in nodes: + self.visit(node, frame) + except CompilerExit: + pass + + def write(self, x): + """Write a string into the output stream.""" + if self._new_lines: + if not self._first_write: + self.stream.write("\n" * self._new_lines) + self.code_lineno += self._new_lines + if self._write_debug_info is not None: + self.debug_info.append((self._write_debug_info, self.code_lineno)) + self._write_debug_info = None + self._first_write = False + self.stream.write(" " * self._indentation) + self._new_lines = 0 + self.stream.write(x) + + def writeline(self, x, node=None, extra=0): + """Combination of newline and write.""" + self.newline(node, extra) + self.write(x) + + def newline(self, node=None, extra=0): + """Add one or more newlines before the next write.""" + self._new_lines = max(self._new_lines, 1 + extra) + if node is not None and node.lineno != self._last_line: + self._write_debug_info = node.lineno + self._last_line = node.lineno + + def signature(self, node, frame, extra_kwargs=None): + """Writes a function call to the stream for the current node. + A leading comma is added automatically. The extra keyword + arguments may not include python keywords otherwise a syntax + error could occur. The extra keyword arguments should be given + as python dict. + """ + # if any of the given keyword arguments is a python keyword + # we have to make sure that no invalid call is created. + kwarg_workaround = False + for kwarg in chain((x.key for x in node.kwargs), extra_kwargs or ()): + if is_python_keyword(kwarg): + kwarg_workaround = True + break + + for arg in node.args: + self.write(", ") + self.visit(arg, frame) + + if not kwarg_workaround: + for kwarg in node.kwargs: + self.write(", ") + self.visit(kwarg, frame) + if extra_kwargs is not None: + for key, value in iteritems(extra_kwargs): + self.write(", %s=%s" % (key, value)) + if node.dyn_args: + self.write(", *") + self.visit(node.dyn_args, frame) + + if kwarg_workaround: + if node.dyn_kwargs is not None: + self.write(", **dict({") + else: + self.write(", **{") + for kwarg in node.kwargs: + self.write("%r: " % kwarg.key) + self.visit(kwarg.value, frame) + self.write(", ") + if extra_kwargs is not None: + for key, value in iteritems(extra_kwargs): + self.write("%r: %s, " % (key, value)) + if node.dyn_kwargs is not None: + self.write("}, **") + self.visit(node.dyn_kwargs, frame) + self.write(")") + else: + self.write("}") + + elif node.dyn_kwargs is not None: + self.write(", **") + self.visit(node.dyn_kwargs, frame) + + def pull_dependencies(self, nodes): + """Pull all the dependencies.""" + visitor = DependencyFinderVisitor() + for node in nodes: + visitor.visit(node) + for dependency in "filters", "tests": + mapping = getattr(self, dependency) + for name in getattr(visitor, dependency): + if name not in mapping: + mapping[name] = self.temporary_identifier() + self.writeline( + "%s = environment.%s[%r]" % (mapping[name], dependency, name) + ) + + def enter_frame(self, frame): + undefs = [] + for target, (action, param) in iteritems(frame.symbols.loads): + if action == VAR_LOAD_PARAMETER: + pass + elif action == VAR_LOAD_RESOLVE: + self.writeline("%s = %s(%r)" % (target, self.get_resolve_func(), param)) + elif action == VAR_LOAD_ALIAS: + self.writeline("%s = %s" % (target, param)) + elif action == VAR_LOAD_UNDEFINED: + undefs.append(target) + else: + raise NotImplementedError("unknown load instruction") + if undefs: + self.writeline("%s = missing" % " = ".join(undefs)) + + def leave_frame(self, frame, with_python_scope=False): + if not with_python_scope: + undefs = [] + for target, _ in iteritems(frame.symbols.loads): + undefs.append(target) + if undefs: + self.writeline("%s = missing" % " = ".join(undefs)) + + def func(self, name): + if self.environment.is_async: + return "async def %s" % name + return "def %s" % name + + def macro_body(self, node, frame): + """Dump the function def of a macro or call block.""" + frame = frame.inner() + frame.symbols.analyze_node(node) + macro_ref = MacroRef(node) + + explicit_caller = None + skip_special_params = set() + args = [] + for idx, arg in enumerate(node.args): + if arg.name == "caller": + explicit_caller = idx + if arg.name in ("kwargs", "varargs"): + skip_special_params.add(arg.name) + args.append(frame.symbols.ref(arg.name)) + + undeclared = find_undeclared(node.body, ("caller", "kwargs", "varargs")) + + if "caller" in undeclared: + # In older Jinja versions there was a bug that allowed caller + # to retain the special behavior even if it was mentioned in + # the argument list. However thankfully this was only really + # working if it was the last argument. So we are explicitly + # checking this now and error out if it is anywhere else in + # the argument list. + if explicit_caller is not None: + try: + node.defaults[explicit_caller - len(node.args)] + except IndexError: + self.fail( + "When defining macros or call blocks the " + 'special "caller" argument must be omitted ' + "or be given a default.", + node.lineno, + ) + else: + args.append(frame.symbols.declare_parameter("caller")) + macro_ref.accesses_caller = True + if "kwargs" in undeclared and "kwargs" not in skip_special_params: + args.append(frame.symbols.declare_parameter("kwargs")) + macro_ref.accesses_kwargs = True + if "varargs" in undeclared and "varargs" not in skip_special_params: + args.append(frame.symbols.declare_parameter("varargs")) + macro_ref.accesses_varargs = True + + # macros are delayed, they never require output checks + frame.require_output_check = False + frame.symbols.analyze_node(node) + self.writeline("%s(%s):" % (self.func("macro"), ", ".join(args)), node) + self.indent() + + self.buffer(frame) + self.enter_frame(frame) + + self.push_parameter_definitions(frame) + for idx, arg in enumerate(node.args): + ref = frame.symbols.ref(arg.name) + self.writeline("if %s is missing:" % ref) + self.indent() + try: + default = node.defaults[idx - len(node.args)] + except IndexError: + self.writeline( + "%s = undefined(%r, name=%r)" + % (ref, "parameter %r was not provided" % arg.name, arg.name) + ) + else: + self.writeline("%s = " % ref) + self.visit(default, frame) + self.mark_parameter_stored(ref) + self.outdent() + self.pop_parameter_definitions() + + self.blockvisit(node.body, frame) + self.return_buffer_contents(frame, force_unescaped=True) + self.leave_frame(frame, with_python_scope=True) + self.outdent() + + return frame, macro_ref + + def macro_def(self, macro_ref, frame): + """Dump the macro definition for the def created by macro_body.""" + arg_tuple = ", ".join(repr(x.name) for x in macro_ref.node.args) + name = getattr(macro_ref.node, "name", None) + if len(macro_ref.node.args) == 1: + arg_tuple += "," + self.write( + "Macro(environment, macro, %r, (%s), %r, %r, %r, " + "context.eval_ctx.autoescape)" + % ( + name, + arg_tuple, + macro_ref.accesses_kwargs, + macro_ref.accesses_varargs, + macro_ref.accesses_caller, + ) + ) + + def position(self, node): + """Return a human readable position for the node.""" + rv = "line %d" % node.lineno + if self.name is not None: + rv += " in " + repr(self.name) + return rv + + def dump_local_context(self, frame): + return "{%s}" % ", ".join( + "%r: %s" % (name, target) + for name, target in iteritems(frame.symbols.dump_stores()) + ) + + def write_commons(self): + """Writes a common preamble that is used by root and block functions. + Primarily this sets up common local helpers and enforces a generator + through a dead branch. + """ + self.writeline("resolve = context.resolve_or_missing") + self.writeline("undefined = environment.undefined") + # always use the standard Undefined class for the implicit else of + # conditional expressions + self.writeline("cond_expr_undefined = Undefined") + self.writeline("if 0: yield None") + + def push_parameter_definitions(self, frame): + """Pushes all parameter targets from the given frame into a local + stack that permits tracking of yet to be assigned parameters. In + particular this enables the optimization from `visit_Name` to skip + undefined expressions for parameters in macros as macros can reference + otherwise unbound parameters. + """ + self._param_def_block.append(frame.symbols.dump_param_targets()) + + def pop_parameter_definitions(self): + """Pops the current parameter definitions set.""" + self._param_def_block.pop() + + def mark_parameter_stored(self, target): + """Marks a parameter in the current parameter definitions as stored. + This will skip the enforced undefined checks. + """ + if self._param_def_block: + self._param_def_block[-1].discard(target) + + def push_context_reference(self, target): + self._context_reference_stack.append(target) + + def pop_context_reference(self): + self._context_reference_stack.pop() + + def get_context_ref(self): + return self._context_reference_stack[-1] + + def get_resolve_func(self): + target = self._context_reference_stack[-1] + if target == "context": + return "resolve" + return "%s.resolve" % target + + def derive_context(self, frame): + return "%s.derived(%s)" % ( + self.get_context_ref(), + self.dump_local_context(frame), + ) + + def parameter_is_undeclared(self, target): + """Checks if a given target is an undeclared parameter.""" + if not self._param_def_block: + return False + return target in self._param_def_block[-1] + + def push_assign_tracking(self): + """Pushes a new layer for assignment tracking.""" + self._assign_stack.append(set()) + + def pop_assign_tracking(self, frame): + """Pops the topmost level for assignment tracking and updates the + context variables if necessary. + """ + vars = self._assign_stack.pop() + if not frame.toplevel or not vars: + return + public_names = [x for x in vars if x[:1] != "_"] + if len(vars) == 1: + name = next(iter(vars)) + ref = frame.symbols.ref(name) + self.writeline("context.vars[%r] = %s" % (name, ref)) + else: + self.writeline("context.vars.update({") + for idx, name in enumerate(vars): + if idx: + self.write(", ") + ref = frame.symbols.ref(name) + self.write("%r: %s" % (name, ref)) + self.write("})") + if public_names: + if len(public_names) == 1: + self.writeline("context.exported_vars.add(%r)" % public_names[0]) + else: + self.writeline( + "context.exported_vars.update((%s))" + % ", ".join(imap(repr, public_names)) + ) + + # -- Statement Visitors + + def visit_Template(self, node, frame=None): + assert frame is None, "no root frame allowed" + eval_ctx = EvalContext(self.environment, self.name) + + from .runtime import exported + + self.writeline("from __future__ import %s" % ", ".join(code_features)) + self.writeline("from jinja2.runtime import " + ", ".join(exported)) + + if self.environment.is_async: + self.writeline( + "from jinja2.asyncsupport import auto_await, " + "auto_aiter, AsyncLoopContext" + ) + + # if we want a deferred initialization we cannot move the + # environment into a local name + envenv = not self.defer_init and ", environment=environment" or "" + + # do we have an extends tag at all? If not, we can save some + # overhead by just not processing any inheritance code. + have_extends = node.find(nodes.Extends) is not None + + # find all blocks + for block in node.find_all(nodes.Block): + if block.name in self.blocks: + self.fail("block %r defined twice" % block.name, block.lineno) + self.blocks[block.name] = block + + # find all imports and import them + for import_ in node.find_all(nodes.ImportedName): + if import_.importname not in self.import_aliases: + imp = import_.importname + self.import_aliases[imp] = alias = self.temporary_identifier() + if "." in imp: + module, obj = imp.rsplit(".", 1) + self.writeline("from %s import %s as %s" % (module, obj, alias)) + else: + self.writeline("import %s as %s" % (imp, alias)) + + # add the load name + self.writeline("name = %r" % self.name) + + # generate the root render function. + self.writeline( + "%s(context, missing=missing%s):" % (self.func("root"), envenv), extra=1 + ) + self.indent() + self.write_commons() + + # process the root + frame = Frame(eval_ctx) + if "self" in find_undeclared(node.body, ("self",)): + ref = frame.symbols.declare_parameter("self") + self.writeline("%s = TemplateReference(context)" % ref) + frame.symbols.analyze_node(node) + frame.toplevel = frame.rootlevel = True + frame.require_output_check = have_extends and not self.has_known_extends + if have_extends: + self.writeline("parent_template = None") + self.enter_frame(frame) + self.pull_dependencies(node.body) + self.blockvisit(node.body, frame) + self.leave_frame(frame, with_python_scope=True) + self.outdent() + + # make sure that the parent root is called. + if have_extends: + if not self.has_known_extends: + self.indent() + self.writeline("if parent_template is not None:") + self.indent() + if supports_yield_from and not self.environment.is_async: + self.writeline("yield from parent_template.root_render_func(context)") + else: + self.writeline( + "%sfor event in parent_template." + "root_render_func(context):" + % (self.environment.is_async and "async " or "") + ) + self.indent() + self.writeline("yield event") + self.outdent() + self.outdent(1 + (not self.has_known_extends)) + + # at this point we now have the blocks collected and can visit them too. + for name, block in iteritems(self.blocks): + self.writeline( + "%s(context, missing=missing%s):" + % (self.func("block_" + name), envenv), + block, + 1, + ) + self.indent() + self.write_commons() + # It's important that we do not make this frame a child of the + # toplevel template. This would cause a variety of + # interesting issues with identifier tracking. + block_frame = Frame(eval_ctx) + undeclared = find_undeclared(block.body, ("self", "super")) + if "self" in undeclared: + ref = block_frame.symbols.declare_parameter("self") + self.writeline("%s = TemplateReference(context)" % ref) + if "super" in undeclared: + ref = block_frame.symbols.declare_parameter("super") + self.writeline("%s = context.super(%r, block_%s)" % (ref, name, name)) + block_frame.symbols.analyze_node(block) + block_frame.block = name + self.enter_frame(block_frame) + self.pull_dependencies(block.body) + self.blockvisit(block.body, block_frame) + self.leave_frame(block_frame, with_python_scope=True) + self.outdent() + + self.writeline( + "blocks = {%s}" % ", ".join("%r: block_%s" % (x, x) for x in self.blocks), + extra=1, + ) + + # add a function that returns the debug info + self.writeline( + "debug_info = %r" % "&".join("%s=%s" % x for x in self.debug_info) + ) + + def visit_Block(self, node, frame): + """Call a block and register it for the template.""" + level = 0 + if frame.toplevel: + # if we know that we are a child template, there is no need to + # check if we are one + if self.has_known_extends: + return + if self.extends_so_far > 0: + self.writeline("if parent_template is None:") + self.indent() + level += 1 + + if node.scoped: + context = self.derive_context(frame) + else: + context = self.get_context_ref() + + if ( + supports_yield_from + and not self.environment.is_async + and frame.buffer is None + ): + self.writeline( + "yield from context.blocks[%r][0](%s)" % (node.name, context), node + ) + else: + loop = self.environment.is_async and "async for" or "for" + self.writeline( + "%s event in context.blocks[%r][0](%s):" % (loop, node.name, context), + node, + ) + self.indent() + self.simple_write("event", frame) + self.outdent() + + self.outdent(level) + + def visit_Extends(self, node, frame): + """Calls the extender.""" + if not frame.toplevel: + self.fail("cannot use extend from a non top-level scope", node.lineno) + + # if the number of extends statements in general is zero so + # far, we don't have to add a check if something extended + # the template before this one. + if self.extends_so_far > 0: + + # if we have a known extends we just add a template runtime + # error into the generated code. We could catch that at compile + # time too, but i welcome it not to confuse users by throwing the + # same error at different times just "because we can". + if not self.has_known_extends: + self.writeline("if parent_template is not None:") + self.indent() + self.writeline("raise TemplateRuntimeError(%r)" % "extended multiple times") + + # if we have a known extends already we don't need that code here + # as we know that the template execution will end here. + if self.has_known_extends: + raise CompilerExit() + else: + self.outdent() + + self.writeline("parent_template = environment.get_template(", node) + self.visit(node.template, frame) + self.write(", %r)" % self.name) + self.writeline( + "for name, parent_block in parent_template.blocks.%s():" % dict_item_iter + ) + self.indent() + self.writeline("context.blocks.setdefault(name, []).append(parent_block)") + self.outdent() + + # if this extends statement was in the root level we can take + # advantage of that information and simplify the generated code + # in the top level from this point onwards + if frame.rootlevel: + self.has_known_extends = True + + # and now we have one more + self.extends_so_far += 1 + + def visit_Include(self, node, frame): + """Handles includes.""" + if node.ignore_missing: + self.writeline("try:") + self.indent() + + func_name = "get_or_select_template" + if isinstance(node.template, nodes.Const): + if isinstance(node.template.value, string_types): + func_name = "get_template" + elif isinstance(node.template.value, (tuple, list)): + func_name = "select_template" + elif isinstance(node.template, (nodes.Tuple, nodes.List)): + func_name = "select_template" + + self.writeline("template = environment.%s(" % func_name, node) + self.visit(node.template, frame) + self.write(", %r)" % self.name) + if node.ignore_missing: + self.outdent() + self.writeline("except TemplateNotFound:") + self.indent() + self.writeline("pass") + self.outdent() + self.writeline("else:") + self.indent() + + skip_event_yield = False + if node.with_context: + loop = self.environment.is_async and "async for" or "for" + self.writeline( + "%s event in template.root_render_func(" + "template.new_context(context.get_all(), True, " + "%s)):" % (loop, self.dump_local_context(frame)) + ) + elif self.environment.is_async: + self.writeline( + "for event in (await " + "template._get_default_module_async())" + "._body_stream:" + ) + else: + if supports_yield_from: + self.writeline("yield from template._get_default_module()._body_stream") + skip_event_yield = True + else: + self.writeline( + "for event in template._get_default_module()._body_stream:" + ) + + if not skip_event_yield: + self.indent() + self.simple_write("event", frame) + self.outdent() + + if node.ignore_missing: + self.outdent() + + def visit_Import(self, node, frame): + """Visit regular imports.""" + self.writeline("%s = " % frame.symbols.ref(node.target), node) + if frame.toplevel: + self.write("context.vars[%r] = " % node.target) + if self.environment.is_async: + self.write("await ") + self.write("environment.get_template(") + self.visit(node.template, frame) + self.write(", %r)." % self.name) + if node.with_context: + self.write( + "make_module%s(context.get_all(), True, %s)" + % ( + self.environment.is_async and "_async" or "", + self.dump_local_context(frame), + ) + ) + elif self.environment.is_async: + self.write("_get_default_module_async()") + else: + self.write("_get_default_module()") + if frame.toplevel and not node.target.startswith("_"): + self.writeline("context.exported_vars.discard(%r)" % node.target) + + def visit_FromImport(self, node, frame): + """Visit named imports.""" + self.newline(node) + self.write( + "included_template = %senvironment.get_template(" + % (self.environment.is_async and "await " or "") + ) + self.visit(node.template, frame) + self.write(", %r)." % self.name) + if node.with_context: + self.write( + "make_module%s(context.get_all(), True, %s)" + % ( + self.environment.is_async and "_async" or "", + self.dump_local_context(frame), + ) + ) + elif self.environment.is_async: + self.write("_get_default_module_async()") + else: + self.write("_get_default_module()") + + var_names = [] + discarded_names = [] + for name in node.names: + if isinstance(name, tuple): + name, alias = name + else: + alias = name + self.writeline( + "%s = getattr(included_template, " + "%r, missing)" % (frame.symbols.ref(alias), name) + ) + self.writeline("if %s is missing:" % frame.symbols.ref(alias)) + self.indent() + self.writeline( + "%s = undefined(%r %% " + "included_template.__name__, " + "name=%r)" + % ( + frame.symbols.ref(alias), + "the template %%r (imported on %s) does " + "not export the requested name %s" + % (self.position(node), repr(name)), + name, + ) + ) + self.outdent() + if frame.toplevel: + var_names.append(alias) + if not alias.startswith("_"): + discarded_names.append(alias) + + if var_names: + if len(var_names) == 1: + name = var_names[0] + self.writeline( + "context.vars[%r] = %s" % (name, frame.symbols.ref(name)) + ) + else: + self.writeline( + "context.vars.update({%s})" + % ", ".join( + "%r: %s" % (name, frame.symbols.ref(name)) for name in var_names + ) + ) + if discarded_names: + if len(discarded_names) == 1: + self.writeline("context.exported_vars.discard(%r)" % discarded_names[0]) + else: + self.writeline( + "context.exported_vars.difference_" + "update((%s))" % ", ".join(imap(repr, discarded_names)) + ) + + def visit_For(self, node, frame): + loop_frame = frame.inner() + test_frame = frame.inner() + else_frame = frame.inner() + + # try to figure out if we have an extended loop. An extended loop + # is necessary if the loop is in recursive mode if the special loop + # variable is accessed in the body. + extended_loop = node.recursive or "loop" in find_undeclared( + node.iter_child_nodes(only=("body",)), ("loop",) + ) + + loop_ref = None + if extended_loop: + loop_ref = loop_frame.symbols.declare_parameter("loop") + + loop_frame.symbols.analyze_node(node, for_branch="body") + if node.else_: + else_frame.symbols.analyze_node(node, for_branch="else") + + if node.test: + loop_filter_func = self.temporary_identifier() + test_frame.symbols.analyze_node(node, for_branch="test") + self.writeline("%s(fiter):" % self.func(loop_filter_func), node.test) + self.indent() + self.enter_frame(test_frame) + self.writeline(self.environment.is_async and "async for " or "for ") + self.visit(node.target, loop_frame) + self.write(" in ") + self.write(self.environment.is_async and "auto_aiter(fiter)" or "fiter") + self.write(":") + self.indent() + self.writeline("if ", node.test) + self.visit(node.test, test_frame) + self.write(":") + self.indent() + self.writeline("yield ") + self.visit(node.target, loop_frame) + self.outdent(3) + self.leave_frame(test_frame, with_python_scope=True) + + # if we don't have an recursive loop we have to find the shadowed + # variables at that point. Because loops can be nested but the loop + # variable is a special one we have to enforce aliasing for it. + if node.recursive: + self.writeline( + "%s(reciter, loop_render_func, depth=0):" % self.func("loop"), node + ) + self.indent() + self.buffer(loop_frame) + + # Use the same buffer for the else frame + else_frame.buffer = loop_frame.buffer + + # make sure the loop variable is a special one and raise a template + # assertion error if a loop tries to write to loop + if extended_loop: + self.writeline("%s = missing" % loop_ref) + + for name in node.find_all(nodes.Name): + if name.ctx == "store" and name.name == "loop": + self.fail( + "Can't assign to special loop variable in for-loop target", + name.lineno, + ) + + if node.else_: + iteration_indicator = self.temporary_identifier() + self.writeline("%s = 1" % iteration_indicator) + + self.writeline(self.environment.is_async and "async for " or "for ", node) + self.visit(node.target, loop_frame) + if extended_loop: + if self.environment.is_async: + self.write(", %s in AsyncLoopContext(" % loop_ref) + else: + self.write(", %s in LoopContext(" % loop_ref) + else: + self.write(" in ") + + if node.test: + self.write("%s(" % loop_filter_func) + if node.recursive: + self.write("reciter") + else: + if self.environment.is_async and not extended_loop: + self.write("auto_aiter(") + self.visit(node.iter, frame) + if self.environment.is_async and not extended_loop: + self.write(")") + if node.test: + self.write(")") + + if node.recursive: + self.write(", undefined, loop_render_func, depth):") + else: + self.write(extended_loop and ", undefined):" or ":") + + self.indent() + self.enter_frame(loop_frame) + + self.blockvisit(node.body, loop_frame) + if node.else_: + self.writeline("%s = 0" % iteration_indicator) + self.outdent() + self.leave_frame( + loop_frame, with_python_scope=node.recursive and not node.else_ + ) + + if node.else_: + self.writeline("if %s:" % iteration_indicator) + self.indent() + self.enter_frame(else_frame) + self.blockvisit(node.else_, else_frame) + self.leave_frame(else_frame) + self.outdent() + + # if the node was recursive we have to return the buffer contents + # and start the iteration code + if node.recursive: + self.return_buffer_contents(loop_frame) + self.outdent() + self.start_write(frame, node) + if self.environment.is_async: + self.write("await ") + self.write("loop(") + if self.environment.is_async: + self.write("auto_aiter(") + self.visit(node.iter, frame) + if self.environment.is_async: + self.write(")") + self.write(", loop)") + self.end_write(frame) + + def visit_If(self, node, frame): + if_frame = frame.soft() + self.writeline("if ", node) + self.visit(node.test, if_frame) + self.write(":") + self.indent() + self.blockvisit(node.body, if_frame) + self.outdent() + for elif_ in node.elif_: + self.writeline("elif ", elif_) + self.visit(elif_.test, if_frame) + self.write(":") + self.indent() + self.blockvisit(elif_.body, if_frame) + self.outdent() + if node.else_: + self.writeline("else:") + self.indent() + self.blockvisit(node.else_, if_frame) + self.outdent() + + def visit_Macro(self, node, frame): + macro_frame, macro_ref = self.macro_body(node, frame) + self.newline() + if frame.toplevel: + if not node.name.startswith("_"): + self.write("context.exported_vars.add(%r)" % node.name) + self.writeline("context.vars[%r] = " % node.name) + self.write("%s = " % frame.symbols.ref(node.name)) + self.macro_def(macro_ref, macro_frame) + + def visit_CallBlock(self, node, frame): + call_frame, macro_ref = self.macro_body(node, frame) + self.writeline("caller = ") + self.macro_def(macro_ref, call_frame) + self.start_write(frame, node) + self.visit_Call(node.call, frame, forward_caller=True) + self.end_write(frame) + + def visit_FilterBlock(self, node, frame): + filter_frame = frame.inner() + filter_frame.symbols.analyze_node(node) + self.enter_frame(filter_frame) + self.buffer(filter_frame) + self.blockvisit(node.body, filter_frame) + self.start_write(frame, node) + self.visit_Filter(node.filter, filter_frame) + self.end_write(frame) + self.leave_frame(filter_frame) + + def visit_With(self, node, frame): + with_frame = frame.inner() + with_frame.symbols.analyze_node(node) + self.enter_frame(with_frame) + for target, expr in izip(node.targets, node.values): + self.newline() + self.visit(target, with_frame) + self.write(" = ") + self.visit(expr, frame) + self.blockvisit(node.body, with_frame) + self.leave_frame(with_frame) + + def visit_ExprStmt(self, node, frame): + self.newline(node) + self.visit(node.node, frame) + + _FinalizeInfo = namedtuple("_FinalizeInfo", ("const", "src")) + #: The default finalize function if the environment isn't configured + #: with one. Or if the environment has one, this is called on that + #: function's output for constants. + _default_finalize = text_type + _finalize = None + + def _make_finalize(self): + """Build the finalize function to be used on constants and at + runtime. Cached so it's only created once for all output nodes. + + Returns a ``namedtuple`` with the following attributes: + + ``const`` + A function to finalize constant data at compile time. + + ``src`` + Source code to output around nodes to be evaluated at + runtime. + """ + if self._finalize is not None: + return self._finalize + + finalize = default = self._default_finalize + src = None + + if self.environment.finalize: + src = "environment.finalize(" + env_finalize = self.environment.finalize + + def finalize(value): + return default(env_finalize(value)) + + if getattr(env_finalize, "contextfunction", False) is True: + src += "context, " + finalize = None # noqa: F811 + elif getattr(env_finalize, "evalcontextfunction", False) is True: + src += "context.eval_ctx, " + finalize = None + elif getattr(env_finalize, "environmentfunction", False) is True: + src += "environment, " + + def finalize(value): + return default(env_finalize(self.environment, value)) + + self._finalize = self._FinalizeInfo(finalize, src) + return self._finalize + + def _output_const_repr(self, group): + """Given a group of constant values converted from ``Output`` + child nodes, produce a string to write to the template module + source. + """ + return repr(concat(group)) + + def _output_child_to_const(self, node, frame, finalize): + """Try to optimize a child of an ``Output`` node by trying to + convert it to constant, finalized data at compile time. + + If :exc:`Impossible` is raised, the node is not constant and + will be evaluated at runtime. Any other exception will also be + evaluated at runtime for easier debugging. + """ + const = node.as_const(frame.eval_ctx) + + if frame.eval_ctx.autoescape: + const = escape(const) + + # Template data doesn't go through finalize. + if isinstance(node, nodes.TemplateData): + return text_type(const) + + return finalize.const(const) + + def _output_child_pre(self, node, frame, finalize): + """Output extra source code before visiting a child of an + ``Output`` node. + """ + if frame.eval_ctx.volatile: + self.write("(escape if context.eval_ctx.autoescape else to_string)(") + elif frame.eval_ctx.autoescape: + self.write("escape(") + else: + self.write("to_string(") + + if finalize.src is not None: + self.write(finalize.src) + + def _output_child_post(self, node, frame, finalize): + """Output extra source code after visiting a child of an + ``Output`` node. + """ + self.write(")") + + if finalize.src is not None: + self.write(")") + + def visit_Output(self, node, frame): + # If an extends is active, don't render outside a block. + if frame.require_output_check: + # A top-level extends is known to exist at compile time. + if self.has_known_extends: + return + + self.writeline("if parent_template is None:") + self.indent() + + finalize = self._make_finalize() + body = [] + + # Evaluate constants at compile time if possible. Each item in + # body will be either a list of static data or a node to be + # evaluated at runtime. + for child in node.nodes: + try: + if not ( + # If the finalize function requires runtime context, + # constants can't be evaluated at compile time. + finalize.const + # Unless it's basic template data that won't be + # finalized anyway. + or isinstance(child, nodes.TemplateData) + ): + raise nodes.Impossible() + + const = self._output_child_to_const(child, frame, finalize) + except (nodes.Impossible, Exception): + # The node was not constant and needs to be evaluated at + # runtime. Or another error was raised, which is easier + # to debug at runtime. + body.append(child) + continue + + if body and isinstance(body[-1], list): + body[-1].append(const) + else: + body.append([const]) + + if frame.buffer is not None: + if len(body) == 1: + self.writeline("%s.append(" % frame.buffer) + else: + self.writeline("%s.extend((" % frame.buffer) + + self.indent() + + for item in body: + if isinstance(item, list): + # A group of constant data to join and output. + val = self._output_const_repr(item) + + if frame.buffer is None: + self.writeline("yield " + val) + else: + self.writeline(val + ",") + else: + if frame.buffer is None: + self.writeline("yield ", item) + else: + self.newline(item) + + # A node to be evaluated at runtime. + self._output_child_pre(item, frame, finalize) + self.visit(item, frame) + self._output_child_post(item, frame, finalize) + + if frame.buffer is not None: + self.write(",") + + if frame.buffer is not None: + self.outdent() + self.writeline(")" if len(body) == 1 else "))") + + if frame.require_output_check: + self.outdent() + + def visit_Assign(self, node, frame): + self.push_assign_tracking() + self.newline(node) + self.visit(node.target, frame) + self.write(" = ") + self.visit(node.node, frame) + self.pop_assign_tracking(frame) + + def visit_AssignBlock(self, node, frame): + self.push_assign_tracking() + block_frame = frame.inner() + # This is a special case. Since a set block always captures we + # will disable output checks. This way one can use set blocks + # toplevel even in extended templates. + block_frame.require_output_check = False + block_frame.symbols.analyze_node(node) + self.enter_frame(block_frame) + self.buffer(block_frame) + self.blockvisit(node.body, block_frame) + self.newline(node) + self.visit(node.target, frame) + self.write(" = (Markup if context.eval_ctx.autoescape else identity)(") + if node.filter is not None: + self.visit_Filter(node.filter, block_frame) + else: + self.write("concat(%s)" % block_frame.buffer) + self.write(")") + self.pop_assign_tracking(frame) + self.leave_frame(block_frame) + + # -- Expression Visitors + + def visit_Name(self, node, frame): + if node.ctx == "store" and frame.toplevel: + if self._assign_stack: + self._assign_stack[-1].add(node.name) + ref = frame.symbols.ref(node.name) + + # If we are looking up a variable we might have to deal with the + # case where it's undefined. We can skip that case if the load + # instruction indicates a parameter which are always defined. + if node.ctx == "load": + load = frame.symbols.find_load(ref) + if not ( + load is not None + and load[0] == VAR_LOAD_PARAMETER + and not self.parameter_is_undeclared(ref) + ): + self.write( + "(undefined(name=%r) if %s is missing else %s)" + % (node.name, ref, ref) + ) + return + + self.write(ref) + + def visit_NSRef(self, node, frame): + # NSRefs can only be used to store values; since they use the normal + # `foo.bar` notation they will be parsed as a normal attribute access + # when used anywhere but in a `set` context + ref = frame.symbols.ref(node.name) + self.writeline("if not isinstance(%s, Namespace):" % ref) + self.indent() + self.writeline( + "raise TemplateRuntimeError(%r)" + % "cannot assign attribute on non-namespace object" + ) + self.outdent() + self.writeline("%s[%r]" % (ref, node.attr)) + + def visit_Const(self, node, frame): + val = node.as_const(frame.eval_ctx) + if isinstance(val, float): + self.write(str(val)) + else: + self.write(repr(val)) + + def visit_TemplateData(self, node, frame): + try: + self.write(repr(node.as_const(frame.eval_ctx))) + except nodes.Impossible: + self.write( + "(Markup if context.eval_ctx.autoescape else identity)(%r)" % node.data + ) + + def visit_Tuple(self, node, frame): + self.write("(") + idx = -1 + for idx, item in enumerate(node.items): + if idx: + self.write(", ") + self.visit(item, frame) + self.write(idx == 0 and ",)" or ")") + + def visit_List(self, node, frame): + self.write("[") + for idx, item in enumerate(node.items): + if idx: + self.write(", ") + self.visit(item, frame) + self.write("]") + + def visit_Dict(self, node, frame): + self.write("{") + for idx, item in enumerate(node.items): + if idx: + self.write(", ") + self.visit(item.key, frame) + self.write(": ") + self.visit(item.value, frame) + self.write("}") + + def binop(operator, interceptable=True): # noqa: B902 + @optimizeconst + def visitor(self, node, frame): + if ( + self.environment.sandboxed + and operator in self.environment.intercepted_binops + ): + self.write("environment.call_binop(context, %r, " % operator) + self.visit(node.left, frame) + self.write(", ") + self.visit(node.right, frame) + else: + self.write("(") + self.visit(node.left, frame) + self.write(" %s " % operator) + self.visit(node.right, frame) + self.write(")") + + return visitor + + def uaop(operator, interceptable=True): # noqa: B902 + @optimizeconst + def visitor(self, node, frame): + if ( + self.environment.sandboxed + and operator in self.environment.intercepted_unops + ): + self.write("environment.call_unop(context, %r, " % operator) + self.visit(node.node, frame) + else: + self.write("(" + operator) + self.visit(node.node, frame) + self.write(")") + + return visitor + + visit_Add = binop("+") + visit_Sub = binop("-") + visit_Mul = binop("*") + visit_Div = binop("/") + visit_FloorDiv = binop("//") + visit_Pow = binop("**") + visit_Mod = binop("%") + visit_And = binop("and", interceptable=False) + visit_Or = binop("or", interceptable=False) + visit_Pos = uaop("+") + visit_Neg = uaop("-") + visit_Not = uaop("not ", interceptable=False) + del binop, uaop + + @optimizeconst + def visit_Concat(self, node, frame): + if frame.eval_ctx.volatile: + func_name = "(context.eval_ctx.volatile and markup_join or unicode_join)" + elif frame.eval_ctx.autoescape: + func_name = "markup_join" + else: + func_name = "unicode_join" + self.write("%s((" % func_name) + for arg in node.nodes: + self.visit(arg, frame) + self.write(", ") + self.write("))") + + @optimizeconst + def visit_Compare(self, node, frame): + self.write("(") + self.visit(node.expr, frame) + for op in node.ops: + self.visit(op, frame) + self.write(")") + + def visit_Operand(self, node, frame): + self.write(" %s " % operators[node.op]) + self.visit(node.expr, frame) + + @optimizeconst + def visit_Getattr(self, node, frame): + if self.environment.is_async: + self.write("(await auto_await(") + + self.write("environment.getattr(") + self.visit(node.node, frame) + self.write(", %r)" % node.attr) + + if self.environment.is_async: + self.write("))") + + @optimizeconst + def visit_Getitem(self, node, frame): + # slices bypass the environment getitem method. + if isinstance(node.arg, nodes.Slice): + self.visit(node.node, frame) + self.write("[") + self.visit(node.arg, frame) + self.write("]") + else: + if self.environment.is_async: + self.write("(await auto_await(") + + self.write("environment.getitem(") + self.visit(node.node, frame) + self.write(", ") + self.visit(node.arg, frame) + self.write(")") + + if self.environment.is_async: + self.write("))") + + def visit_Slice(self, node, frame): + if node.start is not None: + self.visit(node.start, frame) + self.write(":") + if node.stop is not None: + self.visit(node.stop, frame) + if node.step is not None: + self.write(":") + self.visit(node.step, frame) + + @optimizeconst + def visit_Filter(self, node, frame): + if self.environment.is_async: + self.write("await auto_await(") + self.write(self.filters[node.name] + "(") + func = self.environment.filters.get(node.name) + if func is None: + self.fail("no filter named %r" % node.name, node.lineno) + if getattr(func, "contextfilter", False) is True: + self.write("context, ") + elif getattr(func, "evalcontextfilter", False) is True: + self.write("context.eval_ctx, ") + elif getattr(func, "environmentfilter", False) is True: + self.write("environment, ") + + # if the filter node is None we are inside a filter block + # and want to write to the current buffer + if node.node is not None: + self.visit(node.node, frame) + elif frame.eval_ctx.volatile: + self.write( + "(context.eval_ctx.autoescape and" + " Markup(concat(%s)) or concat(%s))" % (frame.buffer, frame.buffer) + ) + elif frame.eval_ctx.autoescape: + self.write("Markup(concat(%s))" % frame.buffer) + else: + self.write("concat(%s)" % frame.buffer) + self.signature(node, frame) + self.write(")") + if self.environment.is_async: + self.write(")") + + @optimizeconst + def visit_Test(self, node, frame): + self.write(self.tests[node.name] + "(") + if node.name not in self.environment.tests: + self.fail("no test named %r" % node.name, node.lineno) + self.visit(node.node, frame) + self.signature(node, frame) + self.write(")") + + @optimizeconst + def visit_CondExpr(self, node, frame): + def write_expr2(): + if node.expr2 is not None: + return self.visit(node.expr2, frame) + self.write( + "cond_expr_undefined(%r)" + % ( + "the inline if-" + "expression on %s evaluated to false and " + "no else section was defined." % self.position(node) + ) + ) + + self.write("(") + self.visit(node.expr1, frame) + self.write(" if ") + self.visit(node.test, frame) + self.write(" else ") + write_expr2() + self.write(")") + + @optimizeconst + def visit_Call(self, node, frame, forward_caller=False): + if self.environment.is_async: + self.write("await auto_await(") + if self.environment.sandboxed: + self.write("environment.call(context, ") + else: + self.write("context.call(") + self.visit(node.node, frame) + extra_kwargs = forward_caller and {"caller": "caller"} or None + self.signature(node, frame, extra_kwargs) + self.write(")") + if self.environment.is_async: + self.write(")") + + def visit_Keyword(self, node, frame): + self.write(node.key + "=") + self.visit(node.value, frame) + + # -- Unused nodes for extensions + + def visit_MarkSafe(self, node, frame): + self.write("Markup(") + self.visit(node.expr, frame) + self.write(")") + + def visit_MarkSafeIfAutoescape(self, node, frame): + self.write("(context.eval_ctx.autoescape and Markup or identity)(") + self.visit(node.expr, frame) + self.write(")") + + def visit_EnvironmentAttribute(self, node, frame): + self.write("environment." + node.name) + + def visit_ExtensionAttribute(self, node, frame): + self.write("environment.extensions[%r].%s" % (node.identifier, node.name)) + + def visit_ImportedName(self, node, frame): + self.write(self.import_aliases[node.importname]) + + def visit_InternalName(self, node, frame): + self.write(node.name) + + def visit_ContextReference(self, node, frame): + self.write("context") + + def visit_DerivedContextReference(self, node, frame): + self.write(self.derive_context(frame)) + + def visit_Continue(self, node, frame): + self.writeline("continue", node) + + def visit_Break(self, node, frame): + self.writeline("break", node) + + def visit_Scope(self, node, frame): + scope_frame = frame.inner() + scope_frame.symbols.analyze_node(node) + self.enter_frame(scope_frame) + self.blockvisit(node.body, scope_frame) + self.leave_frame(scope_frame) + + def visit_OverlayScope(self, node, frame): + ctx = self.temporary_identifier() + self.writeline("%s = %s" % (ctx, self.derive_context(frame))) + self.writeline("%s.vars = " % ctx) + self.visit(node.context, frame) + self.push_context_reference(ctx) + + scope_frame = frame.inner(isolated=True) + scope_frame.symbols.analyze_node(node) + self.enter_frame(scope_frame) + self.blockvisit(node.body, scope_frame) + self.leave_frame(scope_frame) + self.pop_context_reference() + + def visit_EvalContextModifier(self, node, frame): + for keyword in node.options: + self.writeline("context.eval_ctx.%s = " % keyword.key) + self.visit(keyword.value, frame) + try: + val = keyword.value.as_const(frame.eval_ctx) + except nodes.Impossible: + frame.eval_ctx.volatile = True + else: + setattr(frame.eval_ctx, keyword.key, val) + + def visit_ScopedEvalContextModifier(self, node, frame): + old_ctx_name = self.temporary_identifier() + saved_ctx = frame.eval_ctx.save() + self.writeline("%s = context.eval_ctx.save()" % old_ctx_name) + self.visit_EvalContextModifier(node, frame) + for child in node.body: + self.visit(child, frame) + frame.eval_ctx.revert(saved_ctx) + self.writeline("context.eval_ctx.revert(%s)" % old_ctx_name) diff --git a/.venv/lib/python3.8/site-packages/jinja2/constants.py b/.venv/lib/python3.8/site-packages/jinja2/constants.py new file mode 100644 index 00000000..bf7f2ca7 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jinja2/constants.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +#: list of lorem ipsum words used by the lipsum() helper function +LOREM_IPSUM_WORDS = u"""\ +a ac accumsan ad adipiscing aenean aliquam aliquet amet ante aptent arcu at +auctor augue bibendum blandit class commodo condimentum congue consectetuer +consequat conubia convallis cras cubilia cum curabitur curae cursus dapibus +diam dictum dictumst dignissim dis dolor donec dui duis egestas eget eleifend +elementum elit enim erat eros est et etiam eu euismod facilisi facilisis fames +faucibus felis fermentum feugiat fringilla fusce gravida habitant habitasse hac +hendrerit hymenaeos iaculis id imperdiet in inceptos integer interdum ipsum +justo lacinia lacus laoreet lectus leo libero ligula litora lobortis lorem +luctus maecenas magna magnis malesuada massa mattis mauris metus mi molestie +mollis montes morbi mus nam nascetur natoque nec neque netus nibh nisi nisl non +nonummy nostra nulla nullam nunc odio orci ornare parturient pede pellentesque +penatibus per pharetra phasellus placerat platea porta porttitor posuere +potenti praesent pretium primis proin pulvinar purus quam quis quisque rhoncus +ridiculus risus rutrum sagittis sapien scelerisque sed sem semper senectus sit +sociis sociosqu sodales sollicitudin suscipit suspendisse taciti tellus tempor +tempus tincidunt torquent tortor tristique turpis ullamcorper ultrices +ultricies urna ut varius vehicula vel velit venenatis vestibulum vitae vivamus +viverra volutpat vulputate""" diff --git a/.venv/lib/python3.8/site-packages/jinja2/debug.py b/.venv/lib/python3.8/site-packages/jinja2/debug.py new file mode 100644 index 00000000..5d8aec31 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jinja2/debug.py @@ -0,0 +1,268 @@ +import sys +from types import CodeType + +from . import TemplateSyntaxError +from ._compat import PYPY +from .utils import internal_code +from .utils import missing + + +def rewrite_traceback_stack(source=None): + """Rewrite the current exception to replace any tracebacks from + within compiled template code with tracebacks that look like they + came from the template source. + + This must be called within an ``except`` block. + + :param exc_info: A :meth:`sys.exc_info` tuple. If not provided, + the current ``exc_info`` is used. + :param source: For ``TemplateSyntaxError``, the original source if + known. + :return: A :meth:`sys.exc_info` tuple that can be re-raised. + """ + exc_type, exc_value, tb = sys.exc_info() + + if isinstance(exc_value, TemplateSyntaxError) and not exc_value.translated: + exc_value.translated = True + exc_value.source = source + + try: + # Remove the old traceback on Python 3, otherwise the frames + # from the compiler still show up. + exc_value.with_traceback(None) + except AttributeError: + pass + + # Outside of runtime, so the frame isn't executing template + # code, but it still needs to point at the template. + tb = fake_traceback( + exc_value, None, exc_value.filename or "", exc_value.lineno + ) + else: + # Skip the frame for the render function. + tb = tb.tb_next + + stack = [] + + # Build the stack of traceback object, replacing any in template + # code with the source file and line information. + while tb is not None: + # Skip frames decorated with @internalcode. These are internal + # calls that aren't useful in template debugging output. + if tb.tb_frame.f_code in internal_code: + tb = tb.tb_next + continue + + template = tb.tb_frame.f_globals.get("__jinja_template__") + + if template is not None: + lineno = template.get_corresponding_lineno(tb.tb_lineno) + fake_tb = fake_traceback(exc_value, tb, template.filename, lineno) + stack.append(fake_tb) + else: + stack.append(tb) + + tb = tb.tb_next + + tb_next = None + + # Assign tb_next in reverse to avoid circular references. + for tb in reversed(stack): + tb_next = tb_set_next(tb, tb_next) + + return exc_type, exc_value, tb_next + + +def fake_traceback(exc_value, tb, filename, lineno): + """Produce a new traceback object that looks like it came from the + template source instead of the compiled code. The filename, line + number, and location name will point to the template, and the local + variables will be the current template context. + + :param exc_value: The original exception to be re-raised to create + the new traceback. + :param tb: The original traceback to get the local variables and + code info from. + :param filename: The template filename. + :param lineno: The line number in the template source. + """ + if tb is not None: + # Replace the real locals with the context that would be + # available at that point in the template. + locals = get_template_locals(tb.tb_frame.f_locals) + locals.pop("__jinja_exception__", None) + else: + locals = {} + + globals = { + "__name__": filename, + "__file__": filename, + "__jinja_exception__": exc_value, + } + # Raise an exception at the correct line number. + code = compile("\n" * (lineno - 1) + "raise __jinja_exception__", filename, "exec") + + # Build a new code object that points to the template file and + # replaces the location with a block name. + try: + location = "template" + + if tb is not None: + function = tb.tb_frame.f_code.co_name + + if function == "root": + location = "top-level template code" + elif function.startswith("block_"): + location = 'block "%s"' % function[6:] + + # Collect arguments for the new code object. CodeType only + # accepts positional arguments, and arguments were inserted in + # new Python versions. + code_args = [] + + for attr in ( + "argcount", + "posonlyargcount", # Python 3.8 + "kwonlyargcount", # Python 3 + "nlocals", + "stacksize", + "flags", + "code", # codestring + "consts", # constants + "names", + "varnames", + ("filename", filename), + ("name", location), + "firstlineno", + "lnotab", + "freevars", + "cellvars", + ): + if isinstance(attr, tuple): + # Replace with given value. + code_args.append(attr[1]) + continue + + try: + # Copy original value if it exists. + code_args.append(getattr(code, "co_" + attr)) + except AttributeError: + # Some arguments were added later. + continue + + code = CodeType(*code_args) + except Exception: + # Some environments such as Google App Engine don't support + # modifying code objects. + pass + + # Execute the new code, which is guaranteed to raise, and return + # the new traceback without this frame. + try: + exec(code, globals, locals) + except BaseException: + return sys.exc_info()[2].tb_next + + +def get_template_locals(real_locals): + """Based on the runtime locals, get the context that would be + available at that point in the template. + """ + # Start with the current template context. + ctx = real_locals.get("context") + + if ctx: + data = ctx.get_all().copy() + else: + data = {} + + # Might be in a derived context that only sets local variables + # rather than pushing a context. Local variables follow the scheme + # l_depth_name. Find the highest-depth local that has a value for + # each name. + local_overrides = {} + + for name, value in real_locals.items(): + if not name.startswith("l_") or value is missing: + # Not a template variable, or no longer relevant. + continue + + try: + _, depth, name = name.split("_", 2) + depth = int(depth) + except ValueError: + continue + + cur_depth = local_overrides.get(name, (-1,))[0] + + if cur_depth < depth: + local_overrides[name] = (depth, value) + + # Modify the context with any derived context. + for name, (_, value) in local_overrides.items(): + if value is missing: + data.pop(name, None) + else: + data[name] = value + + return data + + +if sys.version_info >= (3, 7): + # tb_next is directly assignable as of Python 3.7 + def tb_set_next(tb, tb_next): + tb.tb_next = tb_next + return tb + + +elif PYPY: + # PyPy might have special support, and won't work with ctypes. + try: + import tputil + except ImportError: + # Without tproxy support, use the original traceback. + def tb_set_next(tb, tb_next): + return tb + + else: + # With tproxy support, create a proxy around the traceback that + # returns the new tb_next. + def tb_set_next(tb, tb_next): + def controller(op): + if op.opname == "__getattribute__" and op.args[0] == "tb_next": + return tb_next + + return op.delegate() + + return tputil.make_proxy(controller, obj=tb) + + +else: + # Use ctypes to assign tb_next at the C level since it's read-only + # from Python. + import ctypes + + class _CTraceback(ctypes.Structure): + _fields_ = [ + # Extra PyObject slots when compiled with Py_TRACE_REFS. + ("PyObject_HEAD", ctypes.c_byte * object().__sizeof__()), + # Only care about tb_next as an object, not a traceback. + ("tb_next", ctypes.py_object), + ] + + def tb_set_next(tb, tb_next): + c_tb = _CTraceback.from_address(id(tb)) + + # Clear out the old tb_next. + if tb.tb_next is not None: + c_tb_next = ctypes.py_object(tb.tb_next) + c_tb.tb_next = ctypes.py_object() + ctypes.pythonapi.Py_DecRef(c_tb_next) + + # Assign the new tb_next. + if tb_next is not None: + c_tb_next = ctypes.py_object(tb_next) + ctypes.pythonapi.Py_IncRef(c_tb_next) + c_tb.tb_next = c_tb_next + + return tb diff --git a/.venv/lib/python3.8/site-packages/jinja2/defaults.py b/.venv/lib/python3.8/site-packages/jinja2/defaults.py new file mode 100644 index 00000000..8e0e7d77 --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jinja2/defaults.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +from ._compat import range_type +from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401 +from .tests import TESTS as DEFAULT_TESTS # noqa: F401 +from .utils import Cycler +from .utils import generate_lorem_ipsum +from .utils import Joiner +from .utils import Namespace + +# defaults for the parser / lexer +BLOCK_START_STRING = "{%" +BLOCK_END_STRING = "%}" +VARIABLE_START_STRING = "{{" +VARIABLE_END_STRING = "}}" +COMMENT_START_STRING = "{#" +COMMENT_END_STRING = "#}" +LINE_STATEMENT_PREFIX = None +LINE_COMMENT_PREFIX = None +TRIM_BLOCKS = False +LSTRIP_BLOCKS = False +NEWLINE_SEQUENCE = "\n" +KEEP_TRAILING_NEWLINE = False + +# default filters, tests and namespace + +DEFAULT_NAMESPACE = { + "range": range_type, + "dict": dict, + "lipsum": generate_lorem_ipsum, + "cycler": Cycler, + "joiner": Joiner, + "namespace": Namespace, +} + +# default policies +DEFAULT_POLICIES = { + "compiler.ascii_str": True, + "urlize.rel": "noopener", + "urlize.target": None, + "truncate.leeway": 5, + "json.dumps_function": None, + "json.dumps_kwargs": {"sort_keys": True}, + "ext.i18n.trimmed": False, +} diff --git a/.venv/lib/python3.8/site-packages/jinja2/environment.py b/.venv/lib/python3.8/site-packages/jinja2/environment.py new file mode 100644 index 00000000..8430390e --- /dev/null +++ b/.venv/lib/python3.8/site-packages/jinja2/environment.py @@ -0,0 +1,1362 @@ +# -*- coding: utf-8 -*- +"""Classes for managing templates and their runtime and compile time +options. +""" +import os +import sys +import weakref +from functools import partial +from functools import reduce + +from markupsafe import Markup + +from . import nodes +from ._compat import encode_filename +from ._compat import implements_iterator +from ._compat import implements_to_string +from ._compat import iteritems +from ._compat import PY2 +from ._compat import PYPY +from ._compat import reraise +from ._compat import string_types +from ._compat import text_type +from .compiler import CodeGenerator +from .compiler import generate +from .defaults import BLOCK_END_STRING +from .defaults import BLOCK_START_STRING +from .defaults import COMMENT_END_STRING +from .defaults import COMMENT_START_STRING +from .defaults import DEFAULT_FILTERS +from .defaults import DEFAULT_NAMESPACE +from .defaults import DEFAULT_POLICIES +from .defaults import DEFAULT_TESTS +from .defaults import KEEP_TRAILING_NEWLINE +from .defaults import LINE_COMMENT_PREFIX +from .defaults import LINE_STATEMENT_PREFIX +from .defaults import LSTRIP_BLOCKS +from .defaults import NEWLINE_SEQUENCE +from .defaults import TRIM_BLOCKS +from .defaults import VARIABLE_END_STRING +from .defaults import VARIABLE_START_STRING +from .exceptions import TemplateNotFound +from .exceptions import TemplateRuntimeError +from .exceptions import TemplatesNotFound +from .exceptions import TemplateSyntaxError +from .exceptions import UndefinedError +from .lexer import get_lexer +from .lexer import TokenStream +from .nodes import EvalContext +from .parser import Parser +from .runtime import Context +from .runtime import new_context +from .runtime import Undefined +from .utils import concat +from .utils import consume +from .utils import have_async_gen +from .utils import import_string +from .utils import internalcode +from .utils import LRUCache +from .utils import missing + +# for direct template usage we have up to ten living environments +_spontaneous_environments = LRUCache(10) + + +def get_spontaneous_environment(cls, *args): + """Return a new spontaneous environment. A spontaneous environment + is used for templates created directly rather than through an + existing environment. + + :param cls: Environment class to create. + :param args: Positional arguments passed to environment. + """ + key = (cls, args) + + try: + return _spontaneous_environments[key] + except KeyError: + _spontaneous_environments[key] = env = cls(*args) + env.shared = True + return env + + +def create_cache(size): + """Return the cache class for the given size.""" + if size == 0: + return None + if size < 0: + return {} + return LRUCache(size) + + +def copy_cache(cache): + """Create an empty copy of the given cache.""" + if cache is None: + return None + elif type(cache) is dict: + return {} + return LRUCache(cache.capacity) + + +def load_extensions(environment, extensions): + """Load the extensions from the list and bind it to the environment. + Returns a dict of instantiated environments. + """ + result = {} + for extension in extensions: + if isinstance(extension, string_types): + extension = import_string(extension) + result[extension.identifier] = extension(environment) + return result + + +def fail_for_missing_callable(string, name): + msg = string % name + if isinstance(name, Undefined): + try: + name._fail_with_undefined_error() + except Exception as e: + msg = "%s (%s; did you forget to quote the callable name?)" % (msg, e) + raise TemplateRuntimeError(msg) + + +def _environment_sanity_check(environment): + """Perform a sanity check on the environment.""" + assert issubclass( + environment.undefined, Undefined + ), "undefined must be a subclass of undefined because filters depend on it." + assert ( + environment.block_start_string + != environment.variable_start_string + != environment.comment_start_string + ), "block, variable and comment start strings must be different" + assert environment.newline_sequence in ( + "\r", + "\r\n", + "\n", + ), "newline_sequence set to unknown line ending string." + return environment + + +class Environment(object): + r"""The core component of Jinja is the `Environment`. It contains + important shared variables like configuration, filters, tests, + globals and others. Instances of this class may be modified if + they are not shared and if no template was loaded so far. + Modifications on environments after the first template was loaded + will lead to surprising effects and undefined behavior. + + Here are the possible initialization parameters: + + `block_start_string` + The string marking the beginning of a block. Defaults to ``'{%'``. + + `block_end_string` + The string marking the end of a block. Defaults to ``'%}'``. + + `variable_start_string` + The string marking the beginning of a print statement. + Defaults to ``'{{'``. + + `variable_end_string` + The string marking the end of a print statement. Defaults to + ``'}}'``. + + `comment_start_string` + The string marking the beginning of a comment. Defaults to ``'{#'``. + + `comment_end_string` + The string marking the end of a comment. Defaults to ``'#}'``. + + `line_statement_prefix` + If given and a string, this will be used as prefix for line based + statements. See also :ref:`line-statements`. + + `line_comment_prefix` + If given and a string, this will be used as prefix for line based + comments. See also :ref:`line-statements`. + + .. versionadded:: 2.2 + + `trim_blocks` + If this is set to ``True`` the first newline after a block is + removed (block, not variable tag!). Defaults to `False`. + + `lstrip_blocks` + If this is set to ``True`` leading spaces and tabs are stripped + from the start of a line to a block. Defaults to `False`. + + `newline_sequence` + The sequence that starts a newline. Must be one of ``'\r'``, + ``'\n'`` or ``'\r\n'``. The default is ``'\n'`` which is a + useful default for Linux and OS X systems as well as web + applications. + + `keep_trailing_newline` + Preserve the trailing newline when rendering templates. + The default is ``False``, which causes a single newline, + if present, to be stripped from the end of the template. + + .. versionadded:: 2.7 + + `extensions` + List of Jinja extensions to use. This can either be import paths + as strings or extension classes. For more information have a + look at :ref:`the extensions documentation `. + + `optimized` + should the optimizer be enabled? Default is ``True``. + + `undefined` + :class:`Undefined` or a subclass of it that is used to represent + undefined values in the template. + + `finalize` + A callable that can be used to process the result of a variable + expression before it is output. For example one can convert + ``None`` implicitly into an empty string here. + + `autoescape` + If set to ``True`` the XML/HTML autoescaping feature is enabled by + default. For more details about autoescaping see + :class:`~markupsafe.Markup`. As of Jinja 2.4 this can also + be a callable that is passed the template name and has to + return ``True`` or ``False`` depending on autoescape should be + enabled by default. + + .. versionchanged:: 2.4 + `autoescape` can now be a function + + `loader` + The template loader for this environment. + + `cache_size` + The size of the cache. Per default this is ``400`` which means + that if more than 400 templates are loaded the loader will clean + out the least recently used template. If the cache size is set to + ``0`` templates are recompiled all the time, if the cache size is + ``-1`` the cache will not be cleaned. + + .. versionchanged:: 2.8 + The cache size was increased to 400 from a low 50. + + `auto_reload` + Some loaders load templates from locations where the template + sources may change (ie: file system or database). If + ``auto_reload`` is set to ``True`` (default) every time a template is + requested the loader checks if the source changed and if yes, it + will reload the template. For higher performance it's possible to + disable that. + + `bytecode_cache` + If set to a bytecode cache object, this object will provide a + cache for the internal Jinja bytecode so that templates don't + have to be parsed if they were not changed. + + See :ref:`bytecode-cache` for more information. + + `enable_async` + If set to true this enables async template execution which allows + you to take advantage of newer Python features. This requires + Python 3.6 or later. + """ + + #: if this environment is sandboxed. Modifying this variable won't make + #: the environment sandboxed though. For a real sandboxed environment + #: have a look at jinja2.sandbox. This flag alone controls the code + #: generation by the compiler. + sandboxed = False + + #: True if the environment is just an overlay + overlayed = False + + #: the environment this environment is linked to if it is an overlay + linked_to = None + + #: shared environments have this set to `True`. A shared environment + #: must not be modified + shared = False + + #: the class that is used for code generation. See + #: :class:`~jinja2.compiler.CodeGenerator` for more information. + code_generator_class = CodeGenerator + + #: the context class thatis used for templates. See + #: :class:`~jinja2.runtime.Context` for more information. + context_class = Context + + def __init__( + self, + block_start_string=BLOCK_START_STRING, + block_end_string=BLOCK_END_STRING, + variable_start_string=VARIABLE_START_STRING, + variable_end_string=VARIABLE_END_STRING, + comment_start_string=COMMENT_START_STRING, + comment_end_string=COMMENT_END_STRING, + line_statement_prefix=LINE_STATEMENT_PREFIX, + line_comment_prefix=LINE_COMMENT_PREFIX, + trim_blocks=TRIM_BLOCKS, + lstrip_blocks=LSTRIP_BLOCKS, + newline_sequence=NEWLINE_SEQUENCE, + keep_trailing_newline=KEEP_TRAILING_NEWLINE, + extensions=(), + optimized=True, + undefined=Undefined, + finalize=None, + autoescape=False, + loader=None, + cache_size=400, + auto_reload=True, + bytecode_cache=None, + enable_async=False, + ): + # !!Important notice!! + # The constructor accepts quite a few arguments that should be + # passed by keyword rather than position. However it's important to + # not change the order of arguments because it's used at least + # internally in those cases: + # - spontaneous environments (i18n extension and Template) + # - unittests + # If parameter changes are required only add parameters at the end + # and don't change the arguments (or the defaults!) of the arguments + # existing already. + + # lexer / parser information + self.block_start_string = block_start_string + self.block_end_string = block_end_string + self.variable_start_string = variable_start_string + self.variable_end_string = variable_end_string + self.comment_start_string = comment_start_string + self.comment_end_string = comment_end_string + self.line_statement_prefix = line_statement_prefix + self.line_comment_prefix = line_comment_prefix + self.trim_blocks = trim_blocks + self.lstrip_blocks = lstrip_blocks + self.newline_sequence = newline_sequence + self.keep_trailing_newline = keep_trailing_newline + + # runtime information + self.undefined = undefined + self.optimized = optimized + self.finalize = finalize + self.autoescape = autoescape + + # defaults + self.filters = DEFAULT_FILTERS.copy() + self.tests = DEFAULT_TESTS.copy() + self.globals = DEFAULT_NAMESPACE.copy() + + # set the loader provided + self.loader = loader + self.cache = create_cache(cache_size) + self.bytecode_cache = bytecode_cache + self.auto_reload = auto_reload + + # configurable policies + self.policies = DEFAULT_POLICIES.copy() + + # load extensions + self.extensions = load_extensions(self, extensions) + + self.enable_async = enable_async + self.is_async = self.enable_async and have_async_gen + if self.is_async: + # runs patch_all() to enable async support + from . import asyncsupport # noqa: F401 + + _environment_sanity_check(self) + + def add_extension(self, extension): + """Adds an extension after the environment was created. + + .. versionadded:: 2.5 + """ + self.extensions.update(load_extensions(self, [extension])) + + def extend(self, **attributes): + """Add the items to the instance of the environment if they do not exist + yet. This is used by :ref:`extensions ` to register + callbacks and configuration values without breaking inheritance. + """ + for key, value in iteritems(attributes): + if not hasattr(self, key): + setattr(self, key, value) + + def overlay( + self, + block_start_string=missing, + block_end_string=missing, + variable_start_string=missing, + variable_end_string=missing, + comment_start_string=missing, + comment_end_string=missing, + line_statement_prefix=missing, + line_comment_prefix=missing, + trim_blocks=missing, + lstrip_blocks=missing, + extensions=missing, + optimized=missing, + undefined=missing, + finalize=missing, + autoescape=missing, + loader=missing, + cache_size=missing, + auto_reload=missing, + bytecode_cache=missing, + ): + """Create a new overlay environment that shares all the data with the + current environment except for cache and the overridden attributes. + Extensions cannot be removed for an overlayed environment. An overlayed + environment automatically gets all the extensions of the environment it + is linked to plus optional extra extensions. + + Creating overlays should happen after the initial environment was set + up completely. Not all attributes are truly linked, some are just + copied over so modifications on the original environment may not shine + through. + """ + args = dict(locals()) + del args["self"], args["cache_size"], args["extensions"] + + rv = object.__new__(self.__class__) + rv.__dict__.update(self.__dict__) + rv.overlayed = True + rv.linked_to = self + + for key, value in iteritems(args): + if value is not missing: + setattr(rv, key, value) + + if cache_size is not missing: + rv.cache = create_cache(cache_size) + else: + rv.cache = copy_cache(self.cache) + + rv.extensions = {} + for key, value in iteritems(self.extensions): + rv.extensions[key] = value.bind(rv) + if extensions is not missing: + rv.extensions.update(load_extensions(rv, extensions)) + + return _environment_sanity_check(rv) + + lexer = property(get_lexer, doc="The lexer for this environment.") + + def iter_extensions(self): + """Iterates over the extensions by priority.""" + return iter(sorted(self.extensions.values(), key=lambda x: x.priority)) + + def getitem(self, obj, argument): + """Get an item or attribute of an object but prefer the item.""" + try: + return obj[argument] + except (AttributeError, TypeError, LookupError): + if isinstance(argument, string_types): + try: + attr = str(argument) + except Exception: + pass + else: + try: + return getattr(obj, attr) + except AttributeError: + pass + return self.undefined(obj=obj, name=argument) + + def getattr(self, obj, attribute): + """Get an item or attribute of an object but prefer the attribute. + Unlike :meth:`getitem` the attribute *must* be a bytestring. + """ + try: + return getattr(obj, attribute) + except AttributeError: + pass + try: + return obj[attribute] + except (TypeError, LookupError, AttributeError): + return self.undefined(obj=obj, name=attribute) + + def call_filter( + self, name, value, args=None, kwargs=None, context=None, eval_ctx=None + ): + """Invokes a filter on a value the same way the compiler does it. + + Note that on Python 3 this might return a coroutine in case the + filter is running from an environment in async mode and the filter + supports async execution. It's your responsibility to await this + if needed. + + .. versionadded:: 2.7 + """ + func = self.filters.get(name) + if func is None: + fail_for_missing_callable("no filter named %r", name) + args = [value] + list(args or ()) + if getattr(func, "contextfilter", False) is True: + if context is None: + raise TemplateRuntimeError( + "Attempted to invoke context filter without context" + ) + args.insert(0, context) + elif getattr(func, "evalcontextfilter", False) is True: + if eval_ctx is None: + if context is not None: + eval_ctx = context.eval_ctx + else: + eval_ctx = EvalContext(self) + args.insert(0, eval_ctx) + elif getattr(func, "environmentfilter", False) is True: + args.insert(0, self) + return func(*args, **(kwargs or {})) + + def call_test(self, name, value, args=None, kwargs=None): + """Invokes a test on a value the same way the compiler does it. + + .. versionadded:: 2.7 + """ + func = self.tests.get(name) + if func is None: + fail_for_missing_callable("no test named %r", name) + return func(value, *(args or ()), **(kwargs or {})) + + @internalcode + def parse(self, source, name=None, filename=None): + """Parse the sourcecode and return the abstract syntax tree. This + tree of nodes is used by the compiler to convert the template into + executable source- or bytecode. This is useful for debugging or to + extract information from templates. + + If you are :ref:`developing Jinja extensions ` + this gives you a good overview of the node tree generated. + """ + try: + return self._parse(source, name, filename) + except TemplateSyntaxError: + self.handle_exception(source=source) + + def _parse(self, source, name, filename): + """Internal parsing function used by `parse` and `compile`.""" + return Parser(self, source, name, encode_filename(filename)).parse() + + def lex(self, source, name=None, filename=None): + """Lex the given sourcecode and return a generator that yields + tokens as tuples in the form ``(lineno, token_type, value)``. + This can be useful for :ref:`extension development ` + and debugging templates. + + This does not perform preprocessing. If you want the preprocessing + of the extensions to be applied you have to filter source through + the :meth:`preprocess` method. + """ + source = text_type(source) + try: + return self.lexer.tokeniter(source, name, filename) + except TemplateSyntaxError: + self.handle_exception(source=source) + + def preprocess(self, source, name=None, filename=None): + """Preprocesses the source with all extensions. This is automatically + called for all parsing and compiling methods but *not* for :meth:`lex` + because there you usually only want the actual source tokenized. + """ + return reduce( + lambda s, e: e.preprocess(s, name, filename), + self.iter_extensions(), + text_type(source), + ) + + def _tokenize(self, source, name, filename=None, state=None): + """Called by the parser to do the preprocessing and filtering + for all the extensions. Returns a :class:`~jinja2.lexer.TokenStream`. + """ + source = self.preprocess(source, name, filename) + stream = self.lexer.tokenize(source, name, filename, state) + for ext in self.iter_extensions(): + stream = ext.filter_stream(stream) + if not isinstance(stream, TokenStream): + stream = TokenStream(stream, name, filename) + return stream + + def _generate(self, source, name, filename, defer_init=False): + """Internal hook that can be overridden to hook a different generate + method in. + + .. versionadded:: 2.5 + """ + return generate( + source, + self, + name, + filename, + defer_init=defer_init, + optimized=self.optimized, + ) + + def _compile(self, source, filename): + """Internal hook that can be overridden to hook a different compile + method in. + + .. versionadded:: 2.5 + """ + return compile(source, filename, "exec") + + @internalcode + def compile(self, source, name=None, filename=None, raw=False, defer_init=False): + """Compile a node or template source code. The `name` parameter is + the load name of the template after it was joined using + :meth:`join_path` if necessary, not the filename on the file system. + the `filename` parameter is the estimated filename of the template on + the file system. If the template came from a database or memory this + can be omitted. + + The return value of this method is a python code object. If the `raw` + parameter is `True` the return value will be a string with python + code equivalent to the bytecode returned otherwise. This method is + mainly used internally. + + `defer_init` is use internally to aid the module code generator. This + causes the generated code to be able to import without the global + environment variable to be set. + + .. versionadded:: 2.4 + `defer_init` parameter added. + """ + source_hint = None + try: + if isinstance(source, string_types): + source_hint = source + source = self._parse(source, name, filename) + source = self._generate(source, name, filename, defer_init=defer_init) + if raw: + return source + if filename is None: + filename = "