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("
" + event["date"].strftime("%Y-%m-%d") + "
: Received ")
receivedlist = sorted(event["received"])
for card in receivedlist:
with open("build/decks/" + card[:-2] + "/type") as thetype:
cardtype = thetype.read()
content.write("")
if cardtype == "red":
content.write("🔴")
elif cardtype == "orange":
content.write("🟠")
elif cardtype == "yellow":
content.write("🟡")
elif cardtype == "green":
content.write("🟢")
elif cardtype == "blue":
content.write("🔵")
elif cardtype == "purple":
content.write("🟣")
elif cardtype == "brown":
content.write("🟤")
elif cardtype == "gray":
content.write("⚪")
elif cardtype == "special":
content.write("✨")
content.write(card + "")
if receivedlist.index(card) == len(receivedlist) - 1:
content.write(" ")
else:
content.write(", ")
content.write(" [" + event["event"] + "].