Remove babel stubs (#10524)

This commit is contained in:
Nikita Sobolev
2023-08-01 11:12:33 +03:00
committed by GitHub
parent fe2ebd69af
commit 474ad1c70e
25 changed files with 0 additions and 1283 deletions

View File

@@ -23,7 +23,6 @@
"stdlib/xml/dom/pulldom.pyi",
"stdlib/xml/sax",
"stubs/aws-xray-sdk",
"stubs/babel",
"stubs/bleach",
"stubs/boto",
"stubs/beautifulsoup4",

View File

@@ -1,8 +0,0 @@
version = "2.11.*"
upstream_repository = "https://github.com/python-babel/babel"
requires = ["types-pytz", "types-setuptools"]
obsolete_since = "2.12.1" # Released on 2023-02-28
partial_stub = true
[tool.stubtest]
ignore_missing_stub = true

View File

@@ -1,8 +0,0 @@
from babel.core import (
Locale as Locale,
UnknownLocaleError as UnknownLocaleError,
default_locale as default_locale,
get_locale_identifier as get_locale_identifier,
negotiate_locale as negotiate_locale,
parse_locale as parse_locale,
)

View File

@@ -1,149 +0,0 @@
from collections.abc import Iterable, Mapping
from typing import Any, overload
from typing_extensions import Literal, TypeAlias
from babel.localedata import LocaleDataDict
from babel.plural import PluralRule
class UnknownLocaleError(Exception):
identifier: str
def __init__(self, identifier: str) -> None: ...
class Locale:
language: str
territory: str | None
script: str | None
variant: str | None
def __init__(
self, language: str, territory: str | None = None, script: str | None = None, variant: str | None = None
) -> None: ...
@classmethod
def default(cls, category: str | None = None, aliases: Mapping[str, str] = ...) -> Locale: ...
@classmethod
def negotiate(
cls, preferred: Iterable[str], available: Iterable[str], sep: str = "_", aliases: Mapping[str, str] = ...
) -> Locale | None: ...
@overload
@classmethod
def parse(cls, identifier: None, sep: str = "_", resolve_likely_subtags: bool = True) -> None: ...
@overload
@classmethod
def parse(cls, identifier: str | Locale, sep: str = "_", resolve_likely_subtags: bool = True) -> Locale: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...
def __hash__(self) -> int: ...
def get_display_name(self, locale: Locale | str | None = None) -> str | None: ...
@property
def display_name(self) -> str | None: ...
def get_language_name(self, locale: Locale | str | None = None) -> str | None: ...
@property
def language_name(self) -> str | None: ...
def get_territory_name(self, locale: Locale | str | None = None) -> str | None: ...
@property
def territory_name(self) -> str | None: ...
def get_script_name(self, locale: Locale | str | None = None) -> str | None: ...
@property
def script_name(self) -> str | None: ...
@property
def english_name(self) -> str | None: ...
@property
def languages(self) -> LocaleDataDict: ...
@property
def scripts(self) -> LocaleDataDict: ...
@property
def territories(self) -> LocaleDataDict: ...
@property
def variants(self) -> LocaleDataDict: ...
@property
def currencies(self) -> LocaleDataDict: ...
@property
def currency_symbols(self) -> LocaleDataDict: ...
@property
def number_symbols(self) -> LocaleDataDict: ...
@property
def decimal_formats(self) -> LocaleDataDict: ...
@property
def compact_decimal_formats(self) -> LocaleDataDict: ...
@property
def currency_formats(self) -> LocaleDataDict: ...
@property
def percent_formats(self) -> LocaleDataDict: ...
@property
def scientific_formats(self) -> LocaleDataDict: ...
@property
def periods(self) -> LocaleDataDict: ...
@property
def day_periods(self) -> LocaleDataDict: ...
@property
def day_period_rules(self) -> LocaleDataDict: ...
@property
def days(self) -> LocaleDataDict: ...
@property
def months(self) -> LocaleDataDict: ...
@property
def quarters(self) -> LocaleDataDict: ...
@property
def eras(self) -> LocaleDataDict: ...
@property
def time_zones(self) -> LocaleDataDict: ...
@property
def meta_zones(self) -> LocaleDataDict: ...
@property
def zone_formats(self) -> LocaleDataDict: ...
@property
def first_week_day(self) -> int: ...
@property
def weekend_start(self) -> int: ...
@property
def weekend_end(self) -> int: ...
@property
def min_week_days(self) -> int: ...
@property
def date_formats(self) -> LocaleDataDict: ...
@property
def time_formats(self) -> LocaleDataDict: ...
@property
def datetime_formats(self) -> LocaleDataDict: ...
@property
def datetime_skeletons(self) -> LocaleDataDict: ...
@property
def interval_formats(self) -> LocaleDataDict: ...
@property
def plural_form(self) -> PluralRule: ...
@property
def list_patterns(self) -> LocaleDataDict: ...
@property
def ordinal_form(self) -> PluralRule: ...
@property
def measurement_systems(self) -> LocaleDataDict: ...
@property
def character_order(self) -> str: ...
@property
def text_direction(self) -> str: ...
@property
def unit_display_names(self) -> LocaleDataDict: ...
def default_locale(category: str | None = None, aliases: Mapping[str, str] = ...) -> str | None: ...
def negotiate_locale(
preferred: Iterable[str], available: Iterable[str], sep: str = "_", aliases: Mapping[str, str] = ...
) -> str | None: ...
def parse_locale(identifier: str, sep: str = "_") -> tuple[str, str | None, str | None, str | None]: ...
def get_locale_identifier(tup: tuple[str, str | None, str | None, str | None], sep: str = "_") -> str: ...
def get_global(key: _GLOBAL_KEY) -> Mapping[str, Any]: ...
_GLOBAL_KEY: TypeAlias = Literal[
"all_currencies",
"currency_fractions",
"language_aliases",
"likely_subtags",
"parent_exceptions",
"script_aliases",
"territory_aliases",
"territory_currencies",
"territory_languages",
"territory_zones",
"variant_aliases",
"windows_zone_mapping",
"zone_aliases",
"zone_territories",
]

View File

@@ -1,182 +0,0 @@
from collections.abc import Iterable
from datetime import date, datetime, time, timedelta, tzinfo
from typing import SupportsInt, overload
from typing_extensions import Literal, TypeAlias
from babel.core import Locale
from babel.localedata import LocaleDataDict
from babel.util import LOCALTZ as LOCALTZ, UTC as UTC
from pytz import BaseTzInfo
# The module contents here are organized the same way they are in the API documentation at
# http://babel.pocoo.org/en/latest/api/dates.html
# Date and Time Formatting
_Instant: TypeAlias = date | time | float | None
_PredefinedTimeFormat: TypeAlias = Literal["full", "long", "medium", "short"]
_Context: TypeAlias = Literal["format", "stand-alone"]
def format_datetime(
datetime: _Instant = None,
format: _PredefinedTimeFormat | str = "medium",
tzinfo: tzinfo | None = None,
locale: Locale | str | None = ...,
) -> str: ...
def format_date(
date: date | None = None, format: _PredefinedTimeFormat | str = "medium", locale: Locale | str | None = ...
) -> str: ...
def format_time(
time: time | datetime | float | None = None,
format: _PredefinedTimeFormat | str = "medium",
tzinfo: tzinfo | None = None,
locale: Locale | str | None = ...,
) -> str: ...
def format_timedelta(
delta: timedelta | int,
granularity: Literal["year", "month", "week", "day", "hour", "minute", "second"] = "second",
threshold: float = 0.85,
add_direction: bool = False,
format: Literal["narrow", "short", "medium", "long"] = "long",
locale: Locale | str | None = ...,
) -> str: ...
def format_skeleton(
skeleton: str, datetime: _Instant = None, tzinfo: tzinfo | None = None, fuzzy: bool = True, locale: Locale | str | None = ...
) -> str: ...
def format_interval(
start: _Instant,
end: _Instant,
skeleton: str | None = None,
tzinfo: tzinfo | None = None,
fuzzy: bool = True,
locale: Locale | str | None = ...,
) -> str: ...
# Timezone Functionality
@overload
def get_timezone(zone: str | BaseTzInfo | None = None) -> BaseTzInfo: ...
@overload
def get_timezone(zone: tzinfo) -> tzinfo: ...
def get_timezone_gmt(
datetime: _Instant = None,
width: Literal["long", "short", "iso8601", "iso8601_short"] = "long",
locale: Locale | str | None = ...,
return_z: bool = False,
) -> str: ...
_DtOrTzinfo: TypeAlias = datetime | tzinfo | str | int | time | None
def get_timezone_location(
dt_or_tzinfo: _DtOrTzinfo = None, locale: Locale | str | None = ..., return_city: bool = False
) -> str: ...
def get_timezone_name(
dt_or_tzinfo: _DtOrTzinfo = None,
width: Literal["long", "short"] = "long",
uncommon: bool = False,
locale: Locale | str | None = ...,
zone_variant: Literal["generic", "daylight", "standard"] | None = None,
return_zone: bool = False,
) -> str: ...
# Note: While Babel accepts any tzinfo for the most part, the get_next_timeout_transition()
# function requires a tzinfo that is produced by get_timezone()/pytz AND has DST info.
# The typing here will help you with the first requirement, but will not protect against
# pytz tzinfo's without DST info, like what you get from get_timezone("UTC") for instance.
def get_next_timezone_transition(zone: BaseTzInfo | None = None, dt: _Instant = None) -> TimezoneTransition: ...
class TimezoneTransition:
# This class itself is not included in the documentation, yet it is mentioned by name.
# See https://github.com/python-babel/babel/issues/823
activates: datetime
from_tzinfo: tzinfo
to_tzinfo: tzinfo
reference_date: datetime | None
def __init__(
self, activates: datetime, from_tzinfo: tzinfo, to_tzinfo: tzinfo, reference_date: datetime | None = None
) -> None: ...
@property
def from_tz(self) -> str: ...
@property
def to_tz(self) -> str: ...
@property
def from_offset(self) -> int: ...
@property
def to_offset(self) -> int: ...
# Data Access
def get_period_names(
width: Literal["abbreviated", "narrow", "wide"] = "wide", context: _Context = "stand-alone", locale: Locale | str | None = ...
) -> LocaleDataDict: ...
def get_day_names(
width: Literal["abbreviated", "narrow", "short", "wide"] = "wide",
context: _Context = "format",
locale: Locale | str | None = ...,
) -> LocaleDataDict: ...
def get_month_names(
width: Literal["abbreviated", "narrow", "wide"] = "wide", context: _Context = "format", locale: Locale | str | None = ...
) -> LocaleDataDict: ...
def get_quarter_names(
width: Literal["abbreviated", "narrow", "wide"] = "wide", context: _Context = "format", locale: Locale | str | None = ...
) -> LocaleDataDict: ...
def get_era_names(
width: Literal["abbreviated", "narrow", "wide"] = "wide", locale: Locale | str | None = ...
) -> LocaleDataDict: ...
def get_date_format(format: _PredefinedTimeFormat = "medium", locale: Locale | str | None = ...) -> DateTimePattern: ...
def get_datetime_format(format: _PredefinedTimeFormat = "medium", locale: Locale | str | None = ...) -> DateTimePattern: ...
def get_time_format(format: _PredefinedTimeFormat = "medium", locale: Locale | str | None = ...) -> DateTimePattern: ...
class ParseError(ValueError): ...
# Basic Parsing
def parse_date(string: str, locale: Locale | str | None = ..., format: _PredefinedTimeFormat = "medium") -> date: ...
def parse_time(string: str, locale: Locale | str | None = ..., format: _PredefinedTimeFormat = "medium") -> time: ...
def parse_pattern(pattern: str) -> DateTimePattern: ...
# Undocumented
NO_INHERITANCE_MARKER: str
LC_TIME: str | None
date_ = date
datetime_ = datetime
time_ = time
TIMEDELTA_UNITS: tuple[tuple[str, int], ...]
def get_period_id(
time: _Instant, tzinfo: BaseTzInfo | None = None, type: Literal["selection"] | None = None, locale: Locale | str | None = ...
): ...
class DateTimePattern:
pattern: str
format: DateTimeFormat
def __init__(self, pattern: str, format: DateTimeFormat) -> None: ...
def __mod__(self, other: DateTimeFormat) -> str: ...
def apply(self, datetime: _Instant, locale: Locale | str | None) -> str: ...
class DateTimeFormat:
value: date | time
locale: Locale
def __init__(self, value: date | time, locale: Locale | str) -> None: ...
def __getitem__(self, name: str) -> str: ...
def extract(self, char: str) -> int: ...
def format_era(self, char: str, num: int) -> str: ...
def format_year(self, char: str, num: int) -> str: ...
def format_quarter(self, char: str, num: int) -> str: ...
def format_month(self, char: str, num: int) -> str: ...
def format_week(self, char: str, num: int) -> str: ...
def format_weekday(self, char: str = "E", num: int = 4) -> str: ...
def format_day_of_year(self, num: int) -> str: ...
def format_day_of_week_in_month(self) -> str: ...
def format_period(self, char: str, num: int) -> str: ...
def format_frac_seconds(self, num: int) -> str: ...
def format_milliseconds_in_day(self, num: int) -> str: ...
def format_timezone(self, char: str, num: int) -> str: ...
def format(self, value: SupportsInt, length: int) -> str: ...
def get_day_of_year(self, date: date | None = None) -> int: ...
def get_week_number(self, day_of_period: int, day_of_week: int | None = None) -> int: ...
PATTERN_CHARS: dict[str, list[int] | None]
PATTERN_CHAR_ORDER: str
def tokenize_pattern(pattern: str) -> list[tuple[str, str | tuple[str, int]]]: ...
def untokenize_pattern(tokens: Iterable[tuple[str, str | tuple[str, int]]]) -> str: ...
def split_interval_pattern(pattern: str) -> list[str]: ...
def match_skeleton(skeleton: str, options: Iterable[str], allow_different_fields: bool = False) -> str | None: ...

View File

@@ -1,2 +0,0 @@
def get_official_languages(territory: str, regional: bool = False, de_facto: bool = False) -> tuple[str, ...]: ...
def get_territory_language_info(territory: str) -> dict[str, dict[str, float | str | None]]: ...

View File

@@ -1,12 +0,0 @@
from collections.abc import Iterable
from typing_extensions import Literal
from babel.core import Locale
DEFAULT_LOCALE: str | None
def format_list(
lst: Iterable[str],
style: Literal["standard", "standard-short", "or", "or-short", "unit", "unit-short", "unit-narrow"] = "standard",
locale: Locale | str | None = ...,
) -> str: ...

View File

@@ -1,25 +0,0 @@
from collections.abc import Iterable, Iterator, Mapping, MutableMapping
from os import PathLike
from typing import Any
def normalize_locale(name: str) -> str | None: ...
def resolve_locale_filename(name: PathLike[str] | str) -> str: ...
def exists(name: str) -> bool: ...
def locale_identifiers() -> list[str]: ...
def load(name: PathLike[str] | str, merge_inherited: bool = True) -> dict[str, Any]: ...
def merge(dict1: MutableMapping[Any, Any], dict2: Mapping[Any, Any]) -> None: ...
class Alias:
keys: tuple[str, ...]
def __init__(self, keys: Iterable[str]) -> None: ...
def resolve(self, data: Mapping[str, Any]) -> Mapping[str, Any]: ...
class LocaleDataDict(MutableMapping[Any, Any]):
base: Mapping[str, Any]
def __init__(self, data: Mapping[str | int | None, Any], base: Mapping[str | int | None, Any] | None = None) -> None: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[str | int | None]: ...
def __getitem__(self, key: str | int | None) -> Any: ...
def __setitem__(self, key: str | int | None, value: Any) -> None: ...
def __delitem__(self, key: str | int | None) -> None: ...
def copy(self) -> LocaleDataDict: ...

View File

@@ -1,17 +0,0 @@
from datetime import datetime, timedelta, tzinfo
from pytz import BaseTzInfo
STDOFFSET: timedelta
DSTOFFSET: timedelta
DSTDIFF: timedelta
ZERO: timedelta
class _FallbackLocalTimezone(tzinfo):
def utcoffset(self, dt: datetime | None) -> timedelta: ...
def dst(self, dt: datetime | None) -> timedelta: ...
def tzname(self, dt: datetime | None) -> str: ...
def get_localzone() -> BaseTzInfo: ...
LOCALTZ: BaseTzInfo | _FallbackLocalTimezone

View File

@@ -1,6 +0,0 @@
from typing import Any
tz_names: dict[str, str]
def valuestodict(key) -> dict[str, Any]: ...
def get_localzone_name() -> str: ...

View File

@@ -1 +0,0 @@
from babel.messages.catalog import *

View File

@@ -1,130 +0,0 @@
import datetime
from collections import OrderedDict
from collections.abc import Generator, Iterable, Iterator
from typing_extensions import TypeAlias
from babel.core import Locale
__all__ = ["Message", "Catalog", "TranslationError"]
_MessageID: TypeAlias = str | tuple[str, ...] | list[str]
class Message:
id: _MessageID
string: _MessageID
locations: list[tuple[str, int]]
flags: set[str]
auto_comments: list[str]
user_comments: list[str]
previous_id: list[str]
lineno: int | None
context: str | None
def __init__(
self,
id: str,
string: str = "",
locations: Iterable[tuple[str, int]] = (),
flags: Iterable[str] = (),
auto_comments: Iterable[str] = (),
user_comments: Iterable[str] = (),
previous_id: _MessageID = (),
lineno: int | None = None,
context: str | None = None,
) -> None: ...
def __cmp__(self, other: Message) -> int: ...
def __gt__(self, other: Message) -> bool: ...
def __lt__(self, other: Message) -> bool: ...
def __ge__(self, other: Message) -> bool: ...
def __le__(self, other: Message) -> bool: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...
def is_identical(self, other: Message) -> bool: ...
def clone(self) -> Message: ...
def check(self, catalog: Catalog | None = None) -> list[TranslationError]: ...
@property
def fuzzy(self) -> bool: ...
@property
def pluralizable(self) -> bool: ...
@property
def python_format(self) -> bool: ...
class TranslationError(Exception): ...
class Catalog:
domain: str | None
project: str
version: str
copyright_holder: str
msgid_bugs_address: str
last_translator: str
language_team: str
charset: str
creation_date: datetime.datetime | str
revision_date: datetime.datetime | datetime.time | float | str
fuzzy: bool
obsolete: OrderedDict[str | tuple[str, str], Message]
def __init__(
self,
locale: str | Locale | None = None,
domain: str | None = None,
header_comment: str | None = ...,
project: str | None = None,
version: str | None = None,
copyright_holder: str | None = None,
msgid_bugs_address: str | None = None,
creation_date: datetime.datetime | str | None = None,
revision_date: datetime.datetime | datetime.time | float | str | None = None,
last_translator: str | None = None,
language_team: str | None = None,
charset: str | None = None,
fuzzy: bool = True,
) -> None: ...
@property
def locale(self) -> Locale | None: ...
@locale.setter # Assigning a string looks up the right Locale object.
def locale(self, value: Locale | str | None) -> None: ...
@property
def locale_identifier(self) -> str | None: ...
@property
def header_comment(self) -> str: ...
@header_comment.setter
def header_comment(self, value: str) -> None: ...
@property
def mime_headers(self) -> list[tuple[str, str]]: ...
@mime_headers.setter
def mime_headers(self, value: Iterable[tuple[str | bytes, str | bytes]]) -> None: ...
@property
def num_plurals(self) -> int: ...
@property
def plural_expr(self) -> str: ...
@property
def plural_forms(self) -> str: ...
def __contains__(self, id: _MessageID) -> bool: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[Message]: ...
def __delitem__(self, id: _MessageID) -> None: ...
def __getitem__(self, id: _MessageID) -> Message: ...
def __setitem__(self, id: _MessageID, message: Message) -> None: ...
def add(
self,
id: _MessageID,
string: _MessageID | None = None,
locations: Iterable[tuple[str, int]] = (),
flags: Iterable[str] = (),
auto_comments: Iterable[str] = (),
user_comments: Iterable[str] = (),
previous_id: _MessageID = (),
lineno: int | None = None,
context: str | None = None,
) -> Message: ...
def check(self) -> Generator[tuple[Message, list[TranslationError]], None, None]: ...
def get(self, id: _MessageID, context: str | None = None): ...
def delete(self, id, context: str | None = None) -> None: ...
def update(
self,
template: Catalog,
no_fuzzy_matching: bool = False,
update_header_comment: bool = False,
keep_user_comments: bool = True,
) -> None: ...
def is_identical(self, other: Catalog) -> bool: ...

View File

@@ -1,8 +0,0 @@
from collections.abc import Callable
from babel.messages.catalog import Catalog, Message
def num_plurals(catalog: Catalog | None, message: Message) -> None: ...
def python_format(catalog: Catalog | None, message: Message) -> None: ...
checkers: list[Callable[[Catalog | None, Message], object]]

View File

@@ -1,85 +0,0 @@
from _typeshed import Incomplete, SupportsItems, SupportsRead, SupportsReadline
from collections.abc import Callable, Collection, Generator, Iterable, Mapping
from os import PathLike
from typing import Any, AnyStr, Protocol, overload
from typing_extensions import TypeAlias, TypedDict
_Keyword: TypeAlias = tuple[int | tuple[int, int] | tuple[int, str], ...] | None
GROUP_NAME: str
DEFAULT_KEYWORDS: dict[str, _Keyword]
DEFAULT_MAPPING: list[tuple[str, str]]
empty_msgid_warning: str
@overload
def extract_from_dir(
dirname: AnyStr | PathLike[AnyStr],
method_map: Iterable[tuple[str, str]] = ...,
options_map: SupportsItems[str, dict[str, Any]] | None = None,
keywords: Mapping[str, _Keyword] = ...,
comment_tags: Collection[str] = (),
callback: Callable[[AnyStr, str, dict[str, Any]], object] | None = None,
strip_comment_tags: bool = False,
directory_filter: Callable[[str], bool] | None = None,
) -> Generator[tuple[AnyStr, int, str | tuple[str, ...], list[str], str | None], None, None]: ...
@overload
def extract_from_dir(
dirname: None = None, # No dirname causes os.getcwd() to be used, producing str.
method_map: Iterable[tuple[str, str]] = ...,
options_map: SupportsItems[str, dict[str, Any]] | None = None,
keywords: Mapping[str, _Keyword] = ...,
comment_tags: Collection[str] = (),
callback: Callable[[str, str, dict[str, Any]], object] | None = None,
strip_comment_tags: bool = False,
directory_filter: Callable[[str], bool] | None = None,
) -> Generator[tuple[str, int, str | tuple[str, ...], list[str], str | None], None, None]: ...
def check_and_call_extract_file(
filepath: AnyStr | PathLike[AnyStr],
method_map: Iterable[tuple[str, str]],
options_map: SupportsItems[str, dict[str, Any]],
callback: Callable[[AnyStr, str, dict[str, Any]], object] | None,
keywords: Mapping[str, _Keyword],
comment_tags: Collection[str],
strip_comment_tags,
dirpath: Incomplete | None = None,
) -> Generator[tuple[AnyStr, int, str | tuple[str, ...], list[str], str | None], None, None]: ...
def extract_from_file(
method,
filename: AnyStr | PathLike[AnyStr],
keywords: Mapping[str, _Keyword] = ...,
comment_tags: Collection[str] = (),
options: dict[str, Any] | None = None,
strip_comment_tags: bool = False,
) -> list[tuple[AnyStr, int, str | tuple[str, ...], list[str], str | None]]: ...
class _FileObj(SupportsRead[bytes], SupportsReadline[bytes], Protocol):
def seek(self, __offset: int, __whence: int = ...) -> int: ...
def tell(self) -> int: ...
def extract(
method,
fileobj: _FileObj,
keywords: Mapping[str, _Keyword] = ...,
comment_tags: Collection[str] = (),
options: dict[str, Any] | None = None,
strip_comment_tags: bool = False,
) -> Iterable[tuple[int, str | tuple[str, ...], list[str], str | None]]: ...
def extract_nothing(
fileobj: _FileObj, keywords: Mapping[str, _Keyword], comment_tags: Collection[str], options: dict[str, Any]
) -> Iterable[tuple[int, str | tuple[str, ...], list[str], str | None]]: ...
class _PyOptions(TypedDict, total=False):
encoding: str
def extract_python(
fileobj: _FileObj, keywords: Mapping[str, _Keyword], comment_tags: Collection[str], options: _PyOptions
) -> Iterable[tuple[int, str | tuple[str, ...], list[str], str | None]]: ...
class _JSOptions(TypedDict, total=False):
encoding: str
jsx: bool
template_string: bool
def extract_javascript(
fileobj: _FileObj, keywords: Mapping[str, _Keyword], comment_tags: Collection[str], options: _JSOptions
) -> Iterable[tuple[int, str | tuple[str, ...], list[str], str | None]]: ...

View File

@@ -1,120 +0,0 @@
import abc
from _typeshed import Incomplete
from typing import Any
from setuptools._distutils.cmd import Command as _Command
def listify_value(arg, split: Incomplete | None = None): ...
class Command(_Command, metaclass=abc.ABCMeta):
as_args: Any
multiple_value_options: Any
boolean_options: Any
option_aliases: Any
option_choices: Any
log: Any
distribution: Any
verbose: bool
force: Any
help: int
finalized: int
def __init__(self, dist: Incomplete | None = None) -> None: ...
class compile_catalog(Command):
description: str
user_options: Any
boolean_options: Any
domain: str
directory: Any
input_file: Any
output_file: Any
locale: Any
use_fuzzy: bool
statistics: bool
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self): ...
class extract_messages(Command):
description: str
user_options: Any
boolean_options: Any
as_args: str
multiple_value_options: Any
option_aliases: Any
option_choices: Any
charset: str
keywords: Any
no_default_keywords: bool
mapping_file: Any
no_location: bool
add_location: Any
omit_header: bool
output_file: Any
input_dirs: Any
input_paths: Any
width: Any
no_wrap: bool
sort_output: bool
sort_by_file: bool
msgid_bugs_address: Any
copyright_holder: Any
project: Any
version: Any
add_comments: Any
strip_comments: bool
include_lineno: bool
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def check_message_extractors(dist, name, value) -> None: ...
class init_catalog(Command):
description: str
user_options: Any
boolean_options: Any
output_dir: Any
output_file: Any
input_file: Any
locale: Any
domain: str
no_wrap: bool
width: Any
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
class update_catalog(Command):
description: str
user_options: Any
boolean_options: Any
domain: str
input_file: Any
output_dir: Any
output_file: Any
omit_header: bool
locale: Any
width: Any
no_wrap: bool
ignore_obsolete: bool
init_missing: bool
no_fuzzy_matching: bool
update_header_comment: bool
previous: bool
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
class CommandLineInterface:
usage: str
version: Any
commands: Any
command_classes: Any
log: Any
parser: Any
def run(self, argv: Incomplete | None = None): ...
def main(): ...
def parse_mapping(fileobj, filename: Incomplete | None = None): ...
def parse_keywords(strings=[]): ...

