This commit is contained in:
Philip Sargent 2022-08-25 16:12:13 +03:00
parent 760abe1a9e
commit 79672dd4b3

View File

@ -317,9 +317,10 @@ def Parseloghtmltxt(year, expedition, txt):
\s*(?:<div\s+class="timeug">\s*(.*?)</div>)? \s*(?:<div\s+class="timeug">\s*(.*?)</div>)?
\s*$ \s*$
''', trippara) ''', trippara)
if s:
tripid, tripid1, tripdate, trippeople, triptitle, triptext, tu = s.groups() tripid, tripid1, tripdate, trippeople, triptitle, triptext, tu = s.groups()
if not s: # allow title and people to be swapped in order else: # allow title and people to be swapped in order
s = re.match(r'''(?x)(?:\s*<div\sclass="tripdate"\sid=".*?">.*?</div>\s*<p>)? # second date s2 = re.match(r'''(?x)(?:\s*<div\sclass="tripdate"\sid=".*?">.*?</div>\s*<p>)? # second date
\s*(?:<a\s+id="(.*?)"\s*/>\s*</a>)? \s*(?:<a\s+id="(.*?)"\s*/>\s*</a>)?
\s*<div\s+class="tripdate"\s*(?:id="(.*?)")?>(.*?)</div>(?:<p>)? \s*<div\s+class="tripdate"\s*(?:id="(.*?)")?>(.*?)</div>(?:<p>)?
\s*<div\s+class="triptitle">\s*(.*?)</div> \s*<div\s+class="triptitle">\s*(.*?)</div>
@ -328,9 +329,9 @@ def Parseloghtmltxt(year, expedition, txt):
\s*(?:<div\s+class="timeug">\s*(.*?)</div>)? \s*(?:<div\s+class="timeug">\s*(.*?)</div>)?
\s*$ \s*$
''', trippara) ''', trippara)
tripid, tripid1, tripdate, triptitle, trippeople, triptext, tu = s.groups() if s2:
tripid, tripid1, tripdate, triptitle, trippeople, triptext, tu = s2.groups()
if not s: else:
if not re.search(r"Rigging Guide", trippara): if not re.search(r"Rigging Guide", trippara):
msg = " !- Logbook. Can't parse: {} entry:{}".format(trippara, logbook_entry_count) msg = " !- Logbook. Can't parse: {} entry:{}".format(trippara, logbook_entry_count)
print(msg) print(msg)