Run black on sources

This commit is contained in:
Griatch 2024-06-27 16:01:09 +02:00
parent 9ca41b5d0d
commit 9c3ba936e4
27 changed files with 153 additions and 90 deletions

View file

@ -474,7 +474,7 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, _BASE_SESSION_CLASS):
_RE_N.sub("", prompt) + ("||n" if prompt.endswith("|") else "|n"),
strip_ansi=nocolor,
xterm256=xterm256,
truecolor=truecolor
truecolor=truecolor,
)
if mxp:
prompt = mxp_parse(prompt)
@ -511,7 +511,7 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, _BASE_SESSION_CLASS):
strip_ansi=nocolor,
xterm256=xterm256,
mxp=mxp,
truecolor=truecolor
truecolor=truecolor,
)
if mxp:
linetosend = mxp_parse(linetosend)

View file

@ -130,10 +130,10 @@ class Ttype:
self.protocol.protocol_flags["NOPROMPTGOAHEAD"] = False
if (
clientname.startswith("XTERM")
or clientname.endswith("-256COLOR")
or clientname
in (
clientname.startswith("XTERM")
or clientname.endswith("-256COLOR")
or clientname
in (
"ATLANTIS", # > 0.9.9.0 (aug 2009)
"CMUD", # > 3.04 (mar 2009)
"KILDCLIENT", # > 2.2.0 (sep 2005)
@ -143,17 +143,13 @@ class Ttype:
"BEIP", # > 2.00.206 (late 2009) (BeipMu)
"POTATO", # > 2.00 (maybe earlier)
"TINYFUGUE", # > 4.x (maybe earlier)
)
)
):
xterm256 = True
# use name to identify support for xterm truecolor
truecolor = False
if (clientname.endswith("-TRUECOLOR") or
clientname in (
"AXMUD",
"TINTIN"
)):
if clientname.endswith("-TRUECOLOR") or clientname in ("AXMUD", "TINTIN"):
truecolor = True
# all clients supporting TTYPE at all seem to support ANSI
@ -169,9 +165,9 @@ class Ttype:
tupper = term.upper()
# identify xterm256 based on flag
xterm256 = (
tupper.endswith("-256COLOR")
or tupper.endswith("XTERM") # Apple Terminal, old Tintin
and not tupper.endswith("-COLOR") # old Tintin, Putty
tupper.endswith("-256COLOR")
or tupper.endswith("XTERM") # Apple Terminal, old Tintin
and not tupper.endswith("-COLOR") # old Tintin, Putty
)
if xterm256:
self.protocol.protocol_flags["ANSI"] = True