mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
Add docutils definitions and (incomplete) modules (#5192)
This commit is contained in:
@@ -1,3 +1,42 @@
|
||||
from typing import Any
|
||||
from collections.abc import Sequence
|
||||
from typing import Any, ClassVar, NamedTuple, Optional, Tuple, Union
|
||||
|
||||
def __getattr__(name: str) -> Any: ...
|
||||
__docformat__: str
|
||||
__version__: str
|
||||
|
||||
class _VersionInfo(NamedTuple):
|
||||
major: int
|
||||
minor: int
|
||||
micro: int
|
||||
releaselevel: str
|
||||
serial: int
|
||||
release: bool
|
||||
|
||||
class VersionInfo(_VersionInfo):
|
||||
def __new__(
|
||||
cls, major: int = ..., minor: int = ..., micro: int = ..., releaselevel: str = ..., serial: int = ..., release: bool = ...
|
||||
) -> VersionInfo: ...
|
||||
|
||||
__version_info__: VersionInfo
|
||||
__version_details__: str
|
||||
|
||||
class ApplicationError(Exception): ...
|
||||
class DataError(ApplicationError): ...
|
||||
|
||||
class SettingsSpec:
|
||||
settings_spec: ClassVar[Tuple[Any, ...]]
|
||||
settings_defaults: ClassVar[Optional[dict[Any, Any]]]
|
||||
settings_default_overrides: ClassVar[Optional[dict[Any, Any]]]
|
||||
relative_path_settings: ClassVar[Tuple[Any, ...]]
|
||||
config_section: ClassVar[Optional[str]]
|
||||
config_section_dependencies: ClassVar[Optional[Tuple[str, ...]]]
|
||||
|
||||
class TransformSpec:
|
||||
def get_transforms(self) -> list[Any]: ...
|
||||
default_transforms: ClassVar[Tuple[Any, ...]]
|
||||
unknown_reference_resolvers: ClassVar[list[Any]]
|
||||
|
||||
class Component(SettingsSpec, TransformSpec):
|
||||
component_type: ClassVar[Optional[str]]
|
||||
supported: ClassVar[Tuple[str, ...]]
|
||||
def supports(self, format: str) -> bool: ...
|
||||
|
||||
3
stubs/docutils/docutils/core.pyi
Normal file
3
stubs/docutils/docutils/core.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
from typing import Any
|
||||
|
||||
def __getattr__(name: str) -> Any: ... # incomplete
|
||||
@@ -1,5 +1,3 @@
|
||||
from typing import Any
|
||||
|
||||
html_parts: Any
|
||||
|
||||
def __getattr__(name: str) -> Any: ...
|
||||
def __getattr__(name: str) -> Any: ... # incomplete
|
||||
|
||||
70
stubs/docutils/docutils/frontend.pyi
Normal file
70
stubs/docutils/docutils/frontend.pyi
Normal file
@@ -0,0 +1,70 @@
|
||||
import optparse
|
||||
from configparser import RawConfigParser
|
||||
from typing import Any, ClassVar, Optional, Tuple
|
||||
|
||||
from docutils import SettingsSpec
|
||||
from docutils.utils import DependencyList
|
||||
|
||||
__docformat__: str
|
||||
|
||||
def store_multiple(option, opt, value, parser, *args, **kwargs) -> None: ...
|
||||
def read_config_file(option, opt, value, parser) -> None: ...
|
||||
def validate_encoding(setting, value, option_parser, config_parser: Optional[Any] = ..., config_section: Optional[Any] = ...): ...
|
||||
def validate_encoding_error_handler(
|
||||
setting, value, option_parser, config_parser: Optional[Any] = ..., config_section: Optional[Any] = ...
|
||||
): ...
|
||||
def validate_encoding_and_error_handler(
|
||||
setting, value, option_parser, config_parser: Optional[Any] = ..., config_section: Optional[Any] = ...
|
||||
): ...
|
||||
def validate_boolean(
|
||||
setting, value, option_parser, config_parser: Optional[Any] = ..., config_section: Optional[Any] = ...
|
||||
) -> bool: ...
|
||||
def validate_nonnegative_int(
|
||||
setting, value, option_parser, config_parser: Optional[Any] = ..., config_section: Optional[Any] = ...
|
||||
) -> int: ...
|
||||
def validate_threshold(
|
||||
setting, value, option_parser, config_parser: Optional[Any] = ..., config_section: Optional[Any] = ...
|
||||
) -> int: ...
|
||||
def validate_colon_separated_string_list(
|
||||
setting, value, option_parser, config_parser: Optional[Any] = ..., config_section: Optional[Any] = ...
|
||||
) -> list[str]: ...
|
||||
def validate_comma_separated_list(
|
||||
setting, value, option_parser, config_parser: Optional[Any] = ..., config_section: Optional[Any] = ...
|
||||
) -> list[str]: ...
|
||||
def validate_url_trailing_slash(
|
||||
setting, value, option_parser, config_parser: Optional[Any] = ..., config_section: Optional[Any] = ...
|
||||
) -> str: ...
|
||||
def validate_dependency_file(
|
||||
setting, value, option_parser, config_parser: Optional[Any] = ..., config_section: Optional[Any] = ...
|
||||
) -> DependencyList: ...
|
||||
def validate_strip_class(
|
||||
setting, value, option_parser, config_parser: Optional[Any] = ..., config_section: Optional[Any] = ...
|
||||
): ...
|
||||
def validate_smartquotes_locales(
|
||||
setting, value, option_parser, config_parser: Optional[Any] = ..., config_section: Optional[Any] = ...
|
||||
) -> list[tuple[str, str]]: ...
|
||||
def make_paths_absolute(pathdict, keys, base_path: Optional[Any] = ...) -> None: ...
|
||||
def make_one_path_absolute(base_path, path) -> str: ...
|
||||
def filter_settings_spec(settings_spec, *exclude, **replace) -> Tuple[Any, ...]: ...
|
||||
|
||||
class Values(optparse.Values):
|
||||
def update(self, other_dict, option_parser) -> None: ...
|
||||
def copy(self) -> Values: ...
|
||||
|
||||
class Option(optparse.Option): ...
|
||||
|
||||
class OptionParser(optparse.OptionParser, SettingsSpec):
|
||||
standard_config_files: ClassVar[list[str]]
|
||||
threshold_choices: ClassVar[list[str]]
|
||||
thresholds: ClassVar[dict[str, int]]
|
||||
booleans: ClassVar[dict[str, bool]]
|
||||
default_error_encoding: ClassVar[str]
|
||||
default_error_encoding_error_handler: ClassVar[str]
|
||||
config_section: ClassVar[str]
|
||||
version_template: ClassVar[str]
|
||||
def __getattr__(self, name: str) -> Any: ... # incomplete
|
||||
|
||||
class ConfigParser(RawConfigParser):
|
||||
def __getattr__(self, name: str) -> Any: ... # incomplete
|
||||
|
||||
class ConfigDeprecationWarning(DeprecationWarning): ...
|
||||
67
stubs/docutils/docutils/io.pyi
Normal file
67
stubs/docutils/docutils/io.pyi
Normal file
@@ -0,0 +1,67 @@
|
||||
from _typeshed import OpenBinaryModeReading, OpenBinaryModeWriting, OpenTextModeReading, OpenTextModeWriting
|
||||
from typing import Any, ClassVar, Optional, Union
|
||||
|
||||
from docutils import TransformSpec
|
||||
|
||||
__docformat__: str
|
||||
|
||||
class InputError(IOError): ...
|
||||
class OutputError(IOError): ...
|
||||
|
||||
def check_encoding(stream: Any, encoding: str) -> Optional[bool]: ...
|
||||
|
||||
class Input(TransformSpec):
|
||||
component_type: ClassVar[str]
|
||||
default_source_path: ClassVar[Optional[str]]
|
||||
def read(self) -> Any: ...
|
||||
def __getattr__(self, name: str) -> Any: ... # incomplete
|
||||
|
||||
class Output(TransformSpec):
|
||||
component_type: ClassVar[str]
|
||||
default_destination_path: ClassVar[Optional[str]]
|
||||
def __init__(
|
||||
self,
|
||||
destination: Optional[Any] = ...,
|
||||
destination_path: Optional[Any] = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
error_handler: str = ...,
|
||||
) -> None: ...
|
||||
def write(self, data: str) -> Any: ... # returns bytes or str
|
||||
def encode(self, data: str) -> Any: ... # returns bytes or str
|
||||
|
||||
class FileInput(Input):
|
||||
def __init__(
|
||||
self,
|
||||
source: Optional[Any] = ...,
|
||||
source_path: Optional[Any] = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
error_handler: str = ...,
|
||||
autoclose: bool = ...,
|
||||
mode: Union[OpenTextModeReading, OpenBinaryModeReading] = ...,
|
||||
) -> None: ...
|
||||
def readlines(self) -> list[str]: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
class FileOutput(Output):
|
||||
mode: ClassVar[Union[OpenTextModeWriting, OpenBinaryModeWriting]]
|
||||
def __getattr__(self, name: str) -> Any: ... # incomplete
|
||||
|
||||
class BinaryFileOutput(FileOutput): ...
|
||||
|
||||
class StringInput(Input):
|
||||
default_source_path: ClassVar[str]
|
||||
|
||||
class StringOutput(Output):
|
||||
default_destination_path: ClassVar[str]
|
||||
destination: Union[str, bytes] # only defined after call to write()
|
||||
|
||||
class NullInput(Input):
|
||||
default_source_path: ClassVar[str]
|
||||
def read(self) -> str: ...
|
||||
|
||||
class NullOutput(Output):
|
||||
default_destination_path: ClassVar[str]
|
||||
def write(self, data: object) -> None: ...
|
||||
|
||||
class DocTreeInput(Input):
|
||||
default_source_path: ClassVar[str]
|
||||
3
stubs/docutils/docutils/languages/__init__.pyi
Normal file
3
stubs/docutils/docutils/languages/__init__.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
from typing import Any
|
||||
|
||||
def __getattr__(name: str) -> Any: ... # incomplete
|
||||
@@ -3,4 +3,4 @@ from typing import Any, List
|
||||
class reference:
|
||||
def __init__(self, rawsource: str = ..., text: str = ..., *children: List[Any], **attributes: Any) -> None: ...
|
||||
|
||||
def __getattr__(name: str) -> Any: ...
|
||||
def __getattr__(name: str) -> Any: ... # incomplete
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
from typing import Any
|
||||
from typing import Any, ClassVar, Type
|
||||
|
||||
def __getattr__(name: str) -> Any: ...
|
||||
from docutils import Component
|
||||
|
||||
class Parser(Component):
|
||||
component_type: ClassVar[str]
|
||||
config_section: ClassVar[str]
|
||||
inputstring: Any # defined after call to setup_parse()
|
||||
document: Any # defined after call to setup_parse()
|
||||
def parse(self, inputstring: str, document) -> None: ...
|
||||
def setup_parse(self, inputstring: str, document) -> None: ...
|
||||
def finish_parse(self) -> None: ...
|
||||
|
||||
_parser_aliases: dict[str, str]
|
||||
|
||||
def get_parser_class(parser_name: str) -> Type[Parser]: ...
|
||||
|
||||
6
stubs/docutils/docutils/parsers/null.pyi
Normal file
6
stubs/docutils/docutils/parsers/null.pyi
Normal file
@@ -0,0 +1,6 @@
|
||||
from typing import ClassVar, Tuple
|
||||
|
||||
from docutils import parsers
|
||||
|
||||
class Parser(parsers.Parser):
|
||||
config_section_dependencies: ClassVar[Tuple[str, ...]]
|
||||
3
stubs/docutils/docutils/parsers/recommonmark_wrapper.pyi
Normal file
3
stubs/docutils/docutils/parsers/recommonmark_wrapper.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
from typing import Any
|
||||
|
||||
def __getattr__(name: str) -> Any: ... # incomplete
|
||||
@@ -1,3 +1,21 @@
|
||||
from typing import Any
|
||||
from typing import Any, ClassVar, Optional, Tuple
|
||||
from typing_extensions import Literal
|
||||
|
||||
def __getattr__(name: str) -> Any: ...
|
||||
from docutils import parsers
|
||||
|
||||
class Parser(parsers.Parser):
|
||||
config_section_dependencies: ClassVar[Tuple[str, ...]]
|
||||
initial_state: Literal["Body", "RFC2822Body"]
|
||||
state_classes: Any
|
||||
inliner: Any
|
||||
def __init__(self, rfc2822: bool = ..., inliner: Optional[Any] = ...) -> None: ...
|
||||
|
||||
class DirectiveError(Exception):
|
||||
level: Any
|
||||
msg: str
|
||||
def __init__(self, level: Any, message: str) -> None: ...
|
||||
|
||||
class Directive:
|
||||
def __getattr__(self, name: str) -> Any: ... # incomplete
|
||||
|
||||
def convert_directive_function(directive_fn): ...
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
from typing import Any
|
||||
|
||||
def __getattr__(name: str) -> Any: ...
|
||||
def __getattr__(name: str) -> Any: ... # incomplete
|
||||
|
||||
@@ -3,4 +3,4 @@ from typing import Any
|
||||
class Inliner:
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
def __getattr__(name: str) -> Any: ...
|
||||
def __getattr__(name: str) -> Any: ... # incomplete
|
||||
|
||||
3
stubs/docutils/docutils/readers/__init__.pyi
Normal file
3
stubs/docutils/docutils/readers/__init__.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
from typing import Any
|
||||
|
||||
def __getattr__(name: str) -> Any: ... # incomplete
|
||||
3
stubs/docutils/docutils/readers/doctree.pyi
Normal file
3
stubs/docutils/docutils/readers/doctree.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
from typing import Any
|
||||
|
||||
def __getattr__(name: str) -> Any: ... # incomplete
|
||||
3
stubs/docutils/docutils/readers/pep.pyi
Normal file
3
stubs/docutils/docutils/readers/pep.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
from typing import Any
|
||||
|
||||
def __getattr__(name: str) -> Any: ... # incomplete
|
||||
3
stubs/docutils/docutils/readers/standalone.pyi
Normal file
3
stubs/docutils/docutils/readers/standalone.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
from typing import Any
|
||||
|
||||
def __getattr__(name: str) -> Any: ... # incomplete
|
||||
3
stubs/docutils/docutils/statemachine.pyi
Normal file
3
stubs/docutils/docutils/statemachine.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
from typing import Any
|
||||
|
||||
def __getattr__(name: str) -> Any: ... # incomplete
|
||||
3
stubs/docutils/docutils/transforms/__init__.pyi
Normal file
3
stubs/docutils/docutils/transforms/__init__.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
from typing import Any
|
||||
|
||||
def __getattr__(name: str) -> Any: ... # incomplete
|
||||
14
stubs/docutils/docutils/utils/__init__.pyi
Normal file
14
stubs/docutils/docutils/utils/__init__.pyi
Normal file
@@ -0,0 +1,14 @@
|
||||
from collections.abc import Iterable
|
||||
from typing import Any, Optional
|
||||
|
||||
from docutils.io import FileOutput
|
||||
|
||||
class DependencyList:
|
||||
list: list[str]
|
||||
file: Optional[FileOutput]
|
||||
def __init__(self, output_file: Optional[str] = ..., dependencies: Iterable[str] = ...) -> None: ...
|
||||
def set_output(self, output_file: Optional[str]) -> None: ...
|
||||
def add(self, *filenames: str) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
def __getattr__(name: str) -> Any: ... # incomplete
|
||||
3
stubs/docutils/docutils/writers/__init__.pyi
Normal file
3
stubs/docutils/docutils/writers/__init__.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
from typing import Any
|
||||
|
||||
def __getattr__(name: str) -> Any: ... # incomplete
|
||||
Reference in New Issue
Block a user