You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.0 KiB
Python

import datetime,os
import log,skel,tcgcore,variables
def tradegen():
if not os.path.isdir("build/trade"):
os.mkdir("build/trade")
if os.path.exists("build/trade/index.html"):
os.remove("build/trade/index.html")
thefile = "build/trade/index.html"
skel.headerwrite(thefile,"trade")
content = open(thefile,"a")
content.write("<h1>available for trade</h1>\n<p>")
for card in tcgcore.ownedcards():
if card[0:4] != "sig_":
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])
for sig in siglist:
content.write(tcgcore.printcard(sig))
content.write("</p>\n<p>Trade cards <a href=\"" + variables.tradepost + "\">here</a></p>\n")
content.close()
skel.footerwrite(thefile)
if __name__ == "__main__":
tradegen()