pyxcp 0.21.11__tar.gz → 0.22.1__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.
Potentially problematic release.
This version of pyxcp might be problematic. Click here for more details.
- {pyxcp-0.21.11 → pyxcp-0.22.1}/PKG-INFO +27 -10
- {pyxcp-0.21.11 → pyxcp-0.22.1}/README.md +4 -3
- pyxcp-0.22.1/build_ext.py +72 -0
- pyxcp-0.22.1/pyproject.toml +187 -0
- pyxcp-0.22.1/pyxcp/__init__.py +20 -0
- pyxcp-0.22.1/pyxcp/aml/EtasCANMonitoring.a2l +82 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/aml/XCP_Common.aml +0 -1
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/aml/XCPonUSB.aml +1 -1
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/aml/ifdata_CAN.a2l +0 -1
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/aml/ifdata_Eth.a2l +0 -1
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/aml/ifdata_Flx.a2l +0 -1
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/aml/ifdata_SxI.a2l +0 -1
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/aml/ifdata_USB.a2l +0 -1
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/asam/types.py +4 -4
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/asamkeydll.c +0 -1
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/checksum.py +0 -1
- pyxcp-0.22.1/pyxcp/cmdline.py +52 -0
- pyxcp-0.22.1/pyxcp/config/__init__.py +1089 -0
- pyxcp-0.22.1/pyxcp/config/legacy.py +120 -0
- pyxcp-0.22.1/pyxcp/constants.py +47 -0
- pyxcp-0.22.1/pyxcp/cpp_ext/__init__.py +8 -0
- pyxcp-0.22.1/pyxcp/cpp_ext/bin.hpp +104 -0
- pyxcp-0.22.1/pyxcp/cpp_ext/blockmem.hpp +58 -0
- pyxcp-0.22.1/pyxcp/cpp_ext/daqlist.hpp +197 -0
- pyxcp-0.22.1/pyxcp/cpp_ext/event.hpp +67 -0
- pyxcp-0.22.1/pyxcp/cpp_ext/extension_wrapper.cpp +94 -0
- pyxcp-0.22.1/pyxcp/cpp_ext/helper.hpp +264 -0
- pyxcp-0.22.1/pyxcp/cpp_ext/mcobject.hpp +241 -0
- pyxcp-0.22.1/pyxcp/cpp_ext/tsqueue.hpp +46 -0
- pyxcp-0.22.1/pyxcp/daq_stim/__init__.py +226 -0
- pyxcp-0.22.1/pyxcp/daq_stim/optimize/__init__.py +67 -0
- pyxcp-0.22.1/pyxcp/daq_stim/optimize/binpacking.py +41 -0
- pyxcp-0.22.1/pyxcp/daq_stim/scheduler.cpp +28 -0
- pyxcp-0.22.1/pyxcp/daq_stim/scheduler.hpp +75 -0
- pyxcp-0.22.1/pyxcp/daq_stim/stim.cpp +13 -0
- pyxcp-0.22.1/pyxcp/daq_stim/stim.hpp +604 -0
- pyxcp-0.22.1/pyxcp/daq_stim/stim_wrapper.cpp +48 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/dllif.py +21 -18
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/errormatrix.py +5 -3
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/examples/conf_can.toml +4 -2
- pyxcp-0.22.1/pyxcp/examples/conf_can_vector.json +11 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/examples/conf_can_vector.toml +4 -2
- pyxcp-0.22.1/pyxcp/examples/conf_eth.toml +9 -0
- pyxcp-0.22.1/pyxcp/examples/conf_nixnet.json +20 -0
- pyxcp-0.22.1/pyxcp/examples/conf_sxi.json +9 -0
- pyxcp-0.22.1/pyxcp/examples/ex_arrow.py +109 -0
- pyxcp-0.22.1/pyxcp/examples/ex_mdf.py +124 -0
- pyxcp-0.22.1/pyxcp/examples/ex_sqlite.py +128 -0
- pyxcp-0.22.1/pyxcp/examples/run_daq.py +146 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/examples/xcp_policy.py +6 -7
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/examples/xcp_read_benchmark.py +8 -6
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/examples/xcp_skel.py +0 -2
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/examples/xcp_unlock.py +1 -1
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/examples/xcp_user_supplied_driver.py +1 -2
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/examples/xcphello.py +6 -3
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/examples/xcphello_recorder.py +4 -4
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/master/__init__.py +1 -2
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/master/errorhandler.py +107 -74
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/master/master.py +156 -117
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/recorder/__init__.py +27 -6
- pyxcp-0.22.1/pyxcp/recorder/converter/__init__.py +37 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/recorder/lz4.c +129 -51
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/recorder/lz4.h +45 -28
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/recorder/lz4hc.c +560 -156
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/recorder/lz4hc.h +1 -1
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/recorder/mio.hpp +721 -767
- pyxcp-0.22.1/pyxcp/recorder/reader.hpp +139 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/recorder/reco.py +5 -8
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/recorder/rekorder.cpp +18 -22
- pyxcp-0.22.1/pyxcp/recorder/rekorder.hpp +274 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/recorder/setup.py +11 -10
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/recorder/test_reko.py +2 -3
- pyxcp-0.22.1/pyxcp/recorder/unfolder.hpp +1249 -0
- pyxcp-0.22.1/pyxcp/recorder/wrap.cpp +189 -0
- pyxcp-0.22.1/pyxcp/recorder/writer.hpp +302 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/scripts/pyxcp_probe_can_drivers.py +0 -2
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/scripts/xcp_fetch_a2l.py +15 -10
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/scripts/xcp_id_scanner.py +2 -6
- pyxcp-0.22.1/pyxcp/scripts/xcp_info.py +109 -0
- pyxcp-0.22.1/pyxcp/scripts/xcp_profile.py +27 -0
- pyxcp-0.22.1/pyxcp/stim/__init__.py +0 -0
- pyxcp-0.22.1/pyxcp/tests/test_binpacking.py +184 -0
- pyxcp-0.22.1/pyxcp/tests/test_can.py +1324 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/tests/test_checksum.py +2 -1
- pyxcp-0.22.1/pyxcp/tests/test_daq.py +188 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/tests/test_frame_padding.py +3 -3
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/tests/test_master.py +42 -31
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/tests/test_transport.py +12 -12
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/tests/test_utils.py +2 -5
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/timing.py +0 -2
- pyxcp-0.22.1/pyxcp/transport/__init__.py +10 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/transport/base.py +142 -124
- pyxcp-0.22.1/pyxcp/transport/base_transport.hpp +0 -0
- pyxcp-0.22.1/pyxcp/transport/can.py +443 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/transport/eth.py +80 -82
- pyxcp-0.22.1/pyxcp/transport/sxi.py +133 -0
- pyxcp-0.22.1/pyxcp/transport/transport_wrapper.cpp +0 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/transport/usb_transport.py +65 -83
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/types.py +61 -20
- pyxcp-0.22.1/pyxcp/utils.py +102 -0
- pyxcp-0.22.1/pyxcp/vector/__init__.py +0 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/vector/map.py +1 -3
- pyxcp-0.21.11/build_ext.py +0 -42
- pyxcp-0.21.11/pyproject.toml +0 -138
- pyxcp-0.21.11/pyxcp/__init__.py +0 -28
- pyxcp-0.21.11/pyxcp/aml/EtasCANMonitoring.a2l +0 -83
- pyxcp-0.21.11/pyxcp/cmdline.py +0 -75
- pyxcp-0.21.11/pyxcp/config.py +0 -57
- pyxcp-0.21.11/pyxcp/constants.py +0 -48
- pyxcp-0.21.11/pyxcp/cxx/asynchiofactory.hpp +0 -24
- pyxcp-0.21.11/pyxcp/cxx/blocking_client.cpp +0 -44
- pyxcp-0.21.11/pyxcp/cxx/blocking_socket.cpp +0 -43
- pyxcp-0.21.11/pyxcp/cxx/blocking_socket.hpp +0 -558
- pyxcp-0.21.11/pyxcp/cxx/concurrent_queue.hpp +0 -60
- pyxcp-0.21.11/pyxcp/cxx/eth.hpp +0 -57
- pyxcp-0.21.11/pyxcp/cxx/exceptions.hpp +0 -30
- pyxcp-0.21.11/pyxcp/cxx/iasyncioservice.hpp +0 -31
- pyxcp-0.21.11/pyxcp/cxx/iresource.hpp +0 -17
- pyxcp-0.21.11/pyxcp/cxx/isocket.hpp +0 -22
- pyxcp-0.21.11/pyxcp/cxx/linux/epoll.cpp +0 -51
- pyxcp-0.21.11/pyxcp/cxx/linux/epoll.hpp +0 -87
- pyxcp-0.21.11/pyxcp/cxx/linux/lit_tester.cpp +0 -19
- pyxcp-0.21.11/pyxcp/cxx/linux/socket.hpp +0 -234
- pyxcp-0.21.11/pyxcp/cxx/linux/timeout.hpp +0 -81
- pyxcp-0.21.11/pyxcp/cxx/memoryblock.hpp +0 -42
- pyxcp-0.21.11/pyxcp/cxx/pool.hpp +0 -81
- pyxcp-0.21.11/pyxcp/cxx/poolmgr.cpp +0 -6
- pyxcp-0.21.11/pyxcp/cxx/poolmgr.hpp +0 -31
- pyxcp-0.21.11/pyxcp/cxx/test_queue.cpp +0 -69
- pyxcp-0.21.11/pyxcp/cxx/timestamp.hpp +0 -84
- pyxcp-0.21.11/pyxcp/cxx/utils.cpp +0 -38
- pyxcp-0.21.11/pyxcp/cxx/utils.hpp +0 -29
- pyxcp-0.21.11/pyxcp/cxx/win/iocp.cpp +0 -242
- pyxcp-0.21.11/pyxcp/cxx/win/iocp.hpp +0 -42
- pyxcp-0.21.11/pyxcp/cxx/win/perhandledata.hpp +0 -24
- pyxcp-0.21.11/pyxcp/cxx/win/periodata.hpp +0 -97
- pyxcp-0.21.11/pyxcp/cxx/win/socket.hpp +0 -185
- pyxcp-0.21.11/pyxcp/cxx/win/timeout.hpp +0 -83
- pyxcp-0.21.11/pyxcp/examples/conf_can.json +0 -20
- pyxcp-0.21.11/pyxcp/examples/conf_can_vector.json +0 -11
- pyxcp-0.21.11/pyxcp/examples/conf_eth.json +0 -8
- pyxcp-0.21.11/pyxcp/examples/conf_eth.toml +0 -6
- pyxcp-0.21.11/pyxcp/examples/conf_nixnet.json +0 -20
- pyxcp-0.21.11/pyxcp/examples/conf_sxi.json +0 -9
- pyxcp-0.21.11/pyxcp/logger.py +0 -64
- pyxcp-0.21.11/pyxcp/recorder/rekorder.hpp +0 -661
- pyxcp-0.21.11/pyxcp/recorder/wrap.cpp +0 -27
- pyxcp-0.21.11/pyxcp/scripts/xcp_info.py +0 -89
- pyxcp-0.21.11/pyxcp/tests/test_can.py +0 -230
- pyxcp-0.21.11/pyxcp/tests/test_config.py +0 -62
- pyxcp-0.21.11/pyxcp/transport/__init__.py +0 -10
- pyxcp-0.21.11/pyxcp/transport/can.py +0 -416
- pyxcp-0.21.11/pyxcp/transport/candriver/__init__.py +0 -2
- pyxcp-0.21.11/pyxcp/transport/candriver/pc_canalystii.py +0 -27
- pyxcp-0.21.11/pyxcp/transport/candriver/pc_etas.py +0 -25
- pyxcp-0.21.11/pyxcp/transport/candriver/pc_gsusb.py +0 -23
- pyxcp-0.21.11/pyxcp/transport/candriver/pc_iscan.py +0 -23
- pyxcp-0.21.11/pyxcp/transport/candriver/pc_ixxat.py +0 -27
- pyxcp-0.21.11/pyxcp/transport/candriver/pc_kvaser.py +0 -39
- pyxcp-0.21.11/pyxcp/transport/candriver/pc_neovi.py +0 -31
- pyxcp-0.21.11/pyxcp/transport/candriver/pc_nican.py +0 -23
- pyxcp-0.21.11/pyxcp/transport/candriver/pc_nixnet.py +0 -23
- pyxcp-0.21.11/pyxcp/transport/candriver/pc_pcan.py +0 -25
- pyxcp-0.21.11/pyxcp/transport/candriver/pc_seeed.py +0 -28
- pyxcp-0.21.11/pyxcp/transport/candriver/pc_serial.py +0 -27
- pyxcp-0.21.11/pyxcp/transport/candriver/pc_slcan.py +0 -29
- pyxcp-0.21.11/pyxcp/transport/candriver/pc_socketcan.py +0 -23
- pyxcp-0.21.11/pyxcp/transport/candriver/pc_systec.py +0 -29
- pyxcp-0.21.11/pyxcp/transport/candriver/pc_usb2can.py +0 -30
- pyxcp-0.21.11/pyxcp/transport/candriver/pc_vector.py +0 -34
- pyxcp-0.21.11/pyxcp/transport/candriver/python_can.py +0 -101
- pyxcp-0.21.11/pyxcp/transport/cxx_ext/CMakeLists.txt +0 -51
- pyxcp-0.21.11/pyxcp/transport/cxx_ext/setup.py +0 -49
- pyxcp-0.21.11/pyxcp/transport/cxx_ext/tests/test_basic_socket.cpp +0 -39
- pyxcp-0.21.11/pyxcp/transport/cxx_ext/tests/test_pool.cpp +0 -39
- pyxcp-0.21.11/pyxcp/transport/cxx_ext/tests/test_timestamp.cpp +0 -27
- pyxcp-0.21.11/pyxcp/transport/sxi.py +0 -87
- pyxcp-0.21.11/pyxcp/utils.py +0 -71
- {pyxcp-0.21.11 → pyxcp-0.22.1}/LICENSE +0 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/aml/EtasCANMonitoring.aml +0 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/aml/XCPonCAN.aml +0 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/aml/XCPonEth.aml +0 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/aml/XCPonFlx.aml +0 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/aml/XCPonSxI.aml +0 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/asam/__init__.py +0 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/asamkeydll.sh +0 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/examples/conf_can_user.toml +0 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/examples/conf_socket_can.toml +0 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/examples/conf_sxi.toml +0 -0
- pyxcp-0.21.11/pyxcp/recorder/recorder.rst → pyxcp-0.22.1/pyxcp/py.typed +0 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/recorder/build_clang.cmd +0 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/recorder/build_clang.sh +0 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/recorder/build_gcc.cmd +0 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/recorder/build_gcc.sh +0 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/recorder/build_gcc_arm.sh +0 -0
- pyxcp-0.21.11/pyxcp/scripts/__init__.py → pyxcp-0.22.1/pyxcp/recorder/recorder.rst +0 -0
- {pyxcp-0.21.11/pyxcp/vector → pyxcp-0.22.1/pyxcp/scripts}/__init__.py +0 -0
- {pyxcp-0.21.11 → pyxcp-0.22.1}/pyxcp/tests/test_asam_types.py +2 -2
|
@@ -1,29 +1,43 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyxcp
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.22.1
|
|
4
4
|
Summary: Universal Calibration Protocol for Python
|
|
5
|
+
Home-page: https://github.com/christoph2/pyxcp
|
|
6
|
+
License: LGPLv3
|
|
5
7
|
Keywords: automotive,ecu,xcp,asam,autosar
|
|
6
8
|
Author: Christoph Schueler
|
|
7
|
-
Author-email:
|
|
8
|
-
Requires-Python: >=3.
|
|
9
|
+
Author-email: cpu.gems@googlemail.com
|
|
10
|
+
Requires-Python: >=3.8.1,<4.0.0
|
|
9
11
|
Classifier: Development Status :: 5 - Production/Stable
|
|
10
12
|
Classifier: Intended Audience :: Developers
|
|
11
13
|
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
|
|
14
|
+
Classifier: License :: Other/Proprietary License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
12
17
|
Classifier: Programming Language :: Python :: 3.10
|
|
13
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
21
|
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
18
22
|
Classifier: Topic :: Scientific/Engineering
|
|
19
23
|
Classifier: Topic :: Software Development
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
Requires-Dist: bandit (>=1.7.8,<2.0.0)
|
|
25
|
+
Requires-Dist: chardet (>=5.2.0,<6.0.0)
|
|
26
|
+
Requires-Dist: construct (>=2.10.68,<3.0.0)
|
|
27
|
+
Requires-Dist: line-profiler-pycharm (>=1.1.0,<2.0.0)
|
|
28
|
+
Requires-Dist: mako (>=1.2.4,<2.0.0)
|
|
29
|
+
Requires-Dist: pyserial (>=3.5,<4.0)
|
|
30
|
+
Requires-Dist: python-can (>=4.2.2,<5.0.0)
|
|
31
|
+
Requires-Dist: pytz (>=2024.1,<2025.0)
|
|
32
|
+
Requires-Dist: pyusb (>=1.2.1,<2.0.0)
|
|
33
|
+
Requires-Dist: rich (>=13.6.0,<14.0.0)
|
|
34
|
+
Requires-Dist: toml (>=0.10.2,<0.11.0)
|
|
35
|
+
Requires-Dist: tomlkit (>=0.12.5,<0.13.0)
|
|
36
|
+
Requires-Dist: traitlets (<=5.11.2)
|
|
37
|
+
Requires-Dist: uptime (>=3.0.1,<4.0.0)
|
|
22
38
|
Description-Content-Type: text/markdown
|
|
23
39
|
|
|
24
|
-
|
|
25
|
-
pyXCP
|
|
26
|
-
=====
|
|
40
|
+
# pyXCP
|
|
27
41
|
|
|
28
42
|
[](https://app.codacy.com/app/christoph2/pyxcp?utm_source=github.com&utm_medium=referral&utm_content=christoph2/pyxcp&utm_campaign=Badge_Grade_Settings)
|
|
29
43
|
[](https://codeclimate.com/github/christoph2/pyxcp/maintainability)
|
|
@@ -47,17 +61,20 @@ XCP also replaces the older CCP (CAN Calibration Protocol).
|
|
|
47
61
|
pyXCP is hosted on Github, get the latest release: [https://github.com/christoph2/pyxcp](https://github.com/christoph2/pyxcp)
|
|
48
62
|
|
|
49
63
|
You can install pyxcp from source:
|
|
64
|
+
|
|
50
65
|
```
|
|
51
66
|
pip install -r requirements.txt
|
|
52
67
|
python setup.py install
|
|
53
68
|
```
|
|
54
69
|
|
|
55
70
|
Alternatively, you can install pyxcp from source with pip:
|
|
71
|
+
|
|
56
72
|
```
|
|
57
73
|
pip install git+https://github.com/christoph2/pyxcp.git
|
|
58
74
|
```
|
|
59
75
|
|
|
60
76
|
Alternatively, get pyxcp from [PyPI](https://pypi.org/project/pyxcp/):
|
|
77
|
+
|
|
61
78
|
```
|
|
62
79
|
pip install pyxcp
|
|
63
80
|
```
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
pyXCP
|
|
3
|
-
=====
|
|
1
|
+
# pyXCP
|
|
4
2
|
|
|
5
3
|
[](https://app.codacy.com/app/christoph2/pyxcp?utm_source=github.com&utm_medium=referral&utm_content=christoph2/pyxcp&utm_campaign=Badge_Grade_Settings)
|
|
6
4
|
[](https://codeclimate.com/github/christoph2/pyxcp/maintainability)
|
|
@@ -24,17 +22,20 @@ XCP also replaces the older CCP (CAN Calibration Protocol).
|
|
|
24
22
|
pyXCP is hosted on Github, get the latest release: [https://github.com/christoph2/pyxcp](https://github.com/christoph2/pyxcp)
|
|
25
23
|
|
|
26
24
|
You can install pyxcp from source:
|
|
25
|
+
|
|
27
26
|
```
|
|
28
27
|
pip install -r requirements.txt
|
|
29
28
|
python setup.py install
|
|
30
29
|
```
|
|
31
30
|
|
|
32
31
|
Alternatively, you can install pyxcp from source with pip:
|
|
32
|
+
|
|
33
33
|
```
|
|
34
34
|
pip install git+https://github.com/christoph2/pyxcp.git
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
Alternatively, get pyxcp from [PyPI](https://pypi.org/project/pyxcp/):
|
|
38
|
+
|
|
38
39
|
```
|
|
39
40
|
pip install pyxcp
|
|
40
41
|
```
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
|
|
3
|
+
import multiprocessing as mp
|
|
4
|
+
import os
|
|
5
|
+
import platform
|
|
6
|
+
import re
|
|
7
|
+
import subprocess # nosec
|
|
8
|
+
import sys
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
from tempfile import TemporaryDirectory
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
TOP_DIR = Path(__file__).parent
|
|
14
|
+
|
|
15
|
+
print("Platform", platform.system())
|
|
16
|
+
uname = platform.uname()
|
|
17
|
+
if uname.system == "Darwin":
|
|
18
|
+
os.environ["MACOSX_DEPLOYMENT_TARGET"] = "11.0"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def banner(msg: str) -> None:
|
|
22
|
+
print("=" * 80)
|
|
23
|
+
print(str.center(msg, 80))
|
|
24
|
+
print("=" * 80)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def build_extension(debug: bool = False, use_temp_dir: bool = False) -> None:
|
|
28
|
+
print("CMakeBuild::build_extension()")
|
|
29
|
+
|
|
30
|
+
debug = bool(os.environ.get("DEBUG", 0)) or debug
|
|
31
|
+
cfg = "Debug" if debug else "Release"
|
|
32
|
+
print(f" BUILD-TYPE: {cfg!r}")
|
|
33
|
+
cmake_args = [
|
|
34
|
+
f"-DPYTHON_EXECUTABLE={sys.executable}",
|
|
35
|
+
f"-DCMAKE_BUILD_TYPE={cfg}", # not used on MSVC, but no harm
|
|
36
|
+
]
|
|
37
|
+
build_args = ["--config Release", "--verbose"]
|
|
38
|
+
# cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 /path/to/src
|
|
39
|
+
|
|
40
|
+
if sys.platform.startswith("darwin"):
|
|
41
|
+
# Cross-compile support for macOS - respect ARCHFLAGS if set
|
|
42
|
+
archs = re.findall(r"-arch (\S+)", os.environ.get("ARCHFLAGS", ""))
|
|
43
|
+
if archs:
|
|
44
|
+
cmake_args += ["-DCMAKE_OSX_ARCHITECTURES={}".format(";".join(archs))]
|
|
45
|
+
|
|
46
|
+
if use_temp_dir:
|
|
47
|
+
build_temp = Path(TemporaryDirectory(suffix=".build-temp").name) / "extension_it_in"
|
|
48
|
+
else:
|
|
49
|
+
build_temp = Path(".")
|
|
50
|
+
# print("cwd:", os.getcwd(), "build-dir:", build_temp, "top:", str(TOP_DIR))
|
|
51
|
+
if not build_temp.exists():
|
|
52
|
+
build_temp.mkdir(parents=True)
|
|
53
|
+
|
|
54
|
+
banner("Step #1: Configure")
|
|
55
|
+
# cmake_args += ["--debug-output"]
|
|
56
|
+
subprocess.run(["cmake", str(TOP_DIR), *cmake_args], cwd=build_temp, check=True) # nosec
|
|
57
|
+
|
|
58
|
+
cmake_args += [f"--parallel {mp.cpu_count()}"]
|
|
59
|
+
|
|
60
|
+
banner("Step #2: Build")
|
|
61
|
+
# build_args += ["-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"]
|
|
62
|
+
subprocess.run(["cmake", "--build", build_temp, *build_args], cwd=TOP_DIR, check=True) # nosec
|
|
63
|
+
|
|
64
|
+
banner("Step #3: Install")
|
|
65
|
+
# subprocess.run(["cmake", "--install", "."], cwd=build_temp, check=True) # nosec
|
|
66
|
+
subprocess.run(["cmake", "--install", build_temp], cwd=TOP_DIR, check=True) # nosec
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
if __name__ == "__main__":
|
|
70
|
+
includes = subprocess.getoutput("pybind11-config --cmakedir") # nosec
|
|
71
|
+
os.environ["pybind11_DIR"] = includes
|
|
72
|
+
build_extension(False)
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
|
|
2
|
+
[build-system]
|
|
3
|
+
requires = ["poetry-core>=1.0.0", "setuptools>=68.0.0", "pybind11>=2.12.0", "pybind11[global]>=2.12.0"]
|
|
4
|
+
build-backend = "poetry.core.masonry.api"
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
[tool.poetry.dev-dependencies]
|
|
8
|
+
Pygments = ">=2.10.0"
|
|
9
|
+
bandit = ">=1.7.4"
|
|
10
|
+
black = ">=21.10b0"
|
|
11
|
+
coverage = {extras = ["toml"], version = ">=6.2"}
|
|
12
|
+
darglint = ">=1.8.1"
|
|
13
|
+
flake8 = ">=4.0.1"
|
|
14
|
+
flake8-docstrings = ">=1.6.0"
|
|
15
|
+
flake8-rst-docstrings = ">=0.2.5"
|
|
16
|
+
furo = ">=2021.11.12"
|
|
17
|
+
isort = ">=5.10.1"
|
|
18
|
+
mypy = ">=0.930"
|
|
19
|
+
pep8-naming = ">=0.12.1"
|
|
20
|
+
pre-commit = ">=2.16.0"
|
|
21
|
+
pre-commit-hooks = ">=4.1.0"
|
|
22
|
+
pytest = ">=6.2.5"
|
|
23
|
+
pyupgrade = ">=2.29.1"
|
|
24
|
+
safety = ">=1.10.3"
|
|
25
|
+
sphinx = ">=4.3.2"
|
|
26
|
+
sphinx-autobuild = ">=2021.3.14"
|
|
27
|
+
sphinx-click = ">=3.0.2"
|
|
28
|
+
typeguard = ">=2.13.3"
|
|
29
|
+
xdoctest = {extras = ["colors"], version = ">=0.15.10"}
|
|
30
|
+
myst-parser = {version = ">=0.16.1"}
|
|
31
|
+
|
|
32
|
+
[project]
|
|
33
|
+
name = "pyxcp"
|
|
34
|
+
dynamic = ["license", "readme", "authors", "requires-python", "description", "classifiers", "scripts", "dependencies", "optional-dependencies"]
|
|
35
|
+
|
|
36
|
+
[tool.poetry]
|
|
37
|
+
authors = ["Christoph Schueler <cpu.gems@googlemail.com>"]
|
|
38
|
+
name = "pyxcp"
|
|
39
|
+
version = "0.22.1"
|
|
40
|
+
readme = "README.md"
|
|
41
|
+
description = "Universal Calibration Protocol for Python"
|
|
42
|
+
keywords = ["automotive", "ecu", "xcp", "asam", "autosar"]
|
|
43
|
+
homepage = "https://github.com/christoph2/pyxcp"
|
|
44
|
+
license = "LGPLv3"
|
|
45
|
+
classifiers = [
|
|
46
|
+
"Development Status :: 5 - Production/Stable",
|
|
47
|
+
"Intended Audience :: Developers", "Topic :: Software Development",
|
|
48
|
+
"Topic :: Scientific/Engineering",
|
|
49
|
+
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
|
|
50
|
+
"Programming Language :: Python :: 3.8",
|
|
51
|
+
"Programming Language :: Python :: 3.9",
|
|
52
|
+
"Programming Language :: Python :: 3.10",
|
|
53
|
+
"Programming Language :: Python :: 3.11",
|
|
54
|
+
"Programming Language :: Python :: 3.12",
|
|
55
|
+
"Programming Language :: Python :: 3.13"
|
|
56
|
+
]
|
|
57
|
+
build = "build_ext.py"
|
|
58
|
+
include = [
|
|
59
|
+
{ path = "pyxcp/cpp_ext/*.so", format = "wheel" },
|
|
60
|
+
{ path = "pyxcp/cpp_ext/*.pyd", format = "wheel" },
|
|
61
|
+
{ path = "pyxcp/daq_stim/*.so", format = "wheel" },
|
|
62
|
+
{ path = "pyxcp/daq_stim/*.pyd", format = "wheel" },
|
|
63
|
+
{ path = "pyxcp/recorder/*.so", format = "wheel" },
|
|
64
|
+
{ path = "pyxcp/recorder/*.pyd", format = "wheel" },
|
|
65
|
+
{ path = "pyxcp/*.exe", format = "wheel" },
|
|
66
|
+
{ path = "CMakeLists.txt", format = "wheel" },
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
[tool.poetry.dependencies]
|
|
70
|
+
python = "^3.8.1"
|
|
71
|
+
construct = "^2.10.68"
|
|
72
|
+
mako = "^1.2.4"
|
|
73
|
+
pyserial = "^3.5"
|
|
74
|
+
pyusb = "^1.2.1"
|
|
75
|
+
python-can = "^4.2.2"
|
|
76
|
+
uptime = "^3.0.1"
|
|
77
|
+
rich = "^13.6.0"
|
|
78
|
+
chardet = "^5.2.0"
|
|
79
|
+
traitlets = "<=5.11.2"
|
|
80
|
+
line-profiler-pycharm = "^1.1.0"
|
|
81
|
+
|
|
82
|
+
toml = "^0.10.2"
|
|
83
|
+
bandit = "^1.7.8"
|
|
84
|
+
tomlkit = "^0.12.5"
|
|
85
|
+
pytz = "^2024.1"
|
|
86
|
+
[tool.poetry.group.dev.dependencies]
|
|
87
|
+
ruff = "^0.1.0"
|
|
88
|
+
|
|
89
|
+
pre-commit-hooks = "^4.6.0"
|
|
90
|
+
darglint = "^1.8.1"
|
|
91
|
+
[tool.poetry.scripts]
|
|
92
|
+
pyxcp-probe-can-drivers = "pyxcp.scripts.pyxcp_probe_can_drivers:main"
|
|
93
|
+
xcp-id-scanner = "pyxcp.scripts.xcp_id_scanner:main"
|
|
94
|
+
xcp-fetch-a2l = "pyxcp.scripts.xcp_fetch_a2l:main"
|
|
95
|
+
xcp-info = "pyxcp.scripts.xcp_info:main"
|
|
96
|
+
xcp-profile = "pyxcp.scripts.xcp_profile:main"
|
|
97
|
+
|
|
98
|
+
[tool.pytest]
|
|
99
|
+
addopts = "--verbose --tb=short --junitxml=result.xml -o junit_family=xunit2"
|
|
100
|
+
testpaths = "pyxcp/tests"
|
|
101
|
+
|
|
102
|
+
[tool.isort]
|
|
103
|
+
profile = "black"
|
|
104
|
+
force_single_line = false
|
|
105
|
+
lines_after_imports = 2
|
|
106
|
+
|
|
107
|
+
[tool.mypy]
|
|
108
|
+
strict = false
|
|
109
|
+
warn_unreachable = true
|
|
110
|
+
pretty = true
|
|
111
|
+
show_column_numbers = true
|
|
112
|
+
show_error_context = true
|
|
113
|
+
|
|
114
|
+
[tool.flake8]
|
|
115
|
+
ignore = ["F403", "D203", "E203", "E266", "E501", "W503", "E501", "F401", "BLK100"]
|
|
116
|
+
exclude = '''
|
|
117
|
+
/(
|
|
118
|
+
\.git
|
|
119
|
+
| __pycache__
|
|
120
|
+
| __pypackages__
|
|
121
|
+
| \.mypy_cache
|
|
122
|
+
| \.tox
|
|
123
|
+
| \.venv
|
|
124
|
+
| \.eggs
|
|
125
|
+
| _build
|
|
126
|
+
| build
|
|
127
|
+
| docs
|
|
128
|
+
| dist
|
|
129
|
+
| experimental
|
|
130
|
+
)/
|
|
131
|
+
'''
|
|
132
|
+
max-complexity = 10
|
|
133
|
+
count = true
|
|
134
|
+
statistics = true
|
|
135
|
+
show-source = true
|
|
136
|
+
max-line-length = 132
|
|
137
|
+
select = ["B","C","E","F","W","T4","B9"]
|
|
138
|
+
extend-select = "B950"
|
|
139
|
+
extend-ignore = ["E203", "E501", "E701"]
|
|
140
|
+
|
|
141
|
+
[tool.ruff]
|
|
142
|
+
line-length = 132
|
|
143
|
+
|
|
144
|
+
[tool.black]
|
|
145
|
+
line-length=132
|
|
146
|
+
include = '\.pyi?$'
|
|
147
|
+
exclude = '''
|
|
148
|
+
/(
|
|
149
|
+
\.git
|
|
150
|
+
| \.mypy_cache
|
|
151
|
+
| \.tox
|
|
152
|
+
| \.venv
|
|
153
|
+
| _build
|
|
154
|
+
| build
|
|
155
|
+
| docs
|
|
156
|
+
| experimental
|
|
157
|
+
| __pycache__
|
|
158
|
+
| __pypackages__
|
|
159
|
+
| dist
|
|
160
|
+
)/
|
|
161
|
+
'''
|
|
162
|
+
|
|
163
|
+
[tool.cibuildwheel]
|
|
164
|
+
build-verbosity = 3
|
|
165
|
+
#test-command = "pytest {package}/tests"
|
|
166
|
+
#test-command = "pytest -svv pyxcp/tests"
|
|
167
|
+
build = "cp3{8,9,10,11,12,13}-*"
|
|
168
|
+
skip = ["*-manylinux_i686", "*-musllinux_x86_64", "*-musllinux_i686"] # Skip Linux 32bit and MUSL builds.
|
|
169
|
+
build-frontend = "pip"
|
|
170
|
+
|
|
171
|
+
[tool.pyright]
|
|
172
|
+
include = ["pyxcp", "build_ext.py"]
|
|
173
|
+
ignore = ["pyxcp/conf_test.py", "pyxcp/config_new.py", "pyxcp/config_tr.py", "pyxcp/examples/memxfer.py",
|
|
174
|
+
"pyxcp/examples/ts_tester.py", "pyxcp/recorder/converter/**", "pyxcp/transport/candriver/**", "pyxcp/recorder/simdjson/**",
|
|
175
|
+
"pyxcp/recorder/mio/**", "pyxcp/recorder/lz4/**"]
|
|
176
|
+
#defineConstant = { DEBUG = true }
|
|
177
|
+
#stubPath = "src/stubs"
|
|
178
|
+
|
|
179
|
+
reportMissingImports = true
|
|
180
|
+
reportMissingTypeStubs = false
|
|
181
|
+
|
|
182
|
+
#executionEnvironments = [
|
|
183
|
+
# { root = "src/web", pythonVersion = "3.5", pythonPlatform = "Windows", extraPaths = [ "src/service_libs" ] },
|
|
184
|
+
# { root = "src/sdk", pythonVersion = "3.0", extraPaths = [ "src/backend" ] },
|
|
185
|
+
# { root = "src/tests", extraPaths = ["src/tests/e2e", "src/sdk" ]},
|
|
186
|
+
# { root = "src" }
|
|
187
|
+
#]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""Universal Calibration Protocol for Python."""
|
|
3
|
+
|
|
4
|
+
from rich import pretty
|
|
5
|
+
from rich.console import Console
|
|
6
|
+
from rich.traceback import install as tb_install
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
pretty.install()
|
|
10
|
+
|
|
11
|
+
from .master import Master # noqa: F401, E402
|
|
12
|
+
from .transport import Can, Eth, SxI, Usb # noqa: F401, E402
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
console = Console()
|
|
16
|
+
tb_install(show_locals=True, max_frames=3) # Install custom exception handler.
|
|
17
|
+
|
|
18
|
+
# if you update this manually, do not forget to update
|
|
19
|
+
# .bumpversion.cfg and pyproject.toml.
|
|
20
|
+
__version__ = "0.22.1"
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
ASAP2_VERSION 1 30
|
|
2
|
+
/begin PROJECT
|
|
3
|
+
aProjectName
|
|
4
|
+
"description of project"
|
|
5
|
+
|
|
6
|
+
/begin HEADER
|
|
7
|
+
"project"
|
|
8
|
+
VERSION "1.0"
|
|
9
|
+
PROJECT_NO "1.0"
|
|
10
|
+
/end HEADER
|
|
11
|
+
|
|
12
|
+
/begin MODULE
|
|
13
|
+
aModuleName
|
|
14
|
+
"description of module"
|
|
15
|
+
|
|
16
|
+
/begin MOD_PAR
|
|
17
|
+
""
|
|
18
|
+
/end MOD_PAR
|
|
19
|
+
|
|
20
|
+
/begin IF_DATA CAN_MONITORING
|
|
21
|
+
/begin TP_BLOB
|
|
22
|
+
500
|
|
23
|
+
/end TP_BLOB
|
|
24
|
+
/end IF_DATA
|
|
25
|
+
|
|
26
|
+
/begin MEASUREMENT
|
|
27
|
+
aMeasurementName
|
|
28
|
+
"description of measurement"
|
|
29
|
+
ULONG
|
|
30
|
+
aConversionName
|
|
31
|
+
0
|
|
32
|
+
0.0
|
|
33
|
+
0
|
|
34
|
+
1000
|
|
35
|
+
/begin IF_DATA CAN_MONITORING
|
|
36
|
+
/begin KP_BLOB
|
|
37
|
+
0x0 32
|
|
38
|
+
/end KP_BLOB
|
|
39
|
+
/end IF_DATA
|
|
40
|
+
FORMAT ""
|
|
41
|
+
BYTE_ORDER MSB_LAST
|
|
42
|
+
BIT_MASK 0xFFFFFFFF
|
|
43
|
+
/end MEASUREMENT
|
|
44
|
+
|
|
45
|
+
/begin COMPU_METHOD
|
|
46
|
+
aConversionName
|
|
47
|
+
"description of conversion"
|
|
48
|
+
RAT_FUNC
|
|
49
|
+
"%f5.2"
|
|
50
|
+
""
|
|
51
|
+
COEFFS 0 1.0 0.0 0 0 1
|
|
52
|
+
/end COMPU_METHOD
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
/begin FRAME
|
|
62
|
+
aFrameName
|
|
63
|
+
"description of frame"
|
|
64
|
+
0
|
|
65
|
+
0
|
|
66
|
+
/begin IF_DATA CAN_MONITORING
|
|
67
|
+
QP_BLOB 0x0200 0 8
|
|
68
|
+
/end IF_DATA
|
|
69
|
+
FRAME_MEASUREMENT aMeasurementName
|
|
70
|
+
/end FRAME
|
|
71
|
+
|
|
72
|
+
/begin FUNCTION
|
|
73
|
+
aFunctionName
|
|
74
|
+
"description of function"
|
|
75
|
+
/begin OUT_MEASUREMENT
|
|
76
|
+
aMeasurementName
|
|
77
|
+
/end OUT_MEASUREMENT
|
|
78
|
+
/end FUNCTION
|
|
79
|
+
|
|
80
|
+
/end MODULE
|
|
81
|
+
|
|
82
|
+
/end PROJECT
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
2
|
import struct
|
|
4
3
|
|
|
4
|
+
|
|
5
5
|
INTEL = "<"
|
|
6
6
|
MOTOROLA = ">"
|
|
7
7
|
|
|
@@ -15,7 +15,7 @@ MOTOROLA = ">"
|
|
|
15
15
|
"""
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
class AsamBaseType
|
|
18
|
+
class AsamBaseType:
|
|
19
19
|
"""Base class for ASAM codecs.
|
|
20
20
|
|
|
21
21
|
Note
|
|
@@ -51,7 +51,7 @@ class AsamBaseType(object):
|
|
|
51
51
|
bytes
|
|
52
52
|
Encoded value.
|
|
53
53
|
"""
|
|
54
|
-
return struct.pack("{
|
|
54
|
+
return struct.pack(f"{self.byteorder}{self.FMT}", value)
|
|
55
55
|
|
|
56
56
|
def decode(self, value):
|
|
57
57
|
"""Decode a value.
|
|
@@ -68,7 +68,7 @@ class AsamBaseType(object):
|
|
|
68
68
|
data-type
|
|
69
69
|
data-type is determined by derived class.
|
|
70
70
|
"""
|
|
71
|
-
return struct.unpack("{
|
|
71
|
+
return struct.unpack(f"{self.byteorder}{self.FMT}", bytes(value))[0]
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
class A_Uint8(AsamBaseType):
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""
|
|
3
|
+
Parse (transport-layer specific) command line parameters
|
|
4
|
+
and create a XCP master instance.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import warnings
|
|
8
|
+
from dataclasses import dataclass
|
|
9
|
+
from typing import List
|
|
10
|
+
|
|
11
|
+
from pyxcp.config import create_application
|
|
12
|
+
from pyxcp.master import Master
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
warnings.simplefilter("always")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@dataclass
|
|
19
|
+
class Option:
|
|
20
|
+
short_opt: str
|
|
21
|
+
long_opt: str = ""
|
|
22
|
+
dest: str = ""
|
|
23
|
+
help: str = ""
|
|
24
|
+
type: str = ""
|
|
25
|
+
default: str = ""
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class FakeParser:
|
|
29
|
+
|
|
30
|
+
options: List[Option] = []
|
|
31
|
+
|
|
32
|
+
def add_argument(self, short_opt: str, long_opt: str = "", dest: str = "", help: str = "", type: str = "", default: str = ""):
|
|
33
|
+
warnings.warn("Argument parser extension is currently not supported.", DeprecationWarning, 2)
|
|
34
|
+
self.options.append(Option(short_opt, long_opt, dest, help, type, default))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class ArgumentParser:
|
|
38
|
+
def __init__(self, callout=None, *args, **kws):
|
|
39
|
+
self._parser = FakeParser()
|
|
40
|
+
if callout is not None:
|
|
41
|
+
warnings.warn("callout argument is currently not supported.", DeprecationWarning, 2)
|
|
42
|
+
|
|
43
|
+
def run(self, policy=None, transport_layer_interface=None):
|
|
44
|
+
application = create_application(self.parser.options)
|
|
45
|
+
master = Master(
|
|
46
|
+
application.transport.layer, config=application, policy=policy, transport_layer_interface=transport_layer_interface
|
|
47
|
+
)
|
|
48
|
+
return master
|
|
49
|
+
|
|
50
|
+
@property
|
|
51
|
+
def parser(self):
|
|
52
|
+
return self._parser
|