Skip to content

Commit 5145a11

Browse files
author
Lukasz Langa
committed
Complete stubs for Click 6.6 on Python 3.
Put under 3.6 as they use the wonderful PEP 526 syntax for annotating class/instance members.
1 parent ab4ad3f commit 5145a11

File tree

11 files changed

+1609
-0
lines changed

11 files changed

+1609
-0
lines changed

third_party/3.6/click/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# click 6.6, Python 3
2+
3+
`__init__.pyi` is literally a copy of click/__init__.py. It's a shortcut module
4+
anyway in the actual sources so it works well without additional changes.
5+
6+
The types are pretty complete but they were created mostly for public API use
7+
so some internal modules (`_compat`) or functions (`core._bashcomplete`) are
8+
deliberately missing. If you feel the need to add those, pull requests accepted.
9+
10+
Speaking of pull requests, it would be great if the option decorators informed
11+
the type checker on what types the command callback should accept.

third_party/3.6/click/__init__.pyi

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
click
4+
~~~~~
5+
6+
Click is a simple Python module that wraps the stdlib's optparse to make
7+
writing command line scripts fun. Unlike other modules, it's based around
8+
a simple API that does not come with too much magic and is composable.
9+
10+
In case optparse ever gets removed from the stdlib, it will be shipped by
11+
this module.
12+
13+
:copyright: (c) 2014 by Armin Ronacher.
14+
:license: BSD, see LICENSE for more details.
15+
"""
16+
17+
# Core classes
18+
from .core import Context, BaseCommand, Command, MultiCommand, Group, \
19+
CommandCollection, Parameter, Option, Argument
20+
21+
# Globals
22+
from .globals import get_current_context
23+
24+
# Decorators
25+
from .decorators import pass_context, pass_obj, make_pass_decorator, \
26+
command, group, argument, option, confirmation_option, \
27+
password_option, version_option, help_option
28+
29+
# Types
30+
from .types import ParamType, File, Path, Choice, IntRange, Tuple, \
31+
STRING, INT, FLOAT, BOOL, UUID, UNPROCESSED
32+
33+
# Utilities
34+
from .utils import echo, get_binary_stream, get_text_stream, open_file, \
35+
format_filename, get_app_dir, get_os_args
36+
37+
# Terminal functions
38+
from .termui import prompt, confirm, get_terminal_size, echo_via_pager, \
39+
progressbar, clear, style, unstyle, secho, edit, launch, getchar, \
40+
pause
41+
42+
# Exceptions
43+
from .exceptions import ClickException, UsageError, BadParameter, \
44+
FileError, Abort, NoSuchOption, BadOptionUsage, BadArgumentUsage, \
45+
MissingParameter
46+
47+
# Formatting
48+
from .formatting import HelpFormatter, wrap_text
49+
50+
# Parsing
51+
from .parser import OptionParser
52+
53+
54+
__all__ = [
55+
# Core classes
56+
'Context', 'BaseCommand', 'Command', 'MultiCommand', 'Group',
57+
'CommandCollection', 'Parameter', 'Option', 'Argument',
58+
59+
# Globals
60+
'get_current_context',
61+
62+
# Decorators
63+
'pass_context', 'pass_obj', 'make_pass_decorator', 'command', 'group',
64+
'argument', 'option', 'confirmation_option', 'password_option',
65+
'version_option', 'help_option',
66+
67+
# Types
68+
'ParamType', 'File', 'Path', 'Choice', 'IntRange', 'Tuple', 'STRING',
69+
'INT', 'FLOAT', 'BOOL', 'UUID', 'UNPROCESSED',
70+
71+
# Utilities
72+
'echo', 'get_binary_stream', 'get_text_stream', 'open_file',
73+
'format_filename', 'get_app_dir', 'get_os_args',
74+
75+
# Terminal functions
76+
'prompt', 'confirm', 'get_terminal_size', 'echo_via_pager',
77+
'progressbar', 'clear', 'style', 'unstyle', 'secho', 'edit', 'launch',
78+
'getchar', 'pause',
79+
80+
# Exceptions
81+
'ClickException', 'UsageError', 'BadParameter', 'FileError',
82+
'Abort', 'NoSuchOption', 'BadOptionUsage', 'BadArgumentUsage',
83+
'MissingParameter',
84+
85+
# Formatting
86+
'HelpFormatter', 'wrap_text',
87+
88+
# Parsing
89+
'OptionParser',
90+
]
91+
92+
93+
# Controls if click should emit the warning about the use of unicode
94+
# literals.
95+
disable_unicode_literals_warning = False
96+
97+
98+
__version__ = '6.6'

0 commit comments

Comments
 (0)