Browse Source

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

master
manetta 5 months ago
parent
commit
de5b1d961d
  1. 6
      LogBot/logbot.py

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

Loading…
Cancel
Save