From 12d3357dbd16cf396356bbe2d0968dde51a0c373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?tr=C3=A9meur?= Date: Sun, 8 Dec 2024 11:38:19 +0000 Subject: [PATCH] Make owned cards page optional --- README.org | 1 + generate.py | 9 +++++---- skel.py | 15 +++++++++------ variables-template.py | 1 + 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/README.org b/README.org index 66ad56b..8e4135b 100644 --- a/README.org +++ b/README.org @@ -30,6 +30,7 @@ Python scripts to generate a mobile-friendly static site for tracking tcg cards - =keepsig=: =True= if you always want to keep one copy of your signature, =False= if you want to make them all available for trading - =tradestatement=: statement to place on your trading page - =maxmastered=: maximum number of most recently mastered decks to show on the index page + - =ownedpage=: =True= if you want a page displaying your entire collection, =False= otherwise - =masscollect=: list (python dict) of series/themes being mass collected and which decks to include in each one - Run the following: #+BEGIN_SRC bash diff --git a/generate.py b/generate.py index 8a8db3d..af77d4f 100644 --- a/generate.py +++ b/generate.py @@ -1,5 +1,5 @@ import sys -import download,indexgen,collectinggen,ownedgen,wantedgen,loggen,levelsgen,tradegen,masteredgen,portfoliosgen,searchgen,massgen +import download,indexgen,collectinggen,ownedgen,wantedgen,loggen,levelsgen,tradegen,masteredgen,portfoliosgen,searchgen,massgen,variables print("Checking for new decks … ",end="") sys.stdout.flush() @@ -13,9 +13,10 @@ massgen.massall() print(" done\nBuilding mass decks pages …",end="") sys.stdout.flush() collectinggen.collectingall() -print(" done\nBuilding owned page …",end="") -sys.stdout.flush() -ownedgen.ownedall() +if variables.ownedpage: + print(" done\nBuilding owned page …",end="") + sys.stdout.flush() + ownedgen.ownedall() print(" done\nBuilding wanted page …",end="") sys.stdout.flush() wantedgen.wantedgen() diff --git a/skel.py b/skel.py index bfbd054..d2caa18 100644 --- a/skel.py +++ b/skel.py @@ -22,12 +22,15 @@ def headerwrite(thefile,pagename): header.write("mastered") else: header.write("mastered") - header.write("\n
  • ") - if pagename == "owned": - header.write("owned") - else: - header.write("owned") - header.write("
  • \n
  • ") + header.write("
  • \n") + if variables.ownedpage: + header.write("
  • ") + if pagename == "owned": + header.write("owned") + else: + header.write("owned") + header.write("
  • \n") + header.write("
  • ") if pagename == "trade": header.write("trading") else: diff --git a/variables-template.py b/variables-template.py index 82afa3e..d563f7b 100644 --- a/variables-template.py +++ b/variables-template.py @@ -12,4 +12,5 @@ highthreshold = 10 keepsig = False tradestatement = "" maxmastered = 20 +ownedpage = False masscollect = {"series":["firstdeck","seconddeck"]}