rigid 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/rigid +4 -0
- data/rigid +16 -0
- data/vendor/PyYAML-3.12.dist-info/DESCRIPTION.rst +12 -0
- data/vendor/PyYAML-3.12.dist-info/INSTALLER +1 -0
- data/vendor/PyYAML-3.12.dist-info/METADATA +35 -0
- data/vendor/PyYAML-3.12.dist-info/RECORD +42 -0
- data/vendor/PyYAML-3.12.dist-info/WHEEL +5 -0
- data/vendor/PyYAML-3.12.dist-info/metadata.json +1 -0
- data/vendor/PyYAML-3.12.dist-info/top_level.txt +2 -0
- data/vendor/_yaml.so +0 -0
- data/vendor/click/__init__.py +98 -0
- data/vendor/click/__init__.pyc +0 -0
- data/vendor/click/_bashcomplete.py +83 -0
- data/vendor/click/_bashcomplete.pyc +0 -0
- data/vendor/click/_compat.py +642 -0
- data/vendor/click/_compat.pyc +0 -0
- data/vendor/click/_termui_impl.py +547 -0
- data/vendor/click/_termui_impl.pyc +0 -0
- data/vendor/click/_textwrap.py +38 -0
- data/vendor/click/_textwrap.pyc +0 -0
- data/vendor/click/_unicodefun.py +119 -0
- data/vendor/click/_unicodefun.pyc +0 -0
- data/vendor/click/_winconsole.py +273 -0
- data/vendor/click/_winconsole.pyc +0 -0
- data/vendor/click/core.py +1738 -0
- data/vendor/click/core.pyc +0 -0
- data/vendor/click/decorators.py +304 -0
- data/vendor/click/decorators.pyc +0 -0
- data/vendor/click/exceptions.py +201 -0
- data/vendor/click/exceptions.pyc +0 -0
- data/vendor/click/formatting.py +256 -0
- data/vendor/click/formatting.pyc +0 -0
- data/vendor/click/globals.py +48 -0
- data/vendor/click/globals.pyc +0 -0
- data/vendor/click/parser.py +426 -0
- data/vendor/click/parser.pyc +0 -0
- data/vendor/click/termui.py +539 -0
- data/vendor/click/termui.pyc +0 -0
- data/vendor/click/testing.py +322 -0
- data/vendor/click/testing.pyc +0 -0
- data/vendor/click/types.py +550 -0
- data/vendor/click/types.pyc +0 -0
- data/vendor/click/utils.py +415 -0
- data/vendor/click/utils.pyc +0 -0
- data/vendor/click-6.6.dist-info/DESCRIPTION.rst +3 -0
- data/vendor/click-6.6.dist-info/INSTALLER +1 -0
- data/vendor/click-6.6.dist-info/METADATA +16 -0
- data/vendor/click-6.6.dist-info/RECORD +41 -0
- data/vendor/click-6.6.dist-info/WHEEL +6 -0
- data/vendor/click-6.6.dist-info/metadata.json +1 -0
- data/vendor/click-6.6.dist-info/top_level.txt +1 -0
- data/vendor/easy_install.py +5 -0
- data/vendor/easy_install.pyc +0 -0
- data/vendor/pip-9.0.1.dist-info/DESCRIPTION.rst +39 -0
- data/vendor/pip-9.0.1.dist-info/INSTALLER +1 -0
- data/vendor/pip-9.0.1.dist-info/METADATA +69 -0
- data/vendor/pip-9.0.1.dist-info/RECORD +501 -0
- data/vendor/pip-9.0.1.dist-info/WHEEL +6 -0
- data/vendor/pip-9.0.1.dist-info/entry_points.txt +5 -0
- data/vendor/pip-9.0.1.dist-info/metadata.json +1 -0
- data/vendor/pip-9.0.1.dist-info/top_level.txt +1 -0
- data/vendor/pkg_resources/__init__.py +3051 -0
- data/vendor/pkg_resources/__init__.pyc +0 -0
- data/vendor/pkg_resources/_vendor/__init__.py +0 -0
- data/vendor/pkg_resources/_vendor/__init__.pyc +0 -0
- data/vendor/pkg_resources/_vendor/appdirs.py +552 -0
- data/vendor/pkg_resources/_vendor/appdirs.pyc +0 -0
- data/vendor/pkg_resources/_vendor/packaging/__about__.py +21 -0
- data/vendor/pkg_resources/_vendor/packaging/__about__.pyc +0 -0
- data/vendor/pkg_resources/_vendor/packaging/__init__.py +14 -0
- data/vendor/pkg_resources/_vendor/packaging/__init__.pyc +0 -0
- data/vendor/pkg_resources/_vendor/packaging/_compat.py +30 -0
- data/vendor/pkg_resources/_vendor/packaging/_compat.pyc +0 -0
- data/vendor/pkg_resources/_vendor/packaging/_structures.py +68 -0
- data/vendor/pkg_resources/_vendor/packaging/_structures.pyc +0 -0
- data/vendor/pkg_resources/_vendor/packaging/markers.py +287 -0
- data/vendor/pkg_resources/_vendor/packaging/markers.pyc +0 -0
- data/vendor/pkg_resources/_vendor/packaging/requirements.py +127 -0
- data/vendor/pkg_resources/_vendor/packaging/requirements.pyc +0 -0
- data/vendor/pkg_resources/_vendor/packaging/specifiers.py +774 -0
- data/vendor/pkg_resources/_vendor/packaging/specifiers.pyc +0 -0
- data/vendor/pkg_resources/_vendor/packaging/utils.py +14 -0
- data/vendor/pkg_resources/_vendor/packaging/utils.pyc +0 -0
- data/vendor/pkg_resources/_vendor/packaging/version.py +393 -0
- data/vendor/pkg_resources/_vendor/packaging/version.pyc +0 -0
- data/vendor/pkg_resources/_vendor/pyparsing.py +5696 -0
- data/vendor/pkg_resources/_vendor/pyparsing.pyc +0 -0
- data/vendor/pkg_resources/_vendor/six.py +868 -0
- data/vendor/pkg_resources/_vendor/six.pyc +0 -0
- data/vendor/pkg_resources/extern/__init__.py +73 -0
- data/vendor/pkg_resources/extern/__init__.pyc +0 -0
- data/vendor/requests/__init__.py +86 -0
- data/vendor/requests/__init__.pyc +0 -0
- data/vendor/requests/adapters.py +503 -0
- data/vendor/requests/adapters.pyc +0 -0
- data/vendor/requests/api.py +148 -0
- data/vendor/requests/api.pyc +0 -0
- data/vendor/requests/auth.py +252 -0
- data/vendor/requests/auth.pyc +0 -0
- data/vendor/requests/cacert.pem +5616 -0
- data/vendor/requests/certs.py +25 -0
- data/vendor/requests/certs.pyc +0 -0
- data/vendor/requests/compat.py +66 -0
- data/vendor/requests/compat.pyc +0 -0
- data/vendor/requests/cookies.py +540 -0
- data/vendor/requests/cookies.pyc +0 -0
- data/vendor/requests/exceptions.py +114 -0
- data/vendor/requests/exceptions.pyc +0 -0
- data/vendor/requests/hooks.py +34 -0
- data/vendor/requests/hooks.pyc +0 -0
- data/vendor/requests/models.py +873 -0
- data/vendor/requests/models.pyc +0 -0
- data/vendor/requests/packages/__init__.py +36 -0
- data/vendor/requests/packages/__init__.pyc +0 -0
- data/vendor/requests/packages/chardet/__init__.py +32 -0
- data/vendor/requests/packages/chardet/__init__.pyc +0 -0
- data/vendor/requests/packages/chardet/big5freq.py +925 -0
- data/vendor/requests/packages/chardet/big5freq.pyc +0 -0
- data/vendor/requests/packages/chardet/big5prober.py +42 -0
- data/vendor/requests/packages/chardet/big5prober.pyc +0 -0
- data/vendor/requests/packages/chardet/chardetect.py +80 -0
- data/vendor/requests/packages/chardet/chardetect.pyc +0 -0
- data/vendor/requests/packages/chardet/chardistribution.py +231 -0
- data/vendor/requests/packages/chardet/chardistribution.pyc +0 -0
- data/vendor/requests/packages/chardet/charsetgroupprober.py +106 -0
- data/vendor/requests/packages/chardet/charsetgroupprober.pyc +0 -0
- data/vendor/requests/packages/chardet/charsetprober.py +62 -0
- data/vendor/requests/packages/chardet/charsetprober.pyc +0 -0
- data/vendor/requests/packages/chardet/codingstatemachine.py +61 -0
- data/vendor/requests/packages/chardet/codingstatemachine.pyc +0 -0
- data/vendor/requests/packages/chardet/compat.py +34 -0
- data/vendor/requests/packages/chardet/compat.pyc +0 -0
- data/vendor/requests/packages/chardet/constants.py +39 -0
- data/vendor/requests/packages/chardet/constants.pyc +0 -0
- data/vendor/requests/packages/chardet/cp949prober.py +44 -0
- data/vendor/requests/packages/chardet/cp949prober.pyc +0 -0
- data/vendor/requests/packages/chardet/escprober.py +86 -0
- data/vendor/requests/packages/chardet/escprober.pyc +0 -0
- data/vendor/requests/packages/chardet/escsm.py +242 -0
- data/vendor/requests/packages/chardet/escsm.pyc +0 -0
- data/vendor/requests/packages/chardet/eucjpprober.py +90 -0
- data/vendor/requests/packages/chardet/eucjpprober.pyc +0 -0
- data/vendor/requests/packages/chardet/euckrfreq.py +596 -0
- data/vendor/requests/packages/chardet/euckrfreq.pyc +0 -0
- data/vendor/requests/packages/chardet/euckrprober.py +42 -0
- data/vendor/requests/packages/chardet/euckrprober.pyc +0 -0
- data/vendor/requests/packages/chardet/euctwfreq.py +428 -0
- data/vendor/requests/packages/chardet/euctwfreq.pyc +0 -0
- data/vendor/requests/packages/chardet/euctwprober.py +41 -0
- data/vendor/requests/packages/chardet/euctwprober.pyc +0 -0
- data/vendor/requests/packages/chardet/gb2312freq.py +472 -0
- data/vendor/requests/packages/chardet/gb2312freq.pyc +0 -0
- data/vendor/requests/packages/chardet/gb2312prober.py +41 -0
- data/vendor/requests/packages/chardet/gb2312prober.pyc +0 -0
- data/vendor/requests/packages/chardet/hebrewprober.py +283 -0
- data/vendor/requests/packages/chardet/hebrewprober.pyc +0 -0
- data/vendor/requests/packages/chardet/jisfreq.py +569 -0
- data/vendor/requests/packages/chardet/jisfreq.pyc +0 -0
- data/vendor/requests/packages/chardet/jpcntx.py +227 -0
- data/vendor/requests/packages/chardet/jpcntx.pyc +0 -0
- data/vendor/requests/packages/chardet/langbulgarianmodel.py +229 -0
- data/vendor/requests/packages/chardet/langbulgarianmodel.pyc +0 -0
- data/vendor/requests/packages/chardet/langcyrillicmodel.py +329 -0
- data/vendor/requests/packages/chardet/langcyrillicmodel.pyc +0 -0
- data/vendor/requests/packages/chardet/langgreekmodel.py +225 -0
- data/vendor/requests/packages/chardet/langgreekmodel.pyc +0 -0
- data/vendor/requests/packages/chardet/langhebrewmodel.py +201 -0
- data/vendor/requests/packages/chardet/langhebrewmodel.pyc +0 -0
- data/vendor/requests/packages/chardet/langhungarianmodel.py +225 -0
- data/vendor/requests/packages/chardet/langhungarianmodel.pyc +0 -0
- data/vendor/requests/packages/chardet/langthaimodel.py +200 -0
- data/vendor/requests/packages/chardet/langthaimodel.pyc +0 -0
- data/vendor/requests/packages/chardet/latin1prober.py +139 -0
- data/vendor/requests/packages/chardet/latin1prober.pyc +0 -0
- data/vendor/requests/packages/chardet/mbcharsetprober.py +86 -0
- data/vendor/requests/packages/chardet/mbcharsetprober.pyc +0 -0
- data/vendor/requests/packages/chardet/mbcsgroupprober.py +54 -0
- data/vendor/requests/packages/chardet/mbcsgroupprober.pyc +0 -0
- data/vendor/requests/packages/chardet/mbcssm.py +572 -0
- data/vendor/requests/packages/chardet/mbcssm.pyc +0 -0
- data/vendor/requests/packages/chardet/sbcharsetprober.py +120 -0
- data/vendor/requests/packages/chardet/sbcharsetprober.pyc +0 -0
- data/vendor/requests/packages/chardet/sbcsgroupprober.py +69 -0
- data/vendor/requests/packages/chardet/sbcsgroupprober.pyc +0 -0
- data/vendor/requests/packages/chardet/sjisprober.py +91 -0
- data/vendor/requests/packages/chardet/sjisprober.pyc +0 -0
- data/vendor/requests/packages/chardet/universaldetector.py +170 -0
- data/vendor/requests/packages/chardet/universaldetector.pyc +0 -0
- data/vendor/requests/packages/chardet/utf8prober.py +76 -0
- data/vendor/requests/packages/chardet/utf8prober.pyc +0 -0
- data/vendor/requests/packages/urllib3/__init__.py +96 -0
- data/vendor/requests/packages/urllib3/__init__.pyc +0 -0
- data/vendor/requests/packages/urllib3/_collections.py +324 -0
- data/vendor/requests/packages/urllib3/_collections.pyc +0 -0
- data/vendor/requests/packages/urllib3/connection.py +330 -0
- data/vendor/requests/packages/urllib3/connection.pyc +0 -0
- data/vendor/requests/packages/urllib3/connectionpool.py +866 -0
- data/vendor/requests/packages/urllib3/connectionpool.pyc +0 -0
- data/vendor/requests/packages/urllib3/contrib/__init__.py +0 -0
- data/vendor/requests/packages/urllib3/contrib/__init__.pyc +0 -0
- data/vendor/requests/packages/urllib3/contrib/appengine.py +231 -0
- data/vendor/requests/packages/urllib3/contrib/appengine.pyc +0 -0
- data/vendor/requests/packages/urllib3/contrib/ntlmpool.py +115 -0
- data/vendor/requests/packages/urllib3/contrib/ntlmpool.pyc +0 -0
- data/vendor/requests/packages/urllib3/contrib/pyopenssl.py +358 -0
- data/vendor/requests/packages/urllib3/contrib/pyopenssl.pyc +0 -0
- data/vendor/requests/packages/urllib3/contrib/socks.py +172 -0
- data/vendor/requests/packages/urllib3/contrib/socks.pyc +0 -0
- data/vendor/requests/packages/urllib3/exceptions.py +209 -0
- data/vendor/requests/packages/urllib3/exceptions.pyc +0 -0
- data/vendor/requests/packages/urllib3/fields.py +178 -0
- data/vendor/requests/packages/urllib3/fields.pyc +0 -0
- data/vendor/requests/packages/urllib3/filepost.py +94 -0
- data/vendor/requests/packages/urllib3/filepost.pyc +0 -0
- data/vendor/requests/packages/urllib3/packages/__init__.py +5 -0
- data/vendor/requests/packages/urllib3/packages/__init__.pyc +0 -0
- data/vendor/requests/packages/urllib3/packages/ordered_dict.py +259 -0
- data/vendor/requests/packages/urllib3/packages/ordered_dict.pyc +0 -0
- data/vendor/requests/packages/urllib3/packages/six.py +868 -0
- data/vendor/requests/packages/urllib3/packages/six.pyc +0 -0
- data/vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py +13 -0
- data/vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyc +0 -0
- data/vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py +105 -0
- data/vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyc +0 -0
- data/vendor/requests/packages/urllib3/poolmanager.py +367 -0
- data/vendor/requests/packages/urllib3/poolmanager.pyc +0 -0
- data/vendor/requests/packages/urllib3/request.py +151 -0
- data/vendor/requests/packages/urllib3/request.pyc +0 -0
- data/vendor/requests/packages/urllib3/response.py +530 -0
- data/vendor/requests/packages/urllib3/response.pyc +0 -0
- data/vendor/requests/packages/urllib3/util/__init__.py +46 -0
- data/vendor/requests/packages/urllib3/util/__init__.pyc +0 -0
- data/vendor/requests/packages/urllib3/util/connection.py +144 -0
- data/vendor/requests/packages/urllib3/util/connection.pyc +0 -0
- data/vendor/requests/packages/urllib3/util/request.py +72 -0
- data/vendor/requests/packages/urllib3/util/request.pyc +0 -0
- data/vendor/requests/packages/urllib3/util/response.py +74 -0
- data/vendor/requests/packages/urllib3/util/response.pyc +0 -0
- data/vendor/requests/packages/urllib3/util/retry.py +300 -0
- data/vendor/requests/packages/urllib3/util/retry.pyc +0 -0
- data/vendor/requests/packages/urllib3/util/ssl_.py +320 -0
- data/vendor/requests/packages/urllib3/util/ssl_.pyc +0 -0
- data/vendor/requests/packages/urllib3/util/timeout.py +242 -0
- data/vendor/requests/packages/urllib3/util/timeout.pyc +0 -0
- data/vendor/requests/packages/urllib3/util/url.py +217 -0
- data/vendor/requests/packages/urllib3/util/url.pyc +0 -0
- data/vendor/requests/sessions.py +712 -0
- data/vendor/requests/sessions.pyc +0 -0
- data/vendor/requests/status_codes.py +91 -0
- data/vendor/requests/status_codes.pyc +0 -0
- data/vendor/requests/structures.py +105 -0
- data/vendor/requests/structures.pyc +0 -0
- data/vendor/requests/utils.py +817 -0
- data/vendor/requests/utils.pyc +0 -0
- data/vendor/requests-2.11.1.dist-info/DESCRIPTION.rst +1294 -0
- data/vendor/requests-2.11.1.dist-info/INSTALLER +1 -0
- data/vendor/requests-2.11.1.dist-info/METADATA +1323 -0
- data/vendor/requests-2.11.1.dist-info/RECORD +170 -0
- data/vendor/requests-2.11.1.dist-info/WHEEL +6 -0
- data/vendor/requests-2.11.1.dist-info/metadata.json +1 -0
- data/vendor/requests-2.11.1.dist-info/top_level.txt +1 -0
- data/vendor/rigid/__init__.py +1 -0
- data/vendor/rigid/__init__.pyc +0 -0
- data/vendor/rigid/api.py +129 -0
- data/vendor/rigid/api.pyc +0 -0
- data/vendor/rigid/commands/__init__.py +260 -0
- data/vendor/rigid/commands/__init__.pyc +0 -0
- data/vendor/rigid/commands/deploy.py +0 -0
- data/vendor/rigid/commands/deploy.pyc +0 -0
- data/vendor/rigid/deploy.py +70 -0
- data/vendor/rigid/deploy.pyc +0 -0
- data/vendor/rigid/file_scanner.py +63 -0
- data/vendor/rigid/file_scanner.pyc +0 -0
- data/vendor/rigid/utils.py +17 -0
- data/vendor/rigid/utils.pyc +0 -0
- data/vendor/rigid-0.2.0.dist-info/DESCRIPTION.rst +3 -0
- data/vendor/rigid-0.2.0.dist-info/INSTALLER +1 -0
- data/vendor/rigid-0.2.0.dist-info/METADATA +23 -0
- data/vendor/rigid-0.2.0.dist-info/RECORD +49 -0
- data/vendor/rigid-0.2.0.dist-info/WHEEL +5 -0
- data/vendor/rigid-0.2.0.dist-info/entry_points.txt +3 -0
- data/vendor/rigid-0.2.0.dist-info/metadata.json +1 -0
- data/vendor/rigid-0.2.0.dist-info/top_level.txt +2 -0
- data/vendor/setuptools-28.8.0.dist-info/DESCRIPTION.rst +243 -0
- data/vendor/setuptools-28.8.0.dist-info/INSTALLER +1 -0
- data/vendor/setuptools-28.8.0.dist-info/METADATA +272 -0
- data/vendor/setuptools-28.8.0.dist-info/RECORD +143 -0
- data/vendor/setuptools-28.8.0.dist-info/WHEEL +6 -0
- data/vendor/setuptools-28.8.0.dist-info/dependency_links.txt +2 -0
- data/vendor/setuptools-28.8.0.dist-info/entry_points.txt +63 -0
- data/vendor/setuptools-28.8.0.dist-info/metadata.json +1 -0
- data/vendor/setuptools-28.8.0.dist-info/top_level.txt +3 -0
- data/vendor/setuptools-28.8.0.dist-info/zip-safe +1 -0
- data/vendor/tests/__init__.py +0 -0
- data/vendor/tests/__init__.pyc +0 -0
- data/vendor/tests/integration/__init__.py +0 -0
- data/vendor/tests/integration/__init__.pyc +0 -0
- data/vendor/tests/integration/test_app.py +63 -0
- data/vendor/tests/integration/test_app.pyc +0 -0
- data/vendor/tests/integration/test_apps.py +27 -0
- data/vendor/tests/integration/test_apps.pyc +0 -0
- data/vendor/tests/integration/test_deploy.py +128 -0
- data/vendor/tests/integration/test_deploy.pyc +0 -0
- data/vendor/tests/integration/test_domains.py +35 -0
- data/vendor/tests/integration/test_domains.pyc +0 -0
- data/vendor/tests/integration/test_login.py +37 -0
- data/vendor/tests/integration/test_login.pyc +0 -0
- data/vendor/tests/integration/test_promote.py +24 -0
- data/vendor/tests/integration/test_promote.pyc +0 -0
- data/vendor/tests/integration/test_token.py +33 -0
- data/vendor/tests/integration/test_token.pyc +0 -0
- data/vendor/tests/integration/test_whoami.py +24 -0
- data/vendor/tests/integration/test_whoami.pyc +0 -0
- data/vendor/tests/test_deploy.py +33 -0
- data/vendor/tests/test_deploy.pyc +0 -0
- data/vendor/tests/test_file_scanner.py +89 -0
- data/vendor/tests/test_file_scanner.pyc +0 -0
- data/vendor/tests/utils.py +78 -0
- data/vendor/tests/utils.pyc +0 -0
- data/vendor/wheel-0.30.0a0.dist-info/DESCRIPTION.rst +325 -0
- data/vendor/wheel-0.30.0a0.dist-info/INSTALLER +1 -0
- data/vendor/wheel-0.30.0a0.dist-info/LICENSE.txt +22 -0
- data/vendor/wheel-0.30.0a0.dist-info/METADATA +357 -0
- data/vendor/wheel-0.30.0a0.dist-info/RECORD +86 -0
- data/vendor/wheel-0.30.0a0.dist-info/WHEEL +6 -0
- data/vendor/wheel-0.30.0a0.dist-info/entry_points.txt +6 -0
- data/vendor/wheel-0.30.0a0.dist-info/metadata.json +1 -0
- data/vendor/wheel-0.30.0a0.dist-info/top_level.txt +1 -0
- data/vendor/yaml/__init__.py +315 -0
- data/vendor/yaml/__init__.pyc +0 -0
- data/vendor/yaml/composer.py +139 -0
- data/vendor/yaml/composer.pyc +0 -0
- data/vendor/yaml/constructor.py +675 -0
- data/vendor/yaml/constructor.pyc +0 -0
- data/vendor/yaml/cyaml.py +85 -0
- data/vendor/yaml/cyaml.pyc +0 -0
- data/vendor/yaml/dumper.py +62 -0
- data/vendor/yaml/dumper.pyc +0 -0
- data/vendor/yaml/emitter.py +1140 -0
- data/vendor/yaml/emitter.pyc +0 -0
- data/vendor/yaml/error.py +75 -0
- data/vendor/yaml/error.pyc +0 -0
- data/vendor/yaml/events.py +86 -0
- data/vendor/yaml/events.pyc +0 -0
- data/vendor/yaml/loader.py +40 -0
- data/vendor/yaml/loader.pyc +0 -0
- data/vendor/yaml/nodes.py +49 -0
- data/vendor/yaml/nodes.pyc +0 -0
- data/vendor/yaml/parser.py +589 -0
- data/vendor/yaml/parser.pyc +0 -0
- data/vendor/yaml/reader.py +190 -0
- data/vendor/yaml/reader.pyc +0 -0
- data/vendor/yaml/representer.py +486 -0
- data/vendor/yaml/representer.pyc +0 -0
- data/vendor/yaml/resolver.py +227 -0
- data/vendor/yaml/resolver.pyc +0 -0
- data/vendor/yaml/scanner.py +1453 -0
- data/vendor/yaml/scanner.pyc +0 -0
- data/vendor/yaml/serializer.py +111 -0
- data/vendor/yaml/serializer.pyc +0 -0
- data/vendor/yaml/tokens.py +104 -0
- data/vendor/yaml/tokens.pyc +0 -0
- metadata +407 -0
@@ -0,0 +1,547 @@
|
|
1
|
+
"""
|
2
|
+
click._termui_impl
|
3
|
+
~~~~~~~~~~~~~~~~~~
|
4
|
+
|
5
|
+
This module contains implementations for the termui module. To keep the
|
6
|
+
import time of Click down, some infrequently used functionality is placed
|
7
|
+
in this module and only imported as needed.
|
8
|
+
|
9
|
+
:copyright: (c) 2014 by Armin Ronacher.
|
10
|
+
:license: BSD, see LICENSE for more details.
|
11
|
+
"""
|
12
|
+
import os
|
13
|
+
import sys
|
14
|
+
import time
|
15
|
+
import math
|
16
|
+
from ._compat import _default_text_stdout, range_type, PY2, isatty, \
|
17
|
+
open_stream, strip_ansi, term_len, get_best_encoding, WIN
|
18
|
+
from .utils import echo
|
19
|
+
from .exceptions import ClickException
|
20
|
+
|
21
|
+
|
22
|
+
if os.name == 'nt':
|
23
|
+
BEFORE_BAR = '\r'
|
24
|
+
AFTER_BAR = '\n'
|
25
|
+
else:
|
26
|
+
BEFORE_BAR = '\r\033[?25l'
|
27
|
+
AFTER_BAR = '\033[?25h\n'
|
28
|
+
|
29
|
+
|
30
|
+
def _length_hint(obj):
|
31
|
+
"""Returns the length hint of an object."""
|
32
|
+
try:
|
33
|
+
return len(obj)
|
34
|
+
except TypeError:
|
35
|
+
try:
|
36
|
+
get_hint = type(obj).__length_hint__
|
37
|
+
except AttributeError:
|
38
|
+
return None
|
39
|
+
try:
|
40
|
+
hint = get_hint(obj)
|
41
|
+
except TypeError:
|
42
|
+
return None
|
43
|
+
if hint is NotImplemented or \
|
44
|
+
not isinstance(hint, (int, long)) or \
|
45
|
+
hint < 0:
|
46
|
+
return None
|
47
|
+
return hint
|
48
|
+
|
49
|
+
|
50
|
+
class ProgressBar(object):
|
51
|
+
|
52
|
+
def __init__(self, iterable, length=None, fill_char='#', empty_char=' ',
|
53
|
+
bar_template='%(bar)s', info_sep=' ', show_eta=True,
|
54
|
+
show_percent=None, show_pos=False, item_show_func=None,
|
55
|
+
label=None, file=None, color=None, width=30):
|
56
|
+
self.fill_char = fill_char
|
57
|
+
self.empty_char = empty_char
|
58
|
+
self.bar_template = bar_template
|
59
|
+
self.info_sep = info_sep
|
60
|
+
self.show_eta = show_eta
|
61
|
+
self.show_percent = show_percent
|
62
|
+
self.show_pos = show_pos
|
63
|
+
self.item_show_func = item_show_func
|
64
|
+
self.label = label or ''
|
65
|
+
if file is None:
|
66
|
+
file = _default_text_stdout()
|
67
|
+
self.file = file
|
68
|
+
self.color = color
|
69
|
+
self.width = width
|
70
|
+
self.autowidth = width == 0
|
71
|
+
|
72
|
+
if length is None:
|
73
|
+
length = _length_hint(iterable)
|
74
|
+
if iterable is None:
|
75
|
+
if length is None:
|
76
|
+
raise TypeError('iterable or length is required')
|
77
|
+
iterable = range_type(length)
|
78
|
+
self.iter = iter(iterable)
|
79
|
+
self.length = length
|
80
|
+
self.length_known = length is not None
|
81
|
+
self.pos = 0
|
82
|
+
self.avg = []
|
83
|
+
self.start = self.last_eta = time.time()
|
84
|
+
self.eta_known = False
|
85
|
+
self.finished = False
|
86
|
+
self.max_width = None
|
87
|
+
self.entered = False
|
88
|
+
self.current_item = None
|
89
|
+
self.is_hidden = not isatty(self.file)
|
90
|
+
self._last_line = None
|
91
|
+
|
92
|
+
def __enter__(self):
|
93
|
+
self.entered = True
|
94
|
+
self.render_progress()
|
95
|
+
return self
|
96
|
+
|
97
|
+
def __exit__(self, exc_type, exc_value, tb):
|
98
|
+
self.render_finish()
|
99
|
+
|
100
|
+
def __iter__(self):
|
101
|
+
if not self.entered:
|
102
|
+
raise RuntimeError('You need to use progress bars in a with block.')
|
103
|
+
self.render_progress()
|
104
|
+
return self
|
105
|
+
|
106
|
+
def render_finish(self):
|
107
|
+
if self.is_hidden:
|
108
|
+
return
|
109
|
+
self.file.write(AFTER_BAR)
|
110
|
+
self.file.flush()
|
111
|
+
|
112
|
+
@property
|
113
|
+
def pct(self):
|
114
|
+
if self.finished:
|
115
|
+
return 1.0
|
116
|
+
return min(self.pos / (float(self.length) or 1), 1.0)
|
117
|
+
|
118
|
+
@property
|
119
|
+
def time_per_iteration(self):
|
120
|
+
if not self.avg:
|
121
|
+
return 0.0
|
122
|
+
return sum(self.avg) / float(len(self.avg))
|
123
|
+
|
124
|
+
@property
|
125
|
+
def eta(self):
|
126
|
+
if self.length_known and not self.finished:
|
127
|
+
return self.time_per_iteration * (self.length - self.pos)
|
128
|
+
return 0.0
|
129
|
+
|
130
|
+
def format_eta(self):
|
131
|
+
if self.eta_known:
|
132
|
+
t = self.eta + 1
|
133
|
+
seconds = t % 60
|
134
|
+
t /= 60
|
135
|
+
minutes = t % 60
|
136
|
+
t /= 60
|
137
|
+
hours = t % 24
|
138
|
+
t /= 24
|
139
|
+
if t > 0:
|
140
|
+
days = t
|
141
|
+
return '%dd %02d:%02d:%02d' % (days, hours, minutes, seconds)
|
142
|
+
else:
|
143
|
+
return '%02d:%02d:%02d' % (hours, minutes, seconds)
|
144
|
+
return ''
|
145
|
+
|
146
|
+
def format_pos(self):
|
147
|
+
pos = str(self.pos)
|
148
|
+
if self.length_known:
|
149
|
+
pos += '/%s' % self.length
|
150
|
+
return pos
|
151
|
+
|
152
|
+
def format_pct(self):
|
153
|
+
return ('% 4d%%' % int(self.pct * 100))[1:]
|
154
|
+
|
155
|
+
def format_progress_line(self):
|
156
|
+
show_percent = self.show_percent
|
157
|
+
|
158
|
+
info_bits = []
|
159
|
+
if self.length_known:
|
160
|
+
bar_length = int(self.pct * self.width)
|
161
|
+
bar = self.fill_char * bar_length
|
162
|
+
bar += self.empty_char * (self.width - bar_length)
|
163
|
+
if show_percent is None:
|
164
|
+
show_percent = not self.show_pos
|
165
|
+
else:
|
166
|
+
if self.finished:
|
167
|
+
bar = self.fill_char * self.width
|
168
|
+
else:
|
169
|
+
bar = list(self.empty_char * (self.width or 1))
|
170
|
+
if self.time_per_iteration != 0:
|
171
|
+
bar[int((math.cos(self.pos * self.time_per_iteration)
|
172
|
+
/ 2.0 + 0.5) * self.width)] = self.fill_char
|
173
|
+
bar = ''.join(bar)
|
174
|
+
|
175
|
+
if self.show_pos:
|
176
|
+
info_bits.append(self.format_pos())
|
177
|
+
if show_percent:
|
178
|
+
info_bits.append(self.format_pct())
|
179
|
+
if self.show_eta and self.eta_known and not self.finished:
|
180
|
+
info_bits.append(self.format_eta())
|
181
|
+
if self.item_show_func is not None:
|
182
|
+
item_info = self.item_show_func(self.current_item)
|
183
|
+
if item_info is not None:
|
184
|
+
info_bits.append(item_info)
|
185
|
+
|
186
|
+
return (self.bar_template % {
|
187
|
+
'label': self.label,
|
188
|
+
'bar': bar,
|
189
|
+
'info': self.info_sep.join(info_bits)
|
190
|
+
}).rstrip()
|
191
|
+
|
192
|
+
def render_progress(self):
|
193
|
+
from .termui import get_terminal_size
|
194
|
+
nl = False
|
195
|
+
|
196
|
+
if self.is_hidden:
|
197
|
+
buf = [self.label]
|
198
|
+
nl = True
|
199
|
+
else:
|
200
|
+
buf = []
|
201
|
+
# Update width in case the terminal has been resized
|
202
|
+
if self.autowidth:
|
203
|
+
old_width = self.width
|
204
|
+
self.width = 0
|
205
|
+
clutter_length = term_len(self.format_progress_line())
|
206
|
+
new_width = max(0, get_terminal_size()[0] - clutter_length)
|
207
|
+
if new_width < old_width:
|
208
|
+
buf.append(BEFORE_BAR)
|
209
|
+
buf.append(' ' * self.max_width)
|
210
|
+
self.max_width = new_width
|
211
|
+
self.width = new_width
|
212
|
+
|
213
|
+
clear_width = self.width
|
214
|
+
if self.max_width is not None:
|
215
|
+
clear_width = self.max_width
|
216
|
+
|
217
|
+
buf.append(BEFORE_BAR)
|
218
|
+
line = self.format_progress_line()
|
219
|
+
line_len = term_len(line)
|
220
|
+
if self.max_width is None or self.max_width < line_len:
|
221
|
+
self.max_width = line_len
|
222
|
+
buf.append(line)
|
223
|
+
|
224
|
+
buf.append(' ' * (clear_width - line_len))
|
225
|
+
line = ''.join(buf)
|
226
|
+
|
227
|
+
# Render the line only if it changed.
|
228
|
+
if line != self._last_line:
|
229
|
+
self._last_line = line
|
230
|
+
echo(line, file=self.file, color=self.color, nl=nl)
|
231
|
+
self.file.flush()
|
232
|
+
|
233
|
+
def make_step(self, n_steps):
|
234
|
+
self.pos += n_steps
|
235
|
+
if self.length_known and self.pos >= self.length:
|
236
|
+
self.finished = True
|
237
|
+
|
238
|
+
if (time.time() - self.last_eta) < 1.0:
|
239
|
+
return
|
240
|
+
|
241
|
+
self.last_eta = time.time()
|
242
|
+
self.avg = self.avg[-6:] + [-(self.start - time.time()) / (self.pos)]
|
243
|
+
|
244
|
+
self.eta_known = self.length_known
|
245
|
+
|
246
|
+
def update(self, n_steps):
|
247
|
+
self.make_step(n_steps)
|
248
|
+
self.render_progress()
|
249
|
+
|
250
|
+
def finish(self):
|
251
|
+
self.eta_known = 0
|
252
|
+
self.current_item = None
|
253
|
+
self.finished = True
|
254
|
+
|
255
|
+
def next(self):
|
256
|
+
if self.is_hidden:
|
257
|
+
return next(self.iter)
|
258
|
+
try:
|
259
|
+
rv = next(self.iter)
|
260
|
+
self.current_item = rv
|
261
|
+
except StopIteration:
|
262
|
+
self.finish()
|
263
|
+
self.render_progress()
|
264
|
+
raise StopIteration()
|
265
|
+
else:
|
266
|
+
self.update(1)
|
267
|
+
return rv
|
268
|
+
|
269
|
+
if not PY2:
|
270
|
+
__next__ = next
|
271
|
+
del next
|
272
|
+
|
273
|
+
|
274
|
+
def pager(text, color=None):
|
275
|
+
"""Decide what method to use for paging through text."""
|
276
|
+
stdout = _default_text_stdout()
|
277
|
+
if not isatty(sys.stdin) or not isatty(stdout):
|
278
|
+
return _nullpager(stdout, text, color)
|
279
|
+
pager_cmd = (os.environ.get('PAGER', None) or '').strip()
|
280
|
+
if pager_cmd:
|
281
|
+
if WIN:
|
282
|
+
return _tempfilepager(text, pager_cmd, color)
|
283
|
+
return _pipepager(text, pager_cmd, color)
|
284
|
+
if os.environ.get('TERM') in ('dumb', 'emacs'):
|
285
|
+
return _nullpager(stdout, text, color)
|
286
|
+
if WIN or sys.platform.startswith('os2'):
|
287
|
+
return _tempfilepager(text, 'more <', color)
|
288
|
+
if hasattr(os, 'system') and os.system('(less) 2>/dev/null') == 0:
|
289
|
+
return _pipepager(text, 'less', color)
|
290
|
+
|
291
|
+
import tempfile
|
292
|
+
fd, filename = tempfile.mkstemp()
|
293
|
+
os.close(fd)
|
294
|
+
try:
|
295
|
+
if hasattr(os, 'system') and os.system('more "%s"' % filename) == 0:
|
296
|
+
return _pipepager(text, 'more', color)
|
297
|
+
return _nullpager(stdout, text, color)
|
298
|
+
finally:
|
299
|
+
os.unlink(filename)
|
300
|
+
|
301
|
+
|
302
|
+
def _pipepager(text, cmd, color):
|
303
|
+
"""Page through text by feeding it to another program. Invoking a
|
304
|
+
pager through this might support colors.
|
305
|
+
"""
|
306
|
+
import subprocess
|
307
|
+
env = dict(os.environ)
|
308
|
+
|
309
|
+
# If we're piping to less we might support colors under the
|
310
|
+
# condition that
|
311
|
+
cmd_detail = cmd.rsplit('/', 1)[-1].split()
|
312
|
+
if color is None and cmd_detail[0] == 'less':
|
313
|
+
less_flags = os.environ.get('LESS', '') + ' '.join(cmd_detail[1:])
|
314
|
+
if not less_flags:
|
315
|
+
env['LESS'] = '-R'
|
316
|
+
color = True
|
317
|
+
elif 'r' in less_flags or 'R' in less_flags:
|
318
|
+
color = True
|
319
|
+
|
320
|
+
if not color:
|
321
|
+
text = strip_ansi(text)
|
322
|
+
|
323
|
+
c = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE,
|
324
|
+
env=env)
|
325
|
+
encoding = get_best_encoding(c.stdin)
|
326
|
+
try:
|
327
|
+
c.stdin.write(text.encode(encoding, 'replace'))
|
328
|
+
c.stdin.close()
|
329
|
+
except (IOError, KeyboardInterrupt):
|
330
|
+
pass
|
331
|
+
|
332
|
+
# Less doesn't respect ^C, but catches it for its own UI purposes (aborting
|
333
|
+
# search or other commands inside less).
|
334
|
+
#
|
335
|
+
# That means when the user hits ^C, the parent process (click) terminates,
|
336
|
+
# but less is still alive, paging the output and messing up the terminal.
|
337
|
+
#
|
338
|
+
# If the user wants to make the pager exit on ^C, they should set
|
339
|
+
# `LESS='-K'`. It's not our decision to make.
|
340
|
+
while True:
|
341
|
+
try:
|
342
|
+
c.wait()
|
343
|
+
except KeyboardInterrupt:
|
344
|
+
pass
|
345
|
+
else:
|
346
|
+
break
|
347
|
+
|
348
|
+
|
349
|
+
def _tempfilepager(text, cmd, color):
|
350
|
+
"""Page through text by invoking a program on a temporary file."""
|
351
|
+
import tempfile
|
352
|
+
filename = tempfile.mktemp()
|
353
|
+
if not color:
|
354
|
+
text = strip_ansi(text)
|
355
|
+
encoding = get_best_encoding(sys.stdout)
|
356
|
+
with open_stream(filename, 'wb')[0] as f:
|
357
|
+
f.write(text.encode(encoding))
|
358
|
+
try:
|
359
|
+
os.system(cmd + ' "' + filename + '"')
|
360
|
+
finally:
|
361
|
+
os.unlink(filename)
|
362
|
+
|
363
|
+
|
364
|
+
def _nullpager(stream, text, color):
|
365
|
+
"""Simply print unformatted text. This is the ultimate fallback."""
|
366
|
+
if not color:
|
367
|
+
text = strip_ansi(text)
|
368
|
+
stream.write(text)
|
369
|
+
|
370
|
+
|
371
|
+
class Editor(object):
|
372
|
+
|
373
|
+
def __init__(self, editor=None, env=None, require_save=True,
|
374
|
+
extension='.txt'):
|
375
|
+
self.editor = editor
|
376
|
+
self.env = env
|
377
|
+
self.require_save = require_save
|
378
|
+
self.extension = extension
|
379
|
+
|
380
|
+
def get_editor(self):
|
381
|
+
if self.editor is not None:
|
382
|
+
return self.editor
|
383
|
+
for key in 'VISUAL', 'EDITOR':
|
384
|
+
rv = os.environ.get(key)
|
385
|
+
if rv:
|
386
|
+
return rv
|
387
|
+
if WIN:
|
388
|
+
return 'notepad'
|
389
|
+
for editor in 'vim', 'nano':
|
390
|
+
if os.system('which %s >/dev/null 2>&1' % editor) == 0:
|
391
|
+
return editor
|
392
|
+
return 'vi'
|
393
|
+
|
394
|
+
def edit_file(self, filename):
|
395
|
+
import subprocess
|
396
|
+
editor = self.get_editor()
|
397
|
+
if self.env:
|
398
|
+
environ = os.environ.copy()
|
399
|
+
environ.update(self.env)
|
400
|
+
else:
|
401
|
+
environ = None
|
402
|
+
try:
|
403
|
+
c = subprocess.Popen('%s "%s"' % (editor, filename),
|
404
|
+
env=environ, shell=True)
|
405
|
+
exit_code = c.wait()
|
406
|
+
if exit_code != 0:
|
407
|
+
raise ClickException('%s: Editing failed!' % editor)
|
408
|
+
except OSError as e:
|
409
|
+
raise ClickException('%s: Editing failed: %s' % (editor, e))
|
410
|
+
|
411
|
+
def edit(self, text):
|
412
|
+
import tempfile
|
413
|
+
|
414
|
+
text = text or ''
|
415
|
+
if text and not text.endswith('\n'):
|
416
|
+
text += '\n'
|
417
|
+
|
418
|
+
fd, name = tempfile.mkstemp(prefix='editor-', suffix=self.extension)
|
419
|
+
try:
|
420
|
+
if WIN:
|
421
|
+
encoding = 'utf-8-sig'
|
422
|
+
text = text.replace('\n', '\r\n')
|
423
|
+
else:
|
424
|
+
encoding = 'utf-8'
|
425
|
+
text = text.encode(encoding)
|
426
|
+
|
427
|
+
f = os.fdopen(fd, 'wb')
|
428
|
+
f.write(text)
|
429
|
+
f.close()
|
430
|
+
timestamp = os.path.getmtime(name)
|
431
|
+
|
432
|
+
self.edit_file(name)
|
433
|
+
|
434
|
+
if self.require_save \
|
435
|
+
and os.path.getmtime(name) == timestamp:
|
436
|
+
return None
|
437
|
+
|
438
|
+
f = open(name, 'rb')
|
439
|
+
try:
|
440
|
+
rv = f.read()
|
441
|
+
finally:
|
442
|
+
f.close()
|
443
|
+
return rv.decode('utf-8-sig').replace('\r\n', '\n')
|
444
|
+
finally:
|
445
|
+
os.unlink(name)
|
446
|
+
|
447
|
+
|
448
|
+
def open_url(url, wait=False, locate=False):
|
449
|
+
import subprocess
|
450
|
+
|
451
|
+
def _unquote_file(url):
|
452
|
+
try:
|
453
|
+
import urllib
|
454
|
+
except ImportError:
|
455
|
+
import urllib
|
456
|
+
if url.startswith('file://'):
|
457
|
+
url = urllib.unquote(url[7:])
|
458
|
+
return url
|
459
|
+
|
460
|
+
if sys.platform == 'darwin':
|
461
|
+
args = ['open']
|
462
|
+
if wait:
|
463
|
+
args.append('-W')
|
464
|
+
if locate:
|
465
|
+
args.append('-R')
|
466
|
+
args.append(_unquote_file(url))
|
467
|
+
null = open('/dev/null', 'w')
|
468
|
+
try:
|
469
|
+
return subprocess.Popen(args, stderr=null).wait()
|
470
|
+
finally:
|
471
|
+
null.close()
|
472
|
+
elif WIN:
|
473
|
+
if locate:
|
474
|
+
url = _unquote_file(url)
|
475
|
+
args = 'explorer /select,"%s"' % _unquote_file(
|
476
|
+
url.replace('"', ''))
|
477
|
+
else:
|
478
|
+
args = 'start %s "" "%s"' % (
|
479
|
+
wait and '/WAIT' or '', url.replace('"', ''))
|
480
|
+
return os.system(args)
|
481
|
+
|
482
|
+
try:
|
483
|
+
if locate:
|
484
|
+
url = os.path.dirname(_unquote_file(url)) or '.'
|
485
|
+
else:
|
486
|
+
url = _unquote_file(url)
|
487
|
+
c = subprocess.Popen(['xdg-open', url])
|
488
|
+
if wait:
|
489
|
+
return c.wait()
|
490
|
+
return 0
|
491
|
+
except OSError:
|
492
|
+
if url.startswith(('http://', 'https://')) and not locate and not wait:
|
493
|
+
import webbrowser
|
494
|
+
webbrowser.open(url)
|
495
|
+
return 0
|
496
|
+
return 1
|
497
|
+
|
498
|
+
|
499
|
+
def _translate_ch_to_exc(ch):
|
500
|
+
if ch == '\x03':
|
501
|
+
raise KeyboardInterrupt()
|
502
|
+
if ch == '\x04':
|
503
|
+
raise EOFError()
|
504
|
+
|
505
|
+
|
506
|
+
if WIN:
|
507
|
+
import msvcrt
|
508
|
+
|
509
|
+
def getchar(echo):
|
510
|
+
rv = msvcrt.getch()
|
511
|
+
if echo:
|
512
|
+
msvcrt.putchar(rv)
|
513
|
+
_translate_ch_to_exc(rv)
|
514
|
+
if PY2:
|
515
|
+
enc = getattr(sys.stdin, 'encoding', None)
|
516
|
+
if enc is not None:
|
517
|
+
rv = rv.decode(enc, 'replace')
|
518
|
+
else:
|
519
|
+
rv = rv.decode('cp1252', 'replace')
|
520
|
+
return rv
|
521
|
+
else:
|
522
|
+
import tty
|
523
|
+
import termios
|
524
|
+
|
525
|
+
def getchar(echo):
|
526
|
+
if not isatty(sys.stdin):
|
527
|
+
f = open('/dev/tty')
|
528
|
+
fd = f.fileno()
|
529
|
+
else:
|
530
|
+
fd = sys.stdin.fileno()
|
531
|
+
f = None
|
532
|
+
try:
|
533
|
+
old_settings = termios.tcgetattr(fd)
|
534
|
+
try:
|
535
|
+
tty.setraw(fd)
|
536
|
+
ch = os.read(fd, 32)
|
537
|
+
if echo and isatty(sys.stdout):
|
538
|
+
sys.stdout.write(ch)
|
539
|
+
finally:
|
540
|
+
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
|
541
|
+
sys.stdout.flush()
|
542
|
+
if f is not None:
|
543
|
+
f.close()
|
544
|
+
except termios.error:
|
545
|
+
pass
|
546
|
+
_translate_ch_to_exc(ch)
|
547
|
+
return ch.decode(get_best_encoding(sys.stdin), 'replace')
|
Binary file
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import textwrap
|
2
|
+
from contextlib import contextmanager
|
3
|
+
|
4
|
+
|
5
|
+
class TextWrapper(textwrap.TextWrapper):
|
6
|
+
|
7
|
+
def _handle_long_word(self, reversed_chunks, cur_line, cur_len, width):
|
8
|
+
space_left = max(width - cur_len, 1)
|
9
|
+
|
10
|
+
if self.break_long_words:
|
11
|
+
last = reversed_chunks[-1]
|
12
|
+
cut = last[:space_left]
|
13
|
+
res = last[space_left:]
|
14
|
+
cur_line.append(cut)
|
15
|
+
reversed_chunks[-1] = res
|
16
|
+
elif not cur_line:
|
17
|
+
cur_line.append(reversed_chunks.pop())
|
18
|
+
|
19
|
+
@contextmanager
|
20
|
+
def extra_indent(self, indent):
|
21
|
+
old_initial_indent = self.initial_indent
|
22
|
+
old_subsequent_indent = self.subsequent_indent
|
23
|
+
self.initial_indent += indent
|
24
|
+
self.subsequent_indent += indent
|
25
|
+
try:
|
26
|
+
yield
|
27
|
+
finally:
|
28
|
+
self.initial_indent = old_initial_indent
|
29
|
+
self.subsequent_indent = old_subsequent_indent
|
30
|
+
|
31
|
+
def indent_only(self, text):
|
32
|
+
rv = []
|
33
|
+
for idx, line in enumerate(text.splitlines()):
|
34
|
+
indent = self.initial_indent
|
35
|
+
if idx > 0:
|
36
|
+
indent = self.subsequent_indent
|
37
|
+
rv.append(indent + line)
|
38
|
+
return '\n'.join(rv)
|
Binary file
|
@@ -0,0 +1,119 @@
|
|
1
|
+
import os
|
2
|
+
import sys
|
3
|
+
import codecs
|
4
|
+
|
5
|
+
from ._compat import PY2
|
6
|
+
|
7
|
+
|
8
|
+
# If someone wants to vendor click, we want to ensure the
|
9
|
+
# correct package is discovered. Ideally we could use a
|
10
|
+
# relative import here but unfortunately Python does not
|
11
|
+
# support that.
|
12
|
+
click = sys.modules[__name__.rsplit('.', 1)[0]]
|
13
|
+
|
14
|
+
|
15
|
+
def _find_unicode_literals_frame():
|
16
|
+
import __future__
|
17
|
+
frm = sys._getframe(1)
|
18
|
+
idx = 1
|
19
|
+
while frm is not None:
|
20
|
+
if frm.f_globals.get('__name__', '').startswith('click.'):
|
21
|
+
frm = frm.f_back
|
22
|
+
idx += 1
|
23
|
+
elif frm.f_code.co_flags & __future__.unicode_literals.compiler_flag:
|
24
|
+
return idx
|
25
|
+
else:
|
26
|
+
break
|
27
|
+
return 0
|
28
|
+
|
29
|
+
|
30
|
+
def _check_for_unicode_literals():
|
31
|
+
if not __debug__:
|
32
|
+
return
|
33
|
+
if not PY2 or click.disable_unicode_literals_warning:
|
34
|
+
return
|
35
|
+
bad_frame = _find_unicode_literals_frame()
|
36
|
+
if bad_frame <= 0:
|
37
|
+
return
|
38
|
+
from warnings import warn
|
39
|
+
warn(Warning('Click detected the use of the unicode_literals '
|
40
|
+
'__future__ import. This is heavily discouraged '
|
41
|
+
'because it can introduce subtle bugs in your '
|
42
|
+
'code. You should instead use explicit u"" literals '
|
43
|
+
'for your unicode strings. For more information see '
|
44
|
+
'http://click.pocoo.org/python3/'),
|
45
|
+
stacklevel=bad_frame)
|
46
|
+
|
47
|
+
|
48
|
+
def _verify_python3_env():
|
49
|
+
"""Ensures that the environment is good for unicode on Python 3."""
|
50
|
+
if PY2:
|
51
|
+
return
|
52
|
+
try:
|
53
|
+
import locale
|
54
|
+
fs_enc = codecs.lookup(locale.getpreferredencoding()).name
|
55
|
+
except Exception:
|
56
|
+
fs_enc = 'ascii'
|
57
|
+
if fs_enc != 'ascii':
|
58
|
+
return
|
59
|
+
|
60
|
+
extra = ''
|
61
|
+
if os.name == 'posix':
|
62
|
+
import subprocess
|
63
|
+
rv = subprocess.Popen(['locale', '-a'], stdout=subprocess.PIPE,
|
64
|
+
stderr=subprocess.PIPE).communicate()[0]
|
65
|
+
good_locales = set()
|
66
|
+
has_c_utf8 = False
|
67
|
+
|
68
|
+
# Make sure we're operating on text here.
|
69
|
+
if isinstance(rv, bytes):
|
70
|
+
rv = rv.decode('ascii', 'replace')
|
71
|
+
|
72
|
+
for line in rv.splitlines():
|
73
|
+
locale = line.strip()
|
74
|
+
if locale.lower().endswith(('.utf-8', '.utf8')):
|
75
|
+
good_locales.add(locale)
|
76
|
+
if locale.lower() in ('c.utf8', 'c.utf-8'):
|
77
|
+
has_c_utf8 = True
|
78
|
+
|
79
|
+
extra += '\n\n'
|
80
|
+
if not good_locales:
|
81
|
+
extra += (
|
82
|
+
'Additional information: on this system no suitable UTF-8\n'
|
83
|
+
'locales were discovered. This most likely requires resolving\n'
|
84
|
+
'by reconfiguring the locale system.'
|
85
|
+
)
|
86
|
+
elif has_c_utf8:
|
87
|
+
extra += (
|
88
|
+
'This system supports the C.UTF-8 locale which is recommended.\n'
|
89
|
+
'You might be able to resolve your issue by exporting the\n'
|
90
|
+
'following environment variables:\n\n'
|
91
|
+
' export LC_ALL=C.UTF-8\n'
|
92
|
+
' export LANG=C.UTF-8'
|
93
|
+
)
|
94
|
+
else:
|
95
|
+
extra += (
|
96
|
+
'This system lists a couple of UTF-8 supporting locales that\n'
|
97
|
+
'you can pick from. The following suitable locales where\n'
|
98
|
+
'discovered: %s'
|
99
|
+
) % ', '.join(sorted(good_locales))
|
100
|
+
|
101
|
+
bad_locale = None
|
102
|
+
for locale in os.environ.get('LC_ALL'), os.environ.get('LANG'):
|
103
|
+
if locale and locale.lower().endswith(('.utf-8', '.utf8')):
|
104
|
+
bad_locale = locale
|
105
|
+
if locale is not None:
|
106
|
+
break
|
107
|
+
if bad_locale is not None:
|
108
|
+
extra += (
|
109
|
+
'\n\nClick discovered that you exported a UTF-8 locale\n'
|
110
|
+
'but the locale system could not pick up from it because\n'
|
111
|
+
'it does not exist. The exported locale is "%s" but it\n'
|
112
|
+
'is not supported'
|
113
|
+
) % bad_locale
|
114
|
+
|
115
|
+
raise RuntimeError('Click will abort further execution because Python 3 '
|
116
|
+
'was configured to use ASCII as encoding for the '
|
117
|
+
'environment. Either run this under Python 2 or '
|
118
|
+
'consult http://click.pocoo.org/python3/ for '
|
119
|
+
'mitigation steps.' + extra)
|
Binary file
|