summaryrefslogtreecommitdiffstats
path: root/src/prompt_toolkit/output
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 /src/prompt_toolkit/output
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 'src/prompt_toolkit/output')
-rw-r--r--src/prompt_toolkit/output/base.py1
-rw-r--r--src/prompt_toolkit/output/vt100.py3
-rw-r--r--src/prompt_toolkit/output/win32.py12
3 files changed, 9 insertions, 7 deletions
diff --git a/src/prompt_toolkit/output/base.py b/src/prompt_toolkit/output/base.py
index 3c38cec..6ba09fd 100644
--- a/src/prompt_toolkit/output/base.py
+++ b/src/prompt_toolkit/output/base.py
@@ -1,6 +1,7 @@
"""
Interface for an output.
"""
+
from __future__ import annotations
from abc import ABCMeta, abstractmethod
diff --git a/src/prompt_toolkit/output/vt100.py b/src/prompt_toolkit/output/vt100.py
index 142deab..069636b 100644
--- a/src/prompt_toolkit/output/vt100.py
+++ b/src/prompt_toolkit/output/vt100.py
@@ -6,6 +6,7 @@ A lot of thanks, regarding outputting of colors, goes to the Pygments project:
everything has been highly optimized.)
http://pygments.org/
"""
+
from __future__ import annotations
import io
@@ -521,7 +522,7 @@ class Vt100_Output(Output):
"eterm-color",
): # Not supported by the Linux console.
self.write_raw(
- "\x1b]2;%s\x07" % title.replace("\x1b", "").replace("\x07", "")
+ "\x1b]2;{}\x07".format(title.replace("\x1b", "").replace("\x07", ""))
)
def clear_title(self) -> None:
diff --git a/src/prompt_toolkit/output/win32.py b/src/prompt_toolkit/output/win32.py
index edeca09..83ccea4 100644
--- a/src/prompt_toolkit/output/win32.py
+++ b/src/prompt_toolkit/output/win32.py
@@ -73,11 +73,11 @@ class NoConsoleScreenBufferError(Exception):
if xterm:
message = (
- "Found %s, while expecting a Windows console. "
+ "Found {}, while expecting a Windows console. "
'Maybe try to run this program using "winpty" '
"or run it in cmd.exe instead. Or otherwise, "
"in case of Cygwin, use the Python executable "
- "that is compiled for Cygwin." % os.environ["TERM"]
+ "that is compiled for Cygwin.".format(os.environ["TERM"])
)
else:
message = "No Windows console found. Are you running cmd.exe?"
@@ -163,13 +163,13 @@ class Win32Output(Output):
self.flush()
if _DEBUG_RENDER_OUTPUT:
- self.LOG.write(("%r" % func.__name__).encode("utf-8") + b"\n")
+ self.LOG.write((f"{func.__name__!r}").encode() + b"\n")
self.LOG.write(
- b" " + ", ".join(["%r" % i for i in a]).encode("utf-8") + b"\n"
+ b" " + ", ".join([f"{i!r}" for i in a]).encode("utf-8") + b"\n"
)
self.LOG.write(
b" "
- + ", ".join(["%r" % type(i) for i in a]).encode("utf-8")
+ + ", ".join([f"{type(i)!r}" for i in a]).encode("utf-8")
+ b"\n"
)
self.LOG.flush()
@@ -370,7 +370,7 @@ class Win32Output(Output):
data = "".join(self._buffer)
if _DEBUG_RENDER_OUTPUT:
- self.LOG.write(("%r" % data).encode("utf-8") + b"\n")
+ self.LOG.write((f"{data!r}").encode() + b"\n")
self.LOG.flush()
# Print characters one by one. This appears to be the best solution