rigid 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (364) hide show
  1. checksums.yaml +7 -0
  2. data/bin/rigid +4 -0
  3. data/rigid +16 -0
  4. data/vendor/PyYAML-3.12.dist-info/DESCRIPTION.rst +12 -0
  5. data/vendor/PyYAML-3.12.dist-info/INSTALLER +1 -0
  6. data/vendor/PyYAML-3.12.dist-info/METADATA +35 -0
  7. data/vendor/PyYAML-3.12.dist-info/RECORD +42 -0
  8. data/vendor/PyYAML-3.12.dist-info/WHEEL +5 -0
  9. data/vendor/PyYAML-3.12.dist-info/metadata.json +1 -0
  10. data/vendor/PyYAML-3.12.dist-info/top_level.txt +2 -0
  11. data/vendor/_yaml.so +0 -0
  12. data/vendor/click/__init__.py +98 -0
  13. data/vendor/click/__init__.pyc +0 -0
  14. data/vendor/click/_bashcomplete.py +83 -0
  15. data/vendor/click/_bashcomplete.pyc +0 -0
  16. data/vendor/click/_compat.py +642 -0
  17. data/vendor/click/_compat.pyc +0 -0
  18. data/vendor/click/_termui_impl.py +547 -0
  19. data/vendor/click/_termui_impl.pyc +0 -0
  20. data/vendor/click/_textwrap.py +38 -0
  21. data/vendor/click/_textwrap.pyc +0 -0
  22. data/vendor/click/_unicodefun.py +119 -0
  23. data/vendor/click/_unicodefun.pyc +0 -0
  24. data/vendor/click/_winconsole.py +273 -0
  25. data/vendor/click/_winconsole.pyc +0 -0
  26. data/vendor/click/core.py +1738 -0
  27. data/vendor/click/core.pyc +0 -0
  28. data/vendor/click/decorators.py +304 -0
  29. data/vendor/click/decorators.pyc +0 -0
  30. data/vendor/click/exceptions.py +201 -0
  31. data/vendor/click/exceptions.pyc +0 -0
  32. data/vendor/click/formatting.py +256 -0
  33. data/vendor/click/formatting.pyc +0 -0
  34. data/vendor/click/globals.py +48 -0
  35. data/vendor/click/globals.pyc +0 -0
  36. data/vendor/click/parser.py +426 -0
  37. data/vendor/click/parser.pyc +0 -0
  38. data/vendor/click/termui.py +539 -0
  39. data/vendor/click/termui.pyc +0 -0
  40. data/vendor/click/testing.py +322 -0
  41. data/vendor/click/testing.pyc +0 -0
  42. data/vendor/click/types.py +550 -0
  43. data/vendor/click/types.pyc +0 -0
  44. data/vendor/click/utils.py +415 -0
  45. data/vendor/click/utils.pyc +0 -0
  46. data/vendor/click-6.6.dist-info/DESCRIPTION.rst +3 -0
  47. data/vendor/click-6.6.dist-info/INSTALLER +1 -0
  48. data/vendor/click-6.6.dist-info/METADATA +16 -0
  49. data/vendor/click-6.6.dist-info/RECORD +41 -0
  50. data/vendor/click-6.6.dist-info/WHEEL +6 -0
  51. data/vendor/click-6.6.dist-info/metadata.json +1 -0
  52. data/vendor/click-6.6.dist-info/top_level.txt +1 -0
  53. data/vendor/easy_install.py +5 -0
  54. data/vendor/easy_install.pyc +0 -0
  55. data/vendor/pip-9.0.1.dist-info/DESCRIPTION.rst +39 -0
  56. data/vendor/pip-9.0.1.dist-info/INSTALLER +1 -0
  57. data/vendor/pip-9.0.1.dist-info/METADATA +69 -0
  58. data/vendor/pip-9.0.1.dist-info/RECORD +501 -0
  59. data/vendor/pip-9.0.1.dist-info/WHEEL +6 -0
  60. data/vendor/pip-9.0.1.dist-info/entry_points.txt +5 -0
  61. data/vendor/pip-9.0.1.dist-info/metadata.json +1 -0
  62. data/vendor/pip-9.0.1.dist-info/top_level.txt +1 -0
  63. data/vendor/pkg_resources/__init__.py +3051 -0
  64. data/vendor/pkg_resources/__init__.pyc +0 -0
  65. data/vendor/pkg_resources/_vendor/__init__.py +0 -0
  66. data/vendor/pkg_resources/_vendor/__init__.pyc +0 -0
  67. data/vendor/pkg_resources/_vendor/appdirs.py +552 -0
  68. data/vendor/pkg_resources/_vendor/appdirs.pyc +0 -0
  69. data/vendor/pkg_resources/_vendor/packaging/__about__.py +21 -0
  70. data/vendor/pkg_resources/_vendor/packaging/__about__.pyc +0 -0
  71. data/vendor/pkg_resources/_vendor/packaging/__init__.py +14 -0
  72. data/vendor/pkg_resources/_vendor/packaging/__init__.pyc +0 -0
  73. data/vendor/pkg_resources/_vendor/packaging/_compat.py +30 -0
  74. data/vendor/pkg_resources/_vendor/packaging/_compat.pyc +0 -0
  75. data/vendor/pkg_resources/_vendor/packaging/_structures.py +68 -0
  76. data/vendor/pkg_resources/_vendor/packaging/_structures.pyc +0 -0
  77. data/vendor/pkg_resources/_vendor/packaging/markers.py +287 -0
  78. data/vendor/pkg_resources/_vendor/packaging/markers.pyc +0 -0
  79. data/vendor/pkg_resources/_vendor/packaging/requirements.py +127 -0
  80. data/vendor/pkg_resources/_vendor/packaging/requirements.pyc +0 -0
  81. data/vendor/pkg_resources/_vendor/packaging/specifiers.py +774 -0
  82. data/vendor/pkg_resources/_vendor/packaging/specifiers.pyc +0 -0
  83. data/vendor/pkg_resources/_vendor/packaging/utils.py +14 -0
  84. data/vendor/pkg_resources/_vendor/packaging/utils.pyc +0 -0
  85. data/vendor/pkg_resources/_vendor/packaging/version.py +393 -0
  86. data/vendor/pkg_resources/_vendor/packaging/version.pyc +0 -0
  87. data/vendor/pkg_resources/_vendor/pyparsing.py +5696 -0
  88. data/vendor/pkg_resources/_vendor/pyparsing.pyc +0 -0
  89. data/vendor/pkg_resources/_vendor/six.py +868 -0
  90. data/vendor/pkg_resources/_vendor/six.pyc +0 -0
  91. data/vendor/pkg_resources/extern/__init__.py +73 -0
  92. data/vendor/pkg_resources/extern/__init__.pyc +0 -0
  93. data/vendor/requests/__init__.py +86 -0
  94. data/vendor/requests/__init__.pyc +0 -0
  95. data/vendor/requests/adapters.py +503 -0
  96. data/vendor/requests/adapters.pyc +0 -0
  97. data/vendor/requests/api.py +148 -0
  98. data/vendor/requests/api.pyc +0 -0
  99. data/vendor/requests/auth.py +252 -0
  100. data/vendor/requests/auth.pyc +0 -0
  101. data/vendor/requests/cacert.pem +5616 -0
  102. data/vendor/requests/certs.py +25 -0
  103. data/vendor/requests/certs.pyc +0 -0
  104. data/vendor/requests/compat.py +66 -0
  105. data/vendor/requests/compat.pyc +0 -0
  106. data/vendor/requests/cookies.py +540 -0
  107. data/vendor/requests/cookies.pyc +0 -0
  108. data/vendor/requests/exceptions.py +114 -0
  109. data/vendor/requests/exceptions.pyc +0 -0
  110. data/vendor/requests/hooks.py +34 -0
  111. data/vendor/requests/hooks.pyc +0 -0
  112. data/vendor/requests/models.py +873 -0
  113. data/vendor/requests/models.pyc +0 -0
  114. data/vendor/requests/packages/__init__.py +36 -0
  115. data/vendor/requests/packages/__init__.pyc +0 -0
  116. data/vendor/requests/packages/chardet/__init__.py +32 -0
  117. data/vendor/requests/packages/chardet/__init__.pyc +0 -0
  118. data/vendor/requests/packages/chardet/big5freq.py +925 -0
  119. data/vendor/requests/packages/chardet/big5freq.pyc +0 -0
  120. data/vendor/requests/packages/chardet/big5prober.py +42 -0
  121. data/vendor/requests/packages/chardet/big5prober.pyc +0 -0
  122. data/vendor/requests/packages/chardet/chardetect.py +80 -0
  123. data/vendor/requests/packages/chardet/chardetect.pyc +0 -0
  124. data/vendor/requests/packages/chardet/chardistribution.py +231 -0
  125. data/vendor/requests/packages/chardet/chardistribution.pyc +0 -0
  126. data/vendor/requests/packages/chardet/charsetgroupprober.py +106 -0
  127. data/vendor/requests/packages/chardet/charsetgroupprober.pyc +0 -0
  128. data/vendor/requests/packages/chardet/charsetprober.py +62 -0
  129. data/vendor/requests/packages/chardet/charsetprober.pyc +0 -0
  130. data/vendor/requests/packages/chardet/codingstatemachine.py +61 -0
  131. data/vendor/requests/packages/chardet/codingstatemachine.pyc +0 -0
  132. data/vendor/requests/packages/chardet/compat.py +34 -0
  133. data/vendor/requests/packages/chardet/compat.pyc +0 -0
  134. data/vendor/requests/packages/chardet/constants.py +39 -0
  135. data/vendor/requests/packages/chardet/constants.pyc +0 -0
  136. data/vendor/requests/packages/chardet/cp949prober.py +44 -0
  137. data/vendor/requests/packages/chardet/cp949prober.pyc +0 -0
  138. data/vendor/requests/packages/chardet/escprober.py +86 -0
  139. data/vendor/requests/packages/chardet/escprober.pyc +0 -0
  140. data/vendor/requests/packages/chardet/escsm.py +242 -0
  141. data/vendor/requests/packages/chardet/escsm.pyc +0 -0
  142. data/vendor/requests/packages/chardet/eucjpprober.py +90 -0
  143. data/vendor/requests/packages/chardet/eucjpprober.pyc +0 -0
  144. data/vendor/requests/packages/chardet/euckrfreq.py +596 -0
  145. data/vendor/requests/packages/chardet/euckrfreq.pyc +0 -0
  146. data/vendor/requests/packages/chardet/euckrprober.py +42 -0
  147. data/vendor/requests/packages/chardet/euckrprober.pyc +0 -0
  148. data/vendor/requests/packages/chardet/euctwfreq.py +428 -0
  149. data/vendor/requests/packages/chardet/euctwfreq.pyc +0 -0
  150. data/vendor/requests/packages/chardet/euctwprober.py +41 -0
  151. data/vendor/requests/packages/chardet/euctwprober.pyc +0 -0
  152. data/vendor/requests/packages/chardet/gb2312freq.py +472 -0
  153. data/vendor/requests/packages/chardet/gb2312freq.pyc +0 -0
  154. data/vendor/requests/packages/chardet/gb2312prober.py +41 -0
  155. data/vendor/requests/packages/chardet/gb2312prober.pyc +0 -0
  156. data/vendor/requests/packages/chardet/hebrewprober.py +283 -0
  157. data/vendor/requests/packages/chardet/hebrewprober.pyc +0 -0
  158. data/vendor/requests/packages/chardet/jisfreq.py +569 -0
  159. data/vendor/requests/packages/chardet/jisfreq.pyc +0 -0
  160. data/vendor/requests/packages/chardet/jpcntx.py +227 -0
  161. data/vendor/requests/packages/chardet/jpcntx.pyc +0 -0
  162. data/vendor/requests/packages/chardet/langbulgarianmodel.py +229 -0
  163. data/vendor/requests/packages/chardet/langbulgarianmodel.pyc +0 -0
  164. data/vendor/requests/packages/chardet/langcyrillicmodel.py +329 -0
  165. data/vendor/requests/packages/chardet/langcyrillicmodel.pyc +0 -0
  166. data/vendor/requests/packages/chardet/langgreekmodel.py +225 -0
  167. data/vendor/requests/packages/chardet/langgreekmodel.pyc +0 -0
  168. data/vendor/requests/packages/chardet/langhebrewmodel.py +201 -0
  169. data/vendor/requests/packages/chardet/langhebrewmodel.pyc +0 -0
  170. data/vendor/requests/packages/chardet/langhungarianmodel.py +225 -0
  171. data/vendor/requests/packages/chardet/langhungarianmodel.pyc +0 -0
  172. data/vendor/requests/packages/chardet/langthaimodel.py +200 -0
  173. data/vendor/requests/packages/chardet/langthaimodel.pyc +0 -0
  174. data/vendor/requests/packages/chardet/latin1prober.py +139 -0
  175. data/vendor/requests/packages/chardet/latin1prober.pyc +0 -0
  176. data/vendor/requests/packages/chardet/mbcharsetprober.py +86 -0
  177. data/vendor/requests/packages/chardet/mbcharsetprober.pyc +0 -0
  178. data/vendor/requests/packages/chardet/mbcsgroupprober.py +54 -0
  179. data/vendor/requests/packages/chardet/mbcsgroupprober.pyc +0 -0
  180. data/vendor/requests/packages/chardet/mbcssm.py +572 -0
  181. data/vendor/requests/packages/chardet/mbcssm.pyc +0 -0
  182. data/vendor/requests/packages/chardet/sbcharsetprober.py +120 -0
  183. data/vendor/requests/packages/chardet/sbcharsetprober.pyc +0 -0
  184. data/vendor/requests/packages/chardet/sbcsgroupprober.py +69 -0
  185. data/vendor/requests/packages/chardet/sbcsgroupprober.pyc +0 -0
  186. data/vendor/requests/packages/chardet/sjisprober.py +91 -0
  187. data/vendor/requests/packages/chardet/sjisprober.pyc +0 -0
  188. data/vendor/requests/packages/chardet/universaldetector.py +170 -0
  189. data/vendor/requests/packages/chardet/universaldetector.pyc +0 -0
  190. data/vendor/requests/packages/chardet/utf8prober.py +76 -0
  191. data/vendor/requests/packages/chardet/utf8prober.pyc +0 -0
  192. data/vendor/requests/packages/urllib3/__init__.py +96 -0
  193. data/vendor/requests/packages/urllib3/__init__.pyc +0 -0
  194. data/vendor/requests/packages/urllib3/_collections.py +324 -0
  195. data/vendor/requests/packages/urllib3/_collections.pyc +0 -0
  196. data/vendor/requests/packages/urllib3/connection.py +330 -0
  197. data/vendor/requests/packages/urllib3/connection.pyc +0 -0
  198. data/vendor/requests/packages/urllib3/connectionpool.py +866 -0
  199. data/vendor/requests/packages/urllib3/connectionpool.pyc +0 -0
  200. data/vendor/requests/packages/urllib3/contrib/__init__.py +0 -0
  201. data/vendor/requests/packages/urllib3/contrib/__init__.pyc +0 -0
  202. data/vendor/requests/packages/urllib3/contrib/appengine.py +231 -0
  203. data/vendor/requests/packages/urllib3/contrib/appengine.pyc +0 -0
  204. data/vendor/requests/packages/urllib3/contrib/ntlmpool.py +115 -0
  205. data/vendor/requests/packages/urllib3/contrib/ntlmpool.pyc +0 -0
  206. data/vendor/requests/packages/urllib3/contrib/pyopenssl.py +358 -0
  207. data/vendor/requests/packages/urllib3/contrib/pyopenssl.pyc +0 -0
  208. data/vendor/requests/packages/urllib3/contrib/socks.py +172 -0
  209. data/vendor/requests/packages/urllib3/contrib/socks.pyc +0 -0
  210. data/vendor/requests/packages/urllib3/exceptions.py +209 -0
  211. data/vendor/requests/packages/urllib3/exceptions.pyc +0 -0
  212. data/vendor/requests/packages/urllib3/fields.py +178 -0
  213. data/vendor/requests/packages/urllib3/fields.pyc +0 -0
  214. data/vendor/requests/packages/urllib3/filepost.py +94 -0
  215. data/vendor/requests/packages/urllib3/filepost.pyc +0 -0
  216. data/vendor/requests/packages/urllib3/packages/__init__.py +5 -0
  217. data/vendor/requests/packages/urllib3/packages/__init__.pyc +0 -0
  218. data/vendor/requests/packages/urllib3/packages/ordered_dict.py +259 -0
  219. data/vendor/requests/packages/urllib3/packages/ordered_dict.pyc +0 -0
  220. data/vendor/requests/packages/urllib3/packages/six.py +868 -0
  221. data/vendor/requests/packages/urllib3/packages/six.pyc +0 -0
  222. data/vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py +13 -0
  223. data/vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyc +0 -0
  224. data/vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py +105 -0
  225. data/vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyc +0 -0
  226. data/vendor/requests/packages/urllib3/poolmanager.py +367 -0
  227. data/vendor/requests/packages/urllib3/poolmanager.pyc +0 -0
  228. data/vendor/requests/packages/urllib3/request.py +151 -0
  229. data/vendor/requests/packages/urllib3/request.pyc +0 -0
  230. data/vendor/requests/packages/urllib3/response.py +530 -0
  231. data/vendor/requests/packages/urllib3/response.pyc +0 -0
  232. data/vendor/requests/packages/urllib3/util/__init__.py +46 -0
  233. data/vendor/requests/packages/urllib3/util/__init__.pyc +0 -0
  234. data/vendor/requests/packages/urllib3/util/connection.py +144 -0
  235. data/vendor/requests/packages/urllib3/util/connection.pyc +0 -0
  236. data/vendor/requests/packages/urllib3/util/request.py +72 -0
  237. data/vendor/requests/packages/urllib3/util/request.pyc +0 -0
  238. data/vendor/requests/packages/urllib3/util/response.py +74 -0
  239. data/vendor/requests/packages/urllib3/util/response.pyc +0 -0
  240. data/vendor/requests/packages/urllib3/util/retry.py +300 -0
  241. data/vendor/requests/packages/urllib3/util/retry.pyc +0 -0
  242. data/vendor/requests/packages/urllib3/util/ssl_.py +320 -0
  243. data/vendor/requests/packages/urllib3/util/ssl_.pyc +0 -0
  244. data/vendor/requests/packages/urllib3/util/timeout.py +242 -0
  245. data/vendor/requests/packages/urllib3/util/timeout.pyc +0 -0
  246. data/vendor/requests/packages/urllib3/util/url.py +217 -0
  247. data/vendor/requests/packages/urllib3/util/url.pyc +0 -0
  248. data/vendor/requests/sessions.py +712 -0
  249. data/vendor/requests/sessions.pyc +0 -0
  250. data/vendor/requests/status_codes.py +91 -0
  251. data/vendor/requests/status_codes.pyc +0 -0
  252. data/vendor/requests/structures.py +105 -0
  253. data/vendor/requests/structures.pyc +0 -0
  254. data/vendor/requests/utils.py +817 -0
  255. data/vendor/requests/utils.pyc +0 -0
  256. data/vendor/requests-2.11.1.dist-info/DESCRIPTION.rst +1294 -0
  257. data/vendor/requests-2.11.1.dist-info/INSTALLER +1 -0
  258. data/vendor/requests-2.11.1.dist-info/METADATA +1323 -0
  259. data/vendor/requests-2.11.1.dist-info/RECORD +170 -0
  260. data/vendor/requests-2.11.1.dist-info/WHEEL +6 -0
  261. data/vendor/requests-2.11.1.dist-info/metadata.json +1 -0
  262. data/vendor/requests-2.11.1.dist-info/top_level.txt +1 -0
  263. data/vendor/rigid/__init__.py +1 -0
  264. data/vendor/rigid/__init__.pyc +0 -0
  265. data/vendor/rigid/api.py +129 -0
  266. data/vendor/rigid/api.pyc +0 -0
  267. data/vendor/rigid/commands/__init__.py +260 -0
  268. data/vendor/rigid/commands/__init__.pyc +0 -0
  269. data/vendor/rigid/commands/deploy.py +0 -0
  270. data/vendor/rigid/commands/deploy.pyc +0 -0
  271. data/vendor/rigid/deploy.py +70 -0
  272. data/vendor/rigid/deploy.pyc +0 -0
  273. data/vendor/rigid/file_scanner.py +63 -0
  274. data/vendor/rigid/file_scanner.pyc +0 -0
  275. data/vendor/rigid/utils.py +17 -0
  276. data/vendor/rigid/utils.pyc +0 -0
  277. data/vendor/rigid-0.2.0.dist-info/DESCRIPTION.rst +3 -0
  278. data/vendor/rigid-0.2.0.dist-info/INSTALLER +1 -0
  279. data/vendor/rigid-0.2.0.dist-info/METADATA +23 -0
  280. data/vendor/rigid-0.2.0.dist-info/RECORD +49 -0
  281. data/vendor/rigid-0.2.0.dist-info/WHEEL +5 -0
  282. data/vendor/rigid-0.2.0.dist-info/entry_points.txt +3 -0
  283. data/vendor/rigid-0.2.0.dist-info/metadata.json +1 -0
  284. data/vendor/rigid-0.2.0.dist-info/top_level.txt +2 -0
  285. data/vendor/setuptools-28.8.0.dist-info/DESCRIPTION.rst +243 -0
  286. data/vendor/setuptools-28.8.0.dist-info/INSTALLER +1 -0
  287. data/vendor/setuptools-28.8.0.dist-info/METADATA +272 -0
  288. data/vendor/setuptools-28.8.0.dist-info/RECORD +143 -0
  289. data/vendor/setuptools-28.8.0.dist-info/WHEEL +6 -0
  290. data/vendor/setuptools-28.8.0.dist-info/dependency_links.txt +2 -0
  291. data/vendor/setuptools-28.8.0.dist-info/entry_points.txt +63 -0
  292. data/vendor/setuptools-28.8.0.dist-info/metadata.json +1 -0
  293. data/vendor/setuptools-28.8.0.dist-info/top_level.txt +3 -0
  294. data/vendor/setuptools-28.8.0.dist-info/zip-safe +1 -0
  295. data/vendor/tests/__init__.py +0 -0
  296. data/vendor/tests/__init__.pyc +0 -0
  297. data/vendor/tests/integration/__init__.py +0 -0
  298. data/vendor/tests/integration/__init__.pyc +0 -0
  299. data/vendor/tests/integration/test_app.py +63 -0
  300. data/vendor/tests/integration/test_app.pyc +0 -0
  301. data/vendor/tests/integration/test_apps.py +27 -0
  302. data/vendor/tests/integration/test_apps.pyc +0 -0
  303. data/vendor/tests/integration/test_deploy.py +128 -0
  304. data/vendor/tests/integration/test_deploy.pyc +0 -0
  305. data/vendor/tests/integration/test_domains.py +35 -0
  306. data/vendor/tests/integration/test_domains.pyc +0 -0
  307. data/vendor/tests/integration/test_login.py +37 -0
  308. data/vendor/tests/integration/test_login.pyc +0 -0
  309. data/vendor/tests/integration/test_promote.py +24 -0
  310. data/vendor/tests/integration/test_promote.pyc +0 -0
  311. data/vendor/tests/integration/test_token.py +33 -0
  312. data/vendor/tests/integration/test_token.pyc +0 -0
  313. data/vendor/tests/integration/test_whoami.py +24 -0
  314. data/vendor/tests/integration/test_whoami.pyc +0 -0
  315. data/vendor/tests/test_deploy.py +33 -0
  316. data/vendor/tests/test_deploy.pyc +0 -0
  317. data/vendor/tests/test_file_scanner.py +89 -0
  318. data/vendor/tests/test_file_scanner.pyc +0 -0
  319. data/vendor/tests/utils.py +78 -0
  320. data/vendor/tests/utils.pyc +0 -0
  321. data/vendor/wheel-0.30.0a0.dist-info/DESCRIPTION.rst +325 -0
  322. data/vendor/wheel-0.30.0a0.dist-info/INSTALLER +1 -0
  323. data/vendor/wheel-0.30.0a0.dist-info/LICENSE.txt +22 -0
  324. data/vendor/wheel-0.30.0a0.dist-info/METADATA +357 -0
  325. data/vendor/wheel-0.30.0a0.dist-info/RECORD +86 -0
  326. data/vendor/wheel-0.30.0a0.dist-info/WHEEL +6 -0
  327. data/vendor/wheel-0.30.0a0.dist-info/entry_points.txt +6 -0
  328. data/vendor/wheel-0.30.0a0.dist-info/metadata.json +1 -0
  329. data/vendor/wheel-0.30.0a0.dist-info/top_level.txt +1 -0
  330. data/vendor/yaml/__init__.py +315 -0
  331. data/vendor/yaml/__init__.pyc +0 -0
  332. data/vendor/yaml/composer.py +139 -0
  333. data/vendor/yaml/composer.pyc +0 -0
  334. data/vendor/yaml/constructor.py +675 -0
  335. data/vendor/yaml/constructor.pyc +0 -0
  336. data/vendor/yaml/cyaml.py +85 -0
  337. data/vendor/yaml/cyaml.pyc +0 -0
  338. data/vendor/yaml/dumper.py +62 -0
  339. data/vendor/yaml/dumper.pyc +0 -0
  340. data/vendor/yaml/emitter.py +1140 -0
  341. data/vendor/yaml/emitter.pyc +0 -0
  342. data/vendor/yaml/error.py +75 -0
  343. data/vendor/yaml/error.pyc +0 -0
  344. data/vendor/yaml/events.py +86 -0
  345. data/vendor/yaml/events.pyc +0 -0
  346. data/vendor/yaml/loader.py +40 -0
  347. data/vendor/yaml/loader.pyc +0 -0
  348. data/vendor/yaml/nodes.py +49 -0
  349. data/vendor/yaml/nodes.pyc +0 -0
  350. data/vendor/yaml/parser.py +589 -0
  351. data/vendor/yaml/parser.pyc +0 -0
  352. data/vendor/yaml/reader.py +190 -0
  353. data/vendor/yaml/reader.pyc +0 -0
  354. data/vendor/yaml/representer.py +486 -0
  355. data/vendor/yaml/representer.pyc +0 -0
  356. data/vendor/yaml/resolver.py +227 -0
  357. data/vendor/yaml/resolver.pyc +0 -0
  358. data/vendor/yaml/scanner.py +1453 -0
  359. data/vendor/yaml/scanner.pyc +0 -0
  360. data/vendor/yaml/serializer.py +111 -0
  361. data/vendor/yaml/serializer.pyc +0 -0
  362. data/vendor/yaml/tokens.py +104 -0
  363. data/vendor/yaml/tokens.pyc +0 -0
  364. metadata +407 -0
