cgse-common 0.16.10__tar.gz → 0.16.12__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.
- {cgse_common-0.16.10 → cgse_common-0.16.12}/PKG-INFO +2 -1
- {cgse_common-0.16.10 → cgse_common-0.16.12}/pyproject.toml +2 -1
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/env.py +1 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/setup.py +1 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/system.py +24 -11
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/zmq_ser.py +14 -5
- {cgse_common-0.16.10 → cgse_common-0.16.12}/.gitignore +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/README.md +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/justfile +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/noxfile.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/service_registry.db +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/cgse_common/__init__.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/cgse_common/cgse.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/cgse_common/settings.yaml +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/bits.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/calibration.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/config.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/counter.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/decorators.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/device.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/dicts.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/exceptions.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/heartbeat.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/hk.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/log.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/metrics.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/observer.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/obsid.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/persistence.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/plugin.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/plugins/metrics/duckdb.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/plugins/metrics/influxdb.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/plugins/metrics/timescaledb.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/process.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/py.typed +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/randomwalk.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/ratelimit.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/reload.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/resource.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/response.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/scpi.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/settings.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/settings.yaml +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/signal.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/socketdevice.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/state.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/task.py +0 -0
- {cgse_common-0.16.10 → cgse_common-0.16.12}/src/egse/version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cgse-common
|
|
3
|
-
Version: 0.16.
|
|
3
|
+
Version: 0.16.12
|
|
4
4
|
Summary: Software framework to support hardware testing
|
|
5
5
|
Author: IvS KU Leuven
|
|
6
6
|
Maintainer-email: Rik Huygen <rik.huygen@kuleuven.be>, Sara Regibo <sara.regibo@kuleuven.be>
|
|
@@ -22,6 +22,7 @@ Requires-Dist: pandas>=2.2.0; python_version >= '3.10'
|
|
|
22
22
|
Requires-Dist: prometheus-client>=0.21.1
|
|
23
23
|
Requires-Dist: psutil>=6.1.1
|
|
24
24
|
Requires-Dist: psycopg>=3.2.9
|
|
25
|
+
Requires-Dist: python-dotenv>=1.1.1
|
|
25
26
|
Requires-Dist: pyyaml>=6.0.2
|
|
26
27
|
Requires-Dist: pyzmq==23.2.1; python_version == '3.9'
|
|
27
28
|
Requires-Dist: pyzmq>=25.1.0; python_version >= '3.10'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "cgse-common"
|
|
3
|
-
version = "0.16.
|
|
3
|
+
version = "0.16.12"
|
|
4
4
|
description = "Software framework to support hardware testing"
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "IvS KU Leuven"}
|
|
@@ -43,6 +43,7 @@ dependencies = [
|
|
|
43
43
|
"duckdb>=1.3.1",
|
|
44
44
|
"requests>=2.32.4",
|
|
45
45
|
"psycopg>=3.2.9",
|
|
46
|
+
"python-dotenv>=1.1.1",
|
|
46
47
|
]
|
|
47
48
|
|
|
48
49
|
[project.scripts]
|
|
@@ -71,19 +71,32 @@ TIME_FORMAT = "%Y-%m-%dT%H:%M:%S.%f%z"
|
|
|
71
71
|
class Periodic:
|
|
72
72
|
"""A timer that periodically invokes a function in the background.
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
This class schedules a callback to be executed at regular intervals using asyncio.
|
|
75
|
+
If no callback is provided, a warning message will be logged. If the callback execution
|
|
76
|
+
takes longer than the interval, and `skip` is True (default), the timer will skip missed
|
|
77
|
+
intervals to maintain the schedule.
|
|
76
78
|
|
|
77
|
-
When the function execution takes longer then the interval there re several options:
|
|
78
|
-
|
|
79
|
-
- if skip is True (default) the interval will take precedence and the
|
|
80
79
|
Args:
|
|
81
|
-
interval: The time between timer events, in seconds.
|
|
82
|
-
name: A name to assign the event (for debugging), defaults to `Periodic#`.
|
|
83
|
-
callback: A
|
|
84
|
-
repeat: The number of times to repeat the timer, or None to repeat forever.
|
|
85
|
-
skip: Enable skipping of scheduled function calls that couldn't be sent in time.
|
|
86
|
-
pause: Start the timer paused. Use `resume()` to activate the timer.
|
|
80
|
+
interval (float): The time between timer events, in seconds.
|
|
81
|
+
name (str, optional): A name to assign the event (for debugging), defaults to `Periodic#`.
|
|
82
|
+
callback (Callable, optional): A callback to invoke when the event is handled.
|
|
83
|
+
repeat (int, optional): The number of times to repeat the timer, or None to repeat forever.
|
|
84
|
+
skip (bool, optional): Enable skipping of scheduled function calls that couldn't be sent in time.
|
|
85
|
+
pause (bool, optional): Start the timer paused. Use `resume()` to activate the timer.
|
|
86
|
+
|
|
87
|
+
Methods:
|
|
88
|
+
start(): Start the timer.
|
|
89
|
+
stop(): Stop the timer.
|
|
90
|
+
is_running(): Return True if the timer is running.
|
|
91
|
+
is_paused(): Return True if the timer is paused.
|
|
92
|
+
pause(): Pause the timer.
|
|
93
|
+
reset(): Reset the timer to start from the beginning.
|
|
94
|
+
resume(): Resume a paused timer.
|
|
95
|
+
|
|
96
|
+
Note:
|
|
97
|
+
The timer runs asynchronously and is suitable for use in asyncio-based applications.
|
|
98
|
+
If the callback is a coroutine, it will be awaited.
|
|
99
|
+
|
|
87
100
|
"""
|
|
88
101
|
|
|
89
102
|
_periodic_count: int = 0
|
|
@@ -44,17 +44,26 @@ def recv_zipped_pickle(socket, flags=0, protocol=-1):
|
|
|
44
44
|
return pickle.loads(p)
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
def get_port_number(socket: zmq.Socket) -> int
|
|
47
|
+
def get_port_number(socket: zmq.Socket | None) -> int:
|
|
48
48
|
"""
|
|
49
|
-
Returns the port number associated with this socket.
|
|
50
|
-
|
|
49
|
+
Returns the port number associated with this socket.
|
|
50
|
+
|
|
51
|
+
If the socket is bound to a TCP or IPC transport, the port number is extracted from the
|
|
52
|
+
LAST_ENDPOINT socket option.
|
|
53
|
+
|
|
54
|
+
Returns:
|
|
55
|
+
- 0 for sockets that do not bound to a TCP or IPC transport.
|
|
56
|
+
- 0 if the socket is None.
|
|
51
57
|
"""
|
|
58
|
+
if socket is None:
|
|
59
|
+
return 0
|
|
60
|
+
|
|
52
61
|
endpoint = socket.getsockopt(zmq.LAST_ENDPOINT)
|
|
53
|
-
if endpoint:
|
|
62
|
+
if endpoint and isinstance(endpoint, bytes):
|
|
54
63
|
port = endpoint.decode("utf-8").split(":")[-1]
|
|
55
64
|
return int(port)
|
|
56
65
|
else:
|
|
57
|
-
return
|
|
66
|
+
return 0
|
|
58
67
|
|
|
59
68
|
|
|
60
69
|
def zmq_string_request(request: str) -> list:
|
|
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
|
|
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
|