syndesi 0.3.2__py3-none-any.whl → 0.4.1__py3-none-any.whl
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.
- syndesi/adapters/adapter.py +126 -165
- syndesi/adapters/auto.py +1 -1
- syndesi/adapters/backend/adapter_backend.py +96 -63
- syndesi/adapters/backend/adapter_session.py +53 -153
- syndesi/adapters/backend/descriptors.py +3 -2
- syndesi/adapters/backend/ip_backend.py +1 -0
- syndesi/adapters/backend/serialport_backend.py +19 -13
- syndesi/adapters/backend/stop_condition_backend.py +99 -243
- syndesi/adapters/backend/visa_backend.py +7 -7
- syndesi/adapters/ip.py +6 -10
- syndesi/adapters/serialport.py +4 -5
- syndesi/adapters/stop_condition.py +47 -26
- syndesi/adapters/timeout.py +2 -2
- syndesi/adapters/visa.py +2 -2
- syndesi/cli/shell_tools.py +95 -97
- syndesi/protocols/delimited.py +16 -21
- syndesi/protocols/modbus.py +17 -14
- syndesi/protocols/raw.py +20 -16
- syndesi/protocols/scpi.py +17 -15
- syndesi/tools/backend_api.py +15 -16
- syndesi/tools/errors.py +28 -0
- syndesi/version.py +1 -1
- {syndesi-0.3.2.dist-info → syndesi-0.4.1.dist-info}/METADATA +2 -1
- {syndesi-0.3.2.dist-info → syndesi-0.4.1.dist-info}/RECORD +28 -28
- {syndesi-0.3.2.dist-info → syndesi-0.4.1.dist-info}/WHEEL +0 -0
- {syndesi-0.3.2.dist-info → syndesi-0.4.1.dist-info}/entry_points.txt +0 -0
- {syndesi-0.3.2.dist-info → syndesi-0.4.1.dist-info}/licenses/LICENSE +0 -0
- {syndesi-0.3.2.dist-info → syndesi-0.4.1.dist-info}/top_level.txt +0 -0
syndesi/tools/backend_api.py
CHANGED
|
@@ -24,28 +24,27 @@ default_host = LOCALHOST
|
|
|
24
24
|
|
|
25
25
|
# The backend links the client with an adapter when SELECT_ADAPTER is sent along with an adapter descriptor
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
EXTRA_BUFFER_RESPONSE_TIME = 1
|
|
29
28
|
|
|
30
29
|
class Action(Enum):
|
|
31
30
|
# All adapters
|
|
32
31
|
SELECT_ADAPTER = "select"
|
|
33
32
|
OPEN = "open" # (descriptor,stop_condition) -> ()
|
|
34
|
-
CLOSE = (
|
|
35
|
-
|
|
36
|
-
)
|
|
37
|
-
FORCE_CLOSE = "force_close" # (descriptor,) -> ()
|
|
33
|
+
CLOSE = "close" # (descriptor,force) -> ()
|
|
34
|
+
#FORCE_CLOSE = "force_close" # (descriptor,) -> ()
|
|
38
35
|
WRITE = "write" # (descriptor,data) -> ()
|
|
39
36
|
READ = "read" # (descriptor,full_output,temporary_timeout,temporary_stop_condition) -> (data,metrics)
|
|
40
|
-
|
|
37
|
+
SET_STOP_CONDITIONs = "set_stop_condition" # (descriptor,stop_condition)
|
|
41
38
|
FLUSHREAD = "flushread"
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
START_READ = "start_read" # Start a read (descriptor,response_time)
|
|
40
|
+
RESPONSE_TIMEOUT = "response_timeout"
|
|
41
|
+
#GET_BACKEND_TIME = "get_time"
|
|
44
42
|
|
|
45
|
-
#
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
# Signal
|
|
44
|
+
ADAPTER_SIGNAL = "adapter_signal"
|
|
45
|
+
#ADAPTER_EVENT_DATA_READY = "event_adapter_data_ready"
|
|
46
|
+
#ADAPTER_EVENT_DISCONNECTED = "event_adapter_disconnected"
|
|
47
|
+
#ADAPTER_EVENT_READ_INIT = "event_adapter_read_init"
|
|
49
48
|
|
|
50
49
|
# Other
|
|
51
50
|
SET_ROLE_ADAPTER = (
|
|
@@ -73,8 +72,8 @@ class Action(Enum):
|
|
|
73
72
|
ERROR_FAILED_TO_OPEN = "error_failed_to_open"
|
|
74
73
|
|
|
75
74
|
|
|
76
|
-
def is_event(action: Action) -> bool:
|
|
77
|
-
|
|
75
|
+
# def is_event(action: Action) -> bool:
|
|
76
|
+
# return action.value.startswith("event_")
|
|
78
77
|
|
|
79
78
|
|
|
80
79
|
def is_action_error(action: Action) -> bool:
|
|
@@ -138,7 +137,7 @@ def backend_request(
|
|
|
138
137
|
conn: Connection,
|
|
139
138
|
action: Action,
|
|
140
139
|
*args: Any,
|
|
141
|
-
timeout: float =
|
|
140
|
+
timeout: float = EXTRA_BUFFER_RESPONSE_TIME,
|
|
142
141
|
) -> BackendResponse:
|
|
143
142
|
try:
|
|
144
143
|
conn.send((action.value, *args))
|
syndesi/tools/errors.py
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
# Author : Sébastien Deriaz
|
|
3
3
|
# License : GPL
|
|
4
4
|
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
PACKAGE_PATH = Path(__file__).resolve().parent.parent
|
|
5
8
|
|
|
6
9
|
class SyndesiError(Exception):
|
|
7
10
|
"""Base class for all Syndesi errors"""
|
|
@@ -21,3 +24,28 @@ class AdapterBackendError(BackendError):
|
|
|
21
24
|
|
|
22
25
|
class AdapterError(SyndesiError):
|
|
23
26
|
"""Error inside an adapter frontend"""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def make_error_description(e : Exception) -> str:
|
|
30
|
+
tb = e.__traceback__
|
|
31
|
+
if tb is None:
|
|
32
|
+
error_message = ""
|
|
33
|
+
else:
|
|
34
|
+
while True:
|
|
35
|
+
if tb.tb_next is None:
|
|
36
|
+
break
|
|
37
|
+
file = Path(tb.tb_next.tb_frame.f_code.co_filename).resolve()
|
|
38
|
+
if not file.is_relative_to(PACKAGE_PATH):
|
|
39
|
+
break
|
|
40
|
+
tb = tb.tb_next
|
|
41
|
+
|
|
42
|
+
_type = type(e)
|
|
43
|
+
extra_arguments = (str(e),)
|
|
44
|
+
frame = tb.tb_frame
|
|
45
|
+
line_no = tb.tb_lineno
|
|
46
|
+
filename = frame.f_code.co_filename
|
|
47
|
+
error_message = (
|
|
48
|
+
f"{_type} : {extra_arguments} {filename}:{line_no}"
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
return error_message
|
syndesi/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: syndesi
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: Syndesi
|
|
5
5
|
Author-email: Sébastien Deriaz <sebastien.deriaz1@gmail.com>
|
|
6
6
|
License: GPL
|
|
@@ -17,6 +17,7 @@ License-File: LICENSE
|
|
|
17
17
|
Requires-Dist: prompt_toolkit
|
|
18
18
|
Requires-Dist: pyserial
|
|
19
19
|
Requires-Dist: rich
|
|
20
|
+
Requires-Dist: platformdirs
|
|
20
21
|
Dynamic: license-file
|
|
21
22
|
|
|
22
23
|
# Syndesi Python Implementation
|
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
syndesi/__init__.py,sha256=FjPBCp-hgUfpzbl9vvNVybvP3Ml8toibnew9kZH2cQw,360
|
|
2
2
|
syndesi/__main__.py,sha256=S9G9k0SHGJJ9qMdF_txtYryiPdEPTI10bgQ-M-rVITs,75
|
|
3
|
-
syndesi/version.py,sha256=
|
|
3
|
+
syndesi/version.py,sha256=QtuM82B6eYOf3QWKLl_-fN_VKqrn8cvKRV7h6wJk9qc,68
|
|
4
4
|
syndesi/adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
syndesi/adapters/adapter.py,sha256=
|
|
6
|
-
syndesi/adapters/auto.py,sha256=
|
|
7
|
-
syndesi/adapters/ip.py,sha256=
|
|
5
|
+
syndesi/adapters/adapter.py,sha256=8GzXsg9J8PuPywhnLfEq5Hhae80QLLiYArLbGpHRy_Y,21147
|
|
6
|
+
syndesi/adapters/auto.py,sha256=SSNlo_EpjWJIqjpSyYPOYBKowVsd1TlaS8_-nng-Bp4,1592
|
|
7
|
+
syndesi/adapters/ip.py,sha256=s-TRHwgyVG-FYxDWB2W1qVwmjox00XL3RyUrOoRJEeQ,3392
|
|
8
8
|
syndesi/adapters/ip_server.py,sha256=8o0cPRxAjnzTvwTCADy6MaNCDc5Uk0NDMXo0sZXoYCY,3773
|
|
9
|
-
syndesi/adapters/serialport.py,sha256=
|
|
10
|
-
syndesi/adapters/stop_condition.py,sha256=
|
|
11
|
-
syndesi/adapters/timeout.py,sha256=
|
|
12
|
-
syndesi/adapters/visa.py,sha256=
|
|
9
|
+
syndesi/adapters/serialport.py,sha256=GeMVfwqgpTL0mR0LfI--4M80EwSg4zvjj03FIGh-x9g,2362
|
|
10
|
+
syndesi/adapters/stop_condition.py,sha256=1mMPpwv1oYSaPV83Avgn0LVuijdhlB-eSqlC38rgJ9o,4495
|
|
11
|
+
syndesi/adapters/timeout.py,sha256=XS-dPZEdR4hS1DzQQUKO2fqNd65SuFLHdc1oSG8yFH0,3179
|
|
12
|
+
syndesi/adapters/visa.py,sha256=dbszb9qFaPc3iiFh8KQV2bQK-QrwTcCUA36yPip4dkU,1406
|
|
13
13
|
syndesi/adapters/backend/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
-
syndesi/adapters/backend/adapter_backend.py,sha256=
|
|
14
|
+
syndesi/adapters/backend/adapter_backend.py,sha256=JX19P7LXI1ywyLzsYY0qCZ0ZVDjUHhp143zEWNg08hk,13894
|
|
15
15
|
syndesi/adapters/backend/adapter_manager.py,sha256=8t_4D3WGtkvdF5RdnFiBJASD3_xny5eBxP8ZQI5BmgM,1938
|
|
16
|
-
syndesi/adapters/backend/adapter_session.py,sha256=
|
|
16
|
+
syndesi/adapters/backend/adapter_session.py,sha256=IhhhtJiBQdMKZWCQjwv9Ko98uqKlm_gW1Jb-MW4eFo0,14149
|
|
17
17
|
syndesi/adapters/backend/backend.py,sha256=yoEYW9wnkii8b6TkiQNz_iRLjB8kdhzZG3Ky1dcycxI,15862
|
|
18
18
|
syndesi/adapters/backend/backend_tools.py,sha256=fkl4_lgW9QKb1fTiC9LvkI88g4SD9K9rxS3qMVc_0FA,1893
|
|
19
|
-
syndesi/adapters/backend/descriptors.py,sha256=
|
|
20
|
-
syndesi/adapters/backend/ip_backend.py,sha256=
|
|
21
|
-
syndesi/adapters/backend/serialport_backend.py,sha256=
|
|
22
|
-
syndesi/adapters/backend/stop_condition_backend.py,sha256=
|
|
19
|
+
syndesi/adapters/backend/descriptors.py,sha256=jG-r-71e5H5sZb8mshNbHbpdLKAzdwa8xW3PqyGJCoI,4299
|
|
20
|
+
syndesi/adapters/backend/ip_backend.py,sha256=KCUacNyZAAYmDKm8ght6ssoYYRvIxg2eV-J9OdsiPtg,5122
|
|
21
|
+
syndesi/adapters/backend/serialport_backend.py,sha256=YzUcuTbXP_pHhwLOG1EbRVG9q6Wy4PLn8psAkiLPdiQ,8463
|
|
22
|
+
syndesi/adapters/backend/stop_condition_backend.py,sha256=102ObiC30khJu85Y4Hn3xodN7HExkJrT9PzS2YywYRM,6995
|
|
23
23
|
syndesi/adapters/backend/timed_queue.py,sha256=CwE3PklJqwwwbjyVvdEXIHXAIMwQSGPeBX3O_Kk4wH8,1163
|
|
24
24
|
syndesi/adapters/backend/timeout.py,sha256=thWUajfgvasPLptf0n5TvWLEjp3F2k0s3EAbAICpdvU,10480
|
|
25
|
-
syndesi/adapters/backend/visa_backend.py,sha256=
|
|
25
|
+
syndesi/adapters/backend/visa_backend.py,sha256=Roty2XkF1sMfI0fDSqh4drAiRXIyG8uIOTKe5dEnXrk,6350
|
|
26
26
|
syndesi/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
27
27
|
syndesi/cli/backend_console.py,sha256=9INqGf2EtnuCxFYWZbNCJ3exrx6k04uCh6jno8sUQTw,2971
|
|
28
28
|
syndesi/cli/backend_status.py,sha256=uD-IS0RcPsWGaKCue0sR-_aTy3cytipSk4C0Rl7w4AY,11908
|
|
29
29
|
syndesi/cli/backend_wrapper.py,sha256=dbBZs0NaWh2OiV3eh_D6_njfkPj_vYGJsY_SSY7QaCI,1900
|
|
30
30
|
syndesi/cli/console.py,sha256=eNxp7XxE30pVJUNRWwbmtSE6XIrFzWvdWuwieNiO_d0,10417
|
|
31
31
|
syndesi/cli/shell.py,sha256=iM05uHyslASz_fBROwiapJPHgWde5EPQTPlgJ34ATfs,7786
|
|
32
|
-
syndesi/cli/shell_tools.py,sha256=
|
|
32
|
+
syndesi/cli/shell_tools.py,sha256=YGPeB1Le4exvtrcLOaKnpDrAlSosztvW4AkChvBLm4E,3455
|
|
33
33
|
syndesi/cli/terminal.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
34
|
syndesi/cli/terminal_apps.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
35
|
syndesi/cli/terminal_tools.py,sha256=VsqN-i7MM29Vo0gIUqFmgTyvMRBkcNuw6H3M4jJ4b4o,285
|
|
36
36
|
syndesi/protocols/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
37
|
-
syndesi/protocols/delimited.py,sha256=
|
|
38
|
-
syndesi/protocols/modbus.py,sha256=
|
|
37
|
+
syndesi/protocols/delimited.py,sha256=NxrK77eAkXFTVEq8-5DfKPjKiYSS51JtQOFZF5dabx8,6992
|
|
38
|
+
syndesi/protocols/modbus.py,sha256=SrQFVJU5Mmx0Gt3UiQlZoQMtNTZ63GiKDHS-LJMMT9E,52981
|
|
39
39
|
syndesi/protocols/protocol.py,sha256=r4Hdc5UvR3oYsFW7NYiOYQBG-K0MPEJGHygK3jlp4pI,2263
|
|
40
|
-
syndesi/protocols/raw.py,sha256=
|
|
41
|
-
syndesi/protocols/scpi.py,sha256=
|
|
40
|
+
syndesi/protocols/raw.py,sha256=BgpYykw2Bp-RGnbRGbQVgf5NEveXh1UPDn4PoMn2P7o,2759
|
|
41
|
+
syndesi/protocols/scpi.py,sha256=XmjYn3NnaUNKWBpVmDDvwWy1AYz7XZtm-pYuR47eHwg,4801
|
|
42
42
|
syndesi/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
43
|
syndesi/scripts/syndesi.py,sha256=sCY14-_YUG27PjteGDPWboS2nO092qpfGpdfU0Rulj4,1386
|
|
44
44
|
syndesi/scripts/syndesi_backend.py,sha256=wrJt-_ciuKumOgbcNTcpNGQj7XN_toJ_Mp_IjdA5TZA,914
|
|
45
45
|
syndesi/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
46
|
-
syndesi/tools/backend_api.py,sha256=
|
|
46
|
+
syndesi/tools/backend_api.py,sha256=xVujKez8a9cF-9yC_uHhhNazIzA3SwVZDuaqpHvOFpE,6293
|
|
47
47
|
syndesi/tools/backend_logger.py,sha256=dpST6jKQz7bq58C-JLLpawZZPie1EcW9vKvsS8L1CFA,2300
|
|
48
|
-
syndesi/tools/errors.py,sha256=
|
|
48
|
+
syndesi/tools/errors.py,sha256=ZUS6wRnZlP3Lzw9uA8goU0a_h4DIs-qClm_dkTUCY9s,1226
|
|
49
49
|
syndesi/tools/exceptions.py,sha256=4zWJFMpNgVHMW91zFX-CafVhBFuP-P8h5tgvHlQMWw4,372
|
|
50
50
|
syndesi/tools/internal.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
51
51
|
syndesi/tools/log.py,sha256=k_L3kMm4r_Vxfw1B7znGXRxsMc_Fo37t5Ky6yZxmE_o,7686
|
|
52
52
|
syndesi/tools/log_settings.py,sha256=CEshxSpIZeVu1BUhy-l1Fel1PY_hxb5ywsYQs9UEUVQ,382
|
|
53
53
|
syndesi/tools/types.py,sha256=7k3rbKZCxSDNA6T1p3sS6TvEclV1HCDeWCW8ymBN0Vo,2498
|
|
54
|
-
syndesi-0.
|
|
55
|
-
syndesi-0.
|
|
56
|
-
syndesi-0.
|
|
57
|
-
syndesi-0.
|
|
58
|
-
syndesi-0.
|
|
59
|
-
syndesi-0.
|
|
54
|
+
syndesi-0.4.1.dist-info/licenses/LICENSE,sha256=7oldAMqsditrYeX4dzMFHpFZ-6AkyGi3bha2zeaJB0A,34492
|
|
55
|
+
syndesi-0.4.1.dist-info/METADATA,sha256=XXstLwl8AU6NG0PhjVWd0D59gaLUple_WuurTegIE8Q,5101
|
|
56
|
+
syndesi-0.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
57
|
+
syndesi-0.4.1.dist-info/entry_points.txt,sha256=1JbZYMX6PrakEg-6b_M_f58QJ1mGFJKJd7puoPQPyKM,112
|
|
58
|
+
syndesi-0.4.1.dist-info/top_level.txt,sha256=HrY36JU6hFYp_6qv-GuVBBtHYYemn8qhCrqpvXBd1Lg,8
|
|
59
|
+
syndesi-0.4.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|