diff --git a/build/style.css b/build/style.css index d0d742c..eb0be8c 100644 --- a/build/style.css +++ b/build/style.css @@ -548,3 +548,13 @@ table.portfolio.gray td.deck7 { table.portfolio.gray td.deck8 { color: rgb(228,222,220); } + +/* card search */ + +form * { + display: block; +} + +span.sorttitle { + font-weight: bold; +} diff --git a/generate.py b/generate.py index d92b106..f27cbbe 100644 --- a/generate.py +++ b/generate.py @@ -1,4 +1,4 @@ -import download,indexgen,collectinggen,ownedgen,wantedgen,loggen,levelsgen,tradegen,masteredgen,portfoliosgen +import download,indexgen,collectinggen,ownedgen,wantedgen,loggen,levelsgen,tradegen,masteredgen,portfoliosgen,searchgen download.getimg() indexgen.indexgen() @@ -10,3 +10,4 @@ levelsgen.levelsgen() tradegen.tradeall() masteredgen.masteredall() portfoliosgen.portfoliosgen() +searchgen.searchgen() diff --git a/searchgen.py b/searchgen.py new file mode 100644 index 0000000..adf53df --- /dev/null +++ b/searchgen.py @@ -0,0 +1,103 @@ +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) + 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("