summaryrefslogtreecommitdiffstats
path: root/examples/telnet
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-05 04:45:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-05 04:45:14 +0000
commit5b43aaac61ac94abe722bc98ae58468618f2f512 (patch)
tree3d58c89faa23d194f83abb24ae1fd05067538fff /examples/telnet
parentAdding upstream version 3.0.43. (diff)
downloadprompt-toolkit-upstream.tar.xz
prompt-toolkit-upstream.zip
Adding upstream version 3.0.46.upstream/3.0.46upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'examples/telnet')
-rwxr-xr-xexamples/telnet/chat-app.py5
-rwxr-xr-xexamples/telnet/dialog.py1
-rwxr-xr-xexamples/telnet/hello-world.py1
-rwxr-xr-xexamples/telnet/toolbar.py1
4 files changed, 6 insertions, 2 deletions
diff --git a/examples/telnet/chat-app.py b/examples/telnet/chat-app.py
index 2e3508d..8f4cb2c 100755
--- a/examples/telnet/chat-app.py
+++ b/examples/telnet/chat-app.py
@@ -4,6 +4,7 @@ A simple chat application over telnet.
Everyone that connects is asked for his name, and then people can chat with
each other.
"""
+
import logging
import random
from asyncio import Future, run
@@ -84,9 +85,9 @@ def _send_to_everyone(sender_connection, name, message, color):
if c != sender_connection:
c.send_above_prompt(
[
- ("fg:" + color, "[%s]" % name),
+ ("fg:" + color, f"[{name}]"),
("", " "),
- ("fg:" + color, "%s\n" % message),
+ ("fg:" + color, f"{message}\n"),
]
)
diff --git a/examples/telnet/dialog.py b/examples/telnet/dialog.py
index c674a9d..1044fb0 100755
--- a/examples/telnet/dialog.py
+++ b/examples/telnet/dialog.py
@@ -2,6 +2,7 @@
"""
Example of a telnet application that displays a dialog window.
"""
+
import logging
from asyncio import Future, run
diff --git a/examples/telnet/hello-world.py b/examples/telnet/hello-world.py
index c19c60c..f7bbda1 100755
--- a/examples/telnet/hello-world.py
+++ b/examples/telnet/hello-world.py
@@ -6,6 +6,7 @@ The interaction function is a prompt_toolkit coroutine.
Also see the `hello-world-asyncio.py` example which uses an asyncio coroutine.
That is probably the preferred way if you only need Python 3 support.
"""
+
import logging
from asyncio import run
diff --git a/examples/telnet/toolbar.py b/examples/telnet/toolbar.py
index d6ae886..6e31c9f 100755
--- a/examples/telnet/toolbar.py
+++ b/examples/telnet/toolbar.py
@@ -3,6 +3,7 @@
Example of a telnet application that displays a bottom toolbar and completions
in the prompt.
"""
+
import logging
from asyncio import run