Show relevant masteries on mass dack pages, hide numbers for some mass decks

master
trémeur 3 weeks ago
parent 409d6c4893
commit 32da5452ed

@ -32,7 +32,7 @@ Python scripts to generate a mobile-friendly static site for tracking tcg cards
- =maxmastered=: maximum number of most recently mastered decks to show on the index page
- =ownedpage=: =True= if you want a page displaying your entire collection, =False= otherwise
- =firstmasteries=: a list of decks you mastered first
- =masscollect=: list (python dict) of series/themes being mass collected, each containing a dict which contains at least one of ="decks"= specifying a list of decks, or ="singles"= specifying a list of individual cards
- =masscollect=: list (python dict) of series/themes being mass collected, each containing a dict which specifies =“full”= as either =True= or =False= (to show or hide a list of the total number of cards in the set) and contains at least one of ="decks"= specifying a list of decks, or ="singles"= specifying a list of individual cards
- Run the following:
#+BEGIN_SRC bash
python3 setup.py

@ -31,6 +31,8 @@ def massindexgen():
content.write("<h1>mass collecting</h1>\n<ul>\n")
massindex = 1
for series in massowned:
content.write("<li><a href=\"/mass/" + str(massindex) + "\">" + series + "</a>")
if variables.masscollect[series]["full"] == True:
totalno = 0
try:
totalno += len(variables.masscollect[series]["decks"]) * 20
@ -40,12 +42,13 @@ def massindexgen():
totalno += len(variables.masscollect[series]["singles"])
except:
pass
content.write("<li><a href=\"/mass/" + str(massindex) + "\">" + series + "</a> (")
content.write(" (")
if len(massowned[series]) == totalno:
content.write("complete")
else:
content.write(str(len(massowned[series])) + "/" + str(totalno))
content.write(")</li>\n")
content.write(")")
content.write("</li>\n")
massindex += 1
content.write("</ul>\n")
content.close()
@ -67,6 +70,11 @@ def massseriesgen(series,massindex):
themassdecks.append(card[:-2])
except:
pass
try:
if card[:-2] in variables.masscollect[series]["masters"]:
themassdecks.append(card[:-2])
except:
pass
themassdecks = sorted(list(dict.fromkeys(themassdecks)))
massmastered = []
for deck in themassdecks:

@ -14,4 +14,4 @@ tradestatement = ""
maxmastered = 20
ownedpage = False
firstmasteries = ["deckname","nameofdeck"]
masscollect = {"series":{"decks":["firstdeck","seconddeck"],"singles":["card01","card02"]}}
masscollect = {"series":{"full":True,"decks":["firstdeck","seconddeck"],"singles":["card01","card02"]}}

Loading…
Cancel
Save