/
phprus
/
github_dpdk
Обзор
Документация
Войти
/
phprus
/
github_dpdk
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
dts/framework/remote_session/python_shell.py
38 строк
978 B
Andrew Bailey
dts: add missing type hints to method signatures
21 окт 2025, 14:52
21 окт 2025, 14:52
4d12498
Код
Авторство
О чём код?
# SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2023 PANTHEON.tech s.r.o. """Python interactive shell. Typical usage example in a TestSuite:: from framework.remote_session import PythonShell python_shell = PythonShell(self.tg_node, timeout=5, privileged=True) python_shell.send_command("print('Hello World')") python_shell.close() """ from pathlib import PurePath from typing import ClassVar from .interactive_shell import InteractiveShell, only_active class PythonShell(InteractiveShell): """Python interactive shell.""" #: Python's prompt. _default_prompt: ClassVar[str] = ">>>" #: This forces the prompt to appear after sending a command. _command_extra_chars: ClassVar[str] = "\n" @property def path(self) -> PurePath: """Path to the Python3 executable.""" return PurePath("python3") @only_active def close(self) -> None: """Close Python shell.""" return super().close()