A few werkzeug type fixes (#2181)

* BaseRequest.stream
* ResponseStreamMixin.stream
* get_content_length()
* get_input_stream()
This commit is contained in:
Sebastian Rittau
2018-06-01 06:38:51 +02:00
committed by Jelle Zijlstra
parent 66226ab2d7
commit c3897b4a14
4 changed files with 20 additions and 14 deletions

View File

@@ -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

View File

@@ -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=''): ...

View File

@@ -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

View File

@@ -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=''): ...