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

wanted cards

\n") decksofinterest = [] for card in tcgcore.ownedcards(): if card[0:4] != "sig_": decksofinterest.append(card[:-2]) decksofinterest = sorted(list(dict.fromkeys(decksofinterest))) highpriority = [] medpriority = [] lowpriority = [] for deck in decksofinterest: if tcgcore.collecting(deck): wantedlist = ["01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20"] for card in wantedlist: combined = deck + card if combined not in tcgcore.ownedcards(): if tcgcore.priority(deck) == "high": highpriority.append(combined) elif tcgcore.priority(deck) == "medium": medpriority.append(combined) elif tcgcore.priority(deck) == "low": lowpriority.append(combined) if len(highpriority) > 0: content.write("

High priority

\n\n

") for card in highpriority: content.write(tcgcore.cardtext(card)) if highpriority.index(card) == len(highpriority) - 1: content.write(" ") else: content.write(", ") content.write("

\n") if len(medpriority) > 0: content.write("

Medium priority

\n\n

") for card in medpriority: content.write(tcgcore.cardtext(card)) if medpriority.index(card) == len(medpriority) - 1: content.write(" ") else: content.write(", ") content.write("

\n") if len(lowpriority) > 0: content.write("

Low priority

\n\n

") for card in lowpriority: content.write(tcgcore.cardtext(card)) if lowpriority.index(card) == len(lowpriority) - 1: content.write(" ") else: content.write(", ") content.write("

\n") content.write("

I’m probably also interested in anything I’m mass collecting.

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