From 0a684cd02a7527bb9ac5ae896c84756043f9cf91 Mon Sep 17 00:00:00 2001 From: "D. Berge" Date: Sun, 4 Oct 2020 03:41:20 +0200 Subject: [PATCH] Add option to import file data for preplot files --- bin/datastore.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/datastore.py b/bin/datastore.py index 4f33648..ddad3fc 100644 --- a/bin/datastore.py +++ b/bin/datastore.py @@ -186,7 +186,7 @@ class Datastore: # We do not commit if we've been passed a cursor, instead # we assume that we are in the middle of a transaction - def save_preplots(self, lines, filepath, preplot_class, epsg = 0): + def save_preplots(self, lines, filepath, preplot_class, epsg = 0, filedata = None): """ Save preplot data. @@ -246,6 +246,9 @@ class Datastore: cursor.executemany(qry, points) + if filedata is not None: + self.save_file_data(filepath, json.dumps(filedata), cursor) + self.maybe_commit() def save_raw_p190(self, records, fileinfo, filepath, epsg = 0, filedata = None, ntbp = False):