massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / stdlib / 2and3 / optparse.pyi
1 # Generated by pytype, with only minor tweaks. Might be incomplete.\r
2 import sys\r
3 from typing import Any, Callable, Dict, IO, Iterable, List, Mapping, Optional, Sequence, Tuple, Union\r
4 \r
5 # See https://groups.google.com/forum/#!topic/python-ideas/gA1gdj3RZ5g\r
6 if sys.version_info >= (3,):\r
7     _Text = str\r
8 else:\r
9     _Text = Union[str, unicode]\r
10 \r
11 NO_DEFAULT = ...  # type: Tuple[_Text, ...]\r
12 SUPPRESS_HELP = ...  # type: _Text\r
13 SUPPRESS_USAGE = ...  # type: _Text\r
14 \r
15 def check_builtin(option: Option, opt: Any, value: _Text) -> Any: ...\r
16 def check_choice(option: Option, opt: Any, value: _Text) -> Any: ...\r
17 if sys.version_info < (3,):\r
18     def isbasestring(x: Any) -> bool: ...\r
19 \r
20 class OptParseError(Exception):\r
21     msg = ...  # type: _Text\r
22     def __init__(self, msg: _Text) -> None: ...\r
23 \r
24 class BadOptionError(OptParseError):\r
25     opt_str = ...  # type: _Text\r
26     def __init__(self, opt_str: _Text) -> None: ...\r
27 \r
28 class AmbiguousOptionError(BadOptionError):\r
29     possibilities = ...  # type: Iterable[_Text]\r
30     def __init__(self, opt_str: _Text, possibilities: Sequence[_Text]) -> None: ...\r
31 \r
32 class OptionError(OptParseError):\r
33     msg = ...  # type: _Text\r
34     option_id = ...  # type: _Text\r
35     def __init__(self, msg: _Text, option: Option) -> None: ...\r
36 \r
37 class OptionConflictError(OptionError): ...\r
38 \r
39 class OptionValueError(OptParseError): ...\r
40 \r
41 \r
42 class HelpFormatter:\r
43     NO_DEFAULT_VALUE = ...  # type: _Text\r
44     _long_opt_fmt = ...  # type: _Text\r
45     _short_opt_fmt = ...  # type: _Text\r
46     current_indent = ...  # type: int\r
47     default_tag = ...  # type: _Text\r
48     help_position = ...  # type: Any\r
49     help_width = ...  # type: Any\r
50     indent_increment = ...  # type: int\r
51     level = ...  # type: int\r
52     max_help_position = ...  # type: int\r
53     option_strings = ...  # type: Dict[Option, _Text]\r
54     parser = ...  # type: OptionParser\r
55     short_first = ...  # type: Any\r
56     width = ...  # type: int\r
57     def __init__(self, indent_increment: int, max_help_position: int, width: Optional[int], short_first: int) -> None: ...\r
58     def _format__Text(self, _Text: _Text) -> _Text: ...\r
59     def dedent(self) -> None: ...\r
60     def expand_default(self, option: Option) -> _Text: ...\r
61     def format_description(self, description: _Text) -> _Text: ...\r
62     def format_epilog(self, epilog) -> _Text: ...\r
63     def format_heading(self, heading: Any) -> _Text: ...\r
64     def format_option(self, option: OptionParser) -> _Text: ...\r
65     def format_option_strings(self, option: OptionParser) -> Any: ...\r
66     def format_usage(self, usage: Any) -> _Text: ...\r
67     def indent(self) -> None: ...\r
68     def set_long_opt_delimiter(self, delim: _Text) -> None: ...\r
69     def set_parser(self, parser: OptionParser) -> None: ...\r
70     def set_short_opt_delimiter(self, delim: _Text) -> None: ...\r
71     def store_option_strings(self, parser: OptionParser) -> None: ...\r
72 \r
73 class IndentedHelpFormatter(HelpFormatter):\r
74     def __init__(self,\r
75                  indent_increment: int = ...,\r
76                  max_help_position: int = ...,\r
77                  width: Optional[int] = ...,\r
78                  short_first: int = ...) -> None: ...\r
79     def format_heading(self, heading: _Text) -> _Text: ...\r
80     def format_usage(self, usage: _Text) -> _Text: ...\r
81 \r
82 class TitledHelpFormatter(HelpFormatter):\r
83     def __init__(self,\r
84                  indent_increment: int = ...,\r
85                  max_help_position: int = ...,\r
86                  width: Optional[int] = ...,\r
87                  short_first: int = ...) -> None: ...\r
88     def format_heading(self, heading: _Text) -> _Text: ...\r
89     def format_usage(self, usage: _Text) -> _Text: ...\r
90 \r
91 class Option:\r
92     ACTIONS = ...  # type: Tuple[_Text, ...]\r
93     ALWAYS_TYPED_ACTIONS = ...  # type: Tuple[_Text, ...]\r
94     ATTRS = ...  # type: List[_Text]\r
95     CHECK_METHODS = ...  # type: Optional[List[Callable]]\r
96     CONST_ACTIONS = ...  # type: Tuple[_Text, ...]\r
97     STORE_ACTIONS = ...  # type: Tuple[_Text, ...]\r
98     TYPED_ACTIONS = ...  # type: Tuple[_Text, ...]\r
99     TYPES = ...  # type: Tuple[_Text, ...]\r
100     TYPE_CHECKER = ...  # type: Dict[_Text, Callable]\r
101     _long_opts = ...  # type: List[_Text]\r
102     _short_opts = ...  # type: List[_Text]\r
103     action = ...  # type: _Text\r
104     dest = ...  # type: Any\r
105     nargs = ...  # type: int\r
106     type = ...  # type: Any\r
107     def __init__(self, *opts, **attrs) -> None: ...\r
108     def _check_action(self) -> None: ...\r
109     def _check_callback(self) -> None: ...\r
110     def _check_choice(self) -> None: ...\r
111     def _check_const(self) -> None: ...\r
112     def _check_dest(self) -> None: ...\r
113     def _check_nargs(self) -> None: ...\r
114     def _check_opt_strings(self, opts: Optional[_Text]) -> Any: ...\r
115     def _check_type(self) -> None: ...\r
116     def _set_attrs(self, attrs: Dict[_Text, Any]) -> None: ...\r
117     def _set_opt_strings(self, opts: _Text) -> None: ...\r
118     def check_value(self, opt: Any, value: Any) -> Any: ...\r
119     def convert_value(self, opt: Any, value: Any) -> Any: ...\r
120     def get_opt_string(self) -> _Text: ...\r
121     def process(self, opt: Any, value: Any, values: Any, parser: OptionParser) -> int: ...\r
122     def take_action(self, action: _Text, dest: _Text, opt: Any, value: Any, values: Any, parser: OptionParser) -> int: ...\r
123     def takes_value(self) -> bool: ...\r
124 \r
125 make_option = Option\r
126 \r
127 class OptionContainer:\r
128     _long_opt = ...  # type: Dict[_Text, Option]\r
129     _short_opt = ...  # type: Dict[_Text, Option]\r
130     conflict_handler = ...  # type: _Text\r
131     defaults = ...  # type: Dict[_Text, Any]\r
132     description = ...  # type: Any\r
133     option_class = ...  # type: Any\r
134     def __init__(self, option_class: Option, conflict_handler: Any, description: Any) -> None: ...\r
135     def _check_conflict(self, option: Any) -> None: ...\r
136     def _create_option_mappings(self) -> None: ...\r
137     def _share_option_mappings(self, parser: OptionParser) -> None: ...\r
138     def add_option(self, *args, **kwargs) -> Any: ...\r
139     def add_options(self, option_list: Iterable[Option]) -> None: ...\r
140     def destroy(self) -> None: ...\r
141     def format_description(self, formatter: Optional[HelpFormatter]) -> Any: ...\r
142     def format_help(self, formatter: Optional[HelpFormatter]) -> _Text: ...\r
143     def format_option_help(self, formatter: Optional[HelpFormatter]) -> _Text: ...\r
144     def get_description(self) -> Any: ...\r
145     def get_option(self, opt_str: _Text) -> Optional[Option]: ...\r
146     def has_option(self, opt_str: _Text) -> bool: ...\r
147     def remove_option(self, opt_str: _Text) -> None: ...\r
148     def set_conflict_handler(self, handler: Any) -> None: ...\r
149     def set_description(self, description: Any) -> None: ...\r
150 \r
151 class OptionGroup(OptionContainer):\r
152     option_list = ...  # type: List[Option]\r
153     parser = ...  # type: OptionParser\r
154     title = ...  # type: _Text\r
155     def __init__(self, parser: OptionParser, title: _Text, description: Optional[_Text] = ...) -> None: ...\r
156     def _create_option_list(self) -> None: ...\r
157     def set_title(self, title: _Text) -> None: ...\r
158 \r
159 class OptionParser(OptionContainer):\r
160     allow_interspersed_args = ...  # type: bool\r
161     epilog = ...  # type: Any\r
162     formatter = ...  # type: HelpFormatter\r
163     largs = ...  # type: Optional[List[_Text]]\r
164     option_groups = ...  # type: List[OptionParser]\r
165     option_list = ...  # type: List[Any]\r
166     process_default_values = ...  # type: Any\r
167     prog = ...  # type: Any\r
168     rargs = ...  # type: Optional[List[Any]]\r
169     standard_option_list = ...  # type: List\r
170     usage = ...  # type: Optional[_Text]\r
171     values = ...  # type: Any\r
172     version = ...  # type: _Text\r
173     def __init__(self, usage: Optional[_Text] = ...,\r
174                        option_list: Iterable[Option] = ...,\r
175                        option_class: Option = ...,\r
176                        version: Optional[_Text] = ...,\r
177                        conflict_handler: _Text = ...,\r
178                        description: Optional[_Text] = ...,\r
179                        formatter: Optional[HelpFormatter] = ...,\r
180                        add_help_option: bool = ...,\r
181                        prog: Optional[_Text] = ...,\r
182                        epilog: Optional[_Text] = ...) -> None: ...\r
183     def _add_help_option(self) -> None: ...\r
184     def _add_version_option(self) -> None: ...\r
185     def _create_option_list(self) -> None: ...\r
186     def _get_all_options(self) -> List[Any]: ...\r
187     def _get_args(self, args: Iterable) -> List[Any]: ...\r
188     def _init_parsing_state(self) -> None: ...\r
189     def _match_long_opt(self, opt: _Text) -> _Text: ...\r
190     def _populate_option_list(self, option_list: Iterable[Option], add_help: bool = ...) -> None: ...\r
191     def _process_args(self, largs: List, rargs: List, values: Values) -> None: ...\r
192     def _process_long_opt(self, rargs: List, values: Any) -> None: ...\r
193     def _process_short_opts(self, rargs: List, values: Any) -> None: ...\r
194     def add_option_group(self, *args, **kwargs) -> OptionParser: ...\r
195     def check_values(self, values: Any, args) -> Tuple[Any, ...]: ...\r
196     def disable_interspersed_args(self) -> None: ...\r
197     def enable_interspersed_args(self) -> None: ...\r
198     def error(self, msg: _Text) -> None: ...\r
199     def exit(self, status: int = ..., msg: Optional[str] = ...) -> None: ...\r
200     def expand_prog_name(self, s: Optional[_Text]) -> Any: ...\r
201     def format_epilog(self, formatter: HelpFormatter) -> Any: ...\r
202     def format_help(self, formatter: Optional[HelpFormatter] = ...) -> _Text: ...\r
203     def format_option_help(self, formatter: Optional[HelpFormatter] = ...) -> _Text: ...\r
204     def get_default_values(self) -> Values: ...\r
205     def get_option_group(self, opt_str: _Text) -> Any: ...\r
206     def get_prog_name(self) -> _Text: ...\r
207     def get_usage(self) -> _Text: ...\r
208     def get_version(self) -> _Text: ...\r
209     def parse_args(self, args: Optional[Sequence[_Text]] = ..., values: Optional[Values] = ...) -> Tuple[Any, ...]: ...\r
210     def print_usage(self, file: Optional[IO[str]] = ...) -> None: ...\r
211     def print_help(self, file: Optional[IO[str]] = ...) -> None: ...\r
212     def print_version(self, file: Optional[IO[str]] = ...) -> None: ...\r
213     def set_default(self, dest: Any, value: Any) -> None: ...\r
214     def set_defaults(self, **kwargs) -> None: ...\r
215     def set_process_default_values(self, process: Any) -> None: ...\r
216     def set_usage(self, usage: _Text) -> None: ...\r
217 \r
218 \r
219 class Values:\r
220     def __init__(self, defaults: Optional[Mapping[str, Any]] = ...) -> None: ...\r
221     def _update(self, dict: Dict[_Text, Any], mode: Any) -> None: ...\r
222     def _update_careful(self, dict: Dict[_Text, Any]) -> None: ...\r
223     def _update_loose(self, dict: Dict[_Text, Any]) -> None: ...\r
224     def ensure_value(self, attr: Any, value: Any) -> Any: ...\r
225     def read_file(self, filename: _Text, mode: _Text) -> None: ...\r
226     def read_module(self, modname: _Text, mode: _Text) -> None: ...\r
227     def __getattr__(self, name: str) -> Any: ...\r