|
|
@ -31,6 +31,36 @@ def deckmastered(deck):
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def datemastered(deck):
|
|
|
|
|
|
|
|
if deckmastered(deck):
|
|
|
|
|
|
|
|
deckdates = []
|
|
|
|
|
|
|
|
for event in log.log:
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
if event["received"]:
|
|
|
|
|
|
|
|
for card in event["received"]:
|
|
|
|
|
|
|
|
if card[:-2] == deck:
|
|
|
|
|
|
|
|
deckdates.append({"card":card,"date":event["date"],"event":"received"})
|
|
|
|
|
|
|
|
except:
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
if event["lost"]:
|
|
|
|
|
|
|
|
for card in event["lost"]:
|
|
|
|
|
|
|
|
if card[:-2] == deck:
|
|
|
|
|
|
|
|
deckdates.append({"card":card,"date":event["date"],"event":"lost"})
|
|
|
|
|
|
|
|
except:
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
cards = {1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0,15:0,16:0,17:0,18:0,19:0,20:0}
|
|
|
|
|
|
|
|
mastered = False
|
|
|
|
|
|
|
|
for event in deckdates:
|
|
|
|
|
|
|
|
if not mastered:
|
|
|
|
|
|
|
|
if event["event"] == "received":
|
|
|
|
|
|
|
|
cards[int(event["card"][-2:])] += 1
|
|
|
|
|
|
|
|
if event["event"] == "lost":
|
|
|
|
|
|
|
|
cards[int(event["card"][-2:])] -= 1
|
|
|
|
|
|
|
|
if cards[1] > 0 and cards[2] > 0 and cards[3] > 0 and cards[4] > 0 and cards[5] > 0 and cards[6] > 0 and cards[7] > 0 and cards[8] > 0 and cards[9] > 0 and cards[10] > 0 and cards[11] > 0 and cards[12] > 0 and cards[13] > 0 and cards[14] > 0 and cards[15] > 0 and cards[16] > 0 and cards[17] > 0 and cards[18] > 0 and cards[19] > 0 and cards[20] > 0:
|
|
|
|
|
|
|
|
mastered = event["date"]
|
|
|
|
|
|
|
|
return mastered
|
|
|
|
|
|
|
|
|
|
|
|
def collecting(deck):
|
|
|
|
def collecting(deck):
|
|
|
|
if len (deckcards(deck)) < 20:
|
|
|
|
if len (deckcards(deck)) < 20:
|
|
|
|
if deck in variables.highpriority:
|
|
|
|
if deck in variables.highpriority:
|
|
|
@ -94,8 +124,12 @@ def printdeck(deck):
|
|
|
|
deckstring = "<table class=\"decktable "
|
|
|
|
deckstring = "<table class=\"decktable "
|
|
|
|
with open("build/decks/" + deck + "/type") as thetype:
|
|
|
|
with open("build/decks/" + deck + "/type") as thetype:
|
|
|
|
decktype = thetype.read()
|
|
|
|
decktype = thetype.read()
|
|
|
|
deckstring += decktype + "\">\n<thead>\n <tr>\n <th colspan=\"5\">" + deck + " ["
|
|
|
|
deckstring += decktype + "\">\n<thead>\n <tr>\n <th colspan=\"5\">" + deck
|
|
|
|
deckstring += str(len(deckcards(deck))) + "/20]</th>\n </tr>\n</thead>\n<tbody>\n"
|
|
|
|
if deckmastered(deck):
|
|
|
|
|
|
|
|
deckstring += " [" + datemastered(deck).strftime("%Y-%m-%d") + "]"
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
deckstring += " [" + str(len(deckcards(deck))) + "/20]"
|
|
|
|
|
|
|
|
deckstring += "</th>\n </tr>\n</thead>\n<tbody>\n"
|
|
|
|
test = 1
|
|
|
|
test = 1
|
|
|
|
while test < 21:
|
|
|
|
while test < 21:
|
|
|
|
if test % 5 == 1:
|
|
|
|
if test % 5 == 1:
|
|
|
|