mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-03 16:42:44 +08:00
apply black and isort (#4287)
* apply black and isort * move some type ignores
This commit is contained in:
@@ -1,25 +1,34 @@
|
||||
import sys
|
||||
from typing import Any, AnyStr, Dict, IO, Iterator, List, Mapping, Optional, Tuple, TypeVar, Union
|
||||
from typing import IO, Any, AnyStr, Dict, Iterator, List, Mapping, Optional, Tuple, TypeVar, Union
|
||||
|
||||
_T = TypeVar('_T', bound=FieldStorage)
|
||||
_T = TypeVar("_T", bound=FieldStorage)
|
||||
|
||||
def parse(
|
||||
fp: Optional[IO[Any]] = ..., environ: Mapping[str, str] = ..., keep_blank_values: bool = ..., strict_parsing: bool = ...
|
||||
) -> Dict[str, List[str]]: ...
|
||||
|
||||
def parse(fp: Optional[IO[Any]] = ..., environ: Mapping[str, str] = ...,
|
||||
keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ...
|
||||
if sys.version_info < (3, 8):
|
||||
def parse_qs(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ...
|
||||
def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def parse_multipart(fp: IO[Any], pdict: Mapping[str, bytes], encoding: str = ..., errors: str = ...) -> Dict[str, List[Any]]: ...
|
||||
def parse_multipart(
|
||||
fp: IO[Any], pdict: Mapping[str, bytes], encoding: str = ..., errors: str = ...
|
||||
) -> Dict[str, List[Any]]: ...
|
||||
|
||||
else:
|
||||
def parse_multipart(fp: IO[Any], pdict: Mapping[str, bytes]) -> Dict[str, List[bytes]]: ...
|
||||
|
||||
def parse_header(line: str) -> Tuple[str, Dict[str, str]]: ...
|
||||
def test(environ: Mapping[str, str] = ...) -> None: ...
|
||||
def print_environ(environ: Mapping[str, str] = ...) -> None: ...
|
||||
def print_form(form: Dict[str, Any]) -> None: ...
|
||||
def print_directory() -> None: ...
|
||||
def print_environ_usage() -> None: ...
|
||||
|
||||
if sys.version_info < (3,):
|
||||
def escape(s: AnyStr, quote: bool = ...) -> AnyStr: ...
|
||||
|
||||
elif sys.version_info < (3, 8):
|
||||
def escape(s: str, quote: Optional[bool] = ...) -> str: ...
|
||||
|
||||
@@ -35,11 +44,9 @@ class MiniFieldStorage:
|
||||
headers: Dict[Any, Any]
|
||||
name: Any
|
||||
value: Any
|
||||
|
||||
def __init__(self, name: Any, value: Any) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
|
||||
|
||||
class FieldStorage(object):
|
||||
FieldStorageClass: Optional[type]
|
||||
keep_blank_values: int
|
||||
@@ -65,17 +72,42 @@ class FieldStorage(object):
|
||||
value: Union[None, bytes, List[Any]]
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
def __init__(self, fp: Optional[IO[Any]] = ..., headers: Optional[Mapping[str, str]] = ..., outerboundary: bytes = ...,
|
||||
environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...,
|
||||
limit: Optional[int] = ..., encoding: str = ..., errors: str = ..., max_num_fields: Optional[int] = ...) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
fp: Optional[IO[Any]] = ...,
|
||||
headers: Optional[Mapping[str, str]] = ...,
|
||||
outerboundary: bytes = ...,
|
||||
environ: Mapping[str, str] = ...,
|
||||
keep_blank_values: int = ...,
|
||||
strict_parsing: int = ...,
|
||||
limit: Optional[int] = ...,
|
||||
encoding: str = ...,
|
||||
errors: str = ...,
|
||||
max_num_fields: Optional[int] = ...,
|
||||
) -> None: ...
|
||||
elif sys.version_info >= (3, 0):
|
||||
def __init__(self, fp: Optional[IO[Any]] = ..., headers: Optional[Mapping[str, str]] = ..., outerboundary: bytes = ...,
|
||||
environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...,
|
||||
limit: Optional[int] = ..., encoding: str = ..., errors: str = ...) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
fp: Optional[IO[Any]] = ...,
|
||||
headers: Optional[Mapping[str, str]] = ...,
|
||||
outerboundary: bytes = ...,
|
||||
environ: Mapping[str, str] = ...,
|
||||
keep_blank_values: int = ...,
|
||||
strict_parsing: int = ...,
|
||||
limit: Optional[int] = ...,
|
||||
encoding: str = ...,
|
||||
errors: str = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, fp: IO[Any] = ..., headers: Mapping[str, str] = ..., outerboundary: bytes = ...,
|
||||
environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...) -> None: ...
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
fp: IO[Any] = ...,
|
||||
headers: Mapping[str, str] = ...,
|
||||
outerboundary: bytes = ...,
|
||||
environ: Mapping[str, str] = ...,
|
||||
keep_blank_values: int = ...,
|
||||
strict_parsing: int = ...,
|
||||
) -> None: ...
|
||||
if sys.version_info >= (3, 0):
|
||||
def __enter__(self: _T) -> _T: ...
|
||||
def __exit__(self, *args: Any) -> None: ...
|
||||
@@ -101,19 +133,14 @@ class FieldStorage(object):
|
||||
# In Python 2 it always returns bytes and ignores the "binary" flag
|
||||
def make_file(self, binary: Any = ...) -> IO[bytes]: ...
|
||||
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
from UserDict import UserDict
|
||||
|
||||
class FormContentDict(UserDict[str, List[str]]):
|
||||
query_string: str
|
||||
def __init__(self, environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...) -> None: ...
|
||||
|
||||
class SvFormContentDict(FormContentDict):
|
||||
def getlist(self, key: Any) -> Any: ...
|
||||
|
||||
class InterpFormContentDict(SvFormContentDict): ...
|
||||
|
||||
class FormContent(FormContentDict):
|
||||
# TODO this should have
|
||||
# def values(self, key: Any) -> Any: ...
|
||||
|
||||
Reference in New Issue
Block a user