View File

@@ -1,26 +0,0 @@
from collections.abc import Generator, Sequence
from re import Pattern
from typing import NamedTuple
operators: Sequence[str]
escapes: dict[str, str]
name_re: Pattern[str]
dotted_name_re: Pattern[str]
division_re: Pattern[str]
regex_re: Pattern[str]
line_re: Pattern[str]
line_join_re: Pattern[str]
uni_escape_re: Pattern[str]
class Token(NamedTuple):
type: str
value: str
lineno: int
# Documented as private
def get_rules(jsx: bool, dotted: bool, template_string: bool) -> list[tuple[str | None, Pattern[str]]]: ... # undocumented
def indicates_division(token: Token) -> bool: ...
def unquote_string(string: str) -> str: ...
def tokenize(
source: str, jsx: bool = True, dotted: bool = True, template_string: bool = True
) -> Generator[Token, None, None]: ...

View File

@@ -1,9 +0,0 @@
from _typeshed import SupportsRead, SupportsWrite
from babel.messages.catalog import Catalog
LE_MAGIC: int
BE_MAGIC: int
def read_mo(fileobj: SupportsRead[bytes]) -> Catalog: ...
def write_mo(fileobj: SupportsWrite[bytes], catalog: Catalog, use_fuzzy: bool = False) -> None: ...

View File

@@ -1,13 +0,0 @@
LC_CTYPE: str
PLURALS: dict[str, tuple[int, str]]
DEFAULT_PLURAL: tuple[int, str]
class _PluralTuple(tuple[int, str]):
@property
def num_plurals(self) -> int: ...
@property
def plural_expr(self) -> str: ...
@property
def plural_forms(self) -> str: ...
def get_plural(locale: str | None = ...) -> _PluralTuple: ...

View File

@@ -1,76 +0,0 @@
from _typeshed import SupportsWrite
from collections.abc import Iterable
from re import Pattern
from babel.core import Locale
from babel.messages.catalog import Catalog
def unescape(string: str) -> str: ...
def denormalize(string: str) -> str: ...
class PoFileError(Exception):
catalog: Catalog
line: str
lineno: int
def __init__(self, message: str, catalog: Catalog, line: str, lineno: int) -> None: ...
class _NormalizedString:
def __init__(self, *args: str) -> None: ...
def append(self, s: str) -> None: ...
def denormalize(self) -> str: ...
def __bool__(self) -> bool: ...
def __cmp__(self, other: object) -> int: ...
def __gt__(self, other: object) -> bool: ...
def __lt__(self, other: object) -> bool: ...
def __ge__(self, other: object) -> bool: ...
def __le__(self, other: object) -> bool: ...
def __eq__(self, other: object) -> bool: ...
def __ne__(self, other: object) -> bool: ...
class PoFileParser:
catalog: Catalog
ignore_obsolete: bool
counter: int
offset: int
abort_invalid: bool
# Internal variables:
messages: list[_NormalizedString]
# [index, string] lists
translations: list[list[int | _NormalizedString]]
locations: list[tuple[str, int | None]]
flags: list[str]
user_comments: list[str]
auto_comments: list[str]
context: str | None
obsolete: bool
in_msgid: bool
in_msgstr: bool
in_msgctxt: bool
def __init__(self, catalog, ignore_obsolete: bool = False, abort_invalid: bool = False) -> None: ...
def parse(self, fileobj: Iterable[str | bytes]) -> None: ...
def read_po(
fileobj: Iterable[str | bytes],
locale: str | Locale | None = None,
domain: str | None = None,
ignore_obsolete: bool = False,
charset: str | None = None,
abort_invalid: bool = False,
) -> Catalog: ...
WORD_SEP: Pattern[str]
def escape(string: str) -> str: ...
def normalize(string: str, prefix: str = "", width: int = 76) -> str: ...
def write_po(
fileobj: SupportsWrite[bytes],
catalog: Catalog,
width: int | None = 76,
no_location: bool = False,
omit_header: bool = False,
sort_output: bool = False,
sort_by_file: bool = False,
ignore_obsolete: bool = False,
include_previous: bool = False,
include_lineno: bool = True,
) -> None: ...

