omlish 0.0.0.dev289__py3-none-any.whl → 0.0.0.dev291__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- omlish/__about__.py +3 -3
- omlish/dispatch/methods.py +22 -3
- omlish/http/urllib.py +23 -0
- {omlish-0.0.0.dev289.dist-info → omlish-0.0.0.dev291.dist-info}/METADATA +3 -3
- {omlish-0.0.0.dev289.dist-info → omlish-0.0.0.dev291.dist-info}/RECORD +9 -8
- {omlish-0.0.0.dev289.dist-info → omlish-0.0.0.dev291.dist-info}/WHEEL +1 -1
- {omlish-0.0.0.dev289.dist-info → omlish-0.0.0.dev291.dist-info}/entry_points.txt +0 -0
- {omlish-0.0.0.dev289.dist-info → omlish-0.0.0.dev291.dist-info}/licenses/LICENSE +0 -0
- {omlish-0.0.0.dev289.dist-info → omlish-0.0.0.dev291.dist-info}/top_level.txt +0 -0
omlish/__about__.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
__version__ = '0.0.0.
|
2
|
-
__revision__ = '
|
1
|
+
__version__ = '0.0.0.dev291'
|
2
|
+
__revision__ = '8d0ee885f143f757a01fdd52c57e6c1d2736d375'
|
3
3
|
|
4
4
|
|
5
5
|
#
|
@@ -37,7 +37,7 @@ class Project(ProjectBase):
|
|
37
37
|
|
38
38
|
'greenlet ~= 3.2',
|
39
39
|
|
40
|
-
'trio ~= 0.
|
40
|
+
'trio ~= 0.30',
|
41
41
|
'trio-asyncio ~= 0.15',
|
42
42
|
],
|
43
43
|
|
omlish/dispatch/methods.py
CHANGED
@@ -16,12 +16,14 @@ from .impls import get_impl_func_cls_set
|
|
16
16
|
|
17
17
|
|
18
18
|
T = ta.TypeVar('T')
|
19
|
+
R = ta.TypeVar('R')
|
20
|
+
P = ta.ParamSpec('P')
|
19
21
|
|
20
22
|
|
21
23
|
##
|
22
24
|
|
23
25
|
|
24
|
-
class Method:
|
26
|
+
class Method(ta.Generic[P, R]):
|
25
27
|
def __init__(
|
26
28
|
self,
|
27
29
|
func: ta.Callable,
|
@@ -170,13 +172,27 @@ class Method:
|
|
170
172
|
func = self.get_dispatch_func(instance_cls)
|
171
173
|
return func.__get__(instance, owner) # noqa
|
172
174
|
|
173
|
-
def __call__(self,
|
175
|
+
def __call__(self, *args: P.args, **kwargs: P.kwargs) -> R:
|
176
|
+
instance, *rest = args
|
174
177
|
instance_cls = type(instance)
|
175
178
|
try:
|
176
179
|
func = self._dispatch_func_cache[weakref.ref(instance_cls)]
|
177
180
|
except KeyError:
|
178
181
|
func = self.get_dispatch_func(instance_cls)
|
179
|
-
return func.__get__(instance)(*
|
182
|
+
return func.__get__(instance)(*rest, **kwargs) # noqa
|
183
|
+
|
184
|
+
|
185
|
+
##
|
186
|
+
|
187
|
+
|
188
|
+
@ta.overload
|
189
|
+
def method(func: ta.Callable[P, R], /, *, installable: bool = False) -> Method[P, R]: # noqa
|
190
|
+
...
|
191
|
+
|
192
|
+
|
193
|
+
@ta.overload
|
194
|
+
def method(func: None = None, /, *, installable: bool = False) -> ta.Callable[[ta.Callable[P, R]], Method[P, R]]: # noqa
|
195
|
+
...
|
180
196
|
|
181
197
|
|
182
198
|
def method(func=None, /, *, installable=False): # noqa
|
@@ -186,6 +202,9 @@ def method(func=None, /, *, installable=False): # noqa
|
|
186
202
|
return Method(func, **kw)
|
187
203
|
|
188
204
|
|
205
|
+
#
|
206
|
+
|
207
|
+
|
189
208
|
def install_method(
|
190
209
|
mth: ta.Any,
|
191
210
|
*,
|
omlish/http/urllib.py
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# @omlish-lite
|
2
|
+
import urllib.request
|
3
|
+
|
4
|
+
|
5
|
+
##
|
6
|
+
|
7
|
+
|
8
|
+
class NonRaisingUrllibErrorProcessor(urllib.request.HTTPErrorProcessor):
|
9
|
+
"""
|
10
|
+
https://stackoverflow.com/a/74844056
|
11
|
+
|
12
|
+
Usage:
|
13
|
+
|
14
|
+
opener = urllib.request.build_opener(NonRaisingUrllibErrorProcessor)
|
15
|
+
with opener.open(req) as resp:
|
16
|
+
...
|
17
|
+
"""
|
18
|
+
|
19
|
+
def http_response(self, request, response):
|
20
|
+
return response
|
21
|
+
|
22
|
+
def https_response(self, request, response):
|
23
|
+
return response
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: omlish
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev291
|
4
4
|
Summary: omlish
|
5
5
|
Author: wrmsr
|
6
6
|
License: BSD-3-Clause
|
@@ -16,7 +16,7 @@ Provides-Extra: all
|
|
16
16
|
Requires-Dist: anyio~=4.9; extra == "all"
|
17
17
|
Requires-Dist: sniffio~=1.3; extra == "all"
|
18
18
|
Requires-Dist: greenlet~=3.2; extra == "all"
|
19
|
-
Requires-Dist: trio~=0.
|
19
|
+
Requires-Dist: trio~=0.30; extra == "all"
|
20
20
|
Requires-Dist: trio-asyncio~=0.15; extra == "all"
|
21
21
|
Requires-Dist: lz4~=4.4; extra == "all"
|
22
22
|
Requires-Dist: python-snappy~=0.7; extra == "all"
|
@@ -55,7 +55,7 @@ Provides-Extra: async
|
|
55
55
|
Requires-Dist: anyio~=4.9; extra == "async"
|
56
56
|
Requires-Dist: sniffio~=1.3; extra == "async"
|
57
57
|
Requires-Dist: greenlet~=3.2; extra == "async"
|
58
|
-
Requires-Dist: trio~=0.
|
58
|
+
Requires-Dist: trio~=0.30; extra == "async"
|
59
59
|
Requires-Dist: trio-asyncio~=0.15; extra == "async"
|
60
60
|
Provides-Extra: compress
|
61
61
|
Requires-Dist: lz4~=4.4; extra == "compress"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
omlish/.manifests.json,sha256=pjGUyLHaoWpPqRP3jz2u1fC1qoRc2lvrEcpU_Ax2tdg,8253
|
2
|
-
omlish/__about__.py,sha256=
|
2
|
+
omlish/__about__.py,sha256=SFKaqgp4IDkB6oP2KqiAFc91BqMnf7A8BP4ZH_asPV8,3444
|
3
3
|
omlish/__init__.py,sha256=SsyiITTuK0v74XpKV8dqNaCmjOlan1JZKrHQv5rWKPA,253
|
4
4
|
omlish/c3.py,sha256=rer-TPOFDU6fYq_AWio_AmA-ckZ8JDY5shIzQ_yXfzA,8414
|
5
5
|
omlish/cached.py,sha256=MLap_p0rdGoDIMVhXVHm1tsbcWobJF0OanoodV03Ju8,542
|
@@ -292,7 +292,7 @@ omlish/dispatch/_dispatch3.py,sha256=9Zjd7bINAC3keiaBdssc4v5dY0-8OI6XooV2DR9U7Z0
|
|
292
292
|
omlish/dispatch/dispatch.py,sha256=KA5l49AiGLRjp4J7RDJW9RiDp9WUD1ewR1AOPEF8g38,3062
|
293
293
|
omlish/dispatch/functions.py,sha256=cwNzGIg2ZIalEgn9I03cnJVbMTHjWloyDTaowlO3UPs,1524
|
294
294
|
omlish/dispatch/impls.py,sha256=K_okKvpZml4NkTHJmTVyMQSrIaIJcqTEgkreGwukaOw,1895
|
295
|
-
omlish/dispatch/methods.py,sha256=
|
295
|
+
omlish/dispatch/methods.py,sha256=CeGVwiUdeadzyOe0xQVY_jegyj0tdHLQZpaIlLkJNnY,7330
|
296
296
|
omlish/docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
297
297
|
omlish/docker/all.py,sha256=xXRgJgLGPwAtr7bDMJ_Dp9jTfOwfGvohNhc6LsoELJc,514
|
298
298
|
omlish/docker/cli.py,sha256=gtb9kitVfGnd4cr587NsVVk8D5Ok5y5SAsqD_SwGrSA,2565
|
@@ -383,6 +383,7 @@ omlish/http/multipart.py,sha256=R9ycpHsXRcmh0uoc43aYb7BdWL-8kSQHe7J-M81aQZM,2240
|
|
383
383
|
omlish/http/parsing.py,sha256=Kz1n-2SwqSbRtPk1nlImf655c2YtGLW4WlTI82o3c1w,14356
|
384
384
|
omlish/http/sessions.py,sha256=TfTJ_j-6c9PelG_RmijEwozfaVm3O7YzgtFvp8VzQqM,4799
|
385
385
|
omlish/http/sse.py,sha256=NwJnQj-hFXAkadXKhUuHSnbXHwDVJjhzfdkkHQ-prQo,2320
|
386
|
+
omlish/http/urllib.py,sha256=LwtMXDkjb9tYnOi6iApizHXpCiyjB1r72ePo_Nzv1vQ,466
|
386
387
|
omlish/http/versions.py,sha256=wSiOXPiClVjkVgSU_VmxkoD1SUYGaoPbP0U5Aw-Ufg8,409
|
387
388
|
omlish/http/wsgi.py,sha256=1JpfrY2JrQ0wrEVE0oLdQMWZw8Zcx0b4_9f3VmH4JKA,1070
|
388
389
|
omlish/http/clients/__init__.py,sha256=SeH3ofjQvk7VuV9OE1uJir9QMZwvEuDl7fptkKgGQUU,449
|
@@ -830,9 +831,9 @@ omlish/typedvalues/holder.py,sha256=4SwRezsmuDDEO5gENGx8kTm30pblF5UktoEAu02i-Gk,
|
|
830
831
|
omlish/typedvalues/marshal.py,sha256=Rr-4DZ90BoD5Z9gT18QhZH2yMA3-gPJBK8GUrGkp8VA,4245
|
831
832
|
omlish/typedvalues/reflect.py,sha256=y_7IY8_4cLVRvD3ug-_-cDaO5RtzC1rLVFzkeAPALf8,683
|
832
833
|
omlish/typedvalues/values.py,sha256=Q_5IiQM3Vka4wGVd-scaslb4-oCMjFcIOksIrKE-JIM,1229
|
833
|
-
omlish-0.0.0.
|
834
|
-
omlish-0.0.0.
|
835
|
-
omlish-0.0.0.
|
836
|
-
omlish-0.0.0.
|
837
|
-
omlish-0.0.0.
|
838
|
-
omlish-0.0.0.
|
834
|
+
omlish-0.0.0.dev291.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
835
|
+
omlish-0.0.0.dev291.dist-info/METADATA,sha256=tzdVbypnyyv__ufhPd-jD_Z2x6cwVBxeKlHGnnapJRs,4316
|
836
|
+
omlish-0.0.0.dev291.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
|
837
|
+
omlish-0.0.0.dev291.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
|
838
|
+
omlish-0.0.0.dev291.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
|
839
|
+
omlish-0.0.0.dev291.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|