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,44 @@
|
|
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"
|
Binary file
|
@@ -0,0 +1,86 @@
|
|
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 .escsm import (HZSMModel, ISO2022CNSMModel, ISO2022JPSMModel,
|
30
|
+
ISO2022KRSMModel)
|
31
|
+
from .charsetprober import CharSetProber
|
32
|
+
from .codingstatemachine import CodingStateMachine
|
33
|
+
from .compat import wrap_ord
|
34
|
+
|
35
|
+
|
36
|
+
class EscCharSetProber(CharSetProber):
|
37
|
+
def __init__(self):
|
38
|
+
CharSetProber.__init__(self)
|
39
|
+
self._mCodingSM = [
|
40
|
+
CodingStateMachine(HZSMModel),
|
41
|
+
CodingStateMachine(ISO2022CNSMModel),
|
42
|
+
CodingStateMachine(ISO2022JPSMModel),
|
43
|
+
CodingStateMachine(ISO2022KRSMModel)
|
44
|
+
]
|
45
|
+
self.reset()
|
46
|
+
|
47
|
+
def reset(self):
|
48
|
+
CharSetProber.reset(self)
|
49
|
+
for codingSM in self._mCodingSM:
|
50
|
+
if not codingSM:
|
51
|
+
continue
|
52
|
+
codingSM.active = True
|
53
|
+
codingSM.reset()
|
54
|
+
self._mActiveSM = len(self._mCodingSM)
|
55
|
+
self._mDetectedCharset = None
|
56
|
+
|
57
|
+
def get_charset_name(self):
|
58
|
+
return self._mDetectedCharset
|
59
|
+
|
60
|
+
def get_confidence(self):
|
61
|
+
if self._mDetectedCharset:
|
62
|
+
return 0.99
|
63
|
+
else:
|
64
|
+
return 0.00
|
65
|
+
|
66
|
+
def feed(self, aBuf):
|
67
|
+
for c in aBuf:
|
68
|
+
# PY3K: aBuf is a byte array, so c is an int, not a byte
|
69
|
+
for codingSM in self._mCodingSM:
|
70
|
+
if not codingSM:
|
71
|
+
continue
|
72
|
+
if not codingSM.active:
|
73
|
+
continue
|
74
|
+
codingState = codingSM.next_state(wrap_ord(c))
|
75
|
+
if codingState == constants.eError:
|
76
|
+
codingSM.active = False
|
77
|
+
self._mActiveSM -= 1
|
78
|
+
if self._mActiveSM <= 0:
|
79
|
+
self._mState = constants.eNotMe
|
80
|
+
return self.get_state()
|
81
|
+
elif codingState == constants.eItsMe:
|
82
|
+
self._mState = constants.eFoundIt
|
83
|
+
self._mDetectedCharset = codingSM.get_coding_state_machine() # nopep8
|
84
|
+
return self.get_state()
|
85
|
+
|
86
|
+
return self.get_state()
|
Binary file
|
@@ -0,0 +1,242 @@
|
|
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, eError, eItsMe
|
29
|
+
|
30
|
+
HZ_cls = (
|
31
|
+
1,0,0,0,0,0,0,0, # 00 - 07
|
32
|
+
0,0,0,0,0,0,0,0, # 08 - 0f
|
33
|
+
0,0,0,0,0,0,0,0, # 10 - 17
|
34
|
+
0,0,0,1,0,0,0,0, # 18 - 1f
|
35
|
+
0,0,0,0,0,0,0,0, # 20 - 27
|
36
|
+
0,0,0,0,0,0,0,0, # 28 - 2f
|
37
|
+
0,0,0,0,0,0,0,0, # 30 - 37
|
38
|
+
0,0,0,0,0,0,0,0, # 38 - 3f
|
39
|
+
0,0,0,0,0,0,0,0, # 40 - 47
|
40
|
+
0,0,0,0,0,0,0,0, # 48 - 4f
|
41
|
+
0,0,0,0,0,0,0,0, # 50 - 57
|
42
|
+
0,0,0,0,0,0,0,0, # 58 - 5f
|
43
|
+
0,0,0,0,0,0,0,0, # 60 - 67
|
44
|
+
0,0,0,0,0,0,0,0, # 68 - 6f
|
45
|
+
0,0,0,0,0,0,0,0, # 70 - 77
|
46
|
+
0,0,0,4,0,5,2,0, # 78 - 7f
|
47
|
+
1,1,1,1,1,1,1,1, # 80 - 87
|
48
|
+
1,1,1,1,1,1,1,1, # 88 - 8f
|
49
|
+
1,1,1,1,1,1,1,1, # 90 - 97
|
50
|
+
1,1,1,1,1,1,1,1, # 98 - 9f
|
51
|
+
1,1,1,1,1,1,1,1, # a0 - a7
|
52
|
+
1,1,1,1,1,1,1,1, # a8 - af
|
53
|
+
1,1,1,1,1,1,1,1, # b0 - b7
|
54
|
+
1,1,1,1,1,1,1,1, # b8 - bf
|
55
|
+
1,1,1,1,1,1,1,1, # c0 - c7
|
56
|
+
1,1,1,1,1,1,1,1, # c8 - cf
|
57
|
+
1,1,1,1,1,1,1,1, # d0 - d7
|
58
|
+
1,1,1,1,1,1,1,1, # d8 - df
|
59
|
+
1,1,1,1,1,1,1,1, # e0 - e7
|
60
|
+
1,1,1,1,1,1,1,1, # e8 - ef
|
61
|
+
1,1,1,1,1,1,1,1, # f0 - f7
|
62
|
+
1,1,1,1,1,1,1,1, # f8 - ff
|
63
|
+
)
|
64
|
+
|
65
|
+
HZ_st = (
|
66
|
+
eStart,eError, 3,eStart,eStart,eStart,eError,eError,# 00-07
|
67
|
+
eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,# 08-0f
|
68
|
+
eItsMe,eItsMe,eError,eError,eStart,eStart, 4,eError,# 10-17
|
69
|
+
5,eError, 6,eError, 5, 5, 4,eError,# 18-1f
|
70
|
+
4,eError, 4, 4, 4,eError, 4,eError,# 20-27
|
71
|
+
4,eItsMe,eStart,eStart,eStart,eStart,eStart,eStart,# 28-2f
|
72
|
+
)
|
73
|
+
|
74
|
+
HZCharLenTable = (0, 0, 0, 0, 0, 0)
|
75
|
+
|
76
|
+
HZSMModel = {'classTable': HZ_cls,
|
77
|
+
'classFactor': 6,
|
78
|
+
'stateTable': HZ_st,
|
79
|
+
'charLenTable': HZCharLenTable,
|
80
|
+
'name': "HZ-GB-2312"}
|
81
|
+
|
82
|
+
ISO2022CN_cls = (
|
83
|
+
2,0,0,0,0,0,0,0, # 00 - 07
|
84
|
+
0,0,0,0,0,0,0,0, # 08 - 0f
|
85
|
+
0,0,0,0,0,0,0,0, # 10 - 17
|
86
|
+
0,0,0,1,0,0,0,0, # 18 - 1f
|
87
|
+
0,0,0,0,0,0,0,0, # 20 - 27
|
88
|
+
0,3,0,0,0,0,0,0, # 28 - 2f
|
89
|
+
0,0,0,0,0,0,0,0, # 30 - 37
|
90
|
+
0,0,0,0,0,0,0,0, # 38 - 3f
|
91
|
+
0,0,0,4,0,0,0,0, # 40 - 47
|
92
|
+
0,0,0,0,0,0,0,0, # 48 - 4f
|
93
|
+
0,0,0,0,0,0,0,0, # 50 - 57
|
94
|
+
0,0,0,0,0,0,0,0, # 58 - 5f
|
95
|
+
0,0,0,0,0,0,0,0, # 60 - 67
|
96
|
+
0,0,0,0,0,0,0,0, # 68 - 6f
|
97
|
+
0,0,0,0,0,0,0,0, # 70 - 77
|
98
|
+
0,0,0,0,0,0,0,0, # 78 - 7f
|
99
|
+
2,2,2,2,2,2,2,2, # 80 - 87
|
100
|
+
2,2,2,2,2,2,2,2, # 88 - 8f
|
101
|
+
2,2,2,2,2,2,2,2, # 90 - 97
|
102
|
+
2,2,2,2,2,2,2,2, # 98 - 9f
|
103
|
+
2,2,2,2,2,2,2,2, # a0 - a7
|
104
|
+
2,2,2,2,2,2,2,2, # a8 - af
|
105
|
+
2,2,2,2,2,2,2,2, # b0 - b7
|
106
|
+
2,2,2,2,2,2,2,2, # b8 - bf
|
107
|
+
2,2,2,2,2,2,2,2, # c0 - c7
|
108
|
+
2,2,2,2,2,2,2,2, # c8 - cf
|
109
|
+
2,2,2,2,2,2,2,2, # d0 - d7
|
110
|
+
2,2,2,2,2,2,2,2, # d8 - df
|
111
|
+
2,2,2,2,2,2,2,2, # e0 - e7
|
112
|
+
2,2,2,2,2,2,2,2, # e8 - ef
|
113
|
+
2,2,2,2,2,2,2,2, # f0 - f7
|
114
|
+
2,2,2,2,2,2,2,2, # f8 - ff
|
115
|
+
)
|
116
|
+
|
117
|
+
ISO2022CN_st = (
|
118
|
+
eStart, 3,eError,eStart,eStart,eStart,eStart,eStart,# 00-07
|
119
|
+
eStart,eError,eError,eError,eError,eError,eError,eError,# 08-0f
|
120
|
+
eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,# 10-17
|
121
|
+
eItsMe,eItsMe,eItsMe,eError,eError,eError, 4,eError,# 18-1f
|
122
|
+
eError,eError,eError,eItsMe,eError,eError,eError,eError,# 20-27
|
123
|
+
5, 6,eError,eError,eError,eError,eError,eError,# 28-2f
|
124
|
+
eError,eError,eError,eItsMe,eError,eError,eError,eError,# 30-37
|
125
|
+
eError,eError,eError,eError,eError,eItsMe,eError,eStart,# 38-3f
|
126
|
+
)
|
127
|
+
|
128
|
+
ISO2022CNCharLenTable = (0, 0, 0, 0, 0, 0, 0, 0, 0)
|
129
|
+
|
130
|
+
ISO2022CNSMModel = {'classTable': ISO2022CN_cls,
|
131
|
+
'classFactor': 9,
|
132
|
+
'stateTable': ISO2022CN_st,
|
133
|
+
'charLenTable': ISO2022CNCharLenTable,
|
134
|
+
'name': "ISO-2022-CN"}
|
135
|
+
|
136
|
+
ISO2022JP_cls = (
|
137
|
+
2,0,0,0,0,0,0,0, # 00 - 07
|
138
|
+
0,0,0,0,0,0,2,2, # 08 - 0f
|
139
|
+
0,0,0,0,0,0,0,0, # 10 - 17
|
140
|
+
0,0,0,1,0,0,0,0, # 18 - 1f
|
141
|
+
0,0,0,0,7,0,0,0, # 20 - 27
|
142
|
+
3,0,0,0,0,0,0,0, # 28 - 2f
|
143
|
+
0,0,0,0,0,0,0,0, # 30 - 37
|
144
|
+
0,0,0,0,0,0,0,0, # 38 - 3f
|
145
|
+
6,0,4,0,8,0,0,0, # 40 - 47
|
146
|
+
0,9,5,0,0,0,0,0, # 48 - 4f
|
147
|
+
0,0,0,0,0,0,0,0, # 50 - 57
|
148
|
+
0,0,0,0,0,0,0,0, # 58 - 5f
|
149
|
+
0,0,0,0,0,0,0,0, # 60 - 67
|
150
|
+
0,0,0,0,0,0,0,0, # 68 - 6f
|
151
|
+
0,0,0,0,0,0,0,0, # 70 - 77
|
152
|
+
0,0,0,0,0,0,0,0, # 78 - 7f
|
153
|
+
2,2,2,2,2,2,2,2, # 80 - 87
|
154
|
+
2,2,2,2,2,2,2,2, # 88 - 8f
|
155
|
+
2,2,2,2,2,2,2,2, # 90 - 97
|
156
|
+
2,2,2,2,2,2,2,2, # 98 - 9f
|
157
|
+
2,2,2,2,2,2,2,2, # a0 - a7
|
158
|
+
2,2,2,2,2,2,2,2, # a8 - af
|
159
|
+
2,2,2,2,2,2,2,2, # b0 - b7
|
160
|
+
2,2,2,2,2,2,2,2, # b8 - bf
|
161
|
+
2,2,2,2,2,2,2,2, # c0 - c7
|
162
|
+
2,2,2,2,2,2,2,2, # c8 - cf
|
163
|
+
2,2,2,2,2,2,2,2, # d0 - d7
|
164
|
+
2,2,2,2,2,2,2,2, # d8 - df
|
165
|
+
2,2,2,2,2,2,2,2, # e0 - e7
|
166
|
+
2,2,2,2,2,2,2,2, # e8 - ef
|
167
|
+
2,2,2,2,2,2,2,2, # f0 - f7
|
168
|
+
2,2,2,2,2,2,2,2, # f8 - ff
|
169
|
+
)
|
170
|
+
|
171
|
+
ISO2022JP_st = (
|
172
|
+
eStart, 3,eError,eStart,eStart,eStart,eStart,eStart,# 00-07
|
173
|
+
eStart,eStart,eError,eError,eError,eError,eError,eError,# 08-0f
|
174
|
+
eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,# 10-17
|
175
|
+
eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,eError,# 18-1f
|
176
|
+
eError, 5,eError,eError,eError, 4,eError,eError,# 20-27
|
177
|
+
eError,eError,eError, 6,eItsMe,eError,eItsMe,eError,# 28-2f
|
178
|
+
eError,eError,eError,eError,eError,eError,eItsMe,eItsMe,# 30-37
|
179
|
+
eError,eError,eError,eItsMe,eError,eError,eError,eError,# 38-3f
|
180
|
+
eError,eError,eError,eError,eItsMe,eError,eStart,eStart,# 40-47
|
181
|
+
)
|
182
|
+
|
183
|
+
ISO2022JPCharLenTable = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
|
184
|
+
|
185
|
+
ISO2022JPSMModel = {'classTable': ISO2022JP_cls,
|
186
|
+
'classFactor': 10,
|
187
|
+
'stateTable': ISO2022JP_st,
|
188
|
+
'charLenTable': ISO2022JPCharLenTable,
|
189
|
+
'name': "ISO-2022-JP"}
|
190
|
+
|
191
|
+
ISO2022KR_cls = (
|
192
|
+
2,0,0,0,0,0,0,0, # 00 - 07
|
193
|
+
0,0,0,0,0,0,0,0, # 08 - 0f
|
194
|
+
0,0,0,0,0,0,0,0, # 10 - 17
|
195
|
+
0,0,0,1,0,0,0,0, # 18 - 1f
|
196
|
+
0,0,0,0,3,0,0,0, # 20 - 27
|
197
|
+
0,4,0,0,0,0,0,0, # 28 - 2f
|
198
|
+
0,0,0,0,0,0,0,0, # 30 - 37
|
199
|
+
0,0,0,0,0,0,0,0, # 38 - 3f
|
200
|
+
0,0,0,5,0,0,0,0, # 40 - 47
|
201
|
+
0,0,0,0,0,0,0,0, # 48 - 4f
|
202
|
+
0,0,0,0,0,0,0,0, # 50 - 57
|
203
|
+
0,0,0,0,0,0,0,0, # 58 - 5f
|
204
|
+
0,0,0,0,0,0,0,0, # 60 - 67
|
205
|
+
0,0,0,0,0,0,0,0, # 68 - 6f
|
206
|
+
0,0,0,0,0,0,0,0, # 70 - 77
|
207
|
+
0,0,0,0,0,0,0,0, # 78 - 7f
|
208
|
+
2,2,2,2,2,2,2,2, # 80 - 87
|
209
|
+
2,2,2,2,2,2,2,2, # 88 - 8f
|
210
|
+
2,2,2,2,2,2,2,2, # 90 - 97
|
211
|
+
2,2,2,2,2,2,2,2, # 98 - 9f
|
212
|
+
2,2,2,2,2,2,2,2, # a0 - a7
|
213
|
+
2,2,2,2,2,2,2,2, # a8 - af
|
214
|
+
2,2,2,2,2,2,2,2, # b0 - b7
|
215
|
+
2,2,2,2,2,2,2,2, # b8 - bf
|
216
|
+
2,2,2,2,2,2,2,2, # c0 - c7
|
217
|
+
2,2,2,2,2,2,2,2, # c8 - cf
|
218
|
+
2,2,2,2,2,2,2,2, # d0 - d7
|
219
|
+
2,2,2,2,2,2,2,2, # d8 - df
|
220
|
+
2,2,2,2,2,2,2,2, # e0 - e7
|
221
|
+
2,2,2,2,2,2,2,2, # e8 - ef
|
222
|
+
2,2,2,2,2,2,2,2, # f0 - f7
|
223
|
+
2,2,2,2,2,2,2,2, # f8 - ff
|
224
|
+
)
|
225
|
+
|
226
|
+
ISO2022KR_st = (
|
227
|
+
eStart, 3,eError,eStart,eStart,eStart,eError,eError,# 00-07
|
228
|
+
eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,# 08-0f
|
229
|
+
eItsMe,eItsMe,eError,eError,eError, 4,eError,eError,# 10-17
|
230
|
+
eError,eError,eError,eError, 5,eError,eError,eError,# 18-1f
|
231
|
+
eError,eError,eError,eItsMe,eStart,eStart,eStart,eStart,# 20-27
|
232
|
+
)
|
233
|
+
|
234
|
+
ISO2022KRCharLenTable = (0, 0, 0, 0, 0, 0)
|
235
|
+
|
236
|
+
ISO2022KRSMModel = {'classTable': ISO2022KR_cls,
|
237
|
+
'classFactor': 6,
|
238
|
+
'stateTable': ISO2022KR_st,
|
239
|
+
'charLenTable': ISO2022KRCharLenTable,
|
240
|
+
'name': "ISO-2022-KR"}
|
241
|
+
|
242
|
+
# flake8: noqa
|
Binary file
|
@@ -0,0 +1,90 @@
|
|
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
|
+
import sys
|
29
|
+
from . import constants
|
30
|
+
from .mbcharsetprober import MultiByteCharSetProber
|
31
|
+
from .codingstatemachine import CodingStateMachine
|
32
|
+
from .chardistribution import EUCJPDistributionAnalysis
|
33
|
+
from .jpcntx import EUCJPContextAnalysis
|
34
|
+
from .mbcssm import EUCJPSMModel
|
35
|
+
|
36
|
+
|
37
|
+
class EUCJPProber(MultiByteCharSetProber):
|
38
|
+
def __init__(self):
|
39
|
+
MultiByteCharSetProber.__init__(self)
|
40
|
+
self._mCodingSM = CodingStateMachine(EUCJPSMModel)
|
41
|
+
self._mDistributionAnalyzer = EUCJPDistributionAnalysis()
|
42
|
+
self._mContextAnalyzer = EUCJPContextAnalysis()
|
43
|
+
self.reset()
|
44
|
+
|
45
|
+
def reset(self):
|
46
|
+
MultiByteCharSetProber.reset(self)
|
47
|
+
self._mContextAnalyzer.reset()
|
48
|
+
|
49
|
+
def get_charset_name(self):
|
50
|
+
return "EUC-JP"
|
51
|
+
|
52
|
+
def feed(self, aBuf):
|
53
|
+
aLen = len(aBuf)
|
54
|
+
for i in range(0, aLen):
|
55
|
+
# PY3K: aBuf is a byte array, so aBuf[i] is an int, not a byte
|
56
|
+
codingState = self._mCodingSM.next_state(aBuf[i])
|
57
|
+
if codingState == constants.eError:
|
58
|
+
if constants._debug:
|
59
|
+
sys.stderr.write(self.get_charset_name()
|
60
|
+
+ ' prober hit error at byte ' + str(i)
|
61
|
+
+ '\n')
|
62
|
+
self._mState = constants.eNotMe
|
63
|
+
break
|
64
|
+
elif codingState == constants.eItsMe:
|
65
|
+
self._mState = constants.eFoundIt
|
66
|
+
break
|
67
|
+
elif codingState == constants.eStart:
|
68
|
+
charLen = self._mCodingSM.get_current_charlen()
|
69
|
+
if i == 0:
|
70
|
+
self._mLastChar[1] = aBuf[0]
|
71
|
+
self._mContextAnalyzer.feed(self._mLastChar, charLen)
|
72
|
+
self._mDistributionAnalyzer.feed(self._mLastChar, charLen)
|
73
|
+
else:
|
74
|
+
self._mContextAnalyzer.feed(aBuf[i - 1:i + 1], charLen)
|
75
|
+
self._mDistributionAnalyzer.feed(aBuf[i - 1:i + 1],
|
76
|
+
charLen)
|
77
|
+
|
78
|
+
self._mLastChar[0] = aBuf[aLen - 1]
|
79
|
+
|
80
|
+
if self.get_state() == constants.eDetecting:
|
81
|
+
if (self._mContextAnalyzer.got_enough_data() and
|
82
|
+
(self.get_confidence() > constants.SHORTCUT_THRESHOLD)):
|
83
|
+
self._mState = constants.eFoundIt
|
84
|
+
|
85
|
+
return self.get_state()
|
86
|
+
|
87
|
+
def get_confidence(self):
|
88
|
+
contxtCf = self._mContextAnalyzer.get_confidence()
|
89
|
+
distribCf = self._mDistributionAnalyzer.get_confidence()
|
90
|
+
return max(contxtCf, distribCf)
|
Binary file
|