From 008c3c1c39b2594f8085c407a76bc7a6710266a1 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sun, 26 Apr 2020 23:36:25 +0100 Subject: [PATCH] 2016 second --- noinfo/walletscripts/make.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/noinfo/walletscripts/make.py b/noinfo/walletscripts/make.py index 1524c75c5..ff6c2c592 100644 --- a/noinfo/walletscripts/make.py +++ b/noinfo/walletscripts/make.py @@ -1,9 +1,10 @@ #!/usr/bin/env python import os, operator, urllib, json, re + loser_dir = "/home/expo/loser" html_base = "%(body)s" -html_year_index = html_base % {"body": "

2015 surveys

Persons

Wallets

%(wallets)s

Needing Scanning

Website needing updating

"} +html_year_index = html_base % {"body": "

%(year)s surveys

Persons

Wallets

%(wallets)s

Needing Scanning

Website needing updating

"} html_year_person = "
  • %(person)s
  • " html_year_wallet_entry = "%(walletname)s %(cave)s %(name)s %(complaints)s" html_person_wallet_entry = "
  • %(walletname)s
  • " @@ -43,6 +44,9 @@ wallets_needing_scanning = set() website_needing_updating = set() people = {} +#use dir this file is in to get current year +path,year = os.path.split(os.path.dirname(os.path.realpath(__file__))) + for item in os.listdir("."): if os.path.isdir(item): files = [] @@ -55,6 +59,7 @@ for item in os.listdir("."): json.dump(blank_json, json_file, indent = 1) json_file.close() json_file = open(contents_path) + print json_file data = json.load(json_file) json_file.close() write_required = False @@ -192,7 +197,7 @@ for person, person_wallets in people.items(): person_summary = dict(person_summary) year_index_file = open("index.html", "w") -year_index_file.write(html_year_index % {"persons": reduce(operator.add, [html_year_person % {"person": person, +year_index_file.write(html_year_index % {"year": year, "persons": reduce(operator.add, [html_year_person % {"person": person, "complaints": reduce(operator.add, [html_complaint_items % {"complaint": complaint, "count": count}