View File

@@ -1,127 +0,0 @@
import decimal
from datetime import date
from re import Pattern
from typing_extensions import Literal
from babel.core import Locale
long = int
LC_NUMERIC: str | None
class UnknownCurrencyError(Exception):
identifier: str
def __init__(self, identifier: str) -> None: ...
def list_currencies(locale: Locale | str | None = ...) -> set[str]: ...
def validate_currency(currency: str, locale: Locale | str | None = ...) -> None: ...
def is_currency(currency: str, locale: Locale | str | None = ...) -> bool: ...
def normalize_currency(currency: str, locale: Locale | str | None = ...) -> str | None: ...
def get_currency_name(currency: str, count: float | decimal.Decimal | None = None, locale: Locale | str | None = ...) -> str: ...
def get_currency_symbol(currency: str, locale: Locale | str | None = ...) -> str: ...
def get_currency_precision(currency: str) -> int: ...
def get_currency_unit_pattern(currency: str, count: float | None = None, locale: Locale | str | None = ...) -> str: ...
def get_territory_currencies(
territory: str,
start_date: date | None = None,
end_date: date | None = None,
tender: bool = True,
non_tender: bool = False,
include_details: bool = False,
) -> list[str]: ...
def get_decimal_symbol(locale: Locale | str | None = ...) -> str: ...
def get_plus_sign_symbol(locale: Locale | str | None = ...) -> str: ...
def get_minus_sign_symbol(locale: Locale | str | None = ...) -> str: ...
def get_exponential_symbol(locale: Locale | str | None = ...) -> str: ...
def get_group_symbol(locale: Locale | str | None = ...) -> str: ...
def format_number(number: float | decimal.Decimal | str, locale: Locale | str | None = ...) -> str: ...
def get_decimal_precision(number: decimal.Decimal) -> int: ...
def get_decimal_quantum(precision: int | decimal.Decimal) -> decimal.Decimal: ...
def format_decimal(
number: float | decimal.Decimal | str,
format: str | None = None,
locale: Locale | str | None = ...,
decimal_quantization: bool = True,
group_separator: bool = True,
): ...
def format_compact_decimal(
number: float, *, format_type: Literal["short", "long"] = "short", locale: Locale | str | None = ..., fraction_digits: int = 0
) -> str: ...
class UnknownCurrencyFormatError(KeyError): ...
def format_currency(
number: float | decimal.Decimal | str,
currency: str,
format: str | None = None,
locale: Locale | str | None = ...,
currency_digits: bool = True,
format_type: Literal["name", "standard", "accounting"] = "standard",
decimal_quantization: bool = True,
group_separator: bool = True,
) -> str: ...
def format_percent(
number: float | decimal.Decimal | str,
format: str | None = None,
locale: Locale | str | None = ...,
decimal_quantization: bool = True,
group_separator: bool = True,
) -> str: ...
def format_scientific(
number: float | decimal.Decimal | str,
format: str | None = None,
locale: Locale | str | None = ...,
decimal_quantization: bool = True,
) -> str: ...
class NumberFormatError(ValueError):
suggestions: str | None
def __init__(self, message: str, suggestions: str | None = None) -> None: ...
def parse_number(string: str, locale: Locale | str | None = ...) -> int: ...
def parse_decimal(string: str, locale: Locale | str | None = ..., strict: bool = False) -> decimal.Decimal: ...
PREFIX_END: str
NUMBER_TOKEN: str
PREFIX_PATTERN: str
NUMBER_PATTERN: str
SUFFIX_PATTERN: str
number_re: Pattern[str]
def parse_grouping(p: str) -> tuple[int, int]: ...
def parse_pattern(pattern: NumberPattern | str) -> NumberPattern: ...
class NumberPattern:
pattern: str
prefix: tuple[str, str]
suffix: tuple[str, str]
grouping: tuple[int, int]
int_prec: tuple[int, int]
frac_prec: tuple[int, int]
exp_prec: tuple[int, int] | None
exp_plus: bool | None
scale: Literal[0, 2, 3]
def __init__(
self,
pattern: str,
prefix: tuple[str, str],
suffix: tuple[str, str],
grouping: tuple[int, int],
int_prec: tuple[int, int],
frac_prec: tuple[int, int],
exp_prec: tuple[int, int] | None,
exp_plus: bool | None,
) -> None: ...
def compute_scale(self) -> Literal[0, 2, 3]: ...
def scientific_notation_elements(
self, value: decimal.Decimal, locale: Locale | str | None
) -> tuple[decimal.Decimal, int, str]: ...
def apply(
self,
value: float | decimal.Decimal,
locale: Locale | str | None,
currency: str | None = None,
currency_digits: bool = True,
decimal_quantization: bool = True,
force_frac: int | None = None,
group_separator: bool = True,
) -> str: ...

