bots/RECbot.wip/log/log.py

15 lines
401 B
Python
Raw Normal View History

2021-01-11 23:08:38 +01:00
import os
from jinja2 import Template
def generate_log_page(input, output):
files = os.listdir(input)
template = Template(open('./log/templates/index.html').read())
html = template.render(entries=files)
print(html)
logfile = os.path.join(output, 'index.html')
with open(logfile, 'w') as log:
log.write(html)
if __name__ == "__main__":
generate_log_page('./testing/entries/', './testing/')