__init__.py 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # -*- coding: utf-8 -*-
  2. """
  3. click
  4. ~~~~~
  5. Click is a simple Python module that wraps the stdlib's optparse to make
  6. writing command line scripts fun. Unlike other modules, it's based around
  7. a simple API that does not come with too much magic and is composable.
  8. In case optparse ever gets removed from the stdlib, it will be shipped by
  9. this module.
  10. :copyright: (c) 2014 by Armin Ronacher.
  11. :license: BSD, see LICENSE for more details.
  12. """
  13. # Core classes
  14. from .core import Context, BaseCommand, Command, MultiCommand, Group, \
  15. CommandCollection, Parameter, Option, Argument
  16. # Globals
  17. from .globals import get_current_context
  18. # Decorators
  19. from .decorators import pass_context, pass_obj, make_pass_decorator, \
  20. command, group, argument, option, confirmation_option, \
  21. password_option, version_option, help_option
  22. # Types
  23. from .types import ParamType, File, Path, Choice, IntRange, Tuple, \
  24. STRING, INT, FLOAT, BOOL, UUID, UNPROCESSED
  25. # Utilities
  26. from .utils import echo, get_binary_stream, get_text_stream, open_file, \
  27. format_filename, get_app_dir, get_os_args
  28. # Terminal functions
  29. from .termui import prompt, confirm, get_terminal_size, echo_via_pager, \
  30. progressbar, clear, style, unstyle, secho, edit, launch, getchar, \
  31. pause
  32. # Exceptions
  33. from .exceptions import ClickException, UsageError, BadParameter, \
  34. FileError, Abort, NoSuchOption, BadOptionUsage, BadArgumentUsage, \
  35. MissingParameter
  36. # Formatting
  37. from .formatting import HelpFormatter, wrap_text
  38. # Parsing
  39. from .parser import OptionParser
  40. __all__ = [
  41. # Core classes
  42. 'Context', 'BaseCommand', 'Command', 'MultiCommand', 'Group',
  43. 'CommandCollection', 'Parameter', 'Option', 'Argument',
  44. # Globals
  45. 'get_current_context',
  46. # Decorators
  47. 'pass_context', 'pass_obj', 'make_pass_decorator', 'command', 'group',
  48. 'argument', 'option', 'confirmation_option', 'password_option',
  49. 'version_option', 'help_option',
  50. # Types
  51. 'ParamType', 'File', 'Path', 'Choice', 'IntRange', 'Tuple', 'STRING',
  52. 'INT', 'FLOAT', 'BOOL', 'UUID', 'UNPROCESSED',
  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__ = '6.7'