From de5b1d961d87a799f78acb446b56269d399249cc Mon Sep 17 00:00:00 2001 From: manetta Date: Thu, 6 May 2021 23:12:04 +0200 Subject: [PATCH] adding more minor hacky checks for old foldername that include the full path of the muc in the json db --- LogBot/logbot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/LogBot/logbot.py b/LogBot/logbot.py index ac65c30..38e1e80 100644 --- a/LogBot/logbot.py +++ b/LogBot/logbot.py @@ -104,7 +104,9 @@ class Logbot(Bot): def _write_log(self, message): """Write new log to the file system.""" template = jinja2.Template(open("template.html").read()) - folder_name = self.db[message.room]["folder"] + folder_name = self.db[message.room]["folder"] + if "@" in folder_name: # hacky + folder_name = self._parse_room_name(folder_name) log_path = os.path.join(self.output, folder_name, "index.html") with open(log_path, "w") as out: html = template.render( @@ -117,6 +119,8 @@ class Logbot(Bot): def _generate_feed(self, message): template = jinja2.Template(open("feed.rss").read()) folder_name = self.db[message.room]["folder"] + if "@" in folder_name: # hacky + folder_name = self._parse_room_name(folder_name) feed_path = os.path.join(self.output, folder_name, "feed.rss") date = datetime.now() with open(feed_path, "w") as out: