mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-25 02:57:14 +08:00
add (overwrite with) mypy stubs, if available
This commit is contained in:
0
stdlib/3/http/__init__.pyi
Normal file
0
stdlib/3/http/__init__.pyi
Normal file
101
stdlib/3/http/client.pyi
Normal file
101
stdlib/3/http/client.pyi
Normal file
@@ -0,0 +1,101 @@
|
||||
# Stubs for http.client (Python 3.4)
|
||||
|
||||
from typing import Any, Dict
|
||||
import email.message
|
||||
import io
|
||||
|
||||
responses = ... # type: Dict[int, str]
|
||||
|
||||
class HTTPMessage(email.message.Message):
|
||||
def getallmatchingheaders(self, name): ...
|
||||
|
||||
class HTTPResponse(io.RawIOBase):
|
||||
fp = ... # type: Any
|
||||
debuglevel = ... # type: Any
|
||||
headers = ... # type: Any
|
||||
version = ... # type: Any
|
||||
status = ... # type: Any
|
||||
reason = ... # type: Any
|
||||
chunked = ... # type: Any
|
||||
chunk_left = ... # type: Any
|
||||
length = ... # type: Any
|
||||
will_close = ... # type: Any
|
||||
def __init__(self, sock, debuglevel=0, method=None, url=None): ...
|
||||
code = ... # type: Any
|
||||
def begin(self): ...
|
||||
def close(self): ...
|
||||
def flush(self): ...
|
||||
def readable(self): ...
|
||||
def isclosed(self): ...
|
||||
def read(self, amt=None): ...
|
||||
def readinto(self, b): ...
|
||||
def fileno(self): ...
|
||||
def getheader(self, name, default=None): ...
|
||||
def getheaders(self): ...
|
||||
def __iter__(self): ...
|
||||
def info(self): ...
|
||||
def geturl(self): ...
|
||||
def getcode(self): ...
|
||||
|
||||
class HTTPConnection:
|
||||
response_class = ... # type: Any
|
||||
default_port = ... # type: Any
|
||||
auto_open = ... # type: Any
|
||||
debuglevel = ... # type: Any
|
||||
mss = ... # type: Any
|
||||
timeout = ... # type: Any
|
||||
source_address = ... # type: Any
|
||||
sock = ... # type: Any
|
||||
def __init__(self, host, port=None, timeout=..., source_address=None): ...
|
||||
def set_tunnel(self, host, port=None, headers=None): ...
|
||||
def set_debuglevel(self, level): ...
|
||||
def connect(self): ...
|
||||
def close(self): ...
|
||||
def send(self, data): ...
|
||||
def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0): ...
|
||||
def putheader(self, header, *values): ...
|
||||
def endheaders(self, message_body=None): ...
|
||||
def request(self, method, url, body=None, headers=...): ...
|
||||
def getresponse(self): ...
|
||||
|
||||
class HTTPSConnection(HTTPConnection):
|
||||
default_port = ... # type: Any
|
||||
key_file = ... # type: Any
|
||||
cert_file = ... # type: Any
|
||||
def __init__(self, host, port=None, key_file=None, cert_file=None, timeout=...,
|
||||
source_address=None, *, context=None, check_hostname=None): ...
|
||||
sock = ... # type: Any
|
||||
def connect(self): ...
|
||||
|
||||
class HTTPException(Exception): ...
|
||||
class NotConnected(HTTPException): ...
|
||||
class InvalidURL(HTTPException): ...
|
||||
|
||||
class UnknownProtocol(HTTPException):
|
||||
args = ... # type: Any
|
||||
version = ... # type: Any
|
||||
def __init__(self, version): ...
|
||||
|
||||
class UnknownTransferEncoding(HTTPException): ...
|
||||
class UnimplementedFileMode(HTTPException): ...
|
||||
|
||||
class IncompleteRead(HTTPException):
|
||||
args = ... # type: Any
|
||||
partial = ... # type: Any
|
||||
expected = ... # type: Any
|
||||
def __init__(self, partial, expected=None): ...
|
||||
|
||||
class ImproperConnectionState(HTTPException): ...
|
||||
class CannotSendRequest(ImproperConnectionState): ...
|
||||
class CannotSendHeader(ImproperConnectionState): ...
|
||||
class ResponseNotReady(ImproperConnectionState): ...
|
||||
|
||||
class BadStatusLine(HTTPException):
|
||||
args = ... # type: Any
|
||||
line = ... # type: Any
|
||||
def __init__(self, line): ...
|
||||
|
||||
class LineTooLong(HTTPException):
|
||||
def __init__(self, line_type): ...
|
||||
|
||||
error = HTTPException
|
||||
121
stdlib/3/http/cookiejar.pyi
Normal file
121
stdlib/3/http/cookiejar.pyi
Normal file
@@ -0,0 +1,121 @@
|
||||
# Stubs for http.cookiejar (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
|
||||
class Cookie:
|
||||
version = ... # type: Any
|
||||
name = ... # type: Any
|
||||
value = ... # type: Any
|
||||
port = ... # type: Any
|
||||
port_specified = ... # type: Any
|
||||
domain = ... # type: Any
|
||||
domain_specified = ... # type: Any
|
||||
domain_initial_dot = ... # type: Any
|
||||
path = ... # type: Any
|
||||
path_specified = ... # type: Any
|
||||
secure = ... # type: Any
|
||||
expires = ... # type: Any
|
||||
discard = ... # type: Any
|
||||
comment = ... # type: Any
|
||||
comment_url = ... # type: Any
|
||||
rfc2109 = ... # type: Any
|
||||
def __init__(self, version, name, value, port, port_specified, domain, domain_specified,
|
||||
domain_initial_dot, path, path_specified, secure, expires, discard, comment,
|
||||
comment_url, rest, rfc2109=False): ...
|
||||
def has_nonstandard_attr(self, name): ...
|
||||
def get_nonstandard_attr(self, name, default=None): ...
|
||||
def set_nonstandard_attr(self, name, value): ...
|
||||
def is_expired(self, now=None): ...
|
||||
|
||||
class CookiePolicy:
|
||||
def set_ok(self, cookie, request): ...
|
||||
def return_ok(self, cookie, request): ...
|
||||
def domain_return_ok(self, domain, request): ...
|
||||
def path_return_ok(self, path, request): ...
|
||||
|
||||
class DefaultCookiePolicy(CookiePolicy):
|
||||
DomainStrictNoDots = ... # type: Any
|
||||
DomainStrictNonDomain = ... # type: Any
|
||||
DomainRFC2965Match = ... # type: Any
|
||||
DomainLiberal = ... # type: Any
|
||||
DomainStrict = ... # type: Any
|
||||
netscape = ... # type: Any
|
||||
rfc2965 = ... # type: Any
|
||||
rfc2109_as_netscape = ... # type: Any
|
||||
hide_cookie2 = ... # type: Any
|
||||
strict_domain = ... # type: Any
|
||||
strict_rfc2965_unverifiable = ... # type: Any
|
||||
strict_ns_unverifiable = ... # type: Any
|
||||
strict_ns_domain = ... # type: Any
|
||||
strict_ns_set_initial_dollar = ... # type: Any
|
||||
strict_ns_set_path = ... # type: Any
|
||||
def __init__(self, blocked_domains=None, allowed_domains=None, netscape=True, rfc2965=False,
|
||||
rfc2109_as_netscape=None, hide_cookie2=False, strict_domain=False,
|
||||
strict_rfc2965_unverifiable=True, strict_ns_unverifiable=False,
|
||||
strict_ns_domain=..., strict_ns_set_initial_dollar=False,
|
||||
strict_ns_set_path=False): ...
|
||||
def blocked_domains(self): ...
|
||||
def set_blocked_domains(self, blocked_domains): ...
|
||||
def is_blocked(self, domain): ...
|
||||
def allowed_domains(self): ...
|
||||
def set_allowed_domains(self, allowed_domains): ...
|
||||
def is_not_allowed(self, domain): ...
|
||||
def set_ok(self, cookie, request): ...
|
||||
def set_ok_version(self, cookie, request): ...
|
||||
def set_ok_verifiability(self, cookie, request): ...
|
||||
def set_ok_name(self, cookie, request): ...
|
||||
def set_ok_path(self, cookie, request): ...
|
||||
def set_ok_domain(self, cookie, request): ...
|
||||
def set_ok_port(self, cookie, request): ...
|
||||
def return_ok(self, cookie, request): ...
|
||||
def return_ok_version(self, cookie, request): ...
|
||||
def return_ok_verifiability(self, cookie, request): ...
|
||||
def return_ok_secure(self, cookie, request): ...
|
||||
def return_ok_expires(self, cookie, request): ...
|
||||
def return_ok_port(self, cookie, request): ...
|
||||
def return_ok_domain(self, cookie, request): ...
|
||||
def domain_return_ok(self, domain, request): ...
|
||||
def path_return_ok(self, path, request): ...
|
||||
|
||||
class Absent: ...
|
||||
|
||||
class CookieJar:
|
||||
non_word_re = ... # type: Any
|
||||
quote_re = ... # type: Any
|
||||
strict_domain_re = ... # type: Any
|
||||
domain_re = ... # type: Any
|
||||
dots_re = ... # type: Any
|
||||
magic_re = ... # type: Any
|
||||
def __init__(self, policy=None): ...
|
||||
def set_policy(self, policy): ...
|
||||
def add_cookie_header(self, request): ...
|
||||
def make_cookies(self, response, request): ...
|
||||
def set_cookie_if_ok(self, cookie, request): ...
|
||||
def set_cookie(self, cookie): ...
|
||||
def extract_cookies(self, response, request): ...
|
||||
def clear(self, domain=None, path=None, name=None): ...
|
||||
def clear_session_cookies(self): ...
|
||||
def clear_expired_cookies(self): ...
|
||||
def __iter__(self): ...
|
||||
def __len__(self): ...
|
||||
|
||||
class LoadError(OSError): ...
|
||||
|
||||
class FileCookieJar(CookieJar):
|
||||
filename = ... # type: Any
|
||||
delayload = ... # type: Any
|
||||
def __init__(self, filename=None, delayload=False, policy=None): ...
|
||||
def save(self, filename=None, ignore_discard=False, ignore_expires=False): ...
|
||||
def load(self, filename=None, ignore_discard=False, ignore_expires=False): ...
|
||||
def revert(self, filename=None, ignore_discard=False, ignore_expires=False): ...
|
||||
|
||||
class LWPCookieJar(FileCookieJar):
|
||||
def as_lwp_str(self, ignore_discard=True, ignore_expires=True): ...
|
||||
def save(self, filename=None, ignore_discard=False, ignore_expires=False): ...
|
||||
|
||||
class MozillaCookieJar(FileCookieJar):
|
||||
magic_re = ... # type: Any
|
||||
header = ... # type: Any
|
||||
def save(self, filename=None, ignore_discard=False, ignore_expires=False): ...
|
||||
Reference in New Issue
Block a user