Skip to content

Commit 05cd155

Browse files
authored
Final changes before the 0.5.0 release (#49)
* get_state timeout as the last argument * Fix exception handling * Remove unnecessary method from the Response class * Fix Platform - compatible only with Linux * Fix typo * Improve exception handling and documentation
1 parent 8c175b8 commit 05cd155

File tree

8 files changed

+193
-122
lines changed

8 files changed

+193
-122
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
![Build](https://github.com/eclipse-ankaios/ank-sdk-python/actions/workflows/build.yml/badge.svg?job=build)
1010
![PyPI - Version](https://img.shields.io/pypi/v/ankaios_sdk)
1111
![Python](https://img.shields.io/badge/python-3.9%20|%203.10%20|%203.11%20|%203.12%20|%203.13-blue)
12-
![OS](https://img.shields.io/badge/os-independent-lightgrey)
1312

1413
![License](https://img.shields.io/badge/license-Apache%202.0-blue)
1514
[![Ankaios](https://img.shields.io/badge/main_project-repo-blue)](https://github.com/eclipse-ankaios/ankaios)

ankaios_sdk/_components/control_interface.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def connect(self) -> None:
139139
from the input fifo and opening the output fifo.
140140
141141
Raises:
142-
AnkaiosConnectionException: If an error occurred.
142+
ControlInterfaceException: If an error occurred.
143143
"""
144144
if self._state == ControlInterfaceState.INITIALIZED:
145145
raise ControlInterfaceException("Already connected.")
@@ -229,7 +229,7 @@ def _read_from_control_interface(self) -> None:
229229
The responses are then sent to the Ankaios class to be handled.
230230
231231
Raises:
232-
AnkaiosConnectionException: If an error occurs
232+
ControlInterfaceException: If an error occurs
233233
while reading the fifo.
234234
"""
235235
# The pragma: no cover is used on small checks that are not expected
@@ -339,7 +339,7 @@ def _write_to_pipe(self, to_ankaios: _control_api.ToAnkaios) -> None:
339339
to_ankaios (_control_api.ToAnkaios): The ToAnkaios proto message.
340340
341341
Raises:
342-
AnkaiosConnectionException: If the output pipe is None.
342+
ControlInterfaceException: If the output pipe is None.
343343
"""
344344
if self._output_file is None:
345345
self._logger.error(
@@ -363,7 +363,7 @@ def write_request(self, request: Request) -> None:
363363
request (Request): The request object to be written.
364364
365365
Raises:
366-
AnkaiosConnectionException: If not connected.
366+
ControlInterfaceException: If not connected.
367367
"""
368368
if not self._state == ControlInterfaceState.INITIALIZED:
369369
raise ControlInterfaceException(
@@ -380,7 +380,7 @@ def _send_initial_hello(self) -> None:
380380
to the control interface.
381381
382382
Raises:
383-
AnkaiosConnectionException: If an error occurred.
383+
ControlInterfaceException: If not connected.
384384
"""
385385
initial_hello = _control_api.ToAnkaios(
386386
hello=_control_api.Hello(

ankaios_sdk/_components/response.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -170,18 +170,6 @@ def get_request_id(self) -> str:
170170
"""
171171
return self._response.requestId
172172

173-
def check_request_id(self, request_id: str) -> bool:
174-
"""
175-
Checks if the request id of the response matches the given request id.
176-
177-
Args:
178-
request_id (str): The request id to check against.
179-
180-
Returns:
181-
bool: True if the request_id matches, False otherwise.
182-
"""
183-
return self._response.requestId == request_id
184-
185173
def get_content(self) -> \
186174
tuple[
187175
'ResponseType',

0 commit comments

Comments
 (0)