Account for card losses, add more tooltips, add player name

master
trémeur 3 weeks ago
parent aaa9504547
commit 457cf368b7

@ -11,13 +11,9 @@ def collectinggen():
content = open(thefile,"a")
content.write("<h1>decks in progress</h1>\n")
decksofinterest = []
for event in log.log:
try:
for card in event["received"]:
if card[0:4] != "sig_":
decksofinterest.append(card[:-2])
except:
pass
for card in tcgcore.ownedcards():
if card[0:4] != "sig_":
decksofinterest.append(card[:-2])
decksofinterest = sorted(list(dict.fromkeys(decksofinterest)))
highpriority = []
medpriority = []

@ -130,7 +130,7 @@ def indexgen():
else:
rank = "red"
rankcode = re.sub(" ","",rank)
content.write("<a href=\"/levels\"><img src=\"/assets/levels/" + rankcode + ".gif\"></a>" + tcgcore.printcard("sig_" + variables.name.lower()) + "\n<ul>\n<li>" + str(len(tcgcore.ownedcards())) + " cards held (" + rank + ")</li>\n<li>started <code>" + firstdate.strftime("%Y-%m-%d") + "</code></li>\n<li>last updated <code>" + datetime.datetime.today().strftime("%Y-%m-%d") + "</code></li>\n<li><a href=\"https://git.praze.net/tre/tcg\">code</a> under construction</li>\n</ul>\n")
content.write("<a href=\"/levels\"><img src=\"/assets/levels/" + rankcode + ".gif\"></a>" + tcgcore.printcard("sig_" + variables.name.lower()) + "\n<ul>\n<li>player name: " + variables.name + "</li>\n<li>" + str(len(tcgcore.ownedcards())) + " cards held (" + rank + ")</li>\n<li>started <code>" + firstdate.strftime("%Y-%m-%d") + "</code></li>\n<li>last updated <code>" + datetime.datetime.today().strftime("%Y-%m-%d") + "</code></li>\n<li><a href=\"https://git.praze.net/tre/tcg\">code</a> under construction</li>\n</ul>\n")
crayred = 0
crayorange = 0
crayyellow = 0
@ -175,21 +175,26 @@ def indexgen():
if crayred + crayorange + crayyellow + craygreen + crayblue + craypurple + craybrown + craygrey > 0:
content.write("<table id=\"crayontable\">\n<tbody>\n<tr>\n")
if crayred > 0:
content.write("<td><img src=\"/assets/crayons/crayon1.gif\" class=\"crayon\"> × " + str(crayred) + "</td>\n")
content.write("<td><img src=\"/assets/crayons/crayon1.gif\" class=\"crayon\" title=\"red\"> × " + str(crayred) + "</td>\n")
if crayorange > 0:
content.write("<td><img src=\"/assets/crayons/crayon2.gif\" class=\"crayon\"> × " + str(crayorange) + "</td>\n")
content.write("<td><img src=\"/assets/crayons/crayon2.gif\" class=\"crayon\" title=\"orange\"> × " + str(crayorange) + "</td>\n")
if crayyellow > 0:
content.write("<td><img src=\"/assets/crayons/crayon3.gif\" class=\"crayon\"> × " + str(crayyellow) + "</td>\n")
content.write("<td><img src=\"/assets/crayons/crayon3.gif\" class=\"crayon\" title=\"yellow\"> × " + str(crayyellow) + "</td>\n")
if craygreen > 0:
content.write("<td><img src=\"/assets/crayons/crayon4.gif\" class=\"crayon\"> × " + str(craygreen) + "</td>\n")
content.write("<td><img src=\"/assets/crayons/crayon4.gif\" class=\"crayon\" title=\"green\"> × " + str(craygreen) + "</td>\n")
if crayblue > 0:
content.write("<td><img src=\"/assets/crayons/crayon5.gif\" class=\"crayon\"> × " + str(crayblue) + "</td>\n")
content.write("<td><img src=\"/assets/crayons/crayon5.gif\" class=\"crayon\" title=\"blue\"> × " + str(crayblue) + "</td>\n")
if craypurple > 0:
content.write("<td><img src=\"/assets/crayons/crayon6.gif\" class=\"crayon\"> × " + str(craypurple) + "</td>\n")
content.write("<td><img src=\"/assets/crayons/crayon6.gif\" class=\"crayon\" title=\"purple\"> × " + str(craypurple) + "</td>\n")
if craybrown > 0:
content.write("<td><img src=\"/assets/crayons/crayon7.gif\" class=\"crayon\"> × " + str(craybrown) + "</td>\n")
content.write("<td><img src=\"/assets/crayons/crayon7.gif\" class=\"crayon\" title=\"brown\"> × " + str(craybrown) + "</td>\n")
if craygrey > 0:
content.write("<td><img src=\"/assets/crayons/crayon8.gif\" class=\"crayon\"> × " + str(craygrey) + "</td>\n")
content.write("<td><img src=\"/assets/crayons/crayon8.gif\" class=\"crayon\" title=\"")
if variables.british:
content.write("grey")
else:
content.write("gray")
content.write("\"> × " + str(craygrey) + "</td>\n")
content.write("</tr>\n</tbody>\n</table>\n")
sigs = []
for card in tcgcore.ownedcards():

