Fix PEP8 in PR #2390

This commit is contained in:
Griatch 2021-05-09 15:43:21 +02:00
parent e306b2ba27
commit 76c1e09c84
3 changed files with 7 additions and 3 deletions

View file

@ -40,7 +40,9 @@ class SuppressGA(object):
self.protocol = protocol
self.protocol.protocol_flags["NOGOAHEAD"] = True
self.protocol.protocol_flags["NOPROMPTGOAHEAD"] = True # Used to send a GA after a prompt line only, set in TTYPE (per client)
self.protocol.protocol_flags[
"NOPROMPTGOAHEAD"
] = True # Used to send a GA after a prompt line only, set in TTYPE (per client)
# tell the client that we prefer to suppress GA ...
self.protocol.will(SUPPRESS_GA).addCallbacks(self.will_suppress_ga, self.wont_suppress_ga)

View file

@ -440,7 +440,8 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
prompt = mxp_parse(prompt)
prompt = to_bytes(prompt, self)
prompt = prompt.replace(IAC, IAC + IAC).replace(b"\n", b"\r\n")
if not self.protocol_flags.get("NOPROMPTGOAHEAD", self.protocol_flags.get("NOGOAHEAD", True)):
if not self.protocol_flags.get("NOPROMPTGOAHEAD",
self.protocol_flags.get("NOGOAHEAD", True)):
prompt += IAC + GA
self.transport.write(mccp_compress(self, prompt))
else:

View file

@ -119,7 +119,8 @@ class Ttype(object):
if clientname.startswith("MUDLET"):
# supports xterm256 stably since 1.1 (2010?)
xterm256 = clientname.split("MUDLET", 1)[1].strip() >= "1.1"
# Mudlet likes GA's on a prompt line for the prompt trigger to match, if it's not wanting NOGOAHEAD.
# Mudlet likes GA's on a prompt line for the prompt trigger to
# match, if it's not wanting NOGOAHEAD.
if not self.protocol.protocol_flags["NOGOAHEAD"]:
self.protocol.protocol_flags["NOGOAHEAD"] = True
self.protocol.protocol_flags["NOPROMPTGOAHEAD"] = False