pending
" deckstring += "\n" if test % 5 == 0: deckstring += " \n" @@ -1126,7 +1074,10 @@ def indexgen(): content.write("") faveslist = sorted(variables.faves) for card in faveslist: - content.write(printcard(card)) + for thecard in cardlist: + if card == thecard["name"]: + content.write(printcard(thecard)) + break content.write("
\n") if len(coupons) > 0: content.write("") @@ -1141,43 +1092,26 @@ def indexgen(): content.write("
\n") donations = [] try: - 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) + for deck in variables.donations["decks"]: + donations.append(deck + "00") except: pass try: for card in variables.donations["scrapbook"]: - donation = {} - donation["name"] = card - donation["type"] = "single" - donations.append(donation) + donations.append(card) except: pass if len(donations) > 0: - donations = sorted(donations, key=lambda d: d["name"]) + donations = sorted(donations) content.write("")
for donation in donations:
- if donation["type"] == "deck":
- content.write("")
- elif donation["type"] == "mastered":
- content.write("
")
- elif donation["type"] == "single":
- content.write(printcard(donation["name"]))
+ if donation[-2:] == "00":
+ content.write("
")
+ else:
+ for thecard in cardlist:
+ if donation == thecard["name"]:
+ content.write(printcard(thecard))
+ break
content.write("