From c41a49ecddf7bad8ea83cfe3eb25e0808ebcdb7c Mon Sep 17 00:00:00 2001 From: Mez Date: Mon, 25 Aug 2025 20:35:13 +0100 Subject: [PATCH] Generate lists for completing-read --- .gitignore | 3 +++ generate.py | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/.gitignore b/.gitignore index a6d395c..175f9f2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,10 @@ __pycache__/ +authorscomplete +bookscomplete build/games/* !build/games/*.css !build/games/*.png +gamescomplete secrets.py build/places/* placelist.py diff --git a/generate.py b/generate.py index 432f469..34b29c9 100644 --- a/generate.py +++ b/generate.py @@ -211,6 +211,22 @@ for book in books: if book["author"][0] == "/": book["author"] = "" +bookscomplete = [] +authorscomplete = [] +for book in books: + if len(book["readdates"]) == 0: + if book["author"] != "": + authorscomplete.append(book["author"]) + bookscomplete.append(book["title"]) +bookscomplete = sorted(list(dict.fromkeys(bookscomplete))) +authorscomplete = sorted(list(dict.fromkeys(authorscomplete))) +bcfile = open("bookscomplete","w") +for book in bookscomplete: + bcfile.write(book + "\n") +acfile = open("authorscomplete","w") +for author in authorscomplete: + acfile.write(author + "\n") + for place in places: if place["name"] == "redruth": place["dates"].append("1993-07-01 to 2015-09-09") @@ -271,6 +287,14 @@ writefile.write(" \n \n") games = sorted(games,key=lambda d: d["lastupdate"]) +gamescomplete = [] +for game in games: + gamescomplete.append(game["name"]) +gamescomplete = sorted(list(dict.fromkeys(gamescomplete))) +gcfile = open("gamescomplete","w") +for game in gamescomplete: + gcfile.write(game + "\n") + consoles = [{"code":"ps5","name":"PlayStation 5","shortname":"PS5","img":"PS5"}, {"code":"ps2","name":"PlayStation 2","shortname":"PS2","img":"PS2"}, {"code":"ps3","name":"PlayStation 3","shortname":"PS3","img":"PS3"},