Skip to content

Commit 40f0358

Browse files
author
Roy Williams
committed
Fix autogenerated stubs
1 parent 89677cb commit 40f0358

30 files changed

+109
-79
lines changed

third_party/2.7/werkzeug/__init__.pyi

+20-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@
44

55
from types import ModuleType
66

7+
from typing import Any
8+
9+
from werkzeug import _internal
10+
from werkzeug import datastructures
11+
from werkzeug import debug
12+
from werkzeug import exceptions
13+
from werkzeug import formparser
14+
from werkzeug import http
15+
from werkzeug import local
16+
from werkzeug import security
17+
from werkzeug import serving
18+
from werkzeug import test
19+
from werkzeug import testapp
20+
from werkzeug import urls
21+
from werkzeug import useragents
22+
from werkzeug import utils
23+
from werkzeug import wsgi
724

825
class module(ModuleType):
926
def __getattr__(self, name): ...
@@ -47,8 +64,8 @@ append_slash_redirect = utils.append_slash_redirect
4764
redirect = utils.redirect
4865
cached_property = utils.cached_property
4966
import_string = utils.import_string
50-
dump_cookie = utils.dump_cookie
51-
parse_cookie = utils.parse_cookie
67+
dump_cookie = http.dump_cookie
68+
parse_cookie = http.parse_cookie
5269
unescape = utils.unescape
5370
format_string = utils.format_string
5471
find_modules = utils.find_modules
@@ -133,5 +150,5 @@ Href = urls.Href
133150
iri_to_uri = urls.iri_to_uri
134151
uri_to_iri = urls.uri_to_iri
135152
parse_form_data = formparser.parse_form_data
136-
abort = exceptions.abort
153+
abort = exceptions.Aborter
137154
Aborter = exceptions.Aborter

third_party/2.7/werkzeug/_compat.pyi

+1-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# NOTE: This dynamically typed stub was automatically generated by stubgen.
44

55
from typing import Any
6-
from cStringIO import StringIO as BytesIO
6+
import StringIO as BytesIO
77

88
PY2 = ... # type: Any
99
WIN = ... # type: Any
@@ -40,14 +40,8 @@ def to_bytes(x, charset=..., errors=''): ...
4040
def to_native(x, charset=..., errors=''): ...
4141
def reraise(tp, value, tb=None): ...
4242

43-
fix_tuple_repr = ... # type: Any
44-
implements_iterator = ... # type: Any
45-
implements_to_string = ... # type: Any
46-
implements_bool = ... # type: Any
47-
native_string_result = ... # type: Any
4843
imap = ... # type: Any
4944
izip = ... # type: Any
5045
ifilter = ... # type: Any
51-
try_coerce_native = ... # type: Any
5246

5347
def to_unicode(x, charset=..., errors='', allow_none_charset=False): ...

third_party/2.7/werkzeug/_internal.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ class _DictAccessorProperty:
1818
def __get__(self, obj, type=None): ...
1919
def __set__(self, obj, value): ...
2020
def __delete__(self, obj): ...
21+
22+
def _easteregg(app=None): ...

third_party/2.7/werkzeug/contrib/testtools.pyi

-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ from werkzeug.wrappers import Response
77

88
class ContentAccessors:
99
def xml(self): ...
10-
xml = ... # type: Any
1110
def lxml(self): ...
12-
lxml = ... # type: Any
1311
def json(self): ...
14-
json = ... # type: Any
1512

1613
class TestResponse(Response, ContentAccessors): ...

third_party/2.7/werkzeug/datastructures.pyi

+15-9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# NOTE: This dynamically typed stub was automatically generated by stubgen.
44

55
from typing import Any
6+
from collections import Container, Iterable, Mapping, MutableSet
67

78
def is_immutable(self): ...
89
def iter_multi_items(mapping): ...
@@ -29,7 +30,7 @@ class ImmutableList(ImmutableListMixin, list): ...
2930

3031
class ImmutableDictMixin:
3132
@classmethod
32-
def fromkeys(cls, keys, value=None): ...
33+
def fromkeys(cls, *args, **kwargs): ...
3334
def __reduce_ex__(self, protocol): ...
3435
def __hash__(self): ...
3536
def setdefault(self, key, default=None): ...
@@ -66,6 +67,10 @@ class ImmutableTypeConversionDict(ImmutableDictMixin, TypeConversionDict):
6667
def copy(self): ...
6768
def __copy__(self): ...
6869

70+
class ViewItems:
71+
def __init__(self, multi_dict, method, repr_name, *a, **kw): ...
72+
def __iter__(self): ...
73+
6974
class MultiDict(TypeConversionDict):
7075
def __init__(self, mapping=None): ...
7176
def __getitem__(self, key): ...
@@ -124,7 +129,7 @@ class OrderedMultiDict(MultiDict):
124129
def popitem(self): ...
125130
def popitemlist(self): ...
126131

127-
class Headers:
132+
class Headers(Mapping):
128133
def __init__(self, defaults=None): ...
129134
def __getitem__(self, key, _get_mode=False): ...
130135
def __eq__(self, other): ...
@@ -138,7 +143,7 @@ class Headers:
138143
def extend(self, iterable): ...
139144
def __delitem__(self, key, _index_operation=True): ...
140145
def remove(self, key): ...
141-
def pop(self, key=None, default=...): ...
146+
def pop(self, **kwargs): ...
142147
def popitem(self): ...
143148
def __contains__(self, key): ...
144149
has_key = ... # type: Any
@@ -156,15 +161,15 @@ class Headers:
156161
def __copy__(self): ...
157162

158163
class ImmutableHeadersMixin:
159-
def __delitem__(self, key): ...
164+
def __delitem__(self, key, **kwargs): ...
160165
def __setitem__(self, key, value): ...
161166
set = ... # type: Any
162-
def add(self, item): ...
167+
def add(self, *args, **kwargs): ...
163168
remove = ... # type: Any
164169
add_header = ... # type: Any
165170
def extend(self, iterable): ...
166171
def insert(self, pos, value): ...
167-
def pop(self, index=-1): ...
172+
def pop(self, **kwargs): ...
168173
def popitem(self): ...
169174
def setdefault(self, key, default): ...
170175

@@ -267,7 +272,7 @@ class CallbackDict(UpdateDictMixin, dict):
267272
on_update = ... # type: Any
268273
def __init__(self, initial=None, on_update=None): ...
269274

270-
class HeaderSet:
275+
class HeaderSet(MutableSet):
271276
on_update = ... # type: Any
272277
def __init__(self, headers=None, on_update=None): ...
273278
def add(self, header): ...
@@ -287,7 +292,7 @@ class HeaderSet:
287292
def __iter__(self): ...
288293
def __nonzero__(self): ...
289294

290-
class ETags:
295+
class ETags(Container, Iterable):
291296
star_tag = ... # type: Any
292297
def __init__(self, strong_etags=None, weak_etags=None, star_tag=False): ...
293298
def as_set(self, include_weak=False): ...
@@ -315,6 +320,7 @@ class Range:
315320
def range_for_length(self, length): ...
316321
def make_content_range(self, length): ...
317322
def to_header(self): ...
323+
def to_content_range_header(self, length): ...
318324

319325
class ContentRange:
320326
on_update = ... # type: Any
@@ -350,6 +356,7 @@ class WWWAuthenticate(UpdateDictMixin, dict):
350356
def set_basic(self, realm=''): ...
351357
def set_digest(self, realm, nonce, qop=..., opaque=None, algorithm=None, stale=False): ...
352358
def to_header(self): ...
359+
@staticmethod
353360
def auth_property(name, doc=None): ...
354361
type = ... # type: Any
355362
realm = ... # type: Any
@@ -359,7 +366,6 @@ class WWWAuthenticate(UpdateDictMixin, dict):
359366
algorithm = ... # type: Any
360367
qop = ... # type: Any
361368
stale = ... # type: Any
362-
auth_property = ... # type: Any
363369

364370
class FileStorage:
365371
name = ... # type: Any

third_party/2.7/werkzeug/debug/console.pyi

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ class HTMLStringO:
1717
def writelines(self, x): ...
1818

