PyOpenocdClient 0.1.0__tar.gz → 0.1.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.
@@ -0,0 +1,73 @@
1
+ Metadata-Version: 2.4
2
+ Name: PyOpenocdClient
3
+ Version: 0.1.1
4
+ Summary: Library for controlling OpenOCD from Python programs
5
+ Author-email: Jan Matyas <info@janmatyas.net>
6
+ Project-URL: Homepage, https://github.com/HonzaMat/PyOpenocdClient
7
+ Project-URL: Issues, https://github.com/HonzaMat/PyOpenocdClient/issues
8
+ Project-URL: Documentation, https://pyopenocdclient.readthedocs.io/en/latest/
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.7
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Dynamic: license-file
16
+
17
+ # PyOpenocdClient
18
+
19
+ [![Build documentation](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/build_doc.yml/badge.svg?event=schedule)](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/build_doc.yml)
20
+ [![Code quality checks](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/code_quality.yml/badge.svg?event=schedule)](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/code_quality.yml)
21
+ [![Unit tests](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/unit_tests.yml/badge.svg?event=schedule)](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/unit_tests.yml)
22
+ [![Integration tests](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/integration_tests.yml/badge.svg?event=schedule)](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/integration_tests.yml)
23
+
24
+ **PyOpenocdClient** is a Python library for controlling [OpenOCD](https://openocd.org)
25
+ software tool.
26
+
27
+ It allows to send TCL commands from Python programs to OpenOCD &mdash; for instance commands like halt execution of the program, view data in memory, place breakpoints, single-step, ...
28
+
29
+ Main features of PyOpenocdClient:
30
+
31
+ * allow to send any TCL command to OpenOCD and obtain its result;
32
+
33
+ * shorcuts for quick use of most common OpenOCD commands are provided;
34
+
35
+ * command failures are detected (and reported as Python exceptions by default);
36
+
37
+ * the code is fully covered via unit tests;
38
+
39
+ * automatic integration testing against multiple versions of OpenOCD;
40
+
41
+ * the code is multiplatform and portable &mdash; it does not have any dependencies except for the Python's standard library;
42
+
43
+ * fully open-source under a permissive license (MIT license).
44
+
45
+
46
+ ## Quick instructions
47
+
48
+ Install PyOpenocdClient package using Pip:
49
+
50
+ ```bash
51
+ $ python3 -m pip install PyOpenocdClient
52
+ ```
53
+
54
+ Basic usage:
55
+
56
+ ```python
57
+ from py_openocd_client import PyOpenocdClient
58
+
59
+ with PyOpenocdClient(host="localhost", port=6666) as ocd:
60
+
61
+ ocd.reset_halt()
62
+ ocd.cmd("load_image path/to/program.elf")
63
+ ocd.resume()
64
+ # ...
65
+ ```
66
+
67
+ ## Documentation
68
+
69
+ For full documentation, please visit: https://pyopenocdclient.readthedocs.io/en/latest/
70
+
71
+ &nbsp;
72
+
73
+
@@ -0,0 +1,57 @@
1
+ # PyOpenocdClient
2
+
3
+ [![Build documentation](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/build_doc.yml/badge.svg?event=schedule)](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/build_doc.yml)
4
+ [![Code quality checks](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/code_quality.yml/badge.svg?event=schedule)](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/code_quality.yml)
5
+ [![Unit tests](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/unit_tests.yml/badge.svg?event=schedule)](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/unit_tests.yml)
6
+ [![Integration tests](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/integration_tests.yml/badge.svg?event=schedule)](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/integration_tests.yml)
7
+
8
+ **PyOpenocdClient** is a Python library for controlling [OpenOCD](https://openocd.org)
9
+ software tool.
10
+
11
+ It allows to send TCL commands from Python programs to OpenOCD &mdash; for instance commands like halt execution of the program, view data in memory, place breakpoints, single-step, ...
12
+
13
+ Main features of PyOpenocdClient:
14
+
15
+ * allow to send any TCL command to OpenOCD and obtain its result;
16
+
17
+ * shorcuts for quick use of most common OpenOCD commands are provided;
18
+
19
+ * command failures are detected (and reported as Python exceptions by default);
20
+
21
+ * the code is fully covered via unit tests;
22
+
23
+ * automatic integration testing against multiple versions of OpenOCD;
24
+
25
+ * the code is multiplatform and portable &mdash; it does not have any dependencies except for the Python's standard library;
26
+
27
+ * fully open-source under a permissive license (MIT license).
28
+
29
+
30
+ ## Quick instructions
31
+
32
+ Install PyOpenocdClient package using Pip:
33
+
34
+ ```bash
35
+ $ python3 -m pip install PyOpenocdClient
36
+ ```
37
+
38
+ Basic usage:
39
+
40
+ ```python
41
+ from py_openocd_client import PyOpenocdClient
42
+
43
+ with PyOpenocdClient(host="localhost", port=6666) as ocd:
44
+
45
+ ocd.reset_halt()
46
+ ocd.cmd("load_image path/to/program.elf")
47
+ ocd.resume()
48
+ # ...
49
+ ```
50
+
51
+ ## Documentation
52
+
53
+ For full documentation, please visit: https://pyopenocdclient.readthedocs.io/en/latest/
54
+
55
+ &nbsp;
56
+
57
+
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "PyOpenocdClient"
3
- version = "0.1.0"
3
+ version = "0.1.1"
4
4
  authors = [
5
5
  { name="Jan Matyas", email="info@janmatyas.net" },
6
6
  ]
@@ -0,0 +1,73 @@
1
+ Metadata-Version: 2.4
2
+ Name: PyOpenocdClient
3
+ Version: 0.1.1
4
+ Summary: Library for controlling OpenOCD from Python programs
5
+ Author-email: Jan Matyas <info@janmatyas.net>
6
+ Project-URL: Homepage, https://github.com/HonzaMat/PyOpenocdClient
7
+ Project-URL: Issues, https://github.com/HonzaMat/PyOpenocdClient/issues
8
+ Project-URL: Documentation, https://pyopenocdclient.readthedocs.io/en/latest/
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.7
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Dynamic: license-file
16
+
17
+ # PyOpenocdClient
18
+
19
+ [![Build documentation](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/build_doc.yml/badge.svg?event=schedule)](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/build_doc.yml)
20
+ [![Code quality checks](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/code_quality.yml/badge.svg?event=schedule)](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/code_quality.yml)
21
+ [![Unit tests](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/unit_tests.yml/badge.svg?event=schedule)](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/unit_tests.yml)
22
+ [![Integration tests](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/integration_tests.yml/badge.svg?event=schedule)](https://github.com/HonzaMat/PyOpenocdClient/actions/workflows/integration_tests.yml)
23
+
24
+ **PyOpenocdClient** is a Python library for controlling [OpenOCD](https://openocd.org)
25
+ software tool.
26
+
27
+ It allows to send TCL commands from Python programs to OpenOCD &mdash; for instance commands like halt execution of the program, view data in memory, place breakpoints, single-step, ...
28
+
29
+ Main features of PyOpenocdClient:
30
+
31
+ * allow to send any TCL command to OpenOCD and obtain its result;
32
+
33
+ * shorcuts for quick use of most common OpenOCD commands are provided;
34
+
35
+ * command failures are detected (and reported as Python exceptions by default);
36
+
37
+ * the code is fully covered via unit tests;
38
+
39
+ * automatic integration testing against multiple versions of OpenOCD;
40
+
41
+ * the code is multiplatform and portable &mdash; it does not have any dependencies except for the Python's standard library;
42
+
43
+ * fully open-source under a permissive license (MIT license).
44
+
45
+
46
+ ## Quick instructions
47
+
48
+ Install PyOpenocdClient package using Pip:
49
+
50
+ ```bash
51
+ $ python3 -m pip install PyOpenocdClient
52
+ ```
53
+
54
+ Basic usage:
55
+
56
+ ```python
57
+ from py_openocd_client import PyOpenocdClient
58
+
59
+ with PyOpenocdClient(host="localhost", port=6666) as ocd:
60
+
61
+ ocd.reset_halt()
62
+ ocd.cmd("load_image path/to/program.elf")
63
+ ocd.resume()
64
+ # ...
65
+ ```
66
+
67
+ ## Documentation
68
+
69
+ For full documentation, please visit: https://pyopenocdclient.readthedocs.io/en/latest/
70
+
71
+ &nbsp;
72
+
73
+
@@ -22,8 +22,8 @@ class PyOpenocdClient:
22
22
 
23
23
  - :meth:`cmd` method to send any TCL command to OpenOCD and obtain
24
24
  the command result,
25
- - convenience methods to issue some of the most common OpenOCD commands --
26
- :meth:`halt`, :meth:`resume`, :meth:`read_memory`, :meth:`get_reg`, ..., etc.
25
+ - convenience methods (shortcuts) to issue some of the most common OpenOCD commands
26
+ -- :meth:`halt`, :meth:`resume`, :meth:`read_memory`, :meth:`get_reg`, ..., etc.
27
27
 
28
28
  Basic usage:
29
29
 
@@ -298,8 +298,8 @@ class PyOpenocdClient:
298
298
 
299
299
  def curstate(self) -> str:
300
300
  """
301
- Determinte the state of the currently selected target via the `currstate`
302
- command. Return the state as a string.
301
+ Determinte the state of the currently selected target via
302
+ the ``<target_name> curstate`` command. Return the state as a string.
303
303
  """
304
304
  return self.cmd("[target current] curstate").out.strip()
305
305
 
@@ -666,11 +666,24 @@ class PyOpenocdClient:
666
666
  def shutdown(self) -> None:
667
667
  """
668
668
  Shut down the OpenOCD process by sending the ``shutdown`` command to it.
669
- Then terminate the connection.
669
+ PyOpenocd client also gets immediately disconnected from OpenOCD.
670
670
  """
671
- # OpenOCD's shutdown command returns a non-zero error code (which is expected).
672
- # For that reason, throw=False is used.
673
- self.cmd("shutdown", throw=False)
671
+ # Different OpenOCD versions respond to "shutdown" command differently:
672
+ #
673
+ # - OpenOCD 0.12.0 and older:
674
+ # The "shutdown" command results in a non-zero TCL return code,
675
+ # which can be obtained normally as for any other TCL command -
676
+ # e.g. via the "catch" command.
677
+ #
678
+ # - OpenOCD 0.13.0-dev and newer (from to commit "93f16eed4"):
679
+ # The "shutdown" command immediately ends the TCL processing and
680
+ # an empty response is sent back to the TCL client.
681
+
682
+ # For the above reasons, send the shutdown command via raw_cmd() and:
683
+ # - don't wrap "shutdown" into any other TCL commands,
684
+ # - don't expect any particular response.
685
+ self.raw_cmd("shutdown")
686
+
674
687
  self.disconnect()
675
688
 
676
689
  def raw_cmd(self, raw_cmd: str, timeout: Optional[float] = None) -> str:
@@ -1,50 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: PyOpenocdClient
3
- Version: 0.1.0
4
- Summary: Library for controlling OpenOCD from Python programs
5
- Author-email: Jan Matyas <info@janmatyas.net>
6
- Project-URL: Homepage, https://github.com/HonzaMat/PyOpenocdClient
7
- Project-URL: Issues, https://github.com/HonzaMat/PyOpenocdClient/issues
8
- Project-URL: Documentation, https://pyopenocdclient.readthedocs.io/en/latest/
9
- Classifier: Programming Language :: Python :: 3
10
- Classifier: License :: OSI Approved :: MIT License
11
- Classifier: Operating System :: OS Independent
12
- Requires-Python: >=3.7
13
- Description-Content-Type: text/markdown
14
- License-File: LICENSE
15
-
16
- # PyOpenocdClient
17
-
18
- **PyOpenocdClient** is a Python library for controlling [OpenOCD](https://openocd.org)
19
- software tool.
20
-
21
- It allows to send any TCL commands from Python programs to OpenOCD and receive results of these commands (for instance commands like halt execution of the program, view data in memory, place breakpoints, single-step, ...).
22
-
23
- ## Quick instructions
24
-
25
- Install PyOpenocdClient package using Pip:
26
-
27
- ```bash
28
- $ python3 -m pip install PyOpenocdClient
29
- ```
30
-
31
- Basic usage:
32
-
33
- ```python
34
- from py_openocd_client import PyOpenocdClient
35
-
36
- with PyOpenocdClient(host="localhost", port=6666) as ocd:
37
-
38
- ocd.reset_halt()
39
- ocd.cmd("load_image path/to/program.elf")
40
- ocd.resume()
41
- # ...
42
- ```
43
-
44
- ## Documentation
45
-
46
- For full documentation, please visit: https://pyopenocdclient.readthedocs.io/en/latest/
47
-
48
- &nbsp;
49
-
50
-
@@ -1,35 +0,0 @@
1
- # PyOpenocdClient
2
-
3
- **PyOpenocdClient** is a Python library for controlling [OpenOCD](https://openocd.org)
4
- software tool.
5
-
6
- It allows to send any TCL commands from Python programs to OpenOCD and receive results of these commands (for instance commands like halt execution of the program, view data in memory, place breakpoints, single-step, ...).
7
-
8
- ## Quick instructions
9
-
10
- Install PyOpenocdClient package using Pip:
11
-
12
- ```bash
13
- $ python3 -m pip install PyOpenocdClient
14
- ```
15
-
16
- Basic usage:
17
-
18
- ```python
19
- from py_openocd_client import PyOpenocdClient
20
-
21
- with PyOpenocdClient(host="localhost", port=6666) as ocd:
22
-
23
- ocd.reset_halt()
24
- ocd.cmd("load_image path/to/program.elf")
25
- ocd.resume()
26
- # ...
27
- ```
28
-
29
- ## Documentation
30
-
31
- For full documentation, please visit: https://pyopenocdclient.readthedocs.io/en/latest/
32
-
33
- &nbsp;
34
-
35
-
@@ -1,50 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: PyOpenocdClient
3
- Version: 0.1.0
4
- Summary: Library for controlling OpenOCD from Python programs
5
- Author-email: Jan Matyas <info@janmatyas.net>
6
- Project-URL: Homepage, https://github.com/HonzaMat/PyOpenocdClient
7
- Project-URL: Issues, https://github.com/HonzaMat/PyOpenocdClient/issues
8
- Project-URL: Documentation, https://pyopenocdclient.readthedocs.io/en/latest/
9
- Classifier: Programming Language :: Python :: 3
10
- Classifier: License :: OSI Approved :: MIT License
11
- Classifier: Operating System :: OS Independent
12
- Requires-Python: >=3.7
13
- Description-Content-Type: text/markdown
14
- License-File: LICENSE
15
-
16
- # PyOpenocdClient
17
-
18
- **PyOpenocdClient** is a Python library for controlling [OpenOCD](https://openocd.org)
19
- software tool.
20
-
21
- It allows to send any TCL commands from Python programs to OpenOCD and receive results of these commands (for instance commands like halt execution of the program, view data in memory, place breakpoints, single-step, ...).
22
-
23
- ## Quick instructions
24
-
25
- Install PyOpenocdClient package using Pip:
26
-
27
- ```bash
28
- $ python3 -m pip install PyOpenocdClient
29
- ```
30
-
31
- Basic usage:
32
-
33
- ```python
34
- from py_openocd_client import PyOpenocdClient
35
-
36
- with PyOpenocdClient(host="localhost", port=6666) as ocd:
37
-
38
- ocd.reset_halt()
39
- ocd.cmd("load_image path/to/program.elf")
40
- ocd.resume()
41
- # ...
42
- ```
43
-
44
- ## Documentation
45
-
46
- For full documentation, please visit: https://pyopenocdclient.readthedocs.io/en/latest/
47
-
48
- &nbsp;
49
-
50
-
File without changes