mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-08-03 14:38:28 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import datetime
|
||||
from typing import Iterable, Optional, Union
|
||||
from typing import Iterable
|
||||
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
@@ -11,8 +11,8 @@ class DateTimeRange(object):
|
||||
separator: str
|
||||
def __init__(
|
||||
self,
|
||||
start_datetime: Optional[Union[datetime.datetime, str]] = ...,
|
||||
end_datetime: Optional[Union[datetime.datetime, str]] = ...,
|
||||
start_datetime: datetime.datetime | str | None = ...,
|
||||
end_datetime: datetime.datetime | str | None = ...,
|
||||
start_time_format: str = ...,
|
||||
end_time_format: str = ...,
|
||||
) -> None: ...
|
||||
@@ -22,7 +22,7 @@ class DateTimeRange(object):
|
||||
def __iadd__(self, other: datetime.timedelta) -> DateTimeRange: ...
|
||||
def __sub__(self, other: datetime.timedelta) -> DateTimeRange: ...
|
||||
def __isub__(self, other: datetime.timedelta) -> DateTimeRange: ...
|
||||
def __contains__(self, x: Union[datetime.timedelta, DateTimeRange, str]) -> bool: ...
|
||||
def __contains__(self, x: datetime.timedelta | DateTimeRange | str) -> bool: ...
|
||||
@property
|
||||
def start_datetime(self) -> datetime.datetime: ...
|
||||
@property
|
||||
@@ -36,12 +36,10 @@ class DateTimeRange(object):
|
||||
def get_start_time_str(self) -> str: ...
|
||||
def get_end_time_str(self) -> str: ...
|
||||
def get_timedelta_second(self) -> float: ...
|
||||
def set_start_datetime(self, value: Optional[Union[datetime.datetime, str]], timezone: Optional[str] = ...) -> None: ...
|
||||
def set_end_datetime(self, value: Optional[Union[datetime.datetime, str]], timezone: Optional[str] = ...) -> None: ...
|
||||
def set_time_range(
|
||||
self, start: Optional[Union[datetime.datetime, str]], end: Optional[Union[datetime.datetime, str]]
|
||||
) -> None: ...
|
||||
def range(self, step: Union[datetime.timedelta, relativedelta]) -> Iterable[datetime.datetime]: ...
|
||||
def set_start_datetime(self, value: datetime.datetime | str | None, timezone: str | None = ...) -> None: ...
|
||||
def set_end_datetime(self, value: datetime.datetime | str | None, timezone: str | None = ...) -> None: ...
|
||||
def set_time_range(self, start: datetime.datetime | str | None, end: datetime.datetime | str | None) -> None: ...
|
||||
def range(self, step: datetime.timedelta | relativedelta) -> Iterable[datetime.datetime]: ...
|
||||
def intersection(self, x: DateTimeRange) -> DateTimeRange: ...
|
||||
def encompass(self, x: DateTimeRange) -> DateTimeRange: ...
|
||||
def truncate(self, percentage: float) -> None: ...
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
from typing import Any, Callable, Optional, Type, TypeVar, overload
|
||||
from typing import Any, Callable, Type, TypeVar, overload
|
||||
|
||||
_F = TypeVar("_F", bound=Callable[..., Any])
|
||||
|
||||
class ClassicAdapter:
|
||||
reason: str
|
||||
version: str
|
||||
action: Optional[str]
|
||||
action: str | None
|
||||
category: Type[DeprecationWarning]
|
||||
def __init__(
|
||||
self, reason: str = ..., version: str = ..., action: Optional[str] = ..., category: Type[DeprecationWarning] = ...
|
||||
self, reason: str = ..., version: str = ..., action: str | None = ..., category: Type[DeprecationWarning] = ...
|
||||
) -> None: ...
|
||||
def get_deprecated_msg(self, wrapped: Callable[..., Any], instance: object) -> str: ...
|
||||
def __call__(self, wrapped: _F) -> Callable[[_F], _F]: ...
|
||||
@@ -17,5 +17,5 @@ class ClassicAdapter:
|
||||
def deprecated(__wrapped: _F) -> _F: ...
|
||||
@overload
|
||||
def deprecated(
|
||||
reason: str = ..., *, version: str = ..., action: Optional[str] = ..., category: Optional[Type[DeprecationWarning]] = ...
|
||||
reason: str = ..., *, version: str = ..., action: str | None = ..., category: Type[DeprecationWarning] | None = ...
|
||||
) -> Callable[[_F], _F]: ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Callable, Optional, Type, TypeVar, overload
|
||||
from typing import Any, Callable, Type, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .classic import ClassicAdapter
|
||||
@@ -9,14 +9,14 @@ class SphinxAdapter(ClassicAdapter):
|
||||
directive: Literal["versionadded", "versionchanged", "deprecated"]
|
||||
reason: str
|
||||
version: str
|
||||
action: Optional[str]
|
||||
action: str | None
|
||||
category: Type[DeprecationWarning]
|
||||
def __init__(
|
||||
self,
|
||||
directive: Literal["versionadded", "versionchanged", "deprecated"],
|
||||
reason: str = ...,
|
||||
version: str = ...,
|
||||
action: Optional[str] = ...,
|
||||
action: str | None = ...,
|
||||
category: Type[DeprecationWarning] = ...,
|
||||
) -> None: ...
|
||||
def __call__(self, wrapped: _F) -> Callable[[_F], _F]: ...
|
||||
@@ -27,5 +27,5 @@ def versionchanged(reason: str = ..., version: str = ...) -> Callable[[_F], _F]:
|
||||
def deprecated(__wrapped: _F) -> _F: ...
|
||||
@overload
|
||||
def deprecated(
|
||||
reason: str = ..., *, version: str = ..., action: Optional[str] = ..., category: Optional[Type[DeprecationWarning]] = ...
|
||||
reason: str = ..., *, version: str = ..., action: str | None = ..., category: Type[DeprecationWarning] | None = ...
|
||||
) -> Callable[[_F], _F]: ...
|
||||
|
||||
+30
-32
@@ -48,7 +48,7 @@ class Flask(_PackageBoundObject):
|
||||
app_ctx_globals_class: type = ...
|
||||
config_class: Type[Config] = ...
|
||||
testing: Any = ...
|
||||
secret_key: Union[Text, bytes, None] = ...
|
||||
secret_key: Text | bytes | None = ...
|
||||
session_cookie_name: Any = ...
|
||||
permanent_session_lifetime: timedelta = ...
|
||||
send_file_max_age_default: timedelta = ...
|
||||
@@ -63,19 +63,19 @@ class Flask(_PackageBoundObject):
|
||||
session_interface: Any = ...
|
||||
import_name: str = ...
|
||||
template_folder: str = ...
|
||||
root_path: Union[str, Text] = ...
|
||||
root_path: str | Text = ...
|
||||
static_url_path: Any = ...
|
||||
static_folder: Optional[str] = ...
|
||||
instance_path: Union[str, Text] = ...
|
||||
static_folder: str | None = ...
|
||||
instance_path: str | Text = ...
|
||||
config: Config = ...
|
||||
view_functions: Any = ...
|
||||
error_handler_spec: Any = ...
|
||||
url_build_error_handlers: Any = ...
|
||||
before_request_funcs: Dict[Optional[str], List[Callable[[], Any]]] = ...
|
||||
before_request_funcs: Dict[str | None, List[Callable[[], Any]]] = ...
|
||||
before_first_request_funcs: List[Callable[[], None]] = ...
|
||||
after_request_funcs: Dict[Optional[str], List[Callable[[Response], Response]]] = ...
|
||||
teardown_request_funcs: Dict[Optional[str], List[Callable[[Optional[Exception]], Any]]] = ...
|
||||
teardown_appcontext_funcs: List[Callable[[Optional[Exception]], Any]] = ...
|
||||
after_request_funcs: Dict[str | None, List[Callable[[Response], Response]]] = ...
|
||||
teardown_request_funcs: Dict[str | None, List[Callable[[Exception | None], Any]]] = ...
|
||||
teardown_appcontext_funcs: List[Callable[[Exception | None], Any]] = ...
|
||||
url_value_preprocessors: Any = ...
|
||||
url_default_functions: Any = ...
|
||||
template_context_processors: Any = ...
|
||||
@@ -88,15 +88,15 @@ class Flask(_PackageBoundObject):
|
||||
def __init__(
|
||||
self,
|
||||
import_name: str,
|
||||
static_url_path: Optional[str] = ...,
|
||||
static_folder: Optional[str] = ...,
|
||||
static_host: Optional[str] = ...,
|
||||
static_url_path: str | None = ...,
|
||||
static_folder: str | None = ...,
|
||||
static_host: str | None = ...,
|
||||
host_matching: bool = ...,
|
||||
subdomain_matching: bool = ...,
|
||||
template_folder: str = ...,
|
||||
instance_path: Optional[str] = ...,
|
||||
instance_path: str | None = ...,
|
||||
instance_relative_config: bool = ...,
|
||||
root_path: Optional[str] = ...,
|
||||
root_path: str | None = ...,
|
||||
) -> None: ...
|
||||
@property
|
||||
def name(self) -> str: ...
|
||||
@@ -112,20 +112,20 @@ class Flask(_PackageBoundObject):
|
||||
def got_first_request(self) -> bool: ...
|
||||
def make_config(self, instance_relative: bool = ...): ...
|
||||
def auto_find_instance_path(self): ...
|
||||
def open_instance_resource(self, resource: Union[str, Text], mode: str = ...): ...
|
||||
def open_instance_resource(self, resource: str | Text, mode: str = ...): ...
|
||||
templates_auto_reload: Any = ...
|
||||
def create_jinja_environment(self): ...
|
||||
def create_global_jinja_loader(self): ...
|
||||
def select_jinja_autoescape(self, filename: Any): ...
|
||||
def update_template_context(self, context: Any) -> None: ...
|
||||
def make_shell_context(self): ...
|
||||
env: Optional[str] = ...
|
||||
env: str | None = ...
|
||||
debug: bool = ...
|
||||
def run(
|
||||
self,
|
||||
host: Optional[str] = ...,
|
||||
port: Optional[Union[int, str]] = ...,
|
||||
debug: Optional[bool] = ...,
|
||||
host: str | None = ...,
|
||||
port: int | str | None = ...,
|
||||
debug: bool | None = ...,
|
||||
load_dotenv: bool = ...,
|
||||
**options: Any,
|
||||
) -> None: ...
|
||||
@@ -139,28 +139,26 @@ class Flask(_PackageBoundObject):
|
||||
def add_url_rule(
|
||||
self,
|
||||
rule: str,
|
||||
endpoint: Optional[str] = ...,
|
||||
endpoint: str | None = ...,
|
||||
view_func: _ViewFunc = ...,
|
||||
provide_automatic_options: Optional[bool] = ...,
|
||||
provide_automatic_options: bool | None = ...,
|
||||
**options: Any,
|
||||
) -> None: ...
|
||||
def route(self, rule: str, **options: Any) -> Callable[[_VT], _VT]: ...
|
||||
def endpoint(self, endpoint: str) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ...
|
||||
def errorhandler(
|
||||
self, code_or_exception: Union[int, Type[Exception]]
|
||||
) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ...
|
||||
def register_error_handler(self, code_or_exception: Union[int, Type[Exception]], f: Callable[..., Any]) -> None: ...
|
||||
def template_filter(self, name: Optional[Any] = ...): ...
|
||||
def add_template_filter(self, f: Any, name: Optional[Any] = ...) -> None: ...
|
||||
def template_test(self, name: Optional[Any] = ...): ...
|
||||
def add_template_test(self, f: Any, name: Optional[Any] = ...) -> None: ...
|
||||
def template_global(self, name: Optional[Any] = ...): ...
|
||||
def add_template_global(self, f: Any, name: Optional[Any] = ...) -> None: ...
|
||||
def errorhandler(self, code_or_exception: int | Type[Exception]) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ...
|
||||
def register_error_handler(self, code_or_exception: int | Type[Exception], f: Callable[..., Any]) -> None: ...
|
||||
def template_filter(self, name: Any | None = ...): ...
|
||||
def add_template_filter(self, f: Any, name: Any | None = ...) -> None: ...
|
||||
def template_test(self, name: Any | None = ...): ...
|
||||
def add_template_test(self, f: Any, name: Any | None = ...) -> None: ...
|
||||
def template_global(self, name: Any | None = ...): ...
|
||||
def add_template_global(self, f: Any, name: Any | None = ...) -> None: ...
|
||||
def before_request(self, f: Callable[[], _T]) -> Callable[[], _T]: ...
|
||||
def before_first_request(self, f: Callable[[], _T]) -> Callable[[], _T]: ...
|
||||
def after_request(self, f: Callable[[Response], Response]) -> Callable[[Response], Response]: ...
|
||||
def teardown_request(self, f: Callable[[Optional[Exception]], _T]) -> Callable[[Optional[Exception]], _T]: ...
|
||||
def teardown_appcontext(self, f: Callable[[Optional[Exception]], _T]) -> Callable[[Optional[Exception]], _T]: ...
|
||||
def teardown_request(self, f: Callable[[Exception | None], _T]) -> Callable[[Exception | None], _T]: ...
|
||||
def teardown_appcontext(self, f: Callable[[Exception | None], _T]) -> Callable[[Exception | None], _T]: ...
|
||||
def context_processor(self, f: Any): ...
|
||||
def shell_context_processor(self, f: Any): ...
|
||||
def url_value_preprocessor(self, f: Any): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Callable, Optional, Type, TypeVar, Union
|
||||
from typing import Any, Callable, Type, TypeVar
|
||||
|
||||
from .app import _ViewFunc
|
||||
from .helpers import _PackageBoundObject
|
||||
@@ -17,49 +17,49 @@ class BlueprintSetupState:
|
||||
url_prefix: Any = ...
|
||||
url_defaults: Any = ...
|
||||
def __init__(self, blueprint: Any, app: Any, options: Any, first_registration: Any) -> None: ...
|
||||
def add_url_rule(self, rule: str, endpoint: Optional[str] = ..., view_func: _ViewFunc = ..., **options: Any) -> None: ...
|
||||
def add_url_rule(self, rule: str, endpoint: str | None = ..., view_func: _ViewFunc = ..., **options: Any) -> None: ...
|
||||
|
||||
class Blueprint(_PackageBoundObject):
|
||||
warn_on_modifications: bool = ...
|
||||
json_encoder: Any = ...
|
||||
json_decoder: Any = ...
|
||||
import_name: str = ...
|
||||
template_folder: Optional[str] = ...
|
||||
template_folder: str | None = ...
|
||||
root_path: str = ...
|
||||
name: str = ...
|
||||
url_prefix: Optional[str] = ...
|
||||
subdomain: Optional[str] = ...
|
||||
static_folder: Optional[str] = ...
|
||||
static_url_path: Optional[str] = ...
|
||||
url_prefix: str | None = ...
|
||||
subdomain: str | None = ...
|
||||
static_folder: str | None = ...
|
||||
static_url_path: str | None = ...
|
||||
deferred_functions: Any = ...
|
||||
url_values_defaults: Any = ...
|
||||
cli_group: Union[Optional[str], _Sentinel] = ...
|
||||
cli_group: str | None | _Sentinel = ...
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
import_name: str,
|
||||
static_folder: Optional[str] = ...,
|
||||
static_url_path: Optional[str] = ...,
|
||||
template_folder: Optional[str] = ...,
|
||||
url_prefix: Optional[str] = ...,
|
||||
subdomain: Optional[str] = ...,
|
||||
url_defaults: Optional[Any] = ...,
|
||||
root_path: Optional[str] = ...,
|
||||
cli_group: Union[Optional[str], _Sentinel] = ...,
|
||||
static_folder: str | None = ...,
|
||||
static_url_path: str | None = ...,
|
||||
template_folder: str | None = ...,
|
||||
url_prefix: str | None = ...,
|
||||
subdomain: str | None = ...,
|
||||
url_defaults: Any | None = ...,
|
||||
root_path: str | None = ...,
|
||||
cli_group: str | None | _Sentinel = ...,
|
||||
) -> None: ...
|
||||
def record(self, func: Any) -> None: ...
|
||||
def record_once(self, func: Any): ...
|
||||
def make_setup_state(self, app: Any, options: Any, first_registration: bool = ...): ...
|
||||
def register(self, app: Any, options: Any, first_registration: bool = ...) -> None: ...
|
||||
def route(self, rule: str, **options: Any) -> Callable[[_VT], _VT]: ...
|
||||
def add_url_rule(self, rule: str, endpoint: Optional[str] = ..., view_func: _ViewFunc = ..., **options: Any) -> None: ...
|
||||
def add_url_rule(self, rule: str, endpoint: str | None = ..., view_func: _ViewFunc = ..., **options: Any) -> None: ...
|
||||
def endpoint(self, endpoint: str) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ...
|
||||
def app_template_filter(self, name: Optional[Any] = ...): ...
|
||||
def add_app_template_filter(self, f: Any, name: Optional[Any] = ...) -> None: ...
|
||||
def app_template_test(self, name: Optional[Any] = ...): ...
|
||||
def add_app_template_test(self, f: Any, name: Optional[Any] = ...) -> None: ...
|
||||
def app_template_global(self, name: Optional[Any] = ...): ...
|
||||
def add_app_template_global(self, f: Any, name: Optional[Any] = ...) -> None: ...
|
||||
def app_template_filter(self, name: Any | None = ...): ...
|
||||
def add_app_template_filter(self, f: Any, name: Any | None = ...) -> None: ...
|
||||
def app_template_test(self, name: Any | None = ...): ...
|
||||
def add_app_template_test(self, f: Any, name: Any | None = ...) -> None: ...
|
||||
def app_template_global(self, name: Any | None = ...): ...
|
||||
def add_app_template_global(self, f: Any, name: Any | None = ...) -> None: ...
|
||||
def before_request(self, f: Any): ...
|
||||
def before_app_request(self, f: Any): ...
|
||||
def before_app_first_request(self, f: Any): ...
|
||||
@@ -74,7 +74,5 @@ class Blueprint(_PackageBoundObject):
|
||||
def url_defaults(self, f: Any): ...
|
||||
def app_url_value_preprocessor(self, f: Any): ...
|
||||
def app_url_defaults(self, f: Any): ...
|
||||
def errorhandler(
|
||||
self, code_or_exception: Union[int, Type[Exception]]
|
||||
) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ...
|
||||
def register_error_handler(self, code_or_exception: Union[int, Type[Exception]], f: Callable[..., Any]) -> None: ...
|
||||
def errorhandler(self, code_or_exception: int | Type[Exception]) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ...
|
||||
def register_error_handler(self, code_or_exception: int | Type[Exception], f: Callable[..., Any]) -> None: ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
import click
|
||||
|
||||
@@ -22,7 +22,7 @@ class ScriptInfo:
|
||||
app_import_path: Any = ...
|
||||
create_app: Any = ...
|
||||
data: Any = ...
|
||||
def __init__(self, app_import_path: Optional[Any] = ..., create_app: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, app_import_path: Any | None = ..., create_app: Any | None = ...) -> None: ...
|
||||
def load_app(self): ...
|
||||
|
||||
pass_script_info: Any
|
||||
@@ -39,7 +39,7 @@ class FlaskGroup(AppGroup):
|
||||
def __init__(
|
||||
self,
|
||||
add_default_commands: bool = ...,
|
||||
create_app: Optional[Any] = ...,
|
||||
create_app: Any | None = ...,
|
||||
add_version_option: bool = ...,
|
||||
load_dotenv: bool = ...,
|
||||
**extra: Any,
|
||||
@@ -48,7 +48,7 @@ class FlaskGroup(AppGroup):
|
||||
def list_commands(self, ctx: Any): ...
|
||||
def main(self, *args: Any, **kwargs: Any): ...
|
||||
|
||||
def load_dotenv(path: Optional[Any] = ...): ...
|
||||
def load_dotenv(path: Any | None = ...): ...
|
||||
def show_server_banner(env: Any, debug: Any, app_import_path: Any, eager_loading: Any): ...
|
||||
|
||||
class CertParamType(click.ParamType):
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
from typing import Any, Dict, Optional
|
||||
from typing import Any, Dict
|
||||
|
||||
class ConfigAttribute:
|
||||
__name__: Any = ...
|
||||
get_converter: Any = ...
|
||||
def __init__(self, name: Any, get_converter: Optional[Any] = ...) -> None: ...
|
||||
def __get__(self, obj: Any, type: Optional[Any] = ...): ...
|
||||
def __init__(self, name: Any, get_converter: Any | None = ...) -> None: ...
|
||||
def __get__(self, obj: Any, type: Any | None = ...): ...
|
||||
def __set__(self, obj: Any, value: Any) -> None: ...
|
||||
|
||||
class Config(Dict[str, Any]):
|
||||
root_path: Any = ...
|
||||
def __init__(self, root_path: Any, defaults: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, root_path: Any, defaults: Any | None = ...) -> None: ...
|
||||
def from_envvar(self, variable_name: Any, silent: bool = ...): ...
|
||||
def from_pyfile(self, filename: Any, silent: bool = ...): ...
|
||||
def from_object(self, obj: Any) -> None: ...
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
class _AppCtxGlobals:
|
||||
def get(self, name: Any, default: Optional[Any] = ...): ...
|
||||
def get(self, name: Any, default: Any | None = ...): ...
|
||||
def pop(self, name: Any, default: Any = ...): ...
|
||||
def setdefault(self, name: Any, default: Optional[Any] = ...): ...
|
||||
def setdefault(self, name: Any, default: Any | None = ...): ...
|
||||
def __contains__(self, item: Any): ...
|
||||
def __iter__(self): ...
|
||||
|
||||
@@ -29,7 +29,7 @@ class RequestContext:
|
||||
flashes: Any = ...
|
||||
session: Any = ...
|
||||
preserved: bool = ...
|
||||
def __init__(self, app: Any, environ: Any, request: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, app: Any, environ: Any, request: Any | None = ...) -> None: ...
|
||||
g: Any = ...
|
||||
def copy(self): ...
|
||||
def match_request(self) -> None: ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
from .cli import AppGroup
|
||||
from .wrappers import Response
|
||||
@@ -14,13 +14,13 @@ def flash(message: Any, category: str = ...) -> None: ...
|
||||
def get_flashed_messages(with_categories: bool = ..., category_filter: Any = ...): ...
|
||||
def send_file(
|
||||
filename_or_fp: Any,
|
||||
mimetype: Optional[Any] = ...,
|
||||
mimetype: Any | None = ...,
|
||||
as_attachment: bool = ...,
|
||||
attachment_filename: Optional[Any] = ...,
|
||||
attachment_filename: Any | None = ...,
|
||||
add_etags: bool = ...,
|
||||
cache_timeout: Optional[Any] = ...,
|
||||
cache_timeout: Any | None = ...,
|
||||
conditional: bool = ...,
|
||||
last_modified: Optional[Any] = ...,
|
||||
last_modified: Any | None = ...,
|
||||
) -> Response: ...
|
||||
def safe_join(directory: Any, *pathnames: Any): ...
|
||||
def send_from_directory(directory: Any, filename: Any, **options: Any) -> Response: ...
|
||||
@@ -33,15 +33,15 @@ class locked_cached_property:
|
||||
__doc__: Any = ...
|
||||
func: Any = ...
|
||||
lock: Any = ...
|
||||
def __init__(self, func: Any, name: Optional[Any] = ..., doc: Optional[Any] = ...) -> None: ...
|
||||
def __get__(self, obj: Any, type: Optional[Any] = ...): ...
|
||||
def __init__(self, func: Any, name: Any | None = ..., doc: Any | None = ...) -> None: ...
|
||||
def __get__(self, obj: Any, type: Any | None = ...): ...
|
||||
|
||||
class _PackageBoundObject:
|
||||
import_name: Any = ...
|
||||
template_folder: Any = ...
|
||||
root_path: Any = ...
|
||||
cli: AppGroup = ...
|
||||
def __init__(self, import_name: Any, template_folder: Optional[Any] = ..., root_path: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, import_name: Any, template_folder: Any | None = ..., root_path: Any | None = ...) -> None: ...
|
||||
static_folder: Any = ...
|
||||
static_url_path: Any = ...
|
||||
@property
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
class JSONTag:
|
||||
key: Any = ...
|
||||
@@ -60,7 +60,7 @@ class TaggedJSONSerializer:
|
||||
tags: Any = ...
|
||||
order: Any = ...
|
||||
def __init__(self) -> None: ...
|
||||
def register(self, tag_class: Any, force: bool = ..., index: Optional[Any] = ...) -> None: ...
|
||||
def register(self, tag_class: Any, force: bool = ..., index: Any | None = ...) -> None: ...
|
||||
def tag(self, value: Any): ...
|
||||
def untag(self, value: Any): ...
|
||||
def dumps(self, value: Any): ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from abc import ABCMeta
|
||||
from typing import Any, MutableMapping, Optional
|
||||
from typing import Any, MutableMapping
|
||||
|
||||
from werkzeug.datastructures import CallbackDict
|
||||
|
||||
@@ -15,10 +15,10 @@ class SessionMixin(MutableMapping[str, Any], metaclass=ABCMeta):
|
||||
class SecureCookieSession(CallbackDict[str, Any], SessionMixin):
|
||||
modified: bool = ...
|
||||
accessed: bool = ...
|
||||
def __init__(self, initial: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, initial: Any | None = ...) -> None: ...
|
||||
def __getitem__(self, key: Any): ...
|
||||
def get(self, key: Any, default: Optional[Any] = ...): ...
|
||||
def setdefault(self, key: Any, default: Optional[Any] = ...): ...
|
||||
def get(self, key: Any, default: Any | None = ...): ...
|
||||
def setdefault(self, key: Any, default: Any | None = ...): ...
|
||||
|
||||
class NullSession(SecureCookieSession):
|
||||
__setitem__: Any = ...
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
signals_available: bool
|
||||
|
||||
class Namespace:
|
||||
def signal(self, name: Any, doc: Optional[Any] = ...): ...
|
||||
def signal(self, name: Any, doc: Any | None = ...): ...
|
||||
|
||||
class _FakeSignal:
|
||||
name: Any = ...
|
||||
__doc__: Any = ...
|
||||
def __init__(self, name: Any, doc: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, name: Any, doc: Any | None = ...) -> None: ...
|
||||
send: Any = ...
|
||||
connect: Any = ...
|
||||
disconnect: Any = ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Iterable, Text, Union
|
||||
from typing import Any, Iterable, Text
|
||||
|
||||
from jinja2 import BaseLoader, Environment as BaseEnvironment
|
||||
|
||||
@@ -12,5 +12,5 @@ class DispatchingJinjaLoader(BaseLoader):
|
||||
def get_source(self, environment: Any, template: Any): ...
|
||||
def list_templates(self): ...
|
||||
|
||||
def render_template(template_name_or_list: Union[Text, Iterable[Text]], **context: Any) -> Text: ...
|
||||
def render_template(template_name_or_list: Text | Iterable[Text], **context: Any) -> Text: ...
|
||||
def render_template_string(source: Text, **context: Any) -> Text: ...
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
from typing import IO, Any, Iterable, Mapping, Optional, Text, TypeVar, Union
|
||||
from typing import IO, Any, Iterable, Mapping, Text, TypeVar
|
||||
|
||||
from click import BaseCommand
|
||||
from click.testing import CliRunner, Result
|
||||
from werkzeug.test import Client, EnvironBuilder as WerkzeugEnvironBuilder
|
||||
|
||||
# Response type for the client below.
|
||||
# By default _R is Tuple[Iterable[Any], Union[Text, int], werkzeug.datastructures.Headers], however
|
||||
# By default _R is Tuple[Iterable[Any], Text | int, werkzeug.datastructures.Headers], however
|
||||
# most commonly it is wrapped in a Reponse object.
|
||||
_R = TypeVar("_R")
|
||||
|
||||
@@ -22,10 +22,10 @@ class FlaskCliRunner(CliRunner):
|
||||
def __init__(self, app: Any, **kwargs: Any) -> None: ...
|
||||
def invoke(
|
||||
self,
|
||||
cli: Optional[BaseCommand] = ...,
|
||||
args: Optional[Union[str, Iterable[str]]] = ...,
|
||||
input: Optional[Union[bytes, IO[Any], Text]] = ...,
|
||||
env: Optional[Mapping[str, str]] = ...,
|
||||
cli: BaseCommand | None = ...,
|
||||
args: str | Iterable[str] | None = ...,
|
||||
input: bytes | IO[Any] | Text | None = ...,
|
||||
env: Mapping[str, str] | None = ...,
|
||||
catch_exceptions: bool = ...,
|
||||
color: bool = ...,
|
||||
**extra: Any,
|
||||
@@ -37,9 +37,9 @@ class EnvironBuilder(WerkzeugEnvironBuilder):
|
||||
self,
|
||||
app: Any,
|
||||
path: str = ...,
|
||||
base_url: Optional[Any] = ...,
|
||||
subdomain: Optional[Any] = ...,
|
||||
url_scheme: Optional[Any] = ...,
|
||||
base_url: Any | None = ...,
|
||||
subdomain: Any | None = ...,
|
||||
url_scheme: Any | None = ...,
|
||||
*args: Any,
|
||||
**kwargs: Any,
|
||||
) -> None: ...
|
||||
@@ -48,9 +48,9 @@ class EnvironBuilder(WerkzeugEnvironBuilder):
|
||||
def make_test_environ_builder(
|
||||
app: Any,
|
||||
path: str = ...,
|
||||
base_url: Optional[Any] = ...,
|
||||
subdomain: Optional[Any] = ...,
|
||||
url_scheme: Optional[Any] = ...,
|
||||
base_url: Any | None = ...,
|
||||
subdomain: Any | None = ...,
|
||||
url_scheme: Any | None = ...,
|
||||
*args: Any,
|
||||
**kwargs: Any,
|
||||
): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Dict, Optional
|
||||
from typing import Any, Dict
|
||||
|
||||
from werkzeug.exceptions import HTTPException
|
||||
from werkzeug.routing import Rule
|
||||
@@ -13,20 +13,20 @@ class JSONMixin:
|
||||
def on_json_loading_failed(self, e: Any) -> None: ...
|
||||
|
||||
class Request(RequestBase, JSONMixin):
|
||||
url_rule: Optional[Rule] = ...
|
||||
url_rule: Rule | None = ...
|
||||
view_args: Dict[str, Any] = ...
|
||||
routing_exception: Optional[HTTPException] = ...
|
||||
routing_exception: HTTPException | None = ...
|
||||
# Request is making the max_content_length readonly, where it was not the
|
||||
# case in its supertype.
|
||||
# We would require something like https://github.com/python/typing/issues/241
|
||||
@property
|
||||
def max_content_length(self) -> Optional[int]: ... # type: ignore
|
||||
def max_content_length(self) -> int | None: ... # type: ignore
|
||||
@property
|
||||
def endpoint(self) -> Optional[str]: ...
|
||||
def endpoint(self) -> str | None: ...
|
||||
@property
|
||||
def blueprint(self) -> Optional[str]: ...
|
||||
def blueprint(self) -> str | None: ...
|
||||
|
||||
class Response(ResponseBase, JSONMixin):
|
||||
default_mimetype: Optional[str] = ...
|
||||
default_mimetype: str | None = ...
|
||||
@property
|
||||
def max_cookie_size(self) -> int: ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Callable, Dict, Generator, Iterable, Iterator, List, Optional, Sequence, Tuple, Union, overload
|
||||
from typing import Any, Callable, Dict, Generator, Iterable, Iterator, List, Sequence, Tuple, overload
|
||||
|
||||
_NDArray = Any # FIXME: no typings for numpy arrays
|
||||
|
||||
@@ -47,8 +47,8 @@ class Client:
|
||||
name: str,
|
||||
use_exact_name: bool = ...,
|
||||
no_start_server: bool = ...,
|
||||
servername: Optional[str] = ...,
|
||||
session_id: Optional[str] = ...,
|
||||
servername: str | None = ...,
|
||||
session_id: str | None = ...,
|
||||
) -> None: ...
|
||||
@property
|
||||
def name(self) -> str: ...
|
||||
@@ -78,13 +78,13 @@ class Client:
|
||||
def midi_inports(self) -> Ports: ...
|
||||
@property
|
||||
def midi_outports(self) -> Ports: ...
|
||||
def owns(self, port: Union[str, Port]) -> bool: ...
|
||||
def owns(self, port: str | Port) -> bool: ...
|
||||
def activate(self) -> None: ...
|
||||
def deactivate(self, ignore_errors: bool = ...) -> None: ...
|
||||
def cpu_load(self) -> float: ...
|
||||
def close(self, ignore_errors: bool = ...) -> None: ...
|
||||
def connect(self, source: Union[str, Port], destination: Union[str, Port]) -> None: ...
|
||||
def disconnect(self, source: Union[str, Port], destination: Union[str, Port]) -> None: ...
|
||||
def connect(self, source: str | Port, destination: str | Port) -> None: ...
|
||||
def disconnect(self, source: str | Port, destination: str | Port) -> None: ...
|
||||
def transport_start(self) -> None: ...
|
||||
def transport_stop(self) -> None: ...
|
||||
@property
|
||||
@@ -106,20 +106,20 @@ class Client:
|
||||
def set_samplerate_callback(self, callback: Callable[[int], None]) -> None: ...
|
||||
def set_client_registration_callback(self, callback: Callable[[str, bool], None]) -> None: ...
|
||||
def set_port_registration_callback(
|
||||
self, callback: Optional[Callable[[Port, bool], None]] = ..., only_available: bool = ...
|
||||
self, callback: Callable[[Port, bool], None] | None = ..., only_available: bool = ...
|
||||
) -> None: ...
|
||||
def set_port_connect_callback(
|
||||
self, callback: Optional[Callable[[Port, Port, bool], None]] = ..., only_available: bool = ...
|
||||
self, callback: Callable[[Port, Port, bool], None] | None = ..., only_available: bool = ...
|
||||
) -> None: ...
|
||||
def set_port_rename_callback(
|
||||
self, callback: Optional[Callable[[Port, str, str], None]] = ..., only_available: bool = ...
|
||||
self, callback: Callable[[Port, str, str], None] | None = ..., only_available: bool = ...
|
||||
) -> None: ...
|
||||
def set_graph_order_callback(self, callback: Callable[[], None]) -> None: ...
|
||||
def set_xrun_callback(self, callback: Callable[[float], None]) -> None: ...
|
||||
def set_sync_callback(self, callback: Optional[Callable[[int, _JackPositionT], None]]) -> None: ...
|
||||
def set_sync_callback(self, callback: Callable[[int, _JackPositionT], None] | None) -> None: ...
|
||||
def release_timebase(self) -> None: ...
|
||||
def set_timebase_callback(
|
||||
self, callback: Optional[Callable[[int, int, _JackPositionT, bool], None]] = ..., conditional: bool = ...
|
||||
self, callback: Callable[[int, int, _JackPositionT, bool], None] | None = ..., conditional: bool = ...
|
||||
) -> bool: ...
|
||||
def set_property_change_callback(self, callback: Callable[[int, str, int], None]) -> None: ...
|
||||
def get_uuid_for_client_name(self, name: str) -> str: ...
|
||||
@@ -137,9 +137,9 @@ class Client:
|
||||
can_monitor: bool = ...,
|
||||
is_terminal: bool = ...,
|
||||
) -> List[Port]: ...
|
||||
def set_property(self, subject: Union[int, str], key: str, value: Union[str, bytes], type: str = ...) -> None: ...
|
||||
def remove_property(self, subject: Union[int, str], key: str) -> None: ...
|
||||
def remove_properties(self, subject: Union[int, str]) -> int: ...
|
||||
def set_property(self, subject: int | str, key: str, value: str | bytes, type: str = ...) -> None: ...
|
||||
def remove_property(self, subject: int | str, key: str) -> None: ...
|
||||
def remove_properties(self, subject: int | str) -> int: ...
|
||||
def remove_all_properties(self) -> None: ...
|
||||
|
||||
class Port:
|
||||
@@ -181,9 +181,9 @@ class OwnPort(Port):
|
||||
def number_of_connections(self) -> int: ...
|
||||
@property
|
||||
def connections(self) -> List[Port]: ...
|
||||
def is_connected_to(self, port: Union[str, Port]) -> bool: ...
|
||||
def connect(self, port: Union[str, Port]) -> None: ...
|
||||
def disconnect(self, other: Optional[Union[str, Port]] = ...) -> None: ...
|
||||
def is_connected_to(self, port: str | Port) -> bool: ...
|
||||
def connect(self, port: str | Port) -> None: ...
|
||||
def disconnect(self, other: str | Port | None = ...) -> None: ...
|
||||
def unregister(self) -> None: ...
|
||||
def get_buffer(self) -> _CBufferType: ...
|
||||
def get_array(self) -> _NDArray: ...
|
||||
@@ -198,7 +198,7 @@ class OwnMidiPort(MidiPort, OwnPort):
|
||||
def lost_midi_events(self) -> int: ...
|
||||
def incoming_midi_events(self) -> Generator[Tuple[int, _CBufferType], None, None]: ...
|
||||
def clear_buffer(self) -> None: ...
|
||||
def write_midi_event(self, time: int, event: Union[bytes, Sequence[int], _CBufferType]) -> None: ...
|
||||
def write_midi_event(self, time: int, event: bytes | Sequence[int] | _CBufferType) -> None: ...
|
||||
def reserve_midi_event(self, time: int, size: int) -> _CBufferType: ...
|
||||
|
||||
class Ports:
|
||||
@@ -213,7 +213,7 @@ class RingBuffer:
|
||||
def __init__(self, size: int) -> None: ...
|
||||
@property
|
||||
def write_space(self) -> int: ...
|
||||
def write(self, data: Union[bytes, Iterable[int], _CBufferType]) -> int: ...
|
||||
def write(self, data: bytes | Iterable[int] | _CBufferType) -> int: ...
|
||||
@property
|
||||
def write_buffers(self) -> Tuple[_CBufferType, _CBufferType]: ...
|
||||
def write_advance(self, size: int) -> None: ...
|
||||
@@ -225,7 +225,7 @@ class RingBuffer:
|
||||
def read_buffers(self) -> Tuple[_CBufferType, _CBufferType]: ...
|
||||
def read_advance(self, size: int) -> None: ...
|
||||
def mlock(self) -> None: ...
|
||||
def reset(self, size: Optional[int] = ...) -> None: ...
|
||||
def reset(self, size: int | None = ...) -> None: ...
|
||||
@property
|
||||
def size(self) -> int: ...
|
||||
|
||||
@@ -265,14 +265,14 @@ class TransportState:
|
||||
|
||||
class CallbackExit(Exception): ...
|
||||
|
||||
def get_property(subject: Union[int, str], key: str) -> Optional[Tuple[bytes, str]]: ...
|
||||
def get_properties(subject: Union[int, str]) -> Dict[str, Tuple[bytes, str]]: ...
|
||||
def get_property(subject: int | str, key: str) -> Tuple[bytes, str] | None: ...
|
||||
def get_properties(subject: int | str) -> Dict[str, Tuple[bytes, str]]: ...
|
||||
def get_all_properties() -> Dict[str, Dict[str, Tuple[bytes, str]]]: ...
|
||||
def position2dict(pos: _JackPositionT) -> Dict[str, Any]: ...
|
||||
def version() -> Tuple[int, int, int, int]: ...
|
||||
def version_string() -> str: ...
|
||||
def client_name_size() -> int: ...
|
||||
def port_name_size() -> int: ...
|
||||
def set_error_function(callback: Optional[Callable[[str], None]] = ...) -> None: ...
|
||||
def set_info_function(callback: Optional[Callable[[str], None]] = ...) -> None: ...
|
||||
def set_error_function(callback: Callable[[str], None] | None = ...) -> None: ...
|
||||
def set_info_function(callback: Callable[[str], None] | None = ...) -> None: ...
|
||||
def client_pid(name: str) -> int: ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
if sys.version_info >= (3,):
|
||||
from urllib.parse import quote_from_bytes
|
||||
@@ -22,7 +22,7 @@ itervalues: Any
|
||||
iteritems: Any
|
||||
NativeStringIO: Any
|
||||
|
||||
def reraise(tp, value, tb: Optional[Any] = ...): ...
|
||||
def reraise(tp, value, tb: Any | None = ...): ...
|
||||
|
||||
ifilter: Any
|
||||
imap: Any
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
marshal_dump: Any
|
||||
marshal_load: Any
|
||||
@@ -21,7 +21,7 @@ class BytecodeCache:
|
||||
def load_bytecode(self, bucket): ...
|
||||
def dump_bytecode(self, bucket): ...
|
||||
def clear(self): ...
|
||||
def get_cache_key(self, name, filename: Optional[Any] = ...): ...
|
||||
def get_cache_key(self, name, filename: Any | None = ...): ...
|
||||
def get_source_checksum(self, source): ...
|
||||
def get_bucket(self, environment, name, filename, source): ...
|
||||
def set_bucket(self, bucket): ...
|
||||
@@ -29,7 +29,7 @@ class BytecodeCache:
|
||||
class FileSystemBytecodeCache(BytecodeCache):
|
||||
directory: Any
|
||||
pattern: Any
|
||||
def __init__(self, directory: Optional[Any] = ..., pattern: str = ...) -> None: ...
|
||||
def __init__(self, directory: Any | None = ..., pattern: str = ...) -> None: ...
|
||||
def load_bytecode(self, bucket): ...
|
||||
def dump_bytecode(self, bucket): ...
|
||||
def clear(self): ...
|
||||
@@ -39,6 +39,6 @@ class MemcachedBytecodeCache(BytecodeCache):
|
||||
prefix: Any
|
||||
timeout: Any
|
||||
ignore_memcache_errors: Any
|
||||
def __init__(self, client, prefix: str = ..., timeout: Optional[Any] = ..., ignore_memcache_errors: bool = ...) -> None: ...
|
||||
def __init__(self, client, prefix: str = ..., timeout: Any | None = ..., ignore_memcache_errors: bool = ...) -> None: ...
|
||||
def load_bytecode(self, bucket): ...
|
||||
def dump_bytecode(self, bucket): ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from keyword import iskeyword as is_python_keyword
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
from jinja2.visitor import NodeVisitor
|
||||
|
||||
@@ -8,7 +8,7 @@ dict_item_iter: str
|
||||
|
||||
unoptimize_before_dead_code: bool
|
||||
|
||||
def generate(node, environment, name, filename, stream: Optional[Any] = ..., defer_init: bool = ...): ...
|
||||
def generate(node, environment, name, filename, stream: Any | None = ..., defer_init: bool = ...): ...
|
||||
def has_safe_repr(value): ...
|
||||
def find_undeclared(nodes, names): ...
|
||||
|
||||
@@ -33,7 +33,7 @@ class Frame:
|
||||
block: Any
|
||||
assigned_names: Any
|
||||
parent: Any
|
||||
def __init__(self, eval_ctx, parent: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, eval_ctx, parent: Any | None = ...) -> None: ...
|
||||
def copy(self): ...
|
||||
def inspect(self, nodes): ...
|
||||
def find_shadowed(self, extra: Any = ...): ...
|
||||
@@ -91,31 +91,31 @@ class CodeGenerator(NodeVisitor):
|
||||
tests: Any
|
||||
filters: Any
|
||||
debug_info: Any
|
||||
def __init__(self, environment, name, filename, stream: Optional[Any] = ..., defer_init: bool = ...) -> None: ...
|
||||
def __init__(self, environment, name, filename, stream: Any | None = ..., defer_init: bool = ...) -> None: ...
|
||||
def fail(self, msg, lineno): ...
|
||||
def temporary_identifier(self): ...
|
||||
def buffer(self, frame): ...
|
||||
def return_buffer_contents(self, frame): ...
|
||||
def indent(self): ...
|
||||
def outdent(self, step: int = ...): ...
|
||||
def start_write(self, frame, node: Optional[Any] = ...): ...
|
||||
def start_write(self, frame, node: Any | None = ...): ...
|
||||
def end_write(self, frame): ...
|
||||
def simple_write(self, s, frame, node: Optional[Any] = ...): ...
|
||||
def simple_write(self, s, frame, node: Any | None = ...): ...
|
||||
def blockvisit(self, nodes, frame): ...
|
||||
def write(self, x): ...
|
||||
def writeline(self, x, node: Optional[Any] = ..., extra: int = ...): ...
|
||||
def newline(self, node: Optional[Any] = ..., extra: int = ...): ...
|
||||
def signature(self, node, frame, extra_kwargs: Optional[Any] = ...): ...
|
||||
def writeline(self, x, node: Any | None = ..., extra: int = ...): ...
|
||||
def newline(self, node: Any | None = ..., extra: int = ...): ...
|
||||
def signature(self, node, frame, extra_kwargs: Any | None = ...): ...
|
||||
def pull_locals(self, frame): ...
|
||||
def pull_dependencies(self, nodes): ...
|
||||
def unoptimize_scope(self, frame): ...
|
||||
def push_scope(self, frame, extra_vars: Any = ...): ...
|
||||
def pop_scope(self, aliases, frame): ...
|
||||
def function_scoping(self, node, frame, children: Optional[Any] = ..., find_special: bool = ...): ...
|
||||
def macro_body(self, node, frame, children: Optional[Any] = ...): ...
|
||||
def function_scoping(self, node, frame, children: Any | None = ..., find_special: bool = ...): ...
|
||||
def macro_body(self, node, frame, children: Any | None = ...): ...
|
||||
def macro_def(self, node, frame): ...
|
||||
def position(self, node): ...
|
||||
def visit_Template(self, node, frame: Optional[Any] = ...): ...
|
||||
def visit_Template(self, node, frame: Any | None = ...): ...
|
||||
def visit_Block(self, node, frame): ...
|
||||
def visit_Extends(self, node, frame): ...
|
||||
def visit_Include(self, node, frame): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
tproxy: Any
|
||||
raise_helper: str
|
||||
@@ -20,7 +20,7 @@ class ProcessedTraceback:
|
||||
exc_value: Any
|
||||
frames: Any
|
||||
def __init__(self, exc_type, exc_value, frames) -> None: ...
|
||||
def render_as_text(self, limit: Optional[Any] = ...): ...
|
||||
def render_as_text(self, limit: Any | None = ...): ...
|
||||
def render_as_html(self, full: bool = ...): ...
|
||||
@property
|
||||
def is_template_syntax_error(self): ...
|
||||
@@ -29,8 +29,8 @@ class ProcessedTraceback:
|
||||
@property
|
||||
def standard_exc_info(self): ...
|
||||
|
||||
def make_traceback(exc_info, source_hint: Optional[Any] = ...): ...
|
||||
def translate_syntax_error(error, source: Optional[Any] = ...): ...
|
||||
def make_traceback(exc_info, source_hint: Any | None = ...): ...
|
||||
def translate_syntax_error(error, source: Any | None = ...): ...
|
||||
def translate_exception(exc_info, initial_skip: int = ...): ...
|
||||
def fake_exc_info(exc_info, filename, lineno): ...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Dict, Optional
|
||||
from typing import Any, Dict
|
||||
|
||||
from jinja2.filters import FILTERS
|
||||
from jinja2.tests import TESTS
|
||||
@@ -12,8 +12,8 @@ VARIABLE_START_STRING: str
|
||||
VARIABLE_END_STRING: str
|
||||
COMMENT_START_STRING: str
|
||||
COMMENT_END_STRING: str
|
||||
LINE_STATEMENT_PREFIX: Optional[str]
|
||||
LINE_COMMENT_PREFIX: Optional[str]
|
||||
LINE_STATEMENT_PREFIX: str | None
|
||||
LINE_COMMENT_PREFIX: str | None
|
||||
TRIM_BLOCKS: bool
|
||||
LSTRIP_BLOCKS: bool
|
||||
NEWLINE_SEQUENCE: str
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Sequence, Text, Type, Union
|
||||
from typing import Any, Callable, Dict, Iterator, List, Sequence, Text, Type
|
||||
|
||||
from .bccache import BytecodeCache
|
||||
from .loaders import BaseLoader
|
||||
@@ -63,12 +63,12 @@ class Environment:
|
||||
extensions: List[Any] = ...,
|
||||
optimized: bool = ...,
|
||||
undefined: Type[Undefined] = ...,
|
||||
finalize: Optional[Callable[..., Any]] = ...,
|
||||
autoescape: Union[bool, Callable[[str], bool]] = ...,
|
||||
loader: Optional[BaseLoader] = ...,
|
||||
finalize: Callable[..., Any] | None = ...,
|
||||
autoescape: bool | Callable[[str], bool] = ...,
|
||||
loader: BaseLoader | None = ...,
|
||||
cache_size: int = ...,
|
||||
auto_reload: bool = ...,
|
||||
bytecode_cache: Optional[BytecodeCache] = ...,
|
||||
bytecode_cache: BytecodeCache | None = ...,
|
||||
enable_async: bool = ...,
|
||||
) -> None: ...
|
||||
def add_extension(self, extension): ...
|
||||
@@ -90,75 +90,65 @@ class Environment:
|
||||
undefined: Type[Undefined] = ...,
|
||||
finalize: Callable[..., Any] = ...,
|
||||
autoescape: bool = ...,
|
||||
loader: Optional[BaseLoader] = ...,
|
||||
loader: BaseLoader | None = ...,
|
||||
cache_size: int = ...,
|
||||
auto_reload: bool = ...,
|
||||
bytecode_cache: Optional[BytecodeCache] = ...,
|
||||
bytecode_cache: BytecodeCache | None = ...,
|
||||
): ...
|
||||
lexer: Any
|
||||
def iter_extensions(self): ...
|
||||
def getitem(self, obj, argument): ...
|
||||
def getattr(self, obj, attribute): ...
|
||||
def call_filter(
|
||||
self,
|
||||
name,
|
||||
value,
|
||||
args: Optional[Any] = ...,
|
||||
kwargs: Optional[Any] = ...,
|
||||
context: Optional[Any] = ...,
|
||||
eval_ctx: Optional[Any] = ...,
|
||||
): ...
|
||||
def call_test(self, name, value, args: Optional[Any] = ..., kwargs: Optional[Any] = ...): ...
|
||||
def parse(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ...): ...
|
||||
def lex(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ...): ...
|
||||
def preprocess(self, source: Text, name: Optional[Any] = ..., filename: Optional[Any] = ...): ...
|
||||
def compile(
|
||||
self, source, name: Optional[Any] = ..., filename: Optional[Any] = ..., raw: bool = ..., defer_init: bool = ...
|
||||
self, name, value, args: Any | None = ..., kwargs: Any | None = ..., context: Any | None = ..., eval_ctx: Any | None = ...
|
||||
): ...
|
||||
def call_test(self, name, value, args: Any | None = ..., kwargs: Any | None = ...): ...
|
||||
def parse(self, source, name: Any | None = ..., filename: Any | None = ...): ...
|
||||
def lex(self, source, name: Any | None = ..., filename: Any | None = ...): ...
|
||||
def preprocess(self, source: Text, name: Any | None = ..., filename: Any | None = ...): ...
|
||||
def compile(self, source, name: Any | None = ..., filename: Any | None = ..., raw: bool = ..., defer_init: bool = ...): ...
|
||||
def compile_expression(self, source: Text, undefined_to_none: bool = ...): ...
|
||||
def compile_templates(
|
||||
self,
|
||||
target,
|
||||
extensions: Optional[Any] = ...,
|
||||
filter_func: Optional[Any] = ...,
|
||||
extensions: Any | None = ...,
|
||||
filter_func: Any | None = ...,
|
||||
zip: str = ...,
|
||||
log_function: Optional[Any] = ...,
|
||||
log_function: Any | None = ...,
|
||||
ignore_errors: bool = ...,
|
||||
py_compile: bool = ...,
|
||||
): ...
|
||||
def list_templates(self, extensions: Optional[Any] = ..., filter_func: Optional[Any] = ...): ...
|
||||
def handle_exception(self, exc_info: Optional[Any] = ..., rendered: bool = ..., source_hint: Optional[Any] = ...): ...
|
||||
def join_path(self, template: Union[Template, Text], parent: Text) -> Text: ...
|
||||
def get_template(
|
||||
self, name: Union[Template, Text], parent: Optional[Text] = ..., globals: Optional[Any] = ...
|
||||
) -> Template: ...
|
||||
def list_templates(self, extensions: Any | None = ..., filter_func: Any | None = ...): ...
|
||||
def handle_exception(self, exc_info: Any | None = ..., rendered: bool = ..., source_hint: Any | None = ...): ...
|
||||
def join_path(self, template: Template | Text, parent: Text) -> Text: ...
|
||||
def get_template(self, name: Template | Text, parent: Text | None = ..., globals: Any | None = ...) -> Template: ...
|
||||
def select_template(
|
||||
self, names: Sequence[Union[Template, Text]], parent: Optional[Text] = ..., globals: Optional[Dict[str, Any]] = ...
|
||||
self, names: Sequence[Template | Text], parent: Text | None = ..., globals: Dict[str, Any] | None = ...
|
||||
) -> Template: ...
|
||||
def get_or_select_template(
|
||||
self,
|
||||
template_name_or_list: Union[Union[Template, Text], Sequence[Union[Template, Text]]],
|
||||
parent: Optional[Text] = ...,
|
||||
globals: Optional[Dict[str, Any]] = ...,
|
||||
template_name_or_list: Template | Text | Sequence[Template | Text],
|
||||
parent: Text | None = ...,
|
||||
globals: Dict[str, Any] | None = ...,
|
||||
) -> Template: ...
|
||||
def from_string(
|
||||
self, source: Text, globals: Optional[Dict[str, Any]] = ..., template_class: Optional[Type[Template]] = ...
|
||||
self, source: Text, globals: Dict[str, Any] | None = ..., template_class: Type[Template] | None = ...
|
||||
) -> Template: ...
|
||||
def make_globals(self, d: Optional[Dict[str, Any]]) -> Dict[str, Any]: ...
|
||||
def make_globals(self, d: Dict[str, Any] | None) -> Dict[str, Any]: ...
|
||||
# Frequently added extensions are included here:
|
||||
# from InternationalizationExtension:
|
||||
def install_gettext_translations(self, translations: Any, newstyle: Optional[bool] = ...): ...
|
||||
def install_null_translations(self, newstyle: Optional[bool] = ...): ...
|
||||
def install_gettext_translations(self, translations: Any, newstyle: bool | None = ...): ...
|
||||
def install_null_translations(self, newstyle: bool | None = ...): ...
|
||||
def install_gettext_callables(
|
||||
self, gettext: Callable[..., Any], ngettext: Callable[..., Any], newstyle: Optional[bool] = ...
|
||||
self, gettext: Callable[..., Any], ngettext: Callable[..., Any], newstyle: bool | None = ...
|
||||
): ...
|
||||
def uninstall_gettext_translations(self, translations: Any): ...
|
||||
def extract_translations(self, source: Any, gettext_functions: Any): ...
|
||||
newstyle_gettext: bool
|
||||
|
||||
class Template:
|
||||
name: Optional[str]
|
||||
filename: Optional[str]
|
||||
name: str | None
|
||||
filename: str | None
|
||||
def __new__(
|
||||
cls,
|
||||
source,
|
||||
@@ -177,22 +167,22 @@ class Template:
|
||||
extensions: Any = ...,
|
||||
optimized: bool = ...,
|
||||
undefined: Any = ...,
|
||||
finalize: Optional[Any] = ...,
|
||||
finalize: Any | None = ...,
|
||||
autoescape: bool = ...,
|
||||
): ...
|
||||
environment: Environment = ...
|
||||
@classmethod
|
||||
def from_code(cls, environment, code, globals, uptodate: Optional[Any] = ...): ...
|
||||
def from_code(cls, environment, code, globals, uptodate: Any | None = ...): ...
|
||||
@classmethod
|
||||
def from_module_dict(cls, environment, module_dict, globals): ...
|
||||
def render(self, *args, **kwargs) -> Text: ...
|
||||
def stream(self, *args, **kwargs) -> TemplateStream: ...
|
||||
def generate(self, *args, **kwargs) -> Iterator[Text]: ...
|
||||
def new_context(
|
||||
self, vars: Optional[Dict[str, Any]] = ..., shared: bool = ..., locals: Optional[Dict[str, Any]] = ...
|
||||
self, vars: Dict[str, Any] | None = ..., shared: bool = ..., locals: Dict[str, Any] | None = ...
|
||||
) -> Context: ...
|
||||
def make_module(
|
||||
self, vars: Optional[Dict[str, Any]] = ..., shared: bool = ..., locals: Optional[Dict[str, Any]] = ...
|
||||
self, vars: Dict[str, Any] | None = ..., shared: bool = ..., locals: Dict[str, Any] | None = ...
|
||||
) -> Context: ...
|
||||
@property
|
||||
def module(self) -> Any: ...
|
||||
@@ -216,7 +206,7 @@ class TemplateExpression:
|
||||
|
||||
class TemplateStream:
|
||||
def __init__(self, gen) -> None: ...
|
||||
def dump(self, fp, encoding: Optional[Text] = ..., errors: Text = ...): ...
|
||||
def dump(self, fp, encoding: Text | None = ..., errors: Text = ...): ...
|
||||
buffered: bool
|
||||
def disable_buffering(self) -> None: ...
|
||||
def enable_buffering(self, size: int = ...) -> None: ...
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Any, Optional, Text
|
||||
from typing import Any, Text
|
||||
|
||||
class TemplateError(Exception):
|
||||
def __init__(self, message: Optional[Text] = ...) -> None: ...
|
||||
def __init__(self, message: Text | None = ...) -> None: ...
|
||||
@property
|
||||
def message(self): ...
|
||||
def __unicode__(self): ...
|
||||
@@ -10,11 +10,11 @@ class TemplateNotFound(IOError, LookupError, TemplateError):
|
||||
message: Any
|
||||
name: Any
|
||||
templates: Any
|
||||
def __init__(self, name, message: Optional[Text] = ...) -> None: ...
|
||||
def __init__(self, name, message: Text | None = ...) -> None: ...
|
||||
|
||||
class TemplatesNotFound(TemplateNotFound):
|
||||
templates: Any
|
||||
def __init__(self, names: Any = ..., message: Optional[Text] = ...) -> None: ...
|
||||
def __init__(self, names: Any = ..., message: Text | None = ...) -> None: ...
|
||||
|
||||
class TemplateSyntaxError(TemplateError):
|
||||
lineno: int
|
||||
@@ -22,7 +22,7 @@ class TemplateSyntaxError(TemplateError):
|
||||
filename: Text
|
||||
source: Text
|
||||
translated: bool
|
||||
def __init__(self, message: Text, lineno: int, name: Optional[Text] = ..., filename: Optional[Text] = ...) -> None: ...
|
||||
def __init__(self, message: Text, lineno: int, name: Text | None = ..., filename: Text | None = ...) -> None: ...
|
||||
|
||||
class TemplateAssertionError(TemplateSyntaxError): ...
|
||||
class TemplateRuntimeError(TemplateError): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
GETTEXT_FUNCTIONS: Any
|
||||
|
||||
@@ -11,18 +11,18 @@ class Extension:
|
||||
environment: Any
|
||||
def __init__(self, environment) -> None: ...
|
||||
def bind(self, environment): ...
|
||||
def preprocess(self, source, name, filename: Optional[Any] = ...): ...
|
||||
def preprocess(self, source, name, filename: Any | None = ...): ...
|
||||
def filter_stream(self, stream): ...
|
||||
def parse(self, parser): ...
|
||||
def attr(self, name, lineno: Optional[Any] = ...): ...
|
||||
def attr(self, name, lineno: Any | None = ...): ...
|
||||
def call_method(
|
||||
self,
|
||||
name,
|
||||
args: Optional[Any] = ...,
|
||||
kwargs: Optional[Any] = ...,
|
||||
dyn_args: Optional[Any] = ...,
|
||||
dyn_kwargs: Optional[Any] = ...,
|
||||
lineno: Optional[Any] = ...,
|
||||
args: Any | None = ...,
|
||||
kwargs: Any | None = ...,
|
||||
dyn_args: Any | None = ...,
|
||||
dyn_kwargs: Any | None = ...,
|
||||
lineno: Any | None = ...,
|
||||
): ...
|
||||
|
||||
class InternationalizationExtension(Extension):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, NamedTuple, Optional
|
||||
from typing import Any, NamedTuple
|
||||
|
||||
def contextfilter(f): ...
|
||||
def evalcontextfilter(f): ...
|
||||
@@ -6,34 +6,34 @@ def environmentfilter(f): ...
|
||||
def make_attrgetter(environment, attribute): ...
|
||||
def do_forceescape(value): ...
|
||||
def do_urlencode(value): ...
|
||||
def do_replace(eval_ctx, s, old, new, count: Optional[Any] = ...): ...
|
||||
def do_replace(eval_ctx, s, old, new, count: Any | None = ...): ...
|
||||
def do_upper(s): ...
|
||||
def do_lower(s): ...
|
||||
def do_xmlattr(_eval_ctx, d, autospace: bool = ...): ...
|
||||
def do_capitalize(s): ...
|
||||
def do_title(s): ...
|
||||
def do_dictsort(value, case_sensitive: bool = ..., by: str = ...): ...
|
||||
def do_sort(environment, value, reverse: bool = ..., case_sensitive: bool = ..., attribute: Optional[Any] = ...): ...
|
||||
def do_sort(environment, value, reverse: bool = ..., case_sensitive: bool = ..., attribute: Any | None = ...): ...
|
||||
def do_default(value, default_value: str = ..., boolean: bool = ...): ...
|
||||
def do_join(eval_ctx, value, d: str = ..., attribute: Optional[Any] = ...): ...
|
||||
def do_join(eval_ctx, value, d: str = ..., attribute: Any | None = ...): ...
|
||||
def do_center(value, width: int = ...): ...
|
||||
def do_first(environment, seq): ...
|
||||
def do_last(environment, seq): ...
|
||||
def do_random(environment, seq): ...
|
||||
def do_filesizeformat(value, binary: bool = ...): ...
|
||||
def do_pprint(value, verbose: bool = ...): ...
|
||||
def do_urlize(eval_ctx, value, trim_url_limit: Optional[Any] = ..., nofollow: bool = ..., target: Optional[Any] = ...): ...
|
||||
def do_urlize(eval_ctx, value, trim_url_limit: Any | None = ..., nofollow: bool = ..., target: Any | None = ...): ...
|
||||
def do_indent(s, width: int = ..., indentfirst: bool = ...): ...
|
||||
def do_truncate(s, length: int = ..., killwords: bool = ..., end: str = ...): ...
|
||||
def do_wordwrap(environment, s, width: int = ..., break_long_words: bool = ..., wrapstring: Optional[Any] = ...): ...
|
||||
def do_wordwrap(environment, s, width: int = ..., break_long_words: bool = ..., wrapstring: Any | None = ...): ...
|
||||
def do_wordcount(s): ...
|
||||
def do_int(value, default: int = ..., base: int = ...): ...
|
||||
def do_float(value, default: float = ...): ...
|
||||
def do_format(value, *args, **kwargs): ...
|
||||
def do_trim(value): ...
|
||||
def do_striptags(value): ...
|
||||
def do_slice(value, slices, fill_with: Optional[Any] = ...): ...
|
||||
def do_batch(value, linecount, fill_with: Optional[Any] = ...): ...
|
||||
def do_slice(value, slices, fill_with: Any | None = ...): ...
|
||||
def do_batch(value, linecount, fill_with: Any | None = ...): ...
|
||||
def do_round(value, precision: int = ..., method: str = ...): ...
|
||||
def do_groupby(environment, value, attribute): ...
|
||||
|
||||
@@ -41,7 +41,7 @@ class _GroupTuple(NamedTuple):
|
||||
grouper: Any
|
||||
list: Any
|
||||
|
||||
def do_sum(environment, iterable, attribute: Optional[Any] = ..., start: int = ...): ...
|
||||
def do_sum(environment, iterable, attribute: Any | None = ..., start: int = ...): ...
|
||||
def do_list(value): ...
|
||||
def do_mark_safe(value): ...
|
||||
def do_mark_unsafe(value): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional, Tuple
|
||||
from typing import Any, Tuple
|
||||
|
||||
whitespace_re: Any
|
||||
string_re: Any
|
||||
@@ -112,6 +112,6 @@ class Lexer:
|
||||
keep_trailing_newline: Any
|
||||
rules: Any
|
||||
def __init__(self, environment) -> None: ...
|
||||
def tokenize(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ..., state: Optional[Any] = ...): ...
|
||||
def wrap(self, stream, name: Optional[Any] = ..., filename: Optional[Any] = ...): ...
|
||||
def tokeniter(self, source, name, filename: Optional[Any] = ..., state: Optional[Any] = ...): ...
|
||||
def tokenize(self, source, name: Any | None = ..., filename: Any | None = ..., state: Any | None = ...): ...
|
||||
def wrap(self, stream, name: Any | None = ..., filename: Any | None = ...): ...
|
||||
def tokeniter(self, source, name, filename: Any | None = ..., state: Any | None = ...): ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from types import ModuleType
|
||||
from typing import Any, Callable, Iterable, List, Optional, Text, Tuple, Union
|
||||
from typing import Any, Callable, Iterable, List, Text, Tuple, Union
|
||||
|
||||
from .environment import Environment
|
||||
|
||||
@@ -17,7 +17,7 @@ class BaseLoader:
|
||||
has_source_access: bool
|
||||
def get_source(self, environment, template): ...
|
||||
def list_templates(self): ...
|
||||
def load(self, environment, name, globals: Optional[Any] = ...): ...
|
||||
def load(self, environment, name, globals: Any | None = ...): ...
|
||||
|
||||
class FileSystemLoader(BaseLoader):
|
||||
searchpath: Text
|
||||
@@ -46,9 +46,7 @@ class DictLoader(BaseLoader):
|
||||
class FunctionLoader(BaseLoader):
|
||||
load_func: Any
|
||||
def __init__(self, load_func) -> None: ...
|
||||
def get_source(
|
||||
self, environment: Environment, template: Text
|
||||
) -> Tuple[Text, Optional[Text], Optional[Callable[..., Any]]]: ...
|
||||
def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text | None, Callable[..., Any] | None]: ...
|
||||
|
||||
class PrefixLoader(BaseLoader):
|
||||
mapping: Any
|
||||
@@ -56,14 +54,14 @@ class PrefixLoader(BaseLoader):
|
||||
def __init__(self, mapping, delimiter: str = ...) -> None: ...
|
||||
def get_loader(self, template): ...
|
||||
def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable[..., Any]]: ...
|
||||
def load(self, environment, name, globals: Optional[Any] = ...): ...
|
||||
def load(self, environment, name, globals: Any | None = ...): ...
|
||||
def list_templates(self): ...
|
||||
|
||||
class ChoiceLoader(BaseLoader):
|
||||
loaders: Any
|
||||
def __init__(self, loaders) -> None: ...
|
||||
def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable[..., Any]]: ...
|
||||
def load(self, environment, name, globals: Optional[Any] = ...): ...
|
||||
def load(self, environment, name, globals: Any | None = ...): ...
|
||||
def list_templates(self): ...
|
||||
|
||||
class _TemplateModule(ModuleType): ...
|
||||
@@ -77,4 +75,4 @@ class ModuleLoader(BaseLoader):
|
||||
def get_template_key(name): ...
|
||||
@staticmethod
|
||||
def get_module_filename(name): ...
|
||||
def load(self, environment, name, globals: Optional[Any] = ...): ...
|
||||
def load(self, environment, name, globals: Any | None = ...): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
class Parser:
|
||||
environment: Any
|
||||
@@ -8,13 +8,13 @@ class Parser:
|
||||
closed: bool
|
||||
extensions: Any
|
||||
def __init__(
|
||||
self, environment, source, name: Optional[Any] = ..., filename: Optional[Any] = ..., state: Optional[Any] = ...
|
||||
self, environment, source, name: Any | None = ..., filename: Any | None = ..., state: Any | None = ...
|
||||
) -> None: ...
|
||||
def fail(self, msg, lineno: Optional[Any] = ..., exc: Any = ...): ...
|
||||
def fail_unknown_tag(self, name, lineno: Optional[Any] = ...): ...
|
||||
def fail_eof(self, end_tokens: Optional[Any] = ..., lineno: Optional[Any] = ...): ...
|
||||
def is_tuple_end(self, extra_end_rules: Optional[Any] = ...): ...
|
||||
def free_identifier(self, lineno: Optional[Any] = ...): ...
|
||||
def fail(self, msg, lineno: Any | None = ..., exc: Any = ...): ...
|
||||
def fail_unknown_tag(self, name, lineno: Any | None = ...): ...
|
||||
def fail_eof(self, end_tokens: Any | None = ..., lineno: Any | None = ...): ...
|
||||
def is_tuple_end(self, extra_end_rules: Any | None = ...): ...
|
||||
def free_identifier(self, lineno: Any | None = ...): ...
|
||||
def parse_statement(self): ...
|
||||
def parse_statements(self, end_tokens, drop_needle: bool = ...): ...
|
||||
def parse_set(self): ...
|
||||
@@ -31,7 +31,7 @@ class Parser:
|
||||
def parse_filter_block(self): ...
|
||||
def parse_macro(self): ...
|
||||
def parse_print(self): ...
|
||||
def parse_assign_target(self, with_tuple: bool = ..., name_only: bool = ..., extra_end_rules: Optional[Any] = ...): ...
|
||||
def parse_assign_target(self, with_tuple: bool = ..., name_only: bool = ..., extra_end_rules: Any | None = ...): ...
|
||||
def parse_expression(self, with_condexpr: bool = ...): ...
|
||||
def parse_condexpr(self): ...
|
||||
def parse_or(self): ...
|
||||
@@ -52,7 +52,7 @@ class Parser:
|
||||
self,
|
||||
simplified: bool = ...,
|
||||
with_condexpr: bool = ...,
|
||||
extra_end_rules: Optional[Any] = ...,
|
||||
extra_end_rules: Any | None = ...,
|
||||
explicit_parentheses: bool = ...,
|
||||
): ...
|
||||
def parse_list(self): ...
|
||||
@@ -64,5 +64,5 @@ class Parser:
|
||||
def parse_call(self, node): ...
|
||||
def parse_filter(self, node, start_inline: bool = ...): ...
|
||||
def parse_test(self, node): ...
|
||||
def subparse(self, end_tokens: Optional[Any] = ...): ...
|
||||
def subparse(self, end_tokens: Any | None = ...): ...
|
||||
def parse(self): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Dict, Optional, Text, Union
|
||||
from typing import Any, Dict, Text
|
||||
|
||||
from jinja2.environment import Environment
|
||||
from jinja2.exceptions import TemplateNotFound as TemplateNotFound, TemplateRuntimeError as TemplateRuntimeError
|
||||
@@ -15,7 +15,7 @@ class TemplateReference:
|
||||
def __getitem__(self, name): ...
|
||||
|
||||
class Context:
|
||||
parent: Union[Context, Dict[str, Any]]
|
||||
parent: Context | Dict[str, Any]
|
||||
vars: Dict[str, Any]
|
||||
environment: Environment
|
||||
eval_ctx: Any
|
||||
@@ -23,15 +23,15 @@ class Context:
|
||||
name: Text
|
||||
blocks: Dict[str, Any]
|
||||
def __init__(
|
||||
self, environment: Environment, parent: Union[Context, Dict[str, Any]], name: Text, blocks: Dict[str, Any]
|
||||
self, environment: Environment, parent: Context | Dict[str, Any], name: Text, blocks: Dict[str, Any]
|
||||
) -> None: ...
|
||||
def super(self, name, current): ...
|
||||
def get(self, key, default: Optional[Any] = ...): ...
|
||||
def get(self, key, default: Any | None = ...): ...
|
||||
def resolve(self, key): ...
|
||||
def get_exported(self): ...
|
||||
def get_all(self): ...
|
||||
def call(__self, __obj, *args, **kwargs): ...
|
||||
def derived(self, locals: Optional[Any] = ...): ...
|
||||
def derived(self, locals: Any | None = ...): ...
|
||||
keys: Any
|
||||
values: Any
|
||||
items: Any
|
||||
@@ -51,7 +51,7 @@ class BlockReference:
|
||||
class LoopContext:
|
||||
index0: int
|
||||
depth0: Any
|
||||
def __init__(self, iterable, recurse: Optional[Any] = ..., depth0: int = ...) -> None: ...
|
||||
def __init__(self, iterable, recurse: Any | None = ..., depth0: int = ...) -> None: ...
|
||||
def cycle(self, *args): ...
|
||||
first: Any
|
||||
last: Any
|
||||
@@ -83,7 +83,7 @@ class Macro:
|
||||
def __call__(self, *args, **kwargs): ...
|
||||
|
||||
class Undefined:
|
||||
def __init__(self, hint: Optional[Any] = ..., obj: Any = ..., name: Optional[Any] = ..., exc: Any = ...) -> None: ...
|
||||
def __init__(self, hint: Any | None = ..., obj: Any = ..., name: Any | None = ..., exc: Any = ...) -> None: ...
|
||||
def __getattr__(self, name): ...
|
||||
__add__: Any
|
||||
__radd__: Any
|
||||
@@ -118,7 +118,7 @@ class Undefined:
|
||||
def __nonzero__(self): ...
|
||||
__bool__: Any
|
||||
|
||||
def make_logging_undefined(logger: Optional[Any] = ..., base: Optional[Any] = ...): ...
|
||||
def make_logging_undefined(logger: Any | None = ..., base: Any | None = ...): ...
|
||||
|
||||
class DebugUndefined(Undefined): ...
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from _typeshed import StrOrBytesPath
|
||||
from typing import IO, Any, Callable, Iterable, Optional, Protocol, Text, TypeVar, Union
|
||||
from typing import IO, Any, Callable, Iterable, Protocol, Text, TypeVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from markupsafe import Markup as Markup, escape as escape, soft_unicode as soft_unicode
|
||||
@@ -36,16 +36,13 @@ def select_autoescape(
|
||||
def consume(iterable: Iterable[object]) -> None: ...
|
||||
def clear_caches() -> None: ...
|
||||
def import_string(import_name: str, silent: bool = ...) -> Any: ...
|
||||
def open_if_exists(filename: StrOrBytesPath, mode: str = ...) -> Optional[IO[Any]]: ...
|
||||
def open_if_exists(filename: StrOrBytesPath, mode: str = ...) -> IO[Any] | None: ...
|
||||
def object_type_repr(obj: object) -> str: ...
|
||||
def pformat(obj: object, verbose: bool = ...) -> str: ...
|
||||
def urlize(
|
||||
text: Union[Markup, Text],
|
||||
trim_url_limit: Optional[int] = ...,
|
||||
rel: Optional[Union[Markup, Text]] = ...,
|
||||
target: Optional[Union[Markup, Text]] = ...,
|
||||
text: Markup | Text, trim_url_limit: int | None = ..., rel: Markup | Text | None = ..., target: Markup | Text | None = ...
|
||||
) -> str: ...
|
||||
def generate_lorem_ipsum(n: int = ..., html: bool = ..., min: int = ..., max: int = ...) -> Union[Markup, str]: ...
|
||||
def generate_lorem_ipsum(n: int = ..., html: bool = ..., min: int = ..., max: int = ...) -> Markup | str: ...
|
||||
def unicode_urlencode(obj: object, charset: str = ..., for_qs: bool = ...) -> str: ...
|
||||
|
||||
class LRUCache:
|
||||
@@ -53,8 +50,8 @@ class LRUCache:
|
||||
def __init__(self, capacity) -> None: ...
|
||||
def __getnewargs__(self): ...
|
||||
def copy(self): ...
|
||||
def get(self, key, default: Optional[Any] = ...): ...
|
||||
def setdefault(self, key, default: Optional[Any] = ...): ...
|
||||
def get(self, key, default: Any | None = ...): ...
|
||||
def setdefault(self, key, default: Any | None = ...): ...
|
||||
def clear(self): ...
|
||||
def __contains__(self, key): ...
|
||||
def __len__(self): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, BinaryIO, Callable, ClassVar, Dict, List, Mapping, Optional, Sequence, Text, TextIO, Union
|
||||
from typing import Any, BinaryIO, Callable, ClassVar, Dict, List, Mapping, Sequence, Text, TextIO
|
||||
from typing_extensions import Literal
|
||||
from xml.etree.ElementTree import Element
|
||||
|
||||
@@ -21,15 +21,13 @@ class Markdown:
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
extensions: Optional[Sequence[Union[str, Extension]]] = ...,
|
||||
extension_configs: Optional[Mapping[str, Mapping[str, Any]]] = ...,
|
||||
output_format: Optional[Literal["xhtml", "html"]] = ...,
|
||||
tab_length: Optional[int] = ...,
|
||||
extensions: Sequence[str | Extension] | None = ...,
|
||||
extension_configs: Mapping[str, Mapping[str, Any]] | None = ...,
|
||||
output_format: Literal["xhtml", "html"] | None = ...,
|
||||
tab_length: int | None = ...,
|
||||
) -> None: ...
|
||||
def build_parser(self) -> Markdown: ...
|
||||
def registerExtensions(
|
||||
self, extensions: Sequence[Union[Extension, str]], configs: Mapping[str, Mapping[str, Any]]
|
||||
) -> Markdown: ...
|
||||
def registerExtensions(self, extensions: Sequence[Extension | str], configs: Mapping[str, Mapping[str, Any]]) -> Markdown: ...
|
||||
def build_extension(self, ext_name: Text, configs: Mapping[str, str]) -> Extension: ...
|
||||
def registerExtension(self, extension: Extension) -> Markdown: ...
|
||||
def reset(self: Markdown) -> Markdown: ...
|
||||
@@ -38,26 +36,26 @@ class Markdown:
|
||||
def convert(self, source: Text) -> Text: ...
|
||||
def convertFile(
|
||||
self,
|
||||
input: Optional[Union[str, TextIO, BinaryIO]] = ...,
|
||||
output: Optional[Union[str, TextIO, BinaryIO]] = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
input: str | TextIO | BinaryIO | None = ...,
|
||||
output: str | TextIO | BinaryIO | None = ...,
|
||||
encoding: str | None = ...,
|
||||
) -> Markdown: ...
|
||||
|
||||
def markdown(
|
||||
text: Text,
|
||||
*,
|
||||
extensions: Optional[Sequence[Union[str, Extension]]] = ...,
|
||||
extension_configs: Optional[Mapping[str, Mapping[str, Any]]] = ...,
|
||||
output_format: Optional[Literal["xhtml", "html"]] = ...,
|
||||
tab_length: Optional[int] = ...,
|
||||
extensions: Sequence[str | Extension] | None = ...,
|
||||
extension_configs: Mapping[str, Mapping[str, Any]] | None = ...,
|
||||
output_format: Literal["xhtml", "html"] | None = ...,
|
||||
tab_length: int | None = ...,
|
||||
) -> Text: ...
|
||||
def markdownFromFile(
|
||||
*,
|
||||
input: Optional[Union[str, TextIO, BinaryIO]] = ...,
|
||||
output: Optional[Union[str, TextIO, BinaryIO]] = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
extensions: Optional[Sequence[Union[str, Extension]]] = ...,
|
||||
extension_configs: Optional[Mapping[str, Mapping[str, Any]]] = ...,
|
||||
output_format: Optional[Literal["xhtml", "html"]] = ...,
|
||||
tab_length: Optional[int] = ...,
|
||||
input: str | TextIO | BinaryIO | None = ...,
|
||||
output: str | TextIO | BinaryIO | None = ...,
|
||||
encoding: str | None = ...,
|
||||
extensions: Sequence[str | Extension] | None = ...,
|
||||
extension_configs: Mapping[str, Mapping[str, Any]] | None = ...,
|
||||
output_format: Literal["xhtml", "html"] | None = ...,
|
||||
tab_length: int | None = ...,
|
||||
) -> None: ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Dict, Optional
|
||||
from typing import Any, Dict
|
||||
|
||||
from markdown.extensions import Extension
|
||||
from markdown.treeprocessors import Treeprocessor
|
||||
@@ -21,16 +21,16 @@ class CodeHilite:
|
||||
options: Dict[str, Any]
|
||||
def __init__(
|
||||
self,
|
||||
src: Optional[Any] = ...,
|
||||
src: Any | None = ...,
|
||||
*,
|
||||
linenums: Optional[Any] = ...,
|
||||
linenums: Any | None = ...,
|
||||
guess_lang: bool = ...,
|
||||
css_class: str = ...,
|
||||
lang: Optional[Any] = ...,
|
||||
lang: Any | None = ...,
|
||||
style: str = ...,
|
||||
noclasses: bool = ...,
|
||||
tab_length: int = ...,
|
||||
hl_lines: Optional[Any] = ...,
|
||||
hl_lines: Any | None = ...,
|
||||
use_pygments: bool = ...,
|
||||
**options: Any,
|
||||
) -> None: ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Match, Optional, Tuple, Union
|
||||
from typing import Any, Match, Tuple
|
||||
from xml.etree.ElementTree import Element
|
||||
|
||||
def build_inlinepatterns(md, **kwargs): ...
|
||||
@@ -36,18 +36,18 @@ class Pattern:
|
||||
pattern: Any
|
||||
compiled_re: Any
|
||||
md: Any
|
||||
def __init__(self, pattern, md: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, pattern, md: Any | None = ...) -> None: ...
|
||||
@property
|
||||
def markdown(self): ...
|
||||
def getCompiledRegExp(self): ...
|
||||
def handleMatch(self, m: Match[str]) -> Optional[Union[str, Element]]: ...
|
||||
def handleMatch(self, m: Match[str]) -> str | Element | None: ...
|
||||
def type(self): ...
|
||||
def unescape(self, text): ...
|
||||
|
||||
class InlineProcessor(Pattern):
|
||||
safe_mode: bool = ...
|
||||
def __init__(self, pattern, md: Optional[Any] = ...) -> None: ...
|
||||
def handleMatch(self, m: Match[str], data) -> Union[Tuple[Element, int, int], Tuple[None, None, None]]: ... # type: ignore
|
||||
def __init__(self, pattern, md: Any | None = ...) -> None: ...
|
||||
def handleMatch(self, m: Match[str], data) -> Tuple[Element, int, int] | Tuple[None, None, None]: ... # type: ignore
|
||||
|
||||
class SimpleTextPattern(Pattern): ...
|
||||
class SimpleTextInlineProcessor(InlineProcessor): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
from . import util
|
||||
|
||||
@@ -6,7 +6,7 @@ def build_treeprocessors(md, **kwargs): ...
|
||||
def isString(s): ...
|
||||
|
||||
class Treeprocessor(util.Processor):
|
||||
def run(self, root) -> Optional[Any]: ...
|
||||
def run(self, root) -> Any | None: ...
|
||||
|
||||
class InlineProcessor(Treeprocessor):
|
||||
inlinePatterns: Any
|
||||
@@ -14,6 +14,6 @@ class InlineProcessor(Treeprocessor):
|
||||
def __init__(self, md) -> None: ...
|
||||
stashed_nodes: Any
|
||||
parent_map: Any
|
||||
def run(self, tree, ancestors: Optional[Any] = ...): ...
|
||||
def run(self, tree, ancestors: Any | None = ...): ...
|
||||
|
||||
class PrettifyTreeprocessor(Treeprocessor): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional, Pattern
|
||||
from typing import Any, Pattern
|
||||
|
||||
PY37: Any
|
||||
__deprecated__: Any
|
||||
@@ -24,7 +24,7 @@ class AtomicString(str): ...
|
||||
|
||||
class Processor:
|
||||
md: Any
|
||||
def __init__(self, md: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, md: Any | None = ...) -> None: ...
|
||||
@property
|
||||
def markdown(self): ...
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import string
|
||||
import sys
|
||||
from typing import Any, Callable, Iterable, Mapping, Optional, Sequence, Text, Tuple, Union
|
||||
from typing import Any, Callable, Iterable, Mapping, Sequence, Text, Tuple
|
||||
from typing_extensions import SupportsIndex
|
||||
|
||||
from markupsafe._compat import text_type
|
||||
from markupsafe._native import escape as escape, escape_silent as escape_silent, soft_unicode as soft_unicode
|
||||
|
||||
class Markup(text_type):
|
||||
def __new__(cls, base: Text = ..., encoding: Optional[Text] = ..., errors: Text = ...) -> Markup: ...
|
||||
def __new__(cls, base: Text = ..., encoding: Text | None = ..., errors: Text = ...) -> Markup: ...
|
||||
def __html__(self) -> Markup: ...
|
||||
def __add__(self, other: text_type) -> Markup: ...
|
||||
def __radd__(self, other: text_type) -> Markup: ...
|
||||
@@ -15,8 +15,8 @@ class Markup(text_type):
|
||||
def __rmul__(self, num: int) -> Markup: ... # type: ignore
|
||||
def __mod__(self, *args: Any) -> Markup: ...
|
||||
def join(self, seq: Iterable[text_type]) -> Markup: ...
|
||||
def split(self, sep: Optional[text_type] = ..., maxsplit: SupportsIndex = ...) -> list[Markup]: ... # type: ignore
|
||||
def rsplit(self, sep: Optional[text_type] = ..., maxsplit: SupportsIndex = ...) -> list[Markup]: ... # type: ignore
|
||||
def split(self, sep: text_type | None = ..., maxsplit: SupportsIndex = ...) -> list[Markup]: ... # type: ignore
|
||||
def rsplit(self, sep: text_type | None = ..., maxsplit: SupportsIndex = ...) -> list[Markup]: ... # type: ignore
|
||||
def splitlines(self, keepends: bool = ...) -> list[Markup]: ... # type: ignore
|
||||
def unescape(self) -> Text: ...
|
||||
def striptags(self) -> Text: ...
|
||||
@@ -27,7 +27,7 @@ class Markup(text_type):
|
||||
def format(self, *args: Any, **kwargs: Any) -> Markup: ...
|
||||
def __html_format__(self, format_spec: text_type) -> Markup: ...
|
||||
def __getslice__(self, start: int, stop: int) -> Markup: ...
|
||||
def __getitem__(self, i: Union[int, slice]) -> Markup: ...
|
||||
def __getitem__(self, i: int | slice) -> Markup: ...
|
||||
def capitalize(self) -> Markup: ...
|
||||
def title(self) -> Markup: ...
|
||||
def lower(self) -> Markup: ...
|
||||
@@ -36,14 +36,12 @@ class Markup(text_type):
|
||||
def replace(self, old: text_type, new: text_type, count: SupportsIndex = ...) -> Markup: ...
|
||||
def ljust(self, width: SupportsIndex, fillchar: text_type = ...) -> Markup: ...
|
||||
def rjust(self, width: SupportsIndex, fillchar: text_type = ...) -> Markup: ...
|
||||
def lstrip(self, chars: Optional[text_type] = ...) -> Markup: ...
|
||||
def rstrip(self, chars: Optional[text_type] = ...) -> Markup: ...
|
||||
def strip(self, chars: Optional[text_type] = ...) -> Markup: ...
|
||||
def lstrip(self, chars: text_type | None = ...) -> Markup: ...
|
||||
def rstrip(self, chars: text_type | None = ...) -> Markup: ...
|
||||
def strip(self, chars: text_type | None = ...) -> Markup: ...
|
||||
def center(self, width: SupportsIndex, fillchar: text_type = ...) -> Markup: ...
|
||||
def zfill(self, width: SupportsIndex) -> Markup: ...
|
||||
def translate(
|
||||
self, table: Union[Mapping[int, Union[int, text_type, None]], Sequence[Union[int, text_type, None]]]
|
||||
) -> Markup: ...
|
||||
def translate(self, table: Mapping[int, int | text_type | None] | Sequence[int | text_type | None]) -> Markup: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def expandtabs(self, tabsize: SupportsIndex = ...) -> Markup: ...
|
||||
else:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from typing import Text, Union
|
||||
from typing import Text
|
||||
|
||||
from . import Markup
|
||||
from ._compat import text_type
|
||||
|
||||
def escape(s: Union[Markup, Text]) -> Markup: ...
|
||||
def escape_silent(s: Union[None, Markup, Text]) -> Markup: ...
|
||||
def escape(s: Markup | Text) -> Markup: ...
|
||||
def escape_silent(s: None | Markup | Text) -> Markup: ...
|
||||
def soft_unicode(s: Text) -> text_type: ...
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from typing import Text, Union
|
||||
from typing import Text
|
||||
|
||||
from . import Markup
|
||||
from ._compat import text_type
|
||||
|
||||
def escape(s: Union[Markup, Text]) -> Markup: ...
|
||||
def escape_silent(s: Union[None, Markup, Text]) -> Markup: ...
|
||||
def escape(s: Markup | Text) -> Markup: ...
|
||||
def escape_silent(s: None | Markup | Text) -> Markup: ...
|
||||
def soft_unicode(s: Text) -> text_type: ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Iterable, Iterator, Optional, Text, Tuple, TypeVar
|
||||
from typing import Any, Iterable, Iterator, Text, Tuple, TypeVar
|
||||
|
||||
from .connections import Connection
|
||||
|
||||
@@ -18,10 +18,10 @@ class Cursor:
|
||||
def close(self) -> None: ...
|
||||
def setinputsizes(self, *args) -> None: ...
|
||||
def setoutputsizes(self, *args) -> None: ...
|
||||
def nextset(self) -> Optional[bool]: ...
|
||||
def nextset(self) -> bool | None: ...
|
||||
def mogrify(self, query: Text, args: object = ...) -> str: ...
|
||||
def execute(self, query: Text, args: object = ...) -> int: ...
|
||||
def executemany(self, query: Text, args: Iterable[object]) -> Optional[int]: ...
|
||||
def executemany(self, query: Text, args: Iterable[object]) -> int | None: ...
|
||||
def callproc(self, procname: Text, args: Iterable[Any] = ...) -> Any: ...
|
||||
def scroll(self, value: int, mode: Text = ...) -> None: ...
|
||||
def __enter__(self: _SelfT) -> _SelfT: ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import IO, Any, Callable, Iterator, Optional, Sequence, Text, Type, TypeVar, Union, overload
|
||||
from typing import IO, Any, Callable, Iterator, Sequence, Text, Type, TypeVar, Union, overload
|
||||
|
||||
from yaml.dumper import * # noqa: F403
|
||||
from yaml.error import * # noqa: F403
|
||||
@@ -29,14 +29,14 @@ def scan(stream, Loader=...): ...
|
||||
def parse(stream, Loader=...): ...
|
||||
def compose(stream, Loader=...): ...
|
||||
def compose_all(stream, Loader=...): ...
|
||||
def load(stream: Union[bytes, IO[bytes], Text, IO[Text]], Loader=...) -> Any: ...
|
||||
def load_all(stream: Union[bytes, IO[bytes], Text, IO[Text]], Loader=...) -> Iterator[Any]: ...
|
||||
def full_load(stream: Union[bytes, IO[bytes], Text, IO[Text]]) -> Any: ...
|
||||
def full_load_all(stream: Union[bytes, IO[bytes], Text, IO[Text]]) -> Iterator[Any]: ...
|
||||
def safe_load(stream: Union[bytes, IO[bytes], Text, IO[Text]]) -> Any: ...
|
||||
def safe_load_all(stream: Union[bytes, IO[bytes], Text, IO[Text]]) -> Iterator[Any]: ...
|
||||
def unsafe_load(stream: Union[bytes, IO[bytes], Text, IO[Text]]) -> Any: ...
|
||||
def unsafe_load_all(stream: Union[bytes, IO[bytes], Text, IO[Text]]) -> Iterator[Any]: ...
|
||||
def load(stream: bytes | IO[bytes] | Text | IO[Text], Loader=...) -> Any: ...
|
||||
def load_all(stream: bytes | IO[bytes] | Text | IO[Text], Loader=...) -> Iterator[Any]: ...
|
||||
def full_load(stream: bytes | IO[bytes] | Text | IO[Text]) -> Any: ...
|
||||
def full_load_all(stream: bytes | IO[bytes] | Text | IO[Text]) -> Iterator[Any]: ...
|
||||
def safe_load(stream: bytes | IO[bytes] | Text | IO[Text]) -> Any: ...
|
||||
def safe_load_all(stream: bytes | IO[bytes] | Text | IO[Text]) -> Iterator[Any]: ...
|
||||
def unsafe_load(stream: bytes | IO[bytes] | Text | IO[Text]) -> Any: ...
|
||||
def unsafe_load_all(stream: bytes | IO[bytes] | Text | IO[Text]) -> Iterator[Any]: ...
|
||||
def emit(events, stream=..., Dumper=..., canonical=..., indent=..., width=..., allow_unicode=..., line_break=...): ...
|
||||
@overload
|
||||
def serialize_all(
|
||||
@@ -64,7 +64,7 @@ def serialize_all(
|
||||
width=...,
|
||||
allow_unicode=...,
|
||||
line_break=...,
|
||||
encoding: Optional[_Str] = ...,
|
||||
encoding: _Str | None = ...,
|
||||
explicit_start=...,
|
||||
explicit_end=...,
|
||||
version=...,
|
||||
@@ -98,7 +98,7 @@ def serialize(
|
||||
width=...,
|
||||
allow_unicode=...,
|
||||
line_break=...,
|
||||
encoding: Optional[_Str] = ...,
|
||||
encoding: _Str | None = ...,
|
||||
explicit_start=...,
|
||||
explicit_end=...,
|
||||
version=...,
|
||||
@@ -135,7 +135,7 @@ def dump_all(
|
||||
width=...,
|
||||
allow_unicode=...,
|
||||
line_break=...,
|
||||
encoding: Optional[_Str] = ...,
|
||||
encoding: _Str | None = ...,
|
||||
explicit_start=...,
|
||||
explicit_end=...,
|
||||
version=...,
|
||||
@@ -175,7 +175,7 @@ def dump(
|
||||
width=...,
|
||||
allow_unicode=...,
|
||||
line_break=...,
|
||||
encoding: Optional[_Str] = ...,
|
||||
encoding: _Str | None = ...,
|
||||
explicit_start=...,
|
||||
explicit_end=...,
|
||||
version=...,
|
||||
@@ -213,7 +213,7 @@ def safe_dump_all(
|
||||
width=...,
|
||||
allow_unicode=...,
|
||||
line_break=...,
|
||||
encoding: Optional[_Str] = ...,
|
||||
encoding: _Str | None = ...,
|
||||
explicit_start=...,
|
||||
explicit_end=...,
|
||||
version=...,
|
||||
@@ -251,7 +251,7 @@ def safe_dump(
|
||||
width=...,
|
||||
allow_unicode=...,
|
||||
line_break=...,
|
||||
encoding: Optional[_Str] = ...,
|
||||
encoding: _Str | None = ...,
|
||||
explicit_start=...,
|
||||
explicit_end=...,
|
||||
version=...,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Dict, Optional
|
||||
from typing import Any, Dict
|
||||
|
||||
from yaml.error import MarkedYAMLError
|
||||
from yaml.nodes import MappingNode, Node, ScalarNode, SequenceNode
|
||||
@@ -9,10 +9,10 @@ class Composer:
|
||||
anchors: Dict[Any, Node]
|
||||
def __init__(self) -> None: ...
|
||||
def check_node(self) -> bool: ...
|
||||
def get_node(self) -> Optional[Node]: ...
|
||||
def get_single_node(self) -> Optional[Node]: ...
|
||||
def compose_document(self) -> Optional[Node]: ...
|
||||
def compose_node(self, parent: Optional[Node], index: int) -> Optional[Node]: ...
|
||||
def get_node(self) -> Node | None: ...
|
||||
def get_single_node(self) -> Node | None: ...
|
||||
def compose_document(self) -> Node | None: ...
|
||||
def compose_node(self, parent: Node | None, index: int) -> Node | None: ...
|
||||
def compose_scalar_node(self, anchor: Dict[Any, Node]) -> ScalarNode: ...
|
||||
def compose_sequence_node(self, anchor: Dict[Any, Node]) -> SequenceNode: ...
|
||||
def compose_mapping_node(self, anchor: Dict[Any, Node]) -> MappingNode: ...
|
||||
|
||||
+27
-27
@@ -1,5 +1,5 @@
|
||||
from _typeshed import SupportsRead
|
||||
from typing import IO, Any, Mapping, Optional, Sequence, Text, Union
|
||||
from typing import IO, Any, Mapping, Sequence, Text, Union
|
||||
|
||||
from yaml.constructor import BaseConstructor, Constructor, SafeConstructor
|
||||
from yaml.representer import BaseRepresenter, Representer, SafeRepresenter
|
||||
@@ -9,16 +9,16 @@ from yaml.serializer import Serializer
|
||||
_Readable = SupportsRead[Union[Text, bytes]]
|
||||
|
||||
class CParser:
|
||||
def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ...
|
||||
def __init__(self, stream: str | bytes | _Readable) -> None: ...
|
||||
|
||||
class CBaseLoader(CParser, BaseConstructor, BaseResolver):
|
||||
def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ...
|
||||
def __init__(self, stream: str | bytes | _Readable) -> None: ...
|
||||
|
||||
class CLoader(CParser, SafeConstructor, Resolver):
|
||||
def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ...
|
||||
def __init__(self, stream: str | bytes | _Readable) -> None: ...
|
||||
|
||||
class CSafeLoader(CParser, SafeConstructor, Resolver):
|
||||
def __init__(self, stream: Union[str, bytes, _Readable]) -> None: ...
|
||||
def __init__(self, stream: str | bytes | _Readable) -> None: ...
|
||||
|
||||
class CDangerLoader(CParser, Constructor, Resolver): ... # undocumented
|
||||
|
||||
@@ -26,34 +26,34 @@ class CEmitter(object):
|
||||
def __init__(
|
||||
self,
|
||||
stream: IO[Any],
|
||||
canonical: Optional[Any] = ...,
|
||||
indent: Optional[int] = ...,
|
||||
width: Optional[int] = ...,
|
||||
allow_unicode: Optional[Any] = ...,
|
||||
line_break: Optional[str] = ...,
|
||||
encoding: Optional[Text] = ...,
|
||||
explicit_start: Optional[Any] = ...,
|
||||
explicit_end: Optional[Any] = ...,
|
||||
version: Optional[Sequence[int]] = ...,
|
||||
tags: Optional[Mapping[Text, Text]] = ...,
|
||||
canonical: Any | None = ...,
|
||||
indent: int | None = ...,
|
||||
width: int | None = ...,
|
||||
allow_unicode: Any | None = ...,
|
||||
line_break: str | None = ...,
|
||||
encoding: Text | None = ...,
|
||||
explicit_start: Any | None = ...,
|
||||
explicit_end: Any | None = ...,
|
||||
version: Sequence[int] | None = ...,
|
||||
tags: Mapping[Text, Text] | None = ...,
|
||||
) -> None: ...
|
||||
|
||||
class CBaseDumper(CEmitter, BaseRepresenter, BaseResolver):
|
||||
def __init__(
|
||||
self,
|
||||
stream: IO[Any],
|
||||
default_style: Optional[str] = ...,
|
||||
default_flow_style: Optional[bool] = ...,
|
||||
canonical: Optional[Any] = ...,
|
||||
indent: Optional[int] = ...,
|
||||
width: Optional[int] = ...,
|
||||
allow_unicode: Optional[Any] = ...,
|
||||
line_break: Optional[str] = ...,
|
||||
encoding: Optional[Text] = ...,
|
||||
explicit_start: Optional[Any] = ...,
|
||||
explicit_end: Optional[Any] = ...,
|
||||
version: Optional[Sequence[int]] = ...,
|
||||
tags: Optional[Mapping[Text, Text]] = ...,
|
||||
default_style: str | None = ...,
|
||||
default_flow_style: bool | None = ...,
|
||||
canonical: Any | None = ...,
|
||||
indent: int | None = ...,
|
||||
width: int | None = ...,
|
||||
allow_unicode: Any | None = ...,
|
||||
line_break: str | None = ...,
|
||||
encoding: Text | None = ...,
|
||||
explicit_start: Any | None = ...,
|
||||
explicit_end: Any | None = ...,
|
||||
version: Sequence[int] | None = ...,
|
||||
tags: Mapping[Text, Text] | None = ...,
|
||||
) -> None: ...
|
||||
|
||||
class CDumper(CEmitter, SafeRepresenter, Resolver): ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
def lex(code, lexer): ...
|
||||
def format(tokens, formatter, outfile: Optional[Any] = ...): ...
|
||||
def highlight(code, lexer, formatter, outfile: Optional[Any] = ...): ...
|
||||
def format(tokens, formatter, outfile: Any | None = ...): ...
|
||||
def highlight(code, lexer, formatter, outfile: Any | None = ...): ...
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import argparse
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
def main_inner(parser, argns): ...
|
||||
|
||||
class HelpFormatter(argparse.HelpFormatter):
|
||||
def __init__(self, prog, indent_increment: int = ..., max_help_position: int = ..., width: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, prog, indent_increment: int = ..., max_help_position: int = ..., width: Any | None = ...) -> None: ...
|
||||
|
||||
def main(args=...): ...
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from collections.abc import Iterable, Iterator
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
from pygments.lexer import Lexer
|
||||
from pygments.token import _TokenType
|
||||
|
||||
def apply_filters(stream, filters, lexer: Optional[Any] = ...): ...
|
||||
def apply_filters(stream, filters, lexer: Any | None = ...): ...
|
||||
def simplefilter(f): ...
|
||||
|
||||
class Filter:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
from pygments.formatter import Formatter
|
||||
|
||||
@@ -31,9 +31,9 @@ class HtmlFormatter(Formatter):
|
||||
anchorlinenos: Any
|
||||
hl_lines: Any
|
||||
def __init__(self, **options) -> None: ...
|
||||
def get_style_defs(self, arg: Optional[Any] = ...): ...
|
||||
def get_token_style_defs(self, arg: Optional[Any] = ...): ...
|
||||
def get_background_style_defs(self, arg: Optional[Any] = ...): ...
|
||||
def get_style_defs(self, arg: Any | None = ...): ...
|
||||
def get_token_style_defs(self, arg: Any | None = ...): ...
|
||||
def get_background_style_defs(self, arg: Any | None = ...): ...
|
||||
def get_linenos_style_defs(self): ...
|
||||
def get_css_prefix(self, arg): ...
|
||||
def wrap(self, source, outfile): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
from pygments.formatter import Formatter
|
||||
|
||||
@@ -9,7 +9,7 @@ class EscapeSequence:
|
||||
underline: Any
|
||||
italic: Any
|
||||
def __init__(
|
||||
self, fg: Optional[Any] = ..., bg: Optional[Any] = ..., bold: bool = ..., underline: bool = ..., italic: bool = ...
|
||||
self, fg: Any | None = ..., bg: Any | None = ..., bold: bool = ..., underline: bool = ..., italic: bool = ...
|
||||
) -> None: ...
|
||||
def escape(self, attrs): ...
|
||||
def color_string(self): ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from collections.abc import Iterable, Iterator, Sequence
|
||||
from typing import Any, Optional, Tuple
|
||||
from typing import Any, Tuple
|
||||
|
||||
from pygments.token import _TokenType
|
||||
from pygments.util import Future
|
||||
@@ -46,9 +46,9 @@ class combined(Tuple[Any]):
|
||||
|
||||
class _PseudoMatch:
|
||||
def __init__(self, start, text) -> None: ...
|
||||
def start(self, arg: Optional[Any] = ...): ...
|
||||
def end(self, arg: Optional[Any] = ...): ...
|
||||
def group(self, arg: Optional[Any] = ...): ...
|
||||
def start(self, arg: Any | None = ...): ...
|
||||
def end(self, arg: Any | None = ...): ...
|
||||
def group(self, arg: Any | None = ...): ...
|
||||
def groups(self): ...
|
||||
def groupdict(self): ...
|
||||
|
||||
@@ -72,7 +72,7 @@ class words(Future):
|
||||
def get(self): ...
|
||||
|
||||
class RegexLexerMeta(LexerMeta):
|
||||
def process_tokendef(cls, name, tokendefs: Optional[Any] = ...): ...
|
||||
def process_tokendef(cls, name, tokendefs: Any | None = ...): ...
|
||||
def get_tokendefs(cls): ...
|
||||
def __call__(cls, *args, **kwds): ...
|
||||
|
||||
@@ -86,7 +86,7 @@ class LexerContext:
|
||||
pos: Any
|
||||
end: Any
|
||||
stack: Any
|
||||
def __init__(self, text, pos, stack: Optional[Any] = ..., end: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, text, pos, stack: Any | None = ..., end: Any | None = ...) -> None: ...
|
||||
|
||||
class ExtendedRegexLexer(RegexLexer):
|
||||
def get_tokens_unprocessed(self, text: str | None = ..., context: LexerContext | None = ...) -> Iterator[tuple[int, _TokenType, str]]: ... # type: ignore
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from io import TextIOWrapper
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
split_path_re: Any
|
||||
doctype_lookup_re: Any
|
||||
@@ -9,10 +9,10 @@ xml_decl_re: Any
|
||||
class ClassNotFound(ValueError): ...
|
||||
class OptionError(Exception): ...
|
||||
|
||||
def get_choice_opt(options, optname, allowed, default: Optional[Any] = ..., normcase: bool = ...): ...
|
||||
def get_bool_opt(options, optname, default: Optional[Any] = ...): ...
|
||||
def get_int_opt(options, optname, default: Optional[Any] = ...): ...
|
||||
def get_list_opt(options, optname, default: Optional[Any] = ...): ...
|
||||
def get_choice_opt(options, optname, allowed, default: Any | None = ..., normcase: bool = ...): ...
|
||||
def get_bool_opt(options, optname, default: Any | None = ...): ...
|
||||
def get_int_opt(options, optname, default: Any | None = ...): ...
|
||||
def get_list_opt(options, optname, default: Any | None = ...): ...
|
||||
def docstring_headline(obj): ...
|
||||
def make_analysator(f): ...
|
||||
def shebang_matches(text, regex): ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import Any, Optional, Text
|
||||
from typing import Any, Text
|
||||
|
||||
if sys.version_info >= (3,):
|
||||
from io import BytesIO as BytesIO, StringIO as StringIO
|
||||
@@ -44,7 +44,7 @@ def wsgi_decoding_dance(s, charset: Text = ..., errors: Text = ...): ...
|
||||
def wsgi_encoding_dance(s, charset: Text = ..., errors: Text = ...): ...
|
||||
def to_bytes(x, charset: Text = ..., errors: Text = ...): ...
|
||||
def to_native(x, charset: Text = ..., errors: Text = ...): ...
|
||||
def reraise(tp, value, tb: Optional[Any] = ...): ...
|
||||
def reraise(tp, value, tb: Any | None = ...): ...
|
||||
|
||||
imap: Any
|
||||
izip: Any
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
class _Missing:
|
||||
def __reduce__(self): ...
|
||||
@@ -13,14 +13,14 @@ class _DictAccessorProperty:
|
||||
def __init__(
|
||||
self,
|
||||
name,
|
||||
default: Optional[Any] = ...,
|
||||
load_func: Optional[Any] = ...,
|
||||
dump_func: Optional[Any] = ...,
|
||||
read_only: Optional[Any] = ...,
|
||||
doc: Optional[Any] = ...,
|
||||
default: Any | None = ...,
|
||||
load_func: Any | None = ...,
|
||||
dump_func: Any | None = ...,
|
||||
read_only: Any | None = ...,
|
||||
doc: Any | None = ...,
|
||||
): ...
|
||||
def __get__(self, obj, type: Optional[Any] = ...): ...
|
||||
def __get__(self, obj, type: Any | None = ...): ...
|
||||
def __set__(self, obj, value): ...
|
||||
def __delete__(self, obj): ...
|
||||
|
||||
def _easteregg(app: Optional[Any] = ...): ...
|
||||
def _easteregg(app: Any | None = ...): ...
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
class ReloaderLoop:
|
||||
name: Any
|
||||
extra_files: Any
|
||||
interval: float
|
||||
def __init__(self, extra_files: Optional[Any] = ..., interval: float = ...): ...
|
||||
def __init__(self, extra_files: Any | None = ..., interval: float = ...): ...
|
||||
def run(self): ...
|
||||
def restart_with_reloader(self): ...
|
||||
def trigger_reload(self, filename): ...
|
||||
@@ -26,4 +26,4 @@ class WatchdogReloaderLoop(ReloaderLoop):
|
||||
|
||||
reloader_loops: Any
|
||||
|
||||
def run_with_reloader(main_func, extra_files: Optional[Any] = ..., interval: float = ..., reloader_type: str = ...): ...
|
||||
def run_with_reloader(main_func, extra_files: Any | None = ..., interval: float = ..., reloader_type: str = ...): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
XHTML_NAMESPACE: Any
|
||||
|
||||
@@ -22,7 +22,7 @@ class AtomFeed:
|
||||
generator: Any
|
||||
links: Any
|
||||
entries: Any
|
||||
def __init__(self, title: Optional[Any] = ..., entries: Optional[Any] = ..., **kwargs): ...
|
||||
def __init__(self, title: Any | None = ..., entries: Any | None = ..., **kwargs): ...
|
||||
def add(self, *args, **kwargs): ...
|
||||
def generate(self): ...
|
||||
def to_string(self): ...
|
||||
@@ -45,6 +45,6 @@ class FeedEntry:
|
||||
links: Any
|
||||
categories: Any
|
||||
xml_base: Any
|
||||
def __init__(self, title: Optional[Any] = ..., content: Optional[Any] = ..., feed_url: Optional[Any] = ..., **kwargs): ...
|
||||
def __init__(self, title: Any | None = ..., content: Any | None = ..., feed_url: Any | None = ..., **kwargs): ...
|
||||
def generate(self): ...
|
||||
def to_string(self): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
class BaseCache:
|
||||
default_timeout: float
|
||||
@@ -7,9 +7,9 @@ class BaseCache:
|
||||
def delete(self, key): ...
|
||||
def get_many(self, *keys): ...
|
||||
def get_dict(self, *keys): ...
|
||||
def set(self, key, value, timeout: Optional[float] = ...): ...
|
||||
def add(self, key, value, timeout: Optional[float] = ...): ...
|
||||
def set_many(self, mapping, timeout: Optional[float] = ...): ...
|
||||
def set(self, key, value, timeout: float | None = ...): ...
|
||||
def add(self, key, value, timeout: float | None = ...): ...
|
||||
def set_many(self, mapping, timeout: float | None = ...): ...
|
||||
def delete_many(self, *keys): ...
|
||||
def has(self, key): ...
|
||||
def clear(self): ...
|
||||
@@ -22,20 +22,20 @@ class SimpleCache(BaseCache):
|
||||
clear: Any
|
||||
def __init__(self, threshold: int = ..., default_timeout: float = ...): ...
|
||||
def get(self, key): ...
|
||||
def set(self, key, value, timeout: Optional[float] = ...): ...
|
||||
def add(self, key, value, timeout: Optional[float] = ...): ...
|
||||
def set(self, key, value, timeout: float | None = ...): ...
|
||||
def add(self, key, value, timeout: float | None = ...): ...
|
||||
def delete(self, key): ...
|
||||
def has(self, key): ...
|
||||
|
||||
class MemcachedCache(BaseCache):
|
||||
key_prefix: Any
|
||||
def __init__(self, servers: Optional[Any] = ..., default_timeout: float = ..., key_prefix: Optional[Any] = ...): ...
|
||||
def __init__(self, servers: Any | None = ..., default_timeout: float = ..., key_prefix: Any | None = ...): ...
|
||||
def get(self, key): ...
|
||||
def get_dict(self, *keys): ...
|
||||
def add(self, key, value, timeout: Optional[float] = ...): ...
|
||||
def set(self, key, value, timeout: Optional[float] = ...): ...
|
||||
def add(self, key, value, timeout: float | None = ...): ...
|
||||
def set(self, key, value, timeout: float | None = ...): ...
|
||||
def get_many(self, *keys): ...
|
||||
def set_many(self, mapping, timeout: Optional[float] = ...): ...
|
||||
def set_many(self, mapping, timeout: float | None = ...): ...
|
||||
def delete(self, key): ...
|
||||
def delete_many(self, *keys): ...
|
||||
def has(self, key): ...
|
||||
@@ -52,19 +52,19 @@ class RedisCache(BaseCache):
|
||||
self,
|
||||
host: str = ...,
|
||||
port: int = ...,
|
||||
password: Optional[Any] = ...,
|
||||
password: Any | None = ...,
|
||||
db: int = ...,
|
||||
default_timeout: float = ...,
|
||||
key_prefix: Optional[Any] = ...,
|
||||
key_prefix: Any | None = ...,
|
||||
**kwargs,
|
||||
): ...
|
||||
def dump_object(self, value): ...
|
||||
def load_object(self, value): ...
|
||||
def get(self, key): ...
|
||||
def get_many(self, *keys): ...
|
||||
def set(self, key, value, timeout: Optional[float] = ...): ...
|
||||
def add(self, key, value, timeout: Optional[float] = ...): ...
|
||||
def set_many(self, mapping, timeout: Optional[float] = ...): ...
|
||||
def set(self, key, value, timeout: float | None = ...): ...
|
||||
def add(self, key, value, timeout: float | None = ...): ...
|
||||
def set_many(self, mapping, timeout: float | None = ...): ...
|
||||
def delete(self, key): ...
|
||||
def delete_many(self, *keys): ...
|
||||
def has(self, key): ...
|
||||
@@ -76,8 +76,8 @@ class FileSystemCache(BaseCache):
|
||||
def __init__(self, cache_dir, threshold: int = ..., default_timeout: float = ..., mode: int = ...): ...
|
||||
def clear(self): ...
|
||||
def get(self, key): ...
|
||||
def add(self, key, value, timeout: Optional[float] = ...): ...
|
||||
def set(self, key, value, timeout: Optional[float] = ...): ...
|
||||
def add(self, key, value, timeout: float | None = ...): ...
|
||||
def set(self, key, value, timeout: float | None = ...): ...
|
||||
def delete(self, key): ...
|
||||
def has(self, key): ...
|
||||
|
||||
@@ -86,7 +86,7 @@ class UWSGICache(BaseCache):
|
||||
def __init__(self, default_timeout: float = ..., cache: str = ...): ...
|
||||
def get(self, key): ...
|
||||
def delete(self, key): ...
|
||||
def set(self, key, value, timeout: Optional[float] = ...): ...
|
||||
def add(self, key, value, timeout: Optional[float] = ...): ...
|
||||
def set(self, key, value, timeout: float | None = ...): ...
|
||||
def add(self, key, value, timeout: float | None = ...): ...
|
||||
def clear(self): ...
|
||||
def has(self, key): ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment
|
||||
from typing import Any, Iterable, List, Mapping, Optional, Set, Text
|
||||
from typing import Any, Iterable, List, Mapping, Set, Text
|
||||
|
||||
from ..middleware.proxy_fix import ProxyFix as ProxyFix
|
||||
|
||||
@@ -21,7 +21,7 @@ class HeaderRewriterFix(object):
|
||||
remove_headers: Set[Text]
|
||||
add_headers: List[Text]
|
||||
def __init__(
|
||||
self, app: WSGIApplication, remove_headers: Optional[Iterable[Text]] = ..., add_headers: Optional[Iterable[Text]] = ...
|
||||
self, app: WSGIApplication, remove_headers: Iterable[Text] | None = ..., add_headers: Iterable[Text] | None = ...
|
||||
) -> None: ...
|
||||
def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ...
|
||||
|
||||
@@ -30,6 +30,6 @@ class InternetExplorerFix(object):
|
||||
fix_vary: bool
|
||||
fix_attach: bool
|
||||
def __init__(self, app: WSGIApplication, fix_vary: bool = ..., fix_attach: bool = ...) -> None: ...
|
||||
def fix_headers(self, environ: WSGIEnvironment, headers: Mapping[str, str], status: Optional[Any] = ...) -> None: ...
|
||||
def fix_headers(self, environ: WSGIEnvironment, headers: Mapping[str, str], status: Any | None = ...) -> None: ...
|
||||
def run_fixed(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ...
|
||||
def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ...
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
from typing import Any, Optional, Text, Union
|
||||
from typing import Any, Text
|
||||
|
||||
greenlet: Any
|
||||
|
||||
class IterIO:
|
||||
def __new__(cls, obj, sentinel: Union[Text, bytes] = ...): ...
|
||||
def __new__(cls, obj, sentinel: Text | bytes = ...): ...
|
||||
def __iter__(self): ...
|
||||
def tell(self): ...
|
||||
def isatty(self): ...
|
||||
def seek(self, pos, mode: int = ...): ...
|
||||
def truncate(self, size: Optional[Any] = ...): ...
|
||||
def truncate(self, size: Any | None = ...): ...
|
||||
def write(self, s): ...
|
||||
def writelines(self, list): ...
|
||||
def read(self, n: int = ...): ...
|
||||
def readlines(self, sizehint: int = ...): ...
|
||||
def readline(self, length: Optional[Any] = ...): ...
|
||||
def readline(self, length: Any | None = ...): ...
|
||||
def flush(self): ...
|
||||
def __next__(self): ...
|
||||
|
||||
class IterI(IterIO):
|
||||
sentinel: Any
|
||||
def __new__(cls, func, sentinel: Union[Text, bytes] = ...): ...
|
||||
def __new__(cls, func, sentinel: Text | bytes = ...): ...
|
||||
closed: Any
|
||||
def close(self): ...
|
||||
def write(self, s): ...
|
||||
@@ -30,10 +30,10 @@ class IterO(IterIO):
|
||||
sentinel: Any
|
||||
closed: Any
|
||||
pos: Any
|
||||
def __new__(cls, gen, sentinel: Union[Text, bytes] = ...): ...
|
||||
def __new__(cls, gen, sentinel: Text | bytes = ...): ...
|
||||
def __iter__(self): ...
|
||||
def close(self): ...
|
||||
def seek(self, pos, mode: int = ...): ...
|
||||
def read(self, n: int = ...): ...
|
||||
def readline(self, length: Optional[Any] = ...): ...
|
||||
def readline(self, length: Any | None = ...): ...
|
||||
def readlines(self, sizehint: int = ...): ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from hashlib import sha1 as _default_hash
|
||||
from hmac import new as hmac
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
from werkzeug.contrib.sessions import ModificationTrackingDict
|
||||
|
||||
@@ -12,28 +12,28 @@ class SecureCookie(ModificationTrackingDict[Any, Any]):
|
||||
quote_base64: Any
|
||||
secret_key: Any
|
||||
new: Any
|
||||
def __init__(self, data: Optional[Any] = ..., secret_key: Optional[Any] = ..., new: bool = ...): ...
|
||||
def __init__(self, data: Any | None = ..., secret_key: Any | None = ..., new: bool = ...): ...
|
||||
@property
|
||||
def should_save(self): ...
|
||||
@classmethod
|
||||
def quote(cls, value): ...
|
||||
@classmethod
|
||||
def unquote(cls, value): ...
|
||||
def serialize(self, expires: Optional[Any] = ...): ...
|
||||
def serialize(self, expires: Any | None = ...): ...
|
||||
@classmethod
|
||||
def unserialize(cls, string, secret_key): ...
|
||||
@classmethod
|
||||
def load_cookie(cls, request, key: str = ..., secret_key: Optional[Any] = ...): ...
|
||||
def load_cookie(cls, request, key: str = ..., secret_key: Any | None = ...): ...
|
||||
def save_cookie(
|
||||
self,
|
||||
response,
|
||||
key: str = ...,
|
||||
expires: Optional[Any] = ...,
|
||||
session_expires: Optional[Any] = ...,
|
||||
max_age: Optional[Any] = ...,
|
||||
expires: Any | None = ...,
|
||||
session_expires: Any | None = ...,
|
||||
max_age: Any | None = ...,
|
||||
path: str = ...,
|
||||
domain: Optional[Any] = ...,
|
||||
secure: Optional[Any] = ...,
|
||||
domain: Any | None = ...,
|
||||
secure: Any | None = ...,
|
||||
httponly: bool = ...,
|
||||
force: bool = ...,
|
||||
): ...
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
from typing import Any, Optional, Text, TypeVar
|
||||
from typing import Any, Text, TypeVar
|
||||
|
||||
from werkzeug.datastructures import CallbackDict
|
||||
|
||||
_K = TypeVar("_K")
|
||||
_V = TypeVar("_V")
|
||||
|
||||
def generate_key(salt: Optional[Any] = ...): ...
|
||||
def generate_key(salt: Any | None = ...): ...
|
||||
|
||||
class ModificationTrackingDict(CallbackDict[_K, _V]):
|
||||
modified: Any
|
||||
@@ -22,9 +22,9 @@ class Session(ModificationTrackingDict[_K, _V]):
|
||||
|
||||
class SessionStore:
|
||||
session_class: Any
|
||||
def __init__(self, session_class: Optional[Any] = ...): ...
|
||||
def __init__(self, session_class: Any | None = ...): ...
|
||||
def is_valid_key(self, key): ...
|
||||
def generate_key(self, salt: Optional[Any] = ...): ...
|
||||
def generate_key(self, salt: Any | None = ...): ...
|
||||
def new(self): ...
|
||||
def save(self, session): ...
|
||||
def save_if_modified(self, session): ...
|
||||
@@ -38,9 +38,9 @@ class FilesystemSessionStore(SessionStore):
|
||||
mode: Any
|
||||
def __init__(
|
||||
self,
|
||||
path: Optional[Any] = ...,
|
||||
path: Any | None = ...,
|
||||
filename_template: Text = ...,
|
||||
session_class: Optional[Any] = ...,
|
||||
session_class: Any | None = ...,
|
||||
renew_missing: bool = ...,
|
||||
mode: int = ...,
|
||||
): ...
|
||||
@@ -66,11 +66,11 @@ class SessionMiddleware:
|
||||
app,
|
||||
store,
|
||||
cookie_name: str = ...,
|
||||
cookie_age: Optional[Any] = ...,
|
||||
cookie_expires: Optional[Any] = ...,
|
||||
cookie_age: Any | None = ...,
|
||||
cookie_expires: Any | None = ...,
|
||||
cookie_path: str = ...,
|
||||
cookie_domain: Optional[Any] = ...,
|
||||
cookie_secure: Optional[Any] = ...,
|
||||
cookie_domain: Any | None = ...,
|
||||
cookie_secure: Any | None = ...,
|
||||
cookie_httponly: bool = ...,
|
||||
environ_key: str = ...,
|
||||
): ...
|
||||
|
||||
@@ -13,12 +13,10 @@ from typing import (
|
||||
Mapping,
|
||||
MutableSet,
|
||||
NoReturn,
|
||||
Optional,
|
||||
Text,
|
||||
Tuple,
|
||||
Type,
|
||||
TypeVar,
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
|
||||
@@ -49,7 +47,7 @@ class ImmutableListMixin(Generic[_V]):
|
||||
def insert(self, pos: int, value: Any) -> NoReturn: ...
|
||||
def pop(self, index: int = ...) -> NoReturn: ...
|
||||
def reverse(self) -> NoReturn: ...
|
||||
def sort(self, cmp: Optional[Any] = ..., key: Optional[Any] = ..., reverse: Optional[Any] = ...) -> NoReturn: ...
|
||||
def sort(self, cmp: Any | None = ..., key: Any | None = ..., reverse: Any | None = ...) -> NoReturn: ...
|
||||
|
||||
class ImmutableList(ImmutableListMixin[_V], List[_V]): ... # type: ignore
|
||||
|
||||
@@ -58,9 +56,9 @@ class ImmutableDictMixin(object):
|
||||
def fromkeys(cls, *args, **kwargs): ...
|
||||
def __reduce_ex__(self, protocol): ...
|
||||
def __hash__(self) -> int: ...
|
||||
def setdefault(self, key, default: Optional[Any] = ...): ...
|
||||
def setdefault(self, key, default: Any | None = ...): ...
|
||||
def update(self, *args, **kwargs): ...
|
||||
def pop(self, key, default: Optional[Any] = ...): ...
|
||||
def pop(self, key, default: Any | None = ...): ...
|
||||
def popitem(self): ...
|
||||
def __setitem__(self, key, value): ...
|
||||
def __delitem__(self, key): ...
|
||||
@@ -72,11 +70,11 @@ class ImmutableMultiDictMixin(ImmutableDictMixin):
|
||||
def popitemlist(self): ...
|
||||
def poplist(self, key): ...
|
||||
def setlist(self, key, new_list): ...
|
||||
def setlistdefault(self, key, default_list: Optional[Any] = ...): ...
|
||||
def setlistdefault(self, key, default_list: Any | None = ...): ...
|
||||
|
||||
class UpdateDictMixin(object):
|
||||
on_update: Any
|
||||
def setdefault(self, key, default: Optional[Any] = ...): ...
|
||||
def setdefault(self, key, default: Any | None = ...): ...
|
||||
def pop(self, key, default=...): ...
|
||||
__setitem__: Any
|
||||
__delitem__: Any
|
||||
@@ -86,13 +84,13 @@ class UpdateDictMixin(object):
|
||||
|
||||
class TypeConversionDict(Dict[_K, _V]):
|
||||
@overload
|
||||
def get(self, key: _K, *, type: None = ...) -> Optional[_V]: ...
|
||||
def get(self, key: _K, *, type: None = ...) -> _V | None: ...
|
||||
@overload
|
||||
def get(self, key: _K, default: _D, type: None = ...) -> Union[_V, _D]: ...
|
||||
def get(self, key: _K, default: _D, type: None = ...) -> _V | _D: ...
|
||||
@overload
|
||||
def get(self, key: _K, *, type: Callable[[_V], _R]) -> Optional[_R]: ...
|
||||
def get(self, key: _K, *, type: Callable[[_V], _R]) -> _R | None: ...
|
||||
@overload
|
||||
def get(self, key: _K, default: _D, type: Callable[[_V], _R]) -> Union[_R, _D]: ...
|
||||
def get(self, key: _K, default: _D, type: Callable[[_V], _R]) -> _R | _D: ...
|
||||
|
||||
class ImmutableTypeConversionDict(ImmutableDictMixin, TypeConversionDict[_K, _V]): # type: ignore
|
||||
def copy(self) -> TypeConversionDict[_K, _V]: ...
|
||||
@@ -103,14 +101,14 @@ class ViewItems:
|
||||
def __iter__(self): ...
|
||||
|
||||
class MultiDict(TypeConversionDict[_K, _V]):
|
||||
def __init__(self, mapping: Optional[Any] = ...): ...
|
||||
def __init__(self, mapping: Any | None = ...): ...
|
||||
def __getitem__(self, key): ...
|
||||
def __setitem__(self, key, value): ...
|
||||
def add(self, key, value): ...
|
||||
def getlist(self, key, type: Optional[Any] = ...): ...
|
||||
def getlist(self, key, type: Any | None = ...): ...
|
||||
def setlist(self, key, new_list): ...
|
||||
def setdefault(self, key, default: Optional[Any] = ...): ...
|
||||
def setlistdefault(self, key, default_list: Optional[Any] = ...): ...
|
||||
def setdefault(self, key, default: Any | None = ...): ...
|
||||
def setlistdefault(self, key, default_list: Any | None = ...): ...
|
||||
def items(self, multi: bool = ...): ...
|
||||
def lists(self): ...
|
||||
def keys(self): ...
|
||||
@@ -118,7 +116,7 @@ class MultiDict(TypeConversionDict[_K, _V]):
|
||||
def values(self): ...
|
||||
def listvalues(self): ...
|
||||
def copy(self): ...
|
||||
def deepcopy(self, memo: Optional[Any] = ...): ...
|
||||
def deepcopy(self, memo: Any | None = ...): ...
|
||||
def to_dict(self, flat: bool = ...): ...
|
||||
def update(self, other_dict): ...
|
||||
def pop(self, key, default=...): ...
|
||||
@@ -137,7 +135,7 @@ class _omd_bucket:
|
||||
def unlink(self, omd): ...
|
||||
|
||||
class OrderedMultiDict(MultiDict[_K, _V]):
|
||||
def __init__(self, mapping: Optional[Any] = ...): ...
|
||||
def __init__(self, mapping: Any | None = ...): ...
|
||||
def __eq__(self, other): ...
|
||||
def __ne__(self, other): ...
|
||||
def __reduce_ex__(self, protocol): ...
|
||||
@@ -151,9 +149,9 @@ class OrderedMultiDict(MultiDict[_K, _V]):
|
||||
def lists(self): ...
|
||||
def listvalues(self): ...
|
||||
def add(self, key, value): ...
|
||||
def getlist(self, key, type: Optional[Any] = ...): ...
|
||||
def getlist(self, key, type: Any | None = ...): ...
|
||||
def setlist(self, key, new_list): ...
|
||||
def setlistdefault(self, key, default_list: Optional[Any] = ...): ...
|
||||
def setlistdefault(self, key, default_list: Any | None = ...): ...
|
||||
def update(self, mapping): ...
|
||||
def poplist(self, key): ...
|
||||
def pop(self, key, default=...): ...
|
||||
@@ -161,29 +159,29 @@ class OrderedMultiDict(MultiDict[_K, _V]):
|
||||
def popitemlist(self): ...
|
||||
|
||||
class Headers(object):
|
||||
def __init__(self, defaults: Optional[Any] = ...): ...
|
||||
def __init__(self, defaults: Any | None = ...): ...
|
||||
def __getitem__(self, key, _get_mode: bool = ...): ...
|
||||
def __eq__(self, other): ...
|
||||
def __ne__(self, other): ...
|
||||
@overload
|
||||
def get(self, key: str, *, type: None = ...) -> Optional[str]: ...
|
||||
def get(self, key: str, *, type: None = ...) -> str | None: ...
|
||||
@overload
|
||||
def get(self, key: str, default: _D, type: None = ...) -> Union[str, _D]: ...
|
||||
def get(self, key: str, default: _D, type: None = ...) -> str | _D: ...
|
||||
@overload
|
||||
def get(self, key: str, *, type: Callable[[str], _R]) -> Optional[_R]: ...
|
||||
def get(self, key: str, *, type: Callable[[str], _R]) -> _R | None: ...
|
||||
@overload
|
||||
def get(self, key: str, default: _D, type: Callable[[str], _R]) -> Union[_R, _D]: ...
|
||||
def get(self, key: str, default: _D, type: Callable[[str], _R]) -> _R | _D: ...
|
||||
@overload
|
||||
def get(self, key: str, *, as_bytes: bool) -> Any: ...
|
||||
@overload
|
||||
def get(self, key: str, *, type: None, as_bytes: bool) -> Any: ...
|
||||
@overload
|
||||
def get(self, key: str, *, type: Callable[[Any], _R], as_bytes: bool) -> Optional[_R]: ...
|
||||
def get(self, key: str, *, type: Callable[[Any], _R], as_bytes: bool) -> _R | None: ...
|
||||
@overload
|
||||
def get(self, key: str, default: Any, type: None, as_bytes: bool) -> Any: ...
|
||||
@overload
|
||||
def get(self, key: str, default: _D, type: Callable[[Any], _R], as_bytes: bool) -> Union[_R, _D]: ...
|
||||
def getlist(self, key, type: Optional[Any] = ..., as_bytes: bool = ...): ...
|
||||
def get(self, key: str, default: _D, type: Callable[[Any], _R], as_bytes: bool) -> _R | _D: ...
|
||||
def getlist(self, key, type: Any | None = ..., as_bytes: bool = ...): ...
|
||||
def get_all(self, name): ...
|
||||
def items(self, lower: bool = ...): ...
|
||||
def keys(self, lower: bool = ...): ...
|
||||
@@ -192,13 +190,13 @@ class Headers(object):
|
||||
def __delitem__(self, key: Any) -> None: ...
|
||||
def remove(self, key): ...
|
||||
@overload
|
||||
def pop(self, key: Optional[int] = ...) -> str: ... # default is ignored, using it is an error
|
||||
def pop(self, key: int | None = ...) -> str: ... # default is ignored, using it is an error
|
||||
@overload
|
||||
def pop(self, key: str) -> str: ...
|
||||
@overload
|
||||
def pop(self, key: str, default: str) -> str: ...
|
||||
@overload
|
||||
def pop(self, key: str, default: None) -> Optional[str]: ...
|
||||
def pop(self, key: str, default: None) -> str | None: ...
|
||||
def popitem(self): ...
|
||||
def __contains__(self, key): ...
|
||||
has_key: Any
|
||||
@@ -225,13 +223,13 @@ class ImmutableHeadersMixin:
|
||||
def extend(self, iterable): ...
|
||||
def insert(self, pos, value): ...
|
||||
@overload
|
||||
def pop(self, key: Optional[int] = ...) -> str: ... # default is ignored, using it is an error
|
||||
def pop(self, key: int | None = ...) -> str: ... # default is ignored, using it is an error
|
||||
@overload
|
||||
def pop(self, key: str) -> str: ...
|
||||
@overload
|
||||
def pop(self, key: str, default: str) -> str: ...
|
||||
@overload
|
||||
def pop(self, key: str, default: None) -> Optional[str]: ...
|
||||
def pop(self, key: str, default: None) -> str | None: ...
|
||||
def popitem(self): ...
|
||||
def setdefault(self, key, default): ...
|
||||
|
||||
@@ -247,12 +245,12 @@ class EnvironHeaders(ImmutableHeadersMixin, Headers):
|
||||
class CombinedMultiDict(ImmutableMultiDictMixin, MultiDict[_K, _V]): # type: ignore
|
||||
def __reduce_ex__(self, protocol): ...
|
||||
dicts: Any
|
||||
def __init__(self, dicts: Optional[Any] = ...): ...
|
||||
def __init__(self, dicts: Any | None = ...): ...
|
||||
@classmethod
|
||||
def fromkeys(cls): ...
|
||||
def __getitem__(self, key): ...
|
||||
def get(self, key, default: Optional[Any] = ..., type: Optional[Any] = ...): ...
|
||||
def getlist(self, key, type: Optional[Any] = ...): ...
|
||||
def get(self, key, default: Any | None = ..., type: Any | None = ...): ...
|
||||
def getlist(self, key, type: Any | None = ...): ...
|
||||
def keys(self): ...
|
||||
__iter__: Any
|
||||
def items(self, multi: bool = ...): ...
|
||||
@@ -266,7 +264,7 @@ class CombinedMultiDict(ImmutableMultiDictMixin, MultiDict[_K, _V]): # type: ig
|
||||
has_key: Any
|
||||
|
||||
class FileMultiDict(MultiDict[_K, _V]):
|
||||
def add_file(self, name, file, filename: Optional[Any] = ..., content_type: Optional[Any] = ...): ...
|
||||
def add_file(self, name, file, filename: Any | None = ..., content_type: Any | None = ...): ...
|
||||
|
||||
class ImmutableDict(ImmutableDictMixin, Dict[_K, _V]): # type: ignore
|
||||
def copy(self): ...
|
||||
@@ -282,7 +280,7 @@ class ImmutableOrderedMultiDict(ImmutableMultiDictMixin, OrderedMultiDict[_K, _V
|
||||
|
||||
class Accept(ImmutableList[Tuple[str, float]]):
|
||||
provided: bool
|
||||
def __init__(self, values: Union[None, Accept, Iterable[Tuple[str, float]]] = ...) -> None: ...
|
||||
def __init__(self, values: None | Accept | Iterable[Tuple[str, float]] = ...) -> None: ...
|
||||
@overload
|
||||
def __getitem__(self, key: SupportsIndex) -> Tuple[str, float]: ...
|
||||
@overload
|
||||
@@ -291,16 +289,16 @@ class Accept(ImmutableList[Tuple[str, float]]):
|
||||
def __getitem__(self, key: str) -> float: ...
|
||||
def quality(self, key: str) -> float: ...
|
||||
def __contains__(self, value: str) -> bool: ... # type: ignore
|
||||
def index(self, key: Union[str, Tuple[str, float]]) -> int: ... # type: ignore
|
||||
def find(self, key: Union[str, Tuple[str, float]]) -> int: ...
|
||||
def index(self, key: str | Tuple[str, float]) -> int: ... # type: ignore
|
||||
def find(self, key: str | Tuple[str, float]) -> int: ...
|
||||
def values(self) -> Iterator[str]: ...
|
||||
def to_header(self) -> str: ...
|
||||
@overload
|
||||
def best_match(self, matches: Iterable[str], default: None = ...) -> Optional[str]: ...
|
||||
def best_match(self, matches: Iterable[str], default: None = ...) -> str | None: ...
|
||||
@overload
|
||||
def best_match(self, matches: Iterable[str], default: _D) -> Union[str, _D]: ...
|
||||
def best_match(self, matches: Iterable[str], default: _D) -> str | _D: ...
|
||||
@property
|
||||
def best(self) -> Optional[str]: ...
|
||||
def best(self) -> str | None: ...
|
||||
|
||||
class MIMEAccept(Accept):
|
||||
@property
|
||||
@@ -322,7 +320,7 @@ class _CacheControl(UpdateDictMixin, Dict[str, Any]):
|
||||
no_transform: Any
|
||||
on_update: Any
|
||||
provided: Any
|
||||
def __init__(self, values=..., on_update: Optional[Any] = ...): ...
|
||||
def __init__(self, values=..., on_update: Any | None = ...): ...
|
||||
def to_header(self): ...
|
||||
|
||||
class RequestCacheControl(ImmutableDictMixin, _CacheControl): # type: ignore
|
||||
@@ -340,11 +338,11 @@ class ResponseCacheControl(_CacheControl):
|
||||
|
||||
class CallbackDict(UpdateDictMixin, Dict[_K, _V]):
|
||||
on_update: Any
|
||||
def __init__(self, initial: Optional[Any] = ..., on_update: Optional[Any] = ...): ...
|
||||
def __init__(self, initial: Any | None = ..., on_update: Any | None = ...): ...
|
||||
|
||||
class HeaderSet(MutableSet[str]):
|
||||
on_update: Any
|
||||
def __init__(self, headers: Optional[Any] = ..., on_update: Optional[Any] = ...): ...
|
||||
def __init__(self, headers: Any | None = ..., on_update: Any | None = ...): ...
|
||||
def add(self, header): ...
|
||||
def remove(self, header): ...
|
||||
def update(self, iterable): ...
|
||||
@@ -364,14 +362,14 @@ class HeaderSet(MutableSet[str]):
|
||||
|
||||
class ETags(Container[str], Iterable[str]):
|
||||
star_tag: Any
|
||||
def __init__(self, strong_etags: Optional[Any] = ..., weak_etags: Optional[Any] = ..., star_tag: bool = ...): ...
|
||||
def __init__(self, strong_etags: Any | None = ..., weak_etags: Any | None = ..., star_tag: bool = ...): ...
|
||||
def as_set(self, include_weak: bool = ...): ...
|
||||
def is_weak(self, etag): ...
|
||||
def contains_weak(self, etag): ...
|
||||
def contains(self, etag): ...
|
||||
def contains_raw(self, etag): ...
|
||||
def to_header(self): ...
|
||||
def __call__(self, etag: Optional[Any] = ..., data: Optional[Any] = ..., include_weak: bool = ...): ...
|
||||
def __call__(self, etag: Any | None = ..., data: Any | None = ..., include_weak: bool = ...): ...
|
||||
def __bool__(self): ...
|
||||
__nonzero__: Any
|
||||
def __iter__(self): ...
|
||||
@@ -380,7 +378,7 @@ class ETags(Container[str], Iterable[str]):
|
||||
class IfRange:
|
||||
etag: Any
|
||||
date: Any
|
||||
def __init__(self, etag: Optional[Any] = ..., date: Optional[Any] = ...): ...
|
||||
def __init__(self, etag: Any | None = ..., date: Any | None = ...): ...
|
||||
def to_header(self): ...
|
||||
|
||||
class Range:
|
||||
@@ -394,12 +392,12 @@ class Range:
|
||||
|
||||
class ContentRange:
|
||||
on_update: Any
|
||||
units: Optional[str]
|
||||
units: str | None
|
||||
start: Any
|
||||
stop: Any
|
||||
length: Any
|
||||
def __init__(self, units: Optional[str], start, stop, length: Optional[Any] = ..., on_update: Optional[Any] = ...): ...
|
||||
def set(self, start, stop, length: Optional[Any] = ..., units: Optional[str] = ...): ...
|
||||
def __init__(self, units: str | None, start, stop, length: Any | None = ..., on_update: Any | None = ...): ...
|
||||
def set(self, start, stop, length: Any | None = ..., units: str | None = ...): ...
|
||||
def unset(self) -> None: ...
|
||||
def to_header(self): ...
|
||||
def __nonzero__(self): ...
|
||||
@@ -407,38 +405,36 @@ class ContentRange:
|
||||
|
||||
class Authorization(ImmutableDictMixin, Dict[str, Any]): # type: ignore
|
||||
type: str
|
||||
def __init__(self, auth_type: str, data: Optional[Mapping[str, Any]] = ...) -> None: ...
|
||||
def __init__(self, auth_type: str, data: Mapping[str, Any] | None = ...) -> None: ...
|
||||
@property
|
||||
def username(self) -> Optional[str]: ...
|
||||
def username(self) -> str | None: ...
|
||||
@property
|
||||
def password(self) -> Optional[str]: ...
|
||||
def password(self) -> str | None: ...
|
||||
@property
|
||||
def realm(self) -> Optional[str]: ...
|
||||
def realm(self) -> str | None: ...
|
||||
@property
|
||||
def nonce(self) -> Optional[str]: ...
|
||||
def nonce(self) -> str | None: ...
|
||||
@property
|
||||
def uri(self) -> Optional[str]: ...
|
||||
def uri(self) -> str | None: ...
|
||||
@property
|
||||
def nc(self) -> Optional[str]: ...
|
||||
def nc(self) -> str | None: ...
|
||||
@property
|
||||
def cnonce(self) -> Optional[str]: ...
|
||||
def cnonce(self) -> str | None: ...
|
||||
@property
|
||||
def response(self) -> Optional[str]: ...
|
||||
def response(self) -> str | None: ...
|
||||
@property
|
||||
def opaque(self) -> Optional[str]: ...
|
||||
def opaque(self) -> str | None: ...
|
||||
@property
|
||||
def qop(self) -> Optional[str]: ...
|
||||
def qop(self) -> str | None: ...
|
||||
|
||||
class WWWAuthenticate(UpdateDictMixin, Dict[str, Any]):
|
||||
on_update: Any
|
||||
def __init__(self, auth_type: Optional[Any] = ..., values: Optional[Any] = ..., on_update: Optional[Any] = ...): ...
|
||||
def __init__(self, auth_type: Any | None = ..., values: Any | None = ..., on_update: Any | None = ...): ...
|
||||
def set_basic(self, realm: str = ...): ...
|
||||
def set_digest(
|
||||
self, realm, nonce, qop=..., opaque: Optional[Any] = ..., algorithm: Optional[Any] = ..., stale: bool = ...
|
||||
): ...
|
||||
def set_digest(self, realm, nonce, qop=..., opaque: Any | None = ..., algorithm: Any | None = ..., stale: bool = ...): ...
|
||||
def to_header(self): ...
|
||||
@staticmethod
|
||||
def auth_property(name, doc: Optional[Any] = ...): ...
|
||||
def auth_property(name, doc: Any | None = ...): ...
|
||||
type: Any
|
||||
realm: Any
|
||||
domain: Any
|
||||
@@ -449,28 +445,28 @@ class WWWAuthenticate(UpdateDictMixin, Dict[str, Any]):
|
||||
stale: Any
|
||||
|
||||
class FileStorage(object):
|
||||
name: Optional[Text]
|
||||
name: Text | None
|
||||
stream: IO[bytes]
|
||||
filename: Optional[Text]
|
||||
filename: Text | None
|
||||
headers: Headers
|
||||
def __init__(
|
||||
self,
|
||||
stream: Optional[IO[bytes]] = ...,
|
||||
filename: Union[None, Text, bytes] = ...,
|
||||
name: Optional[Text] = ...,
|
||||
content_type: Optional[Text] = ...,
|
||||
content_length: Optional[int] = ...,
|
||||
headers: Optional[Headers] = ...,
|
||||
stream: IO[bytes] | None = ...,
|
||||
filename: None | Text | bytes = ...,
|
||||
name: Text | None = ...,
|
||||
content_type: Text | None = ...,
|
||||
content_length: int | None = ...,
|
||||
headers: Headers | None = ...,
|
||||
): ...
|
||||
@property
|
||||
def content_type(self) -> Optional[Text]: ...
|
||||
def content_type(self) -> Text | None: ...
|
||||
@property
|
||||
def content_length(self) -> int: ...
|
||||
@property
|
||||
def mimetype(self) -> str: ...
|
||||
@property
|
||||
def mimetype_params(self) -> Dict[str, str]: ...
|
||||
def save(self, dst: Union[Text, SupportsWrite[bytes]], buffer_size: int = ...): ...
|
||||
def save(self, dst: Text | SupportsWrite[bytes], buffer_size: int = ...): ...
|
||||
def close(self) -> None: ...
|
||||
def __nonzero__(self) -> bool: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
from werkzeug.wrappers import BaseRequest as Request, BaseResponse as Response
|
||||
|
||||
@@ -32,9 +32,9 @@ class DebuggedApplication:
|
||||
evalex: bool = ...,
|
||||
request_key: str = ...,
|
||||
console_path: str = ...,
|
||||
console_init_func: Optional[Any] = ...,
|
||||
console_init_func: Any | None = ...,
|
||||
show_hidden_frames: bool = ...,
|
||||
lodgeit_url: Optional[Any] = ...,
|
||||
lodgeit_url: Any | None = ...,
|
||||
pin_security: bool = ...,
|
||||
pin_logging: bool = ...,
|
||||
): ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import code
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
class HTMLStringO:
|
||||
def __init__(self): ...
|
||||
@@ -36,9 +36,9 @@ class _InteractiveConsole(code.InteractiveInterpreter):
|
||||
def runsource(self, source): ...
|
||||
def runcode(self, code): ...
|
||||
def showtraceback(self): ...
|
||||
def showsyntaxerror(self, filename: Optional[Any] = ...): ...
|
||||
def showsyntaxerror(self, filename: Any | None = ...): ...
|
||||
def write(self, data): ...
|
||||
|
||||
class Console:
|
||||
def __init__(self, globals: Optional[Any] = ..., locals: Optional[Any] = ...): ...
|
||||
def __init__(self, globals: Any | None = ..., locals: Any | None = ...): ...
|
||||
def eval(self, code): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
deque: Any
|
||||
missing: Any
|
||||
@@ -10,7 +10,7 @@ def debug_repr(obj): ...
|
||||
def dump(obj=...): ...
|
||||
|
||||
class _Helper:
|
||||
def __call__(self, topic: Optional[Any] = ...): ...
|
||||
def __call__(self, topic: Any | None = ...): ...
|
||||
|
||||
helper: Any
|
||||
|
||||
@@ -30,4 +30,4 @@ class DebugReprGenerator:
|
||||
def repr(self, obj): ...
|
||||
def dump_object(self, obj): ...
|
||||
def dump_locals(self, d): ...
|
||||
def render_object_dump(self, items, title, repr: Optional[Any] = ...): ...
|
||||
def render_object_dump(self, items, title, repr: Any | None = ...): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
UTF8_COOKIE: Any
|
||||
system_exceptions: Any
|
||||
@@ -31,10 +31,10 @@ class Traceback:
|
||||
def filter_hidden_frames(self): ...
|
||||
def is_syntax_error(self): ...
|
||||
def exception(self): ...
|
||||
def log(self, logfile: Optional[Any] = ...): ...
|
||||
def log(self, logfile: Any | None = ...): ...
|
||||
def paste(self): ...
|
||||
def render_summary(self, include_title: bool = ...): ...
|
||||
def render_full(self, evalex: bool = ..., secret: Optional[Any] = ..., evalex_trusted: bool = ...): ...
|
||||
def render_full(self, evalex: bool = ..., secret: Any | None = ..., evalex_trusted: bool = ...): ...
|
||||
def generate_plaintext_traceback(self): ...
|
||||
def plaintext(self): ...
|
||||
id: Any
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import datetime
|
||||
from _typeshed.wsgi import StartResponse, WSGIEnvironment
|
||||
from typing import Any, Dict, Iterable, List, NoReturn, Optional, Protocol, Text, Tuple, Type, Union
|
||||
from typing import Any, Dict, Iterable, List, NoReturn, Protocol, Text, Tuple, Type
|
||||
|
||||
from werkzeug.wrappers import Response
|
||||
|
||||
@@ -9,18 +9,18 @@ class _EnvironContainer(Protocol):
|
||||
def environ(self) -> WSGIEnvironment: ...
|
||||
|
||||
class HTTPException(Exception):
|
||||
code: Optional[int]
|
||||
description: Optional[Text]
|
||||
response: Optional[Response]
|
||||
def __init__(self, description: Optional[Text] = ..., response: Optional[Response] = ...) -> None: ...
|
||||
code: int | None
|
||||
description: Text | None
|
||||
response: Response | None
|
||||
def __init__(self, description: Text | None = ..., response: Response | None = ...) -> None: ...
|
||||
@classmethod
|
||||
def wrap(cls, exception: Type[Exception], name: Optional[str] = ...) -> Any: ...
|
||||
def wrap(cls, exception: Type[Exception], name: str | None = ...) -> Any: ...
|
||||
@property
|
||||
def name(self) -> str: ...
|
||||
def get_description(self, environ: Optional[WSGIEnvironment] = ...) -> Text: ...
|
||||
def get_body(self, environ: Optional[WSGIEnvironment] = ...) -> Text: ...
|
||||
def get_headers(self, environ: Optional[WSGIEnvironment] = ...) -> List[Tuple[str, str]]: ...
|
||||
def get_response(self, environ: Optional[Union[WSGIEnvironment, _EnvironContainer]] = ...) -> Response: ...
|
||||
def get_description(self, environ: WSGIEnvironment | None = ...) -> Text: ...
|
||||
def get_body(self, environ: WSGIEnvironment | None = ...) -> Text: ...
|
||||
def get_headers(self, environ: WSGIEnvironment | None = ...) -> List[Tuple[str, str]]: ...
|
||||
def get_response(self, environ: WSGIEnvironment | _EnvironContainer | None = ...) -> Response: ...
|
||||
def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ...
|
||||
|
||||
default_exceptions: Dict[int, Type[HTTPException]]
|
||||
@@ -36,12 +36,12 @@ class BadHost(BadRequest): ...
|
||||
class Unauthorized(HTTPException):
|
||||
code: int
|
||||
description: Text
|
||||
www_authenticate: Optional[Iterable[object]]
|
||||
www_authenticate: Iterable[object] | None
|
||||
def __init__(
|
||||
self,
|
||||
description: Optional[Text] = ...,
|
||||
response: Optional[Response] = ...,
|
||||
www_authenticate: Union[None, Tuple[object, ...], List[object], object] = ...,
|
||||
description: Text | None = ...,
|
||||
response: Response | None = ...,
|
||||
www_authenticate: None | Tuple[object, ...] | List[object] | object = ...,
|
||||
) -> None: ...
|
||||
|
||||
class Forbidden(HTTPException):
|
||||
@@ -56,7 +56,7 @@ class MethodNotAllowed(HTTPException):
|
||||
code: int
|
||||
description: Text
|
||||
valid_methods: Any
|
||||
def __init__(self, valid_methods: Optional[Any] = ..., description: Optional[Any] = ...): ...
|
||||
def __init__(self, valid_methods: Any | None = ..., description: Any | None = ...): ...
|
||||
|
||||
class NotAcceptable(HTTPException):
|
||||
code: int
|
||||
@@ -99,7 +99,7 @@ class RequestedRangeNotSatisfiable(HTTPException):
|
||||
description: Text
|
||||
length: Any
|
||||
units: str
|
||||
def __init__(self, length: Optional[Any] = ..., units: str = ..., description: Optional[Any] = ...): ...
|
||||
def __init__(self, length: Any | None = ..., units: str = ..., description: Any | None = ...): ...
|
||||
|
||||
class ExpectationFailed(HTTPException):
|
||||
code: int
|
||||
@@ -126,12 +126,9 @@ class PreconditionRequired(HTTPException):
|
||||
description: Text
|
||||
|
||||
class _RetryAfter(HTTPException):
|
||||
retry_after: Union[None, int, datetime.datetime]
|
||||
retry_after: None | int | datetime.datetime
|
||||
def __init__(
|
||||
self,
|
||||
description: Optional[Text] = ...,
|
||||
response: Optional[Response] = ...,
|
||||
retry_after: Union[None, int, datetime.datetime] = ...,
|
||||
self, description: Text | None = ..., response: Response | None = ..., retry_after: None | int | datetime.datetime = ...
|
||||
) -> None: ...
|
||||
|
||||
class TooManyRequests(_RetryAfter):
|
||||
@@ -148,7 +145,7 @@ class UnavailableForLegalReasons(HTTPException):
|
||||
|
||||
class InternalServerError(HTTPException):
|
||||
def __init__(
|
||||
self, description: Optional[Text] = ..., response: Optional[Response] = ..., original_exception: Optional[Exception] = ...
|
||||
self, description: Text | None = ..., response: Response | None = ..., original_exception: Exception | None = ...
|
||||
) -> None: ...
|
||||
code: int
|
||||
description: Text
|
||||
@@ -175,9 +172,9 @@ class HTTPVersionNotSupported(HTTPException):
|
||||
|
||||
class Aborter:
|
||||
mapping: Any
|
||||
def __init__(self, mapping: Optional[Any] = ..., extra: Optional[Any] = ...) -> None: ...
|
||||
def __call__(self, code: Union[int, Response], *args: Any, **kwargs: Any) -> NoReturn: ...
|
||||
def __init__(self, mapping: Any | None = ..., extra: Any | None = ...) -> None: ...
|
||||
def __call__(self, code: int | Response, *args: Any, **kwargs: Any) -> NoReturn: ...
|
||||
|
||||
def abort(status: Union[int, Response], *args: Any, **kwargs: Any) -> NoReturn: ...
|
||||
def abort(status: int | Response, *args: Any, **kwargs: Any) -> NoReturn: ...
|
||||
|
||||
class BadRequestKeyError(BadRequest, KeyError): ...
|
||||
|
||||
@@ -1,20 +1,5 @@
|
||||
from _typeshed.wsgi import WSGIEnvironment
|
||||
from typing import (
|
||||
IO,
|
||||
Any,
|
||||
Callable,
|
||||
Dict,
|
||||
Generator,
|
||||
Iterable,
|
||||
Mapping,
|
||||
NoReturn,
|
||||
Optional,
|
||||
Protocol,
|
||||
Text,
|
||||
Tuple,
|
||||
TypeVar,
|
||||
Union,
|
||||
)
|
||||
from typing import IO, Any, Callable, Dict, Generator, Iterable, Mapping, NoReturn, Optional, Protocol, Text, Tuple, TypeVar
|
||||
|
||||
from .datastructures import Headers
|
||||
|
||||
@@ -25,20 +10,20 @@ _F = TypeVar("_F", bound=Callable[..., Any])
|
||||
|
||||
class _StreamFactory(Protocol):
|
||||
def __call__(
|
||||
self, total_content_length: Optional[int], filename: str, content_type: str, content_length: Optional[int] = ...
|
||||
self, total_content_length: int | None, filename: str, content_type: str, content_length: int | None = ...
|
||||
) -> IO[bytes]: ...
|
||||
|
||||
def default_stream_factory(
|
||||
total_content_length: Optional[int], filename: str, content_type: str, content_length: Optional[int] = ...
|
||||
total_content_length: int | None, filename: str, content_type: str, content_length: int | None = ...
|
||||
) -> IO[bytes]: ...
|
||||
def parse_form_data(
|
||||
environ: WSGIEnvironment,
|
||||
stream_factory: Optional[_StreamFactory] = ...,
|
||||
stream_factory: _StreamFactory | None = ...,
|
||||
charset: Text = ...,
|
||||
errors: Text = ...,
|
||||
max_form_memory_size: Optional[int] = ...,
|
||||
max_content_length: Optional[int] = ...,
|
||||
cls: Optional[Callable[[], _Dict]] = ...,
|
||||
max_form_memory_size: int | None = ...,
|
||||
max_content_length: int | None = ...,
|
||||
cls: Callable[[], _Dict] | None = ...,
|
||||
silent: bool = ...,
|
||||
) -> Tuple[IO[bytes], _Dict, _Dict]: ...
|
||||
def exhaust_stream(f: _F) -> _F: ...
|
||||
@@ -47,54 +32,54 @@ class FormDataParser(object):
|
||||
stream_factory: _StreamFactory
|
||||
charset: Text
|
||||
errors: Text
|
||||
max_form_memory_size: Optional[int]
|
||||
max_content_length: Optional[int]
|
||||
max_form_memory_size: int | None
|
||||
max_content_length: int | None
|
||||
cls: Callable[[], _Dict]
|
||||
silent: bool
|
||||
def __init__(
|
||||
self,
|
||||
stream_factory: Optional[_StreamFactory] = ...,
|
||||
stream_factory: _StreamFactory | None = ...,
|
||||
charset: Text = ...,
|
||||
errors: Text = ...,
|
||||
max_form_memory_size: Optional[int] = ...,
|
||||
max_content_length: Optional[int] = ...,
|
||||
cls: Optional[Callable[[], _Dict]] = ...,
|
||||
max_form_memory_size: int | None = ...,
|
||||
max_content_length: int | None = ...,
|
||||
cls: Callable[[], _Dict] | None = ...,
|
||||
silent: bool = ...,
|
||||
) -> None: ...
|
||||
def get_parse_func(self, mimetype: str, options: Any) -> Optional[_ParseFunc]: ...
|
||||
def get_parse_func(self, mimetype: str, options: Any) -> _ParseFunc | None: ...
|
||||
def parse_from_environ(self, environ: WSGIEnvironment) -> Tuple[IO[bytes], _Dict, _Dict]: ...
|
||||
def parse(
|
||||
self, stream: IO[bytes], mimetype: Text, content_length: Optional[int], options: Optional[Mapping[str, str]] = ...
|
||||
self, stream: IO[bytes], mimetype: Text, content_length: int | None, options: Mapping[str, str] | None = ...
|
||||
) -> Tuple[IO[bytes], _Dict, _Dict]: ...
|
||||
parse_functions: Dict[Text, _ParseFunc]
|
||||
|
||||
def is_valid_multipart_boundary(boundary: str) -> bool: ...
|
||||
def parse_multipart_headers(iterable: Iterable[Union[Text, bytes]]) -> Headers: ...
|
||||
def parse_multipart_headers(iterable: Iterable[Text | bytes]) -> Headers: ...
|
||||
|
||||
class MultiPartParser(object):
|
||||
charset: Text
|
||||
errors: Text
|
||||
max_form_memory_size: Optional[int]
|
||||
max_form_memory_size: int | None
|
||||
stream_factory: _StreamFactory
|
||||
cls: Callable[[], _Dict]
|
||||
buffer_size: int
|
||||
def __init__(
|
||||
self,
|
||||
stream_factory: Optional[_StreamFactory] = ...,
|
||||
stream_factory: _StreamFactory | None = ...,
|
||||
charset: Text = ...,
|
||||
errors: Text = ...,
|
||||
max_form_memory_size: Optional[int] = ...,
|
||||
cls: Optional[Callable[[], _Dict]] = ...,
|
||||
max_form_memory_size: int | None = ...,
|
||||
cls: Callable[[], _Dict] | None = ...,
|
||||
buffer_size: int = ...,
|
||||
) -> None: ...
|
||||
def fail(self, message: Text) -> NoReturn: ...
|
||||
def get_part_encoding(self, headers: Mapping[str, str]) -> Optional[str]: ...
|
||||
def get_part_encoding(self, headers: Mapping[str, str]) -> str | None: ...
|
||||
def get_part_charset(self, headers: Mapping[str, str]) -> Text: ...
|
||||
def start_file_streaming(
|
||||
self, filename: Union[Text, bytes], headers: Mapping[str, str], total_content_length: Optional[int]
|
||||
self, filename: Text | bytes, headers: Mapping[str, str], total_content_length: int | None
|
||||
) -> Tuple[Text, IO[bytes]]: ...
|
||||
def in_memory_threshold_reached(self, bytes: Any) -> NoReturn: ...
|
||||
def validate_boundary(self, boundary: Optional[str]) -> None: ...
|
||||
def validate_boundary(self, boundary: str | None) -> None: ...
|
||||
def parse_lines(
|
||||
self, file: Any, boundary: bytes, content_length: int, cap_at_buffer: bool = ...
|
||||
) -> Generator[Tuple[str, Any], None, None]: ...
|
||||
|
||||
@@ -1,22 +1,7 @@
|
||||
import sys
|
||||
from _typeshed.wsgi import WSGIEnvironment
|
||||
from datetime import datetime, timedelta
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Dict,
|
||||
Iterable,
|
||||
List,
|
||||
Mapping,
|
||||
Optional,
|
||||
SupportsInt,
|
||||
Text,
|
||||
Tuple,
|
||||
Type,
|
||||
TypeVar,
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
from typing import Any, Callable, Dict, Iterable, List, Mapping, SupportsInt, Text, Tuple, Type, TypeVar, Union, overload
|
||||
|
||||
from .datastructures import (
|
||||
Accept,
|
||||
@@ -46,92 +31,90 @@ _U = TypeVar("_U")
|
||||
|
||||
HTTP_STATUS_CODES: Dict[int, str]
|
||||
|
||||
def wsgi_to_bytes(data: Union[bytes, Text]) -> bytes: ...
|
||||
def wsgi_to_bytes(data: bytes | Text) -> bytes: ...
|
||||
def bytes_to_wsgi(data: bytes) -> str: ...
|
||||
def quote_header_value(value: Any, extra_chars: str = ..., allow_token: bool = ...) -> str: ...
|
||||
def unquote_header_value(value: _Str, is_filename: bool = ...) -> _Str: ...
|
||||
def dump_options_header(header: Optional[_Str], options: Mapping[_Str, Any]) -> _Str: ...
|
||||
def dump_header(iterable: Union[Iterable[Any], Dict[_Str, Any]], allow_token: bool = ...) -> _Str: ...
|
||||
def dump_options_header(header: _Str | None, options: Mapping[_Str, Any]) -> _Str: ...
|
||||
def dump_header(iterable: Iterable[Any] | Dict[_Str, Any], allow_token: bool = ...) -> _Str: ...
|
||||
def parse_list_header(value: _Str) -> List[_Str]: ...
|
||||
@overload
|
||||
def parse_dict_header(value: Union[bytes, Text]) -> Dict[Text, Optional[Text]]: ...
|
||||
def parse_dict_header(value: bytes | Text) -> Dict[Text, Text | None]: ...
|
||||
@overload
|
||||
def parse_dict_header(value: Union[bytes, Text], cls: Type[_T]) -> _T: ...
|
||||
def parse_dict_header(value: bytes | Text, cls: Type[_T]) -> _T: ...
|
||||
@overload
|
||||
def parse_options_header(value: None, multiple: bool = ...) -> Tuple[str, Dict[str, Optional[str]]]: ...
|
||||
def parse_options_header(value: None, multiple: bool = ...) -> Tuple[str, Dict[str, str | None]]: ...
|
||||
@overload
|
||||
def parse_options_header(value: _Str) -> Tuple[_Str, Dict[_Str, Optional[_Str]]]: ...
|
||||
def parse_options_header(value: _Str) -> Tuple[_Str, Dict[_Str, _Str | None]]: ...
|
||||
|
||||
# actually returns Tuple[_Str, Dict[_Str, Optional[_Str]], ...]
|
||||
# actually returns Tuple[_Str, Dict[_Str, _Str | None], ...]
|
||||
@overload
|
||||
def parse_options_header(value: _Str, multiple: bool = ...) -> Tuple[Any, ...]: ...
|
||||
@overload
|
||||
def parse_accept_header(value: Optional[Text]) -> Accept: ...
|
||||
def parse_accept_header(value: Text | None) -> Accept: ...
|
||||
@overload
|
||||
def parse_accept_header(value: Optional[_Str], cls: Callable[[Optional[List[Tuple[str, float]]]], _T]) -> _T: ...
|
||||
def parse_accept_header(value: _Str | None, cls: Callable[[List[Tuple[str, float]] | None], _T]) -> _T: ...
|
||||
@overload
|
||||
def parse_cache_control_header(
|
||||
value: Union[None, bytes, Text], on_update: Optional[Callable[[RequestCacheControl], Any]] = ...
|
||||
value: None | bytes | Text, on_update: Callable[[RequestCacheControl], Any] | None = ...
|
||||
) -> RequestCacheControl: ...
|
||||
@overload
|
||||
def parse_cache_control_header(
|
||||
value: Union[None, bytes, Text], on_update: _T, cls: Callable[[Dict[Text, Optional[Text]], _T], _U]
|
||||
value: None | bytes | Text, on_update: _T, cls: Callable[[Dict[Text, Text | None], _T], _U]
|
||||
) -> _U: ...
|
||||
@overload
|
||||
def parse_cache_control_header(
|
||||
value: Union[None, bytes, Text], *, cls: Callable[[Dict[Text, Optional[Text]], None], _U]
|
||||
) -> _U: ...
|
||||
def parse_set_header(value: Text, on_update: Optional[Callable[[HeaderSet], Any]] = ...) -> HeaderSet: ...
|
||||
def parse_authorization_header(value: Union[None, bytes, Text]) -> Optional[Authorization]: ...
|
||||
def parse_cache_control_header(value: None | bytes | Text, *, cls: Callable[[Dict[Text, Text | None], None], _U]) -> _U: ...
|
||||
def parse_set_header(value: Text, on_update: Callable[[HeaderSet], Any] | None = ...) -> HeaderSet: ...
|
||||
def parse_authorization_header(value: None | bytes | Text) -> Authorization | None: ...
|
||||
def parse_www_authenticate_header(
|
||||
value: Union[None, bytes, Text], on_update: Optional[Callable[[WWWAuthenticate], Any]] = ...
|
||||
value: None | bytes | Text, on_update: Callable[[WWWAuthenticate], Any] | None = ...
|
||||
) -> WWWAuthenticate: ...
|
||||
def parse_if_range_header(value: Optional[Text]) -> IfRange: ...
|
||||
def parse_range_header(value: Optional[Text], make_inclusive: bool = ...) -> Optional[Range]: ...
|
||||
def parse_if_range_header(value: Text | None) -> IfRange: ...
|
||||
def parse_range_header(value: Text | None, make_inclusive: bool = ...) -> Range | None: ...
|
||||
def parse_content_range_header(
|
||||
value: Optional[Text], on_update: Optional[Callable[[ContentRange], Any]] = ...
|
||||
) -> Optional[ContentRange]: ...
|
||||
value: Text | None, on_update: Callable[[ContentRange], Any] | None = ...
|
||||
) -> ContentRange | None: ...
|
||||
def quote_etag(etag: _Str, weak: bool = ...) -> _Str: ...
|
||||
def unquote_etag(etag: Optional[_Str]) -> Tuple[Optional[_Str], Optional[_Str]]: ...
|
||||
def parse_etags(value: Optional[Text]) -> ETags: ...
|
||||
def unquote_etag(etag: _Str | None) -> Tuple[_Str | None, _Str | None]: ...
|
||||
def parse_etags(value: Text | None) -> ETags: ...
|
||||
def generate_etag(data: _ETagData) -> str: ...
|
||||
def parse_date(value: Optional[str]) -> Optional[datetime]: ...
|
||||
def cookie_date(expires: Union[None, float, datetime] = ...) -> str: ...
|
||||
def http_date(timestamp: Union[None, float, datetime] = ...) -> str: ...
|
||||
def parse_age(value: Optional[SupportsInt] = ...) -> Optional[timedelta]: ...
|
||||
def dump_age(age: Union[None, timedelta, SupportsInt]) -> Optional[str]: ...
|
||||
def parse_date(value: str | None) -> datetime | None: ...
|
||||
def cookie_date(expires: None | float | datetime = ...) -> str: ...
|
||||
def http_date(timestamp: None | float | datetime = ...) -> str: ...
|
||||
def parse_age(value: SupportsInt | None = ...) -> timedelta | None: ...
|
||||
def dump_age(age: None | timedelta | SupportsInt) -> str | None: ...
|
||||
def is_resource_modified(
|
||||
environ: WSGIEnvironment,
|
||||
etag: Optional[Text] = ...,
|
||||
data: Optional[_ETagData] = ...,
|
||||
last_modified: Union[None, Text, datetime] = ...,
|
||||
etag: Text | None = ...,
|
||||
data: _ETagData | None = ...,
|
||||
last_modified: None | Text | datetime = ...,
|
||||
ignore_if_range: bool = ...,
|
||||
) -> bool: ...
|
||||
def remove_entity_headers(headers: Union[List[Tuple[Text, Text]], Headers], allowed: Iterable[Text] = ...) -> None: ...
|
||||
def remove_hop_by_hop_headers(headers: Union[List[Tuple[Text, Text]], Headers]) -> None: ...
|
||||
def remove_entity_headers(headers: List[Tuple[Text, Text]] | Headers, allowed: Iterable[Text] = ...) -> None: ...
|
||||
def remove_hop_by_hop_headers(headers: List[Tuple[Text, Text]] | Headers) -> None: ...
|
||||
def is_entity_header(header: Text) -> bool: ...
|
||||
def is_hop_by_hop_header(header: Text) -> bool: ...
|
||||
@overload
|
||||
def parse_cookie(
|
||||
header: Union[None, WSGIEnvironment, Text, bytes], charset: Text = ..., errors: Text = ...
|
||||
header: None | WSGIEnvironment | Text | bytes, charset: Text = ..., errors: Text = ...
|
||||
) -> TypeConversionDict[Any, Any]: ...
|
||||
@overload
|
||||
def parse_cookie(
|
||||
header: Union[None, WSGIEnvironment, Text, bytes],
|
||||
header: None | WSGIEnvironment | Text | bytes,
|
||||
charset: Text = ...,
|
||||
errors: Text = ...,
|
||||
cls: Optional[Callable[[Iterable[Tuple[Text, Text]]], _T]] = ...,
|
||||
cls: Callable[[Iterable[Tuple[Text, Text]]], _T] | None = ...,
|
||||
) -> _T: ...
|
||||
def dump_cookie(
|
||||
key: _ToBytes,
|
||||
value: _ToBytes = ...,
|
||||
max_age: Union[None, float, timedelta] = ...,
|
||||
expires: Union[None, Text, float, datetime] = ...,
|
||||
path: Union[None, Tuple[Any, ...], str, bytes] = ...,
|
||||
domain: Union[None, str, bytes] = ...,
|
||||
max_age: None | float | timedelta = ...,
|
||||
expires: None | Text | float | datetime = ...,
|
||||
path: None | Tuple[Any, ...] | str | bytes = ...,
|
||||
domain: None | str | bytes = ...,
|
||||
secure: bool = ...,
|
||||
httponly: bool = ...,
|
||||
charset: Text = ...,
|
||||
sync_expires: bool = ...,
|
||||
) -> str: ...
|
||||
def is_byte_range_valid(start: Optional[int], stop: Optional[int], length: Optional[int]) -> bool: ...
|
||||
def is_byte_range_valid(start: int | None, stop: int | None, length: int | None) -> bool: ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
def release_local(local): ...
|
||||
|
||||
@@ -26,14 +26,14 @@ class LocalStack:
|
||||
class LocalManager:
|
||||
locals: Any
|
||||
ident_func: Any
|
||||
def __init__(self, locals: Optional[Any] = ..., ident_func: Optional[Any] = ...): ...
|
||||
def __init__(self, locals: Any | None = ..., ident_func: Any | None = ...): ...
|
||||
def get_ident(self): ...
|
||||
def cleanup(self): ...
|
||||
def make_middleware(self, app): ...
|
||||
def middleware(self, func): ...
|
||||
|
||||
class LocalProxy:
|
||||
def __init__(self, local, name: Optional[Any] = ...): ...
|
||||
def __init__(self, local, name: Any | None = ...): ...
|
||||
@property
|
||||
def __dict__(self): ...
|
||||
def __bool__(self): ...
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment
|
||||
from typing import Iterable, Mapping, Optional, Text
|
||||
from typing import Iterable, Mapping, Text
|
||||
|
||||
class DispatcherMiddleware(object):
|
||||
app: WSGIApplication
|
||||
mounts: Mapping[Text, WSGIApplication]
|
||||
def __init__(self, app: WSGIApplication, mounts: Optional[Mapping[Text, WSGIApplication]] = ...) -> None: ...
|
||||
def __init__(self, app: WSGIApplication, mounts: Mapping[Text, WSGIApplication] | None = ...) -> None: ...
|
||||
def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ...
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import SupportsWrite
|
||||
from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment
|
||||
from typing import Any, Iterable, Iterator, List, Mapping, Optional, Protocol, Tuple
|
||||
from typing import Any, Iterable, Iterator, List, Mapping, Protocol, Tuple
|
||||
|
||||
from ..datastructures import Headers
|
||||
|
||||
@@ -55,7 +55,7 @@ class LintMiddleware(object):
|
||||
def __init__(self, app: WSGIApplication) -> None: ...
|
||||
def check_environ(self, environ: WSGIEnvironment) -> None: ...
|
||||
def check_start_response(
|
||||
self, status: str, headers: List[Tuple[str, str]], exc_info: Optional[Tuple[Any, ...]]
|
||||
self, status: str, headers: List[Tuple[str, str]], exc_info: Tuple[Any, ...] | None
|
||||
) -> Tuple[int, Headers]: ...
|
||||
def check_headers(self, headers: Mapping[str, str]) -> None: ...
|
||||
def check_iterator(self, app_iter: Iterable[bytes]) -> None: ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment
|
||||
from typing import IO, Iterable, List, Optional, Text, Tuple, Union
|
||||
from typing import IO, Iterable, List, Text, Tuple
|
||||
|
||||
class ProfilerMiddleware(object):
|
||||
def __init__(
|
||||
@@ -7,8 +7,8 @@ class ProfilerMiddleware(object):
|
||||
app: WSGIApplication,
|
||||
stream: IO[str] = ...,
|
||||
sort_by: Tuple[Text, Text] = ...,
|
||||
restrictions: Iterable[Union[str, float]] = ...,
|
||||
profile_dir: Optional[Text] = ...,
|
||||
restrictions: Iterable[str | float] = ...,
|
||||
profile_dir: Text | None = ...,
|
||||
filename_format: Text = ...,
|
||||
) -> None: ...
|
||||
def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> List[bytes]: ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment
|
||||
from typing import Iterable, Optional
|
||||
from typing import Iterable
|
||||
|
||||
class ProxyFix(object):
|
||||
app: WSGIApplication
|
||||
@@ -12,12 +12,12 @@ class ProxyFix(object):
|
||||
def __init__(
|
||||
self,
|
||||
app: WSGIApplication,
|
||||
num_proxies: Optional[int] = ...,
|
||||
num_proxies: int | None = ...,
|
||||
x_for: int = ...,
|
||||
x_proto: int = ...,
|
||||
x_host: int = ...,
|
||||
x_port: int = ...,
|
||||
x_prefix: int = ...,
|
||||
) -> None: ...
|
||||
def get_remote_addr(self, forwarded_for: Iterable[str]) -> Optional[str]: ...
|
||||
def get_remote_addr(self, forwarded_for: Iterable[str]) -> str | None: ...
|
||||
def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ...
|
||||
|
||||
@@ -15,8 +15,8 @@ class SharedDataMiddleware(object):
|
||||
def __init__(
|
||||
self,
|
||||
app: WSGIApplication,
|
||||
exports: Union[Mapping[Text, _V], Iterable[Tuple[Text, _V]]],
|
||||
disallow: Optional[Text] = ...,
|
||||
exports: Mapping[Text, _V] | Iterable[Tuple[Text, _V]],
|
||||
disallow: Text | None = ...,
|
||||
cache: bool = ...,
|
||||
cache_timeout: float = ...,
|
||||
fallback_mimetype: Text = ...,
|
||||
@@ -25,5 +25,5 @@ class SharedDataMiddleware(object):
|
||||
def get_file_loader(self, filename: Text) -> _Loader: ...
|
||||
def get_package_loader(self, package: Text, package_path: Text) -> _Loader: ...
|
||||
def get_directory_loader(self, directory: Text) -> _Loader: ...
|
||||
def generate_etag(self, mtime: datetime.datetime, file_size: int, real_filename: Union[Text, bytes]) -> str: ...
|
||||
def generate_etag(self, mtime: datetime.datetime, file_size: int, real_filename: Text | bytes) -> str: ...
|
||||
def __call__(self, environment: WSGIEnvironment, start_response: StartResponse) -> WSGIApplication: ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional, Text
|
||||
from typing import Any, Text
|
||||
|
||||
from werkzeug.exceptions import HTTPException
|
||||
|
||||
@@ -23,11 +23,11 @@ class BuildError(RoutingException, LookupError):
|
||||
endpoint: Any
|
||||
values: Any
|
||||
method: Any
|
||||
adapter: Optional[MapAdapter]
|
||||
def __init__(self, endpoint, values, method, adapter: Optional[MapAdapter] = ...) -> None: ...
|
||||
adapter: MapAdapter | None
|
||||
def __init__(self, endpoint, values, method, adapter: MapAdapter | None = ...) -> None: ...
|
||||
@property
|
||||
def suggested(self) -> Optional[Rule]: ...
|
||||
def closest_rule(self, adapter: Optional[MapAdapter]) -> Optional[Rule]: ...
|
||||
def suggested(self) -> Rule | None: ...
|
||||
def closest_rule(self, adapter: MapAdapter | None) -> Rule | None: ...
|
||||
|
||||
class ValidationError(ValueError): ...
|
||||
|
||||
@@ -80,15 +80,15 @@ class Rule(RuleFactory):
|
||||
def __init__(
|
||||
self,
|
||||
string,
|
||||
defaults: Optional[Any] = ...,
|
||||
subdomain: Optional[Any] = ...,
|
||||
methods: Optional[Any] = ...,
|
||||
defaults: Any | None = ...,
|
||||
subdomain: Any | None = ...,
|
||||
methods: Any | None = ...,
|
||||
build_only: bool = ...,
|
||||
endpoint: Optional[Any] = ...,
|
||||
strict_slashes: Optional[Any] = ...,
|
||||
redirect_to: Optional[Any] = ...,
|
||||
endpoint: Any | None = ...,
|
||||
strict_slashes: Any | None = ...,
|
||||
redirect_to: Any | None = ...,
|
||||
alias: bool = ...,
|
||||
host: Optional[Any] = ...,
|
||||
host: Any | None = ...,
|
||||
): ...
|
||||
def empty(self): ...
|
||||
def get_empty_kwargs(self): ...
|
||||
@@ -97,10 +97,10 @@ class Rule(RuleFactory):
|
||||
def bind(self, map, rebind: bool = ...): ...
|
||||
def get_converter(self, variable_name, converter_name, args, kwargs): ...
|
||||
def compile(self): ...
|
||||
def match(self, path, method: Optional[Any] = ...): ...
|
||||
def match(self, path, method: Any | None = ...): ...
|
||||
def build(self, values, append_unknown: bool = ...): ...
|
||||
def provides_defaults_for(self, rule): ...
|
||||
def suitable_for(self, values, method: Optional[Any] = ...): ...
|
||||
def suitable_for(self, values, method: Any | None = ...): ...
|
||||
def match_compare_key(self): ...
|
||||
def build_compare_key(self): ...
|
||||
def __eq__(self, other): ...
|
||||
@@ -116,7 +116,7 @@ class BaseConverter:
|
||||
|
||||
class UnicodeConverter(BaseConverter):
|
||||
regex: Any
|
||||
def __init__(self, map, minlength: int = ..., maxlength: Optional[Any] = ..., length: Optional[Any] = ...): ...
|
||||
def __init__(self, map, minlength: int = ..., maxlength: Any | None = ..., length: Any | None = ...): ...
|
||||
|
||||
class AnyConverter(BaseConverter):
|
||||
regex: Any
|
||||
@@ -131,7 +131,7 @@ class NumberConverter(BaseConverter):
|
||||
fixed_digits: Any
|
||||
min: Any
|
||||
max: Any
|
||||
def __init__(self, map, fixed_digits: int = ..., min: Optional[Any] = ..., max: Optional[Any] = ...): ...
|
||||
def __init__(self, map, fixed_digits: int = ..., min: Any | None = ..., max: Any | None = ...): ...
|
||||
def to_python(self, value): ...
|
||||
def to_url(self, value) -> str: ...
|
||||
|
||||
@@ -142,7 +142,7 @@ class IntegerConverter(NumberConverter):
|
||||
class FloatConverter(NumberConverter):
|
||||
regex: Any
|
||||
num_convert: Any
|
||||
def __init__(self, map, min: Optional[Any] = ..., max: Optional[Any] = ...): ...
|
||||
def __init__(self, map, min: Any | None = ..., max: Any | None = ...): ...
|
||||
|
||||
class UUIDConverter(BaseConverter):
|
||||
regex: Any
|
||||
@@ -164,31 +164,31 @@ class Map:
|
||||
sort_key: Any
|
||||
def __init__(
|
||||
self,
|
||||
rules: Optional[Any] = ...,
|
||||
rules: Any | None = ...,
|
||||
default_subdomain: str = ...,
|
||||
charset: Text = ...,
|
||||
strict_slashes: bool = ...,
|
||||
redirect_defaults: bool = ...,
|
||||
converters: Optional[Any] = ...,
|
||||
converters: Any | None = ...,
|
||||
sort_parameters: bool = ...,
|
||||
sort_key: Optional[Any] = ...,
|
||||
sort_key: Any | None = ...,
|
||||
encoding_errors: Text = ...,
|
||||
host_matching: bool = ...,
|
||||
): ...
|
||||
def is_endpoint_expecting(self, endpoint, *arguments): ...
|
||||
def iter_rules(self, endpoint: Optional[Any] = ...): ...
|
||||
def iter_rules(self, endpoint: Any | None = ...): ...
|
||||
def add(self, rulefactory): ...
|
||||
def bind(
|
||||
self,
|
||||
server_name,
|
||||
script_name: Optional[Any] = ...,
|
||||
subdomain: Optional[Any] = ...,
|
||||
script_name: Any | None = ...,
|
||||
subdomain: Any | None = ...,
|
||||
url_scheme: str = ...,
|
||||
default_method: str = ...,
|
||||
path_info: Optional[Any] = ...,
|
||||
query_args: Optional[Any] = ...,
|
||||
path_info: Any | None = ...,
|
||||
query_args: Any | None = ...,
|
||||
): ...
|
||||
def bind_to_environ(self, environ, server_name: Optional[Any] = ..., subdomain: Optional[Any] = ...): ...
|
||||
def bind_to_environ(self, environ, server_name: Any | None = ..., subdomain: Any | None = ...): ...
|
||||
def update(self): ...
|
||||
|
||||
class MapAdapter:
|
||||
@@ -201,30 +201,19 @@ class MapAdapter:
|
||||
default_method: Any
|
||||
query_args: Any
|
||||
def __init__(
|
||||
self, map, server_name, script_name, subdomain, url_scheme, path_info, default_method, query_args: Optional[Any] = ...
|
||||
): ...
|
||||
def dispatch(
|
||||
self, view_func, path_info: Optional[Any] = ..., method: Optional[Any] = ..., catch_http_exceptions: bool = ...
|
||||
self, map, server_name, script_name, subdomain, url_scheme, path_info, default_method, query_args: Any | None = ...
|
||||
): ...
|
||||
def dispatch(self, view_func, path_info: Any | None = ..., method: Any | None = ..., catch_http_exceptions: bool = ...): ...
|
||||
def match(
|
||||
self,
|
||||
path_info: Optional[Any] = ...,
|
||||
method: Optional[Any] = ...,
|
||||
return_rule: bool = ...,
|
||||
query_args: Optional[Any] = ...,
|
||||
self, path_info: Any | None = ..., method: Any | None = ..., return_rule: bool = ..., query_args: Any | None = ...
|
||||
): ...
|
||||
def test(self, path_info: Optional[Any] = ..., method: Optional[Any] = ...): ...
|
||||
def allowed_methods(self, path_info: Optional[Any] = ...): ...
|
||||
def test(self, path_info: Any | None = ..., method: Any | None = ...): ...
|
||||
def allowed_methods(self, path_info: Any | None = ...): ...
|
||||
def get_host(self, domain_part): ...
|
||||
def get_default_redirect(self, rule, method, values, query_args): ...
|
||||
def encode_query_args(self, query_args): ...
|
||||
def make_redirect_url(self, path_info, query_args: Optional[Any] = ..., domain_part: Optional[Any] = ...): ...
|
||||
def make_redirect_url(self, path_info, query_args: Any | None = ..., domain_part: Any | None = ...): ...
|
||||
def make_alias_redirect_url(self, path, endpoint, values, method, query_args): ...
|
||||
def build(
|
||||
self,
|
||||
endpoint,
|
||||
values: Optional[Any] = ...,
|
||||
method: Optional[Any] = ...,
|
||||
force_external: bool = ...,
|
||||
append_unknown: bool = ...,
|
||||
self, endpoint, values: Any | None = ..., method: Any | None = ..., force_external: bool = ..., append_unknown: bool = ...
|
||||
): ...
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
argument_types: Any
|
||||
converters: Any
|
||||
|
||||
def run(namespace: Optional[Any] = ..., action_prefix: str = ..., args: Optional[Any] = ...): ...
|
||||
def run(namespace: Any | None = ..., action_prefix: str = ..., args: Any | None = ...): ...
|
||||
def fail(message, code: int = ...): ...
|
||||
def find_actions(namespace, action_prefix): ...
|
||||
def print_usage(actions): ...
|
||||
def analyse_action(func): ...
|
||||
def make_shell(init_func: Optional[Any] = ..., banner: Optional[Any] = ..., use_ipython: bool = ...): ...
|
||||
def make_shell(init_func: Any | None = ..., banner: Any | None = ..., use_ipython: bool = ...): ...
|
||||
def make_runserver(
|
||||
app_factory,
|
||||
hostname: str = ...,
|
||||
@@ -18,7 +18,7 @@ def make_runserver(
|
||||
use_evalex: bool = ...,
|
||||
threaded: bool = ...,
|
||||
processes: int = ...,
|
||||
static_files: Optional[Any] = ...,
|
||||
extra_files: Optional[Any] = ...,
|
||||
ssl_context: Optional[Any] = ...,
|
||||
static_files: Any | None = ...,
|
||||
extra_files: Any | None = ...,
|
||||
ssl_context: Any | None = ...,
|
||||
): ...
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
SALT_CHARS: Any
|
||||
DEFAULT_PBKDF2_ITERATIONS: Any
|
||||
|
||||
def pbkdf2_hex(data, salt, iterations=..., keylen: Optional[Any] = ..., hashfunc: Optional[Any] = ...): ...
|
||||
def pbkdf2_bin(data, salt, iterations=..., keylen: Optional[Any] = ..., hashfunc: Optional[Any] = ...): ...
|
||||
def pbkdf2_hex(data, salt, iterations=..., keylen: Any | None = ..., hashfunc: Any | None = ...): ...
|
||||
def pbkdf2_bin(data, salt, iterations=..., keylen: Any | None = ..., hashfunc: Any | None = ...): ...
|
||||
def safe_str_cmp(a, b): ...
|
||||
def gen_salt(length): ...
|
||||
def generate_password_hash(password, method: str = ..., salt_length: int = ...): ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
if sys.version_info >= (3, 0):
|
||||
from http.server import BaseHTTPRequestHandler, HTTPServer
|
||||
@@ -33,10 +33,10 @@ class WSGIRequestHandler(BaseHTTPRequestHandler):
|
||||
def run_wsgi(self): ...
|
||||
def handle(self): ...
|
||||
def initiate_shutdown(self): ...
|
||||
def connection_dropped(self, error, environ: Optional[Any] = ...): ...
|
||||
def connection_dropped(self, error, environ: Any | None = ...): ...
|
||||
raw_requestline: Any
|
||||
def handle_one_request(self): ...
|
||||
def send_response(self, code, message: Optional[Any] = ...): ...
|
||||
def send_response(self, code, message: Any | None = ...): ...
|
||||
def version_string(self): ...
|
||||
def address_string(self): ...
|
||||
def port_integer(self): ...
|
||||
@@ -47,17 +47,17 @@ class WSGIRequestHandler(BaseHTTPRequestHandler):
|
||||
|
||||
BaseRequestHandler: Any
|
||||
|
||||
def generate_adhoc_ssl_pair(cn: Optional[Any] = ...): ...
|
||||
def make_ssl_devcert(base_path, host: Optional[Any] = ..., cn: Optional[Any] = ...): ...
|
||||
def generate_adhoc_ssl_pair(cn: Any | None = ...): ...
|
||||
def make_ssl_devcert(base_path, host: Any | None = ..., cn: Any | None = ...): ...
|
||||
def generate_adhoc_ssl_context(): ...
|
||||
def load_ssl_context(cert_file, pkey_file: Optional[Any] = ..., protocol: Optional[Any] = ...): ...
|
||||
def load_ssl_context(cert_file, pkey_file: Any | None = ..., protocol: Any | None = ...): ...
|
||||
|
||||
class _SSLContext:
|
||||
def __init__(self, protocol): ...
|
||||
def load_cert_chain(self, certfile, keyfile: Optional[Any] = ..., password: Optional[Any] = ...): ...
|
||||
def load_cert_chain(self, certfile, keyfile: Any | None = ..., password: Any | None = ...): ...
|
||||
def wrap_socket(self, sock, **kwargs): ...
|
||||
|
||||
def is_ssl_error(error: Optional[Any] = ...): ...
|
||||
def is_ssl_error(error: Any | None = ...): ...
|
||||
def select_ip_version(host, port): ...
|
||||
|
||||
class BaseWSGIServer(HTTPServer):
|
||||
@@ -78,10 +78,10 @@ class BaseWSGIServer(HTTPServer):
|
||||
host,
|
||||
port,
|
||||
app,
|
||||
handler: Optional[Any] = ...,
|
||||
handler: Any | None = ...,
|
||||
passthrough_errors: bool = ...,
|
||||
ssl_context: Optional[Any] = ...,
|
||||
fd: Optional[Any] = ...,
|
||||
ssl_context: Any | None = ...,
|
||||
fd: Any | None = ...,
|
||||
): ...
|
||||
def log(self, type, message, *args): ...
|
||||
def serve_forever(self): ...
|
||||
@@ -101,22 +101,22 @@ class ForkingWSGIServer(ForkingMixIn, BaseWSGIServer):
|
||||
port,
|
||||
app,
|
||||
processes: int = ...,
|
||||
handler: Optional[Any] = ...,
|
||||
handler: Any | None = ...,
|
||||
passthrough_errors: bool = ...,
|
||||
ssl_context: Optional[Any] = ...,
|
||||
fd: Optional[Any] = ...,
|
||||
ssl_context: Any | None = ...,
|
||||
fd: Any | None = ...,
|
||||
): ...
|
||||
|
||||
def make_server(
|
||||
host: Optional[Any] = ...,
|
||||
port: Optional[Any] = ...,
|
||||
app: Optional[Any] = ...,
|
||||
host: Any | None = ...,
|
||||
port: Any | None = ...,
|
||||
app: Any | None = ...,
|
||||
threaded: bool = ...,
|
||||
processes: int = ...,
|
||||
request_handler: Optional[Any] = ...,
|
||||
request_handler: Any | None = ...,
|
||||
passthrough_errors: bool = ...,
|
||||
ssl_context: Optional[Any] = ...,
|
||||
fd: Optional[Any] = ...,
|
||||
ssl_context: Any | None = ...,
|
||||
fd: Any | None = ...,
|
||||
): ...
|
||||
def is_running_from_reloader(): ...
|
||||
def run_simple(
|
||||
@@ -126,15 +126,15 @@ def run_simple(
|
||||
use_reloader: bool = ...,
|
||||
use_debugger: bool = ...,
|
||||
use_evalex: bool = ...,
|
||||
extra_files: Optional[Any] = ...,
|
||||
extra_files: Any | None = ...,
|
||||
reloader_interval: int = ...,
|
||||
reloader_type: str = ...,
|
||||
threaded: bool = ...,
|
||||
processes: int = ...,
|
||||
request_handler: Optional[Any] = ...,
|
||||
static_files: Optional[Any] = ...,
|
||||
request_handler: Any | None = ...,
|
||||
static_files: Any | None = ...,
|
||||
passthrough_errors: bool = ...,
|
||||
ssl_context: Optional[Any] = ...,
|
||||
ssl_context: Any | None = ...,
|
||||
): ...
|
||||
def run_with_reloader(*args, **kwargs): ...
|
||||
def main(): ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from _typeshed.wsgi import WSGIEnvironment
|
||||
from typing import Any, Generic, Optional, Text, Tuple, Type, TypeVar, overload
|
||||
from typing import Any, Generic, Text, Tuple, Type, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.version_info >= (3, 0):
|
||||
@@ -10,17 +10,15 @@ else:
|
||||
from cookielib import CookieJar
|
||||
from urllib2 import Request as U2Request
|
||||
|
||||
def stream_encode_multipart(
|
||||
values, use_tempfile: int = ..., threshold=..., boundary: Optional[Any] = ..., charset: Text = ...
|
||||
): ...
|
||||
def encode_multipart(values, boundary: Optional[Any] = ..., charset: Text = ...): ...
|
||||
def File(fd, filename: Optional[Any] = ..., mimetype: Optional[Any] = ...): ...
|
||||
def stream_encode_multipart(values, use_tempfile: int = ..., threshold=..., boundary: Any | None = ..., charset: Text = ...): ...
|
||||
def encode_multipart(values, boundary: Any | None = ..., charset: Text = ...): ...
|
||||
def File(fd, filename: Any | None = ..., mimetype: Any | None = ...): ...
|
||||
|
||||
class _TestCookieHeaders:
|
||||
headers: Any
|
||||
def __init__(self, headers): ...
|
||||
def getheaders(self, name): ...
|
||||
def get_all(self, name, default: Optional[Any] = ...): ...
|
||||
def get_all(self, name, default: Any | None = ...): ...
|
||||
|
||||
class _TestCookieResponse:
|
||||
headers: Any
|
||||
@@ -55,20 +53,20 @@ class EnvironBuilder:
|
||||
def __init__(
|
||||
self,
|
||||
path: str = ...,
|
||||
base_url: Optional[Any] = ...,
|
||||
query_string: Optional[Any] = ...,
|
||||
base_url: Any | None = ...,
|
||||
query_string: Any | None = ...,
|
||||
method: str = ...,
|
||||
input_stream: Optional[Any] = ...,
|
||||
content_type: Optional[Any] = ...,
|
||||
content_length: Optional[Any] = ...,
|
||||
errors_stream: Optional[Any] = ...,
|
||||
input_stream: Any | None = ...,
|
||||
content_type: Any | None = ...,
|
||||
content_length: Any | None = ...,
|
||||
errors_stream: Any | None = ...,
|
||||
multithread: bool = ...,
|
||||
multiprocess: bool = ...,
|
||||
run_once: bool = ...,
|
||||
headers: Optional[Any] = ...,
|
||||
data: Optional[Any] = ...,
|
||||
environ_base: Optional[Any] = ...,
|
||||
environ_overrides: Optional[Any] = ...,
|
||||
headers: Any | None = ...,
|
||||
data: Any | None = ...,
|
||||
environ_base: Any | None = ...,
|
||||
environ_overrides: Any | None = ...,
|
||||
charset: Text = ...,
|
||||
): ...
|
||||
form: Any
|
||||
@@ -80,40 +78,36 @@ class EnvironBuilder:
|
||||
def __del__(self) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def get_environ(self) -> WSGIEnvironment: ...
|
||||
def get_request(self, cls: Optional[Any] = ...): ...
|
||||
def get_request(self, cls: Any | None = ...): ...
|
||||
|
||||
class ClientRedirectError(Exception): ...
|
||||
|
||||
# Response type for the client below.
|
||||
# By default _R is Tuple[Iterable[Any], Union[Text, int], datastructures.Headers]
|
||||
# By default _R is Tuple[Iterable[Any], Text | int, datastructures.Headers]
|
||||
_R = TypeVar("_R")
|
||||
|
||||
class Client(Generic[_R]):
|
||||
application: Any
|
||||
response_wrapper: Optional[Type[_R]]
|
||||
response_wrapper: Type[_R] | None
|
||||
cookie_jar: Any
|
||||
allow_subdomain_redirects: Any
|
||||
def __init__(
|
||||
self,
|
||||
application,
|
||||
response_wrapper: Optional[Type[_R]] = ...,
|
||||
use_cookies: bool = ...,
|
||||
allow_subdomain_redirects: bool = ...,
|
||||
self, application, response_wrapper: Type[_R] | None = ..., use_cookies: bool = ..., allow_subdomain_redirects: bool = ...
|
||||
): ...
|
||||
def set_cookie(
|
||||
self,
|
||||
server_name,
|
||||
key,
|
||||
value: str = ...,
|
||||
max_age: Optional[Any] = ...,
|
||||
expires: Optional[Any] = ...,
|
||||
max_age: Any | None = ...,
|
||||
expires: Any | None = ...,
|
||||
path: str = ...,
|
||||
domain: Optional[Any] = ...,
|
||||
secure: Optional[Any] = ...,
|
||||
domain: Any | None = ...,
|
||||
secure: Any | None = ...,
|
||||
httponly: bool = ...,
|
||||
charset: Text = ...,
|
||||
): ...
|
||||
def delete_cookie(self, server_name, key, path: str = ..., domain: Optional[Any] = ...): ...
|
||||
def delete_cookie(self, server_name, key, path: str = ..., domain: Any | None = ...): ...
|
||||
def run_wsgi_app(self, environ, buffered: bool = ...): ...
|
||||
def resolve_redirect(self, response, new_location, environ, buffered: bool = ...): ...
|
||||
@overload
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, NamedTuple, Optional, Text
|
||||
from typing import Any, NamedTuple, Text
|
||||
|
||||
class _URLTuple(NamedTuple):
|
||||
scheme: Any
|
||||
@@ -31,7 +31,7 @@ class BaseURL(_URLTuple):
|
||||
def decode_netloc(self): ...
|
||||
def to_uri_tuple(self): ...
|
||||
def to_iri_tuple(self): ...
|
||||
def get_file_location(self, pathformat: Optional[Any] = ...): ...
|
||||
def get_file_location(self, pathformat: Any | None = ...): ...
|
||||
|
||||
class URL(BaseURL):
|
||||
def encode_netloc(self): ...
|
||||
@@ -41,7 +41,7 @@ class BytesURL(BaseURL):
|
||||
def encode_netloc(self): ...
|
||||
def decode(self, charset: Text = ..., errors: Text = ...): ...
|
||||
|
||||
def url_parse(url, scheme: Optional[Any] = ..., allow_fragments: bool = ...): ...
|
||||
def url_parse(url, scheme: Any | None = ..., allow_fragments: bool = ...): ...
|
||||
def url_quote(string, charset: Text = ..., errors: Text = ..., safe: str = ..., unsafe: str = ...): ...
|
||||
def url_quote_plus(string, charset: Text = ..., errors: Text = ..., safe: str = ...): ...
|
||||
def url_unparse(components): ...
|
||||
@@ -57,7 +57,7 @@ def url_decode(
|
||||
include_empty: bool = ...,
|
||||
errors: Text = ...,
|
||||
separator: str = ...,
|
||||
cls: Optional[Any] = ...,
|
||||
cls: Any | None = ...,
|
||||
): ...
|
||||
def url_decode_stream(
|
||||
stream,
|
||||
@@ -66,20 +66,20 @@ def url_decode_stream(
|
||||
include_empty: bool = ...,
|
||||
errors: Text = ...,
|
||||
separator: str = ...,
|
||||
cls: Optional[Any] = ...,
|
||||
limit: Optional[Any] = ...,
|
||||
cls: Any | None = ...,
|
||||
limit: Any | None = ...,
|
||||
return_iterator: bool = ...,
|
||||
): ...
|
||||
def url_encode(
|
||||
obj, charset: Text = ..., encode_keys: bool = ..., sort: bool = ..., key: Optional[Any] = ..., separator: bytes = ...
|
||||
obj, charset: Text = ..., encode_keys: bool = ..., sort: bool = ..., key: Any | None = ..., separator: bytes = ...
|
||||
): ...
|
||||
def url_encode_stream(
|
||||
obj,
|
||||
stream: Optional[Any] = ...,
|
||||
stream: Any | None = ...,
|
||||
charset: Text = ...,
|
||||
encode_keys: bool = ...,
|
||||
sort: bool = ...,
|
||||
key: Optional[Any] = ...,
|
||||
key: Any | None = ...,
|
||||
separator: bytes = ...,
|
||||
): ...
|
||||
def url_join(base, url, allow_fragments: bool = ...): ...
|
||||
@@ -89,6 +89,6 @@ class Href:
|
||||
charset: Text
|
||||
sort: Any
|
||||
key: Any
|
||||
def __init__(self, base: str = ..., charset: Text = ..., sort: bool = ..., key: Optional[Any] = ...): ...
|
||||
def __init__(self, base: str = ..., charset: Text = ..., sort: bool = ..., key: Any | None = ...): ...
|
||||
def __getattr__(self, name): ...
|
||||
def __call__(self, *path, **query): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
class UserAgentParser:
|
||||
platforms: Any
|
||||
@@ -8,10 +8,10 @@ class UserAgentParser:
|
||||
|
||||
class UserAgent:
|
||||
string: Any
|
||||
platform: Optional[str]
|
||||
browser: Optional[str]
|
||||
version: Optional[str]
|
||||
language: Optional[str]
|
||||
platform: str | None
|
||||
browser: str | None
|
||||
version: str | None
|
||||
language: str | None
|
||||
def __init__(self, environ_or_string): ...
|
||||
def to_header(self): ...
|
||||
def __nonzero__(self): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional, Text, Type, TypeVar, overload
|
||||
from typing import Any, Text, Type, TypeVar, overload
|
||||
|
||||
from werkzeug._internal import _DictAccessorProperty
|
||||
from werkzeug.wrappers import Response
|
||||
@@ -8,9 +8,9 @@ class cached_property(property):
|
||||
__module__: Any
|
||||
__doc__: Any
|
||||
func: Any
|
||||
def __init__(self, func, name: Optional[Any] = ..., doc: Optional[Any] = ...): ...
|
||||
def __init__(self, func, name: Any | None = ..., doc: Any | None = ...): ...
|
||||
def __set__(self, obj, value): ...
|
||||
def __get__(self, obj, type: Optional[Any] = ...): ...
|
||||
def __get__(self, obj, type: Any | None = ...): ...
|
||||
|
||||
class environ_property(_DictAccessorProperty):
|
||||
read_only: Any
|
||||
@@ -30,7 +30,7 @@ xhtml: Any
|
||||
def get_content_type(mimetype, charset): ...
|
||||
def format_string(string, context): ...
|
||||
def secure_filename(filename: Text) -> Text: ...
|
||||
def escape(s, quote: Optional[Any] = ...): ...
|
||||
def escape(s, quote: Any | None = ...): ...
|
||||
def unescape(s): ...
|
||||
|
||||
# 'redirect' returns a werkzeug Response, unless you give it
|
||||
@@ -51,7 +51,7 @@ class ArgumentValidationError(ValueError):
|
||||
missing: Any
|
||||
extra: Any
|
||||
extra_positional: Any
|
||||
def __init__(self, missing: Optional[Any] = ..., extra: Optional[Any] = ..., extra_positional: Optional[Any] = ...): ...
|
||||
def __init__(self, missing: Any | None = ..., extra: Any | None = ..., extra_positional: Any | None = ...): ...
|
||||
|
||||
class ImportStringError(ImportError):
|
||||
import_name: Any
|
||||
|
||||
@@ -1,21 +1,6 @@
|
||||
from _typeshed.wsgi import InputStream, WSGIEnvironment
|
||||
from datetime import datetime, timedelta
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Iterable,
|
||||
Iterator,
|
||||
Mapping,
|
||||
MutableMapping,
|
||||
Optional,
|
||||
Sequence,
|
||||
Text,
|
||||
Tuple,
|
||||
Type,
|
||||
TypeVar,
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
from typing import Any, Callable, Iterable, Iterator, Mapping, MutableMapping, Sequence, Text, Tuple, Type, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .datastructures import (
|
||||
@@ -37,13 +22,13 @@ from .useragents import UserAgent
|
||||
class BaseRequest:
|
||||
charset: str
|
||||
encoding_errors: str
|
||||
max_content_length: Optional[int]
|
||||
max_content_length: int | None
|
||||
max_form_memory_size: int
|
||||
parameter_storage_class: Type[Any]
|
||||
list_storage_class: Type[Any]
|
||||
dict_storage_class: Type[Any]
|
||||
form_data_parser_class: Type[Any]
|
||||
trusted_hosts: Optional[Sequence[Text]]
|
||||
trusted_hosts: Sequence[Text] | None
|
||||
disable_data_descriptor: Any
|
||||
environ: WSGIEnvironment = ...
|
||||
shallow: Any
|
||||
@@ -110,7 +95,7 @@ _SelfT = TypeVar("_SelfT", bound=BaseResponse)
|
||||
class BaseResponse:
|
||||
charset: str
|
||||
default_status: int
|
||||
default_mimetype: Optional[str]
|
||||
default_mimetype: str | None
|
||||
implicit_sequence_conversion: bool
|
||||
autocorrect_location_header: bool
|
||||
automatically_set_content_length: bool
|
||||
@@ -121,16 +106,16 @@ class BaseResponse:
|
||||
response: Iterable[bytes]
|
||||
def __init__(
|
||||
self,
|
||||
response: Optional[Union[str, bytes, bytearray, Iterable[str], Iterable[bytes]]] = ...,
|
||||
status: Optional[Union[Text, int]] = ...,
|
||||
headers: Optional[Union[Headers, Mapping[Text, Text], Sequence[Tuple[Text, Text]]]] = ...,
|
||||
mimetype: Optional[Text] = ...,
|
||||
content_type: Optional[Text] = ...,
|
||||
response: str | bytes | bytearray | Iterable[str] | Iterable[bytes] | None = ...,
|
||||
status: Text | int | None = ...,
|
||||
headers: Headers | Mapping[Text, Text] | Sequence[Tuple[Text, Text]] | None = ...,
|
||||
mimetype: Text | None = ...,
|
||||
content_type: Text | None = ...,
|
||||
direct_passthrough: bool = ...,
|
||||
) -> None: ...
|
||||
def call_on_close(self, func: _OnCloseT) -> _OnCloseT: ...
|
||||
@classmethod
|
||||
def force_type(cls: Type[_SelfT], response: object, environ: Optional[WSGIEnvironment] = ...) -> _SelfT: ...
|
||||
def force_type(cls: Type[_SelfT], response: object, environ: WSGIEnvironment | None = ...) -> _SelfT: ...
|
||||
@classmethod
|
||||
def from_app(cls: Type[_SelfT], app: Any, environ: WSGIEnvironment, buffered: bool = ...) -> _SelfT: ...
|
||||
@overload
|
||||
@@ -139,24 +124,24 @@ class BaseResponse:
|
||||
def get_data(self, as_text: Literal[True]) -> Text: ...
|
||||
@overload
|
||||
def get_data(self, as_text: bool) -> Any: ...
|
||||
def set_data(self, value: Union[bytes, Text]) -> None: ...
|
||||
def set_data(self, value: bytes | Text) -> None: ...
|
||||
data: Any
|
||||
def calculate_content_length(self) -> Optional[int]: ...
|
||||
def calculate_content_length(self) -> int | None: ...
|
||||
def make_sequence(self) -> None: ...
|
||||
def iter_encoded(self) -> Iterator[bytes]: ...
|
||||
def set_cookie(
|
||||
self,
|
||||
key: str,
|
||||
value: Union[str, bytes] = ...,
|
||||
max_age: Union[float, timedelta, None] = ...,
|
||||
expires: Optional[Union[int, datetime]] = ...,
|
||||
value: str | bytes = ...,
|
||||
max_age: float | timedelta | None = ...,
|
||||
expires: int | datetime | None = ...,
|
||||
path: str = ...,
|
||||
domain: Optional[str] = ...,
|
||||
domain: str | None = ...,
|
||||
secure: bool = ...,
|
||||
httponly: bool = ...,
|
||||
samesite: Optional[str] = ...,
|
||||
samesite: str | None = ...,
|
||||
) -> None: ...
|
||||
def delete_cookie(self, key, path: str = ..., domain: Optional[Any] = ...): ...
|
||||
def delete_cookie(self, key, path: str = ..., domain: Any | None = ...): ...
|
||||
@property
|
||||
def is_streamed(self) -> bool: ...
|
||||
@property
|
||||
@@ -204,7 +189,7 @@ class UserAgentMixin:
|
||||
|
||||
class AuthorizationMixin:
|
||||
@property
|
||||
def authorization(self) -> Optional[Authorization]: ...
|
||||
def authorization(self) -> Authorization | None: ...
|
||||
|
||||
class StreamOnlyMixin:
|
||||
disable_data_descriptor: Any
|
||||
@@ -214,7 +199,7 @@ class ETagResponseMixin:
|
||||
@property
|
||||
def cache_control(self): ...
|
||||
status_code: Any
|
||||
def make_conditional(self, request_or_environ, accept_ranges: bool = ..., complete_length: Optional[Any] = ...): ...
|
||||
def make_conditional(self, request_or_environ, accept_ranges: bool = ..., complete_length: Any | None = ...): ...
|
||||
def add_etag(self, overwrite: bool = ..., weak: bool = ...): ...
|
||||
def set_etag(self, etag, weak: bool = ...): ...
|
||||
def get_etag(self): ...
|
||||
@@ -241,19 +226,19 @@ class ResponseStreamMixin:
|
||||
|
||||
class CommonRequestDescriptorsMixin:
|
||||
@property
|
||||
def content_type(self) -> Optional[str]: ...
|
||||
def content_type(self) -> str | None: ...
|
||||
@property
|
||||
def content_length(self) -> Optional[int]: ...
|
||||
def content_length(self) -> int | None: ...
|
||||
@property
|
||||
def content_encoding(self) -> Optional[str]: ...
|
||||
def content_encoding(self) -> str | None: ...
|
||||
@property
|
||||
def content_md5(self) -> Optional[str]: ...
|
||||
def content_md5(self) -> str | None: ...
|
||||
@property
|
||||
def referrer(self) -> Optional[str]: ...
|
||||
def referrer(self) -> str | None: ...
|
||||
@property
|
||||
def date(self) -> Optional[datetime]: ...
|
||||
def date(self) -> datetime | None: ...
|
||||
@property
|
||||
def max_forwards(self) -> Optional[int]: ...
|
||||
def max_forwards(self) -> int | None: ...
|
||||
@property
|
||||
def mimetype(self) -> str: ...
|
||||
@property
|
||||
@@ -262,23 +247,23 @@ class CommonRequestDescriptorsMixin:
|
||||
def pragma(self) -> HeaderSet: ...
|
||||
|
||||
class CommonResponseDescriptorsMixin:
|
||||
mimetype: Optional[str] = ...
|
||||
mimetype: str | None = ...
|
||||
@property
|
||||
def mimetype_params(self) -> MutableMapping[str, str]: ...
|
||||
location: Optional[str] = ...
|
||||
age: Any = ... # get: Optional[datetime.timedelta]
|
||||
content_type: Optional[str] = ...
|
||||
content_length: Optional[int] = ...
|
||||
content_location: Optional[str] = ...
|
||||
content_encoding: Optional[str] = ...
|
||||
content_md5: Optional[str] = ...
|
||||
date: Any = ... # get: Optional[datetime.datetime]
|
||||
expires: Any = ... # get: Optional[datetime.datetime]
|
||||
last_modified: Any = ... # get: Optional[datetime.datetime]
|
||||
retry_after: Any = ... # get: Optional[datetime.datetime]
|
||||
vary: Optional[str] = ...
|
||||
content_language: Optional[str] = ...
|
||||
allow: Optional[str] = ...
|
||||
location: str | None = ...
|
||||
age: Any = ... # get: datetime.timedelta | None
|
||||
content_type: str | None = ...
|
||||
content_length: int | None = ...
|
||||
content_location: str | None = ...
|
||||
content_encoding: str | None = ...
|
||||
content_md5: str | None = ...
|
||||
date: Any = ... # get: datetime.datetime | None
|
||||
expires: Any = ... # get: datetime.datetime | None
|
||||
last_modified: Any = ... # get: datetime.datetime | None
|
||||
retry_after: Any = ... # get: datetime.datetime | None
|
||||
vary: str | None = ...
|
||||
content_language: str | None = ...
|
||||
allow: str | None = ...
|
||||
|
||||
class WWWAuthenticateMixin:
|
||||
@property
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from _typeshed import SupportsRead
|
||||
from _typeshed.wsgi import InputStream, WSGIEnvironment
|
||||
from typing import Any, Iterable, Optional, Text
|
||||
from typing import Any, Iterable, Text
|
||||
|
||||
from .middleware.dispatcher import DispatcherMiddleware as DispatcherMiddleware
|
||||
from .middleware.http_proxy import ProxyMiddleware as ProxyMiddleware
|
||||
@@ -8,11 +8,11 @@ from .middleware.shared_data import SharedDataMiddleware as SharedDataMiddleware
|
||||
|
||||
def responder(f): ...
|
||||
def get_current_url(
|
||||
environ, root_only: bool = ..., strip_querystring: bool = ..., host_only: bool = ..., trusted_hosts: Optional[Any] = ...
|
||||
environ, root_only: bool = ..., strip_querystring: bool = ..., host_only: bool = ..., trusted_hosts: Any | None = ...
|
||||
): ...
|
||||
def host_is_trusted(hostname, trusted_list): ...
|
||||
def get_host(environ, trusted_hosts: Optional[Any] = ...): ...
|
||||
def get_content_length(environ: WSGIEnvironment) -> Optional[int]: ...
|
||||
def get_host(environ, trusted_hosts: Any | None = ...): ...
|
||||
def get_content_length(environ: WSGIEnvironment) -> int | None: ...
|
||||
def get_input_stream(environ: WSGIEnvironment, safe_fallback: bool = ...) -> InputStream: ...
|
||||
def get_query_string(environ): ...
|
||||
def get_path_info(environ, charset: Text = ..., errors: Text = ...): ...
|
||||
@@ -24,7 +24,7 @@ def extract_path_info(
|
||||
): ...
|
||||
|
||||
class ClosingIterator:
|
||||
def __init__(self, iterable, callbacks: Optional[Any] = ...): ...
|
||||
def __init__(self, iterable, callbacks: Any | None = ...): ...
|
||||
def __iter__(self): ...
|
||||
def __next__(self): ...
|
||||
def close(self): ...
|
||||
@@ -38,7 +38,7 @@ class FileWrapper:
|
||||
def close(self) -> None: ...
|
||||
def seekable(self) -> bool: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> None: ...
|
||||
def tell(self) -> Optional[int]: ...
|
||||
def tell(self) -> int | None: ...
|
||||
def __iter__(self) -> FileWrapper: ...
|
||||
def __next__(self) -> bytes: ...
|
||||
|
||||
@@ -50,13 +50,13 @@ class _RangeWrapper:
|
||||
read_length: Any
|
||||
seekable: Any
|
||||
end_reached: Any
|
||||
def __init__(self, iterable, start_byte: int = ..., byte_range: Optional[Any] = ...): ...
|
||||
def __init__(self, iterable, start_byte: int = ..., byte_range: Any | None = ...): ...
|
||||
def __iter__(self): ...
|
||||
def __next__(self): ...
|
||||
def close(self): ...
|
||||
|
||||
def make_line_iter(stream, limit: Optional[Any] = ..., buffer_size=..., cap_at_buffer: bool = ...): ...
|
||||
def make_chunk_iter(stream, separator, limit: Optional[Any] = ..., buffer_size=..., cap_at_buffer: bool = ...): ...
|
||||
def make_line_iter(stream, limit: Any | None = ..., buffer_size=..., cap_at_buffer: bool = ...): ...
|
||||
def make_chunk_iter(stream, separator, limit: Any | None = ..., buffer_size=..., cap_at_buffer: bool = ...): ...
|
||||
|
||||
class LimitedStream:
|
||||
limit: Any
|
||||
@@ -67,8 +67,8 @@ class LimitedStream:
|
||||
def on_exhausted(self): ...
|
||||
def on_disconnect(self): ...
|
||||
def exhaust(self, chunk_size=...): ...
|
||||
def read(self, size: Optional[Any] = ...): ...
|
||||
def readline(self, size: Optional[Any] = ...): ...
|
||||
def readlines(self, size: Optional[Any] = ...): ...
|
||||
def read(self, size: Any | None = ...): ...
|
||||
def readline(self, size: Any | None = ...): ...
|
||||
def readlines(self, size: Any | None = ...): ...
|
||||
def tell(self): ...
|
||||
def __next__(self): ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from _typeshed import Self
|
||||
from types import CodeType, FrameType, TracebackType, coroutine
|
||||
from typing import Any, Coroutine, Generator, Generic, Iterator, Optional, Type, TypeVar, Union
|
||||
from typing import Any, Coroutine, Generator, Generic, Iterator, Type, TypeVar
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_T_co = TypeVar("_T_co", covariant=True)
|
||||
@@ -15,9 +15,7 @@ class AsyncBase(Generic[_T]):
|
||||
class AiofilesContextManager(Generic[_T_co, _T_contra, _V_co]):
|
||||
def __init__(self, coro: Coroutine[_T_co, _T_contra, _V_co]) -> None: ...
|
||||
def send(self, value: _T_contra) -> _T_co: ...
|
||||
def throw(
|
||||
self, typ: Type[BaseException], val: Union[BaseException, object] = ..., tb: Optional[TracebackType] = ...
|
||||
) -> _T_co: ...
|
||||
def throw(self, typ: Type[BaseException], val: BaseException | object = ..., tb: TracebackType | None = ...) -> _T_co: ...
|
||||
def close(self) -> None: ...
|
||||
@property
|
||||
def gi_frame(self) -> FrameType: ...
|
||||
@@ -32,5 +30,5 @@ class AiofilesContextManager(Generic[_T_co, _T_contra, _V_co]):
|
||||
async def __anext__(self) -> _V_co: ...
|
||||
async def __aenter__(self) -> _V_co: ...
|
||||
async def __aexit__(
|
||||
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
|
||||
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> None: ...
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
import sys
|
||||
from _typeshed import StrOrBytesPath
|
||||
from os import stat_result
|
||||
from typing import Optional, Sequence, Union, overload
|
||||
from typing import Sequence, Union, overload
|
||||
|
||||
_FdOrAnyPath = Union[int, StrOrBytesPath]
|
||||
|
||||
async def stat(path: _FdOrAnyPath, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> stat_result: ...
|
||||
async def stat(path: _FdOrAnyPath, *, dir_fd: int | None = ..., follow_symlinks: bool = ...) -> stat_result: ...
|
||||
async def rename(
|
||||
src: StrOrBytesPath, dst: StrOrBytesPath, *, src_dir_fd: Optional[int] = ..., dst_dir_fd: Optional[int] = ...
|
||||
src: StrOrBytesPath, dst: StrOrBytesPath, *, src_dir_fd: int | None = ..., dst_dir_fd: int | None = ...
|
||||
) -> None: ...
|
||||
async def remove(path: StrOrBytesPath, *, dir_fd: Optional[int] = ...) -> None: ...
|
||||
async def mkdir(path: StrOrBytesPath, mode: int = ..., *, dir_fd: Optional[int] = ...) -> None: ...
|
||||
async def rmdir(path: StrOrBytesPath, *, dir_fd: Optional[int] = ...) -> None: ...
|
||||
async def remove(path: StrOrBytesPath, *, dir_fd: int | None = ...) -> None: ...
|
||||
async def mkdir(path: StrOrBytesPath, mode: int = ..., *, dir_fd: int | None = ...) -> None: ...
|
||||
async def rmdir(path: StrOrBytesPath, *, dir_fd: int | None = ...) -> None: ...
|
||||
|
||||
if sys.platform != "win32":
|
||||
@overload
|
||||
async def sendfile(__out_fd: int, __in_fd: int, offset: Optional[int], count: int) -> int: ...
|
||||
async def sendfile(__out_fd: int, __in_fd: int, offset: int | None, count: int) -> int: ...
|
||||
@overload
|
||||
async def sendfile(
|
||||
__out_fd: int,
|
||||
|
||||
@@ -7,7 +7,7 @@ from _typeshed import (
|
||||
StrOrBytesPath,
|
||||
)
|
||||
from asyncio import AbstractEventLoop
|
||||
from typing import Any, Callable, Optional, Union, overload
|
||||
from typing import Any, Callable, Union, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
from ..base import AiofilesContextManager
|
||||
@@ -23,14 +23,14 @@ def open(
|
||||
file: _OpenFile,
|
||||
mode: OpenTextMode = ...,
|
||||
buffering: int = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
errors: Optional[str] = ...,
|
||||
newline: Optional[str] = ...,
|
||||
encoding: str | None = ...,
|
||||
errors: str | None = ...,
|
||||
newline: str | None = ...,
|
||||
closefd: bool = ...,
|
||||
opener: Optional[_Opener] = ...,
|
||||
opener: _Opener | None = ...,
|
||||
*,
|
||||
loop: Optional[AbstractEventLoop] = ...,
|
||||
executor: Optional[Any] = ...,
|
||||
loop: AbstractEventLoop | None = ...,
|
||||
executor: Any | None = ...,
|
||||
) -> AiofilesContextManager[None, None, AsyncTextIOWrapper]: ...
|
||||
|
||||
# Unbuffered binary: returns a FileIO
|
||||
@@ -43,26 +43,26 @@ def open(
|
||||
errors: None = ...,
|
||||
newline: None = ...,
|
||||
closefd: bool = ...,
|
||||
opener: Optional[_Opener] = ...,
|
||||
opener: _Opener | None = ...,
|
||||
*,
|
||||
loop: Optional[AbstractEventLoop] = ...,
|
||||
executor: Optional[Any] = ...,
|
||||
loop: AbstractEventLoop | None = ...,
|
||||
executor: Any | None = ...,
|
||||
) -> AiofilesContextManager[None, None, AsyncFileIO]: ...
|
||||
|
||||
# Buffered binary reading/updating: AsyncBufferedReader
|
||||
@overload
|
||||
def open(
|
||||
file: _OpenFile,
|
||||
mode: Union[OpenBinaryModeReading, OpenBinaryModeUpdating],
|
||||
mode: OpenBinaryModeReading | OpenBinaryModeUpdating,
|
||||
buffering: Literal[-1, 1] = ...,
|
||||
encoding: None = ...,
|
||||
errors: None = ...,
|
||||
newline: None = ...,
|
||||
closefd: bool = ...,
|
||||
opener: Optional[_Opener] = ...,
|
||||
opener: _Opener | None = ...,
|
||||
*,
|
||||
loop: Optional[AbstractEventLoop] = ...,
|
||||
executor: Optional[Any] = ...,
|
||||
loop: AbstractEventLoop | None = ...,
|
||||
executor: Any | None = ...,
|
||||
) -> AiofilesContextManager[None, None, AsyncBufferedReader]: ...
|
||||
|
||||
# Buffered binary writing: AsyncBufferedIOBase
|
||||
@@ -75,10 +75,10 @@ def open(
|
||||
errors: None = ...,
|
||||
newline: None = ...,
|
||||
closefd: bool = ...,
|
||||
opener: Optional[_Opener] = ...,
|
||||
opener: _Opener | None = ...,
|
||||
*,
|
||||
loop: Optional[AbstractEventLoop] = ...,
|
||||
executor: Optional[Any] = ...,
|
||||
loop: AbstractEventLoop | None = ...,
|
||||
executor: Any | None = ...,
|
||||
) -> AiofilesContextManager[None, None, AsyncBufferedIOBase]: ...
|
||||
|
||||
# Buffering cannot be determined: fall back to _UnknownAsyncBinaryIO
|
||||
@@ -91,8 +91,8 @@ def open(
|
||||
errors: None = ...,
|
||||
newline: None = ...,
|
||||
closefd: bool = ...,
|
||||
opener: Optional[_Opener] = ...,
|
||||
opener: _Opener | None = ...,
|
||||
*,
|
||||
loop: Optional[AbstractEventLoop] = ...,
|
||||
executor: Optional[Any] = ...,
|
||||
loop: AbstractEventLoop | None = ...,
|
||||
executor: Any | None = ...,
|
||||
) -> AiofilesContextManager[None, None, _UnknownAsyncBinaryIO]: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from _typeshed import ReadableBuffer, StrOrBytesPath, WriteableBuffer
|
||||
from io import FileIO
|
||||
from typing import Iterable, List, Optional, Union
|
||||
from typing import Iterable, List
|
||||
|
||||
from ..base import AsyncBase
|
||||
|
||||
@@ -9,13 +9,13 @@ class _UnknownAsyncBinaryIO(AsyncBase[bytes]):
|
||||
async def flush(self) -> None: ...
|
||||
async def isatty(self) -> bool: ...
|
||||
async def read(self, __size: int = ...) -> bytes: ...
|
||||
async def readinto(self, __buffer: WriteableBuffer) -> Optional[int]: ...
|
||||
async def readline(self, __size: Optional[int] = ...) -> bytes: ...
|
||||
async def readinto(self, __buffer: WriteableBuffer) -> int | None: ...
|
||||
async def readline(self, __size: int | None = ...) -> bytes: ...
|
||||
async def readlines(self, __hint: int = ...) -> List[bytes]: ...
|
||||
async def seek(self, __offset: int, __whence: int = ...) -> int: ...
|
||||
async def seekable(self) -> bool: ...
|
||||
async def tell(self) -> int: ...
|
||||
async def truncate(self, __size: Optional[int] = ...) -> int: ...
|
||||
async def truncate(self, __size: int | None = ...) -> int: ...
|
||||
async def writable(self) -> bool: ...
|
||||
async def write(self, __b: ReadableBuffer) -> int: ...
|
||||
async def writelines(self, __lines: Iterable[ReadableBuffer]) -> None: ...
|
||||
@@ -26,7 +26,7 @@ class _UnknownAsyncBinaryIO(AsyncBase[bytes]):
|
||||
@property
|
||||
def mode(self) -> str: ...
|
||||
@property
|
||||
def name(self) -> Union[StrOrBytesPath, int]: ...
|
||||
def name(self) -> StrOrBytesPath | int: ...
|
||||
|
||||
class AsyncBufferedIOBase(_UnknownAsyncBinaryIO):
|
||||
async def read1(self, __size: int = ...) -> bytes: ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from _typeshed import StrOrBytesPath
|
||||
from typing import BinaryIO, Iterable, List, Optional, Tuple, Union
|
||||
from typing import BinaryIO, Iterable, List, Tuple
|
||||
|
||||
from ..base import AsyncBase
|
||||
|
||||
@@ -7,13 +7,13 @@ class AsyncTextIOWrapper(AsyncBase[str]):
|
||||
async def close(self) -> None: ...
|
||||
async def flush(self) -> None: ...
|
||||
async def isatty(self) -> bool: ...
|
||||
async def read(self, __size: Optional[int] = ...) -> str: ...
|
||||
async def read(self, __size: int | None = ...) -> str: ...
|
||||
async def readline(self, __size: int = ...) -> str: ...
|
||||
async def readlines(self, __hint: int = ...) -> List[str]: ...
|
||||
async def seek(self, __offset: int, __whence: int = ...) -> int: ...
|
||||
async def seekable(self) -> bool: ...
|
||||
async def tell(self) -> int: ...
|
||||
async def truncate(self, __size: Optional[int] = ...) -> int: ...
|
||||
async def truncate(self, __size: int | None = ...) -> int: ...
|
||||
async def writable(self) -> bool: ...
|
||||
async def write(self, __b: str) -> int: ...
|
||||
async def writelines(self, __lines: Iterable[str]) -> None: ...
|
||||
@@ -27,12 +27,12 @@ class AsyncTextIOWrapper(AsyncBase[str]):
|
||||
@property
|
||||
def encoding(self) -> str: ...
|
||||
@property
|
||||
def errors(self) -> Optional[str]: ...
|
||||
def errors(self) -> str | None: ...
|
||||
@property
|
||||
def line_buffering(self) -> bool: ...
|
||||
@property
|
||||
def newlines(self) -> Union[str, Tuple[str, ...], None]: ...
|
||||
def newlines(self) -> str | Tuple[str, ...] | None: ...
|
||||
@property
|
||||
def name(self) -> Union[StrOrBytesPath, int]: ...
|
||||
def name(self) -> StrOrBytesPath | int: ...
|
||||
@property
|
||||
def mode(self) -> str: ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from _typeshed import StrOrBytesPath
|
||||
from typing import IO, Any, AnyStr, Callable, ContextManager, Optional, Text, Type
|
||||
from typing import IO, Any, AnyStr, Callable, ContextManager, Text, Type
|
||||
|
||||
def replace_atomic(src: AnyStr, dst: AnyStr) -> None: ...
|
||||
def move_atomic(src: AnyStr, dst: AnyStr) -> None: ...
|
||||
@@ -8,7 +8,7 @@ class AtomicWriter(object):
|
||||
def __init__(self, path: StrOrBytesPath, mode: Text = ..., overwrite: bool = ...) -> None: ...
|
||||
def open(self) -> ContextManager[IO[Any]]: ...
|
||||
def _open(self, get_fileobject: Callable[..., IO[AnyStr]]) -> ContextManager[IO[AnyStr]]: ...
|
||||
def get_fileobject(self, dir: Optional[StrOrBytesPath] = ..., **kwargs: Any) -> IO[Any]: ...
|
||||
def get_fileobject(self, dir: StrOrBytesPath | None = ..., **kwargs: Any) -> IO[Any]: ...
|
||||
def sync(self, f: IO[Any]) -> None: ...
|
||||
def commit(self, f: IO[Any]) -> None: ...
|
||||
def rollback(self, f: IO[Any]) -> None: ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Container, Iterable, Optional, Text
|
||||
from typing import Any, Container, Iterable, Text
|
||||
|
||||
from bleach.linkifier import DEFAULT_CALLBACKS as DEFAULT_CALLBACKS, Linker as Linker, _Callback
|
||||
from bleach.sanitizer import (
|
||||
@@ -26,5 +26,5 @@ def clean(
|
||||
strip_comments: bool = ...,
|
||||
) -> Text: ...
|
||||
def linkify(
|
||||
text: Text, callbacks: Iterable[_Callback] = ..., skip_tags: Optional[Container[Text]] = ..., parse_email: bool = ...
|
||||
text: Text, callbacks: Iterable[_Callback] = ..., skip_tags: Container[Text] | None = ..., parse_email: bool = ...
|
||||
) -> Text: ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Generator, Iterable, List, Optional, Text
|
||||
from typing import Any, Generator, Iterable, List, Text
|
||||
|
||||
class HTMLParser(object): # actually html5lib.HTMLParser
|
||||
def __getattr__(self, __name: Text) -> Any: ... # incomplete
|
||||
@@ -13,14 +13,14 @@ class HTMLSerializer(object): # actually html5lib.serializer.HTMLSerializer
|
||||
def __getattr__(self, __name: Text) -> Any: ... # incomplete
|
||||
|
||||
class BleachHTMLParser(HTMLParser):
|
||||
tags: Optional[List[Text]]
|
||||
tags: List[Text] | None
|
||||
strip: bool
|
||||
consume_entities: bool
|
||||
def __init__(self, tags: Optional[Iterable[Text]], strip: bool, consume_entities: bool, **kwargs) -> None: ...
|
||||
def __init__(self, tags: Iterable[Text] | None, strip: bool, consume_entities: bool, **kwargs) -> None: ...
|
||||
|
||||
class BleachHTMLSerializer(HTMLSerializer):
|
||||
escape_rcdata: bool
|
||||
def escape_base_amp(self, stoken: Text) -> Generator[Text, None, None]: ...
|
||||
def serialize(self, treewalker, encoding: Optional[Text] = ...) -> Generator[Text, None, None]: ...
|
||||
def serialize(self, treewalker, encoding: Text | None = ...) -> Generator[Text, None, None]: ...
|
||||
|
||||
def __getattr__(__name: Text) -> Any: ... # incomplete
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Container, Iterable, List, MutableMapping, Optional, Pattern, Protocol, Text
|
||||
from typing import Any, Container, Iterable, List, MutableMapping, Pattern, Protocol, Text
|
||||
|
||||
from .html5lib_shim import Filter
|
||||
|
||||
@@ -24,11 +24,11 @@ class Linker(object):
|
||||
def __init__(
|
||||
self,
|
||||
callbacks: Iterable[_Callback] = ...,
|
||||
skip_tags: Optional[Container[Text]] = ...,
|
||||
skip_tags: Container[Text] | None = ...,
|
||||
parse_email: bool = ...,
|
||||
url_re: Pattern[Text] = ...,
|
||||
email_re: Pattern[Text] = ...,
|
||||
recognized_tags: Optional[Container[Text]] = ...,
|
||||
recognized_tags: Container[Text] | None = ...,
|
||||
) -> None: ...
|
||||
def linkify(self, text: Text) -> Text: ...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Callable, Container, Dict, Iterable, List, Optional, Pattern, Text, Union
|
||||
from typing import Any, Callable, Container, Dict, Iterable, List, Pattern, Text, Union
|
||||
|
||||
from .html5lib_shim import BleachHTMLParser, BleachHTMLSerializer, SanitizerFilter
|
||||
|
||||
@@ -33,7 +33,7 @@ class Cleaner(object):
|
||||
protocols: Container[Text] = ...,
|
||||
strip: bool = ...,
|
||||
strip_comments: bool = ...,
|
||||
filters: Optional[Iterable[_Filter]] = ...,
|
||||
filters: Iterable[_Filter] | None = ...,
|
||||
) -> None: ...
|
||||
def clean(self, text: Text) -> Text: ...
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import logging
|
||||
from typing import Any, Optional, Text
|
||||
from typing import Any, Text
|
||||
|
||||
from .s3.connection import S3Connection
|
||||
|
||||
@@ -20,80 +20,76 @@ class NullHandler(logging.Handler):
|
||||
log: Any
|
||||
perflog: Any
|
||||
|
||||
def set_file_logger(name, filepath, level: Any = ..., format_string: Optional[Any] = ...): ...
|
||||
def set_stream_logger(name, level: Any = ..., format_string: Optional[Any] = ...): ...
|
||||
def connect_sqs(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_s3(
|
||||
aws_access_key_id: Optional[Text] = ..., aws_secret_access_key: Optional[Text] = ..., **kwargs
|
||||
) -> S3Connection: ...
|
||||
def connect_gs(gs_access_key_id: Optional[Any] = ..., gs_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_ec2(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_elb(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_autoscale(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_cloudwatch(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_sdb(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_fps(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_mturk(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_cloudfront(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_vpc(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_rds(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_rds2(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_emr(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_sns(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_iam(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_route53(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_cloudformation(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def set_file_logger(name, filepath, level: Any = ..., format_string: Any | None = ...): ...
|
||||
def set_stream_logger(name, level: Any = ..., format_string: Any | None = ...): ...
|
||||
def connect_sqs(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_s3(aws_access_key_id: Text | None = ..., aws_secret_access_key: Text | None = ..., **kwargs) -> S3Connection: ...
|
||||
def connect_gs(gs_access_key_id: Any | None = ..., gs_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_ec2(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_elb(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_autoscale(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_cloudwatch(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_sdb(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_fps(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_mturk(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_cloudfront(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_vpc(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_rds(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_rds2(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_emr(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_sns(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_iam(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_route53(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_cloudformation(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_euca(
|
||||
host: Optional[Any] = ...,
|
||||
aws_access_key_id: Optional[Any] = ...,
|
||||
aws_secret_access_key: Optional[Any] = ...,
|
||||
host: Any | None = ...,
|
||||
aws_access_key_id: Any | None = ...,
|
||||
aws_secret_access_key: Any | None = ...,
|
||||
port: int = ...,
|
||||
path: str = ...,
|
||||
is_secure: bool = ...,
|
||||
**kwargs,
|
||||
): ...
|
||||
def connect_glacier(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_ec2_endpoint(url, aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_glacier(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_ec2_endpoint(url, aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_walrus(
|
||||
host: Optional[Any] = ...,
|
||||
aws_access_key_id: Optional[Any] = ...,
|
||||
aws_secret_access_key: Optional[Any] = ...,
|
||||
host: Any | None = ...,
|
||||
aws_access_key_id: Any | None = ...,
|
||||
aws_secret_access_key: Any | None = ...,
|
||||
port: int = ...,
|
||||
path: str = ...,
|
||||
is_secure: bool = ...,
|
||||
**kwargs,
|
||||
): ...
|
||||
def connect_ses(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_sts(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_ia(
|
||||
ia_access_key_id: Optional[Any] = ..., ia_secret_access_key: Optional[Any] = ..., is_secure: bool = ..., **kwargs
|
||||
): ...
|
||||
def connect_dynamodb(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_swf(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_cloudsearch(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_ses(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_sts(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_ia(ia_access_key_id: Any | None = ..., ia_secret_access_key: Any | None = ..., is_secure: bool = ..., **kwargs): ...
|
||||
def connect_dynamodb(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_swf(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_cloudsearch(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_cloudsearch2(
|
||||
aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., sign_request: bool = ..., **kwargs
|
||||
aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., sign_request: bool = ..., **kwargs
|
||||
): ...
|
||||
def connect_cloudsearchdomain(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_beanstalk(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_elastictranscoder(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_opsworks(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_redshift(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_support(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_cloudtrail(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_directconnect(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_kinesis(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_logs(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_route53domains(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_cognito_identity(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_cognito_sync(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_kms(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_awslambda(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_codedeploy(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_configservice(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_cloudhsm(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_ec2containerservice(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_machinelearning(aws_access_key_id: Optional[Any] = ..., aws_secret_access_key: Optional[Any] = ..., **kwargs): ...
|
||||
def connect_cloudsearchdomain(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_beanstalk(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_elastictranscoder(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_opsworks(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_redshift(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_support(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_cloudtrail(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_directconnect(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_kinesis(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_logs(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_route53domains(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_cognito_identity(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_cognito_sync(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_kms(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_awslambda(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_codedeploy(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_configservice(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_cloudhsm(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_ec2containerservice(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def connect_machinelearning(aws_access_key_id: Any | None = ..., aws_secret_access_key: Any | None = ..., **kwargs): ...
|
||||
def storage_uri(
|
||||
uri_str,
|
||||
default_scheme: str = ...,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
from boto.auth_handler import AuthHandler
|
||||
|
||||
@@ -45,7 +45,7 @@ class HmacAuthV4Handler(AuthHandler, HmacKeys):
|
||||
capability: Any
|
||||
service_name: Any
|
||||
region_name: Any
|
||||
def __init__(self, host, config, provider, service_name: Optional[Any] = ..., region_name: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, host, config, provider, service_name: Any | None = ..., region_name: Any | None = ...) -> None: ...
|
||||
def headers_to_sign(self, http_request): ...
|
||||
def host_header(self, host, http_request): ...
|
||||
def query_string(self, http_request): ...
|
||||
@@ -78,7 +78,7 @@ class S3HmacAuthV4Handler(HmacAuthV4Handler, AuthHandler):
|
||||
def mangle_path_and_params(self, req): ...
|
||||
def payload(self, http_request): ...
|
||||
def add_auth(self, req, **kwargs): ...
|
||||
def presign(self, req, expires, iso_date: Optional[Any] = ...): ...
|
||||
def presign(self, req, expires, iso_date: Any | None = ...): ...
|
||||
|
||||
class STSAnonHandler(AuthHandler):
|
||||
capability: Any
|
||||
@@ -104,6 +104,6 @@ class POSTPathQSV2AuthHandler(QuerySignatureV2AuthHandler, AuthHandler):
|
||||
capability: Any
|
||||
def add_auth(self, req, **kwargs): ...
|
||||
|
||||
def get_auth_handler(host, config, provider, requested_capability: Optional[Any] = ...): ...
|
||||
def get_auth_handler(host, config, provider, requested_capability: Any | None = ...): ...
|
||||
def detect_potential_sigv4(func): ...
|
||||
def detect_potential_s3sigv4(func): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
from six.moves import http_client
|
||||
|
||||
@@ -42,7 +42,7 @@ class HTTPRequest:
|
||||
|
||||
class HTTPResponse(http_client.HTTPResponse):
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def read(self, amt: Optional[Any] = ...): ...
|
||||
def read(self, amt: Any | None = ...): ...
|
||||
|
||||
class AWSAuthConnection:
|
||||
suppress_consec_slashes: Any
|
||||
@@ -67,22 +67,22 @@ class AWSAuthConnection:
|
||||
def __init__(
|
||||
self,
|
||||
host,
|
||||
aws_access_key_id: Optional[Any] = ...,
|
||||
aws_secret_access_key: Optional[Any] = ...,
|
||||
aws_access_key_id: Any | None = ...,
|
||||
aws_secret_access_key: Any | None = ...,
|
||||
is_secure: bool = ...,
|
||||
port: Optional[Any] = ...,
|
||||
proxy: Optional[Any] = ...,
|
||||
proxy_port: Optional[Any] = ...,
|
||||
proxy_user: Optional[Any] = ...,
|
||||
proxy_pass: Optional[Any] = ...,
|
||||
port: Any | None = ...,
|
||||
proxy: Any | None = ...,
|
||||
proxy_port: Any | None = ...,
|
||||
proxy_user: Any | None = ...,
|
||||
proxy_pass: Any | None = ...,
|
||||
debug: int = ...,
|
||||
https_connection_factory: Optional[Any] = ...,
|
||||
https_connection_factory: Any | None = ...,
|
||||
path: str = ...,
|
||||
provider: str = ...,
|
||||
security_token: Optional[Any] = ...,
|
||||
security_token: Any | None = ...,
|
||||
suppress_consec_slashes: bool = ...,
|
||||
validate_certs: bool = ...,
|
||||
profile_name: Optional[Any] = ...,
|
||||
profile_name: Any | None = ...,
|
||||
) -> None: ...
|
||||
auth_region_name: Any
|
||||
@property
|
||||
@@ -100,7 +100,7 @@ class AWSAuthConnection:
|
||||
@property
|
||||
def profile_name(self): ...
|
||||
def get_path(self, path: str = ...): ...
|
||||
def server_name(self, port: Optional[Any] = ...): ...
|
||||
def server_name(self, port: Any | None = ...): ...
|
||||
proxy: Any
|
||||
proxy_port: Any
|
||||
proxy_user: Any
|
||||
@@ -112,8 +112,8 @@ class AWSAuthConnection:
|
||||
def skip_proxy(self, host): ...
|
||||
def new_http_connection(self, host, port, is_secure): ...
|
||||
def put_http_connection(self, host, port, is_secure, connection): ...
|
||||
def proxy_ssl(self, host: Optional[Any] = ..., port: Optional[Any] = ...): ...
|
||||
def prefix_proxy_to_path(self, path, host: Optional[Any] = ...): ...
|
||||
def proxy_ssl(self, host: Any | None = ..., port: Any | None = ...): ...
|
||||
def prefix_proxy_to_path(self, path, host: Any | None = ...): ...
|
||||
def get_proxy_auth_header(self): ...
|
||||
def get_proxy_url_with_auth(self): ...
|
||||
def set_host_header(self, request): ...
|
||||
@@ -123,23 +123,23 @@ class AWSAuthConnection:
|
||||
method,
|
||||
path,
|
||||
auth_path,
|
||||
params: Optional[Any] = ...,
|
||||
headers: Optional[Any] = ...,
|
||||
params: Any | None = ...,
|
||||
headers: Any | None = ...,
|
||||
data: str = ...,
|
||||
host: Optional[Any] = ...,
|
||||
host: Any | None = ...,
|
||||
): ...
|
||||
def make_request(
|
||||
self,
|
||||
method,
|
||||
path,
|
||||
headers: Optional[Any] = ...,
|
||||
headers: Any | None = ...,
|
||||
data: str = ...,
|
||||
host: Optional[Any] = ...,
|
||||
auth_path: Optional[Any] = ...,
|
||||
sender: Optional[Any] = ...,
|
||||
override_num_retries: Optional[Any] = ...,
|
||||
params: Optional[Any] = ...,
|
||||
retry_handler: Optional[Any] = ...,
|
||||
host: Any | None = ...,
|
||||
auth_path: Any | None = ...,
|
||||
sender: Any | None = ...,
|
||||
override_num_retries: Any | None = ...,
|
||||
params: Any | None = ...,
|
||||
retry_handler: Any | None = ...,
|
||||
): ...
|
||||
def close(self): ...
|
||||
|
||||
@@ -148,27 +148,27 @@ class AWSQueryConnection(AWSAuthConnection):
|
||||
ResponseError: Any
|
||||
def __init__(
|
||||
self,
|
||||
aws_access_key_id: Optional[Any] = ...,
|
||||
aws_secret_access_key: Optional[Any] = ...,
|
||||
aws_access_key_id: Any | None = ...,
|
||||
aws_secret_access_key: Any | None = ...,
|
||||
is_secure: bool = ...,
|
||||
port: Optional[Any] = ...,
|
||||
proxy: Optional[Any] = ...,
|
||||
proxy_port: Optional[Any] = ...,
|
||||
proxy_user: Optional[Any] = ...,
|
||||
proxy_pass: Optional[Any] = ...,
|
||||
host: Optional[Any] = ...,
|
||||
port: Any | None = ...,
|
||||
proxy: Any | None = ...,
|
||||
proxy_port: Any | None = ...,
|
||||
proxy_user: Any | None = ...,
|
||||
proxy_pass: Any | None = ...,
|
||||
host: Any | None = ...,
|
||||
debug: int = ...,
|
||||
https_connection_factory: Optional[Any] = ...,
|
||||
https_connection_factory: Any | None = ...,
|
||||
path: str = ...,
|
||||
security_token: Optional[Any] = ...,
|
||||
security_token: Any | None = ...,
|
||||
validate_certs: bool = ...,
|
||||
profile_name: Optional[Any] = ...,
|
||||
profile_name: Any | None = ...,
|
||||
provider: str = ...,
|
||||
) -> None: ...
|
||||
def get_utf8_value(self, value): ...
|
||||
def make_request(self, action, params: Optional[Any] = ..., path: str = ..., verb: str = ..., *args, **kwargs): ... # type: ignore # https://github.com/python/mypy/issues/1237
|
||||
def make_request(self, action, params: Any | None = ..., path: str = ..., verb: str = ..., *args, **kwargs): ... # type: ignore # https://github.com/python/mypy/issues/1237
|
||||
def build_list_params(self, params, items, label): ...
|
||||
def build_complex_list_params(self, params, items, label, names): ...
|
||||
def get_list(self, action, params, markers, path: str = ..., parent: Optional[Any] = ..., verb: str = ...): ...
|
||||
def get_object(self, action, params, cls, path: str = ..., parent: Optional[Any] = ..., verb: str = ...): ...
|
||||
def get_status(self, action, params, path: str = ..., parent: Optional[Any] = ..., verb: str = ...): ...
|
||||
def get_list(self, action, params, markers, path: str = ..., parent: Any | None = ..., verb: str = ...): ...
|
||||
def get_object(self, action, params, cls, path: str = ..., parent: Any | None = ..., verb: str = ...): ...
|
||||
def get_status(self, action, params, path: str = ..., parent: Any | None = ..., verb: str = ...): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
from boto.compat import StandardError
|
||||
|
||||
@@ -19,7 +19,7 @@ class BotoServerError(StandardError):
|
||||
error_code: Any
|
||||
message: str
|
||||
box_usage: Any
|
||||
def __init__(self, status, reason, body: Optional[Any] = ..., *args) -> None: ...
|
||||
def __init__(self, status, reason, body: Any | None = ..., *args) -> None: ...
|
||||
def __getattr__(self, name): ...
|
||||
def __setattr__(self, name, value): ...
|
||||
def startElement(self, name, attrs, connection): ...
|
||||
@@ -31,13 +31,13 @@ class ConsoleOutput:
|
||||
timestamp: Any
|
||||
comment: Any
|
||||
output: Any
|
||||
def __init__(self, parent: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, parent: Any | None = ...) -> None: ...
|
||||
def startElement(self, name, attrs, connection): ...
|
||||
def endElement(self, name, value, connection): ...
|
||||
|
||||
class StorageCreateError(BotoServerError):
|
||||
bucket: Any
|
||||
def __init__(self, status, reason, body: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, status, reason, body: Any | None = ...) -> None: ...
|
||||
def endElement(self, name, value, connection): ...
|
||||
|
||||
class S3CreateError(StorageCreateError): ...
|
||||
@@ -49,7 +49,7 @@ class GSCopyError(StorageCopyError): ...
|
||||
class SQSError(BotoServerError):
|
||||
detail: Any
|
||||
type: Any
|
||||
def __init__(self, status, reason, body: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, status, reason, body: Any | None = ...) -> None: ...
|
||||
def startElement(self, name, attrs, connection): ...
|
||||
def endElement(self, name, value, connection): ...
|
||||
|
||||
@@ -59,7 +59,7 @@ class SQSDecodeError(BotoClientError):
|
||||
|
||||
class StorageResponseError(BotoServerError):
|
||||
resource: Any
|
||||
def __init__(self, status, reason, body: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, status, reason, body: Any | None = ...) -> None: ...
|
||||
def startElement(self, name, attrs, connection): ...
|
||||
def endElement(self, name, value, connection): ...
|
||||
|
||||
@@ -68,7 +68,7 @@ class GSResponseError(StorageResponseError): ...
|
||||
|
||||
class EC2ResponseError(BotoServerError):
|
||||
errors: Any
|
||||
def __init__(self, status, reason, body: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, status, reason, body: Any | None = ...) -> None: ...
|
||||
def startElement(self, name, attrs, connection): ...
|
||||
request_id: Any
|
||||
def endElement(self, name, value, connection): ...
|
||||
@@ -79,7 +79,7 @@ class JSONResponseError(BotoServerError):
|
||||
body: Any
|
||||
error_message: Any
|
||||
error_code: Any
|
||||
def __init__(self, status, reason, body: Optional[Any] = ..., *args) -> None: ...
|
||||
def __init__(self, status, reason, body: Any | None = ..., *args) -> None: ...
|
||||
|
||||
class DynamoDBResponseError(JSONResponseError): ...
|
||||
class SWFResponseError(JSONResponseError): ...
|
||||
@@ -89,7 +89,7 @@ class _EC2Error:
|
||||
connection: Any
|
||||
error_code: Any
|
||||
error_message: Any
|
||||
def __init__(self, connection: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, connection: Any | None = ...) -> None: ...
|
||||
def startElement(self, name, attrs, connection): ...
|
||||
def endElement(self, name, value, connection): ...
|
||||
|
||||
@@ -140,7 +140,7 @@ class TooManyRecordsException(Exception):
|
||||
class PleaseRetryException(Exception):
|
||||
message: Any
|
||||
response: Any
|
||||
def __init__(self, message, response: Optional[Any] = ...) -> None: ...
|
||||
def __init__(self, message, response: Any | None = ...) -> None: ...
|
||||
|
||||
class InvalidInstanceMetadataError(Exception):
|
||||
MSG: str
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Dict, List, Mapping, Optional, Type
|
||||
from typing import Any, Dict, List, Mapping, Type
|
||||
|
||||
from boto.connection import AWSQueryConnection
|
||||
|
||||
@@ -11,72 +11,67 @@ class KMSConnection(AWSQueryConnection):
|
||||
ResponseError: Type[Exception]
|
||||
region: Any
|
||||
def __init__(self, **kwargs) -> None: ...
|
||||
def create_alias(self, alias_name: str, target_key_id: str) -> Optional[Dict[str, Any]]: ...
|
||||
def create_alias(self, alias_name: str, target_key_id: str) -> Dict[str, Any] | None: ...
|
||||
def create_grant(
|
||||
self,
|
||||
key_id: str,
|
||||
grantee_principal: str,
|
||||
retiring_principal: Optional[str] = ...,
|
||||
operations: Optional[List[str]] = ...,
|
||||
constraints: Optional[Dict[str, Dict[str, str]]] = ...,
|
||||
grant_tokens: Optional[List[str]] = ...,
|
||||
) -> Optional[Dict[str, Any]]: ...
|
||||
retiring_principal: str | None = ...,
|
||||
operations: List[str] | None = ...,
|
||||
constraints: Dict[str, Dict[str, str]] | None = ...,
|
||||
grant_tokens: List[str] | None = ...,
|
||||
) -> Dict[str, Any] | None: ...
|
||||
def create_key(
|
||||
self, policy: Optional[str] = ..., description: Optional[str] = ..., key_usage: Optional[str] = ...
|
||||
) -> Optional[Dict[str, Any]]: ...
|
||||
self, policy: str | None = ..., description: str | None = ..., key_usage: str | None = ...
|
||||
) -> Dict[str, Any] | None: ...
|
||||
def decrypt(
|
||||
self,
|
||||
ciphertext_blob: bytes,
|
||||
encryption_context: Optional[Mapping[str, Any]] = ...,
|
||||
grant_tokens: Optional[List[str]] = ...,
|
||||
) -> Optional[Dict[str, Any]]: ...
|
||||
def delete_alias(self, alias_name: str) -> Optional[Dict[str, Any]]: ...
|
||||
def describe_key(self, key_id: str) -> Optional[Dict[str, Any]]: ...
|
||||
def disable_key(self, key_id: str) -> Optional[Dict[str, Any]]: ...
|
||||
def disable_key_rotation(self, key_id: str) -> Optional[Dict[str, Any]]: ...
|
||||
def enable_key(self, key_id: str) -> Optional[Dict[str, Any]]: ...
|
||||
def enable_key_rotation(self, key_id: str) -> Optional[Dict[str, Any]]: ...
|
||||
self, ciphertext_blob: bytes, encryption_context: Mapping[str, Any] | None = ..., grant_tokens: List[str] | None = ...
|
||||
) -> Dict[str, Any] | None: ...
|
||||
def delete_alias(self, alias_name: str) -> Dict[str, Any] | None: ...
|
||||
def describe_key(self, key_id: str) -> Dict[str, Any] | None: ...
|
||||
def disable_key(self, key_id: str) -> Dict[str, Any] | None: ...
|
||||
def disable_key_rotation(self, key_id: str) -> Dict[str, Any] | None: ...
|
||||
def enable_key(self, key_id: str) -> Dict[str, Any] | None: ...
|
||||
def enable_key_rotation(self, key_id: str) -> Dict[str, Any] | None: ...
|
||||
def encrypt(
|
||||
self,
|
||||
key_id: str,
|
||||
plaintext: bytes,
|
||||
encryption_context: Optional[Mapping[str, Any]] = ...,
|
||||
grant_tokens: Optional[List[str]] = ...,
|
||||
) -> Optional[Dict[str, Any]]: ...
|
||||
encryption_context: Mapping[str, Any] | None = ...,
|
||||
grant_tokens: List[str] | None = ...,
|
||||
) -> Dict[str, Any] | None: ...
|
||||
def generate_data_key(
|
||||
self,
|
||||
key_id: str,
|
||||
encryption_context: Optional[Mapping[str, Any]] = ...,
|
||||
number_of_bytes: Optional[int] = ...,
|
||||
key_spec: Optional[str] = ...,
|
||||
grant_tokens: Optional[List[str]] = ...,
|
||||
) -> Optional[Dict[str, Any]]: ...
|
||||
encryption_context: Mapping[str, Any] | None = ...,
|
||||
number_of_bytes: int | None = ...,
|
||||
key_spec: str | None = ...,
|
||||
grant_tokens: List[str] | None = ...,
|
||||
) -> Dict[str, Any] | None: ...
|
||||
def generate_data_key_without_plaintext(
|
||||
self,
|
||||
key_id: str,
|
||||
encryption_context: Optional[Mapping[str, Any]] = ...,
|
||||
key_spec: Optional[str] = ...,
|
||||
number_of_bytes: Optional[int] = ...,
|
||||
grant_tokens: Optional[List[str]] = ...,
|
||||
) -> Optional[Dict[str, Any]]: ...
|
||||
def generate_random(self, number_of_bytes: Optional[int] = ...) -> Optional[Dict[str, Any]]: ...
|
||||
def get_key_policy(self, key_id: str, policy_name: str) -> Optional[Dict[str, Any]]: ...
|
||||
def get_key_rotation_status(self, key_id: str) -> Optional[Dict[str, Any]]: ...
|
||||
def list_aliases(self, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ...
|
||||
def list_grants(self, key_id: str, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ...
|
||||
def list_key_policies(
|
||||
self, key_id: str, limit: Optional[int] = ..., marker: Optional[str] = ...
|
||||
) -> Optional[Dict[str, Any]]: ...
|
||||
def list_keys(self, limit: Optional[int] = ..., marker: Optional[str] = ...) -> Optional[Dict[str, Any]]: ...
|
||||
def put_key_policy(self, key_id: str, policy_name: str, policy: str) -> Optional[Dict[str, Any]]: ...
|
||||
encryption_context: Mapping[str, Any] | None = ...,
|
||||
key_spec: str | None = ...,
|
||||
number_of_bytes: int | None = ...,
|
||||
grant_tokens: List[str] | None = ...,
|
||||
) -> Dict[str, Any] | None: ...
|
||||
def generate_random(self, number_of_bytes: int | None = ...) -> Dict[str, Any] | None: ...
|
||||
def get_key_policy(self, key_id: str, policy_name: str) -> Dict[str, Any] | None: ...
|
||||
def get_key_rotation_status(self, key_id: str) -> Dict[str, Any] | None: ...
|
||||
def list_aliases(self, limit: int | None = ..., marker: str | None = ...) -> Dict[str, Any] | None: ...
|
||||
def list_grants(self, key_id: str, limit: int | None = ..., marker: str | None = ...) -> Dict[str, Any] | None: ...
|
||||
def list_key_policies(self, key_id: str, limit: int | None = ..., marker: str | None = ...) -> Dict[str, Any] | None: ...
|
||||
def list_keys(self, limit: int | None = ..., marker: str | None = ...) -> Dict[str, Any] | None: ...
|
||||
def put_key_policy(self, key_id: str, policy_name: str, policy: str) -> Dict[str, Any] | None: ...
|
||||
def re_encrypt(
|
||||
self,
|
||||
ciphertext_blob: bytes,
|
||||
destination_key_id: str,
|
||||
source_encryption_context: Optional[Mapping[str, Any]] = ...,
|
||||
destination_encryption_context: Optional[Mapping[str, Any]] = ...,
|
||||
grant_tokens: Optional[List[str]] = ...,
|
||||
) -> Optional[Dict[str, Any]]: ...
|
||||
def retire_grant(self, grant_token: str) -> Optional[Dict[str, Any]]: ...
|
||||
def revoke_grant(self, key_id: str, grant_id: str) -> Optional[Dict[str, Any]]: ...
|
||||
def update_key_description(self, key_id: str, description: str) -> Optional[Dict[str, Any]]: ...
|
||||
source_encryption_context: Mapping[str, Any] | None = ...,
|
||||
destination_encryption_context: Mapping[str, Any] | None = ...,
|
||||
grant_tokens: List[str] | None = ...,
|
||||
) -> Dict[str, Any] | None: ...
|
||||
def retire_grant(self, grant_token: str) -> Dict[str, Any] | None: ...
|
||||
def revoke_grant(self, key_id: str, grant_id: str) -> Dict[str, Any] | None: ...
|
||||
def update_key_description(self, key_id: str, description: str) -> Dict[str, Any] | None: ...
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
class Plugin:
|
||||
capability: Any
|
||||
@classmethod
|
||||
def is_capable(cls, requested_capability): ...
|
||||
|
||||
def get_plugin(cls, requested_capability: Optional[Any] = ...): ...
|
||||
def get_plugin(cls, requested_capability: Any | None = ...): ...
|
||||
def load_plugins(config): ...
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
def load_endpoint_json(path): ...
|
||||
def merge_endpoints(defaults, additions): ...
|
||||
def load_regions(): ...
|
||||
def get_regions(service_name, region_cls: Optional[Any] = ..., connection_cls: Optional[Any] = ...): ...
|
||||
def get_regions(service_name, region_cls: Any | None = ..., connection_cls: Any | None = ...): ...
|
||||
|
||||
class RegionInfo:
|
||||
connection: Any
|
||||
@@ -11,11 +11,7 @@ class RegionInfo:
|
||||
endpoint: Any
|
||||
connection_cls: Any
|
||||
def __init__(
|
||||
self,
|
||||
connection: Optional[Any] = ...,
|
||||
name: Optional[Any] = ...,
|
||||
endpoint: Optional[Any] = ...,
|
||||
connection_cls: Optional[Any] = ...,
|
||||
self, connection: Any | None = ..., name: Any | None = ..., endpoint: Any | None = ..., connection_cls: Any | None = ...
|
||||
) -> None: ...
|
||||
def startElement(self, name, attrs, connection): ...
|
||||
def endElement(self, name, value, connection): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import List, Optional, Text, Type
|
||||
from typing import List, Text, Type
|
||||
|
||||
from boto.connection import AWSAuthConnection
|
||||
from boto.regioninfo import RegionInfo
|
||||
@@ -8,9 +8,9 @@ from .connection import S3Connection
|
||||
class S3RegionInfo(RegionInfo):
|
||||
def connect(
|
||||
self,
|
||||
name: Optional[Text] = ...,
|
||||
endpoint: Optional[str] = ...,
|
||||
connection_cls: Optional[Type[AWSAuthConnection]] = ...,
|
||||
name: Text | None = ...,
|
||||
endpoint: str | None = ...,
|
||||
connection_cls: Type[AWSAuthConnection] | None = ...,
|
||||
**kw_params,
|
||||
) -> S3Connection: ...
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user