adding more minor hacky checks for old foldername that include the full path of the muc in the json db

This commit is contained in:
manetta 2021-05-06 23:12:04 +02:00
parent 03e662e33b
commit de5b1d961d

View File

@ -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: