mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-08-14 11:51:03 +08:00
move generated stubs to separate directory, too messty
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
from contextlib import ContextDecorator
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
|
||||
LANGUAGE_SESSION_KEY: str
|
||||
|
||||
class TranslatorCommentWarning(SyntaxWarning): ...
|
||||
|
||||
class Trans:
|
||||
activate: Callable
|
||||
check_for_language: functools._lru_cache_wrapper
|
||||
deactivate: Callable
|
||||
deactivate_all: Callable
|
||||
get_language: Callable
|
||||
get_language_bidi: Callable
|
||||
get_language_from_path: Callable
|
||||
get_language_from_request: Callable
|
||||
gettext: Callable
|
||||
gettext_noop: Callable
|
||||
ngettext: Callable
|
||||
npgettext: Callable
|
||||
pgettext: Callable
|
||||
def __getattr__(self, real_name: Any): ...
|
||||
|
||||
def gettext_noop(message: str) -> str: ...
|
||||
|
||||
ugettext_noop = gettext_noop
|
||||
|
||||
def gettext(message: str) -> str: ...
|
||||
|
||||
ugettext = gettext
|
||||
|
||||
def ngettext(singular: str, plural: str, number: float) -> str: ...
|
||||
|
||||
ungettext = ngettext
|
||||
|
||||
def pgettext(context: str, message: str) -> str: ...
|
||||
def npgettext(context: str, singular: str, plural: str, number: int) -> str: ...
|
||||
|
||||
gettext_lazy: Any
|
||||
|
||||
ugettext_lazy: Any
|
||||
pgettext_lazy: Any
|
||||
|
||||
def ngettext_lazy(singular: Any, plural: Any, number: Optional[Any] = ...): ...
|
||||
|
||||
ungettext_lazy = ngettext_lazy
|
||||
|
||||
def npgettext_lazy(
|
||||
context: Any, singular: Any, plural: Any, number: Optional[Any] = ...
|
||||
): ...
|
||||
def activate(language: str) -> None: ...
|
||||
def deactivate() -> None: ...
|
||||
|
||||
class override(ContextDecorator):
|
||||
language: Optional[str] = ...
|
||||
deactivate: bool = ...
|
||||
def __init__(
|
||||
self, language: Optional[str], deactivate: bool = ...
|
||||
) -> None: ...
|
||||
old_language: Optional[str] = ...
|
||||
def __enter__(self) -> None: ...
|
||||
def __exit__(
|
||||
self, exc_type: None, exc_value: None, traceback: None
|
||||
) -> None: ...
|
||||
|
||||
def get_language() -> Optional[str]: ...
|
||||
def get_language_bidi() -> bool: ...
|
||||
def check_for_language(lang_code: Optional[str]) -> bool: ...
|
||||
def to_language(locale: str) -> str: ...
|
||||
def to_locale(language: str) -> str: ...
|
||||
def get_language_from_request(
|
||||
request: WSGIRequest, check_path: bool = ...
|
||||
) -> str: ...
|
||||
def templatize(src: str, **kwargs: Any) -> str: ...
|
||||
def deactivate_all() -> None: ...
|
||||
def get_language_info(lang_code: str) -> Any: ...
|
||||
@@ -0,0 +1,14 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
dot_re: Any
|
||||
|
||||
def blankout(src: str, char: str) -> str: ...
|
||||
|
||||
context_re: Any
|
||||
inline_re: Any
|
||||
block_re: Any
|
||||
endblock_re: Any
|
||||
plural_re: Any
|
||||
constant_re: Any
|
||||
|
||||
def templatize(src: str, origin: str = ...) -> str: ...
|
||||
@@ -0,0 +1,28 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
|
||||
def gettext(message: Any): ...
|
||||
|
||||
gettext_noop = gettext
|
||||
gettext_lazy = gettext
|
||||
_ = gettext
|
||||
|
||||
def ngettext(singular: str, plural: str, number: int) -> str: ...
|
||||
|
||||
ngettext_lazy = ngettext
|
||||
|
||||
def pgettext(context: Any, message: Any): ...
|
||||
def npgettext(context: Any, singular: Any, plural: Any, number: Any): ...
|
||||
def activate(x: Any): ...
|
||||
def deactivate(): ...
|
||||
|
||||
deactivate_all = deactivate
|
||||
|
||||
def get_language(): ...
|
||||
def get_language_bidi() -> bool: ...
|
||||
def check_for_language(x: str) -> bool: ...
|
||||
def get_language_from_request(request: None, check_path: bool = ...) -> str: ...
|
||||
def get_language_from_path(request: str) -> None: ...
|
||||
def get_supported_language_variant(
|
||||
lang_code: str, strict: bool = ...
|
||||
) -> str: ...
|
||||
@@ -0,0 +1,53 @@
|
||||
import gettext as gettext_module
|
||||
from collections import OrderedDict
|
||||
from gettext import NullTranslations
|
||||
from typing import Any, List, Optional, Tuple
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
|
||||
CONTEXT_SEPARATOR: str
|
||||
accept_language_re: Any
|
||||
language_code_re: Any
|
||||
language_code_prefix_re: Any
|
||||
|
||||
def reset_cache(**kwargs: Any) -> None: ...
|
||||
|
||||
class DjangoTranslation(gettext_module.GNUTranslations):
|
||||
domain: str = ...
|
||||
plural: Callable = ...
|
||||
def __init__(
|
||||
self,
|
||||
language: str,
|
||||
domain: Optional[str] = ...,
|
||||
localedirs: Optional[List[str]] = ...,
|
||||
) -> None: ...
|
||||
def merge(self, other: NullTranslations) -> None: ...
|
||||
def language(self): ...
|
||||
def to_language(self) -> str: ...
|
||||
|
||||
def translation(language: str) -> DjangoTranslation: ...
|
||||
def activate(language: str) -> None: ...
|
||||
def deactivate() -> None: ...
|
||||
def deactivate_all() -> None: ...
|
||||
def get_language() -> Optional[str]: ...
|
||||
def get_language_bidi() -> bool: ...
|
||||
def catalog(): ...
|
||||
def gettext(message: str) -> str: ...
|
||||
def pgettext(context: str, message: str) -> str: ...
|
||||
def gettext_noop(message: str) -> str: ...
|
||||
def do_ntranslate(
|
||||
singular: str, plural: str, number: float, translation_function: str
|
||||
) -> str: ...
|
||||
def ngettext(singular: str, plural: str, number: float) -> str: ...
|
||||
def npgettext(context: str, singular: str, plural: str, number: int) -> str: ...
|
||||
def all_locale_paths() -> List[str]: ...
|
||||
def check_for_language(lang_code: Optional[str]) -> bool: ...
|
||||
def get_languages() -> OrderedDict: ...
|
||||
def get_supported_language_variant(
|
||||
lang_code: Optional[str], strict: bool = ...
|
||||
) -> str: ...
|
||||
def get_language_from_path(path: str, strict: bool = ...) -> Optional[str]: ...
|
||||
def get_language_from_request(
|
||||
request: WSGIRequest, check_path: bool = ...
|
||||
) -> str: ...
|
||||
def parse_accept_lang_header(lang_string: str) -> Tuple: ...
|
||||
Reference in New Issue
Block a user