1
0
Fork 0

Adding upstream version 3.0.30.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-04-16 08:48:42 +02:00
parent b6d29f411e
commit 635a85607c
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
35 changed files with 212 additions and 195 deletions

View file

@ -6,6 +6,8 @@ Thanks to Vincent Michel for this!
https://gist.github.com/vxgmichel/7685685b3e5ead04ada4a3ba75a48eef
"""
from __future__ import annotations
import asyncio
import pathlib
@ -15,7 +17,7 @@ from prompt_toolkit.contrib.ssh.server import (
PromptToolkitSSHServer,
PromptToolkitSSHSession,
)
from prompt_toolkit.contrib.telnet.server import TelnetServer
from prompt_toolkit.contrib.telnet.server import TelnetConnection, TelnetServer
from ptpython.repl import embed
@ -28,7 +30,7 @@ def ensure_key(filename: str = "ssh_host_key") -> str:
return str(path)
async def interact(connection: PromptToolkitSSHSession) -> None:
async def interact(connection: PromptToolkitSSHSession | TelnetConnection) -> None:
global_dict = {**globals(), "print": print_formatted_text}
await embed(return_asyncio_coroutine=True, globals=global_dict)