websocket-proxy 0.2.0__tar.gz → 0.3.0__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.
- {websocket_proxy-0.2.0 → websocket_proxy-0.3.0}/PKG-INFO +1 -1
- {websocket_proxy-0.2.0 → websocket_proxy-0.3.0}/pyproject.toml +1 -1
- {websocket_proxy-0.2.0 → websocket_proxy-0.3.0}/src/websocket_proxy/proxy.py +2 -1
- {websocket_proxy-0.2.0 → websocket_proxy-0.3.0}/src/websocket_proxy/transformers/__init__.py +9 -4
- {websocket_proxy-0.2.0 → websocket_proxy-0.3.0}/src/websocket_proxy/transformers/image_to_video.py +5 -2
- {websocket_proxy-0.2.0 → websocket_proxy-0.3.0}/src/websocket_proxy/transformers/pointcloud_pureini.py +5 -2
- {websocket_proxy-0.2.0 → websocket_proxy-0.3.0}/README.md +0 -0
- {websocket_proxy-0.2.0 → websocket_proxy-0.3.0}/src/websocket_proxy/__init__.py +0 -0
- {websocket_proxy-0.2.0 → websocket_proxy-0.3.0}/src/websocket_proxy/__main__.py +0 -0
- {websocket_proxy-0.2.0 → websocket_proxy-0.3.0}/src/websocket_proxy/dashboard.py +0 -0
- {websocket_proxy-0.2.0 → websocket_proxy-0.3.0}/src/websocket_proxy/metrics.py +0 -0
- {websocket_proxy-0.2.0 → websocket_proxy-0.3.0}/src/websocket_proxy/py.typed +0 -0
|
@@ -22,6 +22,7 @@ from .transformers import Transformer, TransformerRegistry, TransformError
|
|
|
22
22
|
|
|
23
23
|
if TYPE_CHECKING:
|
|
24
24
|
from collections.abc import Callable
|
|
25
|
+
from types import SimpleNamespace
|
|
25
26
|
|
|
26
27
|
from robo_ws_bridge.ws_types import ChannelInfo
|
|
27
28
|
|
|
@@ -712,7 +713,7 @@ class ProxyBridge:
|
|
|
712
713
|
logger.exception("Message transformation failed")
|
|
713
714
|
return None
|
|
714
715
|
|
|
715
|
-
def _decode_message(self, channel: ChannelInfo, payload: bytes) ->
|
|
716
|
+
def _decode_message(self, channel: ChannelInfo, payload: bytes) -> SimpleNamespace:
|
|
716
717
|
"""Decode a CDR-encoded message.
|
|
717
718
|
|
|
718
719
|
Args:
|
{websocket_proxy-0.2.0 → websocket_proxy-0.3.0}/src/websocket_proxy/transformers/__init__.py
RENAMED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
"""Message transformers for converting between ROS2 message types."""
|
|
2
2
|
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
3
5
|
from abc import ABC, abstractmethod
|
|
4
|
-
from typing import Any
|
|
6
|
+
from typing import TYPE_CHECKING, Any
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from types import SimpleNamespace
|
|
5
10
|
|
|
6
11
|
|
|
7
12
|
class Transformer(ABC):
|
|
@@ -23,11 +28,11 @@ class Transformer(ABC):
|
|
|
23
28
|
...
|
|
24
29
|
|
|
25
30
|
@abstractmethod
|
|
26
|
-
def transform(self, message:
|
|
27
|
-
"""Transform a decoded message
|
|
31
|
+
def transform(self, message: SimpleNamespace) -> dict[str, Any]:
|
|
32
|
+
"""Transform a decoded message object to a message dict.
|
|
28
33
|
|
|
29
34
|
Args:
|
|
30
|
-
message: Decoded input message
|
|
35
|
+
message: Decoded input message (SimpleNamespace from CDR decoder)
|
|
31
36
|
|
|
32
37
|
Returns:
|
|
33
38
|
Transformed output message as a dictionary
|
{websocket_proxy-0.2.0 → websocket_proxy-0.3.0}/src/websocket_proxy/transformers/image_to_video.py
RENAMED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import logging
|
|
6
|
-
from typing import Any
|
|
6
|
+
from typing import TYPE_CHECKING, Any
|
|
7
7
|
|
|
8
8
|
from pymcap_cli.image_utils import (
|
|
9
9
|
FOXGLOVE_COMPRESSED_VIDEO,
|
|
@@ -18,6 +18,9 @@ from pymcap_cli.image_utils import (
|
|
|
18
18
|
|
|
19
19
|
from . import Transformer, TransformError
|
|
20
20
|
|
|
21
|
+
if TYPE_CHECKING:
|
|
22
|
+
from types import SimpleNamespace
|
|
23
|
+
|
|
21
24
|
logger = logging.getLogger(__name__)
|
|
22
25
|
|
|
23
26
|
|
|
@@ -60,7 +63,7 @@ class ImageToVideoTransformer(Transformer):
|
|
|
60
63
|
def get_output_schema_definition(self) -> str:
|
|
61
64
|
return FOXGLOVE_COMPRESSED_VIDEO
|
|
62
65
|
|
|
63
|
-
def transform(self, message:
|
|
66
|
+
def transform(self, message: SimpleNamespace) -> dict[str, Any]:
|
|
64
67
|
if not message.data:
|
|
65
68
|
raise TransformError(f"Empty image data, {message}")
|
|
66
69
|
|
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import logging
|
|
6
|
-
from typing import Any
|
|
6
|
+
from typing import TYPE_CHECKING, Any
|
|
7
7
|
|
|
8
8
|
from pymcap_cli.image_utils import COMPRESSED_POINTCLOUD2, PointCloudCompressor
|
|
9
9
|
|
|
10
10
|
from . import Transformer, TransformError
|
|
11
11
|
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from types import SimpleNamespace
|
|
14
|
+
|
|
12
15
|
logger = logging.getLogger(__name__)
|
|
13
16
|
|
|
14
17
|
|
|
@@ -34,7 +37,7 @@ class PointCloudPureiniTransformer(Transformer):
|
|
|
34
37
|
def get_output_schema_definition(self) -> str:
|
|
35
38
|
return COMPRESSED_POINTCLOUD2
|
|
36
39
|
|
|
37
|
-
def transform(self, message:
|
|
40
|
+
def transform(self, message: SimpleNamespace) -> dict[str, Any]:
|
|
38
41
|
try:
|
|
39
42
|
compressed = self._compressor.compress(message)
|
|
40
43
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|