From 0274438c12f9b9da5995c02adc7c8c0b82c71da9 Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Wed, 27 Jan 2021 17:33:13 +0100 Subject: [PATCH] linting code --- src/chatserver.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/chatserver.py b/src/chatserver.py index b254cf2..7aacf85 100644 --- a/src/chatserver.py +++ b/src/chatserver.py @@ -26,6 +26,7 @@ out of memory errors. Please try again later.""" + class Message: def __init__(self, author: str, content: str): self.author = author @@ -89,7 +90,7 @@ def check_command(self, msg: str, ip: str) -> str: msg = msg.strip() if msg.startswith("/"): - cmd, *data = msg.split(' ') + cmd, *data = msg.split(" ") if cmd == "/register": result = self.register_user(data, ip) if not result: @@ -101,7 +102,7 @@ def check_command(self, msg: str, ip: str) -> str: return "ERROR Unknown command." elif msg.startswith("@"): if len(self.messages) >= MESSAGE_LIMIT: - self.messages = self.messages[-int(MESSAGE_LIMIT / 1000 + 1):] + self.messages = self.messages[-int(MESSAGE_LIMIT / 1000 + 1) :] usertag, *data = msg.split(' ') # remove the @ @@ -109,9 +110,7 @@ def check_command(self, msg: str, ip: str) -> str: if usertag not in self.users: return ERROR_UNKNOWN_USERTAG else: - self.messages.append( - Message(self.users[usertag].name, " ".join(data)) - ) + self.messages.append(Message(self.users[usertag].name, " ".join(data))) return "OK." else: return ERROR_NOT_REGISTERED