gettext: various fixes (#4125)

This commit is contained in:
Shantanu
2020-05-27 21:26:58 -07:00
committed by GitHub
parent 22fd5e916a
commit c3c6abc153
5 changed files with 18 additions and 41 deletions

View File

@@ -1,5 +1,5 @@
import sys
from typing import overload, Any, Container, IO, Iterable, Optional, Type, TypeVar, Union
from typing import overload, Any, Container, IO, Iterable, Optional, Sequence, Type, TypeVar, Union
if sys.version_info >= (3, 8):
from typing import Literal
@@ -13,15 +13,16 @@ else:
_Path = str
class NullTranslations:
def __init__(self, fp: IO[str] = ...) -> None: ...
def __init__(self, fp: Optional[IO[str]] = ...) -> None: ...
def _parse(self, fp: IO[str]) -> None: ...
def add_fallback(self, fallback: NullTranslations) -> None: ...
def gettext(self, message: str) -> str: ...
def lgettext(self, message: str) -> str: ...
def ngettext(self, singular: str, plural: str, n: int) -> str: ...
def lngettext(self, singular: str, plural: str, n: int) -> str: ...
def pgettext(self, context: str, message: str) -> str: ...
def npgettext(self, context: str, msgid1: str, msgid2: str, n: int) -> str: ...
def ngettext(self, msgid1: str, msgid2: str, n: int) -> str: ...
def lngettext(self, msgid1: str, msgid2: str, n: int) -> str: ...
if sys.version_info >= (3, 8):
def pgettext(self, context: str, message: str) -> str: ...
def npgettext(self, context: str, msgid1: str, msgid2: str, n: int) -> str: ...
def info(self) -> Any: ...
def charset(self) -> Any: ...
def output_charset(self) -> Any: ...
@@ -31,6 +32,8 @@ class NullTranslations:
class GNUTranslations(NullTranslations):
LE_MAGIC: int
BE_MAGIC: int
CONTEXT: str
VERSIONS: Sequence[int]
def find(domain: str, localedir: Optional[_Path] = ..., languages: Optional[Iterable[str]] = ...,
all: bool = ...) -> Any: ...
@@ -54,15 +57,16 @@ def bindtextdomain(domain: str, localedir: Optional[_Path] = ...) -> str: ...
def bind_textdomain_codeset(domain: str, codeset: Optional[str] = ...) -> str: ...
def dgettext(domain: str, message: str) -> str: ...
def ldgettext(domain: str, message: str) -> str: ...
def dngettext(domain: str, singular: str, plural: str, n: int) -> str: ...
def ldngettext(domain: str, singular: str, plural: str, n: int) -> str: ...
def dngettext(domain: str, msgid1: str, msgid2: str, n: int) -> str: ...
def ldngettext(domain: str, msgid1: str, msgid2: str, n: int) -> str: ...
def gettext(message: str) -> str: ...
def lgettext(message: str) -> str: ...
def ngettext(singular: str, plural: str, n: int) -> str: ...
def lngettext(singular: str, plural: str, n: int) -> str: ...
def pgettext(context: str, message: str) -> str: ...
def dpgettext(domain: str, context: str, message: str) -> str: ...
def npgettext(context: str, msgid1: str, msgid2: str, n: int) -> str: ...
def dnpgettext(domain: str, context: str, msgid1: str, msgid2: str, n: int) -> str: ...
def ngettext(msgid1: str, msgid2: str, n: int) -> str: ...
def lngettext(msgid1: str, msgid2: str, n: int) -> str: ...
if sys.version_info >= (3, 8):
def pgettext(context: str, message: str) -> str: ...
def dpgettext(domain: str, context: str, message: str) -> str: ...
def npgettext(context: str, msgid1: str, msgid2: str, n: int) -> str: ...
def dnpgettext(domain: str, context: str, msgid1: str, msgid2: str, n: int) -> str: ...
Catalog = translation

View File

@@ -22,12 +22,6 @@ collections.UserString.maketrans
contextlib._GeneratorContextManager.__init__
ctypes.CDLL.__init__
fractions.Fraction.__new__ # private _normalize param was made keyword-only in Python 3.6
gettext.NullTranslations.npgettext
gettext.NullTranslations.pgettext
gettext.dnpgettext
gettext.dpgettext
gettext.npgettext
gettext.pgettext
importlib.metadata
importlib.resources
io.BufferedRandom.read1

View File

@@ -20,12 +20,6 @@ copy.PyStringMap
ctypes.CDLL.__init__
email.message.MIMEPart.as_string
enum.Enum._generate_next_value_
gettext.NullTranslations.npgettext
gettext.NullTranslations.pgettext
gettext.dnpgettext
gettext.dpgettext
gettext.npgettext
gettext.pgettext
importlib.metadata
importlib.resources
io.BufferedRandom.read1

View File

@@ -31,12 +31,6 @@ dataclasses.Field.__init__
dataclasses.field
email.message.MIMEPart.as_string
enum.Enum._generate_next_value_
gettext.NullTranslations.npgettext
gettext.NullTranslations.pgettext
gettext.dnpgettext
gettext.dpgettext
gettext.npgettext
gettext.pgettext
http.client.HTTPSConnection.__init__
http.server.SimpleHTTPRequestHandler.__init__
importlib.metadata

View File

@@ -210,15 +210,6 @@ encodings.utf_8.encode
enum.EnumMeta.__call__
enum.EnumMeta.__new__
getopt.GetoptError.__init__
gettext.GNUTranslations.lngettext
gettext.GNUTranslations.ngettext
gettext.NullTranslations.__init__
gettext.NullTranslations.lngettext
gettext.NullTranslations.ngettext
gettext.dngettext
gettext.ldngettext
gettext.lngettext
gettext.ngettext
hmac.HMAC.__init__
html.parser.HTMLParser.feed
http.HTTPStatus.description