Add functions for showing card or deck details, proposing trades; correct priority for scrapbook singles

This commit is contained in:
mez 2025-05-20 07:42:27 +01:00
parent aee8f5e122
commit b7f628944d
5 changed files with 184 additions and 9 deletions

View file

@ -89,16 +89,19 @@ for event in log.log:
thecard["name"] = card
thecard["received"] = event["date"]
thecard["mass"] = []
thecard["priority"] = 0
if card[0:4] != "sig_":
for theme in variables.masscollect:
try:
if thedeck in variables.masscollect[theme]["decks"]:
thecard["mass"].append(theme)
thecard["priority"] = 3
except KeyError:
pass
try:
if card in variables.masscollect[theme]["singles"]:
thecard["mass"].append(theme)
thecard["priority"] = 2
except KeyError:
pass
if card[0:4] == "sig_":
@ -119,12 +122,13 @@ for event in log.log:
else:
thecard["priority"] = 1
else:
if thedeck in variables.highpriority:
thecard["priority"] = 1
elif len(thecard["mass"]) > 0:
thecard["priority"] = 3
else:
thecard["priority"] = 4
if thecard["priority"] == 0:
if thedeck in variables.highpriority:
thecard["priority"] = 1
elif len(thecard["mass"]) > 0:
thecard["priority"] = 3
else:
thecard["priority"] = 4
cardlist.append(thecard)
datelist.append(event["date"])
receivedcards.append(thecard)
@ -1148,7 +1152,7 @@ def indexgen():
if len(variables.subfolder) > 0:
content.write("/" + variables.subfolder)
content.write("/assets/banner.png\" loading=\"lazy\">")
content.write("\n<ul>\n<li>player name: <span class=\"name\">" + variables.name + "</span></li>\n<li>" + str(len(cardlist) + tradepend) + " cards held <span class=\"rank " + rank + "\">(" + rank + ")</span></li>\n<li>" + str(tradepend) + " cards pending trade</li>\n<li>started <code>" + firstdate.strftime("%Y-%m-%d") + "</code></li>\n<li>last updated <code>" + datetime.datetime.now().strftime("%Y-%m-%d") + "</code></li>\n<li><a href=\"https://git.praze.net/tre/tcg\" target=\"_blank\">code</a> ")
content.write("\n<ul>\n<li>player name: <span class=\"name\">" + variables.name + "</span></li>\n<li>" + str(len(cardlist) + tradepend) + " cards <span class=\"rank " + rank + "\">(" + rank + ")</span></li>\n<li>" + str(tradepend) + " cards held for trades</li>\n<li>started <code>" + firstdate.strftime("%Y-%m-%d") + "</code></li>\n<li>last updated <code>" + datetime.datetime.now().strftime("%Y-%m-%d") + "</code></li>\n<li><a href=\"https://git.praze.net/tre/tcg\" target=\"_blank\">code</a> ")
if variables.name == "Mez":
content.write("under construction")
else: