moat-lib-stream 0.3.6__tar.gz → 0.3.7__tar.gz

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.
Files changed (30) hide show
  1. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/PKG-INFO +6 -6
  2. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/debian/changelog +6 -0
  3. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/pyproject.toml +6 -6
  4. moat_lib_stream-0.3.7/src/moat/lib/stream/cbor.py +56 -0
  5. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/src/moat/lib/stream/serial.py +5 -6
  6. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/src/moat_lib_stream.egg-info/PKG-INFO +6 -6
  7. moat_lib_stream-0.3.7/src/moat_lib_stream.egg-info/requires.txt +5 -0
  8. moat_lib_stream-0.3.6/src/moat/lib/stream/cbor.py +0 -35
  9. moat_lib_stream-0.3.6/src/moat_lib_stream.egg-info/requires.txt +0 -5
  10. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/LICENSE.txt +0 -0
  11. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/README.md +0 -0
  12. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/debian/.gitignore +0 -0
  13. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/debian/control +0 -0
  14. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/debian/rules +0 -0
  15. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/setup.cfg +0 -0
  16. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/src/moat/lib/stream/__init__.py +0 -0
  17. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/src/moat/lib/stream/_cbor.py +0 -0
  18. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/src/moat/lib/stream/_console.py +0 -0
  19. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/src/moat/lib/stream/_layers.py +0 -0
  20. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/src/moat/lib/stream/anyio.py +0 -0
  21. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/src/moat/lib/stream/base.py +0 -0
  22. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/src/moat/lib/stream/log.py +0 -0
  23. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/src/moat/lib/stream/reliable.py +0 -0
  24. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/src/moat/lib/stream/tcp.py +0 -0
  25. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/src/moat/lib/stream/terminal.py +0 -0
  26. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/src/moat/lib/stream/unix.py +0 -0
  27. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/src/moat/lib/stream/ws.py +0 -0
  28. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/src/moat_lib_stream.egg-info/SOURCES.txt +0 -0
  29. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/src/moat_lib_stream.egg-info/dependency_links.txt +0 -0
  30. {moat_lib_stream-0.3.6 → moat_lib_stream-0.3.7}/src/moat_lib_stream.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moat-lib-stream
3
- Version: 0.3.6
3
+ Version: 0.3.7
4
4
  Summary: Stream infrastructure for MoaT applications
5
5
  Maintainer-email: Matthias Urlichs <matthias@urlichs.de>
6
6
  Project-URL: homepage, https://m-o-a-t.org
@@ -15,11 +15,11 @@ Classifier: Intended Audience :: Developers
15
15
  Requires-Python: >=3.8
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE.txt
18
- Requires-Dist: moat-lib-micro~=0.3.0
19
- Requires-Dist: moat-lib-rpc~=0.7.0
20
- Requires-Dist: moat-lib-codec~=0.4.14
21
- Requires-Dist: moat-lib-repl~=0.1.4
22
- Requires-Dist: moat-util~=0.64.0
18
+ Requires-Dist: moat-lib-micro~=0.3.7
19
+ Requires-Dist: moat-lib-rpc~=0.7.23
20
+ Requires-Dist: moat-lib-codec~=0.4.22
21
+ Requires-Dist: moat-lib-repl~=0.1.14
22
+ Requires-Dist: moat-util~=0.64.13
23
23
  Dynamic: license-file
24
24
 
25
25
  # Stream Infrastructure
@@ -1,3 +1,9 @@
1
+ moat-lib-stream (0.3.7-1) unstable; urgency=medium
2
+
3
+ * New release for 26.5.52
4
+
5
+ -- Matthias Urlichs <matthias@urlichs.de> Mon, 16 Nov 2026 06:20:38 +0100
6
+
1
7
  moat-lib-stream (0.3.6-1) unstable; urgency=medium
2
8
 
3
9
  * New release for 26.4.41
@@ -12,11 +12,11 @@ classifiers = [
12
12
  "Intended Audience :: Developers",
13
13
  ]
14
14
  dependencies = [
15
- "moat-lib-micro ~= 0.3.0",
16
- "moat-lib-rpc ~= 0.7.0",
17
- "moat-lib-codec ~= 0.4.14",
18
- "moat-lib-repl ~= 0.1.4",
19
- "moat-util ~= 0.64.0",
15
+ "moat-lib-micro ~= 0.3.7",
16
+ "moat-lib-rpc ~= 0.7.23",
17
+ "moat-lib-codec ~= 0.4.22",
18
+ "moat-lib-repl ~= 0.1.14",
19
+ "moat-util ~= 0.64.13",
20
20
  ]
21
21
  keywords = ["MoaT"]
22
22
  requires-python = ">=3.8"
@@ -24,7 +24,7 @@ name = "moat-lib-stream"
24
24
  maintainers = [{email = "matthias@urlichs.de",name = "Matthias Urlichs"}]
25
25
  description='Stream infrastructure for MoaT applications'
26
26
  readme = "README.md"
27
- version = "0.3.6"
27
+ version = "0.3.7"
28
28
 
29
29
  [project.urls]
30
30
  homepage = "https://m-o-a-t.org"
@@ -0,0 +1,56 @@
1
+ """
2
+ CBOR message handling for streams (CPython-specific).
3
+ """
4
+
5
+ from __future__ import annotations
6
+
7
+ from moat.lib.codec import SUBPROTO_CODEC, get_codec
8
+
9
+ from ._cbor import _CBORMsgBlk, _CBORMsgBuf
10
+
11
+
12
+ def _codec_from_link(s, cfg) -> str:
13
+ """Determine the codec name for a message layer.
14
+
15
+ The negotiated subprotocol of the bottom stream, if it maps to a
16
+ codec, wins over the ``codec`` configuration key; the default is
17
+ ``std-cbor``.
18
+ """
19
+ sub = getattr(s, "subprotocol", None)
20
+ if sub is not None and sub in SUBPROTO_CODEC:
21
+ return SUBPROTO_CODEC[sub]
22
+ return cfg.get("codec", "std-cbor")
23
+
24
+
25
+ class CBORMsgBuf(_CBORMsgBuf):
26
+ """
27
+ structured messages > bytestream
28
+
29
+ Use this if your stream is reliable (TCP, USB, …) but doesn't support
30
+ message boundaries.
31
+
32
+ If the bottom stream reports a negotiated subprotocol (WebSocket
33
+ links do; see :data:`moat.lib.codec.SUBPROTO_CODEC`), it selects the
34
+ codec and overrides the ``codec`` configuration key.
35
+ """
36
+
37
+ async def setup(self) -> None: # noqa:D102
38
+ await super().setup()
39
+ self.codec = get_codec(_codec_from_link(self.s, self.cfg))
40
+
41
+
42
+ class CBORMsgBlk(_CBORMsgBlk):
43
+ """
44
+ structured messages > chunked bytestrings
45
+
46
+ Use this if the layer below supports byte boundaries
47
+ (one bytestring-ized message per call).
48
+
49
+ If the bottom stream reports a negotiated subprotocol (WebSocket
50
+ links do; see :data:`moat.lib.codec.SUBPROTO_CODEC`), it selects the
51
+ codec and overrides the ``codec`` configuration key.
52
+ """
53
+
54
+ async def setup(self) -> None: # noqa:D102
55
+ await super().setup()
56
+ self.codec = get_codec(_codec_from_link(self.s, self.cfg))
@@ -72,14 +72,13 @@ class SerialPackerBlkBuf(StackedBlk):
72
72
 
73
73
  async def snd(self, m: Buffer) -> None:
74
74
  "block write"
75
- h, msg, t = self.p.frame(m)
75
+ msg = self.p.frame(m)
76
76
  async with self.w_lock:
77
- if not self.cons:
78
- await self.s.wr(h)
79
- await self.s.wr(msg)
80
- await self.s.wr(t)
77
+ if self.cons:
78
+ await self.s.wr(b"".join(msg))
81
79
  else:
82
- await self.s.wr(h + msg + t)
80
+ for m in msg:
81
+ await self.s.wr(m)
83
82
 
84
83
  recv = rcv
85
84
  send = snd
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moat-lib-stream
3
- Version: 0.3.6
3
+ Version: 0.3.7
4
4
  Summary: Stream infrastructure for MoaT applications
5
5
  Maintainer-email: Matthias Urlichs <matthias@urlichs.de>
6
6
  Project-URL: homepage, https://m-o-a-t.org
@@ -15,11 +15,11 @@ Classifier: Intended Audience :: Developers
15
15
  Requires-Python: >=3.8
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE.txt
18
- Requires-Dist: moat-lib-micro~=0.3.0
19
- Requires-Dist: moat-lib-rpc~=0.7.0
20
- Requires-Dist: moat-lib-codec~=0.4.14
21
- Requires-Dist: moat-lib-repl~=0.1.4
22
- Requires-Dist: moat-util~=0.64.0
18
+ Requires-Dist: moat-lib-micro~=0.3.7
19
+ Requires-Dist: moat-lib-rpc~=0.7.23
20
+ Requires-Dist: moat-lib-codec~=0.4.22
21
+ Requires-Dist: moat-lib-repl~=0.1.14
22
+ Requires-Dist: moat-util~=0.64.13
23
23
  Dynamic: license-file
24
24
 
25
25
  # Stream Infrastructure
@@ -0,0 +1,5 @@
1
+ moat-lib-codec~=0.4.22
2
+ moat-lib-micro~=0.3.7
3
+ moat-lib-repl~=0.1.14
4
+ moat-lib-rpc~=0.7.23
5
+ moat-util~=0.64.13
@@ -1,35 +0,0 @@
1
- """
2
- CBOR message handling for streams (CPython-specific).
3
- """
4
-
5
- from __future__ import annotations
6
-
7
- from moat.lib.codec import get_codec
8
-
9
- from ._cbor import _CBORMsgBlk, _CBORMsgBuf
10
-
11
-
12
- class CBORMsgBuf(_CBORMsgBuf):
13
- """
14
- structured messages > bytestream
15
-
16
- Use this if your stream is reliable (TCP, USB, …) but doesn't support
17
- message boundaries.
18
- """
19
-
20
- async def setup(self) -> None: # noqa:D102
21
- await super().setup()
22
- self.codec = get_codec(self.cfg.get("codec", "std-cbor"))
23
-
24
-
25
- class CBORMsgBlk(_CBORMsgBlk):
26
- """
27
- structured messages > chunked bytestrings
28
-
29
- Use this if the layer below supports byte boundaries
30
- (one bytestring-ized message per call).
31
- """
32
-
33
- async def setup(self) -> None: # noqa:D102
34
- await super().setup()
35
- self.codec = get_codec(self.cfg.get("codec", "std-cbor"))
@@ -1,5 +0,0 @@
1
- moat-lib-codec~=0.4.14
2
- moat-lib-micro~=0.3.0
3
- moat-lib-repl~=0.1.4
4
- moat-lib-rpc~=0.7.0
5
- moat-util~=0.64.0