Permalink
Browse files

* Add external dependencies.

  • Loading branch information...
1 parent 7650870 commit 96f511a4af8852409f11a3db2d1ea966f92ec843 @dannyakakong committed Dec 13, 2014
Showing with 75,362 additions and 0 deletions.
  1. +85 −0 click/__init__.py
  2. +74 −0 click/_bashcomplete.py
  3. +560 −0 click/_compat.py
  4. +508 −0 click/_termui_impl.py
  5. +38 −0 click/_textwrap.py
  6. +1,575 −0 click/core.py
  7. +293 −0 click/decorators.py
  8. +101 −0 click/exceptions.py
  9. +239 −0 click/formatting.py
  10. +347 −0 click/parser.py
  11. +496 −0 click/termui.py
  12. +294 −0 click/testing.py
  13. +451 −0 click/types.py
  14. +425 −0 click/utils.py
  15. +50 −0 flask/__init__.py
  16. +15 −0 flask/__main__.py
  17. +97 −0 flask/_compat.py
  18. +1,923 −0 flask/app.py
  19. +414 −0 flask/blueprints.py
  20. +448 −0 flask/cli.py
  21. +253 −0 flask/config.py
  22. +406 −0 flask/ctx.py
  23. +87 −0 flask/debughelpers.py
  24. +29 −0 flask/ext/__init__.py
  25. +120 −0 flask/exthook.py
  26. +61 −0 flask/globals.py
  27. +899 −0 flask/helpers.py
  28. +243 −0 flask/json.py
  29. +45 −0 flask/logging.py
  30. +42 −0 flask/module.py
  31. +367 −0 flask/sessions.py
  32. +55 −0 flask/signals.py
  33. +143 −0 flask/templating.py
  34. +126 −0 flask/testing.py
  35. +149 −0 flask/views.py
  36. +199 −0 flask/wrappers.py
  37. +10 −0 humanize/__init__.py
  38. +7 −0 humanize/compat.py
  39. +39 −0 humanize/filesize.py
  40. +49 −0 humanize/i18n.py
  41. +239 −0 humanize/locale/fr_FR/LC_MESSAGES/humanize.po
  42. +238 −0 humanize/locale/ko_KR/LC_MESSAGES/humanize.po
  43. +239 −0 humanize/locale/ru_RU/LC_MESSAGES/humanize.po
  44. +116 −0 humanize/number.py
  45. +168 −0 humanize/time.py
  46. +70 −0 jinja2/__init__.py
  47. +109 −0 jinja2/_compat.py
  48. +132 −0 jinja2/_stringdefs.py
  49. +362 −0 jinja2/bccache.py
  50. +1,663 −0 jinja2/compiler.py
  51. +32 −0 jinja2/constants.py
  52. +337 −0 jinja2/debug.py
  53. +43 −0 jinja2/defaults.py
  54. +1,203 −0 jinja2/environment.py
  55. +146 −0 jinja2/exceptions.py
  56. +636 −0 jinja2/ext.py
  57. +994 −0 jinja2/filters.py
  58. +734 −0 jinja2/lexer.py
  59. +481 −0 jinja2/loaders.py
  60. +103 −0 jinja2/meta.py
  61. +919 −0 jinja2/nodes.py
  62. +68 −0 jinja2/optimizer.py
  63. +897 −0 jinja2/parser.py
  64. +666 −0 jinja2/runtime.py
  65. +368 −0 jinja2/sandbox.py
  66. +171 −0 jinja2/tests.py
  67. +156 −0 jinja2/testsuite/__init__.py
  68. +285 −0 jinja2/testsuite/api.py
  69. +37 −0 jinja2/testsuite/bytecode_cache.py
  70. +322 −0 jinja2/testsuite/core_tags.py
  71. +58 −0 jinja2/testsuite/debug.py
  72. +29 −0 jinja2/testsuite/doctests.py
  73. +459 −0 jinja2/testsuite/ext.py
  74. +545 −0 jinja2/testsuite/filters.py
  75. +141 −0 jinja2/testsuite/imports.py
  76. +250 −0 jinja2/testsuite/inheritance.py
  77. +593 −0 jinja2/testsuite/lexnparse.py
  78. +227 −0 jinja2/testsuite/loader.py
  79. +279 −0 jinja2/testsuite/regression.py
  80. 0 jinja2/testsuite/res/__init__.py
  81. +3 −0 jinja2/testsuite/res/templates/broken.html
  82. +1 −0 jinja2/testsuite/res/templates/foo/test.html
  83. +4 −0 jinja2/testsuite/res/templates/syntaxerror.html
  84. +1 −0 jinja2/testsuite/res/templates/test.html
  85. +166 −0 jinja2/testsuite/security.py
  86. +104 −0 jinja2/testsuite/tests.py
  87. +82 −0 jinja2/testsuite/utils.py
  88. +527 −0 jinja2/utils.py
  89. +87 −0 jinja2/visitor.py
  90. +1 −0 memcache/__init__.py
  91. +1,417 −0 memcache/memcache.py
  92. +77 −0 requests/__init__.py
  93. +390 −0 requests/adapters.py
  94. +120 −0 requests/api.py
  95. +196 −0 requests/auth.py
  96. +5,026 −0 requests/cacert.pem
  97. +24 −0 requests/certs.py
  98. +115 −0 requests/compat.py
  99. +454 −0 requests/cookies.py
  100. +67 −0 requests/exceptions.py
  101. +45 −0 requests/hooks.py
  102. +781 −0 requests/models.py
  103. +8 −0 requests/packages/README.rst
  104. +3 −0 requests/packages/__init__.py
  105. +32 −0 requests/packages/chardet/__init__.py
  106. +925 −0 requests/packages/chardet/big5freq.py
  107. +42 −0 requests/packages/chardet/big5prober.py
  108. +46 −0 requests/packages/chardet/chardetect.py
  109. +231 −0 requests/packages/chardet/chardistribution.py
  110. +106 −0 requests/packages/chardet/charsetgroupprober.py
  111. +62 −0 requests/packages/chardet/charsetprober.py
  112. +61 −0 requests/packages/chardet/codingstatemachine.py
  113. +34 −0 requests/packages/chardet/compat.py
  114. +39 −0 requests/packages/chardet/constants.py
  115. +44 −0 requests/packages/chardet/cp949prober.py
  116. +86 −0 requests/packages/chardet/escprober.py
  117. +242 −0 requests/packages/chardet/escsm.py
  118. +90 −0 requests/packages/chardet/eucjpprober.py
  119. +596 −0 requests/packages/chardet/euckrfreq.py
  120. +42 −0 requests/packages/chardet/euckrprober.py
  121. +428 −0 requests/packages/chardet/euctwfreq.py
  122. +41 −0 requests/packages/chardet/euctwprober.py
  123. +472 −0 requests/packages/chardet/gb2312freq.py
  124. +41 −0 requests/packages/chardet/gb2312prober.py
  125. +283 −0 requests/packages/chardet/hebrewprober.py
  126. +569 −0 requests/packages/chardet/jisfreq.py
  127. +219 −0 requests/packages/chardet/jpcntx.py
  128. +229 −0 requests/packages/chardet/langbulgarianmodel.py
  129. +329 −0 requests/packages/chardet/langcyrillicmodel.py
  130. +225 −0 requests/packages/chardet/langgreekmodel.py
  131. +201 −0 requests/packages/chardet/langhebrewmodel.py
  132. +225 −0 requests/packages/chardet/langhungarianmodel.py
  133. +200 −0 requests/packages/chardet/langthaimodel.py
  134. +139 −0 requests/packages/chardet/latin1prober.py
  135. +86 −0 requests/packages/chardet/mbcharsetprober.py
  136. +54 −0 requests/packages/chardet/mbcsgroupprober.py
  137. +575 −0 requests/packages/chardet/mbcssm.py
  138. +120 −0 requests/packages/chardet/sbcharsetprober.py
  139. +69 −0 requests/packages/chardet/sbcsgroupprober.py
  140. +91 −0 requests/packages/chardet/sjisprober.py
  141. +170 −0 requests/packages/chardet/universaldetector.py
  142. +76 −0 requests/packages/chardet/utf8prober.py
  143. +58 −0 requests/packages/urllib3/__init__.py
  144. +103 −0 requests/packages/urllib3/_collections.py
  145. +107 −0 requests/packages/urllib3/connection.py
  146. +681 −0 requests/packages/urllib3/connectionpool.py
  147. 0 requests/packages/urllib3/contrib/__init__.py
  148. +120 −0 requests/packages/urllib3/contrib/ntlmpool.py
  149. +346 −0 requests/packages/urllib3/contrib/pyopenssl.py
  150. +121 −0 requests/packages/urllib3/exceptions.py
  151. +177 −0 requests/packages/urllib3/fields.py
  152. +101 −0 requests/packages/urllib3/filepost.py
  153. +4 −0 requests/packages/urllib3/packages/__init__.py
  154. +260 −0 requests/packages/urllib3/packages/ordered_dict.py
  155. +385 −0 requests/packages/urllib3/packages/six.py
  156. +13 −0 requests/packages/urllib3/packages/ssl_match_hostname/__init__.py
  157. +105 −0 requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py
  158. +258 −0 requests/packages/urllib3/poolmanager.py
  159. +142 −0 requests/packages/urllib3/request.py
  160. +312 −0 requests/packages/urllib3/response.py
  161. +643 −0 requests/packages/urllib3/util.py
  162. +553 −0 requests/sessions.py
  163. +88 −0 requests/status_codes.py
  164. +128 −0 requests/structures.py
  165. +643 −0 requests/utils.py
  166. +154 −0 werkzeug/__init__.py
  167. +202 −0 werkzeug/_compat.py
  168. +412 −0 werkzeug/_internal.py
  169. +16 −0 werkzeug/contrib/__init__.py
  170. +347 −0 werkzeug/contrib/atom.py
  171. +702 −0 werkzeug/contrib/cache.py
  172. +244 −0 werkzeug/contrib/fixers.py
  173. +349 −0 werkzeug/contrib/iterio.py
  174. +262 −0 werkzeug/contrib/jsrouting.py
  175. +40 −0 werkzeug/contrib/limiter.py
  176. +334 −0 werkzeug/contrib/lint.py
  177. +142 −0 werkzeug/contrib/profiler.py
  178. +321 −0 werkzeug/contrib/securecookie.py
  179. +348 −0 werkzeug/contrib/sessions.py
  180. +71 −0 werkzeug/contrib/testtools.py
  181. +278 −0 werkzeug/contrib/wrappers.py
  182. +2,631 −0 werkzeug/datastructures.py
  183. +185 −0 werkzeug/debug/__init__.py
  184. +211 −0 werkzeug/debug/console.py
  185. +280 −0 werkzeug/debug/repr.py
  186. +96 −0 werkzeug/debug/shared/FONT_LICENSE
  187. BIN werkzeug/debug/shared/console.png
  188. +201 −0 werkzeug/debug/shared/debugger.js
  189. +167 −0 werkzeug/debug/shared/jquery.js
  190. BIN werkzeug/debug/shared/less.png
  191. BIN werkzeug/debug/shared/more.png
  192. BIN werkzeug/debug/shared/source.png
  193. +113 −0 werkzeug/debug/shared/style.css
  194. BIN werkzeug/debug/shared/ubuntu.ttf
  195. +508 −0 werkzeug/debug/tbtools.py
  196. +612 −0 werkzeug/exceptions.py
  197. +523 −0 werkzeug/formparser.py
  198. +980 −0 werkzeug/http.py
  199. +409 −0 werkzeug/local.py
  200. +105 −0 werkzeug/posixemulation.py
  201. +1,653 −0 werkzeug/routing.py
  202. +316 −0 werkzeug/script.py
  203. +264 −0 werkzeug/security.py
  204. +750 −0 werkzeug/serving.py
  205. +880 −0 werkzeug/test.py
  206. +230 −0 werkzeug/testapp.py
  207. +267 −0 werkzeug/testsuite/__init__.py
  208. +40 −0 werkzeug/testsuite/compat.py
  209. +19 −0 werkzeug/testsuite/contrib/__init__.py
  210. +199 −0 werkzeug/testsuite/contrib/cache.py
  211. +193 −0 werkzeug/testsuite/contrib/fixers.py
  212. +191 −0 werkzeug/testsuite/contrib/iterio.py
  213. +64 −0 werkzeug/testsuite/contrib/securecookie.py
  214. +91 −0 werkzeug/testsuite/contrib/sessions.py
  215. +97 −0 werkzeug/testsuite/contrib/wrappers.py
  216. +830 −0 werkzeug/testsuite/datastructures.py
  217. +172 −0 werkzeug/testsuite/debug.py
  218. +87 −0 werkzeug/testsuite/exceptions.py
  219. +411 −0 werkzeug/testsuite/formparser.py
  220. +449 −0 werkzeug/testsuite/http.py
  221. +81 −0 werkzeug/testsuite/internal.py
  222. +159 −0 werkzeug/testsuite/local.py
  223. +57 −0 werkzeug/testsuite/multipart/collect.py
  224. BIN werkzeug/testsuite/multipart/firefox3-2png1txt/file1.png
  225. BIN werkzeug/testsuite/multipart/firefox3-2png1txt/file2.png
  226. BIN werkzeug/testsuite/multipart/firefox3-2png1txt/request.txt
  227. +1 −0 werkzeug/testsuite/multipart/firefox3-2png1txt/text.txt
  228. BIN werkzeug/testsuite/multipart/firefox3-2pnglongtext/file1.png
  229. BIN werkzeug/testsuite/multipart/firefox3-2pnglongtext/file2.png
  230. BIN werkzeug/testsuite/multipart/firefox3-2pnglongtext/request.txt
  231. +3 −0 werkzeug/testsuite/multipart/firefox3-2pnglongtext/text.txt
  232. BIN werkzeug/testsuite/multipart/ie6-2png1txt/file1.png
  233. BIN werkzeug/testsuite/multipart/ie6-2png1txt/file2.png
  234. BIN werkzeug/testsuite/multipart/ie6-2png1txt/request.txt
  235. +1 −0 werkzeug/testsuite/multipart/ie6-2png1txt/text.txt
  236. BIN werkzeug/testsuite/multipart/ie7_full_path_request.txt
  237. BIN werkzeug/testsuite/multipart/opera8-2png1txt/file1.png
  238. BIN werkzeug/testsuite/multipart/opera8-2png1txt/file2.png
  239. BIN werkzeug/testsuite/multipart/opera8-2png1txt/request.txt
  240. +1 −0 werkzeug/testsuite/multipart/opera8-2png1txt/text.txt
  241. BIN werkzeug/testsuite/multipart/webkit3-2png1txt/file1.png
  242. BIN werkzeug/testsuite/multipart/webkit3-2png1txt/file2.png
  243. BIN werkzeug/testsuite/multipart/webkit3-2png1txt/request.txt
  244. +1 −0 werkzeug/testsuite/multipart/webkit3-2png1txt/text.txt
  245. +1 −0 werkzeug/testsuite/res/test.txt
  246. +698 −0 werkzeug/testsuite/routing.py
  247. +105 −0 werkzeug/testsuite/security.py
  248. +142 −0 werkzeug/testsuite/serving.py
  249. +444 −0 werkzeug/testsuite/test.py
  250. +322 −0 werkzeug/testsuite/urls.py
  251. +283 −0 werkzeug/testsuite/utils.py
  252. +845 −0 werkzeug/testsuite/wrappers.py
  253. +352 −0 werkzeug/testsuite/wsgi.py
  254. +916 −0 werkzeug/urls.py
  255. +192 −0 werkzeug/useragents.py
  256. +613 −0 werkzeug/utils.py
  257. +1,808 −0 werkzeug/wrappers.py
  258. +1,047 −0 werkzeug/wsgi.py
