diff --git a/.gitignore b/.gitignore index a967458..8857b56 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ build/decks/*/*.gif build/decks/*/type build/assets/header.png build/assets/levels/*.gif +build/assets/sketch/*.gif __pycache__/ variables.py log.py diff --git a/README.org b/README.org index e1b76f5..cd95797 100644 --- a/README.org +++ b/README.org @@ -33,13 +33,13 @@ Python scripts to generate a mobile-friendly static site for tracking tcg cards chmod +x build.sh #+END_SRC - Save a header image to =build/assets/header.png= +- Save each stage of a filled sketchpad to =build/assets/sketch/=, as =00.gif=, =01.gif=, etc. - Add level images manually to =build/assets/levels/= - Add custom CSS to =build/user.css= *** Updating and building - For each transaction, add a dictionary ={}= to the =log= list like in the example (removing any of ="received"=, ="lost"=, ="crayons"= that aren’t relevant). - Run =./build.sh= in this directory to download the relevant card images and then upload everything to the server. ** Currently unaccounted for -- Sketchpads - Portfolios - Duplicates - Masteries diff --git a/build/assets/sketch/.gitkeep b/build/assets/sketch/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/indexgen.py b/indexgen.py index bcac4e0..1e209fa 100644 --- a/indexgen.py +++ b/indexgen.py @@ -196,6 +196,35 @@ def indexgen(): content.write("gray") content.write("\"> × " + str(craygrey) + "\n") content.write("\n\n\n") + tradeout = [] + tradein = [] + for event in log.log: + if event["event"][0:11] == "trade with ": + try: + for card in event["lost"]: + tradeout.append(event["event"]) + except: + pass + try: + for card in event["received"]: + tradein.append(event["event"]) + except: + pass + tradecommon = list(set(tradeout).intersection(tradein)) + sketch = len(tradecommon) + if sketch > 0: + content.write("
\n") + if sketch > 19: + content.write(" | \n") + content.write(" |
" + str(sketch % 20) + "/20 | \n") + if sketch > 19: + content.write("" + str(int(sketch / 20)) + " completed | \n") + content.write("