omlish 0.0.0.dev280__py3-none-any.whl → 0.0.0.dev282__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 CHANGED
@@ -1,5 +1,5 @@
1
- __version__ = '0.0.0.dev280'
2
- __revision__ = '7ffe9145bdd2895b005e12042a6b5d4437d4e634'
1
+ __version__ = '0.0.0.dev282'
2
+ __revision__ = '7838e4a0dc1a1434797f27f330d5d3efdd410927'
3
3
 
4
4
 
5
5
  #
omlish/http/asgi.py CHANGED
@@ -13,24 +13,24 @@ log = logging.getLogger(__name__)
13
13
  ##
14
14
 
15
15
 
16
- AsgiScope: ta.TypeAlias = ta.Mapping[str, ta.Any]
17
- AsgiMessage: ta.TypeAlias = ta.Mapping[str, ta.Any]
18
- AsgiRecv: ta.TypeAlias = ta.Callable[[], ta.Awaitable[AsgiMessage]]
19
- AsgiSend: ta.TypeAlias = ta.Callable[[AsgiMessage], ta.Awaitable[None]]
20
- AsgiApp: ta.TypeAlias = ta.Callable[[AsgiScope, AsgiRecv, AsgiSend], ta.Awaitable[None]]
21
- AsgiWrapper: ta.TypeAlias = ta.Callable[[AsgiApp, AsgiScope, AsgiRecv, AsgiSend], ta.Awaitable[None]]
16
+ Scope: ta.TypeAlias = ta.Mapping[str, ta.Any]
17
+ Message: ta.TypeAlias = ta.Mapping[str, ta.Any]
18
+ Recv: ta.TypeAlias = ta.Callable[[], ta.Awaitable[Message]]
19
+ Send: ta.TypeAlias = ta.Callable[[Message], ta.Awaitable[None]]
20
+ App: ta.TypeAlias = ta.Callable[[Scope, Recv, Send], ta.Awaitable[None]]
21
+ Wrapper: ta.TypeAlias = ta.Callable[[App, Scope, Recv, Send], ta.Awaitable[None]]
22
22
 
23
23
 
24
- class AsgiApp_(abc.ABC): # noqa
24
+ class App_(abc.ABC): # noqa
25
25
  @abc.abstractmethod
26
- async def __call__(self, scope: AsgiScope, recv: AsgiRecv, send: AsgiSend) -> None:
26
+ async def __call__(self, scope: Scope, recv: Recv, send: Send) -> None:
27
27
  raise NotImplementedError
28
28
 
29
29
 
30
30
  ##
31
31
 
32
32
 
33
- async def stub_lifespan(scope: AsgiScope, recv: AsgiRecv, send: AsgiSend, *, verbose: bool = False) -> None:
33
+ async def stub_lifespan(scope: Scope, recv: Recv, send: Send, *, verbose: bool = False) -> None:
34
34
  while True:
35
35
  message = await recv()
36
36
  if message['type'] == 'lifespan.startup':
@@ -49,7 +49,7 @@ async def stub_lifespan(scope: AsgiScope, recv: AsgiRecv, send: AsgiSend, *, ver
49
49
 
50
50
 
51
51
  async def start_response(
52
- send: AsgiSend,
52
+ send: Send,
53
53
  status: int,
54
54
  content_type: bytes = consts.CONTENT_TYPE_TEXT_UTF8,
55
55
  headers: ta.Sequence[tuple[bytes, bytes]] | None = None,
@@ -65,7 +65,7 @@ async def start_response(
65
65
 
66
66
 
67
67
  async def finish_response(
68
- send: AsgiSend,
68
+ send: Send,
69
69
  body: bytes = b'',
70
70
  ) -> None:
71
71
  await send({
@@ -75,7 +75,7 @@ async def finish_response(
75
75
 
76
76
 
77
77
  async def send_response(
78
- send: AsgiSend,
78
+ send: Send,
79
79
  status: int,
80
80
  content_type: bytes = consts.CONTENT_TYPE_TEXT_UTF8,
81
81
  headers: ta.Sequence[tuple[bytes, bytes]] | None = None,
@@ -93,7 +93,7 @@ async def send_response(
93
93
 
94
94
 
95
95
  async def redirect_response(
96
- send: AsgiSend,
96
+ send: Send,
97
97
  url: str,
98
98
  headers: ta.Sequence[tuple[bytes, bytes]] | None = None,
99
99
  ) -> None:
@@ -116,7 +116,7 @@ async def redirect_response(
116
116
  ##
117
117
 
118
118
 
119
- async def read_body(recv: AsgiRecv) -> bytes:
119
+ async def read_body(recv: Recv) -> bytes:
120
120
  body = b''
121
121
  more_body = True
122
122
  while more_body:
@@ -126,7 +126,7 @@ async def read_body(recv: AsgiRecv) -> bytes:
126
126
  return body
127
127
 
128
128
 
129
- async def read_form_body(recv: AsgiRecv) -> dict[bytes, bytes]:
129
+ async def read_form_body(recv: Recv) -> dict[bytes, bytes]:
130
130
  body = await read_body(recv)
131
131
  dct = urllib.parse.parse_qs(body) # noqa
132
132
  return {k: check.single(v) for k, v in dct.items()}
omlish/http/wsgi.py CHANGED
@@ -3,13 +3,22 @@ import typing as ta
3
3
  from .. import lang
4
4
 
5
5
 
6
- Environ = ta.Mapping[str, ta.Any]
7
- StartResponse = ta.Callable[[str, ta.Iterable[tuple[str | bytes, str | bytes]]], ta.Callable[[lang.BytesLike], None]]
8
- App = ta.Callable[[Environ, StartResponse], ta.Iterable[lang.BytesLike]]
6
+ ##
7
+
8
+
9
+ Environ: ta.TypeAlias = ta.Mapping[str, ta.Any]
10
+ StartResponse: ta.TypeAlias = ta.Callable[
11
+ [
12
+ str,
13
+ ta.Iterable[tuple[str | bytes, str | bytes]],
14
+ # types.ExceptionInfo | None = None,
15
+ ],
16
+ ta.Callable[[lang.BytesLike], None],
17
+ ]
18
+ App: ta.TypeAlias = ta.Callable[[Environ, StartResponse], ta.Iterable[lang.BytesLike]]
9
19
 
10
20
 
11
21
  # class App(lang.Abstract):
12
- #
13
22
  # def __enter__(self: AppT) -> AppT:
14
23
  # return self
15
24
  #
@@ -22,7 +31,6 @@ App = ta.Callable[[Environ, StartResponse], ta.Iterable[lang.BytesLike]]
22
31
 
23
32
 
24
33
  # class AsyncApp(lang.Abstract):
25
- #
26
34
  # async def __aenter__(self: AppT) -> AppT:
27
35
  # return self
28
36
  #
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: omlish
3
- Version: 0.0.0.dev280
3
+ Version: 0.0.0.dev282
4
4
  Summary: omlish
5
5
  Author: wrmsr
6
6
  License: BSD-3-Clause
@@ -1,5 +1,5 @@
1
1
  omlish/.manifests.json,sha256=pjGUyLHaoWpPqRP3jz2u1fC1qoRc2lvrEcpU_Ax2tdg,8253
2
- omlish/__about__.py,sha256=tomhvMbjsT0jtVBAtPgoqWQWYTlkWH2K_sC_ndp9_lI,3380
2
+ omlish/__about__.py,sha256=WctMMOMKUK_c85zNok6MptVWnjIG0yqCXVbBXhqlJiQ,3380
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
@@ -331,7 +331,7 @@ omlish/graphs/dot/rendering.py,sha256=eN1NufiUaKFeRxRTOfIT-oLTg1YQCuPybBx3AmrhdB
331
331
  omlish/graphs/dot/utils.py,sha256=_FMwn77WfiiAfLsRTOKWm4IYbNv5kQN22YJ5psw6CWg,801
332
332
  omlish/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
333
333
  omlish/http/all.py,sha256=4dSBbitsrQIadivSo2rBLg8dgdmC0efpboylGUZgKKo,829
334
- omlish/http/asgi.py,sha256=wXhBZ21bEl32Kv9yBrRwUR_7pHEgVtHP8ZZwbasQ6-4,3307
334
+ omlish/http/asgi.py,sha256=D-8ZnnR5Asv9o02FXorCBYfolFV9TIcCPm51hSlMkCA,3195
335
335
  omlish/http/consts.py,sha256=7BJ4D1MdIvqBcepkgCfBFHolgTwbOlqsOEiee_IjxOA,2289
336
336
  omlish/http/cookies.py,sha256=uuOYlHR6e2SC3GM41V0aozK10nef9tYg83Scqpn5-HM,6351
337
337
  omlish/http/dates.py,sha256=Otgp8wRxPgNGyzx8LFowu1vC4EKJYARCiAwLFncpfHM,2875
@@ -345,7 +345,7 @@ omlish/http/parsing.py,sha256=Kz1n-2SwqSbRtPk1nlImf655c2YtGLW4WlTI82o3c1w,14356
345
345
  omlish/http/sessions.py,sha256=TfTJ_j-6c9PelG_RmijEwozfaVm3O7YzgtFvp8VzQqM,4799
346
346
  omlish/http/sse.py,sha256=NwJnQj-hFXAkadXKhUuHSnbXHwDVJjhzfdkkHQ-prQo,2320
347
347
  omlish/http/versions.py,sha256=wSiOXPiClVjkVgSU_VmxkoD1SUYGaoPbP0U5Aw-Ufg8,409
348
- omlish/http/wsgi.py,sha256=czZsVUX-l2YTlMrUjKN49wRoP4rVpS0qpeBn4O5BoMY,948
348
+ omlish/http/wsgi.py,sha256=1JpfrY2JrQ0wrEVE0oLdQMWZw8Zcx0b4_9f3VmH4JKA,1070
349
349
  omlish/http/clients/__init__.py,sha256=SeH3ofjQvk7VuV9OE1uJir9QMZwvEuDl7fptkKgGQUU,449
350
350
  omlish/http/clients/base.py,sha256=8dQGHJyRxH9GFefdoG6HR-VAMsr1rCOti_M27NLAdJU,4658
351
351
  omlish/http/clients/default.py,sha256=fO8So3pI2z8ateLqt9Sv50UoOJFkUZbgMdoDyWsjBNw,1070
@@ -789,9 +789,9 @@ omlish/typedvalues/holder.py,sha256=4SwRezsmuDDEO5gENGx8kTm30pblF5UktoEAu02i-Gk,
789
789
  omlish/typedvalues/marshal.py,sha256=eWMrmuzPk3pX5AlILc5YBvuJBUHRQA_vwkxRm5aHiGs,4209
790
790
  omlish/typedvalues/reflect.py,sha256=y_7IY8_4cLVRvD3ug-_-cDaO5RtzC1rLVFzkeAPALf8,683
791
791
  omlish/typedvalues/values.py,sha256=Acyf6xSdNHxrkRXLXrFqJouk35YOveso1VqTbyPwQW4,1223
792
- omlish-0.0.0.dev280.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
793
- omlish-0.0.0.dev280.dist-info/METADATA,sha256=cB-W0A9GSdEwu5Hr5ccj4cqL_r-KCNy3JQdUC85fo3A,4198
794
- omlish-0.0.0.dev280.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
795
- omlish-0.0.0.dev280.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
796
- omlish-0.0.0.dev280.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
797
- omlish-0.0.0.dev280.dist-info/RECORD,,
792
+ omlish-0.0.0.dev282.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
793
+ omlish-0.0.0.dev282.dist-info/METADATA,sha256=3o78Htwt4EPIXEyzWDru7KHoGgtjCj1FPl6GgHoswbg,4198
794
+ omlish-0.0.0.dev282.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
795
+ omlish-0.0.0.dev282.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
796
+ omlish-0.0.0.dev282.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
797
+ omlish-0.0.0.dev282.dist-info/RECORD,,