View
@@ -0,0 +1,85 @@
+# -*- coding: utf-8 -*-
+"""
+ click
+ ~~~~~
+
+ Click is a simple Python module that wraps the stdlib's optparse to make
+ writing command line scripts fun. Unlike other modules, it's based around
+ a simple API that does not come with too much magic and is composable.
+
+ In case optparse ever gets removed from the stdlib, it will be shipped by
+ this module.
+
+ :copyright: (c) 2014 by Armin Ronacher.
+ :license: BSD, see LICENSE for more details.
+"""
+
+# Core classes
+from .core import Context, BaseCommand, Command, MultiCommand, Group, \
+ CommandCollection, Parameter, Option, Argument
+
+# Decorators
+from .decorators import pass_context, pass_obj, make_pass_decorator, \
+ command, group, argument, option, confirmation_option, \
+ password_option, version_option, help_option
+
+# Types
+from .types import ParamType, File, Path, Choice, IntRange, STRING, INT, \
+ FLOAT, BOOL, UUID
+
+# Utilities
+from .utils import echo, get_binary_stream, get_text_stream, open_file, \
+ format_filename, get_app_dir
+
+# Terminal functions
+from .termui import prompt, confirm, get_terminal_size, echo_via_pager, \
+ progressbar, clear, style, unstyle, secho, edit, launch, getchar, \
+ pause
+
+# Exceptions
+from .exceptions import ClickException, UsageError, BadParameter, \
+ FileError, Abort
+
+# Formatting
+from .formatting import HelpFormatter, wrap_text
+
+# Parsing
+from .parser import OptionParser
+
+
+__all__ = [
+ # Core classes
+ 'Context', 'BaseCommand', 'Command', 'MultiCommand', 'Group',
+ 'CommandCollection', 'Parameter', 'Option', 'Argument',
+
+ # Decorators
+ 'pass_context', 'pass_obj', 'make_pass_decorator', 'command', 'group',
+ 'argument', 'option', 'confirmation_option', 'password_option',
+ 'version_option', 'help_option',
+
+ # Types
+ 'ParamType', 'File', 'Path', 'Choice', 'IntRange', 'STRING', 'INT',
+ 'FLOAT', 'BOOL', 'UUID',
+
+ # Utilities
+ 'echo', 'get_binary_stream', 'get_text_stream', 'open_file',
+ 'format_filename', 'get_app_dir',
+
+ # Terminal functions
+ 'prompt', 'confirm', 'get_terminal_size', 'echo_via_pager',
+ 'progressbar', 'clear', 'style', 'unstyle', 'secho', 'edit', 'launch',
+ 'getchar', 'pause',
+
+ # Exceptions
+ 'ClickException', 'UsageError', 'BadParameter', 'FileError',
+ 'Abort',
+
+ # Formatting
+ 'HelpFormatter', 'wrap_text',
+
+ # Parsing
+ 'OptionParser',
+]
+
+
+__version__ = '3.3'
@@ -0,0 +1,74 @@
+import os
+from .utils import echo
+from .parser import split_arg_string
+from .core import MultiCommand, Option
+
+
+COMPLETION_SCRIPT = '''
+%(complete_func)s() {
+ COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\
+ COMP_CWORD=$COMP_CWORD \\
+ %(autocomplete_var)s=complete $1 ) )
+ return 0
+}
+
+complete -F %(complete_func)s -o default %(script_names)s
+'''
+
+
+def get_completion_script(prog_name, complete_var):
+ return (COMPLETION_SCRIPT % {
+ 'complete_func': '_%s_completion' % prog_name,
+ 'script_names': prog_name,
+ 'autocomplete_var': complete_var,
+ }).strip() + ';'
+
+
+def resolve_ctx(cli, prog_name, args):
+ ctx = cli.make_context(prog_name, args, resilient_parsing=True)
+ while ctx.args and isinstance(ctx.command, MultiCommand):
+ cmd = ctx.command.get_command(ctx, ctx.args[0])
+ if cmd is None:
+ return None
+ ctx = cmd.make_context(ctx.args[0], ctx.args[1:], parent=ctx,
+ resilient_parsing=True)
+ return ctx
+
+
+def do_complete(cli, prog_name):
+ cwords = split_arg_string(os.environ['COMP_WORDS'])
+ cword = int(os.environ['COMP_CWORD'])
+ args = cwords[1:cword]
+ try:
+ incomplete = cwords[cword]
+ except IndexError:
+ incomplete = ''
+
+ ctx = resolve_ctx(cli, prog_name, args)
+ if ctx is None:
+ return True
+
+ choices = []
+ if incomplete and not incomplete[:1].isalnum():
+ for param in ctx.command.params:
+ if not isinstance(param, Option):
+ continue
+ choices.extend(param.opts)
+ choices.extend(param.secondary_opts)
+ elif isinstance(ctx.command, MultiCommand):
+ choices.extend(ctx.command.list_commands(ctx))
+
+ for item in choices:
+ if item.startswith(incomplete):
+ echo(item)
+
+ return True
+
+
+def bashcomplete(cli, prog_name, complete_var, complete_instr):
+ if complete_instr == 'source':
+ echo(get_completion_script(prog_name, complete_var))
+ return True
+ elif complete_instr == 'complete':
+ return do_complete(cli, prog_name)
+ return False
Oops, something went wrong.

0 comments on commit 96f511a

Please sign in to comment.