diff options
Diffstat (limited to 'parsers/logbooks.py')
-rw-r--r-- | parsers/logbooks.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/parsers/logbooks.py b/parsers/logbooks.py index 5ebc671..e91c69e 100644 --- a/parsers/logbooks.py +++ b/parsers/logbooks.py @@ -581,14 +581,14 @@ def LoadLogbookForExpedition(expedition, expect): cleanerrors(expedition.year) if expedition.year in yearlinks: - logbookfile = os.path.join(expologbase, yearlinks[expedition.year][0]) + logbookpath = Path(expologbase) / expedition.year / yearlinks[expedition.year][0] expedition.logbookfile = yearlinks[expedition.year][0] parsefunc = yearlinks[expedition.year][1] else: - logbookfile = os.path.join(expologbase, expedition.year, settings.DEFAULT_LOGBOOK_FILE) + logbookpath = os.path.join(expologbase, expedition.year, settings.DEFAULT_LOGBOOK_FILE) expedition.logbookfile = settings.DEFAULT_LOGBOOK_FILE parsefunc = settings.DEFAULT_LOGBOOK_PARSER - cache_filename = Path(logbookfile + ".cache") + cache_filename = Path(str(logbookpath) + ".cache") if not cache_filename.is_file(): print(" - Cache file does not exist \"" + str(cache_filename) +"\"") @@ -599,7 +599,7 @@ def LoadLogbookForExpedition(expedition, expect): bad_cache = False # temporarily disable reading the cache - buggy try: cache_t = os.path.getmtime(cache_filename) - if os.path.getmtime(logbookfile) - cache_t > 2: # at least 2 secs later + if os.path.getmtime(logbookpath) - cache_t > 2: # at least 2 secs later print(" - ! Cache is older than the logbook file") bad_cache= True if now - cache_t > 30*24*60*60: @@ -629,13 +629,13 @@ def LoadLogbookForExpedition(expedition, expect): except : print(" - Cache de-pickle failure \"" + str(cache_filename) +"\"") try: - file_in = open(logbookfile,'rb') + file_in = open(logbookpath,'rb') txt = file_in.read().decode("latin1") file_in.close() logbook_parseable = True except (IOError): logbook_parseable = False - print((" ! Couldn't open logbook " + logbookfile)) + print((" ! Couldn't open logbook " + logbookpath)) if logbook_parseable: parser = globals()[parsefunc] |