mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 08:17:09 +00:00
Do not fail hard if preplots do not exist.
They might not have been done yet, and it will be obvious to the user if they're not there.
This commit is contained in:
@@ -8,6 +8,7 @@ or modified preplots and (re-)import them into the database.
|
||||
"""
|
||||
|
||||
from glob import glob
|
||||
import sys
|
||||
import configuration
|
||||
import preplots
|
||||
from datastore import Datastore
|
||||
@@ -28,7 +29,12 @@ if __name__ == '__main__':
|
||||
print(f"Preplot: {file['path']}")
|
||||
if not db.file_in_db(file["path"]):
|
||||
print("Importing")
|
||||
preplot = preplots.from_file(file)
|
||||
try:
|
||||
preplot = preplots.from_file(file)
|
||||
except FileNotFoundError:
|
||||
print(f"File does not exist: {file['path']}", file=sys.stderr)
|
||||
continue
|
||||
|
||||
if type(preplot) is list:
|
||||
print("Saving to DB")
|
||||
db.save_preplots(preplot, file["path"], file["class"], survey["epsg"])
|
||||
|
||||
Reference in New Issue
Block a user