15 lines
401 B
Python
15 lines
401 B
Python
|
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/')
|