Rener using built-in template
This commit is contained in:
parent
0f3c2e758b
commit
8e8b54e3e1
@ -102,11 +102,10 @@ class Logbot(Bot):
|
|||||||
|
|
||||||
def _write_log(self, message):
|
def _write_log(self, message):
|
||||||
"""Write new log to the file system."""
|
"""Write new log to the file system."""
|
||||||
template = jinja2.Template(open("template.html").read())
|
|
||||||
room_name = self._parse_room_name(message.room)
|
room_name = self._parse_room_name(message.room)
|
||||||
log_path = os.path.join(self.output, room_name, "index.html")
|
log_path = os.path.join(self.output, room_name, "index.html")
|
||||||
with open(log_path, "w") as out:
|
with open(log_path, "w") as out:
|
||||||
html = template.render(
|
html = self.template.render(
|
||||||
title=self.db[message.room]["title"],
|
title=self.db[message.room]["title"],
|
||||||
db=self.db[message.room]["messages"],
|
db=self.db[message.room]["messages"],
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user