import datetime,os import log,skel,tcgcore,variables massdecks = dict(sorted(variables.masscollect.items())) massowned = {} for series in massdecks: ownedlist = [] for card in tcgcore.ownedcards(): if card[:-2] in massdecks[series]: ownedlist.append(card) if len(ownedlist) > 0: ownedlist = sorted(list(dict.fromkeys(ownedlist))) massowned[series] = ownedlist def massindexgen(): if not os.path.isdir("build/mass"): os.mkdir("build/mass") thefile = "build/mass/index.html" if os.path.exists(thefile): os.remove(thefile) skel.headerwrite(thefile,"mass") content = open(thefile,"a") content.write("
") themassdecks = [] for card in massowned[series]: themassdecks.append(card[:-2]) themassdecks = sorted(list(dict.fromkeys(themassdecks))) massmastered = [] for deck in themassdecks: if tcgcore.deckmastered(deck): massmastered.append(deck) if len(massmastered) > 0: for deck in massmastered: content.write("") content.write("
") for card in massowned[series]: content.write(tcgcore.printcard(card)) content.write("
\n") content.close() skel.footerwrite(thefile) def massall(): massindexgen() massindex = 1 for series in massowned: massseriesgen(series,massindex) massindex += 1 if __name__ == "__main__": massall()