Generate lists for completing-read
This commit is contained in:
parent
6208ba6644
commit
c41a49ecdd
2 changed files with 27 additions and 0 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,7 +1,10 @@
|
|||
__pycache__/
|
||||
authorscomplete
|
||||
bookscomplete
|
||||
build/games/*
|
||||
!build/games/*.css
|
||||
!build/games/*.png
|
||||
gamescomplete
|
||||
secrets.py
|
||||
build/places/*
|
||||
placelist.py
|
||||
|
|
24
generate.py
24
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(" </script>\n </body>\n</html>")
|
|||
|
||||
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"},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue