Big diff: use lower-case list and dict (#5888)

This commit is contained in:
Akuli
2021-08-08 19:26:35 +03:00
committed by GitHub
parent 11f54c3407
commit ce11072dbe
325 changed files with 2196 additions and 2334 deletions

View File

@@ -1,5 +1,5 @@
import textwrap
from typing import IO, Any, Callable, Dict, Generic, List, Text, Tuple, Type, TypeVar, overload
from typing import IO, Any, Callable, Generic, List, Text, Tuple, Type, TypeVar, overload
from typing_extensions import SupportsIndex
_TB = TypeVar("_TB", bound="_BaseEntry")
@@ -29,7 +29,7 @@ class _BaseFile(List[_TB]):
encoding: Text
check_for_duplicates: bool
header: Text
metadata: Dict[Text, Text]
metadata: dict[Text, Text]
metadata_is_fuzzy: bool
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def __unicode__(self) -> Text: ...
@@ -47,10 +47,10 @@ class POFile(_BaseFile[POEntry]):
def __unicode__(self) -> Text: ...
def save_as_mofile(self, fpath: Text) -> None: ...
def percent_translated(self) -> int: ...
def translated_entries(self) -> List[POEntry]: ...
def untranslated_entries(self) -> List[POEntry]: ...
def fuzzy_entries(self) -> List[POEntry]: ...
def obsolete_entries(self) -> List[POEntry]: ...
def translated_entries(self) -> list[POEntry]: ...
def untranslated_entries(self) -> list[POEntry]: ...
def fuzzy_entries(self) -> list[POEntry]: ...
def obsolete_entries(self) -> list[POEntry]: ...
def merge(self, refpot: POFile) -> None: ...
class MOFile(_BaseFile[MOEntry]):
@@ -62,16 +62,16 @@ class MOFile(_BaseFile[MOEntry]):
def save_as_pofile(self, fpath: str) -> None: ...
def save(self, fpath: Text | None = ...) -> None: ... # type: ignore # binary file does not allow argument repr_method
def percent_translated(self) -> int: ...
def translated_entries(self) -> List[MOEntry]: ...
def untranslated_entries(self) -> List[MOEntry]: ...
def fuzzy_entries(self) -> List[MOEntry]: ...
def obsolete_entries(self) -> List[MOEntry]: ...
def translated_entries(self) -> list[MOEntry]: ...
def untranslated_entries(self) -> list[MOEntry]: ...
def fuzzy_entries(self) -> list[MOEntry]: ...
def obsolete_entries(self) -> list[MOEntry]: ...
class _BaseEntry(object):
msgid: Text
msgstr: Text
msgid_plural: Text
msgstr_plural: List[Text]
msgstr_plural: list[Text]
msgctxt: Text
obsolete: bool
encoding: str
@@ -82,8 +82,8 @@ class _BaseEntry(object):
class POEntry(_BaseEntry):
comment: Text
tcomment: Text
occurrences: List[Tuple[str, int]]
flags: List[Text]
occurrences: list[Tuple[str, int]]
flags: list[Text]
previous_msgctxt: Text | None
previous_msgid: Text | None
previous_msgid_plural: Text | None
@@ -108,8 +108,8 @@ class POEntry(_BaseEntry):
class MOEntry(_BaseEntry):
comment: Text
tcomment: Text
occurrences: List[Tuple[str, int]]
flags: List[Text]
occurrences: list[Tuple[str, int]]
flags: list[Text]
previous_msgctxt: Text | None
previous_msgid: Text | None
previous_msgid_plural: Text | None
@@ -119,7 +119,7 @@ class MOEntry(_BaseEntry):
class _POFileParser(Generic[_TP]):
fhandle: IO[Text]
instance: _TP
transitions: Dict[Tuple[str, str], Tuple[Callable[[], bool], str]]
transitions: dict[Tuple[str, str], Tuple[Callable[[], bool], str]]
current_line: int
current_entry: POEntry
current_state: str
@@ -128,7 +128,7 @@ class _POFileParser(Generic[_TP]):
entry_obsolete: int
def __init__(self, pofile: Text, *args: Any, **kwargs: Any) -> None: ...
def parse(self) -> _TP: ...
def add(self, symbol: str, states: List[str], next_state: str) -> None: ...
def add(self, symbol: str, states: list[str], next_state: str) -> None: ...
def process(self, symbol: str) -> None: ...
def handle_he(self) -> bool: ...
def handle_tc(self) -> bool: ...