@@ -0,0 +1,572 @@
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
+ # BIG5
31
+
32
+ BIG5_cls = (
33
+ 1,1,1,1,1,1,1,1, # 00 - 07 #allow 0x00 as legal value
34
+ 1,1,1,1,1,1,0,0, # 08 - 0f
35
+ 1,1,1,1,1,1,1,1, # 10 - 17
36
+ 1,1,1,0,1,1,1,1, # 18 - 1f
37
+ 1,1,1,1,1,1,1,1, # 20 - 27
38
+ 1,1,1,1,1,1,1,1, # 28 - 2f
39
+ 1,1,1,1,1,1,1,1, # 30 - 37
40
+ 1,1,1,1,1,1,1,1, # 38 - 3f
41
+ 2,2,2,2,2,2,2,2, # 40 - 47
42
+ 2,2,2,2,2,2,2,2, # 48 - 4f
43
+ 2,2,2,2,2,2,2,2, # 50 - 57
44
+ 2,2,2,2,2,2,2,2, # 58 - 5f
45
+ 2,2,2,2,2,2,2,2, # 60 - 67
46
+ 2,2,2,2,2,2,2,2, # 68 - 6f
47
+ 2,2,2,2,2,2,2,2, # 70 - 77
48
+ 2,2,2,2,2,2,2,1, # 78 - 7f
49
+ 4,4,4,4,4,4,4,4, # 80 - 87
50
+ 4,4,4,4,4,4,4,4, # 88 - 8f
51
+ 4,4,4,4,4,4,4,4, # 90 - 97
52
+ 4,4,4,4,4,4,4,4, # 98 - 9f
53
+ 4,3,3,3,3,3,3,3, # a0 - a7
54
+ 3,3,3,3,3,3,3,3, # a8 - af
55
+ 3,3,3,3,3,3,3,3, # b0 - b7
56
+ 3,3,3,3,3,3,3,3, # b8 - bf
57
+ 3,3,3,3,3,3,3,3, # c0 - c7
58
+ 3,3,3,3,3,3,3,3, # c8 - cf
59
+ 3,3,3,3,3,3,3,3, # d0 - d7
60
+ 3,3,3,3,3,3,3,3, # d8 - df
61
+ 3,3,3,3,3,3,3,3, # e0 - e7
62
+ 3,3,3,3,3,3,3,3, # e8 - ef
63
+ 3,3,3,3,3,3,3,3, # f0 - f7
64
+ 3,3,3,3,3,3,3,0 # f8 - ff
65
+ )
66
+
67
+ BIG5_st = (
68
+ eError,eStart,eStart, 3,eError,eError,eError,eError,#00-07
69
+ eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,#08-0f
70
+ eError,eStart,eStart,eStart,eStart,eStart,eStart,eStart#10-17
71
+ )
72
+
73
+ Big5CharLenTable = (0, 1, 1, 2, 0)
74
+
75
+ Big5SMModel = {'classTable': BIG5_cls,
76
+ 'classFactor': 5,
77
+ 'stateTable': BIG5_st,
78
+ 'charLenTable': Big5CharLenTable,
79
+ 'name': 'Big5'}
80
+
81
+ # CP949
82
+
83
+ CP949_cls = (
84
+ 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0,0, # 00 - 0f
85
+ 1,1,1,1,1,1,1,1, 1,1,1,0,1,1,1,1, # 10 - 1f
86
+ 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, # 20 - 2f
87
+ 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, # 30 - 3f
88
+ 1,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4, # 40 - 4f
89
+ 4,4,5,5,5,5,5,5, 5,5,5,1,1,1,1,1, # 50 - 5f
90
+ 1,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5, # 60 - 6f
91
+ 5,5,5,5,5,5,5,5, 5,5,5,1,1,1,1,1, # 70 - 7f
92
+ 0,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, # 80 - 8f
93
+ 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, # 90 - 9f
94
+ 6,7,7,7,7,7,7,7, 7,7,7,7,7,8,8,8, # a0 - af
95
+ 7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7, # b0 - bf
96
+ 7,7,7,7,7,7,9,2, 2,3,2,2,2,2,2,2, # c0 - cf
97
+ 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, # d0 - df
98
+ 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, # e0 - ef
99
+ 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,0, # f0 - ff
100
+ )
101
+
102
+ CP949_st = (
103
+ #cls= 0 1 2 3 4 5 6 7 8 9 # previous state =
104
+ eError,eStart, 3,eError,eStart,eStart, 4, 5,eError, 6, # eStart
105
+ eError,eError,eError,eError,eError,eError,eError,eError,eError,eError, # eError
106
+ eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe, # eItsMe
107
+ eError,eError,eStart,eStart,eError,eError,eError,eStart,eStart,eStart, # 3
108
+ eError,eError,eStart,eStart,eStart,eStart,eStart,eStart,eStart,eStart, # 4
109
+ eError,eStart,eStart,eStart,eStart,eStart,eStart,eStart,eStart,eStart, # 5
110
+ eError,eStart,eStart,eStart,eStart,eError,eError,eStart,eStart,eStart, # 6
111
+ )
112
+
113
+ CP949CharLenTable = (0, 1, 2, 0, 1, 1, 2, 2, 0, 2)
114
+
115
+ CP949SMModel = {'classTable': CP949_cls,
116
+ 'classFactor': 10,
117
+ 'stateTable': CP949_st,
118
+ 'charLenTable': CP949CharLenTable,
119
+ 'name': 'CP949'}
120
+
121
+ # EUC-JP
122
+
123
+ EUCJP_cls = (
124
+ 4,4,4,4,4,4,4,4, # 00 - 07
125
+ 4,4,4,4,4,4,5,5, # 08 - 0f
126
+ 4,4,4,4,4,4,4,4, # 10 - 17
127
+ 4,4,4,5,4,4,4,4, # 18 - 1f
128
+ 4,4,4,4,4,4,4,4, # 20 - 27
129
+ 4,4,4,4,4,4,4,4, # 28 - 2f
130
+ 4,4,4,4,4,4,4,4, # 30 - 37
131
+ 4,4,4,4,4,4,4,4, # 38 - 3f
132
+ 4,4,4,4,4,4,4,4, # 40 - 47
133
+ 4,4,4,4,4,4,4,4, # 48 - 4f
134
+ 4,4,4,4,4,4,4,4, # 50 - 57
135
+ 4,4,4,4,4,4,4,4, # 58 - 5f
136
+ 4,4,4,4,4,4,4,4, # 60 - 67
137
+ 4,4,4,4,4,4,4,4, # 68 - 6f
138
+ 4,4,4,4,4,4,4,4, # 70 - 77
139
+ 4,4,4,4,4,4,4,4, # 78 - 7f
140
+ 5,5,5,5,5,5,5,5, # 80 - 87
141
+ 5,5,5,5,5,5,1,3, # 88 - 8f
142
+ 5,5,5,5,5,5,5,5, # 90 - 97
143
+ 5,5,5,5,5,5,5,5, # 98 - 9f
144
+ 5,2,2,2,2,2,2,2, # a0 - a7
145
+ 2,2,2,2,2,2,2,2, # a8 - af
146
+ 2,2,2,2,2,2,2,2, # b0 - b7
147
+ 2,2,2,2,2,2,2,2, # b8 - bf
148
+ 2,2,2,2,2,2,2,2, # c0 - c7
149
+ 2,2,2,2,2,2,2,2, # c8 - cf
150
+ 2,2,2,2,2,2,2,2, # d0 - d7
151
+ 2,2,2,2,2,2,2,2, # d8 - df
152
+ 0,0,0,0,0,0,0,0, # e0 - e7
153
+ 0,0,0,0,0,0,0,0, # e8 - ef
154
+ 0,0,0,0,0,0,0,0, # f0 - f7
155
+ 0,0,0,0,0,0,0,5 # f8 - ff
156
+ )
157
+
158
+ EUCJP_st = (
159
+ 3, 4, 3, 5,eStart,eError,eError,eError,#00-07
160
+ eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,#08-0f
161
+ eItsMe,eItsMe,eStart,eError,eStart,eError,eError,eError,#10-17
162
+ eError,eError,eStart,eError,eError,eError, 3,eError,#18-1f
163
+ 3,eError,eError,eError,eStart,eStart,eStart,eStart#20-27
164
+ )
165
+
166
+ EUCJPCharLenTable = (2, 2, 2, 3, 1, 0)
167
+
168
+ EUCJPSMModel = {'classTable': EUCJP_cls,
169
+ 'classFactor': 6,
170
+ 'stateTable': EUCJP_st,
171
+ 'charLenTable': EUCJPCharLenTable,
172
+ 'name': 'EUC-JP'}
173
+
174
+ # EUC-KR
175
+
176
+ EUCKR_cls = (
177
+ 1,1,1,1,1,1,1,1, # 00 - 07
178
+ 1,1,1,1,1,1,0,0, # 08 - 0f
179
+ 1,1,1,1,1,1,1,1, # 10 - 17
180
+ 1,1,1,0,1,1,1,1, # 18 - 1f
181
+ 1,1,1,1,1,1,1,1, # 20 - 27
182
+ 1,1,1,1,1,1,1,1, # 28 - 2f
183
+ 1,1,1,1,1,1,1,1, # 30 - 37
184
+ 1,1,1,1,1,1,1,1, # 38 - 3f
185
+ 1,1,1,1,1,1,1,1, # 40 - 47
186
+ 1,1,1,1,1,1,1,1, # 48 - 4f
187
+ 1,1,1,1,1,1,1,1, # 50 - 57
188
+ 1,1,1,1,1,1,1,1, # 58 - 5f
189
+ 1,1,1,1,1,1,1,1, # 60 - 67
190
+ 1,1,1,1,1,1,1,1, # 68 - 6f
191
+ 1,1,1,1,1,1,1,1, # 70 - 77
192
+ 1,1,1,1,1,1,1,1, # 78 - 7f
193
+ 0,0,0,0,0,0,0,0, # 80 - 87
194
+ 0,0,0,0,0,0,0,0, # 88 - 8f
195
+ 0,0,0,0,0,0,0,0, # 90 - 97
196
+ 0,0,0,0,0,0,0,0, # 98 - 9f
197
+ 0,2,2,2,2,2,2,2, # a0 - a7
198
+ 2,2,2,2,2,3,3,3, # a8 - af
199
+ 2,2,2,2,2,2,2,2, # b0 - b7
200
+ 2,2,2,2,2,2,2,2, # b8 - bf
201
+ 2,2,2,2,2,2,2,2, # c0 - c7
202
+ 2,3,2,2,2,2,2,2, # c8 - cf
203
+ 2,2,2,2,2,2,2,2, # d0 - d7
204
+ 2,2,2,2,2,2,2,2, # d8 - df
205
+ 2,2,2,2,2,2,2,2, # e0 - e7
206
+ 2,2,2,2,2,2,2,2, # e8 - ef
207
+ 2,2,2,2,2,2,2,2, # f0 - f7
208
+ 2,2,2,2,2,2,2,0 # f8 - ff
209
+ )
210
+
211
+ EUCKR_st = (
212
+ eError,eStart, 3,eError,eError,eError,eError,eError,#00-07
213
+ eItsMe,eItsMe,eItsMe,eItsMe,eError,eError,eStart,eStart #08-0f
214
+ )
215
+
216
+ EUCKRCharLenTable = (0, 1, 2, 0)
217
+
218
+ EUCKRSMModel = {'classTable': EUCKR_cls,
219
+ 'classFactor': 4,
220
+ 'stateTable': EUCKR_st,
221
+ 'charLenTable': EUCKRCharLenTable,
222
+ 'name': 'EUC-KR'}
223
+
224
+ # EUC-TW
225
+
226
+ EUCTW_cls = (
227
+ 2,2,2,2,2,2,2,2, # 00 - 07
228
+ 2,2,2,2,2,2,0,0, # 08 - 0f
229
+ 2,2,2,2,2,2,2,2, # 10 - 17
230
+ 2,2,2,0,2,2,2,2, # 18 - 1f
231
+ 2,2,2,2,2,2,2,2, # 20 - 27
232
+ 2,2,2,2,2,2,2,2, # 28 - 2f
233
+ 2,2,2,2,2,2,2,2, # 30 - 37
234
+ 2,2,2,2,2,2,2,2, # 38 - 3f
235
+ 2,2,2,2,2,2,2,2, # 40 - 47
236
+ 2,2,2,2,2,2,2,2, # 48 - 4f
237
+ 2,2,2,2,2,2,2,2, # 50 - 57
238
+ 2,2,2,2,2,2,2,2, # 58 - 5f
239
+ 2,2,2,2,2,2,2,2, # 60 - 67
240
+ 2,2,2,2,2,2,2,2, # 68 - 6f
241
+ 2,2,2,2,2,2,2,2, # 70 - 77
242
+ 2,2,2,2,2,2,2,2, # 78 - 7f
243
+ 0,0,0,0,0,0,0,0, # 80 - 87
244
+ 0,0,0,0,0,0,6,0, # 88 - 8f
245
+ 0,0,0,0,0,0,0,0, # 90 - 97
246
+ 0,0,0,0,0,0,0,0, # 98 - 9f
247
+ 0,3,4,4,4,4,4,4, # a0 - a7
248
+ 5,5,1,1,1,1,1,1, # a8 - af
249
+ 1,1,1,1,1,1,1,1, # b0 - b7
250
+ 1,1,1,1,1,1,1,1, # b8 - bf
251
+ 1,1,3,1,3,3,3,3, # c0 - c7
252
+ 3,3,3,3,3,3,3,3, # c8 - cf
253
+ 3,3,3,3,3,3,3,3, # d0 - d7
254
+ 3,3,3,3,3,3,3,3, # d8 - df
255
+ 3,3,3,3,3,3,3,3, # e0 - e7
256
+ 3,3,3,3,3,3,3,3, # e8 - ef
257
+ 3,3,3,3,3,3,3,3, # f0 - f7
258
+ 3,3,3,3,3,3,3,0 # f8 - ff
259
+ )
260
+
261
+ EUCTW_st = (
262
+ eError,eError,eStart, 3, 3, 3, 4,eError,#00-07
263
+ eError,eError,eError,eError,eError,eError,eItsMe,eItsMe,#08-0f
264
+ eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,eStart,eError,#10-17
265
+ eStart,eStart,eStart,eError,eError,eError,eError,eError,#18-1f
266
+ 5,eError,eError,eError,eStart,eError,eStart,eStart,#20-27
267
+ eStart,eError,eStart,eStart,eStart,eStart,eStart,eStart #28-2f
268
+ )
269
+
270
+ EUCTWCharLenTable = (0, 0, 1, 2, 2, 2, 3)
271
+
272
+ EUCTWSMModel = {'classTable': EUCTW_cls,
273
+ 'classFactor': 7,
274
+ 'stateTable': EUCTW_st,
275
+ 'charLenTable': EUCTWCharLenTable,
276
+ 'name': 'x-euc-tw'}
277
+
278
+ # GB2312
279
+
280
+ GB2312_cls = (
281
+ 1,1,1,1,1,1,1,1, # 00 - 07
282
+ 1,1,1,1,1,1,0,0, # 08 - 0f
283
+ 1,1,1,1,1,1,1,1, # 10 - 17
284
+ 1,1,1,0,1,1,1,1, # 18 - 1f
285
+ 1,1,1,1,1,1,1,1, # 20 - 27
286
+ 1,1,1,1,1,1,1,1, # 28 - 2f
287
+ 3,3,3,3,3,3,3,3, # 30 - 37
288
+ 3,3,1,1,1,1,1,1, # 38 - 3f
289
+ 2,2,2,2,2,2,2,2, # 40 - 47
290
+ 2,2,2,2,2,2,2,2, # 48 - 4f
291
+ 2,2,2,2,2,2,2,2, # 50 - 57
292
+ 2,2,2,2,2,2,2,2, # 58 - 5f
293
+ 2,2,2,2,2,2,2,2, # 60 - 67
294
+ 2,2,2,2,2,2,2,2, # 68 - 6f
295
+ 2,2,2,2,2,2,2,2, # 70 - 77
296
+ 2,2,2,2,2,2,2,4, # 78 - 7f
297
+ 5,6,6,6,6,6,6,6, # 80 - 87
298
+ 6,6,6,6,6,6,6,6, # 88 - 8f
299
+ 6,6,6,6,6,6,6,6, # 90 - 97
300
+ 6,6,6,6,6,6,6,6, # 98 - 9f
301
+ 6,6,6,6,6,6,6,6, # a0 - a7
302
+ 6,6,6,6,6,6,6,6, # a8 - af
303
+ 6,6,6,6,6,6,6,6, # b0 - b7
304
+ 6,6,6,6,6,6,6,6, # b8 - bf
305
+ 6,6,6,6,6,6,6,6, # c0 - c7
306
+ 6,6,6,6,6,6,6,6, # c8 - cf
307
+ 6,6,6,6,6,6,6,6, # d0 - d7
308
+ 6,6,6,6,6,6,6,6, # d8 - df
309
+ 6,6,6,6,6,6,6,6, # e0 - e7
310
+ 6,6,6,6,6,6,6,6, # e8 - ef
311
+ 6,6,6,6,6,6,6,6, # f0 - f7
312
+ 6,6,6,6,6,6,6,0 # f8 - ff
313
+ )
314
+
315
+ GB2312_st = (
316
+ eError,eStart,eStart,eStart,eStart,eStart, 3,eError,#00-07
317
+ eError,eError,eError,eError,eError,eError,eItsMe,eItsMe,#08-0f
318
+ eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eError,eError,eStart,#10-17
319
+ 4,eError,eStart,eStart,eError,eError,eError,eError,#18-1f
320
+ eError,eError, 5,eError,eError,eError,eItsMe,eError,#20-27
321
+ eError,eError,eStart,eStart,eStart,eStart,eStart,eStart #28-2f
322
+ )
323
+
324
+ # To be accurate, the length of class 6 can be either 2 or 4.
325
+ # But it is not necessary to discriminate between the two since
326
+ # it is used for frequency analysis only, and we are validing
327
+ # each code range there as well. So it is safe to set it to be
328
+ # 2 here.
329
+ GB2312CharLenTable = (0, 1, 1, 1, 1, 1, 2)
330
+
331
+ GB2312SMModel = {'classTable': GB2312_cls,
332
+ 'classFactor': 7,
333
+ 'stateTable': GB2312_st,
334
+ 'charLenTable': GB2312CharLenTable,
335
+ 'name': 'GB2312'}
336
+
337
+ # Shift_JIS
338
+
339
+ SJIS_cls = (
340
+ 1,1,1,1,1,1,1,1, # 00 - 07
341
+ 1,1,1,1,1,1,0,0, # 08 - 0f
342
+ 1,1,1,1,1,1,1,1, # 10 - 17
343
+ 1,1,1,0,1,1,1,1, # 18 - 1f
344
+ 1,1,1,1,1,1,1,1, # 20 - 27
345
+ 1,1,1,1,1,1,1,1, # 28 - 2f
346
+ 1,1,1,1,1,1,1,1, # 30 - 37
347
+ 1,1,1,1,1,1,1,1, # 38 - 3f
348
+ 2,2,2,2,2,2,2,2, # 40 - 47
349
+ 2,2,2,2,2,2,2,2, # 48 - 4f
350
+ 2,2,2,2,2,2,2,2, # 50 - 57
351
+ 2,2,2,2,2,2,2,2, # 58 - 5f
352
+ 2,2,2,2,2,2,2,2, # 60 - 67
353
+ 2,2,2,2,2,2,2,2, # 68 - 6f
354
+ 2,2,2,2,2,2,2,2, # 70 - 77
355
+ 2,2,2,2,2,2,2,1, # 78 - 7f
356
+ 3,3,3,3,3,2,2,3, # 80 - 87
357
+ 3,3,3,3,3,3,3,3, # 88 - 8f
358
+ 3,3,3,3,3,3,3,3, # 90 - 97
359
+ 3,3,3,3,3,3,3,3, # 98 - 9f
360
+ #0xa0 is illegal in sjis encoding, but some pages does
361
+ #contain such byte. We need to be more error forgiven.
362
+ 2,2,2,2,2,2,2,2, # a0 - a7
363
+ 2,2,2,2,2,2,2,2, # a8 - af
364
+ 2,2,2,2,2,2,2,2, # b0 - b7
365
+ 2,2,2,2,2,2,2,2, # b8 - bf
366
+ 2,2,2,2,2,2,2,2, # c0 - c7
367
+ 2,2,2,2,2,2,2,2, # c8 - cf
368
+ 2,2,2,2,2,2,2,2, # d0 - d7
369
+ 2,2,2,2,2,2,2,2, # d8 - df
370
+ 3,3,3,3,3,3,3,3, # e0 - e7
371
+ 3,3,3,3,3,4,4,4, # e8 - ef
372
+ 3,3,3,3,3,3,3,3, # f0 - f7
373
+ 3,3,3,3,3,0,0,0) # f8 - ff
374
+
375
+
376
+ SJIS_st = (
377
+ eError,eStart,eStart, 3,eError,eError,eError,eError,#00-07
378
+ eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,#08-0f
379
+ eItsMe,eItsMe,eError,eError,eStart,eStart,eStart,eStart #10-17
380
+ )
381
+
382
+ SJISCharLenTable = (0, 1, 1, 2, 0, 0)
383
+
384
+ SJISSMModel = {'classTable': SJIS_cls,
385
+ 'classFactor': 6,
386
+ 'stateTable': SJIS_st,
387
+ 'charLenTable': SJISCharLenTable,
388
+ 'name': 'Shift_JIS'}
389
+
390
+ # UCS2-BE
391
+
392
+ UCS2BE_cls = (
393
+ 0,0,0,0,0,0,0,0, # 00 - 07
394
+ 0,0,1,0,0,2,0,0, # 08 - 0f
395
+ 0,0,0,0,0,0,0,0, # 10 - 17
396
+ 0,0,0,3,0,0,0,0, # 18 - 1f
397
+ 0,0,0,0,0,0,0,0, # 20 - 27
398
+ 0,3,3,3,3,3,0,0, # 28 - 2f
399
+ 0,0,0,0,0,0,0,0, # 30 - 37
400
+ 0,0,0,0,0,0,0,0, # 38 - 3f
401
+ 0,0,0,0,0,0,0,0, # 40 - 47
402
+ 0,0,0,0,0,0,0,0, # 48 - 4f
403
+ 0,0,0,0,0,0,0,0, # 50 - 57
404
+ 0,0,0,0,0,0,0,0, # 58 - 5f
405
+ 0,0,0,0,0,0,0,0, # 60 - 67
406
+ 0,0,0,0,0,0,0,0, # 68 - 6f
407
+ 0,0,0,0,0,0,0,0, # 70 - 77
408
+ 0,0,0,0,0,0,0,0, # 78 - 7f
409
+ 0,0,0,0,0,0,0,0, # 80 - 87
410
+ 0,0,0,0,0,0,0,0, # 88 - 8f
411
+ 0,0,0,0,0,0,0,0, # 90 - 97
412
+ 0,0,0,0,0,0,0,0, # 98 - 9f
413
+ 0,0,0,0,0,0,0,0, # a0 - a7
414
+ 0,0,0,0,0,0,0,0, # a8 - af
415
+ 0,0,0,0,0,0,0,0, # b0 - b7
416
+ 0,0,0,0,0,0,0,0, # b8 - bf
417
+ 0,0,0,0,0,0,0,0, # c0 - c7
418
+ 0,0,0,0,0,0,0,0, # c8 - cf
419
+ 0,0,0,0,0,0,0,0, # d0 - d7
420
+ 0,0,0,0,0,0,0,0, # d8 - df
421
+ 0,0,0,0,0,0,0,0, # e0 - e7
422
+ 0,0,0,0,0,0,0,0, # e8 - ef
423
+ 0,0,0,0,0,0,0,0, # f0 - f7
424
+ 0,0,0,0,0,0,4,5 # f8 - ff
425
+ )
426
+
427
+ UCS2BE_st = (
428
+ 5, 7, 7,eError, 4, 3,eError,eError,#00-07
429
+ eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,#08-0f
430
+ eItsMe,eItsMe, 6, 6, 6, 6,eError,eError,#10-17
431
+ 6, 6, 6, 6, 6,eItsMe, 6, 6,#18-1f
432
+ 6, 6, 6, 6, 5, 7, 7,eError,#20-27
433
+ 5, 8, 6, 6,eError, 6, 6, 6,#28-2f
434
+ 6, 6, 6, 6,eError,eError,eStart,eStart #30-37
435
+ )
436
+
437
+ UCS2BECharLenTable = (2, 2, 2, 0, 2, 2)
438
+
439
+ UCS2BESMModel = {'classTable': UCS2BE_cls,
440
+ 'classFactor': 6,
441
+ 'stateTable': UCS2BE_st,
442
+ 'charLenTable': UCS2BECharLenTable,
443
+ 'name': 'UTF-16BE'}
444
+
445
+ # UCS2-LE
446
+
447
+ UCS2LE_cls = (
448
+ 0,0,0,0,0,0,0,0, # 00 - 07
449
+ 0,0,1,0,0,2,0,0, # 08 - 0f
450
+ 0,0,0,0,0,0,0,0, # 10 - 17
451
+ 0,0,0,3,0,0,0,0, # 18 - 1f
452
+ 0,0,0,0,0,0,0,0, # 20 - 27
453
+ 0,3,3,3,3,3,0,0, # 28 - 2f
454
+ 0,0,0,0,0,0,0,0, # 30 - 37
455
+ 0,0,0,0,0,0,0,0, # 38 - 3f
456
+ 0,0,0,0,0,0,0,0, # 40 - 47
457
+ 0,0,0,0,0,0,0,0, # 48 - 4f
458
+ 0,0,0,0,0,0,0,0, # 50 - 57
459
+ 0,0,0,0,0,0,0,0, # 58 - 5f
460
+ 0,0,0,0,0,0,0,0, # 60 - 67
461
+ 0,0,0,0,0,0,0,0, # 68 - 6f
462
+ 0,0,0,0,0,0,0,0, # 70 - 77
463
+ 0,0,0,0,0,0,0,0, # 78 - 7f
464
+ 0,0,0,0,0,0,0,0, # 80 - 87
465
+ 0,0,0,0,0,0,0,0, # 88 - 8f
466
+ 0,0,0,0,0,0,0,0, # 90 - 97
467
+ 0,0,0,0,0,0,0,0, # 98 - 9f
468
+ 0,0,0,0,0,0,0,0, # a0 - a7
469
+ 0,0,0,0,0,0,0,0, # a8 - af
470
+ 0,0,0,0,0,0,0,0, # b0 - b7
471
+ 0,0,0,0,0,0,0,0, # b8 - bf
472
+ 0,0,0,0,0,0,0,0, # c0 - c7
473
+ 0,0,0,0,0,0,0,0, # c8 - cf
474
+ 0,0,0,0,0,0,0,0, # d0 - d7
475
+ 0,0,0,0,0,0,0,0, # d8 - df
476
+ 0,0,0,0,0,0,0,0, # e0 - e7
477
+ 0,0,0,0,0,0,0,0, # e8 - ef
478
+ 0,0,0,0,0,0,0,0, # f0 - f7
479
+ 0,0,0,0,0,0,4,5 # f8 - ff
480
+ )
481
+
482
+ UCS2LE_st = (
483
+ 6, 6, 7, 6, 4, 3,eError,eError,#00-07
484
+ eError,eError,eError,eError,eItsMe,eItsMe,eItsMe,eItsMe,#08-0f
485
+ eItsMe,eItsMe, 5, 5, 5,eError,eItsMe,eError,#10-17
486
+ 5, 5, 5,eError, 5,eError, 6, 6,#18-1f
487
+ 7, 6, 8, 8, 5, 5, 5,eError,#20-27
488
+ 5, 5, 5,eError,eError,eError, 5, 5,#28-2f
489
+ 5, 5, 5,eError, 5,eError,eStart,eStart #30-37
490
+ )
491
+
492
+ UCS2LECharLenTable = (2, 2, 2, 2, 2, 2)
493
+
494
+ UCS2LESMModel = {'classTable': UCS2LE_cls,
495
+ 'classFactor': 6,
496
+ 'stateTable': UCS2LE_st,
497
+ 'charLenTable': UCS2LECharLenTable,
498
+ 'name': 'UTF-16LE'}
499
+
500
+ # UTF-8
501
+
502
+ UTF8_cls = (
503
+ 1,1,1,1,1,1,1,1, # 00 - 07 #allow 0x00 as a legal value
504
+ 1,1,1,1,1,1,0,0, # 08 - 0f
505
+ 1,1,1,1,1,1,1,1, # 10 - 17
506
+ 1,1,1,0,1,1,1,1, # 18 - 1f
507
+ 1,1,1,1,1,1,1,1, # 20 - 27
508
+ 1,1,1,1,1,1,1,1, # 28 - 2f
509
+ 1,1,1,1,1,1,1,1, # 30 - 37
510
+ 1,1,1,1,1,1,1,1, # 38 - 3f
511
+ 1,1,1,1,1,1,1,1, # 40 - 47
512
+ 1,1,1,1,1,1,1,1, # 48 - 4f
513
+ 1,1,1,1,1,1,1,1, # 50 - 57
514
+ 1,1,1,1,1,1,1,1, # 58 - 5f
515
+ 1,1,1,1,1,1,1,1, # 60 - 67
516
+ 1,1,1,1,1,1,1,1, # 68 - 6f
517
+ 1,1,1,1,1,1,1,1, # 70 - 77
518
+ 1,1,1,1,1,1,1,1, # 78 - 7f
519
+ 2,2,2,2,3,3,3,3, # 80 - 87
520
+ 4,4,4,4,4,4,4,4, # 88 - 8f
521
+ 4,4,4,4,4,4,4,4, # 90 - 97
522
+ 4,4,4,4,4,4,4,4, # 98 - 9f
523
+ 5,5,5,5,5,5,5,5, # a0 - a7
524
+ 5,5,5,5,5,5,5,5, # a8 - af
525
+ 5,5,5,5,5,5,5,5, # b0 - b7
526
+ 5,5,5,5,5,5,5,5, # b8 - bf
527
+ 0,0,6,6,6,6,6,6, # c0 - c7
528
+ 6,6,6,6,6,6,6,6, # c8 - cf
529
+ 6,6,6,6,6,6,6,6, # d0 - d7
530
+ 6,6,6,6,6,6,6,6, # d8 - df
531
+ 7,8,8,8,8,8,8,8, # e0 - e7
532
+ 8,8,8,8,8,9,8,8, # e8 - ef
533
+ 10,11,11,11,11,11,11,11, # f0 - f7
534
+ 12,13,13,13,14,15,0,0 # f8 - ff
535
+ )
536
+
537
+ UTF8_st = (
538
+ eError,eStart,eError,eError,eError,eError, 12, 10,#00-07
539
+ 9, 11, 8, 7, 6, 5, 4, 3,#08-0f
540
+ eError,eError,eError,eError,eError,eError,eError,eError,#10-17
541
+ eError,eError,eError,eError,eError,eError,eError,eError,#18-1f
542
+ eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,#20-27
543
+ eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,eItsMe,#28-2f
544
+ eError,eError, 5, 5, 5, 5,eError,eError,#30-37
545
+ eError,eError,eError,eError,eError,eError,eError,eError,#38-3f
546
+ eError,eError,eError, 5, 5, 5,eError,eError,#40-47
547
+ eError,eError,eError,eError,eError,eError,eError,eError,#48-4f
548
+ eError,eError, 7, 7, 7, 7,eError,eError,#50-57
549
+ eError,eError,eError,eError,eError,eError,eError,eError,#58-5f
550
+ eError,eError,eError,eError, 7, 7,eError,eError,#60-67
551
+ eError,eError,eError,eError,eError,eError,eError,eError,#68-6f
552
+ eError,eError, 9, 9, 9, 9,eError,eError,#70-77
553
+ eError,eError,eError,eError,eError,eError,eError,eError,#78-7f
554
+ eError,eError,eError,eError,eError, 9,eError,eError,#80-87
555
+ eError,eError,eError,eError,eError,eError,eError,eError,#88-8f
556
+ eError,eError, 12, 12, 12, 12,eError,eError,#90-97
557
+ eError,eError,eError,eError,eError,eError,eError,eError,#98-9f
558
+ eError,eError,eError,eError,eError, 12,eError,eError,#a0-a7
559
+ eError,eError,eError,eError,eError,eError,eError,eError,#a8-af
560
+ eError,eError, 12, 12, 12,eError,eError,eError,#b0-b7
561
+ eError,eError,eError,eError,eError,eError,eError,eError,#b8-bf
562
+ eError,eError,eStart,eStart,eStart,eStart,eError,eError,#c0-c7
563
+ eError,eError,eError,eError,eError,eError,eError,eError #c8-cf
564
+ )
565
+
566
+ UTF8CharLenTable = (0, 1, 0, 0, 0, 0, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6)
567
+
568
+ UTF8SMModel = {'classTable': UTF8_cls,
569
+ 'classFactor': 16,
570
+ 'stateTable': UTF8_st,
571
+ 'charLenTable': UTF8CharLenTable,
572
+ 'name': 'UTF-8'}
@@ -0,0 +1,120 @@
1
+ ######################## BEGIN LICENSE BLOCK ########################
2
+ # The Original Code is Mozilla Universal charset detector code.
3
+ #
4
+ # The Initial Developer of the Original Code is
5
+ # Netscape Communications Corporation.
6
+ # Portions created by the Initial Developer are Copyright (C) 2001
7
+ # the Initial Developer. All Rights Reserved.
8
+ #
9
+ # Contributor(s):
10
+ # Mark Pilgrim - port to Python
11
+ # Shy Shalom - original C code
12
+ #
13
+ # This library is free software; you can redistribute it and/or
14
+ # modify it under the terms of the GNU Lesser General Public
15
+ # License as published by the Free Software Foundation; either
16
+ # version 2.1 of the License, or (at your option) any later version.
17
+ #
18
+ # This library is distributed in the hope that it will be useful,
19
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21
+ # Lesser General Public License for more details.
22
+ #
23
+ # You should have received a copy of the GNU Lesser General Public
24
+ # License along with this library; if not, write to the Free Software
25
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
26
+ # 02110-1301 USA
27
+ ######################### END LICENSE BLOCK #########################
28
+
29
+ import sys
30
+ from . import constants
31
+ from .charsetprober import CharSetProber
32
+ from .compat import wrap_ord
33
+
34
+ SAMPLE_SIZE = 64
35
+ SB_ENOUGH_REL_THRESHOLD = 1024
36
+ POSITIVE_SHORTCUT_THRESHOLD = 0.95
37
+ NEGATIVE_SHORTCUT_THRESHOLD = 0.05
38
+ SYMBOL_CAT_ORDER = 250
39
+ NUMBER_OF_SEQ_CAT = 4
40
+ POSITIVE_CAT = NUMBER_OF_SEQ_CAT - 1
41
+ #NEGATIVE_CAT = 0
42
+
43
+
44
+ class SingleByteCharSetProber(CharSetProber):
45
+ def __init__(self, model, reversed=False, nameProber=None):
46
+ CharSetProber.__init__(self)
47
+ self._mModel = model
48
+ # TRUE if we need to reverse every pair in the model lookup
49
+ self._mReversed = reversed
50
+ # Optional auxiliary prober for name decision
51
+ self._mNameProber = nameProber
52
+ self.reset()
53
+
54
+ def reset(self):
55
+ CharSetProber.reset(self)
56
+ # char order of last character
57
+ self._mLastOrder = 255
58
+ self._mSeqCounters = [0] * NUMBER_OF_SEQ_CAT
59
+ self._mTotalSeqs = 0
60
+ self._mTotalChar = 0
61
+ # characters that fall in our sampling range
62
+ self._mFreqChar = 0
63
+
64
+ def get_charset_name(self):
65
+ if self._mNameProber:
66
+ return self._mNameProber.get_charset_name()
67
+ else:
68
+ return self._mModel['charsetName']
69
+
70
+ def feed(self, aBuf):
71
+ if not self._mModel['keepEnglishLetter']:
72
+ aBuf = self.filter_without_english_letters(aBuf)
73
+ aLen = len(aBuf)
74
+ if not aLen:
75
+ return self.get_state()
76
+ for c in aBuf:
77
+ order = self._mModel['charToOrderMap'][wrap_ord(c)]
78
+ if order < SYMBOL_CAT_ORDER:
79
+ self._mTotalChar += 1
80
+ if order < SAMPLE_SIZE:
81
+ self._mFreqChar += 1
82
+ if self._mLastOrder < SAMPLE_SIZE:
83
+ self._mTotalSeqs += 1
84
+ if not self._mReversed:
85
+ i = (self._mLastOrder * SAMPLE_SIZE) + order
86
+ model = self._mModel['precedenceMatrix'][i]
87
+ else: # reverse the order of the letters in the lookup
88
+ i = (order * SAMPLE_SIZE) + self._mLastOrder
89
+ model = self._mModel['precedenceMatrix'][i]
90
+ self._mSeqCounters[model] += 1
91
+ self._mLastOrder = order
92
+
93
+ if self.get_state() == constants.eDetecting:
94
+ if self._mTotalSeqs > SB_ENOUGH_REL_THRESHOLD:
95
+ cf = self.get_confidence()
96
+ if cf > POSITIVE_SHORTCUT_THRESHOLD:
97
+ if constants._debug:
98
+ sys.stderr.write('%s confidence = %s, we have a'
99
+ 'winner\n' %
100
+ (self._mModel['charsetName'], cf))
101
+ self._mState = constants.eFoundIt
102
+ elif cf < NEGATIVE_SHORTCUT_THRESHOLD:
103
+ if constants._debug:
104
+ sys.stderr.write('%s confidence = %s, below negative'
105
+ 'shortcut threshhold %s\n' %
106
+ (self._mModel['charsetName'], cf,
107
+ NEGATIVE_SHORTCUT_THRESHOLD))
108
+ self._mState = constants.eNotMe
109
+
110
+ return self.get_state()
111
+
112
+ def get_confidence(self):
113
+ r = 0.01
114
+ if self._mTotalSeqs > 0:
115
+ r = ((1.0 * self._mSeqCounters[POSITIVE_CAT]) / self._mTotalSeqs
116
+ / self._mModel['mTypicalPositiveRatio'])
117
+ r = r * self._mFreqChar / self._mTotalChar
118
+ if r >= 1.0:
119
+ r = 0.99
120
+ return r