@ -10,239 +10,241 @@ def levelsgen():
skel.headerwrite(thefile,"levels")
content = open(thefile,"a")
content.write("<h1>levels</h1>\n")
datecard = {}
cardno = -1
dates = []
for event in log.log:
try:
for card in event["received"]:
cardno += 1
datecard[cardno] = event["date"]
dates.append(event["date"])
except:
pass
firstdate = log.log[0]["date"]
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/red.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + firstdate.strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
try:
for card in event["lost"]:
dates.remove(dates[-1])
except:
pass
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/red.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[0].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/orange.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[100].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/orange.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[100].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/yellow.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[200].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/yellow.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[200].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/green.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[300].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/green.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[300].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/blue.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[400].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/blue.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[400].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/purple.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[500].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/purple.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[500].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/brown.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[600].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/brown.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[600].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/gray.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[700].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/gray.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[700].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/strawberry.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[800].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/strawberry.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[800].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/tangerine.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[1000].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/tangerine.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[1000].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/lemon.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[1200].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/lemon.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[1200].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/lime.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[1400].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/lime.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[1400].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/blueberry.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[1600].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/blueberry.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[1600].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/grape.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[1800].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/grape.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[1800].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/apricot.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[2000].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/apricot.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[2000].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/dragonfruit.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[2200].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/dragonfruit.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[2200].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/ruby.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[2400].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/ruby.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[2400].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/amber.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[2700].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/amber.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[2700].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/gold.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[3000].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/gold.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[3000].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/emerald.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[3300].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/emerald.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[3300].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/sapphire.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[3600].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/sapphire.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[3600].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/amethyst.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[3900].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/amethyst.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[3900].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/bronze.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[5200].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/bronze.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[5200].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/silver.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[4500].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/silver.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[4500].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/sakura.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[4800].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/sakura.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[4800].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/tigerlily.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[5100].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/tigerlily.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[5100].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/daffodil.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[5400].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/daffodil.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[5400].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/clover.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[5700].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/clover.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[5700].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/hydrangea.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[6000].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/hydrangea.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[6000].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/lilac.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[6300].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/lilac.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[6300].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/chocolatecosmos.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[6600].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/chocolatecosmos.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[6600].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/magnolia.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[6900].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/magnolia.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[6900].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/mars.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[7200].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/mars.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[7200].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/saturn.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[7500].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/saturn.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[7500].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/venus.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[7800].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/venus.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[7800].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/earth.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[8100].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/earth.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[8100].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/neptune.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[8400].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/neptune.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[8400].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/uranus.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[8700].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/uranus.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[8700].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/jupiter.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[9000].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/jupiter.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[9000].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/mercury.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[9300].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/mercury.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[9300].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/fire.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[9600].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/fire.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[9600].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/wind.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[9900].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/wind.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[9900].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/light.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[10200].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/light.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[10200].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/nature.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[10500].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/nature.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[10500].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/water.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[10800].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/water.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[10800].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/darkness.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[11100].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/darkness.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[11100].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/ground.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[11400].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/ground.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[11400].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/metal.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[11700].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/metal.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[11700].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/lion.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[12000].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/lion.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[12000].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/tiger.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[12300].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/tiger.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[12300].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/cheetah.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[12600].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/cheetah.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[12600].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/panther.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[12900].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/panther.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[12900].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/russianblue.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[13200].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/russianblue.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[13200].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/chartreux.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[13500].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/chartreux.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[13500].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/puma.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[13800].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/puma.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[13800].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/himalayan.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[14100].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/himalayan.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[14100].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
try:
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/rainbow.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + datecard[14400].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
content.write("<table class=\"level\">\n<tbody>\n<tr>\n<td align=\"center\"><img src=\"/assets/levels/rainbow.gif\"></td>\n</tr>\n<tr>\n<td align=\"center\"><code>" + dates[14400].strftime("%Y-%m-%d") + "</code></td>\n</tr>\n</tbody>\n</table>\n")
except:
pass
content.close()