1919
class ThreadedStream:
20+
@staticmethod
2021
def push(): ...
21-
push = ... # type: Any
22+
@staticmethod
2223
def fetch(): ...
23-
fetch = ... # type: Any
24+
@staticmethod
2425
def displayhook(obj): ...
25-
displayhook = ... # type: Any
2626
def __setattr__(self, name, value): ...
2727
def __dir__(self): ...
2828
def __getattribute__(self, name): ...

third_party/2.7/werkzeug/debug/tbtools.pyi

-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class Line:
2424
current = ... # type: Any
2525
def __init__(self, lineno, code): ...
2626
def classes(self): ...
27-
classes = ... # type: Any
2827
def render(self): ...
2928

3029
class Traceback:
@@ -35,16 +34,13 @@ class Traceback:
3534
def __init__(self, exc_type, exc_value, tb): ...
3635
def filter_hidden_frames(self): ...
3736
def is_syntax_error(self): ...
38-
is_syntax_error = ... # type: Any
3937
def exception(self): ...
40-
exception = ... # type: Any
4138
def log(self, logfile=None): ...
4239
def paste(self): ...
4340
def render_summary(self, include_title=True): ...
4441
def render_full(self, evalex=False, secret=None, evalex_trusted=True): ...
4542
def generate_plaintext_traceback(self): ...
4643
def plaintext(self): ...
47-
plaintext = ... # type: Any
4844
id = ... # type: Any
4945

5046
class Frame:

third_party/2.7/werkzeug/http.pyi

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from typing import Any
66
from urllib2 import parse_http_list as _parse_list_header
7-
from urllib.request import parse_http_list as _parse_list_header
87

98
HTTP_STATUS_CODES = ... # type: Any
109

third_party/2.7/werkzeug/local.pyi

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# NOTE: This dynamically typed stub was automatically generated by stubgen.
44

55
from typing import Any
6-
from greenlet import getcurrent as get_ident
76

87
def release_local(local): ...
98

third_party/2.7/werkzeug/posixemulation.pyi

-2
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,3 @@ from .filesystem import get_filesystem_encoding as get_filesystem_encoding
99
can_rename_open_file = ... # type: Any
1010

1111
def rename(src, dst): ...
12-
13-
rename = ... # type: Any

third_party/2.7/werkzeug/serving.pyi

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ from typing import Any
66
from ._compat import PY2 as PY2
77
from SocketServer import ThreadingMixIn, ForkingMixIn
88
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
9-
from socketserver import ThreadingMixIn, ForkingMixIn
10-
from http.server import HTTPServer, BaseHTTPRequestHandler
119

1210
class _SslDummy:
1311
def __getattr__(self, name): ...

third_party/2.7/werkzeug/test.pyi

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
from typing import Any
66
from urllib2 import Request as U2Request
7-
from urllib.request import Request as U2Request
8-
from http.cookiejar import CookieJar
97
from cookielib import CookieJar
108

119
def stream_encode_multipart(values, use_tempfile=True, threshold=..., boundary=None, charset=''): ...

third_party/2.7/werkzeug/urls.pyi

+6
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22
#
33
# NOTE: This dynamically typed stub was automatically generated by stubgen.
44

5+
from collections import namedtuple
56
from typing import Any
67

8+
_URLTuple = namedtuple(
9+
'_URLTuple',
10+
['scheme', 'netloc', 'path', 'query', 'fragment']
11+
)
12+
713
class BaseURL(_URLTuple):
814
def replace(self, **kwargs): ...
915
@property

third_party/2.7/werkzeug/wrappers.pyi

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class BaseResponse:
8585
def calculate_content_length(self): ...
8686
def make_sequence(self): ...
8787
def iter_encoded(self): ...
88-
def set_cookie(self, key, value='', max_age=None, expires=None, path='', domain=None, secure=None, httponly=False): ...
88+
def set_cookie(self, key, value='', max_age=None, expires=None, path='', domain=None, secure=False, httponly=False): ...
8989
def delete_cookie(self, key, path='', domain=None): ...
9090
@property
9191
def is_streamed(self): ...
@@ -94,7 +94,7 @@ class BaseResponse:
9494
def close(self): ...
9595
def __enter__(self): ...
9696
def __exit__(self, exc_type, exc_value, tb): ...
97-
def freeze(self): ...
97+
def freeze(self, **kwargs): ...
9898
def get_wsgi_headers(self, environ): ...
9999
def get_app_iter(self, environ): ...
100100
def get_wsgi_response(self, environ): ...
@@ -129,7 +129,7 @@ class ETagResponseMixin:
129129
@property
130130
def cache_control(self): ...
131131
status_code = ... # type: Any
132-
def make_conditional(self, request_or_environ): ...
132+
def make_conditional(self, request_or_environ, accept_ranges=False, complete_length=None): ...
133133
def add_etag(self, overwrite=False, weak=False): ...
134134
def set_etag(self, etag, weak=False): ...
135135
def get_etag(self): ...

