Ran black on sources

This commit is contained in:
Griatch 2024-04-27 22:26:18 +02:00
parent 49330826f3
commit fd39935d19
9 changed files with 56 additions and 29 deletions

View file

@ -94,10 +94,13 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, _BASE_SESSION_CLASS):
"""
try:
# Do we have a NAWS update?
if (NAWS in data and
len([data[i:i+1] for i in range(0, len(data))]) == 9 and
# Is auto resizing on?
self.protocol_flags.get('AUTORESIZE')):
if (
NAWS in data
and len([data[i : i + 1] for i in range(0, len(data))]) == 9
and
# Is auto resizing on?
self.protocol_flags.get("AUTORESIZE")
):
self.sessionhandler.sync(self.sessionhandler.get(self.sessid))
super().dataReceived(data)

View file

@ -258,7 +258,9 @@ class TelnetOOB:
gmcp_cmdname = EVENNIA_TO_GMCP[cmdname]
elif "_" in cmdname:
# enforce initial capitalization of each command part, leaving fully-capitalized sections intact
gmcp_cmdname = ".".join(word.capitalize() if not word.isupper() else word for word in cmdname.split("_"))
gmcp_cmdname = ".".join(
word.capitalize() if not word.isupper() else word for word in cmdname.split("_")
)
else:
gmcp_cmdname = "Core.%s" % (cmdname if cmdname.istitle() else cmdname.capitalize())