__init__.py 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # -*- coding: utf-8 -*-
  2. """
  3. click
  4. ~~~~~
  5. Click is a simple Python module inspired by the stdlib optparse to make
  6. writing command line scripts fun. Unlike other modules, it's based
  7. around a simple API that does not come with too much magic and is
  8. composable.
  9. :copyright: © 2014 by the Pallets team.
  10. :license: BSD, see LICENSE.rst for more details.
  11. """
  12. # Core classes
  13. from .core import Context, BaseCommand, Command, MultiCommand, Group, \
  14. CommandCollection, Parameter, Option, Argument
  15. # Globals
  16. from .globals import get_current_context
  17. # Decorators
  18. from .decorators import pass_context, pass_obj, make_pass_decorator, \
  19. command, group, argument, option, confirmation_option, \
  20. password_option, version_option, help_option
  21. # Types
  22. from .types import ParamType, File, Path, Choice, IntRange, Tuple, \
  23. DateTime, STRING, INT, FLOAT, BOOL, UUID, UNPROCESSED, FloatRange
  24. # Utilities
  25. from .utils import echo, get_binary_stream, get_text_stream, open_file, \
  26. format_filename, get_app_dir, get_os_args
  27. # Terminal functions
  28. from .termui import prompt, confirm, get_terminal_size, echo_via_pager, \
  29. progressbar, clear, style, unstyle, secho, edit, launch, getchar, \
  30. pause
  31. # Exceptions
  32. from .exceptions import ClickException, UsageError, BadParameter, \
  33. FileError, Abort, NoSuchOption, BadOptionUsage, BadArgumentUsage, \
  34. MissingParameter
  35. # Formatting
  36. from .formatting import HelpFormatter, wrap_text
  37. # Parsing
  38. from .parser import OptionParser
  39. __all__ = [
  40. # Core classes
  41. 'Context', 'BaseCommand', 'Command', 'MultiCommand', 'Group',
  42. 'CommandCollection', 'Parameter', 'Option', 'Argument',
  43. # Globals
  44. 'get_current_context',
  45. # Decorators
  46. 'pass_context', 'pass_obj', 'make_pass_decorator', 'command', 'group',
  47. 'argument', 'option', 'confirmation_option', 'password_option',
  48. 'version_option', 'help_option',
  49. # Types
  50. 'ParamType', 'File', 'Path', 'Choice', 'IntRange', 'Tuple',
  51. 'DateTime', 'STRING', 'INT', 'FLOAT', 'BOOL', 'UUID', 'UNPROCESSED',
  52. 'FloatRange',
  53. # Utilities
  54. 'echo', 'get_binary_stream', 'get_text_stream', 'open_file',
  55. 'format_filename', 'get_app_dir', 'get_os_args',
  56. # Terminal functions
  57. 'prompt', 'confirm', 'get_terminal_size', 'echo_via_pager',
  58. 'progressbar', 'clear', 'style', 'unstyle', 'secho', 'edit', 'launch',
  59. 'getchar', 'pause',
  60. # Exceptions
  61. 'ClickException', 'UsageError', 'BadParameter', 'FileError',
  62. 'Abort', 'NoSuchOption', 'BadOptionUsage', 'BadArgumentUsage',
  63. 'MissingParameter',
  64. # Formatting
  65. 'HelpFormatter', 'wrap_text',
  66. # Parsing
  67. 'OptionParser',
  68. ]
  69. # Controls if click should emit the warning about the use of unicode
  70. # literals.
  71. disable_unicode_literals_warning = False
  72. __version__ = '7.0'