From 1c1f871f2a43ce2bba9a7e81558cd385362b0957 Mon Sep 17 00:00:00 2001 From: manetta Date: Sun, 7 Mar 2021 10:51:43 +0100 Subject: [PATCH] adding spaces to the f strings when {} appear --- LogBot/logbot.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/LogBot/logbot.py b/LogBot/logbot.py index d07e039..ca28a0d 100644 --- a/LogBot/logbot.py +++ b/LogBot/logbot.py @@ -65,17 +65,17 @@ class Logbot(Bot): media_type = "video" else: media_type = None - self.log.info(f"Unable to determine media type of {message.url.lower()}") + self.log.info(f"Unable to determine media type of { message.url.lower() }") # download file data = urllib.request.urlopen(message.url).read() if data: - self.log.info(f"downloading: {message.url}") + self.log.info(f"downloading: { message.url }") parsed_url = urlparse(message.url) filename = ( os.path.basename(parsed_url.path).replace(" ", "_").replace("%20", "_") ) # safe url's - self.log.info(f"as the file: {filename}") + self.log.info(f"as the file: { filename }") roomname = re.sub(r"@.*", "", message.room) path = os.path.join(self.output, roomname, media_type) if not os.path.isdir(path): @@ -169,9 +169,9 @@ class Logbot(Bot): def group(self, message): """All the things LogBot does when it receives a group message.""" self.log.info("------------------") - self.log.info(f"message: {message.text}") - self.log.info(f"room: {message.room}") - self.log.info(f"sender: {message.sender}") + self.log.info(f"message: { message.text }") + self.log.info(f"room: { message.room }") + self.log.info(f"sender: { message.sender }") self.log.info("------------------") # image / PDF / audio / video @@ -194,7 +194,7 @@ class Logbot(Bot): if key in self.db[message.room]["messages"]: self.log.info( - f"To be deleted: {self.db[message.room]['messages'][key]}" + f"To be deleted: { self.db[message.room]['messages'][key] }" ) reply = f"This message is deleted: { self.db[message.room]['messages'][key] }" del self.db[message.room]["messages"][key]