Automatically class portfolio decks as high priority

master
trémeur 1 month ago
parent a195e97f5c
commit b1f90124c6

@ -44,7 +44,4 @@ Python scripts to generate a mobile-friendly static site for tracking tcg cards
- For each transaction, add a dictionary ={}= to the =log= list like in the example (removing any of ="received"=, ="lost"=, ="crayons"=, ="decks"= that arent relevant).
- Run =./build.sh= in this directory to download the relevant card images and then upload everything to the server.
** Currently unaccounted for
- Duplicates (should be fine but not checked)
- Coupons
- Card search
- Date to level needs redone

@ -72,13 +72,21 @@ def collecting(deck):
if deck in variables.highpriority:
return True
else:
if deck in medium:
return True
else:
if len(deckcards(deck)) < variables.collectthreshold:
return False
else:
portfoliocollecting = False
for event in log.log:
if portfoliocollecting == False:
if event["event"] == "portfolio":
if deck in event["decks"]:
portfoliocollecting = True
return True
if portfoliocollecting == False:
if deck in medium:
return True
else:
if len(deckcards(deck)) < variables.collectthreshold:
return False
else:
return True
else:
return False
@ -86,17 +94,23 @@ def priority(deck):
if collecting(deck):
if deck in variables.highpriority:
return "high"
elif len(deckcards(deck)) >= variables.highthreshold:
return "high"
else:
if len(deckcards(deck)) >= variables.highthreshold:
return "high"
else:
portfoliopriority = False
for event in log.log:
if portfoliopriority == False:
if event["event"] == "portfolio":
if deck in event["decks"]:
portfoliopriority = True
return "high"
if portfoliopriority == False:
if deck in medium:
return "medium"
elif len(deckcards(deck)) >= variables.mediumthreshold:
return "medium"
else:
if len(deckcards(deck)) >= variables.mediumthreshold:
return "medium"
else:
return ("low")
return ("low")
def cardtype(card):
with open("build/decks/" + card[:-2] + "/type") as thetype:

Loading…
Cancel
Save