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

owned cards

\n

") if colour: content.write("Filtered to ") if colour == "gray": if variables.british: content.write("grey") else: content.write("gray") else: content.write(colour) content.write(". Show all") else: content.write("Filter: 🔴 🟠 🟡 🟢 🔵 🟣 🟤 ⚪ ✨") content.write("

\n

") for card in tcgcore.ownedcards(): if card[0:4] != "sig_": if colour: if tcgcore.cardtype(card) == colour: content.write(tcgcore.printcard(card)) else: content.write(tcgcore.printcard(card)) content.write("

\n") content.close() skel.footerwrite(thefile) def ownedall(): ownedgen() for type in tcgcore.typelist: ownedgen(type) if __name__ == "__main__": ownedall()