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 tcgcore.priority(card[:-2]) == "high": hpw.append(card) elif tcgcore.priority(card[:-2]) == "medium": mpw.append(card) elif tcgcore.priority(card[:-2]) == "low": 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 tcgcore.priority(card[:-2]) == "medium": hpt.append(card) elif tcgcore.priority(card[:-2]) == "low": 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()