Automatically class portfolio decks as high priority
This commit is contained in:
parent
a195e97f5c
commit
b1f90124c6
2 changed files with 27 additions and 16 deletions
|
@ -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 aren’t relevant).
|
- For each transaction, add a dictionary ={}= to the =log= list like in the example (removing any of ="received"=, ="lost"=, ="crayons"=, ="decks"= that aren’t 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
|
|
||||||
|
|
22
tcgcore.py
22
tcgcore.py
|
@ -72,6 +72,14 @@ def collecting(deck):
|
||||||
if deck in variables.highpriority:
|
if deck in variables.highpriority:
|
||||||
return True
|
return True
|
||||||
else:
|
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:
|
if deck in medium:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
@ -86,14 +94,20 @@ def priority(deck):
|
||||||
if collecting(deck):
|
if collecting(deck):
|
||||||
if deck in variables.highpriority:
|
if deck in variables.highpriority:
|
||||||
return "high"
|
return "high"
|
||||||
else:
|
elif len(deckcards(deck)) >= variables.highthreshold:
|
||||||
if len(deckcards(deck)) >= variables.highthreshold:
|
|
||||||
return "high"
|
return "high"
|
||||||
else:
|
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:
|
if deck in medium:
|
||||||
return "medium"
|
return "medium"
|
||||||
else:
|
elif len(deckcards(deck)) >= variables.mediumthreshold:
|
||||||
if len(deckcards(deck)) >= variables.mediumthreshold:
|
|
||||||
return "medium"
|
return "medium"
|
||||||
else:
|
else:
|
||||||
return ("low")
|
return ("low")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue