moat-lib-codec 0.4.15__tar.gz → 0.4.17__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.
- {moat_lib_codec-0.4.15/src/moat_lib_codec.egg-info → moat_lib_codec-0.4.17}/PKG-INFO +1 -1
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/debian/changelog +24 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/pyproject.toml +1 -1
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat/lib/codec/_cbor.py +11 -6
- moat_lib_codec-0.4.17/src/moat/lib/codec/jsonvalstr.py +28 -0
- moat_lib_codec-0.4.17/src/moat/lib/codec/jsonvalue.py +26 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17/src/moat_lib_codec.egg-info}/PKG-INFO +1 -1
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat_lib_codec.egg-info/SOURCES.txt +2 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/LICENSE.txt +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/Makefile +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/README.md +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/debian/.gitignore +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/debian/control +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/debian/py3dist-overrides +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/debian/rules +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/setup.cfg +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat/lib/codec/__init__.py +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat/lib/codec/_base.py +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat/lib/codec/_moat_cbor.py +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat/lib/codec/_moat_msgpack.py +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat/lib/codec/binary.py +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat/lib/codec/bool.py +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat/lib/codec/cbor.py +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat/lib/codec/errors.py +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat/lib/codec/json.py +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat/lib/codec/moat_cbor.py +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat/lib/codec/moat_kv.py +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat/lib/codec/moat_msgpack.py +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat/lib/codec/msgpack.py +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat/lib/codec/noop.py +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat/lib/codec/utf8.py +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat/lib/codec/yaml.py +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat_lib_codec.egg-info/dependency_links.txt +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat_lib_codec.egg-info/requires.txt +0 -0
- {moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat_lib_codec.egg-info/top_level.txt +0 -0
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
moat-lib-codec (0.4.17-1) unstable; urgency=medium
|
|
2
|
+
|
|
3
|
+
* New release for 26.0.20
|
|
4
|
+
|
|
5
|
+
-- Matthias Urlichs <matthias@urlichs.de> Sun, 05 Apr 2026 01:09:43 +0200
|
|
6
|
+
|
|
7
|
+
moat-lib-codec (0.4.16-2) unstable; urgency=medium
|
|
8
|
+
|
|
9
|
+
* New release for 26.0.19
|
|
10
|
+
|
|
11
|
+
-- Matthias Urlichs <matthias@urlichs.de> Sun, 22 Mar 2026 16:05:07 +0100
|
|
12
|
+
|
|
13
|
+
moat-lib-codec (0.4.16-1) unstable; urgency=medium
|
|
14
|
+
|
|
15
|
+
* New release for 26.0.18
|
|
16
|
+
|
|
17
|
+
-- Matthias Urlichs <matthias@urlichs.de> Mon, 16 Mar 2026 21:27:49 +0100
|
|
18
|
+
|
|
19
|
+
moat-lib-codec (0.4.15-2) unstable; urgency=medium
|
|
20
|
+
|
|
21
|
+
* New release for 26.0.12
|
|
22
|
+
|
|
23
|
+
-- Matthias Urlichs <matthias@urlichs.de> Wed, 04 Mar 2026 10:58:14 +0100
|
|
24
|
+
|
|
1
25
|
moat-lib-codec (0.4.15-1) unstable; urgency=medium
|
|
2
26
|
|
|
3
27
|
* New release for 26.0.11
|
|
@@ -25,7 +25,7 @@ maintainers = [{email = "matthias@urlichs.de",name = "Matthias Urlichs"}]
|
|
|
25
25
|
description='A simple command/stream multiplexer'
|
|
26
26
|
readme = "README.rst"
|
|
27
27
|
authors = [{email = "matthias@urlichs.de",name = "Matthias Urlichs"}]
|
|
28
|
-
version = "0.4.
|
|
28
|
+
version = "0.4.17"
|
|
29
29
|
|
|
30
30
|
[project.urls]
|
|
31
31
|
homepage = "https://m-o-a-t.org"
|
|
@@ -5,6 +5,7 @@ plus an unpacker factory for streams.
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
+
import math
|
|
8
9
|
import struct
|
|
9
10
|
|
|
10
11
|
from moat.util import OutOfData
|
|
@@ -403,16 +404,20 @@ class Codec(_Codec):
|
|
|
403
404
|
# Some special cases of CBOR_7 best handled by special struct.unpack logic here
|
|
404
405
|
if tb == CBOR_FLOAT16:
|
|
405
406
|
data = self._read(2)
|
|
406
|
-
pf = struct.unpack_from("!e", data, 0)
|
|
407
|
-
|
|
407
|
+
pf = struct.unpack_from("!e", data, 0)[0]
|
|
408
|
+
if pf != 0:
|
|
409
|
+
pf = round(pf, int(4 - math.log10(abs(pf))))
|
|
410
|
+
return pf
|
|
408
411
|
elif tb == CBOR_FLOAT32:
|
|
409
412
|
data = self._read(4)
|
|
410
|
-
pf = struct.unpack_from("!f", data, 0)
|
|
411
|
-
|
|
413
|
+
pf = struct.unpack_from("!f", data, 0)[0]
|
|
414
|
+
if pf != 0:
|
|
415
|
+
pf = round(pf, int(8 - math.log10(abs(pf))))
|
|
416
|
+
return pf
|
|
412
417
|
elif tb == CBOR_FLOAT64:
|
|
413
418
|
data = self._read(8)
|
|
414
|
-
pf = struct.unpack_from("!d", data, 0)
|
|
415
|
-
return pf
|
|
419
|
+
pf = struct.unpack_from("!d", data, 0)[0]
|
|
420
|
+
return pf
|
|
416
421
|
|
|
417
422
|
tag, aux = self._dec_tag_aux(tb)
|
|
418
423
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"A JSON+Value codec that uses a stringified element"
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
|
|
7
|
+
from .jsonvalue import Codec as _Codec
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Codec(_Codec):
|
|
11
|
+
"JSON+Value using a stringified element"
|
|
12
|
+
|
|
13
|
+
def __init__(self, ext=None):
|
|
14
|
+
if ext is not None:
|
|
15
|
+
raise ValueError("You can't extend the JSON codec")
|
|
16
|
+
super().__init__()
|
|
17
|
+
|
|
18
|
+
def encode(self, obj):
|
|
19
|
+
"basic encoder"
|
|
20
|
+
return super().encode(json.dumps(obj))
|
|
21
|
+
|
|
22
|
+
def decode(self, data):
|
|
23
|
+
"basic decoder"
|
|
24
|
+
return json.loads(super().decode(data))
|
|
25
|
+
|
|
26
|
+
# 'feed' is not implemented:
|
|
27
|
+
# there is no reasonable incremental JSON codec out there
|
|
28
|
+
# bring your own framing …
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"A JSON codec that encapsulates its data in a ``value`` element"
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .json import Codec as _Codec
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Codec(_Codec):
|
|
9
|
+
"JSON codec with 'value' element"
|
|
10
|
+
|
|
11
|
+
def __init__(self, ext=None):
|
|
12
|
+
if ext is not None:
|
|
13
|
+
raise ValueError("You can't extend the JSON codec")
|
|
14
|
+
super().__init__()
|
|
15
|
+
|
|
16
|
+
def encode(self, obj):
|
|
17
|
+
"basic encoder"
|
|
18
|
+
return super().encode({"value": obj})
|
|
19
|
+
|
|
20
|
+
def decode(self, data):
|
|
21
|
+
"basic decoder"
|
|
22
|
+
return super().decode(data)["value"]
|
|
23
|
+
|
|
24
|
+
# 'feed' is not implemented:
|
|
25
|
+
# there is no reasonable incremental JSON codec out there
|
|
26
|
+
# bring your own framing …
|
|
@@ -17,6 +17,8 @@ src/moat/lib/codec/bool.py
|
|
|
17
17
|
src/moat/lib/codec/cbor.py
|
|
18
18
|
src/moat/lib/codec/errors.py
|
|
19
19
|
src/moat/lib/codec/json.py
|
|
20
|
+
src/moat/lib/codec/jsonvalstr.py
|
|
21
|
+
src/moat/lib/codec/jsonvalue.py
|
|
20
22
|
src/moat/lib/codec/moat_cbor.py
|
|
21
23
|
src/moat/lib/codec/moat_kv.py
|
|
22
24
|
src/moat/lib/codec/moat_msgpack.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{moat_lib_codec-0.4.15 → moat_lib_codec-0.4.17}/src/moat_lib_codec.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|