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

decks in progress

\n") ownedcards = [] decksofinterest = [] for event in log.log: for card in event["received"]: ownedcards.append(card) decksofinterest.append(card[:-2]) ownedcards = sorted(ownedcards) decksofinterest = sorted(list(dict.fromkeys(decksofinterest))) highpriority = [] medpriority = [] for deck in decksofinterest: if deck in priority.high: highpriority.append(deck) else: medpriority.append(deck) if len(highpriority) > 0: content.write("

High priority

\n") for deck in highpriority: content.write("\n\n \n \n \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n
" + deck + "
\n") if len(medpriority) > 0: content.write("

Medium priority

\n") for deck in medpriority: content.write("\n\n \n \n \n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n
" + deck + "
\n") content.close() skel.footerwrite(thefile) if __name__ == "__main__": collectinggen()