third_party/2.7/werkzeug/wsgi.pyi

+18-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class SharedDataMiddleware:
2222
exports = ... # type: Any
2323
cache = ... # type: Any
2424
cache_timeout = ... # type: Any
25-
is_allowed = ... # type: Any
2625
fallback_mimetype = ... # type: Any
2726
def __init__(self, app, exports, disallow=None, cache=True, cache_timeout=..., fallback_mimetype=''): ...
2827
def is_allowed(self, filename): ...
@@ -51,11 +50,27 @@ class FileWrapper:
5150
buffer_size = ... # type: Any
5251
def __init__(self, file, buffer_size=8192): ...
5352
def close(self): ...
53+
def seekable(self): ...
54+
def seek(self, *args): ...
55+
def tell(self): ...
5456
def __iter__(self): ...
5557
def __next__(self): ...
5658

57-
def make_line_iter(stream, limit=None, buffer_size=...): ...
58-
def make_chunk_iter(stream, separator, limit=None, buffer_size=...): ...
59+
class _RangeWrapper:
60+
iterable = ... # type: Any
61+
byte_range = ... # type: Any
62+
start_byte = ... # type: Any
63+
end_byte = ... # type: Any
64+
read_length = ... # type: Any
65+
seekable = ... # type: Any
66+
end_reached = ... # type: Any
67+
def __init__(self, iterable, start_byte=0, byte_range=None): ...
68+
def __iter__(self): ...
69+
def __next__(self): ...
70+
def close(self): ...
71+
72+
def make_line_iter(stream, limit=None, buffer_size=..., cap_at_buffer=False): ...
73+
def make_chunk_iter(stream, separator, limit=None, buffer_size=..., cap_at_buffer=False): ...
5974

6075
class LimitedStream:
6176
limit = ... # type: Any

third_party/3/werkzeug/__init__.pyi

+20-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@
33
# NOTE: This dynamically typed stub was automatically generated by stubgen.
44

55
from types import ModuleType
6+
from typing import Any
7+
8+
from werkzeug import _internal
9+
from werkzeug import datastructures
10+
from werkzeug import debug
11+
from werkzeug import exceptions
12+
from werkzeug import formparser
13+
from werkzeug import http
14+
from werkzeug import local
15+
from werkzeug import security
16+
from werkzeug import serving
17+
from werkzeug import test
18+
from werkzeug import testapp
19+
from werkzeug import urls
20+
from werkzeug import useragents
21+
from werkzeug import utils
22+
from werkzeug import wsgi
623

724
class module(ModuleType):
825
def __getattr__(self, name): ...
@@ -46,8 +63,8 @@ append_slash_redirect = utils.append_slash_redirect
4663
redirect = utils.redirect
4764
cached_property = utils.cached_property
4865
import_string = utils.import_string
49-
dump_cookie = utils.dump_cookie
50-
parse_cookie = utils.parse_cookie
66+
dump_cookie = http.dump_cookie
67+
parse_cookie = http.parse_cookie
5168
unescape = utils.unescape
5269
format_string = utils.format_string
5370
find_modules = utils.find_modules
@@ -132,5 +149,5 @@ Href = urls.Href
132149
iri_to_uri = urls.iri_to_uri
133150
uri_to_iri = urls.uri_to_iri
134151
parse_form_data = formparser.parse_form_data
135-
abort = exceptions.abort
152+
abort = exceptions.Aborter
136153
Aborter = exceptions.Aborter

0 commit comments

Comments
 (0)