massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / logging / config.pyi
1 import sys
2 from _typeshed import StrOrBytesPath, StrPath
3 from collections.abc import Callable
4 from configparser import RawConfigParser
5 from threading import Thread
6 from typing import IO, Any, Pattern, Sequence
7
8 from . import _Level
9
10 if sys.version_info >= (3, 8):
11     from typing import Literal, TypedDict
12 else:
13     from typing_extensions import Literal, TypedDict
14
15 if sys.version_info >= (3, 7):
16     _Path = StrOrBytesPath
17 else:
18     _Path = StrPath
19
20 DEFAULT_LOGGING_CONFIG_PORT: int
21 RESET_ERROR: int  # undocumented
22 IDENTIFIER: Pattern[str]  # undocumented
23
24 class _RootLoggerConfiguration(TypedDict, total=False):
25     level: _Level
26     filters: Sequence[str]
27     handlers: Sequence[str]
28
29 class _LoggerConfiguration(_RootLoggerConfiguration, TypedDict, total=False):
30     propagate: bool
31
32 class _OptionalDictConfigArgs(TypedDict, total=False):
33     # these two can have custom factories (key: `()`) which can have extra keys
34     formatters: dict[str, dict[str, Any]]
35     filters: dict[str, dict[str, Any]]
36     # type checkers would warn about extra keys if this was a TypedDict
37     handlers: dict[str, dict[str, Any]]
38     loggers: dict[str, _LoggerConfiguration]
39     root: _RootLoggerConfiguration | None
40     incremental: bool
41     disable_existing_loggers: bool
42
43 class _DictConfigArgs(_OptionalDictConfigArgs, TypedDict):
44     version: Literal[1]
45
46 def dictConfig(config: _DictConfigArgs) -> None: ...
47
48 if sys.version_info >= (3, 10):
49     def fileConfig(
50         fname: _Path | IO[str] | RawConfigParser,
51         defaults: dict[str, str] | None = ...,
52         disable_existing_loggers: bool = ...,
53         encoding: str | None = ...,
54     ) -> None: ...
55
56 else:
57     def fileConfig(
58         fname: _Path | IO[str] | RawConfigParser, defaults: dict[str, str] | None = ..., disable_existing_loggers: bool = ...
59     ) -> None: ...
60
61 def valid_ident(s: str) -> Literal[True]: ...  # undocumented
62 def listen(port: int = ..., verify: Callable[[bytes], bytes | None] | None = ...) -> Thread: ...
63 def stopListening() -> None: ...