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,539 @@
|
|
1
|
+
import os
|
2
|
+
import sys
|
3
|
+
import struct
|
4
|
+
|
5
|
+
from ._compat import raw_input, text_type, string_types, \
|
6
|
+
isatty, strip_ansi, get_winterm_size, DEFAULT_COLUMNS, WIN
|
7
|
+
from .utils import echo
|
8
|
+
from .exceptions import Abort, UsageError
|
9
|
+
from .types import convert_type
|
10
|
+
from .globals import resolve_color_default
|
11
|
+
|
12
|
+
|
13
|
+
# The prompt functions to use. The doc tools currently override these
|
14
|
+
# functions to customize how they work.
|
15
|
+
visible_prompt_func = raw_input
|
16
|
+
|
17
|
+
_ansi_colors = ('black', 'red', 'green', 'yellow', 'blue', 'magenta',
|
18
|
+
'cyan', 'white', 'reset')
|
19
|
+
_ansi_reset_all = '\033[0m'
|
20
|
+
|
21
|
+
|
22
|
+
def hidden_prompt_func(prompt):
|
23
|
+
import getpass
|
24
|
+
return getpass.getpass(prompt)
|
25
|
+
|
26
|
+
|
27
|
+
def _build_prompt(text, suffix, show_default=False, default=None):
|
28
|
+
prompt = text
|
29
|
+
if default is not None and show_default:
|
30
|
+
prompt = '%s [%s]' % (prompt, default)
|
31
|
+
return prompt + suffix
|
32
|
+
|
33
|
+
|
34
|
+
def prompt(text, default=None, hide_input=False,
|
35
|
+
confirmation_prompt=False, type=None,
|
36
|
+
value_proc=None, prompt_suffix=': ',
|
37
|
+
show_default=True, err=False):
|
38
|
+
"""Prompts a user for input. This is a convenience function that can
|
39
|
+
be used to prompt a user for input later.
|
40
|
+
|
41
|
+
If the user aborts the input by sending a interrupt signal, this
|
42
|
+
function will catch it and raise a :exc:`Abort` exception.
|
43
|
+
|
44
|
+
.. versionadded:: 6.0
|
45
|
+
Added unicode support for cmd.exe on Windows.
|
46
|
+
|
47
|
+
.. versionadded:: 4.0
|
48
|
+
Added the `err` parameter.
|
49
|
+
|
50
|
+
:param text: the text to show for the prompt.
|
51
|
+
:param default: the default value to use if no input happens. If this
|
52
|
+
is not given it will prompt until it's aborted.
|
53
|
+
:param hide_input: if this is set to true then the input value will
|
54
|
+
be hidden.
|
55
|
+
:param confirmation_prompt: asks for confirmation for the value.
|
56
|
+
:param type: the type to use to check the value against.
|
57
|
+
:param value_proc: if this parameter is provided it's a function that
|
58
|
+
is invoked instead of the type conversion to
|
59
|
+
convert a value.
|
60
|
+
:param prompt_suffix: a suffix that should be added to the prompt.
|
61
|
+
:param show_default: shows or hides the default value in the prompt.
|
62
|
+
:param err: if set to true the file defaults to ``stderr`` instead of
|
63
|
+
``stdout``, the same as with echo.
|
64
|
+
"""
|
65
|
+
result = None
|
66
|
+
|
67
|
+
def prompt_func(text):
|
68
|
+
f = hide_input and hidden_prompt_func or visible_prompt_func
|
69
|
+
try:
|
70
|
+
# Write the prompt separately so that we get nice
|
71
|
+
# coloring through colorama on Windows
|
72
|
+
echo(text, nl=False, err=err)
|
73
|
+
return f('')
|
74
|
+
except (KeyboardInterrupt, EOFError):
|
75
|
+
# getpass doesn't print a newline if the user aborts input with ^C.
|
76
|
+
# Allegedly this behavior is inherited from getpass(3).
|
77
|
+
# A doc bug has been filed at https://bugs.python.org/issue24711
|
78
|
+
if hide_input:
|
79
|
+
echo(None, err=err)
|
80
|
+
raise Abort()
|
81
|
+
|
82
|
+
if value_proc is None:
|
83
|
+
value_proc = convert_type(type, default)
|
84
|
+
|
85
|
+
prompt = _build_prompt(text, prompt_suffix, show_default, default)
|
86
|
+
|
87
|
+
while 1:
|
88
|
+
while 1:
|
89
|
+
value = prompt_func(prompt)
|
90
|
+
if value:
|
91
|
+
break
|
92
|
+
# If a default is set and used, then the confirmation
|
93
|
+
# prompt is always skipped because that's the only thing
|
94
|
+
# that really makes sense.
|
95
|
+
elif default is not None:
|
96
|
+
return default
|
97
|
+
try:
|
98
|
+
result = value_proc(value)
|
99
|
+
except UsageError as e:
|
100
|
+
echo('Error: %s' % e.message, err=err)
|
101
|
+
continue
|
102
|
+
if not confirmation_prompt:
|
103
|
+
return result
|
104
|
+
while 1:
|
105
|
+
value2 = prompt_func('Repeat for confirmation: ')
|
106
|
+
if value2:
|
107
|
+
break
|
108
|
+
if value == value2:
|
109
|
+
return result
|
110
|
+
echo('Error: the two entered values do not match', err=err)
|
111
|
+
|
112
|
+
|
113
|
+
def confirm(text, default=False, abort=False, prompt_suffix=': ',
|
114
|
+
show_default=True, err=False):
|
115
|
+
"""Prompts for confirmation (yes/no question).
|
116
|
+
|
117
|
+
If the user aborts the input by sending a interrupt signal this
|
118
|
+
function will catch it and raise a :exc:`Abort` exception.
|
119
|
+
|
120
|
+
.. versionadded:: 4.0
|
121
|
+
Added the `err` parameter.
|
122
|
+
|
123
|
+
:param text: the question to ask.
|
124
|
+
:param default: the default for the prompt.
|
125
|
+
:param abort: if this is set to `True` a negative answer aborts the
|
126
|
+
exception by raising :exc:`Abort`.
|
127
|
+
:param prompt_suffix: a suffix that should be added to the prompt.
|
128
|
+
:param show_default: shows or hides the default value in the prompt.
|
129
|
+
:param err: if set to true the file defaults to ``stderr`` instead of
|
130
|
+
``stdout``, the same as with echo.
|
131
|
+
"""
|
132
|
+
prompt = _build_prompt(text, prompt_suffix, show_default,
|
133
|
+
default and 'Y/n' or 'y/N')
|
134
|
+
while 1:
|
135
|
+
try:
|
136
|
+
# Write the prompt separately so that we get nice
|
137
|
+
# coloring through colorama on Windows
|
138
|
+
echo(prompt, nl=False, err=err)
|
139
|
+
value = visible_prompt_func('').lower().strip()
|
140
|
+
except (KeyboardInterrupt, EOFError):
|
141
|
+
raise Abort()
|
142
|
+
if value in ('y', 'yes'):
|
143
|
+
rv = True
|
144
|
+
elif value in ('n', 'no'):
|
145
|
+
rv = False
|
146
|
+
elif value == '':
|
147
|
+
rv = default
|
148
|
+
else:
|
149
|
+
echo('Error: invalid input', err=err)
|
150
|
+
continue
|
151
|
+
break
|
152
|
+
if abort and not rv:
|
153
|
+
raise Abort()
|
154
|
+
return rv
|
155
|
+
|
156
|
+
|
157
|
+
def get_terminal_size():
|
158
|
+
"""Returns the current size of the terminal as tuple in the form
|
159
|
+
``(width, height)`` in columns and rows.
|
160
|
+
"""
|
161
|
+
# If shutil has get_terminal_size() (Python 3.3 and later) use that
|
162
|
+
if sys.version_info >= (3, 3):
|
163
|
+
import shutil
|
164
|
+
shutil_get_terminal_size = getattr(shutil, 'get_terminal_size', None)
|
165
|
+
if shutil_get_terminal_size:
|
166
|
+
sz = shutil_get_terminal_size()
|
167
|
+
return sz.columns, sz.lines
|
168
|
+
|
169
|
+
if get_winterm_size is not None:
|
170
|
+
return get_winterm_size()
|
171
|
+
|
172
|
+
def ioctl_gwinsz(fd):
|
173
|
+
try:
|
174
|
+
import fcntl
|
175
|
+
import termios
|
176
|
+
cr = struct.unpack(
|
177
|
+
'hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234'))
|
178
|
+
except Exception:
|
179
|
+
return
|
180
|
+
return cr
|
181
|
+
|
182
|
+
cr = ioctl_gwinsz(0) or ioctl_gwinsz(1) or ioctl_gwinsz(2)
|
183
|
+
if not cr:
|
184
|
+
try:
|
185
|
+
fd = os.open(os.ctermid(), os.O_RDONLY)
|
186
|
+
try:
|
187
|
+
cr = ioctl_gwinsz(fd)
|
188
|
+
finally:
|
189
|
+
os.close(fd)
|
190
|
+
except Exception:
|
191
|
+
pass
|
192
|
+
if not cr or not cr[0] or not cr[1]:
|
193
|
+
cr = (os.environ.get('LINES', 25),
|
194
|
+
os.environ.get('COLUMNS', DEFAULT_COLUMNS))
|
195
|
+
return int(cr[1]), int(cr[0])
|
196
|
+
|
197
|
+
|
198
|
+
def echo_via_pager(text, color=None):
|
199
|
+
"""This function takes a text and shows it via an environment specific
|
200
|
+
pager on stdout.
|
201
|
+
|
202
|
+
.. versionchanged:: 3.0
|
203
|
+
Added the `color` flag.
|
204
|
+
|
205
|
+
:param text: the text to page.
|
206
|
+
:param color: controls if the pager supports ANSI colors or not. The
|
207
|
+
default is autodetection.
|
208
|
+
"""
|
209
|
+
color = resolve_color_default(color)
|
210
|
+
if not isinstance(text, string_types):
|
211
|
+
text = text_type(text)
|
212
|
+
from ._termui_impl import pager
|
213
|
+
return pager(text + '\n', color)
|
214
|
+
|
215
|
+
|
216
|
+
def progressbar(iterable=None, length=None, label=None, show_eta=True,
|
217
|
+
show_percent=None, show_pos=False,
|
218
|
+
item_show_func=None, fill_char='#', empty_char='-',
|
219
|
+
bar_template='%(label)s [%(bar)s] %(info)s',
|
220
|
+
info_sep=' ', width=36, file=None, color=None):
|
221
|
+
"""This function creates an iterable context manager that can be used
|
222
|
+
to iterate over something while showing a progress bar. It will
|
223
|
+
either iterate over the `iterable` or `length` items (that are counted
|
224
|
+
up). While iteration happens, this function will print a rendered
|
225
|
+
progress bar to the given `file` (defaults to stdout) and will attempt
|
226
|
+
to calculate remaining time and more. By default, this progress bar
|
227
|
+
will not be rendered if the file is not a terminal.
|
228
|
+
|
229
|
+
The context manager creates the progress bar. When the context
|
230
|
+
manager is entered the progress bar is already displayed. With every
|
231
|
+
iteration over the progress bar, the iterable passed to the bar is
|
232
|
+
advanced and the bar is updated. When the context manager exits,
|
233
|
+
a newline is printed and the progress bar is finalized on screen.
|
234
|
+
|
235
|
+
No printing must happen or the progress bar will be unintentionally
|
236
|
+
destroyed.
|
237
|
+
|
238
|
+
Example usage::
|
239
|
+
|
240
|
+
with progressbar(items) as bar:
|
241
|
+
for item in bar:
|
242
|
+
do_something_with(item)
|
243
|
+
|
244
|
+
Alternatively, if no iterable is specified, one can manually update the
|
245
|
+
progress bar through the `update()` method instead of directly
|
246
|
+
iterating over the progress bar. The update method accepts the number
|
247
|
+
of steps to increment the bar with::
|
248
|
+
|
249
|
+
with progressbar(length=chunks.total_bytes) as bar:
|
250
|
+
for chunk in chunks:
|
251
|
+
process_chunk(chunk)
|
252
|
+
bar.update(chunks.bytes)
|
253
|
+
|
254
|
+
.. versionadded:: 2.0
|
255
|
+
|
256
|
+
.. versionadded:: 4.0
|
257
|
+
Added the `color` parameter. Added a `update` method to the
|
258
|
+
progressbar object.
|
259
|
+
|
260
|
+
:param iterable: an iterable to iterate over. If not provided the length
|
261
|
+
is required.
|
262
|
+
:param length: the number of items to iterate over. By default the
|
263
|
+
progressbar will attempt to ask the iterator about its
|
264
|
+
length, which might or might not work. If an iterable is
|
265
|
+
also provided this parameter can be used to override the
|
266
|
+
length. If an iterable is not provided the progress bar
|
267
|
+
will iterate over a range of that length.
|
268
|
+
:param label: the label to show next to the progress bar.
|
269
|
+
:param show_eta: enables or disables the estimated time display. This is
|
270
|
+
automatically disabled if the length cannot be
|
271
|
+
determined.
|
272
|
+
:param show_percent: enables or disables the percentage display. The
|
273
|
+
default is `True` if the iterable has a length or
|
274
|
+
`False` if not.
|
275
|
+
:param show_pos: enables or disables the absolute position display. The
|
276
|
+
default is `False`.
|
277
|
+
:param item_show_func: a function called with the current item which
|
278
|
+
can return a string to show the current item
|
279
|
+
next to the progress bar. Note that the current
|
280
|
+
item can be `None`!
|
281
|
+
:param fill_char: the character to use to show the filled part of the
|
282
|
+
progress bar.
|
283
|
+
:param empty_char: the character to use to show the non-filled part of
|
284
|
+
the progress bar.
|
285
|
+
:param bar_template: the format string to use as template for the bar.
|
286
|
+
The parameters in it are ``label`` for the label,
|
287
|
+
``bar`` for the progress bar and ``info`` for the
|
288
|
+
info section.
|
289
|
+
:param info_sep: the separator between multiple info items (eta etc.)
|
290
|
+
:param width: the width of the progress bar in characters, 0 means full
|
291
|
+
terminal width
|
292
|
+
:param file: the file to write to. If this is not a terminal then
|
293
|
+
only the label is printed.
|
294
|
+
:param color: controls if the terminal supports ANSI colors or not. The
|
295
|
+
default is autodetection. This is only needed if ANSI
|
296
|
+
codes are included anywhere in the progress bar output
|
297
|
+
which is not the case by default.
|
298
|
+
"""
|
299
|
+
from ._termui_impl import ProgressBar
|
300
|
+
color = resolve_color_default(color)
|
301
|
+
return ProgressBar(iterable=iterable, length=length, show_eta=show_eta,
|
302
|
+
show_percent=show_percent, show_pos=show_pos,
|
303
|
+
item_show_func=item_show_func, fill_char=fill_char,
|
304
|
+
empty_char=empty_char, bar_template=bar_template,
|
305
|
+
info_sep=info_sep, file=file, label=label,
|
306
|
+
width=width, color=color)
|
307
|
+
|
308
|
+
|
309
|
+
def clear():
|
310
|
+
"""Clears the terminal screen. This will have the effect of clearing
|
311
|
+
the whole visible space of the terminal and moving the cursor to the
|
312
|
+
top left. This does not do anything if not connected to a terminal.
|
313
|
+
|
314
|
+
.. versionadded:: 2.0
|
315
|
+
"""
|
316
|
+
if not isatty(sys.stdout):
|
317
|
+
return
|
318
|
+
# If we're on Windows and we don't have colorama available, then we
|
319
|
+
# clear the screen by shelling out. Otherwise we can use an escape
|
320
|
+
# sequence.
|
321
|
+
if WIN:
|
322
|
+
os.system('cls')
|
323
|
+
else:
|
324
|
+
sys.stdout.write('\033[2J\033[1;1H')
|
325
|
+
|
326
|
+
|
327
|
+
def style(text, fg=None, bg=None, bold=None, dim=None, underline=None,
|
328
|
+
blink=None, reverse=None, reset=True):
|
329
|
+
"""Styles a text with ANSI styles and returns the new string. By
|
330
|
+
default the styling is self contained which means that at the end
|
331
|
+
of the string a reset code is issued. This can be prevented by
|
332
|
+
passing ``reset=False``.
|
333
|
+
|
334
|
+
Examples::
|
335
|
+
|
336
|
+
click.echo(click.style('Hello World!', fg='green'))
|
337
|
+
click.echo(click.style('ATTENTION!', blink=True))
|
338
|
+
click.echo(click.style('Some things', reverse=True, fg='cyan'))
|
339
|
+
|
340
|
+
Supported color names:
|
341
|
+
|
342
|
+
* ``black`` (might be a gray)
|
343
|
+
* ``red``
|
344
|
+
* ``green``
|
345
|
+
* ``yellow`` (might be an orange)
|
346
|
+
* ``blue``
|
347
|
+
* ``magenta``
|
348
|
+
* ``cyan``
|
349
|
+
* ``white`` (might be light gray)
|
350
|
+
* ``reset`` (reset the color code only)
|
351
|
+
|
352
|
+
.. versionadded:: 2.0
|
353
|
+
|
354
|
+
:param text: the string to style with ansi codes.
|
355
|
+
:param fg: if provided this will become the foreground color.
|
356
|
+
:param bg: if provided this will become the background color.
|
357
|
+
:param bold: if provided this will enable or disable bold mode.
|
358
|
+
:param dim: if provided this will enable or disable dim mode. This is
|
359
|
+
badly supported.
|
360
|
+
:param underline: if provided this will enable or disable underline.
|
361
|
+
:param blink: if provided this will enable or disable blinking.
|
362
|
+
:param reverse: if provided this will enable or disable inverse
|
363
|
+
rendering (foreground becomes background and the
|
364
|
+
other way round).
|
365
|
+
:param reset: by default a reset-all code is added at the end of the
|
366
|
+
string which means that styles do not carry over. This
|
367
|
+
can be disabled to compose styles.
|
368
|
+
"""
|
369
|
+
bits = []
|
370
|
+
if fg:
|
371
|
+
try:
|
372
|
+
bits.append('\033[%dm' % (_ansi_colors.index(fg) + 30))
|
373
|
+
except ValueError:
|
374
|
+
raise TypeError('Unknown color %r' % fg)
|
375
|
+
if bg:
|
376
|
+
try:
|
377
|
+
bits.append('\033[%dm' % (_ansi_colors.index(bg) + 40))
|
378
|
+
except ValueError:
|
379
|
+
raise TypeError('Unknown color %r' % bg)
|
380
|
+
if bold is not None:
|
381
|
+
bits.append('\033[%dm' % (1 if bold else 22))
|
382
|
+
if dim is not None:
|
383
|
+
bits.append('\033[%dm' % (2 if dim else 22))
|
384
|
+
if underline is not None:
|
385
|
+
bits.append('\033[%dm' % (4 if underline else 24))
|
386
|
+
if blink is not None:
|
387
|
+
bits.append('\033[%dm' % (5 if blink else 25))
|
388
|
+
if reverse is not None:
|
389
|
+
bits.append('\033[%dm' % (7 if reverse else 27))
|
390
|
+
bits.append(text)
|
391
|
+
if reset:
|
392
|
+
bits.append(_ansi_reset_all)
|
393
|
+
return ''.join(bits)
|
394
|
+
|
395
|
+
|
396
|
+
def unstyle(text):
|
397
|
+
"""Removes ANSI styling information from a string. Usually it's not
|
398
|
+
necessary to use this function as Click's echo function will
|
399
|
+
automatically remove styling if necessary.
|
400
|
+
|
401
|
+
.. versionadded:: 2.0
|
402
|
+
|
403
|
+
:param text: the text to remove style information from.
|
404
|
+
"""
|
405
|
+
return strip_ansi(text)
|
406
|
+
|
407
|
+
|
408
|
+
def secho(text, file=None, nl=True, err=False, color=None, **styles):
|
409
|
+
"""This function combines :func:`echo` and :func:`style` into one
|
410
|
+
call. As such the following two calls are the same::
|
411
|
+
|
412
|
+
click.secho('Hello World!', fg='green')
|
413
|
+
click.echo(click.style('Hello World!', fg='green'))
|
414
|
+
|
415
|
+
All keyword arguments are forwarded to the underlying functions
|
416
|
+
depending on which one they go with.
|
417
|
+
|
418
|
+
.. versionadded:: 2.0
|
419
|
+
"""
|
420
|
+
return echo(style(text, **styles), file=file, nl=nl, err=err, color=color)
|
421
|
+
|
422
|
+
|
423
|
+
def edit(text=None, editor=None, env=None, require_save=True,
|
424
|
+
extension='.txt', filename=None):
|
425
|
+
r"""Edits the given text in the defined editor. If an editor is given
|
426
|
+
(should be the full path to the executable but the regular operating
|
427
|
+
system search path is used for finding the executable) it overrides
|
428
|
+
the detected editor. Optionally, some environment variables can be
|
429
|
+
used. If the editor is closed without changes, `None` is returned. In
|
430
|
+
case a file is edited directly the return value is always `None` and
|
431
|
+
`require_save` and `extension` are ignored.
|
432
|
+
|
433
|
+
If the editor cannot be opened a :exc:`UsageError` is raised.
|
434
|
+
|
435
|
+
Note for Windows: to simplify cross-platform usage, the newlines are
|
436
|
+
automatically converted from POSIX to Windows and vice versa. As such,
|
437
|
+
the message here will have ``\n`` as newline markers.
|
438
|
+
|
439
|
+
:param text: the text to edit.
|
440
|
+
:param editor: optionally the editor to use. Defaults to automatic
|
441
|
+
detection.
|
442
|
+
:param env: environment variables to forward to the editor.
|
443
|
+
:param require_save: if this is true, then not saving in the editor
|
444
|
+
will make the return value become `None`.
|
445
|
+
:param extension: the extension to tell the editor about. This defaults
|
446
|
+
to `.txt` but changing this might change syntax
|
447
|
+
highlighting.
|
448
|
+
:param filename: if provided it will edit this file instead of the
|
449
|
+
provided text contents. It will not use a temporary
|
450
|
+
file as an indirection in that case.
|
451
|
+
"""
|
452
|
+
from ._termui_impl import Editor
|
453
|
+
editor = Editor(editor=editor, env=env, require_save=require_save,
|
454
|
+
extension=extension)
|
455
|
+
if filename is None:
|
456
|
+
return editor.edit(text)
|
457
|
+
editor.edit_file(filename)
|
458
|
+
|
459
|
+
|
460
|
+
def launch(url, wait=False, locate=False):
|
461
|
+
"""This function launches the given URL (or filename) in the default
|
462
|
+
viewer application for this file type. If this is an executable, it
|
463
|
+
might launch the executable in a new session. The return value is
|
464
|
+
the exit code of the launched application. Usually, ``0`` indicates
|
465
|
+
success.
|
466
|
+
|
467
|
+
Examples::
|
468
|
+
|
469
|
+
click.launch('http://click.pocoo.org/')
|
470
|
+
click.launch('/my/downloaded/file', locate=True)
|
471
|
+
|
472
|
+
.. versionadded:: 2.0
|
473
|
+
|
474
|
+
:param url: URL or filename of the thing to launch.
|
475
|
+
:param wait: waits for the program to stop.
|
476
|
+
:param locate: if this is set to `True` then instead of launching the
|
477
|
+
application associated with the URL it will attempt to
|
478
|
+
launch a file manager with the file located. This
|
479
|
+
might have weird effects if the URL does not point to
|
480
|
+
the filesystem.
|
481
|
+
"""
|
482
|
+
from ._termui_impl import open_url
|
483
|
+
return open_url(url, wait=wait, locate=locate)
|
484
|
+
|
485
|
+
|
486
|
+
# If this is provided, getchar() calls into this instead. This is used
|
487
|
+
# for unittesting purposes.
|
488
|
+
_getchar = None
|
489
|
+
|
490
|
+
|
491
|
+
def getchar(echo=False):
|
492
|
+
"""Fetches a single character from the terminal and returns it. This
|
493
|
+
will always return a unicode character and under certain rare
|
494
|
+
circumstances this might return more than one character. The
|
495
|
+
situations which more than one character is returned is when for
|
496
|
+
whatever reason multiple characters end up in the terminal buffer or
|
497
|
+
standard input was not actually a terminal.
|
498
|
+
|
499
|
+
Note that this will always read from the terminal, even if something
|
500
|
+
is piped into the standard input.
|
501
|
+
|
502
|
+
.. versionadded:: 2.0
|
503
|
+
|
504
|
+
:param echo: if set to `True`, the character read will also show up on
|
505
|
+
the terminal. The default is to not show it.
|
506
|
+
"""
|
507
|
+
f = _getchar
|
508
|
+
if f is None:
|
509
|
+
from ._termui_impl import getchar as f
|
510
|
+
return f(echo)
|
511
|
+
|
512
|
+
|
513
|
+
def pause(info='Press any key to continue ...', err=False):
|
514
|
+
"""This command stops execution and waits for the user to press any
|
515
|
+
key to continue. This is similar to the Windows batch "pause"
|
516
|
+
command. If the program is not run through a terminal, this command
|
517
|
+
will instead do nothing.
|
518
|
+
|
519
|
+
.. versionadded:: 2.0
|
520
|
+
|
521
|
+
.. versionadded:: 4.0
|
522
|
+
Added the `err` parameter.
|
523
|
+
|
524
|
+
:param info: the info string to print before pausing.
|
525
|
+
:param err: if set to message goes to ``stderr`` instead of
|
526
|
+
``stdout``, the same as with echo.
|
527
|
+
"""
|
528
|
+
if not isatty(sys.stdin) or not isatty(sys.stdout):
|
529
|
+
return
|
530
|
+
try:
|
531
|
+
if info:
|
532
|
+
echo(info, nl=False, err=err)
|
533
|
+
try:
|
534
|
+
getchar()
|
535
|
+
except (KeyboardInterrupt, EOFError):
|
536
|
+
pass
|
537
|
+
finally:
|
538
|
+
if info:
|
539
|
+
echo(err=err)
|
Binary file
|