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). - 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. - Run =./build.sh= in this directory to download the relevant card images and then upload everything to the server.
** Currently unaccounted for ** Currently unaccounted for
- Duplicates (should be fine but not checked)
- Coupons - Coupons
- Card search
- Date to level needs redone

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

Loading…
Cancel
Save