View File

@@ -1,99 +0,0 @@
import decimal
from _typeshed import Incomplete
from collections.abc import Iterable, Mapping
from typing import Any
def extract_operands(source: float | decimal.Decimal) -> tuple[decimal.Decimal, int, int, int, int, int, int, int]: ...
class PluralRule:
abstract: list[Any]
def __init__(self, rules: Mapping[str, str] | Iterable[tuple[str, str]]) -> None: ...
@classmethod
def parse(cls, rules: Mapping[str, str] | Iterable[tuple[str, str]] | PluralRule) -> PluralRule: ...
@property
def rules(self) -> Mapping[str, str]: ...
@property
def tags(self) -> frozenset[str]: ...
def __call__(self, n: float | decimal.Decimal) -> str: ...
def to_javascript(rule): ...
def to_python(rule): ...
def to_gettext(rule): ...
def in_range_list(num, range_list): ...
def within_range_list(num, range_list): ...
def cldr_modulo(a, b): ...
class RuleError(Exception): ...
def tokenize_rule(s): ...
def test_next_token(tokens, type_, value: Incomplete | None = None): ...
def skip_token(tokens, type_, value: Incomplete | None = None): ...
def value_node(value): ...
def ident_node(name): ...
def range_list_node(range_list): ...
def negate(rv): ...
class _Parser:
tokens: Any
ast: Any
def __init__(self, string) -> None: ...
def expect(self, type_, value: Incomplete | None = None, term: Incomplete | None = None): ...
def condition(self): ...
def and_condition(self): ...
def relation(self): ...
def newfangled_relation(self, left): ...
def range_or_value(self): ...
def range_list(self): ...
def expr(self): ...
def value(self): ...
compile_zero: Any
class _Compiler:
def compile(self, arg): ...
compile_n: Any
compile_i: Any
compile_v: Any
compile_w: Any
compile_f: Any
compile_t: Any
compile_value: Any
compile_and: Any
compile_or: Any
compile_not: Any
compile_mod: Any
compile_is: Any
compile_isnot: Any
def compile_relation(self, method, expr, range_list) -> None: ...
class _PythonCompiler(_Compiler):
compile_and: Any
compile_or: Any
compile_not: Any
compile_mod: Any
def compile_relation(self, method, expr, range_list): ...
class _GettextCompiler(_Compiler):
compile_i: Any
compile_v: Any
compile_w: Any
compile_f: Any
compile_t: Any
def compile_relation(self, method, expr, range_list): ...
class _JavaScriptCompiler(_GettextCompiler):
compile_i: Any
compile_v: Any
compile_w: Any
compile_f: Any
compile_t: Any
def compile_relation(self, method, expr, range_list): ...
class _UnicodeCompiler(_Compiler):
compile_is: Any
compile_isnot: Any
compile_and: Any
compile_or: Any
compile_mod: Any
def compile_not(self, relation): ...
def compile_relation(self, method, expr, range_list, negated: bool = False): ...