@ -39,6 +39,28 @@ def loggen():
content.write(", ")
position += 1
content.write(".")
try:
if event["lost"]:
content.write(" ")
except:
try:
if event["crayons"]:
content.write(" ")
except:
pass
except:
pass
try:
if event["lost"]:
content.write("Lost ")
lostlist = sorted(event["lost"])
position = 1
for card in lostlist:
content.write(tcgcore.cardtext(card))
if len(lostlist) != position:
content.write(", ")
position += 1
content.write(".")
try:
if event["crayons"]:
content.write(" ")

@ -2,7 +2,7 @@ import variables
def headerwrite(thefile,pagename):
header = open(thefile,"a")
header.write("<!DOCTYPE html>\n<html lang=\"en\" style=\"--headbg:" + variables.headerbackground + ";\">\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <link rel=\"stylesheet\" href=\"/style.css\">\n <meta name=\"theme-color\" content=\"" + variables.headerbackground + "\">\n <title>TCG :: " + pagename + "</title>\n </head>\n <body>\n <aside>\n \n </aside>\n <nav>\n <ul>\n <li>")
header.write("<!DOCTYPE html>\n<html lang=\"en\" style=\"--headbg:" + variables.headerbackground + ";\">\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <link rel=\"stylesheet\" href=\"/style.css\">\n <meta name=\"theme-color\" content=\"" + variables.headerbackground + "\">\n <title>" + variables.name + "s TCG collection :: " + pagename + "</title>\n </head>\n <body>\n <aside>\n \n </aside>\n <nav>\n <ul>\n <li>")
if pagename == "index":
header.write("home")
else:

@ -1,4 +1,4 @@
import log
import log,variables
def ownedcards():
ownedcards = []
@ -8,33 +8,43 @@ def ownedcards():
ownedcards.append(card)
except:
pass
try:
for card in event["lost"]:
ownedcards.remove(card)
except:
pass
return sorted(ownedcards)
def cardtext(card):
cardtext = "<span class=\"cardname\">"
if card[0:4] == "sig_":
cardtext += "" + card + "</span>"
cardtext += "<span title=\"signature\"></span>" + card + "</span>"
else:
with open("build/decks/" + card[:-2] + "/type") as thetype:
cardtype = thetype.read()
if cardtype == "red":
cardtext += "🔴"
cardtext += "<span title=\"red\">🔴</span>"
elif cardtype == "orange":
cardtext += "🟠"
cardtext += "<span title=\"orange\">🟠</span>"
elif cardtype == "yellow":
cardtext += "🟡"
cardtext += "<span title=\"yellow\">🟡</span>"
elif cardtype == "green":
cardtext += "🟢"
cardtext += "<span title=\"green\">🟢</span>"
elif cardtype == "blue":
cardtext += "🔵"
cardtext += "<span title=\"blue\">🔵</span>"
elif cardtype == "purple":
cardtext += "🟣"
cardtext += "<span title=\"purple\">🟣</span>"
elif cardtype == "brown":
cardtext += "🟤"
cardtext += "<span title=\"brown\">🟤</span>"
elif cardtype == "gray":
cardtext += ""
cardtext += "<span title=\""
if variables.british:
cardtext += "grey"
else:
cardtext += "gray"
cardtext += "\">⚪</span>"
elif cardtype == "special":
cardtext += ""
cardtext += "<span title=\"special\"></span>"
cardtext += card + "</span>"
return cardtext

@ -11,13 +11,9 @@ def wantedgen():
content = open(thefile,"a")
content.write("<h1>wanted cards</h1>\n")
decksofinterest = []
for event in log.log:
try:
for card in event["received"]:
if card[0:4] != "sig_":
decksofinterest.append(card[:-2])
except:
pass
for card in tcgcore.ownedcards():
if card[0:4] != "sig_":
decksofinterest.append(card[:-2])
decksofinterest = sorted(list(dict.fromkeys(decksofinterest)))
wantedcards = []
for deck in decksofinterest:

Loading…
Cancel
Save