summaryrefslogtreecommitdiffstats
path: root/parsers/logbooks.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-02-24 20:21:06 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2023-02-24 20:21:06 +0000
commit3d38611e4f684da4819efa763d99a2df6eb83b15 (patch)
treec72828c9907dd6ba1a85511f70b3ddb3e22b69d3 /parsers/logbooks.py
parentd1dac92034f4bf5a8489ea90f8c66703c92adbec (diff)
downloadtroggle-3d38611e4f684da4819efa763d99a2df6eb83b15.tar.gz
troggle-3d38611e4f684da4819efa763d99a2df6eb83b15.tar.bz2
troggle-3d38611e4f684da4819efa763d99a2df6eb83b15.zip
new test for logbook
Diffstat (limited to 'parsers/logbooks.py')
-rw-r--r--parsers/logbooks.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/parsers/logbooks.py b/parsers/logbooks.py
index 47dd9ba..83a2660 100644
--- a/parsers/logbooks.py
+++ b/parsers/logbooks.py
@@ -56,6 +56,7 @@ DEFAULT_LOGBOOK_PARSER = "parser_html"
LOGBOOK_PARSER_SETTINGS = {
"1982": ("logbook.html", "parser_html"),
}
+LOGBOOKS_DIR = "years" # subfolder of settings.EXPOWEB
ENTRIES = {
"2022": 90,
@@ -97,6 +98,7 @@ ENTRIES = {
"1983": 52,
"1982": 42,
}
+# What about 1970s ! Yes, 80 and 81 are missing, but the older ones need re-parsing !!!
logentries = [] # the entire logbook for one year is a single object: a list of entries
noncaveplaces = ["travel", "Journey", "Loser Plateau", "UNKNOWN", "plateau", "base camp", "basecamp", "top camp", "topcamp"]
@@ -294,7 +296,7 @@ def parser_html(year, expedition, txt, seq=""):
# print(f" - headpara:\n'{headpara}'")
if len(headpara) > 0:
- frontpath = Path(settings.EXPOWEB, "years", year, "frontmatter.html")
+ frontpath = Path(settings.EXPOWEB, LOGBOOKS_DIR, year, "frontmatter.html")
with open(frontpath, "w") as front:
front.write(headpara + "\n")
@@ -304,7 +306,7 @@ def parser_html(year, expedition, txt, seq=""):
# print(f" - endpara:\n'{endpara}'")
if len(endpara) > 0:
- endpath = Path(settings.EXPOWEB, "years", year, "endmatter.html")
+ endpath = Path(settings.EXPOWEB, LOGBOOKS_DIR, year, "endmatter.html")
with open(endpath, "w") as end:
end.write(endpara + "\n")
@@ -511,7 +513,7 @@ def parse_logbook_for_expedition(expedition, blog=False):
logentries = []
logbook_parseable = False
- expologbase = Path(settings.EXPOWEB, "years")
+ expologbase = Path(settings.EXPOWEB, LOGBOOKS_DIR)
year = expedition.year
expect = ENTRIES[year]