[v3,4/6] dts: add python remote interactive shell

Message ID 20230719141303.33284-5-juraj.linkes@pantheon.tech (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series dts: tg abstractions and scapy tg |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Juraj Linkeš July 19, 2023, 2:13 p.m. UTC
  The shell can be used to remotely run any Python code interactively.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 dts/framework/remote_session/remote/python_shell.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 dts/framework/remote_session/remote/python_shell.py
  

Patch

diff --git a/dts/framework/remote_session/remote/python_shell.py b/dts/framework/remote_session/remote/python_shell.py
new file mode 100644
index 0000000000..cc3ad48a68
--- /dev/null
+++ b/dts/framework/remote_session/remote/python_shell.py
@@ -0,0 +1,12 @@ 
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2023 PANTHEON.tech s.r.o.
+
+from pathlib import PurePath
+
+from .interactive_shell import InteractiveShell
+
+
+class PythonShell(InteractiveShell):
+    _default_prompt: str = ">>>"
+    _command_extra_chars: str = "\n"
+    path: PurePath = PurePath("python3")