|
|
|
@ -464,12 +464,20 @@ def footerwrite(thefile):
|
|
|
|
|
footer.close()
|
|
|
|
|
|
|
|
|
|
def printcard(card):
|
|
|
|
|
if card["colour"] == "sig":
|
|
|
|
|
return "<img src=\"/decks/sigs/" + card["name"][4:] + ".gif\" title=\"" + card["name"] + "\" loading=\"lazy\">"
|
|
|
|
|
else:
|
|
|
|
|
deck = card["name"][:-2]
|
|
|
|
|
cardid = card["name"][-2:]
|
|
|
|
|
return "<img src=\"/decks/" + deck + "/" + cardid + ".gif\" title=\"" + card["name"] + "\" loading=\"lazy\">"
|
|
|
|
|
if type(card) == dict:
|
|
|
|
|
if card["colour"] == "sig":
|
|
|
|
|
return "<img src=\"/decks/sigs/" + card["name"][4:] + ".gif\" title=\"" + card["name"] + "\" loading=\"lazy\">"
|
|
|
|
|
else:
|
|
|
|
|
deck = card["name"][:-2]
|
|
|
|
|
cardid = card["name"][-2:]
|
|
|
|
|
return "<img src=\"/decks/" + deck + "/" + cardid + ".gif\" title=\"" + card["name"] + "\" loading=\"lazy\">"
|
|
|
|
|
elif type(card) == str:
|
|
|
|
|
if card[0:4] == "sig_":
|
|
|
|
|
return "<img src=\"/decks/sigs/" + card[4:] + ".gif\" title=\"" + card + "\" loading=\"lazy\">"
|
|
|
|
|
else:
|
|
|
|
|
deck = card[:-2]
|
|
|
|
|
cardid = card[-2:]
|
|
|
|
|
return "<img src=\"/decks/" + deck + "/" + cardid + ".gif\" title=\"" + card + "\" loading=\"lazy\">"
|
|
|
|
|
|
|
|
|
|
def cardtext(card):
|
|
|
|
|
cardtext = "<span class=\"cardname\">"
|
|
|
|
@ -1096,10 +1104,7 @@ def indexgen():
|
|
|
|
|
content.write("<h2>faves</h2>\n<p>")
|
|
|
|
|
faveslist = sorted(variables.faves)
|
|
|
|
|
for card in faveslist:
|
|
|
|
|
for thecard in cardlist:
|
|
|
|
|
if card == thecard["name"]:
|
|
|
|
|
content.write(printcard(thecard))
|
|
|
|
|
break
|
|
|
|
|
content.write(printcard(card))
|
|
|
|
|
content.write("</p>\n")
|
|
|
|
|
if len(coupons) > 0:
|
|
|
|
|
content.write("<h2>coupons</h2>\n<p>")
|
|
|
|
@ -1114,26 +1119,43 @@ def indexgen():
|
|
|
|
|
content.write("</p>\n")
|
|
|
|
|
donations = []
|
|
|
|
|
try:
|
|
|
|
|
for deck in variables.donations["decks"]:
|
|
|
|
|
donations.append(deck + "00")
|
|
|
|
|
for donatedeck in variables.donations["decks"]:
|
|
|
|
|
donation = {}
|
|
|
|
|
donation["name"] = donatedeck
|
|
|
|
|
for deck in decklist:
|
|
|
|
|
if deck["name"] == donatedeck:
|
|
|
|
|
if deck["mastered"]:
|
|
|
|
|
donation["type"] = "mastered"
|
|
|
|
|
else:
|
|
|
|
|
donation["type"] = "deck"
|
|
|
|
|
break
|
|
|
|
|
donations.append(donation)
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
try:
|
|
|
|
|
for card in variables.donations["scrapbook"]:
|
|
|
|
|
donations.append(card)
|
|
|
|
|
donation = {}
|
|
|
|
|
donation["name"] = card
|
|
|
|
|
donation["type"] = "single"
|
|
|
|
|
donations.append(donation)
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
if len(donations) > 0:
|
|
|
|
|
donations = sorted(donations)
|
|
|
|
|
donations = sorted(donations, key=lambda d: d["name"])
|
|
|
|
|
content.write("<h2>donations</h2>\n<p>")
|
|
|
|
|
for donation in donations:
|
|
|
|
|
if donation[-2:] == "00":
|
|
|
|
|
content.write("<img src=\"/decks/" + donation[:-2] + "/00.gif\" loading=\"lazy\">")
|
|
|
|
|
else:
|
|
|
|
|
for thecard in cardlist:
|
|
|
|
|
if donation == thecard["name"]:
|
|
|
|
|
content.write(printcard(thecard))
|
|
|
|
|
break
|
|
|
|
|
if donation["type"] == "deck":
|
|
|
|
|
content.write("<img src=\"/decks/" + donation["name"] + "/00.gif\" loading=\"lazy\">")
|
|
|
|
|
elif donation["type"] == "mastered":
|
|
|
|
|
content.write("<img src=\"/decks/" + donation["name"] + "/master.gif\" title=\"mastered " + donation["name"])
|
|
|
|
|
try:
|
|
|
|
|
if donation["name"] in variables.firstmasteries:
|
|
|
|
|
content.write(" (first)\" class=\"first")
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
content.write("\">")
|
|
|
|
|
elif donation["type"] == "single":
|
|
|
|
|
content.write(printcard(donation["name"]))
|
|
|
|
|
content.write("</p>\n")
|
|
|
|
|
content.close()
|
|
|
|
|
footerwrite(thefile)
|
|
|
|
|