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

available for trade

\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 not tcgcore.collecting(card[:-2]): if tcgcore.cardtype(card) == colour: content.write(tcgcore.printcard(card)) else: if not tcgcore.collecting(card[:-2]): content.write(tcgcore.printcard(card)) siglist = [] for card in tcgcore.ownedcards(): if card == "sig_" + variables.name.lower(): siglist.append(card) if variables.keepsig == True: siglist.remove(siglist[0]) if colour: if colour == "sig": for sig in siglist: content.write(tcgcore.printcard(sig)) else: for sig in siglist: content.write(tcgcore.printcard(sig)) content.write("

\n

Trade cards here

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