import os import skel,tcgcore,variables def searchgen(): decksofinterest = [] for card in tcgcore.ownedcards(): if card[0:4] != "sig_": decksofinterest.append(card[:-2]) decksofinterest = sorted(list(dict.fromkeys(decksofinterest))) wantedcards = [] ownedcollecting = [] for deck in decksofinterest: 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 in tcgcore.ownedcards(): if tcgcore.collecting(deck): ownedcollecting.append(combined) else: wantedcards.append(combined) hpw = [] mpw = [] lpw = [] hpt = [] mpt = [] lpt = [] for card in wantedcards: if card[:-2] in variables.highpriority: hpw.append(card) elif card[:-2] in variables.medpriority: mpw.append(card) else: if tcgcore.collecting(card[:-2]): lpw.append(card) previouscard = "" for card in tcgcore.ownedcards(): if card[0:4] != "sig_": if card == previouscard: lpt.append(card) else: if not tcgcore.deckmastered(card[:-2]): if card in ownedcollecting: if card[:-2] in variables.medpriority: hpt.append(card) else: if card[:-2] not in variables.highpriority: mpt.append(card) else: lpt.append(card) previouscard = card if not os.path.isdir("build/search"): os.mkdir("build/search") thefile = "build/search/index.html" if os.path.exists(thefile): os.remove(thefile) skel.headerwrite(thefile,"search") content = open(thefile,"a") content.write("

card search

\n
\n \n \n \n
\n

\n

\n

\n

\n

\n

\n

\n\n \n \n") content.close() if __name__ == "__main__": searchgen()