Show relevant masteries on mass dack pages, hide numbers for some mass decks
This commit is contained in:
parent
409d6c4893
commit
32da5452ed
3 changed files with 25 additions and 17 deletions
|
@ -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
|
- =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
|
- =ownedpage=: =True= if you want a page displaying your entire collection, =False= otherwise
|
||||||
- =firstmasteries=: a list of decks you mastered first
|
- =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:
|
- Run the following:
|
||||||
#+BEGIN_SRC bash
|
#+BEGIN_SRC bash
|
||||||
python3 setup.py
|
python3 setup.py
|
||||||
|
|
38
massgen.py
38
massgen.py
|
@ -31,21 +31,24 @@ def massindexgen():
|
||||||
content.write("<h1>mass collecting</h1>\n<ul>\n")
|
content.write("<h1>mass collecting</h1>\n<ul>\n")
|
||||||
massindex = 1
|
massindex = 1
|
||||||
for series in massowned:
|
for series in massowned:
|
||||||
totalno = 0
|
content.write("<li><a href=\"/mass/" + str(massindex) + "\">" + series + "</a>")
|
||||||
try:
|
if variables.masscollect[series]["full"] == True:
|
||||||
totalno += len(variables.masscollect[series]["decks"]) * 20
|
totalno = 0
|
||||||
except:
|
try:
|
||||||
pass
|
totalno += len(variables.masscollect[series]["decks"]) * 20
|
||||||
try:
|
except:
|
||||||
totalno += len(variables.masscollect[series]["singles"])
|
pass
|
||||||
except:
|
try:
|
||||||
pass
|
totalno += len(variables.masscollect[series]["singles"])
|
||||||
content.write("<li><a href=\"/mass/" + str(massindex) + "\">" + series + "</a> (")
|
except:
|
||||||
if len(massowned[series]) == totalno:
|
pass
|
||||||
content.write("complete")
|
content.write(" (")
|
||||||
else:
|
if len(massowned[series]) == totalno:
|
||||||
content.write(str(len(massowned[series])) + "/" + str(totalno))
|
content.write("complete")
|
||||||
content.write(")</li>\n")
|
else:
|
||||||
|
content.write(str(len(massowned[series])) + "/" + str(totalno))
|
||||||
|
content.write(")")
|
||||||
|
content.write("</li>\n")
|
||||||
massindex += 1
|
massindex += 1
|
||||||
content.write("</ul>\n")
|
content.write("</ul>\n")
|
||||||
content.close()
|
content.close()
|
||||||
|
@ -67,6 +70,11 @@ def massseriesgen(series,massindex):
|
||||||
themassdecks.append(card[:-2])
|
themassdecks.append(card[:-2])
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
try:
|
||||||
|
if card[:-2] in variables.masscollect[series]["masters"]:
|
||||||
|
themassdecks.append(card[:-2])
|
||||||
|
except:
|
||||||
|
pass
|
||||||
themassdecks = sorted(list(dict.fromkeys(themassdecks)))
|
themassdecks = sorted(list(dict.fromkeys(themassdecks)))
|
||||||
massmastered = []
|
massmastered = []
|
||||||
for deck in themassdecks:
|
for deck in themassdecks:
|
||||||
|
|
|
@ -14,4 +14,4 @@ tradestatement = ""
|
||||||
maxmastered = 20
|
maxmastered = 20
|
||||||
ownedpage = False
|
ownedpage = False
|
||||||
firstmasteries = ["deckname","nameofdeck"]
|
firstmasteries = ["deckname","nameofdeck"]
|
||||||
masscollect = {"series":{"decks":["firstdeck","seconddeck"],"singles":["card01","card02"]}}
|
masscollect = {"series":{"full":True,"decks":["firstdeck","seconddeck"],"singles":["card01","card02"]}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue