import datetime,os import log,skel def loggen(): if not os.path.isdir("build/log"): os.mkdir("build/log") if os.path.exists("build/log/index.html"): os.remove("build/log/index.html") thefile = "build/log/index.html" skel.headerwrite(thefile,"log") content = open(thefile,"a") content.write("

log

\n") thelog = log.log[::-1] for event in thelog: content.write("

" + event["date"].strftime("%Y-%m-%d") + ": Received ") receivedlist = sorted(event["received"]) for card in receivedlist: content.write("" + card + "") if receivedlist.index(card) == len(receivedlist) - 1: content.write(" ") else: content.write(", ") content.write(" [x].

\n") content.close() skel.footerwrite(thefile) if __name__ == "__main__": loggen()