View File

@@ -1,106 +0,0 @@
import gettext
from _typeshed import Incomplete
from datetime import date as _date, datetime as _datetime, time as _time, timedelta as _timedelta
from decimal import Decimal
from typing import Any
from typing_extensions import Literal
from babel.core import Locale
from pytz import BaseTzInfo
from .dates import _PredefinedTimeFormat
class Format:
locale: Locale
tzinfo: BaseTzInfo | None
def __init__(self, locale: Locale | str, tzinfo: BaseTzInfo | None = None) -> None: ...
def date(self, date: _date | None = None, format: _PredefinedTimeFormat | str = "medium") -> str: ...
def datetime(self, datetime: _date | None = None, format: _PredefinedTimeFormat | str = "medium") -> str: ...
def time(self, time: _time | _datetime | None = None, format: _PredefinedTimeFormat | str = "medium") -> str: ...
def timedelta(
self,
delta: _timedelta | int,
granularity: Literal["year", "month", "week", "day", "hour", "minute", "second"] = "second",
threshold: float = 0.85,
format: _PredefinedTimeFormat = "long",
add_direction: bool = False,
) -> str: ...
def number(self, number: float | Decimal | str) -> str: ...
def decimal(self, number: float | Decimal | str, format: str | None = None) -> str: ...
def currency(self, number: float | Decimal | str, currency: str) -> str: ...
def percent(self, number: float | Decimal | str, format: str | None = None) -> str: ...
def scientific(self, number: float | Decimal | str) -> str: ...
class LazyProxy:
def __init__(self, func, *args, **kwargs) -> None: ...
@property
def value(self): ...
def __contains__(self, key): ...
def __bool__(self) -> bool: ...
def __dir__(self): ...
def __iter__(self): ...
def __len__(self) -> int: ...
def __add__(self, other): ...
def __radd__(self, other): ...
def __mod__(self, other): ...
def __rmod__(self, other): ...
def __mul__(self, other): ...
def __rmul__(self, other): ...
def __call__(self, *args, **kwargs): ...
def __lt__(self, other): ...
def __le__(self, other): ...
def __eq__(self, other): ...
def __ne__(self, other): ...
def __gt__(self, other): ...
def __ge__(self, other): ...
def __delattr__(self, name: str) -> None: ...
def __getattr__(self, name: str): ...
def __setattr__(self, name: str, value) -> None: ...
def __delitem__(self, key) -> None: ...
def __getitem__(self, key): ...
def __setitem__(self, key, value) -> None: ...
def __copy__(self) -> LazyProxy: ...
def __deepcopy__(self, memo: Any) -> LazyProxy: ...
class NullTranslations(gettext.NullTranslations):
DEFAULT_DOMAIN: Any
plural: Any
files: Any
domain: Any
def __init__(self, fp: Incomplete | None = None): ...
def dgettext(self, domain, message): ...
def ldgettext(self, domain, message): ...
def udgettext(self, domain, message): ...
dugettext: Any
def dngettext(self, domain, singular, plural, num): ...
def ldngettext(self, domain, singular, plural, num): ...
def udngettext(self, domain, singular, plural, num): ...
dungettext: Any
CONTEXT_ENCODING: str
def pgettext(self, context, message): ...
def lpgettext(self, context, message): ...
def npgettext(self, context, singular, plural, num): ...
def lnpgettext(self, context, singular, plural, num): ...
def upgettext(self, context, message): ...
def unpgettext(self, context, singular, plural, num): ...
def dpgettext(self, domain, context, message): ...
def udpgettext(self, domain, context, message): ...
dupgettext: Any
def ldpgettext(self, domain, context, message): ...
def dnpgettext(self, domain, context, singular, plural, num): ...
def udnpgettext(self, domain, context, singular, plural, num): ...
dunpgettext: Any
def ldnpgettext(self, domain, context, singular, plural, num): ...
ugettext: Any
ungettext: Any
class Translations(NullTranslations, gettext.GNUTranslations):
DEFAULT_DOMAIN: str
domain: Any
def __init__(self, fp: Incomplete | None = None, domain: Incomplete | None = None) -> None: ...
ugettext: Any
ungettext: Any
@classmethod
def load(cls, dirname: Incomplete | None = None, locales: Incomplete | None = None, domain: Incomplete | None = None): ...
def add(self, translations, merge: bool = True): ...
def merge(self, translations): ...

View File

@@ -1,27 +0,0 @@
import decimal
from typing_extensions import Literal
from babel.core import Locale
class UnknownUnitError(ValueError):
def __init__(self, unit: str, locale: Locale) -> None: ...
def get_unit_name(
measurement_unit: str, length: Literal["short", "long", "narrow"] = "long", locale: Locale | str | None = ...
) -> str: ...
def format_unit(
value: float | decimal.Decimal,
measurement_unit: str,
length: Literal["short", "long", "narrow"] = "long",
format: str | None = None,
locale: Locale | str | None = ...,
) -> str: ...
def format_compound_unit(
numerator_value: float | decimal.Decimal,
numerator_unit: str | None = None,
denominator_value: float | decimal.Decimal = 1,
denominator_unit: str | None = None,
length: Literal["short", "long", "narrow"] = "long",
format: str | None = None,
locale: Locale | str | None = ...,
) -> str | None: ...

View File

@@ -1,46 +0,0 @@
import collections
import textwrap
from collections.abc import Generator, Iterable
from datetime import timedelta, tzinfo
from re import Pattern
from typing import IO, Any, TypeVar
from babel import localtime as localtime
from pytz import BaseTzInfo
missing: object
_T = TypeVar("_T")
def distinct(iterable: Iterable[_T]) -> Generator[_T, None, None]: ...
PYTHON_MAGIC_COMMENT_re: Pattern[bytes]
def parse_encoding(fp: IO[bytes]) -> str | None: ...
PYTHON_FUTURE_IMPORT_re: Pattern[str]
def parse_future_flags(fp: IO[bytes], encoding: str = "latin-1") -> int: ...
def pathmatch(pattern: str, filename: str) -> bool: ...
class TextWrapper(textwrap.TextWrapper):
wordsep_re: Pattern[str]
def wraptext(text, width: int = 70, initial_indent: str = "", subsequent_indent: str = ""): ...
odict = collections.OrderedDict
class FixedOffsetTimezone(tzinfo):
zone: str
def __init__(self, offset: float, name: str | None = None) -> None: ...
def utcoffset(self, dt: Any) -> timedelta: ...
def tzname(self, dt: Any) -> str: ...
def dst(self, dt: Any) -> timedelta: ...
UTC: BaseTzInfo
LOCALTZ: BaseTzInfo
get_localzone = localtime.get_localzone
STDOFFSET: timedelta
DSTOFFSET: timedelta
DSTDIFF: timedelta
ZERO: timedelta