diff --git a/bin/import_preplots.py b/bin/import_preplots.py index f6e0356..273e50b 100755 --- a/bin/import_preplots.py +++ b/bin/import_preplots.py @@ -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"])