diff options
author | Martin Green <martin.speleo@gmail.com> | 2023-07-24 23:03:47 +0100 |
---|---|---|
committer | Martin Green <martin.speleo@gmail.com> | 2023-07-24 23:03:47 +0100 |
commit | 8463f8947e8f5743f750d2434309ba23464781a3 (patch) | |
tree | 4191e2e0eaadb787d30977cbb2b495ac1edac632 /parsers/logbooks.py | |
parent | 380565c6f51cf413167416a69f75026e01056cfc (diff) | |
parent | 31c815eeb02cce67c5c5586c7a2573c9a3c93eff (diff) | |
download | troggle-8463f8947e8f5743f750d2434309ba23464781a3.tar.gz troggle-8463f8947e8f5743f750d2434309ba23464781a3.tar.bz2 troggle-8463f8947e8f5743f750d2434309ba23464781a3.zip |
Merge branch 'master' of ssh://expo.survex.com/home/expo/troggle
Diffstat (limited to 'parsers/logbooks.py')
-rw-r--r-- | parsers/logbooks.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/parsers/logbooks.py b/parsers/logbooks.py index e701183..84d0f5a 100644 --- a/parsers/logbooks.py +++ b/parsers/logbooks.py @@ -57,7 +57,7 @@ LOGBOOK_PARSER_SETTINGS = { LOGBOOKS_DIR = "years" # subfolder of settings.EXPOWEB ENTRIES = { - "2023": 27, + "2023": 32, "2022": 90, "2019": 55, "2018": 95, @@ -305,8 +305,8 @@ def parser_html(year, expedition, txt, seq=""): endmatch = re.match(r"(?i)(?s).*<hr\s*/>([\s\S]*?)(?=</body)", txt) endpara = endmatch.groups()[0].strip() - #print(f" - endpara:\n'{endpara}'") if len(endpara) > 0: + print(f"\n - {year} endpara:\n'{endpara}'") endpath = Path(settings.EXPOWEB, LOGBOOKS_DIR, year, "endmatter.html") with open(endpath, "w") as end: end.write(endpara + "\n") @@ -560,7 +560,8 @@ def parse_logbook_for_expedition(expedition, blog=False): if logbook_parseable: # -------------------- parser = globals()[parsefunc] - print(f" - {year} parsing with {parsefunc} - {lb}") + # print(f" - {year} parsing with {parsefunc} - {lb}") + print(" .", end="") logentries = parser(year, expedition, txt, sq) # this launches the right parser # -------------------- @@ -665,7 +666,7 @@ def LoadLogbooks(): logentries = parse_logbook_for_expedition(b, blog=True) # loads the blog logbook for one expo allentries += logentries - print(f"total {len(allentries):,} log entries parsed in all expeditions") + print(f"\n - {len(allentries):,} log entries parsed in all expeditions") mem = get_process_memory() print(f" - MEM: {mem:7.2f} MB in use, {mem-mem1:7.2f} MB more", file=sys.stderr) duration = time.time() - start @@ -682,6 +683,7 @@ def LoadLogbooks(): for expo in expos: expo.save() # to save logbook name property mem = get_process_memory() + print(f" - {len(allentries):,} log entries saved into database") print(f" - MEM: {mem:7.2f} MB in use, {mem-mem1:7.2f} MB more", file=sys.stderr) duration = time.time() - start print(f" - TIME: {duration:7.2f} s", file=sys.stderr) |