Improve languages dirs for docutils (#14124)

This commit is contained in:
Semyon Moroz
2025-05-22 10:45:13 +00:00
committed by GitHub
parent 0e3395333c
commit d174329978
61 changed files with 346 additions and 4 deletions
@@ -3,7 +3,6 @@ docutils.frontend.ConfigParser.read
docutils.frontend.OptionParser.__getattr__
docutils.io.FileOutput.__getattr__
docutils.io.FileOutput.__init__
docutils.languages.LanguageImporter.__getattr__
docutils.nodes.Element.__iter__ # doesn't exist at runtime, but the class is iterable due to __getitem__
docutils.nodes.Element.tagname # class variable is overridden in __init__ method
docutils.nodes.GenericNodeVisitor.__getattr__
+11 -3
View File
@@ -1,15 +1,23 @@
from _typeshed import Incomplete
from typing import Protocol
from typing import ClassVar, Final, Protocol, type_check_only
from docutils.utils import Reporter
__docformat__: Final = "reStructuredText"
@type_check_only
class _LanguageModule(Protocol):
labels: dict[str, str]
author_separators: list[str]
bibliographic_fields: list[str]
class LanguageImporter:
packages: ClassVar[tuple[str, ...]]
warn_msg: ClassVar[str]
fallback: ClassVar[str]
cache: dict[str, _LanguageModule]
def __init__(self) -> None: ...
def import_from_packages(self, name: str, reporter: Reporter | None = None): ...
def check_content(self, module: _LanguageModule) -> None: ...
def __call__(self, language_code: str, reporter: Reporter | None = None) -> _LanguageModule: ...
def __getattr__(self, name: str, /) -> Incomplete: ...
get_language: LanguageImporter
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal["؛", "،"]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from _typeshed import Incomplete
__docformat__: str
labels: Incomplete
bibliographic_fields: Incomplete
author_separators: Incomplete
+6
View File
@@ -0,0 +1,6 @@
from _typeshed import Incomplete
__docformat__: str
labels: Incomplete
bibliographic_fields: Incomplete
author_separators: Incomplete
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal["؛", "،"]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
+6
View File
@@ -0,0 +1,6 @@
from typing import Final, Literal
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
@@ -0,0 +1,6 @@
from typing import Final
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[str]
@@ -0,0 +1,6 @@
from typing import Final
__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[str]
@@ -0,0 +1,16 @@
from typing import ClassVar, Final, Protocol, type_check_only
from docutils.languages import LanguageImporter
__docformat__: Final = "reStructuredText"
@type_check_only
class _RstLanguageModule(Protocol):
directives: dict[str, str]
roles: dict[str, str]
class RstLanguageImporter(LanguageImporter):
fallback: ClassVar[None] # type: ignore[assignment]
def check_content(self, module: _RstLanguageModule) -> None: ... # type: ignore[override]
get_language: RstLanguageImporter
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
@@ -0,0 +1,5 @@
from typing import Final
__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]