import datetime,os import log,variables,skel,tcgcore 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") decksofinterest = [] for event in log.log: try: for card in event["received"]: decksofinterest.append(card[:-2]) except: pass decksofinterest = sorted(list(dict.fromkeys(decksofinterest))) highpriority = [] medpriority = [] lowpriority = [] for deck in decksofinterest: if deck in variables.highpriority: highpriority.append(deck) elif deck in variables.medpriority: medpriority.append(deck) else: lowpriority.append(deck) if len(highpriority) > 0: content.write("

High priority

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

Medium priority

\n") for deck in medpriority: content.write(tcgcore.printdeck(deck)) if len(lowpriority) > 0: content.write("

Low priority

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