2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 07:11:52 +00:00

converting 1988 logboog

This commit is contained in:
Philip Sargent 2022-12-20 21:53:56 +00:00
parent 05df2e084c
commit 5ee3ebad3e
2 changed files with 6 additions and 5 deletions

View File

@ -41,7 +41,7 @@ def import_logbooks():
with transaction.atomic():
troggle.parsers.logbooks.LoadLogbooks()
def import_logbook(year=1987):
def import_logbook(year=1988):
print(f"-- Importing Logbook {year}")
with transaction.atomic():
troggle.parsers.logbooks.LoadLogbook(year)

View File

@ -75,8 +75,9 @@ LOGBOOK_PARSER_SETTINGS = {
"1991": ("log.htm", "parser_html_01"),
"1990": ("log.htm", "parser_html_01"),
"1989": ("log.htm", "parser_html_01"), #crashes MySQL
"1988": ("log.htm", "parser_html_01"), #crashes MySQL
#"1988": ("log.htm", "parser_02"), #crashes MySQL
#"1987": ("log.htm", "parser_02"), #crashes MySQL
"1988": ("logbook.html", "parser_html"),
"1987": ("logbook.html", "parser_html"),
"1985": ("logbook.html", "parser_html"),
"1984": ("logbook.html", "parser_html"),
@ -88,7 +89,7 @@ entries = { "2022": 86, "2019": 56, "2018": 100, "2017": 76, "2016": 83, "2015":
"2014": 65, "2013": 51, "2012": 75, "2011": 68, "2010": 22, "2009": 53,
"2008": 49, "2007": 113, "2006": 60, "2005": 55, "2004": 76, "2003": 42, "2002": 31,
"2001": 48, "2000": 54, "1999": 79, "1998": 43, "1997": 53, "1996": 95, "1995": 42,
"1994": 32, "1993": 41, "1992": 62, "1991": 39, "1990": 87, "1989": 1,"1988": 1,"1987": 34,
"1994": 32, "1993": 41, "1992": 62, "1991": 39, "1990": 87, "1989": 1,"1988": 61,"1987": 34,
"1985": 24, "1984": 32, "1983": 52, "1982": 42,}
# Logbooks log.htm exist for 87, 88, 89 but have no full-working parser, or need hand-editing.
@ -507,7 +508,7 @@ def parser_02(year, expedition, txt, seq=""):
#s = re.match(r"(?i)(?s)\s*(?:<p>)?(.*?)</?p>(.*)$", trippara)
s = re.match(r"(?i)(?s)\s*(<hr[\s/]*>)?.*?<a[^>]*>([\s\S]*?)</a>(.*)$", trippara)
if not s:
message = " ! - Skipping logentry {tid} failure to parse header: " + tid + trippara[:300] + "..."
message = f" ! - Skipping logentry {tid} failure to parse header: " + tid + trippara[:300] + "..."
DataIssue.objects.create(parser='logbooks', message=message)
logdataissues[tid]=message
print(message)
@ -846,7 +847,7 @@ def LoadLogbooks():
noexpo = ["1986", "2020", "2021",] #no expo
lostlogbook = ["1976", "1977", "1978", "1979", "1980", "1981"]
sqlfail = ["1987", "1988", "1989"] # breaks mysql with db constraint fail - debug locally first]
sqlfail = ["1989"] # breaks mysql with db constraint fail - debug locally first]
nologbook = noexpo + lostlogbook + sqlfail
nlbe={}