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.

38 lines
1.1 KiB
Python

3 weeks ago
import datetime,os
import log,skel,tcgcore,variables
3 weeks ago
def ownedgen(colour=False):
3 weeks ago
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)
3 weeks ago
skel.headerwrite(thefile,"owned")
content = open(thefile,"a")
content.write("<h1>owned cards</h1>\n")
content.write(tcgcore.filterwrite("owned",colour))
content.write("<p>")
for card in tcgcore.ownedcards():
3 weeks ago
if card[0:4] != "sig_":
if colour:
if tcgcore.cardtype(card) == colour:
content.write(tcgcore.printcard(card))
else:
content.write(tcgcore.printcard(card))
3 weeks ago
content.write("</p>\n")
content.close()
skel.footerwrite(thefile)
def ownedall():
3 weeks ago
ownedgen()
for type in tcgcore.typelist:
ownedgen(type)
if __name__ == "__main__":
ownedall()