mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
A few werkzeug type fixes (#2181)
* BaseRequest.stream * ResponseStreamMixin.stream * get_content_length() * get_input_stream()
This commit is contained in:
committed by
Jelle Zijlstra
parent
66226ab2d7
commit
c3897b4a14
10
third_party/2/werkzeug/wrappers.pyi
vendored
10
third_party/2/werkzeug/wrappers.pyi
vendored
@@ -4,7 +4,7 @@ from typing import (
|
||||
Tuple, Type, TypeVar, Union,
|
||||
)
|
||||
|
||||
from wsgiref.types import WSGIEnvironment
|
||||
from wsgiref.types import WSGIEnvironment, InputStream
|
||||
|
||||
from .datastructures import (
|
||||
CombinedMultiDict, EnvironHeaders, Headers, ImmutableMultiDict,
|
||||
@@ -37,8 +37,9 @@ class BaseRequest:
|
||||
def close(self) -> None: ...
|
||||
def __enter__(self): ...
|
||||
def __exit__(self, exc_type, exc_value, tb): ...
|
||||
def stream(self): ...
|
||||
input_stream = ... # type: Any
|
||||
@property
|
||||
def stream(self) -> InputStream: ...
|
||||
input_stream: InputStream
|
||||
args = ... # type: ImmutableMultiDict
|
||||
@property
|
||||
def data(self) -> bytes: ...
|
||||
@@ -169,7 +170,8 @@ class ResponseStream:
|
||||
def encoding(self): ...
|
||||
|
||||
class ResponseStreamMixin:
|
||||
def stream(self): ...
|
||||
@property
|
||||
def stream(self) -> ResponseStream: ...
|
||||
|
||||
class CommonRequestDescriptorsMixin:
|
||||
@property
|
||||
|
||||
7
third_party/2/werkzeug/wsgi.pyi
vendored
7
third_party/2/werkzeug/wsgi.pyi
vendored
@@ -1,11 +1,12 @@
|
||||
from typing import Any
|
||||
from typing import Any, Optional
|
||||
from wsgiref.types import WSGIEnvironment, InputStream
|
||||
|
||||
def responder(f): ...
|
||||
def get_current_url(environ, root_only=False, strip_querystring=False, host_only=False, trusted_hosts=None): ...
|
||||
def host_is_trusted(hostname, trusted_list): ...
|
||||
def get_host(environ, trusted_hosts=None): ...
|
||||
def get_content_length(environ): ...
|
||||
def get_input_stream(environ, safe_fallback=True): ...
|
||||
def get_content_length(environ: WSGIEnvironment) -> Optional[int]: ...
|
||||
def get_input_stream(environ: WSGIEnvironment, safe_fallback: bool = ...) -> InputStream: ...
|
||||
def get_query_string(environ): ...
|
||||
def get_path_info(environ, charset='', errors=''): ...
|
||||
def get_script_name(environ, charset='', errors=''): ...
|
||||
|
||||
10
third_party/3/werkzeug/wrappers.pyi
vendored
10
third_party/3/werkzeug/wrappers.pyi
vendored
@@ -3,7 +3,7 @@ from typing import (
|
||||
Any, Callable, Iterable, Iterator, Mapping, MutableMapping, Optional, Sequence, Text, Tuple, Type, TypeVar, Union,
|
||||
)
|
||||
|
||||
from wsgiref.types import WSGIEnvironment
|
||||
from wsgiref.types import WSGIEnvironment, InputStream
|
||||
|
||||
from .datastructures import (
|
||||
CombinedMultiDict, EnvironHeaders, Headers, ImmutableMultiDict,
|
||||
@@ -36,8 +36,9 @@ class BaseRequest:
|
||||
def close(self) -> None: ...
|
||||
def __enter__(self): ...
|
||||
def __exit__(self, exc_type, exc_value, tb): ...
|
||||
def stream(self): ...
|
||||
input_stream = ... # type: Any
|
||||
@property
|
||||
def stream(self) -> InputStream: ...
|
||||
input_stream: InputStream
|
||||
args = ... # type: ImmutableMultiDict
|
||||
@property
|
||||
def data(self) -> bytes: ...
|
||||
@@ -168,7 +169,8 @@ class ResponseStream:
|
||||
def encoding(self): ...
|
||||
|
||||
class ResponseStreamMixin:
|
||||
def stream(self): ...
|
||||
@property
|
||||
def stream(self) -> ResponseStream: ...
|
||||
|
||||
class CommonRequestDescriptorsMixin:
|
||||
@property
|
||||
|
||||
7
third_party/3/werkzeug/wsgi.pyi
vendored
7
third_party/3/werkzeug/wsgi.pyi
vendored
@@ -1,11 +1,12 @@
|
||||
from typing import Any
|
||||
from typing import Any, Optional
|
||||
from wsgiref.types import WSGIEnvironment, InputStream
|
||||
|
||||
def responder(f): ...
|
||||
def get_current_url(environ, root_only=False, strip_querystring=False, host_only=False, trusted_hosts=None): ...
|
||||
def host_is_trusted(hostname, trusted_list): ...
|
||||
def get_host(environ, trusted_hosts=None): ...
|
||||
def get_content_length(environ): ...
|
||||
def get_input_stream(environ, safe_fallback=True): ...
|
||||
def get_content_length(environ: WSGIEnvironment) -> Optional[int]: ...
|
||||
def get_input_stream(environ: WSGIEnvironment, safe_fallback: bool = ...) -> InputStream: ...
|
||||
def get_query_string(environ): ...
|
||||
def get_path_info(environ, charset='', errors=''): ...
|
||||
def get_script_name(environ, charset='', errors=''): ...
|
||||
|
||||
Reference in New Issue
Block a user