├── .idea
├── Compiler.iml
├── misc.xml
├── modules.xml
└── workspace.xml
├── 123.txt
├── Code.txt
├── Lexical_analysis.py
├── Parser.py
├── README.md
├── Semantic_analysis.py
├── Trans_to_assembly.py
├── __pycache__
├── Lexical_analysis.cpython-38.pyc
├── Parser.cpython-38.pyc
└── Semantic_analysis.cpython-38.pyc
├── grammer.txt
├── test.py
└── venv
├── Lib
└── site-packages
│ ├── easy-install.pth
│ ├── pip-9.0.1-py3.8.egg
│ ├── EGG-INFO
│ │ ├── PKG-INFO
│ │ ├── SOURCES.txt
│ │ ├── dependency_links.txt
│ │ ├── entry_points.txt
│ │ ├── not-zip-safe
│ │ ├── requires.txt
│ │ └── top_level.txt
│ └── pip
│ │ ├── __init__.py
│ │ ├── __main__.py
│ │ ├── __pycache__
│ │ ├── __init__.cpython-38.pyc
│ │ ├── basecommand.cpython-38.pyc
│ │ ├── baseparser.cpython-38.pyc
│ │ ├── cmdoptions.cpython-38.pyc
│ │ ├── download.cpython-38.pyc
│ │ ├── exceptions.cpython-38.pyc
│ │ ├── index.cpython-38.pyc
│ │ ├── locations.cpython-38.pyc
│ │ ├── pep425tags.cpython-38.pyc
│ │ ├── status_codes.cpython-38.pyc
│ │ └── wheel.cpython-38.pyc
│ │ ├── _vendor
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-38.pyc
│ │ │ ├── appdirs.cpython-38.pyc
│ │ │ ├── pyparsing.cpython-38.pyc
│ │ │ ├── retrying.cpython-38.pyc
│ │ │ └── six.cpython-38.pyc
│ │ ├── appdirs.py
│ │ ├── cachecontrol
│ │ │ ├── __init__.py
│ │ │ ├── __pycache__
│ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ ├── adapter.cpython-38.pyc
│ │ │ │ ├── cache.cpython-38.pyc
│ │ │ │ ├── compat.cpython-38.pyc
│ │ │ │ ├── controller.cpython-38.pyc
│ │ │ │ ├── filewrapper.cpython-38.pyc
│ │ │ │ ├── serialize.cpython-38.pyc
│ │ │ │ └── wrapper.cpython-38.pyc
│ │ │ ├── _cmd.py
│ │ │ ├── adapter.py
│ │ │ ├── cache.py
│ │ │ ├── caches
│ │ │ │ ├── __init__.py
│ │ │ │ ├── __pycache__
│ │ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ │ └── file_cache.cpython-38.pyc
│ │ │ │ ├── file_cache.py
│ │ │ │ └── redis_cache.py
│ │ │ ├── compat.py
│ │ │ ├── controller.py
│ │ │ ├── filewrapper.py
│ │ │ ├── heuristics.py
│ │ │ ├── serialize.py
│ │ │ └── wrapper.py
│ │ ├── colorama
│ │ │ ├── __init__.py
│ │ │ ├── __pycache__
│ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ ├── ansi.cpython-38.pyc
│ │ │ │ ├── ansitowin32.cpython-38.pyc
│ │ │ │ ├── initialise.cpython-38.pyc
│ │ │ │ ├── win32.cpython-38.pyc
│ │ │ │ └── winterm.cpython-38.pyc
│ │ │ ├── ansi.py
│ │ │ ├── ansitowin32.py
│ │ │ ├── initialise.py
│ │ │ ├── win32.py
│ │ │ └── winterm.py
│ │ ├── distlib
│ │ │ ├── __init__.py
│ │ │ ├── __pycache__
│ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ ├── compat.cpython-38.pyc
│ │ │ │ ├── resources.cpython-38.pyc
│ │ │ │ ├── scripts.cpython-38.pyc
│ │ │ │ └── util.cpython-38.pyc
│ │ │ ├── _backport
│ │ │ │ ├── __init__.py
│ │ │ │ ├── misc.py
│ │ │ │ ├── shutil.py
│ │ │ │ ├── sysconfig.cfg
│ │ │ │ ├── sysconfig.py
│ │ │ │ └── tarfile.py
│ │ │ ├── compat.py
│ │ │ ├── database.py
│ │ │ ├── index.py
│ │ │ ├── locators.py
│ │ │ ├── manifest.py
│ │ │ ├── markers.py
│ │ │ ├── metadata.py
│ │ │ ├── resources.py
│ │ │ ├── scripts.py
│ │ │ ├── t32.exe
│ │ │ ├── t64.exe
│ │ │ ├── util.py
│ │ │ ├── version.py
│ │ │ ├── w32.exe
│ │ │ ├── w64.exe
│ │ │ └── wheel.py
│ │ ├── distro.py
│ │ ├── html5lib
│ │ │ ├── __init__.py
│ │ │ ├── __pycache__
│ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ ├── _inputstream.cpython-38.pyc
│ │ │ │ ├── _tokenizer.cpython-38.pyc
│ │ │ │ ├── _utils.cpython-38.pyc
│ │ │ │ ├── constants.cpython-38.pyc
│ │ │ │ ├── html5parser.cpython-38.pyc
│ │ │ │ └── serializer.cpython-38.pyc
│ │ │ ├── _ihatexml.py
│ │ │ ├── _inputstream.py
│ │ │ ├── _tokenizer.py
│ │ │ ├── _trie
│ │ │ │ ├── __init__.py
│ │ │ │ ├── __pycache__
│ │ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ │ ├── _base.cpython-38.pyc
│ │ │ │ │ ├── datrie.cpython-38.pyc
│ │ │ │ │ └── py.cpython-38.pyc
│ │ │ │ ├── _base.py
│ │ │ │ ├── datrie.py
│ │ │ │ └── py.py
│ │ │ ├── _utils.py
│ │ │ ├── constants.py
│ │ │ ├── filters
│ │ │ │ ├── __init__.py
│ │ │ │ ├── alphabeticalattributes.py
│ │ │ │ ├── base.py
│ │ │ │ ├── inject_meta_charset.py
│ │ │ │ ├── lint.py
│ │ │ │ ├── optionaltags.py
│ │ │ │ ├── sanitizer.py
│ │ │ │ └── whitespace.py
│ │ │ ├── html5parser.py
│ │ │ ├── serializer.py
│ │ │ ├── treeadapters
│ │ │ │ ├── __init__.py
│ │ │ │ ├── genshi.py
│ │ │ │ └── sax.py
│ │ │ ├── treebuilders
│ │ │ │ ├── __init__.py
│ │ │ │ ├── __pycache__
│ │ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ │ └── base.cpython-38.pyc
│ │ │ │ ├── base.py
│ │ │ │ ├── dom.py
│ │ │ │ ├── etree.py
│ │ │ │ └── etree_lxml.py
│ │ │ └── treewalkers
│ │ │ │ ├── __init__.py
│ │ │ │ ├── __pycache__
│ │ │ │ └── __init__.cpython-38.pyc
│ │ │ │ ├── base.py
│ │ │ │ ├── dom.py
│ │ │ │ ├── etree.py
│ │ │ │ ├── etree_lxml.py
│ │ │ │ └── genshi.py
│ │ ├── ipaddress.py
│ │ ├── lockfile
│ │ │ ├── __init__.py
│ │ │ ├── __pycache__
│ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ ├── linklockfile.cpython-38.pyc
│ │ │ │ └── mkdirlockfile.cpython-38.pyc
│ │ │ ├── linklockfile.py
│ │ │ ├── mkdirlockfile.py
│ │ │ ├── pidlockfile.py
│ │ │ ├── sqlitelockfile.py
│ │ │ └── symlinklockfile.py
│ │ ├── ordereddict.py
│ │ ├── packaging
│ │ │ ├── __about__.py
│ │ │ ├── __init__.py
│ │ │ ├── __pycache__
│ │ │ │ ├── __about__.cpython-38.pyc
│ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ ├── _compat.cpython-38.pyc
│ │ │ │ ├── _structures.cpython-38.pyc
│ │ │ │ ├── markers.cpython-38.pyc
│ │ │ │ ├── requirements.cpython-38.pyc
│ │ │ │ ├── specifiers.cpython-38.pyc
│ │ │ │ ├── utils.cpython-38.pyc
│ │ │ │ └── version.cpython-38.pyc
│ │ │ ├── _compat.py
│ │ │ ├── _structures.py
│ │ │ ├── markers.py
│ │ │ ├── requirements.py
│ │ │ ├── specifiers.py
│ │ │ ├── utils.py
│ │ │ └── version.py
│ │ ├── pkg_resources
│ │ │ ├── __init__.py
│ │ │ └── __pycache__
│ │ │ │ └── __init__.cpython-38.pyc
│ │ ├── progress
│ │ │ ├── __init__.py
│ │ │ ├── __pycache__
│ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ ├── bar.cpython-38.pyc
│ │ │ │ ├── helpers.cpython-38.pyc
│ │ │ │ └── spinner.cpython-38.pyc
│ │ │ ├── bar.py
│ │ │ ├── counter.py
│ │ │ ├── helpers.py
│ │ │ └── spinner.py
│ │ ├── pyparsing.py
│ │ ├── re-vendor.py
│ │ ├── requests
│ │ │ ├── __init__.py
│ │ │ ├── __pycache__
│ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ ├── adapters.cpython-38.pyc
│ │ │ │ ├── api.cpython-38.pyc
│ │ │ │ ├── auth.cpython-38.pyc
│ │ │ │ ├── certs.cpython-38.pyc
│ │ │ │ ├── compat.cpython-38.pyc
│ │ │ │ ├── cookies.cpython-38.pyc
│ │ │ │ ├── exceptions.cpython-38.pyc
│ │ │ │ ├── hooks.cpython-38.pyc
│ │ │ │ ├── models.cpython-38.pyc
│ │ │ │ ├── sessions.cpython-38.pyc
│ │ │ │ ├── status_codes.cpython-38.pyc
│ │ │ │ ├── structures.cpython-38.pyc
│ │ │ │ └── utils.cpython-38.pyc
│ │ │ ├── adapters.py
│ │ │ ├── api.py
│ │ │ ├── auth.py
│ │ │ ├── cacert.pem
│ │ │ ├── certs.py
│ │ │ ├── compat.py
│ │ │ ├── cookies.py
│ │ │ ├── exceptions.py
│ │ │ ├── hooks.py
│ │ │ ├── models.py
│ │ │ ├── packages
│ │ │ │ ├── __init__.py
│ │ │ │ ├── __pycache__
│ │ │ │ │ └── __init__.cpython-38.pyc
│ │ │ │ ├── chardet
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── __pycache__
│ │ │ │ │ │ └── __init__.cpython-38.pyc
│ │ │ │ │ ├── big5freq.py
│ │ │ │ │ ├── big5prober.py
│ │ │ │ │ ├── chardetect.py
│ │ │ │ │ ├── chardistribution.py
│ │ │ │ │ ├── charsetgroupprober.py
│ │ │ │ │ ├── charsetprober.py
│ │ │ │ │ ├── codingstatemachine.py
│ │ │ │ │ ├── compat.py
│ │ │ │ │ ├── constants.py
│ │ │ │ │ ├── cp949prober.py
│ │ │ │ │ ├── escprober.py
│ │ │ │ │ ├── escsm.py
│ │ │ │ │ ├── eucjpprober.py
│ │ │ │ │ ├── euckrfreq.py
│ │ │ │ │ ├── euckrprober.py
│ │ │ │ │ ├── euctwfreq.py
│ │ │ │ │ ├── euctwprober.py
│ │ │ │ │ ├── gb2312freq.py
│ │ │ │ │ ├── gb2312prober.py
│ │ │ │ │ ├── hebrewprober.py
│ │ │ │ │ ├── jisfreq.py
│ │ │ │ │ ├── jpcntx.py
│ │ │ │ │ ├── langbulgarianmodel.py
│ │ │ │ │ ├── langcyrillicmodel.py
│ │ │ │ │ ├── langgreekmodel.py
│ │ │ │ │ ├── langhebrewmodel.py
│ │ │ │ │ ├── langhungarianmodel.py
│ │ │ │ │ ├── langthaimodel.py
│ │ │ │ │ ├── latin1prober.py
│ │ │ │ │ ├── mbcharsetprober.py
│ │ │ │ │ ├── mbcsgroupprober.py
│ │ │ │ │ ├── mbcssm.py
│ │ │ │ │ ├── sbcharsetprober.py
│ │ │ │ │ ├── sbcsgroupprober.py
│ │ │ │ │ ├── sjisprober.py
│ │ │ │ │ ├── universaldetector.py
│ │ │ │ │ └── utf8prober.py
│ │ │ │ └── urllib3
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── __pycache__
│ │ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ │ ├── _collections.cpython-38.pyc
│ │ │ │ │ ├── connection.cpython-38.pyc
│ │ │ │ │ ├── connectionpool.cpython-38.pyc
│ │ │ │ │ ├── exceptions.cpython-38.pyc
│ │ │ │ │ ├── fields.cpython-38.pyc
│ │ │ │ │ ├── filepost.cpython-38.pyc
│ │ │ │ │ ├── poolmanager.cpython-38.pyc
│ │ │ │ │ ├── request.cpython-38.pyc
│ │ │ │ │ └── response.cpython-38.pyc
│ │ │ │ │ ├── _collections.py
│ │ │ │ │ ├── connection.py
│ │ │ │ │ ├── connectionpool.py
│ │ │ │ │ ├── contrib
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── __pycache__
│ │ │ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ │ │ └── socks.cpython-38.pyc
│ │ │ │ │ ├── appengine.py
│ │ │ │ │ ├── ntlmpool.py
│ │ │ │ │ ├── pyopenssl.py
│ │ │ │ │ └── socks.py
│ │ │ │ │ ├── exceptions.py
│ │ │ │ │ ├── fields.py
│ │ │ │ │ ├── filepost.py
│ │ │ │ │ ├── packages
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── __pycache__
│ │ │ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ │ │ └── six.cpython-38.pyc
│ │ │ │ │ ├── ordered_dict.py
│ │ │ │ │ ├── six.py
│ │ │ │ │ └── ssl_match_hostname
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── __pycache__
│ │ │ │ │ │ └── __init__.cpython-38.pyc
│ │ │ │ │ │ └── _implementation.py
│ │ │ │ │ ├── poolmanager.py
│ │ │ │ │ ├── request.py
│ │ │ │ │ ├── response.py
│ │ │ │ │ └── util
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── __pycache__
│ │ │ │ │ ├── __init__.cpython-38.pyc
│ │ │ │ │ ├── connection.cpython-38.pyc
│ │ │ │ │ ├── request.cpython-38.pyc
│ │ │ │ │ ├── response.cpython-38.pyc
│ │ │ │ │ ├── retry.cpython-38.pyc
│ │ │ │ │ ├── ssl_.cpython-38.pyc
│ │ │ │ │ ├── timeout.cpython-38.pyc
│ │ │ │ │ └── url.cpython-38.pyc
│ │ │ │ │ ├── connection.py
│ │ │ │ │ ├── request.py
│ │ │ │ │ ├── response.py
│ │ │ │ │ ├── retry.py
│ │ │ │ │ ├── ssl_.py
│ │ │ │ │ ├── timeout.py
│ │ │ │ │ └── url.py
│ │ │ ├── sessions.py
│ │ │ ├── status_codes.py
│ │ │ ├── structures.py
│ │ │ └── utils.py
│ │ ├── retrying.py
│ │ ├── six.py
│ │ └── webencodings
│ │ │ ├── __init__.py
│ │ │ ├── __pycache__
│ │ │ ├── __init__.cpython-38.pyc
│ │ │ └── labels.cpython-38.pyc
│ │ │ ├── labels.py
│ │ │ ├── mklabels.py
│ │ │ ├── tests.py
│ │ │ └── x_user_defined.py
│ │ ├── basecommand.py
│ │ ├── baseparser.py
│ │ ├── cmdoptions.py
│ │ ├── commands
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-38.pyc
│ │ │ ├── check.cpython-38.pyc
│ │ │ ├── completion.cpython-38.pyc
│ │ │ ├── download.cpython-38.pyc
│ │ │ ├── freeze.cpython-38.pyc
│ │ │ ├── hash.cpython-38.pyc
│ │ │ ├── help.cpython-38.pyc
│ │ │ ├── install.cpython-38.pyc
│ │ │ ├── list.cpython-38.pyc
│ │ │ ├── search.cpython-38.pyc
│ │ │ ├── show.cpython-38.pyc
│ │ │ ├── uninstall.cpython-38.pyc
│ │ │ └── wheel.cpython-38.pyc
│ │ ├── check.py
│ │ ├── completion.py
│ │ ├── download.py
│ │ ├── freeze.py
│ │ ├── hash.py
│ │ ├── help.py
│ │ ├── install.py
│ │ ├── list.py
│ │ ├── search.py
│ │ ├── show.py
│ │ ├── uninstall.py
│ │ └── wheel.py
│ │ ├── compat
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ └── __init__.cpython-38.pyc
│ │ └── dictconfig.py
│ │ ├── download.py
│ │ ├── exceptions.py
│ │ ├── index.py
│ │ ├── locations.py
│ │ ├── models
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-38.pyc
│ │ │ └── index.cpython-38.pyc
│ │ └── index.py
│ │ ├── operations
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-38.pyc
│ │ │ ├── check.cpython-38.pyc
│ │ │ └── freeze.cpython-38.pyc
│ │ ├── check.py
│ │ └── freeze.py
│ │ ├── pep425tags.py
│ │ ├── req
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-38.pyc
│ │ │ ├── req_file.cpython-38.pyc
│ │ │ ├── req_install.cpython-38.pyc
│ │ │ ├── req_set.cpython-38.pyc
│ │ │ └── req_uninstall.cpython-38.pyc
│ │ ├── req_file.py
│ │ ├── req_install.py
│ │ ├── req_set.py
│ │ └── req_uninstall.py
│ │ ├── status_codes.py
│ │ ├── utils
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-38.pyc
│ │ │ ├── appdirs.cpython-38.pyc
│ │ │ ├── build.cpython-38.pyc
│ │ │ ├── deprecation.cpython-38.pyc
│ │ │ ├── encoding.cpython-38.pyc
│ │ │ ├── filesystem.cpython-38.pyc
│ │ │ ├── glibc.cpython-38.pyc
│ │ │ ├── hashes.cpython-38.pyc
│ │ │ ├── logging.cpython-38.pyc
│ │ │ ├── outdated.cpython-38.pyc
│ │ │ ├── packaging.cpython-38.pyc
│ │ │ ├── setuptools_build.cpython-38.pyc
│ │ │ └── ui.cpython-38.pyc
│ │ ├── appdirs.py
│ │ ├── build.py
│ │ ├── deprecation.py
│ │ ├── encoding.py
│ │ ├── filesystem.py
│ │ ├── glibc.py
│ │ ├── hashes.py
│ │ ├── logging.py
│ │ ├── outdated.py
│ │ ├── packaging.py
│ │ ├── setuptools_build.py
│ │ └── ui.py
│ │ ├── vcs
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-38.pyc
│ │ │ ├── bazaar.cpython-38.pyc
│ │ │ ├── git.cpython-38.pyc
│ │ │ ├── mercurial.cpython-38.pyc
│ │ │ └── subversion.cpython-38.pyc
│ │ ├── bazaar.py
│ │ ├── git.py
│ │ ├── mercurial.py
│ │ └── subversion.py
│ │ └── wheel.py
│ ├── setuptools-28.8.0-py3.8.egg
│ └── setuptools.pth
├── Scripts
├── Activate.ps1
├── activate
├── activate.bat
├── deactivate.bat
├── easy_install-3.8-script.py
├── easy_install-3.8.exe
├── easy_install-script.py
├── easy_install.exe
├── pip-script.py
├── pip.exe
├── pip3-script.py
├── pip3.8-script.py
├── pip3.8.exe
├── pip3.exe
├── python.exe
└── pythonw.exe
├── pip-selfcheck.json
└── pyvenv.cfg
/.idea/Compiler.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/123.txt:
--------------------------------------------------------------------------------
1 | int main(){
2 | int a = 1;
3 | if (a>0)
4 | {
5 | for(a>1;a<10;a++)
6 | {
7 | a=a+10;
8 | }
9 | }else
10 | {
11 | a=a/a;
12 | }
13 |
14 | }
--------------------------------------------------------------------------------
/Code.txt:
--------------------------------------------------------------------------------
1 | int main(){
2 | int a = 1;
3 | if (a>0)
4 | {
5 | for(a>1;a<10;a++)
6 | {
7 | a=a+10;
8 | }
9 | }else
10 | {
11 | a=a/a;
12 | }
13 |
14 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Compiler
2 | 编译原理课设,包括词法分析、语法分析、语义分析、中间代码生成和目标代码生成(使用LL(1)分析法,将C语言翻译成汇编语言)
3 | code.txt 为输入
4 | grammer.txt为文法
5 | Lexical_analysis.py为词法分析
6 | Parser.py为语法分析(LL(1))
7 | Semantic_analysis.py为语义分析并生成中间代码(四元式)
8 | Trans_to_assembly.py为目标代码生成(汇编语言)
9 | 只能编译一些简单的语句
10 |
--------------------------------------------------------------------------------
/__pycache__/Lexical_analysis.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/__pycache__/Lexical_analysis.cpython-38.pyc
--------------------------------------------------------------------------------
/__pycache__/Parser.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/__pycache__/Parser.cpython-38.pyc
--------------------------------------------------------------------------------
/__pycache__/Semantic_analysis.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/__pycache__/Semantic_analysis.cpython-38.pyc
--------------------------------------------------------------------------------
/grammer.txt:
--------------------------------------------------------------------------------
1 | <开始> ::=< 数据类型 >< 标识符 > <(><)><{> <语句列表>< }>
2 | <语句列表>::=<{> <语句列表>< }>
3 | < 数据类型 >::=
4 | < 数据类型 >::=
5 | < 标识符 >::=
6 | < 语句列表 >::=< 语句 >< 语句列表 >
7 | < 语句列表 >::=< 空 >
8 | < 语句 > ::= <声明语句><;>
9 | < 语句 > ::= <赋值语句><;>
10 | < 语句 > ::= <条件语句>
11 | < 语句 > ::=
12 | < 语句 > ::=
13 | < 语句 > ::= < 输入语句 >
14 | < 语句 > ::= < 输出语句 >
15 | < 声明语句 > ::= < 数据类型 >< 声明语句2 ><声明语句3>
16 | < 声明语句2 >::=<赋值语句>
17 | < 声明语句3> ::= <,><声明语句2>
18 | < 声明语句3> ::= <空>
19 | <赋值语句>::=<标识符><赋值语句1>
20 | <赋值语句1>::= <赋值语句2>
21 | <赋值语句1>::=<空>
22 | < 赋值语句2 > ::= <=> <表达式>
23 | < 赋值语句2 > ::= <++>
24 | < 赋值语句2> ::= <-->
25 | < 赋值语句2> ::=<表达式>
26 | <表达式> ::= <左项><运算符1>
27 | <运算符1>::=<运算符><右项>
28 | <运算符1> ::= <空>
29 | <左项> ::= <常量>
30 | <左项> ::= <标识符>
31 | <右项>::=<左项><左项1>
32 | <左项1> ::= <空>
33 | <左项1>::=<运算符> <右项>
34 | <右项> ::= <空>
35 | <运算符> ::=
36 | < 常量 > ::=
37 | < 常量 > ::=
38 | < 条件语句 > ::= <(> <条件式> <)><{> < 语句列表 ><}><条件语句2>
39 | < 条件语句2 > ::= < 空 >
40 | < 条件语句2 > ::= <{>< 语句列表 ><}>
41 | < 条件式 > ::= < 条件式 >
42 | < 条件式 > ::= < 赋值语句 >
43 | < for循环 > ::= <(> <赋值语句><;><条件式> <;><赋值语句> <)><{>< 语句列表 ><}>
44 | < while循环 > ::= <( ><条件式> <)> <{>< 语句列表 ><}>
45 | < 输入语句 > ::= <(> <,> <标识符> <)><;>
46 | < 输出语句 > ::= <(>< STRING> <,> <标识符> <)><;>
47 | <常量> = <-><常量>
--------------------------------------------------------------------------------
/test.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/test.py
--------------------------------------------------------------------------------
/venv/Lib/site-packages/easy-install.pth:
--------------------------------------------------------------------------------
1 | ./setuptools-28.8.0-py3.8.egg
2 | ./pip-9.0.1-py3.8.egg
3 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/EGG-INFO/PKG-INFO:
--------------------------------------------------------------------------------
1 | Metadata-Version: 1.2
2 | Name: pip
3 | Version: 9.0.1
4 | Summary: The PyPA recommended tool for installing Python packages.
5 | Home-page: https://pip.pypa.io/
6 | Author: The pip developers
7 | Author-email: python-virtualenv@groups.google.com
8 | License: MIT
9 | Description: pip
10 | ===
11 |
12 | The `PyPA recommended
13 | `_
14 | tool for installing Python packages.
15 |
16 | * `Installation `_
17 | * `Documentation `_
18 | * `Changelog `_
19 | * `Github Page `_
20 | * `Issue Tracking `_
21 | * `User mailing list `_
22 | * `Dev mailing list `_
23 | * User IRC: #pypa on Freenode.
24 | * Dev IRC: #pypa-dev on Freenode.
25 |
26 |
27 | .. image:: https://img.shields.io/pypi/v/pip.svg
28 | :target: https://pypi.python.org/pypi/pip
29 |
30 | .. image:: https://img.shields.io/travis/pypa/pip/master.svg
31 | :target: http://travis-ci.org/pypa/pip
32 |
33 | .. image:: https://img.shields.io/appveyor/ci/pypa/pip.svg
34 | :target: https://ci.appveyor.com/project/pypa/pip/history
35 |
36 | .. image:: https://readthedocs.org/projects/pip/badge/?version=stable
37 | :target: https://pip.pypa.io/en/stable
38 |
39 | Code of Conduct
40 | ---------------
41 |
42 | Everyone interacting in the pip project's codebases, issue trackers, chat
43 | rooms, and mailing lists is expected to follow the `PyPA Code of Conduct`_.
44 |
45 | .. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/
46 |
47 | Keywords: easy_install distutils setuptools egg virtualenv
48 | Platform: UNKNOWN
49 | Classifier: Development Status :: 5 - Production/Stable
50 | Classifier: Intended Audience :: Developers
51 | Classifier: License :: OSI Approved :: MIT License
52 | Classifier: Topic :: Software Development :: Build Tools
53 | Classifier: Programming Language :: Python :: 2
54 | Classifier: Programming Language :: Python :: 2.6
55 | Classifier: Programming Language :: Python :: 2.7
56 | Classifier: Programming Language :: Python :: 3
57 | Classifier: Programming Language :: Python :: 3.3
58 | Classifier: Programming Language :: Python :: 3.4
59 | Classifier: Programming Language :: Python :: 3.5
60 | Classifier: Programming Language :: Python :: Implementation :: PyPy
61 | Requires-Python: >=2.6,!=3.0.*,!=3.1.*,!=3.2.*
62 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/EGG-INFO/dependency_links.txt:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/EGG-INFO/entry_points.txt:
--------------------------------------------------------------------------------
1 | [console_scripts]
2 | pip = pip:main
3 | pip3 = pip:main
4 | pip3.8 = pip:main
5 |
6 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/EGG-INFO/not-zip-safe:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/EGG-INFO/requires.txt:
--------------------------------------------------------------------------------
1 |
2 | [testing]
3 | pytest
4 | virtualenv>=1.10
5 | scripttest>=1.3
6 | mock
7 | pretend
8 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/EGG-INFO/top_level.txt:
--------------------------------------------------------------------------------
1 | pip
2 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__main__.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 |
3 | import os
4 | import sys
5 |
6 | # If we are running from a wheel, add the wheel to sys.path
7 | # This allows the usage python pip-*.whl/pip install pip-*.whl
8 | if __package__ == '':
9 | # __file__ is pip-*.whl/pip/__main__.py
10 | # first dirname call strips of '/__main__.py', second strips off '/pip'
11 | # Resulting path is the name of the wheel itself
12 | # Add that to sys.path so we can import pip
13 | path = os.path.dirname(os.path.dirname(__file__))
14 | sys.path.insert(0, path)
15 |
16 | import pip # noqa
17 |
18 | if __name__ == '__main__':
19 | sys.exit(pip.main())
20 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/basecommand.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/basecommand.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/baseparser.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/baseparser.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/cmdoptions.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/cmdoptions.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/download.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/download.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/exceptions.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/exceptions.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/index.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/index.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/locations.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/locations.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/pep425tags.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/pep425tags.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/status_codes.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/status_codes.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/wheel.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/__pycache__/wheel.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/__pycache__/appdirs.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/__pycache__/appdirs.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/__pycache__/pyparsing.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/__pycache__/pyparsing.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/__pycache__/retrying.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/__pycache__/retrying.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/__pycache__/six.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/__pycache__/six.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/__init__.py:
--------------------------------------------------------------------------------
1 | """CacheControl import Interface.
2 |
3 | Make it easy to import from cachecontrol without long namespaces.
4 | """
5 | __author__ = 'Eric Larson'
6 | __email__ = 'eric@ionrock.org'
7 | __version__ = '0.11.7'
8 |
9 | from .wrapper import CacheControl
10 | from .adapter import CacheControlAdapter
11 | from .controller import CacheController
12 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/__pycache__/adapter.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/__pycache__/adapter.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/__pycache__/cache.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/__pycache__/cache.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/__pycache__/compat.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/__pycache__/compat.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/__pycache__/controller.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/__pycache__/controller.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/__pycache__/filewrapper.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/__pycache__/filewrapper.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/__pycache__/serialize.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/__pycache__/serialize.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/__pycache__/wrapper.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/__pycache__/wrapper.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/_cmd.py:
--------------------------------------------------------------------------------
1 | import logging
2 |
3 | from pip._vendor import requests
4 |
5 | from pip._vendor.cachecontrol.adapter import CacheControlAdapter
6 | from pip._vendor.cachecontrol.cache import DictCache
7 | from pip._vendor.cachecontrol.controller import logger
8 |
9 | from argparse import ArgumentParser
10 |
11 |
12 | def setup_logging():
13 | logger.setLevel(logging.DEBUG)
14 | handler = logging.StreamHandler()
15 | logger.addHandler(handler)
16 |
17 |
18 | def get_session():
19 | adapter = CacheControlAdapter(
20 | DictCache(),
21 | cache_etags=True,
22 | serializer=None,
23 | heuristic=None,
24 | )
25 | sess = requests.Session()
26 | sess.mount('http://', adapter)
27 | sess.mount('https://', adapter)
28 |
29 | sess.cache_controller = adapter.controller
30 | return sess
31 |
32 |
33 | def get_args():
34 | parser = ArgumentParser()
35 | parser.add_argument('url', help='The URL to try and cache')
36 | return parser.parse_args()
37 |
38 |
39 | def main(args=None):
40 | args = get_args()
41 | sess = get_session()
42 |
43 | # Make a request to get a response
44 | resp = sess.get(args.url)
45 |
46 | # Turn on logging
47 | setup_logging()
48 |
49 | # try setting the cache
50 | sess.cache_controller.cache_response(resp.request, resp.raw)
51 |
52 | # Now try to get it
53 | if sess.cache_controller.cached_request(resp.request):
54 | print('Cached!')
55 | else:
56 | print('Not cached :(')
57 |
58 |
59 | if __name__ == '__main__':
60 | main()
61 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/cache.py:
--------------------------------------------------------------------------------
1 | """
2 | The cache object API for implementing caches. The default is a thread
3 | safe in-memory dictionary.
4 | """
5 | from threading import Lock
6 |
7 |
8 | class BaseCache(object):
9 |
10 | def get(self, key):
11 | raise NotImplemented()
12 |
13 | def set(self, key, value):
14 | raise NotImplemented()
15 |
16 | def delete(self, key):
17 | raise NotImplemented()
18 |
19 | def close(self):
20 | pass
21 |
22 |
23 | class DictCache(BaseCache):
24 |
25 | def __init__(self, init_dict=None):
26 | self.lock = Lock()
27 | self.data = init_dict or {}
28 |
29 | def get(self, key):
30 | return self.data.get(key, None)
31 |
32 | def set(self, key, value):
33 | with self.lock:
34 | self.data.update({key: value})
35 |
36 | def delete(self, key):
37 | with self.lock:
38 | if key in self.data:
39 | self.data.pop(key)
40 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/caches/__init__.py:
--------------------------------------------------------------------------------
1 | from textwrap import dedent
2 |
3 | try:
4 | from .file_cache import FileCache
5 | except ImportError:
6 | notice = dedent('''
7 | NOTE: In order to use the FileCache you must have
8 | lockfile installed. You can install it via pip:
9 | pip install lockfile
10 | ''')
11 | print(notice)
12 |
13 |
14 | try:
15 | import redis
16 | from .redis_cache import RedisCache
17 | except ImportError:
18 | pass
19 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/caches/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/caches/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/caches/__pycache__/file_cache.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/caches/__pycache__/file_cache.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/caches/redis_cache.py:
--------------------------------------------------------------------------------
1 | from __future__ import division
2 |
3 | from datetime import datetime
4 |
5 |
6 | def total_seconds(td):
7 | """Python 2.6 compatability"""
8 | if hasattr(td, 'total_seconds'):
9 | return td.total_seconds()
10 |
11 | ms = td.microseconds
12 | secs = (td.seconds + td.days * 24 * 3600)
13 | return (ms + secs * 10**6) / 10**6
14 |
15 |
16 | class RedisCache(object):
17 |
18 | def __init__(self, conn):
19 | self.conn = conn
20 |
21 | def get(self, key):
22 | return self.conn.get(key)
23 |
24 | def set(self, key, value, expires=None):
25 | if not expires:
26 | self.conn.set(key, value)
27 | else:
28 | expires = expires - datetime.now()
29 | self.conn.setex(key, total_seconds(expires), value)
30 |
31 | def delete(self, key):
32 | self.conn.delete(key)
33 |
34 | def clear(self):
35 | """Helper for clearing all the keys in a database. Use with
36 | caution!"""
37 | for key in self.conn.keys():
38 | self.conn.delete(key)
39 |
40 | def close(self):
41 | self.conn.disconnect()
42 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/compat.py:
--------------------------------------------------------------------------------
1 | try:
2 | from urllib.parse import urljoin
3 | except ImportError:
4 | from urlparse import urljoin
5 |
6 |
7 | try:
8 | import cPickle as pickle
9 | except ImportError:
10 | import pickle
11 |
12 |
13 | from pip._vendor.requests.packages.urllib3.response import HTTPResponse
14 | from pip._vendor.requests.packages.urllib3.util import is_fp_closed
15 |
16 | # Replicate some six behaviour
17 | try:
18 | text_type = (unicode,)
19 | except NameError:
20 | text_type = (str,)
21 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/filewrapper.py:
--------------------------------------------------------------------------------
1 | from io import BytesIO
2 |
3 |
4 | class CallbackFileWrapper(object):
5 | """
6 | Small wrapper around a fp object which will tee everything read into a
7 | buffer, and when that file is closed it will execute a callback with the
8 | contents of that buffer.
9 |
10 | All attributes are proxied to the underlying file object.
11 |
12 | This class uses members with a double underscore (__) leading prefix so as
13 | not to accidentally shadow an attribute.
14 | """
15 |
16 | def __init__(self, fp, callback):
17 | self.__buf = BytesIO()
18 | self.__fp = fp
19 | self.__callback = callback
20 |
21 | def __getattr__(self, name):
22 | # The vaguaries of garbage collection means that self.__fp is
23 | # not always set. By using __getattribute__ and the private
24 | # name[0] allows looking up the attribute value and raising an
25 | # AttributeError when it doesn't exist. This stop thigns from
26 | # infinitely recursing calls to getattr in the case where
27 | # self.__fp hasn't been set.
28 | #
29 | # [0] https://docs.python.org/2/reference/expressions.html#atom-identifiers
30 | fp = self.__getattribute__('_CallbackFileWrapper__fp')
31 | return getattr(fp, name)
32 |
33 | def __is_fp_closed(self):
34 | try:
35 | return self.__fp.fp is None
36 | except AttributeError:
37 | pass
38 |
39 | try:
40 | return self.__fp.closed
41 | except AttributeError:
42 | pass
43 |
44 | # We just don't cache it then.
45 | # TODO: Add some logging here...
46 | return False
47 |
48 | def _close(self):
49 | if self.__callback:
50 | self.__callback(self.__buf.getvalue())
51 |
52 | # We assign this to None here, because otherwise we can get into
53 | # really tricky problems where the CPython interpreter dead locks
54 | # because the callback is holding a reference to something which
55 | # has a __del__ method. Setting this to None breaks the cycle
56 | # and allows the garbage collector to do it's thing normally.
57 | self.__callback = None
58 |
59 | def read(self, amt=None):
60 | data = self.__fp.read(amt)
61 | self.__buf.write(data)
62 | if self.__is_fp_closed():
63 | self._close()
64 |
65 | return data
66 |
67 | def _safe_read(self, amt):
68 | data = self.__fp._safe_read(amt)
69 | if amt == 2 and data == b'\r\n':
70 | # urllib executes this read to toss the CRLF at the end
71 | # of the chunk.
72 | return data
73 |
74 | self.__buf.write(data)
75 | if self.__is_fp_closed():
76 | self._close()
77 |
78 | return data
79 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/cachecontrol/wrapper.py:
--------------------------------------------------------------------------------
1 | from .adapter import CacheControlAdapter
2 | from .cache import DictCache
3 |
4 |
5 | def CacheControl(sess,
6 | cache=None,
7 | cache_etags=True,
8 | serializer=None,
9 | heuristic=None):
10 |
11 | cache = cache or DictCache()
12 | adapter = CacheControlAdapter(
13 | cache,
14 | cache_etags=cache_etags,
15 | serializer=serializer,
16 | heuristic=heuristic,
17 | )
18 | sess.mount('http://', adapter)
19 | sess.mount('https://', adapter)
20 |
21 | return sess
22 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/colorama/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
2 | from .initialise import init, deinit, reinit, colorama_text
3 | from .ansi import Fore, Back, Style, Cursor
4 | from .ansitowin32 import AnsiToWin32
5 |
6 | __version__ = '0.3.7'
7 |
8 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/colorama/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/colorama/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/colorama/__pycache__/ansi.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/colorama/__pycache__/ansi.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/colorama/__pycache__/ansitowin32.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/colorama/__pycache__/ansitowin32.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/colorama/__pycache__/initialise.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/colorama/__pycache__/initialise.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/colorama/__pycache__/win32.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/colorama/__pycache__/win32.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/colorama/__pycache__/winterm.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/colorama/__pycache__/winterm.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/colorama/ansi.py:
--------------------------------------------------------------------------------
1 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
2 | '''
3 | This module generates ANSI character codes to printing colors to terminals.
4 | See: http://en.wikipedia.org/wiki/ANSI_escape_code
5 | '''
6 |
7 | CSI = '\033['
8 | OSC = '\033]'
9 | BEL = '\007'
10 |
11 |
12 | def code_to_chars(code):
13 | return CSI + str(code) + 'm'
14 |
15 | def set_title(title):
16 | return OSC + '2;' + title + BEL
17 |
18 | def clear_screen(mode=2):
19 | return CSI + str(mode) + 'J'
20 |
21 | def clear_line(mode=2):
22 | return CSI + str(mode) + 'K'
23 |
24 |
25 | class AnsiCodes(object):
26 | def __init__(self):
27 | # the subclasses declare class attributes which are numbers.
28 | # Upon instantiation we define instance attributes, which are the same
29 | # as the class attributes but wrapped with the ANSI escape sequence
30 | for name in dir(self):
31 | if not name.startswith('_'):
32 | value = getattr(self, name)
33 | setattr(self, name, code_to_chars(value))
34 |
35 |
36 | class AnsiCursor(object):
37 | def UP(self, n=1):
38 | return CSI + str(n) + 'A'
39 | def DOWN(self, n=1):
40 | return CSI + str(n) + 'B'
41 | def FORWARD(self, n=1):
42 | return CSI + str(n) + 'C'
43 | def BACK(self, n=1):
44 | return CSI + str(n) + 'D'
45 | def POS(self, x=1, y=1):
46 | return CSI + str(y) + ';' + str(x) + 'H'
47 |
48 |
49 | class AnsiFore(AnsiCodes):
50 | BLACK = 30
51 | RED = 31
52 | GREEN = 32
53 | YELLOW = 33
54 | BLUE = 34
55 | MAGENTA = 35
56 | CYAN = 36
57 | WHITE = 37
58 | RESET = 39
59 |
60 | # These are fairly well supported, but not part of the standard.
61 | LIGHTBLACK_EX = 90
62 | LIGHTRED_EX = 91
63 | LIGHTGREEN_EX = 92
64 | LIGHTYELLOW_EX = 93
65 | LIGHTBLUE_EX = 94
66 | LIGHTMAGENTA_EX = 95
67 | LIGHTCYAN_EX = 96
68 | LIGHTWHITE_EX = 97
69 |
70 |
71 | class AnsiBack(AnsiCodes):
72 | BLACK = 40
73 | RED = 41
74 | GREEN = 42
75 | YELLOW = 43
76 | BLUE = 44
77 | MAGENTA = 45
78 | CYAN = 46
79 | WHITE = 47
80 | RESET = 49
81 |
82 | # These are fairly well supported, but not part of the standard.
83 | LIGHTBLACK_EX = 100
84 | LIGHTRED_EX = 101
85 | LIGHTGREEN_EX = 102
86 | LIGHTYELLOW_EX = 103
87 | LIGHTBLUE_EX = 104
88 | LIGHTMAGENTA_EX = 105
89 | LIGHTCYAN_EX = 106
90 | LIGHTWHITE_EX = 107
91 |
92 |
93 | class AnsiStyle(AnsiCodes):
94 | BRIGHT = 1
95 | DIM = 2
96 | NORMAL = 22
97 | RESET_ALL = 0
98 |
99 | Fore = AnsiFore()
100 | Back = AnsiBack()
101 | Style = AnsiStyle()
102 | Cursor = AnsiCursor()
103 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/colorama/initialise.py:
--------------------------------------------------------------------------------
1 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
2 | import atexit
3 | import contextlib
4 | import sys
5 |
6 | from .ansitowin32 import AnsiToWin32
7 |
8 |
9 | orig_stdout = None
10 | orig_stderr = None
11 |
12 | wrapped_stdout = None
13 | wrapped_stderr = None
14 |
15 | atexit_done = False
16 |
17 |
18 | def reset_all():
19 | if AnsiToWin32 is not None: # Issue #74: objects might become None at exit
20 | AnsiToWin32(orig_stdout).reset_all()
21 |
22 |
23 | def init(autoreset=False, convert=None, strip=None, wrap=True):
24 |
25 | if not wrap and any([autoreset, convert, strip]):
26 | raise ValueError('wrap=False conflicts with any other arg=True')
27 |
28 | global wrapped_stdout, wrapped_stderr
29 | global orig_stdout, orig_stderr
30 |
31 | orig_stdout = sys.stdout
32 | orig_stderr = sys.stderr
33 |
34 | if sys.stdout is None:
35 | wrapped_stdout = None
36 | else:
37 | sys.stdout = wrapped_stdout = \
38 | wrap_stream(orig_stdout, convert, strip, autoreset, wrap)
39 | if sys.stderr is None:
40 | wrapped_stderr = None
41 | else:
42 | sys.stderr = wrapped_stderr = \
43 | wrap_stream(orig_stderr, convert, strip, autoreset, wrap)
44 |
45 | global atexit_done
46 | if not atexit_done:
47 | atexit.register(reset_all)
48 | atexit_done = True
49 |
50 |
51 | def deinit():
52 | if orig_stdout is not None:
53 | sys.stdout = orig_stdout
54 | if orig_stderr is not None:
55 | sys.stderr = orig_stderr
56 |
57 |
58 | @contextlib.contextmanager
59 | def colorama_text(*args, **kwargs):
60 | init(*args, **kwargs)
61 | try:
62 | yield
63 | finally:
64 | deinit()
65 |
66 |
67 | def reinit():
68 | if wrapped_stdout is not None:
69 | sys.stdout = wrapped_stdout
70 | if wrapped_stderr is not None:
71 | sys.stderr = wrapped_stderr
72 |
73 |
74 | def wrap_stream(stream, convert, strip, autoreset, wrap):
75 | if wrap:
76 | wrapper = AnsiToWin32(stream,
77 | convert=convert, strip=strip, autoreset=autoreset)
78 | if wrapper.should_wrap():
79 | stream = wrapper.stream
80 | return stream
81 |
82 |
83 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | #
3 | # Copyright (C) 2012-2016 Vinay Sajip.
4 | # Licensed to the Python Software Foundation under a contributor agreement.
5 | # See LICENSE.txt and CONTRIBUTORS.txt.
6 | #
7 | import logging
8 |
9 | __version__ = '0.2.4'
10 |
11 | class DistlibException(Exception):
12 | pass
13 |
14 | try:
15 | from logging import NullHandler
16 | except ImportError: # pragma: no cover
17 | class NullHandler(logging.Handler):
18 | def handle(self, record): pass
19 | def emit(self, record): pass
20 | def createLock(self): self.lock = None
21 |
22 | logger = logging.getLogger(__name__)
23 | logger.addHandler(NullHandler())
24 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/__pycache__/compat.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/__pycache__/compat.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/__pycache__/resources.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/__pycache__/resources.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/__pycache__/scripts.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/__pycache__/scripts.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/__pycache__/util.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/__pycache__/util.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/_backport/__init__.py:
--------------------------------------------------------------------------------
1 | """Modules copied from Python 3 standard libraries, for internal use only.
2 |
3 | Individual classes and functions are found in d2._backport.misc. Intended
4 | usage is to always import things missing from 3.1 from that module: the
5 | built-in/stdlib objects will be used if found.
6 | """
7 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/_backport/misc.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | #
3 | # Copyright (C) 2012 The Python Software Foundation.
4 | # See LICENSE.txt and CONTRIBUTORS.txt.
5 | #
6 | """Backports for individual classes and functions."""
7 |
8 | import os
9 | import sys
10 |
11 | __all__ = ['cache_from_source', 'callable', 'fsencode']
12 |
13 |
14 | try:
15 | from imp import cache_from_source
16 | except ImportError:
17 | def cache_from_source(py_file, debug=__debug__):
18 | ext = debug and 'c' or 'o'
19 | return py_file + ext
20 |
21 |
22 | try:
23 | callable = callable
24 | except NameError:
25 | from collections import Callable
26 |
27 | def callable(obj):
28 | return isinstance(obj, Callable)
29 |
30 |
31 | try:
32 | fsencode = os.fsencode
33 | except AttributeError:
34 | def fsencode(filename):
35 | if isinstance(filename, bytes):
36 | return filename
37 | elif isinstance(filename, str):
38 | return filename.encode(sys.getfilesystemencoding())
39 | else:
40 | raise TypeError("expect bytes or str, not %s" %
41 | type(filename).__name__)
42 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/_backport/sysconfig.cfg:
--------------------------------------------------------------------------------
1 | [posix_prefix]
2 | # Configuration directories. Some of these come straight out of the
3 | # configure script. They are for implementing the other variables, not to
4 | # be used directly in [resource_locations].
5 | confdir = /etc
6 | datadir = /usr/share
7 | libdir = /usr/lib
8 | statedir = /var
9 | # User resource directory
10 | local = ~/.local/{distribution.name}
11 |
12 | stdlib = {base}/lib/python{py_version_short}
13 | platstdlib = {platbase}/lib/python{py_version_short}
14 | purelib = {base}/lib/python{py_version_short}/site-packages
15 | platlib = {platbase}/lib/python{py_version_short}/site-packages
16 | include = {base}/include/python{py_version_short}{abiflags}
17 | platinclude = {platbase}/include/python{py_version_short}{abiflags}
18 | data = {base}
19 |
20 | [posix_home]
21 | stdlib = {base}/lib/python
22 | platstdlib = {base}/lib/python
23 | purelib = {base}/lib/python
24 | platlib = {base}/lib/python
25 | include = {base}/include/python
26 | platinclude = {base}/include/python
27 | scripts = {base}/bin
28 | data = {base}
29 |
30 | [nt]
31 | stdlib = {base}/Lib
32 | platstdlib = {base}/Lib
33 | purelib = {base}/Lib/site-packages
34 | platlib = {base}/Lib/site-packages
35 | include = {base}/Include
36 | platinclude = {base}/Include
37 | scripts = {base}/Scripts
38 | data = {base}
39 |
40 | [os2]
41 | stdlib = {base}/Lib
42 | platstdlib = {base}/Lib
43 | purelib = {base}/Lib/site-packages
44 | platlib = {base}/Lib/site-packages
45 | include = {base}/Include
46 | platinclude = {base}/Include
47 | scripts = {base}/Scripts
48 | data = {base}
49 |
50 | [os2_home]
51 | stdlib = {userbase}/lib/python{py_version_short}
52 | platstdlib = {userbase}/lib/python{py_version_short}
53 | purelib = {userbase}/lib/python{py_version_short}/site-packages
54 | platlib = {userbase}/lib/python{py_version_short}/site-packages
55 | include = {userbase}/include/python{py_version_short}
56 | scripts = {userbase}/bin
57 | data = {userbase}
58 |
59 | [nt_user]
60 | stdlib = {userbase}/Python{py_version_nodot}
61 | platstdlib = {userbase}/Python{py_version_nodot}
62 | purelib = {userbase}/Python{py_version_nodot}/site-packages
63 | platlib = {userbase}/Python{py_version_nodot}/site-packages
64 | include = {userbase}/Python{py_version_nodot}/Include
65 | scripts = {userbase}/Scripts
66 | data = {userbase}
67 |
68 | [posix_user]
69 | stdlib = {userbase}/lib/python{py_version_short}
70 | platstdlib = {userbase}/lib/python{py_version_short}
71 | purelib = {userbase}/lib/python{py_version_short}/site-packages
72 | platlib = {userbase}/lib/python{py_version_short}/site-packages
73 | include = {userbase}/include/python{py_version_short}
74 | scripts = {userbase}/bin
75 | data = {userbase}
76 |
77 | [osx_framework_user]
78 | stdlib = {userbase}/lib/python
79 | platstdlib = {userbase}/lib/python
80 | purelib = {userbase}/lib/python/site-packages
81 | platlib = {userbase}/lib/python/site-packages
82 | include = {userbase}/include
83 | scripts = {userbase}/bin
84 | data = {userbase}
85 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/t32.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/t32.exe
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/t64.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/t64.exe
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/w32.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/w32.exe
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/w64.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/distlib/w64.exe
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/__init__.py:
--------------------------------------------------------------------------------
1 | """
2 | HTML parsing library based on the WHATWG "HTML5"
3 | specification. The parser is designed to be compatible with existing
4 | HTML found in the wild and implements well-defined error recovery that
5 | is largely compatible with modern desktop web browsers.
6 |
7 | Example usage:
8 |
9 | import html5lib
10 | f = open("my_document.html")
11 | tree = html5lib.parse(f)
12 | """
13 |
14 | from __future__ import absolute_import, division, unicode_literals
15 |
16 | from .html5parser import HTMLParser, parse, parseFragment
17 | from .treebuilders import getTreeBuilder
18 | from .treewalkers import getTreeWalker
19 | from .serializer import serialize
20 |
21 | __all__ = ["HTMLParser", "parse", "parseFragment", "getTreeBuilder",
22 | "getTreeWalker", "serialize"]
23 |
24 | # this has to be at the top level, see how setup.py parses this
25 | __version__ = "1.0b10"
26 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/__pycache__/_inputstream.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/__pycache__/_inputstream.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/__pycache__/_tokenizer.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/__pycache__/_tokenizer.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/__pycache__/_utils.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/__pycache__/_utils.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/__pycache__/constants.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/__pycache__/constants.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/__pycache__/html5parser.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/__pycache__/html5parser.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/__pycache__/serializer.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/__pycache__/serializer.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/_trie/__init__.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import, division, unicode_literals
2 |
3 | from .py import Trie as PyTrie
4 |
5 | Trie = PyTrie
6 |
7 | # pylint:disable=wrong-import-position
8 | try:
9 | from .datrie import Trie as DATrie
10 | except ImportError:
11 | pass
12 | else:
13 | Trie = DATrie
14 | # pylint:enable=wrong-import-position
15 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/_trie/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/_trie/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/_trie/__pycache__/_base.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/_trie/__pycache__/_base.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/_trie/__pycache__/datrie.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/_trie/__pycache__/datrie.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/_trie/__pycache__/py.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/_trie/__pycache__/py.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/_trie/_base.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import, division, unicode_literals
2 |
3 | from collections import Mapping
4 |
5 |
6 | class Trie(Mapping):
7 | """Abstract base class for tries"""
8 |
9 | def keys(self, prefix=None):
10 | # pylint:disable=arguments-differ
11 | keys = super(Trie, self).keys()
12 |
13 | if prefix is None:
14 | return set(keys)
15 |
16 | # Python 2.6: no set comprehensions
17 | return set([x for x in keys if x.startswith(prefix)])
18 |
19 | def has_keys_with_prefix(self, prefix):
20 | for key in self.keys():
21 | if key.startswith(prefix):
22 | return True
23 |
24 | return False
25 |
26 | def longest_prefix(self, prefix):
27 | if prefix in self:
28 | return prefix
29 |
30 | for i in range(1, len(prefix) + 1):
31 | if prefix[:-i] in self:
32 | return prefix[:-i]
33 |
34 | raise KeyError(prefix)
35 |
36 | def longest_prefix_item(self, prefix):
37 | lprefix = self.longest_prefix(prefix)
38 | return (lprefix, self[lprefix])
39 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/_trie/datrie.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import, division, unicode_literals
2 |
3 | from datrie import Trie as DATrie
4 | from pip._vendor.six import text_type
5 |
6 | from ._base import Trie as ABCTrie
7 |
8 |
9 | class Trie(ABCTrie):
10 | def __init__(self, data):
11 | chars = set()
12 | for key in data.keys():
13 | if not isinstance(key, text_type):
14 | raise TypeError("All keys must be strings")
15 | for char in key:
16 | chars.add(char)
17 |
18 | self._data = DATrie("".join(chars))
19 | for key, value in data.items():
20 | self._data[key] = value
21 |
22 | def __contains__(self, key):
23 | return key in self._data
24 |
25 | def __len__(self):
26 | return len(self._data)
27 |
28 | def __iter__(self):
29 | raise NotImplementedError()
30 |
31 | def __getitem__(self, key):
32 | return self._data[key]
33 |
34 | def keys(self, prefix=None):
35 | return self._data.keys(prefix)
36 |
37 | def has_keys_with_prefix(self, prefix):
38 | return self._data.has_keys_with_prefix(prefix)
39 |
40 | def longest_prefix(self, prefix):
41 | return self._data.longest_prefix(prefix)
42 |
43 | def longest_prefix_item(self, prefix):
44 | return self._data.longest_prefix_item(prefix)
45 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/_trie/py.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import, division, unicode_literals
2 | from pip._vendor.six import text_type
3 |
4 | from bisect import bisect_left
5 |
6 | from ._base import Trie as ABCTrie
7 |
8 |
9 | class Trie(ABCTrie):
10 | def __init__(self, data):
11 | if not all(isinstance(x, text_type) for x in data.keys()):
12 | raise TypeError("All keys must be strings")
13 |
14 | self._data = data
15 | self._keys = sorted(data.keys())
16 | self._cachestr = ""
17 | self._cachepoints = (0, len(data))
18 |
19 | def __contains__(self, key):
20 | return key in self._data
21 |
22 | def __len__(self):
23 | return len(self._data)
24 |
25 | def __iter__(self):
26 | return iter(self._data)
27 |
28 | def __getitem__(self, key):
29 | return self._data[key]
30 |
31 | def keys(self, prefix=None):
32 | if prefix is None or prefix == "" or not self._keys:
33 | return set(self._keys)
34 |
35 | if prefix.startswith(self._cachestr):
36 | lo, hi = self._cachepoints
37 | start = i = bisect_left(self._keys, prefix, lo, hi)
38 | else:
39 | start = i = bisect_left(self._keys, prefix)
40 |
41 | keys = set()
42 | if start == len(self._keys):
43 | return keys
44 |
45 | while self._keys[i].startswith(prefix):
46 | keys.add(self._keys[i])
47 | i += 1
48 |
49 | self._cachestr = prefix
50 | self._cachepoints = (start, i)
51 |
52 | return keys
53 |
54 | def has_keys_with_prefix(self, prefix):
55 | if prefix in self._data:
56 | return True
57 |
58 | if prefix.startswith(self._cachestr):
59 | lo, hi = self._cachepoints
60 | i = bisect_left(self._keys, prefix, lo, hi)
61 | else:
62 | i = bisect_left(self._keys, prefix)
63 |
64 | if i == len(self._keys):
65 | return False
66 |
67 | return self._keys[i].startswith(prefix)
68 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/filters/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/filters/__init__.py
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/filters/alphabeticalattributes.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import, division, unicode_literals
2 |
3 | from . import base
4 |
5 | try:
6 | from collections import OrderedDict
7 | except ImportError:
8 | from ordereddict import OrderedDict
9 |
10 |
11 | class Filter(base.Filter):
12 | def __iter__(self):
13 | for token in base.Filter.__iter__(self):
14 | if token["type"] in ("StartTag", "EmptyTag"):
15 | attrs = OrderedDict()
16 | for name, value in sorted(token["data"].items(),
17 | key=lambda x: x[0]):
18 | attrs[name] = value
19 | token["data"] = attrs
20 | yield token
21 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/filters/base.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import, division, unicode_literals
2 |
3 |
4 | class Filter(object):
5 | def __init__(self, source):
6 | self.source = source
7 |
8 | def __iter__(self):
9 | return iter(self.source)
10 |
11 | def __getattr__(self, name):
12 | return getattr(self.source, name)
13 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/filters/inject_meta_charset.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import, division, unicode_literals
2 |
3 | from . import base
4 |
5 |
6 | class Filter(base.Filter):
7 | def __init__(self, source, encoding):
8 | base.Filter.__init__(self, source)
9 | self.encoding = encoding
10 |
11 | def __iter__(self):
12 | state = "pre_head"
13 | meta_found = (self.encoding is None)
14 | pending = []
15 |
16 | for token in base.Filter.__iter__(self):
17 | type = token["type"]
18 | if type == "StartTag":
19 | if token["name"].lower() == "head":
20 | state = "in_head"
21 |
22 | elif type == "EmptyTag":
23 | if token["name"].lower() == "meta":
24 | # replace charset with actual encoding
25 | has_http_equiv_content_type = False
26 | for (namespace, name), value in token["data"].items():
27 | if namespace is not None:
28 | continue
29 | elif name.lower() == 'charset':
30 | token["data"][(namespace, name)] = self.encoding
31 | meta_found = True
32 | break
33 | elif name == 'http-equiv' and value.lower() == 'content-type':
34 | has_http_equiv_content_type = True
35 | else:
36 | if has_http_equiv_content_type and (None, "content") in token["data"]:
37 | token["data"][(None, "content")] = 'text/html; charset=%s' % self.encoding
38 | meta_found = True
39 |
40 | elif token["name"].lower() == "head" and not meta_found:
41 | # insert meta into empty head
42 | yield {"type": "StartTag", "name": "head",
43 | "data": token["data"]}
44 | yield {"type": "EmptyTag", "name": "meta",
45 | "data": {(None, "charset"): self.encoding}}
46 | yield {"type": "EndTag", "name": "head"}
47 | meta_found = True
48 | continue
49 |
50 | elif type == "EndTag":
51 | if token["name"].lower() == "head" and pending:
52 | # insert meta into head (if necessary) and flush pending queue
53 | yield pending.pop(0)
54 | if not meta_found:
55 | yield {"type": "EmptyTag", "name": "meta",
56 | "data": {(None, "charset"): self.encoding}}
57 | while pending:
58 | yield pending.pop(0)
59 | meta_found = True
60 | state = "post_head"
61 |
62 | if state == "in_head":
63 | pending.append(token)
64 | else:
65 | yield token
66 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/filters/whitespace.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import, division, unicode_literals
2 |
3 | import re
4 |
5 | from . import base
6 | from ..constants import rcdataElements, spaceCharacters
7 | spaceCharacters = "".join(spaceCharacters)
8 |
9 | SPACES_REGEX = re.compile("[%s]+" % spaceCharacters)
10 |
11 |
12 | class Filter(base.Filter):
13 |
14 | spacePreserveElements = frozenset(["pre", "textarea"] + list(rcdataElements))
15 |
16 | def __iter__(self):
17 | preserve = 0
18 | for token in base.Filter.__iter__(self):
19 | type = token["type"]
20 | if type == "StartTag" \
21 | and (preserve or token["name"] in self.spacePreserveElements):
22 | preserve += 1
23 |
24 | elif type == "EndTag" and preserve:
25 | preserve -= 1
26 |
27 | elif not preserve and type == "SpaceCharacters" and token["data"]:
28 | # Test on token["data"] above to not introduce spaces where there were not
29 | token["data"] = " "
30 |
31 | elif not preserve and type == "Characters":
32 | token["data"] = collapse_spaces(token["data"])
33 |
34 | yield token
35 |
36 |
37 | def collapse_spaces(text):
38 | return SPACES_REGEX.sub(' ', text)
39 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/treeadapters/__init__.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import, division, unicode_literals
2 |
3 | from . import sax
4 |
5 | __all__ = ["sax"]
6 |
7 | try:
8 | from . import genshi # noqa
9 | except ImportError:
10 | pass
11 | else:
12 | __all__.append("genshi")
13 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/treeadapters/genshi.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import, division, unicode_literals
2 |
3 | from genshi.core import QName, Attrs
4 | from genshi.core import START, END, TEXT, COMMENT, DOCTYPE
5 |
6 |
7 | def to_genshi(walker):
8 | text = []
9 | for token in walker:
10 | type = token["type"]
11 | if type in ("Characters", "SpaceCharacters"):
12 | text.append(token["data"])
13 | elif text:
14 | yield TEXT, "".join(text), (None, -1, -1)
15 | text = []
16 |
17 | if type in ("StartTag", "EmptyTag"):
18 | if token["namespace"]:
19 | name = "{%s}%s" % (token["namespace"], token["name"])
20 | else:
21 | name = token["name"]
22 | attrs = Attrs([(QName("{%s}%s" % attr if attr[0] is not None else attr[1]), value)
23 | for attr, value in token["data"].items()])
24 | yield (START, (QName(name), attrs), (None, -1, -1))
25 | if type == "EmptyTag":
26 | type = "EndTag"
27 |
28 | if type == "EndTag":
29 | if token["namespace"]:
30 | name = "{%s}%s" % (token["namespace"], token["name"])
31 | else:
32 | name = token["name"]
33 |
34 | yield END, QName(name), (None, -1, -1)
35 |
36 | elif type == "Comment":
37 | yield COMMENT, token["data"], (None, -1, -1)
38 |
39 | elif type == "Doctype":
40 | yield DOCTYPE, (token["name"], token["publicId"],
41 | token["systemId"]), (None, -1, -1)
42 |
43 | else:
44 | pass # FIXME: What to do?
45 |
46 | if text:
47 | yield TEXT, "".join(text), (None, -1, -1)
48 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/treeadapters/sax.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import, division, unicode_literals
2 |
3 | from xml.sax.xmlreader import AttributesNSImpl
4 |
5 | from ..constants import adjustForeignAttributes, unadjustForeignAttributes
6 |
7 | prefix_mapping = {}
8 | for prefix, localName, namespace in adjustForeignAttributes.values():
9 | if prefix is not None:
10 | prefix_mapping[prefix] = namespace
11 |
12 |
13 | def to_sax(walker, handler):
14 | """Call SAX-like content handler based on treewalker walker"""
15 | handler.startDocument()
16 | for prefix, namespace in prefix_mapping.items():
17 | handler.startPrefixMapping(prefix, namespace)
18 |
19 | for token in walker:
20 | type = token["type"]
21 | if type == "Doctype":
22 | continue
23 | elif type in ("StartTag", "EmptyTag"):
24 | attrs = AttributesNSImpl(token["data"],
25 | unadjustForeignAttributes)
26 | handler.startElementNS((token["namespace"], token["name"]),
27 | token["name"],
28 | attrs)
29 | if type == "EmptyTag":
30 | handler.endElementNS((token["namespace"], token["name"]),
31 | token["name"])
32 | elif type == "EndTag":
33 | handler.endElementNS((token["namespace"], token["name"]),
34 | token["name"])
35 | elif type in ("Characters", "SpaceCharacters"):
36 | handler.characters(token["data"])
37 | elif type == "Comment":
38 | pass
39 | else:
40 | assert False, "Unknown token type"
41 |
42 | for prefix, namespace in prefix_mapping.items():
43 | handler.endPrefixMapping(prefix)
44 | handler.endDocument()
45 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/treebuilders/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/treebuilders/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/treebuilders/__pycache__/base.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/treebuilders/__pycache__/base.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/treewalkers/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/treewalkers/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/treewalkers/dom.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import, division, unicode_literals
2 |
3 | from xml.dom import Node
4 |
5 | from . import base
6 |
7 |
8 | class TreeWalker(base.NonRecursiveTreeWalker):
9 | def getNodeDetails(self, node):
10 | if node.nodeType == Node.DOCUMENT_TYPE_NODE:
11 | return base.DOCTYPE, node.name, node.publicId, node.systemId
12 |
13 | elif node.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE):
14 | return base.TEXT, node.nodeValue
15 |
16 | elif node.nodeType == Node.ELEMENT_NODE:
17 | attrs = {}
18 | for attr in list(node.attributes.keys()):
19 | attr = node.getAttributeNode(attr)
20 | if attr.namespaceURI:
21 | attrs[(attr.namespaceURI, attr.localName)] = attr.value
22 | else:
23 | attrs[(None, attr.name)] = attr.value
24 | return (base.ELEMENT, node.namespaceURI, node.nodeName,
25 | attrs, node.hasChildNodes())
26 |
27 | elif node.nodeType == Node.COMMENT_NODE:
28 | return base.COMMENT, node.nodeValue
29 |
30 | elif node.nodeType in (Node.DOCUMENT_NODE, Node.DOCUMENT_FRAGMENT_NODE):
31 | return (base.DOCUMENT,)
32 |
33 | else:
34 | return base.UNKNOWN, node.nodeType
35 |
36 | def getFirstChild(self, node):
37 | return node.firstChild
38 |
39 | def getNextSibling(self, node):
40 | return node.nextSibling
41 |
42 | def getParentNode(self, node):
43 | return node.parentNode
44 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/html5lib/treewalkers/genshi.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import, division, unicode_literals
2 |
3 | from genshi.core import QName
4 | from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
5 | from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT
6 |
7 | from . import base
8 |
9 | from ..constants import voidElements, namespaces
10 |
11 |
12 | class TreeWalker(base.TreeWalker):
13 | def __iter__(self):
14 | # Buffer the events so we can pass in the following one
15 | previous = None
16 | for event in self.tree:
17 | if previous is not None:
18 | for token in self.tokens(previous, event):
19 | yield token
20 | previous = event
21 |
22 | # Don't forget the final event!
23 | if previous is not None:
24 | for token in self.tokens(previous, None):
25 | yield token
26 |
27 | def tokens(self, event, next):
28 | kind, data, _ = event
29 | if kind == START:
30 | tag, attribs = data
31 | name = tag.localname
32 | namespace = tag.namespace
33 | converted_attribs = {}
34 | for k, v in attribs:
35 | if isinstance(k, QName):
36 | converted_attribs[(k.namespace, k.localname)] = v
37 | else:
38 | converted_attribs[(None, k)] = v
39 |
40 | if namespace == namespaces["html"] and name in voidElements:
41 | for token in self.emptyTag(namespace, name, converted_attribs,
42 | not next or next[0] != END or
43 | next[1] != tag):
44 | yield token
45 | else:
46 | yield self.startTag(namespace, name, converted_attribs)
47 |
48 | elif kind == END:
49 | name = data.localname
50 | namespace = data.namespace
51 | if namespace != namespaces["html"] or name not in voidElements:
52 | yield self.endTag(namespace, name)
53 |
54 | elif kind == COMMENT:
55 | yield self.comment(data)
56 |
57 | elif kind == TEXT:
58 | for token in self.text(data):
59 | yield token
60 |
61 | elif kind == DOCTYPE:
62 | yield self.doctype(*data)
63 |
64 | elif kind in (XML_NAMESPACE, DOCTYPE, START_NS, END_NS,
65 | START_CDATA, END_CDATA, PI):
66 | pass
67 |
68 | else:
69 | yield self.unknown(kind)
70 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/lockfile/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/lockfile/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/lockfile/__pycache__/linklockfile.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/lockfile/__pycache__/linklockfile.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/lockfile/__pycache__/mkdirlockfile.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/lockfile/__pycache__/mkdirlockfile.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/lockfile/linklockfile.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 |
3 | import time
4 | import os
5 |
6 | from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout,
7 | AlreadyLocked)
8 |
9 |
10 | class LinkLockFile(LockBase):
11 | """Lock access to a file using atomic property of link(2).
12 |
13 | >>> lock = LinkLockFile('somefile')
14 | >>> lock = LinkLockFile('somefile', threaded=False)
15 | """
16 |
17 | def acquire(self, timeout=None):
18 | try:
19 | open(self.unique_name, "wb").close()
20 | except IOError:
21 | raise LockFailed("failed to create %s" % self.unique_name)
22 |
23 | timeout = timeout if timeout is not None else self.timeout
24 | end_time = time.time()
25 | if timeout is not None and timeout > 0:
26 | end_time += timeout
27 |
28 | while True:
29 | # Try and create a hard link to it.
30 | try:
31 | os.link(self.unique_name, self.lock_file)
32 | except OSError:
33 | # Link creation failed. Maybe we've double-locked?
34 | nlinks = os.stat(self.unique_name).st_nlink
35 | if nlinks == 2:
36 | # The original link plus the one I created == 2. We're
37 | # good to go.
38 | return
39 | else:
40 | # Otherwise the lock creation failed.
41 | if timeout is not None and time.time() > end_time:
42 | os.unlink(self.unique_name)
43 | if timeout > 0:
44 | raise LockTimeout("Timeout waiting to acquire"
45 | " lock for %s" %
46 | self.path)
47 | else:
48 | raise AlreadyLocked("%s is already locked" %
49 | self.path)
50 | time.sleep(timeout is not None and timeout / 10 or 0.1)
51 | else:
52 | # Link creation succeeded. We're good to go.
53 | return
54 |
55 | def release(self):
56 | if not self.is_locked():
57 | raise NotLocked("%s is not locked" % self.path)
58 | elif not os.path.exists(self.unique_name):
59 | raise NotMyLock("%s is locked, but not by me" % self.path)
60 | os.unlink(self.unique_name)
61 | os.unlink(self.lock_file)
62 |
63 | def is_locked(self):
64 | return os.path.exists(self.lock_file)
65 |
66 | def i_am_locking(self):
67 | return (self.is_locked() and
68 | os.path.exists(self.unique_name) and
69 | os.stat(self.unique_name).st_nlink == 2)
70 |
71 | def break_lock(self):
72 | if os.path.exists(self.lock_file):
73 | os.unlink(self.lock_file)
74 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/lockfile/symlinklockfile.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 |
3 | import os
4 | import time
5 |
6 | from . import (LockBase, NotLocked, NotMyLock, LockTimeout,
7 | AlreadyLocked)
8 |
9 |
10 | class SymlinkLockFile(LockBase):
11 | """Lock access to a file using symlink(2)."""
12 |
13 | def __init__(self, path, threaded=True, timeout=None):
14 | # super(SymlinkLockFile).__init(...)
15 | LockBase.__init__(self, path, threaded, timeout)
16 | # split it back!
17 | self.unique_name = os.path.split(self.unique_name)[1]
18 |
19 | def acquire(self, timeout=None):
20 | # Hopefully unnecessary for symlink.
21 | # try:
22 | # open(self.unique_name, "wb").close()
23 | # except IOError:
24 | # raise LockFailed("failed to create %s" % self.unique_name)
25 | timeout = timeout if timeout is not None else self.timeout
26 | end_time = time.time()
27 | if timeout is not None and timeout > 0:
28 | end_time += timeout
29 |
30 | while True:
31 | # Try and create a symbolic link to it.
32 | try:
33 | os.symlink(self.unique_name, self.lock_file)
34 | except OSError:
35 | # Link creation failed. Maybe we've double-locked?
36 | if self.i_am_locking():
37 | # Linked to out unique name. Proceed.
38 | return
39 | else:
40 | # Otherwise the lock creation failed.
41 | if timeout is not None and time.time() > end_time:
42 | if timeout > 0:
43 | raise LockTimeout("Timeout waiting to acquire"
44 | " lock for %s" %
45 | self.path)
46 | else:
47 | raise AlreadyLocked("%s is already locked" %
48 | self.path)
49 | time.sleep(timeout / 10 if timeout is not None else 0.1)
50 | else:
51 | # Link creation succeeded. We're good to go.
52 | return
53 |
54 | def release(self):
55 | if not self.is_locked():
56 | raise NotLocked("%s is not locked" % self.path)
57 | elif not self.i_am_locking():
58 | raise NotMyLock("%s is locked, but not by me" % self.path)
59 | os.unlink(self.lock_file)
60 |
61 | def is_locked(self):
62 | return os.path.islink(self.lock_file)
63 |
64 | def i_am_locking(self):
65 | return (os.path.islink(self.lock_file)
66 | and os.readlink(self.lock_file) == self.unique_name)
67 |
68 | def break_lock(self):
69 | if os.path.islink(self.lock_file): # exists && link
70 | os.unlink(self.lock_file)
71 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/__about__.py:
--------------------------------------------------------------------------------
1 | # This file is dual licensed under the terms of the Apache License, Version
2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3 | # for complete details.
4 | from __future__ import absolute_import, division, print_function
5 |
6 | __all__ = [
7 | "__title__", "__summary__", "__uri__", "__version__", "__author__",
8 | "__email__", "__license__", "__copyright__",
9 | ]
10 |
11 | __title__ = "packaging"
12 | __summary__ = "Core utilities for Python packages"
13 | __uri__ = "https://github.com/pypa/packaging"
14 |
15 | __version__ = "16.8"
16 |
17 | __author__ = "Donald Stufft and individual contributors"
18 | __email__ = "donald@stufft.io"
19 |
20 | __license__ = "BSD or Apache License, Version 2.0"
21 | __copyright__ = "Copyright 2014-2016 %s" % __author__
22 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/__init__.py:
--------------------------------------------------------------------------------
1 | # This file is dual licensed under the terms of the Apache License, Version
2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3 | # for complete details.
4 | from __future__ import absolute_import, division, print_function
5 |
6 | from .__about__ import (
7 | __author__, __copyright__, __email__, __license__, __summary__, __title__,
8 | __uri__, __version__
9 | )
10 |
11 | __all__ = [
12 | "__title__", "__summary__", "__uri__", "__version__", "__author__",
13 | "__email__", "__license__", "__copyright__",
14 | ]
15 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/__pycache__/__about__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/__pycache__/__about__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/__pycache__/_compat.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/__pycache__/_compat.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/__pycache__/_structures.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/__pycache__/_structures.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/__pycache__/markers.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/__pycache__/markers.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/__pycache__/requirements.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/__pycache__/requirements.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/__pycache__/specifiers.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/__pycache__/specifiers.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/__pycache__/utils.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/__pycache__/utils.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/__pycache__/version.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/__pycache__/version.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/_compat.py:
--------------------------------------------------------------------------------
1 | # This file is dual licensed under the terms of the Apache License, Version
2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3 | # for complete details.
4 | from __future__ import absolute_import, division, print_function
5 |
6 | import sys
7 |
8 |
9 | PY2 = sys.version_info[0] == 2
10 | PY3 = sys.version_info[0] == 3
11 |
12 | # flake8: noqa
13 |
14 | if PY3:
15 | string_types = str,
16 | else:
17 | string_types = basestring,
18 |
19 |
20 | def with_metaclass(meta, *bases):
21 | """
22 | Create a base class with a metaclass.
23 | """
24 | # This requires a bit of explanation: the basic idea is to make a dummy
25 | # metaclass for one level of class instantiation that replaces itself with
26 | # the actual metaclass.
27 | class metaclass(meta):
28 | def __new__(cls, name, this_bases, d):
29 | return meta(name, bases, d)
30 | return type.__new__(metaclass, 'temporary_class', (), {})
31 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/_structures.py:
--------------------------------------------------------------------------------
1 | # This file is dual licensed under the terms of the Apache License, Version
2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3 | # for complete details.
4 | from __future__ import absolute_import, division, print_function
5 |
6 |
7 | class Infinity(object):
8 |
9 | def __repr__(self):
10 | return "Infinity"
11 |
12 | def __hash__(self):
13 | return hash(repr(self))
14 |
15 | def __lt__(self, other):
16 | return False
17 |
18 | def __le__(self, other):
19 | return False
20 |
21 | def __eq__(self, other):
22 | return isinstance(other, self.__class__)
23 |
24 | def __ne__(self, other):
25 | return not isinstance(other, self.__class__)
26 |
27 | def __gt__(self, other):
28 | return True
29 |
30 | def __ge__(self, other):
31 | return True
32 |
33 | def __neg__(self):
34 | return NegativeInfinity
35 |
36 | Infinity = Infinity()
37 |
38 |
39 | class NegativeInfinity(object):
40 |
41 | def __repr__(self):
42 | return "-Infinity"
43 |
44 | def __hash__(self):
45 | return hash(repr(self))
46 |
47 | def __lt__(self, other):
48 | return True
49 |
50 | def __le__(self, other):
51 | return True
52 |
53 | def __eq__(self, other):
54 | return isinstance(other, self.__class__)
55 |
56 | def __ne__(self, other):
57 | return not isinstance(other, self.__class__)
58 |
59 | def __gt__(self, other):
60 | return False
61 |
62 | def __ge__(self, other):
63 | return False
64 |
65 | def __neg__(self):
66 | return Infinity
67 |
68 | NegativeInfinity = NegativeInfinity()
69 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/packaging/utils.py:
--------------------------------------------------------------------------------
1 | # This file is dual licensed under the terms of the Apache License, Version
2 | # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3 | # for complete details.
4 | from __future__ import absolute_import, division, print_function
5 |
6 | import re
7 |
8 |
9 | _canonicalize_regex = re.compile(r"[-_.]+")
10 |
11 |
12 | def canonicalize_name(name):
13 | # This is taken from PEP 503.
14 | return _canonicalize_regex.sub("-", name).lower()
15 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/progress/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/progress/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/progress/__pycache__/bar.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/progress/__pycache__/bar.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/progress/__pycache__/helpers.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/progress/__pycache__/helpers.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/progress/__pycache__/spinner.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/progress/__pycache__/spinner.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/progress/bar.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # Copyright (c) 2012 Giorgos Verigakis
4 | #
5 | # Permission to use, copy, modify, and distribute this software for any
6 | # purpose with or without fee is hereby granted, provided that the above
7 | # copyright notice and this permission notice appear in all copies.
8 | #
9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 |
17 | from . import Progress
18 | from .helpers import WritelnMixin
19 |
20 |
21 | class Bar(WritelnMixin, Progress):
22 | width = 32
23 | message = ''
24 | suffix = '%(index)d/%(max)d'
25 | bar_prefix = ' |'
26 | bar_suffix = '| '
27 | empty_fill = ' '
28 | fill = '#'
29 | hide_cursor = True
30 |
31 | def update(self):
32 | filled_length = int(self.width * self.progress)
33 | empty_length = self.width - filled_length
34 |
35 | message = self.message % self
36 | bar = self.fill * filled_length
37 | empty = self.empty_fill * empty_length
38 | suffix = self.suffix % self
39 | line = ''.join([message, self.bar_prefix, bar, empty, self.bar_suffix,
40 | suffix])
41 | self.writeln(line)
42 |
43 |
44 | class ChargingBar(Bar):
45 | suffix = '%(percent)d%%'
46 | bar_prefix = ' '
47 | bar_suffix = ' '
48 | empty_fill = u'∙'
49 | fill = u'█'
50 |
51 |
52 | class FillingSquaresBar(ChargingBar):
53 | empty_fill = u'▢'
54 | fill = u'▣'
55 |
56 |
57 | class FillingCirclesBar(ChargingBar):
58 | empty_fill = u'◯'
59 | fill = u'◉'
60 |
61 |
62 | class IncrementalBar(Bar):
63 | phases = (u' ', u'▏', u'▎', u'▍', u'▌', u'▋', u'▊', u'▉', u'█')
64 |
65 | def update(self):
66 | nphases = len(self.phases)
67 | expanded_length = int(nphases * self.width * self.progress)
68 | filled_length = int(self.width * self.progress)
69 | empty_length = self.width - filled_length
70 | phase = expanded_length - (filled_length * nphases)
71 |
72 | message = self.message % self
73 | bar = self.phases[-1] * filled_length
74 | current = self.phases[phase] if phase > 0 else ''
75 | empty = self.empty_fill * max(0, empty_length - len(current))
76 | suffix = self.suffix % self
77 | line = ''.join([message, self.bar_prefix, bar, current, empty,
78 | self.bar_suffix, suffix])
79 | self.writeln(line)
80 |
81 |
82 | class ShadyBar(IncrementalBar):
83 | phases = (u' ', u'░', u'▒', u'▓', u'█')
84 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/progress/counter.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # Copyright (c) 2012 Giorgos Verigakis
4 | #
5 | # Permission to use, copy, modify, and distribute this software for any
6 | # purpose with or without fee is hereby granted, provided that the above
7 | # copyright notice and this permission notice appear in all copies.
8 | #
9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 |
17 | from . import Infinite, Progress
18 | from .helpers import WriteMixin
19 |
20 |
21 | class Counter(WriteMixin, Infinite):
22 | message = ''
23 | hide_cursor = True
24 |
25 | def update(self):
26 | self.write(str(self.index))
27 |
28 |
29 | class Countdown(WriteMixin, Progress):
30 | hide_cursor = True
31 |
32 | def update(self):
33 | self.write(str(self.remaining))
34 |
35 |
36 | class Stack(WriteMixin, Progress):
37 | phases = (u' ', u'▁', u'▂', u'▃', u'▄', u'▅', u'▆', u'▇', u'█')
38 | hide_cursor = True
39 |
40 | def update(self):
41 | nphases = len(self.phases)
42 | i = min(nphases - 1, int(self.progress * nphases))
43 | self.write(self.phases[i])
44 |
45 |
46 | class Pie(Stack):
47 | phases = (u'○', u'◔', u'◑', u'◕', u'●')
48 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/progress/spinner.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # Copyright (c) 2012 Giorgos Verigakis
4 | #
5 | # Permission to use, copy, modify, and distribute this software for any
6 | # purpose with or without fee is hereby granted, provided that the above
7 | # copyright notice and this permission notice appear in all copies.
8 | #
9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 |
17 | from . import Infinite
18 | from .helpers import WriteMixin
19 |
20 |
21 | class Spinner(WriteMixin, Infinite):
22 | message = ''
23 | phases = ('-', '\\', '|', '/')
24 | hide_cursor = True
25 |
26 | def update(self):
27 | i = self.index % len(self.phases)
28 | self.write(self.phases[i])
29 |
30 |
31 | class PieSpinner(Spinner):
32 | phases = [u'◷', u'◶', u'◵', u'◴']
33 |
34 |
35 | class MoonSpinner(Spinner):
36 | phases = [u'◑', u'◒', u'◐', u'◓']
37 |
38 |
39 | class LineSpinner(Spinner):
40 | phases = [u'⎺', u'⎻', u'⎼', u'⎽', u'⎼', u'⎻']
41 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/re-vendor.py:
--------------------------------------------------------------------------------
1 | import os
2 | import sys
3 | import pip
4 | import glob
5 | import shutil
6 |
7 | here = os.path.abspath(os.path.dirname(__file__))
8 |
9 | def usage():
10 | print("Usage: re-vendor.py [clean|vendor]")
11 | sys.exit(1)
12 |
13 | def clean():
14 | for fn in os.listdir(here):
15 | dirname = os.path.join(here, fn)
16 | if os.path.isdir(dirname):
17 | shutil.rmtree(dirname)
18 | # six is a single file, not a package
19 | os.unlink(os.path.join(here, 'six.py'))
20 |
21 | def vendor():
22 | pip.main(['install', '-t', here, '-r', 'vendor.txt'])
23 | for dirname in glob.glob('*.egg-info'):
24 | shutil.rmtree(dirname)
25 |
26 | if __name__ == '__main__':
27 | if len(sys.argv) != 2:
28 | usage()
29 | if sys.argv[1] == 'clean':
30 | clean()
31 | elif sys.argv[1] == 'vendor':
32 | vendor()
33 | else:
34 | usage()
35 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # __
4 | # /__) _ _ _ _ _/ _
5 | # / ( (- (/ (/ (- _) / _)
6 | # /
7 |
8 | """
9 | Requests HTTP library
10 | ~~~~~~~~~~~~~~~~~~~~~
11 |
12 | Requests is an HTTP library, written in Python, for human beings. Basic GET
13 | usage:
14 |
15 | >>> import requests
16 | >>> r = requests.get('https://www.python.org')
17 | >>> r.status_code
18 | 200
19 | >>> 'Python is a programming language' in r.content
20 | True
21 |
22 | ... or POST:
23 |
24 | >>> payload = dict(key1='value1', key2='value2')
25 | >>> r = requests.post('http://httpbin.org/post', data=payload)
26 | >>> print(r.text)
27 | {
28 | ...
29 | "form": {
30 | "key2": "value2",
31 | "key1": "value1"
32 | },
33 | ...
34 | }
35 |
36 | The other HTTP methods are supported - see `requests.api`. Full documentation
37 | is at .
38 |
39 | :copyright: (c) 2016 by Kenneth Reitz.
40 | :license: Apache 2.0, see LICENSE for more details.
41 | """
42 |
43 | __title__ = 'requests'
44 | __version__ = '2.11.1'
45 | __build__ = 0x021101
46 | __author__ = 'Kenneth Reitz'
47 | __license__ = 'Apache 2.0'
48 | __copyright__ = 'Copyright 2016 Kenneth Reitz'
49 |
50 | # Attempt to enable urllib3's SNI support, if possible
51 | # Note: Patched by pip to prevent using the PyOpenSSL module. On Windows this
52 | # prevents upgrading cryptography.
53 | # try:
54 | # from .packages.urllib3.contrib import pyopenssl
55 | # pyopenssl.inject_into_urllib3()
56 | # except ImportError:
57 | # pass
58 |
59 | import warnings
60 |
61 | # urllib3's DependencyWarnings should be silenced.
62 | from .packages.urllib3.exceptions import DependencyWarning
63 | warnings.simplefilter('ignore', DependencyWarning)
64 |
65 | from . import utils
66 | from .models import Request, Response, PreparedRequest
67 | from .api import request, get, head, post, patch, put, delete, options
68 | from .sessions import session, Session
69 | from .status_codes import codes
70 | from .exceptions import (
71 | RequestException, Timeout, URLRequired,
72 | TooManyRedirects, HTTPError, ConnectionError,
73 | FileModeWarning, ConnectTimeout, ReadTimeout
74 | )
75 |
76 | # Set default logging handler to avoid "No handler found" warnings.
77 | import logging
78 | try: # Python 2.7+
79 | from logging import NullHandler
80 | except ImportError:
81 | class NullHandler(logging.Handler):
82 | def emit(self, record):
83 | pass
84 |
85 | logging.getLogger(__name__).addHandler(NullHandler())
86 |
87 | # FileModeWarnings go off per the default.
88 | warnings.simplefilter('default', FileModeWarning, append=True)
89 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/adapters.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/adapters.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/api.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/api.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/auth.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/auth.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/certs.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/certs.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/compat.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/compat.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/cookies.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/cookies.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/exceptions.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/exceptions.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/hooks.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/hooks.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/models.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/models.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/sessions.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/sessions.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/status_codes.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/status_codes.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/structures.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/structures.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/utils.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/__pycache__/utils.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/certs.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 |
4 | """
5 | requests.certs
6 | ~~~~~~~~~~~~~~
7 |
8 | This module returns the preferred default CA certificate bundle.
9 |
10 | If you are packaging Requests, e.g., for a Linux distribution or a managed
11 | environment, you can change the definition of where() to return a separately
12 | packaged CA bundle.
13 | """
14 | import os.path
15 |
16 | try:
17 | from certifi import where
18 | except ImportError:
19 | def where():
20 | """Return the preferred certificate bundle."""
21 | # vendored bundle inside Requests
22 | return os.path.join(os.path.dirname(__file__), 'cacert.pem')
23 |
24 | if __name__ == '__main__':
25 | print(where())
26 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/compat.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | """
4 | requests.compat
5 | ~~~~~~~~~~~~~~~
6 |
7 | This module handles import compatibility issues between Python 2 and
8 | Python 3.
9 | """
10 |
11 | from .packages import chardet
12 |
13 | import sys
14 |
15 | # -------
16 | # Pythons
17 | # -------
18 |
19 | # Syntax sugar.
20 | _ver = sys.version_info
21 |
22 | #: Python 2.x?
23 | is_py2 = (_ver[0] == 2)
24 |
25 | #: Python 3.x?
26 | is_py3 = (_ver[0] == 3)
27 |
28 | # Note: We've patched out simplejson support in pip because it prevents
29 | # upgrading simplejson on Windows.
30 | # try:
31 | # import simplejson as json
32 | # except (ImportError, SyntaxError):
33 | # # simplejson does not support Python 3.2, it throws a SyntaxError
34 | # # because of u'...' Unicode literals.
35 | import json
36 |
37 | # ---------
38 | # Specifics
39 | # ---------
40 |
41 | if is_py2:
42 | from urllib import quote, unquote, quote_plus, unquote_plus, urlencode, getproxies, proxy_bypass
43 | from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag
44 | from urllib2 import parse_http_list
45 | import cookielib
46 | from Cookie import Morsel
47 | from StringIO import StringIO
48 | from .packages.urllib3.packages.ordered_dict import OrderedDict
49 |
50 | builtin_str = str
51 | bytes = str
52 | str = unicode
53 | basestring = basestring
54 | numeric_types = (int, long, float)
55 |
56 | elif is_py3:
57 | from urllib.parse import urlparse, urlunparse, urljoin, urlsplit, urlencode, quote, unquote, quote_plus, unquote_plus, urldefrag
58 | from urllib.request import parse_http_list, getproxies, proxy_bypass
59 | from http import cookiejar as cookielib
60 | from http.cookies import Morsel
61 | from io import StringIO
62 | from collections import OrderedDict
63 |
64 | builtin_str = str
65 | str = str
66 | bytes = bytes
67 | basestring = (str, bytes)
68 | numeric_types = (int, float)
69 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/hooks.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | """
4 | requests.hooks
5 | ~~~~~~~~~~~~~~
6 |
7 | This module provides the capabilities for the Requests hooks system.
8 |
9 | Available hooks:
10 |
11 | ``response``:
12 | The response generated from a Request.
13 | """
14 | HOOKS = ['response']
15 |
16 |
17 | def default_hooks():
18 | return dict((event, []) for event in HOOKS)
19 |
20 | # TODO: response is the only one
21 |
22 |
23 | def dispatch_hook(key, hooks, hook_data, **kwargs):
24 | """Dispatches a hook dictionary on a given piece of data."""
25 | hooks = hooks or dict()
26 | hooks = hooks.get(key)
27 | if hooks:
28 | if hasattr(hooks, '__call__'):
29 | hooks = [hooks]
30 | for hook in hooks:
31 | _hook_data = hook(hook_data, **kwargs)
32 | if _hook_data is not None:
33 | hook_data = _hook_data
34 | return hook_data
35 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/__init__.py:
--------------------------------------------------------------------------------
1 | '''
2 | Debian and other distributions "unbundle" requests' vendored dependencies, and
3 | rewrite all imports to use the global versions of ``urllib3`` and ``chardet``.
4 | The problem with this is that not only requests itself imports those
5 | dependencies, but third-party code outside of the distros' control too.
6 |
7 | In reaction to these problems, the distro maintainers replaced
8 | ``requests.packages`` with a magical "stub module" that imports the correct
9 | modules. The implementations were varying in quality and all had severe
10 | problems. For example, a symlink (or hardlink) that links the correct modules
11 | into place introduces problems regarding object identity, since you now have
12 | two modules in `sys.modules` with the same API, but different identities::
13 |
14 | requests.packages.urllib3 is not urllib3
15 |
16 | With version ``2.5.2``, requests started to maintain its own stub, so that
17 | distro-specific breakage would be reduced to a minimum, even though the whole
18 | issue is not requests' fault in the first place. See
19 | https://github.com/kennethreitz/requests/pull/2375 for the corresponding pull
20 | request.
21 | '''
22 |
23 | from __future__ import absolute_import
24 | import sys
25 |
26 | try:
27 | from . import urllib3
28 | except ImportError:
29 | import urllib3
30 | sys.modules['%s.urllib3' % __name__] = urllib3
31 |
32 | try:
33 | from . import chardet
34 | except ImportError:
35 | import chardet
36 | sys.modules['%s.chardet' % __name__] = chardet
37 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/chardet/__init__.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # This library is free software; you can redistribute it and/or
3 | # modify it under the terms of the GNU Lesser General Public
4 | # License as published by the Free Software Foundation; either
5 | # version 2.1 of the License, or (at your option) any later version.
6 | #
7 | # This library is distributed in the hope that it will be useful,
8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 | # Lesser General Public License for more details.
11 | #
12 | # You should have received a copy of the GNU Lesser General Public
13 | # License along with this library; if not, write to the Free Software
14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
15 | # 02110-1301 USA
16 | ######################### END LICENSE BLOCK #########################
17 |
18 | __version__ = "2.3.0"
19 | from sys import version_info
20 |
21 |
22 | def detect(aBuf):
23 | if ((version_info < (3, 0) and isinstance(aBuf, unicode)) or
24 | (version_info >= (3, 0) and not isinstance(aBuf, bytes))):
25 | raise ValueError('Expected a bytes object, not a unicode object')
26 |
27 | from . import universaldetector
28 | u = universaldetector.UniversalDetector()
29 | u.reset()
30 | u.feed(aBuf)
31 | u.close()
32 | return u.result
33 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/chardet/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/chardet/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/chardet/big5prober.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is Mozilla Communicator client code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 1998
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | #
12 | # This library is free software; you can redistribute it and/or
13 | # modify it under the terms of the GNU Lesser General Public
14 | # License as published by the Free Software Foundation; either
15 | # version 2.1 of the License, or (at your option) any later version.
16 | #
17 | # This library is distributed in the hope that it will be useful,
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | # Lesser General Public License for more details.
21 | #
22 | # You should have received a copy of the GNU Lesser General Public
23 | # License along with this library; if not, write to the Free Software
24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 | # 02110-1301 USA
26 | ######################### END LICENSE BLOCK #########################
27 |
28 | from .mbcharsetprober import MultiByteCharSetProber
29 | from .codingstatemachine import CodingStateMachine
30 | from .chardistribution import Big5DistributionAnalysis
31 | from .mbcssm import Big5SMModel
32 |
33 |
34 | class Big5Prober(MultiByteCharSetProber):
35 | def __init__(self):
36 | MultiByteCharSetProber.__init__(self)
37 | self._mCodingSM = CodingStateMachine(Big5SMModel)
38 | self._mDistributionAnalyzer = Big5DistributionAnalysis()
39 | self.reset()
40 |
41 | def get_charset_name(self):
42 | return "Big5"
43 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/chardet/chardetect.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | """
3 | Script which takes one or more file paths and reports on their detected
4 | encodings
5 |
6 | Example::
7 |
8 | % chardetect somefile someotherfile
9 | somefile: windows-1252 with confidence 0.5
10 | someotherfile: ascii with confidence 1.0
11 |
12 | If no paths are provided, it takes its input from stdin.
13 |
14 | """
15 |
16 | from __future__ import absolute_import, print_function, unicode_literals
17 |
18 | import argparse
19 | import sys
20 | from io import open
21 |
22 | from chardet import __version__
23 | from chardet.universaldetector import UniversalDetector
24 |
25 |
26 | def description_of(lines, name='stdin'):
27 | """
28 | Return a string describing the probable encoding of a file or
29 | list of strings.
30 |
31 | :param lines: The lines to get the encoding of.
32 | :type lines: Iterable of bytes
33 | :param name: Name of file or collection of lines
34 | :type name: str
35 | """
36 | u = UniversalDetector()
37 | for line in lines:
38 | u.feed(line)
39 | u.close()
40 | result = u.result
41 | if result['encoding']:
42 | return '{0}: {1} with confidence {2}'.format(name, result['encoding'],
43 | result['confidence'])
44 | else:
45 | return '{0}: no result'.format(name)
46 |
47 |
48 | def main(argv=None):
49 | '''
50 | Handles command line arguments and gets things started.
51 |
52 | :param argv: List of arguments, as if specified on the command-line.
53 | If None, ``sys.argv[1:]`` is used instead.
54 | :type argv: list of str
55 | '''
56 | # Get command line arguments
57 | parser = argparse.ArgumentParser(
58 | description="Takes one or more file paths and reports their detected \
59 | encodings",
60 | formatter_class=argparse.ArgumentDefaultsHelpFormatter,
61 | conflict_handler='resolve')
62 | parser.add_argument('input',
63 | help='File whose encoding we would like to determine.',
64 | type=argparse.FileType('rb'), nargs='*',
65 | default=[sys.stdin])
66 | parser.add_argument('--version', action='version',
67 | version='%(prog)s {0}'.format(__version__))
68 | args = parser.parse_args(argv)
69 |
70 | for f in args.input:
71 | if f.isatty():
72 | print("You are running chardetect interactively. Press " +
73 | "CTRL-D twice at the start of a blank line to signal the " +
74 | "end of your input. If you want help, run chardetect " +
75 | "--help\n", file=sys.stderr)
76 | print(description_of(f, f.name))
77 |
78 |
79 | if __name__ == '__main__':
80 | main()
81 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/chardet/charsetprober.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is Mozilla Universal charset detector code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 2001
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | # Shy Shalom - original C code
12 | #
13 | # This library is free software; you can redistribute it and/or
14 | # modify it under the terms of the GNU Lesser General Public
15 | # License as published by the Free Software Foundation; either
16 | # version 2.1 of the License, or (at your option) any later version.
17 | #
18 | # This library is distributed in the hope that it will be useful,
19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 | # Lesser General Public License for more details.
22 | #
23 | # You should have received a copy of the GNU Lesser General Public
24 | # License along with this library; if not, write to the Free Software
25 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
26 | # 02110-1301 USA
27 | ######################### END LICENSE BLOCK #########################
28 |
29 | from . import constants
30 | import re
31 |
32 |
33 | class CharSetProber:
34 | def __init__(self):
35 | pass
36 |
37 | def reset(self):
38 | self._mState = constants.eDetecting
39 |
40 | def get_charset_name(self):
41 | return None
42 |
43 | def feed(self, aBuf):
44 | pass
45 |
46 | def get_state(self):
47 | return self._mState
48 |
49 | def get_confidence(self):
50 | return 0.0
51 |
52 | def filter_high_bit_only(self, aBuf):
53 | aBuf = re.sub(b'([\x00-\x7F])+', b' ', aBuf)
54 | return aBuf
55 |
56 | def filter_without_english_letters(self, aBuf):
57 | aBuf = re.sub(b'([A-Za-z])+', b' ', aBuf)
58 | return aBuf
59 |
60 | def filter_with_english_letters(self, aBuf):
61 | # TODO
62 | return aBuf
63 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/chardet/codingstatemachine.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is mozilla.org code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 1998
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | #
12 | # This library is free software; you can redistribute it and/or
13 | # modify it under the terms of the GNU Lesser General Public
14 | # License as published by the Free Software Foundation; either
15 | # version 2.1 of the License, or (at your option) any later version.
16 | #
17 | # This library is distributed in the hope that it will be useful,
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | # Lesser General Public License for more details.
21 | #
22 | # You should have received a copy of the GNU Lesser General Public
23 | # License along with this library; if not, write to the Free Software
24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 | # 02110-1301 USA
26 | ######################### END LICENSE BLOCK #########################
27 |
28 | from .constants import eStart
29 | from .compat import wrap_ord
30 |
31 |
32 | class CodingStateMachine:
33 | def __init__(self, sm):
34 | self._mModel = sm
35 | self._mCurrentBytePos = 0
36 | self._mCurrentCharLen = 0
37 | self.reset()
38 |
39 | def reset(self):
40 | self._mCurrentState = eStart
41 |
42 | def next_state(self, c):
43 | # for each byte we get its class
44 | # if it is first byte, we also get byte length
45 | # PY3K: aBuf is a byte stream, so c is an int, not a byte
46 | byteCls = self._mModel['classTable'][wrap_ord(c)]
47 | if self._mCurrentState == eStart:
48 | self._mCurrentBytePos = 0
49 | self._mCurrentCharLen = self._mModel['charLenTable'][byteCls]
50 | # from byte's class and stateTable, we get its next state
51 | curr_state = (self._mCurrentState * self._mModel['classFactor']
52 | + byteCls)
53 | self._mCurrentState = self._mModel['stateTable'][curr_state]
54 | self._mCurrentBytePos += 1
55 | return self._mCurrentState
56 |
57 | def get_current_charlen(self):
58 | return self._mCurrentCharLen
59 |
60 | def get_coding_state_machine(self):
61 | return self._mModel['name']
62 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/chardet/compat.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # Contributor(s):
3 | # Ian Cordasco - port to Python
4 | #
5 | # This library is free software; you can redistribute it and/or
6 | # modify it under the terms of the GNU Lesser General Public
7 | # License as published by the Free Software Foundation; either
8 | # version 2.1 of the License, or (at your option) any later version.
9 | #
10 | # This library is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | # Lesser General Public License for more details.
14 | #
15 | # You should have received a copy of the GNU Lesser General Public
16 | # License along with this library; if not, write to the Free Software
17 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18 | # 02110-1301 USA
19 | ######################### END LICENSE BLOCK #########################
20 |
21 | import sys
22 |
23 |
24 | if sys.version_info < (3, 0):
25 | base_str = (str, unicode)
26 | else:
27 | base_str = (bytes, str)
28 |
29 |
30 | def wrap_ord(a):
31 | if sys.version_info < (3, 0) and isinstance(a, base_str):
32 | return ord(a)
33 | else:
34 | return a
35 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/chardet/constants.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is Mozilla Universal charset detector code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 2001
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | # Shy Shalom - original C code
12 | #
13 | # This library is free software; you can redistribute it and/or
14 | # modify it under the terms of the GNU Lesser General Public
15 | # License as published by the Free Software Foundation; either
16 | # version 2.1 of the License, or (at your option) any later version.
17 | #
18 | # This library is distributed in the hope that it will be useful,
19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 | # Lesser General Public License for more details.
22 | #
23 | # You should have received a copy of the GNU Lesser General Public
24 | # License along with this library; if not, write to the Free Software
25 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
26 | # 02110-1301 USA
27 | ######################### END LICENSE BLOCK #########################
28 |
29 | _debug = 0
30 |
31 | eDetecting = 0
32 | eFoundIt = 1
33 | eNotMe = 2
34 |
35 | eStart = 0
36 | eError = 1
37 | eItsMe = 2
38 |
39 | SHORTCUT_THRESHOLD = 0.95
40 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/chardet/cp949prober.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is mozilla.org code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 1998
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | #
12 | # This library is free software; you can redistribute it and/or
13 | # modify it under the terms of the GNU Lesser General Public
14 | # License as published by the Free Software Foundation; either
15 | # version 2.1 of the License, or (at your option) any later version.
16 | #
17 | # This library is distributed in the hope that it will be useful,
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | # Lesser General Public License for more details.
21 | #
22 | # You should have received a copy of the GNU Lesser General Public
23 | # License along with this library; if not, write to the Free Software
24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 | # 02110-1301 USA
26 | ######################### END LICENSE BLOCK #########################
27 |
28 | from .mbcharsetprober import MultiByteCharSetProber
29 | from .codingstatemachine import CodingStateMachine
30 | from .chardistribution import EUCKRDistributionAnalysis
31 | from .mbcssm import CP949SMModel
32 |
33 |
34 | class CP949Prober(MultiByteCharSetProber):
35 | def __init__(self):
36 | MultiByteCharSetProber.__init__(self)
37 | self._mCodingSM = CodingStateMachine(CP949SMModel)
38 | # NOTE: CP949 is a superset of EUC-KR, so the distribution should be
39 | # not different.
40 | self._mDistributionAnalyzer = EUCKRDistributionAnalysis()
41 | self.reset()
42 |
43 | def get_charset_name(self):
44 | return "CP949"
45 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/chardet/euckrprober.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is mozilla.org code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 1998
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | #
12 | # This library is free software; you can redistribute it and/or
13 | # modify it under the terms of the GNU Lesser General Public
14 | # License as published by the Free Software Foundation; either
15 | # version 2.1 of the License, or (at your option) any later version.
16 | #
17 | # This library is distributed in the hope that it will be useful,
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | # Lesser General Public License for more details.
21 | #
22 | # You should have received a copy of the GNU Lesser General Public
23 | # License along with this library; if not, write to the Free Software
24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 | # 02110-1301 USA
26 | ######################### END LICENSE BLOCK #########################
27 |
28 | from .mbcharsetprober import MultiByteCharSetProber
29 | from .codingstatemachine import CodingStateMachine
30 | from .chardistribution import EUCKRDistributionAnalysis
31 | from .mbcssm import EUCKRSMModel
32 |
33 |
34 | class EUCKRProber(MultiByteCharSetProber):
35 | def __init__(self):
36 | MultiByteCharSetProber.__init__(self)
37 | self._mCodingSM = CodingStateMachine(EUCKRSMModel)
38 | self._mDistributionAnalyzer = EUCKRDistributionAnalysis()
39 | self.reset()
40 |
41 | def get_charset_name(self):
42 | return "EUC-KR"
43 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/chardet/euctwprober.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is mozilla.org code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 1998
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | #
12 | # This library is free software; you can redistribute it and/or
13 | # modify it under the terms of the GNU Lesser General Public
14 | # License as published by the Free Software Foundation; either
15 | # version 2.1 of the License, or (at your option) any later version.
16 | #
17 | # This library is distributed in the hope that it will be useful,
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | # Lesser General Public License for more details.
21 | #
22 | # You should have received a copy of the GNU Lesser General Public
23 | # License along with this library; if not, write to the Free Software
24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 | # 02110-1301 USA
26 | ######################### END LICENSE BLOCK #########################
27 |
28 | from .mbcharsetprober import MultiByteCharSetProber
29 | from .codingstatemachine import CodingStateMachine
30 | from .chardistribution import EUCTWDistributionAnalysis
31 | from .mbcssm import EUCTWSMModel
32 |
33 | class EUCTWProber(MultiByteCharSetProber):
34 | def __init__(self):
35 | MultiByteCharSetProber.__init__(self)
36 | self._mCodingSM = CodingStateMachine(EUCTWSMModel)
37 | self._mDistributionAnalyzer = EUCTWDistributionAnalysis()
38 | self.reset()
39 |
40 | def get_charset_name(self):
41 | return "EUC-TW"
42 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/chardet/gb2312prober.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is mozilla.org code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 1998
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | #
12 | # This library is free software; you can redistribute it and/or
13 | # modify it under the terms of the GNU Lesser General Public
14 | # License as published by the Free Software Foundation; either
15 | # version 2.1 of the License, or (at your option) any later version.
16 | #
17 | # This library is distributed in the hope that it will be useful,
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | # Lesser General Public License for more details.
21 | #
22 | # You should have received a copy of the GNU Lesser General Public
23 | # License along with this library; if not, write to the Free Software
24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 | # 02110-1301 USA
26 | ######################### END LICENSE BLOCK #########################
27 |
28 | from .mbcharsetprober import MultiByteCharSetProber
29 | from .codingstatemachine import CodingStateMachine
30 | from .chardistribution import GB2312DistributionAnalysis
31 | from .mbcssm import GB2312SMModel
32 |
33 | class GB2312Prober(MultiByteCharSetProber):
34 | def __init__(self):
35 | MultiByteCharSetProber.__init__(self)
36 | self._mCodingSM = CodingStateMachine(GB2312SMModel)
37 | self._mDistributionAnalyzer = GB2312DistributionAnalysis()
38 | self.reset()
39 |
40 | def get_charset_name(self):
41 | return "GB2312"
42 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/chardet/mbcsgroupprober.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is Mozilla Universal charset detector code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 2001
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | # Shy Shalom - original C code
12 | # Proofpoint, Inc.
13 | #
14 | # This library is free software; you can redistribute it and/or
15 | # modify it under the terms of the GNU Lesser General Public
16 | # License as published by the Free Software Foundation; either
17 | # version 2.1 of the License, or (at your option) any later version.
18 | #
19 | # This library is distributed in the hope that it will be useful,
20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 | # Lesser General Public License for more details.
23 | #
24 | # You should have received a copy of the GNU Lesser General Public
25 | # License along with this library; if not, write to the Free Software
26 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
27 | # 02110-1301 USA
28 | ######################### END LICENSE BLOCK #########################
29 |
30 | from .charsetgroupprober import CharSetGroupProber
31 | from .utf8prober import UTF8Prober
32 | from .sjisprober import SJISProber
33 | from .eucjpprober import EUCJPProber
34 | from .gb2312prober import GB2312Prober
35 | from .euckrprober import EUCKRProber
36 | from .cp949prober import CP949Prober
37 | from .big5prober import Big5Prober
38 | from .euctwprober import EUCTWProber
39 |
40 |
41 | class MBCSGroupProber(CharSetGroupProber):
42 | def __init__(self):
43 | CharSetGroupProber.__init__(self)
44 | self._mProbers = [
45 | UTF8Prober(),
46 | SJISProber(),
47 | EUCJPProber(),
48 | GB2312Prober(),
49 | EUCKRProber(),
50 | CP949Prober(),
51 | Big5Prober(),
52 | EUCTWProber()
53 | ]
54 | self.reset()
55 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/chardet/utf8prober.py:
--------------------------------------------------------------------------------
1 | ######################## BEGIN LICENSE BLOCK ########################
2 | # The Original Code is mozilla.org code.
3 | #
4 | # The Initial Developer of the Original Code is
5 | # Netscape Communications Corporation.
6 | # Portions created by the Initial Developer are Copyright (C) 1998
7 | # the Initial Developer. All Rights Reserved.
8 | #
9 | # Contributor(s):
10 | # Mark Pilgrim - port to Python
11 | #
12 | # This library is free software; you can redistribute it and/or
13 | # modify it under the terms of the GNU Lesser General Public
14 | # License as published by the Free Software Foundation; either
15 | # version 2.1 of the License, or (at your option) any later version.
16 | #
17 | # This library is distributed in the hope that it will be useful,
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | # Lesser General Public License for more details.
21 | #
22 | # You should have received a copy of the GNU Lesser General Public
23 | # License along with this library; if not, write to the Free Software
24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25 | # 02110-1301 USA
26 | ######################### END LICENSE BLOCK #########################
27 |
28 | from . import constants
29 | from .charsetprober import CharSetProber
30 | from .codingstatemachine import CodingStateMachine
31 | from .mbcssm import UTF8SMModel
32 |
33 | ONE_CHAR_PROB = 0.5
34 |
35 |
36 | class UTF8Prober(CharSetProber):
37 | def __init__(self):
38 | CharSetProber.__init__(self)
39 | self._mCodingSM = CodingStateMachine(UTF8SMModel)
40 | self.reset()
41 |
42 | def reset(self):
43 | CharSetProber.reset(self)
44 | self._mCodingSM.reset()
45 | self._mNumOfMBChar = 0
46 |
47 | def get_charset_name(self):
48 | return "utf-8"
49 |
50 | def feed(self, aBuf):
51 | for c in aBuf:
52 | codingState = self._mCodingSM.next_state(c)
53 | if codingState == constants.eError:
54 | self._mState = constants.eNotMe
55 | break
56 | elif codingState == constants.eItsMe:
57 | self._mState = constants.eFoundIt
58 | break
59 | elif codingState == constants.eStart:
60 | if self._mCodingSM.get_current_charlen() >= 2:
61 | self._mNumOfMBChar += 1
62 |
63 | if self.get_state() == constants.eDetecting:
64 | if self.get_confidence() > constants.SHORTCUT_THRESHOLD:
65 | self._mState = constants.eFoundIt
66 |
67 | return self.get_state()
68 |
69 | def get_confidence(self):
70 | unlike = 0.99
71 | if self._mNumOfMBChar < 6:
72 | for i in range(0, self._mNumOfMBChar):
73 | unlike = unlike * ONE_CHAR_PROB
74 | return 1.0 - unlike
75 | else:
76 | return unlike
77 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/__pycache__/_collections.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/__pycache__/_collections.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/__pycache__/connection.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/__pycache__/connection.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/__pycache__/connectionpool.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/__pycache__/connectionpool.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/__pycache__/exceptions.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/__pycache__/exceptions.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/__pycache__/fields.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/__pycache__/fields.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/__pycache__/filepost.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/__pycache__/filepost.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/__pycache__/poolmanager.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/__pycache__/poolmanager.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/__pycache__/request.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/__pycache__/request.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/__pycache__/response.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/__pycache__/response.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/contrib/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/contrib/__init__.py
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/contrib/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/contrib/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/contrib/__pycache__/socks.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/contrib/__pycache__/socks.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/filepost.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 | import codecs
3 |
4 | from uuid import uuid4
5 | from io import BytesIO
6 |
7 | from .packages import six
8 | from .packages.six import b
9 | from .fields import RequestField
10 |
11 | writer = codecs.lookup('utf-8')[3]
12 |
13 |
14 | def choose_boundary():
15 | """
16 | Our embarassingly-simple replacement for mimetools.choose_boundary.
17 | """
18 | return uuid4().hex
19 |
20 |
21 | def iter_field_objects(fields):
22 | """
23 | Iterate over fields.
24 |
25 | Supports list of (k, v) tuples and dicts, and lists of
26 | :class:`~urllib3.fields.RequestField`.
27 |
28 | """
29 | if isinstance(fields, dict):
30 | i = six.iteritems(fields)
31 | else:
32 | i = iter(fields)
33 |
34 | for field in i:
35 | if isinstance(field, RequestField):
36 | yield field
37 | else:
38 | yield RequestField.from_tuples(*field)
39 |
40 |
41 | def iter_fields(fields):
42 | """
43 | .. deprecated:: 1.6
44 |
45 | Iterate over fields.
46 |
47 | The addition of :class:`~urllib3.fields.RequestField` makes this function
48 | obsolete. Instead, use :func:`iter_field_objects`, which returns
49 | :class:`~urllib3.fields.RequestField` objects.
50 |
51 | Supports list of (k, v) tuples and dicts.
52 | """
53 | if isinstance(fields, dict):
54 | return ((k, v) for k, v in six.iteritems(fields))
55 |
56 | return ((k, v) for k, v in fields)
57 |
58 |
59 | def encode_multipart_formdata(fields, boundary=None):
60 | """
61 | Encode a dictionary of ``fields`` using the multipart/form-data MIME format.
62 |
63 | :param fields:
64 | Dictionary of fields or list of (key, :class:`~urllib3.fields.RequestField`).
65 |
66 | :param boundary:
67 | If not specified, then a random boundary will be generated using
68 | :func:`mimetools.choose_boundary`.
69 | """
70 | body = BytesIO()
71 | if boundary is None:
72 | boundary = choose_boundary()
73 |
74 | for field in iter_field_objects(fields):
75 | body.write(b('--%s\r\n' % (boundary)))
76 |
77 | writer(body).write(field.render_headers())
78 | data = field.data
79 |
80 | if isinstance(data, int):
81 | data = str(data) # Backwards compatibility
82 |
83 | if isinstance(data, six.text_type):
84 | writer(body).write(data)
85 | else:
86 | body.write(data)
87 |
88 | body.write(b'\r\n')
89 |
90 | body.write(b('--%s--\r\n' % (boundary)))
91 |
92 | content_type = str('multipart/form-data; boundary=%s' % boundary)
93 |
94 | return body.getvalue(), content_type
95 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/packages/__init__.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 |
3 | from . import ssl_match_hostname
4 |
5 | __all__ = ('ssl_match_hostname', )
6 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/packages/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/packages/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/packages/__pycache__/six.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/packages/__pycache__/six.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py:
--------------------------------------------------------------------------------
1 | try:
2 | # Python 3.2+
3 | from ssl import CertificateError, match_hostname
4 | except ImportError:
5 | try:
6 | # Backport of the function from a pypi module
7 | from backports.ssl_match_hostname import CertificateError, match_hostname
8 | except ImportError:
9 | # Our vendored copy
10 | from ._implementation import CertificateError, match_hostname
11 |
12 | # Not needed, but documenting what we provide.
13 | __all__ = ('CertificateError', 'match_hostname')
14 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/util/__init__.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 | # For backwards compatibility, provide imports that used to be here.
3 | from .connection import is_connection_dropped
4 | from .request import make_headers
5 | from .response import is_fp_closed
6 | from .ssl_ import (
7 | SSLContext,
8 | HAS_SNI,
9 | IS_PYOPENSSL,
10 | assert_fingerprint,
11 | resolve_cert_reqs,
12 | resolve_ssl_version,
13 | ssl_wrap_socket,
14 | )
15 | from .timeout import (
16 | current_time,
17 | Timeout,
18 | )
19 |
20 | from .retry import Retry
21 | from .url import (
22 | get_host,
23 | parse_url,
24 | split_first,
25 | Url,
26 | )
27 |
28 | __all__ = (
29 | 'HAS_SNI',
30 | 'IS_PYOPENSSL',
31 | 'SSLContext',
32 | 'Retry',
33 | 'Timeout',
34 | 'Url',
35 | 'assert_fingerprint',
36 | 'current_time',
37 | 'is_connection_dropped',
38 | 'is_fp_closed',
39 | 'get_host',
40 | 'parse_url',
41 | 'make_headers',
42 | 'resolve_cert_reqs',
43 | 'resolve_ssl_version',
44 | 'split_first',
45 | 'ssl_wrap_socket',
46 | )
47 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/util/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/util/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/util/__pycache__/connection.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/util/__pycache__/connection.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/util/__pycache__/request.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/util/__pycache__/request.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/util/__pycache__/response.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/util/__pycache__/response.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/util/__pycache__/retry.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/util/__pycache__/retry.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/util/__pycache__/ssl_.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/util/__pycache__/ssl_.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/util/__pycache__/timeout.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/util/__pycache__/timeout.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/util/__pycache__/url.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/util/__pycache__/url.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/util/request.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 | from base64 import b64encode
3 |
4 | from ..packages.six import b
5 |
6 | ACCEPT_ENCODING = 'gzip,deflate'
7 |
8 |
9 | def make_headers(keep_alive=None, accept_encoding=None, user_agent=None,
10 | basic_auth=None, proxy_basic_auth=None, disable_cache=None):
11 | """
12 | Shortcuts for generating request headers.
13 |
14 | :param keep_alive:
15 | If ``True``, adds 'connection: keep-alive' header.
16 |
17 | :param accept_encoding:
18 | Can be a boolean, list, or string.
19 | ``True`` translates to 'gzip,deflate'.
20 | List will get joined by comma.
21 | String will be used as provided.
22 |
23 | :param user_agent:
24 | String representing the user-agent you want, such as
25 | "python-urllib3/0.6"
26 |
27 | :param basic_auth:
28 | Colon-separated username:password string for 'authorization: basic ...'
29 | auth header.
30 |
31 | :param proxy_basic_auth:
32 | Colon-separated username:password string for 'proxy-authorization: basic ...'
33 | auth header.
34 |
35 | :param disable_cache:
36 | If ``True``, adds 'cache-control: no-cache' header.
37 |
38 | Example::
39 |
40 | >>> make_headers(keep_alive=True, user_agent="Batman/1.0")
41 | {'connection': 'keep-alive', 'user-agent': 'Batman/1.0'}
42 | >>> make_headers(accept_encoding=True)
43 | {'accept-encoding': 'gzip,deflate'}
44 | """
45 | headers = {}
46 | if accept_encoding:
47 | if isinstance(accept_encoding, str):
48 | pass
49 | elif isinstance(accept_encoding, list):
50 | accept_encoding = ','.join(accept_encoding)
51 | else:
52 | accept_encoding = ACCEPT_ENCODING
53 | headers['accept-encoding'] = accept_encoding
54 |
55 | if user_agent:
56 | headers['user-agent'] = user_agent
57 |
58 | if keep_alive:
59 | headers['connection'] = 'keep-alive'
60 |
61 | if basic_auth:
62 | headers['authorization'] = 'Basic ' + \
63 | b64encode(b(basic_auth)).decode('utf-8')
64 |
65 | if proxy_basic_auth:
66 | headers['proxy-authorization'] = 'Basic ' + \
67 | b64encode(b(proxy_basic_auth)).decode('utf-8')
68 |
69 | if disable_cache:
70 | headers['cache-control'] = 'no-cache'
71 |
72 | return headers
73 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/requests/packages/urllib3/util/response.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 | from ..packages.six.moves import http_client as httplib
3 |
4 | from ..exceptions import HeaderParsingError
5 |
6 |
7 | def is_fp_closed(obj):
8 | """
9 | Checks whether a given file-like object is closed.
10 |
11 | :param obj:
12 | The file-like object to check.
13 | """
14 |
15 | try:
16 | # Check via the official file-like-object way.
17 | return obj.closed
18 | except AttributeError:
19 | pass
20 |
21 | try:
22 | # Check if the object is a container for another file-like object that
23 | # gets released on exhaustion (e.g. HTTPResponse).
24 | return obj.fp is None
25 | except AttributeError:
26 | pass
27 |
28 | raise ValueError("Unable to determine whether fp is closed.")
29 |
30 |
31 | def assert_header_parsing(headers):
32 | """
33 | Asserts whether all headers have been successfully parsed.
34 | Extracts encountered errors from the result of parsing headers.
35 |
36 | Only works on Python 3.
37 |
38 | :param headers: Headers to verify.
39 | :type headers: `httplib.HTTPMessage`.
40 |
41 | :raises urllib3.exceptions.HeaderParsingError:
42 | If parsing errors are found.
43 | """
44 |
45 | # This will fail silently if we pass in the wrong kind of parameter.
46 | # To make debugging easier add an explicit check.
47 | if not isinstance(headers, httplib.HTTPMessage):
48 | raise TypeError('expected httplib.Message, got {0}.'.format(
49 | type(headers)))
50 |
51 | defects = getattr(headers, 'defects', None)
52 | get_payload = getattr(headers, 'get_payload', None)
53 |
54 | unparsed_data = None
55 | if get_payload: # Platform-specific: Python 3.
56 | unparsed_data = get_payload()
57 |
58 | if defects or unparsed_data:
59 | raise HeaderParsingError(defects=defects, unparsed_data=unparsed_data)
60 |
61 |
62 | def is_response_to_head(response):
63 | """
64 | Checks whether the request of a response has been a HEAD-request.
65 | Handles the quirks of AppEngine.
66 |
67 | :param conn:
68 | :type conn: :class:`httplib.HTTPResponse`
69 | """
70 | # FIXME: Can we do this somehow without accessing private httplib _method?
71 | method = response._method
72 | if isinstance(method, int): # Platform-specific: Appengine
73 | return method == 3
74 | return method.upper() == 'HEAD'
75 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/webencodings/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/webencodings/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/webencodings/__pycache__/labels.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/webencodings/__pycache__/labels.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/_vendor/webencodings/mklabels.py:
--------------------------------------------------------------------------------
1 | """
2 |
3 | webencodings.mklabels
4 | ~~~~~~~~~~~~~~~~~~~~~
5 |
6 | Regenarate the webencodings.labels module.
7 |
8 | :copyright: Copyright 2012 by Simon Sapin
9 | :license: BSD, see LICENSE for details.
10 |
11 | """
12 |
13 | import json
14 | try:
15 | from urllib import urlopen
16 | except ImportError:
17 | from urllib.request import urlopen
18 |
19 |
20 | def assert_lower(string):
21 | assert string == string.lower()
22 | return string
23 |
24 |
25 | def generate(url):
26 | parts = ['''\
27 | """
28 |
29 | webencodings.labels
30 | ~~~~~~~~~~~~~~~~~~~
31 |
32 | Map encoding labels to their name.
33 |
34 | :copyright: Copyright 2012 by Simon Sapin
35 | :license: BSD, see LICENSE for details.
36 |
37 | """
38 |
39 | # XXX Do not edit!
40 | # This file is automatically generated by mklabels.py
41 |
42 | LABELS = {
43 | ''']
44 | labels = [
45 | (repr(assert_lower(label)).lstrip('u'),
46 | repr(encoding['name']).lstrip('u'))
47 | for category in json.loads(urlopen(url).read().decode('ascii'))
48 | for encoding in category['encodings']
49 | for label in encoding['labels']]
50 | max_len = max(len(label) for label, name in labels)
51 | parts.extend(
52 | ' %s:%s %s,\n' % (label, ' ' * (max_len - len(label)), name)
53 | for label, name in labels)
54 | parts.append('}')
55 | return ''.join(parts)
56 |
57 |
58 | if __name__ == '__main__':
59 | print(generate('http://encoding.spec.whatwg.org/encodings.json'))
60 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__init__.py:
--------------------------------------------------------------------------------
1 | """
2 | Package containing all pip commands
3 | """
4 | from __future__ import absolute_import
5 |
6 | from pip.commands.completion import CompletionCommand
7 | from pip.commands.download import DownloadCommand
8 | from pip.commands.freeze import FreezeCommand
9 | from pip.commands.hash import HashCommand
10 | from pip.commands.help import HelpCommand
11 | from pip.commands.list import ListCommand
12 | from pip.commands.check import CheckCommand
13 | from pip.commands.search import SearchCommand
14 | from pip.commands.show import ShowCommand
15 | from pip.commands.install import InstallCommand
16 | from pip.commands.uninstall import UninstallCommand
17 | from pip.commands.wheel import WheelCommand
18 |
19 |
20 | commands_dict = {
21 | CompletionCommand.name: CompletionCommand,
22 | FreezeCommand.name: FreezeCommand,
23 | HashCommand.name: HashCommand,
24 | HelpCommand.name: HelpCommand,
25 | SearchCommand.name: SearchCommand,
26 | ShowCommand.name: ShowCommand,
27 | InstallCommand.name: InstallCommand,
28 | UninstallCommand.name: UninstallCommand,
29 | DownloadCommand.name: DownloadCommand,
30 | ListCommand.name: ListCommand,
31 | CheckCommand.name: CheckCommand,
32 | WheelCommand.name: WheelCommand,
33 | }
34 |
35 |
36 | commands_order = [
37 | InstallCommand,
38 | DownloadCommand,
39 | UninstallCommand,
40 | FreezeCommand,
41 | ListCommand,
42 | ShowCommand,
43 | CheckCommand,
44 | SearchCommand,
45 | WheelCommand,
46 | HashCommand,
47 | CompletionCommand,
48 | HelpCommand,
49 | ]
50 |
51 |
52 | def get_summaries(ordered=True):
53 | """Yields sorted (command name, command summary) tuples."""
54 |
55 | if ordered:
56 | cmditems = _sort_commands(commands_dict, commands_order)
57 | else:
58 | cmditems = commands_dict.items()
59 |
60 | for name, command_class in cmditems:
61 | yield (name, command_class.summary)
62 |
63 |
64 | def get_similar_commands(name):
65 | """Command name auto-correct."""
66 | from difflib import get_close_matches
67 |
68 | name = name.lower()
69 |
70 | close_commands = get_close_matches(name, commands_dict.keys())
71 |
72 | if close_commands:
73 | return close_commands[0]
74 | else:
75 | return False
76 |
77 |
78 | def _sort_commands(cmddict, order):
79 | def keyfn(key):
80 | try:
81 | return order.index(key[1])
82 | except ValueError:
83 | # unordered items should come last
84 | return 0xff
85 |
86 | return sorted(cmddict.items(), key=keyfn)
87 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/check.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/check.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/completion.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/completion.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/download.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/download.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/freeze.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/freeze.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/hash.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/hash.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/help.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/help.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/install.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/install.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/list.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/list.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/search.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/search.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/show.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/show.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/uninstall.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/uninstall.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/wheel.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/__pycache__/wheel.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/check.py:
--------------------------------------------------------------------------------
1 | import logging
2 |
3 | from pip.basecommand import Command
4 | from pip.operations.check import check_requirements
5 | from pip.utils import get_installed_distributions
6 |
7 |
8 | logger = logging.getLogger(__name__)
9 |
10 |
11 | class CheckCommand(Command):
12 | """Verify installed packages have compatible dependencies."""
13 | name = 'check'
14 | usage = """
15 | %prog [options]"""
16 | summary = 'Verify installed packages have compatible dependencies.'
17 |
18 | def run(self, options, args):
19 | dists = get_installed_distributions(local_only=False, skip=())
20 | missing_reqs_dict, incompatible_reqs_dict = check_requirements(dists)
21 |
22 | for dist in dists:
23 | key = '%s==%s' % (dist.project_name, dist.version)
24 |
25 | for requirement in missing_reqs_dict.get(key, []):
26 | logger.info(
27 | "%s %s requires %s, which is not installed.",
28 | dist.project_name, dist.version, requirement.project_name)
29 |
30 | for requirement, actual in incompatible_reqs_dict.get(key, []):
31 | logger.info(
32 | "%s %s has requirement %s, but you have %s %s.",
33 | dist.project_name, dist.version, requirement,
34 | actual.project_name, actual.version)
35 |
36 | if missing_reqs_dict or incompatible_reqs_dict:
37 | return 1
38 | else:
39 | logger.info("No broken requirements found.")
40 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/completion.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 |
3 | import sys
4 | from pip.basecommand import Command
5 |
6 | BASE_COMPLETION = """
7 | # pip %(shell)s completion start%(script)s# pip %(shell)s completion end
8 | """
9 |
10 | COMPLETION_SCRIPTS = {
11 | 'bash': """
12 | _pip_completion()
13 | {
14 | COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\
15 | COMP_CWORD=$COMP_CWORD \\
16 | PIP_AUTO_COMPLETE=1 $1 ) )
17 | }
18 | complete -o default -F _pip_completion pip
19 | """, 'zsh': """
20 | function _pip_completion {
21 | local words cword
22 | read -Ac words
23 | read -cn cword
24 | reply=( $( COMP_WORDS="$words[*]" \\
25 | COMP_CWORD=$(( cword-1 )) \\
26 | PIP_AUTO_COMPLETE=1 $words[1] ) )
27 | }
28 | compctl -K _pip_completion pip
29 | """, 'fish': """
30 | function __fish_complete_pip
31 | set -lx COMP_WORDS (commandline -o) ""
32 | set -lx COMP_CWORD (math (contains -i -- (commandline -t) $COMP_WORDS)-1)
33 | set -lx PIP_AUTO_COMPLETE 1
34 | string split \ -- (eval $COMP_WORDS[1])
35 | end
36 | complete -fa "(__fish_complete_pip)" -c pip
37 | """}
38 |
39 |
40 | class CompletionCommand(Command):
41 | """A helper command to be used for command completion."""
42 | name = 'completion'
43 | summary = 'A helper command used for command completion.'
44 |
45 | def __init__(self, *args, **kw):
46 | super(CompletionCommand, self).__init__(*args, **kw)
47 |
48 | cmd_opts = self.cmd_opts
49 |
50 | cmd_opts.add_option(
51 | '--bash', '-b',
52 | action='store_const',
53 | const='bash',
54 | dest='shell',
55 | help='Emit completion code for bash')
56 | cmd_opts.add_option(
57 | '--zsh', '-z',
58 | action='store_const',
59 | const='zsh',
60 | dest='shell',
61 | help='Emit completion code for zsh')
62 | cmd_opts.add_option(
63 | '--fish', '-f',
64 | action='store_const',
65 | const='fish',
66 | dest='shell',
67 | help='Emit completion code for fish')
68 |
69 | self.parser.insert_option_group(0, cmd_opts)
70 |
71 | def run(self, options, args):
72 | """Prints the completion code of the given shell"""
73 | shells = COMPLETION_SCRIPTS.keys()
74 | shell_options = ['--' + shell for shell in sorted(shells)]
75 | if options.shell in shells:
76 | script = COMPLETION_SCRIPTS.get(options.shell, '')
77 | print(BASE_COMPLETION % {'script': script, 'shell': options.shell})
78 | else:
79 | sys.stderr.write(
80 | 'ERROR: You must pass %s\n' % ' or '.join(shell_options)
81 | )
82 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/freeze.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 |
3 | import sys
4 |
5 | import pip
6 | from pip.compat import stdlib_pkgs
7 | from pip.basecommand import Command
8 | from pip.operations.freeze import freeze
9 | from pip.wheel import WheelCache
10 |
11 |
12 | DEV_PKGS = ('pip', 'setuptools', 'distribute', 'wheel')
13 |
14 |
15 | class FreezeCommand(Command):
16 | """
17 | Output installed packages in requirements format.
18 |
19 | packages are listed in a case-insensitive sorted order.
20 | """
21 | name = 'freeze'
22 | usage = """
23 | %prog [options]"""
24 | summary = 'Output installed packages in requirements format.'
25 | log_streams = ("ext://sys.stderr", "ext://sys.stderr")
26 |
27 | def __init__(self, *args, **kw):
28 | super(FreezeCommand, self).__init__(*args, **kw)
29 |
30 | self.cmd_opts.add_option(
31 | '-r', '--requirement',
32 | dest='requirements',
33 | action='append',
34 | default=[],
35 | metavar='file',
36 | help="Use the order in the given requirements file and its "
37 | "comments when generating output. This option can be "
38 | "used multiple times.")
39 | self.cmd_opts.add_option(
40 | '-f', '--find-links',
41 | dest='find_links',
42 | action='append',
43 | default=[],
44 | metavar='URL',
45 | help='URL for finding packages, which will be added to the '
46 | 'output.')
47 | self.cmd_opts.add_option(
48 | '-l', '--local',
49 | dest='local',
50 | action='store_true',
51 | default=False,
52 | help='If in a virtualenv that has global access, do not output '
53 | 'globally-installed packages.')
54 | self.cmd_opts.add_option(
55 | '--user',
56 | dest='user',
57 | action='store_true',
58 | default=False,
59 | help='Only output packages installed in user-site.')
60 | self.cmd_opts.add_option(
61 | '--all',
62 | dest='freeze_all',
63 | action='store_true',
64 | help='Do not skip these packages in the output:'
65 | ' %s' % ', '.join(DEV_PKGS))
66 |
67 | self.parser.insert_option_group(0, self.cmd_opts)
68 |
69 | def run(self, options, args):
70 | format_control = pip.index.FormatControl(set(), set())
71 | wheel_cache = WheelCache(options.cache_dir, format_control)
72 | skip = set(stdlib_pkgs)
73 | if not options.freeze_all:
74 | skip.update(DEV_PKGS)
75 |
76 | freeze_kwargs = dict(
77 | requirement=options.requirements,
78 | find_links=options.find_links,
79 | local_only=options.local,
80 | user_only=options.user,
81 | skip_regex=options.skip_requirements_regex,
82 | isolated=options.isolated_mode,
83 | wheel_cache=wheel_cache,
84 | skip=skip)
85 |
86 | for line in freeze(**freeze_kwargs):
87 | sys.stdout.write(line + '\n')
88 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/hash.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 |
3 | import hashlib
4 | import logging
5 | import sys
6 |
7 | from pip.basecommand import Command
8 | from pip.status_codes import ERROR
9 | from pip.utils import read_chunks
10 | from pip.utils.hashes import FAVORITE_HASH, STRONG_HASHES
11 |
12 |
13 | logger = logging.getLogger(__name__)
14 |
15 |
16 | class HashCommand(Command):
17 | """
18 | Compute a hash of a local package archive.
19 |
20 | These can be used with --hash in a requirements file to do repeatable
21 | installs.
22 |
23 | """
24 | name = 'hash'
25 | usage = '%prog [options] ...'
26 | summary = 'Compute hashes of package archives.'
27 |
28 | def __init__(self, *args, **kw):
29 | super(HashCommand, self).__init__(*args, **kw)
30 | self.cmd_opts.add_option(
31 | '-a', '--algorithm',
32 | dest='algorithm',
33 | choices=STRONG_HASHES,
34 | action='store',
35 | default=FAVORITE_HASH,
36 | help='The hash algorithm to use: one of %s' %
37 | ', '.join(STRONG_HASHES))
38 | self.parser.insert_option_group(0, self.cmd_opts)
39 |
40 | def run(self, options, args):
41 | if not args:
42 | self.parser.print_usage(sys.stderr)
43 | return ERROR
44 |
45 | algorithm = options.algorithm
46 | for path in args:
47 | logger.info('%s:\n--hash=%s:%s',
48 | path, algorithm, _hash_of_file(path, algorithm))
49 |
50 |
51 | def _hash_of_file(path, algorithm):
52 | """Return the hash digest of a file."""
53 | with open(path, 'rb') as archive:
54 | hash = hashlib.new(algorithm)
55 | for chunk in read_chunks(archive):
56 | hash.update(chunk)
57 | return hash.hexdigest()
58 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/help.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 |
3 | from pip.basecommand import Command, SUCCESS
4 | from pip.exceptions import CommandError
5 |
6 |
7 | class HelpCommand(Command):
8 | """Show help for commands"""
9 | name = 'help'
10 | usage = """
11 | %prog """
12 | summary = 'Show help for commands.'
13 |
14 | def run(self, options, args):
15 | from pip.commands import commands_dict, get_similar_commands
16 |
17 | try:
18 | # 'pip help' with no args is handled by pip.__init__.parseopt()
19 | cmd_name = args[0] # the command we need help for
20 | except IndexError:
21 | return SUCCESS
22 |
23 | if cmd_name not in commands_dict:
24 | guess = get_similar_commands(cmd_name)
25 |
26 | msg = ['unknown command "%s"' % cmd_name]
27 | if guess:
28 | msg.append('maybe you meant "%s"' % guess)
29 |
30 | raise CommandError(' - '.join(msg))
31 |
32 | command = commands_dict[cmd_name]()
33 | command.parser.print_help()
34 |
35 | return SUCCESS
36 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/commands/uninstall.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 |
3 | import pip
4 | from pip.wheel import WheelCache
5 | from pip.req import InstallRequirement, RequirementSet, parse_requirements
6 | from pip.basecommand import Command
7 | from pip.exceptions import InstallationError
8 |
9 |
10 | class UninstallCommand(Command):
11 | """
12 | Uninstall packages.
13 |
14 | pip is able to uninstall most installed packages. Known exceptions are:
15 |
16 | - Pure distutils packages installed with ``python setup.py install``, which
17 | leave behind no metadata to determine what files were installed.
18 | - Script wrappers installed by ``python setup.py develop``.
19 | """
20 | name = 'uninstall'
21 | usage = """
22 | %prog [options] ...
23 | %prog [options] -r ..."""
24 | summary = 'Uninstall packages.'
25 |
26 | def __init__(self, *args, **kw):
27 | super(UninstallCommand, self).__init__(*args, **kw)
28 | self.cmd_opts.add_option(
29 | '-r', '--requirement',
30 | dest='requirements',
31 | action='append',
32 | default=[],
33 | metavar='file',
34 | help='Uninstall all the packages listed in the given requirements '
35 | 'file. This option can be used multiple times.',
36 | )
37 | self.cmd_opts.add_option(
38 | '-y', '--yes',
39 | dest='yes',
40 | action='store_true',
41 | help="Don't ask for confirmation of uninstall deletions.")
42 |
43 | self.parser.insert_option_group(0, self.cmd_opts)
44 |
45 | def run(self, options, args):
46 | with self._build_session(options) as session:
47 | format_control = pip.index.FormatControl(set(), set())
48 | wheel_cache = WheelCache(options.cache_dir, format_control)
49 | requirement_set = RequirementSet(
50 | build_dir=None,
51 | src_dir=None,
52 | download_dir=None,
53 | isolated=options.isolated_mode,
54 | session=session,
55 | wheel_cache=wheel_cache,
56 | )
57 | for name in args:
58 | requirement_set.add_requirement(
59 | InstallRequirement.from_line(
60 | name, isolated=options.isolated_mode,
61 | wheel_cache=wheel_cache
62 | )
63 | )
64 | for filename in options.requirements:
65 | for req in parse_requirements(
66 | filename,
67 | options=options,
68 | session=session,
69 | wheel_cache=wheel_cache):
70 | requirement_set.add_requirement(req)
71 | if not requirement_set.has_requirements:
72 | raise InstallationError(
73 | 'You must give at least one requirement to %(name)s (see '
74 | '"pip help %(name)s")' % dict(name=self.name)
75 | )
76 | requirement_set.uninstall(auto_confirm=options.yes)
77 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/compat/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/compat/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/models/__init__.py:
--------------------------------------------------------------------------------
1 | from pip.models.index import Index, PyPI
2 |
3 |
4 | __all__ = ["Index", "PyPI"]
5 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/models/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/models/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/models/__pycache__/index.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/models/__pycache__/index.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/models/index.py:
--------------------------------------------------------------------------------
1 | from pip._vendor.six.moves.urllib import parse as urllib_parse
2 |
3 |
4 | class Index(object):
5 | def __init__(self, url):
6 | self.url = url
7 | self.netloc = urllib_parse.urlsplit(url).netloc
8 | self.simple_url = self.url_to_path('simple')
9 | self.pypi_url = self.url_to_path('pypi')
10 | self.pip_json_url = self.url_to_path('pypi/pip/json')
11 |
12 | def url_to_path(self, path):
13 | return urllib_parse.urljoin(self.url, path)
14 |
15 |
16 | PyPI = Index('https://pypi.python.org/')
17 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/operations/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/operations/__init__.py
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/operations/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/operations/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/operations/__pycache__/check.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/operations/__pycache__/check.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/operations/__pycache__/freeze.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/operations/__pycache__/freeze.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/operations/check.py:
--------------------------------------------------------------------------------
1 |
2 |
3 | def check_requirements(installed_dists):
4 | missing_reqs_dict = {}
5 | incompatible_reqs_dict = {}
6 |
7 | for dist in installed_dists:
8 | key = '%s==%s' % (dist.project_name, dist.version)
9 |
10 | missing_reqs = list(get_missing_reqs(dist, installed_dists))
11 | if missing_reqs:
12 | missing_reqs_dict[key] = missing_reqs
13 |
14 | incompatible_reqs = list(get_incompatible_reqs(
15 | dist, installed_dists))
16 | if incompatible_reqs:
17 | incompatible_reqs_dict[key] = incompatible_reqs
18 |
19 | return (missing_reqs_dict, incompatible_reqs_dict)
20 |
21 |
22 | def get_missing_reqs(dist, installed_dists):
23 | """Return all of the requirements of `dist` that aren't present in
24 | `installed_dists`.
25 |
26 | """
27 | installed_names = set(d.project_name.lower() for d in installed_dists)
28 | missing_requirements = set()
29 |
30 | for requirement in dist.requires():
31 | if requirement.project_name.lower() not in installed_names:
32 | missing_requirements.add(requirement)
33 | yield requirement
34 |
35 |
36 | def get_incompatible_reqs(dist, installed_dists):
37 | """Return all of the requirements of `dist` that are present in
38 | `installed_dists`, but have incompatible versions.
39 |
40 | """
41 | installed_dists_by_name = {}
42 | for installed_dist in installed_dists:
43 | installed_dists_by_name[installed_dist.project_name] = installed_dist
44 |
45 | for requirement in dist.requires():
46 | present_dist = installed_dists_by_name.get(requirement.project_name)
47 |
48 | if present_dist and present_dist not in requirement:
49 | yield (requirement, present_dist)
50 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/req/__init__.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 |
3 | from .req_install import InstallRequirement
4 | from .req_set import RequirementSet, Requirements
5 | from .req_file import parse_requirements
6 |
7 | __all__ = [
8 | "RequirementSet", "Requirements", "InstallRequirement",
9 | "parse_requirements",
10 | ]
11 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/req/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/req/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/req/__pycache__/req_file.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/req/__pycache__/req_file.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/req/__pycache__/req_install.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/req/__pycache__/req_install.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/req/__pycache__/req_set.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/req/__pycache__/req_set.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/req/__pycache__/req_uninstall.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/req/__pycache__/req_uninstall.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/status_codes.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 |
3 | SUCCESS = 0
4 | ERROR = 1
5 | UNKNOWN_ERROR = 2
6 | VIRTUALENV_NOT_FOUND = 3
7 | PREVIOUS_BUILD_DIR_ERROR = 4
8 | NO_MATCHES_FOUND = 23
9 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/appdirs.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/appdirs.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/build.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/build.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/deprecation.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/deprecation.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/encoding.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/encoding.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/filesystem.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/filesystem.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/glibc.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/glibc.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/hashes.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/hashes.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/logging.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/logging.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/outdated.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/outdated.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/packaging.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/packaging.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/setuptools_build.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/setuptools_build.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/ui.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/__pycache__/ui.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/build.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 |
3 | import os.path
4 | import tempfile
5 |
6 | from pip.utils import rmtree
7 |
8 |
9 | class BuildDirectory(object):
10 |
11 | def __init__(self, name=None, delete=None):
12 | # If we were not given an explicit directory, and we were not given an
13 | # explicit delete option, then we'll default to deleting.
14 | if name is None and delete is None:
15 | delete = True
16 |
17 | if name is None:
18 | # We realpath here because some systems have their default tmpdir
19 | # symlinked to another directory. This tends to confuse build
20 | # scripts, so we canonicalize the path by traversing potential
21 | # symlinks here.
22 | name = os.path.realpath(tempfile.mkdtemp(prefix="pip-build-"))
23 | # If we were not given an explicit directory, and we were not given
24 | # an explicit delete option, then we'll default to deleting.
25 | if delete is None:
26 | delete = True
27 |
28 | self.name = name
29 | self.delete = delete
30 |
31 | def __repr__(self):
32 | return "<{} {!r}>".format(self.__class__.__name__, self.name)
33 |
34 | def __enter__(self):
35 | return self.name
36 |
37 | def __exit__(self, exc, value, tb):
38 | self.cleanup()
39 |
40 | def cleanup(self):
41 | if self.delete:
42 | rmtree(self.name)
43 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/deprecation.py:
--------------------------------------------------------------------------------
1 | """
2 | A module that implements tooling to enable easy warnings about deprecations.
3 | """
4 | from __future__ import absolute_import
5 |
6 | import logging
7 | import warnings
8 |
9 |
10 | class PipDeprecationWarning(Warning):
11 | pass
12 |
13 |
14 | class Pending(object):
15 | pass
16 |
17 |
18 | class RemovedInPip10Warning(PipDeprecationWarning):
19 | pass
20 |
21 |
22 | class RemovedInPip11Warning(PipDeprecationWarning, Pending):
23 | pass
24 |
25 |
26 | class Python26DeprecationWarning(PipDeprecationWarning):
27 | pass
28 |
29 |
30 | # Warnings <-> Logging Integration
31 |
32 |
33 | _warnings_showwarning = None
34 |
35 |
36 | def _showwarning(message, category, filename, lineno, file=None, line=None):
37 | if file is not None:
38 | if _warnings_showwarning is not None:
39 | _warnings_showwarning(
40 | message, category, filename, lineno, file, line,
41 | )
42 | else:
43 | if issubclass(category, PipDeprecationWarning):
44 | # We use a specially named logger which will handle all of the
45 | # deprecation messages for pip.
46 | logger = logging.getLogger("pip.deprecations")
47 |
48 | # This is purposely using the % formatter here instead of letting
49 | # the logging module handle the interpolation. This is because we
50 | # want it to appear as if someone typed this entire message out.
51 | log_message = "DEPRECATION: %s" % message
52 |
53 | # PipDeprecationWarnings that are Pending still have at least 2
54 | # versions to go until they are removed so they can just be
55 | # warnings. Otherwise, they will be removed in the very next
56 | # version of pip. We want these to be more obvious so we use the
57 | # ERROR logging level.
58 | if issubclass(category, Pending):
59 | logger.warning(log_message)
60 | else:
61 | logger.error(log_message)
62 | else:
63 | _warnings_showwarning(
64 | message, category, filename, lineno, file, line,
65 | )
66 |
67 |
68 | def install_warning_logger():
69 | # Enable our Deprecation Warnings
70 | warnings.simplefilter("default", PipDeprecationWarning, append=True)
71 |
72 | global _warnings_showwarning
73 |
74 | if _warnings_showwarning is None:
75 | _warnings_showwarning = warnings.showwarning
76 | warnings.showwarning = _showwarning
77 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/encoding.py:
--------------------------------------------------------------------------------
1 | import codecs
2 | import locale
3 | import re
4 |
5 |
6 | BOMS = [
7 | (codecs.BOM_UTF8, 'utf8'),
8 | (codecs.BOM_UTF16, 'utf16'),
9 | (codecs.BOM_UTF16_BE, 'utf16-be'),
10 | (codecs.BOM_UTF16_LE, 'utf16-le'),
11 | (codecs.BOM_UTF32, 'utf32'),
12 | (codecs.BOM_UTF32_BE, 'utf32-be'),
13 | (codecs.BOM_UTF32_LE, 'utf32-le'),
14 | ]
15 |
16 | ENCODING_RE = re.compile(b'coding[:=]\s*([-\w.]+)')
17 |
18 |
19 | def auto_decode(data):
20 | """Check a bytes string for a BOM to correctly detect the encoding
21 |
22 | Fallback to locale.getpreferredencoding(False) like open() on Python3"""
23 | for bom, encoding in BOMS:
24 | if data.startswith(bom):
25 | return data[len(bom):].decode(encoding)
26 | # Lets check the first two lines as in PEP263
27 | for line in data.split(b'\n')[:2]:
28 | if line[0:1] == b'#' and ENCODING_RE.search(line):
29 | encoding = ENCODING_RE.search(line).groups()[0].decode('ascii')
30 | return data.decode(encoding)
31 | return data.decode(locale.getpreferredencoding(False))
32 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/filesystem.py:
--------------------------------------------------------------------------------
1 | import os
2 | import os.path
3 |
4 | from pip.compat import get_path_uid
5 |
6 |
7 | def check_path_owner(path):
8 | # If we don't have a way to check the effective uid of this process, then
9 | # we'll just assume that we own the directory.
10 | if not hasattr(os, "geteuid"):
11 | return True
12 |
13 | previous = None
14 | while path != previous:
15 | if os.path.lexists(path):
16 | # Check if path is writable by current user.
17 | if os.geteuid() == 0:
18 | # Special handling for root user in order to handle properly
19 | # cases where users use sudo without -H flag.
20 | try:
21 | path_uid = get_path_uid(path)
22 | except OSError:
23 | return False
24 | return path_uid == 0
25 | else:
26 | return os.access(path, os.W_OK)
27 | else:
28 | previous, path = path, os.path.dirname(path)
29 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/packaging.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 |
3 | from email.parser import FeedParser
4 |
5 | import logging
6 | import sys
7 |
8 | from pip._vendor.packaging import specifiers
9 | from pip._vendor.packaging import version
10 | from pip._vendor import pkg_resources
11 |
12 | from pip import exceptions
13 |
14 | logger = logging.getLogger(__name__)
15 |
16 |
17 | def check_requires_python(requires_python):
18 | """
19 | Check if the python version in use match the `requires_python` specifier.
20 |
21 | Returns `True` if the version of python in use matches the requirement.
22 | Returns `False` if the version of python in use does not matches the
23 | requirement.
24 |
25 | Raises an InvalidSpecifier if `requires_python` have an invalid format.
26 | """
27 | if requires_python is None:
28 | # The package provides no information
29 | return True
30 | requires_python_specifier = specifiers.SpecifierSet(requires_python)
31 |
32 | # We only use major.minor.micro
33 | python_version = version.parse('.'.join(map(str, sys.version_info[:3])))
34 | return python_version in requires_python_specifier
35 |
36 |
37 | def get_metadata(dist):
38 | if (isinstance(dist, pkg_resources.DistInfoDistribution) and
39 | dist.has_metadata('METADATA')):
40 | return dist.get_metadata('METADATA')
41 | elif dist.has_metadata('PKG-INFO'):
42 | return dist.get_metadata('PKG-INFO')
43 |
44 |
45 | def check_dist_requires_python(dist):
46 | metadata = get_metadata(dist)
47 | feed_parser = FeedParser()
48 | feed_parser.feed(metadata)
49 | pkg_info_dict = feed_parser.close()
50 | requires_python = pkg_info_dict.get('Requires-Python')
51 | try:
52 | if not check_requires_python(requires_python):
53 | raise exceptions.UnsupportedPythonVersion(
54 | "%s requires Python '%s' but the running Python is %s" % (
55 | dist.project_name,
56 | requires_python,
57 | '.'.join(map(str, sys.version_info[:3])),)
58 | )
59 | except specifiers.InvalidSpecifier as e:
60 | logger.warning(
61 | "Package %s has an invalid Requires-Python entry %s - %s" % (
62 | dist.project_name, requires_python, e))
63 | return
64 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/utils/setuptools_build.py:
--------------------------------------------------------------------------------
1 | # Shim to wrap setup.py invocation with setuptools
2 | SETUPTOOLS_SHIM = (
3 | "import setuptools, tokenize;__file__=%r;"
4 | "f=getattr(tokenize, 'open', open)(__file__);"
5 | "code=f.read().replace('\\r\\n', '\\n');"
6 | "f.close();"
7 | "exec(compile(code, __file__, 'exec'))"
8 | )
9 |
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/vcs/__pycache__/__init__.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/vcs/__pycache__/__init__.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/vcs/__pycache__/bazaar.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/vcs/__pycache__/bazaar.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/vcs/__pycache__/git.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/vcs/__pycache__/git.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/vcs/__pycache__/mercurial.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/vcs/__pycache__/mercurial.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/vcs/__pycache__/subversion.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/pip-9.0.1-py3.8.egg/pip/vcs/__pycache__/subversion.cpython-38.pyc
--------------------------------------------------------------------------------
/venv/Lib/site-packages/setuptools-28.8.0-py3.8.egg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Lib/site-packages/setuptools-28.8.0-py3.8.egg
--------------------------------------------------------------------------------
/venv/Lib/site-packages/setuptools.pth:
--------------------------------------------------------------------------------
1 | ./setuptools-28.8.0-py3.8.egg
2 |
--------------------------------------------------------------------------------
/venv/Scripts/activate:
--------------------------------------------------------------------------------
1 | # This file must be used with "source bin/activate" *from bash*
2 | # you cannot run it directly
3 |
4 | deactivate () {
5 | # reset old environment variables
6 | if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
7 | PATH="${_OLD_VIRTUAL_PATH:-}"
8 | export PATH
9 | unset _OLD_VIRTUAL_PATH
10 | fi
11 | if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
12 | PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
13 | export PYTHONHOME
14 | unset _OLD_VIRTUAL_PYTHONHOME
15 | fi
16 |
17 | # This should detect bash and zsh, which have a hash command that must
18 | # be called to get it to forget past commands. Without forgetting
19 | # past commands the $PATH changes we made may not be respected
20 | if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
21 | hash -r
22 | fi
23 |
24 | if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
25 | PS1="${_OLD_VIRTUAL_PS1:-}"
26 | export PS1
27 | unset _OLD_VIRTUAL_PS1
28 | fi
29 |
30 | unset VIRTUAL_ENV
31 | if [ ! "${1:-}" = "nondestructive" ] ; then
32 | # Self destruct!
33 | unset -f deactivate
34 | fi
35 | }
36 |
37 | # unset irrelevant variables
38 | deactivate nondestructive
39 |
40 | VIRTUAL_ENV="D:\workSpace\Compiler\venv"
41 | export VIRTUAL_ENV
42 |
43 | _OLD_VIRTUAL_PATH="$PATH"
44 | PATH="$VIRTUAL_ENV/Scripts:$PATH"
45 | export PATH
46 |
47 | # unset PYTHONHOME if set
48 | # this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
49 | # could use `if (set -u; : $PYTHONHOME) ;` in bash
50 | if [ -n "${PYTHONHOME:-}" ] ; then
51 | _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
52 | unset PYTHONHOME
53 | fi
54 |
55 | if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
56 | _OLD_VIRTUAL_PS1="${PS1:-}"
57 | if [ "x(venv) " != x ] ; then
58 | PS1="(venv) ${PS1:-}"
59 | else
60 | if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
61 | # special case for Aspen magic directories
62 | # see http://www.zetadev.com/software/aspen/
63 | PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1"
64 | else
65 | PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1"
66 | fi
67 | fi
68 | export PS1
69 | fi
70 |
71 | # This should detect bash and zsh, which have a hash command that must
72 | # be called to get it to forget past commands. Without forgetting
73 | # past commands the $PATH changes we made may not be respected
74 | if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
75 | hash -r
76 | fi
77 |
--------------------------------------------------------------------------------
/venv/Scripts/activate.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | rem This file is UTF-8 encoded, so we need to update the current code page while executing it
4 | for /f "tokens=2 delims=:." %%a in ('"%SystemRoot%\System32\chcp.com"') do (
5 | set _OLD_CODEPAGE=%%a
6 | )
7 | if defined _OLD_CODEPAGE (
8 | "%SystemRoot%\System32\chcp.com" 65001 > nul
9 | )
10 |
11 | set VIRTUAL_ENV=D:\workSpace\Compiler\venv
12 |
13 | if not defined PROMPT set PROMPT=$P$G
14 |
15 | if defined _OLD_VIRTUAL_PROMPT set PROMPT=%_OLD_VIRTUAL_PROMPT%
16 | if defined _OLD_VIRTUAL_PYTHONHOME set PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%
17 |
18 | set _OLD_VIRTUAL_PROMPT=%PROMPT%
19 | set PROMPT=(venv) %PROMPT%
20 |
21 | if defined PYTHONHOME set _OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%
22 | set PYTHONHOME=
23 |
24 | if defined _OLD_VIRTUAL_PATH set PATH=%_OLD_VIRTUAL_PATH%
25 | if not defined _OLD_VIRTUAL_PATH set _OLD_VIRTUAL_PATH=%PATH%
26 |
27 | set PATH=%VIRTUAL_ENV%\Scripts;%PATH%
28 |
29 | :END
30 | if defined _OLD_CODEPAGE (
31 | "%SystemRoot%\System32\chcp.com" %_OLD_CODEPAGE% > nul
32 | set _OLD_CODEPAGE=
33 | )
34 |
--------------------------------------------------------------------------------
/venv/Scripts/deactivate.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | if defined _OLD_VIRTUAL_PROMPT (
4 | set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
5 | )
6 | set _OLD_VIRTUAL_PROMPT=
7 |
8 | if defined _OLD_VIRTUAL_PYTHONHOME (
9 | set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
10 | set _OLD_VIRTUAL_PYTHONHOME=
11 | )
12 |
13 | if defined _OLD_VIRTUAL_PATH (
14 | set "PATH=%_OLD_VIRTUAL_PATH%"
15 | )
16 |
17 | set _OLD_VIRTUAL_PATH=
18 |
19 | set VIRTUAL_ENV=
20 |
21 | :END
22 |
--------------------------------------------------------------------------------
/venv/Scripts/easy_install-3.8-script.py:
--------------------------------------------------------------------------------
1 | #!D:\workSpace\Compiler\venv\Scripts\python.exe
2 | # EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==28.8.0','console_scripts','easy_install-3.8'
3 | __requires__ = 'setuptools==28.8.0'
4 | import re
5 | import sys
6 | from pkg_resources import load_entry_point
7 |
8 | if __name__ == '__main__':
9 | sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
10 | sys.exit(
11 | load_entry_point('setuptools==28.8.0', 'console_scripts', 'easy_install-3.8')()
12 | )
13 |
--------------------------------------------------------------------------------
/venv/Scripts/easy_install-3.8.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Scripts/easy_install-3.8.exe
--------------------------------------------------------------------------------
/venv/Scripts/easy_install-script.py:
--------------------------------------------------------------------------------
1 | #!D:\workSpace\Compiler\venv\Scripts\python.exe
2 | # EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==28.8.0','console_scripts','easy_install'
3 | __requires__ = 'setuptools==28.8.0'
4 | import re
5 | import sys
6 | from pkg_resources import load_entry_point
7 |
8 | if __name__ == '__main__':
9 | sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
10 | sys.exit(
11 | load_entry_point('setuptools==28.8.0', 'console_scripts', 'easy_install')()
12 | )
13 |
--------------------------------------------------------------------------------
/venv/Scripts/easy_install.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Scripts/easy_install.exe
--------------------------------------------------------------------------------
/venv/Scripts/pip-script.py:
--------------------------------------------------------------------------------
1 | #!D:\workSpace\Compiler\venv\Scripts\python.exe
2 | # EASY-INSTALL-ENTRY-SCRIPT: 'pip==9.0.1','console_scripts','pip'
3 | __requires__ = 'pip==9.0.1'
4 | import re
5 | import sys
6 | from pkg_resources import load_entry_point
7 |
8 | if __name__ == '__main__':
9 | sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
10 | sys.exit(
11 | load_entry_point('pip==9.0.1', 'console_scripts', 'pip')()
12 | )
13 |
--------------------------------------------------------------------------------
/venv/Scripts/pip.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Scripts/pip.exe
--------------------------------------------------------------------------------
/venv/Scripts/pip3-script.py:
--------------------------------------------------------------------------------
1 | #!D:\workSpace\Compiler\venv\Scripts\python.exe
2 | # EASY-INSTALL-ENTRY-SCRIPT: 'pip==9.0.1','console_scripts','pip3'
3 | __requires__ = 'pip==9.0.1'
4 | import re
5 | import sys
6 | from pkg_resources import load_entry_point
7 |
8 | if __name__ == '__main__':
9 | sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
10 | sys.exit(
11 | load_entry_point('pip==9.0.1', 'console_scripts', 'pip3')()
12 | )
13 |
--------------------------------------------------------------------------------
/venv/Scripts/pip3.8-script.py:
--------------------------------------------------------------------------------
1 | #!D:\workSpace\Compiler\venv\Scripts\python.exe
2 | # EASY-INSTALL-ENTRY-SCRIPT: 'pip==9.0.1','console_scripts','pip3.8'
3 | __requires__ = 'pip==9.0.1'
4 | import re
5 | import sys
6 | from pkg_resources import load_entry_point
7 |
8 | if __name__ == '__main__':
9 | sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
10 | sys.exit(
11 | load_entry_point('pip==9.0.1', 'console_scripts', 'pip3.8')()
12 | )
13 |
--------------------------------------------------------------------------------
/venv/Scripts/pip3.8.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Scripts/pip3.8.exe
--------------------------------------------------------------------------------
/venv/Scripts/pip3.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Scripts/pip3.exe
--------------------------------------------------------------------------------
/venv/Scripts/python.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Scripts/python.exe
--------------------------------------------------------------------------------
/venv/Scripts/pythonw.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwzong/Compiler/c10d535356ccd237a7b618b6bcc5210c3dfc5e02/venv/Scripts/pythonw.exe
--------------------------------------------------------------------------------
/venv/pip-selfcheck.json:
--------------------------------------------------------------------------------
1 | {"last_check":"2020-06-04T15:11:11Z","pypi_version":"20.1.1"}
--------------------------------------------------------------------------------
/venv/pyvenv.cfg:
--------------------------------------------------------------------------------
1 | home = D:\Python
2 | include-system-site-packages = false
3 | version = 3.8.2
4 |
--------------------------------------------------------------------------------